20 namespace ip_punt_redirect_cmds {
36 return ((m_rx_itf == o.m_rx_itf) && (m_tx_itf == o.m_tx_itf) &&
37 (m_addr == o.m_addr));
43 msg_t req(con.
ctx(), std::ref(*
this));
45 auto& payload = req.get_request().get_payload();
48 payload.punt.rx_sw_if_index = m_rx_itf.
value();
49 payload.punt.tx_sw_if_index = m_tx_itf.
value();
50 to_api(m_addr, payload.punt.nh);
63 <<
" next-hop:" << m_addr;
82 return ((m_rx_itf == o.m_rx_itf) && (m_tx_itf == o.m_tx_itf) &&
83 (m_addr == o.m_addr));
89 msg_t req(con.
ctx(), std::ref(*
this));
91 auto& payload = req.get_request().get_payload();
94 payload.punt.rx_sw_if_index = m_rx_itf.
value();
95 payload.punt.tx_sw_if_index = m_tx_itf.
value();
96 to_api(m_addr, payload.punt.nh);
109 std::ostringstream s;
112 <<
" next-hop:" << m_addr.to_string();
126 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
138 return (
"ip-punt-redirect-dump");
config_cmd(HW::item< bool > &item, const handle_t rx_itf, const handle_t tx_itf, const boost::asio::ip::address &addr)
Constructor.
static const rc_t NOOP
The HW write/update action was/has not been attempted.
uint32_t value() const
get the value of the handle
A command class that configures the IP punt_redirect.
bool operator==(const config_cmd &i) const
Comparison operator - only used for UT.
Error codes that VPP will return during a HW write.
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
rc_t issue(connection &con)
Issue the command to VPP/HW.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A cmd class that Unconfigs Ip punt redirect.
A representation of the connection to VPP.
unconfig_cmd(HW::item< bool > &item, const handle_t rx_itf, const handle_t tx_itf, const boost::asio::ip::address &addr)
Constructor.
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
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.
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.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
A cmd class that Dumps all the IP punt redirect.
The VPP Object Model (VOM) library.
std::string to_string() const
convert to string format for debug purposes
void set(const rc_t &rc)
Set the HW return code - should only be called from the family of Command objects.
bool operator==(const unconfig_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.
HW::item< bool > & item()
return the HW item the command updates
vapi::Ip_punt_redirect msg_t
convenient typedef