16 #ifndef __VOM_ACL_BINDING_H__ 17 #define __VOM_ACL_BINDING_H__ 37 template <
typename LIST>
44 typedef std::pair<direction_t, interface::key_t>
key_t;
50 : m_direction(direction)
62 : m_direction(o.m_direction)
65 , m_binding(o.m_binding)
75 m_db.release(std::make_pair(m_direction, m_itf->key()),
this);
82 std::shared_ptr<binding>
singular()
const {
return find_or_add(*
this); }
90 s <<
"acl-binding:[" << m_direction.
to_string() <<
" " << m_itf->to_string()
91 <<
" " << m_acl->to_string() <<
" " << m_binding.
to_string() <<
"]";
99 static void dump(std::ostream& os) { m_db.dump(os); }
122 void handle_replay() { m_db.replay(); }
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>
233 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.
void db_dump(const DB &db, std::ostream &os)
Print each of the objects in the DB into the stream provided.
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 dump(std::ostream &os)
Dump all bindings into the stream provided.
static dependency_t order()
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
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 ...
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.
binding(const direction_t &direction, const interface &itf, const LIST &acl)
Construct a new object matching the desried state.