|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
23 singular_db<gbp_endpoint::key_t, gbp_endpoint> gbp_endpoint::m_db;
33 gbp_endpoint::flags_t::flags_t(
int v,
const std::string& s)
40 const std::vector<boost::asio::ip::address>& ip_addrs,
45 , m_itf(itf.singular())
48 , m_epg(epg.singular())
59 , m_flags(gbpe.m_flags)
66 m_db.release(
key(),
this);
72 return (std::make_pair(m_itf->key(), m_mac));
78 return ((
key() == gbpe.
key()) && (m_epg == gbpe.m_epg) &&
79 (m_flags == gbpe.m_flags));
96 m_hdl, m_itf->handle(), m_ips, m_mac, m_epg->sclass(), m_flags));
103 std::ostringstream s;
104 s <<
"gbp-endpoint:[" << m_itf->to_string() <<
", ips:[";
106 for (
auto ip : m_ips)
109 s <<
"], " << m_mac.
to_string() <<
", epg:" << m_epg->to_string() <<
"]";
119 m_hdl, m_itf->handle(), m_ips, m_mac, m_epg->sclass(), m_flags));
123 std::shared_ptr<gbp_endpoint>
126 return (m_db.find_or_add(temp.key(), temp));
129 std::shared_ptr<gbp_endpoint>
132 return (m_db.find(k));
135 std::shared_ptr<gbp_endpoint>
138 return find_or_add(*
this);
154 gbp_endpoint::event_handler::handle_replay()
162 std::shared_ptr<gbp_endpoint_cmds::dump_cmd> cmd =
163 std::make_shared<gbp_endpoint_cmds::dump_cmd>();
168 for (
auto& record : *cmd) {
169 auto& payload = record.get_payload();
171 std::vector<boost::asio::ip::address> addresses;
173 for (uint8_t n = 0; n < payload.endpoint.n_ips; n++)
174 addresses.push_back(
from_api(payload.endpoint.ips[n]));
175 std::shared_ptr<interface> itf =
177 std::shared_ptr<gbp_endpoint_group> epg =
190 <<
"no interface:" << payload.endpoint.sw_if_index
191 <<
"or sclass:" << payload.endpoint.sclass;
197 gbp_endpoint::event_handler::order()
const
211 os <<
key.first <<
"," <<
key.second;
const static flags_t EXTERNAL
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.
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 ...
std::shared_ptr< gbp_endpoint > singular() const
Return the matching 'singular instance'.
const static rc_t OK
The HW write was successfull.
A command class that creates or updates the GBP endpoint.
~gbp_endpoint()
Destructor.
std::pair< interface::key_t, mac_address_t > key_t
The key for a GBP endpoint; interface and IP.
@ ENTRY
Entries in Tables.
vnet_hw_if_output_node_runtime_t * r
A cmd class that deletes a GBP endpoint.
void db_dump(const DB &db, std::ostream &os)
Print each of the objects in the DB into the stream provided.
gbp_endpoint(const interface &itf, const std::vector< boost::asio::ip::address > &ip_addr, const mac_address_t &mac, const gbp_endpoint_group &epg, const flags_t &flags=flags_t::NONE)
Construct a GBP endpoint.
const static flags_t BOUNCE
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.
const static flags_t LEARNT
A representation of an interface in VPP.
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 dump(std::ostream &os)
Dump all bridge_domain-doamin into the stream provided.
const key_t key() const
Return the object's key.
A type declaration of an interface handle in VPP.
static void enqueue(cmd *f)
Enqueue A command for execution.
std::string to_string() const
Convert to string for debugging.
bool operator==(const gbp_endpoint &bdae) const
comparison operator
const static log_level_t DEBUG
std::ostream & operator<<(std::ostream &os, const std::pair< direction_t, interface::key_t > &key)
const static flags_t REMOTE
rc_t rc() const
Get the HW return code.
void replay(void)
replay the object to create it in hardware
std::string to_string() const
String conversion.
Type def of a Ethernet address.
const static flags_t NONE
static std::shared_ptr< gbp_endpoint > find(const key_t &k)
Find the instnace of the bridge_domain domain in the OM.
void event_handler(void *tls_async)
A entry in the ARP termination table of a Bridge Domain.
const static log_level_t ERROR
const neighbour::flags_t from_api(vapi_enum_ip_neighbor_flags f)
static std::shared_ptr< interface > find(const handle_t &h)
The the singular instance of the interface in the DB by handle.
vl_api_wireguard_peer_flags_t flags