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;
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;
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;
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))
413 clib_warning (
"failed to %s remote mapping!", is_add ?
"add" :
"delete");
423 .path =
"lisp remote-mapping",
424 .short_help =
"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> " 427 "w <weight> [rloc <dst-locator> ... ]",
447 u8 reid_set = 0, leid_set = 0;
464 else if (
unformat (line_input,
"add"))
466 else if (
unformat (line_input,
"reid %U",
477 else if (
unformat (line_input,
"vni %u", &vni))
482 else if (
unformat (line_input,
"leid %U",
500 if (!reid_set || !leid_set)
511 clib_warning (
"remote and local EIDs are of different types!");
521 clib_warning (
"failed to %s adjacency!", is_add ?
"add" :
"delete");
530 .path =
"lisp adjacency",
531 .short_help =
"lisp adjacency add|del vni <vni> reid <remote-eid> " 564 if (_MR_MODE_MAX == mr_mode)
580 .path =
"lisp map-request mode",
581 .short_help =
"lisp map-request mode dst-only|src-dst",
595 return format (0,
"dst-only");
597 return format (0,
"src-dst");
614 .path =
"show lisp map-request mode",
615 .short_help =
"show lisp map-request mode",
637 .path =
"show lisp map-resolvers",
638 .short_help =
"show lisp map-resolvers",
649 u8 locator_name_set = 0;
650 u8 *locator_set_name = 0;
662 if (
unformat (line_input,
"ls %_%v%_", &locator_set_name))
663 locator_name_set = 1;
664 else if (
unformat (line_input,
"disable"))
673 if (!locator_name_set)
683 is_add ?
"add" :
"delete");
687 if (locator_set_name)
697 .short_help =
"lisp pitr [disable] ls <locator-set-name>",
710 u8 status = lcm->
flags & LISP_FLAG_PITR_MODE;
712 vlib_cli_output (vm,
"%=20s%=16s",
"pitr", status ?
"locator-set" :
"");
722 tmp_str =
format (0,
"N/A");
735 tmp_str =
format (0,
"N/A");
749 .path =
"show lisp pitr",
750 .short_help =
"Show pitr",
792 gid, type, loc, ttl, aut);
796 s =
format (s,
"%55s%v\n",
"", loc);
826 else if (
unformat (line_input,
"local"))
828 else if (
unformat (line_input,
"remote"))
839 "EID",
"type",
"locators",
"ttl",
"authoritative");
851 if (filter && !((1 == filter && ls->
local) ||
852 (2 == filter && !ls->
local)))
871 if (filter && !((1 == filter && ls->
local) ||
872 (2 == filter && !ls->
local)))
889 .path =
"show lisp eid-table",
890 .short_help =
"show lisp eid-table [local|remote|eid <eid>]",
911 .path =
"lisp enable",
912 .short_help =
"lisp enable",
932 .path =
"lisp disable",
933 .short_help =
"lisp disable",
954 if (
unformat (line_input,
"enable"))
959 else if (
unformat (line_input,
"disable"))
985 .path =
"lisp map-register",
986 .short_help =
"lisp map-register [enable|disable]",
1007 if (
unformat (line_input,
"enable"))
1012 else if (
unformat (line_input,
"disable"))
1038 .path =
"lisp rloc-probe",
1039 .short_help =
"lisp rloc-probe [enable|disable]",
1056 msg =
format (msg,
"feature: %U\ngpe: %U\n",
1065 .path =
"show lisp status",
1066 .short_help =
"show lisp status",
1079 uword *vni_table = 0;
1094 else if (
unformat (line_input,
"l3"))
1130 .path =
"show lisp eid-table map",
1131 .short_help =
"show lisp eid-table map l2|l3",
1147 u8 *locator_set_name = 0;
1162 if (
unformat (line_input,
"add %_%v%_", &locator_set_name))
1164 else if (
unformat (line_input,
"del %_%v%_", &locator_set_name))
1166 else if (
unformat (line_input,
"iface %U p %d w %d",
1183 a->
name = locator_set_name;
1192 is_add ?
"add" :
"delete");
1197 if (locator_set_name)
1206 .path =
"lisp locator-set",
1207 .short_help =
"lisp locator-set add/del <name> [iface <iface-name> " 1208 "p <priority> w <weight>]",
1223 u8 *locator_set_name = 0;
1224 u8 locator_set_name_set = 0;
1240 else if (
unformat (line_input,
"del"))
1242 else if (
unformat (line_input,
"locator-set %_%v%_", &locator_set_name))
1243 locator_set_name_set = 1;
1244 else if (
unformat (line_input,
"iface %U p %d w %d",
1259 if (!locator_set_name_set)
1265 a->
name = locator_set_name;
1282 .path =
"lisp locator",
1283 .short_help =
"lisp locator add/del locator-set <name> iface <iface-name> " 1284 "p <priority> w <weight>",
1300 "Priority",
"Weight");
1319 msg =
format (msg,
"%16s",
" ");
1340 .path =
"show lisp locator-set",
1341 .short_help =
"Shows locator-sets",
1353 u8 is_add = 1, addr_set = 0;
1367 else if (
unformat (line_input,
"del"))
1390 is_add ?
"add" :
"delete");
1401 .path =
"lisp map-resolver",
1402 .short_help =
"lisp map-resolver add/del <ip_address>",
1415 u8 *locator_set_name = 0;
1428 else if (
unformat (line_input,
"add %_%v%_", &locator_set_name))
1444 is_add ?
"add" :
"delete");
1456 .path =
"lisp map-request itr-rlocs",
1457 .short_help =
"lisp map-request itr-rlocs add/del <locator_set_name>",
1486 .path =
"show lisp map-request itr-rlocs",
1487 .short_help =
"Shows map-request itr-rlocs",
1510 else if (
unformat (line_input,
"disable"))
1528 is_add ?
"add" :
"delete");
1539 .path =
"lisp use-petr",
1540 .short_help =
"lisp use-petr [disable] <petr-ip>",
1553 u8 use_petr = lcm->
flags & LISP_FLAG_USE_PETR;
1564 tmp_str =
format (0,
"N/A");
1577 tmp_str =
format (0,
"N/A");
1591 .path =
"show lisp petr",
1592 .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)
#define gid_address_type(_a)
static clib_error_t * lisp_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
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
#define pool_foreach(VAR, POOL)
Iterate through pool.
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)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
u8 vnet_lisp_get_map_request_mode(void)
#define vec_terminate_c_string(V)
(If necessary) NULL terminate a vector containing a c-string.
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.
uword unformat_hmac_key_id(unformat_input_t *input, va_list *args)
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)
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.
description fragment has unexpected format
#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'.
vl_api_fib_path_type_t type
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)
uword unformat_ip_address(unformat_input_t *input, va_list *args)
static clib_error_t * lisp_pitr_set_locator_set_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vl_api_tunnel_mode_t mode
#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)
sll srl srl sll sra u16x4 i
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...)
u8 * format_ip_address(u8 *s, va_list *args)
int vnet_lisp_map_register_enable_disable(u8 is_enable)
uword unformat_mac_address(unformat_input_t *input, va_list *args)
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
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)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
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)
gid_dictionary_t mapping_index_by_gid
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)
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)
vl_api_mac_event_action_t action
#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)
#define ip_prefix_len(_a)
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 ip_prefix_version(_a)
#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.
uword unformat_ip_prefix(unformat_input_t *input, va_list *args)
static clib_error_t * lisp_enable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
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)
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.