72 u32 n_left_from, n_left_to_next, * from, * to_next;
80 while (n_left_from > 0)
83 to_next, n_left_to_next);
85 while (n_left_from >= 4 && n_left_to_next >= 2)
88 u32 pi0, pi1, lbi0, lbi1, wrong_next;
92 u32 fib_index0, fib_index1;
93 u32 flow_hash_config0, flow_hash_config1;
110 pi0 = to_next[0] = from[0];
111 pi1 = to_next[1] = from[1];
181 (cm, cpu_index, lbi0, 1,
184 (cm, cpu_index, lbi1, 1,
192 wrong_next = (next0 != next) + 2*(next1 != next);
229 while (n_left_from > 0 && n_left_to_next > 0)
237 u32 fib_index0, flow_hash_config0;
285 (cm, cpu_index, lbi0, 1,
299 to_next, n_left_to_next);
325 .fp_addr.ip6 = *address,
351 u32 classify_table_index =
353 if (classify_table_index != (
u32) ~0)
394 .fp_addr.ip6 = *address,
419 u32 lookup_feature_index;
454 lookup_feature_index,
460 lookup_feature_index,
486 *result_ia = result ? ia : 0;
501 u32 if_address_index;
502 ip6_address_fib_t ip6_af, * addr_fib = 0;
532 im, ip6_af.fib_index,
539 address, address_length,
557 u32 is_admin_up, fib_index;
571 a = ip_interface_address_get_address (&im->lookup_main, ia);
573 ip6_add_interface_routes (vnm, sw_if_index,
577 ip6_del_interface_routes (im, fib_index,
578 a, ia->address_length);
588 .node_name =
"ip6-flow-classify",
594 .node_name =
"ip6-inacl",
600 .node_name =
"ip6-policer-classify",
606 .node_name =
"ipsec-input-ip6",
612 .node_name =
"l2tp-decap",
618 .node_name =
"vpath-input-ip6",
624 .node_name =
"ip6-lookup",
630 .node_name =
"ip6-drop",
637 .node_name =
"vpath-input-ip6",
643 .node_name =
"ip6-lookup",
649 .node_name =
"ip6-drop",
665 .node_name =
"interface-output",
679 int feature_start_len;
689 feature_start_len =
ARRAY_LEN(rx_feature_start_nodes);
694 feature_start_len =
ARRAY_LEN(tx_feature_start_nodes);
770 .name =
"ip6-lookup",
771 .vector_size =
sizeof (
u32),
773 .format_trace = format_ip6_lookup_trace,
787 u32 n_left_from, n_left_to_next, * from, * to_next;
799 while (n_left_from > 0)
802 to_next, n_left_to_next);
805 while (n_left_from > 0 && n_left_to_next > 0)
839 (cm, cpu_index, lbi0, 1,
853 to_next, n_left_to_next);
868 .name =
"ip6-load-balance",
869 .vector_size =
sizeof (
u32),
870 .sibling_of =
"ip6-lookup",
871 .format_trace = format_ip6_lookup_trace,
884 u8 packet_data[128 - 1*
sizeof(
u32)];
891 ip6_forward_next_trace_t * t = va_arg (*args, ip6_forward_next_trace_t *);
904 ip6_forward_next_trace_t * t = va_arg (*args, ip6_forward_next_trace_t *);
907 s =
format (s,
"fib %d dpo-idx %d flow hash: 0x%08x",
920 ip6_forward_next_trace_t * t = va_arg (*args, ip6_forward_next_trace_t *);
924 s =
format (s,
"tx_sw_if_index %d adj-idx %d : %U flow hash: 0x%08x",
953 ip6_forward_next_trace_t * t0, * t1;
1001 ip6_forward_next_trace_t * t0;
1064 .vector_size =
sizeof (
u32),
1079 .vector_size =
sizeof (
u32),
1093 .name =
"ip6-multicast",
1094 .vector_size =
sizeof (
u32),
1108 u16 sum16, payload_length_host_byte_order;
1109 u32 i, n_this_buffer, n_bytes_left;
1110 u32 headers_size =
sizeof(ip0[0]);
1111 void * data_this_buffer;
1118 payload_length_host_byte_order = clib_net_to_host_u16 (ip0->
payload_length);
1119 data_this_buffer = (
void *) (ip0 + 1);
1133 ip6_hop_by_hop_ext_t *ext_hdr = (ip6_hop_by_hop_ext_t *)data_this_buffer;
1136 ASSERT(ext_hdr->next_hdr == IP_PROTOCOL_ICMP6);
1138 skip_bytes = 8* (1 + ext_hdr->n_data_u64s);
1139 data_this_buffer = (
void *)((
u8 *)data_this_buffer + skip_bytes);
1141 payload_length_host_byte_order -= skip_bytes;
1142 headers_size += skip_bytes;
1145 n_bytes_left = n_this_buffer = payload_length_host_byte_order;
1150 u8 nb_segs = mb->nb_segs;
1154 while (n_bytes_left)
1157 n_bytes_left -= n_this_buffer;
1161 if ((nb_segs == 0) || (mb == 0))
1164 data_this_buffer = rte_ctrlmbuf_data(mb);
1165 n_this_buffer = mb->data_len;
1167 if (n_bytes_left || nb_segs)
1180 n_bytes_left -= n_this_buffer;
1181 if (n_bytes_left == 0)
1209 || ip0->
protocol == IP_PROTOCOL_ICMP6
1210 || ip0->
protocol == IP_PROTOCOL_UDP
1211 || ip0->
protocol == IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS);
1213 udp0 = (
void *) (ip0 + 1);
1237 u32 * from, * to_next, n_left_from, n_left_to_next;
1247 while (n_left_from > 0)
1250 to_next, n_left_to_next);
1252 while (n_left_from >= 4 && n_left_to_next >= 2)
1257 u32 pi0, ip_len0, udp_len0, flags0, next0;
1258 u32 pi1, ip_len1, udp_len1, flags1, next1;
1259 i32 len_diff0, len_diff1;
1260 u8 error0, type0, good_l4_checksum0;
1261 u8 error1, type1, good_l4_checksum1;
1263 pi0 = to_next[0] = from[0];
1264 pi1 = to_next[1] = from[1];
1268 n_left_to_next -= 2;
1301 udp_len0 = clib_net_to_host_u16 (udp0->
length);
1302 udp_len1 = clib_net_to_host_u16 (udp1->
length);
1304 len_diff0 = ip_len0 - udp_len0;
1305 len_diff1 = ip_len1 - udp_len1;
1311 && ! good_l4_checksum0
1319 && ! good_l4_checksum1
1320 && ! (flags1 & IP_BUFFER_L4_CHECKSUM_COMPUTED)))
1327 error0 = error1 = IP6_ERROR_UNKNOWN_PROTOCOL;
1329 error0 = len_diff0 < 0 ? IP6_ERROR_UDP_LENGTH : error0;
1330 error1 = len_diff1 < 0 ? IP6_ERROR_UDP_LENGTH : error1;
1334 error0 = (! good_l4_checksum0
1335 ? IP6_ERROR_UDP_CHECKSUM + type0
1337 error1 = (! good_l4_checksum1
1338 ? IP6_ERROR_UDP_CHECKSUM + type1
1343 if (error0 == IP6_ERROR_UNKNOWN_PROTOCOL &&
1349 ? IP6_ERROR_SRC_LOOKUP_MISS
1352 if (error1 == IP6_ERROR_UNKNOWN_PROTOCOL &&
1358 ? IP6_ERROR_SRC_LOOKUP_MISS
1369 to_next, n_left_to_next,
1370 pi0, pi1, next0, next1);
1373 while (n_left_from > 0 && n_left_to_next > 0)
1378 u32 pi0, ip_len0, udp_len0, flags0, next0;
1380 u8 error0, type0, good_l4_checksum0;
1382 pi0 = to_next[0] = from[0];
1386 n_left_to_next -= 1;
1408 udp_len0 = clib_net_to_host_u16 (udp0->
length);
1410 len_diff0 = ip_len0 - udp_len0;
1415 && ! good_l4_checksum0
1423 error0 = IP6_ERROR_UNKNOWN_PROTOCOL;
1425 error0 = len_diff0 < 0 ? IP6_ERROR_UDP_LENGTH : error0;
1429 error0 = (! good_l4_checksum0
1430 ? IP6_ERROR_UDP_CHECKSUM + type0
1434 if (error0 == IP6_ERROR_UNKNOWN_PROTOCOL &&
1440 ? IP6_ERROR_SRC_LOOKUP_MISS
1449 to_next, n_left_to_next,
1461 .name =
"ip6-local",
1462 .vector_size =
sizeof (
u32),
1508 u32 * from, * to_next_drop;
1509 uword n_left_from, n_left_to_next_drop;
1510 static f64 time_last_seed_change = -1e100;
1511 static u32 hash_seeds[3];
1520 if (time_now - time_last_seed_change > 1e-3)
1524 sizeof (hash_seeds));
1525 for (i = 0; i <
ARRAY_LEN (hash_seeds); i++)
1526 hash_seeds[i] = r[i];
1529 for (i = 0; i <
ARRAY_LEN (hash_bitmap); i++)
1532 time_last_seed_change = time_now;
1538 while (n_left_from > 0)
1541 to_next_drop, n_left_to_next_drop);
1543 while (n_left_from > 0 && n_left_to_next_drop > 0)
1547 u32 pi0, adj_index0, a0, b0, c0, m0, sw_if_index0, drop0;
1573 sw_if_index0 = adj0->rewrite_header.sw_if_index;
1587 c0 &=
BITS (hash_bitmap) - 1;
1591 bm0 = hash_bitmap[c0];
1592 drop0 = (bm0 & m0) != 0;
1595 hash_bitmap[c0] = bm0 | m0;
1599 to_next_drop[0] = pi0;
1601 n_left_to_next_drop -= 1;
1624 icmp6_neighbor_solicitation_header_t * h0;
1637 &h0->ip.src_address))
1656 clib_memcpy (h0->link_layer_option.ethernet_address,
1660 h0->neighbor.icmp.checksum = 0;
1661 h0->neighbor.icmp.checksum =
1665 ASSERT (bogus_length == 0);
1684 n_left_to_next_drop);
1709 =
"neighbor solicitations sent",
1711 =
"no source address for ND solicitation",
1716 .name =
"ip6-discover-neighbor",
1717 .vector_size =
sizeof (
u32),
1733 .name =
"ip6-glean",
1734 .vector_size =
sizeof (
u32),
1753 icmp6_neighbor_solicitation_header_t * h;
1776 vnm->
api_errno = VNET_API_ERROR_NO_MATCHING_INTERFACE;
1778 (0,
"no matching interface address for destination %U (interface %U)",
1789 h->ip.dst_address.as_u8[13] = dst->
as_u8[13];
1790 h->ip.dst_address.as_u8[14] = dst->
as_u8[14];
1791 h->ip.dst_address.as_u8[15] = dst->
as_u8[15];
1793 h->ip.src_address = src[0];
1794 h->neighbor.target_address = dst[0];
1798 h->neighbor.icmp.checksum =
1800 ASSERT(bogus_length == 0);
1830 int rewrite_for_locally_received_packets,
1835 u32 n_left_from, n_left_to_next, * to_next, next_index;
1844 while (n_left_from > 0)
1848 while (n_left_from >= 4 && n_left_to_next >= 2)
1853 u32 pi0, rw_len0, next0, error0, adj_index0;
1854 u32 pi1, rw_len1, next1, error1, adj_index1;
1855 u32 tx_sw_if_index0, tx_sw_if_index1;
1874 pi0 = to_next[0] = from[0];
1875 pi1 = to_next[1] = from[1];
1880 n_left_to_next -= 2;
1885 adj_index0 =
vnet_buffer (p0)->ip.adj_index[adj_rx_tx];
1886 adj_index1 =
vnet_buffer (p1)->ip.adj_index[adj_rx_tx];
1889 ASSERT(adj_index0 && adj_index1);
1894 error0 = error1 = IP6_ERROR_NONE;
1897 if (! rewrite_for_locally_received_packets)
1917 error0 = IP6_ERROR_TIME_EXPIRED;
1921 ICMP6_time_exceeded_ttl_exceeded_in_transit, 0);
1925 error1 = IP6_ERROR_TIME_EXPIRED;
1929 ICMP6_time_exceeded_ttl_exceeded_in_transit, 0);
1936 rw_len0 = adj0[0].rewrite_header.data_bytes;
1937 rw_len1 = adj1[0].rewrite_header.data_bytes;
1938 vnet_buffer(p0)->ip.save_rewrite_length = rw_len0;
1939 vnet_buffer(p1)->ip.save_rewrite_length = rw_len1;
1954 ? IP6_ERROR_MTU_EXCEEDED
1957 ? IP6_ERROR_MTU_EXCEEDED
1967 tx_sw_if_index0 = adj0[0].rewrite_header.sw_if_index;
1970 next0 = adj0[0].rewrite_header.next_index;
1990 tx_sw_if_index1 = adj1[0].rewrite_header.sw_if_index;
1993 next1 = adj1[0].rewrite_header.next_index;
2021 to_next, n_left_to_next,
2022 pi0, pi1, next0, next1);
2025 while (n_left_from > 0 && n_left_to_next > 0)
2031 u32 adj_index0, next0, error0;
2032 u32 tx_sw_if_index0;
2034 pi0 = to_next[0] = from[0];
2038 adj_index0 =
vnet_buffer (p0)->ip.adj_index[adj_rx_tx];
2047 error0 = IP6_ERROR_NONE;
2051 if (! rewrite_for_locally_received_packets)
2067 error0 = IP6_ERROR_TIME_EXPIRED;
2071 ICMP6_time_exceeded_ttl_exceeded_in_transit, 0);
2079 rw_len0 = adj0[0].rewrite_header.data_bytes;
2080 vnet_buffer(p0)->ip.save_rewrite_length = rw_len0;
2090 ? IP6_ERROR_MTU_EXCEEDED
2100 tx_sw_if_index0 = adj0[0].rewrite_header.sw_if_index;
2103 next0 = adj0[0].rewrite_header.next_index;
2129 n_left_to_next -= 1;
2132 to_next, n_left_to_next,
2178 .name =
"ip6-midchain",
2179 .vector_size =
sizeof (
u32),
2183 .sibling_of =
"ip6-rewrite",
2190 .name =
"ip6-rewrite",
2191 .vector_size =
sizeof (
u32),
2206 .name =
"ip6-rewrite-local",
2207 .vector_size =
sizeof (
u32),
2209 .sibling_of =
"ip6-rewrite",
2224 #define foreach_ip6_hop_by_hop_error \ 2225 _(PROCESSED, "pkts with ip6 hop-by-hop options") \ 2226 _(FORMAT, "incorrectly formatted hop-by-hop options") \ 2227 _(UNKNOWN_OPTION, "unknown ip6 hop-by-hop options") 2230 #define _(sym,str) IP6_HOP_BY_HOP_ERROR_##sym, 2249 #define _(sym,string) string, 2268 s =
format (s,
"IP6_HOP_BY_HOP: next index %d len %d traced %d",
2274 while (opt0 < limit0) {
2282 if (hm->
trace[type0]) {
2283 s = (*hm->
trace[type0])(s, opt0);
2285 s =
format (s,
"\n unrecognized option %d length %d", type0, opt0->
length);
2306 while (opt0 < limit0)
2319 if ((*hm->
options[type0])(b0, ip0, opt0) < 0)
2321 error0 = IP6_HOP_BY_HOP_ERROR_FORMAT;
2333 error0 = IP6_HOP_BY_HOP_ERROR_UNKNOWN_OPTION;
2337 error0 = IP6_HOP_BY_HOP_ERROR_UNKNOWN_OPTION;
2340 ICMP6_parameter_problem_unrecognized_option, (
u8 *)opt0 - (
u8 *)ip0);
2343 error0 = IP6_HOP_BY_HOP_ERROR_UNKNOWN_OPTION;
2348 ICMP6_parameter_problem_unrecognized_option, (
u8 *)opt0 - (
u8 *)ip0);
2374 u32 n_left_from, *from, *to_next;
2383 while (n_left_from > 0) {
2388 while (n_left_from >= 4 && n_left_to_next >= 2) {
2395 u8 error0 = 0, error1 = 0;
2412 to_next[0] = bi0 = from[0];
2413 to_next[1] = bi1 = from[1];
2417 n_left_to_next -= 2;
2445 error0 = IP6_HOP_BY_HOP_ERROR_FORMAT;
2453 error1 = IP6_HOP_BY_HOP_ERROR_FORMAT;
2473 u32 trace_len = (hbh0->
length + 1) << 3;
2482 u32 trace_len = (hbh1->
length + 1) << 3;
2500 while (n_left_from > 0 && n_left_to_next > 0) {
2515 n_left_to_next -= 1;
2535 error0 = IP6_HOP_BY_HOP_ERROR_FORMAT;
2550 u32 trace_len = (hbh0->
length + 1) << 3;
2570 .name =
"ip6-hop-by-hop",
2571 .sibling_of =
"ip6-lookup",
2572 .vector_size =
sizeof (
u32),
2615 hm->
options[option] = options;
2642 for (i = 0; i < 256; i++) {
2671 for (j = 0; j < i0; j++)
2689 "ip6 FIB fwding table",
2693 "ip6 FIB non-fwding table",
2710 icmp6_neighbor_solicitation_header_t p;
2712 memset (&p, 0,
sizeof (p));
2714 p.ip.ip_version_traffic_class_and_flow_label = clib_host_to_net_u32 (0x6 << 28);
2715 p.ip.payload_length = clib_host_to_net_u16 (
sizeof (p)
2717 p.ip.protocol = IP_PROTOCOL_ICMP6;
2718 p.ip.hop_limit = 255;
2721 p.neighbor.icmp.type = ICMP6_neighbor_solicitation;
2723 p.link_layer_option.header.type = ICMP6_NEIGHBOR_DISCOVERY_OPTION_source_link_layer_address;
2724 p.link_layer_option.header.n_data_u64s =
sizeof (p.link_layer_option) /
sizeof (
u64);
2730 "ip6 neighbor discovery");
2747 u32 sw_if_index, table_id;
2758 if (
unformat (input,
"%d", &table_id))
2802 .path =
"set interface ip6 table",
2804 .short_help =
"set interface ip6 table <interface> <table-id>" 2812 ip->
as_u64[0] = clib_host_to_net_u64 (0xFE80000000000000ULL);
2814 ip->
as_u8 [8] = mac[0] ^ (1<<1);
2815 ip->
as_u8 [9] = mac[1];
2816 ip->
as_u8 [10] = mac[2];
2817 ip->
as_u8 [11] = 0xFF;
2818 ip->
as_u8 [12] = 0xFE;
2819 ip->
as_u8 [13] = mac[3];
2820 ip->
as_u8 [14] = mac[4];
2821 ip->
as_u8 [15] = mac[5];
2829 mac[0] = ip->
as_u8 [8] ^ (1<<1);
2830 mac[1] = ip->
as_u8 [9];
2831 mac[2] = ip->
as_u8 [10];
2832 mac[3] = ip->
as_u8 [13];
2833 mac[4] = ip->
as_u8 [14];
2834 mac[5] = ip->
as_u8 [15];
2871 .path =
"test ip6 link",
2873 .short_help =
"test ip6 link <mac-address>",
2899 u32 flow_hash_config = 0;
2903 if (
unformat (input,
"table %d", &table_id))
2906 else if (unformat (input, #a)) { flow_hash_config |= v; matched=1;} 2926 clib_warning (
"BUG: illegal flow hash config 0x%x", flow_hash_config);
3010 .path =
"set ip6 flow-hash",
3012 "set ip6 flow-hash table <table-id> [src] [dst] [sport] [dport] [proto] [reverse]",
3052 .path =
"show ip6 local",
3054 .short_help =
"show ip6 local",
3069 return VNET_API_ERROR_NO_MATCHING_INTERFACE;
3072 return VNET_API_ERROR_NO_SUCH_ENTRY;
3079 if (
NULL != if_addr)
3084 .fp_addr.ip6 = *if_addr,
3092 if (table_index != (
u32) ~0)
3125 u32 table_index = ~0;
3126 int table_index_set = 0;
3127 u32 sw_if_index = ~0;
3131 if (
unformat (input,
"table-index %d", &table_index))
3132 table_index_set = 1;
3140 if (table_index_set == 0)
3143 if (sw_if_index == ~0)
3153 case VNET_API_ERROR_NO_MATCHING_INTERFACE:
3156 case VNET_API_ERROR_NO_SUCH_ENTRY:
3174 .path =
"set ip6 classify",
3176 "set ip6 classify intfc <interface> table-index <classify-idx>",
3190 if (
unformat (input,
"hash-buckets %d", &tmp))
3192 else if (
unformat (input,
"heap-size %dm", &tmp))
3193 heapsize = ((
u64)tmp) << 20;
3194 else if (
unformat (input,
"heap-size %dM", &tmp))
3195 heapsize = ((
u64)tmp) << 20;
3196 else if (
unformat (input,
"heap-size %dg", &tmp))
3197 heapsize = ((
u64)tmp) << 30;
3198 else if (
unformat (input,
"heap-size %dG", &tmp))
3199 heapsize = ((
u64)tmp) << 30;
3222 u32 sw_if_index = ~0;
3237 if (sw_if_index == ~0)
3260 .path =
"set interface ip6 output feature",
3262 .short_help =
"set interface ip6 output feature <interface> [del]",
static vlib_cli_command_t set_ip6_flow_hash_command
(constructor) VLIB_CLI_COMMAND (set_ip6_flow_hash_command)
vnet_config_main_t config_main
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
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)
VNET_IP6_UNICAST_FEATURE_INIT(ip6_flow_classify, static)
#define vnet_rewrite_one_header(rw0, p0, most_likely_size)
u16 lb_n_buckets
number of buckets in the load-balance.
ip_lookup_next_t
Common (IP4/IP6) next index stored in adjacency.
#define HBH_OPTION_TYPE_DISCARD_UNKNOWN_ICMP
uword * tx_sw_if_has_ip_output_features
any-tx-feature-enabled interface bitmap
vlib_combined_counter_main_t lbm_to_counters
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)
static char * feature_start_nodes[]
#define IP6_LOOKUP_NEXT_NODES
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 current_config_index
Used by feature subgraph arcs to visit enabled feature nodes.
static ip6_fib_t * ip6_fib_get(fib_node_index_t index)
static vlib_main_t * vlib_get_main(void)
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)
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 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)
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
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)
vlib_node_registration_t ip6_rewrite_local_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_local_node)
The table that stores ALL routes learned by the DP.
#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)
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)
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.
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)
u8 * ip_enabled_by_sw_if_index
struct ip_adjacency_t_::@164::@165 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
u32 * config_index_by_sw_if_index
#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_feature_init(vlib_main_t *vm, ip6_main_t *im)
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 VNET_HW_INTERFACE_FLAG_LINK_UP
u32 ip6_unicast_rx_feature_flow_classify
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)
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)
uword as_uword[16/sizeof(uword)]
VNET_SW_INTERFACE_ADD_DEL_FUNCTION(ip6_sw_interface_add_del)
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)
flow_hash_config_t flow_hash_config
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)
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)
ip_csum_t ip_incremental_checksum(ip_csum_t sum, void *_data, uword n_bytes)
#define VLIB_INIT_FUNCTION(x)
This packets needs to go to ICMP error.
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 void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
u16 lb_n_buckets_minus_1
number of buckets in the load-balance - 1.
static clib_error_t * set_ip6_flow_hash_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define IP_BUFFER_L4_CHECKSUM_CORRECT
u32 ip6_unicast_rx_feature_check_access
#define IP6_FIB_DEFAULT_HASH_NUM_BUCKETS
Aggregrate type for a prefix.
u32 ip6_multicast_rx_feature_lookup
static u32 ip6_src_lookup_for_packet(ip6_main_t *im, vlib_buffer_t *b, ip6_header_t *i)
return the DPO that the LB stacks on.
u8 pre_data[VLIB_BUFFER_PRE_DATA_SIZE]
Space for inserting data before buffer start.
#define clib_warning(format, args...)
u16 fp_len
The mask length.
static uword ip6_discover_neighbor_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_glean)
adj_index_t fib_entry_get_adj(fib_node_index_t fib_entry_index)
static uword ip6_flow_classify(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#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
static int ip6_src_address_for_packet(ip_lookup_main_t *lm, u32 sw_if_index, ip6_address_t *src)
VNET_IP6_MULTICAST_FEATURE_INIT(ip6_vpath_mc, static)
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...
static vlib_cli_command_t show_ip6_local
(constructor) VLIB_CLI_COMMAND (show_ip6_local)
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u16 current_length
Nbytes between current data and the end of this buffer.
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)
#define ORDER_CONSTRAINTS
clib_error_t * vnet_feature_arc_init(vlib_main_t *vm, vnet_config_main_t *vcm, char **feature_start_nodes, int num_feature_start_nodes, vnet_feature_registration_t *first_reg, char ***feature_nodes)
Initialize a feature graph arc.
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)
#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(const ip6_header_t *ip, flow_hash_config_t flow_hash_config)
static void * vnet_get_config_data(vnet_config_main_t *cm, u32 *config_index, u32 *next_index, u32 n_data_bytes)
static vlib_cli_command_t set_interface_ip6_output_feature
(constructor) VLIB_CLI_COMMAND (set_interface_ip6_output_feature)
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)
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
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.
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,...)
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.
uword * fib_index_by_table_id
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_fib_table_fwding_lookup(ip6_main_t *im, u32 fib_index, const ip6_address_t *dst)
union ip_adjacency_t_::@164 sub_type
#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)
vnet_feature_config_main_t feature_config_mains[VNET_N_IP_FEAT]
rx unicast, multicast, tx interface/feature configuration.
#define CLIB_PREFETCH(addr, size, type)
#define MPLS_LABEL_INVALID
#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.
clib_error_t * ip6_sw_interface_admin_up_down(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
static clib_error_t * set_interface_ip6_output_feature_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vlib_node_registration_t ip6_midchain_node
(constructor) VLIB_REGISTER_NODE (ip6_midchain_node)
static u8 * format_ip6_forward_next_trace(u8 *s, va_list *args)
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 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
u32 fib_node_index_t
A typedef of a node index.
u32 ip6_unicast_rx_feature_drop
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.
static uword clib_bitmap_get(uword *ai, uword i)
Gets the ith bit value from a bitmap.
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
static void * ip6_next_header(ip6_header_t *i)
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)
static uword ip6_rewrite_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int rewrite_for_locally_received_packets, int is_midchain)
#define VLIB_CLI_COMMAND(x,...)
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.
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
void ip6_register_protocol(u32 protocol, u32 node_index)
#define VNET_SW_INTERFACE_FLAG_ADMIN_UP
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)
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
#define LOG2_IP_BUFFER_L4_CHECKSUM_CORRECT
u32 ip6_tx_feature_interface_output
void ip6_hbh_set_next_override(uword next)
static char * tx_feature_start_nodes[]
static load_balance_t * load_balance_get(index_t lbi)
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)
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 ip6_unicast_rx_feature_vpath
vlib_node_registration_t ip6_hop_by_hop_node
(constructor) VLIB_REGISTER_NODE (ip6_hop_by_hop_node)
u32 fib_table_find_or_create_and_lock(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
#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)
static char * ip6_discover_neighbor_error_strings[]
Route added as a result of interface configuration.
#define VLIB_BUFFER_IS_TRACED
ip6_fib_table_instance_t ip6_table[IP6_FIB_NUM_TABLES]
The two FIB tables; fwding and non-fwding.
vlib_node_registration_t ip6_rewrite_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_node)
static uword is_pow2(uword x)
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.
VLIB_NODE_FUNCTION_MULTIARCH(ip6_rewrite_node, ip6_rewrite_transit)
#define IP_BUFFER_L4_CHECKSUM_COMPUTED
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, fib_protocol_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_label, fib_route_path_flags_t path_flags)
Update the entry to have just one path.
static uword ip6_lookup_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
void ip6_sw_interface_enable_disable(u32 sw_if_index, u32 is_enable)
ip6_address_t * ip6_interface_first_address(ip6_main_t *im, u32 sw_if_index, ip_interface_address_t **result_ia)
#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)
char ** feature_nodes[VNET_N_IP_FEAT]
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
ip_lookup_next_t lookup_next_index
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.
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)
vnet_feature_registration_t * next_feature[VNET_N_IP_FEAT]
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)
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)
u32 ip6_multicast_rx_feature_drop
u8 *(* trace[256])(u8 *s, ip6_hop_by_hop_option_t *opt)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
VNET_IP6_TX_FEATURE_INIT(interface_output, static)
#define VLIB_REGISTER_NODE(x,...)
This packet is to be rewritten and forwarded to the next processing node.
#define HBH_OPTION_TYPE_SKIP_UNKNOWN
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
#define vec_foreach(var, vec)
Vector iterator.
u16 dpoi_next_node
The next VLIB node to follow.
#define clib_error_return(e, args...)
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)
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
vlib_node_registration_t ip6_load_balance_node
(constructor) VLIB_REGISTER_NODE (ip6_load_balance_node)
static char * rx_feature_start_nodes[]
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
static u16 ip_csum_fold(ip_csum_t c)
struct ip_adjacency_t_::@164::@166 midchain
IP_LOOKUP_NEXT_MIDCHAIN.
static uword ip6_punt(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
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.