|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
16 #include <boost/algorithm/string.hpp>
25 std::shared_ptr<interface>
28 std::shared_ptr<interface> sp;
35 reinterpret_cast<const char*
>(vd.interface_dev_type);
70 tag =
std::string(
reinterpret_cast<const char*
>(vd.tag));
86 if (sp && !tag.empty())
94 }
else if ((
name.find(
".") != std::string::npos) && (0 != vd.sub_id)) {
99 std::vector<std::string> parts;
100 std::shared_ptr<interface> parent;
101 boost::split(parts,
name, boost::is_any_of(
"."));
106 interface parent_itf(parts[0],
type,
state, tag);
139 std::shared_ptr<interface>
141 const vapi_payload_sw_interface_vhost_user_details& vd)
143 std::shared_ptr<interface> sp;
153 std::shared_ptr<interface>
155 const vapi_payload_af_packet_details& vd)
157 std::shared_ptr<interface> sp;
168 std::shared_ptr<tap_interface>
170 const vapi_payload_sw_interface_tap_v2_details& vd)
172 std::shared_ptr<tap_interface> sp;
178 if (vd.host_ip4_prefix.len)
180 0, (uint8_t*)vd.host_ip4_prefix.address, vd.host_ip4_prefix.len);
181 else if (vd.host_ip6_prefix.len)
183 1, (uint8_t*)vd.host_ip6_prefix.address, vd.host_ip6_prefix.len);
194 std::shared_ptr<bond_interface>
196 const vapi_payload_sw_interface_bond_details& vd)
198 std::shared_ptr<bond_interface> sp;
214 const vapi_payload_sw_interface_slave_details& vd)
216 std::shared_ptr<bond_member> sp;
228 std::shared_ptr<pipe>
231 std::shared_ptr<pipe> sp;
235 payload.pipe_sw_if_index[1]);
240 sp->set_ends(hdl_pair);
static std::shared_ptr< tap_interface > new_tap_interface(const vapi_payload_sw_interface_tap_v2_details &vd)
The VPP Object Model (VOM) library.
const static prefix_t ZERO
The all Zeros prefix.
static std::shared_ptr< interface > new_af_packet_interface(const vapi_payload_af_packet_details &vd)
const static type_t VXLAN
VXLAN interface.
static const rate_t from_numeric_val(uint8_t v)
Convert VPP's value of the bond to a mode.
vl_api_tunnel_mode_t mode
vl_api_dhcp_client_state_t state
std::shared_ptr< sub_interface > singular() const
Return the matching 'singular instance' of the sub-interface.
static std::shared_ptr< interface > new_vhost_user_interface(const vapi_payload_sw_interface_vhost_user_details &vd)
static type_t from_string(const std::string &str)
Convert VPP's name of the interface to a type.
A bond interface load balance.
static const lb_t from_numeric_val(uint8_t v)
Convert VPP's value of the bond to a lb.
const static type_t LOOPBACK
loopback interface type
const static type_t BOND
bond interface type
const static type_t PIPE
pipe-parent type
@ IF_STATUS_API_FLAG_ADMIN_UP
A representation of an interface in VPP.
const static type_t AFPACKET
AF-Packet interface type.
const static type_t VHOST
vhost-user interface type
std::shared_ptr< interface > singular() const
Return the matching'singular' of the interface.
A type declaration of an interface handle in VPP.
manual_print typedef address
std::shared_ptr< pipe > singular() const
Return the matching 'singular instance' of the sub-interface.
static std::shared_ptr< pipe > new_pipe_interface(const vapi_payload_pipe_details &payload)
static admin_state_t from_int(uint8_t val)
Convert VPP's numerical value to enum type.
const static type_t TAPV2
TAPv2 interface type.
Type def of a L2 address as read from VPP.
const static admin_state_t DOWN
Admin DOWN state.
static bond_member new_bond_member_interface(const vapi_payload_sw_interface_slave_details &vd)
static const mode_t from_numeric_val(uint8_t v)
Convert VPP's value of the bond to a mode.
The admin state of the interface.
std::pair< handle_t, handle_t > handle_pair_t
static std::shared_ptr< interface > new_interface(const vapi_payload_sw_interface_details &vd)
Factory method to construct a new interface from the VPP record.
const static mode_t UNSPECIFIED
Unspecified bond interface mode.
const static type_t UNKNOWN
Unknown type.
static std::shared_ptr< bond_interface > find(const handle_t &hdl)
The the singular instance of the bond interface in the DB by handle.
static std::shared_ptr< bond_interface > new_bond_interface(const vapi_payload_sw_interface_bond_details &vd)
static const mode_t from_numeric_val(uint8_t v)
Convert VPP's value of the bond to a mode.
std::shared_ptr< bond_interface > singular() const
Return the matching 'singular instance' of the BOND interface.
std::shared_ptr< tap_interface > singular() const
Return the matching 'singular instance' of the TAP interface.
const static admin_state_t UP
Admin UP state.
vl_api_fib_path_type_t type
static std::shared_ptr< interface > find(const handle_t &h)
The the singular instance of the interface in the DB by handle.