20 namespace neighbour_cmds {
37 return ((m_mac == other.m_mac) && (m_ip_addr == other.m_ip_addr) &&
38 (m_itf == other.m_itf) && (m_flags == other.m_flags));
44 msg_t req(con.
ctx(), std::ref(*
this));
46 auto& payload = req.get_request().get_payload();
48 payload.neighbor.sw_if_index = m_itf.
value();
50 to_api(m_mac, payload.neighbor.mac_address);
51 to_api(m_ip_addr, payload.neighbor.ip_address);
52 payload.neighbor.flags =
to_api(m_flags);
65 <<
" ip:" << m_ip_addr.to_string();
86 return ((m_mac == other.m_mac) && (m_ip_addr == other.m_ip_addr) &&
87 (m_itf == other.m_itf));
93 msg_t req(con.
ctx(), std::ref(*
this));
95 auto& payload = req.get_request().get_payload();
97 payload.neighbor.sw_if_index = m_itf.
value();
99 to_api(m_mac, payload.neighbor.mac_address);
100 to_api(m_ip_addr, payload.neighbor.ip_address);
101 payload.neighbor.flags =
to_api(m_flags);
114 std::ostringstream s;
117 <<
" ip:" << m_ip_addr.to_string();
145 auto& payload =
m_dump->get_request().get_payload();
146 payload.sw_if_index = m_itf.
value();
147 payload.is_ipv6 = m_proto.
is_ipv6();
159 std::ostringstream s;
static const rc_t NOOP
The HW write/update action was/has not been attempted.
delete_cmd(HW::item< bool > &item, handle_t itf, const mac_address_t &mac, const boost::asio::ip::address &ip_addr, const neighbour::flags_t &flags)
Constructor.
bool operator==(const delete_cmd &i) const
Comparison operator - only used for UT.
A cmd class that deletes a bridge domain ARP entry.
uint32_t value() const
get the value of the handle
Error codes that VPP will return during a HW write.
create_cmd(HW::item< bool > &item, handle_t itf, const mac_address_t &mac, const boost::asio::ip::address &ip_addr, const neighbour::flags_t &flags)
Constructor.
An L3 protocol can be used to construct a prefix that is used to match packets are part of a route...
vapi::Ip_neighbor_dump msg_t
vapi_enum_ip_neighbor_flags to_api(const neighbour::flags_t &f)
rc_t wait()
Wait on the commands promise.
std::string to_string() const
convert to string format for debug purposes
bool operator==(const create_cmd &i) const
Comparison operator - only used for UT.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A representation of the connection to VPP.
dump_cmd()
Default Constructor.
A base class for all RPC commands to VPP.
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
std::string to_string() const
convert to string format for debug purposes
A type declaration of an interface handle in VPP.
const std::string & to_string() const
convert to string format for debug purposes
std::string to_string() const
convert to string format for debug purposes
static const rc_t OK
The HW write was successfull.
rc_t issue(connection &con)
Issue the command to VPP/HW.
rc_t wait()
Wait for the issue of the command to complete.
A cmd class that Dumps all the neighbours.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
std::string to_string() const
String conversion.
std::string to_string() const
convert to string format for debug purposes
The VPP Object Model (VOM) library.
A command class that creates or updates the bridge domain ARP Entry.
void set(const rc_t &rc)
Set the HW return code - should only be called from the family of Command objects.
std::unique_ptr< vapi::Ip_neighbor_dump > m_dump
The VAPI event registration.
rc_t issue(connection &con)
Issue the command to VPP/HW.
Type def of a Ethernet address.
std::string to_string() const
convert to string format for debug purposes
HW::item< bool > & m_hw_item
A reference to an object's HW::item that the command will update.
HW::item< bool > & item()
return the HW item the command updates
vapi::Ip_neighbor_add_del msg_t
convenient typedef