summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vom/neighbour.hpp
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2017-11-23 12:15:00 -0800
committerNeale Ranns <nranns@cisco.com>2017-11-24 14:04:48 +0000
commitfd920609819a5b10d3d7c8d34fe4fa4214c7da22 (patch)
treefb0b5c3b5a9ba56308ef704ef922e959aafad17f /src/vpp-api/vom/neighbour.hpp
parent227bf211ab65e7aed6862fc881cc949c342200fd (diff)
VOM: Additions to allow uses to UT applications that use VOM
- find object by key - compare objects Change-Id: I36ec8612be9482bcef7ceced2a59f7403f77b3e8 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vpp-api/vom/neighbour.hpp')
-rw-r--r--src/vpp-api/vom/neighbour.hpp41
1 files changed, 24 insertions, 17 deletions
diff --git a/src/vpp-api/vom/neighbour.hpp b/src/vpp-api/vom/neighbour.hpp
index 85577f077a9..500f03d0a61 100644
--- a/src/vpp-api/vom/neighbour.hpp
+++ b/src/vpp-api/vom/neighbour.hpp
@@ -22,26 +22,23 @@
namespace VOM {
/**
- * A entry in the ARP termination table of a Bridge Domain
+ * A entry in the neighbour entry (ARP or IPv6 ND)
*/
class neighbour : public object_base
{
public:
/**
- * The key for a bridge_domain ARP entry;
- * the BD, IP address and MAC address
+ * The key for a neighbour entry;
+ * the interface and IP address
*/
- typedef std::tuple<interface::key_type,
- mac_address_t,
- boost::asio::ip::address>
- key_t;
+ typedef std::pair<interface::key_t, boost::asio::ip::address> key_t;
/**
* Construct an ARP entry
*/
neighbour(const interface& itf,
- const mac_address_t& mac,
- const boost::asio::ip::address& ip_addr);
+ const boost::asio::ip::address& ip_addr,
+ const mac_address_t& mac);
/**
* Copy Construct
@@ -54,17 +51,27 @@ public:
~neighbour();
/**
+ * Return the object's key
+ */
+ const key_t key() const;
+
+ /**
+ * Comparison operator
+ */
+ bool operator==(const neighbour& n) const;
+
+ /**
* Return the matching 'singular instance'
*/
std::shared_ptr<neighbour> singular() const;
/**
- * Find the instnace of the bridge_domain domain in the OM
+ * Find the neighbour fromits key
*/
- static std::shared_ptr<neighbour> find(const neighbour& temp);
+ static std::shared_ptr<neighbour> find(const key_t& k);
/**
- * Dump all bridge_domain-doamin into the stream provided
+ * Dump all neighbours into the stream provided
*/
static void dump(std::ostream& os);
@@ -127,7 +134,7 @@ private:
const l3_proto_t& proto);
/**
- * Find or add the instnace of the bridge_domain domain in the OM
+ * Find or add the instnace of the neighbour in the OM
*/
static std::shared_ptr<neighbour> find_or_add(const neighbour& temp);
@@ -157,14 +164,14 @@ private:
std::shared_ptr<interface> m_itf;
/**
- * The mac to match
+ * The IP address
*/
- mac_address_t m_mac;
+ boost::asio::ip::address m_ip_addr;
/**
- * The IP address
+ * The mac to match
*/
- boost::asio::ip::address m_ip_addr;
+ mac_address_t m_mac;
/**
* A map of all bridge_domains