19 namespace ip_punt_redirect_cmds {
35 return ((m_rx_itf == o.m_rx_itf) && (m_tx_itf == o.m_tx_itf) &&
36 (m_addr == o.m_addr));
42 msg_t req(con.
ctx(), std::ref(*
this));
44 auto& payload = req.get_request().get_payload();
47 payload.rx_sw_if_index = m_rx_itf.
value();
48 payload.tx_sw_if_index = m_tx_itf.
value();
50 to_bytes(m_addr, &payload.is_ip6, payload.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.rx_sw_if_index = m_rx_itf.
value();
95 payload.tx_sw_if_index = m_tx_itf.
value();
97 to_bytes(m_addr, &payload.is_ip6, payload.nh);
110 std::ostringstream s;
113 <<
" next-hop:" << m_addr.to_string();
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.
unconfig_cmd(HW::item< bool > &item, const handle_t &rx_itf, const handle_t &tx_itf, const boost::asio::ip::address &addr)
Constructor.
Error codes that VPP will return during a HW write.
std::string to_string() const
convert to string format for debug purposes
std::string to_string() const
convert to string format for debug purposes
rc_t wait()
Wait on the commands promise.
rc_t issue(connection &con)
Issue the command to VPP/HW.
std::string to_string() const
convert to string format for debug purposes
rc_t issue(connection &con)
Issue the command to VPP/HW.
A cmd class that Unconfigs Ip punt redirect.
void to_bytes(const boost::asio::ip::address_v6 &addr, uint8_t *array)
A representation of the connection to VPP.
bool operator==(const unconfig_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.
A type declaration of an interface handle in VPP.
bool operator==(const config_cmd &i) const
Comparison operator - only used for UT.
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.
std::string to_string() const
convert to string format for debug purposes
config_cmd(HW::item< bool > &item, const handle_t &rx_itf, const handle_t &tx_itf, const boost::asio::ip::address &addr)
Constructor.
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