28 singular_db<route::table_id_t, route_domain> route_domain::m_db;
43 , m_table_id(o.m_table_id)
50 return (m_table_id == r.m_table_id);
109 m_db.release(m_table_id,
this);
115 std::ostringstream s;
116 s <<
"route-domain:[" 117 <<
"table-id:" << m_table_id <<
" v4:" << m_hw_v4.
to_string()
123 std::shared_ptr<route_domain>
126 return (m_db.find(k));
145 std::shared_ptr<route_domain>
150 return (find_or_add(rd));
153 std::shared_ptr<route_domain>
156 return (m_db.find_or_add(temp.m_table_id, temp));
159 std::shared_ptr<route_domain>
162 return find_or_add(*
this);
174 std::shared_ptr<route_domain_cmds::dump_cmd>
cmd =
175 std::make_shared<route_domain_cmds::dump_cmd>();
180 for (
auto& record : *cmd) {
181 auto& payload = record.get_payload();
203 route_domain::event_handler::handle_replay()
209 route_domain::event_handler::order()
const bool operator==(const route_domain &r) const
comparison operator - for UT
uint32_t table_id_t
type def the table-id
static std::shared_ptr< route_domain > find(const key_t &temp)
Find the instnace of the route domain in the OM.
route::table_id_t table_id() const
Get the table ID.
void db_dump(const DB &db, std::ostream &os)
Print each of the objects in the DB into the stream provided.
std::string to_string() const
Debug print function.
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 rc_t write()
Write/Execute all commands hitherto enqueued.
rc_t rc() const
Get the HW return code.
static const log_level_t DEBUG
std::string to_string() const
convert to string format for debug purposes
key_t key() const
Get the route-domain's key.
static const l3_proto_t IPV4
static const l3_proto_t IPV6
static const table_id_t DEFAULT_TABLE
The table-id for the default table.
singular_db< const key_t, route_domain >::const_iterator const_iterator_t
The iterator type.
static std::shared_ptr< route_domain > get_default()
Return the sigular instance for the default table.
void replay(void)
replay the object to create it in hardware
A command class that creates the IP table.
Tables in which entries are added, e.g bridge/route-domains.
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)
A cmd class that Deletes the IP Table.
dependency_t
There needs to be a strict order in which object types are read from VPP (at boot time) and replayed ...
static const rc_t OK
The HW write was successfull.
static void enqueue(cmd *f)
Enqueue A command for execution.
route_domain(route::table_id_t id)
Construct a new object matching the desried state.
The VPP Object Model (VOM) library.
std::shared_ptr< route_domain > singular() const
Return the matching 'singular instance'.
A representation of a method call to VPP.
static const_iterator_t cbegin()
~route_domain()
Destructor.
static const_iterator_t cend()
static void dump(std::ostream &os)
Dump all route-doamin into the stream provided.
static bool register_listener(listener *listener)
Register a listener of events.
route::table_id_t key_t
The Key for a route-domain.