|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
27 #define N_ENDS (WEST + 1)
34 return (
"pipe" + std::to_string(
instance));
54 , m_instance(o.m_instance)
65 << m_hdl_pair.
data().first <<
", " << m_hdl_pair.
data().second <<
"]]";
71 pipe::mk_create_cmd(std::queue<cmd*>& q)
79 pipe::mk_delete_cmd(std::queue<cmd*>& q)
81 q.push(
new pipe_cmds::delete_cmd(
m_hdl, m_hdl_pair));
89 return std::dynamic_pointer_cast<pipe>(singular_i());
92 std::shared_ptr<interface>
93 pipe::singular_i()
const
95 return m_db.find_or_add(
key(), *
this);
101 return std::dynamic_pointer_cast<pipe>(
m_db.find(k));
104 std::shared_ptr<interface>
109 m_ends[
WEST] = pipe_end(*
this,
WEST).singular();
110 m_ends[
WEST]->set(m_hdl_pair.
data().first);
114 return (m_ends[
WEST]);
117 std::shared_ptr<interface>
122 m_ends[
EAST] = pipe_end(*
this,
EAST).singular();
123 m_ends[
EAST]->set(m_hdl_pair.
data().first);
127 return (m_ends[
EAST]);
130 pipe::pipe_end::pipe_end(
const pipe& p, uint8_t
id)
134 , m_pipe(p.singular())
139 pipe::pipe_end::mk_create_cmd(std::queue<cmd*>& q)
145 pipe::pipe_end::mk_delete_cmd(std::queue<cmd*>& q)
167 pipe::event_handler::handle_replay()
175 std::shared_ptr<pipe_cmds::dump_cmd> cmd =
176 std::make_shared<pipe_cmds::dump_cmd>();
181 for (
auto& record : *cmd) {
182 std::shared_ptr<pipe> sp;
192 pipe::event_handler::order()
const
A functor class that creates an interface.
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 ...
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.
std::shared_ptr< interface > east()
The interface that is the east end of the pipe.
vl_api_dhcp_client_state_t state
void db_dump(const DB &db, std::ostream &os)
Print each of the objects in the DB into the stream provided.
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.
static const std::string pipe_mk_name(uint32_t instance)
const key_t & key() const
Return the interface type.
virtual void sweep(void)
Sweep/reap the object if still stale.
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 enqueue(cmd *f)
Enqueue A command for execution.
static std::shared_ptr< pipe > find(const key_t &k)
Find a subinterface from its key.
std::shared_ptr< pipe > singular() const
Return the matching 'singular instance' of the sub-interface.
const static rc_t INVALID
HW write reported invalid input.
const static log_level_t DEBUG
static std::shared_ptr< pipe > new_pipe_interface(const vapi_payload_pipe_details &payload)
const std::string & to_string() const
convert to string format for debug purposes
std::shared_ptr< interface > west()
The interface that is the west end of the pipe.
rc_t rc() const
Get the HW return code.
void set_ends(const handle_pair_t &p)
T & data()
Return the data read/written.
@ VIRTUAL_INTERFACE
virtual interfaces - those that depend on some real interface
The admin state of the interface.
std::pair< handle_t, handle_t > handle_pair_t
const static handle_t INVALID
A value of an interface handle_t that means the itf does not exist.
std::string key_t
The key for interface's key.
void release()
release/remove an interface form the singular store
void event_handler(void *tls_async)
virtual std::string to_string(void) const
convert to string format for debug purposes