19 namespace lldp_global_cmds {
21 const std::string& system_name,
25 , m_system_name(system_name)
27 , m_tx_interval(tx_interval)
34 return (m_system_name == other.m_system_name);
40 msg_t req(con.
ctx(), std::ref(*
this));
42 auto& payload = req.get_request().get_payload();
43 payload.tx_hold = m_tx_hold;
44 payload.tx_interval = m_tx_interval;
46 memcpy(payload.system_name, m_system_name.c_str(),
47 std::min(
sizeof(payload.system_name), m_system_name.length()));
61 <<
" system_name:" << m_system_name <<
" tx-hold:" << m_tx_hold
62 <<
" tx-interval:" << m_tx_interval;
HW::item< bool > & m_hw_item
A reference to an object's HW::item that the command will update.
Error codes that VPP will return during a HW write.
std::string to_string() const
convert to string format for debug purposes
rc_t issue(connection &con)
Issue the command to VPP/HW.
bool operator==(const config_cmd &i) const
Comparison operator - only used for UT.
A representation of the connection to VPP.
A base class for all RPC commands to VPP.
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
static const rc_t OK
The HW write was successfull.
A command class that binds the LLDP global to the interface.
config_cmd(HW::item< bool > &item, const std::string &system_name, uint32_t tx_hold, uint32_t tx_interval)
Constructor.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
The VPP Object Model (VOM) library.
std::string to_string() const
convert to string format for debug purposes
void set(const rc_t &rc)
Set the HW return code - should only be called from the family of Command objects.
vapi::Lldp_config msg_t
convenient typedef
rc_t wait()
Wait on the commands promise.