forked from andrsharaev/xt_NAT
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathxt_NAT.h
66 lines (58 loc) · 1.43 KB
/
xt_NAT.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef _LINUX_NETFILTER_XT_NAT_H
#define _LINUX_NETFILTER_XT_NAT_H 1
enum xt_nat_target_variant {
XTNAT_SNAT,
XTNAT_DNAT,
};
struct xt_nat_tginfo {
uint8_t variant;
};
#define NETFLOW9_RECORDS_MAX 30
struct netflow9_record {
__u8 protocol;
__be16 s_port;
__be32 s_addr;
__be16 d_port;
__be32 d_addr;
__be32 n_addr;
__be16 n_port;
__u8 event;
} __attribute__ ((packed));
/* NetFlow v9 template */
struct netflow9_template {
__be16 FlowSetId;
__be16 Length;
__be16 TemplateId;
__be16 FieldsCount;
__be16 proto_id;
__be16 proto_len;
__be16 s_port_id;
__be16 s_port_len;
__be16 s_addr_id;
__be16 s_addr_len;
__be16 d_port_id;
__be16 d_port_len;
__be16 d_addr_id;
__be16 d_addr_len;
__be16 n_addr_id;
__be16 n_addr_len;
__be16 n_port_id;
__be16 n_port_len;
__be16 s_type_id;
__be16 s_type_len;
} __attribute__ ((packed));
/* NetFlow v9 packet */
struct netflow9_pdu {
__be16 version;
__be16 nr_records;
__be32 ts_uptime; /* ms */
__be32 ts_usecs; /* s */
__be32 seq;
__be32 srcID;
struct netflow9_template template_V9;
__be16 FlowSetId;
__be16 FlowSetIdSize;
struct netflow9_record flow[NETFLOW9_RECORDS_MAX];
} __attribute__ ((packed));
#define NETFLOW9_HEADER_SIZE (sizeof(struct netflow9_pdu) - NETFLOW9_RECORDS_MAX * sizeof(struct netflow9_record))
#endif /* _LINUX_NETFILTER_XT_NAT_H */