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,
32 IP6_MAPT_ICMP_NEXT_IP4_LOOKUP,
33 IP6_MAPT_ICMP_NEXT_IP4_FRAG,
34 IP6_MAPT_ICMP_NEXT_DROP,
36 } ip6_mapt_icmp_next_t;
40 IP6_MAPT_TCP_UDP_NEXT_IP4_LOOKUP,
41 IP6_MAPT_TCP_UDP_NEXT_IP4_FRAG,
42 IP6_MAPT_TCP_UDP_NEXT_DROP,
43 IP6_MAPT_TCP_UDP_N_NEXT
44 } ip6_mapt_tcp_udp_next_t;
48 IP6_MAPT_FRAGMENTED_NEXT_IP4_LOOKUP,
49 IP6_MAPT_FRAGMENTED_NEXT_IP4_FRAG,
50 IP6_MAPT_FRAGMENTED_NEXT_DROP,
51 IP6_MAPT_FRAGMENTED_N_NEXT
52 } ip6_mapt_fragmented_next_t;
54 static_always_inline int
55 ip6_map_fragment_cache (ip6_header_t * ip6, ip6_frag_hdr_t * frag,
56 map_domain_t * d, u16 port)
59 map_ip4_reass_lock ();
61 map_ip4_reass_get (map_get_ip4 (&ip6->src_address, d->ip6_src_len),
62 ip6_map_t_embedded_address (d, &ip6->dst_address),
63 frag_id_6to4 (frag->identification),
65 IP_PROTOCOL_ICMP6) ? IP_PROTOCOL_ICMP : ip6->protocol,
70 map_ip4_reass_unlock ();
74 /* Returns the associated port or -1 */
75 static_always_inline i32
76 ip6_map_fragment_get (ip6_header_t * ip6, ip6_frag_hdr_t * frag,
80 map_ip4_reass_lock ();
82 map_ip4_reass_get (map_get_ip4 (&ip6->src_address, d->ip6_src_len),
83 ip6_map_t_embedded_address (d, &ip6->dst_address),
84 frag_id_6to4 (frag->identification),
86 IP_PROTOCOL_ICMP6) ? IP_PROTOCOL_ICMP : ip6->protocol,
88 i32 ret = r ? r->port : -1;
89 map_ip4_reass_unlock ();
97 } icmp6_to_icmp_ctx_t;
100 ip6_to_ip4_set_icmp_cb (ip6_header_t * ip6, ip4_header_t * ip4, void *arg)
102 icmp6_to_icmp_ctx_t *ctx = arg;
106 // Note that this prevents an intermediate IPv6 router from answering
108 ip4_sadr = map_get_ip4 (&ip6->src_address, ctx->d->flags);
109 if (ip6->src_address.as_u64[0] !=
110 map_get_pfx_net (ctx->d, ip4_sadr, ctx->sender_port)
111 || ip6->src_address.as_u64[1] != map_get_sfx_net (ctx->d, ip4_sadr,
115 ip4->dst_address.as_u32 =
116 ip6_map_t_embedded_address (ctx->d, &ip6->dst_address);
117 ip4->src_address.as_u32 = ip4_sadr;
123 ip6_to_ip4_set_inner_icmp_cb (ip6_header_t * ip6, ip4_header_t * ip4,
126 icmp6_to_icmp_ctx_t *ctx = arg;
129 //Security check of inner packet
130 inner_ip4_dadr = map_get_ip4 (&ip6->dst_address, ctx->d->flags);
131 if (ip6->dst_address.as_u64[0] !=
132 map_get_pfx_net (ctx->d, inner_ip4_dadr, ctx->sender_port)
133 || ip6->dst_address.as_u64[1] != map_get_sfx_net (ctx->d,
138 ip4->dst_address.as_u32 = inner_ip4_dadr;
139 ip4->src_address.as_u32 =
140 ip6_map_t_embedded_address (ctx->d, &ip6->src_address);
146 ip6_map_t_icmp (vlib_main_t * vm,
147 vlib_node_runtime_t * node, vlib_frame_t * frame)
149 u32 n_left_from, *from, next_index, *to_next, n_left_to_next;
150 vlib_node_runtime_t *error_node =
151 vlib_node_get_runtime (vm, ip6_map_t_icmp_node.index);
152 from = vlib_frame_vector_args (frame);
153 n_left_from = frame->n_vectors;
154 next_index = node->cached_next_index;
155 vlib_combined_counter_main_t *cm = map_main.domain_counters;
156 u32 thread_index = vm->thread_index;
158 while (n_left_from > 0)
160 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
162 while (n_left_from > 0 && n_left_to_next > 0)
167 ip6_mapt_icmp_next_t next0;
170 icmp6_to_icmp_ctx_t ctx0;
173 pi0 = to_next[0] = from[0];
178 error0 = MAP_ERROR_NONE;
179 next0 = IP6_MAPT_ICMP_NEXT_IP4_LOOKUP;
181 p0 = vlib_get_buffer (vm, pi0);
182 ip60 = vlib_buffer_get_current (p0);
183 len0 = clib_net_to_host_u16 (ip60->payload_length);
185 pool_elt_at_index (map_main.domains,
186 vnet_buffer (p0)->map_t.map_domain_index);
187 ctx0.sender_port = ip6_get_port (ip60, 0, p0->current_length);
189 if (ctx0.sender_port == 0)
191 // In case of 1:1 mapping, we don't care about the port
192 if (!(d0->ea_bits_len == 0 && d0->rules))
194 error0 = MAP_ERROR_ICMP;
200 (p0, ip6_to_ip4_set_icmp_cb, &ctx0,
201 ip6_to_ip4_set_inner_icmp_cb, &ctx0))
203 error0 = MAP_ERROR_ICMP;
207 if (vnet_buffer (p0)->map_t.mtu < p0->current_length)
209 // Send to fragmentation node if necessary
210 vnet_buffer (p0)->ip_frag.mtu = vnet_buffer (p0)->map_t.mtu;
211 vnet_buffer (p0)->ip_frag.next_index = IP4_FRAG_NEXT_IP4_LOOKUP;
212 next0 = IP6_MAPT_ICMP_NEXT_IP4_FRAG;
215 if (PREDICT_TRUE (error0 == MAP_ERROR_NONE))
217 vlib_increment_combined_counter (cm + MAP_DOMAIN_COUNTER_RX,
220 map_t.map_domain_index, 1,
225 next0 = IP6_MAPT_ICMP_NEXT_DROP;
228 p0->error = error_node->errors[error0];
229 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
230 to_next, n_left_to_next, pi0,
233 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
235 return frame->n_vectors;
239 * Translate IPv6 fragmented packet to IPv4.
242 map_ip6_to_ip4_fragmented (vlib_buffer_t * p)
245 ip6_frag_hdr_t *frag;
253 ip6 = vlib_buffer_get_current (p);
256 (ip6, p->current_length, &l4_protocol, &l4_offset, &frag_offset))
259 frag = (ip6_frag_hdr_t *) u8_ptr_add (ip6, frag_offset);
260 ip4 = (ip4_header_t *) u8_ptr_add (ip6, l4_offset - sizeof (*ip4));
261 vlib_buffer_advance (p, l4_offset - sizeof (*ip4));
263 frag_id = frag_id_6to4 (frag->identification);
264 frag_more = ip6_frag_hdr_more (frag);
265 frag_offset = ip6_frag_hdr_offset (frag);
267 ip4->dst_address.as_u32 = vnet_buffer (p)->map_t.v6.daddr;
268 ip4->src_address.as_u32 = vnet_buffer (p)->map_t.v6.saddr;
270 ip4->ip_version_and_header_length =
271 IP4_VERSION_AND_HEADER_LENGTH_NO_OPTIONS;
272 ip4->tos = ip6_translate_tos (ip6);
274 u16_net_add (ip6->payload_length,
275 sizeof (*ip4) - l4_offset + sizeof (*ip6));
276 ip4->fragment_id = frag_id;
277 ip4->flags_and_fragment_offset =
278 clib_host_to_net_u16 (frag_offset |
279 (frag_more ? IP4_HEADER_FLAG_MORE_FRAGMENTS : 0));
280 ip4->ttl = ip6->hop_limit;
282 (l4_protocol == IP_PROTOCOL_ICMP6) ? IP_PROTOCOL_ICMP : l4_protocol;
283 ip4->checksum = ip4_header_checksum (ip4);
289 ip6_map_t_fragmented (vlib_main_t * vm,
290 vlib_node_runtime_t * node, vlib_frame_t * frame)
292 u32 n_left_from, *from, next_index, *to_next, n_left_to_next;
293 from = vlib_frame_vector_args (frame);
294 n_left_from = frame->n_vectors;
295 next_index = node->cached_next_index;
296 vlib_node_runtime_t *error_node =
297 vlib_node_get_runtime (vm, ip6_map_t_fragmented_node.index);
299 while (n_left_from > 0)
301 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
303 while (n_left_from > 0 && n_left_to_next > 0)
309 pi0 = to_next[0] = from[0];
315 next0 = IP6_MAPT_TCP_UDP_NEXT_IP4_LOOKUP;
316 p0 = vlib_get_buffer (vm, pi0);
318 if (map_ip6_to_ip4_fragmented (p0))
320 p0->error = error_node->errors[MAP_ERROR_FRAGMENT_DROPPED];
321 next0 = IP6_MAPT_FRAGMENTED_NEXT_DROP;
325 if (vnet_buffer (p0)->map_t.mtu < p0->current_length)
327 // Send to fragmentation node if necessary
328 vnet_buffer (p0)->ip_frag.mtu = vnet_buffer (p0)->map_t.mtu;
329 vnet_buffer (p0)->ip_frag.next_index =
330 IP4_FRAG_NEXT_IP4_LOOKUP;
331 next0 = IP6_MAPT_FRAGMENTED_NEXT_IP4_FRAG;
335 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
336 to_next, n_left_to_next, pi0,
339 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
341 return frame->n_vectors;
345 * Translate IPv6 UDP/TCP packet to IPv4.
348 map_ip6_to_ip4_tcp_udp (vlib_buffer_t * p, bool udp_checksum)
350 map_main_t *mm = &map_main;
360 ip6_address_t old_src, old_dst;
362 ip6 = vlib_buffer_get_current (p);
365 (ip6, p->current_length, &l4_protocol, &l4_offset, &frag_offset))
368 if (l4_protocol == IP_PROTOCOL_TCP)
370 tcp_header_t *tcp = ip6_next_header (ip6);
373 csum = tcp->checksum;
374 map_mss_clamping (tcp, &csum, mm->tcp_mss);
375 tcp->checksum = ip_csum_fold (csum);
377 checksum = &tcp->checksum;
381 udp_header_t *udp = ip6_next_header (ip6);
382 checksum = &udp->checksum;
385 old_src.as_u64[0] = ip6->src_address.as_u64[0];
386 old_src.as_u64[1] = ip6->src_address.as_u64[1];
387 old_dst.as_u64[0] = ip6->dst_address.as_u64[0];
388 old_dst.as_u64[1] = ip6->dst_address.as_u64[1];
390 ip4 = (ip4_header_t *) u8_ptr_add (ip6, l4_offset - sizeof (*ip4));
392 vlib_buffer_advance (p, l4_offset - sizeof (*ip4));
394 if (PREDICT_FALSE (frag_offset))
396 // Only the first fragment
397 ip6_frag_hdr_t *hdr = (ip6_frag_hdr_t *) u8_ptr_add (ip6, frag_offset);
398 fragment_id = frag_id_6to4 (hdr->identification);
399 flags = clib_host_to_net_u16 (IP4_HEADER_FLAG_MORE_FRAGMENTS);
407 ip4->dst_address.as_u32 = vnet_buffer (p)->map_t.v6.daddr;
408 ip4->src_address.as_u32 = vnet_buffer (p)->map_t.v6.saddr;
410 ip4->ip_version_and_header_length =
411 IP4_VERSION_AND_HEADER_LENGTH_NO_OPTIONS;
412 ip4->tos = ip6_translate_tos (ip6);
414 u16_net_add (ip6->payload_length,
415 sizeof (*ip4) + sizeof (*ip6) - l4_offset);
416 ip4->fragment_id = fragment_id;
417 ip4->flags_and_fragment_offset = flags;
418 ip4->ttl = ip6->hop_limit;
419 ip4->protocol = l4_protocol;
420 ip4->checksum = ip4_header_checksum (ip4);
422 // UDP checksum is optional over IPv4
423 if (!udp_checksum && l4_protocol == IP_PROTOCOL_UDP)
429 csum = ip_csum_sub_even (*checksum, old_src.as_u64[0]);
430 csum = ip_csum_sub_even (csum, old_src.as_u64[1]);
431 csum = ip_csum_sub_even (csum, old_dst.as_u64[0]);
432 csum = ip_csum_sub_even (csum, old_dst.as_u64[1]);
433 csum = ip_csum_add_even (csum, ip4->dst_address.as_u32);
434 csum = ip_csum_add_even (csum, ip4->src_address.as_u32);
435 *checksum = ip_csum_fold (csum);
442 ip6_map_t_tcp_udp (vlib_main_t * vm,
443 vlib_node_runtime_t * node, vlib_frame_t * frame)
445 u32 n_left_from, *from, next_index, *to_next, n_left_to_next;
446 vlib_node_runtime_t *error_node =
447 vlib_node_get_runtime (vm, ip6_map_t_tcp_udp_node.index);
449 from = vlib_frame_vector_args (frame);
450 n_left_from = frame->n_vectors;
451 next_index = node->cached_next_index;
452 while (n_left_from > 0)
454 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
456 while (n_left_from > 0 && n_left_to_next > 0)
460 ip6_mapt_tcp_udp_next_t next0;
462 pi0 = to_next[0] = from[0];
467 next0 = IP6_MAPT_TCP_UDP_NEXT_IP4_LOOKUP;
469 p0 = vlib_get_buffer (vm, pi0);
471 if (map_ip6_to_ip4_tcp_udp (p0, true))
473 p0->error = error_node->errors[MAP_ERROR_UNKNOWN];
474 next0 = IP6_MAPT_TCP_UDP_NEXT_DROP;
478 if (vnet_buffer (p0)->map_t.mtu < p0->current_length)
480 // Send to fragmentation node if necessary
481 vnet_buffer (p0)->ip_frag.mtu = vnet_buffer (p0)->map_t.mtu;
482 vnet_buffer (p0)->ip_frag.next_index =
483 IP4_FRAG_NEXT_IP4_LOOKUP;
484 next0 = IP6_MAPT_TCP_UDP_NEXT_IP4_FRAG;
488 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
489 to_next, n_left_to_next, pi0,
492 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
494 return frame->n_vectors;
498 ip6_map_t (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
500 u32 n_left_from, *from, next_index, *to_next, n_left_to_next;
501 vlib_node_runtime_t *error_node =
502 vlib_node_get_runtime (vm, ip6_map_t_node.index);
503 vlib_combined_counter_main_t *cm = map_main.domain_counters;
504 u32 thread_index = vm->thread_index;
506 from = vlib_frame_vector_args (frame);
507 n_left_from = frame->n_vectors;
508 next_index = node->cached_next_index;
509 while (n_left_from > 0)
511 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
513 while (n_left_from > 0 && n_left_to_next > 0)
522 ip6_frag_hdr_t *frag0;
523 ip6_mapt_next_t next0 = 0;
526 pi0 = to_next[0] = from[0];
531 error0 = MAP_ERROR_NONE;
533 p0 = vlib_get_buffer (vm, pi0);
534 ip60 = vlib_buffer_get_current (p0);
537 ip6_map_get_domain (&ip60->dst_address,
538 &vnet_buffer (p0)->map_t.map_domain_index,
541 { /* Guess it wasn't for us */
542 vnet_feature_next (&next0, p0);
546 saddr = map_get_ip4 (&ip60->src_address, d0->ip6_src_len);
547 vnet_buffer (p0)->map_t.v6.saddr = saddr;
548 vnet_buffer (p0)->map_t.v6.daddr =
549 ip6_map_t_embedded_address (d0, &ip60->dst_address);
550 vnet_buffer (p0)->map_t.mtu = d0->mtu ? d0->mtu : ~0;
553 (ip6_parse (ip60, p0->current_length,
554 &(vnet_buffer (p0)->map_t.v6.l4_protocol),
555 &(vnet_buffer (p0)->map_t.v6.l4_offset),
556 &(vnet_buffer (p0)->map_t.v6.frag_offset))))
559 error0 == MAP_ERROR_NONE ? MAP_ERROR_MALFORMED : error0;
564 (u32) clib_net_to_host_u16 (ip60->payload_length) +
565 sizeof (*ip60) - vnet_buffer (p0)->map_t.v6.l4_offset;
567 (ip6_frag_hdr_t *) u8_ptr_add (ip60,
568 vnet_buffer (p0)->map_t.v6.
572 (vnet_buffer (p0)->map_t.v6.frag_offset
573 && ip6_frag_hdr_offset (frag0)))
575 map_port0 = ip6_map_fragment_get (ip60, frag0, d0);
579 MAP_ERROR_NONE ? MAP_ERROR_FRAGMENT_MEMORY : error0;
581 next0 = IP6_MAPT_NEXT_MAPT_FRAGMENTED;
585 (vnet_buffer (p0)->map_t.v6.l4_protocol == IP_PROTOCOL_TCP))
589 sizeof (tcp_header_t) ? MAP_ERROR_MALFORMED : error0;
590 vnet_buffer (p0)->map_t.checksum_offset =
591 vnet_buffer (p0)->map_t.v6.l4_offset + 16;
592 next0 = IP6_MAPT_NEXT_MAPT_TCP_UDP;
596 u8_ptr_add (ip60, vnet_buffer (p0)->map_t.v6.l4_offset));
600 (vnet_buffer (p0)->map_t.v6.l4_protocol == IP_PROTOCOL_UDP))
604 sizeof (udp_header_t) ? MAP_ERROR_MALFORMED : error0;
605 vnet_buffer (p0)->map_t.checksum_offset =
606 vnet_buffer (p0)->map_t.v6.l4_offset + 6;
607 next0 = IP6_MAPT_NEXT_MAPT_TCP_UDP;
611 u8_ptr_add (ip60, vnet_buffer (p0)->map_t.v6.l4_offset));
613 else if (vnet_buffer (p0)->map_t.v6.l4_protocol ==
618 sizeof (icmp46_header_t) ? MAP_ERROR_MALFORMED : error0;
619 next0 = IP6_MAPT_NEXT_MAPT_ICMP;
620 if (((icmp46_header_t *)
622 vnet_buffer (p0)->map_t.v6.l4_offset))->code ==
624 || ((icmp46_header_t *)
626 vnet_buffer (p0)->map_t.v6.l4_offset))->
627 code == ICMP6_echo_request)
632 vnet_buffer (p0)->map_t.v6.l4_offset + 6));
636 // TODO: In case of 1:1 mapping, it might be possible to
637 // do something with those packets.
638 error0 = MAP_ERROR_BAD_PROTOCOL;
641 if (PREDICT_FALSE (map_port0 != -1) &&
642 (ip60->src_address.as_u64[0] !=
643 map_get_pfx_net (d0, vnet_buffer (p0)->map_t.v6.saddr,
645 || ip60->src_address.as_u64[1] != map_get_sfx_net (d0,
651 // Security check when map_port0 is not zero (non-first
652 // fragment, UDP or TCP)
654 error0 == MAP_ERROR_NONE ? MAP_ERROR_SEC_CHECK : error0;
657 // Fragmented first packet needs to be cached for following packets
659 (vnet_buffer (p0)->map_t.v6.frag_offset
660 && !ip6_frag_hdr_offset ((ip6_frag_hdr_t *)
662 vnet_buffer (p0)->map_t.
664 && (map_port0 != -1) && (d0->ea_bits_len != 0 || !d0->rules)
665 && (error0 == MAP_ERROR_NONE))
667 ip6_map_fragment_cache (ip60,
668 (ip6_frag_hdr_t *) u8_ptr_add (ip60,
677 (error0 == MAP_ERROR_NONE && next0 != IP6_MAPT_NEXT_MAPT_ICMP))
679 vlib_increment_combined_counter (cm + MAP_DOMAIN_COUNTER_RX,
681 vnet_buffer (p0)->map_t.
683 clib_net_to_host_u16 (ip60->
687 next0 = (error0 != MAP_ERROR_NONE) ? IP6_MAPT_NEXT_DROP : next0;
688 p0->error = error_node->errors[error0];
690 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
691 to_next, n_left_to_next, pi0,
694 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
696 return frame->n_vectors;
699 static char *map_t_error_strings[] = {
700 #define _(sym, string) string,
706 VLIB_REGISTER_NODE(ip6_map_t_fragmented_node) = {
707 .function = ip6_map_t_fragmented,
708 .name = "ip6-map-t-fragmented",
709 .vector_size = sizeof (u32),
710 .format_trace = format_map_trace,
711 .type = VLIB_NODE_TYPE_INTERNAL,
713 .n_errors = MAP_N_ERROR,
714 .error_strings = map_t_error_strings,
716 .n_next_nodes = IP6_MAPT_FRAGMENTED_N_NEXT,
719 [IP6_MAPT_FRAGMENTED_NEXT_IP4_LOOKUP] = "ip4-lookup",
720 [IP6_MAPT_FRAGMENTED_NEXT_IP4_FRAG] = IP4_FRAG_NODE_NAME,
721 [IP6_MAPT_FRAGMENTED_NEXT_DROP] = "error-drop",
727 VLIB_REGISTER_NODE(ip6_map_t_icmp_node) = {
728 .function = ip6_map_t_icmp,
729 .name = "ip6-map-t-icmp",
730 .vector_size = sizeof (u32),
731 .format_trace = format_map_trace,
732 .type = VLIB_NODE_TYPE_INTERNAL,
734 .n_errors = MAP_N_ERROR,
735 .error_strings = map_t_error_strings,
737 .n_next_nodes = IP6_MAPT_ICMP_N_NEXT,
740 [IP6_MAPT_ICMP_NEXT_IP4_LOOKUP] = "ip4-lookup",
741 [IP6_MAPT_ICMP_NEXT_IP4_FRAG] = IP4_FRAG_NODE_NAME,
742 [IP6_MAPT_ICMP_NEXT_DROP] = "error-drop",
748 VLIB_REGISTER_NODE(ip6_map_t_tcp_udp_node) = {
749 .function = ip6_map_t_tcp_udp,
750 .name = "ip6-map-t-tcp-udp",
751 .vector_size = sizeof (u32),
752 .format_trace = format_map_trace,
753 .type = VLIB_NODE_TYPE_INTERNAL,
755 .n_errors = MAP_N_ERROR,
756 .error_strings = map_t_error_strings,
758 .n_next_nodes = IP6_MAPT_TCP_UDP_N_NEXT,
761 [IP6_MAPT_TCP_UDP_NEXT_IP4_LOOKUP] = "ip4-lookup",
762 [IP6_MAPT_TCP_UDP_NEXT_IP4_FRAG] = IP4_FRAG_NODE_NAME,
763 [IP6_MAPT_TCP_UDP_NEXT_DROP] = "error-drop",
769 VNET_FEATURE_INIT(ip4_map_t_feature, static) = {
770 .arc_name = "ip6-unicast",
771 .node_name = "ip6-map-t",
772 .runs_before = VNET_FEATURES("ip6-flow-classify"),
775 VLIB_REGISTER_NODE(ip6_map_t_node) = {
776 .function = ip6_map_t,
778 .vector_size = sizeof(u32),
779 .format_trace = format_map_trace,
780 .type = VLIB_NODE_TYPE_INTERNAL,
782 .n_errors = MAP_N_ERROR,
783 .error_strings = map_t_error_strings,
785 .n_next_nodes = IP6_MAPT_N_NEXT,
788 [IP6_MAPT_NEXT_MAPT_TCP_UDP] = "ip6-map-t-tcp-udp",
789 [IP6_MAPT_NEXT_MAPT_ICMP] = "ip6-map-t-icmp",
790 [IP6_MAPT_NEXT_MAPT_FRAGMENTED] = "ip6-map-t-fragmented",
791 [IP6_MAPT_NEXT_DROP] = "error-drop",
797 * fd.io coding-style-patch-verification: ON
800 * eval: (c-set-style "gnu")