44 u8 reid_set = 0, leid_set = 0, is_negative = 0, dp_table_set = 0,
61 else if (
unformat (line_input,
"add"))
71 else if (
unformat (line_input,
"vni %u", &vni))
85 else if (
unformat (line_input,
"negative action %U",
90 else if (
unformat (line_input,
"loc-pair %U %U w %d",
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",
510 if (
unformat (line_input,
"table %d", &table_id))
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",
553 if ((
u32) ~ 0 == table_id)
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");
676 (
u8 *)
"interface-tx");
695 if (
unformat (input,
"pcap %v", &file_name))
714 .path =
"test one nsh",
715 .short_help =
"test gpe nsh pcap <path-to-pcap-file>",
static clib_error_t * lisp_test_nsh_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define gid_address_ip_version(_a)
ip46_address_t frp_addr
The next-hop address.
char * file_name
File name of pcap output.
vlib_node_registration_t lisp_gpe_ip4_input_node
(constructor) VLIB_REGISTER_NODE (lisp_gpe_ip4_input_node)
#define gid_address_type(_a)
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 vnet_lisp_gpe_enable_disable_status(void)
Check if LISP-GPE is enabled.
A representation of a path as described by a route producer.
int fib_route_path_cmp(const fib_route_path_t *rpath1, const fib_route_path_t *rpath2)
vnet_main_t * vnet_get_main(void)
static clib_error_t * ip4_lookup_init(vlib_main_t *vm)
void vnet_lisp_gpe_fwd_entry_flush(void)
Flush all the forwrding entries.
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.
#define clib_memcpy_fast(a, b, c)
clib_error_t * vnet_lisp_gpe_enable_disable(vnet_lisp_gpe_enable_disable_args_t *a)
Enable/disable LISP-GPE.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
lisp_gpe_fwd_entry_key_t * key
The Entry's key: {lEID,rEID,vni}.
ip_lookup_main_t lookup_main
dpo_proto_t frp_proto
The protocol of the address below.
unformat_function_t unformat_vnet_sw_interface
vlib_main_t * vlib_main
convenience
uword unformat_negative_mapping_action(unformat_input_t *input, va_list *args)
static lisp_gpe_main_t * vnet_lisp_gpe_get_main()
PCAP main state data structure.
void gpe_update_native_fwd_path(u8 ip_version)
u32 frp_sw_if_index
The interface.
#define VLIB_INIT_FUNCTION(x)
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_combined_counter_main_t counters
Aggregate type for a prefix.
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
#define clib_error_return(e, args...)
uword * lisp_gpe_fwd_entries
DB of all forwarding entries.
#define clib_error_create(args...)
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
fib_protocol_t dpo_proto_to_fib(dpo_proto_t dpo_proto)
#define vlib_call_init_function(vm, x)
enum gpe_encap_mode_e gpe_encap_mode_t
vl_api_gre_tunnel_mode_t mode
Common utility functions for IPv4, IPv6 and L2 LISP-GPE adjacencys.
vlib_node_registration_t lisp_gpe_ip6_input_node
(constructor) VLIB_REGISTER_NODE (lisp_gpe_ip6_input_node)
#define hash_create_mem(elts, key_bytes, value_bytes)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u32 table_id
table (vrf) id
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
uword unformat_gid_address(unformat_input_t *input, va_list *args)
#define vec_del1(v, i)
Delete the element at index I.
uword unformat_ip_address(unformat_input_t *input, va_list *args)
int vnet_gpe_add_del_native_fwd_rpath(vnet_gpe_native_fwd_rpath_args_t *a)
clib_error_t * pcap_read(pcap_main_t *pm)
Read PCAP file.
format_function_t format_ip46_address
u8 is_negative
type of mapping
u32 vni
VNI/tenant id in HOST byte order.
clib_error_t * ip_main_init(vlib_main_t *vm)
#define vec_free(V)
Free vector's memory (no header).
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.
void udp_unregister_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u8 is_ip4)
tunnel_lookup_t l2_ifaces
void lisp_gpe_tenant_flush(void)
Flush/delete ALL the tenants.
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
lisp_gpe_main_t lisp_gpe_main
LISP-GPE global state.
#define VLIB_CLI_COMMAND(x,...)
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.
void ip_prefix_to_fib_prefix(const ip_prefix_t *ipp, fib_prefix_t *fibp)
convert from a LISP to a FIB prefix
struct _gid_address_t gid_address_t
u8 * format_vnet_lisp_gpe_status(u8 *s, va_list *args)
Format LISP-GPE status.
gpe_encap_mode_t vnet_gpe_get_encap_mode(void)
ip_lookup_main_t lookup_main
clib_error_t * lisp_gpe_init(vlib_main_t *vm)
LISP-GPE init function.
gpe_encap_mode_t encap_mode
uword * hw_if_index_by_dp_table
Lookup lisp-gpe interfaces by dp table (eg.
static clib_error_t * lisp_gpe_test_send_nsh_packet(u8 *file_name)
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.
int vnet_gpe_set_encap_mode(gpe_encap_mode_t mode)
Set GPE encapsulation mode.
gid_address_t rmt_eid
remote eid
static vlib_main_t * vlib_get_main(void)
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.
negative_fwd_actions_e action
action for negative mappings
#define gid_address_vni(_a)
u32 eid_fib_index
The FIB index for the overlay, i.e.
struct lisp_gpe_fwd_entry_t_ * lisp_fwd_entry_pool
A Pool of all LISP forwarding entries.
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.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
tunnel_lookup_t l3_ifaces
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
locator_pair_t * locator_pairs
vector of locator pairs
char * name
The counter collection's name.
void gid_address_copy(gid_address_t *dst, gid_address_t *src)
fib_route_path_t * native_fwd_rpath[2]
Native fwd data structures.
void ip_address_copy(ip_address_t *dst, const ip_address_t *src)
ip4_main_t ip4_main
Global ip4 main structure.
#define vec_foreach(var, vec)
Vector iterator.
static void * vlib_buffer_pull(vlib_buffer_t *b, u8 size)
Retrieve bytes from buffer head.
u8 ** packets_read
Packets read from file.
static void * vlib_buffer_put_uninit(vlib_buffer_t *b, u16 size)
Append uninitialized data to buffer.
void udp_register_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u32 node_index, u8 is_ip4)
uword * lisp_stats_index_by_key
u8 * format_vnet_gpe_encap_mode(u8 *s, va_list *args)
Format GPE encap mode.
u8 frp_weight
[un]equal cost path weight
static u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
gid_address_t lcl_eid
local eid
tunnel_lookup_t nsh_ifaces
u32 frp_fib_index
The FIB index to lookup the nexthop Only valid for recursive paths.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
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.
static uword pool_elts(void *v)
Number of active elements in a pool.