net: add rte prefix to esp structure
[dpdk.git] / lib / librte_ipsec / sa.c
index 5f55c2a..ea05632 100644 (file)
@@ -199,7 +199,7 @@ esp_inb_init(struct rte_ipsec_sa *sa)
        /* these params may differ with new algorithms support */
        sa->ctp.auth.offset = 0;
        sa->ctp.auth.length = sa->icv_len - sa->sqh_len;
-       sa->ctp.cipher.offset = sizeof(struct esp_hdr) + sa->iv_len;
+       sa->ctp.cipher.offset = sizeof(struct rte_esp_hdr) + sa->iv_len;
        sa->ctp.cipher.length = sa->icv_len + sa->ctp.cipher.offset;
 }
 
@@ -223,13 +223,13 @@ esp_outb_init(struct rte_ipsec_sa *sa, uint32_t hlen)
 
        /* these params may differ with new algorithms support */
        sa->ctp.auth.offset = hlen;
-       sa->ctp.auth.length = sizeof(struct esp_hdr) + sa->iv_len + sa->sqh_len;
+       sa->ctp.auth.length = sizeof(struct rte_esp_hdr) + sa->iv_len + sa->sqh_len;
        if (sa->aad_len != 0) {
-               sa->ctp.cipher.offset = hlen + sizeof(struct esp_hdr) +
+               sa->ctp.cipher.offset = hlen + sizeof(struct rte_esp_hdr) +
                        sa->iv_len;
                sa->ctp.cipher.length = 0;
        } else {
-               sa->ctp.cipher.offset = sa->hdr_len + sizeof(struct esp_hdr);
+               sa->ctp.cipher.offset = sa->hdr_len + sizeof(struct rte_esp_hdr);
                sa->ctp.cipher.length = sa->iv_len;
        }
 }
@@ -476,7 +476,7 @@ esp_outb_tun_pkt_prepare(struct rte_ipsec_sa *sa, rte_be64_t sqc,
 {
        uint32_t clen, hlen, l2len, pdlen, pdofs, plen, tlen;
        struct rte_mbuf *ml;
-       struct esp_hdr *esph;
+       struct rte_esp_hdr *esph;
        struct esp_tail *espt;
        char *ph, *pt;
        uint64_t *iv;
@@ -524,7 +524,7 @@ esp_outb_tun_pkt_prepare(struct rte_ipsec_sa *sa, rte_be64_t sqc,
                        sqn_low16(sqc));
 
        /* update spi, seqn and iv */
-       esph = (struct esp_hdr *)(ph + sa->hdr_len);
+       esph = (struct rte_esp_hdr *)(ph + sa->hdr_len);
        iv = (uint64_t *)(esph + 1);
        copy_iv(iv, ivp, sa->iv_len);
 
@@ -644,7 +644,7 @@ esp_outb_trs_pkt_prepare(struct rte_ipsec_sa *sa, rte_be64_t sqc,
        uint8_t np;
        uint32_t clen, hlen, pdlen, pdofs, plen, tlen, uhlen;
        struct rte_mbuf *ml;
-       struct esp_hdr *esph;
+       struct rte_esp_hdr *esph;
        struct esp_tail *espt;
        char *ph, *pt;
        uint64_t *iv;
@@ -687,7 +687,7 @@ esp_outb_trs_pkt_prepare(struct rte_ipsec_sa *sa, rte_be64_t sqc,
                        IPPROTO_ESP);
 
        /* update spi, seqn and iv */
-       esph = (struct esp_hdr *)(ph + uhlen);
+       esph = (struct rte_esp_hdr *)(ph + uhlen);
        iv = (uint64_t *)(esph + 1);
        copy_iv(iv, ivp, sa->iv_len);
 
@@ -806,7 +806,7 @@ esp_inb_tun_cop_prepare(struct rte_crypto_op *cop,
                gcm = rte_crypto_op_ctod_offset(cop, struct aead_gcm_iv *,
                        sa->iv_ofs);
                ivp = rte_pktmbuf_mtod_offset(mb, uint64_t *,
-                       pofs + sizeof(struct esp_hdr));
+                       pofs + sizeof(struct rte_esp_hdr));
                aead_gcm_iv_fill(gcm, ivp[0], sa->salt);
        /* CRYPT+AUTH case */
        } else {
@@ -820,7 +820,7 @@ esp_inb_tun_cop_prepare(struct rte_crypto_op *cop,
                /* copy iv from the input packet to the cop */
                ivc = rte_crypto_op_ctod_offset(cop, uint64_t *, sa->iv_ofs);
                ivp = rte_pktmbuf_mtod_offset(mb, uint64_t *,
-                       pofs + sizeof(struct esp_hdr));
+                       pofs + sizeof(struct rte_esp_hdr));
                copy_iv(ivc, ivp, sa->iv_len);
        }
        return 0;
@@ -862,9 +862,9 @@ esp_inb_tun_pkt_prepare(const struct rte_ipsec_sa *sa,
        uint64_t sqn;
        uint32_t icv_ofs, plen;
        struct rte_mbuf *ml;
-       struct esp_hdr *esph;
+       struct rte_esp_hdr *esph;
 
-       esph = rte_pktmbuf_mtod_offset(mb, struct esp_hdr *, hlen);
+       esph = rte_pktmbuf_mtod_offset(mb, struct rte_esp_hdr *, hlen);
 
        /*
         * retrieve and reconstruct SQN, then check it, then
@@ -991,7 +991,7 @@ esp_inb_tun_single_pkt_process(struct rte_ipsec_sa *sa, struct rte_mbuf *mb,
        uint32_t *sqn)
 {
        uint32_t hlen, icv_len, tlen;
-       struct esp_hdr *esph;
+       struct rte_esp_hdr *esph;
        struct esp_tail *espt;
        struct rte_mbuf *ml;
        char *pd;
@@ -1021,7 +1021,7 @@ esp_inb_tun_single_pkt_process(struct rte_ipsec_sa *sa, struct rte_mbuf *mb,
 
        /* cut of L2/L3 headers, ESP header and IV */
        hlen = mb->l2_len + mb->l3_len;
-       esph = rte_pktmbuf_mtod_offset(mb, struct esp_hdr *, hlen);
+       esph = rte_pktmbuf_mtod_offset(mb, struct rte_esp_hdr *, hlen);
        rte_pktmbuf_adj(mb, hlen + sa->ctp.cipher.offset);
 
        /* retrieve SQN for later check */
@@ -1045,7 +1045,7 @@ esp_inb_trs_single_pkt_process(struct rte_ipsec_sa *sa, struct rte_mbuf *mb,
        uint32_t *sqn)
 {
        uint32_t hlen, icv_len, l2len, l3len, tlen;
-       struct esp_hdr *esph;
+       struct rte_esp_hdr *esph;
        struct esp_tail *espt;
        struct rte_mbuf *ml;
        char *np, *op, *pd;
@@ -1074,7 +1074,7 @@ esp_inb_trs_single_pkt_process(struct rte_ipsec_sa *sa, struct rte_mbuf *mb,
        l3len = mb->l3_len;
        hlen = l2len + l3len;
        op = rte_pktmbuf_mtod(mb, char *);
-       esph = (struct esp_hdr *)(op + hlen);
+       esph = (struct rte_esp_hdr *)(op + hlen);
        *sqn = rte_be_to_cpu_32(esph->seq);
 
        /* cut off ESP header and IV, update L3 header */