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