|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
24 namespace ip_route_cmds {
40 return ((m_prefix == other.m_prefix) && (m_id == other.m_id) &&
41 (m_pl == other.m_pl));
47 msg_t req(
con.ctx(), m_pl.size(), std::ref(*
this));
49 auto& payload = req.get_request().get_payload();
51 payload.route.table_id = m_id;
53 payload.is_multipath = 1;
55 payload.route.table_id = m_id;
56 payload.route.prefix =
to_api(m_prefix);
60 to_api(p, payload.route.paths[ii++]);
72 <<
" prefix:" << m_prefix.
to_string() <<
" paths:";
74 s << p.to_string() <<
" ";
91 return ((m_prefix == other.m_prefix) && (m_id == other.m_id));
97 msg_t req(
con.ctx(), 0, std::ref(*
this));
99 auto& payload = req.get_request().get_payload();
101 payload.is_multipath = 0;
103 payload.route.table_id = m_id;
104 payload.route.n_paths = 0;
105 payload.route.table_id = m_id;
106 payload.route.prefix =
to_api(m_prefix);
119 std::ostringstream s;
143 auto& payload =
m_dump->get_request().get_payload();
145 payload.table.table_id = m_id;
146 payload.table.is_ip6 = m_proto.
is_ipv6();
158 return (
"ip-route-v4-dump");
A cmd class that deletes a route.
vapi::Ip_route_dump msg_t
rc_t wait()
Wait on the commands promise.
void set(const rc_t &rc)
Set the HW return code - should only be called from the family of Command objects.
rc_t issue(connection &con)
Issue the command to VPP/HW.
The VPP Object Model (VOM) library.
std::string to_string() const
convert to string format for debug purposes
const static rc_t OK
The HW write was successfull.
std::set< path > path_list_t
A path-list is a set of paths.
A base class for all RPC commands to VPP.
HW::item< handle_t > & m_hw_item
A reference to an object's HW::item that the command will update.
std::unique_ptr< vapi::Ip_route_dump > m_dump
The VAPI event registration.
rc_t issue(connection &con)
Issue the command to VPP/HW.
std::string to_string() const
convert to string format for debug purposes
rc_t issue(connection &con)
Issue the command to VPP/HW.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
A command class that creates or updates the route.
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
A representation of the connection to VPP.
rc_t wait()
Wait for the issue of the command to complete.
const static rc_t NOOP
The HW write/update action was/has not been attempted.
std::string to_string() const
convert to string format for debug purposes
bool operator==(const update_cmd &i) const
Comparison operator - only used for UT.
std::string to_string() const
convert to string format for debug purposes
std::string to_string() const
convert to string format for debug purposes
vapi_enum_ip_neighbor_flags to_api(const neighbour::flags_t &f)
vapi::Ip_route_add_del msg_t
convenient typedef
An L3 protocol can be used to construct a prefix that is used to match packets are part of a route.
A cmd class that Dumps ip fib routes.
update_cmd(HW::item< handle_t > &item, table_id_t id, const prefix_t &prefix, const path_list_t &pl)
Constructor.
dump_cmd()
Default Constructor.
bool operator==(const delete_cmd &i) const
Comparison operator - only used for UT.
uint32_t table_id_t
type def the table-id
Error codes that VPP will return during a HW write.
delete_cmd(HW::item< handle_t > &item, table_id_t id, const prefix_t &prefix)
Constructor.