summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vom/lldp_binding.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vpp-api/vom/lldp_binding.cpp')
-rw-r--r--src/vpp-api/vom/lldp_binding.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/vpp-api/vom/lldp_binding.cpp b/src/vpp-api/vom/lldp_binding.cpp
index 05d51bbf0b1..a1d3d9f57ba 100644
--- a/src/vpp-api/vom/lldp_binding.cpp
+++ b/src/vpp-api/vom/lldp_binding.cpp
@@ -20,7 +20,7 @@ namespace VOM {
/**
* A DB of all LLDP configs
*/
-singular_db<interface::key_type, lldp_binding> lldp_binding::m_db;
+singular_db<interface::key_t, lldp_binding> lldp_binding::m_db;
lldp_binding::event_handler lldp_binding::m_evh;
@@ -46,6 +46,18 @@ lldp_binding::~lldp_binding()
m_db.release(m_itf->key(), this);
}
+bool
+lldp_binding::operator==(const lldp_binding& l) const
+{
+ return ((key() == l.key()) && (m_port_desc == l.m_port_desc));
+}
+
+const lldp_binding::key_t&
+lldp_binding::key() const
+{
+ return (m_itf->key());
+}
+
void
lldp_binding::sweep()
{
@@ -99,6 +111,12 @@ lldp_binding::find_or_add(const lldp_binding& temp)
}
std::shared_ptr<lldp_binding>
+lldp_binding::find(const key_t& k)
+{
+ return (m_db.find(k));
+}
+
+std::shared_ptr<lldp_binding>
lldp_binding::singular() const
{
return find_or_add(*this);