45 return (m_dir > other.m_dir);
51 return (m_dir == other.m_dir && m_eth == other.m_eth);
75 : m_itf(itf.singular())
84 , m_binding(o.m_binding)
93 m_db.release(m_itf->key(),
this);
97 acl_ethertype::sweep()
108 return (m_itf->key());
114 return (m_itf->key() == other.m_itf->key() && m_le == other.m_le);
117 std::shared_ptr<acl_ethertype>
120 return (m_db.find(key));
130 acl_ethertype::replay()
141 std::ostringstream s;
142 s <<
"Acl-Ethertype:" << m_itf->to_string() <<
" ethertype-rules:";
143 auto it = m_le.cbegin();
144 while (it != m_le.cend()) {
145 s << it->to_string();
148 s <<
" rules-size:" << m_le.size();
159 if (!m_binding || desired.m_le != m_le) {
167 std::shared_ptr<acl_ethertype>
170 return (m_db.find_or_add(temp.m_itf->key(), temp));
173 std::shared_ptr<acl_ethertype>
176 return find_or_add(*
this);
187 acl_ethertype::event_handler::handle_replay()
198 std::shared_ptr<acl_ethertype_cmds::dump_cmd>
cmd =
199 std::make_shared<acl_ethertype_cmds::dump_cmd>(~0);
204 for (
auto& record : *cmd) {
205 auto& payload = record.get_payload();
208 uint8_t n_input = payload.n_input;
209 uint8_t
count = payload.count;
235 acl_ethertype::event_handler::order()
const
std::string to_string() const
convert to string format for debug purposes
int value() const
Return the value of the enum - same as integer conversion.
void db_dump(const DB &db, std::ostream &os)
Print each of the objects in the DB into the stream provided.
ethertype_rule_t(const ethertype_t ð, const direction_t &dir)
Constructor.
const std::string key_t
In the opflex world each entity is known by a URI which can be converted into a string.
static std::shared_ptr< interface > find(const handle_t &h)
The the singular instance of the interface in the DB by handle.
std::shared_ptr< acl_ethertype > singular() const
Return the 'singular' of the acl ethertype that matches this object.
static void register_handler(const std::vector< std::string > &cmds, const std::string &help, command_handler *ch)
Register a command handler for inspection.
static rc_t write()
Write/Execute all commands hitherto enqueued.
static const log_level_t DEBUG
static void dump(std::ostream &os)
Dump all acl ethertype into the stream provided.
static const ethertype_t & from_numeric_val(uint16_t numeric)
Get the ethertype from the numeric value.
static const direction_t INPUT
Permit Direction.
std::string key_t
The KEY can be used to uniquely identify the ACL ethertype.
A command class that binds the ethertype list to the interface.
An ACL ethertype list comprises a set of inbound ether types and out bound ether types to be applied ...
const direction_t & getDirection(void) const
get the direction
const key_t & key() const
Return the binding's key.
bool operator==(const acl_ethertype &o) const
comparision operator (for testing)
uint16_t getEthertype(void) const
get the ether value
A Database to store the unique 'singular' instances of a single object type.
static std::shared_ptr< acl_ethertype > find(const key_t &key)
Static function to find the acl_ethertype in the model.
A command class that unbinds the ethertype list to the interface.
std::multiset< ethertype_rule_t > ethertype_rules_t
The ethertype container.
A representation of an interface in VPP.
bool operator<(const ethertype_rule_t &other) const
comparision operator
A type declaration of an interface handle in VPP.
static rc_t commit(const client_db::key_t &key, const OBJ &obj)
Make the State in VPP reflect the expressed desired state.
void event_handler(void *tls_async)
dependency_t
There needs to be a strict order in which object types are read from VPP (at boot time) and replayed ...
static void enqueue(cmd *f)
Enqueue A command for execution.
acl_ethertype(const interface &itf, const ethertype_rules_t &le)
Construct a new object matching the desried state.
static const log_level_t ERROR
Then L2/objects that bind to interfaces, BD, ACLS, etc.
The VPP Object Model (VOM) library.
bool operator==(const ethertype_rule_t &other) const
comparision operator (for testing)
~acl_ethertype()
Destructor.
A representation of a method call to VPP.
static const direction_t OUTPUT
Deny Direction.
const std::string & to_string() const
convert to string format for debug purposes
static bool register_listener(listener *listener)
Register a listener of events.
std::string to_string() const
convert to string