diff options
author | Damjan Marion <damarion@cisco.com> | 2024-03-12 17:42:49 +0100 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2024-03-12 19:29:56 +0000 |
commit | c3148b1be8f519c80c4417c21b978dfef72b351b (patch) | |
tree | 2511eb86e5c429ab018716fed0366164e6faf679 /src/plugins/ikev2 | |
parent | e2ed59933153d665ee43add2de03a581627b73fa (diff) |
misc: remove GNU Indent directives
Type: refactor
Change-Id: I5235bf3e9aff58af6ba2c14e8c6529c4fc9ec86c
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/ikev2')
-rw-r--r-- | src/plugins/ikev2/ikev2.c | 39 | ||||
-rw-r--r-- | src/plugins/ikev2/ikev2.h | 10 | ||||
-rw-r--r-- | src/plugins/ikev2/ikev2_api.c | 12 | ||||
-rw-r--r-- | src/plugins/ikev2/ikev2_cli.c | 20 | ||||
-rw-r--r-- | src/plugins/ikev2/ikev2_payload.c | 12 |
5 files changed, 0 insertions, 93 deletions
diff --git a/src/plugins/ikev2/ikev2.c b/src/plugins/ikev2/ikev2.c index 4ee2f60b085..d559565487e 100644 --- a/src/plugins/ikev2/ikev2.c +++ b/src/plugins/ikev2/ikev2.c @@ -1110,7 +1110,6 @@ ikev2_initial_contact_cleanup_internal (ikev2_main_per_thread_data_t * ptd, ikev2_child_sa_t *c; /* find old IKE SAs with the same authenticated identity */ - /* *INDENT-OFF* */ pool_foreach (tmp, ptd->sas) { if (!ikev2_is_id_equal (&tmp->i_id, &sa->i_id) || !ikev2_is_id_equal(&tmp->r_id, &sa->r_id)) @@ -1119,7 +1118,6 @@ ikev2_initial_contact_cleanup_internal (ikev2_main_per_thread_data_t * ptd, if (sa->rspi != tmp->rspi) vec_add1(delete, tmp - ptd->sas); } - /* *INDENT-ON* */ for (i = 0; i < vec_len (delete); i++) { @@ -1831,7 +1829,6 @@ ikev2_sa_match_ts (ikev2_sa_t * sa) ikev2_ts_t *ts, *p_tsi, *p_tsr, *tsi = 0, *tsr = 0; ikev2_id_t *id_rem, *id_loc; - /* *INDENT-OFF* */ pool_foreach (p, km->profiles) { if (sa->is_initiator) @@ -1874,7 +1871,6 @@ ikev2_sa_match_ts (ikev2_sa_t * sa) break; } - /* *INDENT-ON* */ if (tsi && tsr) { @@ -2486,14 +2482,12 @@ ikev2_del_tunnel_from_main (ikev2_del_ipsec_tunnel_args_t * a) if (~0 == a->sw_if_index) { - /* *INDENT-OFF* */ ipip_tunnel_key_t key = { .src = a->local_ip, .dst = a->remote_ip, .transport = IPIP_TRANSPORT_IP4, .fib_index = 0, }; - /* *INDENT-ON* */ ipip = ipip_tunnel_db_find (&key); @@ -3013,13 +3007,11 @@ ikev2_retransmit_sa_init (ike_header_t * ike, ip_address_t iaddr, u32 res; ikev2_main_per_thread_data_t *ptd = ikev2_get_per_thread_data (); - /* *INDENT-OFF* */ pool_foreach (sa, ptd->sas) { res = ikev2_retransmit_sa_init_one (sa, ike, iaddr, raddr, rlen); if (res) return res; } - /* *INDENT-ON* */ /* req is not retransmit */ return 0; @@ -3766,7 +3758,6 @@ ikev2_ip6 (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) return ikev2_node_internal (vm, node, frame, 0 /* is_ip4 */, 0); } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (ikev2_node_ip4,static) = { .function = ikev2_ip4, .name = "ikev2-ip4", @@ -3817,7 +3808,6 @@ VLIB_REGISTER_NODE (ikev2_node_ip6,static) = { [IKEV2_NEXT_IP6_ERROR_DROP] = "error-drop", }, }; -/* *INDENT-ON* */ // set ikev2 proposals when vpp is used as initiator static clib_error_t * @@ -4159,12 +4149,10 @@ ikev2_cleanup_profile_sessions (ikev2_main_t * km, ikev2_profile_t * p) u32 *sai; u32 *del_sai = 0; - /* *INDENT-OFF* */ pool_foreach (sa, km->sais) { if (pi == sa->profile_index) vec_add1 (del_sai, sa - km->sais); } - /* *INDENT-ON* */ vec_foreach (sai, del_sai) { @@ -4177,12 +4165,10 @@ ikev2_cleanup_profile_sessions (ikev2_main_t * km, ikev2_profile_t * p) vec_foreach (tkm, km->per_thread_data) { - /* *INDENT-OFF* */ pool_foreach (sa, tkm->sas) { if (sa->profile_index != ~0 && pi == sa->profile_index) vec_add1 (del_sai, sa - tkm->sas); } - /* *INDENT-ON* */ vec_foreach (sai, del_sai) { @@ -4914,7 +4900,6 @@ ikev2_initiate_delete_child_sa (vlib_main_t * vm, u32 ispi) ikev2_sa_t *sa; if (fchild) break; - /* *INDENT-OFF* */ pool_foreach (sa, tkm->sas) { fchild = ikev2_sa_get_child(sa, ispi, IKEV2_PROTOCOL_ESP, 1); if (fchild) @@ -4923,7 +4908,6 @@ ikev2_initiate_delete_child_sa (vlib_main_t * vm, u32 ispi) break; } } - /* *INDENT-ON* */ } if (!fchild || !fsa) @@ -4954,7 +4938,6 @@ ikev2_initiate_delete_ike_sa (vlib_main_t * vm, u64 ispi) ikev2_sa_t *sa; if (fsa) break; - /* *INDENT-OFF* */ pool_foreach (sa, tkm->sas) { if (sa->ispi == ispi) { @@ -4963,7 +4946,6 @@ ikev2_initiate_delete_ike_sa (vlib_main_t * vm, u64 ispi) break; } } - /* *INDENT-ON* */ } if (!fsa) @@ -5039,7 +5021,6 @@ ikev2_initiate_rekey_child_sa (vlib_main_t * vm, u32 ispi) ikev2_sa_t *sa; if (fchild) break; - /* *INDENT-OFF* */ pool_foreach (sa, tkm->sas) { fchild = ikev2_sa_get_child(sa, ispi, IKEV2_PROTOCOL_ESP, 1); if (fchild) @@ -5048,7 +5029,6 @@ ikev2_initiate_rekey_child_sa (vlib_main_t * vm, u32 ispi) break; } } - /* *INDENT-ON* */ } if (!fchild || !fsa) @@ -5081,12 +5061,10 @@ ikev2_sa_del (ikev2_profile_t * p, u32 sw_if_index) vec_foreach (tkm, km->per_thread_data) { - /* *INDENT-OFF* */ pool_foreach (sa, tkm->sas) { if (ikev2_sa_sw_if_match (sa, sw_if_index)) vec_add1 (sa_vec, sa); } - /* *INDENT-ON* */ vec_foreach (sap, sa_vec) { @@ -5096,12 +5074,10 @@ ikev2_sa_del (ikev2_profile_t * p, u32 sw_if_index) } vec_free (sa_vec); - /* *INDENT-OFF* */ pool_foreach (sa, km->sais) { if (ikev2_sa_sw_if_match (sa, sw_if_index)) vec_add1 (ispi_vec, sa->ispi); } - /* *INDENT-ON* */ vec_foreach (ispi, ispi_vec) { @@ -5120,12 +5096,10 @@ ikev2_sw_interface_add_del (vnet_main_t * vnm, u32 sw_if_index, u32 is_add) if (is_add) return 0; - /* *INDENT-OFF* */ pool_foreach (p, km->profiles) { if (p->responder.sw_if_index == sw_if_index) ikev2_sa_del (p, sw_if_index); } - /* *INDENT-ON* */ return 0; } @@ -5151,11 +5125,9 @@ ikev2_init (vlib_main_t * vm) return 0; } -/* *INDENT-OFF* */ VLIB_INIT_FUNCTION (ikev2_init) = { .runs_after = VLIB_INITS ("ipsec_init", "ipsec_punt_init"), }; -/* *INDENT-ON* */ static u8 ikev2_mngr_process_child_sa (ikev2_sa_t * sa, ikev2_child_sa_t * csa, @@ -5226,14 +5198,12 @@ ikev2_mngr_process_child_sa (ikev2_sa_t * sa, ikev2_child_sa_t * csa, ip_addr_bytes (&sa->iaddr)); } - /* *INDENT-OFF* */ ipip_tunnel_key_t key = { .src = local_ip, .dst = remote_ip, .transport = IPIP_TRANSPORT_IP4, .fib_index = 0, }; - /* *INDENT-ON* */ ipip = ipip_tunnel_db_find (&key); @@ -5314,7 +5284,6 @@ ikev2_mngr_process_ipsec_sa (ipsec_sa_t * ipsec_sa) ikev2_sa_t *sa; if (fchild) break; - /* *INDENT-OFF* */ pool_foreach (sa, tkm->sas) { fchild = ikev2_sa_get_child(sa, ipsec_sa->spi, IKEV2_PROTOCOL_ESP, 1); if (fchild) @@ -5323,7 +5292,6 @@ ikev2_mngr_process_ipsec_sa (ipsec_sa_t * ipsec_sa) break; } } - /* *INDENT-ON* */ } vlib_get_combined_counter (&ipsec_sa_counters, ipsec_sa->stat_index, &counts); @@ -5421,7 +5389,6 @@ ikev2_process_pending_sa_init (vlib_main_t *vm, ikev2_main_t *km) u64 ispi; ikev2_sa_t *sa; - /* *INDENT-OFF* */ hash_foreach (ispi, sai, km->sa_by_ispi, ({ sa = pool_elt_at_index (km->sais, sai); @@ -5430,7 +5397,6 @@ ikev2_process_pending_sa_init (vlib_main_t *vm, ikev2_main_t *km) ikev2_process_pending_sa_init_one (vm, km, sa); })); - /* *INDENT-ON* */ } static void @@ -5535,7 +5501,6 @@ ikev2_mngr_process_fn (vlib_main_t * vm, vlib_node_runtime_t * rt, ikev2_sa_t *sa; u32 *to_be_deleted = 0; - /* *INDENT-OFF* */ pool_foreach (sa, tkm->sas) { ikev2_child_sa_t *c; u8 del_old_ids = 0; @@ -5596,19 +5561,16 @@ ikev2_mngr_process_fn (vlib_main_t * vm, vlib_node_runtime_t * rt, /* process ipsec sas */ ipsec_sa_t *sa; - /* *INDENT-OFF* */ pool_foreach (sa, ipsec_sa_pool) { ikev2_mngr_process_ipsec_sa (sa); } - /* *INDENT-ON* */ ikev2_process_pending_sa_init (vm, km); } return 0; } -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (ikev2_mngr_process_node, static) = { .function = ikev2_mngr_process_fn, .type = VLIB_NODE_TYPE_PROCESS, @@ -5670,7 +5632,6 @@ VLIB_PLUGIN_REGISTER () = { .version = VPP_BUILD_VER, .description = "Internet Key Exchange (IKEv2) Protocol", }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/ikev2/ikev2.h b/src/plugins/ikev2/ikev2.h index 020a3f01e5f..9ed0ecc494c 100644 --- a/src/plugins/ikev2/ikev2.h +++ b/src/plugins/ikev2/ikev2.h @@ -32,7 +32,6 @@ typedef u8 v8; -/* *INDENT-OFF* */ typedef CLIB_PACKED (struct { u64 ispi; u64 rspi; @@ -42,14 +41,12 @@ typedef CLIB_PACKED (struct { u8 flags; u32 msgid; u32 length; u8 payload[0]; }) ike_header_t; -/* *INDENT-ON* */ #define ike_hdr_is_response(_h) ((_h)->flags & IKEV2_HDR_FLAG_RESPONSE) #define ike_hdr_is_request(_h) (!ike_hdr_is_response(_h)) #define ike_hdr_is_initiator(_h) ((_h)->flags & IKEV2_HDR_FLAG_INITIATOR) #define ike_hdr_is_responder(_h) (!(ike_hdr_is_initiator(_h))) -/* *INDENT-OFF* */ typedef CLIB_PACKED (struct { u8 nextpayload; u8 flags; @@ -58,17 +55,13 @@ typedef CLIB_PACKED (struct { u8 reserved[2]; u8 payload[0]; }) ike_ke_payload_header_t; -/* *INDENT-ON* */ -/* *INDENT-OFF* */ typedef CLIB_PACKED (struct { u8 nextpayload; u8 flags; u16 length; u8 payload[0]; }) ike_payload_header_t; -/* *INDENT-ON* */ -/* *INDENT-OFF* */ typedef CLIB_PACKED (struct { u8 nextpayload; u8 flags; @@ -77,9 +70,7 @@ typedef CLIB_PACKED (struct { u8 reserved[3]; u8 payload[0]; }) ike_auth_payload_header_t; -/* *INDENT-ON* */ -/* *INDENT-OFF* */ typedef CLIB_PACKED (struct { u8 nextpayload; u8 flags; @@ -87,7 +78,6 @@ typedef CLIB_PACKED (struct { u8 id_type; u8 reserved[3]; u8 payload[0]; }) ike_id_payload_header_t; -/* *INDENT-ON* */ #define IKE_VERSION_2 0x20 diff --git a/src/plugins/ikev2/ikev2_api.c b/src/plugins/ikev2/ikev2_api.c index 975212d4f92..bb44e9f364f 100644 --- a/src/plugins/ikev2/ikev2_api.c +++ b/src/plugins/ikev2/ikev2_api.c @@ -188,12 +188,10 @@ vl_api_ikev2_profile_dump_t_handler (vl_api_ikev2_profile_dump_t * mp) if (!reg) return; - /* *INDENT-OFF* */ pool_foreach (profile, im->profiles) { send_profile (profile, reg, mp->context); } - /* *INDENT-ON* */ } static void @@ -240,7 +238,6 @@ send_sa (ikev2_sa_t * sa, vl_api_ikev2_sa_dump_t * mp, u32 api_sa_index) int rv = 0; ikev2_sa_transform_t *tr; - /* *INDENT-OFF* */ REPLY_MACRO2_ZERO (VL_API_IKEV2_SA_DETAILS, { vl_api_ikev2_sa_t *rsa = &rmp->sa; @@ -296,7 +293,6 @@ send_sa (ikev2_sa_t * sa, vl_api_ikev2_sa_dump_t * mp, u32 api_sa_index) vl_api_ikev2_sa_t_endian(rsa); }); - /* *INDENT-ON* */ } static void @@ -308,14 +304,12 @@ vl_api_ikev2_sa_dump_t_handler (vl_api_ikev2_sa_dump_t * mp) vec_foreach (tkm, km->per_thread_data) { - /* *INDENT-OFF* */ pool_foreach (sa, tkm->sas) { u32 api_sa_index = ikev2_encode_sa_index (sa - tkm->sas, tkm - km->per_thread_data); send_sa (sa, mp, api_sa_index); } - /* *INDENT-ON* */ } } @@ -419,7 +413,6 @@ send_child_sa (ikev2_child_sa_t * child, int rv = 0; ikev2_sa_transform_t *tr; - /* *INDENT-OFF* */ REPLY_MACRO2_ZERO (VL_API_IKEV2_CHILD_SA_DETAILS, { vl_api_ikev2_keys_t *k = &rmp->child_sa.keys; @@ -464,7 +457,6 @@ send_child_sa (ikev2_child_sa_t * child, vl_api_ikev2_child_sa_t_endian (&rmp->child_sa); }); - /* *INDENT-ON* */ } static void @@ -530,7 +522,6 @@ static void vl_api_ikev2_traffic_selector_details_t *rmp = 0; int rv = 0; - /* *INDENT-OFF* */ REPLY_MACRO2_ZERO (VL_API_IKEV2_TRAFFIC_SELECTOR_DETAILS, { rmp->ts.sa_index = api_sa_index; @@ -538,7 +529,6 @@ static void cp_ts (&rmp->ts, ts, mp->is_initiator); vl_api_ikev2_ts_t_endian (&rmp->ts); }); - /* *INDENT-ON* */ } } @@ -567,13 +557,11 @@ vl_api_ikev2_nonce_get_t_handler (vl_api_ikev2_nonce_get_t * mp) int data_len = vec_len (nonce); int rv = 0; - /* *INDENT-OFF* */ REPLY_MACRO3_ZERO (VL_API_IKEV2_NONCE_GET_REPLY, data_len, { rmp->data_len = clib_host_to_net_u32 (data_len); clib_memcpy (rmp->nonce, nonce, data_len); }); - /* *INDENT-ON* */ } static void diff --git a/src/plugins/ikev2/ikev2_cli.c b/src/plugins/ikev2/ikev2_cli.c index e5516f834f4..733ae478b83 100644 --- a/src/plugins/ikev2/ikev2_cli.c +++ b/src/plugins/ikev2/ikev2_cli.c @@ -250,7 +250,6 @@ show_ikev2_sa_command_fn (vlib_main_t * vm, vec_foreach (tkm, km->per_thread_data) { - /* *INDENT-OFF* */ pool_foreach (sa, tkm->sas) { if (show_one) { @@ -263,7 +262,6 @@ show_ikev2_sa_command_fn (vlib_main_t * vm, else s = format (s, "%U\n", format_ikev2_sa, sa, details); } - /* *INDENT-ON* */ } vlib_cli_output (vm, "%v", s); @@ -271,13 +269,11 @@ show_ikev2_sa_command_fn (vlib_main_t * vm, return 0; } -/* *INDENT-OFF* */ VLIB_CLI_COMMAND (show_ikev2_sa_command, static) = { .path = "show ikev2 sa", .short_help = "show ikev2 sa [rspi <rspi>] [details]", .function = show_ikev2_sa_command_fn, }; -/* *INDENT-ON* */ static clib_error_t * ikev2_disable_dpd_command_fn (vlib_main_t * vm, @@ -288,13 +284,11 @@ ikev2_disable_dpd_command_fn (vlib_main_t * vm, return 0; } -/* *INDENT-OFF* */ VLIB_CLI_COMMAND (ikev2_cli_disable_dpd_command, static) = { .path = "ikev2 dpd disable", .short_help = "ikev2 dpd disable", .function = ikev2_disable_dpd_command_fn, }; -/* *INDENT-ON* */ static uword unformat_ikev2_token (unformat_input_t * input, va_list * va) @@ -571,7 +565,6 @@ done: return r; } -/* *INDENT-OFF* */ VLIB_CLI_COMMAND (ikev2_profile_add_del_command, static) = { .path = "ikev2 profile", .short_help = @@ -592,7 +585,6 @@ VLIB_CLI_COMMAND (ikev2_profile_add_del_command, static) = { "ikev2 profile set <id> disable natt\n", .function = ikev2_profile_add_del_command_fn, }; -/* *INDENT-ON* */ static clib_error_t * show_ikev2_profile_command_fn (vlib_main_t * vm, @@ -602,7 +594,6 @@ show_ikev2_profile_command_fn (vlib_main_t * vm, ikev2_main_t *km = &ikev2_main; ikev2_profile_t *p; - /* *INDENT-OFF* */ pool_foreach (p, km->profiles) { vlib_cli_output(vm, "profile %v", p->name); @@ -669,18 +660,15 @@ show_ikev2_profile_command_fn (vlib_main_t * vm, vlib_cli_output(vm, " lifetime %d jitter %d handover %d maxdata %d", p->lifetime, p->lifetime_jitter, p->handover, p->lifetime_maxdata); } - /* *INDENT-ON* */ return 0; } -/* *INDENT-OFF* */ VLIB_CLI_COMMAND (show_ikev2_profile_command, static) = { .path = "show ikev2 profile", .short_help = "show ikev2 profile", .function = show_ikev2_profile_command_fn, }; -/* *INDENT-ON* */ static clib_error_t * set_ikev2_liveness_period_fn (vlib_main_t * vm, @@ -713,13 +701,11 @@ done: return r; } -/* *INDENT-OFF* */ VLIB_CLI_COMMAND (set_ikev2_liveness_command, static) = { .path = "ikev2 set liveness", .short_help = "ikev2 set liveness <period> <max-retires>", .function = set_ikev2_liveness_period_fn, }; -/* *INDENT-ON* */ static clib_error_t * set_ikev2_local_key_command_fn (vlib_main_t * vm, @@ -753,14 +739,12 @@ done: return r; } -/* *INDENT-OFF* */ VLIB_CLI_COMMAND (set_ikev2_local_key_command, static) = { .path = "set ikev2 local key", .short_help = "set ikev2 local key <file>", .function = set_ikev2_local_key_command_fn, }; -/* *INDENT-ON* */ static clib_error_t * @@ -811,7 +795,6 @@ done: return r; } -/* *INDENT-OFF* */ VLIB_CLI_COMMAND (ikev2_initiate_command, static) = { .path = "ikev2 initiate", .short_help = @@ -821,7 +804,6 @@ VLIB_CLI_COMMAND (ikev2_initiate_command, static) = { "ikev2 initiate rekey-child-sa <child sa ispi>\n", .function = ikev2_initiate_command_fn, }; -/* *INDENT-ON* */ static clib_error_t * ikev2_set_log_level_command_fn (vlib_main_t * vm, @@ -851,13 +833,11 @@ done: return error; } -/* *INDENT-OFF* */ VLIB_CLI_COMMAND (ikev2_set_log_level_command, static) = { .path = "ikev2 set logging level", .function = ikev2_set_log_level_command_fn, .short_help = "ikev2 set logging level <0-5>", }; -/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/ikev2/ikev2_payload.c b/src/plugins/ikev2/ikev2_payload.c index 689c502d4a3..5801a1b3e87 100644 --- a/src/plugins/ikev2/ikev2_payload.c +++ b/src/plugins/ikev2/ikev2_payload.c @@ -24,7 +24,6 @@ #include <plugins/ikev2/ikev2.h> #include <plugins/ikev2/ikev2_priv.h> -/* *INDENT-OFF* */ typedef CLIB_PACKED (struct { u8 nextpayload; u8 flags; @@ -34,9 +33,7 @@ typedef CLIB_PACKED (struct { u16 msg_type; u8 payload[0]; }) ike_notify_payload_header_t; -/* *INDENT-ON* */ -/* *INDENT-OFF* */ typedef CLIB_PACKED (struct { ip4_address_t start_addr; ip4_address_t end_addr; @@ -55,9 +52,7 @@ typedef CLIB_PACKED (struct { u16 end_port; u8 addr_pair[0]; }) ikev2_ts_payload_entry_t; -/* *INDENT-OFF* */ -/* *INDENT-OFF* */ typedef CLIB_PACKED (struct { u8 nextpayload; u8 flags; @@ -66,9 +61,7 @@ typedef CLIB_PACKED (struct { u8 reserved[3]; ikev2_ts_payload_entry_t ts[0]; }) ike_ts_payload_header_t; -/* *INDENT-OFF* */ -/* *INDENT-OFF* */ typedef CLIB_PACKED (struct { u8 last_or_more; u8 reserved; @@ -78,9 +71,7 @@ typedef CLIB_PACKED (struct { u8 spi_size; u8 num_transforms; u32 spi[0]; }) ike_sa_proposal_data_t; -/* *INDENT-OFF* */ -/* *INDENT-OFF* */ typedef CLIB_PACKED (struct { u8 last_or_more; u8 reserved; @@ -90,9 +81,7 @@ typedef CLIB_PACKED (struct { u16 transform_id; u8 attributes[0]; }) ike_sa_transform_data_t; -/* *INDENT-OFF* */ -/* *INDENT-OFF* */ typedef CLIB_PACKED (struct { u8 nextpayload; u8 flags; @@ -102,7 +91,6 @@ typedef CLIB_PACKED (struct { u16 num_of_spi; u32 spi[0]; }) ike_delete_payload_header_t; -/* *INDENT-OFF* */ static ike_payload_header_t * ikev2_payload_add_hdr (ikev2_payload_chain_t * c, u8 payload_type, int len) |