MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tun_process_step2

Function tun_process_step2

dpdk/lib/ipsec/esp_inb.c:496–511  ·  view source on GitHub ↗

* step two for tunnel mode: * - read SQN value (for future use) * - cut of ICV, ESP tail and padding bytes * - cut of ESP header and IV, also if needed - L2/L3 headers * (controlled by *adj* value) */

Source from the content-addressed store, hash-verified

494 * (controlled by *adj* value)
495 */
496static inline void *
497tun_process_step2(struct rte_mbuf *mb, struct rte_mbuf *ml, uint32_t hlen,
498 uint32_t adj, uint32_t tofs, uint32_t tlen, uint32_t *sqn)
499{
500 const struct rte_esp_hdr *ph;
501
502 /* read SQN value */
503 ph = rte_pktmbuf_mtod_offset(mb, const struct rte_esp_hdr *, hlen);
504 sqn[0] = ph->seq;
505
506 /* cut of ICV, ESP tail and padding bytes */
507 mbuf_cut_seg_ofs(mb, ml, tofs, tlen);
508
509 /* cut of L2/L3 headers, ESP header and IV */
510 return rte_pktmbuf_adj(mb, adj);
511}
512
513/*
514 * step two for transport mode:

Callers 2

trs_process_step2Function · 0.85
tun_processFunction · 0.85

Calls 2

mbuf_cut_seg_ofsFunction · 0.85
rte_pktmbuf_adjFunction · 0.85

Tested by

no test coverage detected