19 namespace arp_proxy_config_cmds {
22 const boost::asio::ip::address_v4& low,
23 const boost::asio::ip::address_v4& high)
33 return ((m_low == o.m_low) && (m_high == o.m_high));
39 msg_t req(con.
ctx(), std::ref(*
this));
41 auto& payload = req.get_request().get_payload();
44 std::copy_n(std::begin(m_low.to_bytes()), m_low.to_bytes().size(),
45 payload.proxy.low_address);
46 std::copy_n(std::begin(m_high.to_bytes()), m_high.to_bytes().size(),
47 payload.proxy.hi_address);
61 <<
" low:" << m_low.to_string() <<
" high:" << m_high.to_string();
67 const boost::asio::ip::address_v4& low,
68 const boost::asio::ip::address_v4& high)
78 return ((m_low == o.m_low) && (m_high == o.m_high));
84 msg_t req(con.
ctx(), std::ref(*
this));
86 auto& payload = req.get_request().get_payload();
89 std::copy_n(std::begin(m_low.to_bytes()), m_low.to_bytes().size(),
90 payload.proxy.low_address);
91 std::copy_n(std::begin(m_high.to_bytes()), m_high.to_bytes().size(),
92 payload.proxy.hi_address);
105 std::ostringstream s;
107 <<
" low:" << m_low.to_string() <<
" high:" << m_high.to_string();
121 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
133 return (
"ARP-proxy-dump");
static const rc_t NOOP
The HW write/update action was/has not been attempted.
rc_t issue(connection &con)
Issue the command to VPP/HW.
config_cmd(HW::item< bool > &item, const boost::asio::ip::address_v4 &lo, const boost::asio::ip::address_v4 &high)
Constructor.
Error codes that VPP will return during a HW write.
rc_t issue(connection &con)
Issue the command to VPP/HW.
rc_t wait()
Wait on the commands promise.
std::string to_string() const
convert to string format for debug purposes
bool operator==(const unconfig_cmd &i) const
Comparison operator - only used for UT.
std::string to_string() const
convert to string format for debug purposes
A representation of the connection to VPP.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
A base class for all RPC commands to VPP.
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
std::string to_string() const
convert to string format for debug purposes
std::string to_string() const
convert to string format for debug purposes
unconfig_cmd(HW::item< bool > &item, const boost::asio::ip::address_v4 &lo, const boost::asio::ip::address_v4 &hig)
Constructor.
static const rc_t OK
The HW write was successfull.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
The VPP Object Model (VOM) library.
void set(const rc_t &rc)
Set the HW return code - should only be called from the family of Command objects.
A cmd class that Unconfigs ArpProxy Config from an interface.
A command class that adds the ARP Proxy config.
A cmd class that Dumps all the Proxy ARP configs.
bool operator==(const config_cmd &i) const
Comparison operator - only used for UT.
HW::item< bool > & m_hw_item
A reference to an object's HW::item that the command will update.
rc_t issue(connection &con)
Issue the command to VPP/HW.
HW::item< bool > & item()
return the HW item the command updates
vapi::Proxy_arp_add_del msg_t
convenient typedef