• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1  // SPDX-License-Identifier: GPL-2.0-or-later
2  /*
3   * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
4   * Author: Jinhui huang <huangjh.jy@cn.fujitsu.com>
5   */
6  
7  #ifndef LAPI_IF_PACKET_H__
8  #define LAPI_IF_PACKET_H__
9  
10  #include "config.h"
11  
12  #ifdef HAVE_LINUX_IF_PACKET_H
13  # include <linux/if_packet.h>
14  #endif
15  
16  #ifndef PACKET_RX_RING
17  # define PACKET_RX_RING 5
18  #endif
19  
20  #ifndef PACKET_VERSION
21  # define PACKET_VERSION 10
22  #endif
23  
24  #ifndef PACKET_RESERVE
25  # define PACKET_RESERVE 12
26  #endif
27  
28  #ifndef PACKET_VNET_HDR
29  # define PACKET_VNET_HDR 15
30  #endif
31  
32  #ifndef PACKET_FANOUT
33  # define PACKET_FANOUT 18
34  #endif
35  
36  #ifndef PACKET_FANOUT_ROLLOVER
37  # define PACKET_FANOUT_ROLLOVER 3
38  #endif
39  
40  #ifndef HAVE_STRUCT_TPACKET_REQ3
41  # define TPACKET_V3 2
42  
43  struct tpacket_req3 {
44  	unsigned int	tp_block_size;
45  	unsigned int	tp_block_nr;
46  	unsigned int	tp_frame_size;
47  	unsigned int	tp_frame_nr;
48  	unsigned int	tp_retire_blk_tov;
49  	unsigned int	tp_sizeof_priv;
50  	unsigned int	tp_feature_req_word;
51  };
52  #endif
53  
54  #endif /* LAPI_IF_PACKET_H__ */
55