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);