summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeale Ranns <neale@graphiant.com>2021-02-25 08:38:58 +0000
committerMatthew Smith <mgsmith@netgate.com>2021-02-25 14:23:27 +0000
commit2d49830c7dabd3104770957724d61f8fa6998235 (patch)
tree9c3fa4801389f138b6ad0d2d554572ad17c026ab
parent28a0b0197e9894ce835ded5c641fd2a032cf673e (diff)
ipsec: ipsec.h tidy up
Type: refactor - remove the extern declaration of the nodes. keep the use of them to the files that declare them - remove duplicate declaration of ipsec_set_async_mode - remove unsued ipsec_add_feature Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: I6ce7bb4517b508a8f02b11f3bc819e1c5d539c02
-rw-r--r--src/vnet/ipsec/ah_decrypt.c19
-rw-r--r--src/vnet/ipsec/ah_encrypt.c19
-rw-r--r--src/vnet/ipsec/esp_decrypt.c23
-rw-r--r--src/vnet/ipsec/esp_encrypt.c25
-rw-r--r--src/vnet/ipsec/ipsec.c39
-rw-r--r--src/vnet/ipsec/ipsec.h17
6 files changed, 86 insertions, 56 deletions
diff --git a/src/vnet/ipsec/ah_decrypt.c b/src/vnet/ipsec/ah_decrypt.c
index 107ccd2146d..a5e277ee09f 100644
--- a/src/vnet/ipsec/ah_decrypt.c
+++ b/src/vnet/ipsec/ah_decrypt.c
@@ -473,6 +473,25 @@ VLIB_REGISTER_NODE (ah6_decrypt_node) = {
};
/* *INDENT-ON* */
+#ifndef CLIB_MARCH_VARIANT
+
+static clib_error_t *
+ah_decrypt_init (vlib_main_t *vm)
+{
+ ipsec_main_t *im = &ipsec_main;
+
+ im->ah4_dec_fq_index =
+ vlib_frame_queue_main_init (ah4_decrypt_node.index, 0);
+ im->ah6_dec_fq_index =
+ vlib_frame_queue_main_init (ah6_decrypt_node.index, 0);
+
+ return 0;
+}
+
+VLIB_INIT_FUNCTION (ah_decrypt_init);
+
+#endif
+
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vnet/ipsec/ah_encrypt.c b/src/vnet/ipsec/ah_encrypt.c
index 37dd25dc6de..a1f233cfda9 100644
--- a/src/vnet/ipsec/ah_encrypt.c
+++ b/src/vnet/ipsec/ah_encrypt.c
@@ -501,6 +501,25 @@ VLIB_REGISTER_NODE (ah6_encrypt_node) = {
};
/* *INDENT-ON* */
+#ifndef CLIB_MARCH_VARIANT
+
+static clib_error_t *
+ah_encrypt_init (vlib_main_t *vm)
+{
+ ipsec_main_t *im = &ipsec_main;
+
+ im->ah4_enc_fq_index =
+ vlib_frame_queue_main_init (ah4_encrypt_node.index, 0);
+ im->ah6_enc_fq_index =
+ vlib_frame_queue_main_init (ah6_encrypt_node.index, 0);
+
+ return 0;
+}
+
+VLIB_INIT_FUNCTION (ah_encrypt_init);
+
+#endif
+
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vnet/ipsec/esp_decrypt.c b/src/vnet/ipsec/esp_decrypt.c
index a9aa9b8b7f4..0924351a9d4 100644
--- a/src/vnet/ipsec/esp_decrypt.c
+++ b/src/vnet/ipsec/esp_decrypt.c
@@ -1568,6 +1568,29 @@ VLIB_REGISTER_NODE (esp6_decrypt_tun_post_node) = {
};
/* *INDENT-ON* */
+#ifndef CLIB_MARCH_VARIANT
+
+static clib_error_t *
+esp_decrypt_init (vlib_main_t *vm)
+{
+ ipsec_main_t *im = &ipsec_main;
+
+ im->esp4_dec_fq_index =
+ vlib_frame_queue_main_init (esp4_decrypt_node.index, 0);
+ im->esp6_dec_fq_index =
+ vlib_frame_queue_main_init (esp6_decrypt_node.index, 0);
+ im->esp4_dec_tun_fq_index =
+ vlib_frame_queue_main_init (esp4_decrypt_tun_node.index, 0);
+ im->esp6_dec_tun_fq_index =
+ vlib_frame_queue_main_init (esp6_decrypt_tun_node.index, 0);
+
+ return 0;
+}
+
+VLIB_INIT_FUNCTION (esp_decrypt_init);
+
+#endif
+
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vnet/ipsec/esp_encrypt.c b/src/vnet/ipsec/esp_encrypt.c
index c76fccc718e..8251e82d4ba 100644
--- a/src/vnet/ipsec/esp_encrypt.c
+++ b/src/vnet/ipsec/esp_encrypt.c
@@ -1478,6 +1478,31 @@ VLIB_REGISTER_NODE (esp6_no_crypto_tun_node) =
};
/* *INDENT-ON* */
+#ifndef CLIB_MARCH_VARIANT
+
+static clib_error_t *
+esp_encrypt_init (vlib_main_t *vm)
+{
+ ipsec_main_t *im = &ipsec_main;
+
+ im->esp4_enc_fq_index =
+ vlib_frame_queue_main_init (esp4_encrypt_node.index, 0);
+ im->esp6_enc_fq_index =
+ vlib_frame_queue_main_init (esp6_encrypt_node.index, 0);
+ im->esp4_enc_tun_fq_index =
+ vlib_frame_queue_main_init (esp4_encrypt_tun_node.index, 0);
+ im->esp6_enc_tun_fq_index =
+ vlib_frame_queue_main_init (esp6_encrypt_tun_node.index, 0);
+ im->esp_mpls_enc_tun_fq_index =
+ vlib_frame_queue_main_init (esp_mpls_encrypt_tun_node.index, 0);
+
+ return 0;
+}
+
+VLIB_INIT_FUNCTION (esp_encrypt_init);
+
+#endif
+
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vnet/ipsec/ipsec.c b/src/vnet/ipsec/ipsec.c
index 39f272ec30c..84d2293d482 100644
--- a/src/vnet/ipsec/ipsec.c
+++ b/src/vnet/ipsec/ipsec.c
@@ -125,17 +125,6 @@ ipsec_add_node (vlib_main_t * vm, const char *node_name,
}
void
-ipsec_add_feature (const char *arc_name,
- const char *node_name, u32 * out_feature_index)
-{
- u8 arc;
-
- arc = vnet_get_feature_arc_index (arc_name);
- ASSERT (arc != (u8) ~ 0);
- *out_feature_index = vnet_get_feature_index (arc, node_name);
-}
-
-void
ipsec_unregister_udp_port (u16 port)
{
ipsec_main_t *im = &ipsec_main;
@@ -558,34 +547,6 @@ ipsec_init (vlib_main_t * vm)
vec_validate_aligned (im->ptd, vlib_num_workers (), CLIB_CACHE_LINE_BYTES);
- im->ah4_enc_fq_index =
- vlib_frame_queue_main_init (ah4_encrypt_node.index, 0);
- im->ah4_dec_fq_index =
- vlib_frame_queue_main_init (ah4_decrypt_node.index, 0);
- im->ah6_enc_fq_index =
- vlib_frame_queue_main_init (ah6_encrypt_node.index, 0);
- im->ah6_dec_fq_index =
- vlib_frame_queue_main_init (ah6_decrypt_node.index, 0);
-
- im->esp4_enc_fq_index =
- vlib_frame_queue_main_init (esp4_encrypt_node.index, 0);
- im->esp4_dec_fq_index =
- vlib_frame_queue_main_init (esp4_decrypt_node.index, 0);
- im->esp6_enc_fq_index =
- vlib_frame_queue_main_init (esp6_encrypt_node.index, 0);
- im->esp6_dec_fq_index =
- vlib_frame_queue_main_init (esp6_decrypt_node.index, 0);
- im->esp4_enc_tun_fq_index =
- vlib_frame_queue_main_init (esp4_encrypt_tun_node.index, 0);
- im->esp6_enc_tun_fq_index =
- vlib_frame_queue_main_init (esp6_encrypt_tun_node.index, 0);
- im->esp_mpls_enc_tun_fq_index =
- vlib_frame_queue_main_init (esp_mpls_encrypt_tun_node.index, 0);
- im->esp4_dec_tun_fq_index =
- vlib_frame_queue_main_init (esp4_decrypt_tun_node.index, 0);
- im->esp6_dec_tun_fq_index =
- vlib_frame_queue_main_init (esp6_decrypt_tun_node.index, 0);
-
im->async_mode = 0;
crypto_engine_backend_register_post_node (vm);
diff --git a/src/vnet/ipsec/ipsec.h b/src/vnet/ipsec/ipsec.h
index c370fb1aed5..7e897686c66 100644
--- a/src/vnet/ipsec/ipsec.h
+++ b/src/vnet/ipsec/ipsec.h
@@ -224,19 +224,6 @@ clib_error_t *ipsec_add_del_sa_sess_cb (ipsec_main_t * im, u32 sa_index,
clib_error_t *ipsec_check_support_cb (ipsec_main_t * im, ipsec_sa_t * sa);
-extern vlib_node_registration_t ah4_encrypt_node;
-extern vlib_node_registration_t ah4_decrypt_node;
-extern vlib_node_registration_t ah6_encrypt_node;
-extern vlib_node_registration_t ah6_decrypt_node;
-extern vlib_node_registration_t esp4_encrypt_node;
-extern vlib_node_registration_t esp4_decrypt_node;
-extern vlib_node_registration_t esp6_encrypt_node;
-extern vlib_node_registration_t esp6_decrypt_node;
-extern vlib_node_registration_t esp4_encrypt_tun_node;
-extern vlib_node_registration_t esp6_encrypt_tun_node;
-extern vlib_node_registration_t esp_mpls_encrypt_tun_node;
-extern vlib_node_registration_t esp4_decrypt_tun_node;
-extern vlib_node_registration_t esp6_decrypt_tun_node;
extern vlib_node_registration_t ipsec4_tun_input_node;
extern vlib_node_registration_t ipsec6_tun_input_node;
@@ -293,10 +280,6 @@ ipsec_sa_get (u32 sa_index)
return (pool_elt_at_index (ipsec_main.sad, sa_index));
}
-void ipsec_add_feature (const char *arc_name, const char *node_name,
- u32 * out_feature_index);
-
-void ipsec_set_async_mode (u32 is_enabled);
extern void ipsec_register_udp_port (u16 udp_port);
extern void ipsec_unregister_udp_port (u16 udp_port);