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/ip_frag.h>
18 #include <vnet/ip/ip4_to_ip6.h>
22 IP4_MAPT_NEXT_MAPT_TCP_UDP,
23 IP4_MAPT_NEXT_MAPT_ICMP,
24 IP4_MAPT_NEXT_MAPT_FRAGMENTED,
31 IP4_MAPT_ICMP_NEXT_IP6_LOOKUP,
32 IP4_MAPT_ICMP_NEXT_IP6_FRAG,
33 IP4_MAPT_ICMP_NEXT_DROP,
35 } ip4_mapt_icmp_next_t;
39 IP4_MAPT_TCP_UDP_NEXT_IP6_LOOKUP,
40 IP4_MAPT_TCP_UDP_NEXT_IP6_FRAG,
41 IP4_MAPT_TCP_UDP_NEXT_DROP,
42 IP4_MAPT_TCP_UDP_N_NEXT
43 } ip4_mapt_tcp_udp_next_t;
47 IP4_MAPT_FRAGMENTED_NEXT_IP6_LOOKUP,
48 IP4_MAPT_FRAGMENTED_NEXT_IP6_FRAG,
49 IP4_MAPT_FRAGMENTED_NEXT_DROP,
50 IP4_MAPT_FRAGMENTED_N_NEXT
51 } ip4_mapt_fragmented_next_t;
53 //This is used to pass information within the buffer data.
54 //Buffer structure being too small to contain big structures like this.
56 typedef CLIB_PACKED (struct {
59 //IPv6 header + Fragmentation header will be here
60 //sizeof(ip6) + sizeof(ip_frag) - sizeof(ip4)
62 }) ip4_mapt_pseudo_header_t;
69 } icmp_to_icmp6_ctx_t;
72 ip4_to_ip6_set_icmp_cb (vlib_buffer_t * b, ip4_header_t * ip4,
73 ip6_header_t * ip6, void *arg)
75 icmp_to_icmp6_ctx_t *ctx = arg;
77 ip4_map_t_embedded_address (ctx->d, &ip6->src_address, &ip4->src_address);
78 ip6->dst_address.as_u64[0] =
79 map_get_pfx_net (ctx->d, ip4->dst_address.as_u32, ctx->recv_port);
80 ip6->dst_address.as_u64[1] =
81 map_get_sfx_net (ctx->d, ip4->dst_address.as_u32, ctx->recv_port);
87 ip4_to_ip6_set_inner_icmp_cb (vlib_buffer_t * b, ip4_header_t * ip4,
88 ip6_header_t * ip6, void *arg)
90 icmp_to_icmp6_ctx_t *ctx = arg;
92 //Note that the source address is within the domain
93 //while the destination address is the one outside the domain
94 ip4_map_t_embedded_address (ctx->d, &ip6->dst_address, &ip4->dst_address);
95 ip6->src_address.as_u64[0] =
96 map_get_pfx_net (ctx->d, ip4->src_address.as_u32, ctx->recv_port);
97 ip6->src_address.as_u64[1] =
98 map_get_sfx_net (ctx->d, ip4->src_address.as_u32, ctx->recv_port);
104 ip4_map_t_icmp (vlib_main_t * vm,
105 vlib_node_runtime_t * node, vlib_frame_t * frame)
107 u32 n_left_from, *from, next_index, *to_next, n_left_to_next;
108 vlib_node_runtime_t *error_node =
109 vlib_node_get_runtime (vm, ip4_map_t_icmp_node.index);
110 from = vlib_frame_vector_args (frame);
111 n_left_from = frame->n_vectors;
112 next_index = node->cached_next_index;
113 vlib_combined_counter_main_t *cm = map_main.domain_counters;
114 u32 thread_index = vm->thread_index;
116 while (n_left_from > 0)
118 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
120 while (n_left_from > 0 && n_left_to_next > 0)
124 ip4_mapt_icmp_next_t next0;
128 icmp_to_icmp6_ctx_t ctx0;
131 next0 = IP4_MAPT_ICMP_NEXT_IP6_LOOKUP;
132 pi0 = to_next[0] = from[0];
137 error0 = MAP_ERROR_NONE;
139 p0 = vlib_get_buffer (vm, pi0);
140 vlib_buffer_advance (p0, sizeof (ip4_mapt_pseudo_header_t)); //The pseudo-header is not used
142 clib_net_to_host_u16 (((ip4_header_t *)
143 vlib_buffer_get_current (p0))->length);
145 pool_elt_at_index (map_main.domains,
146 vnet_buffer (p0)->map_t.map_domain_index);
148 ip40 = vlib_buffer_get_current (p0);
149 ctx0.recv_port = ip4_get_port (ip40, 1);
151 if (ctx0.recv_port == 0)
153 // In case of 1:1 mapping, we don't care about the port
154 if (!(d0->ea_bits_len == 0 && d0->rules))
156 error0 = MAP_ERROR_ICMP;
162 (p0, ip4_to_ip6_set_icmp_cb, &ctx0,
163 ip4_to_ip6_set_inner_icmp_cb, &ctx0))
165 error0 = MAP_ERROR_ICMP;
169 if (vnet_buffer (p0)->map_t.mtu < p0->current_length)
171 vnet_buffer (p0)->ip_frag.mtu = vnet_buffer (p0)->map_t.mtu;
172 vnet_buffer (p0)->ip_frag.next_index = IP_FRAG_NEXT_IP6_LOOKUP;
173 next0 = IP4_MAPT_ICMP_NEXT_IP6_FRAG;
176 if (PREDICT_TRUE (error0 == MAP_ERROR_NONE))
178 vlib_increment_combined_counter (cm + MAP_DOMAIN_COUNTER_TX,
181 map_t.map_domain_index, 1,
186 next0 = IP4_MAPT_ICMP_NEXT_DROP;
188 p0->error = error_node->errors[error0];
189 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
190 to_next, n_left_to_next, pi0,
193 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
195 return frame->n_vectors;
199 * Translate fragmented IPv4 UDP/TCP packet to IPv6.
202 map_ip4_to_ip6_fragmented (vlib_buffer_t * p,
203 ip4_mapt_pseudo_header_t * pheader)
207 ip6_frag_hdr_t *frag;
209 ip4 = vlib_buffer_get_current (p);
210 frag = (ip6_frag_hdr_t *) u8_ptr_add (ip4, sizeof (*ip4) - sizeof (*frag));
212 (ip6_header_t *) u8_ptr_add (ip4,
213 sizeof (*ip4) - sizeof (*frag) -
215 vlib_buffer_advance (p, sizeof (*ip4) - sizeof (*ip6) - sizeof (*frag));
217 //We know that the protocol was one of ICMP, TCP or UDP
218 //because the first fragment was found and cached
220 (ip4->protocol == IP_PROTOCOL_ICMP) ? IP_PROTOCOL_ICMP6 : ip4->protocol;
221 frag->identification = frag_id_4to6 (ip4->fragment_id);
223 frag->fragment_offset_and_more =
224 ip6_frag_hdr_offset_and_more (ip4_get_fragment_offset (ip4),
226 (ip4->flags_and_fragment_offset) &
227 IP4_HEADER_FLAG_MORE_FRAGMENTS);
229 ip6->ip_version_traffic_class_and_flow_label =
230 clib_host_to_net_u32 ((6 << 28) + (ip4->tos << 20));
231 ip6->payload_length =
232 clib_host_to_net_u16 (clib_net_to_host_u16 (ip4->length) -
233 sizeof (*ip4) + sizeof (*frag));
234 ip6->hop_limit = ip4->ttl;
235 ip6->protocol = IP_PROTOCOL_IPV6_FRAGMENTATION;
237 ip6->dst_address.as_u64[0] = pheader->daddr.as_u64[0];
238 ip6->dst_address.as_u64[1] = pheader->daddr.as_u64[1];
239 ip6->src_address.as_u64[0] = pheader->saddr.as_u64[0];
240 ip6->src_address.as_u64[1] = pheader->saddr.as_u64[1];
246 ip4_map_t_fragmented (vlib_main_t * vm,
247 vlib_node_runtime_t * node, vlib_frame_t * frame)
249 u32 n_left_from, *from, next_index, *to_next, n_left_to_next;
250 from = vlib_frame_vector_args (frame);
251 n_left_from = frame->n_vectors;
252 next_index = node->cached_next_index;
253 vlib_node_runtime_t *error_node =
254 vlib_node_get_runtime (vm, ip4_map_t_fragmented_node.index);
256 while (n_left_from > 0)
258 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
260 while (n_left_from > 0 && n_left_to_next > 0)
264 ip4_mapt_pseudo_header_t *pheader0;
265 ip4_mapt_fragmented_next_t next0;
267 next0 = IP4_MAPT_FRAGMENTED_NEXT_IP6_LOOKUP;
268 pi0 = to_next[0] = from[0];
274 p0 = vlib_get_buffer (vm, pi0);
276 //Accessing pseudo header
277 pheader0 = vlib_buffer_get_current (p0);
278 vlib_buffer_advance (p0, sizeof (*pheader0));
280 if (map_ip4_to_ip6_fragmented (p0, pheader0))
282 p0->error = error_node->errors[MAP_ERROR_FRAGMENT_DROPPED];
283 next0 = IP4_MAPT_FRAGMENTED_NEXT_DROP;
287 if (vnet_buffer (p0)->map_t.mtu < p0->current_length)
289 vnet_buffer (p0)->ip_frag.mtu = vnet_buffer (p0)->map_t.mtu;
290 vnet_buffer (p0)->ip_frag.next_index =
291 IP_FRAG_NEXT_IP6_LOOKUP;
292 next0 = IP4_MAPT_FRAGMENTED_NEXT_IP6_FRAG;
296 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
297 to_next, n_left_to_next, pi0,
300 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
302 return frame->n_vectors;
306 * Translate IPv4 UDP/TCP packet to IPv6.
309 map_ip4_to_ip6_tcp_udp (vlib_buffer_t * p, ip4_mapt_pseudo_header_t * pheader)
311 map_main_t *mm = &map_main;
316 ip6_frag_hdr_t *frag;
318 ip4_address_t old_src, old_dst;
320 ip4 = vlib_buffer_get_current (p);
322 if (ip4->protocol == IP_PROTOCOL_UDP)
324 udp_header_t *udp = ip4_next_header (ip4);
325 checksum = &udp->checksum;
328 * UDP checksum is optional over IPv4 but mandatory for IPv6 We
329 * do not check udp->length sanity but use our safe computed
332 if (PREDICT_FALSE (!*checksum))
334 u16 udp_len = clib_host_to_net_u16 (ip4->length) - sizeof (*ip4);
335 csum = ip_incremental_checksum (0, udp, udp_len);
336 csum = ip_csum_with_carry (csum, clib_host_to_net_u16 (udp_len));
338 ip_csum_with_carry (csum, clib_host_to_net_u16 (IP_PROTOCOL_UDP));
339 csum = ip_csum_with_carry (csum, *((u64 *) (&ip4->src_address)));
340 *checksum = ~ip_csum_fold (csum);
345 tcp_header_t *tcp = ip4_next_header (ip4);
348 csum = tcp->checksum;
349 map_mss_clamping (tcp, &csum, mm->tcp_mss);
350 tcp->checksum = ip_csum_fold (csum);
352 checksum = &tcp->checksum;
355 old_src.as_u32 = ip4->src_address.as_u32;
356 old_dst.as_u32 = ip4->dst_address.as_u32;
358 /* Deal with fragmented packets */
359 if (PREDICT_FALSE (ip4->flags_and_fragment_offset &
360 clib_host_to_net_u16 (IP4_HEADER_FLAG_MORE_FRAGMENTS)))
363 (ip6_header_t *) u8_ptr_add (ip4,
364 sizeof (*ip4) - sizeof (*ip6) -
367 (ip6_frag_hdr_t *) u8_ptr_add (ip4, sizeof (*ip4) - sizeof (*frag));
368 frag_id = frag_id_4to6 (ip4->fragment_id);
369 vlib_buffer_advance (p, sizeof (*ip4) - sizeof (*ip6) - sizeof (*frag));
373 ip6 = (ip6_header_t *) (((u8 *) ip4) + sizeof (*ip4) - sizeof (*ip6));
374 vlib_buffer_advance (p, sizeof (*ip4) - sizeof (*ip6));
378 ip6->ip_version_traffic_class_and_flow_label =
379 clib_host_to_net_u32 ((6 << 28) + (ip4->tos << 20));
380 ip6->payload_length = u16_net_add (ip4->length, -sizeof (*ip4));
381 ip6->hop_limit = ip4->ttl;
382 ip6->protocol = ip4->protocol;
383 if (PREDICT_FALSE (frag != NULL))
385 frag->next_hdr = ip6->protocol;
386 frag->identification = frag_id;
388 frag->fragment_offset_and_more = ip6_frag_hdr_offset_and_more (0, 1);
389 ip6->protocol = IP_PROTOCOL_IPV6_FRAGMENTATION;
390 ip6->payload_length = u16_net_add (ip6->payload_length, sizeof (*frag));
393 ip6->dst_address.as_u64[0] = pheader->daddr.as_u64[0];
394 ip6->dst_address.as_u64[1] = pheader->daddr.as_u64[1];
395 ip6->src_address.as_u64[0] = pheader->saddr.as_u64[0];
396 ip6->src_address.as_u64[1] = pheader->saddr.as_u64[1];
398 csum = ip_csum_sub_even (*checksum, old_src.as_u32);
399 csum = ip_csum_sub_even (csum, old_dst.as_u32);
400 csum = ip_csum_add_even (csum, ip6->src_address.as_u64[0]);
401 csum = ip_csum_add_even (csum, ip6->src_address.as_u64[1]);
402 csum = ip_csum_add_even (csum, ip6->dst_address.as_u64[0]);
403 csum = ip_csum_add_even (csum, ip6->dst_address.as_u64[1]);
404 *checksum = ip_csum_fold (csum);
410 ip4_map_t_tcp_udp (vlib_main_t * vm,
411 vlib_node_runtime_t * node, vlib_frame_t * frame)
413 u32 n_left_from, *from, next_index, *to_next, n_left_to_next;
414 from = vlib_frame_vector_args (frame);
415 n_left_from = frame->n_vectors;
416 next_index = node->cached_next_index;
417 vlib_node_runtime_t *error_node =
418 vlib_node_get_runtime (vm, ip4_map_t_tcp_udp_node.index);
421 while (n_left_from > 0)
423 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
425 while (n_left_from > 0 && n_left_to_next > 0)
429 ip4_mapt_pseudo_header_t *pheader0;
430 ip4_mapt_tcp_udp_next_t next0;
432 pi0 = to_next[0] = from[0];
438 next0 = IP4_MAPT_TCP_UDP_NEXT_IP6_LOOKUP;
439 p0 = vlib_get_buffer (vm, pi0);
441 //Accessing pseudo header
442 pheader0 = vlib_buffer_get_current (p0);
443 vlib_buffer_advance (p0, sizeof (*pheader0));
445 if (map_ip4_to_ip6_tcp_udp (p0, pheader0))
447 p0->error = error_node->errors[MAP_ERROR_UNKNOWN];
448 next0 = IP4_MAPT_TCP_UDP_NEXT_DROP;
452 if (vnet_buffer (p0)->map_t.mtu < p0->current_length)
454 //Send to fragmentation node if necessary
455 vnet_buffer (p0)->ip_frag.mtu = vnet_buffer (p0)->map_t.mtu;
456 vnet_buffer (p0)->ip_frag.next_index =
457 IP_FRAG_NEXT_IP6_LOOKUP;
458 next0 = IP4_MAPT_TCP_UDP_NEXT_IP6_FRAG;
461 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
462 to_next, n_left_to_next, pi0,
465 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
468 return frame->n_vectors;
471 static_always_inline void
472 ip4_map_t_classify (vlib_buffer_t * p0, map_domain_t * d0,
473 ip4_header_t * ip40, u16 ip4_len0, i32 * dst_port0,
474 u8 * error0, ip4_mapt_next_t * next0, u16 l4_dst_port)
476 if (PREDICT_FALSE (ip4_get_fragment_offset (ip40)))
478 *next0 = IP4_MAPT_NEXT_MAPT_FRAGMENTED;
479 if (d0->ea_bits_len == 0 && d0->rules)
485 *dst_port0 = l4_dst_port;
486 *error0 = (*dst_port0 == -1) ? MAP_ERROR_FRAGMENT_MEMORY : *error0;
489 else if (PREDICT_TRUE (ip40->protocol == IP_PROTOCOL_TCP))
491 vnet_buffer (p0)->map_t.checksum_offset = 36;
492 *next0 = IP4_MAPT_NEXT_MAPT_TCP_UDP;
493 *error0 = ip4_len0 < 40 ? MAP_ERROR_MALFORMED : *error0;
494 *dst_port0 = l4_dst_port;
496 else if (PREDICT_TRUE (ip40->protocol == IP_PROTOCOL_UDP))
498 vnet_buffer (p0)->map_t.checksum_offset = 26;
499 *next0 = IP4_MAPT_NEXT_MAPT_TCP_UDP;
500 *error0 = ip4_len0 < 28 ? MAP_ERROR_MALFORMED : *error0;
501 *dst_port0 = l4_dst_port;
503 else if (ip40->protocol == IP_PROTOCOL_ICMP)
505 *next0 = IP4_MAPT_NEXT_MAPT_ICMP;
506 if (d0->ea_bits_len == 0 && d0->rules)
508 else if (((icmp46_header_t *) u8_ptr_add (ip40, sizeof (*ip40)))->code
510 || ((icmp46_header_t *)
512 sizeof (*ip40)))->code == ICMP4_echo_request)
513 *dst_port0 = l4_dst_port;
517 *error0 = MAP_ERROR_BAD_PROTOCOL;
522 ip4_map_t (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
524 u32 n_left_from, *from, next_index, *to_next, n_left_to_next;
525 vlib_node_runtime_t *error_node =
526 vlib_node_get_runtime (vm, ip4_map_t_node.index);
527 from = vlib_frame_vector_args (frame);
528 n_left_from = frame->n_vectors;
529 next_index = node->cached_next_index;
530 vlib_combined_counter_main_t *cm = map_main.domain_counters;
531 u32 thread_index = vm->thread_index;
533 while (n_left_from > 0)
535 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
537 while (n_left_from > 0 && n_left_to_next > 0)
543 ip4_mapt_next_t next0 = 0;
547 ip4_mapt_pseudo_header_t *pheader0;
549 pi0 = to_next[0] = from[0];
554 error0 = MAP_ERROR_NONE;
556 p0 = vlib_get_buffer (vm, pi0);
558 u16 l4_dst_port = vnet_buffer (p0)->ip.reass.l4_dst_port;
560 ip40 = vlib_buffer_get_current (p0);
561 ip4_len0 = clib_host_to_net_u16 (ip40->length);
562 if (PREDICT_FALSE (p0->current_length < ip4_len0 ||
563 ip40->ip_version_and_header_length != 0x45))
565 error0 = MAP_ERROR_UNKNOWN;
568 d0 = ip4_map_get_domain (&ip40->dst_address,
569 &vnet_buffer (p0)->map_t.map_domain_index,
573 { /* Guess it wasn't for us */
574 vnet_feature_next (&next0, p0);
579 ip40->flags_and_fragment_offset &
580 clib_host_to_net_u16 (IP4_HEADER_FLAG_DONT_FRAGMENT);
583 (df0 && !map_main.frag_ignore_df && (ip4_len0 > d0->mtu)))
585 p0->error = error_node->errors[MAP_ERROR_FRAGMENT_DROPPED];
586 next0 = IP4_MAPT_NEXT_DROP;
590 vnet_buffer (p0)->map_t.mtu = d0->mtu ? d0->mtu : ~0;
593 ip4_map_t_classify (p0, d0, ip40, ip4_len0, &dst_port0, &error0,
594 &next0, l4_dst_port);
596 /* Verify that port is not among the well-known ports */
597 if ((d0->psid_length > 0 && d0->psid_offset > 0)
598 && (clib_net_to_host_u16 (dst_port0) <
599 (0x1 << (16 - d0->psid_offset))))
601 error0 = MAP_ERROR_SEC_CHECK;
604 //Add MAP-T pseudo header in front of the packet
605 vlib_buffer_advance (p0, -sizeof (*pheader0));
606 pheader0 = vlib_buffer_get_current (p0);
608 //Save addresses within the packet
609 ip4_map_t_embedded_address (d0, &pheader0->saddr,
611 pheader0->daddr.as_u64[0] =
612 map_get_pfx_net (d0, ip40->dst_address.as_u32, (u16) dst_port0);
613 pheader0->daddr.as_u64[1] =
614 map_get_sfx_net (d0, ip40->dst_address.as_u32, (u16) dst_port0);
617 (error0 == MAP_ERROR_NONE && next0 != IP4_MAPT_NEXT_MAPT_ICMP))
619 vlib_increment_combined_counter (cm + MAP_DOMAIN_COUNTER_TX,
622 map_t.map_domain_index, 1,
627 next0 = (error0 != MAP_ERROR_NONE) ? IP4_MAPT_NEXT_DROP : next0;
628 p0->error = error_node->errors[error0];
630 if (PREDICT_FALSE (p0->flags & VLIB_BUFFER_IS_TRACED))
632 map_add_trace (vm, node, p0, d0 - map_main.domains, dst_port0);
635 vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
636 to_next, n_left_to_next, pi0,
639 vlib_put_next_frame (vm, node, next_index, n_left_to_next);
641 return frame->n_vectors;
644 static char *map_t_error_strings[] = {
645 #define _(sym,string) string,
651 VNET_FEATURE_INIT (ip4_map_t_feature, static) = {
652 .arc_name = "ip4-unicast",
653 .node_name = "ip4-map-t",
654 .runs_before = VNET_FEATURES ("ip4-flow-classify"),
655 .runs_after = VNET_FEATURES ("ip4-sv-reassembly-feature"),
658 VLIB_REGISTER_NODE(ip4_map_t_fragmented_node) = {
659 .function = ip4_map_t_fragmented,
660 .name = "ip4-map-t-fragmented",
661 .vector_size = sizeof(u32),
662 .format_trace = format_map_trace,
663 .type = VLIB_NODE_TYPE_INTERNAL,
665 .n_errors = MAP_N_ERROR,
666 .error_strings = map_t_error_strings,
668 .n_next_nodes = IP4_MAPT_FRAGMENTED_N_NEXT,
670 [IP4_MAPT_FRAGMENTED_NEXT_IP6_LOOKUP] = "ip6-lookup",
671 [IP4_MAPT_FRAGMENTED_NEXT_IP6_FRAG] = IP6_FRAG_NODE_NAME,
672 [IP4_MAPT_FRAGMENTED_NEXT_DROP] = "error-drop",
678 VLIB_REGISTER_NODE(ip4_map_t_icmp_node) = {
679 .function = ip4_map_t_icmp,
680 .name = "ip4-map-t-icmp",
681 .vector_size = sizeof(u32),
682 .format_trace = format_map_trace,
683 .type = VLIB_NODE_TYPE_INTERNAL,
685 .n_errors = MAP_N_ERROR,
686 .error_strings = map_t_error_strings,
688 .n_next_nodes = IP4_MAPT_ICMP_N_NEXT,
690 [IP4_MAPT_ICMP_NEXT_IP6_LOOKUP] = "ip6-lookup",
691 [IP4_MAPT_ICMP_NEXT_IP6_FRAG] = IP6_FRAG_NODE_NAME,
692 [IP4_MAPT_ICMP_NEXT_DROP] = "error-drop",
698 VLIB_REGISTER_NODE(ip4_map_t_tcp_udp_node) = {
699 .function = ip4_map_t_tcp_udp,
700 .name = "ip4-map-t-tcp-udp",
701 .vector_size = sizeof(u32),
702 .format_trace = format_map_trace,
703 .type = VLIB_NODE_TYPE_INTERNAL,
705 .n_errors = MAP_N_ERROR,
706 .error_strings = map_t_error_strings,
708 .n_next_nodes = IP4_MAPT_TCP_UDP_N_NEXT,
710 [IP4_MAPT_TCP_UDP_NEXT_IP6_LOOKUP] = "ip6-lookup",
711 [IP4_MAPT_TCP_UDP_NEXT_IP6_FRAG] = IP6_FRAG_NODE_NAME,
712 [IP4_MAPT_TCP_UDP_NEXT_DROP] = "error-drop",
718 VLIB_REGISTER_NODE(ip4_map_t_node) = {
719 .function = ip4_map_t,
721 .vector_size = sizeof(u32),
722 .format_trace = format_map_trace,
723 .type = VLIB_NODE_TYPE_INTERNAL,
725 .n_errors = MAP_N_ERROR,
726 .error_strings = map_t_error_strings,
728 .n_next_nodes = IP4_MAPT_N_NEXT,
730 [IP4_MAPT_NEXT_MAPT_TCP_UDP] = "ip4-map-t-tcp-udp",
731 [IP4_MAPT_NEXT_MAPT_ICMP] = "ip4-map-t-icmp",
732 [IP4_MAPT_NEXT_MAPT_FRAGMENTED] = "ip4-map-t-fragmented",
733 [IP4_MAPT_NEXT_DROP] = "error-drop",
739 * fd.io coding-style-patch-verification: ON
742 * eval: (c-set-style "gnu")