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 186 if (ip6_ra_listeners[ii] == fn)
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, 225 static char *log_level_strings[] = {
231 static int logmask = 1 << LOG_DEBUG;
240 if ((priority > LOG_EMERG) || !(logmask & (1 << priority)))
250 .format =
"ip6 nd: (%s): %s",.format_args =
"T4T4",};
280 u32 n_left_from, n_left_to_next, next_index;
290 n_left_from = n_packets;
299 option_type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
301 while (n_left_from > 0)
305 while (n_left_from > 0 && n_left_to_next > 0)
311 icmp6_neighbor_discovery_header_t *h0;
312 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t *o0;
314 u32 bi0, options_len0, sw_if_index0, next0, error0;
315 u32 is_solicitation = 1, is_dropped = 0;
316 u32 is_unspecified, is_link_local;
318 bi0 = to_next[0] = from[0];
334 error0 = ICMP6_ERROR_NONE;
342 if (!is_unspecified && !is_link_local)
350 error0 = (adj0->rewrite_header.sw_if_index != sw_if_index0
352 ICMP6_ERROR_ROUTER_SOLICITATION_SOURCE_NOT_ON_LINK
357 error0 = ICMP6_ERROR_ROUTER_SOLICITATION_SOURCE_NOT_ON_LINK;
362 o0 = (
void *) (h0 + 1);
363 o0 = ((options_len0 == 8
364 && o0->header.type == option_type
365 && o0->header.n_data_u64s == 1) ? o0 : 0);
368 if (
PREDICT_TRUE (error0 == ICMP6_ERROR_NONE && o0 != 0 &&
369 !is_unspecified && !is_link_local))
380 memcpy (&learn.
mac, o0->ethernet_address, sizeof (learn.
mac));
387 if (error0 == ICMP6_ERROR_NONE)
400 (!eth_if0) ? ICMP6_ERROR_ROUTER_SOLICITATION_UNSUPPORTED_INTF
403 if (error0 == ICMP6_ERROR_NONE)
408 sizeof (icmp6_neighbor_discovery_header_t));
412 error0 = ((!radv_info) ?
413 ICMP6_ERROR_ROUTER_SOLICITATION_RADV_NOT_CONFIG :
416 if (error0 == ICMP6_ERROR_NONE)
432 icmp6_router_advertisement_header_t rh;
434 rh.icmp.type = ICMP6_router_advertisement;
436 rh.icmp.checksum = 0;
439 rh.router_lifetime_in_sec =
443 time_in_msec_between_retransmitted_neighbor_solicitations
445 clib_host_to_net_u32 (radv_info->
447 rh.neighbor_reachable_time_in_msec =
448 clib_host_to_net_u32 (radv_info->
462 sizeof (icmp6_router_advertisement_header_t);
465 (vm, &bi0, (
void *) &rh,
466 sizeof (icmp6_router_advertisement_header_t)))
469 error0 = ICMP6_ERROR_ALLOC_FAILURE;
475 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t
479 ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
480 h.header.n_data_u64s = 1;
487 (vm, &bi0, (
void *) &h,
489 (icmp6_neighbor_discovery_ethernet_link_layer_address_option_t)))
491 error0 = ICMP6_ERROR_ALLOC_FAILURE;
497 (icmp6_neighbor_discovery_ethernet_link_layer_address_option_t);
503 icmp6_neighbor_discovery_mtu_option_t
h;
508 h.header.type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_mtu;
509 h.header.n_data_u64s = 1;
512 sizeof (icmp6_neighbor_discovery_mtu_option_t);
515 (vm, &bi0, (
void *) &h,
517 (icmp6_neighbor_discovery_mtu_option_t)))
519 error0 = ICMP6_ERROR_ALLOC_FAILURE;
535 icmp6_neighbor_discovery_prefix_information_option_t
h;
537 h.header.type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_prefix_information;
538 h.header.n_data_u64s = (
sizeof(icmp6_neighbor_discovery_prefix_information_option_t) >> 3);
548 h.preferred_time = 0;
567 if (0 && CLIB_DEBUG > 0)
569 (
"send RA for prefix %U/%d " 570 "sw_if_index %d valid %u preferred %u",
573 clib_net_to_host_u32 (h.valid_time),
574 clib_net_to_host_u32 (h.preferred_time));
576 if (h.valid_time == 0)
581 payload_length +=
sizeof( icmp6_neighbor_discovery_prefix_information_option_t);
584 (vm, &bi0, (
void *)&h,
585 sizeof(icmp6_neighbor_discovery_prefix_information_option_t)))
587 error0 = ICMP6_ERROR_ALLOC_FAILURE;
607 IP6_MULTICAST_SCOPE_link_local,
608 IP6_MULTICAST_GROUP_ID_all_hosts);
618 clib_host_to_net_u16 (payload_length);
620 icmp6_router_advertisement_header_t *rh0 =
621 (icmp6_router_advertisement_header_t *) (ip0 + 1);
625 ASSERT (bogus_length == 0);
652 error0 = ICMP6_ERROR_DST_LOOKUP_MISS;
662 p0->
flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
667 if ((error0 == ICMP6_ERROR_NONE) && !is_dropped)
670 n_advertisements_sent++;
679 if (error0 != ICMP6_ERROR_NONE)
683 to_next, n_left_to_next,
693 ICMP6_ERROR_ROUTER_ADVERTISEMENTS_TX,
694 n_advertisements_sent);
703 .name =
"icmp6-router-solicitation",
705 .vector_size =
sizeof (
u32),
726 u32 n_left_from, n_left_to_next, next_index;
727 u32 n_advertisements_rcvd = 0;
733 n_left_from = n_packets;
741 while (n_left_from > 0)
745 while (n_left_from > 0 && n_left_to_next > 0)
750 icmp6_router_advertisement_header_t *h0;
751 u32 bi0, options_len0, sw_if_index0, next0, error0;
753 bi0 = to_next[0] = from[0];
766 error0 = ICMP6_ERROR_NONE;
771 ICMP6_ERROR_ROUTER_ADVERTISEMENT_SOURCE_NOT_LINK_LOCAL : error0;
776 n_advertisements_rcvd++;
778 if (error0 == ICMP6_ERROR_NONE)
790 (!eth_if0) ? ICMP6_ERROR_ROUTER_SOLICITATION_UNSUPPORTED_INTF
793 if (error0 == ICMP6_ERROR_NONE)
798 error0 = ((!radv_info) ?
799 ICMP6_ERROR_ROUTER_SOLICITATION_RADV_NOT_CONFIG :
802 if (error0 == ICMP6_ERROR_NONE)
813 clib_net_to_host_u16 (h0->router_lifetime_in_sec);
816 (h0->neighbor_reachable_time_in_msec);
822 && (h0->current_hop_limit !=
826 "our AdvCurHopLimit on %U doesn't agree with %U",
838 "our AdvManagedFlag on %U doesn't agree with %U",
850 "our AdvOtherConfigFlag on %U doesn't agree with %U",
858 time_in_msec_between_retransmitted_neighbor_solicitations
862 time_in_msec_between_retransmitted_neighbor_solicitations
864 clib_host_to_net_u32 (radv_info->
868 "our AdvRetransTimer on %U doesn't agree with %U",
875 if ((h0->neighbor_reachable_time_in_msec &&
877 (h0->neighbor_reachable_time_in_msec !=
882 "our AdvReachableTime on %U doesn't agree with %U",
890 u8 *opt_hdr = (
u8 *) (h0 + 1);
891 while (options_len0 > 0)
893 icmp6_neighbor_discovery_option_header_t *o0 =
894 (icmp6_neighbor_discovery_option_header_t *)
896 int opt_len = o0->n_data_u64s << 3;
900 if (options_len0 < 2)
903 "malformed RA packet on %U from %U",
914 " zero length option in RA on %U from %U",
921 else if (opt_len > options_len0)
924 "option length in RA packet greater than total length on %U from %U",
932 options_len0 -= opt_len;
937 case ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address:
939 icmp6_neighbor_discovery_ethernet_link_layer_address_option_t
941 (icmp6_neighbor_discovery_ethernet_link_layer_address_option_t
944 if (opt_len <
sizeof (*h))
947 memcpy (r.
slla, h->ethernet_address, 6);
951 case ICMP6_NEIGHBOR_DISCOVERY_OPTION_mtu:
953 icmp6_neighbor_discovery_mtu_option_t *
h =
954 (icmp6_neighbor_discovery_mtu_option_t
957 if (opt_len <
sizeof (*h))
960 r.
mtu = clib_net_to_host_u32 (h->mtu);
968 "our AdvLinkMTU on %U doesn't agree with %U",
977 case ICMP6_NEIGHBOR_DISCOVERY_OPTION_prefix_information:
979 icmp6_neighbor_discovery_prefix_information_option_t
981 (icmp6_neighbor_discovery_prefix_information_option_t
986 u32 preferred, valid;
988 if (opt_len <
sizeof (*h))
998 clib_net_to_host_u32 (h->preferred_time);
999 valid = clib_net_to_host_u32 (h->valid_time);
1003 prefix->
flags = h->flags & 0xc0;
1017 (pr_info->
prefix_len == h->dst_address_length) &&
1025 "our ADV validlifetime on %U for %U does not agree with %U",
1033 "our ADV preferredlifetime on %U for %U does not agree with %U",
1055 if (error0 != ICMP6_ERROR_NONE)
1059 to_next, n_left_to_next,
1068 ICMP6_ERROR_ROUTER_ADVERTISEMENTS_RX,
1069 n_advertisements_rcvd);
1078 .name =
"icmp6-router-advertisement",
1080 .vector_size =
sizeof (
u32),
1095 static u8 seed_set = 0;
1101 return random_f64 (&seed) * (to - from) + from;
1120 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",
1313 ASSERT (~0 != sw_if_index);
1368 ip6_ra_delegate_id));
1400 sizeof (ip6_address_t));
1403 radv_info - ip6_ra_pool);
1418 mhash_unset (&radv_info->address_to_prefix_index, &p->prefix, 0);
1431 u32 primary_sw_if_index,
1435 static u32 *radv_indices;
1445 vec_add1 (radv_indices, radv_info - ip6_ra_pool);
1453 for (i = 0; i <
vec_len (radv_indices); i++)
1459 if (radv_info->
sw_if_index == primary_sw_if_index)
1482 clib_warning (
"ip6_neighbor_ra_prefix returned %d", rv);
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)
1642 for (i = 0; i <
vec_len (event_data); i++)
1644 r = (
void *) (event_data[i]);
1657 .name =
"ip6-ra-process",
1668 if (!
vec_len (ip6_ra_listeners))
1688 u8 suppress,
u8 managed,
u8 other,
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;
1723 if (lifetime <= 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;
1812 return VNET_API_ERROR_INVALID_VALUE_2;
1866 return VNET_API_ERROR_INVALID_VALUE_2;
1875 if ((val_lifetime == ~0) || (pref_lifetime == ~0))
1888 prefix->
enabled = !(no_advertise != 0);
1913 u8 suppress = 0, managed = 0, other = 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,
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",
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> ...",
2313 ip6_icmp_router_solicitation_node.index);
2315 ip6_icmp_router_advertisement_node.index);
void ip6_ra_report_register(ip6_ra_report_notify_t fn)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
fib_protocol_t fp_proto
protocol type
struct ip6_ra_t_ ip6_ra_t
#define vec_foreach_index(var, v)
Iterate over vector indices.
#define DEF_ADV_VALID_LIFETIME
static uword ip6_ra_process_timer_event(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define ICMP6_ROUTER_DISCOVERY_FLAG_OTHER_CONFIG_VIA_DHCP
static uword random_default_seed(void)
Default random seed (unix/linux user-mode)
static void vlib_buffer_reset(vlib_buffer_t *b)
Reset current header & length to state they were in when packet was received.
static 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...
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
static int ip6_ra_publish(ip6_ra_report_t *r)
#define ICMP6_NEIGHBOR_DISCOVERY_PREFIX_INFORMATION_AUTO
#define MIN_ADV_VALID_LIFETIME
vnet_main_t * vnet_get_main(void)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
#define pool_foreach(VAR, POOL)
Iterate through pool.
#define DEF_MAX_RADV_INTERVAL
static ip6_ra_report_notify_t * ip6_ra_listeners
void ip_neighbor_learn_dp(const ip_neighbor_learn_t *l)
APIs invoked by neighbor implementation (i.s.
static void vlib_error_count(vlib_main_t *vm, uword node_index, uword counter, uword increment)
u32 initial_adverts_count
u16 router_lifetime_in_sec
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static f64 vlib_time_now(vlib_main_t *vm)
static ip6_ra_t * ip6_ra_get_itf(u32 sw_if_index)
u32 time_in_msec_between_retransmitted_neighbor_solicitations
int vlib_buffer_add_data(vlib_main_t *vm, u32 *buffer_index, void *data, u32 n_data_bytes)
#define MIN_DELAY_BETWEEN_RAS
u16 current_length
Nbytes between current data and the end of this buffer.
u32 adv_time_in_msec_between_retransmitted_neighbor_solicitations
#define foreach_log_level
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static u64 clib_cpu_time_now(void)
static ip6_link_delegate_id_t ip6_ra_delegate_id
void icmp6_send_router_solicitation(vlib_main_t *vm, u32 sw_if_index, u8 stop, const icmp6_send_router_solicitation_params_t *params)
#define STRUCT_OFFSET_OF(t, f)
u32 adv_pref_lifetime_in_secs
u32 n_solicitations_dropped
static u32 vnet_sw_interface_get_mtu(vnet_main_t *vnm, u32 sw_if_index, vnet_mtu_t af)
unformat_function_t unformat_vnet_sw_interface
adj_index_t ip6_link_get_mcast_adj(u32 sw_if_index)
vlib_error_t * errors
Vector of errors for this node.
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)
format_function_t format_vnet_sw_if_index_name
static vlib_buffer_t * vlib_buffer_copy(vlib_main_t *vm, vlib_buffer_t *b)
icmp6_router_advertisement_packet_t
static f64 random_f64_from_to(f64 from, f64 to)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
#define clib_memcpy(d, s, n)
vlib_node_registration_t ip6_rewrite_mcast_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_mcast_node)
ethernet_main_t ethernet_main
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
#define DEF_CURR_HOP_LIMIT
#define static_always_inline
static void ip6_ra_signal_report(ip6_ra_report_t *r)
#define VLIB_INIT_FUNCTION(x)
static uword vlib_process_get_events(vlib_main_t *vm, uword **data_vector)
Return the first event type which has occurred and a vector of per-event data of that type...
u32 local_interface_sw_if_index
#define DEF_MIN_RADV_INTERVAL
icmp6_send_router_solicitation_params_t params
description fragment has unexpected format
ip6_radv_prefix_t * adv_prefixes_pool
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 vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static vnet_sw_interface_t * vnet_get_sup_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
#define clib_error_return(e, args...)
static u32 ip6_src_lookup_for_packet(ip6_main_t *im, vlib_buffer_t *b, ip6_header_t *i)
return the DPO that the LB stacks on.
void vl_api_rpc_call_main_thread(void *fp, u8 *data, u32 data_length)
u32 n_advertisements_sent
static clib_error_t * icmp6_init(vlib_main_t *vm)
u16 fp_len
The mask length.
#define vlib_call_init_function(vm, x)
ip6_address_t router_address
static u32 vlib_get_buffer_index(vlib_main_t *vm, void *p)
Translate buffer pointer into buffer index.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define pool_flush(VAR, POOL, BODY)
Remove all elements from a pool in a safe way.
f64 pref_lifetime_expires
#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.
#define DEF_DEF_RTR_LIFETIME
void ip6_ra_report_unregister(ip6_ra_report_notify_t fn)
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
static u8 get_mac_address(u32 sw_if_index, u8 *address)
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
static __clib_warn_unused_result u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define pool_put(P, E)
Free an object E in pool P.
enum icmp6_neighbor_discovery_option_type icmp6_neighbor_discovery_option_type_t
ethernet_interface_address_t address
#define vec_del1(v, i)
Delete the element at index I.
f64 min_delay_between_radv
#define MAX_DELAY_BETWEEN_RAS
f64 max_delay_between_radv
icmp6_router_solicitation_or_advertisement_next_t
u32 node_index
Node index.
#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).
static uword ip6_address_is_equal_masked(const ip6_address_t *a, const ip6_address_t *b, const ip6_address_t *mask)
ip6_link_delegate_id_t ip6_link_delegate_register(const ip6_link_delegate_vft_t *vft)
__clib_export void mhash_init(mhash_t *h, uword n_value_bytes, uword n_key_bytes)
vlib_node_registration_t ip6_icmp_input_node
(constructor) VLIB_REGISTER_NODE (ip6_icmp_input_node)
int adv_link_layer_address
#define pool_free(p)
Free a pool.
#define VLIB_REGISTER_NODE(x,...)
u32 neighbor_reachable_time_in_msec
static_always_inline uword icmp6_router_advertisement(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
sll srl srl sll sra u16x4 i
static void stop_sending_rs(vlib_main_t *vm, ip6_ra_t *ra)
#define vec_free(V)
Free vector's memory (no header).
static u8 * format_ip6_ra(u8 *s, va_list *args)
#define MAX_DEF_RTR_LIFETIME
#define clib_warning(format, args...)
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
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.
#define MAX_INITIAL_RTR_ADVERT_INTERVAL
#define ELOG_TYPE_DECLARE(f)
index_t ip6_link_delegate_get(u32 sw_if_index, ip6_link_delegate_id_t id)
f64 initial_adverts_interval
ra_report_prefix_info_t * prefixes
static void * ip6_next_header(ip6_header_t *i)
static bool check_send_rs(vlib_main_t *vm, ip6_ra_t *radv_info, f64 current_time, f64 *due_time)
vlib_main_t vlib_node_runtime_t * node
#define VLIB_CLI_COMMAND(x,...)
u16 ip6_tcp_udp_icmp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip6_header_t *ip0, int *bogus_lengthp)
f64 valid_lifetime_expires
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
mhash_t address_to_prefix_index
u32 ip6_link_delegate_id_t
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)
static void ip6_neighbor_syslog(vlib_main_t *vm, int priority, char *fmt,...)
manual_print typedef address
static uword * mhash_get(mhash_t *h, const void *key)
static void mhash_free(mhash_t *h)
static ip6_ra_t * ip6_ra_pool
static void clib_mem_free(void *p)
void(* ip6_ra_report_notify_t)(const ip6_ra_report_t *rap)
static uword ip6_ra_event_process(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static f64 random_f64(u32 *seed)
Generate f64 random number in the interval [0,1].
int deprecated_prefix_flag
static void ip6_ra_delegate_disable(index_t rai)
static uword ip6_address_is_link_local_unicast(const ip6_address_t *a)
static void * clib_mem_alloc(uword size)
static vlib_main_t * vlib_get_main(void)
static_always_inline uword icmp6_router_solicitation(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static uword vnet_sw_interface_is_admin_up(vnet_main_t *vnm, u32 sw_if_index)
ip6_link_disable_fn_t ildv_disable
static void ip6_ra_handle_report(ip6_ra_report_t *rap)
__clib_export uword mhash_unset(mhash_t *h, void *key, uword *old_value)
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 * ip6_ra_cmd(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
ethernet_interface_t * ethernet_get_interface(ethernet_main_t *em, u32 hw_if_index)
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)
const ip6_address_t * ip6_get_link_local_address(u32 sw_if_index)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
#define VLIB_BUFFER_TRACE_TRAJECTORY_INIT(b)
#define ICMP6_NEIGHBOR_DISCOVERY_PREFIX_INFORMATION_FLAG_ON_LINK
VLIB buffer representation.
u32 adv_neighbor_reachable_time_in_msec
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
f64 max_rtr_default_lifetime
static const ethernet_interface_t * ip6_ra_get_eth_itf(u32 sw_if_index)
__clib_export u32 elog_string(elog_main_t *em, char *fmt,...)
add a string to the event-log string table
static uword send_rs_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f0)
static void ip6_address_copy(ip6_address_t *dst, const ip6_address_t *src)
bool ip6_link_is_enabled(u32 sw_if_index)
#define ICMP6_ROUTER_DISCOVERY_FLAG_ADDRESS_CONFIG_VIA_DHCP
int decrement_lifetime_flag
static void ip6_address_mask_from_width(ip6_address_t *a, u32 width)
static uword ip6_address_is_unspecified(const ip6_address_t *a)
#define MAX_INITIAL_RTR_ADVERTISEMENTS
static u32 random_u32(u32 *seed)
32-bit random number generator
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)
vnet_sw_interface_type_t type
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)
#define vec_foreach(var, vec)
Vector iterator.
#define DEF_ADV_PREF_LIFETIME
u16 flags
Copy of main node flags.
u32 adv_valid_lifetime_in_secs
static vlib_buffer_t * create_buffer_for_rs(vlib_main_t *vm, ip6_ra_t *radv_info)
#define VLIB_NODE_FLAG_TRACE
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
u16 adv_router_lifetime_in_sec
bool ip6_link_delegate_update(u32 sw_if_index, ip6_link_delegate_id_t id, index_t ii)
static void ip6_set_reserved_multicast_address(ip6_address_t *a, ip6_multicast_address_scope_t scope, u16 id)
format_function_t format_icmp6_input_trace