20 namespace acl_ethertype_cmds {
34 return (m_itf == other.m_itf && m_le == other.m_le);
40 msg_t req(con.
ctx(), m_le.size(), std::ref(*
this));
44 auto& payload = req.get_request().get_payload();
45 payload.sw_if_index = m_itf.
value();
46 payload.count = m_le.size();
48 auto it = m_le.cbegin();
49 while (it != m_le.cend()) {
50 payload.whitelist[
i] = it->getEthertype();
57 payload.n_input = n_input;
69 <<
" itf:" << m_itf.
to_string() <<
" ethertype-rules:";
70 auto it = m_le.cbegin();
71 while (it != m_le.cend()) {
76 s <<
" rules-size:" << m_le.size();
90 return (m_itf == other.m_itf);
96 msg_t req(con.
ctx(), 0, std::ref(*
this));
98 auto& payload = req.get_request().get_payload();
99 payload.sw_if_index = m_itf.
value();
115 std::ostringstream s;
142 auto& payload =
m_dump->get_request().get_payload();
143 payload.sw_if_index = m_itf.
value();
155 return (
"acl-ethertype-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.
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.
static const direction_t INPUT
Permit Direction.
vapi::Acl_interface_etype_whitelist_dump msg_t
std::string to_string() const
convert to string format for debug purposes
rc_t wait()
Wait on the commands promise.
A command class that binds the ethertype list to the interface.
A cmd class that Dumps all the acl ethertypes on given interface.
std::string to_string() const
convert to string format for debug purposes
A representation of the connection to VPP.
dump_cmd()
Default Constructor.
std::string to_string() const
convert to string format for debug purposes
unbind_cmd(HW::item< bool > &item, const handle_t &itf)
Constructor.
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.
A command class that unbinds the ethertype list to the interface.
std::multiset< ethertype_rule_t > ethertype_rules_t
The ethertype container.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A type declaration of an interface handle in VPP.
static const rc_t OK
The HW write was successfull.
bind_cmd(HW::item< bool > &item, const handle_t &itf, const acl_ethertype::ethertype_rules_t &le)
Constructor.
rc_t wait()
Wait for the issue of the command to complete.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
bool operator==(const unbind_cmd &i) const
Comparison operator - only used for UT.
The VPP Object Model (VOM) library.
bool operator==(const bind_cmd &i) const
Comparison operator - only used for UT.
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::Acl_interface_etype_whitelist_dump > m_dump
The VAPI event registration.
rc_t issue(connection &con)
Issue the command to VPP/HW.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
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::Acl_interface_set_etype_whitelist msg_t
convenient typedef