22 gbp_recirc::type_t::type_t(
int v,
const std::string s)
23 : enum_base<gbp_recirc::type_t>(v, s)
30 singular_db<gbp_recirc::key_t, gbp_recirc> gbp_recirc::m_db;
38 , m_itf(itf.singular())
40 , m_epg(epg.singular())
55 m_db.release(
key(),
this);
61 return (m_itf->key());
67 return m_itf->handle();
73 return ((
key() == gbpe.
key()) && (m_type == gbpe.m_type) &&
74 (m_itf == gbpe.m_itf) && (m_epg == gbpe.m_epg));
99 s <<
"gbp-recirc:[" << m_itf->to_string() <<
", type:" << m_type.
to_string()
100 <<
", " << m_epg->to_string() <<
"]";
114 std::shared_ptr<gbp_recirc>
115 gbp_recirc::find_or_add(
const gbp_recirc& temp)
117 return (m_db.find_or_add(temp.
key(), temp));
120 std::shared_ptr<gbp_recirc>
123 return (m_db.find(k));
126 std::shared_ptr<gbp_recirc>
129 return find_or_add(*
this);
145 gbp_recirc::event_handler::handle_replay()
153 std::shared_ptr<gbp_recirc_cmds::dump_cmd>
cmd =
154 std::make_shared<gbp_recirc_cmds::dump_cmd>();
159 for (
auto& record : *cmd) {
160 auto& payload = record.get_payload();
162 std::shared_ptr<interface> itf =
164 std::shared_ptr<gbp_endpoint_group> epg =
168 <<
", " << payload.recirc.sclass <<
"]";
182 gbp_recirc::event_handler::order()
const void replay(void)
replay the object to create it in hardware
std::shared_ptr< gbp_recirc > singular() const
Return the matching 'singular instance'.
void db_dump(const DB &db, std::ostream &os)
Print each of the objects in the DB into the stream provided.
bool operator==(const gbp_recirc &bdae) const
comparison operator
const std::string key_t
In the opflex world each entity is known by a URI which can be converted into a string.
const handle_t & handle() const
return the recirculation interface's handle
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.
rc_t rc() const
Get the HW return code.
static const log_level_t DEBUG
std::string to_string() const
Convert to string for debugging.
const key_t key() const
Return the object's key.
static void dump(std::ostream &os)
Dump all bridge_domain-doamin into the stream provided.
vl_api_fib_path_type_t type
interface::key_t key_t
The key for a GBP recirc interface.
A recirculation interface for GBP use pre/post NAT.
A cmd class that deletes a GBP recirc.
A command class that creates or updates the GBP recirc.
A representation of an interface in VPP.
A entry in the ARP termination table of a Bridge Domain.
static const type_t EXTERNAL
External recirculation interfaces accept post-NAT translation traffic from the internal EPG and injec...
A type declaration of an interface handle in VPP.
const std::string & to_string() const
convert to string format for debug purposes
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 const rc_t OK
The HW write was successfull.
static void enqueue(cmd *f)
Enqueue A command for execution.
gbp_recirc(const interface &itf, const type_t &type, const gbp_endpoint_group &epg)
Construct a GBP recirc.
static std::shared_ptr< gbp_recirc > find(const key_t &k)
Find the instnace of the recirc interface in the OM.
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 const type_t INTERNAL
Internal recirclation interfaces accept per-NAT translation traffic from the external/NAT EPG and inj...
static std::shared_ptr< gbp_endpoint_group > find(const key_t &k)
Find the instnace of the bridge_domain domain in the OM.
static bool register_listener(listener *listener)
Register a listener of events.