|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
38 icmp6_neighbor_discovery_header_t neighbor;
39 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t
41 }) icmp6_router_solicitation_header_t;
47 icmp6_router_advertisement_header_t router;
48 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t
50 icmp6_neighbor_discovery_mtu_option_t mtu_option;
51 icmp6_neighbor_discovery_prefix_information_option_t
56 #define DEF_MAX_RADV_INTERVAL 200
57 #define DEF_MIN_RADV_INTERVAL .75 * DEF_MAX_RADV_INTERVAL
58 #define DEF_CURR_HOP_LIMIT 64
59 #define DEF_DEF_RTR_LIFETIME 3 * DEF_MAX_RADV_INTERVAL
60 #define MAX_DEF_RTR_LIFETIME 9000
62 #define MAX_INITIAL_RTR_ADVERT_INTERVAL 16
63 #define MAX_INITIAL_RTR_ADVERTISEMENTS 3
64 #define MIN_DELAY_BETWEEN_RAS 3
65 #define MAX_DELAY_BETWEEN_RAS 1800
66 #define MAX_RA_DELAY_TIME .5
88 #define MIN_ADV_VALID_LIFETIME 7203
89 #define DEF_ADV_VALID_LIFETIME 2592000
90 #define DEF_ADV_PREF_LIFETIME 604800
208 #define foreach_log_level \
210 _ (INFO, "INFORMATION") \
211 _ (NOTICE, "NOTICE") \
212 _ (WARNING, "WARNING") \
214 _ (CRIT, "CRITICAL") \
216 _ (EMERG, "EMERGENCY")
220 #define _(f,s) LOG_##f,
250 .format =
"ip6 nd: (%s): %s",.format_args =
"T4T4",};
282 u32 n_advertisements_sent = 0;
300 option_type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
312 icmp6_neighbor_discovery_header_t *h0;
313 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t *o0;
315 u32 bi0, options_len0, sw_if_index0, next0, error0;
316 u32 is_solicitation = 1, is_dropped = 0;
317 u32 is_unspecified, is_link_local;
319 bi0 = to_next[0] =
from[0];
335 error0 = ICMP6_ERROR_NONE;
343 if (!is_unspecified && !is_link_local)
351 error0 = (adj0->rewrite_header.sw_if_index != sw_if_index0
353 ICMP6_ERROR_ROUTER_SOLICITATION_SOURCE_NOT_ON_LINK
358 error0 = ICMP6_ERROR_ROUTER_SOLICITATION_SOURCE_NOT_ON_LINK;
363 o0 = (
void *) (h0 + 1);
364 o0 = ((options_len0 == 8
365 && o0->header.type == option_type
366 && o0->header.n_data_u64s == 1) ? o0 : 0);
369 if (
PREDICT_TRUE (error0 == ICMP6_ERROR_NONE && o0 != 0 &&
370 !is_unspecified && !is_link_local))
381 memcpy (&learn.
mac, o0->ethernet_address, sizeof (learn.
mac));
388 if (error0 == ICMP6_ERROR_NONE)
401 (!eth_if0) ? ICMP6_ERROR_ROUTER_SOLICITATION_UNSUPPORTED_INTF
404 if (error0 == ICMP6_ERROR_NONE)
409 sizeof (icmp6_neighbor_discovery_header_t));
413 error0 = ((!radv_info) ?
414 ICMP6_ERROR_ROUTER_SOLICITATION_RADV_NOT_CONFIG :
417 if (error0 == ICMP6_ERROR_NONE)
433 icmp6_router_advertisement_header_t rh;
435 rh.icmp.type = ICMP6_router_advertisement;
437 rh.icmp.checksum = 0;
440 rh.router_lifetime_in_sec =
444 time_in_msec_between_retransmitted_neighbor_solicitations
446 clib_host_to_net_u32 (radv_info->
447 adv_time_in_msec_between_retransmitted_neighbor_solicitations);
448 rh.neighbor_reachable_time_in_msec =
449 clib_host_to_net_u32 (radv_info->
450 adv_neighbor_reachable_time_in_msec);
463 sizeof (icmp6_router_advertisement_header_t);
466 (
vm, &bi0, (
void *) &rh,
467 sizeof (icmp6_router_advertisement_header_t)))
470 error0 = ICMP6_ERROR_ALLOC_FAILURE;
476 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t
480 ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
481 h.header.n_data_u64s = 1;
488 (
vm, &bi0, (
void *) &
h,
490 (icmp6_neighbor_discovery_ethernet_link_layer_address_option_t)))
492 error0 = ICMP6_ERROR_ALLOC_FAILURE;
498 (icmp6_neighbor_discovery_ethernet_link_layer_address_option_t);
504 icmp6_neighbor_discovery_mtu_option_t
h;
509 h.header.type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_mtu;
510 h.header.n_data_u64s = 1;
513 sizeof (icmp6_neighbor_discovery_mtu_option_t);
516 (
vm, &bi0, (
void *) &
h,
518 (icmp6_neighbor_discovery_mtu_option_t)))
520 error0 = ICMP6_ERROR_ALLOC_FAILURE;
536 icmp6_neighbor_discovery_prefix_information_option_t
h;
538 h.header.type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_prefix_information;
539 h.header.n_data_u64s = (
sizeof(icmp6_neighbor_discovery_prefix_information_option_t) >> 3);
549 h.preferred_time = 0;
568 if (0 && CLIB_DEBUG > 0)
570 (
"send RA for prefix %U/%d "
571 "sw_if_index %d valid %u preferred %u",
574 clib_net_to_host_u32 (
h.valid_time),
575 clib_net_to_host_u32 (
h.preferred_time));
577 if (
h.valid_time == 0)
582 payload_length +=
sizeof( icmp6_neighbor_discovery_prefix_information_option_t);
585 (
vm, &bi0, (
void *)&
h,
586 sizeof(icmp6_neighbor_discovery_prefix_information_option_t)))
588 error0 = ICMP6_ERROR_ALLOC_FAILURE;
608 IP6_MULTICAST_SCOPE_link_local,
609 IP6_MULTICAST_GROUP_ID_all_hosts);
619 clib_host_to_net_u16 (payload_length);
621 icmp6_router_advertisement_header_t *rh0 =
622 (icmp6_router_advertisement_header_t *) (ip0 + 1);
626 ASSERT (bogus_length == 0);
653 error0 = ICMP6_ERROR_DST_LOOKUP_MISS;
663 p0->
flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
668 if ((error0 == ICMP6_ERROR_NONE) && !is_dropped)
671 n_advertisements_sent++;
680 if (error0 != ICMP6_ERROR_NONE)
684 to_next, n_left_to_next,
694 ICMP6_ERROR_ROUTER_ADVERTISEMENTS_TX,
695 n_advertisements_sent);
697 return frame->n_vectors;
704 .name =
"icmp6-router-solicitation",
706 .vector_size =
sizeof (
u32),
728 u32 n_advertisements_rcvd = 0;
751 icmp6_router_advertisement_header_t *h0;
752 u32 bi0, options_len0, sw_if_index0, next0, error0;
754 bi0 = to_next[0] =
from[0];
767 error0 = ICMP6_ERROR_NONE;
772 ICMP6_ERROR_ROUTER_ADVERTISEMENT_SOURCE_NOT_LINK_LOCAL : error0;
777 n_advertisements_rcvd++;
779 if (error0 == ICMP6_ERROR_NONE)
791 (!eth_if0) ? ICMP6_ERROR_ROUTER_SOLICITATION_UNSUPPORTED_INTF
794 if (error0 == ICMP6_ERROR_NONE)
799 error0 = ((!radv_info) ?
800 ICMP6_ERROR_ROUTER_SOLICITATION_RADV_NOT_CONFIG :
803 if (error0 == ICMP6_ERROR_NONE)
809 r.sw_if_index = sw_if_index0;
811 r.current_hop_limit = h0->current_hop_limit;
813 r.router_lifetime_in_sec =
814 clib_net_to_host_u16 (h0->router_lifetime_in_sec);
815 r.neighbor_reachable_time_in_msec =
817 (h0->neighbor_reachable_time_in_msec);
818 r.time_in_msec_between_retransmitted_neighbor_solicitations = clib_net_to_host_u32 (h0->time_in_msec_between_retransmitted_neighbor_solicitations);
823 && (h0->current_hop_limit !=
827 "our AdvCurHopLimit on %U doesn't agree with %U",
839 "our AdvManagedFlag on %U doesn't agree with %U",
851 "our AdvOtherConfigFlag on %U doesn't agree with %U",
859 time_in_msec_between_retransmitted_neighbor_solicitations
861 adv_time_in_msec_between_retransmitted_neighbor_solicitations)
863 time_in_msec_between_retransmitted_neighbor_solicitations
865 clib_host_to_net_u32 (radv_info->
866 adv_time_in_msec_between_retransmitted_neighbor_solicitations)))
869 "our AdvRetransTimer on %U doesn't agree with %U",
876 if ((h0->neighbor_reachable_time_in_msec &&
878 (h0->neighbor_reachable_time_in_msec !=
883 "our AdvReachableTime on %U doesn't agree with %U",
891 u8 *opt_hdr = (
u8 *) (h0 + 1);
892 while (options_len0 > 0)
894 icmp6_neighbor_discovery_option_header_t *o0 =
895 (icmp6_neighbor_discovery_option_header_t *)
897 int opt_len = o0->n_data_u64s << 3;
901 if (options_len0 < 2)
904 "malformed RA packet on %U from %U",
915 " zero length option in RA on %U from %U",
922 else if (opt_len > options_len0)
925 "option length in RA packet greater than total length on %U from %U",
933 options_len0 -= opt_len;
938 case ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address:
940 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t
942 (icmp6_neighbor_discovery_ethernet_link_layer_address_option_t
945 if (opt_len <
sizeof (*
h))
948 memcpy (
r.slla,
h->ethernet_address, 6);
952 case ICMP6_NEIGHBOR_DISCOVERY_OPTION_mtu:
954 icmp6_neighbor_discovery_mtu_option_t *
h =
955 (icmp6_neighbor_discovery_mtu_option_t
958 if (opt_len <
sizeof (*
h))
961 r.mtu = clib_net_to_host_u32 (
h->mtu);
969 "our AdvLinkMTU on %U doesn't agree with %U",
978 case ICMP6_NEIGHBOR_DISCOVERY_OPTION_prefix_information:
980 icmp6_neighbor_discovery_prefix_information_option_t
982 (icmp6_neighbor_discovery_prefix_information_option_t
987 u32 preferred, valid;
989 if (opt_len <
sizeof (*
h))
999 clib_net_to_host_u32 (
h->preferred_time);
1000 valid = clib_net_to_host_u32 (
h->valid_time);
1002 prefix->preferred_time = preferred;
1003 prefix->valid_time = valid;
1004 prefix->flags =
h->flags & 0xc0;
1005 prefix->prefix.fp_len =
h->dst_address_length;
1006 prefix->prefix.fp_addr.ip6 =
h->dst_address;
1026 "our ADV validlifetime on %U for %U does not agree with %U",
1034 "our ADV preferredlifetime on %U for %U does not agree with %U",
1056 if (error0 != ICMP6_ERROR_NONE)
1060 to_next, n_left_to_next,
1069 ICMP6_ERROR_ROUTER_ADVERTISEMENTS_RX,
1070 n_advertisements_rcvd);
1072 return frame->n_vectors;
1079 .name =
"icmp6-router-advertisement",
1081 .vector_size =
sizeof (
u32),
1095 static u32 seed = 0;
1096 static u8 seed_set = 0;
1121 icmp6_router_solicitation_header_t *rh;
1135 p0->
flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
1146 rh->neighbor.icmp.type = ICMP6_router_solicitation;
1147 rh->neighbor.icmp.code = 0;
1148 rh->neighbor.icmp.checksum = 0;
1149 rh->neighbor.reserved_must_be_zero = 0;
1151 rh->link_layer_option.header.type =
1152 ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
1154 rh->link_layer_option.ethernet_address))
1156 clib_warning (
"interface with sw_if_index %u has no mac address",
1161 rh->link_layer_option.header.n_data_u64s = 1;
1163 payload_length =
sizeof (rh->neighbor) +
sizeof (
u64);
1165 rh->ip.ip_version_traffic_class_and_flow_label =
1166 clib_host_to_net_u32 (0x6 << 28);
1167 rh->ip.payload_length = clib_host_to_net_u16 (payload_length);
1168 rh->ip.protocol = IP_PROTOCOL_ICMP6;
1169 rh->ip.hop_limit = 255;
1173 rh->ip.dst_address.as_u64[0] = clib_host_to_net_u64 (0xff02ULL << 48);
1174 rh->ip.dst_address.as_u64[1] = clib_host_to_net_u64 (2);
1213 params = &radv_info->
params;
1215 if (radv_info->
due_time > current_time)
1237 if (params->
mrc != 0 && --radv_info->
n_left == 0)
1249 if (params->
mrd != 0
1263 uword *event_data = NULL;
1264 f64 sleep_time = 1e9;
1279 due_time = current_time + 1e9;
1290 while (due_time < current_time);
1292 sleep_time = due_time - current_time;
1302 .name =
"ip6-rs-process",
1400 sizeof (ip6_address_t));
1418 mhash_unset (&radv_info->address_to_prefix_index, &p->prefix, 0);
1431 u32 primary_sw_if_index,
1435 static u32 *radv_indices;
1459 if (radv_info->
sw_if_index == primary_sw_if_index)
1497 u32 n_this_frame = 0;
1498 u32 n_left_to_next = 0;
1501 icmp6_router_solicitation_header_t *h0;
1552 b0->
current_length =
sizeof( icmp6_router_solicitation_header_t);
1553 b0->
error = ICMP6_ERROR_NONE;
1558 clib_memset (h0, 0,
sizeof (icmp6_router_solicitation_header_t));
1560 h0->ip.ip_version_traffic_class_and_flow_label = clib_host_to_net_u32 (0x6 << 28);
1561 h0->ip.payload_length = clib_host_to_net_u16 (
sizeof (icmp6_router_solicitation_header_t)
1563 h0->ip.protocol = IP_PROTOCOL_ICMP6;
1564 h0->ip.hop_limit = 255;
1567 h0->ip.src_address.as_u64[0] = 0;
1568 h0->ip.src_address.as_u64[1] = 0;
1570 h0->ip.dst_address.as_u64[0] = 0;
1571 h0->ip.dst_address.as_u64[1] = 0;
1573 h0->neighbor.icmp.type = ICMP6_router_solicitation;
1623 uword *event_data = 0;
1634 if (event_type == ~0)
1644 r = (
void *) (event_data[
i]);
1650 return frame->n_vectors;
1657 .name =
"ip6-ra-process",
1688 u8 suppress,
u8 managed,
u8 other,
1689 u8 ll_option,
u8 send_unicast,
u8 cease,
1691 u32 initial_count,
u32 initial_interval,
1692 u32 max_interval,
u32 min_interval,
u8 is_no)
1700 return (VNET_API_ERROR_IP6_NOT_ENABLED);
1702 if ((max_interval != 0) && (min_interval == 0))
1703 min_interval = .75 * max_interval;
1724 return VNET_API_ERROR_INVALID_VALUE;
1727 if (min_interval != 0)
1729 if ((min_interval > .75 * max_interval) || (min_interval < 3))
1730 return VNET_API_ERROR_INVALID_VALUE;
1735 return VNET_API_ERROR_INVALID_VALUE;
1742 (suppress != 0) ? ((is_no != 0) ? 1 : 0) : radv_info->
send_radv;
1750 (send_unicast != 0) ? ((is_no) ? 0 : 1) : radv_info->
send_unicast;
1752 (cease != 0) ? ((is_no) ? 0 : 1) : radv_info->
cease_radv;
1763 (initial_interval !=
1768 if ((cease != 0) && (is_no))
1782 ip6_address_t * prefix_addr,
u8 prefix_len,
1783 u8 use_default,
u32 val_lifetime,
u32 pref_lifetime,
1784 u8 no_advertise,
u8 off_link,
u8 no_autoconfig,
1785 u8 no_onlink,
u8 is_no)
1793 return (VNET_API_ERROR_IP6_NOT_ENABLED);
1809 return VNET_API_ERROR_INVALID_VALUE;
1811 if (
prefix->prefix_len != prefix_len)
1812 return VNET_API_ERROR_INVALID_VALUE_2;
1841 prefix->prefix_len = prefix_len;
1845 prefix->adv_on_link_flag = 1;
1846 prefix->adv_autonomous_flag = 1;
1850 prefix->decrement_lifetime_flag = 1;
1851 prefix->deprecated_prefix_flag = 1;
1865 if (
prefix->prefix_len != prefix_len)
1866 return VNET_API_ERROR_INVALID_VALUE_2;
1875 if ((val_lifetime == ~0) || (pref_lifetime == ~0))
1877 prefix->adv_valid_lifetime_in_secs = ~0;
1878 prefix->adv_pref_lifetime_in_secs = ~0;
1879 prefix->decrement_lifetime_flag = 0;
1883 prefix->adv_valid_lifetime_in_secs = val_lifetime;;
1884 prefix->adv_pref_lifetime_in_secs = pref_lifetime;
1888 prefix->enabled = !(no_advertise != 0);
1889 prefix->adv_on_link_flag = !((off_link != 0) || (no_onlink != 0));
1890 prefix->adv_autonomous_flag = !(no_autoconfig != 0);
1895 prefix->valid_lifetime_expires =
now +
prefix->adv_valid_lifetime_in_secs;
1896 prefix->pref_lifetime_expires =
now +
prefix->adv_pref_lifetime_in_secs;
1913 u8 suppress = 0, managed = 0, other = 0;
1914 u8 suppress_ll_option = 0, send_unicast = 0, cease = 0;
1915 u8 use_lifetime = 0;
1917 0, ra_initial_interval = 0;
1918 u32 ra_max_interval = 0, ra_min_interval = 0;
1922 int add_radv_info = 1;
1923 ip6_address_t ip6_addr;
1965 else if (
unformat (line_input,
"prefix %U/%d",
1970 else if (
unformat (line_input,
"ra-managed-config-flag"))
1974 else if (
unformat (line_input,
"ra-other-config-flag"))
1978 else if (
unformat (line_input,
"ra-suppress") ||
1979 unformat (line_input,
"ra-surpress"))
1983 else if (
unformat (line_input,
"ra-suppress-link-layer") ||
1984 unformat (line_input,
"ra-surpress-link-layer"))
1986 suppress_ll_option = 1;
1988 else if (
unformat (line_input,
"ra-send-unicast"))
1992 else if (
unformat (line_input,
"ra-lifetime"))
1994 if (!
unformat (line_input,
"%d", &ra_lifetime))
2001 else if (
unformat (line_input,
"ra-initial"))
2004 (line_input,
"%d %d", &ra_initial_count, &ra_initial_interval))
2010 else if (
unformat (line_input,
"ra-interval"))
2012 if (!
unformat (line_input,
"%d", &ra_max_interval))
2018 if (!
unformat (line_input,
"%d", &ra_min_interval))
2019 ra_min_interval = 0;
2021 else if (
unformat (line_input,
"ra-cease"))
2035 suppress, managed, other,
2036 suppress_ll_option, send_unicast, cease,
2037 use_lifetime, ra_lifetime,
2038 ra_initial_count, ra_initial_interval,
2039 ra_max_interval, ra_min_interval, is_no);
2043 u32 valid_lifetime_in_secs = 0;
2044 u32 pref_lifetime_in_secs = 0;
2045 u8 use_prefix_default_values = 0;
2046 u8 no_advertise = 0;
2048 u8 no_autoconfig = 0;
2054 if (
unformat (line_input,
"default"))
2056 use_prefix_default_values = 1;
2059 else if (
unformat (line_input,
"infinite"))
2061 valid_lifetime_in_secs = ~0;
2062 pref_lifetime_in_secs = ~0;
2065 else if (
unformat (line_input,
"%d %d", &valid_lifetime_in_secs,
2066 &pref_lifetime_in_secs))
2074 while (!use_prefix_default_values &&
2077 if (
unformat (line_input,
"no-advertise"))
2079 else if (
unformat (line_input,
"off-link"))
2081 else if (
unformat (line_input,
"no-autoconfig"))
2083 else if (
unformat (line_input,
"no-onlink"))
2093 &ip6_addr, addr_len,
2094 use_prefix_default_values,
2095 valid_lifetime_in_secs,
2096 pref_lifetime_in_secs,
2097 no_advertise, off_link, no_autoconfig, no_onlink, is_no);
2110 u32 indent = va_arg (*args,
u32);
2123 s =
format (s,
"%Uprefix %U, length %d\n",
2129 s =
format (s,
"%UMTU is %d\n",
2131 s =
format (s,
"%UICMP error messages are unlimited\n",
2133 s =
format (s,
"%UICMP redirects are disabled\n",
2135 s =
format (s,
"%UICMP unreachables are not sent\n",
2139 s =
format (s,
"%UND advertised reachable time is %d\n",
2143 "%UND advertised retransmit interval is %d (msec)\n",
2146 adv_time_in_msec_between_retransmitted_neighbor_solicitations);
2149 "%UND router advertisements are sent every %0.1f seconds (min interval is %0.1f)\n",
2153 format (s,
"%UND router advertisements live for %d seconds\n",
2157 format (s,
"%UHosts %s stateless autoconfig for addresses\n",
2293 .short_help =
"ip6 nd <interface> ...",
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
#define MIN_DELAY_BETWEEN_RAS
int adv_link_layer_address
int ip6_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)
#define pool_flush(VAR, POOL, BODY)
Remove all elements from a pool in a safe way.
static void ip6_ra_link_enable(u32 sw_if_index)
called when IP6 is enabled on an interface create and initialize router advertisement parameters with...
static clib_error_t * ip6_ra_init(vlib_main_t *vm)
static uword ip6_address_is_link_local_unicast(const ip6_address_t *a)
vnet_interface_main_t * im
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
icmp6_send_router_solicitation_params_t params
index_t ip6_link_delegate_get(u32 sw_if_index, ip6_link_delegate_id_t id)
vnet_sw_interface_type_t type
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
static ip6_ra_t * ip6_ra_get_itf(u32 sw_if_index)
@ ICMP6_ROUTER_SOLICITATION_NEXT_DROP
u16 ip6_tcp_udp_icmp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip6_header_t *ip0, int *bogus_lengthp)
static uword ip6_ra_process_timer_event(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
@ ICMP6_ROUTER_SOLICITATION_N_NEXT
static vlib_buffer_t * vlib_buffer_copy(vlib_main_t *vm, vlib_buffer_t *b)
#define clib_memcpy(d, s, n)
nat44_ei_hairpin_src_next_t next_index
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#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.
enum icmp6_neighbor_discovery_option_type icmp6_neighbor_discovery_option_type_t
u16 adv_router_lifetime_in_sec
static void ip6_address_mask_from_width(ip6_address_t *a, u32 width)
#define DEF_CURR_HOP_LIMIT
static void ip6_ra_signal_report(ip6_ra_report_t *r)
#define MIN_ADV_VALID_LIFETIME
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)
static void clib_mem_free(void *p)
u32 initial_adverts_count
vlib_main_t vlib_node_runtime_t * node
int deprecated_prefix_flag
#define clib_error_return(e, args...)
#define DEF_ADV_VALID_LIFETIME
icmp6_router_advertisement_packet_t
ip6_link_disable_fn_t ildv_disable
int ip6_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)
bool ip6_link_delegate_update(u32 sw_if_index, ip6_link_delegate_id_t id, index_t ii)
typedef CLIB_PACKED(struct { ip6_header_t ip;icmp6_neighbor_discovery_header_t neighbor;icmp6_neighbor_discovery_ethernet_link_layer_address_option_t link_layer_option;})
#define vlib_call_init_function(vm, x)
#define pool_put(P, E)
Free an object E in pool P.
static uword * mhash_get(mhash_t *h, const void *key)
u32 n_advertisements_sent
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static int ip6_ra_publish(ip6_ra_report_t *r)
void icmp6_send_router_solicitation(vlib_main_t *vm, u32 sw_if_index, u8 stop, const icmp6_send_router_solicitation_params_t *params)
__clib_export u32 elog_string(elog_main_t *em, char *fmt,...)
add a string to the event-log string table
static uword ip6_address_is_unspecified(const ip6_address_t *a)
f64 pref_lifetime_expires
__clib_export void mhash_init(mhash_t *h, uword n_value_bytes, uword n_key_bytes)
vnet_hw_if_output_node_runtime_t * r
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
static void * ip6_next_header(ip6_header_t *i)
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
static f64 random_f64(u32 *seed)
Generate f64 random number in the interval [0,1].
static ip6_ra_report_notify_t * ip6_ra_listeners
#define DEF_MIN_RADV_INTERVAL
ip6_link_delegate_id_t ip6_link_delegate_register(const ip6_link_delegate_vft_t *vft)
#define foreach_log_level
static u32 random_u32(u32 *seed)
32-bit random number generator
void icmp6_register_type(vlib_main_t *vm, icmp6_type_t type, u32 node_index)
static uword vlib_process_get_events(vlib_main_t *vm, uword **data_vector)
Return the first event type which has occurred and a vector of per-event data of that type,...
#define STRUCT_OFFSET_OF(t, f)
static ip6_link_delegate_id_t ip6_ra_delegate_id
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
vlib_error_t * errors
Vector of errors for this node.
#define pool_foreach(VAR, POOL)
Iterate through pool.
static u8 get_mac_address(u32 sw_if_index, u8 *address)
static uword ip6_address_is_equal_masked(const ip6_address_t *a, const ip6_address_t *b, const ip6_address_t *mask)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define ELOG_TYPE_DECLARE(f)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static __clib_warn_unused_result u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
u32 adv_pref_lifetime_in_secs
static f64 random_f64_from_to(f64 from, f64 to)
const static ip6_link_delegate_vft_t ip6_ra_delegate_vft
VFT for registering as a delegate to an IP6 link.
const ip6_address_t * ip6_get_link_local_address(u32 sw_if_index)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
vnet_main_t * vnet_get_main(void)
#define VLIB_NODE_FLAG_TRACE
#define ICMP6_ROUTER_DISCOVERY_FLAG_ADDRESS_CONFIG_VIA_DHCP
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
u32 ip6_link_delegate_id_t
static u32 vlib_get_buffer_index(vlib_main_t *vm, void *p)
Translate buffer pointer into buffer index.
#define MAX_DELAY_BETWEEN_RAS
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define ICMP6_NEIGHBOR_DISCOVERY_PREFIX_INFORMATION_FLAG_ON_LINK
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static void stop_sending_rs(vlib_main_t *vm, ip6_ra_t *ra)
#define static_always_inline
vlib_node_registration_t ip6_rewrite_mcast_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_mcast_node)
#define ICMP6_NEIGHBOR_DISCOVERY_PREFIX_INFORMATION_AUTO
#define vec_foreach_index(var, v)
Iterate over vector indices.
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
static clib_error_t * icmp6_init(vlib_main_t *vm)
u32 n_solicitations_dropped
#define MAX_INITIAL_RTR_ADVERT_INTERVAL
static elog_main_t * vlib_get_elog_main()
sll srl srl sll sra u16x4 i
ip6_radv_prefix_t * adv_prefixes_pool
static vlib_cli_command_t ip6_nd_command
(constructor) VLIB_CLI_COMMAND (ip6_nd_command)
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.
ra_report_prefix_info_t * prefixes
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
manual_print typedef address
#define VLIB_CLI_COMMAND(x,...)
static u32 vnet_sw_interface_get_mtu(vnet_main_t *vnm, u32 sw_if_index, vnet_mtu_t af)
#define ICMP6_ROUTER_DISCOVERY_FLAG_OTHER_CONFIG_VIA_DHCP
u32 adv_time_in_msec_between_retransmitted_neighbor_solicitations
static void ip6_address_copy(ip6_address_t *dst, const ip6_address_t *src)
static uword ip6_ra_event_process(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u32 adv_valid_lifetime_in_secs
icmp6_router_solicitation_or_advertisement_next_t
struct _vlib_node_registration vlib_node_registration_t
void(* ip6_ra_report_notify_t)(const ip6_ra_report_t *rap)
#define DEF_DEF_RTR_LIFETIME
u16 current_length
Nbytes between current data and the end of this buffer.
static uword vnet_sw_interface_is_admin_up(vnet_main_t *vnm, u32 sw_if_index)
ethernet_interface_t * ethernet_get_interface(ethernet_main_t *em, u32 hw_if_index)
void ip6_ra_report_unregister(ip6_ra_report_notify_t fn)
format_function_t format_icmp6_input_trace
static void ip6_set_reserved_multicast_address(ip6_address_t *a, ip6_multicast_address_scope_t scope, u16 id)
clib_error_t * ip6_ra_cmd(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
u32 adv_neighbor_reachable_time_in_msec
bool ip6_link_is_enabled(u32 sw_if_index)
#define vec_free(V)
Free vector's memory (no header).
#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.
void ip6_ra_update_secondary_radv_info(ip6_address_t *address, u8 prefix_len, u32 primary_sw_if_index, u32 valid_time, u32 preferred_time)
u32 node_index
Node index.
static vlib_node_registration_t ip6_icmp_router_advertisement_node
(constructor) VLIB_REGISTER_NODE (ip6_icmp_router_advertisement_node)
static u8 * format_ip6_ra(u8 *s, va_list *args)
mhash_t address_to_prefix_index
u32 local_interface_sw_if_index
ethernet_main_t ethernet_main
f64 max_delay_between_radv
format_function_t format_vnet_sw_if_index_name
unformat_function_t unformat_vnet_sw_interface
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...
description fragment has unexpected format
vlib_put_next_frame(vm, node, next_index, 0)
void ip_neighbor_learn_dp(const ip_neighbor_learn_t *l)
APIs invoked by neighbor implementation (i.s.
@ ICMP6_ROUTER_SOLICITATION_NEXT_REPLY_RW
struct ip6_ra_t_ ip6_ra_t
#define VLIB_INIT_FUNCTION(x)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
static_always_inline uword icmp6_router_solicitation(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define MAX_INITIAL_RTR_ADVERTISEMENTS
vlib_node_registration_t ip6_ra_process_node
(constructor) VLIB_REGISTER_NODE (ip6_ra_process_node)
static void ip6_ra_handle_report(ip6_ra_report_t *rap)
int decrement_lifetime_flag
#define vec_foreach(var, vec)
Vector iterator.
void vl_api_rpc_call_main_thread(void *fp, u8 *data, u32 data_length)
static vlib_buffer_t * create_buffer_for_rs(vlib_main_t *vm, ip6_ra_t *radv_info)
#define DEF_ADV_PREF_LIFETIME
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
static void ip6_ra_delegate_disable(index_t rai)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static vlib_node_registration_t ip6_icmp_router_solicitation_node
(constructor) VLIB_REGISTER_NODE (ip6_icmp_router_solicitation_node)
f64 min_delay_between_radv
static bool check_send_rs(vlib_main_t *vm, ip6_ra_t *radv_info, f64 current_time, f64 *due_time)
f64 max_rtr_default_lifetime
static uword send_rs_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f0)
static vlib_main_t * vlib_get_main(void)
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vnet_interface_output_runtime_t * rt
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
adj_index_t ip6_link_get_mcast_adj(u32 sw_if_index)
f64 valid_lifetime_expires
@ ICMP6_ROUTER_SOLICITATION_NEXT_REPLY_TX
#define pool_free(p)
Free a pool.
static ip6_ra_t * ip6_ra_pool
#define clib_warning(format, args...)
static void ip6_neighbor_syslog(vlib_main_t *vm, int priority, char *fmt,...)
void ip6_ra_report_register(ip6_ra_report_notify_t fn)
vlib_node_registration_t ip6_icmp_input_node
(constructor) VLIB_REGISTER_NODE (ip6_icmp_input_node)
static f64 vlib_time_now(vlib_main_t *vm)
@ VNET_SW_INTERFACE_TYPE_HARDWARE
int vlib_buffer_add_data(vlib_main_t *vm, u32 *buffer_index, void *data, u32 n_data_bytes)
static char * log_level_strings[]
static void vlib_buffer_reset(vlib_buffer_t *b)
Reset current header & length to state they were in when packet was received.
static vnet_sw_interface_t * vnet_get_sup_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
static u64 clib_cpu_time_now(void)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
vl_api_interface_index_t sw_if_index
#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).
ethernet_interface_address_t address
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
__clib_export uword mhash_unset(mhash_t *h, void *key, uword *old_value)
static void * clib_mem_alloc(uword size)
static void mhash_free(mhash_t *h)
vlib_node_registration_t ip6_rs_process_node
(constructor) VLIB_REGISTER_NODE (ip6_rs_process_node)
f64 initial_adverts_interval
#define vec_del1(v, i)
Delete the element at index I.
#define DEF_MAX_RADV_INTERVAL
static uword mhash_set(mhash_t *h, void *key, uword new_value, uword *old_value)
static const ethernet_interface_t * ip6_ra_get_eth_itf(u32 sw_if_index)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)
static uword random_default_seed(void)
Default random seed (unix/linux user-mode)