16 #include <boost/algorithm/string.hpp> 23 std::shared_ptr<interface>
26 std::shared_ptr<interface> sp;
31 std::string name =
reinterpret_cast<const char*
>(vd.interface_name);
36 l2_address_t l2_address(vd.l2_address, vd.l2_address_length);
42 name = name.substr(5);
49 name = std::string(reinterpret_cast<const char*>(vd.tag));
61 }
else if ((name.find(
".") != std::string::npos) && (0 != vd.sub_id)) {
66 std::vector<std::string> parts;
67 boost::split(parts, name, boost::is_any_of(
"."));
69 interface parent(parts[0], type, state);
static const type_t AFPACKET
AF-Packet interface type.
Type def of a L2 address as read from VPP.
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.
static admin_state_t from_int(uint8_t val)
Convert VPP's numerical value to enum type.
The admin state of the interface.
A representation of an interface in VPP.
A type declaration of an interface handle in VPP.
std::shared_ptr< interface > singular() const
Return the matching'singular' of the interface.
std::shared_ptr< tap_interface > singular() const
Return the matching 'singular instance' of the TAP interface.
static type_t from_string(const std::string &str)
Convert VPP's name of the interface to a type.
vhost_vring_state_t state
static const type_t VXLAN
VXLAN interface.
The VPP Object Model (VOM) library.
static const type_t TAP
TAP interface type.
std::shared_ptr< sub_interface > singular() const
Return the matching 'singular instance' of the sub-interface.