|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
28 #include <openssl/evp.h>
31 #define MAX_VALUE_U24 0xffffff
34 #define TIME_UNTIL_REFETCH_OR_DELETE 20
35 #define MAPPING_TIMEOUT (((m->ttl) * 60) - TIME_UNTIL_REFETCH_OR_DELETE)
79 u8 smr_invoked,
u8 is_resend);
176 u8 with_default_route)
187 return VNET_API_ERROR_INVALID_VALUE;
196 return VNET_API_ERROR_INVALID_VALUE;
261 u32 i, limitp = 0, li, found = 0, esi;
293 if ((found && lp->
priority == limitp)
294 || (!found && lp->
priority >= limitp))
312 if ((
u32) ~ 0 == esi)
395 uword *feip = 0, *dpid, *rmts_stored_idxp = 0;
410 if (lcm->
flags & LISP_FLAG_PITR_MODE)
422 lcl_eid = &lcl_map->
eid;
428 rmt_eid = &rmt_map->
eid;
455 a->is_src_dst = is_src_dst;
467 a->table_id = dpid[0];
474 clib_warning (
"vni %d not associated to a bridge domain !",
a->vni);
485 if (
rv == 0 && (lcm->
flags & LISP_FLAG_USE_PETR))
501 if (
a->locator_pairs)
525 if (!rmts_stored_idxp)
534 rmts_idx = (
u32) (*rmts_stored_idxp);
565 (
u8 *) &
a,
sizeof (
a));
641 return VNET_API_ERROR_LISP_DISABLED;
684 u32 * map_index_result)
687 u32 mi, *map_indexp, map_index,
i;
688 u32 **rmts = 0, *remote_idxp, rmts_itr, remote_idx;
698 return VNET_API_ERROR_INVALID_ARGUMENT;
703 return VNET_API_ERROR_INVALID_ARGUMENT;
716 return VNET_API_ERROR_VALUE_EXIST;
736 clib_warning (
"Locator set with index %d doesn't exist",
737 a->locator_set_index);
738 return VNET_API_ERROR_INVALID_VALUE;
744 a->locator_set_index);
745 vec_add1 (eid_indexes[0], map_index);
752 map_index_result[0] = map_index;
760 return VNET_API_ERROR_INVALID_VALUE;
765 a->locator_set_index);
766 for (
i = 0;
i <
vec_len (eid_indexes[0]);
i++)
769 if (map_indexp[0] == mi)
797 if (lm_indexp[0] == mi)
812 remote_idx =
vec_elt (rmts[0], rmts_itr);
813 if (mi == remote_idx)
837 u32 * map_index_result)
848 return VNET_API_ERROR_LISP_DISABLED;
862 return VNET_API_ERROR_INVALID_VALUE;
875 return (BIHASH_WALK_CONTINUE);
877 u32 bd = (
u32) (kvp->key[0] >> 32);
879 return (BIHASH_WALK_CONTINUE);
899 return (BIHASH_WALK_CONTINUE);
901 u32 bd = (
u32) (kvp->key[0] >> 32);
903 return (BIHASH_WALK_CONTINUE);
931 return (BIHASH_WALK_CONTINUE);
933 u32 bd = (
u32) (kvp->key[0] >> 32);
937 mac_copy (e.mac, (
void *) &kvp->value);
938 e.ip4 = (
u32) kvp->key[1];
941 return (BIHASH_WALK_CONTINUE);
967 return (BIHASH_WALK_CONTINUE);
969 u32 bd = (
u32) (kvp->key[0] >> 32);
973 mac_copy (e.mac, (
void *) &kvp->value);
977 return (BIHASH_WALK_CONTINUE);
1001 return VNET_API_ERROR_LISP_DISABLED;
1013 return VNET_API_ERROR_ENTRY_ALREADY_EXISTS;
1023 clib_warning (
"ONE entry %U not found - cannot delete!",
1038 uword *dp_idp, *vnip, **dp_table_by_vni, **vni_by_dp_table;
1043 return VNET_API_ERROR_LISP_DISABLED;
1049 if (!is_l2 && (
vni == 0 || dp_id == 0))
1051 clib_warning (
"can't add/del default vni-vrf mapping!");
1056 vnip =
hash_get (vni_by_dp_table[0], dp_id);
1062 clib_warning (
"vni %d or vrf %d already used in vrf/vni "
1063 "mapping!",
vni, dp_id);
1075 if (!dp_idp || !vnip)
1077 clib_warning (
"vni %d or vrf %d not used in any vrf/vni! "
1078 "mapping!",
vni, dp_id);
1104 old_li =
vec_elt (old_ls_indexes,
i);
1180 a.is_negative = is_negative;
1228 u32 * res_map_index,
u8 * is_updated)
1232 u32 mi, ls_index = 0, dst_map_index;
1239 return VNET_API_ERROR_LISP_DISABLED;
1243 res_map_index[0] = ~0;
1261 return VNET_API_ERROR_LISP_RLOC_LOCAL;
1272 clib_warning (
"mapping %U rejected due to collision with local "
1282 if (old_map->
action !=
a->action && NULL != is_updated)
1286 old_map->
ttl =
a->ttl;
1300 res_map_index[0] = mi;
1310 ls_args->
index = ~0;
1316 a->locator_set_index = ls_index;
1320 res_map_index[0] = dst_map_index;
1346 res_map_index[0] = ~0;
1377 res_map_index[0] = mi;
1387 u32 mi, *map_indices = 0, *map_indexp;
1415 ls->
index =
map->locator_set_index;
1438 u32 local_mi, remote_mi = ~0;
1443 return VNET_API_ERROR_LISP_DISABLED;
1447 &
a->reid, &
a->leid);
1450 clib_warning (
"Remote eid %U not found. Cannot add adjacency!",
1460 if (lcm->
flags & LISP_FLAG_PITR_MODE)
1490 clib_warning (
"Local eid %U not found. Cannot add adjacency!",
1513 return VNET_API_ERROR_LISP_DISABLED;
1516 if (
mode >= _MR_MODE_MAX)
1519 return VNET_API_ERROR_INVALID_ARGUMENT;
1531 u32 locator_set_index = ~0;
1538 return VNET_API_ERROR_LISP_DISABLED;
1548 clib_warning (
"locator-set %v doesn't exist", locator_set_name);
1551 locator_set_index = p[0];
1581 u32 locator_set_index = ~0;
1588 return VNET_API_ERROR_LISP_DISABLED;
1594 clib_warning (
"locator-set %v doesn't exist", locator_set_name);
1597 locator_set_index = p[0];
1622 return VNET_API_ERROR_INVALID_ARGUMENT;
1656 return VNET_API_ERROR_LISP_DISABLED;
1671 ls_args->
index = ~0;
1681 lcm->
flags |= LISP_FLAG_USE_PETR;
1696 lcm->
flags &= ~LISP_FLAG_USE_PETR;
1707 u32 i, j, *loc_indexp, *ls_indexp, **ls_indexes, *to_be_deleted = 0;
1714 for (j = 0; j <
vec_len (ls_indexes[0]); j++)
1717 if (ls_indexp[0] == lsi)
1725 if (
vec_len (ls_indexes[0]) == 0)
1734 for (
i = 0;
i <
vec_len (to_be_deleted);
i++)
1743 static inline uword *
1782 return VNET_API_ERROR_VALUE_EXIST;
1791 u32 mapping_index,
u8 remove_only)
1795 uword *fei = 0, *rmts_idxp = 0;
1796 u32 **rmts = 0, *remote_idxp = 0, *rmts_copy = 0;
1809 rmts_copy =
vec_dup (rmts[0]);
1854 u32 ls_index,
u8 remove_only)
1864 for (
i = 0;
i <
vec_len (eid_indexes[0]);
i++)
1876 u32 **ls_indexes = NULL;
1884 vec_del1 (ls_indexes[0], ls_index);
1894 u32 loc_index = ~0, ls_index = ~0, *locit = NULL, **ls_indexes = NULL;
1903 return VNET_API_ERROR_LISP_DISABLED;
1910 return VNET_API_ERROR_INVALID_ARGUMENT;
1918 clib_warning (
"locator-set %d to be overwritten doesn't exist!",
1920 return VNET_API_ERROR_INVALID_ARGUMENT;
1927 ls_result[0] = p[0];
1968 else if (0 == loc->
local &&
2005 return VNET_API_ERROR_LISP_DISABLED;
2013 if (p && p[0] != (
u32) ~ 0)
2018 clib_warning (
"locator-set %d to be overwritten doesn't exist!",
2033 ls_result[0] = p[0];
2058 ls_result[0] = ls_index;
2079 clib_warning (
"locator-set with index %d doesn't exists", p[0]);
2085 clib_warning (
"Can't delete the locator-set used to constrain "
2086 "the itr-rlocs in map-requests!");
2093 if (
vec_len (eid_indexes[0]) != 0)
2096 (
"Can't delete a locator that supports a mapping!");
2172 dp_add_del_iface(lcm, vni, 0, 1,
2173 with_default_route);
2176 dp_add_del_iface(lcm, vni, 1, 1,
2177 with_default_route);
2208 a->is_en = is_enable;
2213 a->is_en ?
"enable" :
"disable");
2218 if (lcm->
flags & LISP_FLAG_XTR_MODE)
2232 if (lcm->
flags & LISP_FLAG_PETR_MODE)
2235 if (!(lcm->
flags & LISP_FLAG_XTR_MODE))
2244 if (lcm->
flags & LISP_FLAG_PITR_MODE)
2283 return VNET_API_ERROR_LISP_DISABLED;
2345 return VNET_API_ERROR_LISP_DISABLED;
2353 clib_warning (
"locator-set %v doesn't exist",
a->locator_set_name);
2354 return VNET_API_ERROR_INVALID_ARGUMENT;
2368 #define foreach_lisp_cp_lookup_error \
2370 _(MAP_REQUESTS_SENT, "map-request sent") \
2371 _(ARP_REPLY_TX, "ARP replies sent") \
2372 _(NDP_NEIGHBOR_ADVERTISEMENT_TX, \
2373 "neighbor advertisement sent")
2376 #define _(sym,string) string,
2383 #define _(sym,str) LISP_CP_LOOKUP_ERROR_##sym,
2409 s =
format (s,
"LISP-CP-LOOKUP: map-resolver: %U destination eid %U",
2442 clib_warning (
"Can't find map-resolver and local interface ip!");
2472 addr = ip_interface_address_get_address (&lcm->im4->lookup_main, ia);
2473 ip_address_set (rloc, addr, AF_IP4);
2474 ip_prefix_len (ippref) = 32;
2475 ip_prefix_normalize (ippref);
2476 vec_add1 (rlocs, gid[0]);
2483 addr = ip_interface_address_get_address (&lcm->im6->lookup_main, ia);
2484 ip_address_set (rloc, addr, AF_IP6);
2485 ip_prefix_len (ippref) = 128;
2486 ip_prefix_normalize (ippref);
2487 vec_add1 (rlocs, gid[0]);
2506 clib_warning (
"Can't allocate buffer for Map-Request!");
2533 u64 * nonce_res,
u32 * bi_res)
2542 clib_warning (
"Can't allocate buffer for Map-Request!");
2591 #define foreach_msmr \
2597 elect_map_ ## name (lisp_cp_main_t * lcm) \
2600 vec_foreach (mr, lcm->map_ ## name ## s) \
2604 ip_address_copy (&lcm->active_map_ ##name, &mr->address); \
2605 lcm->do_map_ ## name ## _election = 0; \
2645 addr = ip_interface_address_get_address (&lcm->im4->lookup_main,
2647 ip_address_set (new_ip, addr, AF_IP4);
2654 addr = ip_interface_address_get_address (&lcm->im6->lookup_main,
2656 ip_address_set (new_ip, addr, AF_IP6);
2694 return VNET_CRYPTO_ALG_HMAC_SHA1;
2696 return VNET_CRYPTO_ALG_HMAC_SHA256;
2698 clib_warning (
"unsupported encryption key type: %d!", key_id);
2710 return VNET_CRYPTO_OP_SHA1_HMAC;
2712 return VNET_CRYPTO_OP_SHA256_HMAC;
2714 clib_warning (
"unsupported encryption key type: %d!", key_id);
2723 u16 auth_data_len,
u32 msg_len)
2726 MREG_KEY_ID (map_reg_hdr) = clib_host_to_net_u16 (key_id);
2734 op->
src = (
u8 *) map_reg_hdr;
2758 u32 bi, auth_data_len = 0, msg_len = 0;
2763 clib_warning (
"Can't allocate buffer for Map-Register!");
2774 auth_data_len, nonce_res,
2790 get_egress_map_ ##name## _ip (lisp_cp_main_t * lcm, ip_address_t * ip) \
2793 while (lcm->do_map_ ## name ## _election \
2794 | (0 == ip_fib_get_first_egress_ip_for_dst \
2795 (lcm, &lcm->active_map_ ##name, ip))) \
2797 if (0 == elect_map_ ## name (lcm)) \
2801 vec_foreach (mr, lcm->map_ ## name ## s) mr->is_down = 0; \
2811 #define foreach_lisp_cp_output_error \
2812 _(MAP_REGISTERS_SENT, "map-registers sent") \
2813 _(MAP_REQUESTS_SENT, "map-requests sent") \
2814 _(RLOC_PROBES_SENT, "rloc-probes sent")
2816 #define _(sym,string) string,
2823 #define _(sym,str) LISP_CP_OUTPUT_ERROR_##sym,
2840 .name =
"lisp-cp-output",
2841 .vector_size =
sizeof (
u32),
2900 u32 si, rloc_probes_sent = 0;
2911 clib_warning (
"internal error: cannot find local eid %U in "
2935 LISP_CP_OUTPUT_ERROR_RLOC_PROBES_SENT,
2944 u32 bi, map_registers_sent = 0;
2952 if (get_egress_map_server_ip (lcm, &sloc) < 0)
2962 u8 key_id =
r->key_id;
2971 for (k =
r + 1; k <
vec_end (records); k++)
2984 want_map_notif, group, key_id,
key, &bi);
3001 map_registers_sent++;
3012 LISP_CP_OUTPUT_ERROR_MAP_REGISTERS_SENT,
3013 map_registers_sent);
3018 #define send_encapsulated_map_request(lcm, seid, deid, smr) \
3019 _send_encapsulated_map_request(lcm, seid, deid, smr, 0)
3021 #define resend_encapsulated_map_request(lcm, seid, deid, smr) \
3022 _send_encapsulated_map_request(lcm, seid, deid, smr, 1)
3027 u8 is_smr_invoked,
u8 is_resend)
3047 duplicate_pmr = pmr;
3053 if (!is_resend && duplicate_pmr)
3059 u8 pitr_mode = lcm->
flags & LISP_FLAG_PITR_MODE;
3065 if (map_index == ~0)
3067 clib_warning (
"No local mapping found in eid-table for %U!",
3077 (
"Mapping found for src eid %U is not marked as local!",
3081 ls_index =
map->locator_set_index;
3091 ls_index =
map->locator_set_index;
3108 ls_index =
map->locator_set_index;
3121 if (get_egress_map_resolver_ip (lcm, &sloc) < 0)
3131 &sloc, is_smr_invoked, &nonce, &bi);
3150 LISP_CP_OUTPUT_ERROR_MAP_REQUESTS_SENT, 1);
3191 if ((
ip4->ip_version_and_header_length & 0xF0) == 0x40)
3241 return bd_config->
bd_id;
3255 clib_warning (
"bridge domain %d is not mapped to any vni!", bd);
3267 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t *opt;
3301 if (clib_net_to_host_u16 (eh->
type) == ETHERNET_TYPE_ARP)
3306 if (clib_net_to_host_u16 (ah->
opcode)
3307 != ETHERNET_ARP_OPCODE_request)
3322 if (clib_net_to_host_u16 (eh->
type) == ETHERNET_TYPE_IP6)
3327 if (IP_PROTOCOL_ICMP6 ==
ip->protocol)
3329 icmp6_neighbor_solicitation_or_advertisement_header_t *ndh;
3331 if (ndh->icmp.type == ICMP6_neighbor_solicitation)
3336 opt = (
void *) (ndh + 1);
3337 if ((opt->header.type !=
3338 ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address)
3339 || (opt->header.n_data_u64s != 1))
3353 &ndh->target_address,
AF_IP6);
3376 if (clib_net_to_host_u16 (eh->
type) == ETHERNET_TYPE_NSH)
3379 u32 spi = clib_net_to_host_u32 (
nh->spi_si << 8);
3380 u8 si = (
u8) clib_net_to_host_u32 (
nh->spi_si);
3395 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t *opt;
3412 u32 pi0, sw_if_index0, next0;
3420 icmp6_neighbor_solicitation_or_advertisement_header_t *ndh;
3428 n_left_to_next -= 1;
3450 arp0->
opcode = clib_host_to_net_u16 (ETHERNET_ARP_OPCODE_reply);
3459 clib_memcpy (eth0->dst_address, eth0->src_address, 6);
3462 b0->
error =
node->errors[LISP_CP_LOOKUP_ERROR_ARP_REPLY_TX];
3482 opt = (
void *) (ndh + 1);
3484 ICMP6_NEIGHBOR_DISCOVERY_OPTION_target_link_layer_address;
3486 ndh->icmp.type = ICMP6_neighbor_advertisement;
3487 ndh->advertisement_flags = clib_host_to_net_u32
3490 ndh->icmp.checksum = 0;
3491 ndh->icmp.checksum =
3498 [LISP_CP_LOOKUP_ERROR_NDP_NEIGHBOR_ADVERTISEMENT_TX];
3542 b0->
error =
node->errors[LISP_CP_LOOKUP_ERROR_DROP];
3563 n_left_to_next, pi0, next0);
3603 .name =
"lisp-cp-lookup-ip4",
3604 .vector_size =
sizeof (
u32),
3623 .name =
"lisp-cp-lookup-ip6",
3624 .vector_size =
sizeof (
u32),
3643 .name =
"lisp-cp-lookup-l2",
3644 .vector_size =
sizeof (
u32),
3663 .name =
"lisp-cp-lookup-nsh",
3664 .vector_size =
sizeof (
u32),
3681 #define foreach_lisp_cp_input_error \
3683 _(RLOC_PROBE_REQ_RECEIVED, "rloc-probe requests received") \
3684 _(RLOC_PROBE_REP_RECEIVED, "rloc-probe replies received") \
3685 _(MAP_NOTIFIES_RECEIVED, "map-notifies received") \
3686 _(MAP_REPLIES_RECEIVED, "map-replies received")
3689 #define _(sym,string) string,
3696 #define _(sym,str) LISP_CP_INPUT_ERROR_##sym,
3716 s =
format (s,
"LISP-CP-INPUT: TODO");
3740 f64 expiration_time)
3745 u64 exp_clock_time =
now + expiration_time * cpu_cps;
3777 a->rmt_eid = fe->
reid;
3779 a->lcl_eid = fe->
leid;
3838 u32 dst_map_index = 0;
3844 if (
a->is_rloc_probe)
3851 clib_warning (
"No pending map-request entry with nonce %lu!",
a->nonce);
3869 if (dst_map_index == (
u32) ~ 0)
3895 hash_unset(lcm->pending_map_requests_by_nonce, noncep[0]);
3917 u8 out[EVP_MAX_MD_SIZE] = { 0, };
3920 if ((
u16) ~ 0 == auth_data_len)
3922 clib_warning (
"invalid length for key_id %d!", key_id);
3949 result = memcmp (out, auth_data, auth_data_len);
3965 clib_warning (
"No pending map-register entry with nonce %lu!",
4000 u32 key_id,
u8 ** key_out)
4010 key_out[0] = m->
key;
4012 for (
i = 1;
i <
len;
i++)
4086 u16 auth_data_len = 0;
4120 - (
u8 *) mnotif_hdr, key_id,
key))
4122 clib_warning (
"Map-notify auth data verification failed for nonce "
4123 "0x%lx!",
a->nonce);
4141 clib_warning (
"Can't allocate buffer for Map-Register!");
4207 if (start < 0 && start < -
sizeof (
b->
pre_data))
4213 *ip_hdr =
b->
data + start;
4228 u32 i,
len = 0, rloc_probe_recv = 0;
4235 (
"Only SMR Map-Requests and RLOC probe supported for now!");
4296 LISP_CP_INPUT_ERROR_RLOC_PROBE_REQ_RECEIVED,
4369 map_notifies_recv = 0;
4380 u32 n_left_to_next_drop;
4383 to_next_drop, n_left_to_next_drop);
4384 while (
n_left_from > 0 && n_left_to_next_drop > 0)
4392 to_next_drop[0] = bi0;
4394 n_left_to_next_drop -= 1;
4405 if (
a->is_rloc_probe)
4406 rloc_probe_rep_recv++;
4417 map_notifies_recv++;
4426 b0->
error =
node->errors[LISP_CP_INPUT_ERROR_DROP];
4435 n_left_to_next_drop);
4438 LISP_CP_INPUT_ERROR_RLOC_PROBE_REP_RECEIVED,
4439 rloc_probe_rep_recv);
4441 LISP_CP_INPUT_ERROR_MAP_NOTIFIES_RECEIVED,
4449 .name =
"lisp-cp-input",
4450 .vector_size =
sizeof (
u32),
4508 lcm->
flags |= LISP_FLAG_XTR_MODE;
4554 if (lisp_stats_api_fill (lcm, lgm, &stat, key, index))
4555 vec_add1 (stats, stat);
4578 u8 smr_invoked,
u8 is_resend)
4582 a.is_resend = is_resend;
4585 a.smr_invoked = smr_invoked;
4588 (
u8 *) &
a,
sizeof (
a));
4602 if (
r->time_to_expire - dt < 0)
4611 clib_warning (
"Map resolver %U not found - probably deleted "
4617 clib_warning (
"map resolver %U is unreachable, ignoring",
4627 elect_map_resolver (lcm);
4643 r->time_to_expire -= dt;
4651 u32 *to_be_removed = 0, *pmr_index;
4659 hash_unset (lcm->pending_map_requests_by_nonce, nonce[0]);
4696 r->time_to_expire -= dt;
4698 if (
r->time_to_expire < 0)
4707 clib_warning (
"Map server %U not found - probably deleted "
4713 clib_warning (
"map server %U is unreachable, ignoring",
4722 elect_map_server (lcm);
4741 u32 *to_be_removed = 0, *pmr_index;
4743 static u64 mreg_sent_counter = 0;
4788 mreg_sent_counter++;
4833 _vec_len (expired) = 0;
4847 return VNET_API_ERROR_LISP_DISABLED;
4850 lcm->
flags |= LISP_FLAG_STATS_ENABLED;
4852 lcm->
flags &= ~LISP_FLAG_STATS_ENABLED;
4863 return VNET_API_ERROR_LISP_DISABLED;
4865 return lcm->
flags & LISP_FLAG_STATS_ENABLED;
4875 "lisp-retry-service",
4887 return VNET_API_ERROR_INVALID_ARGUMENT;
4904 u8 pitr_mode = lcm->
flags & LISP_FLAG_PITR_MODE;
4905 u8 xtr_mode = lcm->
flags & LISP_FLAG_XTR_MODE;
4906 u8 petr_mode = lcm->
flags & LISP_FLAG_PETR_MODE;
4908 if (pitr_mode && is_enabled)
4909 return VNET_API_ERROR_INVALID_ARGUMENT;
4911 if (is_enabled && xtr_mode)
4913 if (!is_enabled && !xtr_mode)
4923 lcm->
flags |= LISP_FLAG_XTR_MODE;
4932 lcm->
flags &= ~LISP_FLAG_XTR_MODE;
4941 u8 xtr_mode = lcm->
flags & LISP_FLAG_XTR_MODE;
4942 u8 pitr_mode = lcm->
flags & LISP_FLAG_PITR_MODE;
4944 if (xtr_mode && is_enabled)
4945 return VNET_API_ERROR_INVALID_VALUE;
4947 if (is_enabled && pitr_mode)
4949 if (!is_enabled && !pitr_mode)
4956 lcm->
flags |= LISP_FLAG_PITR_MODE;
4961 lcm->
flags &= ~LISP_FLAG_PITR_MODE;
4970 u8 xtr_mode = lcm->
flags & LISP_FLAG_XTR_MODE;
4971 u8 petr_mode = lcm->
flags & LISP_FLAG_PETR_MODE;
4973 if (is_enabled && petr_mode)
4975 if (!is_enabled && !petr_mode)
4984 lcm->
flags |= LISP_FLAG_PETR_MODE;
4992 lcm->
flags &= ~LISP_FLAG_PETR_MODE;
5001 return (lcm->
flags & LISP_FLAG_XTR_MODE);
5008 return (lcm->
flags & LISP_FLAG_PITR_MODE);
5015 return (lcm->
flags & LISP_FLAG_PETR_MODE);
static uword lisp_cp_lookup_ip6(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
#define send_encapsulated_map_request(lcm, seid, deid, smr)
vlib_node_registration_t ip4_lookup_node
(constructor) VLIB_REGISTER_NODE (ip4_lookup_node)
static int add_ndp_entry(BVT(clib_bihash_kv) *kvp, void *arg)
#define gid_address_ippref_len(_a)
vlib_node_registration_t lisp_cp_lookup_ip4_node
(constructor) VLIB_REGISTER_NODE (lisp_cp_lookup_ip4_node)
void * lisp_msg_push_ecm(vlib_main_t *vm, vlib_buffer_t *b, int lp, int rp, gid_address_t *la, gid_address_t *ra)
#define MAP_REGISTER_DEFAULT_TTL
static_always_inline void vnet_crypto_op_init(vnet_crypto_op_t *op, vnet_crypto_op_id_t type)
void get_src_and_dst_eids_from_buffer(lisp_cp_main_t *lcm, vlib_buffer_t *b, gid_address_t *src, gid_address_t *dst, u16 type)
static int is_auth_data_valid(map_notify_hdr_t *h, u32 msg_len, lisp_key_type_t key_id, u8 *key)
static void map_records_arg_free(map_records_arg_t *a)
void process_map_request(vlib_main_t *vm, vlib_node_runtime_t *node, lisp_cp_main_t *lcm, vlib_buffer_t *b)
static mapping_t * build_map_register_record_list(lisp_cp_main_t *lcm)
u8 * format_lisp_cp_lookup_trace(u8 *s, va_list *args)
u32 locator_cmp(locator_t *l1, locator_t *l2)
#define RLOC_PROBING_INTERVAL
static void find_ip_header(vlib_buffer_t *b, u8 **ip_hdr)
static void * ip_interface_address_get_address(ip_lookup_main_t *lm, ip_interface_address_t *a)
static void remove_dead_pending_map_requests(lisp_cp_main_t *lcm)
static int add_l2_arp_bd(BVT(clib_bihash_kv) *kvp, void *arg)
void locator_free(locator_t *l)
#define hash_set(h, key, value)
#define ICMP6_NEIGHBOR_ADVERTISEMENT_FLAG_OVERRIDE
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
clib_error_t * vnet_lisp_gpe_enable_disable(vnet_lisp_gpe_enable_disable_args_t *a)
Enable/disable LISP-GPE.
static void * send_map_request_thread_fn(void *arg)
vl_api_ip_port_and_mask_t dst_port
static void queue_map_notify_for_processing(map_records_arg_t *a)
static void update_rloc_probing(lisp_cp_main_t *lcm, f64 dt)
u8 vnet_lisp_map_register_state_get(void)
#define gid_address_arp_ndp_bd(_a)
static void update_adjacencies_by_map_index(lisp_cp_main_t *lcm, u32 mapping_index, u8 remove_only)
ip_lookup_main_t lookup_main
#define MNOTIFY_REC_COUNT(h_)
u8 vnet_lisp_stats_enable_disable_state(void)
u16 ip6_tcp_udp_icmp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip6_header_t *ip0, int *bogus_lengthp)
u8 vnet_lisp_get_petr_mode(void)
#define clib_memcpy(d, s, n)
void vnet_crypto_key_del(vlib_main_t *vm, vnet_crypto_key_index_t index)
nat44_ei_hairpin_src_next_t next_index
int vnet_lisp_use_petr(ip_address_t *ip, u8 is_add)
Configure Proxy-ETR.
__clib_export void TW() tw_timer_stop(TWT(tw_timer_wheel) *tw, u32 handle)
Stop a tw timer.
static void clean_locator_to_locator_set(lisp_cp_main_t *lcm, u32 lsi)
static uword lisp_cp_output(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
u8 vnet_lisp_get_pitr_mode(void)
ip4_main_t ip4_main
Global ip4 main structure.
static void mapping_start_expiration_timer(lisp_cp_main_t *lcm, u32 mi, f64 expiration_time)
static int update_map_register_auth_data(map_register_hdr_t *map_reg_hdr, lisp_key_type_t key_id, u8 *key, u16 auth_data_len, u32 msg_len)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define gid_address_ip_version(_a)
#define gid_address_sd_dst(_a)
#define MREQ_REC_COUNT(h_)
u32 ip_fib_get_egress_iface_for_dst(lisp_cp_main_t *lcm, ip_address_t *dst)
Find the sw_if_index of the interface that would be used to egress towards dst.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define QUICK_MAP_REGISTER_MSG_COUNT
#define MAX_LISP_MSG_ENCAP_LEN
static void * vlib_buffer_pull(vlib_buffer_t *b, u8 size)
Retrieve bytes from buffer head.
lisp_msmr_t * map_resolvers
static uword clib_fifo_elts(void *v)
static vlib_buffer_t * build_encapsulated_map_request(lisp_cp_main_t *lcm, gid_address_t *seid, gid_address_t *deid, locator_set_t *loc_set, ip_address_t *mr_ip, ip_address_t *sloc, u8 is_smr_invoked, u64 *nonce_res, u32 *bi_res)
@ VLIB_NODE_TYPE_INTERNAL
void * lisp_msg_put_map_reply(vlib_buffer_t *b, mapping_t *records, u64 nonce, u8 probe_bit)
#define MREG_AUTH_DATA_LEN(h_)
#define MREP_REC_COUNT(h_)
u32 vnet_lisp_set_transport_protocol(u8 protocol)
#define vec_end(v)
End (last data address) of vector.
vlib_main_t vlib_node_runtime_t * node
#define clib_fifo_foreach(v, f, body)
lisp_msmr_t * map_servers
__clib_export u32 *TW() tw_timer_expire_timers_vec(TWT(tw_timer_wheel) *tw, f64 now, u32 *vec)
#define clib_error_return(e, args...)
#define hash_foreach(key_var, value_var, h, body)
u32 vnet_lisp_gpe_add_nsh_iface(lisp_gpe_main_t *lgm)
Add LISP-GPE NSH interface.
static mapping_t * get_mapping(lisp_cp_main_t *lcm, gid_address_t *e)
#define gid_address_ippref(_a)
#define foreach_lisp_cp_input_error
static void lisp_cp_enable_l2_l3_ifaces(lisp_cp_main_t *lcm, u8 with_default_route)
lisp_cp_enable_l2_l3_ifaces
@ LISP_CP_LOOKUP_NEXT_DROP
static int send_map_reply(lisp_cp_main_t *lcm, u32 mi, ip_address_t *dst, u8 probe_bit, u64 nonce, u16 dst_port, ip_address_t *probed_loc)
u32 vnet_crypto_key_index_t
#define hash_set_mem(h, key, value)
int vnet_lisp_add_del_adjacency(vnet_lisp_add_del_adjacency_args_t *a)
Adds adjacency or removes forwarding entry associated to remote mapping.
vl_api_tunnel_mode_t mode
@ LISP_CP_INPUT_NEXT_DROP
void ip_address_to_fib_prefix(const ip_address_t *addr, fib_prefix_t *prefix)
convert from a IP address to a FIB prefix
#define vlib_call_init_function(vm, x)
#define vec_is_equal(v1, v2)
Compare two vectors, not NULL-pointer tolerant.
lisp_api_ndp_entry_t * vnet_lisp_ndp_entries_get_by_bd(u32 bd)
#define pool_put(P, E)
Free an object E in pool P.
#define ip_prefix_addr(_a)
@ LISP_TRANSPORT_PROTOCOL_API
#define SHA256_AUTH_DATA_LEN
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
u32 * local_locator_set_indexes
#define gid_address_sd_dst_type(_a)
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
static void reset_pending_mr_counters(pending_map_request_t *r)
static char * lisp_cp_input_error_strings[]
fib_node_index_t fib_table_lookup(u32 fib_index, const fib_prefix_t *prefix)
Perfom a longest prefix match in the non-forwarding table.
u32 expired_map_registers
vl_api_ikev2_sa_stats_t stats
vlib_main_t vlib_node_runtime_t vlib_frame_t * from_frame
int vnet_lisp_pitr_set_locator_set(u8 *locator_set_name, u8 is_add)
#define gid_address_ip(_a)
vlib_node_registration_t lisp_cp_lookup_ip6_node
(constructor) VLIB_REGISTER_NODE (lisp_cp_lookup_ip6_node)
static lisp_msmr_t * get_map_server(ip_address_t *a)
vnet_api_error_t vnet_lisp_stats_enable_disable(u8 enable)
vnet_hw_if_output_node_runtime_t * r
static void * ip6_next_header(ip6_header_t *i)
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
vlib_node_registration_t ip6_lookup_node
(constructor) VLIB_REGISTER_NODE (ip6_lookup_node)
#define pool_put_index(p, i)
Free pool element with given index.
u32 petr_map_index
Proxy ETR map index used for 'use-petr'.
u32 * local_mappings_indexes
#define GID_LOOKUP_MISS_L2
#define vec_cmp(v1, v2)
Compare two vectors (only applicable to vectors of signed numbers).
static int is_local_ip(lisp_cp_main_t *lcm, ip_address_t *addr)
static uword lisp_cp_lookup_nsh(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
u8 vnet_lisp_get_map_request_mode(void)
#define hash_unset(h, key)
vlib_node_registration_t lisp_cp_lookup_nsh_node
(constructor) VLIB_REGISTER_NODE (lisp_cp_lookup_nsh_node)
int vnet_lisp_map_cache_add_del(vnet_lisp_add_del_mapping_args_t *a, u32 *map_index_result)
Add/remove mapping to/from map-cache.
int vnet_lisp_eid_table_map(u32 vni, u32 dp_id, u8 is_l2, u8 is_add)
uword * pending_map_requests_by_nonce
#define MAP_REC_ACTION(h)
static void dp_del_fwd_entry(lisp_cp_main_t *lcm, u32 dst_map_index)
lisp_api_stats_t * vnet_lisp_get_stats(void)
static int add_l2_arp_entry(BVT(clib_bihash_kv) *kvp, void *arg)
vlib_node_registration_t lisp_cp_lookup_l2_node
(constructor) VLIB_REGISTER_NODE (lisp_cp_lookup_l2_node)
static void remove_expired_mapping(lisp_cp_main_t *lcm, u32 mi)
locator_pair_t * locator_pairs
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
#define vec_elt(v, i)
Get vector value at index i.
static lisp_gpe_main_t * vnet_lisp_gpe_get_main()
static u8 vlib_buffer_has_space(vlib_buffer_t *b, word l)
Check if there is enough space in buffer to advance.
int vnet_lisp_enable_disable_pitr_mode(u8 is_enabled)
static uword vlib_process_get_events(vlib_main_t *vm, uword **data_vector)
Return the first event type which has occurred and a vector of per-event data of that type,...
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
#define MAX_EXPIRED_MAP_REGISTERS_DEFAULT
#define ip_addr_version(_a)
#define pool_foreach(VAR, POOL)
Iterate through pool.
u8 ip_address_max_len(u8 version)
u8 vnet_lisp_rloc_probe_state_get(void)
clib_error_t * vnet_lisp_enable_disable(u8 is_enable)
u32 vnet_crypto_process_ops(vlib_main_t *vm, vnet_crypto_op_t ops[], u32 n_ops)
static int update_pending_map_register(pending_map_register_t *r, f64 dt, u8 *del_all)
static int dp_add_fwd_entry_from_mt(u32 si, u32 di)
enum fib_entry_flag_t_ fib_entry_flag_t
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u32 fib_table_get_table_id_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the Table-ID of the FIB bound to the interface.
int ip_fib_get_first_egress_ip_for_dst(lisp_cp_main_t *lcm, ip_address_t *dst, ip_address_t *result)
Find first IP of the interface that would be used to egress towards dst.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
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.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define SHA1_AUTH_DATA_LEN
u32 lisp_msg_parse_itr_rlocs(vlib_buffer_t *b, gid_address_t **rlocs, u8 rloc_count)
u32 max_expired_map_registers
int get_mr_and_local_iface_ip(lisp_cp_main_t *lcm, ip_address_t *mr_ip, ip_address_t *sloc)
u32 * fwd_entry_by_mapping_index
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.
static __clib_warn_unused_result u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
#define hash_unset_mem(h, key)
static char * lisp_cp_output_error_strings[]
locator_set_t * locator_set_pool
#define vec_dup(V)
Return copy of vector (no header, no alignment)
static lisp_msmr_t * get_map_resolver(ip_address_t *a)
int vnet_lisp_set_map_request_mode(u8 mode)
static uword lisp_cp_lookup_l2(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
vnet_main_t * vnet_get_main(void)
#define NUMBER_OF_RETRIES
u32 vlib_process_create(vlib_main_t *vm, char *name, vlib_node_function_t *f, u32 log2_n_stack_bytes)
Create a vlib process.
Combined counter to hold both packets and byte differences.
static u32 get_locator_pairs(lisp_cp_main_t *lcm, mapping_t *lcl_map, mapping_t *rmt_map, locator_pair_t **locator_pairs)
Finds first remote locator with best (lowest) priority that has a local peer locator with an underlyi...
lisp_transport_protocol_t vnet_lisp_get_transport_protocol(void)
static lisp_cp_main_t * vnet_lisp_cp_get_main()
static_always_inline uword vlib_get_thread_index(void)
#define fid_addr_type(_a)
u8 delete_after_expiration
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
int vnet_lisp_enable_disable_petr_mode(u8 is_enabled)
static u8 compare_locators(lisp_cp_main_t *lcm, u32 *old_ls_indexes, locator_t *new_locators)
static int map_record_integrity_check(lisp_cp_main_t *lcm, mapping_t *maps, u32 key_id, u8 **key_out)
When map-notify is received it is necessary that all EIDs in the record list share common key.
gid_dictionary_t mapping_index_by_gid
static void update_pending_request(pending_map_request_t *r, f64 dt)
Take an action with a pending map request depending on expiration time and re-try counters.
#define foreach_lisp_cp_lookup_error
void gid_dict_foreach_l2_arp_ndp_entry(gid_dictionary_t *db, cb, void *ht)
#define gid_address_vni(_a)
clib_error_t * lisp_gpe_init(vlib_main_t *vm)
LISP-GPE init function.
u32 lisp_msg_parse_eid_rec(vlib_buffer_t *b, gid_address_t *eid)
u8 vnet_lisp_get_xtr_mode(void)
lisp_cp_main_t lisp_control_main
#define TIME_UNTIL_REFETCH_OR_DELETE
static void update_map_register(lisp_cp_main_t *lcm, f64 dt)
u32 fib_node_index_t
A typedef of a node index.
#define vec_foreach_index(var, v)
Iterate over vector indices.
int ip_interface_get_first_ip_address(lisp_cp_main_t *lcm, u32 sw_if_index, ip_address_family_t version, ip_address_t *result)
u8 * format_ip_address(u8 *s, va_list *args)
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
int vnet_lisp_gpe_get_fwd_stats(vnet_lisp_gpe_add_del_fwd_entry_args_t *a, vlib_counter_t *c)
u32 lisp_msg_parse_addr(vlib_buffer_t *b, gid_address_t *eid)
void lisp_gpe_tenant_l2_iface_unlock(u32 vni)
Release the lock held on the tenant's L3 interface.
#define clib_fifo_sub1(f, e)
void lisp_gpe_tenant_l3_iface_unlock(u32 vni)
Release the lock held on the tenant's L3 interface.
#define gid_address_arp_bd
static int is_locator_in_locator_set(lisp_cp_main_t *lcm, locator_set_t *ls, locator_t *loc)
BVT(clib_bihash)
The table of adjacencies indexed by the rewrite string.
#define clib_fifo_add1(f, e)
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
@ LISP_TRANSPORT_PROTOCOL_UDP
void udp_register_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u32 node_index, u8 is_ip4)
ip_address_t map_resolver_ip
int vnet_lisp_enable_disable_xtr_mode(u8 is_enabled)
vl_api_ip_port_and_mask_t src_port
static u16 auth_data_len_by_key_id(lisp_key_type_t key_id)
const lisp_gpe_tunnel_t * lisp_gpe_tunnel_get(index_t lgti)
void build_src_dst(gid_address_t *sd, gid_address_t *src, gid_address_t *dst)
int vnet_lisp_add_del_map_server(ip_address_t *addr, u8 is_add)
u8 * format_lisp_cp_input_trace(u8 *s, va_list *args)
void udp_unregister_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u8 is_ip4)
void mac_copy(void *dst, void *src)
vnet_feature_config_main_t * cm
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define ICMP6_NEIGHBOR_ADVERTISEMENT_FLAG_SOLICITED
__clib_export void TW() tw_timer_wheel_init(TWT(tw_timer_wheel) *tw, void *expired_timer_callback, f64 timer_interval_in_seconds, u32 max_expirations)
Initialize a tw timer wheel template instance.
static uword send_map_resolver_service(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
vlib_node_registration_t lisp_cp_input_node
(constructor) VLIB_REGISTER_NODE (lisp_cp_input_node)
u8 do_map_server_election
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
uword * locator_set_index_by_name
manual_print typedef address
@ VNET_SW_INTERFACE_FLAG_UNNUMBERED
static int send_rloc_probes(lisp_cp_main_t *lcm)
int gid_address_cmp(gid_address_t *a1, gid_address_t *a2)
static void remove_mapping_if_needed(u32 mi, void *arg)
Callback invoked when a sub-prefix is found.
save_rewrite_length must be aligned so that reass doesn t overwrite it
#define clib_fifo_head(v)
static map_records_arg_t * parse_map_notify(vlib_buffer_t *b)
void ip_address_set(ip_address_t *dst, const void *src, ip_address_family_t af)
int vnet_lisp_clear_all_remote_adjacencies(void)
uword * lisp_stats_index_by_key
static void lisp_cp_unregister_dst_port(vlib_main_t *vm)
u32 fib_entry_get_resolving_interface(fib_node_index_t entry_index)
u32 * lcl_to_rmt_adjs_by_lcl_idx
static void add_locators(lisp_cp_main_t *lcm, mapping_t *m, u32 locator_set_index, ip_address_t *probed_loc)
static void process_map_notify(map_records_arg_t *a)
struct _vlib_node_registration vlib_node_registration_t
#define PENDING_MREG_EXPIRATION_TIME
Common utility functions for IPv4, IPv6 and L2 LISP-GPE tunnels.
uword unformat_gid_address(unformat_input_t *input, va_list *args)
static void queue_map_reply_for_processing(map_records_arg_t *a)
#define gid_address_sd_src(_a)
#define foreach_lisp_cp_output_error
#define MREQ_RLOC_PROBE(h_)
#define gid_address_ndp_bd
void * ip_interface_get_first_address(ip_lookup_main_t *lm, u32 sw_if_index, u8 version)
u32 ** locator_to_locator_sets
u32 gid_dictionary_sd_lookup(gid_dictionary_t *db, gid_address_t *dst, gid_address_t *src)
u32 * vnet_lisp_ndp_bds_get(void)
ip_address_t active_map_resolver
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.
u8 vnet_lisp_enable_disable_status(void)
int vnet_lisp_add_del_mreq_itr_rlocs(vnet_lisp_add_del_mreq_itr_rloc_args_t *a)
static vlib_buffer_t * build_map_reply(lisp_cp_main_t *lcm, ip_address_t *sloc, ip_address_t *dst, u64 nonce, u8 probe_bit, mapping_t *records, u16 dst_port, u32 *bi_res)
void * lisp_msg_put_mreq(lisp_cp_main_t *lcm, vlib_buffer_t *b, gid_address_t *seid, gid_address_t *deid, gid_address_t *rlocs, u8 is_smr_invoked, u8 rloc_probe_set, u64 *nonce)
#define gid_address_arp_ndp_ip(_a)
static lisp_msg_type_e lisp_msg_type(void *b)
#define hash_create_vec(elts, key_bytes, value_bytes)
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
#define hash_get_mem(h, key)
u32 vnet_crypto_key_add(vlib_main_t *vm, vnet_crypto_alg_t alg, u8 *data, u16 length)
#define vec_free(V)
Free vector's memory (no header).
static vlib_buffer_t * build_map_register(lisp_cp_main_t *lcm, ip_address_t *sloc, ip_address_t *ms_ip, u64 *nonce_res, u8 want_map_notif, mapping_t *records, lisp_key_type_t key_id, u8 *key, u32 *bi_res)
static uword * get_locator_set_index(vnet_lisp_add_del_locator_set_args_t *a, uword *p)
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
static uword lisp_cp_lookup_ip4(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
void * lisp_msg_put_map_register(vlib_buffer_t *b, mapping_t *records, u8 want_map_notify, u16 auth_data_len, u64 *nonce, u32 *msg_len)
static char * lisp_cp_lookup_error_strings[]
uword * map_register_messages_by_nonce
__clib_export u32 TW() tw_timer_start(TWT(tw_timer_wheel) *tw, u32 user_id, u32 timer_id, u64 interval)
Start a Tw Timer.
pending_map_register_t * pending_map_registers_pool
void gid_address_copy(gid_address_t *dst, gid_address_t *src)
#define pool_foreach_index(i, v)
#define MREQ_ITR_RLOC_COUNT(h_)
static_always_inline void mac_address_from_u64(mac_address_t *mac, u64 u)
u32 retry_service_index
Retry service node index.
vlib_node_registration_t lisp_cp_output_node
(constructor) VLIB_REGISTER_NODE (lisp_cp_output_node)
pending_map_request_t * pending_map_requests_pool
static f64 vlib_process_wait_for_event_or_clock(vlib_main_t *vm, f64 dt)
Suspend a cooperative multi-tasking thread Waits for an event, or for the indicated number of seconds...
void gid_address_from_ip(gid_address_t *g, ip_address_t *ip)
u32 ** locator_set_to_eids
description fragment has unexpected format
lisp_adjacency_t * vnet_lisp_adjacencies_get_by_vni(u32 vni)
Returns vector of adjacencies.
A collection of combined counters.
#define gid_address_nsh_si(_a)
static vnet_crypto_op_id_t lisp_key_type_to_crypto_op(lisp_key_type_t key_id)
static int send_rloc_probe(lisp_cp_main_t *lcm, gid_address_t *deid, u32 local_locator_set_index, ip_address_t *sloc, ip_address_t *rloc)
static void remove_locator_from_locator_set(locator_set_t *ls, u32 *locit, u32 ls_index, u32 loc_id)
u32 * vnet_lisp_l2_arp_bds_get(void)
static u8 * vlib_buffer_get_tail(vlib_buffer_t *b)
Get pointer to the end of buffer's data.
static map_records_arg_t * map_record_args_get()
vlib_put_next_frame(vm, node, next_index, 0)
u8 do_map_resolver_election
void * pkt_push_udp_and_ip(vlib_main_t *vm, vlib_buffer_t *b, u16 sp, u16 dp, ip_address_t *sip, ip_address_t *dip, u8 csum_offload)
static int queue_map_request(gid_address_t *seid, gid_address_t *deid, u8 smr_invoked, u8 is_resend)
#define VLIB_INIT_FUNCTION(x)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
lisp_gpe_tunnel_key_t * key
RLOC pair and rloc fib_index.
static void * vlib_buffer_make_headroom(vlib_buffer_t *b, u8 size)
Make head room, typically for packet headers.
static vlib_buffer_t * build_map_request(lisp_cp_main_t *lcm, gid_address_t *deid, ip_address_t *sloc, ip_address_t *rloc, gid_address_t *itr_rlocs, u64 *nonce_res, u32 *bi_res)
clib_error_t * lisp_cp_init(vlib_main_t *vm)
vl_api_ip_proto_t protocol
static void dp_add_fwd_entry(lisp_cp_main_t *lcm, u32 src_map_index, u32 dst_map_index)
#define MNOTIFY_NONCE(h_)
int vnet_lisp_add_del_locator_set(vnet_lisp_add_del_locator_set_args_t *a, u32 *ls_result)
#define vec_foreach(var, vec)
Vector iterator.
gid_address_t * eids_to_be_deleted
static void update_fwd_entries_by_locator_set(lisp_cp_main_t *lcm, u32 ls_index, u8 remove_only)
void vl_api_rpc_call_main_thread(void *fp, u8 *data, u32 data_length)
fib_entry_flag_t fib_entry_get_flags(fib_node_index_t fib_entry_index)
#define fid_addr_ippref(_a)
ip_lookup_main_t lookup_main
static int parse_map_records(vlib_buffer_t *b, map_records_arg_t *a, u8 count)
void vnet_lisp_gpe_del_fwd_counters(vnet_lisp_gpe_add_del_fwd_entry_args_t *a, u32 fwd_entry_index)
static void remove_overlapping_sub_prefixes(lisp_cp_main_t *lcm, gid_address_t *eid, u8 is_negative)
This function searches map cache and looks for IP prefixes that are subset of the provided one.
void gid_dictionary_init(gid_dictionary_t *db)
int vnet_lisp_rloc_probe_enable_disable(u8 is_enable)
static u64 mac_to_u64(u8 *m)
int vnet_lisp_del_mapping(gid_address_t *eid, u32 *res_map_index)
Removes a mapping.
int vnet_lisp_map_register_enable_disable(u8 is_enable)
u32 vnet_lisp_map_register_fallback_threshold_get(void)
lisp_transport_protocol_t
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
int vnet_lisp_map_register_set_ttl(u32 ttl)
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static vnet_crypto_alg_t lisp_key_type_to_crypto_alg(lisp_key_type_t key_id)
static vlib_main_t * vlib_get_main(void)
u64 gid_dictionary_lookup(gid_dictionary_t *db, gid_address_t *key)
int vnet_lisp_map_register_fallback_threshold_set(u32 value)
#define gid_address_type(_a)
#define LISP_CONTROL_PORT
void gid_address_free(gid_address_t *a)
u32 gid_dictionary_add_del(gid_dictionary_t *db, gid_address_t *key, u64 value, u8 is_add)
#define MNOTIFY_KEY_ID(h_)
#define MREP_RLOC_PROBE(h_)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vnet_interface_output_runtime_t * rt
u32 lisp_gpe_tenant_l3_iface_add_or_lock(u32 vni, u32 table_id, u8 with_default_route)
Add/create and lock a new or find and lock the existing L3 interface for the tenant.
static foreach_msmr void free_map_register_records(mapping_t *maps)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
#define gid_address_arp_ip4(_a)
void vnet_lisp_create_retry_process(lisp_cp_main_t *lcm)
u8 * format_gid_address(u8 *s, va_list *args)
#define PENDING_MREQ_EXPIRATION_TIME
int vnet_lisp_add_del_l2_arp_ndp_entry(gid_address_t *key, u8 *mac, u8 is_add)
#define MAP_REGISTER_INTERVAL
static void process_expired_mapping(lisp_cp_main_t *lcm, u32 mi)
#define pool_free(p)
Free a pool.
static int lisp_stats_api_fill(lisp_cp_main_t *lcm, lisp_gpe_main_t *lgm, lisp_api_stats_t *stat, lisp_stats_key_t *key, u32 stats_index)
lisp_transport_protocol_t transport_protocol
either UDP based or binary API.
#define clib_warning(format, args...)
fwd_entry_t * fwd_entry_pool
u32 lisp_gpe_tenant_l2_iface_add_or_lock(u32 vni, u32 bd_id)
Add/create and lock a new or find and lock the existing L2 interface for the tenant.
ip_interface_address_t * ip_interface_get_first_interface_address(ip_lookup_main_t *lm, u32 sw_if_index, u8 loop)
struct _gid_address_t gid_address_t
static void get_src_and_dst_ip(void *hdr, ip_address_t *src, ip_address_t *dst)
void * process_map_reply(map_records_arg_t *a)
static u32 lisp_get_vni_from_buffer_ip(lisp_cp_main_t *lcm, vlib_buffer_t *b, u8 version)
static void cleanup(void)
static void gid_address_sd_to_flat(gid_address_t *dst, gid_address_t *src, fid_address_t *fid)
static uword lisp_cp_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
int ip_address_cmp(const ip_address_t *ip1, const ip_address_t *ip2)
u32 lisp_msg_parse_mapping_record(vlib_buffer_t *b, gid_address_t *eid, locator_t **locs, locator_t *probed_)
vlib_combined_counter_main_t counters
static void lisp_cp_disable_l2_l3_ifaces(lisp_cp_main_t *lcm)
static int dp_add_del_iface(lisp_cp_main_t *lcm, u32 vni, u8 is_l2, u8 is_add, u8 with_default_route)
map_records_arg_t ** map_records_args_pool
Per thread pool of records shared with thread0.
static f64 vlib_time_now(vlib_main_t *vm)
static mapping_t * lisp_get_petr_mapping(lisp_cp_main_t *lcm)
u8 pre_data[VLIB_BUFFER_PRE_DATA_SIZE]
Space for inserting data before buffer start.
static int send_map_register(lisp_cp_main_t *lcm, u8 want_map_notif)
static void * dp_add_fwd_entry_thread_fn(void *arg)
#define clib_fifo_free(f)
ip_address_t active_map_server
l2_input_config_t * configs
map_records_arg_t * parse_map_reply(vlib_buffer_t *b)
static u64 clib_cpu_time_now(void)
void gid_dict_foreach_subprefix(gid_dictionary_t *db, gid_address_t *eid, foreach_subprefix_match_cb_t cb, void *arg)
static vlib_thread_main_t * vlib_get_thread_main()
void ip_address_copy(ip_address_t *dst, const ip_address_t *src)
#define gid_address_nsh_spi(_a)
void gid_to_dp_address(gid_address_t *g, dp_address_t *d)
vl_api_interface_index_t sw_if_index
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
int vnet_lisp_add_del_map_resolver(vnet_lisp_add_del_map_resolver_args_t *a)
u32 ** lcl_to_rmt_adjacencies
static uword lisp_cp_lookup_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, int overlay)
#define hash_foreach_mem(key_var, value_var, h, body)
lisp_api_l2_arp_entry_t * vnet_lisp_l2_arp_entries_get_by_bd(u32 bd)
static u32 lisp_get_bd_from_buffer_eth(vlib_buffer_t *b)
#define resend_encapsulated_map_request(lcm, seid, deid, smr)
static int add_ndp_bd(BVT(clib_bihash_kv) *kvp, void *arg)
static u32 lisp_get_vni_from_buffer_eth(lisp_cp_main_t *lcm, vlib_buffer_t *b)
Aggregate type for a prefix.
vl_api_fib_path_type_t type
#define QUICK_MAP_REGISTER_INTERVAL
#define vec_del1(v, i)
Delete the element at index I.
#define gid_address_mac(_a)
static void lisp_cp_register_dst_port(vlib_main_t *vm)
@ LISP_CP_LOOKUP_NEXT_ARP_NDP_REPLY_TX
void vnet_lisp_gpe_add_fwd_counters(vnet_lisp_gpe_add_del_fwd_entry_args_t *a, u32 fwd_entry_index)
int vnet_lisp_add_del_locator(vnet_lisp_add_del_locator_set_args_t *a, locator_set_t *ls, u32 *ls_result)
l2_bridge_domain_t * bd_configs
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
void vnet_lisp_gpe_del_nsh_iface(lisp_gpe_main_t *lgm)
Del LISP-GPE NSH interface.
static gid_address_t * build_itr_rloc_list(lisp_cp_main_t *lcm, locator_set_t *loc_set)
enum ip_address_family_t_ ip_address_family_t
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)
u32 vnet_lisp_map_register_get_ttl(void)
int vnet_lisp_nsh_set_locator_set(u8 *locator_set_name, u8 is_add)
#define PENDING_MREQ_QUEUE_LEN
vl_api_wireguard_peer_flags_t flags