19 #include <vapi/vpe.api.vapi.hpp> 22 tap_interface::event_handler tap_interface::m_evh;
42 , m_l2_address(l2_address)
54 , m_prefix(o.m_prefix)
55 , m_l2_address(o.m_l2_address)
60 tap_interface::mk_create_cmd(std::queue<cmd*>& q)
69 tap_interface::mk_delete_cmd(std::queue<cmd*>& q)
76 std::shared_ptr<tap_interface>
79 return std::dynamic_pointer_cast<
tap_interface>(singular_i());
82 std::shared_ptr<interface>
83 tap_interface::singular_i()
const 85 return m_db.find_or_add(
name(), *
this);
94 std::shared_ptr<tap_interface_cmds::dump_cmd>
cmd =
95 std::make_shared<tap_interface_cmds::dump_cmd>();
100 for (
auto& record : *cmd) {
101 auto& payload = record.get_payload();
103 std::string
name =
reinterpret_cast<const char*
>(payload.dev_name);
119 tap_interface::event_handler::event_handler()
126 tap_interface::event_handler::handle_replay()
132 tap_interface::event_handler::order()
const void release()
release/remove an interface form the singular store
const std::string key_t
In the opflex world each entity is known by a URI which can be converted into a string.
HW::item< handle_t > m_hdl
The SW interface handle VPP has asigned to the interface.
virtual void sweep(void)
Sweep/reap the object if still stale.
static void register_handler(const std::vector< std::string > &cmds, const std::string &help, command_handler *ch)
Register a command handler for inspection.
static rc_t write()
Write/Execute all commands hitherto enqueued.
static const log_level_t DEBUG
Type def of a L2 address as read from VPP.
static singular_db< key_t, interface > m_db
A map of all interfaces key against the interface's name.
const l2_address_t & l2_address() const
Return the L2 Address.
A functor class that creates an interface.
The admin state of the interface.
A representation of an interface in VPP.
static rc_t commit(const client_db::key_t &key, const OBJ &obj)
Make the State in VPP reflect the expressed desired state.
std::shared_ptr< tap_interface > singular() const
Return the matching 'singular instance' of the TAP interface.
dependency_t
There needs to be a strict order in which object types are read from VPP (at boot time) and replayed ...
const std::string & name() const
Return the interface type.
static void enqueue(cmd *f)
Enqueue A command for execution.
A functor class that deletes a Tap interface.
vhost_vring_state_t state
The VPP Object Model (VOM) library.
static const admin_state_t UP
Admin UP state.
A representation of a method call to VPP.
tap_interface(const std::string &name, admin_state_t state, route::prefix_t prefix)
Construct a new object matching the desried state.
static const prefix_t ZERO
The all Zeros prefix.
virtual std::string to_string(void) const
convert to string format for debug purposes
static bool register_listener(listener *listener)
Register a listener of events.
const key_t & key() const
Return the interface type.
interfaces are the root of the dependency graph