54 #ifndef CLIB_MARCH_VARIANT 62 #define OI_DECAP 0x80000000 76 .fp_len = address_length,
80 address->as_u64[0] & im->
fib_masks[address_length].as_u64[0],
81 address->as_u64[1] & im->
fib_masks[address_length].as_u64[1],
105 if (address_length < 128)
144 if (classify_table_index != (
u32) ~ 0)
183 .fp_len = address_length,
187 address->as_u64[0] & im->
fib_masks[address_length].as_u64[0],
188 address->as_u64[1] & im->
fib_masks[address_length].as_u64[1],
210 if (address_length <= 128)
233 address, address_length);
238 #ifndef CLIB_MARCH_VARIANT 269 sw_if_index, !is_enable, 0, 0);
283 ip6_address_t *result = 0;
301 u32 address_length,
u32 is_del)
307 u32 if_address_index;
308 ip6_address_fib_t ip6_af, *addr_fib = 0;
309 const ip6_address_t *ll_addr;
312 if (sw_if_index == 0)
320 if (address_length != 128)
322 vnm->
api_errno = VNET_API_ERROR_ADDRESS_LENGTH_MISMATCH;
325 (
"prefix length of link-local address must be 128");
344 vnm->
api_errno = VNET_API_ERROR_ADDRESS_NOT_DELETABLE;
349 vnm->
api_errno = VNET_API_ERROR_ADDRESS_NOT_FOUND_FOR_INTERFACE;
382 ip_interface_address_get_address
383 (&im->lookup_main, ia);
385 if (ip6_destination_matches_route
386 (im, address, x, ia->address_length) ||
387 ip6_destination_matches_route (im,
393 if ((sw_if_index == sif->sw_if_index) &&
394 (ia->address_length == address_length) &&
395 !ip6_address_is_equal (x, address))
398 if (ia->flags & IP_INTERFACE_ADDRESS_FLAG_STALE)
407 vnm->api_errno = VNET_API_ERROR_DUPLICATE_IF_ADDRESS;
408 error = clib_error_create
409 (
"failed to add %U which conflicts with %U for interface %U",
410 format_ip6_address_and_length, address,
412 format_ip6_address_and_length, x,
414 format_vnet_sw_if_index_name, vnm,
428 if (~0 == if_address_index)
430 vnm->api_errno = VNET_API_ERROR_ADDRESS_NOT_FOUND_FOR_INTERFACE;
432 lm->format_address_and_length,
433 addr_fib, address_length,
446 if (~0 != if_address_index)
471 addr_fib, address_length,
477 vnm->api_errno = VNET_API_ERROR_DUPLICATE_IF_ADDRESS;
479 (
"Prefix %U already found on interface %U",
480 lm->format_address_and_length, addr_fib, address_length,
486 addr_fib, address_length,
506 im, ip6_af.fib_index,
512 vec_foreach (cb, im->add_del_interface_address_callbacks)
514 address, address_length, if_address_index, is_del);
532 u32 is_admin_up, fib_index;
538 lookup_main.if_address_pool_index_by_sw_if_index,
549 a = ip_interface_address_get_address (&im->lookup_main, ia);
551 ip6_add_interface_routes (vnm, sw_if_index,
555 ip6_del_interface_routes (sw_if_index, im, fib_index,
556 a, ia->address_length);
569 .arc_name =
"ip6-unicast",
571 .last_in_arc =
"ip6-lookup",
577 .arc_name =
"ip6-unicast",
578 .node_name =
"ip6-flow-classify",
584 .arc_name =
"ip6-unicast",
585 .node_name =
"ip6-inacl",
591 .arc_name =
"ip6-unicast",
592 .node_name =
"ip6-policer-classify",
598 .arc_name =
"ip6-unicast",
599 .node_name =
"ipsec6-input-feature",
605 .arc_name =
"ip6-unicast",
606 .node_name =
"l2tp-decap",
612 .arc_name =
"ip6-unicast",
613 .node_name =
"vpath-input-ip6",
619 .arc_name =
"ip6-unicast",
620 .node_name =
"ip6-vxlan-bypass",
626 .arc_name =
"ip6-unicast",
627 .node_name =
"ip6-not-enabled",
633 .arc_name =
"ip6-unicast",
634 .node_name =
"ip6-lookup",
641 .arc_name =
"ip6-multicast",
643 .last_in_arc =
"ip6-mfib-forward-lookup",
648 .arc_name =
"ip6-multicast",
649 .node_name =
"vpath-input-ip6",
654 .arc_name =
"ip6-multicast",
655 .node_name =
"ip6-not-enabled",
660 .arc_name =
"ip6-multicast",
661 .node_name =
"ip6-mfib-forward-lookup",
668 .arc_name =
"ip6-output",
669 .start_nodes =
VNET_FEATURES (
"ip6-rewrite",
"ip6-midchain",
"ip6-dvr-dpo"),
670 .last_in_arc =
"interface-output",
675 .arc_name =
"ip6-output",
676 .node_name =
"ip6-outacl",
681 .arc_name =
"ip6-output",
682 .node_name =
"ipsec6-output-feature",
687 .arc_name =
"ip6-output",
688 .node_name =
"interface-output",
725 sw_if_index, is_add, 0, 0);
744 .name =
"ip6-lookup",
745 .vector_size =
sizeof (
u32),
746 .format_trace = format_ip6_lookup_trace,
764 n_left =
frame->n_vectors;
773 u32 lbi0, hc0, lbi1, hc1;
925 return frame->n_vectors;
931 .name =
"ip6-load-balance",
932 .vector_size =
sizeof (
u32),
933 .sibling_of =
"ip6-lookup",
934 .format_trace = format_ip6_lookup_trace,
946 u8 packet_data[128 - 1 *
sizeof (
u32)];
950 #ifndef CLIB_MARCH_VARIANT 956 ip6_forward_next_trace_t *t = va_arg (*args, ip6_forward_next_trace_t *);
959 s =
format (s,
"%Ufib:%d adj:%d flow:%d",
974 ip6_forward_next_trace_t *t = va_arg (*args, ip6_forward_next_trace_t *);
977 s =
format (s,
"fib %d dpo-idx %d flow hash: 0x%08x",
991 ip6_forward_next_trace_t *t = va_arg (*args, ip6_forward_next_trace_t *);
994 s =
format (s,
"tx_sw_if_index %d adj-idx %d : %U flow hash: 0x%08x",
1005 #ifndef CLIB_MARCH_VARIANT 1021 ip6_forward_next_trace_t *t0, *t1;
1033 if (b0->
flags & VLIB_BUFFER_IS_TRACED)
1048 if (b1->
flags & VLIB_BUFFER_IS_TRACED)
1071 ip6_forward_next_trace_t *t0;
1077 if (b0->
flags & VLIB_BUFFER_IS_TRACED)
1103 u16 payload_length, payload_length_host_byte_order;
1105 u32 headers_size =
sizeof (ip0[0]);
1106 u8 *data_this_buffer;
1112 payload_length_host_byte_order = clib_net_to_host_u16 (ip0->
payload_length);
1113 data_this_buffer = (
u8 *) (ip0 + 1);
1118 if (
PREDICT_FALSE (next_hdr == IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS))
1121 ip6_hop_by_hop_ext_t *ext_hdr =
1122 (ip6_hop_by_hop_ext_t *) data_this_buffer;
1125 ASSERT ((ext_hdr->next_hdr == IP_PROTOCOL_ICMP6)
1126 || (ext_hdr->next_hdr == IP_PROTOCOL_UDP));
1128 skip_bytes = 8 * (1 + ext_hdr->n_data_u64s);
1129 data_this_buffer = (
void *) ((
u8 *) data_this_buffer + skip_bytes);
1131 payload_length_host_byte_order -= skip_bytes;
1132 headers_size += skip_bytes;
1138 payload_length = clib_host_to_net_u16 (payload_length_host_byte_order);
1139 next_hdr = ext_hdr->next_hdr;
1143 sum0 = payload_length + clib_host_to_net_u16 (next_hdr);
1155 payload_length_host_byte_order,
1156 (
u8 *) ip0, headers_size, NULL);
1159 payload_length_host_byte_order, NULL, 0,
1173 || ip0->
protocol == IP_PROTOCOL_ICMP6
1174 || ip0->
protocol == IP_PROTOCOL_UDP
1175 || ip0->
protocol == IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS);
1177 udp0 = (
void *) (ip0 + 1);
1180 p0->
flags |= (VNET_BUFFER_F_L4_CHECKSUM_COMPUTED
1181 | VNET_BUFFER_F_L4_CHECKSUM_CORRECT);
1187 p0->
flags |= (VNET_BUFFER_F_L4_CHECKSUM_COMPUTED
1188 | ((sum16 == 0) << VNET_BUFFER_F_LOG2_L4_CHECKSUM_CORRECT));
1222 if (proto0 != IP_PROTOCOL_UDP)
1225 proto0 = (proto0 == IP_PROTOCOL_TCP) ? proto0 : 0;
1233 .arc_name =
"ip6-local",
1242 u16 payload_length_host_byte_order;
1243 u32 n_this_buffer, n_bytes_left;
1245 u32 headers_size =
sizeof (ip0[0]);
1246 u8 *data_this_buffer;
1249 data_this_buffer = (
u8 *) (ip0 + 1);
1251 ip6_hop_by_hop_ext_t *ext_hdr = (ip6_hop_by_hop_ext_t *) data_this_buffer;
1255 if (!(ext_hdr->next_hdr == IP_PROTOCOL_ICMP6)
1256 || (ext_hdr->next_hdr == IP_PROTOCOL_UDP))
1260 payload_length_host_byte_order = clib_net_to_host_u16 (ip0->
payload_length);
1261 n_bytes_left = n_this_buffer = payload_length_host_byte_order;
1264 u32 n_ip_bytes_this_buffer =
1266 if (n_this_buffer + headers_size > n_ip_bytes_this_buffer)
1269 n_ip_bytes_this_buffer - headers_size : 0;
1272 n_bytes_left -= n_this_buffer;
1275 if (n_bytes_left == 0)
1288 u32 *from, n_left_from;
1291 u8 arc_index = vnet_feat_arc_ip6_local.feature_arc_index;
1305 while (n_left_from > 2)
1308 if (n_left_from >= 6)
1317 error[0] = IP6_ERROR_UNKNOWN_PROTOCOL;
1318 error[1] = IP6_ERROR_UNKNOWN_PROTOCOL;
1324 if (head_of_feature_arc)
1334 flags[0] = b[0]->
flags;
1335 flags[1] = b[1]->
flags;
1337 u32 good_l4_csum[2];
1339 flags[0] & (VNET_BUFFER_F_L4_CHECKSUM_CORRECT |
1340 VNET_BUFFER_F_OFFLOAD_TCP_CKSUM |
1341 VNET_BUFFER_F_OFFLOAD_UDP_CKSUM);
1343 flags[1] & (VNET_BUFFER_F_L4_CHECKSUM_CORRECT |
1344 VNET_BUFFER_F_OFFLOAD_TCP_CKSUM |
1345 VNET_BUFFER_F_OFFLOAD_UDP_CKSUM);
1347 u32 udp_offset[2] = { };
1353 i16 len_diff[2] = { 0 };
1361 u16 ip_len, udp_len;
1362 ip_len = clib_net_to_host_u16 (ip[0]->payload_length);
1363 udp_len = clib_net_to_host_u16 (udp->
length);
1364 len_diff[0] = ip_len - udp_len;
1373 u16 ip_len, udp_len;
1374 ip_len = clib_net_to_host_u16 (ip[1]->payload_length);
1375 udp_len = clib_net_to_host_u16 (udp->
length);
1376 len_diff[1] = ip_len - udp_len;
1388 && !(flags[0] & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED);
1391 && !(flags[1] & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED);
1395 good_l4_csum[0] = flags[0] & VNET_BUFFER_F_L4_CHECKSUM_CORRECT;
1396 error[0] = IP6_ERROR_UNKNOWN_PROTOCOL;
1401 error[0] = IP6_ERROR_BAD_LENGTH;
1406 good_l4_csum[1] = flags[1] & VNET_BUFFER_F_L4_CHECKSUM_CORRECT;
1407 error[1] = IP6_ERROR_UNKNOWN_PROTOCOL;
1412 error[1] = IP6_ERROR_BAD_LENGTH;
1416 error[0] = len_diff[0] < 0 ? IP6_ERROR_UDP_LENGTH : error[0];
1418 error[1] = len_diff[1] < 0 ? IP6_ERROR_UDP_LENGTH : error[1];
1421 IP6_ERROR_UDP_CHECKSUM,
1422 "Wrong IP6 errors constants");
1424 IP6_ERROR_ICMP_CHECKSUM,
1425 "Wrong IP6 errors constants");
1428 !good_l4_csum[0] ? IP6_ERROR_UDP_CHECKSUM + type[0] : error[0];
1430 !good_l4_csum[1] ? IP6_ERROR_UDP_CHECKSUM + type[1] : error[1];
1435 unroutable[0] = error[0] == IP6_ERROR_UNKNOWN_PROTOCOL
1438 unroutable[1] = error[1] == IP6_ERROR_UNKNOWN_PROTOCOL
1445 ip[0]) ? IP6_ERROR_SRC_LOOKUP_MISS
1452 ip[1]) ? IP6_ERROR_SRC_LOOKUP_MISS
1476 if (head_of_feature_arc)
1479 ip6_unknown[0] = error[0] == (
u8) IP6_ERROR_UNKNOWN_PROTOCOL;
1480 ip6_unknown[1] = error[1] == (
u8) IP6_ERROR_UNKNOWN_PROTOCOL;
1483 u32 next32 = next[0];
1491 u32 next32 = next[1];
1508 error = IP6_ERROR_UNKNOWN_PROTOCOL;
1513 if (head_of_feature_arc)
1520 flags & (VNET_BUFFER_F_L4_CHECKSUM_CORRECT |
1521 VNET_BUFFER_F_OFFLOAD_TCP_CKSUM |
1522 VNET_BUFFER_F_OFFLOAD_UDP_CKSUM);
1534 u16 ip_len, udp_len;
1536 udp_len = clib_net_to_host_u16 (udp->
length);
1537 len_diff = ip_len - udp_len;
1544 && !(flags & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED);
1548 good_l4_csum = flags & VNET_BUFFER_F_L4_CHECKSUM_CORRECT;
1549 error = IP6_ERROR_UNKNOWN_PROTOCOL;
1554 error = IP6_ERROR_BAD_LENGTH;
1559 error = len_diff < 0 ? IP6_ERROR_UDP_LENGTH : error;
1562 IP6_ERROR_UDP_CHECKSUM,
1563 "Wrong IP6 errors constants");
1565 IP6_ERROR_ICMP_CHECKSUM,
1566 "Wrong IP6 errors constants");
1568 error = !good_l4_csum ? IP6_ERROR_UDP_CHECKSUM +
type : error;
1572 u8 unroutable = error == IP6_ERROR_UNKNOWN_PROTOCOL
1579 ip) ? IP6_ERROR_SRC_LOOKUP_MISS :
1595 if (head_of_feature_arc)
1599 u32 next32 = next[0];
1626 .name =
"ip6-local",
1627 .vector_size =
sizeof (
u32),
1650 .name =
"ip6-local-end-of-arc",
1651 .vector_size =
sizeof (
u32),
1654 .sibling_of =
"ip6-local",
1658 .arc_name =
"ip6-local",
1659 .node_name =
"ip6-local-end-of-arc",
1664 #ifdef CLIB_MARCH_VARIANT 1702 #define IP6_MCAST_ADDR_MASK 0xffffffff 1706 u16 adj_packet_bytes,
bool is_locally_generated,
1709 if (adj_packet_bytes >= 1280 && packet_bytes > adj_packet_bytes)
1711 if (is_locally_generated)
1719 *error = IP6_ERROR_MTU_EXCEEDED;
1723 *error = IP6_ERROR_MTU_EXCEEDED;
1735 int do_counters,
int is_midchain,
int is_mcast)
1739 u32 n_left_from, n_left_to_next, *to_next, next_index;
1747 while (n_left_from > 0)
1751 while (n_left_from >= 4 && n_left_to_next >= 2)
1756 u32 pi0, rw_len0, next0, error0, adj_index0;
1757 u32 pi1, rw_len1, next1, error1, adj_index1;
1758 u32 tx_sw_if_index0, tx_sw_if_index1;
1759 bool is_locally_originated0, is_locally_originated1;
1778 pi0 = to_next[0] = from[0];
1779 pi1 = to_next[1] = from[1];
1784 n_left_to_next -= 2;
1795 error0 = error1 = IP6_ERROR_NONE;
1798 is_locally_originated0 =
1799 p0->
flags & VNET_BUFFER_F_LOCALLY_ORIGINATED;
1817 error0 = IP6_ERROR_TIME_EXPIRED;
1821 ICMP6_time_exceeded_ttl_exceeded_in_transit,
1826 is_locally_originated1 =
1827 p1->
flags & VNET_BUFFER_F_LOCALLY_ORIGINATED;
1845 error1 = IP6_ERROR_TIME_EXPIRED;
1849 ICMP6_time_exceeded_ttl_exceeded_in_transit,
1857 rw_len0 = adj0[0].rewrite_header.data_bytes;
1858 rw_len1 = adj1[0].rewrite_header.data_bytes;
1859 vnet_buffer (p0)->ip.save_rewrite_length = rw_len0;
1860 vnet_buffer (p1)->ip.save_rewrite_length = rw_len1;
1866 thread_index, adj_index0, 1,
1870 thread_index, adj_index1, 1,
1881 if (p0->
flags & VNET_BUFFER_F_GSO)
1883 if (p1->
flags & VNET_BUFFER_F_GSO)
1889 adj0[0].rewrite_header.max_l3_packet_bytes,
1890 is_locally_originated0, &next0, is_midchain,
1893 adj1[0].rewrite_header.max_l3_packet_bytes,
1894 is_locally_originated1, &next1, is_midchain,
1904 tx_sw_if_index0 = adj0[0].rewrite_header.sw_if_index;
1906 next0 = adj0[0].rewrite_header.next_index;
1923 tx_sw_if_index1 = adj1[0].rewrite_header.sw_if_index;
1925 next1 = adj1[0].rewrite_header.next_index;
1972 rewrite_header.dst_mcast_offset,
1977 rewrite_header.dst_mcast_offset,
1983 to_next, n_left_to_next,
1984 pi0, pi1, next0, next1);
1987 while (n_left_from > 0 && n_left_to_next > 0)
1993 u32 adj_index0, next0, error0;
1994 u32 tx_sw_if_index0;
1995 bool is_locally_originated0;
1997 pi0 = to_next[0] = from[0];
2007 error0 = IP6_ERROR_NONE;
2011 is_locally_originated0 =
2012 p0->
flags & VNET_BUFFER_F_LOCALLY_ORIGINATED;
2029 error0 = IP6_ERROR_TIME_EXPIRED;
2033 ICMP6_time_exceeded_ttl_exceeded_in_transit,
2052 rw_len0 = adj0[0].rewrite_header.data_bytes;
2053 vnet_buffer (p0)->ip.save_rewrite_length = rw_len0;
2059 thread_index, adj_index0, 1,
2067 if (p0->
flags & VNET_BUFFER_F_GSO)
2071 adj0[0].rewrite_header.max_l3_packet_bytes,
2072 is_locally_originated0, &next0, is_midchain,
2082 tx_sw_if_index0 = adj0[0].rewrite_header.sw_if_index;
2085 next0 = adj0[0].rewrite_header.next_index;
2108 rewrite_header.dst_mcast_offset,
2116 n_left_to_next -= 1;
2119 to_next, n_left_to_next,
2137 int do_counters,
int is_midchain,
int is_mcast)
2140 is_midchain, is_mcast);
2196 .name =
"ip6-midchain",
2197 .vector_size =
sizeof (
u32),
2199 .sibling_of =
"ip6-rewrite",
2204 .name =
"ip6-rewrite",
2205 .vector_size =
sizeof (
u32),
2217 .name =
"ip6-rewrite-bcast",
2218 .vector_size =
sizeof (
u32),
2221 .sibling_of =
"ip6-rewrite",
2226 .name =
"ip6-rewrite-mcast",
2227 .vector_size =
sizeof (
u32),
2229 .sibling_of =
"ip6-rewrite",
2235 .name =
"ip6-mcast-midchain",
2236 .vector_size =
sizeof (
u32),
2238 .sibling_of =
"ip6-rewrite",
2246 #ifndef CLIB_MARCH_VARIANT 2250 #define foreach_ip6_hop_by_hop_error \ 2251 _(PROCESSED, "pkts with ip6 hop-by-hop options") \ 2252 _(FORMAT, "incorrectly formatted hop-by-hop options") \ 2253 _(UNKNOWN_OPTION, "unknown ip6 hop-by-hop options") 2258 #define _(sym,str) IP6_HOP_BY_HOP_ERROR_##sym, 2279 #define _(sym,string) string, 2284 #ifndef CLIB_MARCH_VARIANT 2289 int total_len = va_arg (*args,
int);
2294 s =
format (s,
"IP6_HOP_BY_HOP: next protocol %d len %d total %d",
2300 while (opt0 < limit0)
2310 if (hm->
trace[type0])
2312 s = (*hm->
trace[type0]) (s, opt0);
2317 format (s,
"\n unrecognized option %d length %d", type0,
2344 s =
format (s,
"IP6_HOP_BY_HOP: next index %d len %d traced %d",
2350 while (opt0 < limit0)
2360 if (hm->
trace[type0])
2362 s = (*hm->
trace[type0]) (s, opt0);
2367 format (s,
"\n unrecognized option %d length %d", type0,
2390 while (opt0 < limit0)
2403 if ((*hm->
options[type0]) (b0, ip0, opt0) < 0)
2405 error0 = IP6_HOP_BY_HOP_ERROR_FORMAT;
2417 error0 = IP6_HOP_BY_HOP_ERROR_UNKNOWN_OPTION;
2421 error0 = IP6_HOP_BY_HOP_ERROR_UNKNOWN_OPTION;
2424 ICMP6_parameter_problem_unrecognized_option,
2425 (
u8 *) opt0 - (
u8 *) ip0);
2428 error0 = IP6_HOP_BY_HOP_ERROR_UNKNOWN_OPTION;
2433 ICMP6_parameter_problem,
2434 ICMP6_parameter_problem_unrecognized_option,
2435 (
u8 *) opt0 - (
u8 *) ip0);
2463 u32 n_left_from, *from, *to_next;
2467 n_left_from =
frame->n_vectors;
2468 next_index = node->cached_next_index;
2470 while (n_left_from > 0)
2476 while (n_left_from >= 4 && n_left_to_next >= 2)
2484 u8 error0 = 0, error1 = 0;
2501 to_next[0] = bi0 = from[0];
2502 to_next[1] = bi1 = from[1];
2506 n_left_to_next -= 2;
2529 ((hbh0->
length + 1) << 3));
2532 ((hbh1->
length + 1) << 3));
2537 if ((hbh0->
length + 1) << 3 >
2540 error0 = IP6_HOP_BY_HOP_ERROR_FORMAT;
2547 if ((hbh1->
length + 1) << 3 >
2550 error1 = IP6_HOP_BY_HOP_ERROR_FORMAT;
2572 if (b0->
flags & VLIB_BUFFER_IS_TRACED)
2576 u32 trace_len = (hbh0->
length + 1) << 3;
2586 if (b1->
flags & VLIB_BUFFER_IS_TRACED)
2590 u32 trace_len = (hbh1->
length + 1) << 3;
2608 n_left_to_next, bi0, bi1, next0,
2612 while (n_left_from > 0 && n_left_to_next > 0)
2628 n_left_to_next -= 1;
2644 ((hbh0->
length + 1) << 3));
2649 if ((hbh0->
length + 1) << 3 >
2652 error0 = IP6_HOP_BY_HOP_ERROR_FORMAT;
2671 u32 trace_len = (hbh0->
length + 1) << 3;
2686 n_left_to_next, bi0, next0);
2690 return frame->n_vectors;
2696 .name =
"ip6-hop-by-hop",
2697 .sibling_of =
"ip6-lookup",
2698 .vector_size =
sizeof (
u32),
2701 .n_errors =
ARRAY_LEN (ip6_hop_by_hop_error_strings),
2719 #ifndef CLIB_MARCH_VARIANT 2765 hm->
trace[option] = NULL;
2770 for (i = 0; i < 256; i++)
2805 for (j = 0; j < i0; j++)
2810 clib_host_to_net_u32 (
pow2_mask (i1) << (32 - i1));
2835 #ifndef CLIB_MARCH_VARIANT 2843 if (~0 == fib_index)
2844 return VNET_API_ERROR_NO_SUCH_FIB;
2860 u32 flow_hash_config = 0;
2865 if (
unformat (input,
"table %d", &table_id))
2868 else if (unformat (input, #a)) { flow_hash_config |= v; matched=1;} 2889 clib_warning (
"BUG: illegal flow hash config 0x%x", flow_hash_config);
2974 .path =
"set ip6 flow-hash",
2976 "set ip6 flow-hash table <table-id> [src] [dst] [sport] [dport] [proto] [reverse]",
2996 ip6_local_node.index)->
3023 .path =
"show ip6 local",
3025 .short_help =
"show ip6 local",
3029 #ifndef CLIB_MARCH_VARIANT 3039 ip6_address_t *if_addr;
3042 return VNET_API_ERROR_NO_MATCHING_INTERFACE;
3045 return VNET_API_ERROR_NO_SUCH_ENTRY;
3052 if (NULL != if_addr)
3057 .fp_addr.ip6 = *if_addr,
3065 if (table_index != (
u32) ~ 0)
3096 u32 table_index = ~0;
3097 int table_index_set = 0;
3103 if (
unformat (input,
"table-index %d", &table_index))
3104 table_index_set = 1;
3112 if (table_index_set == 0)
3115 if (sw_if_index == ~0)
3125 case VNET_API_ERROR_NO_MATCHING_INTERFACE:
3128 case VNET_API_ERROR_NO_SUCH_ENTRY:
3147 .path =
"set ip6 classify",
3149 "set ip6 classify intfc <interface> table-index <classify-idx>",
static vlib_cli_command_t set_ip6_flow_hash_command
(constructor) VLIB_CLI_COMMAND (set_ip6_flow_hash_command)
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 vnet_rewrite_one_header(rw0, p0, most_likely_size)
u16 lb_n_buckets
number of buckets in the load-balance.
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
#define HBH_OPTION_TYPE_DISCARD_UNKNOWN_ICMP
static ip_interface_prefix_t * ip_get_interface_prefix(ip_lookup_main_t *lm, ip_interface_prefix_key_t *k)
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.
static uword ip6_local_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int head_of_feature_arc)
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
static clib_error_t * ip6_sw_interface_admin_up_down(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
static u8 * format_ip6_lookup_trace(u8 *s, va_list *args)
static u32 ip6_fib_table_fwding_lookup(u32 fib_index, const ip6_address_t *dst)
static int fib_urpf_check_size(index_t ui)
Data-Plane function to check the size of an uRPF list, (i.e.
void ip_frag_set_vnet_buffer(vlib_buffer_t *b, u16 mtu, u8 next_index, u8 flags)
int ip6_link_enable(u32 sw_if_index, const ip6_address_t *link_local_addr)
IPv6 Configuration on an interface.
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)
vl_api_wireguard_peer_flags_t flags
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.
u32 * mfib_index_by_sw_if_index
Table index indexed by software interface.
#define IP6_LOOKUP_NEXT_NODES
Route added as a result of interface configuration.
int dpo_is_adj(const dpo_id_t *dpo)
Return TRUE is the DPO is any type of adjacency.
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)
int ip6_link_set_local_address(u32 sw_if_index, const ip6_address_t *address)
#define pool_foreach(VAR, POOL)
Iterate through pool.
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)
#define foreach_ip6_hop_by_hop_error
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
vl_api_ip_proto_t protocol
static void * ip_interface_address_get_address(ip_lookup_main_t *lm, ip_interface_address_t *a)
vlib_node_registration_t ip6_lookup_node
(constructor) VLIB_REGISTER_NODE (ip6_lookup_node)
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)
#define clib_memcpy_fast(a, b, c)
static u8 * format_ip6_rewrite_trace(u8 *s, va_list *args)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
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.
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
u16 current_length
Nbytes between current data and the end of this buffer.
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)
static uword ip6_lookup_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
int ip6_link_disable(u32 sw_if_index)
struct ip_adjacency_t_::@161::@163 midchain
IP_LOOKUP_NEXT_MIDCHAIN.
static ip_csum_t ip_csum_with_carry(ip_csum_t sum, ip_csum_t x)
unformat_function_t unformat_vnet_sw_interface
vlib_node_registration_t ip6_rewrite_mcast_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_mcast_node)
#define VLIB_NODE_FN(node)
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.
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
u8 mcast_feature_arc_index
Feature arc indices.
format_function_t format_vnet_sw_if_index_name
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
ip_lookup_next_t
An adjacency is a representation of an attached L3 peer.
VNET_SW_INTERFACE_ADD_DEL_FUNCTION(ip6_sw_interface_add_del)
static pg_node_t * pg_get_node(uword node_index)
#define clib_memcpy(d, s, n)
VNET_FEATURE_ARC_INIT(ip6_unicast, static)
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, fib_mpls_label_t *next_hop_labels, fib_route_path_flags_t path_flags)
Update the entry to have just one path.
u32 ip6_tcp_udp_icmp_validate_checksum(vlib_main_t *vm, vlib_buffer_t *p0)
u8 output_feature_arc_index
static u16 ip_calculate_l4_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip_csum_t sum0, u32 payload_length, u8 *iph, u32 ip_header_size, u8 *l4h)
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
static u8 * format_ip6_hop_by_hop_trace(u8 *s, va_list *args)
#define static_always_inline
#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)
#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)
static uword ip6_rewrite_inline_with_gso(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int do_counters, int is_midchain, int is_mcast)
u16 lb_n_buckets_minus_1
number of buckets in the load-balance - 1.
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)
description fragment has unexpected format
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
Aggregate type for a prefix.
#define clib_error_return(e, args...)
static_always_inline u8 ip6_tcp_udp_icmp_bad_length(vlib_main_t *vm, vlib_buffer_t *p0)
#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)
static clib_error_t * ip6_sw_interface_add_del(vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
u8 * format_ip6_hop_by_hop_ext_hdr(u8 *s, va_list *args)
void ip6_unregister_protocol(u32 protocol)
static clib_error_t * vnet_feature_init(vlib_main_t *vm)
void icmp6_error_set_vnet_buffer(vlib_buffer_t *b, u8 type, u8 code, u32 data)
vl_api_fib_path_type_t type
vlib_error_t error
Error code for buffers to be enqueued to error handler.
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...
static vlib_cli_command_t show_ip6_local
(constructor) VLIB_CLI_COMMAND (show_ip6_local)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vlib_node_registration_t ip6_rewrite_bcast_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_bcast_node)
void vnet_sw_interface_update_unnumbered(u32 unnumbered_sw_if_index, u32 ip_sw_if_index, u8 enable)
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 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)
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)
#define pool_put(P, E)
Free an object E in pool P.
static_always_inline void * vnet_feature_arc_start_w_cfg_index(u8 arc, u32 sw_if_index, u32 *next, vlib_buffer_t *b, u32 cfg_index)
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)
vl_api_address_union_t src_address
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.
ip_interface_address_flags_t flags
#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)
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))
vlib_combined_counter_main_t adjacency_counters
Adjacency packet counters.
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)
u8 packet_data[128 - 1 *sizeof(u32)]
static void ip6_add_interface_prefix_routes(ip6_main_t *im, u32 sw_if_index, u32 fib_index, ip6_address_t *address, u32 address_length)
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.
u32 ip_interface_address_find(ip_lookup_main_t *lm, void *addr_fib, u32 address_length)
Adjacency to drop this packet.
#define VLIB_REGISTER_NODE(x,...)
#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
static_always_inline void vlib_buffer_enqueue_to_next(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, u16 *nexts, uword count)
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
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.
clib_error_t * ip_interface_address_add(ip_lookup_main_t *lm, u32 sw_if_index, void *addr_fib, u32 address_length, u32 *result_if_address_index)
static void ip6_del_interface_prefix_routes(ip6_main_t *im, u32 sw_if_index, u32 fib_index, ip6_address_t *address, u32 address_length)
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.
vlib_node_registration_t ip6_midchain_node
(constructor) VLIB_REGISTER_NODE (ip6_midchain_node)
#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.
unformat_function_t * unformat_edit
#define vlib_prefetch_buffer_data(b, type)
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.
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.
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
vlib_main_t vlib_node_runtime_t * node
u8 builtin_protocol_by_ip_protocol[256]
IP_BUILTIN_PROTOCOL_{TCP,UDP,ICMP,OTHER} by protocol in IP header.
clib_error_t * ip_interface_address_del(ip_lookup_main_t *lm, vnet_main_t *vnm, u32 address_index, void *addr_fib, u32 address_length, u32 sw_if_index)
static void ip6_del_interface_routes(u32 sw_if_index, ip6_main_t *im, u32 fib_index, ip6_address_t *address, u32 address_length)
#define VLIB_CLI_COMMAND(x,...)
struct _vnet_classify_main vnet_classify_main_t
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)
index_t lb_urpf
This is the index of the uRPF list for this LB.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
manual_print typedef address
u8 pre_data[VLIB_BUFFER_PRE_DATA_SIZE]
Space for inserting data before buffer start.
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)
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)
static void ip6_addr_fib_init(ip6_address_fib_t *addr_fib, const ip6_address_t *address, u32 fib_index)
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)
u32 ia_cfg_index
feature [arc] config index
#define HBH_OPTION_TYPE_DISCARD_UNKNOWN_ICMP_NOT_MCAST
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 uword ip6_address_is_link_local_unicast(const ip6_address_t *a)
#define clib_mem_unaligned(pointer, type)
static uword ip6_address_is_equal(const ip6_address_t *a, const ip6_address_t *b)
static uword ip6_address_is_multicast(const ip6_address_t *a)
#define VNET_FEATURES(...)
static vlib_main_t * vlib_get_main(void)
vlib_node_registration_t ip6_rewrite_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_node)
static uword vnet_sw_interface_is_admin_up(vnet_main_t *vnm, u32 sw_if_index)
static u32 ip6_compute_flow_hash(const ip6_header_t *ip, flow_hash_config_t flow_hash_config)
#define vec_elt(v, i)
Get vector value at index i.
union ip_adjacency_t_::@161 sub_type
struct _vlib_node_registration vlib_node_registration_t
__clib_export uword mhash_unset(mhash_t *h, void *key, uword *old_value)
u8 ucast_feature_arc_index
This packets needs to go to ICMP error.
void ip6_sw_interface_enable_disable(u32 sw_if_index, u32 is_enable)
static void vnet_ip_mcast_fixup_header(u32 dst_mcast_mask, u32 dst_mcast_offset, u32 *addr, u8 *packet0)
#define HBH_OPTION_TYPE_DISCARD_UNKNOWN
index_t dpoi_index
the index of objects of that type
#define foreach_flow_hash_bit
#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)
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
#define STATIC_ASSERT(truth,...)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
#define IP6_MCAST_ADDR_MASK
This bits of an IPv6 address to mask to construct a multicast MAC address.
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
mhash_t prefix_to_if_prefix_index
Hash table mapping prefix to index in interface prefix pool.
ip_interface_prefix_key_t key
VLIB buffer representation.
vnet_sw_interface_t * sw_interfaces
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
The default route source.
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
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)
A collection of combined counters.
static_always_inline void vnet_calc_checksums_inline(vlib_main_t *vm, vlib_buffer_t *b, int is_ip4, int is_ip6)
u16 ip6_tcp_udp_icmp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip6_header_t *ip0, int *bogus_lengthp)
static vlib_cli_command_t set_ip6_classify_command
(constructor) VLIB_CLI_COMMAND (set_ip6_classify_command)
u8 *(* trace[256])(u8 *s, ip6_hop_by_hop_option_t *opt)
static struct option options[]
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
static void ip6_mtu_check(vlib_buffer_t *b, u16 packet_bytes, u16 adj_packet_bytes, bool is_locally_generated, u32 *next, u8 is_midchain, u32 *error)
static int ip6_locate_header(vlib_buffer_t *p0, ip6_header_t *ip0, int find_hdr_type, u32 *offset)
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.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
u16 dpoi_next_node
The next VLIB node to follow.
static u32 ip6_lookup(gid_ip6_table_t *db, u32 vni, ip_prefix_t *key)
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_always_inline void vlib_get_buffers(vlib_main_t *vm, u32 *bi, vlib_buffer_t **b, int count)
Translate array of buffer indices into buffer pointers.
#define VLIB_NODE_FLAG_TRACE
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)
#define vnet_rewrite_two_headers(rw0, rw1, p0, p1, most_likely_size)
#define CLIB_CACHE_LINE_BYTES
u32 total_length_not_including_first_buffer
Only valid for first buffer in chain.
vlib_node_registration_t ip6_load_balance_node
(constructor) VLIB_REGISTER_NODE (ip6_load_balance_node)
This adjacency/interface has output features configured.
u32 * fib_index_by_sw_if_index
ip_interface_prefix_t * if_prefix_pool
Pool of prefixes containing addresses assigned to interfaces.
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
static int adj_are_counters_enabled(void)
Get the global configuration option for enabling per-adj counters.
vl_api_interface_index_t sw_if_index
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)