nat: nat44-ei/ed nat objects cleanup improvements
[vpp.git] / src / vnet / ipsec / ah_encrypt.c
index a1f233c..bb971e4 100644 (file)
@@ -38,11 +38,10 @@ typedef enum
     AH_ENCRYPT_N_NEXT,
 } ah_encrypt_next_t;
 
-#define foreach_ah_encrypt_error                                \
- _(RX_PKTS, "AH pkts received")                                 \
- _(CRYPTO_ENGINE_ERROR, "crypto engine error (packet dropped)") \
- _(SEQ_CYCLED, "sequence number cycled")
-
+#define foreach_ah_encrypt_error                                              \
+  _ (RX_PKTS, "AH pkts received")                                             \
+  _ (CRYPTO_ENGINE_ERROR, "crypto engine error (packet dropped)")             \
+  _ (SEQ_CYCLED, "sequence number cycled (packet dropped)")
 
 typedef enum
 {
@@ -176,7 +175,7 @@ ah_encrypt_inline (vlib_main_t * vm,
                                             current_sa_pkts,
                                             current_sa_bytes);
          current_sa_index = vnet_buffer (b[0])->ipsec.sad_index;
-         sa0 = pool_elt_at_index (im->sad, current_sa_index);
+         sa0 = ipsec_sa_get (current_sa_index);
 
          current_sa_bytes = current_sa_pkts = 0;
        }
@@ -387,7 +386,7 @@ ah_encrypt_inline (vlib_main_t * vm,
     next:
       if (PREDICT_FALSE (b[0]->flags & VLIB_BUFFER_IS_TRACED))
        {
-         sa0 = vec_elt_at_index (im->sad, pd->sa_index);
+         sa0 = ipsec_sa_get (pd->sa_index);
          ah_encrypt_trace_t *tr =
            vlib_add_trace (vm, node, b[0], sizeof (*tr));
          tr->spi = sa0->spi;