35 if (
unformat (line_input,
"vni %d", &vni))
67 .path =
"show one adjacencies",
68 .short_help =
"show one adjacencies",
79 u8 is_add = 1, ip_set = 0;
91 else if (
unformat (line_input,
"del"))
114 is_add ?
"add" :
"delete");
121 .path =
"one map-server",
122 .short_help =
"one map-server add|del <ip>",
138 u8 *locator_set_name = 0;
139 u32 locator_set_index = 0, map_index = 0;
147 memset (&eid, 0,
sizeof (eid));
148 memset (a, 0,
sizeof (*a));
158 else if (
unformat (line_input,
"del"))
162 else if (
unformat (line_input,
"vni %d", &vni))
164 else if (
unformat (line_input,
"secret-key %_%v%_", &key))
169 else if (
unformat (line_input,
"locator-set %_%v%_", &locator_set_name))
178 locator_set_index = p[0];
195 if (key && (0 == key_id))
212 is_add ?
"add" :
"delete");
216 if (locator_set_name)
226 .path =
"one eid-table",
227 .short_help =
"one eid-table add/del [vni <vni>] eid <eid> " 228 "locator-set <locator-set> [key <secret-key> key-id sha1|sha256 ]",
238 u8 is_add = 1, is_l2 = 0;
239 u32 vni = 0, dp_id = 0;
251 else if (
unformat (line_input,
"vni %d", &vni))
253 else if (
unformat (line_input,
"vrf %d", &dp_id))
255 else if (
unformat (line_input,
"bd %d", &dp_id))
273 .path =
"one eid-table map",
274 .short_help =
"one eid-table map [del] vni <vni> vrf <vrf> | bd <bdi>",
294 u8 is_add = 1, del_all = 0;
295 locator_t rloc, *rlocs = 0, *curr_rloc = 0;
298 u32 vni, action = ~0, p, w;
305 memset (&eid, 0,
sizeof (eid));
306 memset (&rloc, 0,
sizeof (rloc));
310 if (
unformat (line_input,
"del-all"))
312 else if (
unformat (line_input,
"del"))
314 else if (
unformat (line_input,
"add"))
318 else if (
unformat (line_input,
"vni %u", &vni))
322 else if (
unformat (line_input,
"p %d w %d", &p, &w))
327 (
"No RLOC configured for setting priority/weight!");
330 curr_rloc->priority = p;
331 curr_rloc->weight = w;
343 curr_rloc = &rlocs[
vec_len (rlocs) - 1];
345 else if (
unformat (line_input,
"action %U",
355 if (!del_all && !eid_set)
363 if (is_add && (~0 == action) && 0 ==
vec_len (rlocs))
379 memset (a, 0,
sizeof (a[0]));
394 clib_warning (
"failed to %s remote mapping!", is_add ?
"add" :
"delete");
404 .path =
"one remote-mapping",
406 "one remote-mapping add|del [del-all] vni <vni> " 407 "eid <est-eid> [action <no-action|natively-forward|" 408 "send-map-request|drop>] rloc <dst-locator> p <prio> w <weight> " 409 "[rloc <dst-locator> ... ]",
425 ip_prefix_t *reid_ippref, *leid_ippref;
429 u8 reid_set = 0, leid_set = 0;
436 memset (&reid, 0,
sizeof (reid));
437 memset (&leid, 0,
sizeof (leid));
446 else if (
unformat (line_input,
"add"))
448 else if (
unformat (line_input,
"reid %U",
459 else if (
unformat (line_input,
"vni %u", &vni))
464 else if (
unformat (line_input,
"leid %U",
482 if (!reid_set || !leid_set)
493 clib_warning (
"remote and local EIDs are of different types!");
497 memset (a, 0,
sizeof (a[0]));
503 clib_warning (
"failed to %s adjacency!", is_add ?
"add" :
"delete");
512 .path =
"one adjacency",
513 .short_help =
"one adjacency add|del vni <vni> reid <remote-eid> " 545 if (_MR_MODE_MAX == mr_mode)
561 .path =
"one map-request mode",
562 .short_help =
"one map-request mode dst-only|src-dst",
571 u32 mode = va_arg (*args,
u32);
576 return format (0,
"dst-only");
578 return format (0,
"src-dst");
595 .path =
"show one map-request mode",
596 .short_help =
"show one map-request mode",
618 .path =
"show one map-resolvers",
619 .short_help =
"show one map-resolvers",
630 u8 locator_name_set = 0;
631 u8 *locator_set_name = 0;
643 if (
unformat (line_input,
"ls %_%v%_", &locator_set_name))
644 locator_name_set = 1;
645 else if (
unformat (line_input,
"disable"))
654 if (!locator_name_set)
663 is_add ?
"add" :
"delete");
667 if (locator_set_name)
676 .short_help =
"one pitr [disable] ls <locator-set-name>",
691 "pitr", lcm->
lisp_pitr ?
"locator-set" :
"");
701 tmp_str =
format (0,
"N/A");
714 tmp_str =
format (0,
"N/A");
728 .path =
"show one pitr",
729 .short_help =
"Show pitr",
771 gid, type, loc, ttl, aut);
775 s =
format (s,
"%55s%v\n",
"", loc);
795 memset (&eid, 0,
sizeof (eid));
805 else if (
unformat (line_input,
"local"))
807 else if (
unformat (line_input,
"remote"))
818 "EID",
"type",
"locators",
"ttl",
"autoritative");
825 locator_set_t * ls = pool_elt_at_index (lcm->locator_set_pool,
826 mapit->locator_set_index);
827 if (filter && !((1 == filter && ls->local) ||
828 (2 == filter && !ls->local)))
845 mapit->locator_set_index);
847 if (filter && !((1 == filter && ls->
local) ||
848 (2 == filter && !ls->
local)))
865 .path =
"show one eid-table",
866 .short_help =
"Shows EID table",
887 if (
unformat (line_input,
"enable"))
892 else if (
unformat (line_input,
"disable"))
919 .short_help =
"one [enable|disable]",
940 if (
unformat (line_input,
"enable"))
945 else if (
unformat (line_input,
"disable"))
971 .path =
"one map-register",
972 .short_help =
"one map-register [enable|disable]",
993 if (
unformat (line_input,
"enable"))
998 else if (
unformat (line_input,
"disable"))
1024 .path =
"one rloc-probe",
1025 .short_help =
"one rloc-probe [enable|disable]",
1042 msg =
format (msg,
"feature: %U\ngpe: %U\n",
1051 .path =
"show one status",
1052 .short_help =
"show one status",
1065 uword *vni_table = 0;
1080 else if (
unformat (line_input,
"l3"))
1116 .path =
"show one eid-table map",
1117 .short_help =
"show one eid-table l2|l3",
1133 u8 *locator_set_name = 0;
1139 memset (&locator, 0,
sizeof (locator));
1140 memset (a, 0,
sizeof (a[0]));
1148 if (
unformat (line_input,
"add %_%v%_", &locator_set_name))
1150 else if (
unformat (line_input,
"del %_%v%_", &locator_set_name))
1152 else if (
unformat (line_input,
"iface %U p %d w %d",
1167 a->
name = locator_set_name;
1176 is_add ?
"add" :
"delete");
1181 if (locator_set_name)
1189 .path =
"one locator-set",
1190 .short_help =
"one locator-set add/del <name> [iface <iface-name> " 1191 "p <priority> w <weight>]",
1206 u8 *locator_set_name = 0;
1207 u8 locator_set_name_set = 0;
1212 memset (&locator, 0,
sizeof (locator));
1213 memset (a, 0,
sizeof (a[0]));
1223 else if (
unformat (line_input,
"del"))
1225 else if (
unformat (line_input,
"locator-set %_%v%_", &locator_set_name))
1226 locator_set_name_set = 1;
1227 else if (
unformat (line_input,
"iface %U p %d w %d",
1242 if (!locator_set_name_set)
1248 a->
name = locator_set_name;
1264 .path =
"one locator",
1265 .short_help =
"one locator add/del locator-set <name> iface <iface-name> " 1266 "p <priority> w <weight>",
1282 "Priority",
"Weight");
1291 msg = format (msg,
"%v", lsit->name);
1295 msg = format (msg,
"<%s-%d>",
"remote", lsit - lcm->locator_set_pool);
1301 msg = format (msg,
"%16s",
" ");
1322 .path =
"show one locator-set",
1323 .short_help =
"Shows locator-sets",
1335 u8 is_add = 1, addr_set = 0;
1336 ip_address_t ip_addr;
1349 else if (
unformat (line_input,
"del"))
1372 is_add ?
"add" :
"delete");
1382 .path =
"one map-resolver",
1383 .short_help =
"one map-resolver add/del <ip_address>",
1396 u8 *locator_set_name = 0;
1409 else if (
unformat (line_input,
"add %_%v%_", &locator_set_name))
1424 is_add ?
"add" :
"delete");
1436 .path =
"one map-request itr-rlocs",
1437 .short_help =
"one map-request itr-rlocs add/del <locator_set_name>",
1466 .path =
"show one map-request itr-rlocs",
1467 .short_help =
"Shows map-request itr-rlocs",
1477 u8 is_add = 1, ip_set = 0;
1490 else if (
unformat (line_input,
"disable"))
1508 is_add ?
"add" :
"delete");
1518 .path =
"one use-petr",
1519 .short_help =
"one use-petr [disable] <petr-ip>",
1532 u8 use_petr = lcm->
flags & LISP_FLAG_USE_PETR;
1543 tmp_str =
format (0,
"N/A");
1556 tmp_str =
format (0,
"N/A");
1570 .path =
"show one petr",
1571 .short_help =
"Show petr",
1593 .path =
"show one map-servers",
1594 .short_help =
"show one map servers",
1607 msg =
format (msg,
"%s\n", is_enabled ?
"enabled" :
"disabled");
1615 .path =
"show one map-register state",
1616 .short_help =
"show one map-register state",
1629 msg =
format (msg,
"%s\n", is_enabled ?
"enabled" :
"disabled");
1637 .path =
"show one rloc state",
1638 .short_help =
"show one RLOC state",
1655 .path =
"show one statistics status",
1656 .short_help =
"show ONE statistics enable/disable status",
1670 "[src-EID, dst-EID] [loc-rloc, rmt-rloc] count bytes\n");
1689 .path =
"show one statistics details",
1690 .short_help =
"show ONE statistics",
1709 if (
unformat (line_input,
"enable"))
1711 else if (
unformat (line_input,
"disable"))
1727 .path =
"one statistics",
1728 .short_help =
"enable/disable ONE statistics collecting",
1744 .path =
"one statistics flush",
1745 .short_help =
"Flush ONE statistics",
static clib_error_t * lisp_stats_flush_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define gid_address_ip_version(_a)
sll srl srl sll sra u16x4 i
#define gid_address_type(_a)
static clib_error_t * lisp_show_pitr_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
lisp_msmr_t * map_resolvers
static clib_error_t * lisp_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static u8 * format_eid_entry(u8 *s, va_list *args)
u8 vnet_lisp_get_map_request_mode(void)
#define ip_prefix_len(_a)
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).
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_add_del_adjacency_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Handler for add/del adjacency CLI.
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_local_eid_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
unformat_function_t unformat_vnet_sw_interface
vnet_api_error_t vnet_lisp_stats_enable_disable(u8 enable)
uword unformat_hmac_key_id(unformat_input_t *input, va_list *args)
#define ip_prefix_version(_a)
u8 vnet_lisp_stats_enable_disable_state(void)
format_function_t format_vnet_sw_if_index_name
u8 vnet_lisp_map_register_state_get(void)
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)
lisp_msmr_t * map_servers
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static clib_error_t * lisp_show_map_servers_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * lisp_show_rloc_probe_state_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int vnet_lisp_flush_stats(void)
static clib_error_t * lisp_show_eid_table_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define clib_error_return(e, args...)
int vnet_lisp_eid_table_map(u32 vni, u32 dp_id, u8 is_l2, u8 is_add)
static lisp_cp_main_t * vnet_lisp_cp_get_main()
static clib_error_t * lisp_cp_show_locator_sets_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 petr_map_index
Proxy ETR map index.
clib_error_t * vnet_lisp_enable_disable(u8 is_enable)
u32 gid_dictionary_lookup(gid_dictionary_t *db, gid_address_t *key)
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.
u8 vnet_lisp_rloc_probe_state_get(void)
counter_t packets
packet counter
static clib_error_t * lisp_add_del_map_server_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * lisp_map_request_mode_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#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)
lisp_api_stats_t * vnet_lisp_get_stats(void)
uword unformat_gid_address(unformat_input_t *input, va_list *args)
u8 * format_gid_address(u8 *s, va_list *args)
static clib_error_t * lisp_map_register_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int vnet_lisp_add_del_mapping(gid_address_t *eid, locator_t *rlocs, u8 action, u8 authoritative, u32 ttl, u8 is_add, u8 is_static, u32 *res_map_index)
Adds/removes/updates mapping.
#define gid_address_ippref(_a)
lisp_adjacency_t * vnet_lisp_adjacencies_get_by_vni(u32 vni)
Returns vector of adjacencies.
static clib_error_t * lisp_stats_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int vnet_lisp_add_del_mreq_itr_rlocs(vnet_lisp_add_del_mreq_itr_rloc_args_t *a)
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)
#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)
static clib_error_t * lisp_add_del_map_resolver_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
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_eid_table_map_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
lisp_gpe_main_t lisp_gpe_main
LISP-GPE global state.
static clib_error_t * lisp_show_adjacencies_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define VLIB_CLI_COMMAND(x,...)
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 u8 * format_lisp_status(u8 *s, va_list *args)
locator_set_t * locator_set_pool
static clib_error_t * lisp_show_stats_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int vnet_lisp_rloc_probe_enable_disable(u8 is_enable)
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.
static clib_error_t * lisp_pitr_set_locator_set_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * lisp_show_eid_table_map_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
uword unformat_ip_prefix(unformat_input_t *input, va_list *args)
static clib_error_t * lisp_rloc_probe_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
counter_t bytes
byte counter
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_show_mreq_itr_rlocs_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * lisp_show_status_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_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)
static clib_error_t * lisp_show_map_register_state_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define hash_get_mem(h, key)
static clib_error_t * lisp_show_petr_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)
static u8 * format_lisp_map_request_mode(u8 *s, va_list *args)
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)
#define vec_foreach(var, vec)
Vector iterator.
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)
static clib_error_t * lisp_show_stats_details_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u8 * format_fid_address(u8 *s, va_list *args)
int vnet_lisp_use_petr(ip_address_t *ip, u8 is_add)
Configure Proxy-ETR.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)