/* 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;
}
/* 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;
}
}
{
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;
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);
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;
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);
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 {
/* 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;
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
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;
/* 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 */
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;
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 */