|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
62 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
71 #define foreach_ip_api_msg \
72 _ (SW_INTERFACE_IP6_ENABLE_DISABLE, sw_interface_ip6_enable_disable) \
73 _ (IP_TABLE_DUMP, ip_table_dump) \
74 _ (IP_ROUTE_DUMP, ip_route_dump) \
75 _ (IP_ROUTE_V2_DUMP, ip_route_v2_dump) \
76 _ (IP_MTABLE_DUMP, ip_mtable_dump) \
77 _ (IP_MROUTE_DUMP, ip_mroute_dump) \
78 _ (IP_MROUTE_ADD_DEL, ip_mroute_add_del) \
79 _ (MFIB_SIGNAL_DUMP, mfib_signal_dump) \
80 _ (IP_ADDRESS_DUMP, ip_address_dump) \
81 _ (IP_UNNUMBERED_DUMP, ip_unnumbered_dump) \
82 _ (IP_DUMP, ip_dump) \
83 _ (IP_TABLE_REPLACE_BEGIN, ip_table_replace_begin) \
84 _ (IP_TABLE_REPLACE_END, ip_table_replace_end) \
85 _ (IP_TABLE_FLUSH, ip_table_flush) \
86 _ (IP_ROUTE_ADD_DEL, ip_route_add_del) \
87 _ (IP_ROUTE_ADD_DEL_V2, ip_route_add_del_v2) \
88 _ (IP_ROUTE_LOOKUP, ip_route_lookup) \
89 _ (IP_ROUTE_LOOKUP_V2, ip_route_lookup_v2) \
90 _ (IP_TABLE_ADD_DEL, ip_table_add_del) \
91 _ (IP_PUNT_POLICE, ip_punt_police) \
92 _ (IP_PUNT_REDIRECT, ip_punt_redirect) \
93 _ (SET_IP_FLOW_HASH, set_ip_flow_hash) \
94 _ (SET_IP_FLOW_HASH_V2, set_ip_flow_hash_v2) \
95 _ (SET_IP_FLOW_HASH_ROUTER_ID, set_ip_flow_hash_router_id) \
96 _ (IP_CONTAINER_PROXY_ADD_DEL, ip_container_proxy_add_del) \
97 _ (IP_CONTAINER_PROXY_DUMP, ip_container_proxy_dump) \
98 _ (IOAM_ENABLE, ioam_enable) \
99 _ (IOAM_DISABLE, ioam_disable) \
100 _ (IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL, \
101 ip_source_and_port_range_check_add_del) \
102 _ (IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL, \
103 ip_source_and_port_range_check_interface_add_del) \
104 _ (SW_INTERFACE_IP6_SET_LINK_LOCAL_ADDRESS, \
105 sw_interface_ip6_set_link_local_address) \
106 _ (SW_INTERFACE_IP6_GET_LINK_LOCAL_ADDRESS, \
107 sw_interface_ip6_get_link_local_address) \
108 _ (IP_REASSEMBLY_SET, ip_reassembly_set) \
109 _ (IP_REASSEMBLY_GET, ip_reassembly_get) \
110 _ (IP_REASSEMBLY_ENABLE_DISABLE, ip_reassembly_enable_disable) \
111 _ (IP_PUNT_REDIRECT_DUMP, ip_punt_redirect_dump) \
112 _ (IP_PATH_MTU_UPDATE, ip_path_mtu_update) \
113 _ (IP_PATH_MTU_REPLACE_BEGIN, ip_path_mtu_replace_begin) \
114 _ (IP_PATH_MTU_REPLACE_END, ip_path_mtu_replace_end) \
115 _ (IP_PATH_MTU_GET, ip_path_mtu_get)
121 vl_api_sw_interface_ip6_enable_disable_reply_t *rmp;
132 REPLY_MACRO (VL_API_SW_INTERFACE_IP6_ENABLE_DISABLE_REPLY);
146 mp->_vl_msg_id =
ntohs (VL_API_IP_TABLE_DETAILS);
206 vl_api_fib_path_t *fp;
218 mp->_vl_msg_id =
ntohs (VL_API_IP_ROUTE_DETAILS);
225 mp->
route.n_paths = path_count;
226 mp->
route.stats_index =
230 fp = mp->
route.paths;
248 vl_api_fib_path_t *fp;
260 mp->_vl_msg_id =
ntohs (VL_API_IP_ROUTE_V2_DETAILS);
266 mp->
route.n_paths = path_count;
271 fp = mp->
route.paths;
368 memset (mp, 0,
sizeof (*mp));
369 mp->_vl_msg_id =
ntohs (VL_API_IP_MTABLE_DETAILS);
423 vl_api_mfib_path_t *fp;
435 mp->_vl_msg_id =
ntohs (VL_API_IP_MROUTE_DETAILS);
442 mp->
route.n_paths = path_count;
443 fp = mp->
route.paths;
493 vl_api_ip_punt_police_reply_t *rmp;
508 vl_api_ip_punt_redirect_reply_t *rmp;
514 goto bad_sw_if_index;
522 ntohl (mp->
punt.tx_sw_if_index), &
nh);
527 ntohl (mp->
punt.tx_sw_if_index), &
nh);
550 _vnet_ip_table_function_list_elt_t **
553 _vnet_ip_table_function_list_elt_t *
elt;
567 elt =
elt->next_ip_table_function;
576 u32 fib_index, mfib_index;
596 if ((~0 != fib_index) || (~0 != mfib_index))
605 if (~0 != mfib_index)
616 vl_api_ip_table_add_del_reply_t *rmp;
639 vl_api_fib_path_t *apath;
648 ntohl (mp->
route.table_id), &fib_index);
652 if (0 != mp->
route.n_paths)
655 for (ii = 0; ii < mp->
route.n_paths; ii++)
657 apath = &mp->
route.paths[ii];
663 (~0 == rpath->frp_sw_if_index))
688 vl_api_fib_path_t *apath;
702 if (0 != mp->
route.n_paths)
705 for (ii = 0; ii < mp->
route.n_paths; ii++)
707 apath = &mp->
route.paths[ii];
713 (~0 == rpath->frp_sw_if_index))
775 vl_api_fib_path_t *fp;
791 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
802 npaths *
sizeof (*fp),
808 rmp->
route.n_paths = npaths;
810 rmp->
route.stats_index = htonl (rmp->
route.stats_index);
812 fp = rmp->
route.paths;
831 vl_api_fib_path_t *fp;
848 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
860 npaths *
sizeof (*fp),
866 rmp->
route.n_paths = npaths;
869 rmp->
route.stats_index = htonl (rmp->
route.stats_index);
871 fp = rmp->
route.paths;
887 u32 fib_index, mfib_index;
914 if (~0 == mfib_index)
922 if ((~0 == fib_index) || (~0 == mfib_index))
936 u32 mfib_entry_index = ~0;
959 return (mfib_entry_index);
977 ntohl (mp->
route.table_id), &fib_index);
983 for (ii = 0; ii < mp->
route.n_paths; ii++)
998 ntohl (mp->
route.rpf_id),
1001 if (~0 != mfib_entry_index)
1034 mp->_vl_msg_id =
ntohs (VL_API_IP_DETAILS);
1053 mp->_vl_msg_id =
ntohs (VL_API_IP_ADDRESS_DETAILS);
1073 int rv __attribute__ ((unused)) = 0;
1129 mp->_vl_msg_id =
ntohs (VL_API_IP_UNNUMBERED_DETAILS);
1143 int rv __attribute__ ((unused)) = 0;
1205 _vec_len (sorted_sis) = 0;
1232 vl_api_set_ip_flow_hash_reply_t *rmp;
1239 #define _(a,b) if (mp->a) flow_hash_config |= b;
1252 vl_api_set_ip_flow_hash_v2_reply_t *rmp;
1269 vl_api_set_ip_flow_hash_router_id_reply_t *rmp;
1274 REPLY_MACRO (VL_API_SET_IP_FLOW_HASH_ROUTER_ID_REPLY);
1289 mp->_vl_msg_id =
ntohs (VL_API_MFIB_SIGNAL_DETAILS);
1332 vl_api_ip_container_proxy_add_del_reply_t *rmp;
1341 args.sw_if_index = clib_net_to_host_u32 (mp->
sw_if_index);
1342 args.is_add = mp->
is_add;
1349 REPLY_MACRO (VL_API_IP_CONTAINER_PROXY_ADD_DEL_REPLY);
1370 mp->_vl_msg_id =
ntohs (VL_API_IP_CONTAINER_PROXY_DETAILS);
1403 vl_api_ioam_enable_reply_t *rmp;
1423 vl_api_ioam_disable_reply_t *rmp;
1440 vl_api_ip_source_and_port_range_check_add_del_reply_t *rmp;
1446 u16 *high_ports = 0;
1448 u16 tmp_low, tmp_high;
1456 if (num_ranges > 32)
1458 rv = VNET_API_ERROR_EXCEEDED_NUMBER_OF_RANGES_CAPACITY;
1465 for (
i = 0;
i < num_ranges;
i++)
1471 if (tmp_low > tmp_high || tmp_low == 0 || tmp_high > 65535)
1473 rv = VNET_API_ERROR_INVALID_VALUE;
1477 vec_add1 (high_ports, tmp_high + 1);
1484 rv = VNET_API_ERROR_INVALID_VALUE;
1495 high_ports, is_add);
1503 high_ports, is_add);
1509 REPLY_MACRO (VL_API_IP_SOURCE_AND_PORT_RANGE_CHECK_ADD_DEL_REPLY);
1517 vl_api_ip_source_and_port_range_check_interface_add_del_reply_t *rmp;
1544 rv = VNET_API_ERROR_INVALID_VALUE;
1548 fib_index[
i] = p[0];
1564 REPLY_MACRO (VL_API_IP_SOURCE_AND_PORT_RANGE_CHECK_INTERFACE_ADD_DEL_REPLY);
1571 vl_api_sw_interface_ip6_set_link_local_address_reply_t *rmp;
1582 REPLY_MACRO (VL_API_SW_INTERFACE_IP6_SET_LINK_LOCAL_ADDRESS_REPLY);
1590 const ip6_address_t *
ip = NULL;
1597 rv = VNET_API_ERROR_IP6_NOT_ENABLED;
1601 REPLY_MACRO2 (VL_API_SW_INTERFACE_IP6_GET_LINK_LOCAL_ADDRESS_REPLY,
1612 vl_api_ip_table_replace_begin_reply_t *rmp;
1621 rv = VNET_API_ERROR_NO_SUCH_FIB;
1628 REPLY_MACRO (VL_API_IP_TABLE_REPLACE_BEGIN_REPLY);
1634 vl_api_ip_table_replace_end_reply_t *rmp;
1643 rv = VNET_API_ERROR_NO_SUCH_FIB;
1648 (fproto, ntohl (mp->
table.table_id)), fproto,
1657 vl_api_ip_table_flush_reply_t *rmp;
1666 rv = VNET_API_ERROR_NO_SUCH_FIB;
1698 vl_api_ip_reassembly_set_reply_t *rmp;
1700 switch ((vl_api_ip_reass_type_t) clib_net_to_host_u32 (mp->
type))
1706 clib_net_to_host_u32
1708 clib_net_to_host_u32
1710 clib_net_to_host_u32
1716 clib_net_to_host_u32
1718 clib_net_to_host_u32
1720 clib_net_to_host_u32
1730 clib_net_to_host_u32
1732 clib_net_to_host_u32
1739 clib_net_to_host_u32
1741 clib_net_to_host_u32
1761 rmp->_vl_msg_id =
ntohs (VL_API_IP_REASSEMBLY_GET_REPLY);
1765 u32 max_reassemblies;
1766 u32 max_reassembly_length;
1767 u32 expire_walk_interval_ms;
1768 switch ((vl_api_ip_reass_type_t) clib_net_to_host_u32 (mp->
type))
1775 &max_reassembly_length,
1776 &expire_walk_interval_ms);
1782 &max_reassembly_length,
1783 &expire_walk_interval_ms);
1791 &max_reassembly_length, &expire_walk_interval_ms);
1797 &max_reassembly_length, &expire_walk_interval_ms);
1801 rmp->
timeout_ms = clib_host_to_net_u32 (timeout_ms);
1805 clib_host_to_net_u32 (expire_walk_interval_ms);
1813 vl_api_ip_reassembly_enable_disable_reply_t *rmp;
1815 switch ((vl_api_ip_reass_type_t) clib_net_to_host_u32 (mp->
type))
1839 REPLY_MACRO (VL_API_IP_REASSEMBLY_ENABLE_DISABLE_REPLY);
1857 mp->_vl_msg_id =
ntohs (VL_API_IP_PUNT_REDIRECT_DETAILS);
1862 mp->
punt.rx_sw_if_index = htonl (rx_sw_if_index);
1914 vl_api_ip_path_mtu_update_reply_t *rmp;
1930 vl_api_ip_path_mtu_replace_begin_reply_t *rmp;
1935 REPLY_MACRO (VL_API_IP_PATH_MTU_REPLACE_BEGIN_REPLY);
1941 vl_api_ip_path_mtu_replace_end_reply_t *rmp;
1946 REPLY_MACRO (VL_API_IP_PATH_MTU_REPLACE_END_REPLY);
1961 rmp->
pmtu.table_id =
1978 #define vl_msg_name_crc_list
1979 #include <vnet/ip/ip.api.h>
1980 #undef vl_msg_name_crc_list
1985 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id);
1986 foreach_vl_msg_name_crc_ip;
1996 vl_msg_api_set_handlers(VL_API_##N, #n, \
1997 vl_api_##n##_t_handler, \
1999 vl_api_##n##_t_endian, \
2000 vl_api_##n##_t_print, \
2001 sizeof(vl_api_##n##_t), 1);
2008 am->is_mp_safe[VL_API_IP_ROUTE_ADD_DEL] = 1;
2009 am->is_mp_safe[VL_API_IP_ROUTE_ADD_DEL_REPLY] = 1;
2010 am->is_mp_safe[VL_API_IP_ROUTE_ADD_DEL_V2] = 1;
2011 am->is_mp_safe[VL_API_IP_ROUTE_ADD_DEL_V2_REPLY] = 1;
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
struct apt_ip6_fib_show_ctx_t_ api_ip6_fib_show_ctx_t
vl_api_interface_index_t sw_if_index
vnet_interface_main_t * im
#define VALIDATE_SW_IF_INDEX(mp)
void vl_api_ip_reassembly_set_t_handler(vl_api_ip_reassembly_set_t *mp)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, vnet_sw_interface_flags_t flags)
int mfib_signal_send_one(struct vl_api_registration_ *reg, u32 context)
vl_api_interface_index_t sw_if_index
static void * ip_interface_address_get_address(ip_lookup_main_t *lm, ip_interface_address_t *a)
vl_api_ip_path_mtu_t pmtu
@ IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_UDP_IN
bool is_add[default=true]
static void vl_api_ip_mtable_dump_t_handler(vl_api_ip_mtable_dump_t *mp)
vnet_api_error_t ip6_sv_reass_set(u32 timeout_ms, u32 max_reassemblies, u32 max_reassembly_length, u32 expire_walk_interval_ms)
set ip6 reassembly configuration
Dump IP unnumbered configurations.
static void send_ip_table_details(vpe_api_main_t *am, vl_api_registration_t *reg, u32 context, const fib_table_t *table)
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
vl_api_registration_t * reg
static fib_protocol_t fib_ip_proto(bool is_ip6)
Convert from boolean is_ip6 to FIB protocol.
void ip6_punt_redirect_add(u32 rx_sw_if_index, u32 tx_sw_if_index, ip46_address_t *nh)
void ip6_punt_redirect_del(u32 rx_sw_if_index)
static void vl_api_ip_table_replace_end_t_handler(vl_api_ip_table_replace_end_t *mp)
int ip_path_mtu_replace_end(void)
const fib_prefix_t * fib_entry_get_prefix(fib_node_index_t fib_entry_index)
int ip6_source_and_port_range_check_add_del(ip6_address_t *address, u32 length, u32 vrf_id, u16 *low_ports, u16 *high_ports, int is_add)
#define REPLY_MACRO2(t, body)
ip_lookup_main_t lookup_main
_vnet_ip_table_function_list_elt_t * ip_table_add_del_functions[VNET_ITF_FUNC_N_PRIO]
mfib_entry_flags_t mfib_api_path_entry_flags_decode(vl_api_mfib_entry_flags_t in)
void fib_table_sweep(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Signal that the table has converged, i.e.
#define vec_new(T, N)
Create new vector of given type and length (unspecified alignment, no header).
u32 fib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
Path encode context to use when walking a path-list to encode paths.
void fib_table_mark(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Resync all entries from a table for the source this is the mark part of the mark and sweep algorithm.
ip4_main_t ip4_main
Global ip4 main structure.
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
void ip_mprefix_decode(const vl_api_mprefix_t *in, mfib_prefix_t *out)
bool is_add[default=true]
vl_api_interface_index_t sw_if_index
#define clib_error_get_code(err)
void vl_api_ip_path_mtu_replace_begin_t_handler(vl_api_ip_path_mtu_replace_begin_t *mp)
u32 fib_table_find_or_create_and_lock_w_name(fib_protocol_t proto, u32 table_id, fib_source_t src, const u8 *name)
Get the index of the FIB for a Table-ID.
vl_api_mfib_entry_flags_t entry_flags
@ IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_TCP_OUT
void ip_container_proxy_walk(ip_container_proxy_cb_t cb, void *ctx)
static void send_ip_mroute_details(vpe_api_main_t *am, vl_api_registration_t *reg, u32 context, fib_node_index_t mfib_entry_index)
fib_node_index_t * entries
static void vl_api_set_ip_flow_hash_v2_t_handler(vl_api_set_ip_flow_hash_v2_t *mp)
int ip_path_mtu_replace_begin(void)
vl_api_ip_path_mtu_t pmtu
Aggregate type for a prefix.
vl_api_interface_index_t sw_if_index
static hash_pair_t * lookup(void *v, uword key, enum lookup_opcode op, void *new_value, void *old_value)
static void vl_api_ip_table_replace_begin_t_handler(vl_api_ip_table_replace_begin_t *mp)
void vl_api_ip_reassembly_enable_disable_t_handler(vl_api_ip_reassembly_enable_disable_t *mp)
static void send_ip_path_mtu_details(index_t ipti, vl_api_registration_t *rp, u32 context)
void vl_api_ip_reassembly_get_t_handler(vl_api_ip_reassembly_get_t *mp)
static void send_ip_unnumbered_details(vpe_api_main_t *am, vl_api_registration_t *reg, u32 sw_if_index, u32 ip_sw_if_index, u32 context)
vnet_api_error_t ip4_sv_reass_get(u32 *timeout_ms, u32 *max_reassemblies, u32 *max_reassembly_length, u32 *expire_walk_interval_ms)
get ip4 reassembly configuration
Dump IP multicast fib table.
void ip_mprefix_encode(const mfib_prefix_t *in, vl_api_mprefix_t *out)
vnet_api_error_t ip6_sv_reass_enable_disable(u32 sw_if_index, u8 enable_disable)
int mfib_api_path_decode(vl_api_mfib_path_t *in, fib_route_path_t *out)
#define FIB_NODE_INDEX_INVALID
ip46_address_t frp_addr
The next-hop address.
void ip_pmtu_get_ip(const ip_pmtu_t *ipt, ip_address_t *ip)
vl_api_interface_index_t sw_if_index
@ VNET_IP_TABLE_FUNC_PRIORITY_HIGH
u16 fp_len
The mask length.
void ip6_address_decode(const vl_api_ip6_address_t in, ip6_address_t *out)
static_always_inline ip_pmtu_t * ip_path_mtu_get(index_t index)
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
static void vl_api_ip_route_dump_t_handler(vl_api_ip_route_dump_t *mp)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vl_api_interface_index_t sw_if_index[default=0xffffffff]
Dump IP routes from a table.
IP FIB table entry response.
u32 frp_sw_if_index
The interface.
vnet_api_error_t ip6_sv_reass_get(u32 *timeout_ms, u32 *max_reassemblies, u32 *max_reassembly_length, u32 *expire_walk_interval_ms)
get ip6 reassembly configuration
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
Remote Path MTU tracking object.
Set the ip flow hash config for a fib request.
struct ip_walk_ctx_t_ ip_walk_ctx_t
fib_node_index_t mfib_table_entry_paths_update(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, const fib_route_path_t *rpaths)
enum mfib_entry_flags_t_ mfib_entry_flags_t
Dump IP multicast fib table.
fib_node_index_t fib_table_lookup(u32 fib_index, const fib_prefix_t *prefix)
Perfom a longest prefix match in the non-forwarding table.
void fib_table_walk(u32 fib_index, fib_protocol_t proto, fib_table_walk_fn_t fn, void *ctx)
Walk all entries in a FIB table N.B: This is NOT safe to deletes.
IPv6 set link local address on interface request.
u32 max_reassembly_length
#define clib_error_report(e)
struct vl_api_ip_fib_dump_walk_ctx_t_ vl_api_ip_fib_dump_walk_ctx_t
u32 mfi_sw_if_index
The SW IF index that this MFIB interface represents.
static void vl_api_ip_route_v2_dump_t_handler(vl_api_ip_route_v2_dump_t *mp)
vnet_api_error_t ip4_full_reass_get(u32 *timeout_ms, u32 *max_reassemblies, u32 *max_reassembly_length, u32 *expire_walk_interval_ms)
get ip4 reassembly configuration
void mfib_table_walk(u32 fib_index, fib_protocol_t proto, mfib_table_walk_fn_t fn, void *ctx)
Walk all entries in a FIB table N.B: This is NOT safe to deletes.
fib_node_index_t * entries
void fib_api_path_encode(const fib_route_path_t *rpath, vl_api_fib_path_t *out)
Encode and decode functions from the API types to internal types.
A protocol Independent IP multicast FIB table.
vl_api_interface_index_t sw_if_index
vl_api_interface_index_t sw_if_index
void ip_prefix_encode(const fib_prefix_t *in, vl_api_prefix_t *out)
vnet_api_error_t ip4_sv_reass_set(u32 timeout_ms, u32 max_reassemblies, u32 max_reassembly_length, u32 expire_walk_interval_ms)
set ip4 reassembly configuration
A pair of indicies, for the entry and interface resp.
vnet_sw_interface_flags_t flags
fib_route_path_t * rpaths
fib_route_path_t * mfib_entry_encode(fib_node_index_t mfib_entry_index)
void ip_address_encode2(const ip_address_t *in, vl_api_address_t *out)
void mfib_table_entry_paths_remove(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, const fib_route_path_t *rpaths)
IP FIB table lookup response.
ip46_type_t ip_address_decode(const vl_api_address_t *in, ip46_address_t *out)
Decode/Encode for struct/union types.
static void vl_api_mfib_signal_dump_t_handler(vl_api_mfib_signal_dump_t *mp)
Set the ip flow hash router ID.
static void vl_api_sw_interface_ip6_enable_disable_t_handler(vl_api_sw_interface_ip6_enable_disable_t *mp)
vl_api_ip_reass_type_t type
vl_api_interface_index_t sw_if_index
A protocol Independent FIB table.
Enable/disable reassembly feature.
vnet_api_error_t ip6_full_reass_enable_disable(u32 sw_if_index, u8 enable_disable)
static int ip_route_add_del_v2_t_handler(vl_api_ip_route_add_del_v2_t *mp, u32 *stats_index)
#define pool_foreach(VAR, POOL)
Iterate through pool.
void ip_table_delete(fib_protocol_t fproto, u32 table_id, u8 is_api)
Configure IP source and L4 port-range check.
VLIB_API_INIT_FUNCTION(ip_api_hookup)
enum fib_entry_flag_t_ fib_entry_flag_t
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
IPv6 shallow virtual reassembly.
IPv4 shallow virtual reassembly.
int ip_address_family_decode(vl_api_address_family_t af, ip_address_family_t *out)
Conversion functions to/from (decode/encode) API types to VPP internal types.
static void vl_api_ip_dump_t_handler(vl_api_ip_dump_t *mp)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
void vl_api_ip_route_add_del_t_handler(vl_api_ip_route_add_del_t *mp)
static fib_table_walk_rc_t vl_api_ip_fib_dump_walk(fib_node_index_t fei, void *arg)
void ip6_address_encode(const ip6_address_t *in, vl_api_ip6_address_t out)
int ip_path_mtu_update(const ip_address_t *nh, u32 table_id, u16 pmtu)
const ip6_address_t * ip6_get_link_local_address(u32 sw_if_index)
int set_ip_source_and_port_range_check(vlib_main_t *vm, u32 *fib_index, u32 sw_if_index, u32 is_add)
vnet_main_t * vnet_get_main(void)
u32 ft_table_id
Table ID (hash key) for this FIB.
static void send_ip_details(vpe_api_main_t *am, vl_api_registration_t *reg, u32 sw_if_index, u8 is_ipv6, u32 context)
u32 mfib_entry_get_fib_index(fib_node_index_t mfib_entry_index)
An API client registration, only in vpp/vlib.
static void vl_api_set_ip_flow_hash_router_id_t_handler(vl_api_set_ip_flow_hash_router_id_t *mp)
u8 * ft_desc
Table description.
void ip4_punt_redirect_add(u32 rx_sw_if_index, u32 tx_sw_if_index, ip46_address_t *nh)
int mfib_api_table_id_decode(fib_protocol_t fproto, u32 table_id, u32 *fib_index)
void ip6_punt_policer_add_del(u8 is_add, u32 policer_index)
enum vnet_ip_table_function_priority_t_ vnet_ip_table_function_priority_t
enum flow_hash_config_t_ flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
Lookup IP route from a table.
@ IP_SOURCE_AND_PORT_RANGE_CHECK_N_PROTOCOLS
vl_api_address_family_t af
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
int ip_flow_hash_set(ip_address_family_t af, u32 table_id, u32 flow_hash_config)
void vl_api_ip_route_add_del_v2_t_handler(vl_api_ip_route_add_del_v2_t *mp)
void ip_prefix_decode(const vl_api_prefix_t *in, fib_prefix_t *out)
vl_api_ip_reass_type_t type
u32 fib_node_index_t
A typedef of a node index.
#define REPLY_MACRO_DETAILS4(t, rp, context, body)
int fib_api_route_add_del(u8 is_add, u8 is_multipath, u32 fib_index, const fib_prefix_t *prefix, fib_source_t src, fib_entry_flag_t entry_flags, fib_route_path_t *rpaths)
Adding routes from the API.
static void vl_api_set_ip_flow_hash_t_handler(vl_api_set_ip_flow_hash_t *mp)
static walk_rc_t mfib_route_dump_walk(fib_node_index_t fei, void *arg)
void fib_table_flush(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Flush all entries from a table for the source.
vl_api_ip_flow_hash_config_t flow_hash_config
struct mfib_table_t_ * mfibs
Vector of MFIBs.
bool is_add[default=true]
static api_main_t * vlibapi_get_main(void)
void mfib_table_flush(u32 mfib_index, fib_protocol_t proto, mfib_source_t source)
Flush all entries from a table for the source.
bool is_add[default=true]
sll srl srl sll sra u16x4 i
static u32 mroute_add_del_handler(u8 is_add, u8 is_multipath, u32 fib_index, const mfib_prefix_t *prefix, u32 entry_flags, u32 rpf_id, fib_route_path_t *rpaths)
static void vl_api_ip_punt_redirect_t_handler(vl_api_ip_punt_redirect_t *mp, vlib_main_t *vm)
void vl_api_ip_table_add_del_t_handler(vl_api_ip_table_add_del_t *mp)
void mfib_table_mark(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Resync all entries from a table for the source this is the mark part of the mark and sweep algorithm.
vl_api_interface_index_t sw_if_index
void mfib_table_sweep(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Signal that the table has converged, i.e.
vl_api_interface_index_t ip_sw_if_index
mfib_table_t * mfib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
vl_api_address_with_prefix_t prefix
#define REPLY_AND_DETAILS_MACRO(t, p, body)
fib_table_flags_t ft_flags
Table flags.
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
@ VNET_SW_INTERFACE_FLAG_UNNUMBERED
struct fib_table_t_ * fibs
void vl_api_ip_mroute_add_del_t_handler(vl_api_ip_mroute_add_del_t *mp)
static void vl_api_ip_table_dump_t_handler(vl_api_ip_table_dump_t *mp)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
IP4 punt redirect per-rx interface configuration redirect punted traffic to another location.
vnet_api_error_t ip4_full_reass_enable_disable(u32 sw_if_index, u8 enable_disable)
static clib_error_t * call_elf_section_ip_table_callbacks(vnet_main_t *vnm, u32 table_id, u32 flags, _vnet_ip_table_function_list_elt_t **elts)
vl_api_punt_redirect_t punt
IPv6 get link local address on interface request.
static int api_mroute_add_del_t_handler(vl_api_ip_mroute_add_del_t *mp, u32 *stats_index)
fib_protocol_t fp_proto
protocol type
void ip_punt_redirect_walk(fib_protocol_t fproto, ip_punt_redirect_walk_cb_t cb, void *ctx)
vnet_sw_interface_t * sw_interfaces
bool is_add[default=true]
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
void mfib_table_unlock(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Take a reference counting lock on the table.
vl_api_punt_redirect_t punt
vl_api_interface_index_t sw_if_index
int fib_api_table_id_decode(fib_protocol_t fproto, u32 table_id, u32 *fib_index)
void ip4_punt_policer_add_del(u8 is_add, u32 policer_index)
void ip_address_decode2(const vl_api_address_t *in, ip_address_t *out)
void mfib_api_path_encode(const fib_route_path_t *in, vl_api_mfib_path_t *out)
Encode and decode functions from the API types to internal types.
#define BAD_SW_IF_INDEX_LABEL
u32 unnumbered_sw_if_index
vnet_api_error_t ip6_full_reass_set(u32 timeout_ms, u32 max_reassemblies, u32 max_reassembly_length, u32 expire_walk_interval_ms)
set ip6 reassembly configuration
static void setup_message_id_table(api_main_t *am)
void fib_path_list_walk_w_ext(fib_node_index_t path_list_index, const fib_path_ext_list_t *ext_list, fib_path_list_walk_w_ext_fn_t func, void *ctx)
static void vl_api_ip_table_flush_t_handler(vl_api_ip_table_flush_t *mp)
static void vl_api_ioam_disable_t_handler(vl_api_ioam_disable_t *mp)
API main structure, used by both vpp and binary API clients.
index_t ip_punt_redirect_find(fib_protocol_t fproto, u32 rx_sw_if_index)
static uword vnet_sw_if_index_is_api_valid(u32 sw_if_index)
u32 mfib_table_find_or_create_and_lock_w_name(fib_protocol_t proto, u32 table_id, mfib_source_t src, const u8 *name)
Get the index of the FIB for a Table-ID.
vnet_api_error_t ip6_full_reass_get(u32 *timeout_ms, u32 *max_reassemblies, u32 *max_reassembly_length, u32 *expire_walk_interval_ms)
get ip6 reassembly configuration
vl_api_interface_index_t sw_if_index
static void vl_api_ip_mroute_dump_t_handler(vl_api_ip_mroute_dump_t *mp)
fib_node_index_t fib_table_lookup_exact_match(u32 fib_index, const fib_prefix_t *prefix)
Perfom an exact match in the non-forwarding table.
clib_error_t * ip6_ioam_enable(int has_trace_option, int has_pot_option, int has_seqno_option, int has_analyse_option)
IP unnumbered configurations.
IOAM enable : Enable in-band OAM.
u32 ip_pmtu_get_table_id(const ip_pmtu_t *ipt)
#define vec_free(V)
Free vector's memory (no header).
int mfib_entry_cmp_for_sort(void *i1, void *i2)
static mfib_itf_t * mfib_itf_get(index_t mi)
Get the MFIB interface representation.
ip_pmtu_t * ip_pmtu_pool
Path MTU tracker pool.
static void vl_api_ioam_enable_t_handler(vl_api_ioam_enable_t *mp)
IPv6 link local address detail.
@ FIB_ENTRY_FLAG_CONNECTED
struct vl_api_ip_mfib_dump_ctx_t_ vl_api_ip_mfib_dump_ctx_t
fib_protocol_t mft_proto
Which protocol this table serves.
u32 mfib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
vl_api_ip_route_v2_t route
static int vl_api_can_send_msg(vl_api_registration_t *rp)
static clib_error_t * ip_api_hookup(vlib_main_t *vm)
u32 mfib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
u32 fib_table_get_index_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the index of the FIB bound to the interface.
#define foreach_flow_hash_bit_v1
u32 mft_table_id
Table ID (hash key) for this FIB.
static void vl_api_ip_unnumbered_dump_t_handler(vl_api_ip_unnumbered_dump_t *mp)
bool is_add[default=true]
vl_api_ip_reass_type_t type
vl_api_interface_index_t sw_if_index
enum fib_table_walk_rc_t_ fib_table_walk_rc_t
return code controlling how a table walk proceeds
IP Multicast Route Details.
struct fib_table_t_ * fibs
Vector of FIBs.
A representation of a path as described by a route producer.
void vl_api_ip_route_lookup_v2_t_handler(vl_api_ip_route_lookup_v2_t *mp)
fib_path_list_walk_rc_t fib_path_encode(fib_node_index_t path_list_index, fib_node_index_t path_index, const fib_path_ext_t *path_ext, void *args)
vl_api_ip_route_v2_t route
static int ip_container_proxy_send_details(const fib_prefix_t *pfx, u32 sw_if_index, void *args)
#define vec_foreach(var, vec)
Vector iterator.
@ FIB_SOURCE_CLI
From the CLI.
static void send_ip_route_v2_details(vpe_api_main_t *am, vl_api_registration_t *reg, u32 context, fib_node_index_t fib_entry_index)
static void vl_api_ip_container_proxy_dump_t_handler(vl_api_ip_container_proxy_dump_t *mp)
static void vl_api_ip_punt_police_t_handler(vl_api_ip_punt_police_t *mp, vlib_main_t *vm)
static uword pool_elts(void *v)
Number of active elements in a pool.
IPv6 interface enable / disable request.
@ FIB_SOURCE_API
From the control plane API.
u32 mfib_entry_get_stats_index(fib_node_index_t fib_entry_index)
clib_error_t * vnet_ip_container_proxy_add_del(vnet_ip_container_proxy_args_t *args)
ip_lookup_main_t lookup_main
void ip_flow_hash_router_id_set(u32 router_id)
void ip_table_create(fib_protocol_t fproto, u32 table_id, u8 is_api, const u8 *name)
fib_protocol_t fp_proto
protocol type
static_always_inline ip_punt_redirect_rx_t * ip_punt_redirect_get(index_t rrxi)
u32 fib_entry_get_fib_index(fib_node_index_t fib_entry_index)
An interface associated with a particular MFIB entry.
const mfib_prefix_t * mfib_entry_get_prefix(fib_node_index_t mfib_entry_index)
static void vl_api_sw_interface_ip6_get_link_local_address_t_handler(vl_api_sw_interface_ip6_get_link_local_address_t *mp)
static void vl_api_ip_address_dump_t_handler(vl_api_ip_address_dump_t *mp)
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
static void vl_api_ip_source_and_port_range_check_add_del_t_handler(vl_api_ip_source_and_port_range_check_add_del_t *mp)
struct mfib_table_t_ * mfibs
Vector of MFIBs.
fib_route_path_t * fib_entry_encode(fib_node_index_t fib_entry_index)
@ FIB_TABLE_WALK_CONTINUE
Continue on to the next entry.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
bool is_add[default=true]
void vl_api_ip_path_mtu_replace_end_t_handler(vl_api_ip_path_mtu_replace_end_t *mp)
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
static vlib_main_t * vlib_get_main(void)
void ip4_punt_redirect_del(u32 rx_sw_if_index)
static void vl_api_ip_source_and_port_range_check_interface_add_del_t_handler(vl_api_ip_source_and_port_range_check_interface_add_del_t *mp)
static void send_ip_mtable_details(vl_api_registration_t *reg, u32 context, const mfib_table_t *mfib_table)
u32 expire_walk_interval_ms
fib_node_index_t mfib_table_entry_update(u32 fib_index, const mfib_prefix_t *prefix, mfib_source_t source, fib_rpf_id_t rpf_id, mfib_entry_flags_t entry_flags)
Add a new (with no replication) or lock an existing entry.
void vl_api_ip_path_mtu_update_t_handler(vl_api_ip_path_mtu_update_t *mp)
void vl_api_ip_route_lookup_t_handler(vl_api_ip_route_lookup_t *mp)
void fib_table_unlock(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Take a reference counting lock on the table.
IP table flush Flush a table of all routes.
Set interface source and L4 port-range request.
u16 ipt_cfg_pmtu
Configured MTU.
static void vl_api_sw_interface_ip6_set_link_local_address_t_handler(vl_api_sw_interface_ip6_set_link_local_address_t *mp)
u32 expire_walk_interval_ms
bool is_add[default=true]
enum fib_source_t_ fib_source_t
The different sources that can create a route.
static void vl_api_ip_punt_redirect_dump_t_handler(vl_api_ip_punt_redirect_dump_t *mp)
@ VNET_IP_TABLE_FUNC_PRIORITY_LOW
@ IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_UDP_OUT
fib_node_index_t mfs_entry
vnet_api_error_t ip4_full_reass_set(u32 timeout_ms, u32 max_reassemblies, u32 max_reassembly_length, u32 expire_walk_interval_ms)
set ip4 reassembly configuration
fib_protocol_t ft_proto
Which protocol this table serves.
vl_api_ip_route_v2_t route
int ip6_link_set_local_address(u32 sw_if_index, const ip6_address_t *address)
u8 mfs_buffer[MFIB_SIGNAL_BUFFER_SIZE]
A buffer copied from the DP plane that triggered the signal.
vl_api_interface_index_t sw_if_index
u32 fib_table_entry_get_stats_index(u32 fib_index, const fib_prefix_t *prefix)
Return the stats index for a FIB entry.
u32 max_reassembly_length
int ip6_link_enable(u32 sw_if_index, const ip6_address_t *link_local_addr)
IPv6 Configuration on an interface.
int ip4_source_and_port_range_check_add_del(ip4_address_t *address, u32 length, u32 vrf_id, u16 *low_ports, u16 *high_ports, int is_add)
static void send_ip_route_details(vpe_api_main_t *am, vl_api_registration_t *reg, u32 context, fib_node_index_t fib_entry_index)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
static void vl_api_ip_container_proxy_add_del_t_handler(vl_api_ip_container_proxy_add_del_t *mp)
int fib_api_path_decode(vl_api_fib_path_t *in, fib_route_path_t *out)
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
vl_api_interface_index_t sw_if_index
clib_error_t * clear_ioam_rewrite_fn(void)
#define foreach_ip_api_msg
enum walk_rc_t_ walk_rc_t
Walk return code.
static walk_rc_t send_ip_punt_redirect_details(u32 rx_sw_if_index, const ip_punt_redirect_rx_t *ipr, void *arg)
vnet_api_error_t ip4_sv_reass_enable_disable(u32 sw_if_index, u8 enable_disable)
bool is_add[default=true]
ip46_type_t fib_proto_to_ip46(fib_protocol_t fproto)
Convert from fib_protocol to ip46_type.
Aggregate type for a prefix.
static void vl_api_ip_path_mtu_get_t_handler(vl_api_ip_path_mtu_get_t *mp)
fib_source_t fib_entry_get_best_source(fib_node_index_t entry_index)
@ FIB_ROUTE_PATH_LOCAL
A for-us/local path.
static int ip_route_add_del_t_handler(vl_api_ip_route_add_del_t *mp, u32 *stats_index)
@ IP_REASS_TYPE_SHALLOW_VIRTUAL
void fib_table_walk_w_src(u32 fib_index, fib_protocol_t proto, fib_source_t src, fib_table_walk_fn_t fn, void *data)
Walk all entries in a FIB table N.B: This is NOT safe to deletes.
Add / del table request A table can be added multiple times, but need be deleted only once.
vnet_interface_main_t interface_main
static void send_ip_address_details(vpe_api_main_t *am, vl_api_registration_t *reg, const fib_prefix_t *pfx, u32 sw_if_index, u32 context)
#define REPLY_MACRO3_ZERO(t, n, body)
struct _vnet_ip_container_proxy_args vnet_ip_container_proxy_args_t
int ip6_link_disable(u32 sw_if_index)
vpe_api_main_t vpe_api_main
@ IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_TCP_IN
enum ip_address_family_t_ ip_address_family_t
void * vl_msg_api_alloc(int nbytes)
vl_api_wireguard_peer_flags_t flags
void vl_mfib_signal_send_one(vl_api_registration_t *reg, u32 context, const mfib_signal_t *mfs)