examples/ipsec-secgw: add event mode
[dpdk.git] / examples / ipsec-secgw / sad.h
index 3f92db2..473aaa9 100644 (file)
@@ -18,11 +18,6 @@ struct ipsec_sad_cache {
 
 RTE_DECLARE_PER_LCORE(struct ipsec_sad_cache, sad_cache);
 
-struct ipsec_sad {
-       struct rte_ipsec_sad *sad_v4;
-       struct rte_ipsec_sad *sad_v6;
-};
-
 int ipsec_sad_create(const char *name, struct ipsec_sad *sad,
        int socket_id, struct ipsec_sa_cnt *sa_cnt);
 
@@ -93,7 +88,7 @@ sad_lookup(struct ipsec_sad *sad, struct rte_mbuf *pkts[],
                esp = rte_pktmbuf_mtod_offset(pkts[i], struct rte_esp_hdr *,
                                pkts[i]->l3_len);
 
-               is_ipv4 = ((ipv4->version_ihl >> 4) == IPVERSION);
+               is_ipv4 = pkts[i]->packet_type & RTE_PTYPE_L3_IPV4;
                spi = rte_be_to_cpu_32(esp->spi);
                cache_idx = SPI2IDX(spi, cache->mask);