Codebase list nfdump / 3c79283
Merge commit 'upstream/1.6.3p1' into unstable Erik Wenzel 13 years ago
18 changed file(s) with 368 addition(s) and 2016 deletion(s). Raw diff Collapse all Expand all
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
07 2011-02-05
18 - Fix SysUptime 32bit overflow in v5 header
29 - Add fix for strange first/last swap reported by some users.
(New empty file)
1212
1313 m4_ifndef([AC_AUTOCONF_VERSION],
1414 [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.
1717 You have another version of autoconf. It may work, but is not guaranteed to.
1818 If you have problems, you may need to regenerate the build system entirely.
1919 To do so, use the procedure documented by the package, typically `autoreconf'.])])
7777
7878 } // End of ApplyNetMaskBits
7979
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
340340
341341 } // End of FlushExtensionMaps
342342
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) {
344345 option_offset_t **t;
345346
346347 t = &(fs->option_offset_table);
360361 fprintf(stderr, "malloc() allocation error: %s\n", strerror(errno));
361362 return ;
362363 }
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",
364365 offset_sampler_id, offset_sampler_mode, offset_sampler_interval);
365366 } // else existing table
366367
368369 SetFlag((*t)->flags, HAS_SAMPLER_DATA);
369370 (*t)->id = id;
370371 (*t)->offset_id = offset_sampler_id;
372 (*t)->sampler_id_length = sampler_id_length;
371373 (*t)->offset_mode = offset_sampler_mode;
372374 (*t)->offset_interval = offset_sampler_interval;
373375 (*t)->offset_std_sampler_interval = 0;
395397 fprintf(stderr, "malloc() allocation error: %s\n", strerror(errno));
396398 return ;
397399 }
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",
399401 offset_std_sampler_interval, offset_std_sampler_algorithm);
400402 } // else existing table
401403
6565 // sampling offsets
6666 #define HAS_SAMPLER_DATA 1
6767 uint16_t offset_id;
68 uint16_t sampler_id_length;
6869 uint16_t offset_mode;
6970 uint16_t offset_interval;
7071
132133
133134 void FlushExtensionMaps(FlowSource_t *fs);
134135
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);
136138
137139 void InsertStdSamplerOffset( FlowSource_t *fs, uint16_t id, uint16_t offset_std_sampler_interval, uint16_t offset_std_sampler_algorithm);
138140
+0
-1739
bin/grammar.y.orig less more
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 */
186186 static inline exporter_v5_t *GetExporter(FlowSource_t *fs, netflow_v5_header_t *header) {
187187 exporter_v5_t **e = (exporter_v5_t **)&(fs->exporter_data);
188188 uint16_t engine_tag = ntohs(header->engine_tag);
189 uint16_t version = ntohs(header->version);
189190 #define IP_STRING_LEN 40
190191 char ipstr[IP_STRING_LEN];
191192
192193 // search the appropriate exporter engine
193194 while ( *e ) {
194 if ( (*e)->version == 5 && (*e)->engine_tag == engine_tag &&
195 if ( (*e)->version == version && (*e)->engine_tag == engine_tag &&
195196 (*e)->ip.v6[0] == fs->ip.v6[0] && (*e)->ip.v6[1] == fs->ip.v6[1])
196197 return *e;
197198 e = &((*e)->next);
212213 (*e)->sampling_mode = (0xC000 & ntohs(header->sampling_interval)) >> 14;
213214 (*e)->sampling_interval = 0x3fff & ntohs(header->sampling_interval);
214215 (*e)->next = NULL;
215 (*e)->version = 5;
216 (*e)->version = version;
216217 (*e)->first = 1;
217218
218219 // default is global default_sampling ( user defined or unsampled => 1 )
349350 #define delta(a,b) ( (a)>(b) ? (a)-(b) : (b)-(a) )
350351 fs->stat_record.sequence_failure++;
351352 /*
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
356356 */
357357 }
358358 }
450450 First = ntohl(v5_record->First);
451451 Last = ntohl(v5_record->Last);
452452
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 ) {
454465 /* First in msec, in case of msec overflow, between start and end */
455466 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
466468 start_time = (uint64_t)First + boot_time;
467469
468470 /* end time in msecs */
107107 uint32_t byte_offset;
108108 uint32_t ICMP_offset;
109109 uint32_t sampler_offset;
110 uint32_t sampler_size;
110111 uint32_t router_ip_offset;
111112 uint32_t engine_offset;
112113 uint32_t extension_map_changed;
196197 { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0}, { 0, 0, 0},
197198
198199 // 48 - 54 not implemented
199 { 1, 1, 0}, // 48 - NF9_FLOW_SAMPLER_ID
200 { 1, 2, 0}, // 48 - NF9_FLOW_SAMPLER_ID
200201 { 1, 1, 0}, // 49 - FLOW_SAMPLER_MODE
201202 { 4, 4, 0}, // 50 - NF9_FLOW_SAMPLER_RANDOM_INTERVAL
202203
545546 table->flags = 0;
546547 table->ICMP_offset = 0;
547548 table->sampler_offset = 0;
549 table->sampler_size = 0;
548550 table->engine_offset = 0;
549551 table->router_ip_offset = 0;
550552
805807 if ( input_template[NF9_FLOW_SAMPLER_ID].offset != 0 ) {
806808 if ( input_template[NF9_FLOW_SAMPLER_ID].length == 1 ) {
807809 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 {
810817 syslog(LOG_ERR, "Process_v9: Unexpected SAMPLER ID field length: %d",
811818 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);
813821 }
814822 } else {
815823 dbg_printf("No Sampling ID found\n");
946954 static inline void Process_v9_option_templates(exporter_domain_t *exporter, void *option_template_flowset, FlowSource_t *fs) {
947955 void *option_template, *p;
948956 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;
950958 uint16_t offset_sampler_id, offset_sampler_mode, offset_sampler_interval, found_sampler;
951959 uint16_t offset_std_sampler_interval, offset_std_sampler_algorithm, found_std_sampling;
952960
981989 dbg_printf("\n[%u] Option Template ID: %u\n", exporter->exporter_id, id);
982990 dbg_printf("Scope length: %u Option length: %u\n", scope_length, option_length);
983991
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;
987996 offset_std_sampler_interval = 0;
988997 offset_std_sampler_algorithm = 0;
989 found_sampler = 0;
990 found_std_sampling = 0;
998 found_sampler = 0;
999 found_std_sampling = 0;
9911000 offset = 0;
9921001
9931002 p = option_template + 6; // start of length/type data
10061015 uint16_t type = Get_val16(p); p = p + 2;
10071016 uint16_t length = Get_val16(p); p = p + 2;
10081017 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 }
10091023 switch (type) {
10101024 // general sampling
10111025 case NF9_SAMPLING_INTERVAL:
10201034 // individual samplers
10211035 case NF9_FLOW_SAMPLER_ID:
10221036 offset_sampler_id = offset;
1037 sampler_id_length = length;
10231038 found_sampler++;
10241039 break;
10251040 case FLOW_SAMPLER_MODE:
10361051
10371052 if ( found_sampler == 3 ) { // need all three tags
10381053 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);
10401055 } else if ( found_std_sampling == 2 ) { // need all two tags
10411056 dbg_printf("[%u] Std sampling information found\n", exporter->exporter_id);
10421057 InsertStdSamplerOffset(fs, id, offset_std_sampler_interval, offset_std_sampler_algorithm);
10441059 dbg_printf("[%u] No Sampling information found\n", exporter->exporter_id);
10451060 }
10461061 dbg_printf("\n");
1062 processed_records++;
10471063
10481064 } // End of Process_v9_option_templates
10491065
10641080
10651081 // Check if sampling is announced
10661082 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 }
10681089 if ( fs->sampler[sampler_id] ) {
10691090 sampling_rate = fs->sampler[sampler_id]->interval;
10701091 dbg_printf("[%u] Sampling ID %u available\n", exporter->exporter_id, sampler_id);
14181439
14191440 if ( TestFlag(offset_table->flags, HAS_SAMPLER_DATA) ) {
14201441 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 }
14221447 sampler.mode = in[offset_table->offset_mode];
14231448 sampler.interval = Get_val32((void *)&in[offset_table->offset_interval]);
14241449
14441469 dbg_printf("Set std sampler: algorithm: %u, interval: %u\n",
14451470 fs->std_sampling.mode, fs->std_sampling.interval);
14461471 }
1447
1472 processed_records++;
1473
14481474 } // End of Process_v9_option_data
14491475
14501476 void Process_v9(void *in_buff, ssize_t in_buff_cnt, FlowSource_t *fs) {
14601486 pkg_num++;
14611487 size_left = in_buff_cnt;
14621488 if ( size_left < NETFLOW_V9_HEADER_LENGTH ) {
1489 syslog(LOG_ERR, "Process_v9: Too little data for v9 packets: '%lli'", (long long)size_left);
14631490 syslog(LOG_ERR, "Process_v9: Too little data for v9 packets: '%lli'", (long long)size_left);
14641491 return;
14651492 }
241241 SortElement_t *SortList;
242242 stat_record_t stat_record;
243243 nffile_t *nffile;
244 master_record_t *aggr_record_mask;
244245 uint32_t i;
245246 uint32_t maxindex, c;
246247 char *string;
258259 }
259260
260261 CreateExportExtensionMaps(aggregate, bidir, nffile);
262
263 aggr_record_mask = GetMasterAggregateMask();
261264
262265 FlowTable = GetFlowTable();
263266 c = 0;
321324
322325 if ( FlowTable->apply_netbits )
323326 ApplyNetMaskBits(flow_record, FlowTable->apply_netbits);
327
328 if ( aggr_record_mask ) {
329 ApplyAggrMask(flow_record, aggr_record_mask);
330 }
324331
325332 // switch to output extension map
326333 flow_record->map_ref = export_maps[map_id];
362369 flow_record->v6.dstaddr[1] &= FlowTable->IPmask[3];
363370 }
364371
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 }
365378
366379 // switch to output extension map
367380 flow_record->map_ref = export_maps[map_id];
161161 uint32_t proto;
162162 } Default_key_t;
163163
164
164165 static aggregate_param_t *aggregate_stack = NULL;
165166 static uint32_t aggregate_key_len = sizeof(Default_key_t);
166167 static uint32_t bidir_flows = 0;
187188 // both times are the same
188189 return 0;
189190 } // End of TimeMsec_CMP
190
191191
192192 static int MemoryHandle_init(MemoryHandle_t *handle) {
193193
811811
812812 return 1;
813813 } // 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
814852
815853 static inline void New_Hash_Key(void *keymem, master_record_t *flow_record, int swap_flow) {
816854 uint64_t *record = (uint64_t *)flow_record;
143143
144144 int ParseAggregateMask( char *arg, char **aggr_fmt );
145145
146 master_record_t *GetMasterAggregateMask(void);
147
146148 #endif //_NFLOWCACHE_H
11331133 void PrintFlowTable(printer_t print_record, uint32_t limitflows, int date_sorted, int tag, int GuessDir) {
11341134 hash_FlowTable *FlowTable;
11351135 FlowTableRecord_t *r;
1136 master_record_t *aggr_record_mask;
11361137 SortElement_t *SortList;
11371138 uint32_t i;
11381139 uint32_t maxindex, c;
11391140 char *string;
11401141
11411142 FlowTable = GetFlowTable();
1143 aggr_record_mask = GetMasterAggregateMask();
11421144 c = 0;
11431145 maxindex = FlowTable->NumRecords;
11441146 if ( date_sorted ) {
12131215 flow_record->v6.dstaddr[1] &= FlowTable->IPmask[3];
12141216 }
12151217
1218 if ( aggr_record_mask ) {
1219 ApplyAggrMask(flow_record, aggr_record_mask);
1220 }
1221
12161222 if ( GuessDir && ( flow_record->srcport < 1024 && flow_record->dstport > 1024 ) )
12171223 SwapFlow(flow_record);
12181224 print_record((void *)flow_record, &string, tag);
12671273 flow_record->v6.dstaddr[1] &= FlowTable->IPmask[3];
12681274 }
12691275
1276 if ( aggr_record_mask ) {
1277 ApplyAggrMask(flow_record, aggr_record_mask);
1278 }
12701279 if ( GuessDir && ( flow_record->srcport < 1024 && flow_record->dstport > 1024 ) )
12711280 SwapFlow(flow_record);
12721281 print_record((void *)flow_record, &string, tag);
Binary diff not shown
+0
-49
bin/sflow_c.patch less more
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 /*_________________---------------------------__________________
2828 *
2929 * $Author: peter $
3030 *
31 * $Id: version.h 19 2011-01-09 11:28:32Z peter $
31 * $Id: version.h 23 2011-02-26 11:49:02Z peter $
3232 *
33 * $LastChangedRevision: 19 $
33 * $LastChangedRevision: 23 $
3434 *
3535 *
3636 */
3737
3838 #ifndef _VERSION_H
3939 #define _VERSION_H 1
40
40
4141 const char *nfdump_version = VERSION;
4242
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) $";
4444
4545 #endif //_VERSION_H
00 #! /bin/sh
11 # From configure.in Revision: 69 .
22 # 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.
44 #
55 # Report bugs to <phaag@users.sourceforge.net>.
66 #
9191 IFS=" "" $as_nl"
9292
9393 # Find who we are. Look in the path if we contain no directory separator.
94 as_myself=
9495 case $0 in #((
9596 *[\\/]* ) as_myself=$0 ;;
9697 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
216217 # We cannot yet assume a decent shell, so we have to provide a
217218 # neutralization value for shells without unset; and this also
218219 # works around shells that cannot unset nonexistent variables.
220 # Preserve -v and -x to the replacement shell.
219221 BASH_ENV=/dev/null
220222 ENV=/dev/null
221223 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
222224 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+"$@"}
224232 fi
225233
226234 if test x$as_have_required = xno; then :
552560 # Identity of this package.
553561 PACKAGE_NAME='nfdump'
554562 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'
557565 PACKAGE_BUGREPORT='phaag@users.sourceforge.net'
558566 PACKAGE_URL=''
559567
705713 enable_dependency_tracking
706714 enable_devel
707715 enable_compat15
716 enable_fixtimebug
708717 with_ftpath
709718 with_rrdpath
710719 enable_ftconv
723732 CPPFLAGS
724733 YACC
725734 YFLAGS
726 CPP'
735 CPP
736 CPPFLAGS'
727737
728738
729739 # Initialize some variables set by options.
11281138 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
11291139 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
11301140 $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}"
11321142 ;;
11331143
11341144 esac
12661276 # Omit some internal or obsolete options to make the list less imposing.
12671277 # This message is too long to be a string in the A/UX 3.1 sh.
12681278 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.
12701280
12711281 Usage: $0 [OPTION]... [VAR=VALUE]...
12721282
13321342
13331343 if test -n "$ac_init_help"; then
13341344 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:";;
13361346 esac
13371347 cat <<\_ACEOF
13381348
13441354 --enable-dependency-tracking do not reject slow dependency extractors
13451355 --enable-devel compile debug and development code into nfdump; default is NO
13461356 --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
13471358 --enable-ftconv Build the flow-tools to nfdump converter; default is NO
13481359 --enable-nfprofile Build nfprofile used by NfSen; default is NO
13491360 --enable-nftrack Build nftrack used by PortTracker; default is NO
13641375 LIBS libraries to pass to the linker, e.g. -l<library>
13651376 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
13661377 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'.
13691381 YFLAGS The list of arguments that will be passed by default to $YACC.
13701382 This script will default YFLAGS to the empty string to avoid a
13711383 default value of `-d' given by some make applications.
14371449 test -n "$ac_init_help" && exit $ac_status
14381450 if $ac_init_version; then
14391451 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
14421454
14431455 Copyright (C) 2010 Free Software Foundation, Inc.
14441456 This configure script is free software; the Free Software Foundation
14841496
14851497 ac_retval=1
14861498 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
14881500 as_fn_set_status $ac_retval
14891501
14901502 } # ac_fn_c_try_compile
15301542 # interfere with the next link command; also delete a directory that is
15311543 # left behind by Apple's compiler. We do this before executing the actions.
15321544 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
15341546 as_fn_set_status $ac_retval
15351547
15361548 } # ac_fn_c_try_link
15671579
15681580 ac_retval=1
15691581 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
15711583 as_fn_set_status $ac_retval
15721584
15731585 } # ac_fn_c_try_cpp
15801592 ac_fn_c_check_header_mongrel ()
15811593 {
15821594 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 :
15841596 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
15851597 $as_echo_n "checking for $2... " >&6; }
1586 if eval "test \"\${$3+set}\"" = set; then :
1598 if eval \${$3+:} false; then :
15871599 $as_echo_n "(cached) " >&6
15881600 fi
15891601 eval ac_res=\$$3
16501662 esac
16511663 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
16521664 $as_echo_n "checking for $2... " >&6; }
1653 if eval "test \"\${$3+set}\"" = set; then :
1665 if eval \${$3+:} false; then :
16541666 $as_echo_n "(cached) " >&6
16551667 else
16561668 eval "$3=\$ac_header_compiler"
16591671 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
16601672 $as_echo "$ac_res" >&6; }
16611673 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
16631675
16641676 } # ac_fn_c_check_header_mongrel
16651677
17001712 ac_retval=$ac_status
17011713 fi
17021714 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
17041716 as_fn_set_status $ac_retval
17051717
17061718 } # ac_fn_c_try_run
17141726 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
17151727 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
17161728 $as_echo_n "checking for $2... " >&6; }
1717 if eval "test \"\${$3+set}\"" = set; then :
1729 if eval \${$3+:} false; then :
17181730 $as_echo_n "(cached) " >&6
17191731 else
17201732 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17321744 eval ac_res=\$$3
17331745 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
17341746 $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
17361748
17371749 } # ac_fn_c_check_header_compile
17381750
17451757 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
17461758 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
17471759 $as_echo_n "checking for $2.$3... " >&6; }
1748 if eval "test \"\${$4+set}\"" = set; then :
1760 if eval \${$4+:} false; then :
17491761 $as_echo_n "(cached) " >&6
17501762 else
17511763 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17891801 eval ac_res=\$$4
17901802 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
17911803 $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
17931805
17941806 } # ac_fn_c_check_member
17951807
18011813 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
18021814 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
18031815 $as_echo_n "checking for $2... " >&6; }
1804 if eval "test \"\${$3+set}\"" = set; then :
1816 if eval \${$3+:} false; then :
18051817 $as_echo_n "(cached) " >&6
18061818 else
18071819 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18561868 eval ac_res=\$$3
18571869 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
18581870 $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
18601872
18611873 } # ac_fn_c_check_func
18621874
20332045 rm -f conftest.val
20342046
20352047 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
20372049 as_fn_set_status $ac_retval
20382050
20392051 } # ac_fn_c_compute_int
20472059 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
20482060 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
20492061 $as_echo_n "checking for $2... " >&6; }
2050 if eval "test \"\${$3+set}\"" = set; then :
2062 if eval \${$3+:} false; then :
20512063 $as_echo_n "(cached) " >&6
20522064 else
20532065 eval "$3=no"
20882100 eval ac_res=\$$3
20892101 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
20902102 $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
20922104
20932105 } # ac_fn_c_check_type
20942106 cat >config.log <<_ACEOF
20952107 This file contains any messages produced by compilers while
20962108 running configure, to aid debugging if configure makes a mistake.
20972109
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
21002112
21012113 $ $0 $@
21022114
24972509 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
24982510 $as_echo_n "checking for a BSD-compatible install... " >&6; }
24992511 if test -z "$INSTALL"; then
2500 if test "${ac_cv_path_install+set}" = set; then :
2512 if ${ac_cv_path_install+:} false; then :
25012513 $as_echo_n "(cached) " >&6
25022514 else
25032515 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
26742686 set dummy ${ac_tool_prefix}strip; ac_word=$2
26752687 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
26762688 $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 :
26782690 $as_echo_n "(cached) " >&6
26792691 else
26802692 if test -n "$STRIP"; then
27142726 set dummy strip; ac_word=$2
27152727 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
27162728 $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 :
27182730 $as_echo_n "(cached) " >&6
27192731 else
27202732 if test -n "$ac_ct_STRIP"; then
27672779 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
27682780 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
27692781 if test -z "$MKDIR_P"; then
2770 if test "${ac_cv_path_mkdir+set}" = set; then :
2782 if ${ac_cv_path_mkdir+:} false; then :
27712783 $as_echo_n "(cached) " >&6
27722784 else
27732785 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
28182830 set dummy $ac_prog; ac_word=$2
28192831 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
28202832 $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 :
28222834 $as_echo_n "(cached) " >&6
28232835 else
28242836 if test -n "$AWK"; then
28582870 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
28592871 set x ${MAKE-make}
28602872 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 :
28622874 $as_echo_n "(cached) " >&6
28632875 else
28642876 cat >conftest.make <<\_ACEOF
29162928
29172929 # Define the identity of the package.
29182930 PACKAGE='nfdump'
2919 VERSION='1.6.3'
2931 VERSION='1.6.3p1'
29202932
29212933
29222934 cat >>confdefs.h <<_ACEOF
29682980 set dummy ${ac_tool_prefix}gcc; ac_word=$2
29692981 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
29702982 $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 :
29722984 $as_echo_n "(cached) " >&6
29732985 else
29742986 if test -n "$CC"; then
30083020 set dummy gcc; ac_word=$2
30093021 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30103022 $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 :
30123024 $as_echo_n "(cached) " >&6
30133025 else
30143026 if test -n "$ac_ct_CC"; then
30613073 set dummy ${ac_tool_prefix}cc; ac_word=$2
30623074 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
30633075 $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 :
30653077 $as_echo_n "(cached) " >&6
30663078 else
30673079 if test -n "$CC"; then
31013113 set dummy cc; ac_word=$2
31023114 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
31033115 $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 :
31053117 $as_echo_n "(cached) " >&6
31063118 else
31073119 if test -n "$CC"; then
31603172 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
31613173 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
31623174 $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 :
31643176 $as_echo_n "(cached) " >&6
31653177 else
31663178 if test -n "$CC"; then
32043216 set dummy $ac_prog; ac_word=$2
32053217 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
32063218 $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 :
32083220 $as_echo_n "(cached) " >&6
32093221 else
32103222 if test -n "$ac_ct_CC"; then
34873499 ac_clean_files=$ac_clean_files_save
34883500 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
34893501 $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 :
34913503 $as_echo_n "(cached) " >&6
34923504 else
34933505 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35383550 ac_objext=$OBJEXT
35393551 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
35403552 $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 :
35423554 $as_echo_n "(cached) " >&6
35433555 else
35443556 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35753587 ac_save_CFLAGS=$CFLAGS
35763588 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
35773589 $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 :
35793591 $as_echo_n "(cached) " >&6
35803592 else
35813593 ac_save_c_werror_flag=$ac_c_werror_flag
36533665 fi
36543666 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
36553667 $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 :
36573669 $as_echo_n "(cached) " >&6
36583670 else
36593671 ac_cv_prog_cc_c89=no
38143826
38153827 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
38163828 $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 :
38183830 $as_echo_n "(cached) " >&6
38193831 else
38203832 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
39463958 fi
39473959 set dummy $CC; ac_cc=`$as_echo "$2" |
39483960 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 :
39503962 $as_echo_n "(cached) " >&6
39513963 else
39523964 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41324144 CFLAGS="$CFLAGS -DCOMPAT15"
41334145 fi
41344146
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
41354157 for ac_prog in 'bison -y' byacc
41364158 do
41374159 # Extract the first word of "$ac_prog", so it can be a program name with args.
41384160 set dummy $ac_prog; ac_word=$2
41394161 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
41404162 $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 :
41424164 $as_echo_n "(cached) " >&6
41434165 else
41444166 if test -n "$YACC"; then
41814203 set dummy $ac_prog; ac_word=$2
41824204 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
41834205 $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 :
41854207 $as_echo_n "(cached) " >&6
41864208 else
41874209 if test -n "$LEX"; then
42514273 test $ac_status = 0; }
42524274 { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5
42534275 $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 :
42554277 $as_echo_n "(cached) " >&6
42564278 else
42574279
42704292 if test -z "${LEXLIB+set}"; then
42714293 { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5
42724294 $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 :
42744296 $as_echo_n "(cached) " >&6
42754297 else
42764298
43004322
43014323 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5
43024324 $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 :
43044326 $as_echo_n "(cached) " >&6
43054327 else
43064328 # POSIX says lex can declare yytext either as a pointer or an array; the
43114333 LIBS="$LEXLIB $ac_save_LIBS"
43124334 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43134335 /* end confdefs.h. */
4314 #define YYTEXT_POINTER 1
4336
4337 #define YYTEXT_POINTER 1
43154338 `cat $LEX_OUTPUT_ROOT.c`
43164339 _ACEOF
43174340 if ac_fn_c_try_link "$LINENO"; then :
43784401 if test "${enable_ftconv+set}" = set; then :
43794402 enableval=$enable_ftconv; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5
43804403 $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 :
43824405 $as_echo_n "(cached) " >&6
43834406 else
43844407 ac_check_lib_save_LIBS=$LIBS
44124435 fi
44134436 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5
44144437 $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 :
44164439 cat >>confdefs.h <<_ACEOF
44174440 #define HAVE_LIBZ 1
44184441 _ACEOF
44714494 CPP=
44724495 fi
44734496 if test -z "$CPP"; then
4474 if test "${ac_cv_prog_CPP+set}" = set; then :
4497 if ${ac_cv_prog_CPP+:} false; then :
44754498 $as_echo_n "(cached) " >&6
44764499 else
44774500 # Double quotes because CPP needs to be expanded
45994622
46004623 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
46014624 $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 :
46034626 $as_echo_n "(cached) " >&6
46044627 else
46054628 if test -z "$GREP"; then
46624685
46634686 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
46644687 $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 :
46664689 $as_echo_n "(cached) " >&6
46674690 else
46684691 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
47294752
47304753 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
47314754 $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 :
47334756 $as_echo_n "(cached) " >&6
47344757 else
47354758 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48614884 enableval=$enable_nfprofile;
48624885 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rrd_update in -lrrd" >&5
48634886 $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 :
48654888 $as_echo_n "(cached) " >&6
48664889 else
48674890 ac_check_lib_save_LIBS=$LIBS
48954918 fi
48964919 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rrd_rrd_update" >&5
48974920 $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 :
48994922
49004923 cat >>config.h <<_ACEOF
49014924 #define HAVE_LIBRRD 1
49114934 for ac_header in rrd.h
49124935 do :
49134936 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 :
49154938 cat >>confdefs.h <<_ACEOF
49164939 #define HAVE_RRD_H 1
49174940 _ACEOF
49855008 enableval=$enable_nftrack;
49865009 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rrd_update in -lrrd" >&5
49875010 $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 :
49895012 $as_echo_n "(cached) " >&6
49905013 else
49915014 ac_check_lib_save_LIBS=$LIBS
50195042 fi
50205043 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rrd_rrd_update" >&5
50215044 $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 :
50235046
50245047 cat >>config.h <<_ACEOF
50255048 #define HAVE_LIBRRD 1
50355058 for ac_header in rrd.h
50365059 do :
50375060 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 :
50395062 cat >>confdefs.h <<_ACEOF
50405063 #define HAVE_RRD_H 1
50415064 _ACEOF
51375160 #include <sys/types.h>
51385161 #include <sys/socket.h>
51395162 "
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 :
51415164
51425165 $as_echo "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h
51435166
51545177 for ac_func in gethostbyname
51555178 do :
51565179 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 :
51585181 cat >>confdefs.h <<_ACEOF
51595182 #define HAVE_GETHOSTBYNAME 1
51605183 _ACEOF
51625185 else
51635186 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
51645187 $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 :
51665189 $as_echo_n "(cached) " >&6
51675190 else
51685191 ac_check_lib_save_LIBS=$LIBS
51965219 fi
51975220 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
51985221 $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 :
52005223 cat >>confdefs.h <<_ACEOF
52015224 #define HAVE_LIBNSL 1
52025225 _ACEOF
52065229 else
52075230 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5
52085231 $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 :
52105233 $as_echo_n "(cached) " >&6
52115234 else
52125235 ac_check_lib_save_LIBS=$LIBS
52405263 fi
52415264 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5
52425265 $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 :
52445267 cat >>confdefs.h <<_ACEOF
52455268 #define HAVE_LIBSOCKET 1
52465269 _ACEOF
52575280 for ac_func in setsockopt
52585281 do :
52595282 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 :
52615284 cat >>confdefs.h <<_ACEOF
52625285 #define HAVE_SETSOCKOPT 1
52635286 _ACEOF
52655288 else
52665289 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5
52675290 $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 :
52695292 $as_echo_n "(cached) " >&6
52705293 else
52715294 ac_check_lib_save_LIBS=$LIBS
52995322 fi
53005323 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5
53015324 $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 :
53035326 cat >>confdefs.h <<_ACEOF
53045327 #define HAVE_LIBSOCKET 1
53055328 _ACEOF
53325355 as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
53335356 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
53345357 $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 :
53365359 $as_echo_n "(cached) " >&6
53375360 else
53385361 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53725395 if test $ac_header_dirent = dirent.h; then
53735396 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
53745397 $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 :
53765399 $as_echo_n "(cached) " >&6
53775400 else
53785401 ac_func_search_save_LIBS=$LIBS
54065429 fi
54075430 rm -f core conftest.err conftest.$ac_objext \
54085431 conftest$ac_exeext
5409 if test "${ac_cv_search_opendir+set}" = set; then :
5432 if ${ac_cv_search_opendir+:} false; then :
54105433 break
54115434 fi
54125435 done
5413 if test "${ac_cv_search_opendir+set}" = set; then :
5436 if ${ac_cv_search_opendir+:} false; then :
54145437
54155438 else
54165439 ac_cv_search_opendir=no
54295452 else
54305453 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
54315454 $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 :
54335456 $as_echo_n "(cached) " >&6
54345457 else
54355458 ac_func_search_save_LIBS=$LIBS
54635486 fi
54645487 rm -f core conftest.err conftest.$ac_objext \
54655488 conftest$ac_exeext
5466 if test "${ac_cv_search_opendir+set}" = set; then :
5489 if ${ac_cv_search_opendir+:} false; then :
54675490 break
54685491 fi
54695492 done
5470 if test "${ac_cv_search_opendir+set}" = set; then :
5493 if ${ac_cv_search_opendir+:} false; then :
54715494
54725495 else
54735496 ac_cv_search_opendir=no
54875510
54885511 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
54895512 $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 :
54915514 $as_echo_n "(cached) " >&6
54925515 else
54935516 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56005623 for ac_header in nameser8_compat.h
56015624 do :
56025625 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 :
56045627 cat >>confdefs.h <<_ACEOF
56055628 #define HAVE_NAMESER8_COMPAT_H 1
56065629 _ACEOF
56635686 # This bug is HP SR number 8606223364.
56645687 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
56655688 $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 :
56675690 $as_echo_n "(cached) " >&6
56685691 else
56695692 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then :
56935716
56945717 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
56955718 $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 :
56975720 $as_echo_n "(cached) " >&6
56985721 else
56995722 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57735796
57745797 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
57755798 $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 :
57775800 $as_echo_n "(cached) " >&6
57785801 else
57795802 ac_cv_c_inline=no
58155838
58165839 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
58175840 $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 :
58195842 $as_echo_n "(cached) " >&6
58205843 else
58215844 ac_cv_c_bigendian=unknown
60386061 esac
60396062
60406063 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 :
60426065
60436066 else
60446067
60496072 fi
60506073
60516074 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 :
60536076
60546077 else
60556078
60616084
60626085 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
60636086 $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 :
60656088 $as_echo_n "(cached) " >&6
60666089 else
60676090 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60966119
60976120 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
60986121 $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 :
61006123 $as_echo_n "(cached) " >&6
61016124 else
61026125 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61286151 char b[false == 0 ? 1 : -1];
61296152 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
61306153 char d[(bool) 0.5 == true ? 1 : -1];
6131 bool e = &s;
6154 /* See body of main program for 'e'. */
61326155 char f[(_Bool) 0.0 == false ? 1 : -1];
61336156 char g[true];
61346157 char h[sizeof (_Bool)];
61396162 _Bool n[m];
61406163 char o[sizeof n == m * sizeof n[0] ? 1 : -1];
61416164 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
61616165 /* Catch a bug in an HP-UX C compiler. See
61626166 http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
61636167 http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
61696173 main ()
61706174 {
61716175
6176 bool e = &s;
61726177 *pq |= q;
61736178 *pq |= ! q;
61746179 /* Refer to every declared value, to avoid compiler optimizations. */
61896194 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
61906195 $as_echo "$ac_cv_header_stdbool_h" >&6; }
61916196 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 :
61936198
61946199 cat >>confdefs.h <<_ACEOF
61956200 #define HAVE__BOOL 1
62086213 # Checks for library functions.
62096214 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5
62106215 $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 :
62126217 $as_echo_n "(cached) " >&6
62136218 else
62146219 if test "$cross_compiling" = yes; then :
62516256 for ac_header in vfork.h
62526257 do :
62536258 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 :
62556260 cat >>confdefs.h <<_ACEOF
62566261 #define HAVE_VFORK_H 1
62576262 _ACEOF
62756280 if test "x$ac_cv_func_fork" = xyes; then
62766281 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
62776282 $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 :
62796284 $as_echo_n "(cached) " >&6
62806285 else
62816286 if test "$cross_compiling" = yes; then :
63286333 if test "x$ac_cv_func_vfork" = xyes; then
63296334 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
63306335 $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 :
63326337 $as_echo_n "(cached) " >&6
63336338 else
63346339 if test "$cross_compiling" = yes; then :
64646469 for ac_header in stdlib.h
64656470 do :
64666471 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 :
64686473 cat >>confdefs.h <<_ACEOF
64696474 #define HAVE_STDLIB_H 1
64706475 _ACEOF
64756480
64766481 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
64776482 $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 :
64796484 $as_echo_n "(cached) " >&6
64806485 else
64816486 if test "$cross_compiling" = yes; then :
65306535
65316536 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
65326537 $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 :
65346539 $as_echo_n "(cached) " >&6
65356540 else
65366541 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66056610
66066611 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5
66076612 $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 :
66096614 $as_echo_n "(cached) " >&6
66106615 else
66116616 if test "$cross_compiling" = yes; then :
68296834 for ac_header in stdlib.h
68306835 do :
68316836 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 :
68336838 cat >>confdefs.h <<_ACEOF
68346839 #define HAVE_STDLIB_H 1
68356840 _ACEOF
68406845
68416846 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5
68426847 $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 :
68446849 $as_echo_n "(cached) " >&6
68456850 else
68466851 if test "$cross_compiling" = yes; then :
68956900
68966901 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
68976902 $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 :
68996904 $as_echo_n "(cached) " >&6
69006905 else
69016906 rm -f conftest.sym conftest.file
69576962
69586963 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5
69596964 $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 :
69616966 $as_echo_n "(cached) " >&6
69626967 else
69636968 if test "$cross_compiling" = yes; then :
70047009 for ac_func in strftime
70057010 do :
70067011 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 :
70087013 cat >>confdefs.h <<_ACEOF
70097014 #define HAVE_STRFTIME 1
70107015 _ACEOF
70137018 # strftime is in -lintl on SCO UNIX.
70147019 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
70157020 $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 :
70177022 $as_echo_n "(cached) " >&6
70187023 else
70197024 ac_check_lib_save_LIBS=$LIBS
70477052 fi
70487053 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5
70497054 $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 :
70517056 $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h
70527057
70537058 LIBS="-lintl $LIBS"
70717076
70727077 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lsocket" >&5
70737078 $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 :
70757080 $as_echo_n "(cached) " >&6
70767081 else
70777082 ac_check_lib_save_LIBS=$LIBS
71057110 fi
71067111 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_res_search" >&5
71077112 $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 :
71097114
71107115 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dn_skipname in -lresolv" >&5
71117116 $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 :
71137118 $as_echo_n "(cached) " >&6
71147119 else
71157120 ac_check_lib_save_LIBS=$LIBS
71437148 fi
71447149 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_dn_skipname" >&5
71457150 $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 :
71477152 cat >>confdefs.h <<_ACEOF
71487153 #define HAVE_LIBRESOLV 1
71497154 _ACEOF
71547159
71557160 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __dn_skipname in -lresolv" >&5
71567161 $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 :
71587163 $as_echo_n "(cached) " >&6
71597164 else
71607165 ac_check_lib_save_LIBS=$LIBS
71887193 fi
71897194 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv___dn_skipname" >&5
71907195 $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 :
71927197 cat >>confdefs.h <<_ACEOF
71937198 #define HAVE_LIBRESOLV 1
71947199 _ACEOF
72057210
72067211 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_search in -lresolv" >&5
72077212 $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 :
72097214 $as_echo_n "(cached) " >&6
72107215 else
72117216 ac_check_lib_save_LIBS=$LIBS
72397244 fi
72407245 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_res_search" >&5
72417246 $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 :
72437248
72447249 LIBS="$LIBS -lresolv"
72457250
72507255
72517256 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dn_skipname in -lresolv" >&5
72527257 $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 :
72547259 $as_echo_n "(cached) " >&6
72557260 else
72567261 ac_check_lib_save_LIBS=$LIBS
72847289 fi
72857290 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_dn_skipname" >&5
72867291 $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 :
72887293 cat >>confdefs.h <<_ACEOF
72897294 #define HAVE_LIBRESOLV 1
72907295 _ACEOF
72957300
72967301 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __dn_skipname in -lresolv" >&5
72977302 $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 :
72997304 $as_echo_n "(cached) " >&6
73007305 else
73017306 ac_check_lib_save_LIBS=$LIBS
73297334 fi
73307335 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv___dn_skipname" >&5
73317336 $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 :
73337338 cat >>confdefs.h <<_ACEOF
73347339 #define HAVE_LIBRESOLV 1
73357340 _ACEOF
73477352
73487353 # lzo compression requirements
73497354 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 :
73517356
73527357 else
73537358
73587363 fi
73597364
73607365 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 :
73627367
73637368 else
73647369
73747379 # This bug is HP SR number 8606223364.
73757380 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
73767381 $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 :
73787383 $as_echo_n "(cached) " >&6
73797384 else
73807385 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then :
74077412 # This bug is HP SR number 8606223364.
74087413 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
74097414 $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 :
74117416 $as_echo_n "(cached) " >&6
74127417 else
74137418 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then :
74407445 # This bug is HP SR number 8606223364.
74417446 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
74427447 $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 :
74447449 $as_echo_n "(cached) " >&6
74457450 else
74467451 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
74737478 # This bug is HP SR number 8606223364.
74747479 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5
74757480 $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 :
74777482 $as_echo_n "(cached) " >&6
74787483 else
74797484 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then :
75067511 # This bug is HP SR number 8606223364.
75077512 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5
75087513 $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 :
75107515 $as_echo_n "(cached) " >&6
75117516 else
75127517 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64" "$ac_includes_default"; then :
75397544 # This bug is HP SR number 8606223364.
75407545 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
75417546 $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 :
75437548 $as_echo_n "(cached) " >&6
75447549 else
75457550 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then :
75727577 # This bug is HP SR number 8606223364.
75737578 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
75747579 $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 :
75767581 $as_echo_n "(cached) " >&6
75777582 else
75787583 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then :
76057610 # This bug is HP SR number 8606223364.
76067611 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ptrdiff_t" >&5
76077612 $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 :
76097614 $as_echo_n "(cached) " >&6
76107615 else
76117616 if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ptrdiff_t))" "ac_cv_sizeof_ptrdiff_t" "$ac_includes_default"; then :
76347639
76357640 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
76367641 $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 :
76387643 $as_echo_n "(cached) " >&6
76397644 else
76407645 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
77277732
77287733 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for union semun" >&5
77297734 $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 :
77317736 $as_echo_n "(cached) " >&6
77327737 else
77337738
78817886 :end' >>confcache
78827887 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
78837888 if test -w "$cache_file"; then
7884 test "x$cache_file" != "x/dev/null" &&
7889 if test "x$cache_file" != "x/dev/null"; then
78857890 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
78867891 $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
78887904 else
78897905 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
78907906 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
79657981 fi
79667982
79677983
7968 : ${CONFIG_STATUS=./config.status}
7984 : "${CONFIG_STATUS=./config.status}"
79697985 ac_write_fail=0
79707986 ac_clean_files_save=$ac_clean_files
79717987 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
80668082 IFS=" "" $as_nl"
80678083
80688084 # Find who we are. Look in the path if we contain no directory separator.
8085 as_myself=
80698086 case $0 in #((
80708087 *[\\/]* ) as_myself=$0 ;;
80718088 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
83728389 # report actual input values of CONFIG_FILES etc. instead of their
83738390 # values after options handling.
83748391 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
83778394
83788395 CONFIG_FILES = $CONFIG_FILES
83798396 CONFIG_HEADERS = $CONFIG_HEADERS
84388455 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
84398456 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
84408457 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,
84438460 with options \\"\$ac_cs_config\\"
84448461
84458462 Copyright (C) 2010 Free Software Foundation, Inc.
85968613 # after its creation but before its name has been assigned to `$tmp'.
85978614 $debug ||
85988615 {
8599 tmp=
8616 tmp= ac_tmp=
86008617 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
86028620 ' 0
86038621 trap 'as_fn_exit 1' 1 2 13 15
86048622 }
86068624
86078625 {
86088626 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
8609 test -n "$tmp" && test -d "$tmp"
8627 test -d "$tmp"
86108628 } ||
86118629 {
86128630 tmp=./conf$$-$RANDOM
86138631 (umask 077 && mkdir "$tmp")
86148632 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
8633 ac_tmp=$tmp
86158634
86168635 # Set up the scripts for CONFIG_FILES section.
86178636 # No need to generate them if there are no CONFIG_FILES.
86338652 ac_cs_awk_cr=$ac_cr
86348653 fi
86358654
8636 echo 'BEGIN {' >"$tmp/subs1.awk" &&
8655 echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
86378656 _ACEOF
86388657
86398658
86618680 rm -f conf$$subs.sh
86628681
86638682 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
8664 cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
8683 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
86658684 _ACEOF
86668685 sed -n '
86678686 h
87098728 rm -f conf$$subs.awk
87108729 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
87118730 _ACAWK
8712 cat >>"\$tmp/subs1.awk" <<_ACAWK &&
8731 cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
87138732 for (key in S) S_is_set[key] = 1
87148733 FS = ""
87158734
87418760 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
87428761 else
87438762 cat
8744 fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
8763 fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
87458764 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
87468765 _ACEOF
87478766
87758794 # No need to generate them if there are no CONFIG_HEADERS.
87768795 # This happens for instance with `./config.status Makefile'.
87778796 if test -n "$CONFIG_HEADERS"; then
8778 cat >"$tmp/defines.awk" <<\_ACAWK ||
8797 cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
87798798 BEGIN {
87808799 _ACEOF
87818800
87878806 # handling of long lines.
87888807 ac_delim='%!_!# '
87898808 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
87928811 break
87938812 elif $ac_last_try; then
87948813 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
89088927 for ac_f
89098928 do
89108929 case $ac_f in
8911 -) ac_f="$tmp/stdin";;
8930 -) ac_f="$ac_tmp/stdin";;
89128931 *) # Look for the file first in the build tree, then in the source tree
89138932 # (if the path is not absolute). The absolute path cannot be DOS-style,
89148933 # because $ac_f cannot contain `:'.
89438962 esac
89448963
89458964 case $ac_tag in
8946 *:-:* | *:-) cat >"$tmp/stdin" \
8965 *:-:* | *:-) cat >"$ac_tmp/stdin" \
89478966 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
89488967 esac
89498968 ;;
90809099 s&@MKDIR_P@&$ac_MKDIR_P&;t t
90819100 $ac_datarootdir_hack
90829101 "
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
90859104
90869105 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"; } &&
90899109 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
90909110 which seems to be undefined. Please make sure it is defined" >&5
90919111 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
90929112 which seems to be undefined. Please make sure it is defined" >&2;}
90939113
9094 rm -f "$tmp/stdin"
9114 rm -f "$ac_tmp/stdin"
90959115 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";;
90989118 esac \
90999119 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
91009120 ;;
91059125 if test x"$ac_file" != x-; then
91069126 {
91079127 $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" \
91109130 || 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
91129132 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
91139133 $as_echo "$as_me: $ac_file is unchanged" >&6;}
91149134 else
91159135 rm -f "$ac_file"
9116 mv "$tmp/config.h" "$ac_file" \
9136 mv "$ac_tmp/config.h" "$ac_file" \
91179137 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
91189138 fi
91199139 else
91209140 $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" \
91229142 || as_fn_error $? "could not create -" "$LINENO" 5
91239143 fi
91249144 # Compute "$ac_file"'s index in $config_headers.
22
33 AC_PREREQ(2.59)
44 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)
66 #AC_CONFIG_SRCDIR([grammar.y])
77 AC_CONFIG_HEADER([config.h])
88 AM_INIT_AUTOMAKE()
5353 #AM_CONDITIONAL(COMPAT15, test "$enable_compat15" = yes)
5454 if test "${enable_compat15}" = "yes" ; then
5555 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"
5663 fi
5764
5865 AC_PROG_YACC