40 #define ETHER_MAC_ADDR_LEN 6 62 #define MIN_ADV_VALID_LIFETIME 7203 63 #define DEF_ADV_VALID_LIFETIME 2592000 64 #define DEF_ADV_PREF_LIFETIME 604800 95 u8 link_layer_address[8];
125 #define DEF_MAX_RADV_INTERVAL 200 126 #define DEF_MIN_RADV_INTERVAL .75 * DEF_MAX_RADV_INTERVAL 127 #define DEF_CURR_HOP_LIMIT 64 128 #define DEF_DEF_RTR_LIFETIME 3 * DEF_MAX_RADV_INTERVAL 129 #define MAX_DEF_RTR_LIFETIME 9000 131 #define MAX_INITIAL_RTR_ADVERT_INTERVAL 16 132 #define MAX_INITIAL_RTR_ADVERTISEMENTS 3 133 #define MIN_DELAY_BETWEEN_RAS 3 134 #define MAX_DELAY_BETWEEN_RAS 1800 135 #define MAX_RA_DELAY_TIME .5 253 clib_warning (
"IPv6 is not enabled for sw_if_index %d", sw_if_index);
254 return empty_address;
257 if (radv_info ==
NULL)
260 return empty_address;
291 if (ni == (
uword) ~ 0)
323 if (ni == (
uword) ~ 0)
347 return format (s,
"%=12s%=45s%=6s%=20s%=40s",
"Time",
"Address",
"Flags",
348 "Link layer",
"Interface");
352 return format (s,
"%=12U%=45U%=6U%=20U%=40U",
419 (
u8 *) & args,
sizeof (args));
425 icmp6_neighbor_solicitation_header_t *
h;
462 h->ip.dst_address.as_u8[13] = dst->
as_u8[13];
463 h->ip.dst_address.as_u8[14] = dst->
as_u8[14];
464 h->ip.dst_address.as_u8[15] = dst->
as_u8[15];
465 h->ip.src_address = src[0];
466 h->neighbor.target_address = dst[0];
468 clib_memcpy (h->link_layer_option.ethernet_address,
471 h->neighbor.icmp.checksum =
473 ASSERT (bogus_length == 0);
516 #define IP6_NBR_MK_KEY(k, sw_if_index, addr) \ 518 k.sw_if_index = sw_if_index; \ 519 k.ip6_address = *addr; \ 562 u32 sw_if_index,
u32 flags)
566 u32 i, *to_delete = 0;
571 if (n->key.sw_if_index == sw_if_index)
572 vec_add1 (to_delete, n - nm->neighbor_pool);
578 for (i = 0; i <
vec_len (to_delete); i++)
587 for (i = 0; i <
vec_len (to_delete); i++)
680 offset =
vec_len (rewrite) - 2;
741 if ((count++ == 100) || (index == ~0))
769 int make_new_nd_cache_entry = 1;
790 (n->
flags & IP_NEIGHBOR_FLAG_STATIC))
794 goto check_customers;
797 make_new_nd_cache_entry = 0;
800 if (make_new_nd_cache_entry)
841 goto check_customers;
857 n->
flags &= ~IP_NEIGHBOR_FLAG_STATIC;
870 while (next_index != (
u32) ~ 0)
888 while (next_index != (
u32) ~ 0)
971 n2->key.sw_if_index);
993 if (sw_if_index != ~0 && n->key.sw_if_index != sw_if_index)
1040 (vm,
"There are %u ip6 neighbors, " 1041 "'show ip6 neighbors verbose' to display the entire table...",
1073 .path =
"show ip6 neighbors",
1075 .short_help =
"show ip6 neighbors [<interface>]",
1102 else if (
unformat (input,
"static"))
1104 else if (
unformat (input,
"no-fib-entry"))
1135 .path =
"set ip6 neighbor",
1137 .short_help =
"set ip6 neighbor [del] <interface> <ip6-address> <mac-address> [static]",
1152 uword is_solicitation)
1157 u32 *from, *to_next;
1158 u32 n_left_from, n_left_to_next, next_index, n_advertisements_sent;
1165 n_left_from = n_packets;
1175 ? ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address
1176 : ICMP6_NEIGHBOR_DISCOVERY_OPTION_target_link_layer_address);
1177 n_advertisements_sent = 0;
1179 while (n_left_from > 0)
1183 while (n_left_from > 0 && n_left_to_next > 0)
1187 icmp6_neighbor_solicitation_or_advertisement_header_t *h0;
1188 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t *o0;
1189 u32 bi0, options_len0, sw_if_index0, next0, error0;
1190 u32 ip6_sadd_link_local, ip6_sadd_unspecified;
1194 bi0 = to_next[0] = from[0];
1199 n_left_to_next -= 1;
1207 error0 = ICMP6_ERROR_NONE;
1209 ip6_sadd_link_local =
1211 ip6_sadd_unspecified =
1215 if (!ip6_sadd_unspecified && !ip6_sadd_link_local)
1228 error0 = ((adj0->rewrite_header.sw_if_index != sw_if_index0
1231 ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_NOT_ON_LINK
1237 ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_NOT_ON_LINK;
1241 o0 = (
void *) (h0 + 1);
1242 o0 = ((options_len0 == 8 && o0->header.type == option_type
1243 && o0->header.n_data_u64s == 1) ? o0 : 0);
1246 if (
PREDICT_TRUE (error0 == ICMP6_ERROR_NONE && o0 != 0 &&
1247 !ip6_sadd_unspecified))
1252 &h0->target_address,
1254 o0->ethernet_address,
1258 if (is_solicitation && error0 == ICMP6_ERROR_NONE)
1267 if (~0 == fib_index)
1269 error0 = ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_UNKNOWN;
1277 &h0->target_address, 128);
1282 &h0->target_address,
1290 ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_UNKNOWN;
1313 ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_UNKNOWN;
1319 if (is_solicitation)
1320 next0 = (error0 != ICMP6_ERROR_NONE
1326 error0 = error0 == ICMP6_ERROR_NONE ?
1327 ICMP6_ERROR_NEIGHBOR_ADVERTISEMENTS_RX : error0;
1330 if (is_solicitation && error0 == ICMP6_ERROR_NONE)
1337 if (!ip6_sadd_unspecified)
1341 IP6_MULTICAST_SCOPE_link_local,
1342 IP6_MULTICAST_GROUP_ID_all_hosts);
1346 h0->icmp.type = ICMP6_neighbor_advertisement;
1356 ICMP6_NEIGHBOR_DISCOVERY_OPTION_target_link_layer_address;
1359 h0->advertisement_flags = clib_host_to_net_u32
1363 h0->icmp.checksum = 0;
1367 ASSERT (bogus_length == 0);
1383 n_advertisements_sent++;
1389 to_next, n_left_to_next,
1398 ICMP6_ERROR_NEIGHBOR_ADVERTISEMENTS_TX,
1399 n_advertisements_sent);
1405 #define foreach_log_level \ 1406 _ (DEBUG, "DEBUG") \ 1407 _ (INFO, "INFORMATION") \ 1408 _ (NOTICE, "NOTICE") \ 1409 _ (WARNING, "WARNING") \ 1411 _ (CRIT, "CRITICAL") \ 1412 _ (ALERT, "ALERT") \ 1413 _ (EMERG, "EMERGENCY") 1417 #define _(f,s) LOG_##f, 1437 if ((priority > LOG_EMERG) || !(logmask & (1 << priority)))
1447 .format =
"ip6 nd: (%s): %s",.format_args =
"T4T4",};
1462 _vnet_ip6_neighbor_function_list_elt_t * elt)
1468 error = elt->fp (data);
1471 elt = elt->next_ip6_neighbor_function;
1494 u32 *from, *to_next;
1495 u32 n_left_from, n_left_to_next, next_index;
1496 u32 n_advertisements_sent = 0;
1505 n_left_from = n_packets;
1514 option_type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
1516 while (n_left_from > 0)
1520 while (n_left_from > 0 && n_left_to_next > 0)
1526 icmp6_neighbor_discovery_header_t *h0;
1527 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t *o0;
1529 u32 bi0, options_len0, sw_if_index0, next0, error0;
1530 u32 is_solicitation = 1, is_dropped = 0;
1531 u32 is_unspecified, is_link_local;
1533 bi0 = to_next[0] = from[0];
1538 n_left_to_next -= 1;
1549 error0 = ICMP6_ERROR_NONE;
1554 is_solicitation = 0;
1557 if (!is_unspecified && !is_link_local)
1565 error0 = (adj0->rewrite_header.sw_if_index != sw_if_index0
1567 ICMP6_ERROR_ROUTER_SOLICITATION_SOURCE_NOT_ON_LINK
1572 error0 = ICMP6_ERROR_ROUTER_SOLICITATION_SOURCE_NOT_ON_LINK;
1577 o0 = (
void *) (h0 + 1);
1578 o0 = ((options_len0 == 8
1579 && o0->header.type == option_type
1580 && o0->header.n_data_u64s == 1) ? o0 : 0);
1583 if (
PREDICT_TRUE (error0 == ICMP6_ERROR_NONE && o0 != 0 &&
1584 !is_unspecified && !is_link_local))
1596 if (error0 == ICMP6_ERROR_NONE)
1609 (!eth_if0) ? ICMP6_ERROR_ROUTER_SOLICITATION_UNSUPPORTED_INTF
1612 if (error0 == ICMP6_ERROR_NONE)
1619 sizeof (icmp6_neighbor_discovery_header_t));
1634 ICMP6_ERROR_ROUTER_SOLICITATION_RADV_NOT_CONFIG :
1637 if (error0 == ICMP6_ERROR_NONE)
1642 if (is_solicitation)
1653 icmp6_router_advertisement_header_t rh;
1655 rh.icmp.type = ICMP6_router_advertisement;
1657 rh.icmp.checksum = 0;
1660 rh.router_lifetime_in_sec =
1661 clib_host_to_net_u16
1664 time_in_msec_between_retransmitted_neighbor_solicitations
1666 clib_host_to_net_u32 (radv_info->
1667 adv_time_in_msec_between_retransmitted_neighbor_solicitations);
1668 rh.neighbor_reachable_time_in_msec =
1669 clib_host_to_net_u32 (radv_info->
1670 adv_neighbor_reachable_time_in_msec);
1682 u16 payload_length =
1683 sizeof (icmp6_router_advertisement_header_t);
1686 (vm, &bi0, (
void *) &rh,
1687 sizeof (icmp6_router_advertisement_header_t)))
1690 error0 = ICMP6_ERROR_ALLOC_FAILURE;
1696 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t
1700 ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
1701 h.header.n_data_u64s = 1;
1708 (vm, &bi0, (
void *) &h,
1710 (icmp6_neighbor_discovery_ethernet_link_layer_address_option_t)))
1712 error0 = ICMP6_ERROR_ALLOC_FAILURE;
1718 (icmp6_neighbor_discovery_ethernet_link_layer_address_option_t);
1724 icmp6_neighbor_discovery_mtu_option_t
h;
1729 h.header.type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_mtu;
1730 h.header.n_data_u64s = 1;
1733 sizeof (icmp6_neighbor_discovery_mtu_option_t);
1736 (vm, &bi0, (
void *) &h,
1738 (icmp6_neighbor_discovery_mtu_option_t)))
1740 error0 = ICMP6_ERROR_ALLOC_FAILURE;
1751 if(pr_info->enabled &&
1752 (!pr_info->decrement_lifetime_flag
1753 || (pr_info->pref_lifetime_expires >0)))
1756 icmp6_neighbor_discovery_prefix_information_option_t h;
1758 h.header.type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_prefix_information;
1759 h.header.n_data_u64s = (sizeof(icmp6_neighbor_discovery_prefix_information_option_t) >> 3);
1761 h.dst_address_length = pr_info->prefix_len;
1763 h.flags = (pr_info->adv_on_link_flag) ? ICMP6_NEIGHBOR_DISCOVERY_PREFIX_INFORMATION_FLAG_ON_LINK : 0;
1764 h.flags |= (pr_info->adv_autonomous_flag) ? ICMP6_NEIGHBOR_DISCOVERY_PREFIX_INFORMATION_AUTO : 0;
1766 if(radv_info->cease_radv && pr_info->deprecated_prefix_flag)
1768 h.valid_time = clib_host_to_net_u32(MIN_ADV_VALID_LIFETIME);
1769 h.preferred_time = 0;
1773 if(pr_info->decrement_lifetime_flag)
1775 pr_info->adv_valid_lifetime_in_secs = ((pr_info->valid_lifetime_expires > now)) ?
1776 (pr_info->valid_lifetime_expires - now) : 0;
1778 pr_info->adv_pref_lifetime_in_secs = ((pr_info->pref_lifetime_expires > now)) ?
1779 (pr_info->pref_lifetime_expires - now) : 0;
1782 h.valid_time = clib_host_to_net_u32(pr_info->adv_valid_lifetime_in_secs);
1783 h.preferred_time = clib_host_to_net_u32(pr_info->adv_pref_lifetime_in_secs) ;
1787 clib_memcpy(&h.dst_address, &pr_info->prefix, sizeof(ip6_address_t));
1789 payload_length += sizeof( icmp6_neighbor_discovery_prefix_information_option_t);
1791 if (vlib_buffer_add_data
1792 (vm, &bi0, (void *)&h,
1793 sizeof(icmp6_neighbor_discovery_prefix_information_option_t)))
1795 error0 = ICMP6_ERROR_ALLOC_FAILURE;
1815 IP6_MULTICAST_SCOPE_link_local,
1816 IP6_MULTICAST_GROUP_ID_all_hosts);
1824 clib_host_to_net_u16 (payload_length);
1826 icmp6_router_advertisement_header_t *rh0 =
1827 (icmp6_router_advertisement_header_t *) (ip0 + 1);
1828 rh0->icmp.checksum =
1831 ASSERT (bogus_length == 0);
1837 if (is_solicitation)
1849 is_dropped ? next0 :
1857 if (adj_index0 == 0)
1858 error0 = ICMP6_ERROR_DST_LOOKUP_MISS;
1862 is_dropped ? next0 :
1868 p0->
flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
1873 if ((error0 == ICMP6_ERROR_NONE) && !is_dropped)
1876 n_advertisements_sent++;
1883 p0->error = error_node->
errors[error0];
1885 if (error0 != ICMP6_ERROR_NONE)
1889 to_next, n_left_to_next,
1899 ICMP6_ERROR_ROUTER_ADVERTISEMENTS_TX,
1900 n_advertisements_sent);
1902 return frame->n_vectors;
1913 u32 *from, *to_next;
1914 u32 n_left_from, n_left_to_next, next_index;
1915 u32 n_advertisements_rcvd = 0;
1921 n_left_from = n_packets;
1929 while (n_left_from > 0)
1933 while (n_left_from > 0 && n_left_to_next > 0)
1938 icmp6_router_advertisement_header_t *h0;
1939 u32 bi0, options_len0, sw_if_index0, next0, error0;
1941 bi0 = to_next[0] = from[0];
1946 n_left_to_next -= 1;
1954 error0 = ICMP6_ERROR_NONE;
1959 ICMP6_ERROR_ROUTER_ADVERTISEMENT_SOURCE_NOT_LINK_LOCAL : error0;
1964 n_advertisements_rcvd++;
1966 if (error0 == ICMP6_ERROR_NONE)
1978 (!eth_if0) ? ICMP6_ERROR_ROUTER_SOLICITATION_UNSUPPORTED_INTF
1981 if (error0 == ICMP6_ERROR_NONE)
1998 ICMP6_ERROR_ROUTER_SOLICITATION_RADV_NOT_CONFIG :
2001 if (error0 == ICMP6_ERROR_NONE)
2010 r.
flags = h0->flags;
2012 clib_net_to_host_u16 (h0->router_lifetime_in_sec);
2014 clib_net_to_host_u32
2015 (h0->neighbor_reachable_time_in_msec);
2021 && (h0->current_hop_limit !=
2025 "our AdvCurHopLimit on %U doesn't agree with %U",
2037 "our AdvManagedFlag on %U doesn't agree with %U",
2049 "our AdvOtherConfigFlag on %U doesn't agree with %U",
2057 time_in_msec_between_retransmitted_neighbor_solicitations
2059 adv_time_in_msec_between_retransmitted_neighbor_solicitations)
2061 time_in_msec_between_retransmitted_neighbor_solicitations
2063 clib_host_to_net_u32 (radv_info->
2064 adv_time_in_msec_between_retransmitted_neighbor_solicitations)))
2067 "our AdvRetransTimer on %U doesn't agree with %U",
2074 if ((h0->neighbor_reachable_time_in_msec &&
2076 (h0->neighbor_reachable_time_in_msec !=
2077 clib_host_to_net_u32
2081 "our AdvReachableTime on %U doesn't agree with %U",
2089 u8 *opt_hdr = (
u8 *) (h0 + 1);
2090 while (options_len0 > 0)
2092 icmp6_neighbor_discovery_option_header_t *o0 =
2093 (icmp6_neighbor_discovery_option_header_t *)
2095 int opt_len = o0->n_data_u64s << 3;
2099 if (options_len0 < 2)
2102 "malformed RA packet on %U from %U",
2113 " zero length option in RA on %U from %U",
2120 else if (opt_len > options_len0)
2123 "option length in RA packet greater than total length on %U from %U",
2131 options_len0 -= opt_len;
2134 switch (option_type)
2136 case ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address:
2138 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t
2140 (icmp6_neighbor_discovery_ethernet_link_layer_address_option_t
2143 if (opt_len <
sizeof (*h))
2146 memcpy (r.
slla, h->ethernet_address, 6);
2150 case ICMP6_NEIGHBOR_DISCOVERY_OPTION_mtu:
2152 icmp6_neighbor_discovery_mtu_option_t *
h =
2153 (icmp6_neighbor_discovery_mtu_option_t
2156 if (opt_len <
sizeof (*h))
2159 r.
mtu = clib_net_to_host_u32 (h->mtu);
2163 clib_host_to_net_u32
2167 "our AdvLinkMTU on %U doesn't agree with %U",
2176 case ICMP6_NEIGHBOR_DISCOVERY_OPTION_prefix_information:
2178 icmp6_neighbor_discovery_prefix_information_option_t
2180 (icmp6_neighbor_discovery_prefix_information_option_t
2185 u32 preferred, valid;
2187 if (opt_len <
sizeof (*h))
2197 clib_net_to_host_u32 (h->preferred_time);
2198 valid = clib_net_to_host_u32 (h->valid_time);
2202 prefix->
flags = h->flags & 0xc0;
2213 ip6_address_mask_from_width(&mask, pr_info->prefix_len);
2215 if(pr_info->enabled &&
2216 (pr_info->prefix_len == h->dst_address_length) &&
2217 ip6_address_is_equal_masked (&pr_info->prefix, &h->dst_address, &mask))
2220 if(!pr_info->decrement_lifetime_flag &&
2221 valid != pr_info->adv_valid_lifetime_in_secs)
2223 ip6_neighbor_syslog(vm, LOG_WARNING,
2224 "our ADV validlifetime on %U for %U does not agree with %U",
2225 format_vnet_sw_if_index_name, vnm, sw_if_index0,format_ip6_address, &pr_info->prefix,
2226 format_ip6_address, &h->dst_address);
2228 if(!pr_info->decrement_lifetime_flag &&
2229 preferred != pr_info->adv_pref_lifetime_in_secs)
2231 ip6_neighbor_syslog(vm, LOG_WARNING,
2232 "our ADV preferredlifetime on %U for %U does not agree with %U",
2233 format_vnet_sw_if_index_name, vnm, sw_if_index0,format_ip6_address, &pr_info->prefix,
2234 format_ip6_address, &h->dst_address);
2252 p0->error = error_node->
errors[error0];
2254 if (error0 != ICMP6_ERROR_NONE)
2258 to_next, n_left_to_next,
2267 ICMP6_ERROR_ROUTER_ADVERTISEMENTS_RX,
2268 n_advertisements_rcvd);
2270 return frame->n_vectors;
2276 static u32 seed = 0;
2277 static u8 seed_set = 0;
2283 return random_f64 (&seed) * (to - from) + from;
2302 icmp6_router_solicitation_header_t *rh;
2317 p0->
flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
2327 rh->neighbor.icmp.type = ICMP6_router_solicitation;
2328 rh->neighbor.icmp.code = 0;
2329 rh->neighbor.icmp.checksum = 0;
2330 rh->neighbor.reserved_must_be_zero = 0;
2332 rh->link_layer_option.header.type =
2333 ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
2335 rh->link_layer_option.ethernet_address))
2337 clib_warning (
"interface with sw_if_index %u has no mac address",
2342 rh->link_layer_option.header.n_data_u64s = 1;
2344 payload_length =
sizeof (rh->neighbor) +
sizeof (
u64);
2346 rh->ip.ip_version_traffic_class_and_flow_label =
2347 clib_host_to_net_u32 (0x6 << 28);
2348 rh->ip.payload_length = clib_host_to_net_u16 (payload_length);
2349 rh->ip.protocol = IP_PROTOCOL_ICMP6;
2350 rh->ip.hop_limit = 255;
2353 rh->ip.dst_address.
as_u64[0] = clib_host_to_net_u64 (0xff02ULL << 48);
2354 rh->ip.dst_address.as_u64[1] = clib_host_to_net_u64 (2);
2393 params = &radv_info->
params;
2395 if (radv_info->
due_time > current_time)
2414 if (params->
mrc != 0 && --radv_info->
n_left == 0)
2426 if (params->
mrd != 0
2442 uword *event_data = 0;
2443 f64 sleep_time = 1e9;
2457 due_time = current_time + 1e9;
2461 if (check_send_rs (vm, radv_info, current_time, &dt)
2468 while (due_time < current_time);
2470 sleep_time = due_time - current_time;
2480 .name =
"send-rs-process",
2493 ASSERT (~0 != sw_if_index);
2531 if (!mcast_group_info)
2541 mcast_group_info->
type = 4;
2562 if (mcast_group_info)
2627 mhash_unset (&a->address_to_prefix_index, &p->prefix, 0);
2631 mhash_unset (&a->address_to_mldp_index, &m->mcast_address, 0);
2708 IP6_MULTICAST_SCOPE_link_local,
2709 IP6_MULTICAST_GROUP_ID_all_hosts);
2711 IP6_MULTICAST_SCOPE_link_local,
2712 IP6_MULTICAST_GROUP_ID_all_routers);
2714 IP6_MULTICAST_SCOPE_link_local,
2715 IP6_MULTICAST_GROUP_ID_mldv2_routers);
2743 icmp6_multicast_listener_report_header_t *rh0;
2744 icmp6_multicast_listener_report_packet_t *rp0;
2774 b0->
current_length =
sizeof (icmp6_multicast_listener_report_packet_t);
2776 payload_length =
sizeof (icmp6_multicast_listener_report_header_t);
2778 b0->
error = ICMP6_ERROR_NONE;
2782 rh0 = (icmp6_multicast_listener_report_header_t *) & rp0->report_hdr;
2784 clib_memset (rp0, 0x0,
sizeof (icmp6_multicast_listener_report_packet_t));
2787 clib_host_to_net_u32 (0x6 << 28);
2789 ip0->
protocol = IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS;
2794 rh0->icmp.type = ICMP6_multicast_listener_report_v2;
2802 IP6_MULTICAST_SCOPE_link_local,
2803 IP6_MULTICAST_GROUP_ID_mldv2_routers);
2807 int num_addr_records = 0;
2808 icmp6_multicast_address_record_t rr;
2811 rh0->ext_hdr.next_hdr = IP_PROTOCOL_ICMP6;
2812 rh0->ext_hdr.n_data_u64s = 0;
2816 rh0->alert.value = 0;
2821 rh0->icmp.checksum = 0;
2827 rr.aux_data_len_u32s = 0;
2828 rr.num_sources = clib_host_to_net_u16 (m->num_sources);
2829 clib_memcpy(&rr.mcast_addr, &m->mcast_address, sizeof(ip6_address_t));
2833 if(vlib_buffer_add_data (vm, &bo0, (void *)&rr,
2834 sizeof(icmp6_multicast_address_record_t)))
2836 vlib_buffer_free (vm, &bo0, 1);
2840 payload_length +=
sizeof( icmp6_multicast_address_record_t);
2845 rh0->num_addr_records = clib_host_to_net_u16 (num_addr_records);
2848 ip0->payload_length = clib_host_to_net_u16 (payload_length);
2852 ASSERT (bogus_length == 0);
2862 b0->flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
2879 .name =
"icmp6-router-solicitation",
2881 .vector_size =
sizeof (
u32),
2904 u32 n_this_frame = 0;
2905 u32 n_left_to_next = 0;
2908 icmp6_router_solicitation_header_t *h0;
2916 if( !vnet_sw_interface_is_admin_up (vnm, radv_info->sw_if_index))
2918 radv_info->initial_adverts_sent = radv_info->initial_adverts_count-1;
2919 radv_info->next_multicast_time = now;
2920 radv_info->last_multicast_time = now;
2921 radv_info->last_radv_time = 0;
2922 radv_info->all_routers_mcast = 0;
2930 ip6_neighbor_send_mldpv2_report(radv_info->sw_if_index);
2931 radv_info->all_routers_mcast = 1;
2940 f64 rfn = (radv_info->max_radv_interval - radv_info->min_radv_interval) *
2941 random_f64 (&radv_info->seed) + radv_info->min_radv_interval;
2944 if( radv_info->initial_adverts_sent > 0)
2946 radv_info->initial_adverts_sent--;
2947 if(rfn > radv_info-> initial_adverts_interval)
2948 rfn = radv_info-> initial_adverts_interval;
2951 if( radv_info->initial_adverts_sent == 0)
2952 if(radv_info->cease_radv)
2953 radv_info->send_radv = 0;
2968 b0->
current_length =
sizeof( icmp6_router_solicitation_header_t);
2969 b0->
error = ICMP6_ERROR_NONE;
2974 clib_memset (h0, 0,
sizeof (icmp6_router_solicitation_header_t));
2976 h0->ip.ip_version_traffic_class_and_flow_label = clib_host_to_net_u32 (0x6 << 28);
2977 h0->ip.payload_length = clib_host_to_net_u16 (
sizeof (icmp6_router_solicitation_header_t)
2979 h0->ip.protocol = IP_PROTOCOL_ICMP6;
2980 h0->ip.hop_limit = 255;
2983 h0->ip.src_address.as_u64[0] = 0;
2984 h0->ip.src_address.as_u64[1] = 0;
2986 h0->ip.dst_address.as_u64[0] = 0;
2987 h0->ip.dst_address.as_u64[1] = 0;
2989 h0->neighbor.icmp.type = ICMP6_router_solicitation;
3017 f->n_vectors = n_this_frame;
3061 _vec_len (event_data) = 0;
3071 .name =
"icmp6-router-advertisement",
3073 .vector_size =
sizeof (
u32),
3087 .name =
"ip6-icmp-neighbor-discovery-event-process",
3114 .name =
"icmp6-neighbor-solicitation",
3116 .vector_size =
sizeof (
u32),
3132 .name =
"icmp6-neighbor-advertisement",
3134 .vector_size =
sizeof (
u32),
3167 u32 *from, *to_next_drop;
3168 uword n_left_from, n_left_to_next_drop;
3182 while (n_left_from > 0)
3185 to_next_drop, n_left_to_next_drop);
3187 while (n_left_from > 0 && n_left_to_next_drop > 0)
3189 u32 pi0, adj_index0, sw_if_index0, drop0, r0, next0;
3214 sw_if_index0 = adj0->rewrite_header.sw_if_index;
3224 to_next_drop[0] = pi0;
3226 n_left_to_next_drop -= 1;
3262 icmp6_neighbor_solicitation_header_t *h0;
3282 &h0->ip.src_address))
3302 clib_memcpy (h0->link_layer_option.ethernet_address,
3306 h0->neighbor.icmp.checksum = 0;
3307 h0->neighbor.icmp.checksum =
3311 ASSERT (bogus_length == 0);
3320 b0->
flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
3328 n_left_to_next_drop);
3351 =
"no source address for ND solicitation",
3358 .name =
"ip6-glean",
3359 .vector_size =
sizeof (
u32),
3373 .name =
"ip6-discover-neighbor",
3374 .vector_size =
sizeof (
u32),
3390 u8 suppress,
u8 managed,
u8 other,
3391 u8 ll_option,
u8 send_unicast,
u8 cease,
3392 u8 use_lifetime,
u32 lifetime,
3393 u32 initial_count,
u32 initial_interval,
3394 u32 max_interval,
u32 min_interval,
u8 is_no)
3404 error = (ri != ~0) ? 0 : VNET_API_ERROR_INVALID_SW_IF_INDEX;
3412 if ((max_interval != 0) && (min_interval == 0))
3413 min_interval = .75 * max_interval;
3433 if (lifetime <= max_interval)
3434 return VNET_API_ERROR_INVALID_VALUE;
3437 if (min_interval != 0)
3439 if ((min_interval > .75 * max_interval) || (min_interval < 3))
3440 return VNET_API_ERROR_INVALID_VALUE;
3445 return VNET_API_ERROR_INVALID_VALUE;
3452 (suppress != 0) ? ((is_no != 0) ? 1 : 0) : radv_info->
send_radv;
3461 (send_unicast != 0) ? ((is_no) ? 0 : 1) : radv_info->
send_unicast;
3463 (cease != 0) ? ((is_no) ? 0 : 1) : radv_info->
cease_radv;
3474 (initial_interval !=
3479 if ((cease != 0) && (is_no))
3493 u8 use_default,
u32 val_lifetime,
u32 pref_lifetime,
3494 u8 no_advertise,
u8 off_link,
u8 no_autoconfig,
3495 u8 no_onlink,
u8 is_no)
3508 error = (ri != ~0) ? 0 : VNET_API_ERROR_INVALID_SW_IF_INDEX;
3528 return VNET_API_ERROR_INVALID_VALUE;
3531 return VNET_API_ERROR_INVALID_VALUE_2;
3586 return VNET_API_ERROR_INVALID_VALUE_2;
3595 if ((val_lifetime == ~0) || (pref_lifetime == ~0))
3608 prefix->
enabled = !(no_advertise != 0);
3635 u8 suppress = 0, managed = 0, other = 0;
3636 u8 suppress_ll_option = 0, send_unicast = 0, cease = 0;
3637 u8 use_lifetime = 0;
3639 0, ra_initial_interval = 0;
3640 u32 ra_max_interval = 0, ra_min_interval = 0;
3645 int add_radv_info = 1;
3646 __attribute__ ((unused))
ip6_radv_t *radv_info = 0;
3707 else if (
unformat (line_input,
"prefix %U/%d",
3713 else if (
unformat (line_input,
"ra-managed-config-flag"))
3718 else if (
unformat (line_input,
"ra-other-config-flag"))
3723 else if (
unformat (line_input,
"ra-suppress") ||
3724 unformat (line_input,
"ra-surpress"))
3729 else if (
unformat (line_input,
"ra-suppress-link-layer") ||
3730 unformat (line_input,
"ra-surpress-link-layer"))
3732 suppress_ll_option = 1;
3735 else if (
unformat (line_input,
"ra-send-unicast"))
3740 else if (
unformat (line_input,
"ra-lifetime"))
3742 if (!
unformat (line_input,
"%d", &ra_lifetime))
3750 else if (
unformat (line_input,
"ra-initial"))
3753 (line_input,
"%d %d", &ra_initial_count, &ra_initial_interval))
3760 else if (
unformat (line_input,
"ra-interval"))
3762 if (!
unformat (line_input,
"%d", &ra_max_interval))
3768 if (!
unformat (line_input,
"%d", &ra_min_interval))
3769 ra_min_interval = 0;
3772 else if (
unformat (line_input,
"ra-cease"))
3787 suppress, managed, other,
3788 suppress_ll_option, send_unicast, cease,
3789 use_lifetime, ra_lifetime,
3790 ra_initial_count, ra_initial_interval,
3791 ra_max_interval, ra_min_interval, is_no);
3795 u32 valid_lifetime_in_secs = 0;
3796 u32 pref_lifetime_in_secs = 0;
3797 u8 use_prefix_default_values = 0;
3798 u8 no_advertise = 0;
3800 u8 no_autoconfig = 0;
3806 if (
unformat (line_input,
"default"))
3808 use_prefix_default_values = 1;
3811 else if (
unformat (line_input,
"infinite"))
3813 valid_lifetime_in_secs = ~0;
3814 pref_lifetime_in_secs = ~0;
3817 else if (
unformat (line_input,
"%d %d", &valid_lifetime_in_secs,
3818 &pref_lifetime_in_secs))
3826 while (!use_prefix_default_values &&
3829 if (
unformat (line_input,
"no-advertise"))
3831 else if (
unformat (line_input,
"off-link"))
3833 else if (
unformat (line_input,
"no-autoconfig"))
3835 else if (
unformat (line_input,
"no-onlink"))
3845 &ip6_addr, addr_len,
3846 use_prefix_default_values,
3847 valid_lifetime_in_secs,
3848 pref_lifetime_in_secs,
3850 off_link, no_autoconfig, no_onlink, is_no);
3865 for (i = 0; i <
vec_len (addrs); i++)
3910 u32 *link_scope = 0, *global_scope = 0;
3911 u32 *local_scope = 0, *unknown_scope = 0;
3918 while (ai != (
u32) ~ 0)
3973 vlib_cli_output (vm,
"\t\t%U\n", format_ip6_address,
3983 vlib_cli_output (vm,
"\t\tprefix %U, length %d\n",
3984 format_ip6_address, &p->prefix, p->prefix_len);
3997 "\tND advertised retransmit interval is %d (msec)\n",
3999 adv_time_in_msec_between_retransmitted_neighbor_solicitations);
4004 "\tND router advertisements are sent every %d seconds (min interval is %d)\n",
4005 ra_interval, ra_interval_min);
4007 "\tND router advertisements live for %d seconds\n",
4010 "\tHosts %s stateless autoconfig for addresses\n",
4069 .path =
"show ip6 interface",
4071 .short_help =
"show ip6 interface <interface>",
4169 (&link_local_address, eth_if0->
address);
4177 link_local_address.
as_u64[1] =
4180 link_local_address.
as_u64[0] =
4181 clib_host_to_net_u64 (0xFE80000000000000ULL);
4183 link_local_address.
as_u8[8] &= 0xfd;
4263 .path =
"enable ip6 interface",
4265 .short_help =
"enable ip6 interface <interface>",
4302 .path =
"disable ip6 interface",
4304 .short_help =
"disable ip6 interface <interface>",
4427 .short_help =
"ip6 nd <interface> ...",
4469 vnm->
api_errno = VNET_API_ERROR_IP6_NOT_ENABLED;
4485 u32 if_address_index,
u32 is_delete)
4563 u32 new_fib_index,
u32 old_fib_index)
4567 u32 i, *to_re_add = 0;
4572 if (n->key.sw_if_index == sw_if_index)
4573 vec_add1 (to_re_add, n - nm->neighbor_pool);
4577 for (i = 0; i <
vec_len (to_re_add); i++)
4640 (im->discover_neighbor_next_index_by_hw_if_index, 32, 0 );
4694 while (p && *p != ~0)
4703 int found = p && *p != ~0;
4707 return VNET_API_ERROR_ENTRY_ALREADY_EXISTS;
4714 .node_index = node_index,
4715 .type_opaque = type_opaque,
4732 return VNET_API_ERROR_NO_SUCH_ENTRY;
4743 if (*p == ~0 && p == first)
4757 icmp6_neighbor_solicitation_or_advertisement_header_t *ndh;
4762 if (ndh->icmp.type != ICMP6_neighbor_solicitation &&
4763 ndh->icmp.type != ICMP6_neighbor_advertisement)
4767 (p0->
flags & VLIB_BUFFER_IS_TRACED)))
4783 if (ndh->icmp.type == ICMP6_neighbor_solicitation)
4785 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t *opt;
4789 opt = (
void *) (ndh + 1);
4790 if ((opt->header.type !=
4791 ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address) ||
4792 (opt->header.n_data_u64s != 1))
4807 ICMP6_NEIGHBOR_DISCOVERY_OPTION_target_link_layer_address;
4809 ndh->icmp.type = ICMP6_neighbor_advertisement;
4810 ndh->advertisement_flags = clib_host_to_net_u32
4813 ndh->icmp.checksum = 0;
4814 ndh->icmp.checksum =
4819 ICMP6_ERROR_NEIGHBOR_ADVERTISEMENTS_TX, 1);
4840 ip46_address_t
nh = {
4846 if (~0 == fib_index)
4847 return VNET_API_ERROR_NO_SUCH_FIB;
4907 .path =
"set ip6 nd proxy",
4908 .short_help =
"set ip6 nd proxy <HOST> <INTERFACE>",
4923 if (n->key.sw_if_index == sw_if_index)
4925 adj_nbr_walk_nh6 (sw_if_index,
4926 &n->key.ip6_address,
4927 ip6_nd_mk_complete_walk, n);
4953 u8 *rewrite, rewrite_len;
4960 (
"Sending unsolicitated NA IP6 address %U on sw_if_idex %d",
4966 icmp6_neighbor_solicitation_header_t *
h =
4974 IP6_MULTICAST_SCOPE_link_local,
4975 IP6_MULTICAST_GROUP_ID_all_hosts);
4976 h->ip.src_address = ip6_addr[0];
4977 h->neighbor.icmp.type = ICMP6_neighbor_advertisement;
4978 h->neighbor.target_address = ip6_addr[0];
4979 h->neighbor.advertisement_flags = clib_host_to_net_u32
4981 h->link_layer_option.header.type =
4982 ICMP6_NEIGHBOR_DISCOVERY_OPTION_target_link_layer_address;
4983 clib_memcpy (h->link_layer_option.ethernet_address,
4985 h->neighbor.icmp.checksum =
4987 ASSERT (bogus_length == 0);
4992 IP6_MULTICAST_GROUP_ID_all_hosts);
4995 rewrite_len =
vec_len (rewrite);
#define ICMP6_NEIGHBOR_ADVERTISEMENT_FLAG_SOLICITED
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
ip6_radv_t * if_radv_pool
#define MIN_DELAY_BETWEEN_RAS
static void ip6_neighbor_adj_fib_add(ip6_neighbor_t *n, u32 fib_index)
#define vnet_rewrite_one_header(rw0, p0, most_likely_size)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
#define DEF_DEF_RTR_LIFETIME
fib_protocol_t fp_proto
protocol type
static void ip6_nd_mk_incomplete(adj_index_t ai)
#define pool_next_index(P, I)
Return next occupied pool index after i, useful for safe iteration.
fib_node_index_t fib_table_entry_path_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, dpo_proto_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, fib_mpls_label_t *next_hop_labels, fib_route_path_flags_t path_flags)
Add one path to an entry (aka route) in the FIB.
#define VNET_REWRITE_FOR_SW_INTERFACE_ADDRESS_BROADCAST
icmp6_router_solicitation_or_advertisement_next_t
ip6_discover_neighbor_next_t
static void ip6_neighbor_syslog(vlib_main_t *vm, int priority, char *fmt,...)
#define ICMP6_ROUTER_DISCOVERY_FLAG_OTHER_CONFIG_VIA_DHCP
static uword random_default_seed(void)
Default random seed (unix/linux user-mode)
static void vlib_buffer_reset(vlib_buffer_t *b)
Reset current header & length to state they were in when packet was received.
static vlib_node_registration_t ip6_icmp_neighbor_solicitation_node
(constructor) VLIB_REGISTER_NODE (ip6_icmp_neighbor_solicitation_node)
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 send_ip6_na_w_addr(vlib_main_t *vm, const ip6_address_t *ip6_addr, u32 sw_if_index)
ip_neighbor_flags_t flags
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
int ip6_neighbor_ra_prefix(vlib_main_t *vm, u32 sw_if_index, ip6_address_t *prefix_addr, u8 prefix_len, u8 use_default, u32 val_lifetime, u32 pref_lifetime, u8 no_advertise, u8 off_link, u8 no_autoconfig, u8 no_onlink, u8 is_no)
An indication that the rewrite is incomplete, i.e.
uword ip6_ra_publisher_node
static void ip6_nbr_probe(ip_adjacency_t *adj)
clib_error_t * ip6_neighbor_set_link_local_address(vlib_main_t *vm, u32 sw_if_index, ip6_address_t *address)
static clib_error_t * ip6_neighbor_init(vlib_main_t *vm)
static void vlib_set_next_frame_buffer(vlib_main_t *vm, vlib_node_runtime_t *node, u32 next_index, u32 buffer_index)
ip_interface_address_t * if_address_pool
Pool of addresses that are assigned to interfaces.
An indication that the rewrite is complete, i.e.
vnet_main_t * vnet_get_main(void)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
static char * log_level_strings[]
ip6_multicast_address_scope_t
static void stop_sending_rs(vlib_main_t *vm, ip6_radv_t *ra)
static void ip6_nd_mk_complete(adj_index_t ai, ip6_neighbor_t *nbr)
mhash_t neighbor_index_by_key
void icmp6_send_router_solicitation(vlib_main_t *vm, u32 sw_if_index, u8 stop, icmp6_send_router_solicitation_params_t *params)
static void ip6_link_local_address_from_ethernet_mac_address(ip6_address_t *ip, u8 *mac)
static void ip6_neighbor_del_mld_prefix(ip6_radv_t *radv_info, ip6_address_t *addr)
Delete a multicast Address from the advertised MLD set.
static clib_error_t * set_ip6_nd_proxy_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
ip6_nd_change_event_cb_t data_callback
static ip6_address_t * ip6_interface_address_matching_destination(ip6_main_t *im, ip6_address_t *dst, u32 sw_if_index, ip_interface_address_t **result_ia)
clib_error_t * call_ip6_neighbor_callbacks(void *data, _vnet_ip6_neighbor_function_list_elt_t *elt)
#define clib_memcpy_fast(a, b, c)
void send_ip6_na(vlib_main_t *vm, u32 sw_if_index)
vnet_link_t adj_get_link_type(adj_index_t ai)
Return the link type of the adjacency.
uword mhash_unset(mhash_t *h, void *key, uword *old_value)
static f64 vlib_time_now(vlib_main_t *vm)
ip6_radv_prefix_t * adv_prefixes_pool
#define ethernet_buffer_header_size(b)
Determine the size of the Ethernet headers of the current frame in the buffer.
int vlib_buffer_add_data(vlib_main_t *vm, u32 *buffer_index, void *data, u32 n_data_bytes)
static void wc_nd_signal_report(wc_nd_report_t *r)
ip6_neighbor_t * ip6_neighbors_entries(u32 sw_if_index)
pending_resolution_t * pending_resolutions
static vlib_cli_command_t set_ip6_neighbor_command
(constructor) VLIB_CLI_COMMAND (set_ip6_neighbor_command)
static uword ip6_discover_neighbor_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_glean)
u16 current_length
Nbytes between current data and the end of this buffer.
This packet is to be rewritten and forwarded to the next processing node.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
ip6_address_t * ip6_interface_first_address(ip6_main_t *im, u32 sw_if_index)
get first IPv6 interface address
word vnet_sw_interface_compare(vnet_main_t *vnm, uword sw_if_index0, uword sw_if_index1)
static u64 clib_cpu_time_now(void)
#define IP6_NBR_MK_KEY(k, sw_if_index, addr)
int ip6_get_ll_address(u32 sw_if_index, ip6_address_t *addr)
int ip6_neighbor_proxy_add_del(u32 sw_if_index, ip6_address_t *addr, u8 is_del)
static_always_inline void mac_address_copy(mac_address_t *dst, const mac_address_t *src)
adj_index_t adj_glean_get(fib_protocol_t proto, u32 sw_if_index)
Get an existing glean.
clib_memset(h->entries, 0, sizeof(h->entries[0])*entries)
#define STRUCT_OFFSET_OF(t, f)
u32 adv_pref_lifetime_in_secs
#define DEF_ADV_PREF_LIFETIME
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
u32 ip6_neighbor_sw_interface_add_del(vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
create and initialize router advertisement parameters with default values for this intfc ...
static u32 vnet_sw_interface_get_mtu(vnet_main_t *vnm, u32 sw_if_index, vnet_mtu_t af)
static uword ip6_address_is_local_unicast(const ip6_address_t *a)
unformat_function_t unformat_vnet_sw_interface
static u64 random_u64(u64 *seed)
64-bit random number generator Again, constants courtesy of Donald Knuth.
u32 adv_neighbor_reachable_time_in_msec
uword ip6_ra_publisher_et
vlib_error_t * errors
Vector of errors for this node.
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
format_function_t format_vnet_sw_if_index_name
static vlib_buffer_t * vlib_buffer_copy(vlib_main_t *vm, vlib_buffer_t *b)
clib_error_t * disable_ip6_interface(vlib_main_t *vm, u32 sw_if_index)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
vnet_link_t ia_link
link/ether-type 1 bytes
#define clib_memcpy(d, s, n)
union ip_adjacency_t_::@48 sub_type
vlib_node_registration_t ip6_rewrite_mcast_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_mcast_node)
static uword ip6_neighbor_process_timer_event(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Adjacency to punt this packet.
vlib_packet_template_t discover_neighbor_packet_template
static vlib_buffer_t * create_buffer_for_rs(vlib_main_t *vm, ip6_radv_t *radv_info)
void adj_glean_update_rewrite(adj_index_t adj_index)
adj_glean_update_rewrite
ethernet_main_t ethernet_main
fib_node_index_t ip6_fib_table_lookup_exact_match(u32 fib_index, const ip6_address_t *addr, u32 len)
static void ip6_print_addrs(vlib_main_t *vm, u32 *addrs)
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
int(* ip6_nd_change_event_cb_t)(u32 pool_index, const mac_address_t *new_mac, u32 sw_if_index, const ip6_address_t *address)
static u64 ip6_address_hash_to_u64(const ip6_address_t *a)
ip6_neighbor_t * ip6_neighbors_pool(void)
#define static_always_inline
void * vlib_packet_template_get_packet(vlib_main_t *vm, vlib_packet_template_t *t, u32 *bi_result)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
vl_api_interface_index_t sw_if_index
#define VLIB_INIT_FUNCTION(x)
static uword ip6_glean(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
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...
u32 local_interface_sw_if_index
VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION(ip6_neighbor_sw_interface_up_down)
uword wc_ip6_nd_publisher_node
#define ICMP6_NEIGHBOR_ADVERTISEMENT_FLAG_OVERRIDE
enum ip_neighbor_flags_t_ ip_neighbor_flags_t
enum adj_walk_rc_t_ adj_walk_rc_t
return codes from a adjacency walker callback function
static clib_error_t * disable_ip6_interface_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static u8 * format_ip6_neighbor_ip6_entry(u8 *s, va_list *va)
static uword ip6_icmp_neighbor_discovery_event_process(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static clib_error_t * show_ip6_neighbors(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vnet_hw_interface_flags_t flags
#define DEF_ADV_VALID_LIFETIME
mhash_t address_to_mldp_index
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static vnet_sw_interface_t * vnet_get_sup_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
Aggregrate type for a prefix.
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
#define clib_error_return(e, args...)
static u32 ip6_src_lookup_for_packet(ip6_main_t *im, vlib_buffer_t *b, ip6_header_t *i)
return the DPO that the LB stacks on.
void vl_api_rpc_call_main_thread(void *fp, u8 *data, u32 data_length)
void adj_unlock(adj_index_t adj_index)
Release a reference counting lock on the adjacency.
static clib_error_t * set_ip6_neighbor(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 * neighbor_input_next_index_by_hw_if_index
int vnet_ip6_nd_term(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *p0, ethernet_header_t *eth, ip6_header_t *ip, u32 sw_if_index, u16 bd_index)
u16 fp_len
The mask length.
const u8 * ethernet_ip6_mcast_dst_addr(void)
static void ra_signal_report(ra_report_t *r)
static f64 random_f64_from_to(f64 from, f64 to)
u32 ip6_fib_table_get_index_for_sw_if_index(u32 sw_if_index)
u32 time_in_msec_between_retransmitted_neighbor_solicitations
static u32 vlib_get_buffer_index(vlib_main_t *vm, void *p)
Translate buffer pointer into buffer index.
ip6_address_t router_address
#define MAX_DELAY_BETWEEN_RAS
static heap_elt_t * first(heap_header_t *h)
throttle_t nd_throttle
ND throttling.
f64 max_delay_between_radv
vlib_error_t error
Error code for buffers to be enqueued to error handler.