16 #ifndef __VOM_ACL_BINDING_H__ 17 #define __VOM_ACL_BINDING_H__ 38 template <
typename LIST>
45 typedef std::pair<direction_t, interface::key_t>
key_t;
51 : m_direction(direction)
63 : m_direction(o.m_direction)
66 , m_binding(o.m_binding)
76 m_db.release(std::make_pair(m_direction, m_itf->key()),
this);
83 std::shared_ptr<binding>
singular()
const {
return find_or_add(*
this); }
91 s <<
"acl-binding:[" << m_direction.
to_string() <<
" " << m_itf->to_string()
92 <<
" " << m_acl->to_string() <<
" " << m_binding.
to_string() <<
"]";
100 static void dump(std::ostream& os) { m_db.dump(os); }
123 void handle_replay() { m_db.replay(); }
144 void update(
const binding& obj);
149 static std::shared_ptr<binding> find_or_add(
const binding& temp)
151 return (m_db.find_or_add(
152 std::make_pair(temp.m_direction, temp.m_itf->key()), temp));
186 const std::shared_ptr<interface> m_itf;
193 const std::shared_ptr<LIST> m_acl;
220 template <
typename LIST>
224 template <
typename LIST>
234 const std::pair<direction_t, interface::key_t>&
key);
binding< l2_list > l2_binding
Typedef the L2 binding type.
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.
std::shared_ptr< binding > singular() const
Return the 'singular instance' of the L2 config that matches this object.
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
const std::string & to_string() const
convert to string format for debug purposes
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)
The VPP Object Model (VOM) library.
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.