|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
34 vxlan_tunnel::mode_t::mode_t(
int v,
const std::string s)
64 <<
"src:" <<
src.to_string() <<
" dst:" <<
dst.to_string() <<
" vni:" <<
vni
108 , m_mcast_itf(mcast_itf.singular())
124 , m_rd(rd.singular())
132 , m_mcast_itf(o.m_mcast_itf)
134 , m_table_id(o.m_table_id)
140 return ((m_tep == other.m_tep) && (m_mode == other.m_mode) &&
141 (m_mcast_itf == other.m_mcast_itf));
150 std::shared_ptr<vxlan_tunnel>
153 return std::dynamic_pointer_cast<vxlan_tunnel>(
m_db.find(k));
157 vxlan_tunnel::sweep()
169 vxlan_tunnel::replay()
210 std::ostringstream s;
214 s <<
" " << m_mcast_itf->to_string();
247 if (!m_table_id && m_rd) {
255 std::shared_ptr<vxlan_tunnel>
258 return std::dynamic_pointer_cast<vxlan_tunnel>(singular_i());
261 std::shared_ptr<interface>
262 vxlan_tunnel::singular_i()
const
264 return m_db.find_or_add(
key(), *
this);
274 std::shared_ptr<vxlan_tunnel_cmds::dump_cmd> cmd =
275 std::make_shared<vxlan_tunnel_cmds::dump_cmd>();
280 for (
auto& record : *cmd) {
281 auto& payload = record.get_payload();
282 handle_t hdl(payload.sw_if_index);
284 from_bytes(payload.src_address.af, (uint8_t*)&payload.src_address.un);
286 from_bytes(payload.dst_address.af, (uint8_t*)&payload.dst_address.un);
288 std::shared_ptr<vxlan_tunnel> vt =
289 vxlan_tunnel(
src,
dst, payload.vni).singular();
298 std::shared_ptr<vxlan_gbp_tunnel_cmds::dump_cmd> cmd =
299 std::make_shared<vxlan_gbp_tunnel_cmds::dump_cmd>();
304 for (
auto& record : *cmd) {
305 auto& payload = record.get_payload();
306 handle_t hdl(payload.tunnel.sw_if_index);
310 std::shared_ptr<vxlan_tunnel> vt =
334 vxlan_tunnel::event_handler::handle_replay()
340 vxlan_tunnel::event_handler::order()
const
static std::shared_ptr< vxlan_tunnel > find(const interface::key_t &k)
Fond the singular instance of the interface in the DB by key.
boost::asio::ip::address dst
The destination IP address of the endpoint.
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 mode_t STANDARD
bool operator==(const endpoint_t &o) const
Comparison operator.
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.
static singular_db< key_t, interface > m_db
A map of all interfaces key against the interface's name.
HW::item< handle_t > m_hdl
The SW interface handle VPP has asigned to the interface.
const static l3_proto_t IPV4
vl_api_tunnel_mode_t mode
boost::asio::ip::address from_bytes(uint8_t is_ip6, const uint8_t *bytes)
Convert a VPP byte stinrg into a boost addresss.
const std::string & name() const
Return the interface type.
A Command class that creates an VXLAN tunnel.
uint32_t vni
The VNI of the endpoint.
virtual std::string to_string() const
Debug rpint function.
static bool register_listener(listener *listener)
Register a listener of events.
const static mode_t GBP_L3
const key_t & key() const
Return the interface type.
A functor class that creates an VXLAN tunnel.
A template base class for all enum types.
boost::asio::ip::address src
The src IP address of the endpoint.
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.
A type declaration of an interface handle in VPP.
static void enqueue(cmd *f)
Enqueue A command for execution.
manual_print typedef address
A representation of a VXLAN Tunnel in VPP.
std::string to_string() const
convert to string format for debug purposes
const static log_level_t DEBUG
A functor class that creates an VXLAN tunnel.
const std::string & to_string() const
convert to string format for debug purposes
rc_t rc() const
Get the HW return code.
T & data()
Return the data read/written.
const handle_t & handle() const
Return VPP's handle to this object.
endpoint_t()
Default constructor.
@ VIRTUAL_INTERFACE
virtual interfaces - those that depend on some real interface
const std::string VXLAN_TUNNEL_NAME
const static mode_t GBP_L2
The admin state of the interface.
bool operator==(const vxlan_tunnel &vx) const
comparison operator
std::string to_string() const
Debug print function.
A Command class that creates an VXLAN tunnel.
const static handle_t INVALID
A value of an interface handle_t that means the itf does not exist.
vxlan_tunnel(const boost::asio::ip::address &src, const boost::asio::ip::address &dst, uint32_t vni, const mode_t &mode=mode_t::STANDARD)
Construct a new object matching the desried state.
@ VXLAN_GBP_API_TUNNEL_MODE_L2
std::string key_t
The key for interface's key.
std::shared_ptr< vxlan_tunnel > singular() const
Return the matching 'singular instance'.
const static table_id_t DEFAULT_TABLE
The table-id for the default table.
void release()
release/remove an interface form the singular store
void event_handler(void *tls_async)
const neighbour::flags_t from_api(vapi_enum_ip_neighbor_flags f)
Combaintion of attributes that are a unique key for a VXLAN tunnel.
const static l3_proto_t IPV6