-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnf_tbf.h
52 lines (45 loc) · 1.4 KB
/
nf_tbf.h
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
/*
* Copyright (C) 2013 Mikhail Vorozhtsov
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef NF_TBF_H
#define NF_TBF_H
#include <linux/types.h>
#ifdef __KERNEL__
# define NF_TBF_U64_T __u64
#else
# include <inttypes.h>
# define NF_TBF_U64_T uint64_t
#endif
#define NF_TBF_MIN_BURST 68
#define NF_TBF_MIN_RATE NF_TBF_MIN_BURST
struct nf_tbf_cfg {
__u32 limit;
__u32 burst;
__u32 rate;
} __attribute__ ((packed));
struct nf_tbf_stats {
NF_TBF_U64_T first_pkt_ts;
NF_TBF_U64_T pkts_bursted;
NF_TBF_U64_T bytes_bursted;
NF_TBF_U64_T pkts_queued;
NF_TBF_U64_T bytes_queued;
NF_TBF_U64_T pkts_dropped;
NF_TBF_U64_T bytes_dropped;
NF_TBF_U64_T pkts_nomem;
NF_TBF_U64_T bytes_nomem;
} __attribute__ ((packed));
#endif /* NF_TBF_H */