From c3148b1be8f519c80c4417c21b978dfef72b351b Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Tue, 12 Mar 2024 17:42:49 +0100 Subject: misc: remove GNU Indent directives Type: refactor Change-Id: I5235bf3e9aff58af6ba2c14e8c6529c4fc9ec86c Signed-off-by: Damjan Marion --- src/plugins/nat/det44/det44.c | 14 ------------ src/plugins/nat/det44/det44.h | 4 ---- src/plugins/nat/det44/det44_api.c | 16 -------------- src/plugins/nat/det44/det44_in2out.c | 2 -- src/plugins/nat/det44/det44_inlines.h | 4 ---- src/plugins/nat/det44/det44_out2in.c | 2 -- src/plugins/nat/dslite/dslite.c | 4 ---- src/plugins/nat/dslite/dslite.h | 2 -- src/plugins/nat/dslite/dslite_api.c | 6 ----- src/plugins/nat/dslite/dslite_ce_decap.c | 2 -- src/plugins/nat/dslite/dslite_ce_encap.c | 2 -- src/plugins/nat/dslite/dslite_cli.c | 6 ----- src/plugins/nat/dslite/dslite_in2out.c | 4 ---- src/plugins/nat/dslite/dslite_out2in.c | 2 -- src/plugins/nat/lib/alloc.h | 2 -- src/plugins/nat/lib/ipfix_logging.c | 2 -- src/plugins/nat/nat44-ei/nat44_ei_ha.c | 8 ------- src/plugins/nat/nat64/nat64.c | 38 -------------------------------- src/plugins/nat/nat64/nat64.h | 2 -- src/plugins/nat/nat64/nat64_api.c | 6 ----- src/plugins/nat/nat64/nat64_cli.c | 6 ----- src/plugins/nat/nat64/nat64_db.c | 36 ------------------------------ src/plugins/nat/nat64/nat64_db.h | 8 ------- src/plugins/nat/nat64/nat64_in2out.c | 14 ------------ src/plugins/nat/nat64/nat64_out2in.c | 4 ---- src/plugins/nat/nat66/nat66_in2out.c | 4 ---- src/plugins/nat/nat66/nat66_out2in.c | 2 -- 27 files changed, 202 deletions(-) (limited to 'src/plugins/nat') diff --git a/src/plugins/nat/det44/det44.c b/src/plugins/nat/det44/det44.c index a8aea28d948..f251bc9c608 100644 --- a/src/plugins/nat/det44/det44.c +++ b/src/plugins/nat/det44/det44.c @@ -29,7 +29,6 @@ det44_main_t det44_main; -/* *INDENT-OFF* */ VNET_FEATURE_INIT (ip4_det44_in2out, static) = { .arc_name = "ip4-unicast", .node_name = "det44-in2out", @@ -47,7 +46,6 @@ VLIB_PLUGIN_REGISTER () = { .version = VPP_BUILD_VER, .description = "Deterministic NAT (CGN)", }; -/* *INDENT-ON* */ void det44_add_del_addr_to_fib (ip4_address_t * addr, u8 p_len, u32 sw_if_index, @@ -150,14 +148,12 @@ snat_det_add_map (ip4_address_t * in_addr, u8 in_plen, } /* Add/del external address range to FIB */ - /* *INDENT-OFF* */ pool_foreach (i, dm->interfaces) { if (det44_interface_is_inside(i)) continue; det44_add_del_addr_to_fib(out_addr, out_plen, i->sw_if_index, is_add); goto out; } - /* *INDENT-ON* */ out: return 0; } @@ -203,7 +199,6 @@ det44_interface_add_del (u32 sw_if_index, u8 is_inside, int is_del) // rather make a structure and when enable call is used // then register nodes - /* *INDENT-OFF* */ pool_foreach (tmp, dm->interfaces) { if (tmp->sw_if_index == sw_if_index) { @@ -211,7 +206,6 @@ det44_interface_add_del (u32 sw_if_index, u8 is_inside, int is_del) goto out; } } - /* *INDENT-ON* */ out: feature_name = is_inside ? "det44-in2out" : "det44-out2in"; @@ -270,7 +264,6 @@ out: // add/del outside interface fib to registry u8 found = 0; det44_fib_t *outside_fib; - /* *INDENT-OFF* */ vec_foreach (outside_fib, dm->outside_fibs) { if (outside_fib->fib_index == fib_index) @@ -292,7 +285,6 @@ out: break; } } - /* *INDENT-ON* */ if (!is_del && !found) { vec_add2 (dm->outside_fibs, outside_fib, 1); @@ -301,12 +293,10 @@ out: } // add/del outside address to FIB snat_det_map_t *mp; - /* *INDENT-OFF* */ pool_foreach (mp, dm->det_maps) { det44_add_del_addr_to_fib(&mp->out_addr, mp->out_plen, sw_if_index, !is_del); } - /* *INDENT-ON* */ } return 0; } @@ -441,12 +431,10 @@ det44_plugin_disable () } vec_free (interfaces); - /* *INDENT-OFF* */ pool_foreach (mp, dm->det_maps) { vec_free (mp->sessions); } - /* *INDENT-ON* */ det44_reset_timeouts (); @@ -479,7 +467,6 @@ det44_update_outside_fib (ip4_main_t * im, if (!vec_len (dm->outside_fibs)) return; - /* *INDENT-OFF* */ pool_foreach (i, dm->interfaces) { if (i->sw_if_index == sw_if_index) @@ -489,7 +476,6 @@ det44_update_outside_fib (ip4_main_t * im, match = 1; } } - /* *INDENT-ON* */ if (!match) return; diff --git a/src/plugins/nat/det44/det44.h b/src/plugins/nat/det44/det44.h index 7d290f4a956..e576bfb65e8 100644 --- a/src/plugins/nat/det44/det44.h +++ b/src/plugins/nat/det44/det44.h @@ -279,13 +279,11 @@ snat_det_map_by_user (ip4_address_t * user_addr) { det44_main_t *dm = &det44_main; snat_det_map_t *mp; - /* *INDENT-OFF* */ pool_foreach (mp, dm->det_maps) { if (is_addr_in_net(user_addr, &mp->in_addr, mp->in_plen)) return mp; } - /* *INDENT-ON* */ return 0; } @@ -294,13 +292,11 @@ snat_det_map_by_out (ip4_address_t * out_addr) { det44_main_t *dm = &det44_main; snat_det_map_t *mp; - /* *INDENT-OFF* */ pool_foreach (mp, dm->det_maps) { if (is_addr_in_net(out_addr, &mp->out_addr, mp->out_plen)) return mp; } - /* *INDENT-ON* */ return 0; } diff --git a/src/plugins/nat/det44/det44_api.c b/src/plugins/nat/det44/det44_api.c index 1486180aa99..c7e17dfd147 100644 --- a/src/plugins/nat/det44/det44_api.c +++ b/src/plugins/nat/det44/det44_api.c @@ -67,14 +67,12 @@ vl_api_det44_forward_t_handler (vl_api_det44_forward_t * mp) hi_port = lo_port + m->ports_per_host - 1; send_reply: - /* *INDENT-OFF* */ REPLY_MACRO2 (VL_API_DET44_FORWARD_REPLY, ({ rmp->out_port_lo = ntohs (lo_port); rmp->out_port_hi = ntohs (hi_port); clib_memcpy (rmp->out_addr, &out_addr, 4); })) - /* *INDENT-ON* */ } static void @@ -98,12 +96,10 @@ vl_api_det44_reverse_t_handler (vl_api_det44_reverse_t * mp) snat_det_reverse (m, &out_addr, htons (mp->out_port), &in_addr); send_reply: - /* *INDENT-OFF* */ REPLY_MACRO2 (VL_API_DET44_REVERSE_REPLY, ({ clib_memcpy (rmp->in_addr, &in_addr, 4); })) - /* *INDENT-ON* */ } static void @@ -139,10 +135,8 @@ vl_api_det44_map_dump_t_handler (vl_api_det44_map_dump_t * mp) if (!reg) return; - /* *INDENT-OFF* */ vec_foreach(m, dm->det_maps) sent_det44_map_details(m, reg, mp->context); - /* *INDENT-ON* */ } static void @@ -328,12 +322,10 @@ vl_api_det44_interface_dump_t_handler (vl_api_det44_interface_dump_t * mp) if (!reg) return; - /* *INDENT-OFF* */ pool_foreach (i, dm->interfaces) { det44_send_interface_details(i, reg, mp->context); } - /* *INDENT-ON* */ } static void @@ -359,7 +351,6 @@ vl_api_det44_get_timeouts_t_handler (vl_api_det44_get_timeouts_t * mp) nat_timeouts_t timeouts; int rv = 0; timeouts = det44_get_timeouts (); - /* *INDENT-OFF* */ REPLY_MACRO2 (VL_API_DET44_GET_TIMEOUTS_REPLY, ({ rmp->udp = htonl (timeouts.udp); @@ -367,7 +358,6 @@ vl_api_det44_get_timeouts_t_handler (vl_api_det44_get_timeouts_t * mp) rmp->tcp_transitory = htonl (timeouts.tcp.transitory); rmp->icmp = htonl (timeouts.icmp); })) - /* *INDENT-ON* */ } /* @@ -412,14 +402,12 @@ vl_api_nat_det_forward_t_handler (vl_api_nat_det_forward_t * mp) hi_port = lo_port + m->ports_per_host - 1; send_reply: - /* *INDENT-OFF* */ REPLY_MACRO2 (VL_API_NAT_DET_FORWARD_REPLY, ({ rmp->out_port_lo = ntohs (lo_port); rmp->out_port_hi = ntohs (hi_port); clib_memcpy (rmp->out_addr, &out_addr, 4); })) - /* *INDENT-ON* */ } static void @@ -443,12 +431,10 @@ vl_api_nat_det_reverse_t_handler (vl_api_nat_det_reverse_t * mp) snat_det_reverse (m, &out_addr, htons (mp->out_port), &in_addr); send_reply: - /* *INDENT-OFF* */ REPLY_MACRO2 (VL_API_NAT_DET_REVERSE_REPLY, ({ clib_memcpy (rmp->in_addr, &in_addr, 4); })) - /* *INDENT-ON* */ } static void @@ -484,10 +470,8 @@ vl_api_nat_det_map_dump_t_handler (vl_api_nat_det_map_dump_t * mp) if (!reg) return; - /* *INDENT-OFF* */ vec_foreach(m, dm->det_maps) sent_nat_det_map_details(m, reg, mp->context); - /* *INDENT-ON* */ } static void diff --git a/src/plugins/nat/det44/det44_in2out.c b/src/plugins/nat/det44/det44_in2out.c index 5fe4a9a0658..3f5e05a064c 100644 --- a/src/plugins/nat/det44/det44_in2out.c +++ b/src/plugins/nat/det44/det44_in2out.c @@ -1011,7 +1011,6 @@ VLIB_NODE_FN (det44_in2out_node) (vlib_main_t * vm, return frame->n_vectors; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (det44_in2out_node) = { .name = "det44-in2out", .vector_size = sizeof (u32), @@ -1028,7 +1027,6 @@ VLIB_REGISTER_NODE (det44_in2out_node) = { [DET44_IN2OUT_NEXT_ICMP_ERROR] = "ip4-icmp-error", }, }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/nat/det44/det44_inlines.h b/src/plugins/nat/det44/det44_inlines.h index aeb55b385d3..e5e70bbaebc 100644 --- a/src/plugins/nat/det44/det44_inlines.h +++ b/src/plugins/nat/det44/det44_inlines.h @@ -91,7 +91,6 @@ det44_translate (vlib_node_runtime_t * node, u32 sw_if_index0, if (sw_if_index == ~0) { // TODO: go over use cases - /* *INDENT-OFF* */ vec_foreach (outside_fib, dm->outside_fibs) { fei = fib_table_lookup (outside_fib->fib_index, &pfx); @@ -102,18 +101,15 @@ det44_translate (vlib_node_runtime_t * node, u32 sw_if_index0, break; } } - /* *INDENT-ON* */ } if (sw_if_index != ~0) { det44_interface_t *i; - /* *INDENT-OFF* */ pool_foreach (i, dm->interfaces) { /* NAT packet aimed at outside interface */ if ((det44_interface_is_outside (i)) && (sw_if_index == i->sw_if_index)) return 0; } - /* *INDENT-ON* */ } } return 1; diff --git a/src/plugins/nat/det44/det44_out2in.c b/src/plugins/nat/det44/det44_out2in.c index 4871e752db0..ab6acd4f8e9 100644 --- a/src/plugins/nat/det44/det44_out2in.c +++ b/src/plugins/nat/det44/det44_out2in.c @@ -818,7 +818,6 @@ VLIB_NODE_FN (det44_out2in_node) (vlib_main_t * vm, return frame->n_vectors; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (det44_out2in_node) = { .name = "det44-out2in", .vector_size = sizeof (u32), @@ -835,7 +834,6 @@ VLIB_REGISTER_NODE (det44_out2in_node) = { [DET44_OUT2IN_NEXT_ICMP_ERROR] = "ip4-icmp-error", }, }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/nat/dslite/dslite.c b/src/plugins/nat/dslite/dslite.c index 4fe4422df13..a2654b5a44b 100644 --- a/src/plugins/nat/dslite/dslite.c +++ b/src/plugins/nat/dslite/dslite.c @@ -101,7 +101,6 @@ dslite_init_datastructures (void) u32 b4_buckets = 128; u32 b4_memory_size = 64 << 20; - /* *INDENT-OFF* */ vec_foreach (td, dm->per_thread_data) { clib_bihash_init_24_8 (&td->in2out, "dslite in2out", translation_buckets, @@ -112,7 +111,6 @@ dslite_init_datastructures (void) clib_bihash_init_16_8 (&td->b4_hash, "dslite b4s", b4_buckets, b4_memory_size); } - /* *INDENT-ON* */ dm->is_enabled = 1; } @@ -281,13 +279,11 @@ format_dslite_ce_trace (u8 * s, va_list * args) VLIB_INIT_FUNCTION (dslite_init); -/* *INDENT-OFF* */ VLIB_PLUGIN_REGISTER () = { .version = VPP_BUILD_VER, .description = "Dual-Stack Lite", }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/nat/dslite/dslite.h b/src/plugins/nat/dslite/dslite.h index 3c798bf54fe..f05670c9bf5 100644 --- a/src/plugins/nat/dslite/dslite.h +++ b/src/plugins/nat/dslite/dslite.h @@ -61,7 +61,6 @@ typedef struct }; } dslite_session_key_t; -/* *INDENT-OFF* */ typedef CLIB_PACKED (struct { nat_session_key_t out2in; @@ -72,7 +71,6 @@ typedef CLIB_PACKED (struct u64 total_bytes; u32 total_pkts; }) dslite_session_t; -/* *INDENT-ON* */ typedef struct { diff --git a/src/plugins/nat/dslite/dslite_api.c b/src/plugins/nat/dslite/dslite_api.c index 420e8212ad9..4bb53c37660 100644 --- a/src/plugins/nat/dslite/dslite_api.c +++ b/src/plugins/nat/dslite/dslite_api.c @@ -53,13 +53,11 @@ vl_api_dslite_get_aftr_addr_t_handler (vl_api_dslite_get_aftr_addr_t * mp) dslite_main_t *dm = &dslite_main; int rv = 0; - /* *INDENT-OFF* */ REPLY_MACRO2 (VL_API_DSLITE_GET_AFTR_ADDR_REPLY, ({ memcpy (rmp->ip4_addr, &dm->aftr_ip4_addr.as_u8, 4); memcpy (rmp->ip6_addr, &dm->aftr_ip6_addr.as_u8, 16); })) - /* *INDENT-ON* */ } static void @@ -88,13 +86,11 @@ vl_api_dslite_get_b4_addr_t_handler (vl_api_dslite_get_b4_addr_t * mp) dslite_main_t *dm = &dslite_main; int rv = 0; - /* *INDENT-OFF* */ REPLY_MACRO2 (VL_API_DSLITE_GET_B4_ADDR_REPLY, ({ memcpy (rmp->ip4_addr, &dm->b4_ip4_addr.as_u8, 4); memcpy (rmp->ip6_addr, &dm->b4_ip6_addr.as_u8, 16); })) - /* *INDENT-ON* */ } static void @@ -154,12 +150,10 @@ vl_api_dslite_address_dump_t_handler (vl_api_dslite_address_dump_t * mp) if (!reg) return; - /* *INDENT-OFF* */ vec_foreach (a, dm->pool.pool_addr) { send_dslite_address_details (a, reg, mp->context); } - /* *INDENT-ON* */ } /* API definitions */ diff --git a/src/plugins/nat/dslite/dslite_ce_decap.c b/src/plugins/nat/dslite/dslite_ce_decap.c index f36a87f8bc1..b5bdafc0e26 100644 --- a/src/plugins/nat/dslite/dslite_ce_decap.c +++ b/src/plugins/nat/dslite/dslite_ce_decap.c @@ -114,7 +114,6 @@ VLIB_NODE_FN (dslite_ce_decap_node) (vlib_main_t * vm, return frame->n_vectors; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (dslite_ce_decap_node) = { .name = "dslite-ce-decap", .vector_size = sizeof (u32), @@ -130,7 +129,6 @@ VLIB_REGISTER_NODE (dslite_ce_decap_node) = { [DSLITE_IN2OUT_NEXT_IP6_ICMP] = "ip6-icmp-input", }, }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/nat/dslite/dslite_ce_encap.c b/src/plugins/nat/dslite/dslite_ce_encap.c index d8d0e400919..19596efd32d 100644 --- a/src/plugins/nat/dslite/dslite_ce_encap.c +++ b/src/plugins/nat/dslite/dslite_ce_encap.c @@ -107,7 +107,6 @@ VLIB_NODE_FN (dslite_ce_encap_node) (vlib_main_t * vm, return frame->n_vectors; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (dslite_ce_encap_node) = { .name = "dslite-ce-encap", .vector_size = sizeof (u32), @@ -122,7 +121,6 @@ VLIB_REGISTER_NODE (dslite_ce_encap_node) = { [DSLITE_CE_ENCAP_NEXT_IP6_LOOKUP] = "ip6-lookup", }, }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/nat/dslite/dslite_cli.c b/src/plugins/nat/dslite/dslite_cli.c index 193cb3fe248..8ed9deb2a2d 100644 --- a/src/plugins/nat/dslite/dslite_cli.c +++ b/src/plugins/nat/dslite/dslite_cli.c @@ -95,12 +95,10 @@ dslite_show_pool_command_fn (vlib_main_t * vm, vlib_cli_output (vm, "DS-Lite pool:"); - /* *INDENT-OFF* */ vec_foreach (a, dm->pool.pool_addr) { vlib_cli_output (vm, "%U", format_ip4_address, &a->addr); } - /* *INDENT-ON* */ return 0; } @@ -267,7 +265,6 @@ dslite_show_sessions_command_fn (vlib_main_t * vm, dslite_per_thread_data_t *td; dslite_b4_t *b4; - /* *INDENT-OFF* */ vec_foreach (td, dm->per_thread_data) { pool_foreach (b4, td->b4s) @@ -275,12 +272,10 @@ dslite_show_sessions_command_fn (vlib_main_t * vm, vlib_cli_output (vm, "%U", format_dslite_b4, td, b4); } } - /* *INDENT-ON* */ return 0; } -/* *INDENT-OFF* */ /*? * @cliexpar @@ -394,7 +389,6 @@ VLIB_CLI_COMMAND (dslite_show_sessions, static) = { .function = dslite_show_sessions_command_fn, }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/nat/dslite/dslite_in2out.c b/src/plugins/nat/dslite/dslite_in2out.c index 409c59c218c..522c3cf4123 100644 --- a/src/plugins/nat/dslite/dslite_in2out.c +++ b/src/plugins/nat/dslite/dslite_in2out.c @@ -460,7 +460,6 @@ VLIB_NODE_FN (dslite_in2out_node) (vlib_main_t * vm, return dslite_in2out_node_fn_inline (vm, node, frame, 0); } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (dslite_in2out_node) = { .name = "dslite-in2out", .vector_size = sizeof (u32), @@ -477,7 +476,6 @@ VLIB_REGISTER_NODE (dslite_in2out_node) = { [DSLITE_IN2OUT_NEXT_SLOWPATH] = "dslite-in2out-slowpath", }, }; -/* *INDENT-ON* */ VLIB_NODE_FN (dslite_in2out_slowpath_node) (vlib_main_t * vm, vlib_node_runtime_t * node, @@ -486,7 +484,6 @@ VLIB_NODE_FN (dslite_in2out_slowpath_node) (vlib_main_t * vm, return dslite_in2out_node_fn_inline (vm, node, frame, 1); } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (dslite_in2out_slowpath_node) = { .name = "dslite-in2out-slowpath", .vector_size = sizeof (u32), @@ -503,7 +500,6 @@ VLIB_REGISTER_NODE (dslite_in2out_slowpath_node) = { [DSLITE_IN2OUT_NEXT_SLOWPATH] = "dslite-in2out-slowpath", }, }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/nat/dslite/dslite_out2in.c b/src/plugins/nat/dslite/dslite_out2in.c index c2fa767bd7d..531bbb468bb 100644 --- a/src/plugins/nat/dslite/dslite_out2in.c +++ b/src/plugins/nat/dslite/dslite_out2in.c @@ -266,7 +266,6 @@ VLIB_NODE_FN (dslite_out2in_node) (vlib_main_t * vm, return frame->n_vectors; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (dslite_out2in_node) = { .name = "dslite-out2in", .vector_size = sizeof (u32), @@ -282,7 +281,6 @@ VLIB_REGISTER_NODE (dslite_out2in_node) = { [DSLITE_OUT2IN_NEXT_IP6_LOOKUP] = "ip6-lookup", }, }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/nat/lib/alloc.h b/src/plugins/nat/lib/alloc.h index 0c302bf4cfb..882809e829c 100644 --- a/src/plugins/nat/lib/alloc.h +++ b/src/plugins/nat/lib/alloc.h @@ -42,14 +42,12 @@ struct nat_ip4_pool_addr_s { ip4_address_t addr; u32 fib_index; -/* *INDENT-OFF* */ #define _(N, i, n, s) \ u16 busy_##n##_ports; \ u16 * busy_##n##_ports_per_thread; \ uword * busy_##n##_port_bitmap; foreach_nat_protocol #undef _ -/* *INDENT-ON* */ }; struct nat_ip4_addr_port_s diff --git a/src/plugins/nat/lib/ipfix_logging.c b/src/plugins/nat/lib/ipfix_logging.c index 5f40db8d81c..593fa09f7e2 100644 --- a/src/plugins/nat/lib/ipfix_logging.c +++ b/src/plugins/nat/lib/ipfix_logging.c @@ -1630,11 +1630,9 @@ ipfix_flush_process (vlib_main_t *vm, return 0; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat_ipfix_flush_node) = { .function = ipfix_flush_process, .name = "nat-ipfix-flush", .type = VLIB_NODE_TYPE_INPUT, .state = VLIB_NODE_STATE_INTERRUPT, }; -/* *INDENT-ON* */ diff --git a/src/plugins/nat/nat44-ei/nat44_ei_ha.c b/src/plugins/nat/nat44-ei/nat44_ei_ha.c index 39bce255bd6..9546a595cc2 100644 --- a/src/plugins/nat/nat44-ei/nat44_ei_ha.c +++ b/src/plugins/nat/nat44-ei/nat44_ei_ha.c @@ -926,14 +926,12 @@ nat_ha_worker_fn (vlib_main_t * vm, vlib_node_runtime_t * rt, return 0; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat_ha_worker_node) = { .function = nat_ha_worker_fn, .type = VLIB_NODE_TYPE_INPUT, .state = VLIB_NODE_STATE_INTERRUPT, .name = "nat44-ei-ha-worker", }; -/* *INDENT-ON* */ /* periodically send interrupt to each thread */ static uword @@ -969,13 +967,11 @@ nat_ha_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) return 0; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat_ha_process_node) = { .function = nat_ha_process, .type = VLIB_NODE_TYPE_PROCESS, .name = "nat44-ei-ha-process", }; -/* *INDENT-ON* */ void nat_ha_get_resync_status (u8 * in_resync, u32 * resync_ack_missed) @@ -1166,7 +1162,6 @@ nat_ha_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, return frame->n_vectors; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat_ha_node) = { .function = nat_ha_node_fn, .name = "nat44-ei-ha", @@ -1181,7 +1176,6 @@ VLIB_REGISTER_NODE (nat_ha_node) = { [NAT_HA_NEXT_DROP] = "error-drop", }, }; -/* *INDENT-ON* */ typedef struct { @@ -1286,7 +1280,6 @@ nat_ha_resync (u32 client_index, u32 pid, return 0; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat_ha_handoff_node) = { .function = nat_ha_handoff_node_fn, .name = "nat44-ei-ha-handoff", @@ -1300,7 +1293,6 @@ VLIB_REGISTER_NODE (nat_ha_handoff_node) = { [0] = "error-drop", }, }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/nat/nat64/nat64.c b/src/plugins/nat/nat64/nat64.c index 79e9da03a1e..950eea60e5e 100644 --- a/src/plugins/nat/nat64/nat64.c +++ b/src/plugins/nat/nat64/nat64.c @@ -26,7 +26,6 @@ nat64_main_t nat64_main; -/* *INDENT-OFF* */ /* Hook up input features */ VNET_FEATURE_INIT (nat64_in2out, static) = { .arc_name = "ip6-unicast", @@ -62,7 +61,6 @@ static u8 well_known_prefix[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -/* *INDENT-ON* */ #define nat_elog_str(_str) \ do \ @@ -171,14 +169,12 @@ nat64_get_worker_out2in (vlib_buffer_t * b, ip4_header_t * ip) clib_memset (&daddr, 0, sizeof (daddr)); daddr.ip4.as_u32 = ip->dst_address.as_u32; - /* *INDENT-OFF* */ vec_foreach (db, nm->db) { bibe = nat64_db_bib_entry_find (db, &daddr, 0, ip->protocol, 0, 0); if (bibe) return (u32) (db - nm->db); } - /* *INDENT-ON* */ return vlib_get_thread_index (); } @@ -296,12 +292,10 @@ nat64_init (vlib_main_t * vm) for (i = 0; i < nm->num_workers; i++) bitmap = clib_bitmap_set (bitmap, i, 1); - /* *INDENT-OFF* */ clib_bitmap_foreach (i, bitmap) { vec_add1(nm->workers, i); } - /* *INDENT-ON* */ clib_bitmap_free (bitmap); @@ -337,7 +331,6 @@ nat64_init_hash (nat64_config_t c) vec_validate (nm->db, tm->n_vlib_mains - 1); - /* *INDENT-OFF* */ vec_foreach (db, nm->db) { if (nat64_db_init (db, c, nat64_free_out_addr_and_port)) @@ -346,7 +339,6 @@ nat64_init_hash (nat64_config_t c) rv = 1; } } - /* *INDENT-ON* */ return rv; } @@ -358,7 +350,6 @@ nat64_free_hash () nat64_db_t *db; int rv = 0; - /* *INDENT-OFF* */ vec_foreach (db, nm->db) { if (nat64_db_free (db)) @@ -367,7 +358,6 @@ nat64_free_hash () rv = 1; } } - /* *INDENT-ON* */ vec_free (nm->db); @@ -422,7 +412,6 @@ nat64_add_del_pool_addr (u32 thread_index, if (a->fib_index != ~0) fib_table_unlock (a->fib_index, FIB_PROTOCOL_IP6, nm->fib_src_hi); /* Delete sessions using address */ - /* *INDENT-OFF* */ vec_foreach (db, nm->db) { nat64_db_free_out_addr (thread_index, db, &a->addr); @@ -431,12 +420,10 @@ nat64_add_del_pool_addr (u32 thread_index, vlib_set_simple_counter (&nm->total_sessions, db - nm->db, 0, db->st.st_entries_num); } - /* *INDENT-ON* */ vec_del1 (nm->addr_pool, i); } /* Add/del external address to FIB */ - /* *INDENT-OFF* */ pool_foreach (interface, nm->interfaces) { if (nat64_interface_is_inside(interface)) @@ -445,7 +432,6 @@ nat64_add_del_pool_addr (u32 thread_index, nat64_add_del_addr_to_fib (addr, 32, interface->sw_if_index, is_add); break; } - /* *INDENT-ON* */ return 0; } @@ -456,13 +442,11 @@ nat64_pool_addr_walk (nat64_pool_addr_walk_fn_t fn, void *ctx) nat64_main_t *nm = &nat64_main; nat64_address_t *a = 0; - /* *INDENT-OFF* */ vec_foreach (a, nm->addr_pool) { if (fn (a, ctx)) break; }; - /* *INDENT-ON* */ } int @@ -560,7 +544,6 @@ nat64_interface_add_del (u32 sw_if_index, u8 is_inside, u8 is_add) // TODO: is enabled ? we can't signal if it is not /* Check if interface already exists */ - /* *INDENT-OFF* */ pool_foreach (i, nm->interfaces) { if (i->sw_if_index == sw_if_index) @@ -569,7 +552,6 @@ nat64_interface_add_del (u32 sw_if_index, u8 is_inside, u8 is_add) break; } } - /* *INDENT-ON* */ if (is_add) { @@ -610,10 +592,8 @@ nat64_interface_add_del (u32 sw_if_index, u8 is_inside, u8 is_add) if (!is_inside) { - /* *INDENT-OFF* */ vec_foreach (ap, nm->addr_pool) nat64_add_del_addr_to_fib (&ap->addr, 32, sw_if_index, is_add); - /* *INDENT-ON* */ } if (nm->num_workers > 1) @@ -655,13 +635,11 @@ nat64_interfaces_walk (nat64_interface_walk_fn_t fn, void *ctx) nat64_main_t *nm = &nat64_main; nat64_interface_t *i = 0; - /* *INDENT-OFF* */ pool_foreach (i, nm->interfaces) { if (fn (i, ctx)) break; } - /* *INDENT-ON* */ } // TODO: plugin independent @@ -836,7 +814,6 @@ nat64_static_bib_worker_fn (vlib_main_t * vm, vlib_node_runtime_t * rt, nat64_db_bib_entry_t *bibe; ip46_address_t addr; - /* *INDENT-OFF* */ pool_foreach (static_bib, nm->static_bibs) { if ((static_bib->thread_index != thread_index) || (static_bib->done)) @@ -873,21 +850,18 @@ nat64_static_bib_worker_fn (vlib_main_t * vm, vlib_node_runtime_t * rt, static_bib->done = 1; } - /* *INDENT-ON* */ return 0; } static vlib_node_registration_t nat64_static_bib_worker_node; -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat64_static_bib_worker_node, static) = { .function = nat64_static_bib_worker_fn, .type = VLIB_NODE_TYPE_INPUT, .state = VLIB_NODE_STATE_INTERRUPT, .name = "nat64-static-bib-worker", }; -/* *INDENT-ON* */ int nat64_add_del_static_bib_entry (ip6_address_t * in_addr, @@ -991,7 +965,6 @@ nat64_add_del_static_bib_entry (ip6_address_t * in_addr, if (nm->num_workers) { - /* *INDENT-OFF* */ pool_foreach (static_bib, nm->static_bibs) { if (static_bib->done) @@ -999,7 +972,6 @@ nat64_add_del_static_bib_entry (ip6_address_t * in_addr, } vec_foreach (index, to_be_free) pool_put_index (nm->static_bibs, index[0]); - /* *INDENT-ON* */ vec_free (to_be_free); pool_get (nm->static_bibs, static_bib); static_bib->in_addr.as_u64[0] = in_addr->as_u64[0]; @@ -1272,13 +1244,11 @@ nat64_prefix_walk (nat64_prefix_walk_fn_t fn, void *ctx) nat64_main_t *nm = &nat64_main; nat64_prefix_t *p = 0; - /* *INDENT-OFF* */ vec_foreach (p, nm->pref64) { if (fn (p, ctx)) break; }; - /* *INDENT-ON* */ } void @@ -1287,7 +1257,6 @@ nat64_compose_ip6 (ip6_address_t * ip6, ip4_address_t * ip4, u32 fib_index) nat64_main_t *nm = &nat64_main; nat64_prefix_t *p, *gp = 0, *prefix = 0; - /* *INDENT-OFF* */ vec_foreach (p, nm->pref64) { if (p->fib_index == fib_index) @@ -1299,7 +1268,6 @@ nat64_compose_ip6 (ip6_address_t * ip6, ip4_address_t * ip4, u32 fib_index) if (p->fib_index == 0) gp = p; }; - /* *INDENT-ON* */ if (!prefix) prefix = gp; @@ -1358,7 +1326,6 @@ nat64_extract_ip4 (ip6_address_t * ip6, ip4_address_t * ip4, u32 fib_index) nat64_prefix_t *p, *gp = 0; u8 plen = 0; - /* *INDENT-OFF* */ vec_foreach (p, nm->pref64) { if (p->fib_index == fib_index) @@ -1370,7 +1337,6 @@ nat64_extract_ip4 (ip6_address_t * ip6, ip4_address_t * ip4, u32 fib_index) if (p->vrf_id == 0) gp = p; }; - /* *INDENT-ON* */ if (!plen) { @@ -1445,14 +1411,12 @@ nat64_expire_worker_walk_fn (vlib_main_t * vm, vlib_node_runtime_t * rt, return 0; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat64_expire_worker_walk_node, static) = { .function = nat64_expire_worker_walk_fn, .type = VLIB_NODE_TYPE_INPUT, .state = VLIB_NODE_STATE_INTERRUPT, .name = "nat64-expire-worker-walk", }; -/* *INDENT-ON* */ /** * @brief Centralized process to drive per worker expire walk. @@ -1580,12 +1544,10 @@ nat64_plugin_disable () } nm->enabled = 0; - /* *INDENT-OFF* */ pool_foreach (i, nm->interfaces) { vec_add1 (interfaces, *i); } - /* *INDENT-ON* */ vec_foreach (i, interfaces) { rv = nat64_interface_add_del (i->sw_if_index, i->flags, 0); diff --git a/src/plugins/nat/nat64/nat64.h b/src/plugins/nat/nat64/nat64.h index 1180f9df778..9eb8d915390 100644 --- a/src/plugins/nat/nat64/nat64.h +++ b/src/plugins/nat/nat64/nat64.h @@ -93,14 +93,12 @@ typedef struct { ip4_address_t addr; u32 fib_index; -/* *INDENT-OFF* */ #define _(N, i, n, s) \ u16 busy_##n##_ports; \ u16 * busy_##n##_ports_per_thread; \ u32 busy_##n##_port_refcounts[65535]; foreach_nat_protocol #undef _ -/* *INDENT-ON* */ } nat64_address_t; typedef struct diff --git a/src/plugins/nat/nat64/nat64_api.c b/src/plugins/nat/nat64/nat64_api.c index e64b6434fd2..87cca01b59b 100644 --- a/src/plugins/nat/nat64/nat64_api.c +++ b/src/plugins/nat/nat64/nat64_api.c @@ -69,7 +69,6 @@ vl_api_nat64_get_timeouts_t_handler (vl_api_nat64_get_timeouts_t * mp) vl_api_nat64_get_timeouts_reply_t *rmp; int rv = 0; - /* *INDENT-OFF* */ REPLY_MACRO2 (VL_API_NAT64_GET_TIMEOUTS_REPLY, ({ rmp->udp = htonl (nm->udp_timeout); @@ -77,7 +76,6 @@ vl_api_nat64_get_timeouts_t_handler (vl_api_nat64_get_timeouts_t * mp) rmp->tcp_transitory = htonl (nm->tcp_trans_timeout); rmp->icmp = htonl (nm->icmp_timeout); })) - /* *INDENT-ON* */ } static void @@ -298,10 +296,8 @@ vl_api_nat64_bib_dump_t_handler (vl_api_nat64_bib_dump_t * mp) .context = mp->context, }; - /* *INDENT-OFF* */ vec_foreach (db, nm->db) nat64_db_bib_walk (db, mp->proto, nat64_api_bib_walk, &ctx); - /* *INDENT-ON* */ } static int @@ -356,13 +352,11 @@ vl_api_nat64_st_dump_t_handler (vl_api_nat64_st_dump_t * mp) .context = mp->context, }; - /* *INDENT-OFF* */ vec_foreach (db, nm->db) { ctx.db = db; nat64_db_st_walk (db, mp->proto, nat64_api_st_walk, &ctx); } - /* *INDENT-ON* */ } static void diff --git a/src/plugins/nat/nat64/nat64_cli.c b/src/plugins/nat/nat64/nat64_cli.c index 3af715c2457..2cef71080f9 100644 --- a/src/plugins/nat/nat64/nat64_cli.c +++ b/src/plugins/nat/nat64/nat64_cli.c @@ -484,10 +484,8 @@ nat64_show_bib_command_fn (vlib_main_t * vm, else vlib_cli_output (vm, "NAT64 %U BIB entries:", format_nat_protocol, proto); - /* *INDENT-OFF* */ vec_foreach (db, nm->db) nat64_db_bib_walk (db, p, nat64_cli_bib_walk, vm); - /* *INDENT-ON* */ done: unformat_free (line_input); @@ -586,13 +584,11 @@ nat64_show_st_command_fn (vlib_main_t * vm, vlib_cli_output (vm, "NAT64 sessions:"); else vlib_cli_output (vm, "NAT64 %U sessions:", format_nat_protocol, proto); - /* *INDENT-OFF* */ vec_foreach (db, nm->db) { ctx.db = db; nat64_db_st_walk (db, p, nat64_cli_st_walk, &ctx); } - /* *INDENT-ON* */ done: unformat_free (line_input); @@ -775,7 +771,6 @@ done: return error; } -/* *INDENT-OFF* */ /*? * @cliexpar * @cliexstart{nat64 plugin} @@ -983,7 +978,6 @@ VLIB_CLI_COMMAND (nat64_add_interface_address_command, static) = { .short_help = "nat64 add interface address [del]", .function = nat64_add_interface_address_command_fn, }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/nat/nat64/nat64_db.c b/src/plugins/nat/nat64/nat64_db.c index 24f7f571c01..e4e9febcb12 100644 --- a/src/plugins/nat/nat64/nat64_db.c +++ b/src/plugins/nat/nat64/nat64_db.c @@ -54,13 +54,11 @@ nat64_db_free (nat64_db_t * db) clib_bihash_free_48_8 (&db->st.in2out); clib_bihash_free_48_8 (&db->st.out2in); -/* *INDENT-OFF* */ #define _(N, i, n, s) \ pool_free (db->bib._##n##_bib); \ pool_free (db->st._##n##_st); foreach_nat_protocol #undef _ -/* *INDENT-ON* */ pool_free (db->bib._unk_proto_bib); pool_free (db->st._unk_proto_st); @@ -89,7 +87,6 @@ nat64_db_bib_entry_create (u32 thread_index, nat64_db_t * db, /* create pool entry */ switch (ip_proto_to_nat_proto (proto)) { -/* *INDENT-OFF* */ #define _(N, i, n, s) \ case NAT_PROTOCOL_##N: \ pool_get (db->bib._##n##_bib, bibe); \ @@ -97,7 +94,6 @@ nat64_db_bib_entry_create (u32 thread_index, nat64_db_t * db, break; foreach_nat_protocol #undef _ -/* *INDENT-ON* */ default: pool_get (db->bib._unk_proto_bib, bibe); kv.value = bibe - db->bib._unk_proto_bib; @@ -155,7 +151,6 @@ nat64_db_bib_entry_free (u32 thread_index, nat64_db_t * db, switch (ip_proto_to_nat_proto (bibe->proto)) { -/* *INDENT-OFF* */ #define _(N, i, n, s) \ case NAT_PROTOCOL_##N: \ bib = db->bib._##n##_bib; \ @@ -163,7 +158,6 @@ nat64_db_bib_entry_free (u32 thread_index, nat64_db_t * db, break; foreach_nat_protocol #undef _ -/* *INDENT-ON* */ default: bib = db->bib._unk_proto_bib; st = db->st._unk_proto_st; @@ -232,14 +226,12 @@ nat64_db_bib_entry_find (nat64_db_t * db, ip46_address_t * addr, u16 port, switch (ip_proto_to_nat_proto (proto)) { -/* *INDENT-OFF* */ #define _(N, i, n, s) \ case NAT_PROTOCOL_##N: \ bib = db->bib._##n##_bib; \ break; foreach_nat_protocol #undef _ -/* *INDENT-ON* */ default: bib = db->bib._unk_proto_bib; break; @@ -271,7 +263,6 @@ nat64_db_bib_walk (nat64_db_t * db, u8 proto, if (proto == 255) { - /* *INDENT-OFF* */ #define _(N, i, n, s) \ bib = db->bib._##n##_bib; \ pool_foreach (bibe, bib) { \ @@ -285,32 +276,27 @@ nat64_db_bib_walk (nat64_db_t * db, u8 proto, if (fn (bibe, ctx)) return; } - /* *INDENT-ON* */ } else { switch (ip_proto_to_nat_proto (proto)) { - /* *INDENT-OFF* */ #define _(N, i, n, s) \ case NAT_PROTOCOL_##N: \ bib = db->bib._##n##_bib; \ break; foreach_nat_protocol #undef _ - /* *INDENT-ON* */ default: bib = db->bib._unk_proto_bib; break; } - /* *INDENT-OFF* */ pool_foreach (bibe, bib) { if (fn (bibe, ctx)) return; } - /* *INDENT-ON* */ } } @@ -321,14 +307,12 @@ nat64_db_bib_entry_by_index (nat64_db_t * db, u8 proto, u32 bibe_index) switch (ip_proto_to_nat_proto (proto)) { -/* *INDENT-OFF* */ #define _(N, i, n, s) \ case NAT_PROTOCOL_##N: \ bib = db->bib._##n##_bib; \ break; foreach_nat_protocol #undef _ -/* *INDENT-ON* */ default: bib = db->bib._unk_proto_bib; break; @@ -345,7 +329,6 @@ nat64_db_st_walk (nat64_db_t * db, u8 proto, if (proto == 255) { - /* *INDENT-OFF* */ #define _(N, i, n, s) \ st = db->st._##n##_st; \ pool_foreach (ste, st) { \ @@ -359,32 +342,27 @@ nat64_db_st_walk (nat64_db_t * db, u8 proto, if (fn (ste, ctx)) return; } - /* *INDENT-ON* */ } else { switch (ip_proto_to_nat_proto (proto)) { - /* *INDENT-OFF* */ #define _(N, i, n, s) \ case NAT_PROTOCOL_##N: \ st = db->st._##n##_st; \ break; foreach_nat_protocol #undef _ - /* *INDENT-ON* */ default: st = db->st._unk_proto_st; break; } - /* *INDENT-OFF* */ pool_foreach (ste, st) { if (fn (ste, ctx)) return; } - /* *INDENT-ON* */ } } @@ -408,7 +386,6 @@ nat64_db_st_entry_create (u32 thread_index, nat64_db_t * db, /* create pool entry */ switch (ip_proto_to_nat_proto (bibe->proto)) { -/* *INDENT-OFF* */ #define _(N, i, n, s) \ case NAT_PROTOCOL_##N: \ pool_get (db->st._##n##_st, ste); \ @@ -417,7 +394,6 @@ nat64_db_st_entry_create (u32 thread_index, nat64_db_t * db, break; foreach_nat_protocol #undef _ -/* *INDENT-ON* */ default: pool_get (db->st._unk_proto_st, ste); kv.value = ste - db->st._unk_proto_st; @@ -494,7 +470,6 @@ nat64_db_st_entry_free (u32 thread_index, switch (ip_proto_to_nat_proto (ste->proto)) { -/* *INDENT-OFF* */ #define _(N, i, n, s) \ case NAT_PROTOCOL_##N: \ st = db->st._##n##_st; \ @@ -502,7 +477,6 @@ nat64_db_st_entry_free (u32 thread_index, break; foreach_nat_protocol #undef _ -/* *INDENT-ON* */ default: st = db->st._unk_proto_st; bib = db->bib._unk_proto_bib; @@ -579,14 +553,12 @@ nat64_db_st_entry_find (nat64_db_t * db, ip46_address_t * l_addr, switch (ip_proto_to_nat_proto (proto)) { -/* *INDENT-OFF* */ #define _(N, i, n, s) \ case NAT_PROTOCOL_##N: \ st = db->st._##n##_st; \ break; foreach_nat_protocol #undef _ -/* *INDENT-ON* */ default: st = db->st._unk_proto_st; break; @@ -622,14 +594,12 @@ nat64_db_st_entry_get_index (nat64_db_t * db, nat64_db_st_entry_t * ste) switch (ip_proto_to_nat_proto (ste->proto)) { -/* *INDENT-OFF* */ #define _(N, i, n, s) \ case NAT_PROTOCOL_##N: \ st = db->st._##n##_st; \ break; foreach_nat_protocol #undef _ -/* *INDENT-ON* */ default: st = db->st._unk_proto_st; return (u32) ~ 0; @@ -645,14 +615,12 @@ nat64_db_st_entry_by_index (nat64_db_t * db, u8 proto, u32 ste_index) switch (ip_proto_to_nat_proto (proto)) { -/* *INDENT-OFF* */ #define _(N, i, n, s) \ case NAT_PROTOCOL_##N: \ st = db->st._##n##_st; \ break; foreach_nat_protocol #undef _ -/* *INDENT-ON* */ default: st = db->st._unk_proto_st; break; @@ -667,7 +635,6 @@ nad64_db_st_free_expired (u32 thread_index, nat64_db_t * db, u32 now) u32 *ste_to_be_free = 0, *ste_index; nat64_db_st_entry_t *st, *ste; -/* *INDENT-OFF* */ #define _(N, i, n, s) \ st = db->st._##n##_st; \ pool_foreach (ste, st) {\ @@ -692,7 +659,6 @@ nad64_db_st_free_expired (u32 thread_index, nat64_db_t * db, u32 now) nat64_db_st_entry_free (thread_index, db, pool_elt_at_index(st, ste_index[0])); vec_free (ste_to_be_free); -/* *INDENT-ON* */ } void @@ -704,7 +670,6 @@ nat64_db_free_out_addr (u32 thread_index, nat64_db_bib_entry_t *bibe; db->addr_free = 1; -/* *INDENT-OFF* */ #define _(N, i, n, s) \ st = db->st._##n##_st; \ pool_foreach (ste, st) { \ @@ -730,7 +695,6 @@ nat64_db_free_out_addr (u32 thread_index, pool_elt_at_index(st, ste_index[0])); vec_free (ste_to_be_free); db->addr_free = 0; -/* *INDENT-ON* */ } /* diff --git a/src/plugins/nat/nat64/nat64_db.h b/src/plugins/nat/nat64/nat64_db.h index c34b671999a..a7d433fb8ea 100644 --- a/src/plugins/nat/nat64/nat64_db.h +++ b/src/plugins/nat/nat64/nat64_db.h @@ -47,7 +47,6 @@ typedef struct }; } nat64_db_bib_entry_key_t; -/* *INDENT-OFF* */ typedef CLIB_PACKED(struct { ip6_address_t in_addr; @@ -59,17 +58,14 @@ typedef CLIB_PACKED(struct u8 proto; u8 is_static; }) nat64_db_bib_entry_t; -/* *INDENT-ON* */ typedef struct { /* BIBs */ -/* *INDENT-OFF* */ #define _(N, i, n, s) \ nat64_db_bib_entry_t *_##n##_bib; foreach_nat_protocol #undef _ -/* *INDENT-ON* */ nat64_db_bib_entry_t *_unk_proto_bib; /* BIB lookup */ @@ -98,7 +94,6 @@ typedef struct }; } nat64_db_st_entry_key_t; -/* *INDENT-OFF* */ typedef CLIB_PACKED(struct { ip6_address_t in_r_addr; @@ -109,17 +104,14 @@ typedef CLIB_PACKED(struct u8 proto; u8 tcp_state; }) nat64_db_st_entry_t; -/* *INDENT-ON* */ typedef struct { /* session tables */ -/* *INDENT-OFF* */ #define _(N, i, n, s) \ nat64_db_st_entry_t *_##n##_st; foreach_nat_protocol #undef _ -/* *INDENT-ON* */ nat64_db_st_entry_t *_unk_proto_st; /* session lookup */ diff --git a/src/plugins/nat/nat64/nat64_in2out.c b/src/plugins/nat/nat64/nat64_in2out.c index 52d3c7f0a3b..63eab72a7fb 100644 --- a/src/plugins/nat/nat64/nat64_in2out.c +++ b/src/plugins/nat/nat64/nat64_in2out.c @@ -86,14 +86,12 @@ nat64_not_translate (u32 sw_if_index, ip6_address_t ip6_addr) ip_lookup_main_t *lm6 = &im6->lookup_main; ip_interface_address_t *ia = 0; - /* *INDENT-OFF* */ foreach_ip_interface_address (lm6, ia, sw_if_index, 0, ({ addr = ip_interface_address_get_address (lm6, ia); if (0 == ip6_address_compare (addr, &ip6_addr)) return 1; })); - /* *INDENT-ON* */ return 0; } @@ -744,7 +742,6 @@ nat64_in2out_tcp_udp_hairpinning (vlib_main_t * vm, vlib_buffer_t * b, daddr.ip4.as_u32 = ste->out_r_addr.as_u32; bibe = 0; - /* *INDENT-OFF* */ vec_foreach (db, nm->db) { bibe = nat64_db_bib_entry_find (db, &daddr, dport, proto, 0, 0); @@ -752,7 +749,6 @@ nat64_in2out_tcp_udp_hairpinning (vlib_main_t * vm, vlib_buffer_t * b, if (bibe) break; } - /* *INDENT-ON* */ if (!bibe) return -1; @@ -851,7 +847,6 @@ nat64_in2out_icmp_hairpinning (vlib_main_t * vm, vlib_buffer_t * b, daddr.ip4.as_u32 = bibe->out_addr.as_u32; ste = 0; - /* *INDENT-OFF* */ vec_foreach (db, nm->db) { ste = nat64_db_st_entry_find (db, &saddr, &daddr, sport, dport, proto, @@ -860,7 +855,6 @@ nat64_in2out_icmp_hairpinning (vlib_main_t * vm, vlib_buffer_t * b, if (ste) break; } - /* *INDENT-ON* */ if (!ste) return -1; @@ -1006,7 +1000,6 @@ nat64_in2out_unk_proto_hairpinning (vlib_main_t * vm, vlib_buffer_t * b, daddr.ip4.as_u32 = ste->out_r_addr.as_u32; bibe = 0; - /* *INDENT-OFF* */ vec_foreach (db, nm->db) { bibe = nat64_db_bib_entry_find (db, &daddr, 0, proto, 0, 0); @@ -1014,7 +1007,6 @@ nat64_in2out_unk_proto_hairpinning (vlib_main_t * vm, vlib_buffer_t * b, if (bibe) break; } - /* *INDENT-ON* */ if (!bibe) return -1; @@ -1226,7 +1218,6 @@ VLIB_NODE_FN (nat64_in2out_node) (vlib_main_t * vm, return nat64_in2out_node_fn_inline (vm, node, frame, 0); } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat64_in2out_node) = { .name = "nat64-in2out", .vector_size = sizeof (u32), @@ -1243,7 +1234,6 @@ VLIB_REGISTER_NODE (nat64_in2out_node) = { [NAT64_IN2OUT_NEXT_SLOWPATH] = "nat64-in2out-slowpath", }, }; -/* *INDENT-ON* */ VLIB_NODE_FN (nat64_in2out_slowpath_node) (vlib_main_t * vm, vlib_node_runtime_t * node, @@ -1252,7 +1242,6 @@ VLIB_NODE_FN (nat64_in2out_slowpath_node) (vlib_main_t * vm, return nat64_in2out_node_fn_inline (vm, node, frame, 1); } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat64_in2out_slowpath_node) = { .name = "nat64-in2out-slowpath", .vector_size = sizeof (u32), @@ -1269,7 +1258,6 @@ VLIB_REGISTER_NODE (nat64_in2out_slowpath_node) = { [NAT64_IN2OUT_NEXT_SLOWPATH] = "nat64-in2out-slowpath", }, }; -/* *INDENT-ON* */ typedef struct nat64_in2out_frag_set_ctx_t_ { @@ -1384,7 +1372,6 @@ VLIB_NODE_FN (nat64_in2out_handoff_node) (vlib_main_t * vm, return frame->n_vectors; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat64_in2out_handoff_node) = { .name = "nat64-in2out-handoff", .vector_size = sizeof (u32), @@ -1399,7 +1386,6 @@ VLIB_REGISTER_NODE (nat64_in2out_handoff_node) = { [0] = "error-drop", }, }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/nat/nat64/nat64_out2in.c b/src/plugins/nat/nat64/nat64_out2in.c index 7cc2d3d3b70..a8faead4470 100644 --- a/src/plugins/nat/nat64/nat64_out2in.c +++ b/src/plugins/nat/nat64/nat64_out2in.c @@ -639,7 +639,6 @@ VLIB_NODE_FN (nat64_out2in_node) (vlib_main_t * vm, return frame->n_vectors; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat64_out2in_node) = { .name = "nat64-out2in", .vector_size = sizeof (u32), @@ -655,7 +654,6 @@ VLIB_REGISTER_NODE (nat64_out2in_node) = { [NAT64_OUT2IN_NEXT_IP4_LOOKUP] = "ip4-lookup", }, }; -/* *INDENT-ON* */ typedef struct nat64_out2in_frag_set_ctx_t_ { @@ -769,7 +767,6 @@ VLIB_NODE_FN (nat64_out2in_handoff_node) (vlib_main_t * vm, return frame->n_vectors; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat64_out2in_handoff_node) = { .name = "nat64-out2in-handoff", .vector_size = sizeof (u32), @@ -784,7 +781,6 @@ VLIB_REGISTER_NODE (nat64_out2in_handoff_node) = { [0] = "error-drop", }, }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/nat/nat66/nat66_in2out.c b/src/plugins/nat/nat66/nat66_in2out.c index 356100f89ef..aa2229e1997 100644 --- a/src/plugins/nat/nat66/nat66_in2out.c +++ b/src/plugins/nat/nat66/nat66_in2out.c @@ -94,14 +94,12 @@ nat66_not_translate (u32 rx_fib_index, ip6_address_t ip6_addr) sw_if_index = fib_entry_get_resolving_interface (fei); } - /* *INDENT-OFF* */ pool_foreach (i, nm->interfaces) { /* NAT packet aimed at outside interface */ if (nat66_interface_is_outside (i) && sw_if_index == i->sw_if_index) return 0; } - /* *INDENT-ON* */ return 1; } @@ -235,7 +233,6 @@ VLIB_NODE_FN (nat66_in2out_node) (vlib_main_t * vm, return frame->n_vectors; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat66_in2out_node) = { .name = "nat66-in2out", .vector_size = sizeof (u32), @@ -250,7 +247,6 @@ VLIB_REGISTER_NODE (nat66_in2out_node) = { [NAT66_IN2OUT_NEXT_IP6_LOOKUP] = "ip6-lookup", }, }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/nat/nat66/nat66_out2in.c b/src/plugins/nat/nat66/nat66_out2in.c index 9d44b4880eb..820e0c79033 100644 --- a/src/plugins/nat/nat66/nat66_out2in.c +++ b/src/plugins/nat/nat66/nat66_out2in.c @@ -193,7 +193,6 @@ VLIB_NODE_FN (nat66_out2in_node) (vlib_main_t * vm, return frame->n_vectors; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (nat66_out2in_node) = { .name = "nat66-out2in", .vector_size = sizeof (u32), @@ -208,7 +207,6 @@ VLIB_REGISTER_NODE (nat66_out2in_node) = { [NAT66_OUT2IN_NEXT_IP6_LOOKUP] = "ip6-lookup", }, }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON -- cgit 1.2.3-korg