|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
25 singular_db<ip_punt_redirect::key_t, ip_punt_redirect> ip_punt_redirect::m_db;
32 : m_rx_itf(rx_itf.singular())
33 , m_tx_itf(tx_itf.singular())
41 , m_tx_itf(tx_itf.singular())
47 : m_rx_itf(o.m_rx_itf)
48 , m_tx_itf(o.m_tx_itf)
50 , m_config(o.m_config)
59 m_db.release(
key(),
this);
66 return m_rx_itf->key();
72 ip_punt_redirect::sweep()
77 m_tx_itf->handle(), m_addr));
89 ip_punt_redirect::replay()
94 m_tx_itf->handle(), m_addr));
101 std::ostringstream s;
102 s <<
"IP-punt-redirect:"
103 <<
" rx-itf:" <<
key() <<
" tx-itf:" << m_tx_itf->to_string()
104 <<
" next-hop:" << m_addr;
115 m_tx_itf->handle(), m_addr));
119 std::shared_ptr<ip_punt_redirect>
122 return (m_db.find_or_add(temp.key(), temp));
125 std::shared_ptr<ip_punt_redirect>
128 return find_or_add(*
this);
135 "IP punt redirect configurations",
this);
139 ip_punt_redirect::event_handler::handle_replay()
147 std::shared_ptr<ip_punt_redirect_cmds::dump_cmd> cmd =
148 std::make_shared<ip_punt_redirect_cmds::dump_cmd>();
153 for (
auto& record : *cmd) {
154 auto& payload = record.get_payload();
156 std::shared_ptr<interface> tx_itf =
158 std::shared_ptr<interface> rx_itf =
163 <<
", " << payload.punt.rx_sw_if_index <<
", "
166 if (rx_itf && tx_itf) {
179 ip_punt_redirect::event_handler::order()
const
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 ...
A representation of IP punt_redirect configuration on an interface.
interface::key_t key_t
The key type for ip_punt_redirects.
void db_dump(const DB &db, std::ostream &os)
Print each of the objects in the DB into the stream provided.
static bool register_listener(listener *listener)
Register a listener of events.
static uword ip_punt_redirect(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 arc_index, fib_protocol_t fproto)
const key_t key() const
return the object's key
A representation of an interface in VPP.
ip_punt_redirect(const interface &rx_itf, const interface &tx_itf, const boost::asio::ip::address &addr)
Construct a new object matching the desried state.
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.
manual_print typedef address
std::shared_ptr< ip_punt_redirect > singular() const
Return the 'singular instance' of the ip_punt_redirect that matches this object.
const static log_level_t DEBUG
A cmd class that Unconfigs Ip punt redirect.
A command class that configures the IP punt_redirect.
~ip_punt_redirect()
Destructor.
const static handle_t INVALID
A value of an interface handle_t that means the itf does not exist.
static void dump(std::ostream &os)
Dump all ip_punt_redirects into the stream provided.
@ BINDING
Then L2/objects that bind to interfaces, BD, ACLS, etc.
void event_handler(void *tls_async)
std::string to_string() const
convert to string format for debug purposes
const neighbour::flags_t from_api(vapi_enum_ip_neighbor_flags f)
static std::shared_ptr< interface > find(const handle_t &h)
The the singular instance of the interface in the DB by handle.