22 namespace neighbour_cmds {
38 return ((m_mac == other.m_mac) && (m_ip_addr == other.m_ip_addr) &&
39 (m_itf == other.m_itf) && (m_flags == other.m_flags));
45 msg_t req(con.
ctx(), std::ref(*
this));
47 auto& payload = req.get_request().get_payload();
49 payload.neighbor.sw_if_index = m_itf.
value();
51 to_api(m_mac, payload.neighbor.mac_address);
52 to_api(m_ip_addr, payload.neighbor.ip_address);
53 payload.neighbor.flags =
to_api(m_flags);
66 <<
" 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();
143 auto& payload =
m_dump->get_request().get_payload();
144 payload.sw_if_index = m_itf.
value();
145 payload.af =
to_api(m_proto);
157 std::ostringstream s;
static const rc_t NOOP
The HW write/update action was/has not been attempted.
bool operator==(const delete_cmd &i) const
Comparison operator - only used for UT.
A cmd class that deletes a bridge domain ARP entry.
vl_api_wireguard_peer_flags_t flags
uint32_t value() const
get the value of the handle
Error codes that VPP will return during a HW write.
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.
delete_cmd(HW::item< handle_t > &item, handle_t itf, const mac_address_t &mac, const boost::asio::ip::address &ip_addr, const neighbour::flags_t &flags)
Constructor.
dump_cmd()
Default Constructor.
DEFINE_VAPI_MSG_IDS_IP_NEIGHBOR_API_JSON
#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.
manual_print typedef address
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.
create_cmd(HW::item< handle_t > &item, handle_t itf, const mac_address_t &mac, const boost::asio::ip::address &ip_addr, const neighbour::flags_t &flags)
Constructor.
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< handle_t > & m_hw_item
A reference to an object's HW::item that the command will update.
HW::item< handle_t > & item()
return the HW item the command updates
vapi::Ip_neighbor_add_del msg_t
convenient typedef