38 ip_address_t lloc, rloc;
41 u8 reid_set = 0, leid_set = 0, is_negative = 0, dp_table_set = 0,
43 u32 vni = 0, dp_table = 0, action = ~0, w;
47 memset (leid, 0,
sizeof (*leid));
48 memset (reid, 0,
sizeof (*reid));
58 else if (
unformat (line_input,
"add"))
68 else if (
unformat (line_input,
"vni %u", &vni))
74 else if (
unformat (line_input,
"vrf %u", &dp_table))
78 else if (
unformat (line_input,
"bd %u", &dp_table))
82 else if (
unformat (line_input,
"negative action %U",
87 else if (
unformat (line_input,
"loc-pair %U %U w %d",
145 memset (a, 0,
sizeof (a[0]));
160 is_add ?
"add" :
"delete");
172 .short_help =
"gpe entry add/del vni <vni> vrf/bd <id> [leid <leid>]" 173 "reid <reid> [loc-pair <lloc> <rloc> w <weight>] " 174 "[negative action <action>]",
219 return VNET_API_ERROR_INVALID_GPE_MODE;
222 return VNET_API_ERROR_LISP_GPE_ENTRIES_PRESENT;
246 else if (
unformat (line_input,
"vxlan"))
258 "Error: invalid mode or GPE entries are present!");
267 .short_help =
"gpe encap [lisp|vxlan]",
281 return format (s,
"lisp");
283 return format (s,
"vxlan");
302 .path =
"show gpe encap",
303 .short_help =
"show GPE encapulation mode",
325 if (
unformat (line_input,
"enable"))
327 else if (
unformat (line_input,
"disable"))
348 .short_help =
"gpe [enable|disable]",
366 vlib_cli_output (vm,
"%=10d%=10d", p->key, p->value[0]);
375 vlib_cli_output (vm,
"%=10d%=10d", p->key, p->value[0]);
384 .path =
"show gpe interface",
385 .short_help =
"show gpe interface",
395 return format (s,
"%s", lgm->
is_en ?
"enabled" :
"disabled");
#define gid_address_ip_version(_a)
vlib_node_registration_t lisp_gpe_ip4_input_node
(constructor) VLIB_REGISTER_NODE (lisp_gpe_ip4_input_node)
#define gid_address_type(_a)
u8 vnet_lisp_gpe_enable_disable_status(void)
Check if LISP-GPE is enabled.
vnet_main_t * vnet_get_main(void)
void vnet_lisp_gpe_fwd_entry_flush(void)
Flush all the forwrding entries.
clib_error_t * vnet_lisp_gpe_enable_disable(vnet_lisp_gpe_enable_disable_args_t *a)
Enable/disable LISP-GPE.
uword unformat_ip_address(unformat_input_t *input, va_list *args)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
ip_lookup_main_t lookup_main
vlib_main_t * vlib_main
convenience
uword unformat_negative_mapping_action(unformat_input_t *input, va_list *args)
#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
#define clib_error_return(e, args...)
uword * lisp_gpe_fwd_entries
DB of all forwarding entries.
#define vlib_call_init_function(vm, x)
enum gpe_encap_mode_e gpe_encap_mode_t
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)
u32 table_id
table (vrf) id
uword unformat_gid_address(unformat_input_t *input, va_list *args)
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.
tunnel_lookup_t l2_ifaces
void lisp_gpe_tenant_flush(void)
Flush/delete ALL the tenants.
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.
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.
int vnet_gpe_set_encap_mode(gpe_encap_mode_t mode)
Set GPE encapsulation mode.
gid_address_t rmt_eid
remote eid
clib_error_t * ip4_lookup_init(vlib_main_t *vm)
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)
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.
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)
ip4_main_t ip4_main
Global ip4 main structure.
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.
gid_address_t lcl_eid
local eid
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
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.