devices: af-packet v3 support
[vpp.git] / src / vnet / devices / af_packet / af_packet.h
index d7d16b9..ed3f10b 100644 (file)
  *------------------------------------------------------------------
  */
 
+#include <linux/if_packet.h>
+
 #include <vppinfra/lock.h>
 #include <vlib/log.h>
 
+typedef struct tpacket_block_desc block_desc_t;
+typedef struct tpacket_req3 tpacket_req3_t;
+typedef struct tpacket3_hdr tpacket3_hdr_t;
+
 typedef enum
 {
   AF_PACKET_IF_MODE_ETHERNET = 1,
@@ -39,15 +45,16 @@ typedef struct
   u8 *host_if_name;
   int host_if_index;
   int fd;
-  struct tpacket_req *rx_req;
-  struct tpacket_req *tx_req;
-  u8 *rx_ring;
-  u8 *tx_ring;
+  tpacket_req3_t *rx_req;
+  tpacket_req3_t *tx_req;
+  u8 **rx_ring;
+  u8 **tx_ring;
+  u32 hdrlen;
   u32 hw_if_index;
   u32 sw_if_index;
   u32 clib_file_index;
 
-  u32 next_rx_frame;
+  u32 next_rx_block;
   u32 next_tx_frame;
 
   u32 per_interface_next_index;