22 namespace ip_route_cmds {
28 payload.is_unreach = 0;
29 payload.is_prohibit = 0;
31 payload.is_classify = 0;
32 payload.is_multipath = 0;
33 payload.is_resolve_host = 0;
34 payload.is_resolve_attached = 0;
37 payload.is_l2_bridged = 1;
42 to_bytes(p.
nh(), &path_v6, payload.next_hop_address);
45 payload.next_hop_table_id = p.
rd()->table_id();
48 payload.next_hop_sw_if_index = p.
itf()->handle().value();
53 payload.is_unreach = 1;
55 payload.is_prohibit = 1;
59 payload.next_hop_weight = p.
weight();
61 payload.next_hop_via_label = 0;
62 payload.classify_table_index = 0;
75 assert(paths.size() == 1);
81 return ((m_prefix == other.m_prefix) && (m_id == other.m_id));
87 msg_t req(con.
ctx(), 0, std::ref(*
this));
89 auto& payload = req.get_request().get_payload();
91 payload.table_id = m_id;
93 payload.is_multipath = 0;
95 m_prefix.
to_vpp(&payload.is_ipv6, payload.dst_address,
96 &payload.dst_address_length);
98 for (
auto& p : m_paths)
111 std::ostringstream s;
113 <<
" prefix:" << m_prefix.
to_string() <<
" paths:" << m_paths;
130 return ((m_prefix == other.m_prefix) && (m_id == other.m_id));
136 msg_t req(con.
ctx(), 0, std::ref(*
this));
138 auto& payload = req.get_request().get_payload();
139 payload.table_id = m_id;
142 m_prefix.
to_vpp(&payload.is_ipv6, payload.dst_address,
143 &payload.dst_address_length);
156 std::ostringstream s;
176 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
188 return (
"ip-route-v4-dump");
204 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
216 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.
nh_proto_t nh_proto() const
HW::item< bool > & m_hw_item
A reference to an object's HW::item that the command will update.
static void to_vpp(const route::path &p, vapi_payload_ip_add_del_route &payload)
delete_cmd(HW::item< bool > &item, table_id_t id, const prefix_t &prefix)
Constructor.
A cmd class that Dumps ipv6 fib.
bool operator==(const update_cmd &i) const
Comparison operator - only used for UT.
static const special_t STANDARD
A standard path type.
A command class that creates or updates the route.
dump_v4_cmd()
Constructor.
A path for IP or MPLS routes.
update_cmd(HW::item< bool > &item, table_id_t id, const prefix_t &prefix, const path_list_t &paths)
Constructor.
Error codes that VPP will return during a HW write.
std::shared_ptr< interface > itf() const
std::string to_string() const
convert to string format for debug purposes
std::string to_string() const
convert to string format for debug purposes
bool operator==(const delete_cmd &i) const
Comparison operator - only used for UT.
static const special_t LOCAL
A local/for-us/recieve.
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
static const special_t DROP
drop path
rc_t issue(connection &con)
Issue the command to VPP/HW.
void to_bytes(const boost::asio::ip::address_v6 &addr, uint8_t *array)
A representation of the connection to VPP.
std::string to_string() const
convert to string format for debug purposes
static const special_t UNREACH
a path will return ICMP unreachables
std::shared_ptr< route_domain > rd() const
HW::item< bool > & item()
return the HW item the command updates
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.
void to_vpp(uint8_t *is_ip6, uint8_t *addr, uint8_t *len) const
Convert the prefix into VPP API parameters.
static const special_t PROHIBIT
a path will return ICMP prohibit
std::set< path > path_list_t
A path-list is a set of paths.
uint8_t preference() const
static const rc_t OK
The HW write was successfull.
A cmd class that deletes a route.
dump_v6_cmd()
Constructor.
const boost::asio::ip::address & nh() const
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.
vapi::Ip_add_del_route msg_t
convenient typedef
special_t type() const
Getters.
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 wait()
Wait on the commands promise.
static const nh_proto_t ETHERNET