2 * Copyright (c) 2015 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
17 #include <vnet/ip/ip4_to_ip6.h>
18 #include <vnet/ip/ip6_to_ip4.h>
19 #include <vnet/ip/ip_frag.h>
23 IP6_MAPT_NEXT_MAPT_TCP_UDP,
24 IP6_MAPT_NEXT_MAPT_ICMP,
25 IP6_MAPT_NEXT_MAPT_FRAGMENTED,
33 IP6_MAPT_ICMP_NEXT_IP4_LOOKUP,
34 IP6_MAPT_ICMP_NEXT_IP4_REWRITE,
35 IP6_MAPT_ICMP_NEXT_IP4_FRAG,
36 IP6_MAPT_ICMP_NEXT_DROP,
38 } ip6_mapt_icmp_next_t;
42 IP6_MAPT_TCP_UDP_NEXT_IP4_LOOKUP,
43 IP6_MAPT_TCP_UDP_NEXT_IP4_REWRITE,
44 IP6_MAPT_TCP_UDP_NEXT_IP4_FRAG,
45 IP6_MAPT_TCP_UDP_NEXT_DROP,
46 IP6_MAPT_TCP_UDP_N_NEXT
47 } ip6_mapt_tcp_udp_next_t;
51 IP6_MAPT_FRAGMENTED_NEXT_IP4_LOOKUP,
52 IP6_MAPT_FRAGMENTED_NEXT_IP4_REWRITE,
53 IP6_MAPT_FRAGMENTED_NEXT_IP4_FRAG,
54 IP6_MAPT_FRAGMENTED_NEXT_DROP,
55 IP6_MAPT_FRAGMENTED_N_NEXT
56 } ip6_mapt_fragmented_next_t;
62 } icmp6_to_icmp_ctx_t;
65 ip6_to_ip4_set_icmp_cb (ip6_header_t * ip6, ip4_header_t * ip4, void *arg)
67 icmp6_to_icmp_ctx_t *ctx = arg;
71 // Note that this prevents an intermediate IPv6 router from answering
73 ip4_sadr = map_get_ip4 (&ip6->src_address, ctx->d->ip6_src_len);
74 if (ip6->src_address.as_u64[0] !=
75 map_get_pfx_net (ctx->d, ip4_sadr, ctx->sender_port)
76 || ip6->src_address.as_u64[1] != map_get_sfx_net (ctx->d, ip4_sadr,
80 ip4->dst_address.as_u32 =
81 ip6_map_t_embedded_address (ctx->d, &ip6->dst_address);
82 ip4->src_address.as_u32 = ip4_sadr;
88 ip6_to_ip4_set_inner_icmp_cb (ip6_header_t * ip6, ip4_header_t * ip4,
91 icmp6_to_icmp_ctx_t *ctx = arg;
94 //Security check of inner packet
95 inner_ip4_dadr = map_get_ip4 (&ip6->dst_address, ctx->d->ip6_src_len);
96 if (ip6->dst_address.as_u64[0] !=
97 map_get_pfx_net (ctx->d, inner_ip4_dadr, ctx->sender_port)
98 || ip6->dst_address.as_u64[1] != map_get_sfx_net (ctx->d,
103 ip4->dst_address.as_u32 = inner_ip4_dadr;
104 ip4->src_address.as_u32 =
105 ip6_map_t_embedded_address (ctx->d, &ip6->src_address);
111 ip6_map_t_icmp (vlib_main_t * vm,
112 vlib_node_runtime_t * node, vlib_frame_t * frame)
114 u32 n_left_from, *from, next_index, *to_next, n_left_to_next;
115 vlib_node_runtime_t *error_node =
116 vlib_node_get_runtime (vm, ip6_map_t_icmp_node.index);
117 from = vlib_frame_vector_args (frame);
118 n_left_from = frame->n_vectors;
119 next_index = node->cached_next_index;
120 vlib_combined_counter_main_t *cm = map_main.domain_counters;
121 u32 thread_index = vm->thread_index;
123 while (n_left_from > 0)
125 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
127 while (n_left_from > 0 && n_left_to_next > 0)
132 ip6_mapt_icmp_next_t next0;
135 icmp6_to_icmp_ctx_t ctx0;
138 pi0 = to_next[0] = from[0];
143 error0 = MAP_ERROR_NONE;
144 next0 = IP6_MAPT_ICMP_NEXT_IP4_LOOKUP;
146 p0 = vlib_get_buffer (vm, pi0);
147 ip60 = vlib_buffer_get_current (p0);
148 len0 = clib_net_to_host_u16 (ip60->payload_length);
150 pool_elt_at_index (map_main.domains,
151 vnet_buffer (p0)->map_t.map_domain_index);
153 ctx0.sender_port = 0;
155 (vm, p0, ip60, p0->current_length, NULL, &ctx0.sender_port,
156 NULL, NULL, NULL, NULL))
158 // In case of 1:1 mapping, we don't care about the port
159 if (!(d0->ea_bits_len == 0 && d0->rules))
161 error0 = MAP_ERROR_ICMP;
166 if (icmp6_to_icmp (vm, p0, ip6_to_ip4_set_icmp_cb, &ctx0,
167 ip6_to_ip4_set_inner_icmp_cb, &ctx0))
169 error0 = MAP_ERROR_ICMP;
173 if (vnet_buffer (p0)->map_t.mtu < p0->current_length)
175 // Send to fragmentation node if necessary
176 vnet_buffer (p0)->ip_frag.mtu = vnet_buffer (p0)->map_t.mtu;
177 vnet_buffer (p0)->ip_frag.next_index = IP_FRAG_NEXT_IP4_LOOKUP;
178 next0 = IP6_MAPT_ICMP_NEXT_IP4_FRAG;
182 next0 = ip6_map_ip4_lookup_bypass (p0, NULL) ?
183 IP6_MAPT_ICMP_NEXT_IP4_REWRITE : next0;
186 if (PREDICT_TRUE (error0 == MAP_ERROR_NONE))
188 vlib_increment_combined_counter (cm + MAP_DOMAIN_COUNTER_RX,
191 map_t.map_domain_index, 1,
196 next0 = IP6_MAPT_ICMP_NEXT_DROP;
199 p0->error = error_node->errors[error0];
200 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
201 to_next, n_left_to_next, pi0,
204 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
206 return frame->n_vectors;
210 * Translate IPv6 fragmented packet to IPv4.
213 map_ip6_to_ip4_fragmented (vlib_main_t * vm, vlib_buffer_t * p)
216 ip6_frag_hdr_t *frag;
224 ip6 = vlib_buffer_get_current (p);
227 (vm, p, ip6, p->current_length, &l4_protocol, &l4_offset, &frag_offset))
230 frag = (ip6_frag_hdr_t *) u8_ptr_add (ip6, frag_offset);
231 ip4 = (ip4_header_t *) u8_ptr_add (ip6, l4_offset - sizeof (*ip4));
232 vlib_buffer_advance (p, l4_offset - sizeof (*ip4));
234 frag_id = frag_id_6to4 (frag->identification);
235 frag_more = ip6_frag_hdr_more (frag);
236 frag_offset = ip6_frag_hdr_offset (frag);
238 ip4->dst_address.as_u32 = vnet_buffer (p)->map_t.v6.daddr;
239 ip4->src_address.as_u32 = vnet_buffer (p)->map_t.v6.saddr;
241 ip4->ip_version_and_header_length =
242 IP4_VERSION_AND_HEADER_LENGTH_NO_OPTIONS;
243 ip4->tos = ip6_translate_tos (ip6->ip_version_traffic_class_and_flow_label);
245 u16_net_add (ip6->payload_length,
246 sizeof (*ip4) - l4_offset + sizeof (*ip6));
247 ip4->fragment_id = frag_id;
248 ip4->flags_and_fragment_offset =
249 clib_host_to_net_u16 (frag_offset |
250 (frag_more ? IP4_HEADER_FLAG_MORE_FRAGMENTS : 0));
251 ip4->ttl = ip6->hop_limit;
253 (l4_protocol == IP_PROTOCOL_ICMP6) ? IP_PROTOCOL_ICMP : l4_protocol;
254 ip4->checksum = ip4_header_checksum (ip4);
260 ip6_map_t_fragmented (vlib_main_t * vm,
261 vlib_node_runtime_t * node, vlib_frame_t * frame)
263 u32 n_left_from, *from, next_index, *to_next, n_left_to_next;
264 from = vlib_frame_vector_args (frame);
265 n_left_from = frame->n_vectors;
266 next_index = node->cached_next_index;
267 vlib_node_runtime_t *error_node =
268 vlib_node_get_runtime (vm, ip6_map_t_fragmented_node.index);
270 while (n_left_from > 0)
272 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
274 while (n_left_from > 0 && n_left_to_next > 0)
280 pi0 = to_next[0] = from[0];
285 next0 = IP6_MAPT_FRAGMENTED_NEXT_IP4_LOOKUP;
286 p0 = vlib_get_buffer (vm, pi0);
288 if (map_ip6_to_ip4_fragmented (vm, p0))
290 p0->error = error_node->errors[MAP_ERROR_FRAGMENT_DROPPED];
291 next0 = IP6_MAPT_FRAGMENTED_NEXT_DROP;
295 if (vnet_buffer (p0)->map_t.mtu < p0->current_length)
297 // Send to fragmentation node if necessary
298 vnet_buffer (p0)->ip_frag.mtu = vnet_buffer (p0)->map_t.mtu;
299 vnet_buffer (p0)->ip_frag.next_index =
300 IP_FRAG_NEXT_IP4_LOOKUP;
301 next0 = IP6_MAPT_FRAGMENTED_NEXT_IP4_FRAG;
305 next0 = ip6_map_ip4_lookup_bypass (p0, NULL) ?
306 IP6_MAPT_FRAGMENTED_NEXT_IP4_REWRITE : next0;
310 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
311 to_next, n_left_to_next, pi0,
314 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
316 return frame->n_vectors;
320 * Translate IPv6 UDP/TCP packet to IPv4.
321 * Returns 0 on success.
322 * Returns a non-zero error code on error.
325 map_ip6_to_ip4_tcp_udp (vlib_main_t * vm, vlib_buffer_t * p,
328 map_main_t *mm = &map_main;
338 ip6_address_t old_src, old_dst;
340 ip6 = vlib_buffer_get_current (p);
343 (vm, p, ip6, p->current_length, &l4_protocol, &l4_offset, &frag_offset))
346 if (l4_protocol == IP_PROTOCOL_TCP)
348 tcp_header_t *tcp = (tcp_header_t *) u8_ptr_add (ip6, l4_offset);
351 csum = tcp->checksum;
352 map_mss_clamping (tcp, &csum, mm->tcp_mss);
353 tcp->checksum = ip_csum_fold (csum);
355 checksum = &tcp->checksum;
359 udp_header_t *udp = (udp_header_t *) u8_ptr_add (ip6, l4_offset);
360 checksum = &udp->checksum;
363 old_src.as_u64[0] = ip6->src_address.as_u64[0];
364 old_src.as_u64[1] = ip6->src_address.as_u64[1];
365 old_dst.as_u64[0] = ip6->dst_address.as_u64[0];
366 old_dst.as_u64[1] = ip6->dst_address.as_u64[1];
368 ip4 = (ip4_header_t *) u8_ptr_add (ip6, l4_offset - sizeof (*ip4));
370 vlib_buffer_advance (p, l4_offset - sizeof (*ip4));
372 if (PREDICT_FALSE (frag_offset))
374 // Only the first fragment
375 ip6_frag_hdr_t *hdr = (ip6_frag_hdr_t *) u8_ptr_add (ip6, frag_offset);
376 fragment_id = frag_id_6to4 (hdr->identification);
377 flags = clib_host_to_net_u16 (IP4_HEADER_FLAG_MORE_FRAGMENTS);
385 ip4->dst_address.as_u32 = vnet_buffer (p)->map_t.v6.daddr;
386 ip4->src_address.as_u32 = vnet_buffer (p)->map_t.v6.saddr;
389 * Drop spoofed packets that from a known domain source.
391 u32 map_domain_index = -1;
394 ip4_map_get_domain (&ip4->src_address, &map_domain_index, &error);
398 ip4->ip_version_and_header_length =
399 IP4_VERSION_AND_HEADER_LENGTH_NO_OPTIONS;
400 ip4->tos = ip6_translate_tos (ip6->ip_version_traffic_class_and_flow_label);
402 u16_net_add (ip6->payload_length,
403 sizeof (*ip4) + sizeof (*ip6) - l4_offset);
404 ip4->fragment_id = fragment_id;
405 ip4->flags_and_fragment_offset = flags;
406 ip4->ttl = ip6->hop_limit;
407 ip4->protocol = l4_protocol;
408 ip4->checksum = ip4_header_checksum (ip4);
410 // UDP checksum is optional over IPv4
411 if (!udp_checksum && l4_protocol == IP_PROTOCOL_UDP)
417 csum = ip_csum_sub_even (*checksum, old_src.as_u64[0]);
418 csum = ip_csum_sub_even (csum, old_src.as_u64[1]);
419 csum = ip_csum_sub_even (csum, old_dst.as_u64[0]);
420 csum = ip_csum_sub_even (csum, old_dst.as_u64[1]);
421 csum = ip_csum_add_even (csum, ip4->dst_address.as_u32);
422 csum = ip_csum_add_even (csum, ip4->src_address.as_u32);
423 *checksum = ip_csum_fold (csum);
430 ip6_map_t_tcp_udp (vlib_main_t * vm,
431 vlib_node_runtime_t * node, vlib_frame_t * frame)
433 u32 n_left_from, *from, next_index, *to_next, n_left_to_next;
434 vlib_node_runtime_t *error_node =
435 vlib_node_get_runtime (vm, ip6_map_t_tcp_udp_node.index);
437 from = vlib_frame_vector_args (frame);
438 n_left_from = frame->n_vectors;
439 next_index = node->cached_next_index;
440 while (n_left_from > 0)
442 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
444 while (n_left_from > 0 && n_left_to_next > 0)
448 ip6_mapt_tcp_udp_next_t next0;
450 pi0 = to_next[0] = from[0];
455 next0 = IP6_MAPT_TCP_UDP_NEXT_IP4_LOOKUP;
457 p0 = vlib_get_buffer (vm, pi0);
459 if (map_ip6_to_ip4_tcp_udp (vm, p0, true))
461 p0->error = error_node->errors[MAP_ERROR_UNKNOWN];
462 next0 = IP6_MAPT_TCP_UDP_NEXT_DROP;
466 if (vnet_buffer (p0)->map_t.mtu < p0->current_length)
468 // Send to fragmentation node if necessary
469 vnet_buffer (p0)->ip_frag.mtu = vnet_buffer (p0)->map_t.mtu;
470 vnet_buffer (p0)->ip_frag.next_index =
471 IP_FRAG_NEXT_IP4_LOOKUP;
472 next0 = IP6_MAPT_TCP_UDP_NEXT_IP4_FRAG;
476 next0 = ip6_map_ip4_lookup_bypass (p0, NULL) ?
477 IP6_MAPT_TCP_UDP_NEXT_IP4_REWRITE : next0;
481 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
482 to_next, n_left_to_next, pi0,
485 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
487 return frame->n_vectors;
491 ip6_map_t (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
493 u32 n_left_from, *from, next_index, *to_next, n_left_to_next;
494 vlib_node_runtime_t *error_node =
495 vlib_node_get_runtime (vm, ip6_map_t_node.index);
496 map_main_t *mm = &map_main;
497 vlib_combined_counter_main_t *cm = map_main.domain_counters;
498 u32 thread_index = vm->thread_index;
500 from = vlib_frame_vector_args (frame);
501 n_left_from = frame->n_vectors;
502 next_index = node->cached_next_index;
503 while (n_left_from > 0)
505 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
507 while (n_left_from > 0 && n_left_to_next > 0)
516 ip6_frag_hdr_t *frag0;
517 ip6_mapt_next_t next0 = 0;
520 pi0 = to_next[0] = from[0];
525 error0 = MAP_ERROR_NONE;
526 p0 = vlib_get_buffer (vm, pi0);
527 u16 l4_src_port = vnet_buffer (p0)->ip.reass.l4_src_port;
529 ip60 = vlib_buffer_get_current (p0);
532 ip6_map_get_domain (&ip60->dst_address,
533 &vnet_buffer (p0)->map_t.map_domain_index,
536 { /* Guess it wasn't for us */
537 vnet_feature_next (&next0, p0);
541 saddr = map_get_ip4 (&ip60->src_address, d0->ip6_src_len);
542 vnet_buffer (p0)->map_t.v6.saddr = saddr;
543 vnet_buffer (p0)->map_t.v6.daddr =
544 ip6_map_t_embedded_address (d0, &ip60->dst_address);
545 vnet_buffer (p0)->map_t.mtu = d0->mtu ? d0->mtu : ~0;
549 if (PREDICT_FALSE (ip60->hop_limit == 1))
551 icmp6_error_set_vnet_buffer (p0, ICMP6_time_exceeded,
552 ICMP6_time_exceeded_ttl_exceeded_in_transit,
554 p0->error = error_node->errors[MAP_ERROR_TIME_EXCEEDED];
555 next0 = IP6_MAPT_NEXT_ICMP;
560 (ip6_parse (vm, p0, ip60, p0->current_length,
561 &(vnet_buffer (p0)->map_t.v6.l4_protocol),
562 &(vnet_buffer (p0)->map_t.v6.l4_offset),
563 &(vnet_buffer (p0)->map_t.v6.frag_offset))))
566 error0 == MAP_ERROR_NONE ? MAP_ERROR_MALFORMED : error0;
570 (u32) clib_net_to_host_u16 (ip60->payload_length) +
571 sizeof (*ip60) - vnet_buffer (p0)->map_t.v6.l4_offset;
573 (ip6_frag_hdr_t *) u8_ptr_add (ip60,
574 vnet_buffer (p0)->map_t.v6.
578 (vnet_buffer (p0)->map_t.v6.frag_offset
579 && ip6_frag_hdr_offset (frag0)))
581 map_port0 = l4_src_port;
582 next0 = IP6_MAPT_NEXT_MAPT_FRAGMENTED;
586 (vnet_buffer (p0)->map_t.v6.l4_protocol == IP_PROTOCOL_TCP))
590 sizeof (tcp_header_t) ? MAP_ERROR_MALFORMED : error0;
591 vnet_buffer (p0)->map_t.checksum_offset =
592 vnet_buffer (p0)->map_t.v6.l4_offset + 16;
593 next0 = IP6_MAPT_NEXT_MAPT_TCP_UDP;
594 map_port0 = l4_src_port;
598 (vnet_buffer (p0)->map_t.v6.l4_protocol == IP_PROTOCOL_UDP))
602 sizeof (udp_header_t) ? MAP_ERROR_MALFORMED : error0;
603 vnet_buffer (p0)->map_t.checksum_offset =
604 vnet_buffer (p0)->map_t.v6.l4_offset + 6;
605 next0 = IP6_MAPT_NEXT_MAPT_TCP_UDP;
606 map_port0 = l4_src_port;
608 else if (vnet_buffer (p0)->map_t.v6.l4_protocol ==
613 sizeof (icmp46_header_t) ? MAP_ERROR_MALFORMED : error0;
614 next0 = IP6_MAPT_NEXT_MAPT_ICMP;
615 if (((icmp46_header_t *)
617 vnet_buffer (p0)->map_t.v6.l4_offset))->type ==
619 || ((icmp46_header_t *)
621 vnet_buffer (p0)->map_t.v6.l4_offset))->
622 type == ICMP6_echo_request)
623 map_port0 = l4_src_port;
627 // TODO: In case of 1:1 mapping, it might be possible to
628 // do something with those packets.
629 error0 = MAP_ERROR_BAD_PROTOCOL;
632 if (PREDICT_FALSE (map_port0 != -1) &&
633 (ip60->src_address.as_u64[0] !=
634 map_get_pfx_net (d0, vnet_buffer (p0)->map_t.v6.saddr,
636 || ip60->src_address.as_u64[1] != map_get_sfx_net (d0,
642 // Security check when map_port0 is not zero (non-first
643 // fragment, UDP or TCP)
645 error0 == MAP_ERROR_NONE ? MAP_ERROR_SEC_CHECK : error0;
649 (error0 == MAP_ERROR_NONE && next0 != IP6_MAPT_NEXT_MAPT_ICMP))
651 vlib_increment_combined_counter (cm + MAP_DOMAIN_COUNTER_RX,
653 vnet_buffer (p0)->map_t.
655 clib_net_to_host_u16 (ip60->
660 (error0 == MAP_ERROR_SEC_CHECK && mm->icmp6_enabled))
662 icmp6_error_set_vnet_buffer (p0, ICMP6_destination_unreachable,
663 ICMP6_destination_unreachable_source_address_failed_policy,
665 next0 = IP6_MAPT_NEXT_ICMP;
669 next0 = (error0 != MAP_ERROR_NONE) ? IP6_MAPT_NEXT_DROP : next0;
672 p0->error = error_node->errors[error0];
674 if (PREDICT_FALSE (p0->flags & VLIB_BUFFER_IS_TRACED))
676 map_add_trace (vm, node, p0,
677 vnet_buffer (p0)->map_t.map_domain_index,
681 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
682 to_next, n_left_to_next, pi0,
685 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
687 return frame->n_vectors;
691 VLIB_REGISTER_NODE(ip6_map_t_fragmented_node) = {
692 .function = ip6_map_t_fragmented,
693 .name = "ip6-map-t-fragmented",
694 .vector_size = sizeof (u32),
695 .format_trace = format_map_trace,
696 .type = VLIB_NODE_TYPE_INTERNAL,
698 .n_errors = MAP_N_ERROR,
699 .error_counters = map_error_counters,
701 .n_next_nodes = IP6_MAPT_FRAGMENTED_N_NEXT,
704 [IP6_MAPT_FRAGMENTED_NEXT_IP4_LOOKUP] = "ip4-lookup",
705 [IP6_MAPT_FRAGMENTED_NEXT_IP4_REWRITE] = "ip4-load-balance",
706 [IP6_MAPT_FRAGMENTED_NEXT_IP4_FRAG] = IP4_FRAG_NODE_NAME,
707 [IP6_MAPT_FRAGMENTED_NEXT_DROP] = "error-drop",
713 VLIB_REGISTER_NODE(ip6_map_t_icmp_node) = {
714 .function = ip6_map_t_icmp,
715 .name = "ip6-map-t-icmp",
716 .vector_size = sizeof (u32),
717 .format_trace = format_map_trace,
718 .type = VLIB_NODE_TYPE_INTERNAL,
720 .n_errors = MAP_N_ERROR,
721 .error_counters = map_error_counters,
723 .n_next_nodes = IP6_MAPT_ICMP_N_NEXT,
726 [IP6_MAPT_ICMP_NEXT_IP4_LOOKUP] = "ip4-lookup",
727 [IP6_MAPT_ICMP_NEXT_IP4_REWRITE] = "ip4-load-balance",
728 [IP6_MAPT_ICMP_NEXT_IP4_FRAG] = IP4_FRAG_NODE_NAME,
729 [IP6_MAPT_ICMP_NEXT_DROP] = "error-drop",
735 VLIB_REGISTER_NODE(ip6_map_t_tcp_udp_node) = {
736 .function = ip6_map_t_tcp_udp,
737 .name = "ip6-map-t-tcp-udp",
738 .vector_size = sizeof (u32),
739 .format_trace = format_map_trace,
740 .type = VLIB_NODE_TYPE_INTERNAL,
742 .n_errors = MAP_N_ERROR,
743 .error_counters = map_error_counters,
745 .n_next_nodes = IP6_MAPT_TCP_UDP_N_NEXT,
748 [IP6_MAPT_TCP_UDP_NEXT_IP4_LOOKUP] = "ip4-lookup",
749 [IP6_MAPT_TCP_UDP_NEXT_IP4_REWRITE] = "ip4-load-balance",
750 [IP6_MAPT_TCP_UDP_NEXT_IP4_FRAG] = IP4_FRAG_NODE_NAME,
751 [IP6_MAPT_TCP_UDP_NEXT_DROP] = "error-drop",
757 VNET_FEATURE_INIT (ip6_map_t_feature, static) = {
758 .arc_name = "ip6-unicast",
759 .node_name = "ip6-map-t",
760 .runs_before = VNET_FEATURES ("ip6-flow-classify"),
761 .runs_after = VNET_FEATURES ("ip6-sv-reassembly-feature"),
764 VLIB_REGISTER_NODE(ip6_map_t_node) = {
765 .function = ip6_map_t,
767 .vector_size = sizeof(u32),
768 .format_trace = format_map_trace,
769 .type = VLIB_NODE_TYPE_INTERNAL,
771 .n_errors = MAP_N_ERROR,
772 .error_counters = map_error_counters,
774 .n_next_nodes = IP6_MAPT_N_NEXT,
777 [IP6_MAPT_NEXT_MAPT_TCP_UDP] = "ip6-map-t-tcp-udp",
778 [IP6_MAPT_NEXT_MAPT_ICMP] = "ip6-map-t-icmp",
779 [IP6_MAPT_NEXT_MAPT_FRAGMENTED] = "ip6-map-t-fragmented",
780 [IP6_MAPT_NEXT_DROP] = "error-drop",
781 [IP6_MAPT_NEXT_ICMP] = "ip6-icmp-error",
787 * fd.io coding-style-patch-verification: ON
790 * eval: (c-set-style "gnu")