16 #ifndef __VOM_INTERFACE_IP6_ND_H__ 17 #define __VOM_INTERFACE_IP6_ND_H__ 34 template <
typename CLASS,
typename CMD>
55 , m_config(o.m_config)
65 m_db.release(m_itf->key(),
this);
72 std::shared_ptr<interface_ip6_nd>
singular()
const 74 return find_or_add(*
this);
83 s <<
"interface-ip6-nd:[" 84 <<
" itf:" << m_itf->to_string() <<
" " << m_cls.to_string() <<
" " 93 static void dump(std::ostream& os) { m_db.dump(os); }
110 std::deque<std::shared_ptr<interface_ip6_nd>> rac;
112 auto it = m_db.cbegin();
114 while (it != m_db.cend()) {
119 auto key = it->first;
121 if (i.
key() == key.first) {
122 rac.push_back(it->second.lock());
157 std::ostringstream s;
159 <<
" itf:" << m_itf.
to_string() <<
" " << m_cls.to_string();
169 return ((m_itf == other.m_itf) && (m_cls == other.m_cls));
181 const class_t& m_cls;
210 std::ostringstream s;
212 <<
" itf:" << m_itf.to_string() <<
" " << m_cls.to_string();
222 return ((m_itf == other.m_itf) && (m_cls == other.m_cls));
234 const class_t& m_cls;
265 void handle_replay() { m_db.replay(); }
270 void show(std::ostream& os) { m_db.dump(os); }
314 static std::shared_ptr<interface_ip6_nd> find_or_add(
317 return (m_db.find_or_add(temp.m_itf->key(), temp));
330 const std::shared_ptr<interface> m_itf;
364 template <
typename CLASS,
typename CMD>
369 template <
typename CLASS,
typename CMD>
A representation of L3 configuration on an interface.
config_cmd(HW::item< bool > &item, const handle_t &itf, const class_t &cls)
Constructor.
interface_ip6_nd< ra_config, vapi::Sw_interface_ip6nd_ra_config > ip6nd_ra_config
Typedef the ip6nd_ra_config.
std::shared_ptr< interface_ip6_nd > singular() const
Return the 'singular instance' of the interface ip6nd that matches this object.
const std::string key_t
In the opflex world each entity is known by a URI which can be converted into a string.
A functor class that binds the ra config to the interface.
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 config into the stream provided.
static rc_t write()
Write/Execute all commands hitherto enqueued.
Error codes that VPP will return during a HW write.
std::string to_string() const
convert to string format for debug purposes
static std::shared_ptr< interface_ip6_nd > find(const interface &i)
Find an singular instance in the DB for the interface passed.
std::string to_string() const
convert to string format for debug purposes
rc_t issue(connection &con)
Issue the command to VPP/HW.
std::string to_string() const
convert to string format for debug purposes
bool operator==(const unconfig_cmd &other) const
Comparison operator - only used for UT.
A representation of the connection to VPP.
interface_ip6_nd(const interface &itf, const class_t cls)
Construct a new object matching the desried state.
bool operator==(const config_cmd &other) const
Comparison operator - only used for UT.
A Database to store the unique 'singular' instances of a single object type.
A base class for all RPC commands to VPP.
std::string to_string() const
convert to string format for debug purposes
A representation of an interface in VPP.
Class definition for listeners to OM events.
inspect command handler Handler
A type declaration of an interface handle in VPP.
interface_ip6_nd< ra_prefix, vapi::Sw_interface_ip6nd_ra_prefix > ip6nd_ra_prefix
Typedef the ip6nd_ra_prefix.
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 ...
static void enqueue(cmd *f)
Enqueue A command for execution.
The interface to writing objects into VPP OM.
unconfig_cmd(HW::item< bool > &item, const handle_t &itf, const class_t &cls)
Constructor.
A base class for all object_base in the VPP object_base-Model.
Then L2/objects that bind to interfaces, BD, ACLS, etc.
The VPP Object Model (VOM) library.
interface_ip6_nd(const interface_ip6_nd &o)
Copy Constructor.
std::string to_string() const
convert to string format for debug purposes
std::string key_t
The key for interface's key.
static bool register_listener(listener *listener)
Register a listener of events.
~interface_ip6_nd()
Destructor.
const key_t & key() const
Return the interface type.
A cmd class that Unbinds L3 Config from an interface.
HW::item< bool > & item()
return the HW item the command updates
interface::key_t key_t
The key type for interface ip6 nd.