23 namespace ip_route_cmds {
39 return ((m_prefix == other.m_prefix) && (m_id == other.m_id) &&
40 (m_path == other.m_path));
46 msg_t req(con.
ctx(), 0, std::ref(*
this));
48 auto& payload = req.get_request().get_payload();
50 payload.table_id = m_id;
52 payload.is_multipath = 0;
54 m_prefix.
to_vpp(&payload.is_ipv6, payload.dst_address,
55 &payload.dst_address_length);
87 return ((m_prefix == other.m_prefix) && (m_id == other.m_id) &&
88 (m_path == other.m_path));
94 msg_t req(con.
ctx(), 0, std::ref(*
this));
96 auto& payload = req.get_request().get_payload();
97 payload.table_id = m_id;
100 m_prefix.
to_vpp(&payload.is_ipv6, payload.dst_address,
101 &payload.dst_address_length);
115 std::ostringstream s;
135 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
147 return (
"ip-route-v4-dump");
163 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
175 return (
"ip-route-v6-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.
A cmd class that Dumps ipv6 fib.
bool operator==(const update_cmd &i) const
Comparison operator - only used for UT.
A command class that creates or updates the route.
void to_vpp(const route::path &p, vapi_payload_ip_add_del_route &payload)
dump_v4_cmd()
Constructor.
A path for IP or MPLS routes.
std::string to_string() const
convert to string format for debug purposes
Error codes that VPP will return during a HW write.
std::string to_string() const
convert to string format for debug purposes
std::string to_string() const
convert to string format for debug purposes
rc_t wait()
Wait on the commands promise.
bool operator==(const delete_cmd &i) const
Comparison operator - only used for UT.
bool operator==(const dump_v4_cmd &i) const
Comparison operator - only used for UT.
std::string to_string() const
convert to string format for debug purposes
rc_t issue(connection &con)
Issue the command to VPP/HW.
A representation of the connection to VPP.
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_v6_cmd &i) const
Comparison operator - only used for UT.
A base class for all RPC commands to VPP.
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
delete_cmd(HW::item< bool > &item, table_id_t id, const prefix_t &prefix, const path &path)
Constructor.
void to_vpp(uint8_t *is_ip6, uint8_t *addr, uint8_t *len) const
Convert the prefix into VPP API parameters.
static const rc_t OK
The HW write was successfull.
A cmd class that deletes a route.
dump_v6_cmd()
Constructor.
update_cmd(HW::item< bool > &item, table_id_t id, const prefix_t &prefix, const path &path)
Constructor.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
A cmd class that Dumps ipv4 fib.
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
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.
std::string to_string() const
convert to string format for debug purposes
HW::item< bool > & m_hw_item
A reference to an object's HW::item that the command will update.
HW::item< bool > & item()
return the HW item the command updates
vapi::Ip_add_del_route msg_t
convenient typedef