16 #ifndef __VOM_ACL_LIST_CMDS_H__ 17 #define __VOM_ACL_LIST_CMDS_H__ 23 #include <vapi/acl.api.vapi.hpp> 31 template <
typename RULE,
typename UPDATE>
43 const cmd_rules_t&
rules)
61 s <<
"ACL-list-update:[ " << this->
item().
to_string() <<
" rule-list:[";
62 for (
auto rule : m_rules) {
63 s <<
" " << rule.to_string();
75 return ((m_key == other.m_key) && (m_rules == other.m_rules));
89 int acl_index = reply.get_response().get_payload().acl_index;
90 int retval = reply.get_response().get_payload().retval;
114 const cmd_key_t& m_key;
119 const cmd_rules_t& m_rules;
125 template <
typename RULE,
typename DELETE>
147 std::ostringstream s;
171 template <
typename DUMP>
188 std::string
to_string()
const {
return (
"acl-list-dump"); }
update_cmd< l3_rule, vapi::Acl_add_replace > l3_update_cmd
Typedef the L3 ACL commands.
void succeeded()
Called by the HW Command Q when it is disabled to indicate the command can be considered successful w...
static const rc_t & from_vpp_retval(int32_t rv)
Get the rc_t from the VPP API value.
update_cmd(HW::item< handle_t > &item, const cmd_key_t &key, const cmd_rules_t &rules)
Constructor.
Error codes that VPP will return during a HW write.
static const log_level_t DEBUG
void remove(const RULE &rule)
Remove a rule from the list.
bool operator==(const update_cmd &other) const
Comparison operator - only used for UT.
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
std::string key_t
The KEY can be used to uniquely identify the ACL.
rc_t issue(connection &con)
Issue the command to VPP/HW.
list< RULE >::rules_t cmd_rules_t
A cmd class that Dumps all the ACLs.
dump_cmd< vapi::Acl_dump > l3_dump_cmd
A representation of the connection to VPP.
A command class that Create the list.
std::string to_string() const
convert to string format for debug purposes
A base class for all RPC commands to VPP.
list< RULE >::key_t cmd_key_t
void fulfill(const HW::item< handle_t > &d)
Fulfill the commands promise.
A cmd class that Deletes an ACL.
delete_cmd< l3_rule, vapi::Acl_del > l3_delete_cmd
A type declaration of an interface handle in VPP.
vl_api_gbp_rule_t rules[n_rules]
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
std::string to_string() const
convert to string format for debug purposes
virtual vapi_error_e operator()(UPDATE &reply)
A callback function for handling ACL creates.
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< l2_rule, vapi::Macip_acl_del > l2_delete_cmd
update_cmd< l2_rule, vapi::Macip_acl_add > l2_update_cmd
Typedef the L2 ACL commands.
delete_cmd(HW::item< handle_t > &item)
Constructor.
std::multiset< RULE > rules_t
The rule container type.
static void add(const key_t &key, const HW::item< handle_t > &item)
bool operator==(const delete_cmd &other) const
Comparison operator - only used for UT.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A base class for VPP dump commands.
HW::item< handle_t > & item()
return the HW item the command updates