24 singular_db<interface::key_t, lldp_binding> lldp_binding::m_db;
29 : m_itf(itf.singular())
30 , m_port_desc(port_desc)
37 , m_port_desc(o.m_port_desc)
47 m_db.release(m_itf->key(),
this);
53 return ((
key() == l.
key()) && (m_port_desc == l.m_port_desc));
59 return (m_itf->key());
78 lldp_binding::replay()
90 s <<
"Lldp-binding: " << m_itf->to_string() <<
" port_desc:" << m_port_desc
108 std::shared_ptr<lldp_binding>
111 return (m_db.find_or_add(temp.m_itf->key(), temp));
114 std::shared_ptr<lldp_binding>
117 return (m_db.find(k));
120 std::shared_ptr<lldp_binding>
123 return find_or_add(*
this);
133 lldp_binding::event_handler::handle_replay()
145 lldp_binding::event_handler::order()
const A representation of LLDP client configuration on an interface.
void db_dump(const DB &db, std::ostream &os)
Print each of the objects in the DB into the stream provided.
static void dump(std::ostream &os)
Dump all LLDP bindings 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 register_handler(const std::vector< std::string > &cmds, const std::string &help, command_handler *ch)
Register a command handler for inspection.
static std::shared_ptr< lldp_binding > find(const key_t &k)
Find or add LLDP binding based on its key.
static rc_t write()
Write/Execute all commands hitherto enqueued.
std::string to_string() const
convert to string format for debug purposes
std::string to_string() const
convert to string format for debug purposes
bool operator==(const lldp_binding &b) const
Comparison operator.
~lldp_binding()
Destructor.
A cmd class that Unbinds Lldp Config from an interface.
A representation of an interface in VPP.
void event_handler(void *tls_async)
const key_t & key() const
Return this object's key.
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.
A command class that binds the LLDP config to the interface.
Then L2/objects that bind to interfaces, BD, ACLS, etc.
The VPP Object Model (VOM) library.
lldp_binding(const interface &itf, const std::string &hostname)
Construct a new object matching the desried state.
interface::key_t key_t
Typedef for the key of a LLDP binding.
std::shared_ptr< lldp_binding > singular() const
Return the 'singular' of the LLDP binding that matches this object.
static bool register_listener(listener *listener)
Register a listener of events.