24 singular_db<ip_unnumbered::key_t, ip_unnumbered> ip_unnumbered::m_db;
29 : m_itf(itf.singular())
30 , m_l3_itf(l3_itf.singular())
36 , m_l3_itf(o.m_l3_itf)
37 , m_config(o.m_config)
46 m_db.release(m_itf->key(),
this);
50 ip_unnumbered::sweep()
66 ip_unnumbered::replay()
78 s <<
"IP Unnumbered-config:" 79 <<
" itf:" << m_itf->to_string() <<
" l3-itf:" << m_l3_itf->to_string();
93 std::shared_ptr<ip_unnumbered>
96 return (m_db.find_or_add(temp.m_itf->key(), temp));
99 std::shared_ptr<ip_unnumbered>
102 return find_or_add(*
this);
112 ip_unnumbered::event_handler::handle_replay()
120 std::shared_ptr<ip_unnumbered_cmds::dump_cmd>
cmd =
121 std::make_shared<ip_unnumbered_cmds::dump_cmd>();
126 for (
auto& ip_record : *cmd) {
127 auto& payload = ip_record.get_payload();
130 <<
" itf: " << payload.sw_if_index
131 <<
" ip: " << payload.ip_sw_if_index;
134 std::shared_ptr<interface> ip_itf =
interface::find(payload.ip_sw_if_index);
144 ip_unnumbered::event_handler::order()
const A command class that configures the IP unnumbered.
std::string to_string() const
convert to string format for debug purposes
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 std::shared_ptr< interface > find(const handle_t &h)
The the singular instance of the interface in the DB by handle.
static void register_handler(const std::vector< std::string > &cmds, const std::string &help, command_handler *ch)
Register a command handler for inspection.
static rc_t write()
Write/Execute all commands hitherto enqueued.
static const log_level_t DEBUG
A cmd class that Unconfigs L3 Config from an interface.
std::shared_ptr< ip_unnumbered > singular() const
Return the 'singular instance' of the L3-Config that matches this object.
~ip_unnumbered()
Destructor.
A representation of IP unnumbered configuration on an interface.
A representation of an interface in VPP.
static void dump(std::ostream &os)
Dump all ip_unnumbereds into the stream provided.
static rc_t commit(const client_db::key_t &key, const OBJ &obj)
Make the State in VPP reflect the expressed desired state.
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.
ip_unnumbered(const interface &itf, const interface &l3_itf)
Construct a new object matching the desried state.
Then L2/objects that bind to interfaces, BD, ACLS, etc.
The VPP Object Model (VOM) library.
A representation of a method call to VPP.
static bool register_listener(listener *listener)
Register a listener of events.