Merge commit 'upstream/1.6.3p1' into unstable
Erik Wenzel
13 years ago
0 | 2011-02-26 | |
1 | - Fix timebug fix :(, make it a compile time option | |
2 | - fix v7 sequence errors | |
3 | ||
4 | 2011-02-15 | |
5 | - Zero out unused fields after aggregation | |
6 | ||
0 | 7 | 2011-02-05 |
1 | 8 | - Fix SysUptime 32bit overflow in v5 header |
2 | 9 | - Add fix for strange first/last swap reported by some users. |
12 | 12 | |
13 | 13 | m4_ifndef([AC_AUTOCONF_VERSION], |
14 | 14 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
15 | m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],, | |
16 | [m4_warning([this file was generated for autoconf 2.67. | |
15 | m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, | |
16 | [m4_warning([this file was generated for autoconf 2.68. | |
17 | 17 | You have another version of autoconf. It may work, but is not guaranteed to. |
18 | 18 | If you have problems, you may need to regenerate the build system entirely. |
19 | 19 | To do so, use the procedure documented by the package, typically `autoreconf'.])]) |
77 | 77 | |
78 | 78 | } // End of ApplyNetMaskBits |
79 | 79 | |
80 | static inline void ApplyAggrMask(master_record_t *record, master_record_t *mask) { | |
81 | uint64_t *r = (uint64_t *)record; | |
82 | uint64_t *m = (uint64_t *)mask; | |
83 | int i, max_offset; | |
84 | ||
85 | max_offset = offsetof(master_record_t, map_ref) >> 3; | |
86 | for (i=2; i<max_offset; i++) { | |
87 | r[i] &= m[i]; | |
88 | } | |
89 | ||
90 | } // End of ApplyAggrMask |
340 | 340 | |
341 | 341 | } // End of FlushExtensionMaps |
342 | 342 | |
343 | void InsertSamplerOffset( FlowSource_t *fs, uint16_t id, uint16_t offset_sampler_id, uint16_t offset_sampler_mode, uint16_t offset_sampler_interval) { | |
343 | void InsertSamplerOffset( FlowSource_t *fs, uint16_t id, uint16_t offset_sampler_id, uint16_t sampler_id_length, | |
344 | uint16_t offset_sampler_mode, uint16_t offset_sampler_interval) { | |
344 | 345 | option_offset_t **t; |
345 | 346 | |
346 | 347 | t = &(fs->option_offset_table); |
360 | 361 | fprintf(stderr, "malloc() allocation error: %s\n", strerror(errno)); |
361 | 362 | return ; |
362 | 363 | } |
363 | syslog(LOG_ERR, "Process_v9: New sampler at offsets: ID %i, mode: %i, interval: %i", | |
364 | dbg_printf("Process_v9: New sampler at offsets: ID %i, mode: %i, interval: %i", | |
364 | 365 | offset_sampler_id, offset_sampler_mode, offset_sampler_interval); |
365 | 366 | } // else existing table |
366 | 367 | |
368 | 369 | SetFlag((*t)->flags, HAS_SAMPLER_DATA); |
369 | 370 | (*t)->id = id; |
370 | 371 | (*t)->offset_id = offset_sampler_id; |
372 | (*t)->sampler_id_length = sampler_id_length; | |
371 | 373 | (*t)->offset_mode = offset_sampler_mode; |
372 | 374 | (*t)->offset_interval = offset_sampler_interval; |
373 | 375 | (*t)->offset_std_sampler_interval = 0; |
395 | 397 | fprintf(stderr, "malloc() allocation error: %s\n", strerror(errno)); |
396 | 398 | return ; |
397 | 399 | } |
398 | syslog(LOG_ERR, "Process_v9: New std sampler at offsets: interval: %i, algorithm: %i", | |
400 | syslog(LOG_ERR, "Process_v9: New std sampler: interval: %i, algorithm: %i", | |
399 | 401 | offset_std_sampler_interval, offset_std_sampler_algorithm); |
400 | 402 | } // else existing table |
401 | 403 |
65 | 65 | // sampling offsets |
66 | 66 | #define HAS_SAMPLER_DATA 1 |
67 | 67 | uint16_t offset_id; |
68 | uint16_t sampler_id_length; | |
68 | 69 | uint16_t offset_mode; |
69 | 70 | uint16_t offset_interval; |
70 | 71 | |
132 | 133 | |
133 | 134 | void FlushExtensionMaps(FlowSource_t *fs); |
134 | 135 | |
135 | void InsertSamplerOffset( FlowSource_t *fs, uint16_t id, uint16_t offset_sampler_id, uint16_t offset_sampler_mode, uint16_t offset_sampler_interval); | |
136 | void InsertSamplerOffset( FlowSource_t *fs, uint16_t id, uint16_t offset_sampler_id, uint16_t sampler_id_length, | |
137 | uint16_t offset_sampler_mode, uint16_t offset_sampler_interval); | |
136 | 138 | |
137 | 139 | void InsertStdSamplerOffset( FlowSource_t *fs, uint16_t id, uint16_t offset_std_sampler_interval, uint16_t offset_std_sampler_algorithm); |
138 | 140 |
0 | /* | |
1 | * This file is part of the nfdump project. | |
2 | * | |
3 | * Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung | |
4 | * All rights reserved. | |
5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions are met: | |
8 | * | |
9 | * * Redistributions of source code must retain the above copyright notice, | |
10 | * this list of conditions and the following disclaimer. | |
11 | * * Redistributions in binary form must reproduce the above copyright notice, | |
12 | * this list of conditions and the following disclaimer in the documentation | |
13 | * and/or other materials provided with the distribution. | |
14 | * * Neither the name of SWITCH nor the names of its contributors may be | |
15 | * used to endorse or promote products derived from this software without | |
16 | * specific prior written permission. | |
17 | * | |
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | |
22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | * | |
30 | * $Author: peter $ | |
31 | * | |
32 | * $Id: grammar.y 100 2008-08-15 11:36:21Z peter $ | |
33 | * | |
34 | * $LastChangedRevision: 100 $ | |
35 | * | |
36 | * | |
37 | * | |
38 | */ | |
39 | ||
40 | %{ | |
41 | ||
42 | #include "config.h" | |
43 | ||
44 | #include <stdio.h> | |
45 | #include <sys/types.h> | |
46 | #include <sys/socket.h> | |
47 | #include <netinet/in.h> | |
48 | #include <string.h> | |
49 | #include <stdlib.h> | |
50 | #include <ctype.h> | |
51 | ||
52 | #ifdef HAVE_STDINT_H | |
53 | #include <stdint.h> | |
54 | #endif | |
55 | ||
56 | #include "nf_common.h" | |
57 | #include "rbtree.h" | |
58 | #include "nfdump.h" | |
59 | #include "nffile.h" | |
60 | #include "nftree.h" | |
61 | #include "ipconv.h" | |
62 | #include "util.h" | |
63 | ||
64 | /* | |
65 | * function prototypes | |
66 | */ | |
67 | static void yyerror(char *msg); | |
68 | ||
69 | static uint32_t ChainHosts(uint64_t *hostlist, int num_records, int type); | |
70 | ||
71 | static uint64_t VerifyMac(char *s); | |
72 | ||
73 | enum { DIR_UNSPEC = 1, SOURCE, DESTINATION, SOURCE_AND_DESTINATION, SOURCE_OR_DESTINATION, DIR_IN, DIR_OUT, IN_SRC, IN_DST, OUT_SRC, OUT_DST }; | |
74 | ||
75 | /* var defs */ | |
76 | extern int lineno; | |
77 | extern char *yytext; | |
78 | extern uint64_t *IPstack; | |
79 | extern uint32_t StartNode; | |
80 | extern uint16_t Extended; | |
81 | extern int (*FilterEngine)(uint32_t *); | |
82 | extern char *FilterFilename; | |
83 | ||
84 | static uint32_t num_ip; | |
85 | ||
86 | char yyerror_buff[256]; | |
87 | ||
88 | #define MPLSMAX 0x00ffffff | |
89 | %} | |
90 | ||
91 | %union { | |
92 | uint64_t value; | |
93 | char *s; | |
94 | FilterParam_t param; | |
95 | void *list; | |
96 | } | |
97 | ||
98 | %token ANY IP IF MAC MPLS TOS DIR FLAGS PROTO MASK HOSTNAME NET PORT FWDSTAT IN OUT SRC DST EQ LT GT | |
99 | %token NUMBER STRING IDENT ALPHA_FLAGS PROTOSTR PORTNUM ICMP_TYPE ICMP_CODE ENGINE_TYPE ENGINE_ID AS PACKETS BYTES FLOWS | |
100 | %token PPS BPS BPP DURATION | |
101 | %token IPV4 IPV6 NEXTHOP BGPNEXTHOP ROUTER VLAN | |
102 | %token NOT END | |
103 | %type <value> expr NUMBER PORTNUM ICMP_TYPE ICMP_CODE | |
104 | %type <s> STRING IDENT ALPHA_FLAGS PROTOSTR | |
105 | %type <param> dqual term comp | |
106 | %type <list> iplist ullist | |
107 | ||
108 | %left '+' OR | |
109 | %left '*' AND | |
110 | %left NEGATE | |
111 | ||
112 | %% | |
113 | prog: /* empty */ | |
114 | | expr { | |
115 | StartNode = $1; | |
116 | } | |
117 | ; | |
118 | ||
119 | term: ANY { /* this is an unconditionally true expression, as a filter applies in any case */ | |
120 | $$.self = NewBlock(OffsetProto, 0, 0, CMP_EQ, FUNC_NONE, NULL ); | |
121 | } | |
122 | ||
123 | | IDENT STRING { | |
124 | if ( !ScreenIdentString($2) ) { | |
125 | yyerror("Illegal ident string"); | |
126 | YYABORT; | |
127 | } | |
128 | ||
129 | uint32_t index = AddIdent($2); | |
130 | $$.self = NewBlock(0, 0, index, CMP_IDENT, FUNC_NONE, NULL ); | |
131 | } | |
132 | ||
133 | | IPV4 { | |
134 | $$.self = NewBlock(OffsetRecordFlags, (1LL << ShiftRecordFlags) & MaskRecordFlags, | |
135 | (0LL << ShiftRecordFlags) & MaskRecordFlags, CMP_EQ, FUNC_NONE, NULL); | |
136 | } | |
137 | ||
138 | | IPV6 { | |
139 | $$.self = NewBlock(OffsetRecordFlags, (1LL << ShiftRecordFlags) & MaskRecordFlags, | |
140 | (1LL << ShiftRecordFlags) & MaskRecordFlags, CMP_EQ, FUNC_NONE, NULL); | |
141 | } | |
142 | ||
143 | | PROTO NUMBER { | |
144 | int64_t proto; | |
145 | proto = $2; | |
146 | ||
147 | if ( proto > 255 ) { | |
148 | yyerror("Protocol number > 255"); | |
149 | YYABORT; | |
150 | } | |
151 | if ( proto < 0 ) { | |
152 | yyerror("Unknown protocol"); | |
153 | YYABORT; | |
154 | } | |
155 | $$.self = NewBlock(OffsetProto, MaskProto, (proto << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL); | |
156 | ||
157 | } | |
158 | ||
159 | | PROTO STRING { | |
160 | int64_t proto; | |
161 | proto = Proto_num($2); | |
162 | ||
163 | if ( proto > 255 ) { | |
164 | yyerror("Protocol number > 255"); | |
165 | YYABORT; | |
166 | } | |
167 | if ( proto < 0 ) { | |
168 | yyerror("Unknown protocol"); | |
169 | YYABORT; | |
170 | } | |
171 | $$.self = NewBlock(OffsetProto, MaskProto, (proto << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL); | |
172 | } | |
173 | ||
174 | | dqual PACKETS comp NUMBER { | |
175 | ||
176 | switch ( $$.direction ) { | |
177 | case DIR_UNSPEC: | |
178 | case DIR_IN: | |
179 | $$.self = NewBlock(OffsetPackets, MaskPackets, $4, $3.comp, FUNC_NONE, NULL); | |
180 | break; | |
181 | case DIR_OUT: | |
182 | $$.self = NewBlock(OffsetOutPackets, MaskPackets, $4, $3.comp, FUNC_NONE, NULL); | |
183 | break; | |
184 | case SOURCE: | |
185 | case DESTINATION: | |
186 | case SOURCE_OR_DESTINATION: | |
187 | case SOURCE_AND_DESTINATION: | |
188 | case IN_SRC: | |
189 | case IN_DST: | |
190 | case OUT_SRC: | |
191 | case OUT_DST: | |
192 | yyerror("This token is not expected here!"); | |
193 | YYABORT; | |
194 | break; | |
195 | default: | |
196 | /* should never happen */ | |
197 | yyerror("Internal parser error"); | |
198 | YYABORT; | |
199 | } // End of switch | |
200 | ||
201 | } | |
202 | ||
203 | | dqual BYTES comp NUMBER { | |
204 | ||
205 | switch ( $$.direction ) { | |
206 | case DIR_UNSPEC: | |
207 | case DIR_IN: | |
208 | $$.self = NewBlock(OffsetBytes, MaskBytes, $4, $3.comp, FUNC_NONE, NULL); | |
209 | break; | |
210 | case DIR_OUT: | |
211 | $$.self = NewBlock(OffsetOutBytes, MaskBytes, $4, $3.comp, FUNC_NONE, NULL); | |
212 | break; | |
213 | case SOURCE: | |
214 | case DESTINATION: | |
215 | case SOURCE_OR_DESTINATION: | |
216 | case SOURCE_AND_DESTINATION: | |
217 | case IN_SRC: | |
218 | case IN_DST: | |
219 | case OUT_SRC: | |
220 | case OUT_DST: | |
221 | yyerror("This token is not expected here!"); | |
222 | YYABORT; | |
223 | break; | |
224 | default: | |
225 | /* should never happen */ | |
226 | yyerror("Internal parser error"); | |
227 | YYABORT; | |
228 | } // End of switch | |
229 | ||
230 | } | |
231 | ||
232 | | FLOWS comp NUMBER { | |
233 | $$.self = NewBlock(OffsetAggrFlows, MaskFlows, $3, $2.comp, FUNC_NONE, NULL); | |
234 | } | |
235 | ||
236 | | PPS comp NUMBER { | |
237 | $$.self = NewBlock(0, AnyMask, $3, $2.comp, FUNC_PPS, NULL); | |
238 | } | |
239 | ||
240 | | BPS comp NUMBER { | |
241 | $$.self = NewBlock(0, AnyMask, $3, $2.comp, FUNC_BPS, NULL); | |
242 | } | |
243 | ||
244 | | BPP comp NUMBER { | |
245 | $$.self = NewBlock(0, AnyMask, $3, $2.comp, FUNC_BPP, NULL); | |
246 | } | |
247 | ||
248 | | DURATION comp NUMBER { | |
249 | $$.self = NewBlock(0, AnyMask, $3, $2.comp, FUNC_DURATION, NULL); | |
250 | } | |
251 | ||
252 | | dqual TOS comp NUMBER { | |
253 | if ( $4 > 255 ) { | |
254 | yyerror("TOS must be 0..255"); | |
255 | YYABORT; | |
256 | } | |
257 | ||
258 | switch ( $$.direction ) { | |
259 | case DIR_UNSPEC: | |
260 | case SOURCE: | |
261 | $$.self = NewBlock(OffsetTos, MaskTos, ($4 << ShiftTos) & MaskTos, $3.comp, FUNC_NONE, NULL); | |
262 | break; | |
263 | case DESTINATION: | |
264 | $$.self = NewBlock(OffsetDstTos, MaskDstTos, ($4 << ShiftDstTos) & MaskDstTos, $3.comp, FUNC_NONE, NULL); | |
265 | break; | |
266 | case SOURCE_OR_DESTINATION: | |
267 | $$.self = Connect_OR( | |
268 | NewBlock(OffsetTos, MaskTos, ($4 << ShiftTos) & MaskTos, $3.comp, FUNC_NONE, NULL), | |
269 | NewBlock(OffsetDstTos, MaskDstTos, ($4 << ShiftDstTos) & MaskDstTos, $3.comp, FUNC_NONE, NULL) | |
270 | ); | |
271 | break; | |
272 | case SOURCE_AND_DESTINATION: | |
273 | $$.self = Connect_AND( | |
274 | NewBlock(OffsetTos, MaskTos, ($4 << ShiftTos) & MaskTos, $3.comp, FUNC_NONE, NULL), | |
275 | NewBlock(OffsetDstTos, MaskDstTos, ($4 << ShiftDstTos) & MaskDstTos, $3.comp, FUNC_NONE, NULL) | |
276 | ); | |
277 | break; | |
278 | case DIR_IN: | |
279 | case DIR_OUT: | |
280 | case IN_SRC: | |
281 | case IN_DST: | |
282 | case OUT_SRC: | |
283 | case OUT_DST: | |
284 | yyerror("This token is not expected here!"); | |
285 | YYABORT; | |
286 | break; | |
287 | default: | |
288 | /* should never happen */ | |
289 | yyerror("Internal parser error"); | |
290 | YYABORT; | |
291 | } | |
292 | } | |
293 | ||
294 | | FLAGS comp NUMBER { | |
295 | if ( $3 > 63 ) { | |
296 | yyerror("Flags must be 0..63"); | |
297 | YYABORT; | |
298 | } | |
299 | $$.self = NewBlock(OffsetFlags, MaskFlags, ($3 << ShiftFlags) & MaskFlags, $2.comp, FUNC_NONE, NULL); | |
300 | } | |
301 | ||
302 | | FLAGS STRING { | |
303 | uint64_t fl = 0; | |
304 | int cnt = 0; | |
305 | size_t len = strlen($2); | |
306 | ||
307 | if ( len > 7 ) { | |
308 | yyerror("Too many flags"); | |
309 | YYABORT; | |
310 | } | |
311 | ||
312 | if ( strchr($2, 'F') ) { fl |= 1; cnt++; } | |
313 | if ( strchr($2, 'S') ) { fl |= 2; cnt++; } | |
314 | if ( strchr($2, 'R') ) { fl |= 4; cnt++; } | |
315 | if ( strchr($2, 'P') ) { fl |= 8; cnt++; } | |
316 | if ( strchr($2, 'A') ) { fl |= 16; cnt++; } | |
317 | if ( strchr($2, 'U') ) { fl |= 32; cnt++; } | |
318 | if ( strchr($2, 'X') ) { fl = 63; cnt++; } | |
319 | ||
320 | if ( cnt != len ) { | |
321 | yyerror("Too many flags"); | |
322 | YYABORT; | |
323 | } | |
324 | ||
325 | $$.self = NewBlock(OffsetFlags, (fl << ShiftFlags) & MaskFlags, | |
326 | (fl << ShiftFlags) & MaskFlags, CMP_FLAGS, FUNC_NONE, NULL); | |
327 | } | |
328 | ||
329 | | dqual IP STRING { | |
330 | int af, bytes, ret; | |
331 | ||
332 | ret = parse_ip(&af, $3, IPstack, &bytes, ALLOW_LOOKUP, &num_ip); | |
333 | ||
334 | if ( ret == 0 ) { | |
335 | yyerror("Error parsing IP address."); | |
336 | YYABORT; | |
337 | } | |
338 | ||
339 | // ret == -1 will never happen here, as ALLOW_LOOKUP is set | |
340 | if ( ret == -2 ) { | |
341 | // could not resolv host => 'not any' | |
342 | $$.self = Invert(NewBlock(OffsetProto, 0, 0, CMP_EQ, FUNC_NONE, NULL )); | |
343 | } else { | |
344 | if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { | |
345 | yyerror("incomplete IP address"); | |
346 | YYABORT; | |
347 | } | |
348 | ||
349 | switch ( $$.direction ) { | |
350 | case SOURCE: | |
351 | case DESTINATION: | |
352 | $$.self = ChainHosts(IPstack, num_ip, $$.direction); | |
353 | break; | |
354 | case DIR_UNSPEC: | |
355 | case SOURCE_OR_DESTINATION: { | |
356 | uint32_t src = ChainHosts(IPstack, num_ip, SOURCE); | |
357 | uint32_t dst = ChainHosts(IPstack, num_ip, DESTINATION); | |
358 | $$.self = Connect_OR(src, dst); | |
359 | } break; | |
360 | case SOURCE_AND_DESTINATION: { | |
361 | uint32_t src = ChainHosts(IPstack, num_ip, SOURCE); | |
362 | uint32_t dst = ChainHosts(IPstack, num_ip, DESTINATION); | |
363 | $$.self = Connect_AND(src, dst); | |
364 | } break; | |
365 | case DIR_IN: | |
366 | case DIR_OUT: | |
367 | case IN_SRC: | |
368 | case IN_DST: | |
369 | case OUT_SRC: | |
370 | case OUT_DST: | |
371 | yyerror("This token is not expected here!"); | |
372 | YYABORT; | |
373 | break; | |
374 | default: | |
375 | /* should never happen */ | |
376 | yyerror("Internal parser error"); | |
377 | YYABORT; | |
378 | ||
379 | } // End of switch | |
380 | ||
381 | } | |
382 | } | |
383 | ||
384 | | dqual IP IN '[' iplist ']' { | |
385 | ||
386 | $$.direction = $1.direction; | |
387 | ||
388 | switch ( $$.direction ) { | |
389 | case SOURCE: | |
390 | $$.self = NewBlock(OffsetSrcIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ); | |
391 | break; | |
392 | case DESTINATION: | |
393 | $$.self = NewBlock(OffsetDstIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ); | |
394 | break; | |
395 | case DIR_UNSPEC: | |
396 | case SOURCE_OR_DESTINATION: | |
397 | $$.self = Connect_OR( | |
398 | NewBlock(OffsetSrcIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ), | |
399 | NewBlock(OffsetDstIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ) | |
400 | ); | |
401 | break; | |
402 | case SOURCE_AND_DESTINATION: | |
403 | $$.self = Connect_AND( | |
404 | NewBlock(OffsetSrcIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ), | |
405 | NewBlock(OffsetDstIPv6a, MaskIPv6, 0 , CMP_IPLIST, FUNC_NONE, (void *)$5 ) | |
406 | ); | |
407 | break; | |
408 | case DIR_IN: | |
409 | case DIR_OUT: | |
410 | case IN_SRC: | |
411 | case IN_DST: | |
412 | case OUT_SRC: | |
413 | case OUT_DST: | |
414 | yyerror("This token is not expected here!"); | |
415 | YYABORT; | |
416 | break; | |
417 | default: | |
418 | /* should never happen */ | |
419 | yyerror("Internal parser error"); | |
420 | YYABORT; | |
421 | } | |
422 | } | |
423 | ||
424 | | NEXTHOP IP STRING { | |
425 | int af, bytes, ret; | |
426 | ||
427 | ret = parse_ip(&af, $3, IPstack, &bytes, STRICT_IP, &num_ip); | |
428 | ||
429 | if ( ret == 0 ) { | |
430 | yyerror("Error parsing IP address."); | |
431 | YYABORT; | |
432 | } | |
433 | ||
434 | if ( ret == -1 ) { | |
435 | yyerror("IP address required - hostname not allowed here."); | |
436 | YYABORT; | |
437 | } | |
438 | // ret == -2 will never happen here, as STRICT_IP is set | |
439 | ||
440 | if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { | |
441 | yyerror("incomplete IP address"); | |
442 | YYABORT; | |
443 | } | |
444 | ||
445 | $$.self = Connect_AND( | |
446 | NewBlock(OffsetNexthopv6b, MaskIPv6, IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), | |
447 | NewBlock(OffsetNexthopv6a, MaskIPv6, IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) | |
448 | ); | |
449 | } | |
450 | ||
451 | | BGPNEXTHOP IP STRING { | |
452 | int af, bytes, ret; | |
453 | ||
454 | ret = parse_ip(&af, $3, IPstack, &bytes, STRICT_IP, &num_ip); | |
455 | ||
456 | if ( ret == 0 ) { | |
457 | yyerror("Error parsing IP address."); | |
458 | YYABORT; | |
459 | } | |
460 | ||
461 | if ( ret == -1 ) { | |
462 | yyerror("IP address required - hostname not allowed here."); | |
463 | YYABORT; | |
464 | } | |
465 | // ret == -2 will never happen here, as STRICT_IP is set | |
466 | ||
467 | if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { | |
468 | yyerror("incomplete IP address"); | |
469 | YYABORT; | |
470 | } | |
471 | ||
472 | $$.self = Connect_AND( | |
473 | NewBlock(OffsetBGPNexthopv6b, MaskIPv6, IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), | |
474 | NewBlock(OffsetBGPNexthopv6a, MaskIPv6, IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) | |
475 | ); | |
476 | } | |
477 | ||
478 | | ROUTER IP STRING { | |
479 | int af, bytes, ret; | |
480 | ||
481 | ret = parse_ip(&af, $3, IPstack, &bytes, STRICT_IP, &num_ip); | |
482 | ||
483 | if ( ret == 0 ) { | |
484 | yyerror("Error parsing IP address."); | |
485 | YYABORT; | |
486 | } | |
487 | ||
488 | if ( ret == -1 ) { | |
489 | yyerror("IP address required - hostname not allowed here."); | |
490 | YYABORT; | |
491 | } | |
492 | // ret == -2 will never happen here, as STRICT_IP is set | |
493 | ||
494 | if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { | |
495 | yyerror("incomplete IP address"); | |
496 | YYABORT; | |
497 | } | |
498 | ||
499 | $$.self = Connect_AND( | |
500 | NewBlock(OffsetRouterv6b, MaskIPv6, IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), | |
501 | NewBlock(OffsetRouterv6a, MaskIPv6, IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) | |
502 | ); | |
503 | } | |
504 | ||
505 | | dqual PORT comp NUMBER { | |
506 | $$.direction = $1.direction; | |
507 | if ( $4 > 65535 ) { | |
508 | yyerror("Port outside of range 0..65535"); | |
509 | YYABORT; | |
510 | } | |
511 | ||
512 | switch ( $$.direction ) { | |
513 | case SOURCE: | |
514 | $$.self = NewBlock(OffsetPort, MaskSrcPort, ($4 << ShiftSrcPort) & MaskSrcPort, $3.comp, FUNC_NONE, NULL ); | |
515 | break; | |
516 | case DESTINATION: | |
517 | $$.self = NewBlock(OffsetPort, MaskDstPort, ($4 << ShiftDstPort) & MaskDstPort, $3.comp, FUNC_NONE, NULL ); | |
518 | break; | |
519 | case DIR_UNSPEC: | |
520 | case SOURCE_OR_DESTINATION: | |
521 | $$.self = Connect_OR( | |
522 | NewBlock(OffsetPort, MaskSrcPort, ($4 << ShiftSrcPort) & MaskSrcPort, $3.comp, FUNC_NONE, NULL ), | |
523 | NewBlock(OffsetPort, MaskDstPort, ($4 << ShiftDstPort) & MaskDstPort, $3.comp, FUNC_NONE, NULL ) | |
524 | ); | |
525 | break; | |
526 | case SOURCE_AND_DESTINATION: | |
527 | $$.self = Connect_AND( | |
528 | NewBlock(OffsetPort, MaskSrcPort, ($4 << ShiftSrcPort) & MaskSrcPort, $3.comp, FUNC_NONE, NULL ), | |
529 | NewBlock(OffsetPort, MaskDstPort, ($4 << ShiftDstPort) & MaskDstPort, $3.comp, FUNC_NONE, NULL ) | |
530 | ); | |
531 | break; | |
532 | case DIR_IN: | |
533 | case DIR_OUT: | |
534 | case IN_SRC: | |
535 | case IN_DST: | |
536 | case OUT_SRC: | |
537 | case OUT_DST: | |
538 | yyerror("This token is not expected here!"); | |
539 | YYABORT; | |
540 | break; | |
541 | default: | |
542 | /* should never happen */ | |
543 | yyerror("Internal parser error"); | |
544 | YYABORT; | |
545 | } // End switch | |
546 | ||
547 | } | |
548 | ||
549 | | dqual PORT IN '[' ullist ']' { | |
550 | struct ULongListNode *node; | |
551 | ULongtree_t *root = NULL; | |
552 | ||
553 | $$.direction = $1.direction; | |
554 | if ( $$.direction == DIR_UNSPEC || $$.direction == SOURCE_OR_DESTINATION || $$.direction == SOURCE_AND_DESTINATION ) { | |
555 | // src and/or dst port | |
556 | // we need a second rbtree due to different shifts for src and dst ports | |
557 | root = malloc(sizeof(ULongtree_t)); | |
558 | ||
559 | struct ULongListNode *n; | |
560 | if ( root == NULL) { | |
561 | yyerror("malloc() error"); | |
562 | YYABORT; | |
563 | } | |
564 | RB_INIT(root); | |
565 | ||
566 | RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { | |
567 | if ((n = malloc(sizeof(struct ULongListNode))) == NULL) { | |
568 | yyerror("malloc() error"); | |
569 | YYABORT; | |
570 | } | |
571 | n->value = (node->value << ShiftDstPort) & MaskDstPort; | |
572 | node->value = (node->value << ShiftSrcPort) & MaskSrcPort; | |
573 | RB_INSERT(ULongtree, root, n); | |
574 | } | |
575 | } | |
576 | ||
577 | switch ( $$.direction ) { | |
578 | case SOURCE: | |
579 | RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { | |
580 | node->value = (node->value << ShiftSrcPort) & MaskSrcPort; | |
581 | } | |
582 | $$.self = NewBlock(OffsetPort, MaskSrcPort, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ); | |
583 | break; | |
584 | case DESTINATION: | |
585 | RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { | |
586 | node->value = (node->value << ShiftDstPort) & MaskDstPort; | |
587 | } | |
588 | $$.self = NewBlock(OffsetPort, MaskDstPort, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ); | |
589 | break; | |
590 | case DIR_UNSPEC: | |
591 | case SOURCE_OR_DESTINATION: | |
592 | $$.self = Connect_OR( | |
593 | NewBlock(OffsetPort, MaskSrcPort, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ), | |
594 | NewBlock(OffsetPort, MaskDstPort, 0, CMP_ULLIST, FUNC_NONE, (void *)root ) | |
595 | ); | |
596 | break; | |
597 | case SOURCE_AND_DESTINATION: | |
598 | $$.self = Connect_AND( | |
599 | NewBlock(OffsetPort, MaskSrcPort, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ), | |
600 | NewBlock(OffsetPort, MaskDstPort, 0, CMP_ULLIST, FUNC_NONE, (void *)root ) | |
601 | ); | |
602 | break; | |
603 | case DIR_IN: | |
604 | case DIR_OUT: | |
605 | case IN_SRC: | |
606 | case IN_DST: | |
607 | case OUT_SRC: | |
608 | case OUT_DST: | |
609 | yyerror("This token is not expected here!"); | |
610 | YYABORT; | |
611 | break; | |
612 | default: | |
613 | /* should never happen */ | |
614 | yyerror("Internal parser error"); | |
615 | YYABORT; | |
616 | } // End of switch | |
617 | ||
618 | } | |
619 | ||
620 | | ICMP_TYPE NUMBER { | |
621 | if ( $2 > 255 ) { | |
622 | yyerror("ICMP tpye of range 0..15"); | |
623 | YYABORT; | |
624 | } | |
625 | $$.self = Connect_AND( | |
626 | // imply proto ICMP with a proto ICMP block | |
627 | Connect_OR ( | |
628 | NewBlock(OffsetProto, MaskProto, ((uint64_t)IPPROTO_ICMP << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL), | |
629 | NewBlock(OffsetProto, MaskProto, ((uint64_t)IPPROTO_ICMPV6 << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL) | |
630 | ), | |
631 | NewBlock(OffsetPort, MaskICMPtype, ($2 << ShiftICMPtype) & MaskICMPtype, CMP_EQ, FUNC_NONE, NULL ) | |
632 | ); | |
633 | ||
634 | } | |
635 | ||
636 | | ICMP_CODE NUMBER { | |
637 | if ( $2 > 255 ) { | |
638 | yyerror("ICMP code of range 0..15"); | |
639 | YYABORT; | |
640 | } | |
641 | $$.self = Connect_AND( | |
642 | // imply proto ICMP with a proto ICMP block | |
643 | Connect_OR ( | |
644 | NewBlock(OffsetProto, MaskProto, ((uint64_t)IPPROTO_ICMP << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL), | |
645 | NewBlock(OffsetProto, MaskProto, ((uint64_t)IPPROTO_ICMPV6 << ShiftProto) & MaskProto, CMP_EQ, FUNC_NONE, NULL) | |
646 | ), | |
647 | NewBlock(OffsetPort, MaskICMPcode, ($2 << ShiftICMPcode) & MaskICMPcode, CMP_EQ, FUNC_NONE, NULL ) | |
648 | ); | |
649 | ||
650 | } | |
651 | ||
652 | | ENGINE_TYPE comp NUMBER { | |
653 | if ( $3 > 255 ) { | |
654 | yyerror("Engine type of range 0..255"); | |
655 | YYABORT; | |
656 | } | |
657 | $$.self = NewBlock(OffsetRouterID, MaskEngineType, ($3 << ShiftEngineType) & MaskEngineType, $2.comp, FUNC_NONE, NULL); | |
658 | ||
659 | } | |
660 | ||
661 | | ENGINE_ID comp NUMBER { | |
662 | if ( $3 > 255 ) { | |
663 | yyerror("Engine ID of range 0..255"); | |
664 | YYABORT; | |
665 | } | |
666 | $$.self = NewBlock(OffsetRouterID, MaskEngineID, ($3 << ShiftEngineID) & MaskEngineID, $2.comp, FUNC_NONE, NULL); | |
667 | ||
668 | } | |
669 | ||
670 | | dqual AS comp NUMBER { | |
671 | $$.direction = $1.direction; | |
672 | if ( $4 > 0x7FFFFFFF || $4 < 0 ) { | |
673 | yyerror("AS number of range"); | |
674 | YYABORT; | |
675 | } | |
676 | ||
677 | switch ( $$.direction ) { | |
678 | case SOURCE: | |
679 | $$.self = NewBlock(OffsetAS, MaskSrcAS, ($4 << ShiftSrcAS) & MaskSrcAS, $3.comp, FUNC_NONE, NULL ); | |
680 | break; | |
681 | case DESTINATION: | |
682 | $$.self = NewBlock(OffsetAS, MaskDstAS, ($4 << ShiftDstAS) & MaskDstAS, $3.comp, FUNC_NONE, NULL); | |
683 | break; | |
684 | case DIR_UNSPEC: | |
685 | case SOURCE_OR_DESTINATION: | |
686 | $$.self = Connect_OR( | |
687 | NewBlock(OffsetAS, MaskSrcAS, ($4 << ShiftSrcAS) & MaskSrcAS, $3.comp, FUNC_NONE, NULL ), | |
688 | NewBlock(OffsetAS, MaskDstAS, ($4 << ShiftDstAS) & MaskDstAS, $3.comp, FUNC_NONE, NULL) | |
689 | ); | |
690 | break; | |
691 | case SOURCE_AND_DESTINATION: | |
692 | $$.self = Connect_AND( | |
693 | NewBlock(OffsetAS, MaskSrcAS, ($4 << ShiftSrcAS) & MaskSrcAS, $3.comp, FUNC_NONE, NULL ), | |
694 | NewBlock(OffsetAS, MaskDstAS, ($4 << ShiftDstAS) & MaskDstAS, $3.comp, FUNC_NONE, NULL) | |
695 | ); | |
696 | break; | |
697 | case DIR_IN: | |
698 | case DIR_OUT: | |
699 | case IN_SRC: | |
700 | case IN_DST: | |
701 | case OUT_SRC: | |
702 | case OUT_DST: | |
703 | yyerror("This token is not expected here!"); | |
704 | YYABORT; | |
705 | break; | |
706 | default: | |
707 | /* should never happen */ | |
708 | yyerror("Internal parser error"); | |
709 | YYABORT; | |
710 | } // End of switch | |
711 | ||
712 | } | |
713 | ||
714 | | dqual AS IN '[' ullist ']' { | |
715 | struct ULongListNode *node; | |
716 | ULongtree_t *root = NULL; | |
717 | ||
718 | $$.direction = $1.direction; | |
719 | if ( $$.direction == DIR_UNSPEC || $$.direction == SOURCE_OR_DESTINATION || $$.direction == SOURCE_AND_DESTINATION ) { | |
720 | // src and/or dst AS | |
721 | // we need a second rbtree due to different shifts for src and dst AS | |
722 | root = malloc(sizeof(ULongtree_t)); | |
723 | ||
724 | struct ULongListNode *n; | |
725 | if ( root == NULL) { | |
726 | yyerror("malloc() error"); | |
727 | YYABORT; | |
728 | } | |
729 | RB_INIT(root); | |
730 | ||
731 | RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { | |
732 | ||
733 | if ((n = malloc(sizeof(struct ULongListNode))) == NULL) { | |
734 | yyerror("malloc() error"); | |
735 | YYABORT; | |
736 | } | |
737 | n->value = (node->value << ShiftDstAS) & MaskDstAS; | |
738 | node->value = (node->value << ShiftSrcAS) & MaskSrcAS; | |
739 | RB_INSERT(ULongtree, root, n); | |
740 | } | |
741 | } | |
742 | ||
743 | switch ( $$.direction ) { | |
744 | case SOURCE: | |
745 | RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { | |
746 | node->value = (node->value << ShiftSrcAS) & MaskSrcAS; | |
747 | } | |
748 | $$.self = NewBlock(OffsetAS, MaskSrcAS, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ); | |
749 | break; | |
750 | case DESTINATION: | |
751 | RB_FOREACH(node, ULongtree, (ULongtree_t *)$5) { | |
752 | node->value = (node->value << ShiftDstAS) & MaskDstAS; | |
753 | } | |
754 | $$.self = NewBlock(OffsetAS, MaskDstAS, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ); | |
755 | break; | |
756 | case DIR_UNSPEC: | |
757 | case SOURCE_OR_DESTINATION: | |
758 | $$.self = Connect_OR( | |
759 | NewBlock(OffsetAS, MaskSrcAS, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ), | |
760 | NewBlock(OffsetAS, MaskDstAS, 0, CMP_ULLIST, FUNC_NONE, (void *)root ) | |
761 | ); | |
762 | break; | |
763 | case SOURCE_AND_DESTINATION: | |
764 | $$.self = Connect_AND( | |
765 | NewBlock(OffsetAS, MaskSrcAS, 0, CMP_ULLIST, FUNC_NONE, (void *)$5 ), | |
766 | NewBlock(OffsetAS, MaskDstAS, 0, CMP_ULLIST, FUNC_NONE, (void *)root ) | |
767 | ); | |
768 | break; | |
769 | case DIR_IN: | |
770 | case DIR_OUT: | |
771 | case IN_SRC: | |
772 | case IN_DST: | |
773 | case OUT_SRC: | |
774 | case OUT_DST: | |
775 | yyerror("This token is not expected here!"); | |
776 | YYABORT; | |
777 | break; | |
778 | default: | |
779 | /* should never happen */ | |
780 | yyerror("Internal parser error"); | |
781 | YYABORT; | |
782 | } | |
783 | ||
784 | } | |
785 | ||
786 | | dqual MASK NUMBER { | |
787 | $$.direction = $1.direction; | |
788 | if ( $3 > 255 ) { | |
789 | yyerror("Mask outside of range 0..255"); | |
790 | YYABORT; | |
791 | } | |
792 | ||
793 | switch ( $$.direction ) { | |
794 | case SOURCE: | |
795 | $$.self = NewBlock(OffsetMask, MaskSrcMask, ($3 << ShiftSrcMask) & MaskSrcMask, CMP_EQ, FUNC_NONE, NULL ); | |
796 | break; | |
797 | case DESTINATION: | |
798 | $$.self = NewBlock(OffsetMask, MaskDstMask, ($3 << ShiftDstMask) & MaskDstMask, CMP_EQ, FUNC_NONE, NULL ); | |
799 | break; | |
800 | case DIR_UNSPEC: | |
801 | case SOURCE_OR_DESTINATION: | |
802 | $$.self = Connect_OR( | |
803 | NewBlock(OffsetMask, MaskSrcMask, ($3 << ShiftSrcMask) & MaskSrcMask, CMP_EQ, FUNC_NONE, NULL ), | |
804 | NewBlock(OffsetMask, MaskDstMask, ($3 << ShiftDstMask) & MaskDstMask, CMP_EQ, FUNC_NONE, NULL ) | |
805 | ); | |
806 | break; | |
807 | case SOURCE_AND_DESTINATION: | |
808 | $$.self = Connect_AND( | |
809 | NewBlock(OffsetMask, MaskSrcMask, ($3 << ShiftSrcMask) & MaskSrcMask, CMP_EQ, FUNC_NONE, NULL ), | |
810 | NewBlock(OffsetMask, MaskDstMask, ($3 << ShiftDstMask) & MaskDstMask, CMP_EQ, FUNC_NONE, NULL ) | |
811 | ); | |
812 | break; | |
813 | case DIR_IN: | |
814 | case DIR_OUT: | |
815 | case IN_SRC: | |
816 | case IN_DST: | |
817 | case OUT_SRC: | |
818 | case OUT_DST: | |
819 | yyerror("This token is not expected here!"); | |
820 | YYABORT; | |
821 | break; | |
822 | default: | |
823 | /* should never happen */ | |
824 | yyerror("Internal parser error"); | |
825 | YYABORT; | |
826 | } // End switch | |
827 | ||
828 | } | |
829 | ||
830 | | dqual NET STRING STRING { | |
831 | int af, bytes, ret; | |
832 | uint64_t mask[2]; | |
833 | ret = parse_ip(&af, $3, IPstack, &bytes, STRICT_IP, &num_ip); | |
834 | ||
835 | if ( ret == 0 ) { | |
836 | yyerror("Invalid IP address"); | |
837 | YYABORT; | |
838 | } | |
839 | ||
840 | if ( ret == -1 ) { | |
841 | yyerror("IP address required - hostname not allowed here."); | |
842 | YYABORT; | |
843 | } | |
844 | // ret == -2 will never happen here, as STRICT_IP is set | |
845 | ||
846 | if ( af != PF_INET ) { | |
847 | yyerror("IP netmask syntax valid only for IPv4"); | |
848 | YYABORT; | |
849 | } | |
850 | if ( bytes != 4 ) { | |
851 | yyerror("Need complete IP address"); | |
852 | YYABORT; | |
853 | } | |
854 | ||
855 | ret = parse_ip(&af, $4, mask, &bytes, STRICT_IP, &num_ip); | |
856 | if ( ret == 0 ) { | |
857 | yyerror("Invalid IP address"); | |
858 | YYABORT; | |
859 | } | |
860 | if ( ret == -1 ) { | |
861 | yyerror("IP address required - hostname not allowed here."); | |
862 | YYABORT; | |
863 | } | |
864 | // ret == -2 will never happen here, as STRICT_IP is set | |
865 | ||
866 | if ( af != PF_INET || bytes != 4 ) { | |
867 | yyerror("Invalid netmask for IPv4 address"); | |
868 | YYABORT; | |
869 | } | |
870 | ||
871 | IPstack[0] &= mask[0]; | |
872 | IPstack[1] &= mask[1]; | |
873 | ||
874 | $$.direction = $1.direction; | |
875 | ||
876 | switch ( $$.direction ) { | |
877 | case SOURCE: | |
878 | $$.self = Connect_AND( | |
879 | NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), | |
880 | NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) | |
881 | ); | |
882 | break; | |
883 | case DESTINATION: | |
884 | $$.self = Connect_AND( | |
885 | NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), | |
886 | NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) | |
887 | ); | |
888 | break; | |
889 | case DIR_UNSPEC: | |
890 | case SOURCE_OR_DESTINATION: | |
891 | $$.self = Connect_OR( | |
892 | Connect_AND( | |
893 | NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), | |
894 | NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) | |
895 | ), | |
896 | Connect_AND( | |
897 | NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), | |
898 | NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) | |
899 | ) | |
900 | ); | |
901 | break; | |
902 | case SOURCE_AND_DESTINATION: | |
903 | $$.self = Connect_AND( | |
904 | Connect_AND( | |
905 | NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), | |
906 | NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) | |
907 | ), | |
908 | Connect_AND( | |
909 | NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), | |
910 | NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) | |
911 | ) | |
912 | ); | |
913 | break; | |
914 | case DIR_IN: | |
915 | case DIR_OUT: | |
916 | case IN_SRC: | |
917 | case IN_DST: | |
918 | case OUT_SRC: | |
919 | case OUT_DST: | |
920 | yyerror("This token is not expected here!"); | |
921 | YYABORT; | |
922 | break; | |
923 | default: | |
924 | /* should never happen */ | |
925 | yyerror("Internal parser error"); | |
926 | YYABORT; | |
927 | } // End of switch | |
928 | ||
929 | } | |
930 | ||
931 | | dqual NET STRING '/' NUMBER { | |
932 | int af, bytes, ret; | |
933 | uint64_t mask[2]; | |
934 | ||
935 | ret = parse_ip(&af, $3, IPstack, &bytes, STRICT_IP, &num_ip); | |
936 | if ( ret == 0 ) { | |
937 | yyerror("Invalid IP address"); | |
938 | YYABORT; | |
939 | } | |
940 | if ( ret == -1 ) { | |
941 | yyerror("IP address required - hostname not allowed here."); | |
942 | YYABORT; | |
943 | } | |
944 | // ret == -2 will never happen here, as STRICT_IP is set | |
945 | ||
946 | ||
947 | if ( $5 > (bytes*8) ) { | |
948 | yyerror("Too many netbits for this IP addresss"); | |
949 | YYABORT; | |
950 | } | |
951 | ||
952 | if ( af == PF_INET ) { | |
953 | mask[0] = 0xffffffffffffffffLL; | |
954 | mask[1] = 0xffffffffffffffffLL << ( 32 - $5 ); | |
955 | } else { // PF_INET6 | |
956 | if ( $5 > 64 ) { | |
957 | mask[0] = 0xffffffffffffffffLL; | |
958 | mask[1] = 0xffffffffffffffffLL << ( 128 - $5 ); | |
959 | } else { | |
960 | mask[0] = 0xffffffffffffffffLL << ( 64 - $5 ); | |
961 | mask[1] = 0; | |
962 | } | |
963 | } | |
964 | // IP aadresses are stored in network representation | |
965 | mask[0] = mask[0]; | |
966 | mask[1] = mask[1]; | |
967 | ||
968 | IPstack[0] &= mask[0]; | |
969 | IPstack[1] &= mask[1]; | |
970 | ||
971 | $$.direction = $1.direction; | |
972 | switch ( $$.direction ) { | |
973 | case SOURCE: | |
974 | $$.self = Connect_AND( | |
975 | NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), | |
976 | NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) | |
977 | ); | |
978 | break; | |
979 | case DESTINATION: | |
980 | $$.self = Connect_AND( | |
981 | NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), | |
982 | NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) | |
983 | ); | |
984 | break; | |
985 | case DIR_UNSPEC: | |
986 | case SOURCE_OR_DESTINATION: | |
987 | $$.self = Connect_OR( | |
988 | Connect_AND( | |
989 | NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), | |
990 | NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) | |
991 | ), | |
992 | Connect_AND( | |
993 | NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), | |
994 | NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) | |
995 | ) | |
996 | ); | |
997 | break; | |
998 | case SOURCE_AND_DESTINATION: | |
999 | $$.self = Connect_AND( | |
1000 | Connect_AND( | |
1001 | NewBlock(OffsetSrcIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), | |
1002 | NewBlock(OffsetSrcIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) | |
1003 | ), | |
1004 | Connect_AND( | |
1005 | NewBlock(OffsetDstIPv6b, mask[1], IPstack[1] , CMP_EQ, FUNC_NONE, NULL ), | |
1006 | NewBlock(OffsetDstIPv6a, mask[0], IPstack[0] , CMP_EQ, FUNC_NONE, NULL ) | |
1007 | ) | |
1008 | ); | |
1009 | break; | |
1010 | case DIR_IN: | |
1011 | case DIR_OUT: | |
1012 | case IN_SRC: | |
1013 | case IN_DST: | |
1014 | case OUT_SRC: | |
1015 | case OUT_DST: | |
1016 | yyerror("This token is not expected here!"); | |
1017 | YYABORT; | |
1018 | break; | |
1019 | default: | |
1020 | /* should never happen */ | |
1021 | yyerror("Internal parser error"); | |
1022 | YYABORT; | |
1023 | } // End of switch | |
1024 | ||
1025 | } | |
1026 | ||
1027 | | dqual IF NUMBER { | |
1028 | if ( $3 > 0x00000000ffffffffLL ) { | |
1029 | yyerror("Input interface number must 0..2^32"); | |
1030 | YYABORT; | |
1031 | } | |
1032 | ||
1033 | switch ( $$.direction ) { | |
1034 | case DIR_UNSPEC: | |
1035 | $$.self = Connect_OR( | |
1036 | NewBlock(OffsetInOut, MaskInput, ($3 << ShiftInput) & MaskInput, CMP_EQ, FUNC_NONE, NULL), | |
1037 | NewBlock(OffsetInOut, MaskOutput, ($3 << ShiftOutput) & MaskOutput, CMP_EQ, FUNC_NONE, NULL) | |
1038 | ); | |
1039 | break; | |
1040 | case DIR_IN: | |
1041 | $$.self = NewBlock(OffsetInOut, MaskInput, ($3 << ShiftInput) & MaskInput, CMP_EQ, FUNC_NONE, NULL); | |
1042 | break; | |
1043 | case DIR_OUT: | |
1044 | $$.self = NewBlock(OffsetInOut, MaskOutput, ($3 << ShiftOutput) & MaskOutput, CMP_EQ, FUNC_NONE, NULL); | |
1045 | break; | |
1046 | case SOURCE: | |
1047 | case DESTINATION: | |
1048 | case SOURCE_OR_DESTINATION: | |
1049 | case SOURCE_AND_DESTINATION: | |
1050 | case IN_SRC: | |
1051 | case IN_DST: | |
1052 | case OUT_SRC: | |
1053 | case OUT_DST: | |
1054 | yyerror("This token is not expected here!"); | |
1055 | YYABORT; | |
1056 | break; | |
1057 | default: | |
1058 | /* should never happen */ | |
1059 | yyerror("Internal parser error"); | |
1060 | YYABORT; | |
1061 | } // End of switch | |
1062 | ||
1063 | } | |
1064 | ||
1065 | | dqual VLAN NUMBER { | |
1066 | $$.direction = $1.direction; | |
1067 | if ( $3 > 65535 || $3 < 0 ) { | |
1068 | yyerror("VLAN number of range 0..65535"); | |
1069 | YYABORT; | |
1070 | } | |
1071 | ||
1072 | switch ( $$.direction ) { | |
1073 | case SOURCE: | |
1074 | $$.self = NewBlock(OffsetVlan, MaskSrcVlan, ($3 << ShiftSrcVlan) & MaskSrcVlan, CMP_EQ, FUNC_NONE, NULL ); | |
1075 | break; | |
1076 | case DESTINATION: | |
1077 | $$.self = NewBlock(OffsetVlan, MaskDstVlan, ($3 << ShiftDstVlan) & MaskDstVlan, CMP_EQ, FUNC_NONE, NULL); | |
1078 | break; | |
1079 | case DIR_UNSPEC: | |
1080 | case SOURCE_OR_DESTINATION: | |
1081 | $$.self = Connect_OR( | |
1082 | NewBlock(OffsetVlan, MaskSrcVlan, ($3 << ShiftSrcVlan) & MaskSrcVlan, CMP_EQ, FUNC_NONE, NULL ), | |
1083 | NewBlock(OffsetVlan, MaskDstVlan, ($3 << ShiftDstVlan) & MaskDstVlan, CMP_EQ, FUNC_NONE, NULL) | |
1084 | ); | |
1085 | break; | |
1086 | case SOURCE_AND_DESTINATION: | |
1087 | $$.self = Connect_AND( | |
1088 | NewBlock(OffsetVlan, MaskSrcVlan, ($3 << ShiftSrcVlan) & MaskSrcVlan, CMP_EQ, FUNC_NONE, NULL ), | |
1089 | NewBlock(OffsetVlan, MaskDstVlan, ($3 << ShiftDstVlan) & MaskDstVlan, CMP_EQ, FUNC_NONE, NULL) | |
1090 | ); | |
1091 | break; | |
1092 | case DIR_IN: | |
1093 | case DIR_OUT: | |
1094 | case IN_SRC: | |
1095 | case IN_DST: | |
1096 | case OUT_SRC: | |
1097 | case OUT_DST: | |
1098 | yyerror("This token is not expected here!"); | |
1099 | YYABORT; | |
1100 | break; | |
1101 | default: | |
1102 | /* should never happen */ | |
1103 | yyerror("Internal parser error"); | |
1104 | YYABORT; | |
1105 | } // End of switch | |
1106 | ||
1107 | } | |
1108 | ||
1109 | | dqual MAC STRING { | |
1110 | uint64_t mac = VerifyMac($3); | |
1111 | if ( mac == 0 ) { | |
1112 | yyerror("Invalid MAC address format"); | |
1113 | YYABORT; | |
1114 | } | |
1115 | switch ( $$.direction ) { | |
1116 | case DIR_UNSPEC: { | |
1117 | uint32_t in, out; | |
1118 | in = Connect_OR( | |
1119 | NewBlock(OffsetInSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), | |
1120 | NewBlock(OffsetInDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) | |
1121 | ); | |
1122 | out = Connect_OR( | |
1123 | NewBlock(OffsetOutSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), | |
1124 | NewBlock(OffsetOutDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) | |
1125 | ); | |
1126 | $$.self = Connect_OR(in, out); | |
1127 | } break; | |
1128 | case DIR_IN: | |
1129 | $$.self = Connect_OR( | |
1130 | NewBlock(OffsetInSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), | |
1131 | NewBlock(OffsetInDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) | |
1132 | ); | |
1133 | break; | |
1134 | case DIR_OUT: | |
1135 | $$.self = Connect_OR( | |
1136 | NewBlock(OffsetOutSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), | |
1137 | NewBlock(OffsetOutDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) | |
1138 | ); | |
1139 | break; | |
1140 | case SOURCE: | |
1141 | $$.self = Connect_OR( | |
1142 | NewBlock(OffsetInSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), | |
1143 | NewBlock(OffsetOutSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) | |
1144 | ); | |
1145 | break; | |
1146 | case DESTINATION: | |
1147 | $$.self = Connect_OR( | |
1148 | NewBlock(OffsetInDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ), | |
1149 | NewBlock(OffsetOutDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ) | |
1150 | ); | |
1151 | break; | |
1152 | case IN_SRC: | |
1153 | $$.self = NewBlock(OffsetInSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ); | |
1154 | break; | |
1155 | case IN_DST: | |
1156 | $$.self = NewBlock(OffsetInDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ); | |
1157 | break; | |
1158 | case OUT_SRC: | |
1159 | $$.self = NewBlock(OffsetOutSrcMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ); | |
1160 | break; | |
1161 | case OUT_DST: | |
1162 | $$.self = NewBlock(OffsetOutDstMAC, MaskMac, mac, CMP_EQ, FUNC_NONE, NULL ); | |
1163 | break; | |
1164 | case SOURCE_OR_DESTINATION: | |
1165 | case SOURCE_AND_DESTINATION: | |
1166 | yyerror("This token is not expected here!"); | |
1167 | YYABORT; | |
1168 | break; | |
1169 | default: | |
1170 | /* should never happen */ | |
1171 | yyerror("Internal parser error"); | |
1172 | YYABORT; | |
1173 | } // End of switch | |
1174 | } | |
1175 | ||
1176 | | MPLS STRING comp NUMBER { | |
1177 | if ( $4 > MPLSMAX ) { | |
1178 | yyerror("MPLS value out of range"); | |
1179 | YYABORT; | |
1180 | } | |
1181 | ||
1182 | // search for label1 - label10 | |
1183 | if ( strncasecmp($2, "label", 5) == 0 ) { | |
1184 | uint64_t mask; | |
1185 | uint32_t offset, shift; | |
1186 | char *s = &$2[5]; | |
1187 | if ( s == '\0' ) { | |
1188 | yyerror("Missing label number"); | |
1189 | YYABORT; | |
1190 | } | |
1191 | int i = (int)strtol(s, (char **)NULL, 10); | |
1192 | ||
1193 | switch (i) { | |
1194 | case 1: | |
1195 | offset = OffsetMPLS12; | |
1196 | mask = MaskMPLSlabelOdd; | |
1197 | shift = ShiftMPLSlabelOdd; | |
1198 | break; | |
1199 | case 2: | |
1200 | offset = OffsetMPLS12; | |
1201 | mask = MaskMPLSlabelEven; | |
1202 | shift = ShiftMPLSlabelEven; | |
1203 | break; | |
1204 | case 3: | |
1205 | offset = OffsetMPLS34; | |
1206 | mask = MaskMPLSlabelOdd; | |
1207 | shift = ShiftMPLSlabelOdd; | |
1208 | break; | |
1209 | case 4: | |
1210 | offset = OffsetMPLS34; | |
1211 | mask = MaskMPLSlabelEven; | |
1212 | shift = ShiftMPLSlabelEven; | |
1213 | break; | |
1214 | case 5: | |
1215 | offset = OffsetMPLS56; | |
1216 | mask = MaskMPLSlabelOdd; | |
1217 | shift = ShiftMPLSlabelOdd; | |
1218 | break; | |
1219 | case 6: | |
1220 | offset = OffsetMPLS56; | |
1221 | mask = MaskMPLSlabelEven; | |
1222 | shift = ShiftMPLSlabelEven; | |
1223 | break; | |
1224 | case 7: | |
1225 | offset = OffsetMPLS78; | |
1226 | mask = MaskMPLSlabelOdd; | |
1227 | shift = ShiftMPLSlabelOdd; | |
1228 | break; | |
1229 | case 8: | |
1230 | offset = OffsetMPLS78; | |
1231 | mask = MaskMPLSlabelEven; | |
1232 | shift = ShiftMPLSlabelEven; | |
1233 | break; | |
1234 | case 9: | |
1235 | offset = OffsetMPLS910; | |
1236 | mask = MaskMPLSlabelOdd; | |
1237 | shift = ShiftMPLSlabelOdd; | |
1238 | break; | |
1239 | case 10: | |
1240 | offset = OffsetMPLS910; | |
1241 | mask = MaskMPLSlabelEven; | |
1242 | shift = ShiftMPLSlabelEven; | |
1243 | break; | |
1244 | default: | |
1245 | yyerror("MPLS label out of range 1..10"); | |
1246 | YYABORT; | |
1247 | } | |
1248 | $$.self = NewBlock(offset, mask, ($4 << shift) & mask, $3.comp, FUNC_NONE, NULL ); | |
1249 | ||
1250 | } else if ( strcasecmp($2, "eos") == 0 ) { | |
1251 | // match End of Stack label | |
1252 | $$.self = NewBlock(0, AnyMask, $4 << 4, $3.comp, FUNC_MPLS_EOS, NULL ); | |
1253 | ||
1254 | } else if ( strncasecmp($2, "exp", 3) == 0 ) { | |
1255 | uint64_t mask; | |
1256 | uint32_t offset, shift; | |
1257 | char *s = &$2[3]; | |
1258 | if ( s == '\0' ) { | |
1259 | yyerror("Missing label number"); | |
1260 | YYABORT; | |
1261 | } | |
1262 | int i = (int)strtol(s, (char **)NULL, 10); | |
1263 | ||
1264 | if ( $4 < 0 || $4 > 7 ) { | |
1265 | yyerror("MPLS exp value out of range"); | |
1266 | YYABORT; | |
1267 | } | |
1268 | ||
1269 | switch (i) { | |
1270 | case 1: | |
1271 | offset = OffsetMPLS12; | |
1272 | mask = MaskMPLSexpOdd; | |
1273 | shift = ShiftMPLSexpOdd; | |
1274 | break; | |
1275 | case 2: | |
1276 | offset = OffsetMPLS12; | |
1277 | mask = MaskMPLSexpEven; | |
1278 | shift = ShiftMPLSexpEven; | |
1279 | break; | |
1280 | case 3: | |
1281 | offset = OffsetMPLS34; | |
1282 | mask = MaskMPLSexpOdd; | |
1283 | shift = ShiftMPLSexpOdd; | |
1284 | break; | |
1285 | case 4: | |
1286 | offset = OffsetMPLS34; | |
1287 | mask = MaskMPLSexpEven; | |
1288 | shift = ShiftMPLSexpEven; | |
1289 | break; | |
1290 | case 5: | |
1291 | offset = OffsetMPLS56; | |
1292 | mask = MaskMPLSexpOdd; | |
1293 | shift = ShiftMPLSexpOdd; | |
1294 | break; | |
1295 | case 6: | |
1296 | offset = OffsetMPLS56; | |
1297 | mask = MaskMPLSexpEven; | |
1298 | shift = ShiftMPLSexpEven; | |
1299 | break; | |
1300 | case 7: | |
1301 | offset = OffsetMPLS78; | |
1302 | mask = MaskMPLSexpOdd; | |
1303 | shift = ShiftMPLSexpOdd; | |
1304 | break; | |
1305 | case 8: | |
1306 | offset = OffsetMPLS78; | |
1307 | mask = MaskMPLSexpEven; | |
1308 | shift = ShiftMPLSexpEven; | |
1309 | break; | |
1310 | case 9: | |
1311 | offset = OffsetMPLS910; | |
1312 | mask = MaskMPLSexpOdd; | |
1313 | shift = ShiftMPLSexpOdd; | |
1314 | break; | |
1315 | case 10: | |
1316 | offset = OffsetMPLS910; | |
1317 | mask = MaskMPLSexpEven; | |
1318 | shift = ShiftMPLSexpEven; | |
1319 | break; | |
1320 | default: | |
1321 | yyerror("MPLS label out of range 1..10"); | |
1322 | YYABORT; | |
1323 | } | |
1324 | $$.self = NewBlock(offset, mask, $4 << shift, $3.comp, FUNC_NONE, NULL ); | |
1325 | ||
1326 | } else { | |
1327 | yyerror("Unknown MPLS option"); | |
1328 | YYABORT; | |
1329 | } | |
1330 | } | |
1331 | | MPLS ANY NUMBER { | |
1332 | uint32_t *opt = malloc(sizeof(uint32_t)); | |
1333 | if ( $3 > MPLSMAX ) { | |
1334 | yyerror("MPLS value out of range"); | |
1335 | YYABORT; | |
1336 | } | |
1337 | if ( opt == NULL) { | |
1338 | yyerror("malloc() error"); | |
1339 | YYABORT; | |
1340 | } | |
1341 | *opt = $3 << 4; | |
1342 | $$.self = NewBlock(0, AnyMask, $3 << 4, CMP_EQ, FUNC_MPLS_ANY, opt ); | |
1343 | ||
1344 | } | |
1345 | | FWDSTAT NUMBER { | |
1346 | if ( $2 > 255 ) { | |
1347 | yyerror("Forwarding status of range 0..255"); | |
1348 | YYABORT; | |
1349 | } | |
1350 | $$.self = NewBlock(OffsetStatus, MaskStatus, ($2 << ShiftStatus) & MaskStatus, CMP_EQ, FUNC_NONE, NULL); | |
1351 | } | |
1352 | ||
1353 | | FWDSTAT STRING { | |
1354 | uint64_t id = Get_fwd_status_id($2); | |
1355 | if (id == 256 ) { | |
1356 | yyerror("Unknown forwarding status"); | |
1357 | YYABORT; | |
1358 | } | |
1359 | ||
1360 | $$.self = NewBlock(OffsetStatus, MaskStatus, (id << ShiftStatus) & MaskStatus, CMP_EQ, FUNC_NONE, NULL); | |
1361 | ||
1362 | } | |
1363 | ||
1364 | | DIR NUMBER { | |
1365 | if ( $2 > 2 ) { | |
1366 | yyerror("Flow direction status of range 0, 1"); | |
1367 | YYABORT; | |
1368 | } | |
1369 | $$.self = NewBlock(OffsetDir, MaskDir, ($2 << ShiftDir) & MaskDir, CMP_EQ, FUNC_NONE, NULL); | |
1370 | ||
1371 | } | |
1372 | ||
1373 | | DIR STRING { | |
1374 | uint64_t dir = 0xFF; | |
1375 | if ( strcasecmp($2, "ingress") == 0 ) | |
1376 | dir = 0; | |
1377 | else if ( strcasecmp($2, "egress") == 0 ) | |
1378 | dir = 1; | |
1379 | else { | |
1380 | yyerror("Flow direction status of range ingress, egress"); | |
1381 | YYABORT; | |
1382 | } | |
1383 | ||
1384 | $$.self = NewBlock(OffsetDir, MaskDir, (dir << ShiftDir) & MaskDir, CMP_EQ, FUNC_NONE, NULL); | |
1385 | ||
1386 | } | |
1387 | ||
1388 | /* iplist definition */ | |
1389 | iplist: STRING { | |
1390 | int i, af, bytes, ret; | |
1391 | struct IPListNode *node; | |
1392 | ||
1393 | IPlist_t *root = malloc(sizeof(IPlist_t)); | |
1394 | ||
1395 | if ( root == NULL) { | |
1396 | yyerror("malloc() error"); | |
1397 | YYABORT; | |
1398 | } | |
1399 | RB_INIT(root); | |
1400 | ||
1401 | ret = parse_ip(&af, $1, IPstack, &bytes, ALLOW_LOOKUP, &num_ip); | |
1402 | ||
1403 | if ( ret == 0 ) { | |
1404 | yyerror("Invalid IP address"); | |
1405 | YYABORT; | |
1406 | } | |
1407 | // ret == -1 will never happen here, as ALLOW_LOOKUP is set | |
1408 | ||
1409 | if ( ret != -2 ) { | |
1410 | if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { | |
1411 | yyerror("incomplete IP address"); | |
1412 | YYABORT; | |
1413 | } | |
1414 | ||
1415 | for ( i=0; i<num_ip; i++ ) { | |
1416 | if ((node = malloc(sizeof(struct IPListNode))) == NULL) { | |
1417 | yyerror("malloc() error"); | |
1418 | YYABORT; | |
1419 | } | |
1420 | node->ip[0] = IPstack[2*i]; | |
1421 | node->ip[1] = IPstack[2*i+1]; | |
1422 | node->mask[0] = 0xffffffffffffffffLL; | |
1423 | node->mask[1] = 0xffffffffffffffffLL; | |
1424 | RB_INSERT(IPtree, root, node); | |
1425 | } | |
1426 | ||
1427 | } | |
1428 | $$ = (void *)root; | |
1429 | ||
1430 | } | |
1431 | ||
1432 | iplist: STRING '/' NUMBER { | |
1433 | int af, bytes, ret; | |
1434 | struct IPListNode *node; | |
1435 | ||
1436 | IPlist_t *root = malloc(sizeof(IPlist_t)); | |
1437 | ||
1438 | if ( root == NULL) { | |
1439 | yyerror("malloc() error"); | |
1440 | YYABORT; | |
1441 | } | |
1442 | RB_INIT(root); | |
1443 | ||
1444 | ret = parse_ip(&af, $1, IPstack, &bytes, STRICT_IP, &num_ip); | |
1445 | ||
1446 | if ( ret == 0 ) { | |
1447 | yyerror("Invalid IP address"); | |
1448 | YYABORT; | |
1449 | } | |
1450 | // ret == -1 will never happen here, as ALLOW_LOOKUP is set | |
1451 | ||
1452 | if ( ret != -2 ) { | |
1453 | if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { | |
1454 | yyerror("incomplete IP address"); | |
1455 | YYABORT; | |
1456 | } | |
1457 | ||
1458 | if ((node = malloc(sizeof(struct IPListNode))) == NULL) { | |
1459 | yyerror("malloc() error"); | |
1460 | YYABORT; | |
1461 | } | |
1462 | ||
1463 | if ( af == PF_INET ) { | |
1464 | node->mask[0] = 0xffffffffffffffffLL; | |
1465 | node->mask[1] = 0xffffffffffffffffLL << ( 32 - $3 ); | |
1466 | } else { // PF_INET6 | |
1467 | if ( $3 > 64 ) { | |
1468 | node->mask[0] = 0xffffffffffffffffLL; | |
1469 | node->mask[1] = 0xffffffffffffffffLL << ( 128 - $3 ); | |
1470 | } else { | |
1471 | node->mask[0] = 0xffffffffffffffffLL << ( 64 - $3 ); | |
1472 | node->mask[1] = 0; | |
1473 | } | |
1474 | } | |
1475 | ||
1476 | node->ip[0] = IPstack[0] & node->mask[0]; | |
1477 | node->ip[1] = IPstack[1] & node->mask[1]; | |
1478 | ||
1479 | RB_INSERT(IPtree, root, node); | |
1480 | ||
1481 | } | |
1482 | $$ = (void *)root; | |
1483 | ||
1484 | } | |
1485 | ||
1486 | | iplist STRING { | |
1487 | int i, af, bytes, ret; | |
1488 | struct IPListNode *node; | |
1489 | ||
1490 | ret = parse_ip(&af, $2, IPstack, &bytes, ALLOW_LOOKUP, &num_ip); | |
1491 | ||
1492 | if ( ret == 0 ) { | |
1493 | yyerror("Invalid IP address"); | |
1494 | YYABORT; | |
1495 | } | |
1496 | if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { | |
1497 | yyerror("incomplete IP address"); | |
1498 | YYABORT; | |
1499 | } | |
1500 | ||
1501 | // ret == - 2 means lookup failure | |
1502 | if ( ret != -2 ) { | |
1503 | for ( i=0; i<num_ip; i++ ) { | |
1504 | if ((node = malloc(sizeof(struct IPListNode))) == NULL) { | |
1505 | yyerror("malloc() error"); | |
1506 | YYABORT; | |
1507 | } | |
1508 | node->ip[0] = IPstack[2*i]; | |
1509 | node->ip[1] = IPstack[2*i+1]; | |
1510 | node->mask[0] = 0xffffffffffffffffLL; | |
1511 | node->mask[1] = 0xffffffffffffffffLL; | |
1512 | ||
1513 | RB_INSERT(IPtree, (IPlist_t *)$$, node); | |
1514 | } | |
1515 | } | |
1516 | } | |
1517 | ||
1518 | | iplist STRING '/' NUMBER { | |
1519 | int af, bytes, ret; | |
1520 | struct IPListNode *node; | |
1521 | ||
1522 | ret = parse_ip(&af, $2, IPstack, &bytes, STRICT_IP, &num_ip); | |
1523 | ||
1524 | if ( ret == 0 ) { | |
1525 | yyerror("Invalid IP address"); | |
1526 | YYABORT; | |
1527 | } | |
1528 | if ( af && (( af == PF_INET && bytes != 4 ) || ( af == PF_INET6 && bytes != 16 ))) { | |
1529 | yyerror("incomplete IP address"); | |
1530 | YYABORT; | |
1531 | } | |
1532 | ||
1533 | // ret == - 2 means lookup failure | |
1534 | if ( ret != -2 ) { | |
1535 | if ((node = malloc(sizeof(struct IPListNode))) == NULL) { | |
1536 | yyerror("malloc() error"); | |
1537 | YYABORT; | |
1538 | } | |
1539 | if ( af == PF_INET ) { | |
1540 | node->mask[0] = 0xffffffffffffffffLL; | |
1541 | node->mask[1] = 0xffffffffffffffffLL << ( 32 - $4 ); | |
1542 | } else { // PF_INET6 | |
1543 | if ( $4 > 64 ) { | |
1544 | node->mask[0] = 0xffffffffffffffffLL; | |
1545 | node->mask[1] = 0xffffffffffffffffLL << ( 128 - $4 ); | |
1546 | } else { | |
1547 | node->mask[0] = 0xffffffffffffffffLL << ( 64 - $4 ); | |
1548 | node->mask[1] = 0; | |
1549 | } | |
1550 | } | |
1551 | ||
1552 | node->ip[0] = IPstack[0] & node->mask[0]; | |
1553 | node->ip[1] = IPstack[1] & node->mask[1]; | |
1554 | ||
1555 | RB_INSERT(IPtree, (IPlist_t *)$$, node); | |
1556 | } | |
1557 | } | |
1558 | ||
1559 | ; | |
1560 | ||
1561 | /* ULlist definition */ | |
1562 | ullist: NUMBER { | |
1563 | struct ULongListNode *node; | |
1564 | ||
1565 | if ( $1 > 65535 ) { | |
1566 | yyerror("Value outside of range 0..65535"); | |
1567 | YYABORT; | |
1568 | } | |
1569 | ULongtree_t *root = malloc(sizeof(ULongtree_t)); | |
1570 | ||
1571 | if ( root == NULL) { | |
1572 | yyerror("malloc() error"); | |
1573 | YYABORT; | |
1574 | } | |
1575 | RB_INIT(root); | |
1576 | ||
1577 | if ((node = malloc(sizeof(struct ULongListNode))) == NULL) { | |
1578 | yyerror("malloc() error"); | |
1579 | YYABORT; | |
1580 | } | |
1581 | node->value = $1; | |
1582 | ||
1583 | RB_INSERT(ULongtree, root, node); | |
1584 | $$ = (void *)root; | |
1585 | } | |
1586 | | ullist NUMBER { | |
1587 | struct ULongListNode *node; | |
1588 | ||
1589 | if ( $2 > 65535 ) { | |
1590 | yyerror("Value outside of range 0..65535"); | |
1591 | YYABORT; | |
1592 | } | |
1593 | if ((node = malloc(sizeof(struct ULongListNode))) == NULL) { | |
1594 | yyerror("malloc() error"); | |
1595 | YYABORT; | |
1596 | } | |
1597 | node->value = $2; | |
1598 | RB_INSERT(ULongtree, (ULongtree_t *)$$, node); | |
1599 | } | |
1600 | ; | |
1601 | ||
1602 | /* scaling qualifiers */ | |
1603 | ||
1604 | /* comparator qualifiers */ | |
1605 | comp: { $$.comp = CMP_EQ; } | |
1606 | | EQ { $$.comp = CMP_EQ; } | |
1607 | | LT { $$.comp = CMP_LT; } | |
1608 | | GT { $$.comp = CMP_GT; } | |
1609 | ; | |
1610 | ||
1611 | /* 'direction' qualifiers */ | |
1612 | dqual: { $$.direction = DIR_UNSPEC; } | |
1613 | | SRC { $$.direction = SOURCE; } | |
1614 | | DST { $$.direction = DESTINATION; } | |
1615 | | SRC OR DST { $$.direction = SOURCE_OR_DESTINATION; } | |
1616 | | DST OR SRC { $$.direction = SOURCE_OR_DESTINATION; } | |
1617 | | SRC AND DST { $$.direction = SOURCE_AND_DESTINATION; } | |
1618 | | DST AND SRC { $$.direction = SOURCE_AND_DESTINATION; } | |
1619 | | IN { $$.direction = DIR_IN; } | |
1620 | | OUT { $$.direction = DIR_OUT; } | |
1621 | | IN SRC { $$.direction = IN_SRC; } | |
1622 | | IN DST { $$.direction = IN_DST; } | |
1623 | | OUT SRC { $$.direction = OUT_SRC; } | |
1624 | | OUT DST { $$.direction = OUT_DST; } | |
1625 | ; | |
1626 | ||
1627 | expr: term { $$ = $1.self; } | |
1628 | | expr OR expr { $$ = Connect_OR($1, $3); } | |
1629 | | expr AND expr { $$ = Connect_AND($1, $3); } | |
1630 | | NOT expr %prec NEGATE { $$ = Invert($2); } | |
1631 | | '(' expr ')' { $$ = $2; } | |
1632 | ; | |
1633 | ||
1634 | %% | |
1635 | ||
1636 | static void yyerror(char *msg) { | |
1637 | ||
1638 | if ( FilterFilename ) | |
1639 | snprintf(yyerror_buff, 255 ,"File '%s' line %d: %s at '%s'", FilterFilename, lineno, msg, yytext); | |
1640 | else | |
1641 | snprintf(yyerror_buff, 255, "Line %d: %s at '%s'", lineno, msg, yytext); | |
1642 | ||
1643 | yyerror_buff[255] = '\0'; | |
1644 | fprintf(stderr, "%s\n", yyerror_buff); | |
1645 | ||
1646 | } /* End of yyerror */ | |
1647 | ||
1648 | static uint32_t ChainHosts(uint64_t *hostlist, int num_records, int type) { | |
1649 | uint32_t offset_a, offset_b, i, j, block; | |
1650 | ||
1651 | if ( type == SOURCE ) { | |
1652 | offset_a = OffsetSrcIPv6a; | |
1653 | offset_b = OffsetSrcIPv6b; | |
1654 | } else { | |
1655 | offset_a = OffsetDstIPv6a; | |
1656 | offset_b = OffsetDstIPv6b; | |
1657 | } | |
1658 | ||
1659 | i = 0; | |
1660 | block = Connect_AND( | |
1661 | NewBlock(offset_b, MaskIPv6, hostlist[i+1] , CMP_EQ, FUNC_NONE, NULL ), | |
1662 | NewBlock(offset_a, MaskIPv6, hostlist[i] , CMP_EQ, FUNC_NONE, NULL ) | |
1663 | ); | |
1664 | i += 2; | |
1665 | for ( j=1; j<num_records; j++ ) { | |
1666 | uint32_t b = Connect_AND( | |
1667 | NewBlock(offset_b, MaskIPv6, hostlist[i+1] , CMP_EQ, FUNC_NONE, NULL ), | |
1668 | NewBlock(offset_a, MaskIPv6, hostlist[i] , CMP_EQ, FUNC_NONE, NULL ) | |
1669 | ); | |
1670 | block = Connect_OR(block, b); | |
1671 | i += 2; | |
1672 | } | |
1673 | ||
1674 | return block; | |
1675 | ||
1676 | } // End of ChainHosts | |
1677 | ||
1678 | uint64_t VerifyMac(char *s) { | |
1679 | uint64_t mac; | |
1680 | size_t slen = strlen(s); | |
1681 | long l; | |
1682 | char *p, *q, *r; | |
1683 | int i; | |
1684 | ||
1685 | if ( slen > 17 ) | |
1686 | return 0; | |
1687 | ||
1688 | for (i=0; i<slen; i++ ) { | |
1689 | if ( !isxdigit(s[i]) && s[i] != ':' ) | |
1690 | return 0; | |
1691 | } | |
1692 | ||
1693 | p = strdup(s); | |
1694 | if ( !p ) { | |
1695 | yyerror("malloc() error"); | |
1696 | return 0; | |
1697 | } | |
1698 | ||
1699 | mac = 0; | |
1700 | i = 0; // number of MAC octets must be 6 | |
1701 | r = p; | |
1702 | q = strchr(r, ':'); | |
1703 | while ( r && i < 6 ) { | |
1704 | if ( q ) | |
1705 | *q = '\0'; | |
1706 | l = strtol(r, NULL, 16); | |
1707 | if ( l > 255 ) { | |
1708 | free(p); | |
1709 | return 0; | |
1710 | } | |
1711 | ||
1712 | mac = ( mac << 8 ) | (l & 0xFF ); | |
1713 | i++; | |
1714 | ||
1715 | if ( q ) { | |
1716 | r = ++q; | |
1717 | q = strchr(r, ':'); | |
1718 | } else | |
1719 | r = NULL; | |
1720 | } | |
1721 | ||
1722 | if ( i != 6 ) | |
1723 | return 0; | |
1724 | ||
1725 | return mac; | |
1726 | ||
1727 | } // End of VerifyMac | |
1728 | ||
1729 | /* | |
1730 | ||
1731 | mpls 1 == 3 | |
1732 | mpls label1 == 3 | |
1733 | mpls any == 4 | |
1734 | ||
1735 | ||
1736 | ||
1737 | ||
1738 | */ |
186 | 186 | static inline exporter_v5_t *GetExporter(FlowSource_t *fs, netflow_v5_header_t *header) { |
187 | 187 | exporter_v5_t **e = (exporter_v5_t **)&(fs->exporter_data); |
188 | 188 | uint16_t engine_tag = ntohs(header->engine_tag); |
189 | uint16_t version = ntohs(header->version); | |
189 | 190 | #define IP_STRING_LEN 40 |
190 | 191 | char ipstr[IP_STRING_LEN]; |
191 | 192 | |
192 | 193 | // search the appropriate exporter engine |
193 | 194 | while ( *e ) { |
194 | if ( (*e)->version == 5 && (*e)->engine_tag == engine_tag && | |
195 | if ( (*e)->version == version && (*e)->engine_tag == engine_tag && | |
195 | 196 | (*e)->ip.v6[0] == fs->ip.v6[0] && (*e)->ip.v6[1] == fs->ip.v6[1]) |
196 | 197 | return *e; |
197 | 198 | e = &((*e)->next); |
212 | 213 | (*e)->sampling_mode = (0xC000 & ntohs(header->sampling_interval)) >> 14; |
213 | 214 | (*e)->sampling_interval = 0x3fff & ntohs(header->sampling_interval); |
214 | 215 | (*e)->next = NULL; |
215 | (*e)->version = 5; | |
216 | (*e)->version = version; | |
216 | 217 | (*e)->first = 1; |
217 | 218 | |
218 | 219 | // default is global default_sampling ( user defined or unsampled => 1 ) |
349 | 350 | #define delta(a,b) ( (a)>(b) ? (a)-(b) : (b)-(a) ) |
350 | 351 | fs->stat_record.sequence_failure++; |
351 | 352 | /* |
352 | syslog(LOG_ERR,"Flow sequence mismatch. Missing: %lli flows", delta(last_count,distance)); | |
353 | syslog(LOG_ERR,"sequence %llu. last sequence: %lli", sequence, last_sequence); | |
354 | if ( report_seq ) | |
355 | syslog(LOG_ERR,"Flow sequence mismatch. Missing: %lli flows", delta(last_count,distance)); | |
353 | syslog(LOG_ERR,"Flow v%d sequence last:%llu now:%llu mismatch. Missing: dist:%lu flows", | |
354 | version, exporter->last_sequence, exporter->sequence, exporter->distance); | |
355 | ||
356 | 356 | */ |
357 | 357 | } |
358 | 358 | } |
450 | 450 | First = ntohl(v5_record->First); |
451 | 451 | Last = ntohl(v5_record->Last); |
452 | 452 | |
453 | if ( First > Last ) | |
453 | ||
454 | #ifdef FIXTIMEBUG | |
455 | // assume bug, some users reported - swap time stamps | |
456 | if ( First > Last && ( (First - Last) < 20000) ) { | |
457 | uint32_t _t; | |
458 | syslog(LOG_ERR,"Process_v5: Unexpected time swap: First 0x%llx smaller than boot time: 0x%llx", start_time, boot_time); | |
459 | _t= First; | |
460 | First = Last; | |
461 | Last = _t; | |
462 | } | |
463 | #endif | |
464 | if ( First > Last ) { | |
454 | 465 | /* First in msec, in case of msec overflow, between start and end */ |
455 | 466 | start_time = boot_time - 0x100000000LL + (uint64_t)First; |
456 | if ( start_time < boot_time ) { | |
457 | uint32_t _t; | |
458 | syslog(LOG_ERR,"Process_v5: Unexpected time swap: First 0x%xll smaller than boot time: 0x%xll", start_time, boot_time); | |
459 | // assume bug, some users reported - swap time stamps | |
460 | _t= First; | |
461 | First = Last; | |
462 | Last = _t; | |
463 | start_time = (uint64_t)First + boot_time; | |
464 | } | |
465 | else | |
467 | } else | |
466 | 468 | start_time = (uint64_t)First + boot_time; |
467 | 469 | |
468 | 470 | /* end time in msecs */ |
107 | 107 | uint32_t byte_offset; |
108 | 108 | uint32_t ICMP_offset; |
109 | 109 | uint32_t sampler_offset; |
110 | uint32_t sampler_size; | |
110 | 111 | uint32_t router_ip_offset; |
111 | 112 | uint32_t engine_offset; |
112 | 113 | uint32_t extension_map_changed; |
196 | 197 | { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, |
197 | 198 | |
198 | 199 | // 48 - 54 not implemented |
199 | { 1, 1, 0}, // 48 - NF9_FLOW_SAMPLER_ID | |
200 | { 1, 2, 0}, // 48 - NF9_FLOW_SAMPLER_ID | |
200 | 201 | { 1, 1, 0}, // 49 - FLOW_SAMPLER_MODE |
201 | 202 | { 4, 4, 0}, // 50 - NF9_FLOW_SAMPLER_RANDOM_INTERVAL |
202 | 203 | |
545 | 546 | table->flags = 0; |
546 | 547 | table->ICMP_offset = 0; |
547 | 548 | table->sampler_offset = 0; |
549 | table->sampler_size = 0; | |
548 | 550 | table->engine_offset = 0; |
549 | 551 | table->router_ip_offset = 0; |
550 | 552 | |
805 | 807 | if ( input_template[NF9_FLOW_SAMPLER_ID].offset != 0 ) { |
806 | 808 | if ( input_template[NF9_FLOW_SAMPLER_ID].length == 1 ) { |
807 | 809 | table->sampler_offset = input_template[NF9_FLOW_SAMPLER_ID].offset; |
808 | dbg_printf("Sampling ID included at offset %u\n", table->sampler_offset); | |
809 | } else { | |
810 | table->sampler_size = 1; | |
811 | dbg_printf("1 byte Sampling ID included at offset %u\n", table->sampler_offset); | |
812 | } else if ( input_template[NF9_FLOW_SAMPLER_ID].length == 2 ) { | |
813 | table->sampler_offset = input_template[NF9_FLOW_SAMPLER_ID].offset; | |
814 | table->sampler_size = 2; | |
815 | dbg_printf("2 byte Sampling ID included at offset %u\n", table->sampler_offset); | |
816 | } else { | |
810 | 817 | syslog(LOG_ERR, "Process_v9: Unexpected SAMPLER ID field length: %d", |
811 | 818 | input_template[NF9_FLOW_SAMPLER_ID].length); |
812 | dbg_printf("Sampling ID included\n"); | |
819 | dbg_printf("Unexpected SAMPLER ID field length: %d", | |
820 | input_template[NF9_FLOW_SAMPLER_ID].length); | |
813 | 821 | } |
814 | 822 | } else { |
815 | 823 | dbg_printf("No Sampling ID found\n"); |
946 | 954 | static inline void Process_v9_option_templates(exporter_domain_t *exporter, void *option_template_flowset, FlowSource_t *fs) { |
947 | 955 | void *option_template, *p; |
948 | 956 | uint32_t size_left, nr_scopes, nr_options, i; |
949 | uint16_t id, scope_length, option_length, offset; | |
957 | uint16_t id, scope_length, option_length, offset, sampler_id_length; | |
950 | 958 | uint16_t offset_sampler_id, offset_sampler_mode, offset_sampler_interval, found_sampler; |
951 | 959 | uint16_t offset_std_sampler_interval, offset_std_sampler_algorithm, found_std_sampling; |
952 | 960 | |
981 | 989 | dbg_printf("\n[%u] Option Template ID: %u\n", exporter->exporter_id, id); |
982 | 990 | dbg_printf("Scope length: %u Option length: %u\n", scope_length, option_length); |
983 | 991 | |
984 | offset_sampler_id = 0; | |
985 | offset_sampler_mode = 0; | |
986 | offset_sampler_interval = 0; | |
992 | sampler_id_length = 0; | |
993 | offset_sampler_id = 0; | |
994 | offset_sampler_mode = 0; | |
995 | offset_sampler_interval = 0; | |
987 | 996 | offset_std_sampler_interval = 0; |
988 | 997 | offset_std_sampler_algorithm = 0; |
989 | found_sampler = 0; | |
990 | found_std_sampling = 0; | |
998 | found_sampler = 0; | |
999 | found_std_sampling = 0; | |
991 | 1000 | offset = 0; |
992 | 1001 | |
993 | 1002 | p = option_template + 6; // start of length/type data |
1006 | 1015 | uint16_t type = Get_val16(p); p = p + 2; |
1007 | 1016 | uint16_t length = Get_val16(p); p = p + 2; |
1008 | 1017 | dbg_printf("Option field Type: %u, length %u\n", type, length); |
1018 | if ( element_info[type].min && CheckElementLength(type, length) == 0 ) { | |
1019 | syslog(LOG_ERR,"Process_v9: Option field Type: %u, length %u not supported\n", type, length); | |
1020 | dbg_printf("Process_v9: Option field Type: %u, length %u not supported\n", type, length); | |
1021 | continue; | |
1022 | } | |
1009 | 1023 | switch (type) { |
1010 | 1024 | // general sampling |
1011 | 1025 | case NF9_SAMPLING_INTERVAL: |
1020 | 1034 | // individual samplers |
1021 | 1035 | case NF9_FLOW_SAMPLER_ID: |
1022 | 1036 | offset_sampler_id = offset; |
1037 | sampler_id_length = length; | |
1023 | 1038 | found_sampler++; |
1024 | 1039 | break; |
1025 | 1040 | case FLOW_SAMPLER_MODE: |
1036 | 1051 | |
1037 | 1052 | if ( found_sampler == 3 ) { // need all three tags |
1038 | 1053 | dbg_printf("[%u] Sampling information found\n", exporter->exporter_id); |
1039 | InsertSamplerOffset(fs, id, offset_sampler_id, offset_sampler_mode, offset_sampler_interval); | |
1054 | InsertSamplerOffset(fs, id, offset_sampler_id, sampler_id_length, offset_sampler_mode, offset_sampler_interval); | |
1040 | 1055 | } else if ( found_std_sampling == 2 ) { // need all two tags |
1041 | 1056 | dbg_printf("[%u] Std sampling information found\n", exporter->exporter_id); |
1042 | 1057 | InsertStdSamplerOffset(fs, id, offset_std_sampler_interval, offset_std_sampler_algorithm); |
1044 | 1059 | dbg_printf("[%u] No Sampling information found\n", exporter->exporter_id); |
1045 | 1060 | } |
1046 | 1061 | dbg_printf("\n"); |
1062 | processed_records++; | |
1047 | 1063 | |
1048 | 1064 | } // End of Process_v9_option_templates |
1049 | 1065 | |
1064 | 1080 | |
1065 | 1081 | // Check if sampling is announced |
1066 | 1082 | if ( table->sampler_offset && fs->sampler ) { |
1067 | uint8_t sampler_id = in[table->sampler_offset]; | |
1083 | uint32_t sampler_id; | |
1084 | if ( table->sampler_size == 2 ) { | |
1085 | sampler_id = Get_val16((void *)&in[table->sampler_offset]); | |
1086 | } else { | |
1087 | sampler_id = in[table->sampler_offset]; | |
1088 | } | |
1068 | 1089 | if ( fs->sampler[sampler_id] ) { |
1069 | 1090 | sampling_rate = fs->sampler[sampler_id]->interval; |
1070 | 1091 | dbg_printf("[%u] Sampling ID %u available\n", exporter->exporter_id, sampler_id); |
1418 | 1439 | |
1419 | 1440 | if ( TestFlag(offset_table->flags, HAS_SAMPLER_DATA) ) { |
1420 | 1441 | sampler.table_id = id; |
1421 | sampler_id = in[offset_table->offset_id]; | |
1442 | if (offset_table->sampler_id_length == 2) { | |
1443 | sampler_id = Get_val16((void *)&in[offset_table->offset_id]); | |
1444 | } else { | |
1445 | sampler_id = in[offset_table->offset_id]; | |
1446 | } | |
1422 | 1447 | sampler.mode = in[offset_table->offset_mode]; |
1423 | 1448 | sampler.interval = Get_val32((void *)&in[offset_table->offset_interval]); |
1424 | 1449 | |
1444 | 1469 | dbg_printf("Set std sampler: algorithm: %u, interval: %u\n", |
1445 | 1470 | fs->std_sampling.mode, fs->std_sampling.interval); |
1446 | 1471 | } |
1447 | ||
1472 | processed_records++; | |
1473 | ||
1448 | 1474 | } // End of Process_v9_option_data |
1449 | 1475 | |
1450 | 1476 | void Process_v9(void *in_buff, ssize_t in_buff_cnt, FlowSource_t *fs) { |
1460 | 1486 | pkg_num++; |
1461 | 1487 | size_left = in_buff_cnt; |
1462 | 1488 | if ( size_left < NETFLOW_V9_HEADER_LENGTH ) { |
1489 | syslog(LOG_ERR, "Process_v9: Too little data for v9 packets: '%lli'", (long long)size_left); | |
1463 | 1490 | syslog(LOG_ERR, "Process_v9: Too little data for v9 packets: '%lli'", (long long)size_left); |
1464 | 1491 | return; |
1465 | 1492 | } |
241 | 241 | SortElement_t *SortList; |
242 | 242 | stat_record_t stat_record; |
243 | 243 | nffile_t *nffile; |
244 | master_record_t *aggr_record_mask; | |
244 | 245 | uint32_t i; |
245 | 246 | uint32_t maxindex, c; |
246 | 247 | char *string; |
258 | 259 | } |
259 | 260 | |
260 | 261 | CreateExportExtensionMaps(aggregate, bidir, nffile); |
262 | ||
263 | aggr_record_mask = GetMasterAggregateMask(); | |
261 | 264 | |
262 | 265 | FlowTable = GetFlowTable(); |
263 | 266 | c = 0; |
321 | 324 | |
322 | 325 | if ( FlowTable->apply_netbits ) |
323 | 326 | ApplyNetMaskBits(flow_record, FlowTable->apply_netbits); |
327 | ||
328 | if ( aggr_record_mask ) { | |
329 | ApplyAggrMask(flow_record, aggr_record_mask); | |
330 | } | |
324 | 331 | |
325 | 332 | // switch to output extension map |
326 | 333 | flow_record->map_ref = export_maps[map_id]; |
362 | 369 | flow_record->v6.dstaddr[1] &= FlowTable->IPmask[3]; |
363 | 370 | } |
364 | 371 | |
372 | if ( FlowTable->apply_netbits ) | |
373 | ApplyNetMaskBits(flow_record, FlowTable->apply_netbits); | |
374 | ||
375 | if ( aggr_record_mask ) { | |
376 | ApplyAggrMask(flow_record, aggr_record_mask); | |
377 | } | |
365 | 378 | |
366 | 379 | // switch to output extension map |
367 | 380 | flow_record->map_ref = export_maps[map_id]; |
161 | 161 | uint32_t proto; |
162 | 162 | } Default_key_t; |
163 | 163 | |
164 | ||
164 | 165 | static aggregate_param_t *aggregate_stack = NULL; |
165 | 166 | static uint32_t aggregate_key_len = sizeof(Default_key_t); |
166 | 167 | static uint32_t bidir_flows = 0; |
187 | 188 | // both times are the same |
188 | 189 | return 0; |
189 | 190 | } // End of TimeMsec_CMP |
190 | ||
191 | 191 | |
192 | 192 | static int MemoryHandle_init(MemoryHandle_t *handle) { |
193 | 193 | |
811 | 811 | |
812 | 812 | return 1; |
813 | 813 | } // End of ParseAggregateMask |
814 | ||
815 | master_record_t *GetMasterAggregateMask(void) { | |
816 | master_record_t *aggr_record_mask; | |
817 | ||
818 | if ( aggregate_stack ) { | |
819 | uint64_t *r; | |
820 | aggregate_param_t *aggr_param = aggregate_stack; | |
821 | ||
822 | aggr_record_mask = (master_record_t *)malloc(sizeof(master_record_t)); | |
823 | if ( !aggr_record_mask ) { | |
824 | fprintf(stderr, "malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror (errno)); | |
825 | return 0; | |
826 | } | |
827 | ||
828 | r = (uint64_t *)aggr_record_mask; | |
829 | memset((void *)aggr_record_mask, 0, sizeof(master_record_t)); | |
830 | while ( aggr_param->size ) { | |
831 | int offset = aggr_param->offset; | |
832 | r[offset] |= aggr_param->mask; | |
833 | aggr_param++; | |
834 | } | |
835 | ||
836 | // not really needed, but preset it anyway | |
837 | r[0] = 0xffffffffffffffffLL; | |
838 | r[1] = 0xffffffffffffffffLL; | |
839 | aggr_record_mask->dPkts = 0xffffffffffffffffLL; | |
840 | aggr_record_mask->dOctets = 0xffffffffffffffffLL; | |
841 | aggr_record_mask->out_pkts = 0xffffffffffffffffLL; | |
842 | aggr_record_mask->out_bytes = 0xffffffffffffffffLL; | |
843 | aggr_record_mask->aggr_flows = 0xffffffffffffffffLL; | |
844 | aggr_record_mask->last = 0xffffffff; | |
845 | ||
846 | return aggr_record_mask; | |
847 | } else { | |
848 | return NULL; | |
849 | } | |
850 | ||
851 | } // End of GetMasterAggregateMask | |
814 | 852 | |
815 | 853 | static inline void New_Hash_Key(void *keymem, master_record_t *flow_record, int swap_flow) { |
816 | 854 | uint64_t *record = (uint64_t *)flow_record; |
143 | 143 | |
144 | 144 | int ParseAggregateMask( char *arg, char **aggr_fmt ); |
145 | 145 | |
146 | master_record_t *GetMasterAggregateMask(void); | |
147 | ||
146 | 148 | #endif //_NFLOWCACHE_H |
1133 | 1133 | void PrintFlowTable(printer_t print_record, uint32_t limitflows, int date_sorted, int tag, int GuessDir) { |
1134 | 1134 | hash_FlowTable *FlowTable; |
1135 | 1135 | FlowTableRecord_t *r; |
1136 | master_record_t *aggr_record_mask; | |
1136 | 1137 | SortElement_t *SortList; |
1137 | 1138 | uint32_t i; |
1138 | 1139 | uint32_t maxindex, c; |
1139 | 1140 | char *string; |
1140 | 1141 | |
1141 | 1142 | FlowTable = GetFlowTable(); |
1143 | aggr_record_mask = GetMasterAggregateMask(); | |
1142 | 1144 | c = 0; |
1143 | 1145 | maxindex = FlowTable->NumRecords; |
1144 | 1146 | if ( date_sorted ) { |
1213 | 1215 | flow_record->v6.dstaddr[1] &= FlowTable->IPmask[3]; |
1214 | 1216 | } |
1215 | 1217 | |
1218 | if ( aggr_record_mask ) { | |
1219 | ApplyAggrMask(flow_record, aggr_record_mask); | |
1220 | } | |
1221 | ||
1216 | 1222 | if ( GuessDir && ( flow_record->srcport < 1024 && flow_record->dstport > 1024 ) ) |
1217 | 1223 | SwapFlow(flow_record); |
1218 | 1224 | print_record((void *)flow_record, &string, tag); |
1267 | 1273 | flow_record->v6.dstaddr[1] &= FlowTable->IPmask[3]; |
1268 | 1274 | } |
1269 | 1275 | |
1276 | if ( aggr_record_mask ) { | |
1277 | ApplyAggrMask(flow_record, aggr_record_mask); | |
1278 | } | |
1270 | 1279 | if ( GuessDir && ( flow_record->srcport < 1024 && flow_record->dstport > 1024 ) ) |
1271 | 1280 | SwapFlow(flow_record); |
1272 | 1281 | print_record((void *)flow_record, &string, tag); |
Binary diff not shown
0 | --- sflow.c.orig 2009-11-18 07:18:25.000000000 +0100 | |
1 | +++ sflow.c 2009-11-17 19:27:42.000000000 +0100 | |
2 | @@ -1067,7 +1067,6 @@ | |
3 | extension_map = sflow_extension_info[ip_flags].map; | |
4 | } | |
5 | ||
6 | - common_record = (common_record_t *)fs->nffile.writeto; | |
7 | ||
8 | // output buffer size check | |
9 | // IPv6 needs 2 x 128 bytes, IPv4 2 x 4 bytes | |
10 | @@ -1078,6 +1077,8 @@ | |
11 | return; | |
12 | } | |
13 | ||
14 | + common_record = (common_record_t *)fs->nffile.writeto; | |
15 | + | |
16 | common_record->size = sflow_output_record_size[ip_flags] + ipsize; | |
17 | common_record->type = CommonRecordType; | |
18 | common_record->flags = 0; | |
19 | @@ -1283,7 +1284,7 @@ | |
20 | fs->nffile.block_header->size += (sflow_output_record_size[ip_flags] + ipsize); | |
21 | #ifdef DEVEL | |
22 | if ( (next_data - fs->nffile.writeto) != (sflow_output_record_size[ip_flags] + ipsize) ) { | |
23 | - printf("PANIC: Size error. Buffer diff: %ull, Size: %u\n", | |
24 | + printf("PANIC: Size error. Buffer diff: %llu, Size: %u\n", | |
25 | (unsigned long long)(next_data - fs->nffile.writeto), | |
26 | (sflow_output_record_size[ip_flags] + ipsize)); | |
27 | exit(255); | |
28 | @@ -2328,7 +2329,8 @@ | |
29 | default: receiveError(sample, "unknown INMCOUNTERSVERSION", YES); break; | |
30 | } | |
31 | /* line-by-line output... */ | |
32 | - writeCountersLine(sample); | |
33 | + if ( verbose ) | |
34 | + writeCountersLine(sample); | |
35 | } | |
36 | ||
37 | /*_________________---------------------------__________________ | |
38 | @@ -2385,7 +2387,9 @@ | |
39 | } | |
40 | lengthCheck(sample, "counters_sample", sampleStart, sampleLength); | |
41 | /* line-by-line output... */ | |
42 | - writeCountersLine(sample); | |
43 | + if ( verbose ) | |
44 | + writeCountersLine(sample); | |
45 | + | |
46 | } | |
47 | ||
48 | /*_________________---------------------------__________________ |
28 | 28 | * |
29 | 29 | * $Author: peter $ |
30 | 30 | * |
31 | * $Id: version.h 19 2011-01-09 11:28:32Z peter $ | |
31 | * $Id: version.h 23 2011-02-26 11:49:02Z peter $ | |
32 | 32 | * |
33 | * $LastChangedRevision: 19 $ | |
33 | * $LastChangedRevision: 23 $ | |
34 | 34 | * |
35 | 35 | * |
36 | 36 | */ |
37 | 37 | |
38 | 38 | #ifndef _VERSION_H |
39 | 39 | #define _VERSION_H 1 |
40 | ||
40 | ||
41 | 41 | const char *nfdump_version = VERSION; |
42 | 42 | |
43 | const char *nfdump_date = "$LastChangedDate: 2011-01-09 12:28:32 +0100 (Sun, 09 Jan 2011) $"; | |
43 | const char *nfdump_date = "$LastChangedDate: 2011-02-26 12:49:02 +0100 (Sat, 26 Feb 2011) $"; | |
44 | 44 | |
45 | 45 | #endif //_VERSION_H |
0 | 0 | #! /bin/sh |
1 | 1 | # From configure.in Revision: 69 . |
2 | 2 | # Guess values for system-dependent variables and create Makefiles. |
3 | # Generated by GNU Autoconf 2.67 for nfdump 1.6.3. | |
3 | # Generated by GNU Autoconf 2.68 for nfdump 1.6.3p1. | |
4 | 4 | # |
5 | 5 | # Report bugs to <phaag@users.sourceforge.net>. |
6 | 6 | # |
91 | 91 | IFS=" "" $as_nl" |
92 | 92 | |
93 | 93 | # Find who we are. Look in the path if we contain no directory separator. |
94 | as_myself= | |
94 | 95 | case $0 in #(( |
95 | 96 | *[\\/]* ) as_myself=$0 ;; |
96 | 97 | *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
216 | 217 | # We cannot yet assume a decent shell, so we have to provide a |
217 | 218 | # neutralization value for shells without unset; and this also |
218 | 219 | # works around shells that cannot unset nonexistent variables. |
220 | # Preserve -v and -x to the replacement shell. | |
219 | 221 | BASH_ENV=/dev/null |
220 | 222 | ENV=/dev/null |
221 | 223 | (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV |
222 | 224 | export CONFIG_SHELL |
223 | exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} | |
225 | case $- in # (((( | |
226 | *v*x* | *x*v* ) as_opts=-vx ;; | |
227 | *v* ) as_opts=-v ;; | |
228 | *x* ) as_opts=-x ;; | |
229 | * ) as_opts= ;; | |
230 | esac | |
231 | exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} | |
224 | 232 | fi |
225 | 233 | |
226 | 234 | if test x$as_have_required = xno; then : |
552 | 560 | # Identity of this package. |
553 | 561 | PACKAGE_NAME='nfdump' |
554 | 562 | PACKAGE_TARNAME='nfdump' |
555 | PACKAGE_VERSION='1.6.3' | |
556 | PACKAGE_STRING='nfdump 1.6.3' | |
563 | PACKAGE_VERSION='1.6.3p1' | |
564 | PACKAGE_STRING='nfdump 1.6.3p1' | |
557 | 565 | PACKAGE_BUGREPORT='phaag@users.sourceforge.net' |
558 | 566 | PACKAGE_URL='' |
559 | 567 | |
705 | 713 | enable_dependency_tracking |
706 | 714 | enable_devel |
707 | 715 | enable_compat15 |
716 | enable_fixtimebug | |
708 | 717 | with_ftpath |
709 | 718 | with_rrdpath |
710 | 719 | enable_ftconv |
723 | 732 | CPPFLAGS |
724 | 733 | YACC |
725 | 734 | YFLAGS |
726 | CPP' | |
735 | CPP | |
736 | CPPFLAGS' | |
727 | 737 | |
728 | 738 | |
729 | 739 | # Initialize some variables set by options. |
1128 | 1138 | $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 |
1129 | 1139 | expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && |
1130 | 1140 | $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 |
1131 | : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} | |
1141 | : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" | |
1132 | 1142 | ;; |
1133 | 1143 | |
1134 | 1144 | esac |
1266 | 1276 | # Omit some internal or obsolete options to make the list less imposing. |
1267 | 1277 | # This message is too long to be a string in the A/UX 3.1 sh. |
1268 | 1278 | cat <<_ACEOF |
1269 | \`configure' configures nfdump 1.6.3 to adapt to many kinds of systems. | |
1279 | \`configure' configures nfdump 1.6.3p1 to adapt to many kinds of systems. | |
1270 | 1280 | |
1271 | 1281 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1272 | 1282 | |
1332 | 1342 | |
1333 | 1343 | if test -n "$ac_init_help"; then |
1334 | 1344 | case $ac_init_help in |
1335 | short | recursive ) echo "Configuration of nfdump 1.6.3:";; | |
1345 | short | recursive ) echo "Configuration of nfdump 1.6.3p1:";; | |
1336 | 1346 | esac |
1337 | 1347 | cat <<\_ACEOF |
1338 | 1348 | |
1344 | 1354 | --enable-dependency-tracking do not reject slow dependency extractors |
1345 | 1355 | --enable-devel compile debug and development code into nfdump; default is NO |
1346 | 1356 | --enable-compat15 compile nfdump, to read nfdump data files created with nfdump 1.5.x; default is NO |
1357 | --enable-fixtimebug enable code for swap time bug of some v5 exporters; default is NO | |
1347 | 1358 | --enable-ftconv Build the flow-tools to nfdump converter; default is NO |
1348 | 1359 | --enable-nfprofile Build nfprofile used by NfSen; default is NO |
1349 | 1360 | --enable-nftrack Build nftrack used by PortTracker; default is NO |
1364 | 1375 | LIBS libraries to pass to the linker, e.g. -l<library> |
1365 | 1376 | CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if |
1366 | 1377 | you have headers in a nonstandard directory <include dir> |
1367 | YACC The `Yet Another C Compiler' implementation to use. Defaults to | |
1368 | the first program found out of: `bison -y', `byacc', `yacc'. | |
1378 | YACC The `Yet Another Compiler Compiler' implementation to use. | |
1379 | Defaults to the first program found out of: `bison -y', `byacc', | |
1380 | `yacc'. | |
1369 | 1381 | YFLAGS The list of arguments that will be passed by default to $YACC. |
1370 | 1382 | This script will default YFLAGS to the empty string to avoid a |
1371 | 1383 | default value of `-d' given by some make applications. |
1437 | 1449 | test -n "$ac_init_help" && exit $ac_status |
1438 | 1450 | if $ac_init_version; then |
1439 | 1451 | cat <<\_ACEOF |
1440 | nfdump configure 1.6.3 | |
1441 | generated by GNU Autoconf 2.67 | |
1452 | nfdump configure 1.6.3p1 | |
1453 | generated by GNU Autoconf 2.68 | |
1442 | 1454 | |
1443 | 1455 | Copyright (C) 2010 Free Software Foundation, Inc. |
1444 | 1456 | This configure script is free software; the Free Software Foundation |
1484 | 1496 | |
1485 | 1497 | ac_retval=1 |
1486 | 1498 | fi |
1487 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} | |
1499 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
1488 | 1500 | as_fn_set_status $ac_retval |
1489 | 1501 | |
1490 | 1502 | } # ac_fn_c_try_compile |
1530 | 1542 | # interfere with the next link command; also delete a directory that is |
1531 | 1543 | # left behind by Apple's compiler. We do this before executing the actions. |
1532 | 1544 | rm -rf conftest.dSYM conftest_ipa8_conftest.oo |
1533 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} | |
1545 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
1534 | 1546 | as_fn_set_status $ac_retval |
1535 | 1547 | |
1536 | 1548 | } # ac_fn_c_try_link |
1567 | 1579 | |
1568 | 1580 | ac_retval=1 |
1569 | 1581 | fi |
1570 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} | |
1582 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
1571 | 1583 | as_fn_set_status $ac_retval |
1572 | 1584 | |
1573 | 1585 | } # ac_fn_c_try_cpp |
1580 | 1592 | ac_fn_c_check_header_mongrel () |
1581 | 1593 | { |
1582 | 1594 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack |
1583 | if eval "test \"\${$3+set}\"" = set; then : | |
1595 | if eval \${$3+:} false; then : | |
1584 | 1596 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 |
1585 | 1597 | $as_echo_n "checking for $2... " >&6; } |
1586 | if eval "test \"\${$3+set}\"" = set; then : | |
1598 | if eval \${$3+:} false; then : | |
1587 | 1599 | $as_echo_n "(cached) " >&6 |
1588 | 1600 | fi |
1589 | 1601 | eval ac_res=\$$3 |
1650 | 1662 | esac |
1651 | 1663 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 |
1652 | 1664 | $as_echo_n "checking for $2... " >&6; } |
1653 | if eval "test \"\${$3+set}\"" = set; then : | |
1665 | if eval \${$3+:} false; then : | |
1654 | 1666 | $as_echo_n "(cached) " >&6 |
1655 | 1667 | else |
1656 | 1668 | eval "$3=\$ac_header_compiler" |
1659 | 1671 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 |
1660 | 1672 | $as_echo "$ac_res" >&6; } |
1661 | 1673 | fi |
1662 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} | |
1674 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
1663 | 1675 | |
1664 | 1676 | } # ac_fn_c_check_header_mongrel |
1665 | 1677 | |
1700 | 1712 | ac_retval=$ac_status |
1701 | 1713 | fi |
1702 | 1714 | rm -rf conftest.dSYM conftest_ipa8_conftest.oo |
1703 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} | |
1715 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
1704 | 1716 | as_fn_set_status $ac_retval |
1705 | 1717 | |
1706 | 1718 | } # ac_fn_c_try_run |
1714 | 1726 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack |
1715 | 1727 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 |
1716 | 1728 | $as_echo_n "checking for $2... " >&6; } |
1717 | if eval "test \"\${$3+set}\"" = set; then : | |
1729 | if eval \${$3+:} false; then : | |
1718 | 1730 | $as_echo_n "(cached) " >&6 |
1719 | 1731 | else |
1720 | 1732 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
1732 | 1744 | eval ac_res=\$$3 |
1733 | 1745 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 |
1734 | 1746 | $as_echo "$ac_res" >&6; } |
1735 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} | |
1747 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
1736 | 1748 | |
1737 | 1749 | } # ac_fn_c_check_header_compile |
1738 | 1750 | |
1745 | 1757 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack |
1746 | 1758 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 |
1747 | 1759 | $as_echo_n "checking for $2.$3... " >&6; } |
1748 | if eval "test \"\${$4+set}\"" = set; then : | |
1760 | if eval \${$4+:} false; then : | |
1749 | 1761 | $as_echo_n "(cached) " >&6 |
1750 | 1762 | else |
1751 | 1763 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
1789 | 1801 | eval ac_res=\$$4 |
1790 | 1802 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 |
1791 | 1803 | $as_echo "$ac_res" >&6; } |
1792 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} | |
1804 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
1793 | 1805 | |
1794 | 1806 | } # ac_fn_c_check_member |
1795 | 1807 | |
1801 | 1813 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack |
1802 | 1814 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 |
1803 | 1815 | $as_echo_n "checking for $2... " >&6; } |
1804 | if eval "test \"\${$3+set}\"" = set; then : | |
1816 | if eval \${$3+:} false; then : | |
1805 | 1817 | $as_echo_n "(cached) " >&6 |
1806 | 1818 | else |
1807 | 1819 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
1856 | 1868 | eval ac_res=\$$3 |
1857 | 1869 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 |
1858 | 1870 | $as_echo "$ac_res" >&6; } |
1859 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} | |
1871 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
1860 | 1872 | |
1861 | 1873 | } # ac_fn_c_check_func |
1862 | 1874 | |
2033 | 2045 | rm -f conftest.val |
2034 | 2046 | |
2035 | 2047 | fi |
2036 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} | |
2048 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
2037 | 2049 | as_fn_set_status $ac_retval |
2038 | 2050 | |
2039 | 2051 | } # ac_fn_c_compute_int |
2047 | 2059 | as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack |
2048 | 2060 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 |
2049 | 2061 | $as_echo_n "checking for $2... " >&6; } |
2050 | if eval "test \"\${$3+set}\"" = set; then : | |
2062 | if eval \${$3+:} false; then : | |
2051 | 2063 | $as_echo_n "(cached) " >&6 |
2052 | 2064 | else |
2053 | 2065 | eval "$3=no" |
2088 | 2100 | eval ac_res=\$$3 |
2089 | 2101 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 |
2090 | 2102 | $as_echo "$ac_res" >&6; } |
2091 | eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} | |
2103 | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno | |
2092 | 2104 | |
2093 | 2105 | } # ac_fn_c_check_type |
2094 | 2106 | cat >config.log <<_ACEOF |
2095 | 2107 | This file contains any messages produced by compilers while |
2096 | 2108 | running configure, to aid debugging if configure makes a mistake. |
2097 | 2109 | |
2098 | It was created by nfdump $as_me 1.6.3, which was | |
2099 | generated by GNU Autoconf 2.67. Invocation command line was | |
2110 | It was created by nfdump $as_me 1.6.3p1, which was | |
2111 | generated by GNU Autoconf 2.68. Invocation command line was | |
2100 | 2112 | |
2101 | 2113 | $ $0 $@ |
2102 | 2114 | |
2497 | 2509 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 |
2498 | 2510 | $as_echo_n "checking for a BSD-compatible install... " >&6; } |
2499 | 2511 | if test -z "$INSTALL"; then |
2500 | if test "${ac_cv_path_install+set}" = set; then : | |
2512 | if ${ac_cv_path_install+:} false; then : | |
2501 | 2513 | $as_echo_n "(cached) " >&6 |
2502 | 2514 | else |
2503 | 2515 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
2674 | 2686 | set dummy ${ac_tool_prefix}strip; ac_word=$2 |
2675 | 2687 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
2676 | 2688 | $as_echo_n "checking for $ac_word... " >&6; } |
2677 | if test "${ac_cv_prog_STRIP+set}" = set; then : | |
2689 | if ${ac_cv_prog_STRIP+:} false; then : | |
2678 | 2690 | $as_echo_n "(cached) " >&6 |
2679 | 2691 | else |
2680 | 2692 | if test -n "$STRIP"; then |
2714 | 2726 | set dummy strip; ac_word=$2 |
2715 | 2727 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
2716 | 2728 | $as_echo_n "checking for $ac_word... " >&6; } |
2717 | if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : | |
2729 | if ${ac_cv_prog_ac_ct_STRIP+:} false; then : | |
2718 | 2730 | $as_echo_n "(cached) " >&6 |
2719 | 2731 | else |
2720 | 2732 | if test -n "$ac_ct_STRIP"; then |
2767 | 2779 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 |
2768 | 2780 | $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } |
2769 | 2781 | if test -z "$MKDIR_P"; then |
2770 | if test "${ac_cv_path_mkdir+set}" = set; then : | |
2782 | if ${ac_cv_path_mkdir+:} false; then : | |
2771 | 2783 | $as_echo_n "(cached) " >&6 |
2772 | 2784 | else |
2773 | 2785 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
2818 | 2830 | set dummy $ac_prog; ac_word=$2 |
2819 | 2831 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
2820 | 2832 | $as_echo_n "checking for $ac_word... " >&6; } |
2821 | if test "${ac_cv_prog_AWK+set}" = set; then : | |
2833 | if ${ac_cv_prog_AWK+:} false; then : | |
2822 | 2834 | $as_echo_n "(cached) " >&6 |
2823 | 2835 | else |
2824 | 2836 | if test -n "$AWK"; then |
2858 | 2870 | $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } |
2859 | 2871 | set x ${MAKE-make} |
2860 | 2872 | ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` |
2861 | if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : | |
2873 | if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : | |
2862 | 2874 | $as_echo_n "(cached) " >&6 |
2863 | 2875 | else |
2864 | 2876 | cat >conftest.make <<\_ACEOF |
2916 | 2928 | |
2917 | 2929 | # Define the identity of the package. |
2918 | 2930 | PACKAGE='nfdump' |
2919 | VERSION='1.6.3' | |
2931 | VERSION='1.6.3p1' | |
2920 | 2932 | |
2921 | 2933 | |
2922 | 2934 | cat >>confdefs.h <<_ACEOF |
2968 | 2980 | set dummy ${ac_tool_prefix}gcc; ac_word=$2 |
2969 | 2981 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
2970 | 2982 | $as_echo_n "checking for $ac_word... " >&6; } |
2971 | if test "${ac_cv_prog_CC+set}" = set; then : | |
2983 | if ${ac_cv_prog_CC+:} false; then : | |
2972 | 2984 | $as_echo_n "(cached) " >&6 |
2973 | 2985 | else |
2974 | 2986 | if test -n "$CC"; then |
3008 | 3020 | set dummy gcc; ac_word=$2 |
3009 | 3021 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
3010 | 3022 | $as_echo_n "checking for $ac_word... " >&6; } |
3011 | if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : | |
3023 | if ${ac_cv_prog_ac_ct_CC+:} false; then : | |
3012 | 3024 | $as_echo_n "(cached) " >&6 |
3013 | 3025 | else |
3014 | 3026 | if test -n "$ac_ct_CC"; then |
3061 | 3073 | set dummy ${ac_tool_prefix}cc; ac_word=$2 |
3062 | 3074 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
3063 | 3075 | $as_echo_n "checking for $ac_word... " >&6; } |
3064 | if test "${ac_cv_prog_CC+set}" = set; then : | |
3076 | if ${ac_cv_prog_CC+:} false; then : | |
3065 | 3077 | $as_echo_n "(cached) " >&6 |
3066 | 3078 | else |
3067 | 3079 | if test -n "$CC"; then |
3101 | 3113 | set dummy cc; ac_word=$2 |
3102 | 3114 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
3103 | 3115 | $as_echo_n "checking for $ac_word... " >&6; } |
3104 | if test "${ac_cv_prog_CC+set}" = set; then : | |
3116 | if ${ac_cv_prog_CC+:} false; then : | |
3105 | 3117 | $as_echo_n "(cached) " >&6 |
3106 | 3118 | else |
3107 | 3119 | if test -n "$CC"; then |
3160 | 3172 | set dummy $ac_tool_prefix$ac_prog; ac_word=$2 |
3161 | 3173 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
3162 | 3174 | $as_echo_n "checking for $ac_word... " >&6; } |
3163 | if test "${ac_cv_prog_CC+set}" = set; then : | |
3175 | if ${ac_cv_prog_CC+:} false; then : | |
3164 | 3176 | $as_echo_n "(cached) " >&6 |
3165 | 3177 | else |
3166 | 3178 | if test -n "$CC"; then |
3204 | 3216 | set dummy $ac_prog; ac_word=$2 |
3205 | 3217 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
3206 | 3218 | $as_echo_n "checking for $ac_word... " >&6; } |
3207 | if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : | |
3219 | if ${ac_cv_prog_ac_ct_CC+:} false; then : | |
3208 | 3220 | $as_echo_n "(cached) " >&6 |
3209 | 3221 | else |
3210 | 3222 | if test -n "$ac_ct_CC"; then |
3487 | 3499 | ac_clean_files=$ac_clean_files_save |
3488 | 3500 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 |
3489 | 3501 | $as_echo_n "checking for suffix of object files... " >&6; } |
3490 | if test "${ac_cv_objext+set}" = set; then : | |
3502 | if ${ac_cv_objext+:} false; then : | |
3491 | 3503 | $as_echo_n "(cached) " >&6 |
3492 | 3504 | else |
3493 | 3505 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
3538 | 3550 | ac_objext=$OBJEXT |
3539 | 3551 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 |
3540 | 3552 | $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } |
3541 | if test "${ac_cv_c_compiler_gnu+set}" = set; then : | |
3553 | if ${ac_cv_c_compiler_gnu+:} false; then : | |
3542 | 3554 | $as_echo_n "(cached) " >&6 |
3543 | 3555 | else |
3544 | 3556 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
3575 | 3587 | ac_save_CFLAGS=$CFLAGS |
3576 | 3588 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 |
3577 | 3589 | $as_echo_n "checking whether $CC accepts -g... " >&6; } |
3578 | if test "${ac_cv_prog_cc_g+set}" = set; then : | |
3590 | if ${ac_cv_prog_cc_g+:} false; then : | |
3579 | 3591 | $as_echo_n "(cached) " >&6 |
3580 | 3592 | else |
3581 | 3593 | ac_save_c_werror_flag=$ac_c_werror_flag |
3653 | 3665 | fi |
3654 | 3666 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 |
3655 | 3667 | $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } |
3656 | if test "${ac_cv_prog_cc_c89+set}" = set; then : | |
3668 | if ${ac_cv_prog_cc_c89+:} false; then : | |
3657 | 3669 | $as_echo_n "(cached) " >&6 |
3658 | 3670 | else |
3659 | 3671 | ac_cv_prog_cc_c89=no |
3814 | 3826 | |
3815 | 3827 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 |
3816 | 3828 | $as_echo_n "checking dependency style of $depcc... " >&6; } |
3817 | if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : | |
3829 | if ${am_cv_CC_dependencies_compiler_type+:} false; then : | |
3818 | 3830 | $as_echo_n "(cached) " >&6 |
3819 | 3831 | else |
3820 | 3832 | if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then |
3946 | 3958 | fi |
3947 | 3959 | set dummy $CC; ac_cc=`$as_echo "$2" | |
3948 | 3960 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` |
3949 | if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then : | |
3961 | if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : | |
3950 | 3962 | $as_echo_n "(cached) " >&6 |
3951 | 3963 | else |
3952 | 3964 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
4132 | 4144 | CFLAGS="$CFLAGS -DCOMPAT15" |
4133 | 4145 | fi |
4134 | 4146 | |
4147 | # Check whether --enable-fixtimebug was given. | |
4148 | if test "${enable_fixtimebug+set}" = set; then : | |
4149 | enableval=$enable_fixtimebug; | |
4150 | fi | |
4151 | ||
4152 | ||
4153 | if test "${enable_fixtimebug}" = "yes" ; then | |
4154 | CFLAGS="$CFLAGS -DFIXTIMEBUG" | |
4155 | fi | |
4156 | ||
4135 | 4157 | for ac_prog in 'bison -y' byacc |
4136 | 4158 | do |
4137 | 4159 | # Extract the first word of "$ac_prog", so it can be a program name with args. |
4138 | 4160 | set dummy $ac_prog; ac_word=$2 |
4139 | 4161 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
4140 | 4162 | $as_echo_n "checking for $ac_word... " >&6; } |
4141 | if test "${ac_cv_prog_YACC+set}" = set; then : | |
4163 | if ${ac_cv_prog_YACC+:} false; then : | |
4142 | 4164 | $as_echo_n "(cached) " >&6 |
4143 | 4165 | else |
4144 | 4166 | if test -n "$YACC"; then |
4181 | 4203 | set dummy $ac_prog; ac_word=$2 |
4182 | 4204 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
4183 | 4205 | $as_echo_n "checking for $ac_word... " >&6; } |
4184 | if test "${ac_cv_prog_LEX+set}" = set; then : | |
4206 | if ${ac_cv_prog_LEX+:} false; then : | |
4185 | 4207 | $as_echo_n "(cached) " >&6 |
4186 | 4208 | else |
4187 | 4209 | if test -n "$LEX"; then |
4251 | 4273 | test $ac_status = 0; } |
4252 | 4274 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 |
4253 | 4275 | $as_echo_n "checking lex output file root... " >&6; } |
4254 | if test "${ac_cv_prog_lex_root+set}" = set; then : | |
4276 | if ${ac_cv_prog_lex_root+:} false; then : | |
4255 | 4277 | $as_echo_n "(cached) " >&6 |
4256 | 4278 | else |
4257 | 4279 | |
4270 | 4292 | if test -z "${LEXLIB+set}"; then |
4271 | 4293 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 |
4272 | 4294 | $as_echo_n "checking lex library... " >&6; } |
4273 | if test "${ac_cv_lib_lex+set}" = set; then : | |
4295 | if ${ac_cv_lib_lex+:} false; then : | |
4274 | 4296 | $as_echo_n "(cached) " >&6 |
4275 | 4297 | else |
4276 | 4298 | |
4300 | 4322 | |
4301 | 4323 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 |
4302 | 4324 | $as_echo_n "checking whether yytext is a pointer... " >&6; } |
4303 | if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then : | |
4325 | if ${ac_cv_prog_lex_yytext_pointer+:} false; then : | |
4304 | 4326 | $as_echo_n "(cached) " >&6 |
4305 | 4327 | else |
4306 | 4328 | # POSIX says lex can declare yytext either as a pointer or an array; the |
4311 | 4333 | LIBS="$LEXLIB $ac_save_LIBS" |
4312 | 4334 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
4313 | 4335 | /* end confdefs.h. */ |
4314 | #define YYTEXT_POINTER 1 | |
4336 | ||
4337 | #define YYTEXT_POINTER 1 | |
4315 | 4338 | `cat $LEX_OUTPUT_ROOT.c` |
4316 | 4339 | _ACEOF |
4317 | 4340 | if ac_fn_c_try_link "$LINENO"; then : |
4378 | 4401 | if test "${enable_ftconv+set}" = set; then : |
4379 | 4402 | enableval=$enable_ftconv; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5 |
4380 | 4403 | $as_echo_n "checking for zlibVersion in -lz... " >&6; } |
4381 | if test "${ac_cv_lib_z_zlibVersion+set}" = set; then : | |
4404 | if ${ac_cv_lib_z_zlibVersion+:} false; then : | |
4382 | 4405 | $as_echo_n "(cached) " >&6 |
4383 | 4406 | else |
4384 | 4407 | ac_check_lib_save_LIBS=$LIBS |
4412 | 4435 | fi |
4413 | 4436 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5 |
4414 | 4437 | $as_echo "$ac_cv_lib_z_zlibVersion" >&6; } |
4415 | if test "x$ac_cv_lib_z_zlibVersion" = x""yes; then : | |
4438 | if test "x$ac_cv_lib_z_zlibVersion" = xyes; then : | |
4416 | 4439 | cat >>confdefs.h <<_ACEOF |
4417 | 4440 | #define HAVE_LIBZ 1 |
4418 | 4441 | _ACEOF |
4471 | 4494 | CPP= |
4472 | 4495 | fi |
4473 | 4496 | if test -z "$CPP"; then |
4474 | if test "${ac_cv_prog_CPP+set}" = set; then : | |
4497 | if ${ac_cv_prog_CPP+:} false; then : | |
4475 | 4498 | $as_echo_n "(cached) " >&6 |
4476 | 4499 | else |
4477 | 4500 | # Double quotes because CPP needs to be expanded |
4599 | 4622 | |
4600 | 4623 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 |
4601 | 4624 | $as_echo_n "checking for grep that handles long lines and -e... " >&6; } |
4602 | if test "${ac_cv_path_GREP+set}" = set; then : | |
4625 | if ${ac_cv_path_GREP+:} false; then : | |
4603 | 4626 | $as_echo_n "(cached) " >&6 |
4604 | 4627 | else |
4605 | 4628 | if test -z "$GREP"; then |
4662 | 4685 | |
4663 | 4686 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 |
4664 | 4687 | $as_echo_n "checking for egrep... " >&6; } |
4665 | if test "${ac_cv_path_EGREP+set}" = set; then : | |
4688 | if ${ac_cv_path_EGREP+:} false; then : | |
4666 | 4689 | $as_echo_n "(cached) " >&6 |
4667 | 4690 | else |
4668 | 4691 | if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 |
4729 | 4752 | |
4730 | 4753 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 |
4731 | 4754 | $as_echo_n "checking for ANSI C header files... " >&6; } |
4732 | if test "${ac_cv_header_stdc+set}" = set; then : | |
4755 | if ${ac_cv_header_stdc+:} false; then : | |
4733 | 4756 | $as_echo_n "(cached) " >&6 |
4734 | 4757 | else |
4735 | 4758 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
4861 | 4884 | enableval=$enable_nfprofile; |
4862 | 4885 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rrd_update in -lrrd" >&5 |
4863 | 4886 | $as_echo_n "checking for rrd_update in -lrrd... " >&6; } |
4864 | if test "${ac_cv_lib_rrd_rrd_update+set}" = set; then : | |
4887 | if ${ac_cv_lib_rrd_rrd_update+:} false; then : | |
4865 | 4888 | $as_echo_n "(cached) " >&6 |
4866 | 4889 | else |
4867 | 4890 | ac_check_lib_save_LIBS=$LIBS |
4895 | 4918 | fi |
4896 | 4919 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rrd_rrd_update" >&5 |
4897 | 4920 | $as_echo "$ac_cv_lib_rrd_rrd_update" >&6; } |
4898 | if test "x$ac_cv_lib_rrd_rrd_update" = x""yes; then : | |
4921 | if test "x$ac_cv_lib_rrd_rrd_update" = xyes; then : | |
4899 | 4922 | |
4900 | 4923 | cat >>config.h <<_ACEOF |
4901 | 4924 | #define HAVE_LIBRRD 1 |
4911 | 4934 | for ac_header in rrd.h |
4912 | 4935 | do : |
4913 | 4936 | ac_fn_c_check_header_mongrel "$LINENO" "rrd.h" "ac_cv_header_rrd_h" "$ac_includes_default" |
4914 | if test "x$ac_cv_header_rrd_h" = x""yes; then : | |
4937 | if test "x$ac_cv_header_rrd_h" = xyes; then : | |
4915 | 4938 | cat >>confdefs.h <<_ACEOF |
4916 | 4939 | #define HAVE_RRD_H 1 |
4917 | 4940 | _ACEOF |
4985 | 5008 | enableval=$enable_nftrack; |
4986 | 5009 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rrd_update in -lrrd" >&5 |
4987 | 5010 | $as_echo_n "checking for rrd_update in -lrrd... " >&6; } |
4988 | if test "${ac_cv_lib_rrd_rrd_update+set}" = set; then : | |
5011 | if ${ac_cv_lib_rrd_rrd_update+:} false; then : | |
4989 | 5012 | $as_echo_n "(cached) " >&6 |
4990 | 5013 | else |
4991 | 5014 | ac_check_lib_save_LIBS=$LIBS |
5019 | 5042 | fi |
5020 | 5043 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rrd_rrd_update" >&5 |
5021 | 5044 | $as_echo "$ac_cv_lib_rrd_rrd_update" >&6; } |
5022 | if test "x$ac_cv_lib_rrd_rrd_update" = x""yes; then : | |
5045 | if test "x$ac_cv_lib_rrd_rrd_update" = xyes; then : | |
5023 | 5046 | |
5024 | 5047 | cat >>config.h <<_ACEOF |
5025 | 5048 | #define HAVE_LIBRRD 1 |
5035 | 5058 | for ac_header in rrd.h |
5036 | 5059 | do : |
5037 | 5060 | ac_fn_c_check_header_mongrel "$LINENO" "rrd.h" "ac_cv_header_rrd_h" "$ac_includes_default" |
5038 | if test "x$ac_cv_header_rrd_h" = x""yes; then : | |
5061 | if test "x$ac_cv_header_rrd_h" = xyes; then : | |
5039 | 5062 | cat >>confdefs.h <<_ACEOF |
5040 | 5063 | #define HAVE_RRD_H 1 |
5041 | 5064 | _ACEOF |
5137 | 5160 | #include <sys/types.h> |
5138 | 5161 | #include <sys/socket.h> |
5139 | 5162 | " |
5140 | if test "x$ac_cv_member_struct_sockaddr_sa_len" = x""yes; then : | |
5163 | if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes; then : | |
5141 | 5164 | |
5142 | 5165 | $as_echo "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h |
5143 | 5166 | |
5154 | 5177 | for ac_func in gethostbyname |
5155 | 5178 | do : |
5156 | 5179 | ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" |
5157 | if test "x$ac_cv_func_gethostbyname" = x""yes; then : | |
5180 | if test "x$ac_cv_func_gethostbyname" = xyes; then : | |
5158 | 5181 | cat >>confdefs.h <<_ACEOF |
5159 | 5182 | #define HAVE_GETHOSTBYNAME 1 |
5160 | 5183 | _ACEOF |
5162 | 5185 | else |
5163 | 5186 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 |
5164 | 5187 | $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } |
5165 | if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then : | |
5188 | if ${ac_cv_lib_nsl_gethostbyname+:} false; then : | |
5166 | 5189 | $as_echo_n "(cached) " >&6 |
5167 | 5190 | else |
5168 | 5191 | ac_check_lib_save_LIBS=$LIBS |
5196 | 5219 | fi |
5197 | 5220 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 |
5198 | 5221 | $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } |
5199 | if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then : | |
5222 | if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : | |
5200 | 5223 | cat >>confdefs.h <<_ACEOF |
5201 | 5224 | #define HAVE_LIBNSL 1 |
5202 | 5225 | _ACEOF |
5206 | 5229 | else |
5207 | 5230 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5 |
5208 | 5231 | $as_echo_n "checking for gethostbyname in -lsocket... " >&6; } |
5209 | if test "${ac_cv_lib_socket_gethostbyname+set}" = set; then : | |
5232 | if ${ac_cv_lib_socket_gethostbyname+:} false; then : | |
5210 | 5233 | $as_echo_n "(cached) " >&6 |
5211 | 5234 | else |
5212 | 5235 | ac_check_lib_save_LIBS=$LIBS |
5240 | 5263 | fi |
5241 | 5264 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5 |
5242 | 5265 | $as_echo "$ac_cv_lib_socket_gethostbyname" >&6; } |
5243 | if test "x$ac_cv_lib_socket_gethostbyname" = x""yes; then : | |
5266 | if test "x$ac_cv_lib_socket_gethostbyname" = xyes; then : | |
5244 | 5267 | cat >>confdefs.h <<_ACEOF |
5245 | 5268 | #define HAVE_LIBSOCKET 1 |
5246 | 5269 | _ACEOF |
5257 | 5280 | for ac_func in setsockopt |
5258 | 5281 | do : |
5259 | 5282 | ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt" |
5260 | if test "x$ac_cv_func_setsockopt" = x""yes; then : | |
5283 | if test "x$ac_cv_func_setsockopt" = xyes; then : | |
5261 | 5284 | cat >>confdefs.h <<_ACEOF |
5262 | 5285 | #define HAVE_SETSOCKOPT 1 |
5263 | 5286 | _ACEOF |
5265 | 5288 | else |
5266 | 5289 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5 |
5267 | 5290 | $as_echo_n "checking for setsockopt in -lsocket... " >&6; } |
5268 | if test "${ac_cv_lib_socket_setsockopt+set}" = set; then : | |
5291 | if ${ac_cv_lib_socket_setsockopt+:} false; then : | |
5269 | 5292 | $as_echo_n "(cached) " >&6 |
5270 | 5293 | else |
5271 | 5294 | ac_check_lib_save_LIBS=$LIBS |
5299 | 5322 | fi |
5300 | 5323 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5 |
5301 | 5324 | $as_echo "$ac_cv_lib_socket_setsockopt" >&6; } |
5302 | if test "x$ac_cv_lib_socket_setsockopt" = x""yes; then : | |
5325 | if test "x$ac_cv_lib_socket_setsockopt" = xyes; then : | |
5303 | 5326 | cat >>confdefs.h <<_ACEOF |
5304 | 5327 | #define HAVE_LIBSOCKET 1 |
5305 | 5328 | _ACEOF |
5332 | 5355 | as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` |
5333 | 5356 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 |
5334 | 5357 | $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } |
5335 | if eval "test \"\${$as_ac_Header+set}\"" = set; then : | |
5358 | if eval \${$as_ac_Header+:} false; then : | |
5336 | 5359 | $as_echo_n "(cached) " >&6 |
5337 | 5360 | else |
5338 | 5361 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5372 | 5395 | if test $ac_header_dirent = dirent.h; then |
5373 | 5396 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 |
5374 | 5397 | $as_echo_n "checking for library containing opendir... " >&6; } |
5375 | if test "${ac_cv_search_opendir+set}" = set; then : | |
5398 | if ${ac_cv_search_opendir+:} false; then : | |
5376 | 5399 | $as_echo_n "(cached) " >&6 |
5377 | 5400 | else |
5378 | 5401 | ac_func_search_save_LIBS=$LIBS |
5406 | 5429 | fi |
5407 | 5430 | rm -f core conftest.err conftest.$ac_objext \ |
5408 | 5431 | conftest$ac_exeext |
5409 | if test "${ac_cv_search_opendir+set}" = set; then : | |
5432 | if ${ac_cv_search_opendir+:} false; then : | |
5410 | 5433 | break |
5411 | 5434 | fi |
5412 | 5435 | done |
5413 | if test "${ac_cv_search_opendir+set}" = set; then : | |
5436 | if ${ac_cv_search_opendir+:} false; then : | |
5414 | 5437 | |
5415 | 5438 | else |
5416 | 5439 | ac_cv_search_opendir=no |
5429 | 5452 | else |
5430 | 5453 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 |
5431 | 5454 | $as_echo_n "checking for library containing opendir... " >&6; } |
5432 | if test "${ac_cv_search_opendir+set}" = set; then : | |
5455 | if ${ac_cv_search_opendir+:} false; then : | |
5433 | 5456 | $as_echo_n "(cached) " >&6 |
5434 | 5457 | else |
5435 | 5458 | ac_func_search_save_LIBS=$LIBS |
5463 | 5486 | fi |
5464 | 5487 | rm -f core conftest.err conftest.$ac_objext \ |
5465 | 5488 | conftest$ac_exeext |
5466 | if test "${ac_cv_search_opendir+set}" = set; then : | |
5489 | if ${ac_cv_search_opendir+:} false; then : | |
5467 | 5490 | break |
5468 | 5491 | fi |
5469 | 5492 | done |
5470 | if test "${ac_cv_search_opendir+set}" = set; then : | |
5493 | if ${ac_cv_search_opendir+:} false; then : | |
5471 | 5494 | |
5472 | 5495 | else |
5473 | 5496 | ac_cv_search_opendir=no |
5487 | 5510 | |
5488 | 5511 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 |
5489 | 5512 | $as_echo_n "checking for ANSI C header files... " >&6; } |
5490 | if test "${ac_cv_header_stdc+set}" = set; then : | |
5513 | if ${ac_cv_header_stdc+:} false; then : | |
5491 | 5514 | $as_echo_n "(cached) " >&6 |
5492 | 5515 | else |
5493 | 5516 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5600 | 5623 | for ac_header in nameser8_compat.h |
5601 | 5624 | do : |
5602 | 5625 | ac_fn_c_check_header_mongrel "$LINENO" "nameser8_compat.h" "ac_cv_header_nameser8_compat_h" "$ac_includes_default" |
5603 | if test "x$ac_cv_header_nameser8_compat_h" = x""yes; then : | |
5626 | if test "x$ac_cv_header_nameser8_compat_h" = xyes; then : | |
5604 | 5627 | cat >>confdefs.h <<_ACEOF |
5605 | 5628 | #define HAVE_NAMESER8_COMPAT_H 1 |
5606 | 5629 | _ACEOF |
5663 | 5686 | # This bug is HP SR number 8606223364. |
5664 | 5687 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 |
5665 | 5688 | $as_echo_n "checking size of void *... " >&6; } |
5666 | if test "${ac_cv_sizeof_void_p+set}" = set; then : | |
5689 | if ${ac_cv_sizeof_void_p+:} false; then : | |
5667 | 5690 | $as_echo_n "(cached) " >&6 |
5668 | 5691 | else |
5669 | 5692 | if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : |
5693 | 5716 | |
5694 | 5717 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 |
5695 | 5718 | $as_echo_n "checking for an ANSI C-conforming const... " >&6; } |
5696 | if test "${ac_cv_c_const+set}" = set; then : | |
5719 | if ${ac_cv_c_const+:} false; then : | |
5697 | 5720 | $as_echo_n "(cached) " >&6 |
5698 | 5721 | else |
5699 | 5722 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
5773 | 5796 | |
5774 | 5797 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 |
5775 | 5798 | $as_echo_n "checking for inline... " >&6; } |
5776 | if test "${ac_cv_c_inline+set}" = set; then : | |
5799 | if ${ac_cv_c_inline+:} false; then : | |
5777 | 5800 | $as_echo_n "(cached) " >&6 |
5778 | 5801 | else |
5779 | 5802 | ac_cv_c_inline=no |
5815 | 5838 | |
5816 | 5839 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 |
5817 | 5840 | $as_echo_n "checking whether byte ordering is bigendian... " >&6; } |
5818 | if test "${ac_cv_c_bigendian+set}" = set; then : | |
5841 | if ${ac_cv_c_bigendian+:} false; then : | |
5819 | 5842 | $as_echo_n "(cached) " >&6 |
5820 | 5843 | else |
5821 | 5844 | ac_cv_c_bigendian=unknown |
6038 | 6061 | esac |
6039 | 6062 | |
6040 | 6063 | ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" |
6041 | if test "x$ac_cv_type_pid_t" = x""yes; then : | |
6064 | if test "x$ac_cv_type_pid_t" = xyes; then : | |
6042 | 6065 | |
6043 | 6066 | else |
6044 | 6067 | |
6049 | 6072 | fi |
6050 | 6073 | |
6051 | 6074 | ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" |
6052 | if test "x$ac_cv_type_size_t" = x""yes; then : | |
6075 | if test "x$ac_cv_type_size_t" = xyes; then : | |
6053 | 6076 | |
6054 | 6077 | else |
6055 | 6078 | |
6061 | 6084 | |
6062 | 6085 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 |
6063 | 6086 | $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } |
6064 | if test "${ac_cv_struct_tm+set}" = set; then : | |
6087 | if ${ac_cv_struct_tm+:} false; then : | |
6065 | 6088 | $as_echo_n "(cached) " >&6 |
6066 | 6089 | else |
6067 | 6090 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6096 | 6119 | |
6097 | 6120 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 |
6098 | 6121 | $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } |
6099 | if test "${ac_cv_header_stdbool_h+set}" = set; then : | |
6122 | if ${ac_cv_header_stdbool_h+:} false; then : | |
6100 | 6123 | $as_echo_n "(cached) " >&6 |
6101 | 6124 | else |
6102 | 6125 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6128 | 6151 | char b[false == 0 ? 1 : -1]; |
6129 | 6152 | char c[__bool_true_false_are_defined == 1 ? 1 : -1]; |
6130 | 6153 | char d[(bool) 0.5 == true ? 1 : -1]; |
6131 | bool e = &s; | |
6154 | /* See body of main program for 'e'. */ | |
6132 | 6155 | char f[(_Bool) 0.0 == false ? 1 : -1]; |
6133 | 6156 | char g[true]; |
6134 | 6157 | char h[sizeof (_Bool)]; |
6139 | 6162 | _Bool n[m]; |
6140 | 6163 | char o[sizeof n == m * sizeof n[0] ? 1 : -1]; |
6141 | 6164 | char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; |
6142 | # if defined __xlc__ || defined __GNUC__ | |
6143 | /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 | |
6144 | reported by James Lemley on 2005-10-05; see | |
6145 | http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html | |
6146 | This test is not quite right, since xlc is allowed to | |
6147 | reject this program, as the initializer for xlcbug is | |
6148 | not one of the forms that C requires support for. | |
6149 | However, doing the test right would require a runtime | |
6150 | test, and that would make cross-compilation harder. | |
6151 | Let us hope that IBM fixes the xlc bug, and also adds | |
6152 | support for this kind of constant expression. In the | |
6153 | meantime, this test will reject xlc, which is OK, since | |
6154 | our stdbool.h substitute should suffice. We also test | |
6155 | this with GCC, where it should work, to detect more | |
6156 | quickly whether someone messes up the test in the | |
6157 | future. */ | |
6158 | char digs[] = "0123456789"; | |
6159 | int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); | |
6160 | # endif | |
6161 | 6165 | /* Catch a bug in an HP-UX C compiler. See |
6162 | 6166 | http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html |
6163 | 6167 | http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html |
6169 | 6173 | main () |
6170 | 6174 | { |
6171 | 6175 | |
6176 | bool e = &s; | |
6172 | 6177 | *pq |= q; |
6173 | 6178 | *pq |= ! q; |
6174 | 6179 | /* Refer to every declared value, to avoid compiler optimizations. */ |
6189 | 6194 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 |
6190 | 6195 | $as_echo "$ac_cv_header_stdbool_h" >&6; } |
6191 | 6196 | ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" |
6192 | if test "x$ac_cv_type__Bool" = x""yes; then : | |
6197 | if test "x$ac_cv_type__Bool" = xyes; then : | |
6193 | 6198 | |
6194 | 6199 | cat >>confdefs.h <<_ACEOF |
6195 | 6200 | #define HAVE__BOOL 1 |
6208 | 6213 | # Checks for library functions. |
6209 | 6214 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5 |
6210 | 6215 | $as_echo_n "checking whether closedir returns void... " >&6; } |
6211 | if test "${ac_cv_func_closedir_void+set}" = set; then : | |
6216 | if ${ac_cv_func_closedir_void+:} false; then : | |
6212 | 6217 | $as_echo_n "(cached) " >&6 |
6213 | 6218 | else |
6214 | 6219 | if test "$cross_compiling" = yes; then : |
6251 | 6256 | for ac_header in vfork.h |
6252 | 6257 | do : |
6253 | 6258 | ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" |
6254 | if test "x$ac_cv_header_vfork_h" = x""yes; then : | |
6259 | if test "x$ac_cv_header_vfork_h" = xyes; then : | |
6255 | 6260 | cat >>confdefs.h <<_ACEOF |
6256 | 6261 | #define HAVE_VFORK_H 1 |
6257 | 6262 | _ACEOF |
6275 | 6280 | if test "x$ac_cv_func_fork" = xyes; then |
6276 | 6281 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 |
6277 | 6282 | $as_echo_n "checking for working fork... " >&6; } |
6278 | if test "${ac_cv_func_fork_works+set}" = set; then : | |
6283 | if ${ac_cv_func_fork_works+:} false; then : | |
6279 | 6284 | $as_echo_n "(cached) " >&6 |
6280 | 6285 | else |
6281 | 6286 | if test "$cross_compiling" = yes; then : |
6328 | 6333 | if test "x$ac_cv_func_vfork" = xyes; then |
6329 | 6334 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 |
6330 | 6335 | $as_echo_n "checking for working vfork... " >&6; } |
6331 | if test "${ac_cv_func_vfork_works+set}" = set; then : | |
6336 | if ${ac_cv_func_vfork_works+:} false; then : | |
6332 | 6337 | $as_echo_n "(cached) " >&6 |
6333 | 6338 | else |
6334 | 6339 | if test "$cross_compiling" = yes; then : |
6464 | 6469 | for ac_header in stdlib.h |
6465 | 6470 | do : |
6466 | 6471 | ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" |
6467 | if test "x$ac_cv_header_stdlib_h" = x""yes; then : | |
6472 | if test "x$ac_cv_header_stdlib_h" = xyes; then : | |
6468 | 6473 | cat >>confdefs.h <<_ACEOF |
6469 | 6474 | #define HAVE_STDLIB_H 1 |
6470 | 6475 | _ACEOF |
6475 | 6480 | |
6476 | 6481 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 |
6477 | 6482 | $as_echo_n "checking for GNU libc compatible malloc... " >&6; } |
6478 | if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then : | |
6483 | if ${ac_cv_func_malloc_0_nonnull+:} false; then : | |
6479 | 6484 | $as_echo_n "(cached) " >&6 |
6480 | 6485 | else |
6481 | 6486 | if test "$cross_compiling" = yes; then : |
6530 | 6535 | |
6531 | 6536 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 |
6532 | 6537 | $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } |
6533 | if test "${ac_cv_header_time+set}" = set; then : | |
6538 | if ${ac_cv_header_time+:} false; then : | |
6534 | 6539 | $as_echo_n "(cached) " >&6 |
6535 | 6540 | else |
6536 | 6541 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
6605 | 6610 | |
6606 | 6611 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5 |
6607 | 6612 | $as_echo_n "checking for working mktime... " >&6; } |
6608 | if test "${ac_cv_func_working_mktime+set}" = set; then : | |
6613 | if ${ac_cv_func_working_mktime+:} false; then : | |
6609 | 6614 | $as_echo_n "(cached) " >&6 |
6610 | 6615 | else |
6611 | 6616 | if test "$cross_compiling" = yes; then : |
6829 | 6834 | for ac_header in stdlib.h |
6830 | 6835 | do : |
6831 | 6836 | ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" |
6832 | if test "x$ac_cv_header_stdlib_h" = x""yes; then : | |
6837 | if test "x$ac_cv_header_stdlib_h" = xyes; then : | |
6833 | 6838 | cat >>confdefs.h <<_ACEOF |
6834 | 6839 | #define HAVE_STDLIB_H 1 |
6835 | 6840 | _ACEOF |
6840 | 6845 | |
6841 | 6846 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 |
6842 | 6847 | $as_echo_n "checking for GNU libc compatible realloc... " >&6; } |
6843 | if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then : | |
6848 | if ${ac_cv_func_realloc_0_nonnull+:} false; then : | |
6844 | 6849 | $as_echo_n "(cached) " >&6 |
6845 | 6850 | else |
6846 | 6851 | if test "$cross_compiling" = yes; then : |
6895 | 6900 | |
6896 | 6901 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 |
6897 | 6902 | $as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } |
6898 | if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then : | |
6903 | if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then : | |
6899 | 6904 | $as_echo_n "(cached) " >&6 |
6900 | 6905 | else |
6901 | 6906 | rm -f conftest.sym conftest.file |
6957 | 6962 | |
6958 | 6963 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 |
6959 | 6964 | $as_echo_n "checking whether stat accepts an empty string... " >&6; } |
6960 | if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then : | |
6965 | if ${ac_cv_func_stat_empty_string_bug+:} false; then : | |
6961 | 6966 | $as_echo_n "(cached) " >&6 |
6962 | 6967 | else |
6963 | 6968 | if test "$cross_compiling" = yes; then : |
7004 | 7009 | for ac_func in strftime |
7005 | 7010 | do : |
7006 | 7011 | ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" |
7007 | if test "x$ac_cv_func_strftime" = x""yes; then : | |
7012 | if test "x$ac_cv_func_strftime" = xyes; then : | |
7008 | 7013 | cat >>confdefs.h <<_ACEOF |
7009 | 7014 | #define HAVE_STRFTIME 1 |
7010 | 7015 | _ACEOF |
7013 | 7018 | # strftime is in -lintl on SCO UNIX. |
7014 | 7019 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 |
7015 | 7020 | $as_echo_n "checking for strftime in -lintl... " >&6; } |
7016 | if test "${ac_cv_lib_intl_strftime+set}" = set; then : | |
7021 | if ${ac_cv_lib_intl_strftime+:} false; then : | |
7017 | 7022 | $as_echo_n "(cached) " >&6 |
7018 | 7023 | else |
7019 | 7024 | ac_check_lib_save_LIBS=$LIBS |
7047 | 7052 | fi |
7048 | 7053 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 |
7049 | 7054 | $as_echo "$ac_cv_lib_intl_strftime" >&6; } |
7050 | if test "x$ac_cv_lib_intl_strftime" = x""yes; then : | |
7055 | if test "x$ac_cv_lib_intl_strftime" = xyes; then : | |
7051 | 7056 | $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h |
7052 | 7057 | |
7053 | 7058 | LIBS="-lintl $LIBS" |
7071 | 7076 | |
7072 | 7077 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lsocket" >&5 |
7073 | 7078 | $as_echo_n "checking for res_search in -lsocket... " >&6; } |
7074 | if test "${ac_cv_lib_socket_res_search+set}" = set; then : | |
7079 | if ${ac_cv_lib_socket_res_search+:} false; then : | |
7075 | 7080 | $as_echo_n "(cached) " >&6 |
7076 | 7081 | else |
7077 | 7082 | ac_check_lib_save_LIBS=$LIBS |
7105 | 7110 | fi |
7106 | 7111 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_res_search" >&5 |
7107 | 7112 | $as_echo "$ac_cv_lib_socket_res_search" >&6; } |
7108 | if test "x$ac_cv_lib_socket_res_search" = x""yes; then : | |
7113 | if test "x$ac_cv_lib_socket_res_search" = xyes; then : | |
7109 | 7114 | |
7110 | 7115 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dn_skipname in -lresolv" >&5 |
7111 | 7116 | $as_echo_n "checking for dn_skipname in -lresolv... " >&6; } |
7112 | if test "${ac_cv_lib_resolv_dn_skipname+set}" = set; then : | |
7117 | if ${ac_cv_lib_resolv_dn_skipname+:} false; then : | |
7113 | 7118 | $as_echo_n "(cached) " >&6 |
7114 | 7119 | else |
7115 | 7120 | ac_check_lib_save_LIBS=$LIBS |
7143 | 7148 | fi |
7144 | 7149 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_dn_skipname" >&5 |
7145 | 7150 | $as_echo "$ac_cv_lib_resolv_dn_skipname" >&6; } |
7146 | if test "x$ac_cv_lib_resolv_dn_skipname" = x""yes; then : | |
7151 | if test "x$ac_cv_lib_resolv_dn_skipname" = xyes; then : | |
7147 | 7152 | cat >>confdefs.h <<_ACEOF |
7148 | 7153 | #define HAVE_LIBRESOLV 1 |
7149 | 7154 | _ACEOF |
7154 | 7159 | |
7155 | 7160 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __dn_skipname in -lresolv" >&5 |
7156 | 7161 | $as_echo_n "checking for __dn_skipname in -lresolv... " >&6; } |
7157 | if test "${ac_cv_lib_resolv___dn_skipname+set}" = set; then : | |
7162 | if ${ac_cv_lib_resolv___dn_skipname+:} false; then : | |
7158 | 7163 | $as_echo_n "(cached) " >&6 |
7159 | 7164 | else |
7160 | 7165 | ac_check_lib_save_LIBS=$LIBS |
7188 | 7193 | fi |
7189 | 7194 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv___dn_skipname" >&5 |
7190 | 7195 | $as_echo "$ac_cv_lib_resolv___dn_skipname" >&6; } |
7191 | if test "x$ac_cv_lib_resolv___dn_skipname" = x""yes; then : | |
7196 | if test "x$ac_cv_lib_resolv___dn_skipname" = xyes; then : | |
7192 | 7197 | cat >>confdefs.h <<_ACEOF |
7193 | 7198 | #define HAVE_LIBRESOLV 1 |
7194 | 7199 | _ACEOF |
7205 | 7210 | |
7206 | 7211 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lresolv" >&5 |
7207 | 7212 | $as_echo_n "checking for res_search in -lresolv... " >&6; } |
7208 | if test "${ac_cv_lib_resolv_res_search+set}" = set; then : | |
7213 | if ${ac_cv_lib_resolv_res_search+:} false; then : | |
7209 | 7214 | $as_echo_n "(cached) " >&6 |
7210 | 7215 | else |
7211 | 7216 | ac_check_lib_save_LIBS=$LIBS |
7239 | 7244 | fi |
7240 | 7245 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_search" >&5 |
7241 | 7246 | $as_echo "$ac_cv_lib_resolv_res_search" >&6; } |
7242 | if test "x$ac_cv_lib_resolv_res_search" = x""yes; then : | |
7247 | if test "x$ac_cv_lib_resolv_res_search" = xyes; then : | |
7243 | 7248 | |
7244 | 7249 | LIBS="$LIBS -lresolv" |
7245 | 7250 | |
7250 | 7255 | |
7251 | 7256 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dn_skipname in -lresolv" >&5 |
7252 | 7257 | $as_echo_n "checking for dn_skipname in -lresolv... " >&6; } |
7253 | if test "${ac_cv_lib_resolv_dn_skipname+set}" = set; then : | |
7258 | if ${ac_cv_lib_resolv_dn_skipname+:} false; then : | |
7254 | 7259 | $as_echo_n "(cached) " >&6 |
7255 | 7260 | else |
7256 | 7261 | ac_check_lib_save_LIBS=$LIBS |
7284 | 7289 | fi |
7285 | 7290 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_dn_skipname" >&5 |
7286 | 7291 | $as_echo "$ac_cv_lib_resolv_dn_skipname" >&6; } |
7287 | if test "x$ac_cv_lib_resolv_dn_skipname" = x""yes; then : | |
7292 | if test "x$ac_cv_lib_resolv_dn_skipname" = xyes; then : | |
7288 | 7293 | cat >>confdefs.h <<_ACEOF |
7289 | 7294 | #define HAVE_LIBRESOLV 1 |
7290 | 7295 | _ACEOF |
7295 | 7300 | |
7296 | 7301 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __dn_skipname in -lresolv" >&5 |
7297 | 7302 | $as_echo_n "checking for __dn_skipname in -lresolv... " >&6; } |
7298 | if test "${ac_cv_lib_resolv___dn_skipname+set}" = set; then : | |
7303 | if ${ac_cv_lib_resolv___dn_skipname+:} false; then : | |
7299 | 7304 | $as_echo_n "(cached) " >&6 |
7300 | 7305 | else |
7301 | 7306 | ac_check_lib_save_LIBS=$LIBS |
7329 | 7334 | fi |
7330 | 7335 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv___dn_skipname" >&5 |
7331 | 7336 | $as_echo "$ac_cv_lib_resolv___dn_skipname" >&6; } |
7332 | if test "x$ac_cv_lib_resolv___dn_skipname" = x""yes; then : | |
7337 | if test "x$ac_cv_lib_resolv___dn_skipname" = xyes; then : | |
7333 | 7338 | cat >>confdefs.h <<_ACEOF |
7334 | 7339 | #define HAVE_LIBRESOLV 1 |
7335 | 7340 | _ACEOF |
7347 | 7352 | |
7348 | 7353 | # lzo compression requirements |
7349 | 7354 | ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" |
7350 | if test "x$ac_cv_type_ptrdiff_t" = x""yes; then : | |
7355 | if test "x$ac_cv_type_ptrdiff_t" = xyes; then : | |
7351 | 7356 | |
7352 | 7357 | else |
7353 | 7358 | |
7358 | 7363 | fi |
7359 | 7364 | |
7360 | 7365 | ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" |
7361 | if test "x$ac_cv_type_size_t" = x""yes; then : | |
7366 | if test "x$ac_cv_type_size_t" = xyes; then : | |
7362 | 7367 | |
7363 | 7368 | else |
7364 | 7369 | |
7374 | 7379 | # This bug is HP SR number 8606223364. |
7375 | 7380 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 |
7376 | 7381 | $as_echo_n "checking size of short... " >&6; } |
7377 | if test "${ac_cv_sizeof_short+set}" = set; then : | |
7382 | if ${ac_cv_sizeof_short+:} false; then : | |
7378 | 7383 | $as_echo_n "(cached) " >&6 |
7379 | 7384 | else |
7380 | 7385 | if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : |
7407 | 7412 | # This bug is HP SR number 8606223364. |
7408 | 7413 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 |
7409 | 7414 | $as_echo_n "checking size of int... " >&6; } |
7410 | if test "${ac_cv_sizeof_int+set}" = set; then : | |
7415 | if ${ac_cv_sizeof_int+:} false; then : | |
7411 | 7416 | $as_echo_n "(cached) " >&6 |
7412 | 7417 | else |
7413 | 7418 | if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : |
7440 | 7445 | # This bug is HP SR number 8606223364. |
7441 | 7446 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 |
7442 | 7447 | $as_echo_n "checking size of long... " >&6; } |
7443 | if test "${ac_cv_sizeof_long+set}" = set; then : | |
7448 | if ${ac_cv_sizeof_long+:} false; then : | |
7444 | 7449 | $as_echo_n "(cached) " >&6 |
7445 | 7450 | else |
7446 | 7451 | if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : |
7473 | 7478 | # This bug is HP SR number 8606223364. |
7474 | 7479 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 |
7475 | 7480 | $as_echo_n "checking size of long long... " >&6; } |
7476 | if test "${ac_cv_sizeof_long_long+set}" = set; then : | |
7481 | if ${ac_cv_sizeof_long_long+:} false; then : | |
7477 | 7482 | $as_echo_n "(cached) " >&6 |
7478 | 7483 | else |
7479 | 7484 | if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : |
7506 | 7511 | # This bug is HP SR number 8606223364. |
7507 | 7512 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5 |
7508 | 7513 | $as_echo_n "checking size of __int64... " >&6; } |
7509 | if test "${ac_cv_sizeof___int64+set}" = set; then : | |
7514 | if ${ac_cv_sizeof___int64+:} false; then : | |
7510 | 7515 | $as_echo_n "(cached) " >&6 |
7511 | 7516 | else |
7512 | 7517 | if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64" "$ac_includes_default"; then : |
7539 | 7544 | # This bug is HP SR number 8606223364. |
7540 | 7545 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 |
7541 | 7546 | $as_echo_n "checking size of void *... " >&6; } |
7542 | if test "${ac_cv_sizeof_void_p+set}" = set; then : | |
7547 | if ${ac_cv_sizeof_void_p+:} false; then : | |
7543 | 7548 | $as_echo_n "(cached) " >&6 |
7544 | 7549 | else |
7545 | 7550 | if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : |
7572 | 7577 | # This bug is HP SR number 8606223364. |
7573 | 7578 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 |
7574 | 7579 | $as_echo_n "checking size of size_t... " >&6; } |
7575 | if test "${ac_cv_sizeof_size_t+set}" = set; then : | |
7580 | if ${ac_cv_sizeof_size_t+:} false; then : | |
7576 | 7581 | $as_echo_n "(cached) " >&6 |
7577 | 7582 | else |
7578 | 7583 | if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : |
7605 | 7610 | # This bug is HP SR number 8606223364. |
7606 | 7611 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ptrdiff_t" >&5 |
7607 | 7612 | $as_echo_n "checking size of ptrdiff_t... " >&6; } |
7608 | if test "${ac_cv_sizeof_ptrdiff_t+set}" = set; then : | |
7613 | if ${ac_cv_sizeof_ptrdiff_t+:} false; then : | |
7609 | 7614 | $as_echo_n "(cached) " >&6 |
7610 | 7615 | else |
7611 | 7616 | if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ptrdiff_t))" "ac_cv_sizeof_ptrdiff_t" "$ac_includes_default"; then : |
7634 | 7639 | |
7635 | 7640 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 |
7636 | 7641 | $as_echo_n "checking for an ANSI C-conforming const... " >&6; } |
7637 | if test "${ac_cv_c_const+set}" = set; then : | |
7642 | if ${ac_cv_c_const+:} false; then : | |
7638 | 7643 | $as_echo_n "(cached) " >&6 |
7639 | 7644 | else |
7640 | 7645 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
7727 | 7732 | |
7728 | 7733 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for union semun" >&5 |
7729 | 7734 | $as_echo_n "checking for union semun... " >&6; } |
7730 | if test "${ac_cv_struct_semun+set}" = set; then : | |
7735 | if ${ac_cv_struct_semun+:} false; then : | |
7731 | 7736 | $as_echo_n "(cached) " >&6 |
7732 | 7737 | else |
7733 | 7738 | |
7881 | 7886 | :end' >>confcache |
7882 | 7887 | if diff "$cache_file" confcache >/dev/null 2>&1; then :; else |
7883 | 7888 | if test -w "$cache_file"; then |
7884 | test "x$cache_file" != "x/dev/null" && | |
7889 | if test "x$cache_file" != "x/dev/null"; then | |
7885 | 7890 | { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 |
7886 | 7891 | $as_echo "$as_me: updating cache $cache_file" >&6;} |
7887 | cat confcache >$cache_file | |
7892 | if test ! -f "$cache_file" || test -h "$cache_file"; then | |
7893 | cat confcache >"$cache_file" | |
7894 | else | |
7895 | case $cache_file in #( | |
7896 | */* | ?:*) | |
7897 | mv -f confcache "$cache_file"$$ && | |
7898 | mv -f "$cache_file"$$ "$cache_file" ;; #( | |
7899 | *) | |
7900 | mv -f confcache "$cache_file" ;; | |
7901 | esac | |
7902 | fi | |
7903 | fi | |
7888 | 7904 | else |
7889 | 7905 | { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 |
7890 | 7906 | $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} |
7965 | 7981 | fi |
7966 | 7982 | |
7967 | 7983 | |
7968 | : ${CONFIG_STATUS=./config.status} | |
7984 | : "${CONFIG_STATUS=./config.status}" | |
7969 | 7985 | ac_write_fail=0 |
7970 | 7986 | ac_clean_files_save=$ac_clean_files |
7971 | 7987 | ac_clean_files="$ac_clean_files $CONFIG_STATUS" |
8066 | 8082 | IFS=" "" $as_nl" |
8067 | 8083 | |
8068 | 8084 | # Find who we are. Look in the path if we contain no directory separator. |
8085 | as_myself= | |
8069 | 8086 | case $0 in #(( |
8070 | 8087 | *[\\/]* ) as_myself=$0 ;; |
8071 | 8088 | *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
8372 | 8389 | # report actual input values of CONFIG_FILES etc. instead of their |
8373 | 8390 | # values after options handling. |
8374 | 8391 | ac_log=" |
8375 | This file was extended by nfdump $as_me 1.6.3, which was | |
8376 | generated by GNU Autoconf 2.67. Invocation command line was | |
8392 | This file was extended by nfdump $as_me 1.6.3p1, which was | |
8393 | generated by GNU Autoconf 2.68. Invocation command line was | |
8377 | 8394 | |
8378 | 8395 | CONFIG_FILES = $CONFIG_FILES |
8379 | 8396 | CONFIG_HEADERS = $CONFIG_HEADERS |
8438 | 8455 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
8439 | 8456 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
8440 | 8457 | ac_cs_version="\\ |
8441 | nfdump config.status 1.6.3 | |
8442 | configured by $0, generated by GNU Autoconf 2.67, | |
8458 | nfdump config.status 1.6.3p1 | |
8459 | configured by $0, generated by GNU Autoconf 2.68, | |
8443 | 8460 | with options \\"\$ac_cs_config\\" |
8444 | 8461 | |
8445 | 8462 | Copyright (C) 2010 Free Software Foundation, Inc. |
8596 | 8613 | # after its creation but before its name has been assigned to `$tmp'. |
8597 | 8614 | $debug || |
8598 | 8615 | { |
8599 | tmp= | |
8616 | tmp= ac_tmp= | |
8600 | 8617 | trap 'exit_status=$? |
8601 | { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status | |
8618 | : "${ac_tmp:=$tmp}" | |
8619 | { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status | |
8602 | 8620 | ' 0 |
8603 | 8621 | trap 'as_fn_exit 1' 1 2 13 15 |
8604 | 8622 | } |
8606 | 8624 | |
8607 | 8625 | { |
8608 | 8626 | tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && |
8609 | test -n "$tmp" && test -d "$tmp" | |
8627 | test -d "$tmp" | |
8610 | 8628 | } || |
8611 | 8629 | { |
8612 | 8630 | tmp=./conf$$-$RANDOM |
8613 | 8631 | (umask 077 && mkdir "$tmp") |
8614 | 8632 | } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 |
8633 | ac_tmp=$tmp | |
8615 | 8634 | |
8616 | 8635 | # Set up the scripts for CONFIG_FILES section. |
8617 | 8636 | # No need to generate them if there are no CONFIG_FILES. |
8633 | 8652 | ac_cs_awk_cr=$ac_cr |
8634 | 8653 | fi |
8635 | 8654 | |
8636 | echo 'BEGIN {' >"$tmp/subs1.awk" && | |
8655 | echo 'BEGIN {' >"$ac_tmp/subs1.awk" && | |
8637 | 8656 | _ACEOF |
8638 | 8657 | |
8639 | 8658 | |
8661 | 8680 | rm -f conf$$subs.sh |
8662 | 8681 | |
8663 | 8682 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
8664 | cat >>"\$tmp/subs1.awk" <<\\_ACAWK && | |
8683 | cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && | |
8665 | 8684 | _ACEOF |
8666 | 8685 | sed -n ' |
8667 | 8686 | h |
8709 | 8728 | rm -f conf$$subs.awk |
8710 | 8729 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
8711 | 8730 | _ACAWK |
8712 | cat >>"\$tmp/subs1.awk" <<_ACAWK && | |
8731 | cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && | |
8713 | 8732 | for (key in S) S_is_set[key] = 1 |
8714 | 8733 | FS = "" |
8715 | 8734 | |
8741 | 8760 | sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" |
8742 | 8761 | else |
8743 | 8762 | cat |
8744 | fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ | |
8763 | fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ | |
8745 | 8764 | || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 |
8746 | 8765 | _ACEOF |
8747 | 8766 | |
8775 | 8794 | # No need to generate them if there are no CONFIG_HEADERS. |
8776 | 8795 | # This happens for instance with `./config.status Makefile'. |
8777 | 8796 | if test -n "$CONFIG_HEADERS"; then |
8778 | cat >"$tmp/defines.awk" <<\_ACAWK || | |
8797 | cat >"$ac_tmp/defines.awk" <<\_ACAWK || | |
8779 | 8798 | BEGIN { |
8780 | 8799 | _ACEOF |
8781 | 8800 | |
8787 | 8806 | # handling of long lines. |
8788 | 8807 | ac_delim='%!_!# ' |
8789 | 8808 | for ac_last_try in false false :; do |
8790 | ac_t=`sed -n "/$ac_delim/p" confdefs.h` | |
8791 | if test -z "$ac_t"; then | |
8809 | ac_tt=`sed -n "/$ac_delim/p" confdefs.h` | |
8810 | if test -z "$ac_tt"; then | |
8792 | 8811 | break |
8793 | 8812 | elif $ac_last_try; then |
8794 | 8813 | as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 |
8908 | 8927 | for ac_f |
8909 | 8928 | do |
8910 | 8929 | case $ac_f in |
8911 | -) ac_f="$tmp/stdin";; | |
8930 | -) ac_f="$ac_tmp/stdin";; | |
8912 | 8931 | *) # Look for the file first in the build tree, then in the source tree |
8913 | 8932 | # (if the path is not absolute). The absolute path cannot be DOS-style, |
8914 | 8933 | # because $ac_f cannot contain `:'. |
8943 | 8962 | esac |
8944 | 8963 | |
8945 | 8964 | case $ac_tag in |
8946 | *:-:* | *:-) cat >"$tmp/stdin" \ | |
8965 | *:-:* | *:-) cat >"$ac_tmp/stdin" \ | |
8947 | 8966 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; |
8948 | 8967 | esac |
8949 | 8968 | ;; |
9080 | 9099 | s&@MKDIR_P@&$ac_MKDIR_P&;t t |
9081 | 9100 | $ac_datarootdir_hack |
9082 | 9101 | " |
9083 | eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ | |
9084 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 | |
9102 | eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ | |
9103 | >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 | |
9085 | 9104 | |
9086 | 9105 | test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && |
9087 | { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && | |
9088 | { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && | |
9106 | { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && | |
9107 | { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ | |
9108 | "$ac_tmp/out"`; test -z "$ac_out"; } && | |
9089 | 9109 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' |
9090 | 9110 | which seems to be undefined. Please make sure it is defined" >&5 |
9091 | 9111 | $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' |
9092 | 9112 | which seems to be undefined. Please make sure it is defined" >&2;} |
9093 | 9113 | |
9094 | rm -f "$tmp/stdin" | |
9114 | rm -f "$ac_tmp/stdin" | |
9095 | 9115 | case $ac_file in |
9096 | -) cat "$tmp/out" && rm -f "$tmp/out";; | |
9097 | *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; | |
9116 | -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; | |
9117 | *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; | |
9098 | 9118 | esac \ |
9099 | 9119 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 |
9100 | 9120 | ;; |
9105 | 9125 | if test x"$ac_file" != x-; then |
9106 | 9126 | { |
9107 | 9127 | $as_echo "/* $configure_input */" \ |
9108 | && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" | |
9109 | } >"$tmp/config.h" \ | |
9128 | && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" | |
9129 | } >"$ac_tmp/config.h" \ | |
9110 | 9130 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 |
9111 | if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then | |
9131 | if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then | |
9112 | 9132 | { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 |
9113 | 9133 | $as_echo "$as_me: $ac_file is unchanged" >&6;} |
9114 | 9134 | else |
9115 | 9135 | rm -f "$ac_file" |
9116 | mv "$tmp/config.h" "$ac_file" \ | |
9136 | mv "$ac_tmp/config.h" "$ac_file" \ | |
9117 | 9137 | || as_fn_error $? "could not create $ac_file" "$LINENO" 5 |
9118 | 9138 | fi |
9119 | 9139 | else |
9120 | 9140 | $as_echo "/* $configure_input */" \ |
9121 | && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ | |
9141 | && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ | |
9122 | 9142 | || as_fn_error $? "could not create -" "$LINENO" 5 |
9123 | 9143 | fi |
9124 | 9144 | # Compute "$ac_file"'s index in $config_headers. |
2 | 2 | |
3 | 3 | AC_PREREQ(2.59) |
4 | 4 | AC_REVISION($Revision: 69 $)dnl |
5 | AC_INIT(nfdump, 1.6.3, phaag@users.sourceforge.net) | |
5 | AC_INIT(nfdump, 1.6.3p1, phaag@users.sourceforge.net) | |
6 | 6 | #AC_CONFIG_SRCDIR([grammar.y]) |
7 | 7 | AC_CONFIG_HEADER([config.h]) |
8 | 8 | AM_INIT_AUTOMAKE() |
53 | 53 | #AM_CONDITIONAL(COMPAT15, test "$enable_compat15" = yes) |
54 | 54 | if test "${enable_compat15}" = "yes" ; then |
55 | 55 | CFLAGS="$CFLAGS -DCOMPAT15" |
56 | fi | |
57 | ||
58 | AC_ARG_ENABLE(fixtimebug, | |
59 | [ --enable-fixtimebug enable code for swap time bug of some v5 exporters; default is NO]) | |
60 | ||
61 | if test "${enable_fixtimebug}" = "yes" ; then | |
62 | CFLAGS="$CFLAGS -DFIXTIMEBUG" | |
56 | 63 | fi |
57 | 64 | |
58 | 65 | AC_PROG_YACC |