55 int dst_address_length = 128 - i;
56 vec_add1 (im->prefix_lengths_in_search_order, dst_address_length);
66 BVT(clib_bihash_kv) kv, value;
71 kv.key[0] = dst->
as_u64[0];
72 kv.key[1] = dst->
as_u64[1];
73 fib = ((
u64)((fib_index))<<32);
75 for (i = 0; i < len; i++)
80 ASSERT(dst_address_length >= 0 && dst_address_length <= 128);
82 kv.key[0] &= mask->
as_u64[0];
83 kv.key[1] &= mask->
as_u64[1];
84 kv.key[2] = fib | dst_address_length;
86 rv = BV(clib_bihash_search_inline_2)(&im->ip6_lookup_table, &kv, &value);
121 adj->rewrite_header.data_bytes = 0;
133 adj->rewrite_header.data_bytes = 0;
136 IP6_MULTICAST_SCOPE_link_local,
137 IP6_MULTICAST_GROUP_ID_all_routers);
147 adj->rewrite_header.data_bytes = 0;
150 IP6_MULTICAST_SCOPE_link_local,
151 IP6_MULTICAST_GROUP_ID_all_hosts);
161 adj->rewrite_header.data_bytes = 0;
164 IP6_MULTICAST_SCOPE_link_local,
165 IP6_MULTICAST_GROUP_ID_mldv2_routers);
187 uword * p, fib_index;
189 fib_index = table_index_or_id;
192 if (table_index_or_id == ~0) {
193 table_index_or_id = 0;
213 u32 dst_address_length, adj_index;
215 u32 old_adj_index = ~0;
216 BVT(clib_bihash_kv) kv, value;
247 128 - dst_address_length, 0);
257 128 - dst_address_length, 1);
261 kv.key[0] = dst_address.
as_u64[0];
262 kv.key[1] = dst_address.
as_u64[1];
263 kv.key[2] = ((
u64)((fib - im->
fibs))<<32) | dst_address_length;
266 old_adj_index = value.value;
276 kv.value = adj_index;
282 if (old_adj_index == adj_index
294 && old_adj_index != ~0
295 && old_adj_index != adj_index)
304 u32 next_hop_sw_if_index,
305 u32 explicit_fib_index)
309 int is_interface_next_hop;
318 if (is_interface_next_hop)
321 next_hop_sw_if_index);
323 nh_adj_index = *nh_result;
330 next_hop_sw_if_index, ~0);
332 (lm, next_hop_sw_if_index, 0);
334 next_hop_sw_if_index, nh_adj_index);
337 else if (next_hop_sw_if_index == ~0)
345 memset (&add_adj, 0,
sizeof(add_adj));
355 BVT(clib_bihash_kv) kv, value;
358 kv.key[0] = next_hop->
as_u64[0];
359 kv.key[1] = next_hop->
as_u64[1];
360 kv.key[2] = ((
u64)((fib - im->
fibs))<<32) | 128;
370 adj->
arp.next_hop.ip6.as_u64[0] == 0 &&
371 adj->
arp.next_hop.ip6.as_u64[1] == 0)
375 else if (next_hop->
as_u8[0] == 0xfe)
382 &null_addr, next_hop_sw_if_index,
389 nh_adj_index = value.value;
393 return (nh_adj_index);
400 u32 dst_address_length,
402 u32 next_hop_sw_if_index,
403 u32 next_hop_weight,
u32 adj_index,
404 u32 explicit_fib_index)
411 u32 old_mp_adj_index, new_mp_adj_index;
412 u32 dst_adj_index, nh_adj_index;
418 BVT(clib_bihash_kv) kv, value;
422 if (explicit_fib_index == (
u32)~0)
425 fib_index = explicit_fib_index;
430 if (adj_index == (
u32)~0)
434 next_hop_sw_if_index,
440 kv.key[0] = next_hop->
as_u64[0];
441 kv.key[1] = next_hop->
as_u64[1];
442 kv.key[2] = ((
u64)((fib - im->
fibs))<<32) | 128;
446 vnm->
api_errno = VNET_API_ERROR_UNKNOWN_DESTINATION;
452 nh_adj_index = value.value;
456 masked_dst_address = dst_address[0];
459 kv.key[0] = masked_dst_address.
as_u64[0];
460 kv.key[1] = masked_dst_address.
as_u64[1];
461 kv.key[2] = ((
u64)((fib - im->
fibs))<<32) | dst_address_length;
467 dst_adj_index = value.value;
475 vnm->
api_errno = VNET_API_ERROR_UNKNOWN_DESTINATION;
488 && dst_address_length == 128
491 vnm->
api_errno = VNET_API_ERROR_PREFIX_MATCHES_NEXT_HOP;
500 if (dst_adj_index == ~0 && next_hop_weight == 1 && next_hop_sw_if_index == ~0)
521 old_mp_adj_index = dst_adj ? dst_adj->
heap_handle : ~0;
530 vnm->
api_errno = VNET_API_ERROR_NEXT_HOP_NOT_FOUND_MP;
532 (0,
"requested deleting next-hop %U not found in multi-path",
538 if (old_mp_adj_index != ~0)
540 if (new_mp_adj_index != ~0)
543 if (old_mp != new_mp)
573 u32 table_index_or_table_id,
580 BVT(clib_bihash_kv) kv, value;
583 clib_memcpy (&masked_address, address,
sizeof (masked_address));
586 kv.key[0] = masked_address.
as_u64[0];
587 kv.key[1] = masked_address.
as_u64[1];
588 kv.key[2] = ((
u64)((fib - im->
fibs))<<32) | address_length;
591 return (value.value);
597 u32 table_index_or_table_id,
602 u8 ** result_lengths)
606 BVT(clib_bihash) * h = &im->ip6_lookup_table;
612 _vec_len (*results) = 0;
614 _vec_len (*result_lengths) = 0;
617 for (i = 0; i < h->nbuckets; i++)
624 for (j = 0; j < (1<<b->log2_pages); j++)
628 if (BV(clib_bihash_is_free)(&v->kvp[k]))
631 if ((v->kvp[k].key[2]
632 == (((
u64)((fib - im->
fibs))<<32) | address_length))
642 vec_add1 (*result_lengths, address_length);
651 u32 table_index_or_table_id,
663 clib_warning (
"unimplemented, please report to vpp-dev@cisco.com");
670 u32 table_index_or_table_id,
677 static u8 * matching_address_lengths;
689 for (l = address_length + 1; l <= 128; l++)
695 &matching_address_lengths);
696 for (i = 0; i <
vec_len (matching_addresses); i++)
722 u32 n_left_from, n_left_to_next, * from, * to_next;
730 while (n_left_from > 0)
733 to_next, n_left_to_next);
735 while (n_left_from >= 4 && n_left_to_next >= 2)
738 u32 pi0, pi1, adj_index0, adj_index1, wrong_next;
743 u32 fib_index0, fib_index1;
744 u32 flow_hash_config0, flow_hash_config1;
759 pi0 = to_next[0] = from[0];
760 pi1 = to_next[1] = from[1];
773 dst_addr0 = &iadj0->
indirect.next_hop.ip6;
774 dst_addr1 = &iadj1->
indirect.next_hop.ip6;
849 (cm, cpu_index, adj_index0, 1,
852 (cm, cpu_index, adj_index1, 1,
860 wrong_next = (next0 != next) + 2*(next1 != next);
897 while (n_left_from > 0 && n_left_to_next > 0)
905 u32 fib_index0, flow_hash_config0;
918 dst_addr0 = &iadj0->
indirect.next_hop.ip6;
964 (cm, cpu_index, adj_index0, 1,
978 to_next, n_left_to_next);
997 u32 if_address_index)
1009 adj->
arp.next_hop.ip6.as_u64[0] = 0;
1010 adj->
arp.next_hop.ip6.as_u64[1] = 0;
1023 VNET_L3_PACKET_TYPE_IP6,
1027 &adj->rewrite_header,
1028 sizeof (adj->rewrite_data));
1041 u32 classify_table_index;
1068 classify_table_index = ~0;
1071 if (classify_table_index != (
u32) ~0)
1074 adj->
classify.table_index = classify_table_index;
1080 adj->rewrite_header.sw_if_index = sw_if_index;
1082 adj->rewrite_header.data_bytes = 0;
1105 if (address_length < 128)
1108 if (address_length != 64 ||
1109 address[0].
as_u64[0] != clib_net_to_host_u64(0xfe80000000000000ULL))
1151 u32 if_address_index;
1152 ip6_address_fib_t ip6_af, * addr_fib = 0;
1185 im, ip6_af.fib_index,
1193 address, address_length,
1209 (vm, sw_if_index, address, address_length,
1223 u32 is_admin_up, fib_index;
1237 a = ip_interface_address_get_address (&im->lookup_main, ia);
1239 ip6_add_interface_routes (vnm, sw_if_index,
1243 ip6_del_interface_routes (im, fib_index,
1244 a, ia->address_length);
1254 .node_name =
"ip6-inacl",
1255 .runs_before = {
"ip6-policer-classify", 0},
1260 .node_name =
"ip6-policer-classify",
1261 .runs_before = {
"ipsec-input-ip6", 0},
1266 .node_name =
"ipsec-input-ip6",
1267 .runs_before = {
"l2tp-decap", 0},
1272 .node_name =
"l2tp-decap",
1273 .runs_before = {
"vpath-input-ip6", 0},
1278 .node_name =
"vpath-input-ip6",
1279 .runs_before = {
"ip6-lookup", 0},
1284 .node_name =
"ip6-lookup",
1291 .node_name =
"vpath-input-ip6",
1292 .runs_before = {
"ip6-lookup", 0},
1297 .node_name =
"ip6-lookup",
1318 feature_start_nodes,
1383 .name =
"ip6-lookup",
1384 .vector_size =
sizeof (
u32),
1386 .format_trace = format_ip6_lookup_trace,
1405 .name =
"ip6-indirect",
1406 .vector_size =
sizeof (
u32),
1407 .sibling_of =
"ip6-lookup",
1408 .format_trace = format_ip6_lookup_trace,
1428 ip6_forward_next_trace_t * t = va_arg (*args, ip6_forward_next_trace_t *);
1441 ip6_forward_next_trace_t * t = va_arg (*args, ip6_forward_next_trace_t *);
1446 s =
format (s,
"fib %d adj-idx %d : %U flow hash: 0x%08x",
1460 ip6_forward_next_trace_t * t = va_arg (*args, ip6_forward_next_trace_t *);
1465 s =
format (s,
"tx_sw_if_index %d adj-idx %d : %U flow hash: 0x%08x",
1493 ip6_forward_next_trace_t * t0, * t1;
1541 ip6_forward_next_trace_t * t0;
1610 .vector_size =
sizeof (
u32),
1625 .vector_size =
sizeof (
u32),
1640 .vector_size =
sizeof (
u32),
1654 .name =
"ip6-multicast",
1655 .vector_size =
sizeof (
u32),
1669 u16 sum16, payload_length_host_byte_order;
1670 u32 i, n_this_buffer, n_bytes_left;
1671 u32 headers_size =
sizeof(ip0[0]);
1672 void * data_this_buffer;
1679 payload_length_host_byte_order = clib_net_to_host_u16 (ip0->
payload_length);
1680 data_this_buffer = (
void *) (ip0 + 1);
1694 ip6_hop_by_hop_ext_t *ext_hdr = (ip6_hop_by_hop_ext_t *)data_this_buffer;
1697 ASSERT(ext_hdr->next_hdr == IP_PROTOCOL_ICMP6);
1699 skip_bytes = 8* (1 + ext_hdr->n_data_u64s);
1700 data_this_buffer = (
void *)((
u8 *)data_this_buffer + skip_bytes);
1702 payload_length_host_byte_order -= skip_bytes;
1703 headers_size += skip_bytes;
1706 n_bytes_left = n_this_buffer = payload_length_host_byte_order;
1711 u8 nb_segs = mb->nb_segs;
1715 while (n_bytes_left)
1718 n_bytes_left -= n_this_buffer;
1722 if ((nb_segs == 0) || (mb == 0))
1725 data_this_buffer = rte_ctrlmbuf_data(mb);
1726 n_this_buffer = mb->data_len;
1728 if (n_bytes_left || nb_segs)
1741 n_bytes_left -= n_this_buffer;
1742 if (n_bytes_left == 0)
1770 || ip0->
protocol == IP_PROTOCOL_ICMP6
1771 || ip0->
protocol == IP_PROTOCOL_UDP
1772 || ip0->
protocol == IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS);
1774 udp0 = (
void *) (ip0 + 1);
1798 u32 * from, * to_next, n_left_from, n_left_to_next;
1808 while (n_left_from > 0)
1811 to_next, n_left_to_next);
1813 while (n_left_from >= 4 && n_left_to_next >= 2)
1818 u32 pi0, ip_len0, udp_len0, flags0, next0;
1819 u32 pi1, ip_len1, udp_len1, flags1, next1;
1820 i32 len_diff0, len_diff1;
1821 u8 error0, type0, good_l4_checksum0;
1822 u8 error1, type1, good_l4_checksum1;
1824 pi0 = to_next[0] = from[0];
1825 pi1 = to_next[1] = from[1];
1829 n_left_to_next -= 2;
1862 udp_len0 = clib_net_to_host_u16 (udp0->
length);
1863 udp_len1 = clib_net_to_host_u16 (udp1->
length);
1865 len_diff0 = ip_len0 - udp_len0;
1866 len_diff1 = ip_len1 - udp_len1;
1872 && ! good_l4_checksum0
1880 && ! good_l4_checksum1
1881 && ! (flags1 & IP_BUFFER_L4_CHECKSUM_COMPUTED)))
1888 error0 = error1 = IP6_ERROR_UNKNOWN_PROTOCOL;
1890 error0 = len_diff0 < 0 ? IP6_ERROR_UDP_LENGTH : error0;
1891 error1 = len_diff1 < 0 ? IP6_ERROR_UDP_LENGTH : error1;
1895 error0 = (! good_l4_checksum0
1896 ? IP6_ERROR_UDP_CHECKSUM + type0
1898 error1 = (! good_l4_checksum1
1899 ? IP6_ERROR_UDP_CHECKSUM + type1
1908 ? IP6_ERROR_SRC_LOOKUP_MISS
1915 ? IP6_ERROR_SRC_LOOKUP_MISS
1926 to_next, n_left_to_next,
1927 pi0, pi1, next0, next1);
1930 while (n_left_from > 0 && n_left_to_next > 0)
1935 u32 pi0, ip_len0, udp_len0, flags0, next0;
1937 u8 error0, type0, good_l4_checksum0;
1939 pi0 = to_next[0] = from[0];
1943 n_left_to_next -= 1;
1965 udp_len0 = clib_net_to_host_u16 (udp0->
length);
1967 len_diff0 = ip_len0 - udp_len0;
1972 && ! good_l4_checksum0
1980 error0 = IP6_ERROR_UNKNOWN_PROTOCOL;
1982 error0 = len_diff0 < 0 ? IP6_ERROR_UDP_LENGTH : error0;
1986 error0 = (! good_l4_checksum0
1987 ? IP6_ERROR_UDP_CHECKSUM + type0
1995 ? IP6_ERROR_SRC_LOOKUP_MISS
2004 to_next, n_left_to_next,
2016 .name =
"ip6-local",
2017 .vector_size =
sizeof (
u32),
2062 u32 * from, * to_next_drop;
2063 uword n_left_from, n_left_to_next_drop;
2064 static f64 time_last_seed_change = -1e100;
2065 static u32 hash_seeds[3];
2074 if (time_now - time_last_seed_change > 1e-3)
2078 sizeof (hash_seeds));
2079 for (i = 0; i <
ARRAY_LEN (hash_seeds); i++)
2080 hash_seeds[i] = r[i];
2083 for (i = 0; i <
ARRAY_LEN (hash_bitmap); i++)
2086 time_last_seed_change = time_now;
2092 while (n_left_from > 0)
2095 to_next_drop, n_left_to_next_drop);
2097 while (n_left_from > 0 && n_left_to_next_drop > 0)
2101 u32 pi0, adj_index0, a0, b0, c0, m0, sw_if_index0, drop0;
2117 if (adj0->
arp.next_hop.ip6.as_u64[0] ||
2118 adj0->
arp.next_hop.ip6.as_u64[1]) {
2127 sw_if_index0 = adj0->rewrite_header.sw_if_index;
2141 c0 &=
BITS (hash_bitmap) - 1;
2145 bm0 = hash_bitmap[c0];
2146 drop0 = (bm0 & m0) != 0;
2149 hash_bitmap[c0] = bm0 | m0;
2153 to_next_drop[0] = pi0;
2155 n_left_to_next_drop -= 1;
2171 icmp6_neighbor_solicitation_header_t * h0;
2201 clib_memcpy (h0->link_layer_option.ethernet_address,
2205 h0->neighbor.icmp.checksum = 0;
2206 h0->neighbor.icmp.checksum =
2210 ASSERT (bogus_length == 0);
2229 n_left_to_next_drop);
2238 =
"neighbor solicitations sent",
2240 =
"no source address for ND solicitation",
2245 .name =
"ip6-discover-neighbor",
2246 .vector_size =
sizeof (
u32),
2265 icmp6_neighbor_solicitation_header_t * h;
2288 vnm->
api_errno = VNET_API_ERROR_NO_MATCHING_INTERFACE;
2290 (0,
"no matching interface address for destination %U (interface %U)",
2301 h->ip.dst_address.as_u8[13] = dst->
as_u8[13];
2302 h->ip.dst_address.as_u8[14] = dst->
as_u8[14];
2303 h->ip.dst_address.as_u8[15] = dst->
as_u8[15];
2305 h->ip.src_address = src[0];
2306 h->neighbor.target_address = dst[0];
2310 h->neighbor.icmp.checksum =
2312 ASSERT(bogus_length == 0);
2342 int rewrite_for_locally_received_packets)
2346 u32 n_left_from, n_left_to_next, * to_next, next_index;
2354 while (n_left_from > 0)
2358 while (n_left_from >= 4 && n_left_to_next >= 2)
2363 u32 pi0, rw_len0, next0, error0, adj_index0;
2364 u32 pi1, rw_len1, next1, error1, adj_index1;
2383 pi0 = to_next[0] = from[0];
2384 pi1 = to_next[1] = from[1];
2389 n_left_to_next -= 2;
2394 adj_index0 =
vnet_buffer (p0)->ip.adj_index[adj_rx_tx];
2395 adj_index1 =
vnet_buffer (p1)->ip.adj_index[adj_rx_tx];
2398 ASSERT(adj_index0 && adj_index1);
2403 error0 = error1 = IP6_ERROR_NONE;
2406 if (! rewrite_for_locally_received_packets)
2426 error0 = IP6_ERROR_TIME_EXPIRED;
2430 ICMP6_time_exceeded_ttl_exceeded_in_transit, 0);
2434 error1 = IP6_ERROR_TIME_EXPIRED;
2438 ICMP6_time_exceeded_ttl_exceeded_in_transit, 0);
2445 if (rewrite_for_locally_received_packets)
2453 error0 = IP6_ERROR_SPOOFED_LOCAL_PACKETS;
2456 error1 = IP6_ERROR_SPOOFED_LOCAL_PACKETS;
2459 rw_len0 = adj0[0].rewrite_header.data_bytes;
2460 rw_len1 = adj1[0].rewrite_header.data_bytes;
2475 ? IP6_ERROR_MTU_EXCEEDED
2478 ? IP6_ERROR_MTU_EXCEEDED
2489 adj0[0].rewrite_header.sw_if_index;
2490 next0 = adj0[0].rewrite_header.next_index;
2498 adj1[0].rewrite_header.sw_if_index;
2499 next1 = adj1[0].rewrite_header.next_index;
2508 to_next, n_left_to_next,
2509 pi0, pi1, next0, next1);
2512 while (n_left_from > 0 && n_left_to_next > 0)
2518 u32 adj_index0, next0, error0;
2520 pi0 = to_next[0] = from[0];
2524 adj_index0 =
vnet_buffer (p0)->ip.adj_index[adj_rx_tx];
2533 error0 = IP6_ERROR_NONE;
2537 if (! rewrite_for_locally_received_packets)
2553 error0 = IP6_ERROR_TIME_EXPIRED;
2557 ICMP6_time_exceeded_ttl_exceeded_in_transit, 0);
2561 if (rewrite_for_locally_received_packets)
2565 error0 = IP6_ERROR_SPOOFED_LOCAL_PACKETS;
2572 rw_len0 = adj0[0].rewrite_header.data_bytes;
2582 ? IP6_ERROR_MTU_EXCEEDED
2593 adj0[0].rewrite_header.sw_if_index;
2594 next0 = adj0[0].rewrite_header.next_index;
2602 n_left_to_next -= 1;
2605 to_next, n_left_to_next,
2639 .name =
"ip6-rewrite",
2640 .vector_size =
sizeof (
u32),
2655 .name =
"ip6-rewrite-local",
2656 .vector_size =
sizeof (
u32),
2658 .sibling_of =
"ip6-rewrite",
2673 #define foreach_ip6_hop_by_hop_error \ 2674 _(PROCESSED, "pkts with ip6 hop-by-hop options") \ 2675 _(FORMAT, "incorrectly formatted hop-by-hop options") \ 2676 _(UNKNOWN_OPTION, "unknown ip6 hop-by-hop options") 2679 #define _(sym,str) IP6_HOP_BY_HOP_ERROR_##sym, 2698 #define _(sym,string) string, 2717 s =
format (s,
"IP6_HOP_BY_HOP: next index %d len %d traced %d",
2723 while (opt0 < limit0) {
2731 if (hm->
trace[type0]) {
2732 s = (*hm->
trace[type0])(s, opt0);
2734 s =
format (s,
"\n unrecognized option %d length %d", type0, opt0->
length);
2753 u32 n_left_from, *from, *to_next;
2762 while (n_left_from > 0) {
2767 while (n_left_from > 0 && n_left_to_next > 0) {
2783 n_left_to_next -= 1;
2800 error0 = IP6_HOP_BY_HOP_ERROR_FORMAT;
2806 while (opt0 < limit0) {
2816 if ((*hm->
options[type0])(b0, ip0, opt0) < 0) {
2817 error0 = IP6_HOP_BY_HOP_ERROR_FORMAT;
2831 ICMP6_parameter_problem_unrecognized_option, (
u8 *)opt0 - (
u8 *)ip0);
2837 ICMP6_parameter_problem_unrecognized_option, (
u8 *)opt0 - (
u8 *)ip0);
2843 error0 = IP6_HOP_BY_HOP_ERROR_UNKNOWN_OPTION;
2857 u32 trace_len = (hbh0->
length + 1) << 3;
2877 .name =
"ip6-hop-by-hop",
2878 .sibling_of =
"ip6-lookup",
2879 .vector_size =
sizeof (
u32),
2915 hm->
options[option] = options;
2942 for (i = 0; i < 256; i++) {
2971 for (j = 0; j < i0; j++)
3005 icmp6_neighbor_solicitation_header_t p;
3007 memset (&p, 0,
sizeof (p));
3009 p.ip.ip_version_traffic_class_and_flow_label = clib_host_to_net_u32 (0x6 << 28);
3010 p.ip.payload_length = clib_host_to_net_u16 (
sizeof (p)
3012 p.ip.protocol = IP_PROTOCOL_ICMP6;
3013 p.ip.hop_limit = 255;
3016 p.neighbor.icmp.type = ICMP6_neighbor_solicitation;
3018 p.link_layer_option.header.type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
3019 p.link_layer_option.header.n_data_u64s =
sizeof (p.link_layer_option) /
sizeof (
u64);
3025 "ip6 neighbor discovery");
3042 u32 sw_if_index, table_id;
3053 if (
unformat (input,
"%d", &table_id))
3079 .path =
"set interface ip6 table",
3081 .short_help =
"set interface ip6 table <intfc> <table-id>" 3088 ip->
as_u64[0] = clib_host_to_net_u64 (0xFE80000000000000ULL);
3090 ip->
as_u8 [8] = mac[0] ^ (1<<1);
3091 ip->
as_u8 [9] = mac[1];
3092 ip->
as_u8 [10] = mac[2];
3093 ip->
as_u8 [11] = 0xFF;
3094 ip->
as_u8 [12] = 0xFE;
3095 ip->
as_u8 [13] = mac[3];
3096 ip->
as_u8 [14] = mac[4];
3097 ip->
as_u8 [15] = mac[5];
3105 mac[0] = ip->
as_u8 [8] ^ (1<<1);
3106 mac[1] = ip->
as_u8 [9];
3107 mac[2] = ip->
as_u8 [10];
3108 mac[3] = ip->
as_u8 [13];
3109 mac[4] = ip->
as_u8 [14];
3110 mac[5] = ip->
as_u8 [15];
3135 .path =
"test ip6 link",
3137 .short_help =
"test ip6 link <mac-address>",
3162 u32 flow_hash_config = 0;
3166 if (
unformat (input,
"table %d", &table_id))
3169 else if (unformat (input, #a)) { flow_hash_config |= v; matched=1;} 3189 clib_warning (
"BUG: illegal flow hash config 0x%x", flow_hash_config);
3197 .path =
"set ip6 flow-hash",
3199 "set ip table flow-hash table <fib-id> src dst sport dport proto reverse",
3224 .path =
"show ip6 local",
3226 .short_help =
"Show ip6 local protocol table",
3239 return VNET_API_ERROR_NO_MATCHING_INTERFACE;
3242 return VNET_API_ERROR_NO_SUCH_ENTRY;
3255 u32 table_index = ~0;
3256 int table_index_set = 0;
3257 u32 sw_if_index = ~0;
3261 if (
unformat (input,
"table-index %d", &table_index))
3262 table_index_set = 1;
3270 if (table_index_set == 0)
3273 if (sw_if_index == ~0)
3283 case VNET_API_ERROR_NO_MATCHING_INTERFACE:
3286 case VNET_API_ERROR_NO_SUCH_ENTRY:
3293 .path =
"set ip6 classify",
3295 "set ip6 classify intfc <int> table-index <index>",
3308 if (
unformat (input,
"hash-buckets %d", &tmp))
3310 else if (
unformat (input,
"heap-size %dm", &tmp))
3311 heapsize = ((
u64)tmp) << 20;
3312 else if (
unformat (input,
"heap-size %dM", &tmp))
3313 heapsize = ((
u64)tmp) << 20;
3314 else if (
unformat (input,
"heap-size %dg", &tmp))
3315 heapsize = ((
u64)tmp) << 30;
3316 else if (
unformat (input,
"heap-size %dG", &tmp))
3317 heapsize = ((
u64)tmp) << 30;
static vlib_cli_command_t set_ip6_flow_hash_command
(constructor) VLIB_CLI_COMMAND (set_ip6_flow_hash_command)
struct ip_adjacency_t::@143::@147 indirect
IP_LOOKUP_NEXT_INDIRECT only.
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
static void ip6_address_mask(ip6_address_t *a, ip6_address_t *mask)
static void ip_call_add_del_adjacency_callbacks(ip_lookup_main_t *lm, u32 adj_index, u32 is_del)
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 foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
#define vnet_rewrite_one_header(rw0, p0, most_likely_size)
ip_lookup_next_t
Common (IP4/IP6) next index stored in adjacency.
#define HBH_OPTION_TYPE_DISCARD_UNKNOWN_ICMP
#define VNET_REWRITE_FOR_SW_INTERFACE_ADDRESS_BROADCAST
#define hash_set(h, key, value)
sll srl srl sll sra u16x4 i
uword vlib_error_drop_buffers(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, u32 next_buffer_stride, u32 n_buffers, u32 next_index, u32 drop_error_node, u32 drop_error_code)
static vlib_cli_command_t test_link_command
(constructor) VLIB_CLI_COMMAND (test_link_command)
static u8 * format_ip6_lookup_trace(u8 *s, va_list *args)
#define rte_mbuf_from_vlib_buffer(x)
u32 * config_index_by_sw_if_index
static void compute_prefix_lengths_in_search_order(ip6_main_t *im)
#define IP6_LOOKUP_NEXT_NODES
static uword ip6_indirect(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
static vlib_main_t * vlib_get_main(void)
static void vlib_set_next_frame_buffer(vlib_main_t *vm, vlib_node_runtime_t *node, u32 next_index, u32 buffer_index)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
ip_interface_address_t * if_address_pool
Pool of addresses that are assigned to interfaces.
static clib_error_t * add_del_ip6_interface_table(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
u16 n_adj
Number of adjecencies in block.
u32 ip6_unicast_rx_feature_lookup
static clib_error_t * set_ip6_classify_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vnet_interface_main_t interface_main
vlib_node_registration_t ip6_rewrite_local_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_local_node)
ip_lookup_next_t lookup_next_index
#define foreach_ip6_hop_by_hop_error
static uword ip6_rewrite_local(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
i32 dst_address_length_refcounts[129]
static ip6_address_t * ip6_interface_address_matching_destination(ip6_main_t *im, ip6_address_t *dst, u32 sw_if_index, ip_interface_address_t **result_ia)
vlib_node_registration_t ip6_lookup_node
(constructor) VLIB_REGISTER_NODE (ip6_lookup_node)
u32 miss_adj_index
Adjacency index for routing table misses, local punts, and drops.
static u8 * format_ip6_rewrite_trace(u8 *s, va_list *args)
static f64 vlib_time_now(vlib_main_t *vm)
static void * clib_random_buffer_get_data(clib_random_buffer_t *b, uword n_bytes)
u32 vnet_config_del_feature(vlib_main_t *vm, vnet_config_main_t *cm, u32 config_string_heap_index, u32 feature_index, void *feature_config, u32 n_feature_config_bytes)
ip_config_main_t rx_config_mains[VNET_N_CAST]
rx/tx interface/feature configuration.
#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)
u32 share_count
Number of FIB entries sharing this adjacency.
int ip6_hbh_unregister_option(u8 option)
ip_adjacency_t * ip_add_adjacency(ip_lookup_main_t *lm, ip_adjacency_t *copy_adj, u32 n_adj, u32 *adj_index_return)
static uword ip6_miss(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
struct _vlib_node_registration vlib_node_registration_t
static clib_error_t * ip6_feature_init(vlib_main_t *vm, ip6_main_t *im)
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
static clib_error_t * ip6_config(vlib_main_t *vm, unformat_input_t *input)
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap. ...
#define STRUCT_OFFSET_OF(t, f)
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
static clib_error_t * test_ip6_link_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static ip_csum_t ip_csum_with_carry(ip_csum_t sum, ip_csum_t x)
static vlib_node_registration_t ip6_multicast_node
(constructor) VLIB_REGISTER_NODE (ip6_multicast_node)
unformat_function_t unformat_vnet_sw_interface
#define clib_error_report(e)
static clib_error_t * ip6_add_del_interface_address_internal(vlib_main_t *vm, u32 sw_if_index, ip6_address_t *new_address, u32 new_length, u32 redistribute, u32 insert_routes, u32 is_del)
#define VNET_HW_INTERFACE_FLAG_LINK_UP
void ip6_add_del_route(ip6_main_t *im, ip6_add_del_route_args_t *a)
u32 ip6_fib_lookup_with_table(ip6_main_t *im, u32 fib_index, ip6_address_t *dst)
static char * ip6_hop_by_hop_error_strings[]
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
u32 neighbor_probe_adj_index
#define hash_v3_mix32(a, b, c)
format_function_t format_vnet_sw_if_index_name
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
static uword ip6_hop_by_hop(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static void vlib_smp_unsafe_warning(void)
uword as_uword[16/sizeof(uword)]
VNET_SW_INTERFACE_ADD_DEL_FUNCTION(ip6_sw_interface_add_del)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
Adjacency to drop this packet.
static pg_node_t * pg_get_node(uword node_index)
static vlib_node_registration_t ip6_drop_node
(constructor) VLIB_REGISTER_NODE (ip6_drop_node)
void vlib_packet_template_init(vlib_main_t *vm, vlib_packet_template_t *t, void *packet_data, uword n_packet_data_bytes, uword min_n_buffers_each_physmem_alloc, char *fmt,...)
ip6_discover_neighbor_error_t
static uword ip6_drop(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
vlib_packet_template_t discover_neighbor_packet_template
u32 ip6_tcp_udp_icmp_validate_checksum(vlib_main_t *vm, vlib_buffer_t *p0)
vnet_main_t * vnet_get_main(void)
vlib_node_registration_t ip6_indirect_node
(constructor) VLIB_REGISTER_NODE (ip6_indirect_node)
clib_error_t * ip6_sw_interface_add_del(vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
static u8 * format_ip6_hop_by_hop_trace(u8 *s, va_list *args)
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
u8 * format_ethernet_address(u8 *s, va_list *args)
#define vlib_prefetch_buffer_with_index(vm, bi, type)
Prefetch buffer metadata by buffer index The first 64 bytes of buffer contains most header informatio...
static clib_error_t * show_ip6_local_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int clib_bihash_add_del(clib_bihash *h, clib_bihash_kv *add_v, int is_add)
Add or delete a (key,value) pair from a bi-hash table.
ip_csum_t ip_incremental_checksum(ip_csum_t sum, void *_data, uword n_bytes)
#define VLIB_INIT_FUNCTION(x)
static uword ip6_rewrite_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int rewrite_for_locally_received_packets)
This packets needs to go to ICMP error.
static uword pow2_mask(uword x)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
VNET_IP6_MULTICAST_FEATURE_INIT(ip4_vpath_mc, static)
static clib_error_t * set_ip6_flow_hash_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Hop-by-hop header handling.
#define IP_BUFFER_L4_CHECKSUM_CORRECT
static uword ip6_address_is_equal(ip6_address_t *a, ip6_address_t *b)
u32 ip6_unicast_rx_feature_check_access
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define IP6_FIB_DEFAULT_HASH_NUM_BUCKETS
u32 ip_multipath_adjacency_add_del_next_hop(ip_lookup_main_t *lm, u32 is_del, u32 old_mp_adj_index, u32 next_hop_adj_index, u32 next_hop_weight, u32 *new_mp_adj_index)
u32 ip6_multicast_rx_feature_lookup
u8 pre_data[VLIB_BUFFER_PRE_DATA_SIZE]
Space for inserting data before buffer start.
#define clib_warning(format, args...)
u32 table_index_or_table_id
This packet is for one of our own IP addresses.
void ip_del_adjacency(ip_lookup_main_t *lm, u32 adj_index)
#define VLIB_BUFFER_NEXT_PRESENT
void icmp6_error_set_vnet_buffer(vlib_buffer_t *b, u8 type, u8 code, u32 data)
u32 lookup_table_nbuckets
u8 packet_data[128-1 *sizeof(u32)]
vnet_api_error_t api_errno
ip6_fib_t * find_ip6_fib_by_table_index_or_id(ip6_main_t *im, u32 table_index_or_id, u32 flags)
Get or create an IPv6 fib.
ip6_address_t dst_address
static vlib_cli_command_t show_ip6_local
(constructor) VLIB_CLI_COMMAND (show_ip6_local)
#define clib_bitmap_foreach(i, ai, body)
Macro to iterate across set bits in a bitmap.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u16 current_length
Nbytes between current data and the end of this buffer.
u32 ip6_fib_lookup(ip6_main_t *im, u32 sw_if_index, ip6_address_t *dst)
clib_error_t * ip_feature_init_cast(vlib_main_t *vm, ip_config_main_t *cm, vnet_config_main_t *vcm, char **feature_start_nodes, int num_feature_start_nodes, vnet_cast_t cast, int is_ip4)
u32 * classify_table_index_by_sw_if_index
First table index to use for this interface, ~0 => none.
static void ip6_del_interface_routes(ip6_main_t *im, u32 fib_index, ip6_address_t *address, u32 address_length)
vlib_node_registration_t ip6_input_node
(constructor) VLIB_REGISTER_NODE (ip6_input_node)
#define BIHASH_KVP_PER_PAGE
#define IP6_FIB_DEFAULT_HASH_MEMORY_SIZE
uword os_get_cpu_number(void)
static vlib_node_registration_t ip6_punt_node
(constructor) VLIB_REGISTER_NODE (ip6_punt_node)
int vnet_set_ip6_flow_hash(u32 table_id, u32 flow_hash_config)
static u32 ip6_compute_flow_hash(ip6_header_t *ip, u32 flow_hash_config)
u8 local_next_by_ip_protocol[256]
Table mapping ip protocol to ip[46]-local node next index.
static clib_error_t * ip6_hop_by_hop_init(vlib_main_t *vm)
vnet_hw_interface_class_t srp_hw_interface_class
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
Finish enqueueing two buffers forward in the graph.
u32 ip6_unicast_rx_feature_policer_classify
static uword ip6_rewrite_transit(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#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.
#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).
int ip6_hbh_register_option(u8 option, int options(vlib_buffer_t *b, ip6_header_t *ip, ip6_hop_by_hop_option_t *opt), u8 *trace(u8 *s, ip6_hop_by_hop_option_t *opt))
void clib_bihash_init(clib_bihash *h, char *name, u32 nbuckets, uword memory_size)
initialize a bounded index extensible hash table
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
ip6_add_del_interface_address_callback_t * add_del_interface_address_callbacks
void ip6_forward_next_trace(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, vlib_rx_or_tx_t which_adj_index)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
vnet_hw_interface_class_t ethernet_hw_interface_class
u32 ip6_get_route(ip6_main_t *im, u32 table_index_or_table_id, u32 flags, ip6_address_t *address, u32 address_length)
uword * fib_index_by_table_id
This packet needs to be classified.
void vnet_ip6_fib_init(ip6_main_t *im, u32 fib_index)
static uword ip6_local(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
ip6_address_t fib_masks[129]
u32 ip6_route_get_next_hop_adj(ip6_main_t *im, u32 fib_index, ip6_address_t *next_hop, u32 next_hop_sw_if_index, u32 explicit_fib_index)
#define VLIB_EARLY_CONFIG_FUNCTION(x, n,...)
static void vlib_buffer_copy_trace_flag(vlib_main_t *vm, vlib_buffer_t *b, u32 bi_target)
static uword ip6_destination_matches_route(ip6_main_t *im, ip6_address_t *key, ip6_address_t *dest, uword dest_length)
#define IP6_ROUTE_FLAG_KEEP_OLD_ADJACENCY
#define CLIB_PREFETCH(addr, size, type)
uword * non_empty_dst_address_length_bitmap
static ip6_fib_t * create_fib_with_table_id(ip6_main_t *im, u32 table_id)
void ip6_maybe_remap_adjacencies(ip6_main_t *im, u32 table_index_or_table_id, u32 flags)
#define vec_free(V)
Free vector's memory (no header).
static vlib_node_registration_t ip6_local_node
(constructor) VLIB_REGISTER_NODE (ip6_local_node)
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 uword ip6_lookup_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_indirect)
clib_error_t * ip6_sw_interface_admin_up_down(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
static u8 * format_ip6_forward_next_trace(u8 *s, va_list *args)
static vlib_node_registration_t ip6_miss_node
(constructor) VLIB_REGISTER_NODE (ip6_miss_node)
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
clib_error_t * ip6_probe_neighbor(vlib_main_t *vm, ip6_address_t *dst, u32 sw_if_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.
static uword ip6_drop_or_punt(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, ip6_error_t error_code)
unformat_function_t * unformat_edit
#define IP6_ROUTE_FLAG_DEL
void ip_lookup_init(ip_lookup_main_t *lm, u32 is_ip6)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
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 ip6_adjacency_set_interface_route(vnet_main_t *vnm, ip_adjacency_t *adj, u32 sw_if_index, u32 if_address_index)
void ip6_ethernet_mac_address_from_link_local_address(u8 *mac, ip6_address_t *ip)
struct ip_adjacency_t::@143::@146 classify
IP_LOOKUP_NEXT_CLASSIFY only.
static void * ip6_next_header(ip6_header_t *i)
void ip6_delete_matching_routes(ip6_main_t *im, u32 table_index_or_table_id, u32 flags, ip6_address_t *address, u32 address_length)
vlib_combined_counter_main_t adjacency_counters
Adjacency packet/byte counters indexed by adjacency index.
u8 builtin_protocol_by_ip_protocol[256]
IP_BUILTIN_PROTOCOL_{TCP,UDP,ICMP,OTHER} by protocol in IP header.
static vlib_cli_command_t set_interface_ip6_table_command
(constructor) VLIB_CLI_COMMAND (set_interface_ip6_table_command)
struct _vnet_classify_main vnet_classify_main_t
#define foreach_flow_hash_bit
u32 ip6_multicast_rx_feature_vpath
u32 * if_address_pool_index_by_sw_if_index
Head of doubly linked list of interface addresses for each software interface.
ip6_add_del_interface_address_function_t * function
void ip6_register_protocol(u32 protocol, u32 node_index)
#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 vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 cpu_index, u32 index, u32 packet_increment, u32 byte_increment)
Increment a combined counter.
vlib_node_registration_t ip6_discover_neighbor_node
(constructor) VLIB_REGISTER_NODE (ip6_discover_neighbor_node)
static uword ip6_address_is_zero(ip6_address_t *a)
VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION(ip6_sw_interface_admin_up_down)
ip6_hop_by_hop_main_t ip6_hop_by_hop_main
ip_lookup_main_t lookup_main
int clib_bihash_search(clib_bihash *h, clib_bihash_kv *search_v, clib_bihash_kv *return_v)
Search a bi-hash table.
#define LOG2_IP_BUFFER_L4_CHECKSUM_CORRECT
#define IP6_ROUTE_FLAG_NOT_LAST_IN_GROUP
void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
#define hash_v3_finalize32(a, b, c)
static uword ip6_discover_neighbor(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u32 next_buffer
Next buffer for this linked-list of buffers.
u32 ip6_unicast_rx_feature_vpath
u8 * prefix_lengths_in_search_order
vlib_node_registration_t ip6_hop_by_hop_node
(constructor) VLIB_REGISTER_NODE (ip6_hop_by_hop_node)
#define HBH_OPTION_TYPE_DISCARD_UNKNOWN_ICMP_NOT_MCAST
#define VLIB_NODE_FLAG_TRACE
u32 vnet_config_add_feature(vlib_main_t *vm, vnet_config_main_t *cm, u32 config_string_heap_index, u32 feature_index, void *feature_config, u32 n_feature_config_bytes)
u32 ip6_unicast_rx_feature_l2tp_decap
vnet_classify_main_t vnet_classify_main
int vnet_set_ip6_classify_intfc(vlib_main_t *vm, u32 sw_if_index, u32 table_index)
#define IP_FLOW_HASH_DEFAULT
Default: 5-tuple without the "reverse" bit.
static char * ip6_discover_neighbor_error_strings[]
#define VLIB_BUFFER_IS_TRACED
#define IP6_ROUTE_FLAG_FIB_INDEX
vlib_node_registration_t ip6_rewrite_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_node)
static uword is_pow2(uword x)
static uword vnet_sw_interface_is_admin_up(vnet_main_t *vnm, u32 sw_if_index)
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define vec_elt(v, i)
Get vector value at index i.
#define IP_BUFFER_L4_CHECKSUM_COMPUTED
template key/value backing page structure
void ip6_foreach_matching_route(ip6_main_t *im, u32 table_index_or_table_id, u32 flags, ip6_address_t *dst_address, u32 address_length, ip6_address_t **results, u8 **result_lengths)
#define HBH_OPTION_TYPE_DISCARD_UNKNOWN
static uword ip6_address_is_multicast(ip6_address_t *a)
VLIB_CLI_COMMAND(set_interface_ip_source_and_port_range_check_command, static)
static void ip6_set_solicited_node_multicast_address(ip6_address_t *a, u32 id)
static int ip6_src_address_for_packet(ip6_main_t *im, vlib_buffer_t *p, ip6_address_t *src, u32 sw_if_index)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u32 heap_handle
Handle for this adjacency in adjacency heap.
static uword max_log2(uword x)
void ip6_link_local_address_from_ethernet_mac_address(ip6_address_t *ip, u8 *mac)
vnet_sw_interface_t * sw_interfaces
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
u32 ip6_unicast_rx_feature_ipsec
static void ip6_add_interface_routes(vnet_main_t *vnm, u32 sw_if_index, ip6_main_t *im, u32 fib_index, ip_interface_address_t *a)
clib_error_t * ip_interface_address_add_del(ip_lookup_main_t *lm, u32 sw_if_index, void *addr_fib, u32 address_length, u32 is_del, u32 *result_if_address_index)
A collection of combined counters.
VNET_IP6_UNICAST_FEATURE_INIT(ip6_inacl, static)
#define clib_mem_unaligned(pointer, type)
static char * feature_start_nodes[]
u16 ip6_tcp_udp_icmp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip6_header_t *ip0, int *bogus_lengthp)
uword * interface_route_adj_index_by_sw_if_index
static uword ip6_policer_classify(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static vlib_cli_command_t set_ip6_classify_command
(constructor) VLIB_CLI_COMMAND (set_ip6_classify_command)
void * vlib_packet_template_get_packet(vlib_main_t *vm, vlib_packet_template_t *t, u32 *bi_result)
u8 *(* trace[256])(u8 *s, ip6_hop_by_hop_option_t *opt)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
ip_multipath_adjacency_t * multipath_adjacencies
Indexed by heap_handle from ip_adjacency_t.
#define VLIB_REGISTER_NODE(x,...)
This packets needs to go to indirect next hop.
u32 vnet_ip6_neighbor_glean_add(u32 fib_index, void *next_hop_arg)
This packet is to be rewritten and forwarded to the next processing node.
#define IP6_ROUTE_FLAG_ADD
#define HBH_OPTION_TYPE_SKIP_UNKNOWN
u32 if_address_index
Interface address index for this local/arp adjacency.
#define vec_foreach(var, vec)
Vector iterator.
#define IP6_ROUTE_FLAG_NO_REDISTRIBUTE
void ip6_add_del_route_next_hop(ip6_main_t *im, u32 flags, ip6_address_t *dst_address, u32 dst_address_length, ip6_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_weight, u32 adj_index, u32 explicit_fib_index)
struct ip_adjacency_t::@143::@145 arp
IP_LOOKUP_NEXT_ARP only.
i16 explicit_fib_index
Force re-lookup in a different FIB.
static void * clib_bihash_get_value(clib_bihash *h, uword offset)
Get pointer to value page given its clib mheap offset.
#define clib_error_return(e, args...)
#define IP6_ROUTE_FLAG_TABLE_ID
static void * ip_interface_address_get_address(ip_lookup_main_t *lm, ip_interface_address_t *a)
int(* options[256])(vlib_buffer_t *b, ip6_header_t *ip, ip6_hop_by_hop_option_t *opt)
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)
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
static clib_error_t * ip6_lookup_init(vlib_main_t *vm)
#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)
static uword ip6_lookup(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define vnet_rewrite_two_headers(rw0, rw1, p0, p1, most_likely_size)
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
ip6_discover_neighbor_next_t
u32 * fib_index_by_sw_if_index
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define HBH_OPTION_TYPE_HIGH_ORDER_BITS
clib_random_buffer_t random_buffer
vnet_config_main_t config_main
static u16 ip_csum_fold(ip_csum_t c)
static uword ip6_punt(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
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)
static uword pool_elts(void *v)
Number of active elements in a pool.