16 #ifndef __VOM_ACL_BINDING_H__ 17 #define __VOM_ACL_BINDING_H__ 36 template <
typename LIST>
43 typedef std::pair<direction_t, interface::key_t>
key_t;
49 : m_direction(direction)
61 : m_direction(o.m_direction)
74 m_db.release(std::make_pair(m_direction, m_itf->key()),
this);
81 std::shared_ptr<binding>
singular()
const {
return find_or_add(*
this); }
89 s <<
"acl-binding:[" << m_direction.
to_string() <<
" " << m_itf->to_string()
90 <<
" " << m_acl->to_string() <<
" " << m_binding.
to_string() <<
"]";
98 static void dump(std::ostream& os) { m_db.dump(os); }
112 virtual ~event_handler() =
default;
122 void handle_replay() { m_db.replay(); }
127 void show(std::ostream& os) { m_db.dump(os); }
138 static event_handler m_evh;
143 void update(
const binding& obj);
148 static std::shared_ptr<binding> find_or_add(
const binding& temp)
150 return (m_db.find_or_add(
151 std::make_pair(temp.m_direction, temp.m_itf->key()), temp));
185 const std::shared_ptr<interface> m_itf;
192 const std::shared_ptr<LIST> m_acl;
219 template <
typename LIST>
223 template <
typename LIST>
228 const std::pair<direction_t, interface::key_t>& key);
binding< l2_list > l2_binding
Typedef the L2 binding type.
std::shared_ptr< binding > singular() const
Return the 'singular instance' of the L2 config that matches this object.
std::pair< direction_t, interface::key_t > key_t
The key for a binding is the direction and the interface.
const std::string key_t
In the opflex world each entity is known by a URI which can be converted into a string.
static void register_handler(const std::vector< std::string > &cmds, const std::string &help, command_handler *ch)
Register a command handler for inspection.
static void dump(std::ostream &os)
Dump all bindings into the stream provided.
std::string to_string() const
convert to string format for debug purposes
binding(const binding &o)
Copy Constructor.
A Database to store the unique 'singular' instances of a single object type.
A representation of an interface in VPP.
Class definition for listeners to OM events.
inspect command handler Handler
dependency_t
There needs to be a strict order in which object types are read from VPP (at boot time) and replayed ...
binding< l3_list > l3_binding
Typedef the L3 binding type.
The interface to writing objects into VPP OM.
A base class for all object_base in the VPP object_base-Model.
std::ostream & operator<<(std::ostream &os, const std::pair< direction_t, interface::key_t > &key)
Then L2/objects that bind to interfaces, BD, ACLS, etc.
The VPP Object Model (VOM) library.
std::string to_string() const
convert to string format for debug purposes
const std::string & to_string() const
convert to string format for debug purposes
A binding between an ACL and an interface.
static bool register_listener(listener *listener)
Register a listener of events.
binding(const direction_t &direction, const interface &itf, const LIST &acl)
Construct a new object matching the desried state.