23 singular_db<interface::key_t, lldp_binding> lldp_binding::m_db;
25 lldp_binding::event_handler lldp_binding::m_evh;
28 : m_itf(itf.singular())
29 , m_port_desc(port_desc)
36 , m_port_desc(o.m_port_desc)
46 m_db.release(m_itf->key(),
this);
52 return ((
key() == l.
key()) && (m_port_desc == l.m_port_desc));
58 return (m_itf->key());
77 lldp_binding::replay()
89 s <<
"Lldp-binding: " << m_itf->to_string() <<
" port_desc:" << m_port_desc
107 std::shared_ptr<lldp_binding>
110 return (m_db.find_or_add(temp.m_itf->key(), temp));
113 std::shared_ptr<lldp_binding>
116 return (m_db.find(k));
119 std::shared_ptr<lldp_binding>
122 return find_or_add(*
this);
125 lldp_binding::event_handler::event_handler()
132 lldp_binding::event_handler::handle_replay()
144 lldp_binding::event_handler::order()
const A representation of LLDP client configuration on an interface.
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.
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.