36 if (
unformat (line_input,
"vni %d", &vni))
69 .path =
"show lisp adjacencies",
70 .short_help =
"show lisp adjacencies",
81 u8 is_add = 1, ip_set = 0;
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))
182 locator_set_index = p[0];
199 if (key && (0 == key_id))
216 is_add ?
"add" :
"delete");
220 if (locator_set_name)
231 .path =
"lisp eid-table",
232 .short_help =
"lisp eid-table add/del [vni <vni>] eid <eid> " 233 "locator-set <locator-set> [key <secret-key> key-id sha1|sha256 ]",
243 u8 is_add = 1, is_l2 = 0;
244 u32 vni = 0, dp_id = 0;
256 else if (
unformat (line_input,
"vni %d", &vni))
258 else if (
unformat (line_input,
"vrf %d", &dp_id))
260 else if (
unformat (line_input,
"bd %d", &dp_id))
278 .path =
"lisp eid-table map",
279 .short_help =
"lisp eid-table map [del] vni <vni> vrf <vrf> | bd <bdi>",
299 u8 is_add = 1, del_all = 0;
300 locator_t rloc, *rlocs = 0, *curr_rloc = 0;
303 u32 vni, action = ~0, p, w;
310 memset (&eid, 0,
sizeof (eid));
311 memset (&rloc, 0,
sizeof (rloc));
315 if (
unformat (line_input,
"del-all"))
317 else if (
unformat (line_input,
"del"))
319 else if (
unformat (line_input,
"add"))
323 else if (
unformat (line_input,
"vni %u", &vni))
327 else if (
unformat (line_input,
"p %d w %d", &p, &w))
332 (
"No RLOC configured for setting priority/weight!");
335 curr_rloc->priority = p;
336 curr_rloc->weight = w;
348 curr_rloc = &rlocs[
vec_len (rlocs) - 1];
350 else if (
unformat (line_input,
"action %U",
368 if (is_add && (~0 == action) && 0 ==
vec_len (rlocs))
386 memset (a, 0,
sizeof (a[0]));
401 clib_warning (
"failed to %s remote mapping!", is_add ?
"add" :
"delete");
411 .path =
"lisp remote-mapping",.short_help =
412 "lisp remote-mapping add|del [del-all] vni <vni> " 413 "eid <est-eid> [action <no-action|natively-forward|" 414 "send-map-request|drop>] rloc <dst-locator> p <prio> w <weight> " 415 "[rloc <dst-locator> ... ]",.function =
429 ip_prefix_t *reid_ippref, *leid_ippref;
433 u8 reid_set = 0, leid_set = 0;
440 memset (&reid, 0,
sizeof (reid));
441 memset (&leid, 0,
sizeof (leid));
450 else if (
unformat (line_input,
"add"))
452 else if (
unformat (line_input,
"reid %U",
463 else if (
unformat (line_input,
"vni %u", &vni))
468 else if (
unformat (line_input,
"leid %U",
486 if (!reid_set || !leid_set)
497 clib_warning (
"remote and local EIDs are of different types!");
501 memset (a, 0,
sizeof (a[0]));
507 clib_warning (
"failed to %s adjacency!", is_add ?
"add" :
"delete");
516 .path =
"lisp adjacency",
517 .short_help =
"lisp adjacency add|del vni <vni> reid <remote-eid> " 550 if (_MR_MODE_MAX == mr_mode)
566 .path =
"lisp map-request mode",
567 .short_help =
"lisp map-request mode dst-only|src-dst",
576 u32 mode = va_arg (*args,
u32);
581 return format (0,
"dst-only");
583 return format (0,
"src-dst");
600 .path =
"show lisp map-request mode",
601 .short_help =
"show lisp map-request mode",
623 .path =
"show lisp map-resolvers",
624 .short_help =
"show lisp map-resolvers",
635 u8 locator_name_set = 0;
636 u8 *locator_set_name = 0;
648 if (
unformat (line_input,
"ls %_%v%_", &locator_set_name))
649 locator_name_set = 1;
650 else if (
unformat (line_input,
"disable"))
659 if (!locator_name_set)
668 is_add ?
"add" :
"delete");
672 if (locator_set_name)
682 .short_help =
"lisp pitr [disable] ls <locator-set-name>",
697 "pitr", lcm->
lisp_pitr ?
"locator-set" :
"");
707 tmp_str =
format (0,
"N/A");
720 tmp_str =
format (0,
"N/A");
734 .path =
"show lisp pitr",
735 .short_help =
"Show pitr",
777 gid, type, loc, ttl, aut);
781 s =
format (s,
"%55s%v\n",
"", loc);
801 memset (&eid, 0,
sizeof (eid));
811 else if (
unformat (line_input,
"local"))
813 else if (
unformat (line_input,
"remote"))
824 "EID",
"type",
"locators",
"ttl",
"autoritative");
834 locator_set_t * ls = pool_elt_at_index (lcm->locator_set_pool,
835 mapit->locator_set_index);
836 if (filter && !((1 == filter && ls->local) ||
837 (2 == filter && !ls->local)))
854 mapit->locator_set_index);
856 if (filter && !((1 == filter && ls->
local) ||
857 (2 == filter && !ls->
local)))
874 .path =
"show lisp eid-table",
875 .short_help =
"Shows EID table",
896 if (
unformat (line_input,
"enable"))
901 else if (
unformat (line_input,
"disable"))
928 .short_help =
"lisp [enable|disable]",
949 if (
unformat (line_input,
"enable"))
954 else if (
unformat (line_input,
"disable"))
980 .path =
"lisp map-register",
981 .short_help =
"lisp map-register [enable|disable]",
1002 if (
unformat (line_input,
"enable"))
1007 else if (
unformat (line_input,
"disable"))
1033 .path =
"lisp rloc-probe",
1034 .short_help =
"lisp rloc-probe [enable|disable]",
1051 msg =
format (msg,
"feature: %U\ngpe: %U\n",
1060 .path =
"show lisp status",
1061 .short_help =
"show lisp status",
1074 uword *vni_table = 0;
1089 else if (
unformat (line_input,
"l3"))
1125 .path =
"show lisp eid-table map",
1126 .short_help =
"show lisp eid-table l2|l3",
1142 u8 *locator_set_name = 0;
1148 memset (&locator, 0,
sizeof (locator));
1149 memset (a, 0,
sizeof (a[0]));
1157 if (
unformat (line_input,
"add %_%v%_", &locator_set_name))
1159 else if (
unformat (line_input,
"del %_%v%_", &locator_set_name))
1161 else if (
unformat (line_input,
"iface %U p %d w %d",
1176 a->
name = locator_set_name;
1185 is_add ?
"add" :
"delete");
1190 if (locator_set_name)
1199 .path =
"lisp locator-set",
1200 .short_help =
"lisp locator-set add/del <name> [iface <iface-name> " 1201 "p <priority> w <weight>]",
1216 u8 *locator_set_name = 0;
1217 u8 locator_set_name_set = 0;
1222 memset (&locator, 0,
sizeof (locator));
1223 memset (a, 0,
sizeof (a[0]));
1233 else if (
unformat (line_input,
"del"))
1235 else if (
unformat (line_input,
"locator-set %_%v%_", &locator_set_name))
1236 locator_set_name_set = 1;
1237 else if (
unformat (line_input,
"iface %U p %d w %d",
1252 if (!locator_set_name_set)
1258 a->
name = locator_set_name;
1275 .path =
"lisp locator",
1276 .short_help =
"lisp locator add/del locator-set <name> iface <iface-name> " 1277 "p <priority> w <weight>",
1293 "Priority",
"Weight");
1302 msg = format (msg,
"%v", lsit->name);
1306 msg = format (msg,
"<%s-%d>",
"remote", lsit - lcm->locator_set_pool);
1312 msg = format (msg,
"%16s",
" ");
1333 .path =
"show lisp locator-set",
1334 .short_help =
"Shows locator-sets",
1346 u8 is_add = 1, addr_set = 0;
1347 ip_address_t ip_addr;
1360 else if (
unformat (line_input,
"del"))
1383 is_add ?
"add" :
"delete");
1394 .path =
"lisp map-resolver",
1395 .short_help =
"lisp map-resolver add/del <ip_address>",
1408 u8 *locator_set_name = 0;
1421 else if (
unformat (line_input,
"add %_%v%_", &locator_set_name))
1436 is_add ?
"add" :
"delete");
1448 .path =
"lisp map-request itr-rlocs",
1449 .short_help =
"lisp map-request itr-rlocs add/del <locator_set_name>",
1478 .path =
"show lisp map-request itr-rlocs",
1479 .short_help =
"Shows map-request itr-rlocs",
1489 u8 is_add = 1, ip_set = 0;
1502 else if (
unformat (line_input,
"disable"))
1520 is_add ?
"add" :
"delete");
1531 .path =
"lisp use-petr",
1532 .short_help =
"lisp use-petr [disable] <petr-ip>",
1545 u8 use_petr = lcm->
flags & LISP_FLAG_USE_PETR;
1556 tmp_str =
format (0,
"N/A");
1569 tmp_str =
format (0,
"N/A");
1583 .path =
"show lisp petr",
1584 .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)
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)
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
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.
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.
#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)
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 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)
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_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.