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];
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;
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])
409 for (i = 0; i < uadj->
n_adj; i++)
412 uadj[i].
arp.next_hop.ip6.as_u64[1] == a->
as_u64[1])
430 if (make_new_nd_cache_entry) {
450 while (next_index != (
u32)~0)
471 u8 * link_layer_address,
472 uword n_bytes_link_layer_address)
542 if (adj->
arp.next_hop.ip6.as_u64[0] ||
543 adj->
arp.next_hop.ip6.as_u64[1])
558 memset(&args, 0,
sizeof(args));
559 memcpy(&add_adj, adj,
sizeof(add_adj));
560 add_adj.
arp.next_hop.ip6 = *next_hop;
593 n2->key.sw_if_index);
629 .path =
"show ip6 neighbors",
631 .short_help =
"Show ip6 neighbors",
658 else if (
unformat (input,
"static"))
669 mac_address,
sizeof(mac_address), is_static);
672 mac_address,
sizeof(mac_address));
677 .path =
"set ip6 neighbor",
679 .short_help =
"set ip6 neighbor [del] <intfc> <ip6-address> <mac-address> [static]",
692 uword is_solicitation)
698 u32 * from, * to_next;
699 u32 n_left_from, n_left_to_next, next_index, n_advertisements_sent;
705 n_left_from = n_packets;
715 ? ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address
716 : ICMP6_NEIGHBOR_DISCOVERY_OPTION_target_link_layer_address);
717 n_advertisements_sent = 0;
719 while (n_left_from > 0)
723 while (n_left_from > 0 && n_left_to_next > 0)
727 icmp6_neighbor_solicitation_or_advertisement_header_t * h0;
728 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t * o0;
729 u32 bi0, options_len0, sw_if_index0, next0, error0;
730 u32 ip6_sadd_link_local, ip6_sadd_unspecified;
734 bi0 = to_next[0] = from[0];
744 options_len0 = clib_net_to_host_u16 (ip0->
payload_length) -
sizeof (h0[0]);
746 error0 = ICMP6_ERROR_NONE;
752 if (!ip6_sadd_unspecified && !ip6_sadd_link_local)
762 error0 = ((adj0->rewrite_header.sw_if_index != sw_if_index0
764 ? ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_NOT_ON_LINK
768 o0 = (
void *) (h0 + 1);
769 o0 = ((options_len0 == 8 && o0->header.type == option_type
770 && o0->header.n_data_u64s == 1) ? o0 : 0);
773 if (
PREDICT_TRUE (error0 == ICMP6_ERROR_NONE && o0 != 0 &&
774 !ip6_sadd_unspecified && !ip6_sadd_link_local))
782 is_solicitation ? &ip0->
src_address : &h0->target_address,
783 o0->ethernet_address, sizeof (o0->ethernet_address), 0);
786 if (is_solicitation && error0 == ICMP6_ERROR_NONE)
790 ip6_address_fib_t ip6_af0;
802 ICMP6_ERROR_NEIGHBOR_SOLICITATION_SOURCE_UNKNOWN : error0;
806 next0 = (error0 != ICMP6_ERROR_NONE
812 error0 = error0 == ICMP6_ERROR_NONE ?
813 ICMP6_ERROR_NEIGHBOR_ADVERTISEMENTS_RX : error0;
816 if (is_solicitation && error0 == ICMP6_ERROR_NONE)
823 if(!ip6_sadd_unspecified)
827 IP6_MULTICAST_SCOPE_link_local,
828 IP6_MULTICAST_GROUP_ID_all_hosts);
832 h0->icmp.type = ICMP6_neighbor_advertisement;
841 ICMP6_NEIGHBOR_DISCOVERY_OPTION_target_link_layer_address;
844 h0->advertisement_flags = clib_host_to_net_u32
848 h0->icmp.checksum = 0;
852 ASSERT(bogus_length == 0);
867 n_advertisements_sent++;
873 to_next, n_left_to_next,
887 #define foreach_log_level \ 889 _ (INFO, "INFORMATION") \ 890 _ (NOTICE, "NOTICE") \ 891 _ (WARNING, "WARNING") \ 893 _ (CRIT, "CRITICAL") \ 895 _ (EMERG, "EMERGENCY") 898 #define _(f,s) LOG_##f, 918 if( (priority > LOG_EMERG) ||
919 !(logmask & (1 << priority)))
928 .format =
"ip6 nd: (%s): %s",
929 .format_args =
"T4T4",
931 struct {
u32 s[2]; } * ed;
957 u32 * from, * to_next;
958 u32 n_left_from, n_left_to_next, next_index;
959 u32 n_advertisements_sent = 0;
967 n_left_from = n_packets;
976 option_type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
978 while (n_left_from > 0)
982 while (n_left_from > 0 && n_left_to_next > 0)
988 icmp6_neighbor_discovery_header_t * h0;
989 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t * o0;
991 u32 bi0, options_len0, sw_if_index0, next0, error0;
992 u32 is_solicitation = 1, is_dropped = 0;
993 u32 is_unspecified, is_link_local;
995 bi0 = to_next[0] = from[0];
1000 n_left_to_next -= 1;
1005 options_len0 = clib_net_to_host_u16 (ip0->
payload_length) -
sizeof (h0[0]);
1009 error0 = ICMP6_ERROR_NONE;
1014 is_solicitation = 0;
1017 if (!is_unspecified && !is_link_local)
1022 error0 = ((adj0->rewrite_header.sw_if_index != sw_if_index0
1025 ? ICMP6_ERROR_ROUTER_SOLICITATION_SOURCE_NOT_ON_LINK
1030 o0 = (
void *) (h0 + 1);
1031 o0 = ((options_len0 == 8
1032 && o0->header.type == option_type
1033 && o0->header.n_data_u64s == 1)
1038 if (
PREDICT_TRUE (error0 == ICMP6_ERROR_NONE && o0 != 0 &&
1039 !is_unspecified && !is_link_local)) {
1047 o0->ethernet_address,
1048 sizeof (o0->ethernet_address), 0);
1054 if (error0 == ICMP6_ERROR_NONE)
1065 error0 = (!eth_if0) ? ICMP6_ERROR_ROUTER_SOLICITATION_UNSUPPORTED_INTF : error0;
1067 if (error0 == ICMP6_ERROR_NONE)
1072 p0->
current_length -= (options_len0 +
sizeof(icmp6_neighbor_discovery_header_t));
1082 error0 = ((!radv_info) ? ICMP6_ERROR_ROUTER_SOLICITATION_RADV_NOT_CONFIG : error0);
1084 if (error0 == ICMP6_ERROR_NONE)
1098 icmp6_router_advertisement_header_t rh;
1100 rh.icmp.type = ICMP6_router_advertisement;
1102 rh.icmp.checksum = 0;
1106 rh.time_in_msec_between_retransmitted_neighbor_solicitations =
1108 rh.neighbor_reachable_time_in_msec =
1115 u16 payload_length =
sizeof(icmp6_router_advertisement_header_t);
1120 (
void *)&rh,
sizeof(icmp6_router_advertisement_header_t));
1124 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t h;
1126 h.header.type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
1127 h.header.n_data_u64s = 1;
1135 (
void *)&h,
sizeof(icmp6_neighbor_discovery_ethernet_link_layer_address_option_t));
1137 payload_length +=
sizeof(icmp6_neighbor_discovery_ethernet_link_layer_address_option_t);
1143 icmp6_neighbor_discovery_mtu_option_t h;
1147 h.header.type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_mtu;
1148 h.header.n_data_u64s = 1;
1150 payload_length +=
sizeof( icmp6_neighbor_discovery_mtu_option_t);
1155 (
void *)&h,
sizeof(icmp6_neighbor_discovery_mtu_option_t));
1163 if(pr_info->enabled &&
1164 (!pr_info->decrement_lifetime_flag || (pr_info->pref_lifetime_expires >0)))
1167 icmp6_neighbor_discovery_prefix_information_option_t h;
1169 h.header.type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_prefix_information;
1170 h.header.n_data_u64s = (sizeof(icmp6_neighbor_discovery_prefix_information_option_t) >> 3);
1172 h.dst_address_length = pr_info->prefix_len;
1174 h.flags = (pr_info->adv_on_link_flag) ? ICMP6_NEIGHBOR_DISCOVERY_PREFIX_INFORMATION_FLAG_ON_LINK : 0;
1175 h.flags |= (pr_info->adv_autonomous_flag) ? ICMP6_NEIGHBOR_DISCOVERY_PREFIX_INFORMATION_AUTO : 0;
1177 if(radv_info->cease_radv && pr_info->deprecated_prefix_flag)
1179 h.valid_time = clib_host_to_net_u32(MIN_ADV_VALID_LIFETIME);
1180 h.preferred_time = 0;
1184 if(pr_info->decrement_lifetime_flag)
1186 pr_info->adv_valid_lifetime_in_secs = ((pr_info->valid_lifetime_expires > now)) ?
1187 (pr_info->valid_lifetime_expires - now) : 0;
1189 pr_info->adv_pref_lifetime_in_secs = ((pr_info->pref_lifetime_expires > now)) ?
1190 (pr_info->pref_lifetime_expires - now) : 0;
1193 h.valid_time = clib_host_to_net_u32(pr_info->adv_valid_lifetime_in_secs);
1194 h.preferred_time = clib_host_to_net_u32(pr_info->adv_pref_lifetime_in_secs) ;
1198 clib_memcpy(&h.dst_address, &pr_info->prefix, sizeof(ip6_address_t));
1200 payload_length += sizeof( icmp6_neighbor_discovery_prefix_information_option_t);
1202 vlib_buffer_add_data (vm,
1203 p0->free_list_index,
1205 (void *)&h, sizeof(icmp6_neighbor_discovery_prefix_information_option_t));
1221 IP6_MULTICAST_SCOPE_link_local,
1222 IP6_MULTICAST_GROUP_ID_all_hosts);
1231 icmp6_router_advertisement_header_t * rh0 = (icmp6_router_advertisement_header_t *)(ip0 + 1);
1232 rh0->icmp.checksum =
1235 ASSERT(bogus_length == 0);
1241 if (is_solicitation)
1250 next0 = is_dropped ?
1257 if (adj_index0 == 0)
1258 error0 = ICMP6_ERROR_DST_LOOKUP_MISS;
1263 ((adj0->rewrite_header.sw_if_index != sw_if_index0
1265 ? ICMP6_ERROR_ROUTER_SOLICITATION_DEST_UNKNOWN
1267 next0 = is_dropped ?
1276 if((error0 == ICMP6_ERROR_NONE) && !is_dropped)
1279 n_advertisements_sent++;
1285 p0->error = error_node->
errors[error0];
1287 if(error0 != ICMP6_ERROR_NONE)
1291 to_next, n_left_to_next,
1300 vlib_error_count (vm, error_node->node_index, ICMP6_ERROR_ROUTER_ADVERTISEMENTS_TX, n_advertisements_sent);
1302 return frame->n_vectors;
1314 u32 * from, * to_next;
1315 u32 n_left_from, n_left_to_next, next_index;
1316 u32 n_advertisements_rcvd = 0;
1321 n_left_from = n_packets;
1329 while (n_left_from > 0)
1333 while (n_left_from > 0 && n_left_to_next > 0)
1338 icmp6_router_advertisement_header_t * h0;
1339 u32 bi0, options_len0, sw_if_index0, next0, error0;
1341 bi0 = to_next[0] = from[0];
1346 n_left_to_next -= 1;
1351 options_len0 = clib_net_to_host_u16 (ip0->
payload_length) -
sizeof (h0[0]);
1353 error0 = ICMP6_ERROR_NONE;
1358 ICMP6_ERROR_ROUTER_ADVERTISEMENT_SOURCE_NOT_LINK_LOCAL : error0;
1363 n_advertisements_rcvd++;
1365 if (error0 == ICMP6_ERROR_NONE)
1375 error0 = (!eth_if0) ? ICMP6_ERROR_ROUTER_SOLICITATION_UNSUPPORTED_INTF : error0;
1377 if (error0 == ICMP6_ERROR_NONE)
1389 error0 = ((!radv_info) ? ICMP6_ERROR_ROUTER_SOLICITATION_RADV_NOT_CONFIG : error0);
1391 if (error0 == ICMP6_ERROR_NONE)
1398 "our AdvCurHopLimit on %U doesn't agree with %U",
1406 "our AdvManagedFlag on %U doesn't agree with %U",
1414 "our AdvOtherConfigFlag on %U doesn't agree with %U",
1418 if((h0->time_in_msec_between_retransmitted_neighbor_solicitations &&
1420 (h0->time_in_msec_between_retransmitted_neighbor_solicitations !=
1424 "our AdvRetransTimer on %U doesn't agree with %U",
1428 if((h0->neighbor_reachable_time_in_msec &&
1430 (h0->neighbor_reachable_time_in_msec !=
1434 "our AdvReachableTime on %U doesn't agree with %U",
1439 u8 * opt_hdr = (
u8 *)(h0 + 1);
1440 while( options_len0 > 0 &&
1443 icmp6_neighbor_discovery_option_header_t *o0 = ( icmp6_neighbor_discovery_option_header_t *)opt_hdr;
1444 int opt_len = o0->n_data_u64s << 3;
1447 if(options_len0 < 2)
1450 "malformed RA packet on %U from %U",
1458 " zero length option in RA on %U from %U",
1462 else if( opt_len > options_len0)
1465 "option length in RA packet greater than total length on %U from %U",
1470 options_len0 -= opt_len;
1475 case ICMP6_NEIGHBOR_DISCOVERY_OPTION_mtu:
1477 icmp6_neighbor_discovery_mtu_option_t *h =
1478 (icmp6_neighbor_discovery_mtu_option_t *)(o0);
1480 if(opt_len <
sizeof(*h))
1484 (h->mtu != clib_host_to_net_u32(radv_info->
adv_link_mtu)))
1487 "our AdvLinkMTU on %U doesn't agree with %U",
1493 case ICMP6_NEIGHBOR_DISCOVERY_OPTION_prefix_information:
1495 icmp6_neighbor_discovery_prefix_information_option_t *h =
1496 (icmp6_neighbor_discovery_prefix_information_option_t *)(o0);
1500 u32 preferred, valid;
1502 if(opt_len <
sizeof(*h))
1505 preferred = clib_net_to_host_u32(h->preferred_time);
1506 valid = clib_net_to_host_u32(h->valid_time);
1512 ip6_address_mask_from_width(&mask, pr_info->prefix_len);
1514 if(pr_info->enabled &&
1515 (pr_info->prefix_len == h->dst_address_length) &&
1516 ip6_address_is_equal_masked (&pr_info->prefix, &h->dst_address, &mask))
1519 if(!pr_info->decrement_lifetime_flag &&
1520 valid != pr_info->adv_valid_lifetime_in_secs)
1522 ip6_neighbor_syslog(vm, LOG_WARNING,
1523 "our ADV validlifetime on %U for %U does not agree with %U",
1524 format_vnet_sw_if_index_name, vnm, sw_if_index0,format_ip6_address, &pr_info->prefix,
1525 format_ip6_address, &h->dst_address);
1527 if(!pr_info->decrement_lifetime_flag &&
1528 preferred != pr_info->adv_pref_lifetime_in_secs)
1530 ip6_neighbor_syslog(vm, LOG_WARNING,
1531 "our ADV preferredlifetime on %U for %U does not agree with %U",
1532 format_vnet_sw_if_index_name, vnm, sw_if_index0,format_ip6_address, &pr_info->prefix,
1533 format_ip6_address, &h->dst_address);
1549 p0->error = error_node->
errors[error0];
1551 if(error0 != ICMP6_ERROR_NONE)
1555 to_next, n_left_to_next,
1563 vlib_error_count (vm, error_node->node_index, ICMP6_ERROR_ROUTER_ADVERTISEMENTS_RX, n_advertisements_rcvd);
1565 return frame->n_vectors;
1599 u32 i, * to_delete = 0;
1610 vec_add1 (to_delete, p - a->adv_prefixes_pool);
1613 for (i = 0; i <
vec_len (to_delete); i++)
1625 vec_add1 (to_delete, m - a->mldp_group_pool);
1628 for (i = 0; i <
vec_len (to_delete); i++)
1656 memset (a, 0,
sizeof (a[0]));
1696 u8 link_layer_address[6] =
1697 {0x33, 0x33, 0x00, 0x00, 0x00, IP6_MULTICAST_GROUP_ID_all_hosts};
1707 VNET_L3_PACKET_TYPE_IP6,
1711 &adj->rewrite_header,
1712 sizeof (adj->rewrite_data));
1717 u8 link_layer_address[6] =
1718 {0x33, 0x33, 0x00, 0x00, 0x00, IP6_MULTICAST_GROUP_ID_all_routers};
1728 VNET_L3_PACKET_TYPE_IP6,
1732 &adj->rewrite_header,
1733 sizeof (adj->rewrite_data));
1738 u8 link_layer_address[6] =
1739 {0x33, 0x33, 0x00, 0x00, 0x00, IP6_MULTICAST_GROUP_ID_mldv2_routers};
1749 VNET_L3_PACKET_TYPE_IP6,
1753 &adj->rewrite_header,
1754 sizeof (adj->rewrite_data));
1762 IP6_MULTICAST_SCOPE_link_local,
1763 IP6_MULTICAST_GROUP_ID_all_hosts);
1771 if(!mcast_group_info)
1780 mcast_group_info->
type = 4;
1787 IP6_MULTICAST_SCOPE_link_local,
1788 IP6_MULTICAST_GROUP_ID_all_routers);
1793 if(!mcast_group_info)
1802 mcast_group_info->
type = 4;
1809 IP6_MULTICAST_SCOPE_link_local,
1810 IP6_MULTICAST_GROUP_ID_mldv2_routers);
1815 if(!mcast_group_info)
1824 mcast_group_info->
type = 4;
1856 icmp6_multicast_listener_report_header_t *rh0;
1857 icmp6_multicast_listener_report_packet_t *rp0;
1888 b0->
current_length =
sizeof(icmp6_multicast_listener_report_packet_t);
1890 payload_length =
sizeof(icmp6_multicast_listener_report_header_t);
1892 b0->
error = ICMP6_ERROR_NONE;
1896 rh0 = (icmp6_multicast_listener_report_header_t *)&rp0-> report_hdr;
1898 memset (rp0 , 0x0,
sizeof (icmp6_multicast_listener_report_packet_t));
1902 ip0->
protocol = IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS;
1907 rh0->icmp.type = ICMP6_multicast_listener_report_v2;
1915 IP6_MULTICAST_SCOPE_link_local,
1916 IP6_MULTICAST_GROUP_ID_mldv2_routers);
1920 int num_addr_records = 0;
1921 icmp6_multicast_address_record_t rr;
1924 rh0->ext_hdr.next_hdr = IP_PROTOCOL_ICMP6;
1925 rh0->ext_hdr.n_data_u64s = 0;
1929 rh0->alert.value = 0;
1934 rh0->icmp.checksum = 0;
1939 rr.aux_data_len_u32s = 0;
1940 rr.num_sources = clib_host_to_net_u16 (m->num_sources);
1941 clib_memcpy(&rr.mcast_addr, &m->mcast_address, sizeof(ip6_address_t));
1945 vlib_buffer_add_data (vm,
1946 b0->free_list_index,
1948 (void *)&rr, sizeof(icmp6_multicast_address_record_t));
1950 payload_length += sizeof( icmp6_multicast_address_record_t);
1954 rh0->num_addr_records = clib_host_to_net_u16(num_addr_records);
1961 ASSERT(bogus_length == 0);
1986 .name =
"icmp6-router-solicitation",
1988 .vector_size =
sizeof (
u32),
2010 u32 n_this_frame = 0;
2011 u32 n_left_to_next = 0;
2014 icmp6_router_solicitation_header_t * h0;
2021 if( !vnet_sw_interface_is_admin_up (vnm, radv_info->sw_if_index))
2023 radv_info->initial_adverts_sent = radv_info->initial_adverts_count-1;
2024 radv_info->next_multicast_time = now;
2025 radv_info->last_multicast_time = now;
2026 radv_info->last_radv_time = 0;
2027 radv_info->all_routers_mcast = 0;
2035 ip6_neighbor_send_mldpv2_report(radv_info->sw_if_index);
2036 radv_info->all_routers_mcast = 1;
2045 f64 rfn = (radv_info->max_radv_interval - radv_info->min_radv_interval) *
2046 random_f64 (&radv_info->seed) + radv_info->min_radv_interval;
2049 if( radv_info->initial_adverts_sent > 0)
2051 radv_info->initial_adverts_sent--;
2052 if(rfn > radv_info-> initial_adverts_interval)
2053 rfn = radv_info-> initial_adverts_interval;
2056 if( radv_info->initial_adverts_sent == 0)
2057 if(radv_info->cease_radv)
2058 radv_info->send_radv = 0;
2076 b0->
current_length =
sizeof( icmp6_router_solicitation_header_t);
2077 b0->
error = ICMP6_ERROR_NONE;
2082 memset (h0, 0,
sizeof (icmp6_router_solicitation_header_t));
2084 h0->ip.ip_version_traffic_class_and_flow_label = clib_host_to_net_u32 (0x6 << 28);
2085 h0->ip.payload_length = clib_host_to_net_u16 (
sizeof (icmp6_router_solicitation_header_t)
2087 h0->ip.protocol = IP_PROTOCOL_ICMP6;
2088 h0->ip.hop_limit = 255;
2091 h0->ip.src_address.as_u64[0] = 0;
2092 h0->ip.src_address.as_u64[1] = 0;
2094 h0->ip.dst_address.as_u64[0] = 0;
2095 h0->ip.dst_address.as_u64[1] = 0;
2097 h0->neighbor.icmp.type = ICMP6_router_solicitation;
2124 f->n_vectors = n_this_frame;
2154 switch (event_type) {
2167 _vec_len (event_data) = 0;
2175 .name =
"icmp6-router-advertisement",
2177 .vector_size =
sizeof (
u32),
2190 .name =
"ip6-icmp-neighbor-discovery-event-process",
2208 .name =
"icmp6-neighbor-solicitation",
2210 .vector_size =
sizeof (
u32),
2223 .name =
"icmp6-neighbor-advertisement",
2225 .vector_size =
sizeof (
u32),
2238 u8 suppress,
u8 managed,
u8 other,
2239 u8 ll_option,
u8 send_unicast,
u8 cease,
2240 u8 use_lifetime,
u32 lifetime,
2241 u32 initial_count,
u32 initial_interval,
2242 u32 max_interval,
u32 min_interval,
2252 error = (ri != ~0) ? 0 : VNET_API_ERROR_INVALID_SW_IF_INDEX;
2260 if((max_interval != 0) && (min_interval ==0))
2261 min_interval = .75 * max_interval;
2272 if(lifetime <= max_interval)
2273 return VNET_API_ERROR_INVALID_VALUE;
2276 if(min_interval != 0)
2278 if((min_interval > .75 * max_interval) ||
2280 return VNET_API_ERROR_INVALID_VALUE;
2285 return VNET_API_ERROR_INVALID_VALUE;
2291 radv_info->
send_radv = (suppress != 0) ? ( (is_no != 0) ? 1 : 0 ) : radv_info->
send_radv;
2308 if((cease != 0) && (is_no))
2309 radv_info-> send_radv = 1;
2322 u8 use_default,
u32 val_lifetime,
u32 pref_lifetime,
2323 u8 no_advertise,
u8 off_link,
u8 no_autoconfig,
u8 no_onlink,
2336 error = (ri != ~0) ? 0 : VNET_API_ERROR_INVALID_SW_IF_INDEX;
2356 return VNET_API_ERROR_INVALID_VALUE;
2359 return VNET_API_ERROR_INVALID_VALUE_2;
2411 return VNET_API_ERROR_INVALID_VALUE_2;
2420 if((val_lifetime == ~0) || (pref_lifetime == ~0))
2433 prefix->
enabled = !(no_advertise != 0);
2458 u8 suppress = 0, managed = 0, other = 0;
2459 u8 suppress_ll_option = 0, send_unicast = 0, cease= 0;
2460 u8 use_lifetime = 0;
2461 u32 sw_if_index, ra_lifetime = 0, ra_initial_count = 0, ra_initial_interval = 0;
2462 u32 ra_max_interval = 0 , ra_min_interval = 0;
2467 int add_radv_info = 1;
2468 __attribute__((unused))
ip6_radv_t * radv_info = 0;
2526 else if(
unformat (line_input,
"prefix %U/%d",
2533 else if (
unformat (line_input,
"ra-managed-config-flag"))
2538 else if (
unformat (line_input,
"ra-other-config-flag"))
2543 else if (
unformat (line_input,
"ra-suppress") ||
2544 unformat (line_input,
"ra-surpress"))
2549 else if (
unformat (line_input,
"ra-suppress-link-layer") ||
2550 unformat (line_input,
"ra-surpress-link-layer"))
2552 suppress_ll_option = 1;
2555 else if (
unformat (line_input,
"ra-send-unicast"))
2560 else if (
unformat (line_input,
"ra-lifetime"))
2562 if (!
unformat (line_input,
"%d", &ra_lifetime))
2567 else if (
unformat (line_input,
"ra-initial"))
2569 if (!
unformat (line_input,
"%d %d", &ra_initial_count, &ra_initial_interval))
2573 else if (
unformat (line_input,
"ra-interval"))
2575 if (!
unformat (line_input,
"%d", &ra_max_interval))
2578 if (!
unformat (line_input,
"%d", &ra_min_interval))
2579 ra_min_interval = 0;
2582 else if(
unformat (line_input,
"ra-cease"))
2594 suppress, managed, other,
2595 suppress_ll_option, send_unicast, cease,
2596 use_lifetime, ra_lifetime,
2597 ra_initial_count, ra_initial_interval,
2598 ra_max_interval, ra_min_interval,
2603 u32 valid_lifetime_in_secs = 0;
2604 u32 pref_lifetime_in_secs = 0;
2605 u8 use_prefix_default_values = 0;
2606 u8 no_advertise = 0;
2608 u8 no_autoconfig = 0;
2614 if(
unformat (line_input,
"default"))
2616 use_prefix_default_values = 1;
2619 else if(
unformat (line_input,
"infinite"))
2621 valid_lifetime_in_secs = ~0;
2622 pref_lifetime_in_secs = ~0;
2625 else if(
unformat (line_input,
"%d %d", &valid_lifetime_in_secs,
2626 &pref_lifetime_in_secs))
2634 while (!use_prefix_default_values &&
2637 if(
unformat (line_input,
"no-advertise"))
2639 else if(
unformat (line_input,
"off-link"))
2641 else if(
unformat (line_input,
"no-autoconfig"))
2643 else if(
unformat (line_input,
"no-onlink"))
2650 &ip6_addr, addr_len,
2651 use_prefix_default_values,
2652 valid_lifetime_in_secs,
2653 pref_lifetime_in_secs,
2674 for (i = 0; i <
vec_len (addrs); i++)
2718 u32 *link_scope = 0, *global_scope = 0;
2719 u32 *local_scope = 0, *unknown_scope = 0;
2725 while (ai != (
u32)~0)
2773 vlib_cli_output (vm,
"\t\t%U\n", format_ip6_address, &m->mcast_address);
2779 vlib_cli_output (vm,
"\t\tprefix %U, length %d\n",
2780 format_ip6_address, &p->prefix, p->prefix_len);
2791 vlib_cli_output (vm,
"\tND advertised retransmit interval is %d (msec)\n",
2796 vlib_cli_output (vm,
"\tND router advertisements are sent every %d seconds (min interval is %d)\n",
2797 ra_interval, ra_interval_min);
2798 vlib_cli_output (vm,
"\tND router advertisements live for %d seconds\n",
2800 vlib_cli_output (vm,
"\tHosts %s stateless autoconfig for addresses\n",
2817 .path =
"show ip6 interface",
2819 .short_help =
"show ip6 interface <iface name>",
2923 md5_add (&m, &link_local_address, 16);
2930 link_local_address.
as_u64[0] = clib_host_to_net_u64 (0xFE80000000000000ULL);
2932 link_local_address.
as_u8[8] &= 0xfd;
2937 &link_local_address, 64 ,
2980 .path =
"enable ip6 interface",
2982 .short_help =
"enable ip6 interface <iface name>",
3011 .path =
"disable ip6 interface",
3013 .short_help =
"disable ip6 interface <iface name>",
3018 .short_help =
"Set ip6 neighbor discovery parameters",
3036 vnm->
api_errno = VNET_API_ERROR_ADDRESS_NOT_LINK_LOCAL;
3075 vnm->
api_errno = VNET_API_ERROR_IP6_NOT_ENABLED;
3115 .path =
"set ip6 link-local address",
3116 .short_help =
"Set ip6 interface link-local address <intfc> <address.>",
3127 u32 if_address_index,
3167 if(!mcast_group_info)
3176 mcast_group_info->
type = 4;
3199 if(mcast_group_info)
3267 (adj->
arp.next_hop.ip6.as_u64[0] || adj->
arp.next_hop.ip6.as_u64[1]))
3283 clib_warning(
"Adjacency contains unknown ND next hop %U (del)",
3291 clib_warning(
"Adjacency contains unknown ND next hop %U (add)",
3336 (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)
Release pointer to next frame vector data.
ip6_radv_t * if_radv_pool
#define MIN_DELAY_BETWEEN_RAS
#define DEF_DEF_RTR_LIFETIME
#define pool_next_index(P, I)
Return next occupied pool index after i, useful for safe iteration.
#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
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)
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.
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
static char * log_level_strings[]
u16 n_adj
Number of adjecencies in block.
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
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
static uword ip6_address_is_local_unicast(ip6_address_t *a)
void md5_init(md5_context_t *c)
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
static void ip6_neighbor_entry_add_adj(ip6_neighbor_t *n, u32 adj_index)
#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)
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).
static u32 ip6_src_lookup_for_packet(ip6_main_t *im, vlib_buffer_t *b, ip6_header_t *i)
word vnet_sw_interface_compare(vnet_main_t *vnm, uword sw_if_index0, uword sw_if_index1)
static u64 clib_cpu_time_now(void)
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)
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
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
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)
ethernet_main_t ethernet_main
vnet_main_t * vnet_get_main(void)
static void ip6_print_addrs(vlib_main_t *vm, u32 *addrs)
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
#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
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
static vnet_sw_interface_t * vnet_get_sup_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
#define IP6_NEIGHBOR_FLAG_STATIC
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
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)
Returns pointer to element at given index.
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 vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
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)
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
#define vec_dup(V)
Return copy of vector (no header, no alignment)
enum icmp6_neighbor_discovery_option_type icmp6_neighbor_discovery_option_type_t
int ip6_address_compare(ip6_address_t *a1, ip6_address_t *a2)
#define vec_del1(v, i)
Delete the element at index I.
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)
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)
static void * clib_mem_set_heap(void *heap)
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.
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
static ip_interface_address_t * ip_get_interface_address(ip_lookup_main_t *lm, void *addr_fib)
static uword * mhash_get(mhash_t *h, void *key)
static vlib_cli_command_t show_ip6_neighbors_command
(constructor) VLIB_CLI_COMMAND (show_ip6_neighbors_command)
void vlib_worker_thread_barrier_sync(vlib_main_t *vm)
#define ELOG_TYPE_DECLARE(f)
This packet matches an "interface route" and packets need to be passed to ARP to find rewrite string ...
static void ip6_addr_fib_init(ip6_address_fib_t *addr_fib, ip6_address_t *address, u32 fib_index)
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_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)
static void ip_register_add_del_adjacency_callback(ip_lookup_main_t *lm, ip_add_del_adjacency_callback_t cb)
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 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
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
static uword vnet_sw_interface_is_admin_up(vnet_main_t *vnm, u32 sw_if_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)
static 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
VLIB_CLI_COMMAND(set_interface_ip_source_and_port_range_check_command, static)
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)
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)
u32 heap_handle
Handle for this adjacency in adjacency heap.
#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.
#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)
static 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
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
#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 IP6_ROUTE_FLAG_ADD
u32 if_address_index
Interface address index for this local/arp adjacency.
#define vec_foreach(var, vec)
Vector iterator.
static uword ip6_address_is_unspecified(ip6_address_t *a)
struct ip_adjacency_t::@143::@145 arp
IP_LOOKUP_NEXT_ARP only.
i16 explicit_fib_index
Force re-lookup in a different FIB.
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 void ip6_link_local_address_from_ethernet_address(ip6_address_t *a, u8 *ethernet_address)
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
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
u32 * fib_index_by_sw_if_index
u32 all_routers_adj_index
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static u64 random_u64(u32 *seed)
64-bit random number generator
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
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
static uword pool_elts(void *v)
Number of active elements in a pool.