|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
23 gbp_subnet::type_t::type_t(
int v,
const std::string s)
38 singular_db<gbp_subnet::key_t, gbp_subnet> gbp_subnet::m_db;
62 , m_type(
type_t::STITCHED_EXTERNAL)
63 , m_recirc(recirc.singular())
64 , m_epg(epg.singular())
86 , m_prefix(o.m_prefix)
88 , m_recirc(o.m_recirc)
90 , m_sclass(o.m_sclass)
97 m_db.release(
key(),
this);
103 return (std::make_pair(m_rd->key(), m_prefix));
109 return ((
key() == gs.
key()) && (m_type == gs.m_type) &&
110 (m_recirc == gs.m_recirc) && (m_epg == gs.m_epg) &&
111 (m_sclass == gs.m_sclass));
128 m_hw, m_rd->id(), m_prefix, m_type,
130 (m_epg ? m_epg->sclass() : m_sclass)));
137 std::ostringstream s;
138 s <<
"gbp-subnet:[" << m_type.
to_string() <<
", " << m_rd->to_string() <<
":"
141 s <<
", " << m_recirc->to_string();
143 s <<
", " << m_epg->to_string();
155 m_hw, m_rd->id(), m_prefix, m_type,
157 (m_epg ? m_epg->sclass() : m_sclass)));
159 if (m_type !=
r.m_type) {
161 m_recirc =
r.m_recirc;
165 m_hw, m_rd->id(), m_prefix, m_type,
167 (m_epg ? m_epg->sclass() : m_sclass)));
172 std::shared_ptr<gbp_subnet>
173 gbp_subnet::find_or_add(
const gbp_subnet& temp)
175 return (m_db.find_or_add(temp.key(), temp));
178 std::shared_ptr<gbp_subnet>
181 return (m_db.find(k));
184 std::shared_ptr<gbp_subnet>
187 return find_or_add(*
this);
203 gbp_subnet::event_handler::handle_replay()
211 std::shared_ptr<gbp_subnet_cmds::dump_cmd> cmd =
212 std::make_shared<gbp_subnet_cmds::dump_cmd>();
217 for (
auto& record : *cmd) {
218 auto& payload = record.get_payload();
220 route::prefix_t pfx =
from_api(payload.subnet.prefix);
221 std::shared_ptr<gbp_route_domain> rd =
225 switch (payload.subnet.type) {
233 gbp_subnet gs(*rd, pfx, type_t::STITCHED_INTERNAL);
239 gbp_subnet gs(*rd, pfx, payload.subnet.sclass);
245 gbp_subnet gs(*rd, pfx, payload.subnet.sclass, type_t::ANON_L3_OUT);
251 std::shared_ptr<interface> itf =
253 std::shared_ptr<gbp_endpoint_group> epg =
272 gbp_subnet::event_handler::order()
const
286 os <<
"[" <<
key.first <<
", " <<
key.second <<
"]";
static rc_t write()
Write/Execute all commands hitherto enqueued.
static rc_t commit(const client_db::key_t &key, const OBJ &obj)
Make the State in VPP reflect the expressed desired state.
const static type_t STITCHED_INTERNAL
Internal subnet is reachable through the source EPG's uplink interface.
gbp_subnet(const gbp_route_domain &rd, const route::prefix_t &prefix, const type_t &type)
Construct an internal GBP subnet.
@ GBP_API_SUBNET_ANON_L3_OUT
The VPP Object Model (VOM) library.
static void register_handler(const std::vector< std::string > &cmds, const std::string &help, command_handler *ch)
Register a command handler for inspection.
dependency_t
There needs to be a strict order in which object types are read from VPP (at boot time) and replayed ...
const static rc_t OK
The HW write was successfull.
const static type_t ANON_L3_OUT
An anonymous L3-out subnet.
static std::shared_ptr< gbp_subnet > find(const key_t &k)
Find the instnace of the bridge_domain domain in the OM.
bool operator==(const gbp_subnet &bdae) const
comparison operator
@ ENTRY
Entries in Tables.
vnet_hw_if_output_node_runtime_t * r
@ GBP_API_SUBNET_STITCHED_INTERNAL
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
Convert to string for debugging.
std::string to_string() const
convert to string format for debug purposes
static bool register_listener(listener *listener)
Register a listener of events.
static std::shared_ptr< gbp_endpoint_group > find(const key_t &k)
Find the instnace of the bridge_domain domain in the OM.
A recirculation interface for GBP use pre/post NAT.
A cmd class that deletes a GBP subnet.
void replay(void)
replay the object to create it in hardware
const typedef std::string key_t
In the opflex world each entity is known by a URI which can be converted into a string.
static void enqueue(cmd *f)
Enqueue A command for execution.
const static log_level_t DEBUG
std::ostream & operator<<(std::ostream &os, const std::pair< direction_t, interface::key_t > &key)
@ GBP_API_SUBNET_STITCHED_EXTERNAL
A command class that creates or updates the GBP subnet.
const static type_t STITCHED_EXTERNAL
External subnet requires NAT translation before egress.
const std::string & to_string() const
convert to string format for debug purposes
rc_t rc() const
Get the HW return code.
static void dump(std::ostream &os)
Dump all bridge_domain-doamin into the stream provided.
const static type_t TRANSPORT
A transport subnet, sent via the RD's UU-fwd interface.
std::shared_ptr< gbp_subnet > singular() const
Return the matching 'singular instance'.
A entry in the ARP termination table of a Route Domain.
const static handle_t INVALID
A value of an interface handle_t that means the itf does not exist.
const static type_t L3_OUT
A L3-out subnet.
const key_t key() const
Return the object's key.
std::pair< gbp_route_domain::key_t, route::prefix_t > key_t
The key for a GBP subnet; table and prefix.
void event_handler(void *tls_async)
A entry in the ARP termination table of a Bridge Domain.
const neighbour::flags_t from_api(vapi_enum_ip_neighbor_flags f)
vl_api_fib_path_type_t type
@ GBP_API_SUBNET_TRANSPORT
static std::shared_ptr< gbp_recirc > find(const key_t &k)
Find the instnace of the recirc interface in the OM.
static std::shared_ptr< interface > find(const handle_t &h)
The the singular instance of the interface in the DB by handle.
static std::shared_ptr< gbp_route_domain > find(const key_t &k)
Find the instnace of the route_domain domain in the OM.