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.
std::string to_string() const
convert to string format for debug purposes
uint32_t value() const
get the value of the handle
void remove_interface()
remove the deleted interface from the DB
A functor class that deletes a Tap interface.
static const mode_t XOR
XOR bond interface mode.
rc_t rc() const
Get the HW return code.
Error codes that VPP will return during a HW write.
static const l2_address_t ZERO
An all 0's L2 address.
rc_t issue(connection &con)
Issue the command to VPP/HW.
int value() const
Return the value of the enum - same as integer conversion.
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.
std::string to_string() const
convert to string format for debug purposes
static const mode_t LACP
LACP bond interface mode.
rc_t issue(connection &con)
Issue the command to VPP/HW.
std::string to_string() const
convert to string format for debug purposes
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.
void to_bytes(uint8_t *array, uint8_t len) const
Convert to byte array.
A representation of an interface in VPP.
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.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
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
std::string to_string() const
convert to string format for debug purposes
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