36 #define ETHER_MAC_ADDR_LEN 6 58 #define MIN_ADV_VALID_LIFETIME 7203 59 #define DEF_ADV_VALID_LIFETIME 2592000 60 #define DEF_ADV_PREF_LIFETIME 604800 91 u8 link_layer_address[8];
124 #define DEF_MAX_RADV_INTERVAL 200 125 #define DEF_MIN_RADV_INTERVAL .75 * DEF_MAX_RADV_INTERVAL 126 #define DEF_CURR_HOP_LIMIT 64 127 #define DEF_DEF_RTR_LIFETIME 3 * DEF_MAX_RADV_INTERVAL 128 #define MAX_DEF_RTR_LIFETIME 9000 130 #define MAX_INITIAL_RTR_ADVERT_INTERVAL 16 131 #define MAX_INITIAL_RTR_ADVERTISEMENTS 3 132 #define MIN_DELAY_BETWEEN_RAS 3 133 #define MAX_DELAY_BETWEEN_RAS 1800 134 #define MAX_RA_DELAY_TIME .5 215 return format (s,
"%=12s%=20s%=6s%=20s%=40s",
"Time",
"Address",
"Flags",
216 "Link layer",
"Interface");
219 flags =
format (flags,
"D");
222 flags =
format (flags,
"S");
225 s =
format (s,
"%=12U%=20U%=6s%=20U%=40U",
228 flags ? (
char *) flags :
"",
245 u32 i, *to_delete = 0;
250 if (n->key.sw_if_index == sw_if_index)
251 vec_add1 (to_delete, n - nm->neighbor_pool);
255 for (i = 0; i <
vec_len (to_delete); i++)
306 u8 link_layer_address[6];
329 (
u8 *) & args,
sizeof (args));
335 icmp6_neighbor_solicitation_header_t *h;
370 h->ip.dst_address.as_u8[13] = dst->
as_u8[13];
371 h->ip.dst_address.as_u8[14] = dst->
as_u8[14];
372 h->ip.dst_address.as_u8[15] = dst->
as_u8[15];
373 h->ip.src_address = src[0];
374 h->neighbor.target_address = dst[0];
376 clib_memcpy (h->link_layer_option.ethernet_address,
379 h->neighbor.icmp.checksum =
381 ASSERT (bogus_length == 0);
424 #define IP6_NBR_MK_KEY(k, sw_if_index, addr) \ 426 k.sw_if_index = sw_if_index; \ 427 k.ip6_address = *addr; \ 512 u8 * link_layer_address,
513 uword n_bytes_link_layer_address,
519 int make_new_nd_cache_entry = 1;
542 make_new_nd_cache_entry = 0;
545 if (make_new_nd_cache_entry)
563 link_layer_address, n_bytes_link_layer_address);
569 n->
fib_entry_index =
fib_table_entry_update_one_path (fib_index, &pfx,
FIB_SOURCE_ADJ,
FIB_ENTRY_FLAG_NONE,
FIB_PROTOCOL_IP6, &pfx.
fp_addr, n->
key.
sw_if_index, ~0, 1,
NULL,
579 link_layer_address, n_bytes_link_layer_address))
583 link_layer_address, n_bytes_link_layer_address);
602 while (next_index != (
u32) ~ 0)
620 while (next_index != (
u32) ~ 0)
630 (*fp) (mc->
data, link_layer_address, sw_if_index, &
ip6a_zero);
649 u8 * link_layer_address,
650 uword n_bytes_link_layer_address)
708 n2->key.sw_if_index);
723 if (sw_if_index != ~0 && n->key.sw_if_index != sw_if_index)
783 .path =
"show ip6 neighbors",
785 .short_help =
"show ip6 neighbors [<interface>]",
812 else if (
unformat (input,
"static"))
823 mac_address,
sizeof (mac_address),
827 mac_address,
sizeof (mac_address));
846 .path =
"set ip6 neighbor",
848 .short_help =
"set ip6 neighbor [del] <interface> <ip6-address> <mac-address> [static]",
863 uword is_solicitation)
869 u32 n_left_from, n_left_to_next, next_index, n_advertisements_sent;
876 n_left_from = n_packets;
886 ? ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address
887 : ICMP6_NEIGHBOR_DISCOVERY_OPTION_target_link_layer_address);
888 n_advertisements_sent = 0;
890 while (n_left_from > 0)
894 while (n_left_from > 0 && n_left_to_next > 0)
898 icmp6_neighbor_solicitation_or_advertisement_header_t *h0;
899 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t *o0;
900 u32 bi0, options_len0, sw_if_index0, next0, error0;
901 u32 ip6_sadd_link_local, ip6_sadd_unspecified;
905 bi0 = to_next[0] = from[0];
918 error0 = ICMP6_ERROR_NONE;
920 ip6_sadd_link_local =
922 ip6_sadd_unspecified =
926 if (!ip6_sadd_unspecified && !ip6_sadd_link_local)
940 error0 = ((adj0->rewrite_header.sw_if_index != sw_if_index0
943 ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_NOT_ON_LINK
949 ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_NOT_ON_LINK;
953 o0 = (
void *) (h0 + 1);
954 o0 = ((options_len0 == 8 && o0->header.type == option_type
955 && o0->header.n_data_u64s == 1) ? o0 : 0);
958 if (
PREDICT_TRUE (error0 == ICMP6_ERROR_NONE && o0 != 0 &&
959 !ip6_sadd_unspecified && !ip6_sadd_link_local))
970 o0->ethernet_address,
971 sizeof (o0->ethernet_address),
975 if (is_solicitation && error0 == ICMP6_ERROR_NONE)
986 error0 = ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_UNKNOWN;
1000 ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_UNKNOWN;
1005 if (is_solicitation)
1006 next0 = (error0 != ICMP6_ERROR_NONE
1012 error0 = error0 == ICMP6_ERROR_NONE ?
1013 ICMP6_ERROR_NEIGHBOR_ADVERTISEMENTS_RX : error0;
1016 if (is_solicitation && error0 == ICMP6_ERROR_NONE)
1023 if (!ip6_sadd_unspecified)
1027 IP6_MULTICAST_SCOPE_link_local,
1028 IP6_MULTICAST_GROUP_ID_all_hosts);
1032 h0->icmp.type = ICMP6_neighbor_advertisement;
1042 ICMP6_NEIGHBOR_DISCOVERY_OPTION_target_link_layer_address;
1045 h0->advertisement_flags = clib_host_to_net_u32
1049 h0->icmp.checksum = 0;
1053 ASSERT (bogus_length == 0);
1069 n_advertisements_sent++;
1075 to_next, n_left_to_next,
1084 ICMP6_ERROR_NEIGHBOR_ADVERTISEMENTS_TX,
1085 n_advertisements_sent);
1091 #define foreach_log_level \ 1092 _ (DEBUG, "DEBUG") \ 1093 _ (INFO, "INFORMATION") \ 1094 _ (NOTICE, "NOTICE") \ 1095 _ (WARNING, "WARNING") \ 1097 _ (CRIT, "CRITICAL") \ 1098 _ (ALERT, "ALERT") \ 1099 _ (EMERG, "EMERGENCY") 1103 #define _(f,s) LOG_##f, 1123 if ((priority > LOG_EMERG) || !(logmask & (1 << priority)))
1133 .format =
"ip6 nd: (%s): %s",.format_args =
"T4T4",};
1163 u32 *from, *to_next;
1164 u32 n_left_from, n_left_to_next, next_index;
1165 u32 n_advertisements_sent = 0;
1174 n_left_from = n_packets;
1183 option_type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
1185 while (n_left_from > 0)
1189 while (n_left_from > 0 && n_left_to_next > 0)
1195 icmp6_neighbor_discovery_header_t *h0;
1196 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t *o0;
1198 u32 bi0, options_len0, sw_if_index0, next0, error0;
1199 u32 is_solicitation = 1, is_dropped = 0;
1200 u32 is_unspecified, is_link_local;
1202 bi0 = to_next[0] = from[0];
1207 n_left_to_next -= 1;
1218 error0 = ICMP6_ERROR_NONE;
1223 is_solicitation = 0;
1226 if (!is_unspecified && !is_link_local)
1235 error0 = (adj0->rewrite_header.sw_if_index != sw_if_index0
1237 ICMP6_ERROR_ROUTER_SOLICITATION_SOURCE_NOT_ON_LINK
1242 error0 = ICMP6_ERROR_ROUTER_SOLICITATION_SOURCE_NOT_ON_LINK;
1247 o0 = (
void *) (h0 + 1);
1248 o0 = ((options_len0 == 8
1249 && o0->header.type == option_type
1250 && o0->header.n_data_u64s == 1) ? o0 : 0);
1253 if (
PREDICT_TRUE (error0 == ICMP6_ERROR_NONE && o0 != 0 &&
1254 !is_unspecified && !is_link_local))
1264 o0->ethernet_address,
1265 sizeof (o0->ethernet_address),
1272 if (error0 == ICMP6_ERROR_NONE)
1285 (!eth_if0) ? ICMP6_ERROR_ROUTER_SOLICITATION_UNSUPPORTED_INTF
1288 if (error0 == ICMP6_ERROR_NONE)
1295 sizeof (icmp6_neighbor_discovery_header_t));
1308 ICMP6_ERROR_ROUTER_SOLICITATION_RADV_NOT_CONFIG :
1311 if (error0 == ICMP6_ERROR_NONE)
1316 if (is_solicitation)
1326 icmp6_router_advertisement_header_t rh;
1328 rh.icmp.type = ICMP6_router_advertisement;
1330 rh.icmp.checksum = 0;
1333 rh.router_lifetime_in_sec =
1334 clib_host_to_net_u16
1337 time_in_msec_between_retransmitted_neighbor_solicitations
1339 clib_host_to_net_u32 (radv_info->
1340 adv_time_in_msec_between_retransmitted_neighbor_solicitations);
1341 rh.neighbor_reachable_time_in_msec =
1342 clib_host_to_net_u32 (radv_info->
1343 adv_neighbor_reachable_time_in_msec);
1355 u16 payload_length =
1356 sizeof (icmp6_router_advertisement_header_t);
1363 (icmp6_router_advertisement_header_t));
1367 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t
1371 ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
1372 h.header.n_data_u64s = 1;
1383 (icmp6_neighbor_discovery_ethernet_link_layer_address_option_t));
1387 (icmp6_neighbor_discovery_ethernet_link_layer_address_option_t);
1393 icmp6_neighbor_discovery_mtu_option_t h;
1398 h.header.type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_mtu;
1399 h.header.n_data_u64s = 1;
1402 sizeof (icmp6_neighbor_discovery_mtu_option_t);
1409 (icmp6_neighbor_discovery_mtu_option_t));
1418 if(pr_info->enabled &&
1419 (!pr_info->decrement_lifetime_flag
1420 || (pr_info->pref_lifetime_expires >0)))
1423 icmp6_neighbor_discovery_prefix_information_option_t h;
1425 h.header.type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_prefix_information;
1426 h.header.n_data_u64s = (sizeof(icmp6_neighbor_discovery_prefix_information_option_t) >> 3);
1428 h.dst_address_length = pr_info->prefix_len;
1430 h.flags = (pr_info->adv_on_link_flag) ? ICMP6_NEIGHBOR_DISCOVERY_PREFIX_INFORMATION_FLAG_ON_LINK : 0;
1431 h.flags |= (pr_info->adv_autonomous_flag) ? ICMP6_NEIGHBOR_DISCOVERY_PREFIX_INFORMATION_AUTO : 0;
1433 if(radv_info->cease_radv && pr_info->deprecated_prefix_flag)
1435 h.valid_time = clib_host_to_net_u32(MIN_ADV_VALID_LIFETIME);
1436 h.preferred_time = 0;
1440 if(pr_info->decrement_lifetime_flag)
1442 pr_info->adv_valid_lifetime_in_secs = ((pr_info->valid_lifetime_expires > now)) ?
1443 (pr_info->valid_lifetime_expires - now) : 0;
1445 pr_info->adv_pref_lifetime_in_secs = ((pr_info->pref_lifetime_expires > now)) ?
1446 (pr_info->pref_lifetime_expires - now) : 0;
1449 h.valid_time = clib_host_to_net_u32(pr_info->adv_valid_lifetime_in_secs);
1450 h.preferred_time = clib_host_to_net_u32(pr_info->adv_pref_lifetime_in_secs) ;
1454 clib_memcpy(&h.dst_address, &pr_info->prefix, sizeof(ip6_address_t));
1456 payload_length += sizeof( icmp6_neighbor_discovery_prefix_information_option_t);
1458 vlib_buffer_add_data (vm,
1459 p0->free_list_index,
1461 (void *)&h, sizeof(icmp6_neighbor_discovery_prefix_information_option_t));
1479 IP6_MULTICAST_SCOPE_link_local,
1480 IP6_MULTICAST_GROUP_ID_all_hosts);
1488 clib_host_to_net_u16 (payload_length);
1490 icmp6_router_advertisement_header_t *rh0 =
1491 (icmp6_router_advertisement_header_t *) (ip0 + 1);
1492 rh0->icmp.checksum =
1495 ASSERT (bogus_length == 0);
1501 if (is_solicitation)
1513 is_dropped ? next0 :
1521 if (adj_index0 == 0)
1522 error0 = ICMP6_ERROR_DST_LOOKUP_MISS;
1529 ((adj0->rewrite_header.sw_if_index !=
1533 ICMP6_ERROR_ROUTER_SOLICITATION_DEST_UNKNOWN
1536 is_dropped ? next0 :
1547 if ((error0 == ICMP6_ERROR_NONE) && !is_dropped)
1550 n_advertisements_sent++;
1556 p0->error = error_node->
errors[error0];
1558 if (error0 != ICMP6_ERROR_NONE)
1562 to_next, n_left_to_next,
1572 ICMP6_ERROR_ROUTER_ADVERTISEMENTS_TX,
1573 n_advertisements_sent);
1575 return frame->n_vectors;
1586 u32 *from, *to_next;
1587 u32 n_left_from, n_left_to_next, next_index;
1588 u32 n_advertisements_rcvd = 0;
1594 n_left_from = n_packets;
1602 while (n_left_from > 0)
1606 while (n_left_from > 0 && n_left_to_next > 0)
1611 icmp6_router_advertisement_header_t *h0;
1612 u32 bi0, options_len0, sw_if_index0, next0, error0;
1614 bi0 = to_next[0] = from[0];
1619 n_left_to_next -= 1;
1627 error0 = ICMP6_ERROR_NONE;
1632 ICMP6_ERROR_ROUTER_ADVERTISEMENT_SOURCE_NOT_LINK_LOCAL : error0;
1637 n_advertisements_rcvd++;
1639 if (error0 == ICMP6_ERROR_NONE)
1651 (!eth_if0) ? ICMP6_ERROR_ROUTER_SOLICITATION_UNSUPPORTED_INTF
1654 if (error0 == ICMP6_ERROR_NONE)
1669 ICMP6_ERROR_ROUTER_SOLICITATION_RADV_NOT_CONFIG :
1672 if (error0 == ICMP6_ERROR_NONE)
1676 && (h0->current_hop_limit !=
1680 "our AdvCurHopLimit on %U doesn't agree with %U",
1692 "our AdvManagedFlag on %U doesn't agree with %U",
1704 "our AdvOtherConfigFlag on %U doesn't agree with %U",
1712 time_in_msec_between_retransmitted_neighbor_solicitations
1714 adv_time_in_msec_between_retransmitted_neighbor_solicitations)
1716 time_in_msec_between_retransmitted_neighbor_solicitations
1718 clib_host_to_net_u32 (radv_info->
1719 adv_time_in_msec_between_retransmitted_neighbor_solicitations)))
1722 "our AdvRetransTimer on %U doesn't agree with %U",
1729 if ((h0->neighbor_reachable_time_in_msec &&
1731 (h0->neighbor_reachable_time_in_msec !=
1732 clib_host_to_net_u32
1736 "our AdvReachableTime on %U doesn't agree with %U",
1744 u8 *opt_hdr = (
u8 *) (h0 + 1);
1745 while (options_len0 > 0)
1747 icmp6_neighbor_discovery_option_header_t *o0 =
1748 (icmp6_neighbor_discovery_option_header_t *)
1750 int opt_len = o0->n_data_u64s << 3;
1754 if (options_len0 < 2)
1757 "malformed RA packet on %U from %U",
1768 " zero length option in RA on %U from %U",
1775 else if (opt_len > options_len0)
1778 "option length in RA packet greater than total length on %U from %U",
1786 options_len0 -= opt_len;
1789 switch (option_type)
1791 case ICMP6_NEIGHBOR_DISCOVERY_OPTION_mtu:
1793 icmp6_neighbor_discovery_mtu_option_t *h =
1794 (icmp6_neighbor_discovery_mtu_option_t
1797 if (opt_len <
sizeof (*h))
1802 clib_host_to_net_u32
1806 "our AdvLinkMTU on %U doesn't agree with %U",
1815 case ICMP6_NEIGHBOR_DISCOVERY_OPTION_prefix_information:
1817 icmp6_neighbor_discovery_prefix_information_option_t
1819 (icmp6_neighbor_discovery_prefix_information_option_t
1824 u32 preferred, valid;
1826 if (opt_len <
sizeof (*h))
1830 clib_net_to_host_u32 (h->preferred_time);
1831 valid = clib_net_to_host_u32 (h->valid_time);
1839 ip6_address_mask_from_width(&mask, pr_info->prefix_len);
1841 if(pr_info->enabled &&
1842 (pr_info->prefix_len == h->dst_address_length) &&
1843 ip6_address_is_equal_masked (&pr_info->prefix, &h->dst_address, &mask))
1846 if(!pr_info->decrement_lifetime_flag &&
1847 valid != pr_info->adv_valid_lifetime_in_secs)
1849 ip6_neighbor_syslog(vm, LOG_WARNING,
1850 "our ADV validlifetime on %U for %U does not agree with %U",
1851 format_vnet_sw_if_index_name, vnm, sw_if_index0,format_ip6_address, &pr_info->prefix,
1852 format_ip6_address, &h->dst_address);
1854 if(!pr_info->decrement_lifetime_flag &&
1855 preferred != pr_info->adv_pref_lifetime_in_secs)
1857 ip6_neighbor_syslog(vm, LOG_WARNING,
1858 "our ADV preferredlifetime on %U for %U does not agree with %U",
1859 format_vnet_sw_if_index_name, vnm, sw_if_index0,format_ip6_address, &pr_info->prefix,
1860 format_ip6_address, &h->dst_address);
1877 p0->error = error_node->
errors[error0];
1879 if (error0 != ICMP6_ERROR_NONE)
1883 to_next, n_left_to_next,
1892 ICMP6_ERROR_ROUTER_ADVERTISEMENTS_RX,
1893 n_advertisements_rcvd);
1895 return frame->n_vectors;
1901 u32 sw_if_index,
u32 is_add)
1927 u32 i, *to_delete = 0;
1940 vec_add1 (to_delete, p - a->adv_prefixes_pool);
1944 for (i = 0; i <
vec_len (to_delete); i++)
1958 vec_add1 (to_delete, m - a->mldp_group_pool);
1962 for (i = 0; i <
vec_len (to_delete); i++)
1990 memset (a, 0,
sizeof (a[0]));
2031 u8 link_layer_address[6] = { 0x33, 0x33, 0x00, 0x00, 0x00,
2032 IP6_MULTICAST_GROUP_ID_all_hosts
2037 sw_if_index, link_layer_address);
2041 u8 link_layer_address[6] = { 0x33, 0x33, 0x00, 0x00, 0x00,
2042 IP6_MULTICAST_GROUP_ID_all_routers
2047 sw_if_index, link_layer_address);
2051 u8 link_layer_address[6] = { 0x33, 0x33, 0x00, 0x00, 0x00,
2052 IP6_MULTICAST_GROUP_ID_mldv2_routers
2058 sw_if_index, link_layer_address);
2066 IP6_MULTICAST_SCOPE_link_local,
2067 IP6_MULTICAST_GROUP_ID_all_hosts);
2076 if (!mcast_group_info)
2086 mcast_group_info->
type = 4;
2094 IP6_MULTICAST_SCOPE_link_local,
2095 IP6_MULTICAST_GROUP_ID_all_routers);
2101 if (!mcast_group_info)
2111 mcast_group_info->
type = 4;
2119 IP6_MULTICAST_SCOPE_link_local,
2120 IP6_MULTICAST_GROUP_ID_mldv2_routers);
2126 if (!mcast_group_info)
2136 mcast_group_info->
type = 4;
2169 icmp6_multicast_listener_report_header_t *rh0;
2170 icmp6_multicast_listener_report_packet_t *rp0;
2202 b0->
current_length =
sizeof (icmp6_multicast_listener_report_packet_t);
2204 payload_length =
sizeof (icmp6_multicast_listener_report_header_t);
2206 b0->
error = ICMP6_ERROR_NONE;
2210 rh0 = (icmp6_multicast_listener_report_header_t *) & rp0->report_hdr;
2212 memset (rp0, 0x0,
sizeof (icmp6_multicast_listener_report_packet_t));
2215 clib_host_to_net_u32 (0x6 << 28);
2217 ip0->
protocol = IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS;
2222 rh0->icmp.type = ICMP6_multicast_listener_report_v2;
2230 IP6_MULTICAST_SCOPE_link_local,
2231 IP6_MULTICAST_GROUP_ID_mldv2_routers);
2235 int num_addr_records = 0;
2236 icmp6_multicast_address_record_t rr;
2239 rh0->ext_hdr.next_hdr = IP_PROTOCOL_ICMP6;
2240 rh0->ext_hdr.n_data_u64s = 0;
2244 rh0->alert.value = 0;
2249 rh0->icmp.checksum = 0;
2255 rr.aux_data_len_u32s = 0;
2256 rr.num_sources = clib_host_to_net_u16 (m->num_sources);
2257 clib_memcpy(&rr.mcast_addr, &m->mcast_address, sizeof(ip6_address_t));
2261 vlib_buffer_add_data
2262 (vm, b0->free_list_index, bo0,
2263 (void *)&rr, sizeof(icmp6_multicast_address_record_t));
2265 payload_length += sizeof( icmp6_multicast_address_record_t);
2270 rh0->num_addr_records = clib_host_to_net_u16 (num_addr_records);
2277 ASSERT (bogus_length == 0);
2305 .name =
"icmp6-router-solicitation",
2307 .vector_size =
sizeof (
u32),
2330 u32 n_this_frame = 0;
2331 u32 n_left_to_next = 0;
2334 icmp6_router_solicitation_header_t *h0;
2342 if( !vnet_sw_interface_is_admin_up (vnm, radv_info->sw_if_index))
2344 radv_info->initial_adverts_sent = radv_info->initial_adverts_count-1;
2345 radv_info->next_multicast_time = now;
2346 radv_info->last_multicast_time = now;
2347 radv_info->last_radv_time = 0;
2348 radv_info->all_routers_mcast = 0;
2356 ip6_neighbor_send_mldpv2_report(radv_info->sw_if_index);
2357 radv_info->all_routers_mcast = 1;
2366 f64 rfn = (radv_info->max_radv_interval - radv_info->min_radv_interval) *
2367 random_f64 (&radv_info->seed) + radv_info->min_radv_interval;
2370 if( radv_info->initial_adverts_sent > 0)
2372 radv_info->initial_adverts_sent--;
2373 if(rfn > radv_info-> initial_adverts_interval)
2374 rfn = radv_info-> initial_adverts_interval;
2377 if( radv_info->initial_adverts_sent == 0)
2378 if(radv_info->cease_radv)
2379 radv_info->send_radv = 0;
2395 b0->
current_length =
sizeof( icmp6_router_solicitation_header_t);
2396 b0->
error = ICMP6_ERROR_NONE;
2401 memset (h0, 0,
sizeof (icmp6_router_solicitation_header_t));
2403 h0->ip.ip_version_traffic_class_and_flow_label = clib_host_to_net_u32 (0x6 << 28);
2404 h0->ip.payload_length = clib_host_to_net_u16 (
sizeof (icmp6_router_solicitation_header_t)
2406 h0->ip.protocol = IP_PROTOCOL_ICMP6;
2407 h0->ip.hop_limit = 255;
2410 h0->ip.src_address.as_u64[0] = 0;
2411 h0->ip.src_address.as_u64[1] = 0;
2413 h0->ip.dst_address.as_u64[0] = 0;
2414 h0->ip.dst_address.as_u64[1] = 0;
2416 h0->neighbor.icmp.type = ICMP6_router_solicitation;
2444 f->n_vectors = n_this_frame;
2488 _vec_len (event_data) = 0;
2498 .name =
"icmp6-router-advertisement",
2500 .vector_size =
sizeof (
u32),
2514 .name =
"ip6-icmp-neighbor-discovery-event-process",
2541 .name =
"icmp6-neighbor-solicitation",
2543 .vector_size =
sizeof (
u32),
2559 .name =
"icmp6-neighbor-advertisement",
2561 .vector_size =
sizeof (
u32),
2575 u8 suppress,
u8 managed,
u8 other,
2576 u8 ll_option,
u8 send_unicast,
u8 cease,
2577 u8 use_lifetime,
u32 lifetime,
2578 u32 initial_count,
u32 initial_interval,
2579 u32 max_interval,
u32 min_interval,
u8 is_no)
2589 error = (ri != ~0) ? 0 : VNET_API_ERROR_INVALID_SW_IF_INDEX;
2597 if ((max_interval != 0) && (min_interval == 0))
2598 min_interval = .75 * max_interval;
2618 if (lifetime <= max_interval)
2619 return VNET_API_ERROR_INVALID_VALUE;
2622 if (min_interval != 0)
2624 if ((min_interval > .75 * max_interval) || (min_interval < 3))
2625 return VNET_API_ERROR_INVALID_VALUE;
2630 return VNET_API_ERROR_INVALID_VALUE;
2637 (suppress != 0) ? ((is_no != 0) ? 1 : 0) : radv_info->
send_radv;
2646 (send_unicast != 0) ? ((is_no) ? 0 : 1) : radv_info->
send_unicast;
2648 (cease != 0) ? ((is_no) ? 0 : 1) : radv_info->
cease_radv;
2659 (initial_interval !=
2664 if ((cease != 0) && (is_no))
2678 u8 use_default,
u32 val_lifetime,
u32 pref_lifetime,
2679 u8 no_advertise,
u8 off_link,
u8 no_autoconfig,
2680 u8 no_onlink,
u8 is_no)
2693 error = (ri != ~0) ? 0 : VNET_API_ERROR_INVALID_SW_IF_INDEX;
2713 return VNET_API_ERROR_INVALID_VALUE;
2716 return VNET_API_ERROR_INVALID_VALUE_2;
2771 return VNET_API_ERROR_INVALID_VALUE_2;
2780 if ((val_lifetime == ~0) || (pref_lifetime == ~0))
2793 prefix->
enabled = !(no_advertise != 0);
2820 u8 suppress = 0, managed = 0, other = 0;
2821 u8 suppress_ll_option = 0, send_unicast = 0, cease = 0;
2822 u8 use_lifetime = 0;
2823 u32 sw_if_index, ra_lifetime = 0, ra_initial_count =
2824 0, ra_initial_interval = 0;
2825 u32 ra_max_interval = 0, ra_min_interval = 0;
2830 int add_radv_info = 1;
2831 __attribute__ ((unused))
ip6_radv_t *radv_info = 0;
2892 else if (
unformat (line_input,
"prefix %U/%d",
2898 else if (
unformat (line_input,
"ra-managed-config-flag"))
2903 else if (
unformat (line_input,
"ra-other-config-flag"))
2908 else if (
unformat (line_input,
"ra-suppress") ||
2909 unformat (line_input,
"ra-surpress"))
2914 else if (
unformat (line_input,
"ra-suppress-link-layer") ||
2915 unformat (line_input,
"ra-surpress-link-layer"))
2917 suppress_ll_option = 1;
2920 else if (
unformat (line_input,
"ra-send-unicast"))
2925 else if (
unformat (line_input,
"ra-lifetime"))
2927 if (!
unformat (line_input,
"%d", &ra_lifetime))
2932 else if (
unformat (line_input,
"ra-initial"))
2935 (line_input,
"%d %d", &ra_initial_count, &ra_initial_interval))
2939 else if (
unformat (line_input,
"ra-interval"))
2941 if (!
unformat (line_input,
"%d", &ra_max_interval))
2944 if (!
unformat (line_input,
"%d", &ra_min_interval))
2945 ra_min_interval = 0;
2948 else if (
unformat (line_input,
"ra-cease"))
2960 suppress, managed, other,
2961 suppress_ll_option, send_unicast, cease,
2962 use_lifetime, ra_lifetime,
2963 ra_initial_count, ra_initial_interval,
2964 ra_max_interval, ra_min_interval, is_no);
2968 u32 valid_lifetime_in_secs = 0;
2969 u32 pref_lifetime_in_secs = 0;
2970 u8 use_prefix_default_values = 0;
2971 u8 no_advertise = 0;
2973 u8 no_autoconfig = 0;
2979 if (
unformat (line_input,
"default"))
2981 use_prefix_default_values = 1;
2984 else if (
unformat (line_input,
"infinite"))
2986 valid_lifetime_in_secs = ~0;
2987 pref_lifetime_in_secs = ~0;
2990 else if (
unformat (line_input,
"%d %d", &valid_lifetime_in_secs,
2991 &pref_lifetime_in_secs))
2999 while (!use_prefix_default_values &&
3002 if (
unformat (line_input,
"no-advertise"))
3004 else if (
unformat (line_input,
"off-link"))
3006 else if (
unformat (line_input,
"no-autoconfig"))
3008 else if (
unformat (line_input,
"no-onlink"))
3015 &ip6_addr, addr_len,
3016 use_prefix_default_values,
3017 valid_lifetime_in_secs,
3018 pref_lifetime_in_secs,
3020 off_link, no_autoconfig, no_onlink, is_no);
3035 for (i = 0; i <
vec_len (addrs); i++)
3080 u32 *link_scope = 0, *global_scope = 0;
3081 u32 *local_scope = 0, *unknown_scope = 0;
3088 while (ai != (
u32) ~ 0)
3139 vlib_cli_output (vm,
"\t\t%U\n", format_ip6_address,
3149 vlib_cli_output (vm,
"\t\tprefix %U, length %d\n",
3150 format_ip6_address, &p->prefix, p->prefix_len);
3163 "\tND advertised retransmit interval is %d (msec)\n",
3165 adv_time_in_msec_between_retransmitted_neighbor_solicitations);
3170 "\tND router advertisements are sent every %d seconds (min interval is %d)\n",
3171 ra_interval, ra_interval_min);
3173 "\tND router advertisements live for %d seconds\n",
3176 "\tHosts %s stateless autoconfig for addresses\n",
3235 .path =
"show ip6 interface",
3237 .short_help =
"show ip6 interface <interface>",
3267 link_local_address, 128,
3333 (&link_local_address, eth_if0->
address);
3345 md5_add (&m, &link_local_address, 16);
3352 link_local_address.
as_u64[0] =
3353 clib_host_to_net_u64 (0xFE80000000000000ULL);
3355 link_local_address.
as_u8[8] &= 0xfd;
3360 &link_local_address,
3412 .path =
"enable ip6 interface",
3414 .short_help =
"enable ip6 interface <interface>",
3451 .path =
"disable ip6 interface",
3453 .short_help =
"disable ip6 interface <interface>",
3576 .short_help =
"ip6 nd <interface> ...",
3594 vnm->
api_errno = VNET_API_ERROR_ADDRESS_NOT_LINK_LOCAL;
3630 vnm->
api_errno = VNET_API_ERROR_IP6_NOT_ENABLED;
3677 .path =
"set ip6 link-local address",
3678 .short_help =
"set ip6 link-local address <interface> <ip6-address>/<width>",
3690 u32 if_address_index,
u32 is_delete)
3731 if (!mcast_group_info)
3741 mcast_group_info->
type = 4;
3767 if (mcast_group_info)
3838 (im->discover_neighbor_next_index_by_hw_if_index, 32, 0 );
3879 void *data_callback,
3889 void (*fp) (
u32,
u8 *) = data_callback;
3921 return VNET_API_ERROR_NO_SUCH_ENTRY;
3925 while (index != (
u32) ~ 0)
3933 (*fp) (mc->
data, 0 );
3955 return VNET_API_ERROR_NO_SUCH_ENTRY;
3967 icmp6_neighbor_solicitation_or_advertisement_header_t *ndh;
3972 if (ndh->icmp.type != ICMP6_neighbor_solicitation &&
3973 ndh->icmp.type != ICMP6_neighbor_advertisement)
3986 if (p && shg == 0 &&
3989 u32 next_index = p[0];
3990 while (next_index != (
u32) ~ 0)
3998 rv = (*fp) (mc->
data,
4009 if (ndh->icmp.type == ICMP6_neighbor_solicitation)
4011 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t *opt;
4015 opt = (
void *) (ndh + 1);
4016 if ((opt->header.type !=
4017 ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address) ||
4018 (opt->header.n_data_u64s != 1))
4033 ICMP6_NEIGHBOR_DISCOVERY_OPTION_target_link_layer_address;
4035 ndh->icmp.type = ICMP6_neighbor_advertisement;
4036 ndh->advertisement_flags = clib_host_to_net_u32
4039 ndh->icmp.checksum = 0;
4040 ndh->icmp.checksum =
4045 ICMP6_ERROR_NEIGHBOR_ADVERTISEMENTS_TX, 1);
4063 if (n->key.sw_if_index == sw_if_index)
4065 adj_nbr_walk_nh6 (sw_if_index,
4066 &n->key.ip6_address,
4067 ip6_nd_mk_complete_walk, n);
#define ICMP6_NEIGHBOR_ADVERTISEMENT_FLAG_SOLICITED
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
fib_node_index_t fib_table_entry_update_one_path(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, fib_protocol_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, mpls_label_t *next_hop_labels, fib_route_path_flags_t path_flags)
Update the entry to have just one path.
ip6_radv_t * if_radv_pool
#define MIN_DELAY_BETWEEN_RAS
#define vnet_rewrite_one_header(rw0, p0, most_likely_size)
#define DEF_DEF_RTR_LIFETIME
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.
void md5_finish(md5_context_t *c, u8 *digest)
#define VNET_REWRITE_FOR_SW_INTERFACE_ADDRESS_BROADCAST
icmp6_router_solicitation_or_advertisement_next_t
static void unset_random_neighbor_entry(void)
static void ip6_neighbor_syslog(vlib_main_t *vm, int priority, char *fmt,...)
sll srl srl sll sra u16x4 i
#define ICMP6_ROUTER_DISCOVERY_FLAG_OTHER_CONFIG_VIA_DHCP
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...
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.
static void ip6_nbr_probe(ip_adjacency_t *adj)
static clib_error_t * ip6_neighbor_init(vlib_main_t *vm)
static vlib_main_t * vlib_get_main(void)
ip_interface_address_t * if_address_pool
Pool of addresses that are assigned to interfaces.
An indication that the rewrite is complete, i.e.
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
adj_index_t all_nodes_adj_index
static char * log_level_strings[]
static void ip6_nd_mk_complete(adj_index_t ai, ip6_neighbor_t *nbr)
mhash_t neighbor_index_by_key
u32 free_list_index
Buffer free list that this buffer was allocated from and will be freed to.
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
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)
static uword ip6_address_is_local_unicast(ip6_address_t *a)
adj_index_t adj_rewrite_add_and_lock(fib_protocol_t nh_proto, vnet_link_t link_type, u32 sw_if_index, u8 *rewrite)
adj_rewrite_add_and_lock
void md5_init(md5_context_t *c)
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)
u32 vlib_buffer_alloc_from_free_list(vlib_main_t *vm, u32 *buffers, u32 n_buffers, u32 free_list_index)
Allocate buffers from specific freelist into supplied array.
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.
static uword ip6_address_is_global_unicast(ip6_address_t *a)
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)
#define ETHER_MAC_ADDR_LEN
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
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)
#define IP6_NEIGHBOR_FLAG_DYNAMIC
struct _vlib_node_registration vlib_node_registration_t
#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)
format_function_t format_vlib_cpu_time
unformat_function_t unformat_vnet_sw_interface
static u64 random_u64(u64 *seed)
64-bit random number generator Again, constants courtesy of Donald Knuth.
int vnet_add_del_ip6_nd_change_event(vnet_main_t *vnm, void *data_callback, u32 pid, void *address_arg, uword node_index, uword type_opaque, uword data, int is_add)
u32 adv_neighbor_reachable_time_in_msec
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
format_function_t format_vnet_sw_if_index_name
union ip_adjacency_t_::@175 sub_type
clib_error_t * disable_ip6_interface(vlib_main_t *vm, u32 sw_if_index)
u32 vlib_register_node(vlib_main_t *vm, vlib_node_registration_t *r)
static uword ip6_neighbor_process_timer_event(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
vlib_packet_template_t discover_neighbor_packet_template
ethernet_main_t ethernet_main
vnet_main_t * vnet_get_main(void)
#define VNET_BUFFER_LOCALLY_ORIGINATED
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.
#define static_always_inline
u8 * format_ethernet_address(u8 *s, va_list *args)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define VLIB_INIT_FUNCTION(x)
u32 local_interface_sw_if_index
VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION(ip6_neighbor_sw_interface_up_down)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define ICMP6_NEIGHBOR_ADVERTISEMENT_FLAG_OVERRIDE
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)
#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.
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)
#define clib_warning(format, args...)
adj_index_t all_routers_adj_index
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
u16 fp_len
The mask length.
u32 ip6_fib_table_get_index_for_sw_if_index(u32 sw_if_index)
#define MAX_DELAY_BETWEEN_RAS
f64 max_delay_between_radv
u32 adv_time_in_msec_between_retransmitted_neighbor_solicitations
vnet_api_error_t api_errno
f64 pref_lifetime_expires
format_function_t format_vnet_sw_interface_name
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
void vnet_register_ip6_neighbor_resolution_event(vnet_main_t *vnm, void *address_arg, uword node_index, uword type_opaque, uword data)
u16 current_length
Nbytes between current data and the end of this buffer.
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
int vnet_unset_ip6_ethernet_neighbor(vlib_main_t *vm, u32 sw_if_index, ip6_address_t *a, u8 *link_layer_address, uword n_bytes_link_layer_address)
static clib_error_t * enable_ip6_interface_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
uword os_get_cpu_number(void)
#define DEF_MAX_RADV_INTERVAL
#define IP6_MLDP_ALERT_TYPE
u32 limit_neighbor_cache_size
#define pool_put(P, E)
Free an object E in pool P.
#define foreach_log_level
enum icmp6_neighbor_discovery_option_type icmp6_neighbor_discovery_option_type_t
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, u8 shg)
int ip6_address_compare(ip6_address_t *a1, ip6_address_t *a2)
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
mhash_t address_to_prefix_index
static void vlib_buffer_reset(vlib_buffer_t *b)
Reset current header & length to state they were in when packet was received.
#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 mhash_set(mhash_t *h, void *key, uword new_value, uword *old_value)
#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).
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
ip6_add_del_interface_address_callback_t * add_del_interface_address_callbacks
vlib_error_t error
Error code for buffers to be enqueued to error handler.
void ip6_link_local_address_from_ethernet_mac_address(ip6_address_t *ip, u8 *mac)
vlib_node_registration_t ip6_icmp_input_node
(constructor) VLIB_REGISTER_NODE (ip6_icmp_input_node)
ip6_mldp_group_t * mldp_group_pool
static_always_inline uword icmp6_neighbor_solicitation_or_advertisement(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, uword is_solicitation)
clib_error_t * enable_ip6_interface(vlib_main_t *vm, u32 sw_if_index)
icmp6_neighbor_solicitation_or_advertisement_next_t
static uword icmp6_neighbor_advertisement(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u32 n_solicitations_dropped
void mhash_init(mhash_t *h, uword n_value_bytes, uword n_key_bytes)
static void set_unset_ip6_neighbor_rpc(vlib_main_t *vm, u32 sw_if_index, ip6_address_t *a, u8 *link_layer_addreess, int is_add, int is_static)
static ip6_address_t ip6a_zero
#define IP6_NEIGHBOR_FLAG_STATIC
void fib_table_entry_delete_index(fib_node_index_t fib_entry_index, fib_source_t source)
Delete a FIB entry.
ip6_address_t mcast_address
#define vec_free(V)
Free vector's memory (no header).
struct ip_adjacency_t_::@175::@176 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
ip6_address_t * mcast_source_address_pool
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
#define clib_memcpy(a, b, c)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
#define DEF_CURR_HOP_LIMIT
int adv_link_layer_address
u32 fib_node_index_t
A typedef of a node index.
static vlib_cli_command_t show_ip6_neighbors_command
(constructor) VLIB_CLI_COMMAND (show_ip6_neighbors_command)
fib_node_index_t fib_entry_index
u32 adj_index_t
An index for adjacencies.
#define ELOG_TYPE_DECLARE(f)
This packet matches an "incomplete adjacency" and packets need to be passed to ARP to find rewrite st...
void md5_add(md5_context_t *c, void *data, int data_bytes)
u64 cpu_time_last_updated
static void * ip6_next_header(ip6_header_t *i)
#define VLIB_CLI_COMMAND(x,...)
adj_index_t all_mldv2_routers_adj_index
#define VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX
u32 initial_adverts_count
u32 * if_address_pool_index_by_sw_if_index
Head of doubly linked list of interface addresses for each software interface.
u16 ip6_tcp_udp_icmp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip6_header_t *ip0, int *bogus_lengthp)
ip6_add_del_interface_address_function_t * function
f64 valid_lifetime_expires
#define MAX_INITIAL_RTR_ADVERTISEMENTS
ip6_address_t link_local_address
#define VNET_SW_INTERFACE_FLAG_ADMIN_UP
u32 max_l3_packet_bytes[VLIB_N_RX_TX]
uword unformat_ethernet_address(unformat_input_t *input, va_list *args)
u32 neighbor_delete_rotor
static uword * mhash_get(mhash_t *h, const void *key)
ip6_address_t ip6_address
ip_lookup_main_t lookup_main
u32 n_advertisements_sent
static clib_error_t * show_ip6_interface_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
f64 min_delay_between_radv
#define DEF_MIN_RADV_INTERVAL
static_always_inline uword icmp6_router_solicitation(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static int ip6_neighbor_sort(void *a1, void *a2)
u32 vlib_buffer_add_data(vlib_main_t *vm, u32 free_list_index, u32 buffer_index, void *data, u32 n_data_bytes)
u32 * if_radv_pool_index_by_sw_if_index
u16 adv_router_lifetime_in_sec
#define VLIB_NODE_FLAG_TRACE
int deprecated_prefix_flag
Route added as a result of interface configuration.
mhash_t pending_resolutions_by_address
static uword icmp6_neighbor_solicitation(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static adj_walk_rc_t ip6_nd_mk_incomplete_walk(adj_index_t ai, void *ctx)
#define VLIB_BUFFER_IS_TRACED
static uword vnet_sw_interface_is_admin_up(vnet_main_t *vnm, u32 sw_if_index)
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
int vnet_set_ip6_ethernet_neighbor(vlib_main_t *vm, u32 sw_if_index, ip6_address_t *a, u8 *link_layer_address, uword n_bytes_link_layer_address, int is_static)
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
void ethernet_ndp_change_mac(u32 sw_if_index)
fib_entry_flag_t fib_entry_get_flags_for_source(fib_node_index_t fib_entry_index, fib_source_t source)
static vlib_node_registration_t ip6_icmp_router_solicitation_node
(constructor) VLIB_REGISTER_NODE (ip6_icmp_router_solicitation_node)
void vlib_trace_frame_buffers_only(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, uword n_buffers, uword next_buffer_stride, uword n_buffer_data_bytes_in_trace)
clib_error_t * set_ip6_link_local_address_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static void ip6_neighbor_send_mldpv2_report(u32 sw_if_index)
vlib_node_registration_t ip6_icmp_neighbor_discovery_event_node
static void * vlib_process_get_event_data(vlib_main_t *vm, uword *return_event_type_opaque)
static void ip6_neighbor_set_unset_rpc_callback(ip6_neighbor_set_unset_rpc_args_t *a)
ethernet_interface_t * ethernet_get_interface(ethernet_main_t *em, u32 hw_if_index)
static void ip6_set_solicited_node_multicast_address(ip6_address_t *a, u32 id)
#define FIB_NODE_INDEX_INVALID
static uword ip6_address_is_link_local_unicast(ip6_address_t *a)
u32 elog_string(elog_main_t *em, char *fmt,...)
void icmp6_register_type(vlib_main_t *vm, icmp6_type_t type, u32 node_index)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
ip_lookup_next_t lookup_next_index
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
int ip6_neighbor_ra_config(vlib_main_t *vm, u32 sw_if_index, u8 suppress, u8 managed, u8 other, u8 ll_option, u8 send_unicast, u8 cease, u8 use_lifetime, u32 lifetime, u32 initial_count, u32 initial_interval, u32 max_interval, u32 min_interval, u8 is_no)
static void ip6_neighbor_add_del_interface_address(ip6_main_t *im, uword opaque, u32 sw_if_index, ip6_address_t *address, u32 address_length, u32 if_address_index, u32 is_delete)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
u8 * ethernet_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
build a rewrite string to use for sending packets of type 'link_type' to 'dst_address' ...
l2_bridge_domain_t * bd_configs
#define ICMP6_ROUTER_DISCOVERY_FLAG_ADDRESS_CONFIG_VIA_DHCP
int decrement_lifetime_flag
clib_error_t * set_ip6_link_local_address(vlib_main_t *vm, u32 sw_if_index, ip6_address_t *address, u8 address_length)
#define hash_get_mem(h, key)
static u32 ip6_neighbor_sw_interface_add_del(vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
static vlib_node_registration_t ip6_icmp_neighbor_advertisement_node
(constructor) VLIB_REGISTER_NODE (ip6_icmp_neighbor_advertisement_node)
void * vlib_packet_template_get_packet(vlib_main_t *vm, vlib_packet_template_t *t, u32 *bi_result)
static clib_error_t * ip6_neighbor_sw_interface_up_down(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
f64 initial_adverts_interval
static u32 random_u32(u32 *seed)
32-bit random number generator
#define VLIB_REGISTER_NODE(x,...)
vnet_sw_interface_type_t type
This packet is to be rewritten and forwarded to the next processing node.
#define vec_foreach(var, vec)
Vector iterator.
static uword ip6_address_is_unspecified(ip6_address_t *a)
void ip6_ethernet_update_adjacency(vnet_main_t *vnm, u32 sw_if_index, u32 ai)
u32 adv_valid_lifetime_in_secs
clib_error_t * ip6_add_del_interface_address(vlib_main_t *vm, u32 sw_if_index, ip6_address_t *address, u32 address_length, u32 is_del)
#define clib_error_return(e, args...)
static void * ip_interface_address_get_address(ip_lookup_main_t *lm, ip_interface_address_t *a)
static ip6_neighbor_t * ip6_nd_find(u32 sw_if_index, const ip6_address_t *addr)
mhash_t mac_changes_by_address
static void ip6_link_local_address_from_ethernet_address(ip6_address_t *a, u8 *ethernet_address)
static adj_walk_rc_t ip6_nd_mk_complete_walk(adj_index_t ai, void *ctx)
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
#define MAX_INITIAL_RTR_ADVERT_INTERVAL
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
clib_error_t * ip6_neighbor_cmd(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
f64 max_rtr_default_lifetime
static vlib_node_registration_t ip6_icmp_router_advertisement_node
(constructor) VLIB_REGISTER_NODE (ip6_icmp_router_advertisement_node)
ip6_neighbor_t * neighbor_pool
void adj_nbr_update_rewrite(adj_index_t adj_index, adj_nbr_rewrite_flag_t flags, u8 *rewrite)
adj_nbr_update_rewrite
u32 * fib_index_by_sw_if_index
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static_always_inline uword icmp6_router_advertisement(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define MAX_DEF_RTR_LIFETIME
static ip6_neighbor_main_t ip6_neighbor_main
pending_resolution_t * mac_changes
int ip6_interface_enabled(vlib_main_t *vm, u32 sw_if_index)
static void ip6_set_reserved_multicast_address(ip6_address_t *a, ip6_multicast_address_scope_t scope, u16 id)
static ip_adjacency_t * ip_get_adjacency(ip_lookup_main_t *lm, u32 adj_index)
u32 next_this_sw_interface
clib_error_t * ip6_set_neighbor_limit(u32 neighbor_limit)
format_function_t format_icmp6_input_trace
void adj_nbr_walk_nh6(u32 sw_if_index, const ip6_address_t *addr, adj_walk_cb_t cb, void *ctx)
Walk adjacencies on a link with a given v6 next-hop.
static uword pool_elts(void *v)
Number of active elements in a pool.