22 route_domain::event_handler route_domain::m_evh;
27 singular_db<route::table_id_t, route_domain> route_domain::m_db;
42 , m_table_id(o.m_table_id)
49 return (m_table_id == r.m_table_id);
96 m_db.release(m_table_id,
this);
102 std::ostringstream s;
103 s <<
"route-domain:[" 104 <<
"table-id:" << m_table_id <<
" v4:" << m_hw_v4.
to_string()
110 std::shared_ptr<route_domain>
113 std::shared_ptr<route_domain> rd;
115 auto it = m_db.cbegin();
117 while (it != m_db.cend()) {
122 auto key = it->first;
125 rd = it->second.lock();
151 std::shared_ptr<route_domain>
156 return (find_or_add(rd));
159 std::shared_ptr<route_domain>
162 return (m_db.find_or_add(temp.m_table_id, temp));
165 std::shared_ptr<route_domain>
168 return find_or_add(*
this);
182 route_domain::event_handler::event_handler()
189 route_domain::event_handler::handle_replay()
195 route_domain::event_handler::order()
const uint32_t table_id_t
type def the table-id
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.
std::string to_string() const
convert to string format for debug purposes
static std::shared_ptr< route_domain > find(const route_domain &temp)
Find the instnace of the route domain in the OM.
rc_t rc() const
Get the HW return code.
static const l3_proto_t IPV4
route::table_id_t table_id() const
Get the table ID.
static const l3_proto_t IPV6
static const table_id_t DEFAULT_TABLE
The table-id for the default table.
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.
std::shared_ptr< route_domain > singular() const
Return the matching 'singular instance'.
Tables in which entries are added, e.g bridge/route-domains.
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.
bool operator==(const route_domain &r) const
comparison operator - for UT
std::string to_string() const
Debug print function.
route_domain(route::table_id_t id)
Construct a new object matching the desried state.
key_t key() const
Get the route-domain's key.
The VPP Object Model (VOM) library.
~route_domain()
Destructor.
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.