2 Copyright (C) Slava Astashonok <sla@0n.ru>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License.
7 $Id: netflow.h,v 1.3.2.5.2.1 2004/08/13 21:03:10 sla Exp $
13 #include <my_inttypes.h>
15 #define NETFLOW_BYTES_32 1
16 #define NETFLOW_BYTES_32_SIZE 4
18 #define NETFLOW_PKTS_32 2
19 #define NETFLOW_PKTS_32_SIZE 4
21 #define NETFLOW_FLOWS 3
22 #define NETFLOW_FLOWS_SIZE 4
24 #define NETFLOW_PROT 4
25 #define NETFLOW_PROT_SIZE 1
27 #define NETFLOW_SRC_TOS 5
28 #define NETFLOW_SRC_TOS_SIZE 1
30 #define NETFLOW_TCP_FLAGS 6
31 #define NETFLOW_TCP_FLAGS_SIZE 1
33 #define NETFLOW_L4_SRC_PORT 7
34 #define NETFLOW_L4_SRC_PORT_SIZE 2
36 #define NETFLOW_IPV4_SRC_ADDR 8
37 #define NETFLOW_IPV4_SRC_ADDR_SIZE 4
39 #define NETFLOW_SRC_MASK 9
40 #define NETFLOW_SRC_MASK_SIZE 1
42 #define NETFLOW_INPUT_SNMP 10
43 #define NETFLOW_INPUT_SNMP_SIZE 2
45 #define NETFLOW_L4_DST_PORT 11
46 #define NETFLOW_L4_DST_PORT_SIZE 2
48 #define NETFLOW_IPV4_DST_ADDR 12
49 #define NETFLOW_IPV4_DST_ADDR_SIZE 4
51 #define NETFLOW_DST_MASK 13
52 #define NETFLOW_DST_MASK_SIZE 1
54 #define NETFLOW_OUTPUT_SNMP 14
55 #define NETFLOW_OUTPUT_SNMP_SIZE 2
57 #define NETFLOW_IPV4_NEXT_HOP 15
58 #define NETFLOW_IPV4_NEXT_HOP_SIZE 4
60 #define NETFLOW_SRC_AS 16
61 #define NETFLOW_SRC_AS_SIZE 2
63 #define NETFLOW_DST_AS 17
64 #define NETFLOW_DST_AS_SIZE 2
66 #define NETFLOW_BGP_NEXT_HOP 18
67 #define NETFLOW_BGP_NEXT_HOP_SIZE 4
69 #define NETFLOW_IPM_DPKTS 19
70 #define NETFLOW_IPM_DPKTS_SIZE 4
72 #define NETFLOW_IPM_DOCTETS 20
73 #define NETFLOW_IPM_DOCTETS_SIZE 4
75 #define NETFLOW_LAST_SWITCHED 21
76 #define NETFLOW_LAST_SWITCHED_SIZE 4
78 #define NETFLOW_FIRST_SWITCHED 22
79 #define NETFLOW_FIRST_SWITCHED_SIZE 4
81 #define NETFLOW_BYTES_64 23
82 #define NETFLOW_BYTES_64_SIZE 8
84 #define NETFLOW_PKTS_64 24
85 #define NETFLOW_PKTS_64_SIZE 8
87 #define NETFLOW_MAC_ADDR 25
88 #define NETFLOW_MAC_ADDR_SIZE 6
90 #define NETFLOW_VLAN_ID 26
91 #define NETFLOW_VLAN_ID_SIZE 2
93 #define NETFLOW_IPV6_SRC_ADDR 27
94 #define NETFLOW_IPV6_SRC_ADDR_SIZE 16
96 #define NETFLOW_IPV6_DST_ADDR 28
97 #define NETFLOW_IPV6_DST_ADDR_SIZE 16
99 #define NETFLOW_IPV6_SRC_MASK 29
100 #define NETFLOW_IPV6_SRC_MASK_SIZE 1
102 #define NETFLOW_IPV6_DST_MASK 30
103 #define NETFLOW_IPV6_DST_MASK_SIZE 1
105 #define NETFLOW_FLOW_LABEL 31
106 #define NETFLOW_FLOW_LABEL_SZIE 3
108 #define NETFLOW_ICMP_TYPE 32
109 #define NETFLOW_ICMP_TYPE_SIZE 1
111 #define NETFLOW_MUL_IGMP_TYPE 33
112 #define NETFLOW_MUL_IGMP_TYPE_SIZE 1
114 #define NETFLOW_SAMPLING_INTERVAL 34
115 #define NETFLOW_SAMPLING_INTERVAL_SIZE 4
117 #define NETFLOW_SAMPLING_ALGORITHM 35
118 #define NETFLOW_SAMPLING_ALGORITHM_SIZE 1
120 #define NETFLOW_FLOW_ACTIVE_TIMEOUT 36
121 #define NETFLOW_FLOW_ACTIVE_TIMEOUT_SIZE 2
123 #define NETFLOW_FLOW_INACTIVE_TIMEOUT 37
124 #define NETFLOW_FLOW_INACTIVE_TIMEOUT_SIZE 2
126 #define NETFLOW_ENGINE_TYPE 38
127 #define NETFLOW_ENGINE_TYPE_SIZE 1
129 #define NETFLOW_ENGINE_ID 39
130 #define NETFLOW_ENGINE_ID_SIZE 1
132 #define NETFLOW_TOTAL_BYTES_EXPORTED 40
133 #define NETFLOW_TOTAL_BYTES_EXPORTED_SIZE 4
135 #define NETFLOW_TOTAL_EXPORT_PKTS_SENT 41
136 #define NETFLOW_TOTAL_EXPORT_PKTS_SENT_SIZE 4
138 #define NETFLOW_TOTAL_FLOWS_EXPORTED 42
139 #define NETFLOW_TOTAL_FLOWS_EXPORTED_SIZE 4
141 #define NETFLOW_FLOW_SAMPLER_ID 48
142 #define NETFLOW_FLOW_SAMPLER_ID_SIZE 1
144 #define NETFLOW_FLOW_SAMPLER_MODE 49
145 #define NETFLOW_FLOW_SAMPLER_MODE_SIZE 1
147 #define NETFLOW_FLOW_SAMPLER_RANDOM_INTERVAL 50
148 #define NETFLOW_FLOW_SAMPLER_RANDOM_INTERVAL_SIZE 4
150 #define NETFLOW_IP_PROTOCOL_VERSION 60
151 #define NETFLOW_IP_PROTOCOL_VERSION_SIZE 1
153 #define NETFLOW_DIRECTION 61
154 #define NETFLOW_DIRECTION_SIZE 1
156 #define NETFLOW_IPV6_NEXT_HOP 62
157 #define NETFLOW_IPV6_NEXT_HOP_SIZE 16
159 #define NETFLOW_BGP_IPV6_NEXT_HOP 63
160 #define NETFLOW_BGP_IPV6_NEXT_HOP_SIZE 16
162 #define NETFLOW_IPV6_OPTION_HEADERS 64
163 #define NETFLOW_IPV6_OPTION_HEADERS_SIZE 4
165 #define NETFLOW_XID 65
166 #define NETFLOW_XID_SIZE 4
168 #define NETFLOW_VERSION 1001
169 #define NETFLOW_VERSION_SIZE 2
171 #define NETFLOW_COUNT 1002
172 #define NETFLOW_COUNT_SIZE 2
174 #define NETFLOW_UPTIME 1003
175 #define NETFLOW_UPTIME_SIZE 4
177 #define NETFLOW_UNIX_SECS 1004
178 #define NETFLOW_UNIX_SECS_SIZE 4
180 #define NETFLOW_UNIX_NSECS 1005
181 #define NETFLOW_UNIX_NSECS_SIZE 4
183 #define NETFLOW_FLOW_SEQUENCE 1006
184 #define NETFLOW_FLOW_SEQUENCE_SIZE 4
186 #define NETFLOW_HEADER_SAMPLING_INTERVAL 1009 /* ??? */
187 #define NETFLOW_HEADER_SAMPLING_INTERVAL_SIZE 2
189 #define NETFLOW_FLAGS7_1 1010
190 #define NETFLOW_FLAGS7_1_SIZE 1
192 #define NETFLOW_FLAGS7_2 1011
193 #define NETFLOW_FLAGS7_2_SIZE 2
195 #define NETFLOW_ROUTER_SC 1012
196 #define NETFLOW_ROUTER_SC_SIZE 4
199 #define NETFLOW_PAD8 9001
200 #define NETFLOW_PAD8_SIZE 1
202 #define NETFLOW_PAD16 9002
203 #define NETFLOW_PAD16_SIZE 2
205 #define NETFLOW_PAD32 9003
206 #define NETFLOW_PAD32_SIZE 4
208 #define NETFLOW_PAD64 9004
209 #define NETFLOW_PAD64_SIZE 8
212 #define NETFLOW_MAX_PACKET 1500
214 #define NETFLOW1_VERSION 1
215 #define NETFLOW1_HEADER_SIZE 16
216 #define NETFLOW1_MAX_FLOWS 24
217 #define NETFLOW1_FLOW_SIZE 48
218 #define NETFLOW1_SEQ_OFFSET 0
220 #define NETFLOW5_VERSION 5
221 #define NETFLOW5_HEADER_SIZE 24
222 #define NETFLOW5_MAX_FLOWS 30
223 #define NETFLOW5_FLOW_SIZE 48
224 #define NETFLOW5_SEQ_OFFSET 16
226 #define NETFLOW7_VERSION 7
227 #define NETFLOW7_HEADER_SIZE 24
228 #define NETFLOW7_MAX_FLOWS 27
229 #define NETFLOW7_FLOW_SIZE 52
230 #define NETFLOW7_SEQ_OFFSET 16
232 #define NETFLOW8_VERSION 8
233 #define NETFLOW8_MAX_FLOWS 51
241 unsigned HeaderFields;
242 uint16_t *HeaderFormat;
244 uint16_t *FlowFormat;