1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
use libc::c_int;
bitflags! {
pub struct PFRingFlags: c_int {
const ZC_SYMMETRIC_RSS = 1 << 0;
const DNA_SYMMETRIC_RSS = Self::ZC_SYMMETRIC_RSS.bits;
const REENTRANT = 1 << 1;
const LONG_HEADER = 1 << 2;
const PROMISC = 1 << 3;
const TIMESTAMP = 1 << 4;
const HW_TIMESTAMP = 1 << 5;
const RX_PACKET_BOUNCE = 1 << 6;
const ZC_FIXED_RSS_Q_0 = 1 << 7;
const DNA_FIXED_RSS_Q_0 = Self::ZC_FIXED_RSS_Q_0.bits;
const STRIP_HW_TIMESTAMP = 1 << 8;
const DO_NOT_PARSE = 1 << 9;
const DO_NOT_TIMESTAMP = 1 << 10;
const CHUNK_MODE = 1 << 11;
const IXIA_TIMESTAMP = 1 << 12;
const USERSPACE_BPF = 1 << 13;
const ZC_NOT_REPROGRAM_RSS = 1 << 14;
const VSS_APCON_TIMESTAMP = 1 << 15;
const ZC_IPONLY_RSS = 1 << 16;
const FLOW_OFFLOAD = 1 << 17;
const FLOW_OFFLOAD_NOUPDATES = 1 << 18;
const FLOW_OFFLOAD_NORAWDATA = 1 << 19;
const L7_FILTERING = 1 << 20;
const DO_NOT_STRIP_FCS = 1 << 21;
}
}
pub const MAX_CAPLEN: c_int = 65535;
pub const PAGE_SIZE: c_int = 4096;
pub const DEFAULT_POLL_DURATION: c_int = 500;
pub const POLL_SLEEP_STEP: c_int = 10;
pub const POLL_SLEEP_MIN: c_int = POLL_SLEEP_STEP;
pub const POLL_SLEEP_MAX: c_int = 1000;
pub const POLL_QUEUE_MIN_LEN:c_int = 500;
pub const MAX_NUM_RX_CHANNELS: usize = 64;
pub const SUCCESS: c_int = 0;
#[repr(C)]
pub enum FilteringMode{
HardwareAndSoftware = 0,
HardwareOnly,
SoftwareOnly
}
#[repr(C)]
pub enum PFRingChunkType {
PcapChunk,
PcapNsecChunk,
UnknownChunkType
}
#[repr(C)]
pub enum PacketSlicingLevel {
FullPacketSlicing = 0,
L2Slicing = 2,
L3Slicing = 3,
L4Slicing = 4
}
#[repr(C)]
pub enum SocketMode {
SendAndRecv = 0,
SendOnly,
RecvOnly,
}
#[repr(C)]
pub enum ClusterType {
PerFlow = 0,
RoundRobin,
PerFlow2Tuple,
PerFlow4Tuple,
PerFlow5Tuple,
PerFlowTcp5Tuple,
PerInnerFlow,
PerInnerFlow2Tuple,
PerInerFlow4Tuple,
PerInnerFlow5Tuple,
PerInnerFlowTcp5Tuple,
PerFlowIp5Tuple,
PerInnerFlowIp5Tuple,
PerFlowIpWithDupTuple,
}