|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
22 singular_db<neighbour::key_t, neighbour> neighbour::m_db;
49 , m_ip_addr(n.m_ip_addr)
60 m_db.release(
key(),
this);
66 return ((
key() == n.
key()) && (m_mac == n.m_mac));
72 return (std::make_pair(m_itf->key(), m_ip_addr));
98 s <<
"neighbour:[" << m_itf->to_string() <<
", " << m_mac.
to_string() <<
", "
99 << m_ip_addr.to_string() <<
" " << m_flags.
to_string() <<
"]";
112 m_ip_addr, m_flags));
116 std::shared_ptr<neighbour>
117 neighbour::find_or_add(
const neighbour& temp)
119 return (m_db.find_or_add(temp.key(), temp));
122 std::shared_ptr<neighbour>
125 return (m_db.find(k));
128 std::shared_ptr<neighbour>
131 return find_or_add(*
this);
143 os <<
"[" <<
key.first <<
", " <<
key.second <<
"]";
155 neighbour::event_handler::handle_replay()
162 std::shared_ptr<interface> itf,
163 const l3_proto_t&
proto)
168 std::shared_ptr<neighbour_cmds::dump_cmd> cmd =
169 std::make_shared<neighbour_cmds::dump_cmd>(
170 neighbour_cmds::dump_cmd(itf->handle(),
proto));
175 for (
auto& record : *cmd) {
179 auto& payload = record.get_payload();
183 neighbour::flags_t
f =
from_api(payload.neighbor.flags);
188 <<
mac.to_string() <<
" " << ip_addr.to_string()
189 <<
" " <<
f.to_string();
214 neighbour::event_handler::order()
const
neighbour(const interface &itf, const boost::asio::ip::address &ip_addr, const mac_address_t &mac, const flags_t flags=flags_t::STATIC)
Construct an ARP entry.
static rc_t write()
Write/Execute all commands hitherto enqueued.
static const_iterator_t cend()
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.
const key_t key() const
Return the object's key.
const static l3_proto_t IPV4
static void dump(std::ostream &os)
Dump all neighbours into the stream provided.
std::pair< interface::key_t, boost::asio::ip::address > key_t
The key for a neighbour entry; the interface and IP address.
A entry in the neighbour entry (ARP or IPv6 ND)
@ ENTRY
Entries in Tables.
vnet_hw_if_output_node_runtime_t * r
const static flags_t STATIC
void db_dump(const DB &db, std::ostream &os)
Print each of the objects in the DB into the stream provided.
bool operator==(const neighbour &n) const
Comparison operator.
static bool register_listener(listener *listener)
Register a listener of events.
std::shared_ptr< neighbour > singular() const
Return the matching 'singular instance'.
A template base class for all enum types.
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.
std::string to_string() const
Convert to string for debugging.
static void enqueue(cmd *f)
Enqueue A command for execution.
manual_print typedef address
void replay(void)
replay the object to create it in hardware
save_rewrite_length must be aligned so that reass doesn t overwrite it
const static log_level_t DEBUG
std::ostream & operator<<(std::ostream &os, const std::pair< direction_t, interface::key_t > &key)
A command class that creates or updates the bridge domain ARP Entry.
const std::string & to_string() const
convert to string format for debug purposes
rc_t rc() const
Get the HW return code.
A cmd class that deletes a bridge domain ARP entry.
std::string to_string() const
String conversion.
Type def of a Ethernet address.
static const_iterator_t cbegin()
static std::shared_ptr< neighbour > find(const key_t &k)
Find the neighbour fromits key.
void event_handler(void *tls_async)
const static flags_t NO_FIB_ENTRY
flags_t(int v, const std::string s)
Constructor.
const static flags_t NONE
const neighbour::flags_t from_api(vapi_enum_ip_neighbor_flags f)
const static l3_proto_t IPV6
vl_api_wireguard_peer_flags_t flags