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();
79 msg_t req(con.
ctx(), std::ref(*
this));
81 auto& payload = req.get_request().get_payload();
115 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
127 return (
"bond-itf-dump");
static const rc_t NOOP
The HW write/update action was/has not been attempted.
HW::item< handle_t > & m_hw_item
A reference to an object's HW::item that the command will update.
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.
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.
A representation of the connection to VPP.
A cmd class that Dumps all the Vpp Interfaces.
dump_cmd()
Default Constructor.
HW::item< handle_t > & item()
return the HW item the command updates
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)
delete_cmd(HW::item< handle_t > &item)
static const lb_t UNSPECIFIED
Unspecificed 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.
vapi::Bond_create msg_t
convenient typedef
DEFINE_VAPI_MSG_IDS_BOND_API_JSON
HW::item< handle_t > wait()
Wait on the commands promise.