34 #define ETHER_MAC_ADDR_LEN 6 38 u8 link_layer_address[8];
40 #define IP6_NEIGHBOR_FLAG_STATIC (1 << 0) 41 #define IP6_NEIGHBOR_FLAG_GLEAN (2 << 0) 65 #define MIN_ADV_VALID_LIFETIME 7203 66 #define DEF_ADV_VALID_LIFETIME 2592000 67 #define DEF_ADV_PREF_LIFETIME 604800 96 u8 link_layer_address[8];
129 #define DEF_MAX_RADV_INTERVAL 200 130 #define DEF_MIN_RADV_INTERVAL .75 * DEF_MAX_RADV_INTERVAL 131 #define DEF_CURR_HOP_LIMIT 64 132 #define DEF_DEF_RTR_LIFETIME 3 * DEF_MAX_RADV_INTERVAL 133 #define MAX_DEF_RTR_LIFETIME 9000 135 #define MAX_INITIAL_RTR_ADVERT_INTERVAL 16 136 #define MAX_INITIAL_RTR_ADVERTISEMENTS 3 137 #define MIN_DELAY_BETWEEN_RAS 3 138 #define MAX_DELAY_BETWEEN_RAS 1800 139 #define MAX_RA_DELAY_TIME .5 210 return format (s,
"%=12s%=20s%=6s%=20s%=40s",
"Time",
"Address",
"Flags",
"Link layer",
"Interface");
213 flags =
format(flags,
"G");
216 flags =
format(flags,
"S");
219 s =
format (s,
"%=12U%=20U%=6s%=20U%=40U",
222 flags ? (
char *)flags :
"",
240 u32 i, * to_delete = 0;
243 if (n->key.sw_if_index == sw_if_index)
244 vec_add1 (to_delete, n - nm->neighbor_pool);
247 for (i = 0; i <
vec_len (to_delete); i++)
295 u8 link_layer_address[6];
301 static void ip6_neighbor_set_unset_rpc_callback
304 static void set_unset_ip6_neighbor_rpc
308 u8 *link_layer_addreess,
309 int is_add,
int is_static)
321 (
u8 *) &args,
sizeof (args));
329 u8 * link_layer_address,
330 uword n_bytes_link_layer_address,
339 int make_new_nd_cache_entry=1;
349 set_unset_ip6_neighbor_rpc (vm, sw_if_index, a, link_layer_address,
368 make_new_nd_cache_entry = 0;
375 memset (&adj, 0,
sizeof(adj));
381 VNET_L3_PACKET_TYPE_IP6,
386 sizeof (adj.rewrite_data));
393 existing_adj->
arp.next_hop.ip6.as_u64[0] == a->
as_u64[0] &&
394 existing_adj->
arp.next_hop.ip6.as_u64[1] == a->
as_u64[1])
403 for (i = 0; i < uadj->
n_adj; i++)
406 uadj[i].
arp.next_hop.ip6.as_u64[1] == a->
as_u64[1])
424 if (make_new_nd_cache_entry) {
444 while (next_index != (
u32)~0)
465 u8 * link_layer_address,
466 uword n_bytes_link_layer_address)
479 set_unset_ip6_neighbor_rpc (vm, sw_if_index, a, link_layer_address,
536 if (adj->
arp.next_hop.ip6.as_u64[0] ||
537 adj->
arp.next_hop.ip6.as_u64[1])
552 memset(&args, 0,
sizeof(args));
553 memcpy(&add_adj, adj,
sizeof(add_adj));
554 add_adj.
arp.next_hop.ip6 = *next_hop;
567 static void ip6_neighbor_set_unset_rpc_callback
587 n2->key.sw_if_index);
623 .path =
"show ip6 neighbors",
625 .short_help =
"Show ip6 neighbors",
652 else if (
unformat (input,
"static"))
663 mac_address,
sizeof(mac_address), is_static);
666 mac_address,
sizeof(mac_address));
671 .path =
"set ip6 neighbor",
673 .short_help =
"set ip6 neighbor [del] <intfc> <ip6-address> <mac-address> [static]",
686 uword is_solicitation)
692 u32 * from, * to_next;
693 u32 n_left_from, n_left_to_next, next_index, n_advertisements_sent;
699 n_left_from = n_packets;
709 ? ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address
710 : ICMP6_NEIGHBOR_DISCOVERY_OPTION_target_link_layer_address);
711 n_advertisements_sent = 0;
713 while (n_left_from > 0)
717 while (n_left_from > 0 && n_left_to_next > 0)
721 icmp6_neighbor_solicitation_or_advertisement_header_t * h0;
722 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t * o0;
723 u32 bi0, options_len0, sw_if_index0, next0, error0;
724 u32 ip6_sadd_link_local, ip6_sadd_unspecified;
728 bi0 = to_next[0] = from[0];
738 options_len0 = clib_net_to_host_u16 (ip0->
payload_length) -
sizeof (h0[0]);
740 error0 = ICMP6_ERROR_NONE;
746 if (!ip6_sadd_unspecified && !ip6_sadd_link_local)
756 error0 = ((adj0->rewrite_header.sw_if_index != sw_if_index0
758 ? ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_NOT_ON_LINK
762 o0 = (
void *) (h0 + 1);
763 o0 = ((options_len0 == 8 && o0->header.type == option_type
764 && o0->header.n_data_u64s == 1) ? o0 : 0);
767 if (
PREDICT_TRUE (error0 == ICMP6_ERROR_NONE && o0 != 0 &&
768 !ip6_sadd_unspecified && !ip6_sadd_link_local))
776 is_solicitation ? &ip0->
src_address : &h0->target_address,
777 o0->ethernet_address, sizeof (o0->ethernet_address), 0);
780 if (is_solicitation && error0 == ICMP6_ERROR_NONE)
784 ip6_address_fib_t ip6_af0;
796 ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_UNKNOWN : error0;
800 next0 = (error0 != ICMP6_ERROR_NONE
806 error0 = error0 == ICMP6_ERROR_NONE ?
807 ICMP6_ERROR_NEIGHBOR_ADVERTISEMENTS_RX : error0;
810 if (is_solicitation && error0 == ICMP6_ERROR_NONE)
817 if(!ip6_sadd_unspecified)
821 IP6_MULTICAST_SCOPE_link_local,
822 IP6_MULTICAST_GROUP_ID_all_hosts);
826 h0->icmp.type = ICMP6_neighbor_advertisement;
835 ICMP6_NEIGHBOR_DISCOVERY_OPTION_target_link_layer_address;
838 h0->advertisement_flags = clib_host_to_net_u32
842 h0->icmp.checksum = 0;
846 ASSERT(bogus_length == 0);
861 n_advertisements_sent++;
867 to_next, n_left_to_next,
881 #define foreach_log_level \ 883 _ (INFO, "INFORMATION") \ 884 _ (NOTICE, "NOTICE") \ 885 _ (WARNING, "WARNING") \ 887 _ (CRIT, "CRITICAL") \ 889 _ (EMERG, "EMERGENCY") 892 #define _(f,s) LOG_##f, 912 if( (priority > LOG_EMERG) ||
913 !(logmask & (1 << priority)))
922 .format =
"ip6 nd: (%s): %s",
923 .format_args =
"T4T4",
925 struct {
u32 s[2]; } * ed;
951 u32 * from, * to_next;
952 u32 n_left_from, n_left_to_next, next_index;
953 u32 n_advertisements_sent = 0;
961 n_left_from = n_packets;
970 option_type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
972 while (n_left_from > 0)
976 while (n_left_from > 0 && n_left_to_next > 0)
982 icmp6_neighbor_discovery_header_t * h0;
983 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t * o0;
985 u32 bi0, options_len0, sw_if_index0, next0, error0;
986 u32 is_solicitation = 1, is_dropped = 0;
987 u32 is_unspecified, is_link_local;
989 bi0 = to_next[0] = from[0];
999 options_len0 = clib_net_to_host_u16 (ip0->
payload_length) -
sizeof (h0[0]);
1003 error0 = ICMP6_ERROR_NONE;
1008 is_solicitation = 0;
1011 if (!is_unspecified && !is_link_local)
1016 error0 = ((adj0->rewrite_header.sw_if_index != sw_if_index0
1019 ? ICMP6_ERROR_ROUTER_SOLICITATION_SOURCE_NOT_ON_LINK
1024 o0 = (
void *) (h0 + 1);
1025 o0 = ((options_len0 == 8
1026 && o0->header.type == option_type
1027 && o0->header.n_data_u64s == 1)
1032 if (
PREDICT_TRUE (error0 == ICMP6_ERROR_NONE && o0 != 0 &&
1033 !is_unspecified && !is_link_local)) {
1041 o0->ethernet_address,
1042 sizeof (o0->ethernet_address), 0);
1048 if (error0 == ICMP6_ERROR_NONE)
1059 error0 = (!eth_if0) ? ICMP6_ERROR_ROUTER_SOLICITATION_UNSUPPORTED_INTF : error0;
1061 if (error0 == ICMP6_ERROR_NONE)
1066 p0->
current_length -= (options_len0 +
sizeof(icmp6_neighbor_discovery_header_t));
1076 error0 = ((!radv_info) ? ICMP6_ERROR_ROUTER_SOLICITATION_RADV_NOT_CONFIG : error0);
1078 if (error0 == ICMP6_ERROR_NONE)
1092 icmp6_router_advertisement_header_t rh;
1094 rh.icmp.type = ICMP6_router_advertisement;
1096 rh.icmp.checksum = 0;
1100 rh.time_in_msec_between_retransmitted_neighbor_solicitations =
1102 rh.neighbor_reachable_time_in_msec =
1109 u16 payload_length =
sizeof(icmp6_router_advertisement_header_t);
1114 (
void *)&rh,
sizeof(icmp6_router_advertisement_header_t));
1118 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t h;
1120 h.header.type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
1121 h.header.n_data_u64s = 1;
1129 (
void *)&h,
sizeof(icmp6_neighbor_discovery_ethernet_link_layer_address_option_t));
1131 payload_length +=
sizeof(icmp6_neighbor_discovery_ethernet_link_layer_address_option_t);
1137 icmp6_neighbor_discovery_mtu_option_t h;
1141 h.header.type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_mtu;
1142 h.header.n_data_u64s = 1;
1144 payload_length +=
sizeof( icmp6_neighbor_discovery_mtu_option_t);
1149 (
void *)&h,
sizeof(icmp6_neighbor_discovery_mtu_option_t));
1157 if(pr_info->enabled &&
1158 (!pr_info->decrement_lifetime_flag || (pr_info->pref_lifetime_expires >0)))
1161 icmp6_neighbor_discovery_prefix_information_option_t h;
1163 h.header.type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_prefix_information;
1164 h.header.n_data_u64s = (sizeof(icmp6_neighbor_discovery_prefix_information_option_t) >> 3);
1166 h.dst_address_length = pr_info->prefix_len;
1168 h.flags = (pr_info->adv_on_link_flag) ? ICMP6_NEIGHBOR_DISCOVERY_PREFIX_INFORMATION_FLAG_ON_LINK : 0;
1169 h.flags |= (pr_info->adv_autonomous_flag) ? ICMP6_NEIGHBOR_DISCOVERY_PREFIX_INFORMATION_AUTO : 0;
1171 if(radv_info->cease_radv && pr_info->deprecated_prefix_flag)
1173 h.valid_time = clib_host_to_net_u32(MIN_ADV_VALID_LIFETIME);
1174 h.preferred_time = 0;
1178 if(pr_info->decrement_lifetime_flag)
1180 pr_info->adv_valid_lifetime_in_secs = ((pr_info->valid_lifetime_expires > now)) ?
1181 (pr_info->valid_lifetime_expires - now) : 0;
1183 pr_info->adv_pref_lifetime_in_secs = ((pr_info->pref_lifetime_expires > now)) ?
1184 (pr_info->pref_lifetime_expires - now) : 0;
1187 h.valid_time = clib_host_to_net_u32(pr_info->adv_valid_lifetime_in_secs);
1188 h.preferred_time = clib_host_to_net_u32(pr_info->adv_pref_lifetime_in_secs) ;
1192 clib_memcpy(&h.dst_address, &pr_info->prefix, sizeof(ip6_address_t));
1194 payload_length += sizeof( icmp6_neighbor_discovery_prefix_information_option_t);
1196 vlib_buffer_add_data (vm,
1197 p0->free_list_index,
1199 (void *)&h, sizeof(icmp6_neighbor_discovery_prefix_information_option_t));
1215 IP6_MULTICAST_SCOPE_link_local,
1216 IP6_MULTICAST_GROUP_ID_all_hosts);
1225 icmp6_router_advertisement_header_t * rh0 = (icmp6_router_advertisement_header_t *)(ip0 + 1);
1226 rh0->icmp.checksum =
1229 ASSERT(bogus_length == 0);
1235 if (is_solicitation)
1244 next0 = is_dropped ?
1251 if (adj_index0 == 0)
1252 error0 = ICMP6_ERROR_DST_LOOKUP_MISS;
1257 ((adj0->rewrite_header.sw_if_index != sw_if_index0
1259 ? ICMP6_ERROR_ROUTER_SOLICITATION_DEST_UNKNOWN
1261 next0 = is_dropped ?
1270 if((error0 == ICMP6_ERROR_NONE) && !is_dropped)
1273 n_advertisements_sent++;
1279 p0->error = error_node->
errors[error0];
1281 if(error0 != ICMP6_ERROR_NONE)
1285 to_next, n_left_to_next,
1294 vlib_error_count (vm, error_node->node_index, ICMP6_ERROR_ROUTER_ADVERTISEMENTS_TX, n_advertisements_sent);
1296 return frame->n_vectors;
1308 u32 * from, * to_next;
1309 u32 n_left_from, n_left_to_next, next_index;
1310 u32 n_advertisements_rcvd = 0;
1315 n_left_from = n_packets;
1323 while (n_left_from > 0)
1327 while (n_left_from > 0 && n_left_to_next > 0)
1332 icmp6_router_advertisement_header_t * h0;
1333 u32 bi0, options_len0, sw_if_index0, next0, error0;
1335 bi0 = to_next[0] = from[0];
1340 n_left_to_next -= 1;
1345 options_len0 = clib_net_to_host_u16 (ip0->
payload_length) -
sizeof (h0[0]);
1347 error0 = ICMP6_ERROR_NONE;
1352 ICMP6_ERROR_ROUTER_ADVERTISEMENT_SOURCE_NOT_LINK_LOCAL : error0;
1357 n_advertisements_rcvd++;
1359 if (error0 == ICMP6_ERROR_NONE)
1369 error0 = (!eth_if0) ? ICMP6_ERROR_ROUTER_SOLICITATION_UNSUPPORTED_INTF : error0;
1371 if (error0 == ICMP6_ERROR_NONE)
1383 error0 = ((!radv_info) ? ICMP6_ERROR_ROUTER_SOLICITATION_RADV_NOT_CONFIG : error0);
1385 if (error0 == ICMP6_ERROR_NONE)
1392 "our AdvCurHopLimit on %U doesn't agree with %U",
1400 "our AdvManagedFlag on %U doesn't agree with %U",
1408 "our AdvOtherConfigFlag on %U doesn't agree with %U",
1412 if((h0->time_in_msec_between_retransmitted_neighbor_solicitations &&
1414 (h0->time_in_msec_between_retransmitted_neighbor_solicitations !=
1418 "our AdvRetransTimer on %U doesn't agree with %U",
1422 if((h0->neighbor_reachable_time_in_msec &&
1424 (h0->neighbor_reachable_time_in_msec !=
1428 "our AdvReachableTime on %U doesn't agree with %U",
1433 u8 * opt_hdr = (
u8 *)(h0 + 1);
1434 while( options_len0 > 0)
1436 icmp6_neighbor_discovery_option_header_t *o0 = ( icmp6_neighbor_discovery_option_header_t *)opt_hdr;
1437 int opt_len = o0->n_data_u64s << 3;
1440 if(options_len0 < 2)
1443 "malformed RA packet on %U from %U",
1451 " zero length option in RA on %U from %U",
1455 else if( opt_len > options_len0)
1458 "option length in RA packet greater than total length on %U from %U",
1463 options_len0 -= opt_len;
1468 case ICMP6_NEIGHBOR_DISCOVERY_OPTION_mtu:
1470 icmp6_neighbor_discovery_mtu_option_t *h =
1471 (icmp6_neighbor_discovery_mtu_option_t *)(o0);
1473 if(opt_len <
sizeof(*h))
1477 (h->mtu != clib_host_to_net_u32(radv_info->
adv_link_mtu)))
1480 "our AdvLinkMTU on %U doesn't agree with %U",
1486 case ICMP6_NEIGHBOR_DISCOVERY_OPTION_prefix_information:
1488 icmp6_neighbor_discovery_prefix_information_option_t *h =
1489 (icmp6_neighbor_discovery_prefix_information_option_t *)(o0);
1493 u32 preferred, valid;
1495 if(opt_len <
sizeof(*h))
1498 preferred = clib_net_to_host_u32(h->preferred_time);
1499 valid = clib_net_to_host_u32(h->valid_time);
1505 ip6_address_mask_from_width(&mask, pr_info->prefix_len);
1507 if(pr_info->enabled &&
1508 (pr_info->prefix_len == h->dst_address_length) &&
1509 ip6_address_is_equal_masked (&pr_info->prefix, &h->dst_address, &mask))
1512 if(!pr_info->decrement_lifetime_flag &&
1513 valid != pr_info->adv_valid_lifetime_in_secs)
1515 ip6_neighbor_syslog(vm, LOG_WARNING,
1516 "our ADV validlifetime on %U for %U does not agree with %U",
1517 format_vnet_sw_if_index_name, vnm, sw_if_index0,format_ip6_address, &pr_info->prefix,
1518 format_ip6_address, &h->dst_address);
1520 if(!pr_info->decrement_lifetime_flag &&
1521 preferred != pr_info->adv_pref_lifetime_in_secs)
1523 ip6_neighbor_syslog(vm, LOG_WARNING,
1524 "our ADV preferredlifetime on %U for %U does not agree with %U",
1525 format_vnet_sw_if_index_name, vnm, sw_if_index0,format_ip6_address, &pr_info->prefix,
1526 format_ip6_address, &h->dst_address);
1542 p0->error = error_node->
errors[error0];
1544 if(error0 != ICMP6_ERROR_NONE)
1548 to_next, n_left_to_next,
1556 vlib_error_count (vm, error_node->node_index, ICMP6_ERROR_ROUTER_ADVERTISEMENTS_RX, n_advertisements_rcvd);
1558 return frame->n_vectors;
1592 u32 i, * to_delete = 0;
1603 vec_add1 (to_delete, p - a->adv_prefixes_pool);
1606 for (i = 0; i <
vec_len (to_delete); i++)
1618 vec_add1 (to_delete, m - a->mldp_group_pool);
1621 for (i = 0; i <
vec_len (to_delete); i++)
1649 memset (a, 0,
sizeof (a[0]));
1690 u8 link_layer_address[6] =
1691 {0x33, 0x33, 0x00, 0x00, 0x00, IP6_MULTICAST_GROUP_ID_all_hosts};
1701 VNET_L3_PACKET_TYPE_IP6,
1705 &adj->rewrite_header,
1706 sizeof (adj->rewrite_data));
1711 u8 link_layer_address[6] =
1712 {0x33, 0x33, 0x00, 0x00, 0x00, IP6_MULTICAST_GROUP_ID_all_routers};
1722 VNET_L3_PACKET_TYPE_IP6,
1726 &adj->rewrite_header,
1727 sizeof (adj->rewrite_data));
1732 u8 link_layer_address[6] =
1733 {0x33, 0x33, 0x00, 0x00, 0x00, IP6_MULTICAST_GROUP_ID_mldv2_routers};
1743 VNET_L3_PACKET_TYPE_IP6,
1747 &adj->rewrite_header,
1748 sizeof (adj->rewrite_data));
1756 IP6_MULTICAST_SCOPE_link_local,
1757 IP6_MULTICAST_GROUP_ID_all_hosts);
1765 if(!mcast_group_info)
1774 mcast_group_info->
type = 4;
1781 IP6_MULTICAST_SCOPE_link_local,
1782 IP6_MULTICAST_GROUP_ID_all_routers);
1787 if(!mcast_group_info)
1796 mcast_group_info->
type = 4;
1803 IP6_MULTICAST_SCOPE_link_local,
1804 IP6_MULTICAST_GROUP_ID_mldv2_routers);
1809 if(!mcast_group_info)
1818 mcast_group_info->
type = 4;
1850 icmp6_multicast_listener_report_header_t *rh0;
1851 icmp6_multicast_listener_report_packet_t *rp0;
1882 b0->
current_length =
sizeof(icmp6_multicast_listener_report_packet_t);
1884 payload_length =
sizeof(icmp6_multicast_listener_report_header_t);
1886 b0->
error = ICMP6_ERROR_NONE;
1890 rh0 = (icmp6_multicast_listener_report_header_t *)&rp0-> report_hdr;
1892 memset (rp0 , 0x0,
sizeof (icmp6_multicast_listener_report_packet_t));
1896 ip0->
protocol = IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS;
1901 rh0->icmp.type = ICMP6_multicast_listener_report_v2;
1909 IP6_MULTICAST_SCOPE_link_local,
1910 IP6_MULTICAST_GROUP_ID_mldv2_routers);
1914 int num_addr_records = 0;
1915 icmp6_multicast_address_record_t rr;
1918 rh0->ext_hdr.next_hdr = IP_PROTOCOL_ICMP6;
1919 rh0->ext_hdr.n_data_u64s = 0;
1923 rh0->alert.value = 0;
1928 rh0->icmp.checksum = 0;
1933 rr.aux_data_len_u32s = 0;
1934 rr.num_sources = clib_host_to_net_u16 (m->num_sources);
1935 clib_memcpy(&rr.mcast_addr, &m->mcast_address, sizeof(ip6_address_t));
1939 vlib_buffer_add_data (vm,
1940 b0->free_list_index,
1942 (void *)&rr, sizeof(icmp6_multicast_address_record_t));
1944 payload_length += sizeof( icmp6_multicast_address_record_t);
1948 rh0->num_addr_records = clib_host_to_net_u16(num_addr_records);
1955 ASSERT(bogus_length == 0);
1980 .name =
"icmp6-router-solicitation",
1982 .vector_size =
sizeof (
u32),
2004 u32 n_this_frame = 0;
2005 u32 n_left_to_next = 0;
2008 icmp6_router_solicitation_header_t * h0;
2015 if( !vnet_sw_interface_is_admin_up (vnm, radv_info->sw_if_index))
2017 radv_info->initial_adverts_sent = radv_info->initial_adverts_count-1;
2018 radv_info->next_multicast_time = now;
2019 radv_info->last_multicast_time = now;
2020 radv_info->last_radv_time = 0;
2021 radv_info->all_routers_mcast = 0;
2029 ip6_neighbor_send_mldpv2_report(radv_info->sw_if_index);
2030 radv_info->all_routers_mcast = 1;
2039 f64 rfn = (radv_info->max_radv_interval - radv_info->min_radv_interval) *
2040 random_f64 (&radv_info->seed) + radv_info->min_radv_interval;
2043 if( radv_info->initial_adverts_sent > 0)
2045 radv_info->initial_adverts_sent--;
2046 if(rfn > radv_info-> initial_adverts_interval)
2047 rfn = radv_info-> initial_adverts_interval;
2050 if( radv_info->initial_adverts_sent == 0)
2051 if(radv_info->cease_radv)
2052 radv_info->send_radv = 0;
2070 b0->
current_length =
sizeof( icmp6_router_solicitation_header_t);
2071 b0->
error = ICMP6_ERROR_NONE;
2076 memset (h0, 0,
sizeof (icmp6_router_solicitation_header_t));
2078 h0->ip.ip_version_traffic_class_and_flow_label = clib_host_to_net_u32 (0x6 << 28);
2079 h0->ip.payload_length = clib_host_to_net_u16 (
sizeof (icmp6_router_solicitation_header_t)
2081 h0->ip.protocol = IP_PROTOCOL_ICMP6;
2082 h0->ip.hop_limit = 255;
2085 h0->ip.src_address.as_u64[0] = 0;
2086 h0->ip.src_address.as_u64[1] = 0;
2088 h0->ip.dst_address.as_u64[0] = 0;
2089 h0->ip.dst_address.as_u64[1] = 0;
2091 h0->neighbor.icmp.type = ICMP6_router_solicitation;
2118 f->n_vectors = n_this_frame;
2148 switch (event_type) {
2161 _vec_len (event_data) = 0;
2169 .name =
"icmp6-router-advertisement",
2171 .vector_size =
sizeof (
u32),
2184 .name =
"ip6-icmp-neighbor-discovery-event-process",
2202 .name =
"icmp6-neighbor-solicitation",
2204 .vector_size =
sizeof (
u32),
2217 .name =
"icmp6-neighbor-advertisement",
2219 .vector_size =
sizeof (
u32),
2232 u8 surpress,
u8 managed,
u8 other,
2233 u8 ll_option,
u8 send_unicast,
u8 cease,
2234 u8 use_lifetime,
u32 lifetime,
2235 u32 initial_count,
u32 initial_interval,
2236 u32 max_interval,
u32 min_interval,
2246 error = (ri != ~0) ? 0 : VNET_API_ERROR_INVALID_SW_IF_INDEX;
2254 if((max_interval != 0) && (min_interval ==0))
2255 min_interval = .75 * max_interval;
2266 if(lifetime <= max_interval)
2267 return VNET_API_ERROR_INVALID_VALUE;
2270 if(min_interval != 0)
2272 if((min_interval > .75 * max_interval) ||
2274 return VNET_API_ERROR_INVALID_VALUE;
2279 return VNET_API_ERROR_INVALID_VALUE;
2285 radv_info->
send_radv = (surpress != 0) ? ( (is_no != 0) ? 1 : 0 ) : radv_info->
send_radv;
2302 if((cease != 0) && (is_no))
2303 radv_info-> send_radv = 1;
2316 u8 use_default,
u32 val_lifetime,
u32 pref_lifetime,
2317 u8 no_advertise,
u8 off_link,
u8 no_autoconfig,
u8 no_onlink,
2330 error = (ri != ~0) ? 0 : VNET_API_ERROR_INVALID_SW_IF_INDEX;
2350 return VNET_API_ERROR_INVALID_VALUE;
2353 return VNET_API_ERROR_INVALID_VALUE_2;
2405 return VNET_API_ERROR_INVALID_VALUE_2;
2414 if((val_lifetime == ~0) || (pref_lifetime == ~0))
2427 prefix->
enabled = !(no_advertise != 0);
2452 u8 surpress = 0, managed = 0, other = 0;
2453 u8 surpress_ll_option = 0, send_unicast = 0, cease= 0;
2454 u8 use_lifetime = 0;
2455 u32 sw_if_index, ra_lifetime = 0, ra_initial_count = 0, ra_initial_interval = 0;
2456 u32 ra_max_interval = 0 , ra_min_interval = 0;
2461 int add_radv_info = 1;
2462 __attribute__((unused))
ip6_radv_t * radv_info = 0;
2520 else if(
unformat (line_input,
"prefix %U/%d",
2527 else if (
unformat (line_input,
"ra-managed-config-flag"))
2532 else if (
unformat (line_input,
"ra-other-config-flag"))
2537 else if (
unformat (line_input,
"ra-surpress"))
2542 else if (
unformat (line_input,
"ra-surpress-link-layer"))
2544 surpress_ll_option = 1;
2547 else if (
unformat (line_input,
"ra-send-unicast"))
2552 else if (
unformat (line_input,
"ra-lifetime"))
2554 if (!
unformat (line_input,
"%d", &ra_lifetime))
2559 else if (
unformat (line_input,
"ra-initial"))
2561 if (!
unformat (line_input,
"%d %d", &ra_initial_count, &ra_initial_interval))
2565 else if (
unformat (line_input,
"ra-interval"))
2567 if (!
unformat (line_input,
"%d", &ra_max_interval))
2570 if (!
unformat (line_input,
"%d", &ra_min_interval))
2571 ra_min_interval = 0;
2574 else if(
unformat (line_input,
"ra-cease"))
2586 surpress, managed, other,
2587 surpress_ll_option, send_unicast, cease,
2588 use_lifetime, ra_lifetime,
2589 ra_initial_count, ra_initial_interval,
2590 ra_max_interval, ra_min_interval,
2595 u32 valid_lifetime_in_secs = 0;
2596 u32 pref_lifetime_in_secs = 0;
2597 u8 use_prefix_default_values = 0;
2598 u8 no_advertise = 0;
2600 u8 no_autoconfig = 0;
2606 if(
unformat (line_input,
"default"))
2608 use_prefix_default_values = 1;
2611 else if(
unformat (line_input,
"infinite"))
2613 valid_lifetime_in_secs = ~0;
2614 pref_lifetime_in_secs = ~0;
2617 else if(
unformat (line_input,
"%d %d", &valid_lifetime_in_secs,
2618 &pref_lifetime_in_secs))
2626 while (!use_prefix_default_values &&
2629 if(
unformat (line_input,
"no-advertise"))
2631 else if(
unformat (line_input,
"off-link"))
2633 else if(
unformat (line_input,
"no-autoconfig"))
2635 else if(
unformat (line_input,
"no-onlink"))
2642 &ip6_addr, addr_len,
2643 use_prefix_default_values,
2644 valid_lifetime_in_secs,
2645 pref_lifetime_in_secs,
2692 u32 *global_scope = 0,
i;
2698 while (ai != (
u32)~0)
2707 if((address->
as_u8[0] & 0xe0) == 0x20)
2733 vlib_cli_output (vm,
"\t\t%U\n", format_ip6_address, &m->mcast_address);
2739 vlib_cli_output (vm,
"\t\tprefix %U, length %d\n",
2740 format_ip6_address, &p->prefix, p->prefix_len);
2751 vlib_cli_output (vm,
"\tND advertised retransmit interval is %d (msec)\n",
2756 vlib_cli_output (vm,
"\tND router advertisements are sent every %d seconds (min interval is %d)\n",
2757 ra_interval, ra_interval_min);
2758 vlib_cli_output (vm,
"\tND router advertisements live for %d seconds\n",
2760 vlib_cli_output (vm,
"\tHosts %s stateless autoconfig for addresses\n",
2777 .path =
"show ip6 interface",
2779 .short_help =
"Show ip6 interface <iface name>",
2883 md5_add (&m, &link_local_address, 16);
2890 link_local_address.
as_u64[0] = clib_host_to_net_u64 (0xFE80000000000000ULL);
2892 link_local_address.
as_u8[8] &= 0xfd;
2897 &link_local_address, 64 ,
2940 .path =
"enable ip6 interface",
2942 .short_help =
"enable ip6 interface <iface name>",
2971 .path =
"disable ip6 interface",
2973 .short_help =
"disable ip6 interface <iface name>",
2978 .short_help =
"Set ip6 neighbor discovery parameters",
2996 vnm->
api_errno = VNET_API_ERROR_ADDRESS_NOT_LINK_LOCAL;
3035 vnm->
api_errno = VNET_API_ERROR_IP6_NOT_ENABLED;
3075 .path =
"set ip6 link-local address",
3076 .short_help =
"Set ip6 interface link-local address <intfc> <address.>",
3087 u32 if_address_index,
3127 if(!mcast_group_info)
3136 mcast_group_info->
type = 4;
3159 if(mcast_group_info)
3227 (adj->
arp.next_hop.ip6.as_u64[0] || adj->
arp.next_hop.ip6.as_u64[1]))
3243 clib_warning(
"Adjacency contains unknown ND next hop %U (del)",
3251 clib_warning(
"Adjacency contains unknown ND next hop %U (add)",
3296 (im->discover_neighbor_next_index_by_hw_if_index, 32, 0 );
#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)
ip6_radv_t * if_radv_pool
#define MIN_DELAY_BETWEEN_RAS
#define DEF_DEF_RTR_LIFETIME
#define pool_next_index(P, I)
always_inline void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
always_inline void ip6_address_mask_from_width(ip6_address_t *a, u32 width)
#define IP6_ROUTE_FLAG_NEIGHBOR
#define vec_foreach_index(var, v)
Iterate over vector indices.
void md5_finish(md5_context_t *c, u8 *digest)
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
void * clib_per_cpu_mheaps[CLIB_MAX_MHEAPS]
#define ICMP6_ROUTER_DISCOVERY_FLAG_OTHER_CONFIG_VIA_DHCP
int ip6_neighbor_ra_config(vlib_main_t *vm, u32 sw_if_index, u8 surpress, 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)
vlib_node_registration_t ip6_icmp_neighbor_solicitation_node
(constructor) VLIB_REGISTER_NODE (ip6_icmp_neighbor_solicitation_node)
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)
static clib_error_t * ip6_neighbor_init(vlib_main_t *vm)
static void(BVT(clib_bihash)*h, BVT(clib_bihash_value)*v)
ip_interface_address_t * if_address_pool
static char * log_level_strings[]
always_inline uword ip6_address_is_unspecified(ip6_address_t *a)
mhash_t neighbor_index_by_key
u32 free_list_index
Buffer free list that this buffer was allocated from and will be freed to.
ip_lookup_next_t lookup_next_index
always_inline void ip6_set_reserved_multicast_address(ip6_address_t *a, ip6_multicast_address_scope_t scope, u16 id)
void md5_init(md5_context_t *c)
uword mhash_unset(mhash_t *h, void *key, uword *old_value)
ip6_radv_prefix_t * adv_prefixes_pool
static void ip6_neighbor_entry_add_adj(ip6_neighbor_t *n, u32 adj_index)
always_inline uword ip6_address_is_link_local_unicast(ip6_address_t *a)
#define ethernet_buffer_header_size(b)
Determine the size of the Ethernet headers of the current frame in the buffer.
pending_resolution_t * pending_resolutions
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)
vlib_node_registration_t ip6_rewrite_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_node)
ip_adjacency_t * ip_add_adjacency(ip_lookup_main_t *lm, ip_adjacency_t *copy_adj, u32 n_adj, u32 *adj_index_return)
always_inline uword mhash_set(mhash_t *h, void *key, uword new_value, uword *old_value)
struct _vlib_node_registration vlib_node_registration_t
always_inline void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
#define STRUCT_OFFSET_OF(t, f)
always_inline void * ip6_next_header(ip6_header_t *i)
u32 adv_pref_lifetime_in_secs
#define DEF_ADV_PREF_LIFETIME
format_function_t format_vlib_cpu_time
unformat_function_t unformat_vnet_sw_interface
u32 adv_neighbor_reachable_time_in_msec
format_function_t format_vnet_sw_if_index_name
always_inline void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
always_inline vlib_main_t * vlib_get_main(void)
clib_error_t * disable_ip6_interface(vlib_main_t *vm, u32 sw_if_index)
always_inline void * ip_interface_address_get_address(ip_lookup_main_t *lm, ip_interface_address_t *a)
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)
ethernet_main_t ethernet_main
vnet_main_t * vnet_get_main(void)
#define static_always_inline
u8 * format_ethernet_address(u8 *s, va_list *args)
#define pool_foreach(VAR, POOL, BODY)
#define VLIB_INIT_FUNCTION(x)
u32 local_interface_sw_if_index
VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION(ip6_neighbor_sw_interface_up_down)
#define ICMP6_NEIGHBOR_ADVERTISEMENT_FLAG_OVERRIDE
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)
u32 vnet_ip6_neighbor_glean_add(u32 fib_index, void *next_hop_arg)
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 IP6_NEIGHBOR_FLAG_STATIC
always_inline uword pool_elts(void *v)
void vl_api_rpc_call_main_thread(void *fp, u8 *data, u32 data_length)
#define clib_warning(format, args...)
u32 table_index_or_table_id
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
always_inline void * vlib_frame_vector_args(vlib_frame_t *f)
void ip6_add_del_route(ip6_main_t *im, ip6_add_del_route_args_t *args)
void ip_del_adjacency(ip_lookup_main_t *lm, u32 adj_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
ip6_address_t dst_address
format_function_t format_vnet_sw_interface_name
#define pool_elt_at_index(p, i)
static void ip6_neighbor_entry_del_adj(ip6_neighbor_t *n, u32 adj_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 ip6_neighbor_add_del_adj_cb(struct ip_lookup_main_t *lm, u32 adj_index, ip_adjacency_t *adj, u32 is_del)
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)
always_inline uword random_default_seed(void)
Default random seed (unix/linux user-mode)
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 foreach_log_level
#define vec_dup(V)
Return copy of vector (no header, no alignment)
enum icmp6_neighbor_discovery_option_type icmp6_neighbor_discovery_option_type_t
always_inline f64 vlib_process_wait_for_event_or_clock(vlib_main_t *vm, f64 dt)
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.
int ip6_address_compare(ip6_address_t *a1, ip6_address_t *a2)
#define vec_del1(v, i)
Delete the element at index I.
always_inline void * clib_mem_set_heap(void *heap)
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
u32 vlib_buffer_add_data(vlib_main_t *vm, u32 free_list_index, u32 buffer_index, void *data, u32 n_data_bytes)
mhash_t address_to_prefix_index
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
always_inline void vlib_buffer_reset(vlib_buffer_t *b)
Reset current header & length to state they were in when packet was received.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
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)
ip6_address_t mcast_address
#define vec_free(V)
Free vector's memory (no header).
void vnet_rewrite_for_sw_interface(vnet_main_t *vnm, vnet_l3_packet_type_t packet_type, u32 sw_if_index, u32 node_index, void *dst_address, vnet_rewrite_header_t *rw, u32 max_rewrite_bytes)
always_inline void ip6_link_local_address_from_ethernet_address(ip6_address_t *a, u8 *ethernet_address)
ip6_address_t * mcast_source_address_pool
#define clib_memcpy(a, b, c)
always_inline vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
u32 ip6_fib_lookup_with_table(ip6_main_t *im, u32 fib_index, ip6_address_t *dst)
#define DEF_CURR_HOP_LIMIT
#define IP6_ROUTE_FLAG_DEL
int adv_link_layer_address
vlib_cli_command_t show_ip6_neighbors_command
(constructor) VLIB_CLI_COMMAND (show_ip6_neighbors_command)
#define ELOG_TYPE_DECLARE(f)
always_inline uword vnet_sw_interface_is_admin_up(vnet_main_t *vnm, u32 sw_if_index)
void md5_add(md5_context_t *c, void *data, int data_bytes)
u64 cpu_time_last_updated
always_inline vnet_sw_interface_t * vnet_get_sup_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
always_inline void ip6_set_solicited_node_multicast_address(ip6_address_t *a, u32 id)
#define VLIB_CLI_COMMAND(x,...)
#define VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX
u32 initial_adverts_count
u32 * if_address_pool_index_by_sw_if_index
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)
static void ip_register_add_del_adjacency_callback(ip_lookup_main_t *lm, ip_add_del_adjacency_callback_t cb)
void vlib_worker_thread_barrier_sync(vlib_main_t *vm)
always_inline u64 random_u64(u32 *seed)
64-bit random number generator
u32 neighbor_delete_rotor
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 * if_radv_pool_index_by_sw_if_index
u16 adv_router_lifetime_in_sec
#define VLIB_NODE_FLAG_TRACE
int deprecated_prefix_flag
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
void ip_update_adjacency(ip_lookup_main_t *lm, u32 adj_index, ip_adjacency_t *copy_adj)
mhash_t pending_resolutions_by_address
static uword icmp6_neighbor_solicitation(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define IP6_ROUTE_FLAG_FIB_INDEX
always_inline ip_adjacency_t * ip_get_adjacency(ip_lookup_main_t *lm, u32 adj_index)
#define vec_elt(v, i)
Get vector value at index i.
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)
vlib_node_registration_t ip6_icmp_router_solicitation_node
(constructor) VLIB_REGISTER_NODE (ip6_icmp_router_solicitation_node)
#define IP6_NEIGHBOR_FLAG_GLEAN
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
struct ip_adjacency_t::@112::@114 arp
ethernet_interface_t * ethernet_get_interface(ethernet_main_t *em, u32 hw_if_index)
always_inline ip_interface_address_t * ip_get_interface_address(ip_lookup_main_t *lm, void *addr_fib)
always_inline void * vlib_process_get_event_data(vlib_main_t *vm, uword *return_event_type_opaque)
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)
always_inline void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
always_inline vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
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)
#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)
static u32 ip6_neighbor_sw_interface_add_del(vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
vlib_node_registration_t ip6_icmp_neighbor_advertisement_node
(constructor) VLIB_REGISTER_NODE (ip6_icmp_neighbor_advertisement_node)
static clib_error_t * ip6_neighbor_sw_interface_up_down(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
f64 initial_adverts_interval
#define VLIB_REGISTER_NODE(x,...)
vnet_sw_interface_type_t type
always_inline vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
always_inline u32 ip6_src_lookup_for_packet(ip6_main_t *im, vlib_buffer_t *b, ip6_header_t *i)
#define IP6_ROUTE_FLAG_ADD
#define vec_foreach(var, vec)
Vector iterator.
always_inline void ip6_addr_fib_init(ip6_address_fib_t *addr_fib, ip6_address_t *address, u32 fib_index)
always_inline f64 vlib_time_now(vlib_main_t *vm)
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)
always_inline void ip6_address_mask(ip6_address_t *a, ip6_address_t *mask)
#define clib_error_return(e, args...)
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 all_mldv2_routers_adj_index
always_inline u64 clib_cpu_time_now(void)
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
vlib_node_registration_t ip6_icmp_router_advertisement_node
(constructor) VLIB_REGISTER_NODE (ip6_icmp_router_advertisement_node)
ip6_neighbor_t * neighbor_pool
u32 * fib_index_by_sw_if_index
always_inline vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
u32 all_routers_adj_index
static_always_inline uword icmp6_router_advertisement(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
always_inline uword * mhash_get(mhash_t *h, void *key)
#define MAX_DEF_RTR_LIFETIME
static ip6_neighbor_main_t ip6_neighbor_main
int ip6_interface_enabled(vlib_main_t *vm, u32 sw_if_index)
u32 next_this_sw_interface
clib_error_t * ip6_set_neighbor_limit(u32 neighbor_limit)
format_function_t format_icmp6_input_trace