16 #ifndef __VOM_ACL_LIST_CMDS_H__ 17 #define __VOM_ACL_LIST_CMDS_H__ 24 #include <vapi/acl.api.vapi.hpp> 32 template <
typename LIST,
typename UPDATE>
44 const cmd_rules_t&
rules)
62 s <<
"ACL-list-update:[ " << this->
item().
to_string() <<
" rule-list:[";
63 for (
auto rule : m_rules) {
64 s <<
" " << rule.to_string();
76 return ((m_key == other.m_key) && (m_rules == other.m_rules));
82 LIST::add(m_key, this->
item());
90 int acl_index = reply.get_response().get_payload().acl_index;
91 int retval = reply.get_response().get_payload().retval;
110 void insert_acl() { LIST::add(m_key, this->
item()); }
115 const cmd_key_t& m_key;
120 const cmd_rules_t& m_rules;
126 template <
typename LIST,
typename DELETE>
148 std::ostringstream s;
166 void remove_acl() { LIST::remove(this->
item()); }
172 template <
typename DUMP>
189 std::string
to_string()
const {
return (
"acl-list-dump"); }
std::string to_string() const
convert to string format for debug purposes
std::string to_string() const
convert to string format for debug purposes
static const rc_t & from_vpp_retval(int32_t rv)
Get the rc_t from the VPP API value.
Error codes that VPP will return during a HW write.
static const log_level_t DEBUG
virtual vapi_error_e operator()(UPDATE &reply)
A callback function for handling ACL creates.
std::string to_string() const
convert to string format for debug purposes
T & data()
Return the data read/written.
std::string to_string() const
convert to string format for debug purposes
void succeeded()
Called by the HW Command Q when it is disabled to indicate the command can be considered successful w...
update_cmd< l3_list, vapi::Acl_add_replace > l3_update_cmd
Typedef the L3 ACL commands.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A cmd class that Dumps all the ACLs.
delete_cmd(HW::item< handle_t > &item)
Constructor.
bool operator==(const delete_cmd &other) const
Comparison operator - only used for UT.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
dump_cmd< vapi::Acl_dump > l3_dump_cmd
A representation of the connection to VPP.
A command class that Create the list.
delete_cmd< l2_list, vapi::Macip_acl_del > l2_delete_cmd
A base class for all RPC commands to VPP.
bool operator==(const update_cmd &other) const
Comparison operator - only used for UT.
void fulfill(const HW::item< handle_t > &d)
Fulfill the commands promise.
A cmd class that Deletes an ACL.
A type declaration of an interface handle in VPP.
vl_api_gbp_rule_t rules[n_rules]
update_cmd(HW::item< handle_t > &item, const cmd_key_t &key, const cmd_rules_t &rules)
Constructor.
dump_cmd< vapi::Macip_acl_dump > l2_dump_cmd
static const rc_t INVALID
HW write reported invalid input.
The VPP Object Model (VOM) library.
delete_cmd< l3_list, vapi::Acl_del > l3_delete_cmd
rc_t issue(connection &con)
Issue the command to VPP/HW.
LIST::rules_t cmd_rules_t
A base class for VPP dump commands.
HW::item< handle_t > & item()
return the HW item the command updates
update_cmd< l2_list, vapi::Macip_acl_add > l2_update_cmd
Typedef the L2 ACL commands.