ipsec: infra for selecting backends
[vpp.git] / src / vnet / ipsec / esp.h
index 10f2f2d..50c4d39 100644 (file)
@@ -42,6 +42,14 @@ typedef CLIB_PACKED (struct {
 }) ip4_and_esp_header_t;
 /* *INDENT-ON* */
 
+/* *INDENT-OFF* */
+typedef CLIB_PACKED (struct {
+  ip4_header_t ip4;
+  udp_header_t udp;
+  esp_header_t esp;
+}) ip4_and_udp_and_esp_header_t;
+/* *INDENT-ON* */
+
 /* *INDENT-OFF* */
 typedef CLIB_PACKED (struct {
   ip6_header_t ip6;
@@ -251,7 +259,7 @@ ipsec_proto_init ()
   ipsec_proto_main_t *em = &ipsec_proto_main;
   vlib_thread_main_t *tm = vlib_get_thread_main ();
 
-  memset (em, 0, sizeof (em[0]));
+  clib_memset (em, 0, sizeof (em[0]));
 
   vec_validate (em->ipsec_proto_main_crypto_algs, IPSEC_CRYPTO_N_ALG - 1);
   em->ipsec_proto_main_crypto_algs[IPSEC_CRYPTO_ALG_AES_CBC_128].type =
@@ -305,7 +313,7 @@ ipsec_proto_init ()
                        CLIB_CACHE_LINE_BYTES);
   int thread_id;
 
-  for (thread_id = 0; thread_id < tm->n_vlib_mains - 1; thread_id++)
+  for (thread_id = 0; thread_id < tm->n_vlib_mains; thread_id++)
     {
 #if OPENSSL_VERSION_NUMBER >= 0x10100000L
       em->per_thread_data[thread_id].encrypt_ctx = EVP_CIPHER_CTX_new ();