55 #define OI_DECAP 0x80000000 76 u32 n_left_from, n_left_to_next, *from, *to_next;
84 while (n_left_from > 0)
88 while (n_left_from >= 4 && n_left_to_next >= 2)
91 u32 pi0, pi1, lbi0, lbi1, wrong_next;
95 u32 fib_index0, fib_index1;
96 u32 flow_hash_config0, flow_hash_config1;
113 pi0 = to_next[0] = from[0];
114 pi1 = to_next[1] = from[1];
182 (ip0->
protocol == IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS))
188 (ip1->
protocol == IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS))
206 wrong_next = (next0 != next) + 2 * (next1 != next);
244 while (n_left_from > 0 && n_left_to_next > 0)
252 u32 fib_index0, flow_hash_config0;
302 (ip0->
protocol == IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS))
348 .fp_addr.ip6 = *address,
370 u32 classify_table_index =
372 if (classify_table_index != (
u32) ~ 0)
407 .fp_addr.ip6 = *address,
475 u32 address_length,
u32 is_del)
481 u32 if_address_index;
482 ip6_address_fib_t ip6_af, *addr_fib = 0;
485 if (sw_if_index == 0)
502 (lm, sw_if_index, addr_fib, address_length, is_del, &if_address_index);
517 im, ip6_af.fib_index,
525 address, address_length, if_address_index, is_del);
539 u32 is_admin_up, fib_index;
545 lookup_main.if_address_pool_index_by_sw_if_index,
556 a = ip_interface_address_get_address (&im->lookup_main, ia);
558 ip6_add_interface_routes (vnm, sw_if_index,
562 ip6_del_interface_routes (im, fib_index,
563 a, ia->address_length);
576 .arc_name =
"ip6-unicast",
583 .arc_name =
"ip6-unicast",
584 .node_name =
"ip6-flow-classify",
590 .arc_name =
"ip6-unicast",
591 .node_name =
"ip6-inacl",
597 .arc_name =
"ip6-unicast",
598 .node_name =
"ip6-policer-classify",
604 .arc_name =
"ip6-unicast",
605 .node_name =
"ipsec-input-ip6",
611 .arc_name =
"ip6-unicast",
612 .node_name =
"l2tp-decap",
618 .arc_name =
"ip6-unicast",
619 .node_name =
"vpath-input-ip6",
625 .arc_name =
"ip6-unicast",
626 .node_name =
"ip6-vxlan-bypass",
632 .arc_name =
"ip6-unicast",
633 .node_name =
"ip6-drop",
639 .arc_name =
"ip6-unicast",
640 .node_name =
"ip6-lookup",
647 .arc_name =
"ip6-multicast",
653 .arc_name =
"ip6-multicast",
654 .node_name =
"vpath-input-ip6",
659 .arc_name =
"ip6-multicast",
660 .node_name =
"ip6-drop",
665 .arc_name =
"ip6-multicast",
666 .node_name =
"ip6-mfib-forward-lookup",
673 .arc_name =
"ip6-output",
674 .start_nodes =
VNET_FEATURES (
"ip6-rewrite",
"ip6-midchain"),
679 .arc_name =
"ip6-output",
680 .node_name =
"ipsec-output-ip6",
685 .arc_name =
"ip6-output",
686 .node_name =
"interface-output",
743 .name =
"ip6-lookup",
744 .vector_size =
sizeof (
u32),
745 .format_trace = format_ip6_lookup_trace,
758 u32 n_left_from, n_left_to_next, *from, *to_next;
770 while (n_left_from > 0)
775 while (n_left_from >= 4 && n_left_to_next >= 2)
780 u32 pi0, lbi0, hc0, pi1, lbi1, hc1;
798 pi0 = to_next[0] = from[0];
799 pi1 = to_next[1] = from[1];
873 (ip0->
protocol == IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS))
880 (ip1->
protocol == IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS))
895 to_next, n_left_to_next,
896 pi0, pi1, next0, next1);
899 while (n_left_from > 0 && n_left_to_next > 0)
950 (ip0->
protocol == IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS))
960 to_next, n_left_to_next,
974 .name =
"ip6-load-balance",
975 .vector_size =
sizeof (
u32),
976 .sibling_of =
"ip6-lookup",
977 .format_trace = format_ip6_lookup_trace,
991 u8 packet_data[128 - 1 *
sizeof (
u32)];
1000 ip6_forward_next_trace_t *t = va_arg (*args, ip6_forward_next_trace_t *);
1014 ip6_forward_next_trace_t *t = va_arg (*args, ip6_forward_next_trace_t *);
1017 s =
format (s,
"fib %d dpo-idx %d flow hash: 0x%08x",
1031 ip6_forward_next_trace_t *t = va_arg (*args, ip6_forward_next_trace_t *);
1034 s =
format (s,
"tx_sw_if_index %d adj-idx %d : %U flow hash: 0x%08x",
1060 ip6_forward_next_trace_t *t0, *t1;
1110 ip6_forward_next_trace_t *t0;
1173 .vector_size =
sizeof (
u32),
1178 [0] =
"error-drop",},
1189 .vector_size =
sizeof (
u32),
1194 [0] =
"error-punt",},
1206 u16 sum16, payload_length_host_byte_order;
1207 u32 i, n_this_buffer, n_bytes_left;
1208 u32 headers_size =
sizeof (ip0[0]);
1209 void *data_this_buffer;
1216 payload_length_host_byte_order = clib_net_to_host_u16 (ip0->
payload_length);
1217 data_this_buffer = (
void *) (ip0 + 1);
1223 src_address.as_uword[i],
1236 ip6_hop_by_hop_ext_t *ext_hdr =
1237 (ip6_hop_by_hop_ext_t *) data_this_buffer;
1240 ASSERT ((ext_hdr->next_hdr == IP_PROTOCOL_ICMP6)
1241 || (ext_hdr->next_hdr == IP_PROTOCOL_UDP));
1243 skip_bytes = 8 * (1 + ext_hdr->n_data_u64s);
1244 data_this_buffer = (
void *) ((
u8 *) data_this_buffer + skip_bytes);
1246 payload_length_host_byte_order -= skip_bytes;
1247 headers_size += skip_bytes;
1250 n_bytes_left = n_this_buffer = payload_length_host_byte_order;
1258 n_bytes_left -= n_this_buffer;
1259 if (n_bytes_left == 0)
1287 || ip0->
protocol == IP_PROTOCOL_ICMP6
1288 || ip0->
protocol == IP_PROTOCOL_UDP
1289 || ip0->
protocol == IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS);
1291 udp0 = (
void *) (ip0 + 1);
1294 p0->
flags |= (VNET_BUFFER_F_L4_CHECKSUM_COMPUTED
1295 | VNET_BUFFER_F_L4_CHECKSUM_CORRECT);
1301 p0->
flags |= (VNET_BUFFER_F_L4_CHECKSUM_COMPUTED
1302 | ((sum16 == 0) << VNET_BUFFER_F_LOG2_L4_CHECKSUM_CORRECT));
1332 if (proto0 != IP_PROTOCOL_UDP)
1335 proto0 = (proto0 == IP_PROTOCOL_TCP) ? proto0 : 0;
1343 .arc_name =
"ip6-local",
1355 u32 *from, *to_next, n_left_from, n_left_to_next;
1358 u8 arc_index = vnet_feat_arc_ip6_local.feature_arc_index;
1367 while (n_left_from > 0)
1371 while (n_left_from >= 4 && n_left_to_next >= 2)
1376 u32 pi0, ip_len0, udp_len0, flags0, next0;
1377 u32 pi1, ip_len1, udp_len1, flags1, next1;
1378 i32 len_diff0, len_diff1;
1379 u8 error0, type0, good_l4_csum0, is_tcp_udp0;
1380 u8 error1, type1, good_l4_csum1, is_tcp_udp1;
1381 u32 udp_offset0, udp_offset1;
1383 pi0 = to_next[0] = from[0];
1384 pi1 = to_next[1] = from[1];
1388 n_left_to_next -= 2;
1390 error0 = error1 = IP6_ERROR_UNKNOWN_PROTOCOL;
1398 if (head_of_feature_arc == 0)
1413 good_l4_csum0 = (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
1414 good_l4_csum1 = (flags1 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
1425 if (is_tcp_udp0 == IP_PROTOCOL_UDP)
1428 udp_len0 = clib_net_to_host_u16 (udp0->
length);
1429 len_diff0 = ip_len0 - udp_len0;
1439 if (is_tcp_udp1 == IP_PROTOCOL_UDP)
1442 udp_len1 = clib_net_to_host_u16 (udp1->
length);
1443 len_diff1 = ip_len1 - udp_len1;
1456 VNET_BUFFER_F_L4_CHECKSUM_COMPUTED)))
1460 (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
1465 VNET_BUFFER_F_L4_CHECKSUM_COMPUTED)))
1469 (flags1 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
1472 error0 = error1 = IP6_ERROR_UNKNOWN_PROTOCOL;
1473 error0 = len_diff0 < 0 ? IP6_ERROR_UDP_LENGTH : error0;
1474 error1 = len_diff1 < 0 ? IP6_ERROR_UDP_LENGTH : error1;
1477 IP6_ERROR_UDP_CHECKSUM);
1479 IP6_ERROR_ICMP_CHECKSUM);
1480 error0 = (!good_l4_csum0 ? IP6_ERROR_UDP_CHECKSUM + type0 : error0);
1481 error1 = (!good_l4_csum1 ? IP6_ERROR_UDP_CHECKSUM + type1 : error1);
1485 if (error0 == IP6_ERROR_UNKNOWN_PROTOCOL &&
1490 ? IP6_ERROR_SRC_LOOKUP_MISS : error0);
1492 if (error1 == IP6_ERROR_UNKNOWN_PROTOCOL &&
1497 ? IP6_ERROR_SRC_LOOKUP_MISS : error1);
1513 if (head_of_feature_arc)
1526 to_next, n_left_to_next,
1527 pi0, pi1, next0, next1);
1530 while (n_left_from > 0 && n_left_to_next > 0)
1535 u32 pi0, ip_len0, udp_len0, flags0, next0;
1537 u8 error0, type0, good_l4_csum0;
1541 pi0 = to_next[0] = from[0];
1545 n_left_to_next -= 1;
1547 error0 = IP6_ERROR_UNKNOWN_PROTOCOL;
1552 if (head_of_feature_arc == 0)
1560 good_l4_csum0 = (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
1571 if (is_tcp_udp0 == IP_PROTOCOL_UDP)
1574 udp_len0 = clib_net_to_host_u16 (udp0->
length);
1575 len_diff0 = ip_len0 - udp_len0;
1585 VNET_BUFFER_F_L4_CHECKSUM_COMPUTED)))
1589 (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
1592 error0 = IP6_ERROR_UNKNOWN_PROTOCOL;
1593 error0 = len_diff0 < 0 ? IP6_ERROR_UDP_LENGTH : error0;
1596 IP6_ERROR_UDP_CHECKSUM);
1598 IP6_ERROR_ICMP_CHECKSUM);
1599 error0 = (!good_l4_csum0 ? IP6_ERROR_UDP_CHECKSUM + type0 : error0);
1602 if (error0 == IP6_ERROR_UNKNOWN_PROTOCOL &&
1607 ? IP6_ERROR_SRC_LOOKUP_MISS : error0);
1617 if (head_of_feature_arc)
1626 to_next, n_left_to_next,
1646 .name =
"ip6-local",
1647 .vector_size =
sizeof (
u32),
1673 .name =
"ip6-local-end-of-arc",
1674 .vector_size =
sizeof (
u32),
1677 .sibling_of =
"ip6-local",
1683 .arc_name =
"ip6-local",
1684 .node_name =
"ip6-local-end-of-arc",
1723 u32 *from, *to_next_drop;
1724 uword n_left_from, n_left_to_next_drop;
1725 static f64 time_last_seed_change = -1e100;
1726 static u32 hash_seeds[3];
1735 if (time_now - time_last_seed_change > 1e-3)
1739 sizeof (hash_seeds));
1740 for (i = 0; i <
ARRAY_LEN (hash_seeds); i++)
1741 hash_seeds[i] = r[i];
1744 for (i = 0; i <
ARRAY_LEN (hash_bitmap); i++)
1747 time_last_seed_change = time_now;
1753 while (n_left_from > 0)
1756 to_next_drop, n_left_to_next_drop);
1758 while (n_left_from > 0 && n_left_to_next_drop > 0)
1762 u32 pi0, adj_index0, a0, b0, c0, m0, sw_if_index0, drop0;
1790 sw_if_index0 = adj0->rewrite_header.sw_if_index;
1804 c0 &=
BITS (hash_bitmap) - 1;
1808 bm0 = hash_bitmap[c0];
1809 drop0 = (bm0 & m0) != 0;
1812 hash_bitmap[c0] = bm0 | m0;
1816 to_next_drop[0] = pi0;
1818 n_left_to_next_drop -= 1;
1841 icmp6_neighbor_solicitation_header_t *h0;
1854 &h0->ip.src_address))
1874 clib_memcpy (h0->link_layer_option.ethernet_address,
1878 h0->neighbor.icmp.checksum = 0;
1879 h0->neighbor.icmp.checksum =
1883 ASSERT (bogus_length == 0);
1901 n_left_to_next_drop);
1924 =
"no source address for ND solicitation",
1931 .name =
"ip6-discover-neighbor",
1932 .vector_size =
sizeof (
u32),
1934 .n_errors =
ARRAY_LEN (ip6_discover_neighbor_error_strings),
1949 .name =
"ip6-glean",
1950 .vector_size =
sizeof (
u32),
1952 .n_errors =
ARRAY_LEN (ip6_discover_neighbor_error_strings),
1968 icmp6_neighbor_solicitation_header_t *
h;
1993 vnm->
api_errno = VNET_API_ERROR_NO_MATCHING_INTERFACE;
1995 (0,
"no matching interface address for destination %U (interface %U)",
2009 h->ip.dst_address.as_u8[13] = dst->
as_u8[13];
2010 h->ip.dst_address.as_u8[14] = dst->
as_u8[14];
2011 h->ip.dst_address.as_u8[15] = dst->
as_u8[15];
2013 h->ip.src_address = src[0];
2014 h->neighbor.target_address = dst[0];
2027 h->neighbor.icmp.checksum =
2029 ASSERT (bogus_length == 0);
2036 ip46_address_t nh = {
2077 int do_counters,
int is_midchain,
int is_mcast)
2081 u32 n_left_from, n_left_to_next, *to_next, next_index;
2089 while (n_left_from > 0)
2093 while (n_left_from >= 4 && n_left_to_next >= 2)
2098 u32 pi0, rw_len0, next0, error0, adj_index0;
2099 u32 pi1, rw_len1, next1, error1, adj_index1;
2100 u32 tx_sw_if_index0, tx_sw_if_index1;
2119 pi0 = to_next[0] = from[0];
2120 pi1 = to_next[1] = from[1];
2125 n_left_to_next -= 2;
2136 error0 = error1 = IP6_ERROR_NONE;
2156 error0 = IP6_ERROR_TIME_EXPIRED;
2160 ICMP6_time_exceeded_ttl_exceeded_in_transit,
2166 p0->
flags &= ~VNET_BUFFER_F_LOCALLY_ORIGINATED;
2185 error1 = IP6_ERROR_TIME_EXPIRED;
2189 ICMP6_time_exceeded_ttl_exceeded_in_transit,
2195 p1->
flags &= ~VNET_BUFFER_F_LOCALLY_ORIGINATED;
2200 rw_len0 = adj0[0].rewrite_header.data_bytes;
2201 rw_len1 = adj1[0].rewrite_header.data_bytes;
2202 vnet_buffer (p0)->ip.save_rewrite_length = rw_len0;
2203 vnet_buffer (p1)->ip.save_rewrite_length = rw_len1;
2209 thread_index, adj_index0, 1,
2213 thread_index, adj_index1, 1,
2221 rewrite_header.max_l3_packet_bytes ? IP6_ERROR_MTU_EXCEEDED :
2226 rewrite_header.max_l3_packet_bytes ? IP6_ERROR_MTU_EXCEEDED :
2236 tx_sw_if_index0 = adj0[0].rewrite_header.sw_if_index;
2238 next0 = adj0[0].rewrite_header.next_index;
2243 tx_sw_if_index0, &next0, p0);
2250 tx_sw_if_index1 = adj1[0].rewrite_header.sw_if_index;
2252 next1 = adj1[0].rewrite_header.next_index;
2257 tx_sw_if_index1, &next1, p1);
2279 to_next, n_left_to_next,
2280 pi0, pi1, next0, next1);
2283 while (n_left_from > 0 && n_left_to_next > 0)
2289 u32 adj_index0, next0, error0;
2290 u32 tx_sw_if_index0;
2292 pi0 = to_next[0] = from[0];
2302 error0 = IP6_ERROR_NONE;
2322 error0 = IP6_ERROR_TIME_EXPIRED;
2326 ICMP6_time_exceeded_ttl_exceeded_in_transit,
2332 p0->
flags &= ~VNET_BUFFER_F_LOCALLY_ORIGINATED;
2339 rw_len0 = adj0[0].rewrite_header.data_bytes;
2340 vnet_buffer (p0)->ip.save_rewrite_length = rw_len0;
2346 thread_index, adj_index0, 1,
2354 rewrite_header.max_l3_packet_bytes ? IP6_ERROR_MTU_EXCEEDED :
2364 tx_sw_if_index0 = adj0[0].rewrite_header.sw_if_index;
2367 next0 = adj0[0].rewrite_header.next_index;
2372 tx_sw_if_index0, &next0, p0);
2389 n_left_to_next -= 1;
2392 to_next, n_left_to_next,
2450 .name =
"ip6-midchain",
2451 .vector_size =
sizeof (
u32),
2453 .sibling_of =
"ip6-rewrite",
2463 .name =
"ip6-rewrite",
2464 .vector_size =
sizeof (
u32),
2481 .name =
"ip6-rewrite-mcast",
2482 .vector_size =
sizeof (
u32),
2484 .sibling_of =
"ip6-rewrite",
2494 .name =
"ip6-mcast-midchain",
2495 .vector_size =
sizeof (
u32),
2497 .sibling_of =
"ip6-rewrite",
2508 #define foreach_ip6_hop_by_hop_error \ 2509 _(PROCESSED, "pkts with ip6 hop-by-hop options") \ 2510 _(FORMAT, "incorrectly formatted hop-by-hop options") \ 2511 _(UNKNOWN_OPTION, "unknown ip6 hop-by-hop options") 2516 #define _(sym,str) IP6_HOP_BY_HOP_ERROR_##sym, 2537 #define _(sym,string) string, 2546 int total_len = va_arg (*args,
int);
2551 s =
format (s,
"IP6_HOP_BY_HOP: next protocol %d len %d total %d",
2557 while (opt0 < limit0)
2567 if (hm->
trace[type0])
2569 s = (*hm->
trace[type0]) (s, opt0);
2574 format (s,
"\n unrecognized option %d length %d", type0,
2600 s =
format (s,
"IP6_HOP_BY_HOP: next index %d len %d traced %d",
2606 while (opt0 < limit0)
2616 if (hm->
trace[type0])
2618 s = (*hm->
trace[type0]) (s, opt0);
2623 format (s,
"\n unrecognized option %d length %d", type0,
2646 while (opt0 < limit0)
2659 if ((*hm->
options[type0]) (b0, ip0, opt0) < 0)
2661 error0 = IP6_HOP_BY_HOP_ERROR_FORMAT;
2673 error0 = IP6_HOP_BY_HOP_ERROR_UNKNOWN_OPTION;
2677 error0 = IP6_HOP_BY_HOP_ERROR_UNKNOWN_OPTION;
2680 ICMP6_parameter_problem_unrecognized_option,
2681 (
u8 *) opt0 - (
u8 *) ip0);
2684 error0 = IP6_HOP_BY_HOP_ERROR_UNKNOWN_OPTION;
2689 ICMP6_parameter_problem,
2690 ICMP6_parameter_problem_unrecognized_option,
2691 (
u8 *) opt0 - (
u8 *) ip0);
2719 u32 n_left_from, *from, *to_next;
2726 while (n_left_from > 0)
2732 while (n_left_from >= 4 && n_left_to_next >= 2)
2740 u8 error0 = 0, error1 = 0;
2757 to_next[0] = bi0 = from[0];
2758 to_next[1] = bi1 = from[1];
2762 n_left_to_next -= 2;
2785 ((hbh0->
length + 1) << 3));
2788 ((hbh1->
length + 1) << 3));
2793 if ((hbh0->
length + 1) << 3 >
2796 error0 = IP6_HOP_BY_HOP_ERROR_FORMAT;
2803 if ((hbh1->
length + 1) << 3 >
2806 error1 = IP6_HOP_BY_HOP_ERROR_FORMAT;
2832 u32 trace_len = (hbh0->
length + 1) << 3;
2846 u32 trace_len = (hbh1->
length + 1) << 3;
2864 n_left_to_next, bi0, bi1, next0,
2868 while (n_left_from > 0 && n_left_to_next > 0)
2884 n_left_to_next -= 1;
2900 ((hbh0->
length + 1) << 3));
2905 if ((hbh0->
length + 1) << 3 >
2908 error0 = IP6_HOP_BY_HOP_ERROR_FORMAT;
2927 u32 trace_len = (hbh0->
length + 1) << 3;
2942 n_left_to_next, bi0, next0);
2953 .name =
"ip6-hop-by-hop",
2954 .sibling_of =
"ip6-lookup",
2955 .vector_size =
sizeof (
u32),
2958 .n_errors =
ARRAY_LEN (ip6_hop_by_hop_error_strings),
3001 hm->
options[option] = options;
3028 for (i = 0; i < 256; i++)
3062 for (j = 0; j < i0; j++)
3067 clib_host_to_net_u32 (
pow2_mask (i1) << (32 - i1));
3081 "ip6 FIB fwding table",
3084 "ip6 FIB non-fwding table",
3103 icmp6_neighbor_solicitation_header_t p;
3105 memset (&p, 0,
sizeof (p));
3107 p.ip.ip_version_traffic_class_and_flow_label =
3108 clib_host_to_net_u32 (0x6 << 28);
3109 p.ip.payload_length =
3110 clib_host_to_net_u16 (
sizeof (p) -
3112 (icmp6_neighbor_solicitation_header_t, neighbor));
3113 p.ip.protocol = IP_PROTOCOL_ICMP6;
3114 p.ip.hop_limit = 255;
3117 p.neighbor.icmp.type = ICMP6_neighbor_solicitation;
3119 p.link_layer_option.header.type =
3120 ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
3121 p.link_layer_option.header.n_data_u64s =
3122 sizeof (p.link_layer_option) /
sizeof (
u64);
3128 "ip6 neighbor discovery");
3140 ip->
as_u64[0] = clib_host_to_net_u64 (0xFE80000000000000ULL);
3142 ip->
as_u8[8] = mac[0] ^ (1 << 1);
3143 ip->
as_u8[9] = mac[1];
3144 ip->
as_u8[10] = mac[2];
3145 ip->
as_u8[11] = 0xFF;
3146 ip->
as_u8[12] = 0xFE;
3147 ip->
as_u8[13] = mac[3];
3148 ip->
as_u8[14] = mac[4];
3149 ip->
as_u8[15] = mac[5];
3157 mac[0] = ip->
as_u8[8] ^ (1 << 1);
3158 mac[1] = ip->
as_u8[9];
3159 mac[2] = ip->
as_u8[10];
3160 mac[3] = ip->
as_u8[13];
3161 mac[4] = ip->
as_u8[14];
3162 mac[5] = ip->
as_u8[15];
3198 .path =
"test ip6 link",
3200 .short_help =
"test ip6 link <mac-address>",
3211 if (~0 == fib_index)
3212 return VNET_API_ERROR_NO_SUCH_FIB;
3227 u32 flow_hash_config = 0;
3232 if (
unformat (input,
"table %d", &table_id))
3235 else if (unformat (input, #a)) { flow_hash_config |= v; matched=1;} 3256 clib_warning (
"BUG: illegal flow hash config 0x%x", flow_hash_config);
3341 .path =
"set ip6 flow-hash",
3343 "set ip6 flow-hash table <table-id> [src] [dst] [sport] [dport] [proto] [reverse]",
3390 .path =
"show ip6 local",
3392 .short_help =
"show ip6 local",
3408 return VNET_API_ERROR_NO_MATCHING_INTERFACE;
3411 return VNET_API_ERROR_NO_SUCH_ENTRY;
3418 if (
NULL != if_addr)
3423 .fp_addr.ip6 = *if_addr,
3431 if (table_index != (
u32) ~ 0)
3461 u32 table_index = ~0;
3462 int table_index_set = 0;
3463 u32 sw_if_index = ~0;
3468 if (
unformat (input,
"table-index %d", &table_index))
3469 table_index_set = 1;
3477 if (table_index_set == 0)
3480 if (sw_if_index == ~0)
3490 case VNET_API_ERROR_NO_MATCHING_INTERFACE:
3493 case VNET_API_ERROR_NO_SUCH_ENTRY:
3512 .path =
"set ip6 classify",
3514 "set ip6 classify intfc <interface> table-index <classify-idx>",
3529 if (
unformat (input,
"hash-buckets %d", &tmp))
3531 else if (
unformat (input,
"heap-size %dm", &tmp))
3532 heapsize = ((
u64) tmp) << 20;
3533 else if (
unformat (input,
"heap-size %dM", &tmp))
3534 heapsize = ((
u64) tmp) << 20;
3535 else if (
unformat (input,
"heap-size %dg", &tmp))
3536 heapsize = ((
u64) tmp) << 30;
3537 else if (
unformat (input,
"heap-size %dG", &tmp))
3538 heapsize = ((
u64) tmp) << 30;
static uword ip6_rewrite(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u8 * format_ip6_forward_next_trace(u8 *s, va_list *args)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
#define vnet_rewrite_one_header(rw0, p0, most_likely_size)
u16 lb_n_buckets
number of buckets in the load-balance.
#define HBH_OPTION_TYPE_DISCARD_UNKNOWN_ICMP
u32 mfib_table_find_or_create_and_lock(fib_protocol_t proto, u32 table_id, mfib_source_t src)
Get the index of the FIB for a Table-ID.
vlib_combined_counter_main_t lbm_to_counters
static uword ip6_local_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int head_of_feature_arc)
sll srl srl sll sra u16x4 i
static u8 * format_ip6_lookup_trace(u8 *s, va_list *args)
static int fib_urpf_check_size(index_t ui)
Data-Plane function to check the size of an uRPF list, (i.e.
format_function_t format_vlib_node_name
static u8 ip6_next_proto_is_tcp_udp(vlib_buffer_t *p0, ip6_header_t *ip0, u32 *udp_offset0)
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
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 vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
static uword ip6_midchain(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u32 * mfib_index_by_sw_if_index
Table index indexed by software interface.
#define IP6_LOOKUP_NEXT_NODES
int dpo_is_adj(const dpo_id_t *dpo)
Return TRUE is the DPO is any type of adjacency.
static void vlib_set_next_frame_buffer(vlib_main_t *vm, vlib_node_runtime_t *node, u32 next_index, u32 buffer_index)
ip_interface_address_t * if_address_pool
Pool of addresses that are assigned to interfaces.
vnet_main_t * vnet_get_main(void)
static uword ip6_glean(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
adj_index_t adj_glean_add_or_lock(fib_protocol_t proto, u32 sw_if_index, const ip46_address_t *nh_addr)
Glean Adjacency.
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
static u8 ip6_scan_hbh_options(vlib_buffer_t *b0, ip6_header_t *ip0, ip6_hop_by_hop_header_t *hbh0, ip6_hop_by_hop_option_t *opt0, ip6_hop_by_hop_option_t *limit0, u32 *next0)
The table that stores ALL routes learned by the DP.
#define foreach_ip6_hop_by_hop_error
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)
#define vnet_fixup_one_header(rw0, addr, p0)
static uword ip6_rewrite_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int do_counters, int is_midchain, int is_mcast)
static u8 * format_ip6_rewrite_trace(u8 *s, va_list *args)
static f64 vlib_time_now(vlib_main_t *vm)
u32 fib_table_get_index_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the index of the FIB bound to the interface.
static void * clib_random_buffer_get_data(clib_random_buffer_t *b, uword n_bytes)
flow_hash_config_t lb_hash_config
the hash config to use when selecting a bucket.
static const dpo_id_t * load_balance_get_fwd_bucket(const load_balance_t *lb, u16 bucket)
u8 * ip_enabled_by_sw_if_index
This packet is to be rewritten and forwarded to the next processing node.
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).
int ip6_hbh_unregister_option(u8 option)
struct _vlib_node_registration vlib_node_registration_t
static clib_error_t * ip6_config(vlib_main_t *vm, unformat_input_t *input)
fib_node_index_t fib_table_entry_update_one_path(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, dpo_proto_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, mpls_label_t *next_hop_labels, fib_route_path_flags_t path_flags)
Update the entry to have just one path.
#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)
u32 ip6_neighbor_sw_interface_add_del(vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
create and initialize router advertisement parameters with default values for this intfc ...
unformat_function_t unformat_vnet_sw_interface
vlib_node_registration_t ip6_rewrite_mcast_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_mcast_node)
#define VNET_HW_INTERFACE_FLAG_LINK_UP
static u32 ip6_fib_table_fwding_lookup(ip6_main_t *im, u32 fib_index, const ip6_address_t *dst)
vlib_error_t * errors
Vector of errors for this node.
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.
static uword ip6_load_balance(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
struct ip_adjacency_t_::@38::@40 midchain
IP_LOOKUP_NEXT_MIDCHAIN.
u8 mcast_feature_arc_index
Feature arc indices.
#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)
ip_lookup_next_t
An adjacency is a representation of an attached L3 peer.
uword as_uword[16/sizeof(uword)]
VNET_SW_INTERFACE_ADD_DEL_FUNCTION(ip6_sw_interface_add_del)
static pg_node_t * pg_get_node(uword node_index)
static uword ip6_vxlan_bypass(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
VNET_FEATURE_ARC_INIT(ip6_unicast, static)
static vlib_node_registration_t ip6_drop_node
(constructor) VLIB_REGISTER_NODE (ip6_drop_node)
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)
u8 output_feature_arc_index
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
clib_error_t * ip6_sw_interface_add_del(vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
#define VLIB_BUFFER_NEXT_PRESENT
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)
void * vlib_packet_template_get_packet(vlib_main_t *vm, vlib_packet_template_t *t, u32 *bi_result)
#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)
ip_csum_t ip_incremental_checksum(ip_csum_t sum, void *_data, uword n_bytes)
#define VLIB_INIT_FUNCTION(x)
void fib_table_entry_special_remove(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Remove a 'special' entry from the FIB.
static uword pow2_mask(uword x)
u16 lb_n_buckets_minus_1
number of buckets in the load-balance - 1.
static vlib_node_registration_t ip6_mcast_midchain_node
(constructor) VLIB_REGISTER_NODE (ip6_mcast_midchain_node)
static clib_error_t * set_ip6_flow_hash_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define IP6_FIB_DEFAULT_HASH_NUM_BUCKETS
Aggregrate type for a prefix.
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
#define clib_error_return(e, args...)
u8 pre_data[VLIB_BUFFER_PRE_DATA_SIZE]
Space for inserting data before buffer start.
void adj_unlock(adj_index_t adj_index)
Release a reference counting lock on the adjacency.
#define clib_error_create(args...)
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
u16 fp_len
The mask length.
#define vlib_call_init_function(vm, x)
u8 * format_ip6_hop_by_hop_ext_hdr(u8 *s, va_list *args)
static clib_error_t * vnet_feature_init(vlib_main_t *vm)
static uword ip6_discover_neighbor_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_glean)
static uword ip6_flow_classify(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
void icmp6_error_set_vnet_buffer(vlib_buffer_t *b, u8 type, u8 code, u32 data)
u32 lookup_table_nbuckets
static int ip6_src_address_for_packet(ip_lookup_main_t *lm, u32 sw_if_index, ip6_address_t *src)
u8 packet_data[128-1 *sizeof(u32)]
vnet_api_error_t api_errno
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
#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.
VLIB_NODE_FUNCTION_MULTIARCH(ip6_lookup_node, ip6_lookup)
u32 * classify_table_index_by_sw_if_index
First table index to use for this interface, ~0 => none.
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
index_t classify_dpo_create(dpo_proto_t proto, u32 classify_table_index)
static void ip6_del_interface_routes(ip6_main_t *im, u32 fib_index, ip6_address_t *address, u32 address_length)
struct ip_adjacency_t_::@38::@39 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
static const dpo_id_t * load_balance_get_bucket_i(const load_balance_t *lb, u32 bucket)
vlib_node_registration_t ip6_input_node
(constructor) VLIB_REGISTER_NODE (ip6_input_node)
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)
#define IP6_FIB_DEFAULT_HASH_MEMORY_SIZE
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
static vlib_node_registration_t ip6_punt_node
(constructor) VLIB_REGISTER_NODE (ip6_punt_node)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
int vnet_set_ip6_flow_hash(u32 table_id, u32 flow_hash_config)
static u32 ip6_compute_flow_hash(const ip6_header_t *ip, flow_hash_config_t 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)
load_balance_main_t load_balance_main
The one instance of load-balance main.
#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.
#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.
VNET_FEATURE_INIT(ip6_flow_classify, static)
#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
vlib_combined_counter_main_t adjacency_counters
Adjacency packet counters.
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.
union ip_adjacency_t_::@38 sub_type
static uword ip6_local(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
ip6_address_t fib_masks[129]
void ip6_mfib_interface_enable_disable(u32 sw_if_index, int is_enable)
Add/remove the interface from the accepting list of the special MFIB entries.
#define VLIB_EARLY_CONFIG_FUNCTION(x, n,...)
Adjacency to drop this packet.
static void vlib_buffer_copy_trace_flag(vlib_main_t *vm, vlib_buffer_t *b, u32 bi_target)
static_always_inline uword vlib_get_thread_index(void)
#define CLIB_PREFETCH(addr, size, type)
ip6_address_t * ip6_interface_first_address(ip6_main_t *im, u32 sw_if_index)
get first IPv6 interface address
#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 fib_table_entry_delete(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Delete a FIB entry.
void fib_table_set_flow_hash_config(u32 fib_index, fib_protocol_t proto, flow_hash_config_t hash_config)
Set the flow hash configured used by the table.
clib_error_t * ip6_sw_interface_admin_up_down(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
vlib_node_registration_t ip6_midchain_node
(constructor) VLIB_REGISTER_NODE (ip6_midchain_node)
#define clib_warning(format, args...)
#define VLIB_BUFFER_IS_TRACED
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)
This table stores the routes that are used to forward traffic.
#define clib_memcpy(a, b, c)
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
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.
u32 adj_index_t
An index for adjacencies.
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.
static void ip6_addr_fib_init(ip6_address_fib_t *addr_fib, ip6_address_t *address, u32 fib_index)
void ip6_ethernet_mac_address_from_link_local_address(u8 *mac, ip6_address_t *ip)
void dpo_set(dpo_id_t *dpo, dpo_type_t type, dpo_proto_t proto, index_t index)
Set/create a DPO ID The DPO will be locked.
vlib_combined_counter_main_t lbm_via_counters
u8 builtin_protocol_by_ip_protocol[256]
IP_BUILTIN_PROTOCOL_{TCP,UDP,ICMP,OTHER} by protocol in IP header.
#define VLIB_CLI_COMMAND(x,...)
struct _vnet_classify_main vnet_classify_main_t
#define foreach_flow_hash_bit
fib_node_index_t fib_table_entry_special_dpo_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
Add a 'special' entry to the FIB that links to the DPO passed A special entry is an entry that the FI...
ip6_add_del_interface_address_function_t * function
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
void ip6_register_protocol(u32 protocol, u32 node_index)
#define VNET_SW_INTERFACE_FLAG_ADMIN_UP
static uword ip6_local_end_of_arc(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
uword unformat_ethernet_address(unformat_input_t *input, va_list *args)
vlib_node_registration_t ip6_discover_neighbor_node
(constructor) VLIB_REGISTER_NODE (ip6_discover_neighbor_node)
index_t lb_urpf
This is the index of the uRPF list for this LB.
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
void ip6_hbh_set_next_override(uword next)
static vlib_node_registration_t ip6_local_end_of_arc_node
(constructor) VLIB_REGISTER_NODE (ip6_local_end_of_arc_node)
static load_balance_t * load_balance_get(index_t lbi)
#define hash_v3_finalize32(a, b, c)
The default route source.
static uword ip6_discover_neighbor(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
vlib_node_registration_t ip6_glean_node
(constructor) VLIB_REGISTER_NODE (ip6_glean_node)
u32 next_buffer
Next buffer for this linked-list of buffers.
u32 fib_table_find_or_create_and_lock(fib_protocol_t proto, u32 table_id, fib_source_t src)
Get the index of the FIB for a Table-ID.
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
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
#define VLIB_NODE_FLAG_TRACE
vnet_classify_main_t vnet_classify_main
int vnet_set_ip6_classify_intfc(vlib_main_t *vm, u32 sw_if_index, u32 table_index)
static char * ip6_discover_neighbor_error_strings[]
Route added as a result of interface configuration.
ip6_fib_table_instance_t ip6_table[IP6_FIB_NUM_TABLES]
The two FIB tables; fwding and non-fwding.
#define VNET_FEATURES(...)
static int ip6_locate_header(vlib_buffer_t *p0, ip6_header_t *ip0, int find_hdr_type, u32 *offset)
static vlib_main_t * vlib_get_main(void)
vlib_node_registration_t ip6_rewrite_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_node)
static uword is_pow2(uword x)
static uword ip6_mcast_midchain(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
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.
u8 ucast_feature_arc_index
static uword ip6_lookup_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
This packets needs to go to ICMP error.
void ip6_sw_interface_enable_disable(u32 sw_if_index, u32 is_enable)
u32 ip6_fib_table_fwding_lookup_with_if_index(ip6_main_t *im, u32 sw_if_index, const ip6_address_t *dst)
#define HBH_OPTION_TYPE_DISCARD_UNKNOWN
static uword ip6_address_is_multicast(ip6_address_t *a)
index_t dpoi_index
the index of objects of that type
static void ip6_set_solicited_node_multicast_address(ip6_address_t *a, u32 id)
static uword ip6_address_is_link_local_unicast(ip6_address_t *a)
static uword ip6_rewrite_mcast(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
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.
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
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,...)
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.
#define clib_mem_unaligned(pointer, type)
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_policer_classify(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u8 *(* trace[256])(u8 *s, ip6_hop_by_hop_option_t *opt)
#define VLIB_REGISTER_NODE(x,...)
static int ip6_urpf_loose_check(ip6_main_t *im, vlib_buffer_t *b, ip6_header_t *i)
returns number of links on which src is reachable.
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
#define HBH_OPTION_TYPE_SKIP_UNKNOWN
adj_index_t adj_nbr_add_or_lock(fib_protocol_t nh_proto, vnet_link_t link_type, const ip46_address_t *nh_addr, u32 sw_if_index)
Neighbour Adjacency sub-type.
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
#define vec_foreach(var, vec)
Vector iterator.
u16 flags
Copy of main node flags.
u16 dpoi_next_node
The next VLIB node to follow.
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)
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)
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
vlib_node_registration_t ip6_load_balance_node
(constructor) VLIB_REGISTER_NODE (ip6_load_balance_node)
This adjacency/interface has output features configured.
ip6_discover_neighbor_next_t
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
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
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 int adj_are_counters_enabled(void)
Get the global configuration option for enabling per-adj counters.
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
static_always_inline void vnet_feature_arc_start(u8 arc, u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
static uword pool_elts(void *v)
Number of active elements in a pool.