21 namespace l3_binding_cmds {
34 return ((m_itf == other.m_itf) && (m_pfx == other.m_pfx));
40 msg_t req(con.
ctx(), std::ref(*
this));
42 auto& payload = req.get_request().get_payload();
43 payload.sw_if_index = m_itf.
value();
47 m_pfx.
to_vpp(&payload.is_ipv6, payload.address, &payload.address_length);
76 return ((m_itf == other.m_itf) && (m_pfx == other.m_pfx));
82 msg_t req(con.
ctx(), std::ref(*
this));
84 auto& payload = req.get_request().get_payload();
85 payload.sw_if_index = m_itf.
value();
89 m_pfx.
to_vpp(&payload.is_ipv6, payload.address, &payload.address_length);
102 std::ostringstream s;
130 auto& payload =
m_dump->get_request().get_payload();
131 payload.sw_if_index = m_itf.
value();
144 return (
"L3-binding-dump");
rc_t issue(connection &con)
Issue the command to VPP/HW.
static const rc_t NOOP
The HW write/update action was/has not been attempted.
A functor class that binds the L3 config to the interface.
std::string to_string() const
convert to string format for debug purposes
uint32_t value() const
get the value of the handle
Error codes that VPP will return during a HW write.
vapi::Ip_address_dump msg_t
bool operator==(const unbind_cmd &i) const
Comparison operator - only used for UT.
rc_t wait()
Wait on the commands promise.
std::string to_string() const
convert to string format for debug purposes
std::string to_string() const
convert to string format for debug purposes
bind_cmd(HW::item< bool > &item, const handle_t &itf, const route::prefix_t &pfx)
Constructor.
A representation of the connection to VPP.
void to_vpp(uint8_t *is_ip6, uint8_t *addr, uint8_t *len) const
Convert the prefix into VPP API parameters.
std::string to_string() const
convert to string format for debug purposes
A base class for all RPC commands to VPP.
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
dump_v4_cmd(const handle_t &itf)
Constructor.
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 Unbinds L3 Config from an interface.
A type declaration of an interface handle in VPP.
static const rc_t OK
The HW write was successfull.
DEFINE_VAPI_MSG_IDS_IP_API_JSON
rc_t issue(connection &con)
Issue the command to VPP/HW.
rc_t wait()
Wait for the issue of the command to complete.
std::string to_string() const
convert to string format for debug purposes
A cmd class that Dumps all the IPv4 L3 configs.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
bool operator==(const bind_cmd &i) const
Comparison operator - only used for UT.
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::unique_ptr< vapi::Ip_address_dump > m_dump
The VAPI event registration.
bool operator==(const dump_v4_cmd &i) const
Comparison operator - only used for UT.
unbind_cmd(HW::item< bool > &item, const handle_t &itf, const route::prefix_t &pfx)
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::Sw_interface_add_del_address msg_t
convenient typedef