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");
uint32_t table_id_t
type def the table-id
static const 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
std::string to_string() const
convert to string format for debug purposes
A command class that creates or updates the route.
std::string to_string() const
convert to string format for debug purposes
A cmd class that Dumps ip fib routes.
Error codes that VPP will return during a HW write.
An L3 protocol can be used to construct a prefix that is used to match packets are part of a route...
rc_t issue(connection &con)
Issue the command to VPP/HW.
vapi::Ip_route_dump msg_t
vapi_enum_ip_neighbor_flags to_api(const neighbour::flags_t &f)
rc_t wait()
Wait on the commands promise.
std::string to_string() const
convert to string format for debug purposes
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
update_cmd(HW::item< handle_t > &item, table_id_t id, const prefix_t &prefix, const path_list_t &pl)
Constructor.
A representation of the connection to VPP.
dump_cmd()
Default Constructor.
std::string to_string() const
convert to string format for debug purposes
rc_t issue(connection &con)
Issue the command to VPP/HW.
A base class for all RPC commands to VPP.
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
std::set< path > path_list_t
A path-list is a set of paths.
static const rc_t OK
The HW write was successfull.
A cmd class that deletes a route.
rc_t wait()
Wait for the issue of the command to complete.
delete_cmd(HW::item< handle_t > &item, table_id_t id, const prefix_t &prefix)
Constructor.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
rc_t issue(connection &con)
Issue the command to VPP/HW.
The VPP Object Model (VOM) library.
void set(const rc_t &rc)
Set the HW return code - should only be called from the family of Command objects.
std::unique_ptr< vapi::Ip_route_dump > m_dump
The VAPI event registration.
bool operator==(const update_cmd &i) const
Comparison operator - only used for UT.
bool operator==(const delete_cmd &i) const
Comparison operator - only used for UT.
HW::item< handle_t > & m_hw_item
A reference to an object's HW::item that the command will update.
HW::item< handle_t > & item()
return the HW item the command updates
vapi::Ip_route_add_del msg_t
convenient typedef