|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
44 u8 reid_set = 0, leid_set = 0, is_negative = 0, dp_table_set = 0,
61 else if (
unformat (line_input,
"add"))
85 else if (
unformat (line_input,
"negative action %U",
90 else if (
unformat (line_input,
"loc-pair %U %U w %d",
151 a->is_negative = is_negative;
156 a->locator_pairs = pairs;
163 is_add ?
"add" :
"delete");
175 .short_help =
"gpe entry add/del vni <vni> vrf/bd <id> [leid <leid>]"
176 "reid <reid> [loc-pair <lloc> <rloc> w <weight>] "
177 "[negative action <action>]",
229 return VNET_API_ERROR_INVALID_GPE_MODE;
232 return VNET_API_ERROR_LISP_GPE_ENTRIES_PRESENT;
256 else if (
unformat (line_input,
"vxlan"))
268 "Error: invalid mode or GPE entries are present!");
277 .short_help =
"gpe encap [lisp|vxlan]",
291 return format (s,
"lisp");
293 return format (s,
"vxlan");
312 .path =
"show gpe encap",
313 .short_help =
"show GPE encapulation mode",
335 if (
unformat (line_input,
"enable"))
337 else if (
unformat (line_input,
"disable"))
358 .short_help =
"gpe [enable|disable]",
376 vlib_cli_output (vm,
"%=10d%=10d", p->key, p->value[0]);
385 vlib_cli_output (vm,
"%=10d%=10d", p->key, p->value[0]);
394 .path =
"show gpe interface",
395 .short_help =
"show gpe interface",
433 .path =
"show gpe native-forward",
434 .short_help =
"show gpe native-forward",
512 else if (
unformat (line_input,
"del"))
514 else if (
unformat (line_input,
"via %U %U",
523 else if (
unformat (line_input,
"via %U %U",
532 else if (
unformat (line_input,
"via %U",
539 else if (
unformat (line_input,
"via %U",
583 .path =
"gpe native-forward",
584 .short_help =
"gpe native-forward [del] via <nh-ip-addr> [iface] "
595 return format (s,
"%s", lgm->
is_en ?
"enabled" :
"disabled");
695 if (
unformat (input,
"pcap %v", &file_name))
714 .path =
"test one nsh",
715 .short_help =
"test gpe nsh pcap <path-to-pcap-file>",
u32 frp_fib_index
The FIB index to lookup the nexthop Only valid for recursive paths.
int fib_route_path_cmp(const fib_route_path_t *rpath1, const fib_route_path_t *rpath2)
static void * vlib_buffer_put_uninit(vlib_buffer_t *b, u16 size)
Append uninitialized data to buffer.
__clib_export clib_error_t * pcap_read(pcap_main_t *pm)
Read PCAP file.
clib_error_t * vnet_lisp_gpe_enable_disable(vnet_lisp_gpe_enable_disable_args_t *a)
Enable/disable LISP-GPE.
static clib_error_t * gpe_set_encap_mode_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI command to set GPE encap.
vlib_cli_command_t gpe_show_native_fwd_rpath_command
(constructor) VLIB_CLI_COMMAND (gpe_show_native_fwd_rpath_command)
ip_lookup_main_t lookup_main
static clib_error_t * gpe_native_forward_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI command to add action for native forward.
u8 frp_weight
[un]equal cost path weight
ip4_main_t ip4_main
Global ip4 main structure.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define gid_address_ip_version(_a)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void * vlib_buffer_pull(vlib_buffer_t *b, u8 size)
Retrieve bytes from buffer head.
static clib_error_t * lisp_gpe_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI command to enable/disable LISP-GPE.
void gpe_update_native_fwd_path(u8 ip_version)
gpe_encap_mode_t encap_mode
#define clib_error_return(e, args...)
static vlib_cli_command_t lisp_test_nsh_command
(constructor) VLIB_CLI_COMMAND (lisp_test_nsh_command)
enum gpe_encap_mode_e gpe_encap_mode_t
ip46_address_t frp_addr
The next-hop address.
static vlib_cli_command_t gpe_set_encap_mode_command
(constructor) VLIB_CLI_COMMAND (gpe_set_encap_mode_command)
vl_api_tunnel_mode_t mode
#define vlib_call_init_function(vm, x)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
u32 frp_sw_if_index
The interface.
char * name
The counter collection's name.
static vlib_cli_command_t enable_disable_lisp_gpe_command
(constructor) VLIB_CLI_COMMAND (enable_disable_lisp_gpe_command)
struct lisp_gpe_fwd_entry_t_ * lisp_fwd_entry_pool
A Pool of all LISP forwarding entries.
PCAP main state data structure.
dpo_proto_t frp_proto
The protocol of the address below.
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
tunnel_lookup_t nsh_ifaces
static vlib_cli_command_t gpe_show_encap_mode_command
(constructor) VLIB_CLI_COMMAND (gpe_show_encap_mode_command)
void lisp_gpe_tenant_flush(void)
Flush/delete ALL the tenants.
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
static lisp_gpe_main_t * vnet_lisp_gpe_get_main()
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
uword unformat_ip_address(unformat_input_t *input, va_list *args)
tunnel_lookup_t l3_ifaces
#define clib_error_create(args...)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static __clib_warn_unused_result u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
vnet_main_t * vnet_get_main(void)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define gid_address_vni(_a)
clib_error_t * lisp_gpe_init(vlib_main_t *vm)
LISP-GPE init function.
static clib_error_t * lisp_show_iface_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI command to show LISP-GPE interfaces.
static clib_error_t * ip4_lookup_init(vlib_main_t *vm)
#define hash_create_mem(elts, key_bytes, value_bytes)
void udp_register_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u32 node_index, u8 is_ip4)
lisp_gpe_main_t lisp_gpe_main
LISP-GPE global state.
fib_route_path_t * native_fwd_rpath[2]
Native fwd data structures.
u8 * format_vnet_gpe_encap_mode(u8 *s, va_list *args)
Format GPE encap mode.
void udp_unregister_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u8 is_ip4)
static clib_error_t * lisp_gpe_test_send_nsh_packet(u8 *file_name)
int vnet_gpe_set_encap_mode(gpe_encap_mode_t mode)
Set GPE encapsulation mode.
#define VLIB_CLI_COMMAND(x,...)
lisp_gpe_fwd_entry_key_t * key
The Entry's key: {lEID,rEID,vni}.
uword * lisp_stats_index_by_key
clib_error_t * ip_main_init(vlib_main_t *vm)
u8 ** packets_read
Packets read from file.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
uword unformat_gid_address(unformat_input_t *input, va_list *args)
static clib_error_t * lisp_gpe_add_del_fwd_entry_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI command to add/del forwarding entry.
vlib_cli_command_t gpe_native_forward_command
(constructor) VLIB_CLI_COMMAND (gpe_native_forward_command)
u8 vnet_lisp_gpe_enable_disable_status(void)
Check if LISP-GPE is enabled.
int vnet_lisp_gpe_add_del_fwd_entry(vnet_lisp_gpe_add_del_fwd_entry_args_t *a, u32 *hw_if_indexp)
Forwarding entry create/remove dispatcher.
#define vec_free(V)
Free vector's memory (no header).
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
void gid_address_copy(gid_address_t *dst, gid_address_t *src)
fib_protocol_t dpo_proto_to_fib(dpo_proto_t dpo_proto)
unformat_function_t unformat_vnet_sw_interface
description fragment has unexpected format
static clib_error_t * gpe_show_native_fwd_rpath_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI command to show GPE fwd native route path.
format_function_t format_ip46_address
#define VLIB_INIT_FUNCTION(x)
A representation of a path as described by a route producer.
u8 * format_vnet_lisp_gpe_status(u8 *s, va_list *args)
Format LISP-GPE status.
#define vec_foreach(var, vec)
Vector iterator.
static vlib_cli_command_t lisp_gpe_add_del_fwd_entry_command
(constructor) VLIB_CLI_COMMAND (lisp_gpe_add_del_fwd_entry_command)
static uword pool_elts(void *v)
Number of active elements in a pool.
ip_lookup_main_t lookup_main
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_node_registration_t lisp_gpe_ip6_input_node
(constructor) VLIB_REGISTER_NODE (lisp_gpe_ip6_input_node)
vlib_main_t * vlib_main
convenience
static vlib_main_t * vlib_get_main(void)
Common utility functions for IPv4, IPv6 and L2 LISP-GPE adjacencys.
gpe_encap_mode_t vnet_gpe_get_encap_mode(void)
#define gid_address_type(_a)
vlib_node_registration_t lisp_gpe_ip4_input_node
(constructor) VLIB_REGISTER_NODE (lisp_gpe_ip4_input_node)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
int vnet_gpe_add_del_native_fwd_rpath(vnet_gpe_native_fwd_rpath_args_t *a)
uword unformat_negative_mapping_action(unformat_input_t *input, va_list *args)
char * file_name
File name of pcap output.
struct _gid_address_t gid_address_t
u32 eid_fib_index
The FIB index for the overlay, i.e.
vlib_combined_counter_main_t counters
uword * lisp_gpe_fwd_entries
DB of all forwarding entries.
vlib_cli_command_t lisp_show_iface_command
(constructor) VLIB_CLI_COMMAND (lisp_show_iface_command)
void ip_address_copy(ip_address_t *dst, const ip_address_t *src)
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
vl_api_mac_event_action_t action
tunnel_lookup_t l2_ifaces
uword * hw_if_index_by_dp_table
Lookup lisp-gpe interfaces by dp table (eg.
Aggregate type for a prefix.
static clib_error_t * lisp_test_nsh_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void vnet_lisp_gpe_fwd_entry_flush(void)
Flush all the forwrding entries.
#define vec_del1(v, i)
Delete the element at index I.
fib_node_index_t fib_table_entry_update(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, fib_route_path_t *paths)
Update an entry to have a new set of paths.
VLIB buffer representation.
static clib_error_t * gpe_show_encap_mode_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI command to show GPE encap.
void ip_prefix_to_fib_prefix(const ip_prefix_t *ip_prefix, fib_prefix_t *fib_prefix)
convert from a LISP to a FIB prefix