36 if (
unformat (line_input,
"vni %d", &vni))
69 .path =
"show lisp adjacencies",
70 .short_help =
"show lisp adjacencies",
94 else if (
unformat (line_input,
"del"))
115 is_add ?
"add" :
"delete");
125 .path =
"lisp map-server",
126 .short_help =
"lisp map-server add|del <ip>",
142 u8 *locator_set_name = 0;
143 u32 locator_set_index = 0, map_index = 0;
151 memset (&eid, 0,
sizeof (eid));
152 memset (a, 0,
sizeof (*a));
162 else if (
unformat (line_input,
"del"))
166 else if (
unformat (line_input,
"vni %d", &vni))
168 else if (
unformat (line_input,
"secret-key %_%v%_", &key))
173 else if (
unformat (line_input,
"locator-set %_%v%_", &locator_set_name))
183 locator_set_index = p[0];
200 if (key && (0 == key_id))
217 is_add ?
"add" :
"delete");
221 if (locator_set_name)
232 .path =
"lisp eid-table",
233 .short_help =
"lisp eid-table add/del [vni <vni>] eid <eid> " 234 "locator-set <locator-set> [key <secret-key> key-id sha1|sha256 ]",
244 u8 is_add = 1, is_l2 = 0;
245 u32 vni = 0, dp_id = 0;
257 else if (
unformat (line_input,
"vni %d", &vni))
259 else if (
unformat (line_input,
"vrf %d", &dp_id))
261 else if (
unformat (line_input,
"bd %d", &dp_id))
279 .path =
"lisp eid-table map",
280 .short_help =
"lisp eid-table map [del] vni <vni> vrf <vrf> | bd <bdi>",
300 u8 is_add = 1, del_all = 0;
301 locator_t rloc, *rlocs = 0, *curr_rloc = 0;
304 u32 vni, action = ~0, p, w;
311 memset (&eid, 0,
sizeof (eid));
312 memset (&rloc, 0,
sizeof (rloc));
316 if (
unformat (line_input,
"del-all"))
318 else if (
unformat (line_input,
"del"))
320 else if (
unformat (line_input,
"add"))
324 else if (
unformat (line_input,
"vni %u", &vni))
328 else if (
unformat (line_input,
"p %d w %d", &p, &w))
333 (
"No RLOC configured for setting priority/weight!");
336 curr_rloc->priority = p;
337 curr_rloc->weight = w;
349 curr_rloc = &rlocs[
vec_len (rlocs) - 1];
351 else if (
unformat (line_input,
"action %U",
369 if (is_add && (~0 == action) && 0 ==
vec_len (rlocs))
387 memset (a, 0,
sizeof (a[0]));
401 memset (map_args, 0,
sizeof (map_args[0]));
403 map_args->
action = action;
413 clib_warning (
"failed to %s remote mapping!", is_add ?
"add" :
"delete");
423 .path =
"lisp remote-mapping",.short_help =
424 "lisp remote-mapping add|del [del-all] vni <vni> " 425 "eid <est-eid> [action <no-action|natively-forward|" 426 "send-map-request|drop>] rloc <dst-locator> p <prio> w <weight> " 427 "[rloc <dst-locator> ... ]",.function =
441 ip_prefix_t *reid_ippref, *leid_ippref;
445 u8 reid_set = 0, leid_set = 0;
452 memset (&reid, 0,
sizeof (reid));
453 memset (&leid, 0,
sizeof (leid));
462 else if (
unformat (line_input,
"add"))
464 else if (
unformat (line_input,
"reid %U",
475 else if (
unformat (line_input,
"vni %u", &vni))
480 else if (
unformat (line_input,
"leid %U",
498 if (!reid_set || !leid_set)
509 clib_warning (
"remote and local EIDs are of different types!");
513 memset (a, 0,
sizeof (a[0]));
519 clib_warning (
"failed to %s adjacency!", is_add ?
"add" :
"delete");
528 .path =
"lisp adjacency",
529 .short_help =
"lisp adjacency add|del vni <vni> reid <remote-eid> " 562 if (_MR_MODE_MAX == mr_mode)
578 .path =
"lisp map-request mode",
579 .short_help =
"lisp map-request mode dst-only|src-dst",
588 u32 mode = va_arg (*args,
u32);
593 return format (0,
"dst-only");
595 return format (0,
"src-dst");
612 .path =
"show lisp map-request mode",
613 .short_help =
"show lisp map-request mode",
635 .path =
"show lisp map-resolvers",
636 .short_help =
"show lisp map-resolvers",
647 u8 locator_name_set = 0;
648 u8 *locator_set_name = 0;
660 if (
unformat (line_input,
"ls %_%v%_", &locator_set_name))
661 locator_name_set = 1;
662 else if (
unformat (line_input,
"disable"))
671 if (!locator_name_set)
681 is_add ?
"add" :
"delete");
685 if (locator_set_name)
695 .short_help =
"lisp pitr [disable] ls <locator-set-name>",
708 u8 status = lcm->
flags & LISP_FLAG_PITR_MODE;
710 vlib_cli_output (vm,
"%=20s%=16s",
"pitr", status ?
"locator-set" :
"");
720 tmp_str =
format (0,
"N/A");
733 tmp_str =
format (0,
"N/A");
747 .path =
"show lisp pitr",
748 .short_help =
"Show pitr",
790 gid, type, loc, ttl, aut);
794 s =
format (s,
"%55s%v\n",
"", loc);
814 memset (&eid, 0,
sizeof (eid));
824 else if (
unformat (line_input,
"local"))
826 else if (
unformat (line_input,
"remote"))
837 "EID",
"type",
"locators",
"ttl",
"autoritative");
847 locator_set_t * ls = pool_elt_at_index (lcm->locator_set_pool,
848 mapit->locator_set_index);
849 if (filter && !((1 == filter && ls->local) ||
850 (2 == filter && !ls->local)))
867 mapit->locator_set_index);
869 if (filter && !((1 == filter && ls->
local) ||
870 (2 == filter && !ls->
local)))
887 .path =
"show lisp eid-table",
888 .short_help =
"Shows EID table",
909 if (
unformat (line_input,
"enable"))
914 else if (
unformat (line_input,
"disable"))
941 .short_help =
"lisp [enable|disable]",
962 if (
unformat (line_input,
"enable"))
967 else if (
unformat (line_input,
"disable"))
993 .path =
"lisp map-register",
994 .short_help =
"lisp map-register [enable|disable]",
1015 if (
unformat (line_input,
"enable"))
1020 else if (
unformat (line_input,
"disable"))
1046 .path =
"lisp rloc-probe",
1047 .short_help =
"lisp rloc-probe [enable|disable]",
1064 msg =
format (msg,
"feature: %U\ngpe: %U\n",
1073 .path =
"show lisp status",
1074 .short_help =
"show lisp status",
1087 uword *vni_table = 0;
1102 else if (
unformat (line_input,
"l3"))
1138 .path =
"show lisp eid-table map",
1139 .short_help =
"show lisp eid-table l2|l3",
1155 u8 *locator_set_name = 0;
1161 memset (&locator, 0,
sizeof (locator));
1162 memset (a, 0,
sizeof (a[0]));
1170 if (
unformat (line_input,
"add %_%v%_", &locator_set_name))
1172 else if (
unformat (line_input,
"del %_%v%_", &locator_set_name))
1174 else if (
unformat (line_input,
"iface %U p %d w %d",
1189 a->
name = locator_set_name;
1198 is_add ?
"add" :
"delete");
1203 if (locator_set_name)
1212 .path =
"lisp locator-set",
1213 .short_help =
"lisp locator-set add/del <name> [iface <iface-name> " 1214 "p <priority> w <weight>]",
1229 u8 *locator_set_name = 0;
1230 u8 locator_set_name_set = 0;
1235 memset (&locator, 0,
sizeof (locator));
1236 memset (a, 0,
sizeof (a[0]));
1246 else if (
unformat (line_input,
"del"))
1248 else if (
unformat (line_input,
"locator-set %_%v%_", &locator_set_name))
1249 locator_set_name_set = 1;
1250 else if (
unformat (line_input,
"iface %U p %d w %d",
1265 if (!locator_set_name_set)
1271 a->
name = locator_set_name;
1288 .path =
"lisp locator",
1289 .short_help =
"lisp locator add/del locator-set <name> iface <iface-name> " 1290 "p <priority> w <weight>",
1306 "Priority",
"Weight");
1315 msg = format (msg,
"%v", lsit->name);
1319 msg = format (msg,
"<%s-%d>",
"remote", lsit - lcm->locator_set_pool);
1325 msg = format (msg,
"%16s",
" ");
1346 .path =
"show lisp locator-set",
1347 .short_help =
"Shows locator-sets",
1359 u8 is_add = 1, addr_set = 0;
1360 ip_address_t ip_addr;
1373 else if (
unformat (line_input,
"del"))
1396 is_add ?
"add" :
"delete");
1407 .path =
"lisp map-resolver",
1408 .short_help =
"lisp map-resolver add/del <ip_address>",
1421 u8 *locator_set_name = 0;
1434 else if (
unformat (line_input,
"add %_%v%_", &locator_set_name))
1450 is_add ?
"add" :
"delete");
1462 .path =
"lisp map-request itr-rlocs",
1463 .short_help =
"lisp map-request itr-rlocs add/del <locator_set_name>",
1492 .path =
"show lisp map-request itr-rlocs",
1493 .short_help =
"Shows map-request itr-rlocs",
1516 else if (
unformat (line_input,
"disable"))
1534 is_add ?
"add" :
"delete");
1545 .path =
"lisp use-petr",
1546 .short_help =
"lisp use-petr [disable] <petr-ip>",
1559 u8 use_petr = lcm->
flags & LISP_FLAG_USE_PETR;
1570 tmp_str =
format (0,
"N/A");
1583 tmp_str =
format (0,
"N/A");
1597 .path =
"show lisp petr",
1598 .short_help =
"Show petr",
#define gid_address_ip_version(_a)
static clib_error_t * lisp_show_pitr_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
sll srl srl sll sra u16x4 i
#define gid_address_type(_a)
static clib_error_t * lisp_use_petr_set_locator_set_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * lisp_show_mreq_itr_rlocs_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
lisp_msmr_t * map_resolvers
static u8 * format_lisp_status(u8 *s, va_list *args)
void ip_set(ip46_address_t *dst, void *src, u8 is_ip4)
static clib_error_t * lisp_rloc_probe_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static u8 * format_lisp_map_request_mode(u8 *s, va_list *args)
u8 vnet_lisp_get_map_request_mode(void)
#define ip_prefix_len(_a)
#define vec_terminate_c_string(V)
(If necessary) NULL terminate a vector containing a c-string.
uword unformat_ip_address(unformat_input_t *input, va_list *args)
static clib_error_t * lisp_show_eid_table_map_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
unformat_function_t unformat_vnet_sw_interface
int vnet_lisp_add_mapping(vnet_lisp_add_del_mapping_args_t *a, locator_t *rlocs, u32 *res_map_index, u8 *is_updated)
Adds/updates mapping.
static clib_error_t * lisp_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
uword unformat_hmac_key_id(unformat_input_t *input, va_list *args)
#define ip_prefix_version(_a)
format_function_t format_vnet_sw_if_index_name
int vnet_lisp_set_map_request_mode(u8 mode)
int vnet_lisp_add_del_adjacency(vnet_lisp_add_del_adjacency_args_t *a)
Adds adjacency or removes forwarding entry associated to remote mapping.
uword unformat_negative_mapping_action(unformat_input_t *input, va_list *args)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static clib_error_t * lisp_add_del_adjacency_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Handler for add/del adjacency CLI.
#define clib_error_return(e, args...)
static clib_error_t * lisp_cp_show_locator_sets_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int vnet_lisp_eid_table_map(u32 vni, u32 dp_id, u8 is_l2, u8 is_add)
static clib_error_t * lisp_add_del_local_eid_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static lisp_cp_main_t * vnet_lisp_cp_get_main()
static clib_error_t * lisp_show_map_request_mode_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * lisp_add_del_mreq_itr_rlocs_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 petr_map_index
Proxy ETR map index used for 'use-petr'.
clib_error_t * vnet_lisp_enable_disable(u8 is_enable)
int vnet_lisp_pitr_set_locator_set(u8 *locator_set_name, u8 is_add)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define gid_address_mac(_a)
int vnet_lisp_add_del_local_mapping(vnet_lisp_add_del_mapping_args_t *a, u32 *map_index_result)
Add/update/delete mapping to/in/from map-cache.
void gid_address_free(gid_address_t *a)
uword unformat_gid_address(unformat_input_t *input, va_list *args)
static clib_error_t * lisp_show_petr_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * lisp_map_register_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u8 * format_gid_address(u8 *s, va_list *args)
static clib_error_t * lisp_map_request_mode_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * lisp_pitr_set_locator_set_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define gid_address_ippref(_a)
lisp_adjacency_t * vnet_lisp_adjacencies_get_by_vni(u32 vni)
Returns vector of adjacencies.
static u8 * format_eid_entry(u8 *s, va_list *args)
int vnet_lisp_add_del_mreq_itr_rlocs(vnet_lisp_add_del_mreq_itr_rloc_args_t *a)
static clib_error_t * lisp_show_adjacencies_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * lisp_add_del_map_resolver_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_free(V)
Free vector's memory (no header).
#define clib_warning(format, args...)
int vnet_lisp_map_register_enable_disable(u8 is_enable)
lisp_gpe_main_t lisp_gpe_main
LISP-GPE global state.
#define VLIB_CLI_COMMAND(x,...)
static clib_error_t * lisp_show_status_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
struct _gid_address_t gid_address_t
uword unformat_mac_address(unformat_input_t *input, va_list *args)
u8 * format_vnet_lisp_gpe_status(u8 *s, va_list *args)
Format LISP-GPE status.
int vnet_lisp_add_del_map_server(ip_address_t *addr, u8 is_add)
u8 * format_ip_address(u8 *s, va_list *args)
int vnet_lisp_clear_all_remote_adjacencies(void)
static clib_error_t * lisp_add_del_map_server_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
locator_set_t * locator_set_pool
int vnet_lisp_rloc_probe_enable_disable(u8 is_enable)
u64 gid_dictionary_lookup(gid_dictionary_t *db, gid_address_t *key)
uword unformat_ip_prefix(unformat_input_t *input, va_list *args)
int vnet_lisp_add_del_locator_set(vnet_lisp_add_del_locator_set_args_t *a, u32 *ls_result)
#define gid_address_ip(_a)
static clib_error_t * lisp_add_del_locator_in_set_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define gid_address_vni(_a)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
int vnet_lisp_del_mapping(gid_address_t *eid, u32 *res_map_index)
Removes a mapping.
int vnet_lisp_add_del_locator(vnet_lisp_add_del_locator_set_args_t *a, locator_set_t *ls, u32 *ls_result)
u8 ip_address_max_len(u8 version)
uword * locator_set_index_by_name
void gid_address_copy(gid_address_t *dst, gid_address_t *src)
#define hash_get_mem(h, key)
static clib_error_t * lisp_add_del_locator_set_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * lisp_eid_table_map_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int vnet_lisp_add_del_map_resolver(vnet_lisp_add_del_map_resolver_args_t *a)
#define vec_foreach(var, vec)
Vector iterator.
int vnet_lisp_use_petr(ip_address_t *ip, u8 is_add)
Configure Proxy-ETR.
static clib_error_t * lisp_show_eid_table_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static clib_error_t * lisp_show_map_resolvers_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * lisp_add_del_remote_mapping_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Handler for add/del remote mapping CLI.