21 namespace bond_interface_cmds {
23 const std::string&
name,
30 , m_l2_address(l2_address)
37 msg_t req(con.
ctx(), std::ref(*
this));
39 auto& payload = req.get_request().get_payload();
42 m_l2_address.
to_bytes(payload.mac_address, 6);
43 payload.use_custom_mac = 1;
46 payload.mode = m_mode.
value();
50 payload.lb = m_lb.
value();
80 msg_t req(con.
ctx(), std::ref(*
this));
82 auto& payload = req.get_request().get_payload();
116 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
128 return (
"bond-itf-dump");
static const rc_t NOOP
The HW write/update action was/has not been attempted.
int value() const
Return the value of the enum - same as integer conversion.
void remove_interface()
remove the deleted interface from the DB
uint32_t value() const
get the value of the handle
A functor class that deletes a Tap interface.
void to_bytes(uint8_t *array, uint8_t len) const
Convert to byte array.
std::string to_string() const
convert to string format for debug purposes
static const mode_t XOR
XOR bond interface mode.
Error codes that VPP will return during a HW write.
std::string to_string() const
convert to string format for debug purposes
static const l2_address_t ZERO
An all 0's L2 address.
rc_t issue(connection &con)
Issue the command to VPP/HW.
std::string to_string() const
convert to string format for debug purposes
A bond interface load balance.
Type def of a L2 address as read from VPP.
rc_t wait()
Wait on the commands promise.
T & data()
Return the data read/written.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
static const mode_t LACP
LACP bond interface mode.
rc_t issue(connection &con)
Issue the command to VPP/HW.
rc_t rc() const
Get the HW return code.
A representation of the connection to VPP.
A cmd class that Dumps all the Vpp Interfaces.
dump_cmd()
Default Constructor.
A functor class that creates an interface.
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
A representation of an interface in VPP.
std::string to_string() const
convert to string format for debug purposes
create_cmd(HW::item< handle_t > &item, const std::string &name, const bond_interface::mode_t &mode, const bond_interface::lb_t &lb, const l2_address_t &l2_address)
vl_api_vxlan_gbp_api_tunnel_mode_t mode
delete_cmd(HW::item< handle_t > &item)
static const lb_t UNSPECIFIED
Unspecified bond interface lb.
static const rc_t OK
The HW write was successfull.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
void insert_interface()
add the created interface to the DB
The VPP Object Model (VOM) library.
rc_t issue(connection &con)
Issue the command to VPP/HW.
void set(const rc_t &rc)
Set the HW return code - should only be called from the family of Command objects.
DEFINE_VAPI_MSG_IDS_BOND_API_JSON
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::Bond_create msg_t
convenient typedef