View | Details | Raw Unified | Return to bug 203182 | Differences between
and this patch

Collapse All | Expand All

(-)libbgpdump-new/Makefile (-10 / +9 lines)
Lines 1-11 Link Here
1
# $FreeBSD: head/net/libbgpdump/Makefile 365034 2014-08-15 20:24:06Z pi $
1
# $FreeBSD: head/net/libbgpdump/Makefile 365034 2014-08-15 20:24:06Z pi $
2
2
3
PORTNAME=	libbgpdump
3
PORTNAME=	libbgpdump
4
PORTVERSION=	1.4.99.13
4
PORTVERSION=	1.4.99.15
5
PORTREVISION=	3
6
CATEGORIES=	net
5
CATEGORIES=	net
7
MASTER_SITES=	http://www.ris.ripe.net/source/bgpdump/
6
MASTER_SITES=	http://www.ris.ripe.net/source/bgpdump/
8
EXTRACT_SUFX=	.tgz
9
7
10
MAINTAINER=	mjl@luckie.org.nz
8
MAINTAINER=	mjl@luckie.org.nz
11
COMMENT=	Analyzing dump files produced by Zebra/Quagga or MRT
9
COMMENT=	Analyzing dump files produced by Zebra/Quagga or MRT
Lines 14-31 Link Here
14
12
15
GNU_CONFIGURE=	yes
13
GNU_CONFIGURE=	yes
16
USE_LDCONFIG=	yes
14
USE_LDCONFIG=	yes
15
USES=		tar:tgz
17
16
18
OPTIONS_DEFINE=	DOCS EXAMPLES
17
OPTIONS_DEFINE=	DOCS EXAMPLES
19
18
20
do-install:
19
do-install:
21
	@${INSTALL_PROGRAM} ${WRKSRC}/bgpdump ${STAGEDIR}${PREFIX}/bin
20
	${INSTALL_PROGRAM} ${WRKSRC}/bgpdump ${STAGEDIR}${PREFIX}/bin
22
	@${INSTALL_DATA} ${WRKSRC}/libbgpdump.* ${STAGEDIR}${PREFIX}/lib
21
	${INSTALL_DATA} ${WRKSRC}/libbgpdump.* ${STAGEDIR}${PREFIX}/lib
23
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libbgpdump.so
22
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libbgpdump.so
24
.for i in bgpdump_attr.h bgpdump_formats.h bgpdump_lib.h
23
.for i in bgpdump_attr.h bgpdump_formats.h bgpdump_lib.h
25
	@${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${PREFIX}/include
24
	${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${PREFIX}/include
26
.endfor
25
.endfor
27
	@${MKDIR} ${STAGEDIR}${DOCSDIR} ${STAGEDIR}${EXAMPLESDIR}
26
	${MKDIR} ${STAGEDIR}${DOCSDIR} ${STAGEDIR}${EXAMPLESDIR}
28
	@${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}
27
	${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}
29
	@${INSTALL_DATA} ${WRKSRC}/example.c ${STAGEDIR}${EXAMPLESDIR}
28
	${INSTALL_DATA} ${WRKSRC}/example.c ${STAGEDIR}${EXAMPLESDIR}
30
29
31
.include <bsd.port.mk>
30
.include <bsd.port.mk>
(-)libbgpdump-new/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (libbgpdump-1.4.99.13.tgz) = 7551a285fa5c0885aec7290e1f316e58968baab70a4f3467f8f70868d338311e
1
SHA256 (libbgpdump-1.4.99.15.tgz) = 04ad874a745541ec88c87639cb6cfdddaba4db515360855108bc9d65f14b7576
2
SIZE (libbgpdump-1.4.99.13.tgz) = 84083
2
SIZE (libbgpdump-1.4.99.15.tgz) = 131580
(-)libbgpdump-new/files/patch-bgpdump.c (-13 lines)
Lines 1-13 Link Here
1
--- bgpdump.c.old	2014-07-24 13:02:50.000000000 +0000
2
+++ bgpdump.c	2014-07-24 13:03:27.000000000 +0000
3
@@ -164,10 +164,6 @@
4
         exit(1);        
5
     }
6
 
7
-    // more efficient then line buffering
8
-    char buffer[16000];
9
-    setbuffer(stdout, buffer, sizeof buffer);
10
-    
11
     BGPDUMP *my_dump = bgpdump_open_dump(argv[0]);
12
     
13
     do {
(-)libbgpdump-new/files/patch-util.c (-29 lines)
Lines 1-29 Link Here
1
--- util.c.orig	2014-08-15 12:58:56.000000000 -0700
2
+++ util.c	2014-08-15 13:01:14.000000000 -0700
3
@@ -29,6 +29,7 @@
4
 #include <syslog.h>
5
 #include <time.h>
6
 #include <string.h>
7
+#include <inttypes.h>
8
 
9
 static bool use_syslog = true;
10
 
11
@@ -110,17 +111,7 @@
12
 
13
 int int2str(uint32_t value, char* str)
14
 {
15
-    const int LEN = 11;
16
-    char b[LEN];
17
-    int i = LEN;
18
-    b[i--] = '\0';
19
-    
20
-    do {
21
-        b[i--] = (char)(48 + (value % 10));
22
-    } while (value /= 10);
23
-
24
-    memcpy(str, b + i + 1, LEN - i);
25
-    return LEN - i - 1;
26
+  return snprintf(str, 11, "%"PRIu32, value);
27
 }
28
 
29
 static void ti2s(uint32_t value) {
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/.cvsignore (+1 lines)
Line 0 Link Here
1
.project
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/.hg_archival.txt (+5 lines)
Line 0 Link Here
1
repo: fc85b5d83c23266299237988401380dcb3d3c4f3
2
node: 0cb1a4c59d10ba20de237a0a2b072df8829634ea
3
branch: default
4
latesttag: 1.4.99.15
5
latesttagdistance: 2
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/.hgignore (+18 lines)
Line 0 Link Here
1
\.o$
2
\.pbxuser$
3
\.mode1v3$
4
\.swp$
5
^bgpdump-config.h$
6
^config.log$
7
^config.status$
8
^bgpdump$
9
^testbgpdump$
10
^libbgpdump.a$
11
^libbgpdump.so$
12
^Makefile$
13
^test_out/.*
14
^build/
15
^bgpdump.spec$
16
~$
17
^libbgpdump-.*\.tgz$
18
^autom4te.cache/
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/.hgtags (+9 lines)
Line 0 Link Here
1
6271706a4a0e495b2cc5e48822d0d73abfc55807 1.4.98.7
2
e9617d1b0fa959ad3436797701d027958b335667 1.4.99.8
3
aeead79922f7eeac5d8e678b43101deef02cf847 1.4.99.9
4
397bfe76c57fe46694ac06735843575683c772e6 1.4.99.10
5
4cce25d5026009a1ba2924afa8b10907ecf4498e 1.4.99.11
6
9fe2f50927688e4560941e655b3c970c4b668540 1.4.99.12
7
b8e3ed2b370ca220f46bfa59193665dfdee5d5ef 1.4.99.13
8
c4c53146f09af40a0068992d67a345a05ac54514 1.4.99.14
9
d8e8bcf60eb4c7ce065b2744d6a32003c728d8b2 1.4.99.15
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/COPYING (+309 lines)
Line 0 Link Here
1
2
Copyright (C) 2007 - 2011 RIPE NCC
3
4
Permission to use, copy, modify, and distribute this software and its
5
documentation for any purpose and without fee is hereby granted, provided
6
that the above copyright notice appear in all copies and that both that
7
copyright notice and this permission notice appear in supporting
8
documentation, and that the name of the author not be used in advertising or
9
publicity pertaining to distribution of the software without specific,
10
written prior permission.
11
12
THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
13
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
14
AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
15
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
16
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 
18
19
----------------------------------------------------------------------------
20
21
Parts of this code have been engineered after analiyzing GNU Zebra's
22
source code and therefore might contain declarations/code from GNU
23
Zebra, Copyright (C) 1999 Kunihiro Ishiguro. Zebra is a free routing
24
software, distributed under the GNU General Public License. A copy of
25
this license is included with libbgpdump.
26
27
----------------------------------------------------------------------------
28
29
		    GNU GENERAL PUBLIC LICENSE
30
		       Version 2, June 1991
31
32
 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
33
                          675 Mass Ave, Cambridge, MA 02139, USA
34
 Everyone is permitted to copy and distribute verbatim copies
35
 of this license document, but changing it is not allowed.
36
37
			    Preamble
38
39
  The licenses for most software are designed to take away your
40
freedom to share and change it.  By contrast, the GNU General Public
41
License is intended to guarantee your freedom to share and change free
42
software--to make sure the software is free for all its users.  This
43
General Public License applies to most of the Free Software
44
Foundation's software and to any other program whose authors commit to
45
using it.  (Some other Free Software Foundation software is covered by
46
the GNU Library General Public License instead.)  You can apply it to
47
your programs, too.
48
49
  When we speak of free software, we are referring to freedom, not
50
price.  Our General Public Licenses are designed to make sure that you
51
have the freedom to distribute copies of free software (and charge for
52
this service if you wish), that you receive source code or can get it
53
if you want it, that you can change the software or use pieces of it
54
in new free programs; and that you know you can do these things.
55
56
  To protect your rights, we need to make restrictions that forbid
57
anyone to deny you these rights or to ask you to surrender the rights.
58
These restrictions translate to certain responsibilities for you if you
59
distribute copies of the software, or if you modify it.
60
61
  For example, if you distribute copies of such a program, whether
62
gratis or for a fee, you must give the recipients all the rights that
63
you have.  You must make sure that they, too, receive or can get the
64
source code.  And you must show them these terms so they know their
65
rights.
66
67
  We protect your rights with two steps: (1) copyright the software, and
68
(2) offer you this license which gives you legal permission to copy,
69
distribute and/or modify the software.
70
71
  Also, for each author's protection and ours, we want to make certain
72
that everyone understands that there is no warranty for this free
73
software.  If the software is modified by someone else and passed on, we
74
want its recipients to know that what they have is not the original, so
75
that any problems introduced by others will not reflect on the original
76
authors' reputations.
77
78
  Finally, any free program is threatened constantly by software
79
patents.  We wish to avoid the danger that redistributors of a free
80
program will individually obtain patent licenses, in effect making the
81
program proprietary.  To prevent this, we have made it clear that any
82
patent must be licensed for everyone's free use or not licensed at all.
83
84
  The precise terms and conditions for copying, distribution and
85
modification follow.
86
87
		    GNU GENERAL PUBLIC LICENSE
88
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
89
90
  0. This License applies to any program or other work which contains
91
a notice placed by the copyright holder saying it may be distributed
92
under the terms of this General Public License.  The "Program", below,
93
refers to any such program or work, and a "work based on the Program"
94
means either the Program or any derivative work under copyright law:
95
that is to say, a work containing the Program or a portion of it,
96
either verbatim or with modifications and/or translated into another
97
language.  (Hereinafter, translation is included without limitation in
98
the term "modification".)  Each licensee is addressed as "you".
99
100
Activities other than copying, distribution and modification are not
101
covered by this License; they are outside its scope.  The act of
102
running the Program is not restricted, and the output from the Program
103
is covered only if its contents constitute a work based on the
104
Program (independent of having been made by running the Program).
105
Whether that is true depends on what the Program does.
106
107
  1. You may copy and distribute verbatim copies of the Program's
108
source code as you receive it, in any medium, provided that you
109
conspicuously and appropriately publish on each copy an appropriate
110
copyright notice and disclaimer of warranty; keep intact all the
111
notices that refer to this License and to the absence of any warranty;
112
and give any other recipients of the Program a copy of this License
113
along with the Program.
114
115
You may charge a fee for the physical act of transferring a copy, and
116
you may at your option offer warranty protection in exchange for a fee.
117
118
  2. You may modify your copy or copies of the Program or any portion
119
of it, thus forming a work based on the Program, and copy and
120
distribute such modifications or work under the terms of Section 1
121
above, provided that you also meet all of these conditions:
122
123
    a) You must cause the modified files to carry prominent notices
124
    stating that you changed the files and the date of any change.
125
126
    b) You must cause any work that you distribute or publish, that in
127
    whole or in part contains or is derived from the Program or any
128
    part thereof, to be licensed as a whole at no charge to all third
129
    parties under the terms of this License.
130
131
    c) If the modified program normally reads commands interactively
132
    when run, you must cause it, when started running for such
133
    interactive use in the most ordinary way, to print or display an
134
    announcement including an appropriate copyright notice and a
135
    notice that there is no warranty (or else, saying that you provide
136
    a warranty) and that users may redistribute the program under
137
    these conditions, and telling the user how to view a copy of this
138
    License.  (Exception: if the Program itself is interactive but
139
    does not normally print such an announcement, your work based on
140
    the Program is not required to print an announcement.)
141
142
These requirements apply to the modified work as a whole.  If
143
identifiable sections of that work are not derived from the Program,
144
and can be reasonably considered independent and separate works in
145
themselves, then this License, and its terms, do not apply to those
146
sections when you distribute them as separate works.  But when you
147
distribute the same sections as part of a whole which is a work based
148
on the Program, the distribution of the whole must be on the terms of
149
this License, whose permissions for other licensees extend to the
150
entire whole, and thus to each and every part regardless of who wrote it.
151
152
Thus, it is not the intent of this section to claim rights or contest
153
your rights to work written entirely by you; rather, the intent is to
154
exercise the right to control the distribution of derivative or
155
collective works based on the Program.
156
157
In addition, mere aggregation of another work not based on the Program
158
with the Program (or with a work based on the Program) on a volume of
159
a storage or distribution medium does not bring the other work under
160
the scope of this License.
161
162
  3. You may copy and distribute the Program (or a work based on it,
163
under Section 2) in object code or executable form under the terms of
164
Sections 1 and 2 above provided that you also do one of the following:
165
166
    a) Accompany it with the complete corresponding machine-readable
167
    source code, which must be distributed under the terms of Sections
168
    1 and 2 above on a medium customarily used for software interchange; or,
169
170
    b) Accompany it with a written offer, valid for at least three
171
    years, to give any third party, for a charge no more than your
172
    cost of physically performing source distribution, a complete
173
    machine-readable copy of the corresponding source code, to be
174
    distributed under the terms of Sections 1 and 2 above on a medium
175
    customarily used for software interchange; or,
176
177
    c) Accompany it with the information you received as to the offer
178
    to distribute corresponding source code.  (This alternative is
179
    allowed only for noncommercial distribution and only if you
180
    received the program in object code or executable form with such
181
    an offer, in accord with Subsection b above.)
182
183
The source code for a work means the preferred form of the work for
184
making modifications to it.  For an executable work, complete source
185
code means all the source code for all modules it contains, plus any
186
associated interface definition files, plus the scripts used to
187
control compilation and installation of the executable.  However, as a
188
special exception, the source code distributed need not include
189
anything that is normally distributed (in either source or binary
190
form) with the major components (compiler, kernel, and so on) of the
191
operating system on which the executable runs, unless that component
192
itself accompanies the executable.
193
194
If distribution of executable or object code is made by offering
195
access to copy from a designated place, then offering equivalent
196
access to copy the source code from the same place counts as
197
distribution of the source code, even though third parties are not
198
compelled to copy the source along with the object code.
199
200
  4. You may not copy, modify, sublicense, or distribute the Program
201
except as expressly provided under this License.  Any attempt
202
otherwise to copy, modify, sublicense or distribute the Program is
203
void, and will automatically terminate your rights under this License.
204
However, parties who have received copies, or rights, from you under
205
this License will not have their licenses terminated so long as such
206
parties remain in full compliance.
207
208
  5. You are not required to accept this License, since you have not
209
signed it.  However, nothing else grants you permission to modify or
210
distribute the Program or its derivative works.  These actions are
211
prohibited by law if you do not accept this License.  Therefore, by
212
modifying or distributing the Program (or any work based on the
213
Program), you indicate your acceptance of this License to do so, and
214
all its terms and conditions for copying, distributing or modifying
215
the Program or works based on it.
216
217
  6. Each time you redistribute the Program (or any work based on the
218
Program), the recipient automatically receives a license from the
219
original licensor to copy, distribute or modify the Program subject to
220
these terms and conditions.  You may not impose any further
221
restrictions on the recipients' exercise of the rights granted herein.
222
You are not responsible for enforcing compliance by third parties to
223
this License.
224
225
  7. If, as a consequence of a court judgment or allegation of patent
226
infringement or for any other reason (not limited to patent issues),
227
conditions are imposed on you (whether by court order, agreement or
228
otherwise) that contradict the conditions of this License, they do not
229
excuse you from the conditions of this License.  If you cannot
230
distribute so as to satisfy simultaneously your obligations under this
231
License and any other pertinent obligations, then as a consequence you
232
may not distribute the Program at all.  For example, if a patent
233
license would not permit royalty-free redistribution of the Program by
234
all those who receive copies directly or indirectly through you, then
235
the only way you could satisfy both it and this License would be to
236
refrain entirely from distribution of the Program.
237
238
If any portion of this section is held invalid or unenforceable under
239
any particular circumstance, the balance of the section is intended to
240
apply and the section as a whole is intended to apply in other
241
circumstances.
242
243
It is not the purpose of this section to induce you to infringe any
244
patents or other property right claims or to contest validity of any
245
such claims; this section has the sole purpose of protecting the
246
integrity of the free software distribution system, which is
247
implemented by public license practices.  Many people have made
248
generous contributions to the wide range of software distributed
249
through that system in reliance on consistent application of that
250
system; it is up to the author/donor to decide if he or she is willing
251
to distribute software through any other system and a licensee cannot
252
impose that choice.
253
254
This section is intended to make thoroughly clear what is believed to
255
be a consequence of the rest of this License.
256
257
  8. If the distribution and/or use of the Program is restricted in
258
certain countries either by patents or by copyrighted interfaces, the
259
original copyright holder who places the Program under this License
260
may add an explicit geographical distribution limitation excluding
261
those countries, so that distribution is permitted only in or among
262
countries not thus excluded.  In such case, this License incorporates
263
the limitation as if written in the body of this License.
264
265
  9. The Free Software Foundation may publish revised and/or new versions
266
of the General Public License from time to time.  Such new versions will
267
be similar in spirit to the present version, but may differ in detail to
268
address new problems or concerns.
269
270
Each version is given a distinguishing version number.  If the Program
271
specifies a version number of this License which applies to it and "any
272
later version", you have the option of following the terms and conditions
273
either of that version or of any later version published by the Free
274
Software Foundation.  If the Program does not specify a version number of
275
this License, you may choose any version ever published by the Free Software
276
Foundation.
277
278
  10. If you wish to incorporate parts of the Program into other free
279
programs whose distribution conditions are different, write to the author
280
to ask for permission.  For software which is copyrighted by the Free
281
Software Foundation, write to the Free Software Foundation; we sometimes
282
make exceptions for this.  Our decision will be guided by the two goals
283
of preserving the free status of all derivatives of our free software and
284
of promoting the sharing and reuse of software generally.
285
286
			    NO WARRANTY
287
288
  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
289
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
290
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
291
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
292
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
293
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
294
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
295
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
296
REPAIR OR CORRECTION.
297
298
  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
299
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
300
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
301
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
302
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
303
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
304
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
305
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
306
POSSIBILITY OF SUCH DAMAGES.
307
308
		     END OF TERMS AND CONDITIONS
309
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/ChangeLog (+197 lines)
Line 0 Link Here
1
==========================================================
2
The current maintainer of this library is the
3
RIPE NCC information services department.
4
5
You can reach us at https://bitbucket.org/ripencc/bgpdump
6
7
PLEASE DO NOT E-MAIL INDIVIDUAL DEVELOPERS ABOUT
8
ISSUES, AS YOUR E-MAIL MAY BE LOST
9
==========================================================
10
11
2015-07-16 Max Lapan <mlapan@ripe.net>
12
	* -p option to show packet index
13
14
2011-01-25 Devin Bayer <dbayer@ripe.net>
15
	* move development to bitbucket
16
17
2010-10-21 Devin Bayer <dbayer@ripe.net> v1.4.99.13
18
	* fix configure script for Darwin
19
20
2010-09-24 Devin Bayer <dbayer@ripe.net> v1.4.99.12
21
	* Remove --disable-ipv6 flag
22
        * Fix parsing of IPv6 NEXT_HOP attributes
23
        * Add clearer command-line options
24
        * Add logging to STDERR
25
        * Add dumping to files instead of STDOUT
26
        * Add regression test suite
27
28
2009-11-24 Roman Kalyakin <roman@ripe.net> v1.4.99.11
29
	* Fixed incorrect output when running with -m which was
30
	  introduced by a change in one of the previous versions.
31
	  (issue IS-439)
32
33
2009-10-13 Ruben van Staveren <ruben@ripe.net>
34
	* Fix segfaults with empty AS path on -m/-M 
35
	  (issue IS-292)
36
	  Patch contributed by Lorenzo Colitti <lorenzo@google.com> 
37
38
2009-07-29 Erik Romijn <eromijn@ripe.net>
39
	* Fixing incorrect as path length count in case of AS_(CONFED_)SEQUENCE
40
	  (issue IS-141)
41
	  Patch contributed by Toby Ehrenkranz <tehrenkr@cs.uoregon.edu>
42
	* Added support for the ORIGINATOR_ID and CLUSTER_LIST attributes
43
	  (issue IS-181)
44
	  Patch contributed by Maurizio Pizzonia <pizzonia@dia.uniroma3.it>
45
	* Fixed signedness of MED and localpref (issue IS-180)
46
	  Patch contributed by Steve Hill <cheesy@sackheads.org>
47
	* Implemented conditional checking for compression libraries (issue IS-179)
48
	  Patch contributed by Steve Hill <cheesy@sackheads.org>
49
50
2009-07-27 Ruben van Staveren <ruben@ripe.net>
51
	* Enabled extra compiler warnings
52
	* Fixed some potentially unsafe constructs (pointer arithmetic,
53
	  signed/unsigned comparisons, shadowed variables) 
54
55
2009-07-22 Ruben van Staveren <ruben@ripe.net>
56
	* Fixed a case where during -M dumps aspaths where printed for entries that
57
	  did not have their BGP_ATTR_AS_PATH flag set. Such entries will now print
58
	  an empty field. Reported by many people.
59
	* Changed -fpic to -fPIC: newer gccs coerce -fpic to -fPIC any way.
60
	  difference is that with -fpic the global offset table has a maximum size
61
	* Fixed nit in getopt handling
62
	* Added distclean target
63
	* In bgpdump_free_mp_info(), set pointers to NULL after freeing them.
64
	  Reported by Robert Kisteleki <robertk@ripe.net>
65
	* Default output for 32bit ASN numbers is now ASPLAIN
66
67
2008-02-01 Erik Romijn <eromijn@ripe.net>
68
	* Fixed a few memleaks based on a patch from
69
	  Antony Antony <antony@phenome.org>
70
	  (Ticket NCC#2007064868)
71
	* Fixed compiling with --disable-ipv6 based on a patch
72
	  from Haniff Rahbari <hnrahbari@yahoo.com>
73
	  (Ticket NCC#2007111325)
74
	* Fixed a few warnings, mostly based on a patch from
75
	  Bruno Quoitin <bruno.quoitin@uclouvain.be>
76
	  (Ticket NCC#2007123069)
77
	* Made bgpdump's usage message nicer
78
79
2007-06-21 Erik Romijn <eromijn@ripe.net>
80
    * Fixed incorrect dump time display for some cases
81
82
2007-06-06 Erik Romijn <eromijn@ripe.net>
83
    * Set proper compile options to work on Mac OS X 10.4
84
85
2007-06-01 Erik Romijn <eromijn@ripe.net>
86
    * Fixed several bugs in 64-bit PC support and added
87
	  bzip2 support, credit goes to
88
	  Bernhard Tellenbach <betellen@tik.ee.ethz.ch>
89
	  for providing patches.
90
	* Fixed incorrect IPv6 nexthops in -M/-m output
91
92
2007-03-29 Erik Romijn <eromijn@ripe.net>
93
	* Fixed a serious segfault in the insertion of update dumps
94
95
2007-03-28 Erik Romijn <eromijn@ripe.net>
96
	* Fixed a large memory leak in TABLE_DUMP_V2 processing
97
98
2007-03-27 Erik Romijn <eromijn@ripe.net>
99
	* Fixed a bug causing segfaults on processing some MP_REACH_NLRI's
100
101
2007-03-09 Erik Romijn <eromijn@ripe.net>
102
	* Updated TABLE_DUMP_V2 support to comply with draft-ietf-grow-mrt-04
103
104
2007-03-07 Erik Romijn <eromijn@ripe.net>
105
	* Built in TABLE_DUMP_V2 support
106
	* Rename ..MESSAGE32 to ..MESSAGE_AS4
107
	* Fixed bug where -M always crashed
108
109
2007-02-01 Erik Romijn <eromijn@ripe.net>
110
	* Minor fix in ASN32 support
111
112
2006-10-20 Lorenzo Colitti <lorenzo@ripe.net>
113
	* Implement ASN32 support
114
115
2005-11-08 Young Hyun <youngh@caida.org>
116
	* IPv6 prefixes were not printed properly by bgpdump.
117
118
2004-02-10 Lorenzo Colitti <lorenzo@ripe.net>
119
	* Fix a stupid crash when reading truncated prefixes.
120
121
2004-02-09 Lorenzo Colitti <lorenzo@ripe.net>
122
	* Decode unknown attributes properly.
123
	* Fix a crash when reading truncated prefixes.
124
125
2004-02-04 Hong-wei Kong  <hong-wei_kong@agilent.com>
126
        * Add a new option (-t dump|change) to bgpdump. If '-t dump' is 
127
	  specified, then the decoding result with '-m' / '-M' option will
128
	  show the timestamp when these routes are dumped. If '-t change' is
129
	  specified, then the decoding result with '-m' / '-M' option will
130
	  show the timestamp when the routes were last time changed. This 
131
	  option only works with routing table dumps.
132
133
2004-01-16 Lorenzo Colitti <lorenzo@ripe.net>
134
	* Fix compile errors under cygwin (only IPv4 works though)
135
136
2003-12-18 Hong-Wei Kong <hong-wei_kong@agilent.com>
137
	* Added support for dumping BGP routing table entries in
138
	  machine-readable format (-m). Previously -m was only supported
139
	  for BGP messages
140
141
2003-12-16 Shufu Mao <msf98@mails.tsinghua.edu.cn>
142
	* Revised the decoding of BGP routing table dump to make the result
143
	  identical to route_btoa
144
145
2003-12-15  Lorenzo Colitti <lorenzo@ripe.net>
146
	* Proper autoconf support: check for features instead of target
147
	  systems, remove extra .h files and only use configure.in, use
148
	  Makefile.in instead of Make.include, link both static and
149
	  shared library, check for ar and ranlib, etc.
150
	* Changed INET6 to BGPDUMP_HAVE_IPV6
151
	  (N.B. Docs are not updated yet)
152
	* Fixed possible endianness issues on Sparc.
153
	* Fixed a crash while decoding NOTIFICATION messages
154
155
2003-11-26  Shufu Mao <msf98@mails.tsinghua.edu.cn>
156
157
	* Workaround for zebra "NOIP" bug
158
	* Preliminary autoconf support (./configure; make)
159
	* Added option to disable IPv6. If this option is specified to
160
	  ./configure, the library is compiled without IPv6 support.
161
	  The default is to turn on IPv6 if the necessary headers are
162
	  available.
163
164
2003-11-25  Lorenzo Colitti <lorenzo@ripe.net>
165
166
	* Added support for OPEN and NOTIFICATION messages.
167
	* Better workarounds for corrupt data produced by zebra/quagga bugs.
168
	* The library now keeps track of how many records were parsed and how
169
	  many were successfully parsed.
170
	* Better error reporting. Now an error will be logged through syslog
171
	  whenever a record cannot be decoded.
172
	* Agilent Labs contributed bgpdump, a tool which emulates route_btoa
173
	  using libbgpdump. This should be a drop-in replacement for people
174
	  currently using route_btoa and supports IPv6 on all platforms.
175
176
2003-10-15  Lorenzo Colitti <lorenzo@ripe.net>
177
178
	* 1.3.1 beta released
179
	* Added support for reading from gzipped input files and gzipped stdin.
180
	  NOTE: this means you must now link with zlib!
181
	* Changed Makefile to build a shared library by default.
182
	* Renamed test program from test2 to testbgpdump.
183
184
2003-10-15  Lorenzo Colitti <lorenzo@ripe.net>
185
186
	* 1.3 beta released
187
	* Added IPv6 support. Note that this changes some interfaces!
188
	  See README.ipv6 for details.
189
	* Set announce and withdraw arrays to NULL to avoid segfaults if there
190
	  is a parse error.
191
	* Change mstream behaviour so it always returns zero bytes if reading
192
	  past the end of a packet. This eliminates non-deterministic
193
	  behaviour (random segfaults, infinite loops, ...) when parsing
194
	  corrupt data, including the consequences of the zebra "update packet
195
	  truncated at 4096 bytes" bug.
196
	* Other fixes to handle corrupt data better.
197
	* Other miscellaneous fixes.
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/Makefile (+64 lines)
Line 0 Link Here
1
2
CC	= gcc -fPIC
3
CFLAGS	= -g -O3  -Wall -Wsystem-headers -Wno-format-y2k -Wno-sign-compare -Wcast-align -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wswitch -Wshadow
4
COMPILE  = $(CC) $(CFLAGS) $(INCLUDES)
5
6
LD	= gcc
7
LDFLAGS	=  -dynamiclib
8
RANLIB	= ranlib
9
10
SYS_LIBS= -lbz2 -lz 
11
12
prefix   = /usr/local
13
exec_prefix = ${prefix}
14
bindir   = ${exec_prefix}/bin
15
libdir   = ${exec_prefix}/lib
16
includedir = ${prefix}/include
17
18
LIB_H	 = bgpdump_attr.h bgpdump_formats.h bgpdump_lib.h bgpdump_mstream.h
19
LIB_O	 = bgpdump_lib.o bgpdump_mstream.o cfile_tools.o util.o inet_ntop.o
20
OTHER    = *.in configure bgpdump.spec README* ChangeLog License*
21
22
all: libbgpdump.so bgpdump 
23
24
libbgpdump.a: $(LIB_H) $(LIB_O) Makefile cfile_tools.h util.h
25
	ar r libbgpdump.a $(LIB_O)
26
	$(RANLIB) libbgpdump.a
27
28
libbgpdump.so: libbgpdump.a
29
	$(COMPILE) $(LDFLAGS) -o libbgpdump.so $(LIB_O) $(SYS_LIBS)
30
31
example: example.c libbgpdump.a
32
	$(COMPILE) -o example example.c libbgpdump.a $(SYS_LIBS)
33
34
bgpdump: bgpdump.c libbgpdump.a
35
	$(COMPILE) -o bgpdump bgpdump.c libbgpdump.a $(SYS_LIBS)
36
37
check-clean:
38
	rm -f test_out/*.bgp.gz
39
40
check: check-clean bgpdump
41
	./test.sh
42
43
clean: check-clean
44
	rm -f libbgpdump.so libbgpdump.a example bgpdump $(LIB_O)
45
46
distclean: clean
47
	rm -Rf config.log config.status *.dSYM core *.core autom4te.cache bgpdump-config.h Makefile
48
	rm -Rf $(PKG)
49
50
install: all
51
	install -d $(bindir) $(includedir) $(libdir)
52
	install bgpdump $(bindir)
53
	install $(LIB_H) $(includedir)
54
	install libbgpdump.so libbgpdump.a $(libdir)
55
56
PKG=libbgpdump-1.4.99.15
57
dist:
58
	mkdir $(PKG)
59
	ln *.h *.c $(OTHER) $(PKG)
60
	tar -czf $(PKG).tgz $(PKG)
61
	rm $(PKG)/* && rmdir $(PKG)
62
63
rpm: dist
64
	rpmbuild -v -ta $(PKG).tgz
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/Makefile.in (+64 lines)
Line 0 Link Here
1
2
CC	= @CC@ -fPIC
3
CFLAGS	= @CFLAGS@
4
COMPILE  = $(CC) $(CFLAGS) $(INCLUDES)
5
6
LD	= @CC@
7
LDFLAGS	= @LDFLAGS@
8
RANLIB	= @RANLIB@
9
10
SYS_LIBS= @LIBS@
11
12
prefix   = @prefix@
13
exec_prefix = @exec_prefix@
14
bindir   = @bindir@
15
libdir   = @libdir@
16
includedir = @includedir@
17
18
LIB_H	 = bgpdump_attr.h bgpdump_formats.h bgpdump_lib.h bgpdump_mstream.h
19
LIB_O	 = bgpdump_lib.o bgpdump_mstream.o cfile_tools.o util.o inet_ntop.o
20
OTHER    = *.in configure bgpdump.spec README* ChangeLog License*
21
22
all: libbgpdump.so bgpdump 
23
24
libbgpdump.a: $(LIB_H) $(LIB_O) Makefile cfile_tools.h util.h
25
	ar r libbgpdump.a $(LIB_O)
26
	$(RANLIB) libbgpdump.a
27
28
libbgpdump.so: libbgpdump.a
29
	$(COMPILE) $(LDFLAGS) -o libbgpdump.so $(LIB_O) $(SYS_LIBS)
30
31
example: example.c libbgpdump.a
32
	$(COMPILE) -o example example.c libbgpdump.a $(SYS_LIBS)
33
34
bgpdump: bgpdump.c libbgpdump.a
35
	$(COMPILE) -o bgpdump bgpdump.c libbgpdump.a $(SYS_LIBS)
36
37
check-clean:
38
	rm -f test_out/*.bgp.gz
39
40
check: check-clean bgpdump
41
	./test.sh
42
43
clean: check-clean
44
	rm -f libbgpdump.so libbgpdump.a example bgpdump $(LIB_O)
45
46
distclean: clean
47
	rm -Rf config.log config.status *.dSYM core *.core autom4te.cache bgpdump-config.h Makefile
48
	rm -Rf $(PKG)
49
50
install: all
51
	install -d $(bindir) $(includedir) $(libdir)
52
	install bgpdump $(bindir)
53
	install $(LIB_H) $(includedir)
54
	install libbgpdump.so libbgpdump.a $(libdir)
55
56
PKG=@PACKAGE_NAME@-@PACKAGE_VERSION@
57
dist:
58
	mkdir $(PKG)
59
	ln *.h *.c $(OTHER) $(PKG)
60
	tar -czf $(PKG).tgz $(PKG)
61
	rm $(PKG)/* && rmdir $(PKG)
62
63
rpm: dist
64
	rpmbuild -v -ta $(PKG).tgz
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/README (+8 lines)
Line 0 Link Here
1
== libBGPdump ==
2
3
A C library designed to help with analyzing dump
4
files produced by Zebra/Quagga or MRT. Documenation
5
is available at:
6
7
https://bitbucket.org/ripencc/bgpdump/wiki/Home
8
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/autom4te.cache/output.0 (+5019 lines)
Line 0 Link Here
1
@%:@! /bin/sh
2
@%:@ From configure.in Revision.
3
@%:@ Guess values for system-dependent variables and create Makefiles.
4
@%:@ Generated by GNU Autoconf 2.69 for libbgpdump 1.4.99.15.
5
@%:@
6
@%:@ Report bugs to <ris@ripe.net>.
7
@%:@ 
8
@%:@ 
9
@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
10
@%:@ 
11
@%:@ 
12
@%:@ This configure script is free software; the Free Software Foundation
13
@%:@ gives unlimited permission to copy, distribute and modify it.
14
## -------------------- ##
15
## M4sh Initialization. ##
16
## -------------------- ##
17
18
# Be more Bourne compatible
19
DUALCASE=1; export DUALCASE # for MKS sh
20
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
21
  emulate sh
22
  NULLCMD=:
23
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
24
  # is contrary to our usage.  Disable this feature.
25
  alias -g '${1+"$@"}'='"$@"'
26
  setopt NO_GLOB_SUBST
27
else
28
  case `(set -o) 2>/dev/null` in @%:@(
29
  *posix*) :
30
    set -o posix ;; @%:@(
31
  *) :
32
     ;;
33
esac
34
fi
35
36
37
as_nl='
38
'
39
export as_nl
40
# Printing a long string crashes Solaris 7 /usr/bin/printf.
41
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
42
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
43
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
44
# Prefer a ksh shell builtin over an external printf program on Solaris,
45
# but without wasting forks for bash or zsh.
46
if test -z "$BASH_VERSION$ZSH_VERSION" \
47
    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
48
  as_echo='print -r --'
49
  as_echo_n='print -rn --'
50
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
51
  as_echo='printf %s\n'
52
  as_echo_n='printf %s'
53
else
54
  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
55
    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
56
    as_echo_n='/usr/ucb/echo -n'
57
  else
58
    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
59
    as_echo_n_body='eval
60
      arg=$1;
61
      case $arg in @%:@(
62
      *"$as_nl"*)
63
	expr "X$arg" : "X\\(.*\\)$as_nl";
64
	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
65
      esac;
66
      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
67
    '
68
    export as_echo_n_body
69
    as_echo_n='sh -c $as_echo_n_body as_echo'
70
  fi
71
  export as_echo_body
72
  as_echo='sh -c $as_echo_body as_echo'
73
fi
74
75
# The user is always right.
76
if test "${PATH_SEPARATOR+set}" != set; then
77
  PATH_SEPARATOR=:
78
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
79
    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
80
      PATH_SEPARATOR=';'
81
  }
82
fi
83
84
85
# IFS
86
# We need space, tab and new line, in precisely that order.  Quoting is
87
# there to prevent editors from complaining about space-tab.
88
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
89
# splitting by setting IFS to empty value.)
90
IFS=" ""	$as_nl"
91
92
# Find who we are.  Look in the path if we contain no directory separator.
93
as_myself=
94
case $0 in @%:@((
95
  *[\\/]* ) as_myself=$0 ;;
96
  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
97
for as_dir in $PATH
98
do
99
  IFS=$as_save_IFS
100
  test -z "$as_dir" && as_dir=.
101
    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
102
  done
103
IFS=$as_save_IFS
104
105
     ;;
106
esac
107
# We did not find ourselves, most probably we were run as `sh COMMAND'
108
# in which case we are not to be found in the path.
109
if test "x$as_myself" = x; then
110
  as_myself=$0
111
fi
112
if test ! -f "$as_myself"; then
113
  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
114
  exit 1
115
fi
116
117
# Unset variables that we do not need and which cause bugs (e.g. in
118
# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
119
# suppresses any "Segmentation fault" message there.  '((' could
120
# trigger a bug in pdksh 5.2.14.
121
for as_var in BASH_ENV ENV MAIL MAILPATH
122
do eval test x\${$as_var+set} = xset \
123
  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
124
done
125
PS1='$ '
126
PS2='> '
127
PS4='+ '
128
129
# NLS nuisances.
130
LC_ALL=C
131
export LC_ALL
132
LANGUAGE=C
133
export LANGUAGE
134
135
# CDPATH.
136
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
137
138
# Use a proper internal environment variable to ensure we don't fall
139
  # into an infinite loop, continuously re-executing ourselves.
140
  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
141
    _as_can_reexec=no; export _as_can_reexec;
142
    # We cannot yet assume a decent shell, so we have to provide a
143
# neutralization value for shells without unset; and this also
144
# works around shells that cannot unset nonexistent variables.
145
# Preserve -v and -x to the replacement shell.
146
BASH_ENV=/dev/null
147
ENV=/dev/null
148
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
149
case $- in @%:@ ((((
150
  *v*x* | *x*v* ) as_opts=-vx ;;
151
  *v* ) as_opts=-v ;;
152
  *x* ) as_opts=-x ;;
153
  * ) as_opts= ;;
154
esac
155
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
156
# Admittedly, this is quite paranoid, since all the known shells bail
157
# out after a failed `exec'.
158
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
159
as_fn_exit 255
160
  fi
161
  # We don't want this to propagate to other subprocesses.
162
          { _as_can_reexec=; unset _as_can_reexec;}
163
if test "x$CONFIG_SHELL" = x; then
164
  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
165
  emulate sh
166
  NULLCMD=:
167
  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
168
  # is contrary to our usage.  Disable this feature.
169
  alias -g '\${1+\"\$@\"}'='\"\$@\"'
170
  setopt NO_GLOB_SUBST
171
else
172
  case \`(set -o) 2>/dev/null\` in @%:@(
173
  *posix*) :
174
    set -o posix ;; @%:@(
175
  *) :
176
     ;;
177
esac
178
fi
179
"
180
  as_required="as_fn_return () { (exit \$1); }
181
as_fn_success () { as_fn_return 0; }
182
as_fn_failure () { as_fn_return 1; }
183
as_fn_ret_success () { return 0; }
184
as_fn_ret_failure () { return 1; }
185
186
exitcode=0
187
as_fn_success || { exitcode=1; echo as_fn_success failed.; }
188
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
189
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
190
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
191
if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
192
  
193
else
194
  exitcode=1; echo positional parameters were not saved.
195
fi
196
test x\$exitcode = x0 || exit 1
197
test -x / || exit 1"
198
  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
199
  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
200
  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
201
  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
202
test \$(( 1 + 1 )) = 2 || exit 1"
203
  if (eval "$as_required") 2>/dev/null; then :
204
  as_have_required=yes
205
else
206
  as_have_required=no
207
fi
208
  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
209
  
210
else
211
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
212
as_found=false
213
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
214
do
215
  IFS=$as_save_IFS
216
  test -z "$as_dir" && as_dir=.
217
  as_found=:
218
  case $as_dir in @%:@(
219
	 /*)
220
	   for as_base in sh bash ksh sh5; do
221
	     # Try only shells that exist, to save several forks.
222
	     as_shell=$as_dir/$as_base
223
	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
224
		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
225
  CONFIG_SHELL=$as_shell as_have_required=yes
226
		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
227
  break 2
228
fi
229
fi
230
	   done;;
231
       esac
232
  as_found=false
233
done
234
$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
235
	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
236
  CONFIG_SHELL=$SHELL as_have_required=yes
237
fi; }
238
IFS=$as_save_IFS
239
240
241
      if test "x$CONFIG_SHELL" != x; then :
242
  export CONFIG_SHELL
243
             # We cannot yet assume a decent shell, so we have to provide a
244
# neutralization value for shells without unset; and this also
245
# works around shells that cannot unset nonexistent variables.
246
# Preserve -v and -x to the replacement shell.
247
BASH_ENV=/dev/null
248
ENV=/dev/null
249
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
250
case $- in @%:@ ((((
251
  *v*x* | *x*v* ) as_opts=-vx ;;
252
  *v* ) as_opts=-v ;;
253
  *x* ) as_opts=-x ;;
254
  * ) as_opts= ;;
255
esac
256
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
257
# Admittedly, this is quite paranoid, since all the known shells bail
258
# out after a failed `exec'.
259
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
260
exit 255
261
fi
262
263
    if test x$as_have_required = xno; then :
264
  $as_echo "$0: This script requires a shell more modern than all"
265
  $as_echo "$0: the shells that I found on your system."
266
  if test x${ZSH_VERSION+set} = xset ; then
267
    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
268
    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
269
  else
270
    $as_echo "$0: Please tell bug-autoconf@gnu.org and ris@ripe.net about
271
$0: your system, including any error possibly output before
272
$0: this message. Then install a modern shell, or manually
273
$0: run the script under such a shell if you do have one."
274
  fi
275
  exit 1
276
fi
277
fi
278
fi
279
SHELL=${CONFIG_SHELL-/bin/sh}
280
export SHELL
281
# Unset more variables known to interfere with behavior of common tools.
282
CLICOLOR_FORCE= GREP_OPTIONS=
283
unset CLICOLOR_FORCE GREP_OPTIONS
284
285
## --------------------- ##
286
## M4sh Shell Functions. ##
287
## --------------------- ##
288
@%:@ as_fn_unset VAR
289
@%:@ ---------------
290
@%:@ Portably unset VAR.
291
as_fn_unset ()
292
{
293
  { eval $1=; unset $1;}
294
}
295
as_unset=as_fn_unset
296
297
@%:@ as_fn_set_status STATUS
298
@%:@ -----------------------
299
@%:@ Set @S|@? to STATUS, without forking.
300
as_fn_set_status ()
301
{
302
  return $1
303
} @%:@ as_fn_set_status
304
305
@%:@ as_fn_exit STATUS
306
@%:@ -----------------
307
@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
308
as_fn_exit ()
309
{
310
  set +e
311
  as_fn_set_status $1
312
  exit $1
313
} @%:@ as_fn_exit
314
315
@%:@ as_fn_mkdir_p
316
@%:@ -------------
317
@%:@ Create "@S|@as_dir" as a directory, including parents if necessary.
318
as_fn_mkdir_p ()
319
{
320
321
  case $as_dir in #(
322
  -*) as_dir=./$as_dir;;
323
  esac
324
  test -d "$as_dir" || eval $as_mkdir_p || {
325
    as_dirs=
326
    while :; do
327
      case $as_dir in #(
328
      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
329
      *) as_qdir=$as_dir;;
330
      esac
331
      as_dirs="'$as_qdir' $as_dirs"
332
      as_dir=`$as_dirname -- "$as_dir" ||
333
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
334
	 X"$as_dir" : 'X\(//\)[^/]' \| \
335
	 X"$as_dir" : 'X\(//\)$' \| \
336
	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
337
$as_echo X"$as_dir" |
338
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
339
	    s//\1/
340
	    q
341
	  }
342
	  /^X\(\/\/\)[^/].*/{
343
	    s//\1/
344
	    q
345
	  }
346
	  /^X\(\/\/\)$/{
347
	    s//\1/
348
	    q
349
	  }
350
	  /^X\(\/\).*/{
351
	    s//\1/
352
	    q
353
	  }
354
	  s/.*/./; q'`
355
      test -d "$as_dir" && break
356
    done
357
    test -z "$as_dirs" || eval "mkdir $as_dirs"
358
  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
359
360
361
} @%:@ as_fn_mkdir_p
362
363
@%:@ as_fn_executable_p FILE
364
@%:@ -----------------------
365
@%:@ Test if FILE is an executable regular file.
366
as_fn_executable_p ()
367
{
368
  test -f "$1" && test -x "$1"
369
} @%:@ as_fn_executable_p
370
@%:@ as_fn_append VAR VALUE
371
@%:@ ----------------------
372
@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take
373
@%:@ advantage of any shell optimizations that allow amortized linear growth over
374
@%:@ repeated appends, instead of the typical quadratic growth present in naive
375
@%:@ implementations.
376
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
377
  eval 'as_fn_append ()
378
  {
379
    eval $1+=\$2
380
  }'
381
else
382
  as_fn_append ()
383
  {
384
    eval $1=\$$1\$2
385
  }
386
fi # as_fn_append
387
388
@%:@ as_fn_arith ARG...
389
@%:@ ------------------
390
@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the
391
@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments
392
@%:@ must be portable across @S|@(()) and expr.
393
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
394
  eval 'as_fn_arith ()
395
  {
396
    as_val=$(( $* ))
397
  }'
398
else
399
  as_fn_arith ()
400
  {
401
    as_val=`expr "$@" || test $? -eq 1`
402
  }
403
fi # as_fn_arith
404
405
406
@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD]
407
@%:@ ----------------------------------------
408
@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are
409
@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the
410
@%:@ script with STATUS, using 1 if that was 0.
411
as_fn_error ()
412
{
413
  as_status=$1; test $as_status -eq 0 && as_status=1
414
  if test "$4"; then
415
    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
416
    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
417
  fi
418
  $as_echo "$as_me: error: $2" >&2
419
  as_fn_exit $as_status
420
} @%:@ as_fn_error
421
422
if expr a : '\(a\)' >/dev/null 2>&1 &&
423
   test "X`expr 00001 : '.*\(...\)'`" = X001; then
424
  as_expr=expr
425
else
426
  as_expr=false
427
fi
428
429
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
430
  as_basename=basename
431
else
432
  as_basename=false
433
fi
434
435
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
436
  as_dirname=dirname
437
else
438
  as_dirname=false
439
fi
440
441
as_me=`$as_basename -- "$0" ||
442
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
443
	 X"$0" : 'X\(//\)$' \| \
444
	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
445
$as_echo X/"$0" |
446
    sed '/^.*\/\([^/][^/]*\)\/*$/{
447
	    s//\1/
448
	    q
449
	  }
450
	  /^X\/\(\/\/\)$/{
451
	    s//\1/
452
	    q
453
	  }
454
	  /^X\/\(\/\).*/{
455
	    s//\1/
456
	    q
457
	  }
458
	  s/.*/./; q'`
459
460
# Avoid depending upon Character Ranges.
461
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
462
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
463
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
464
as_cr_digits='0123456789'
465
as_cr_alnum=$as_cr_Letters$as_cr_digits
466
467
468
  as_lineno_1=$LINENO as_lineno_1a=$LINENO
469
  as_lineno_2=$LINENO as_lineno_2a=$LINENO
470
  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
471
  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
472
  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
473
  sed -n '
474
    p
475
    /[$]LINENO/=
476
  ' <$as_myself |
477
    sed '
478
      s/[$]LINENO.*/&-/
479
      t lineno
480
      b
481
      :lineno
482
      N
483
      :loop
484
      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
485
      t loop
486
      s/-\n.*//
487
    ' >$as_me.lineno &&
488
  chmod +x "$as_me.lineno" ||
489
    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
490
491
  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
492
  # already done that, so ensure we don't try to do so again and fall
493
  # in an infinite loop.  This has already happened in practice.
494
  _as_can_reexec=no; export _as_can_reexec
495
  # Don't try to exec as it changes $[0], causing all sort of problems
496
  # (the dirname of $[0] is not the place where we might find the
497
  # original and so on.  Autoconf is especially sensitive to this).
498
  . "./$as_me.lineno"
499
  # Exit status is that of the last command.
500
  exit
501
}
502
503
ECHO_C= ECHO_N= ECHO_T=
504
case `echo -n x` in @%:@(((((
505
-n*)
506
  case `echo 'xy\c'` in
507
  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
508
  xy)  ECHO_C='\c';;
509
  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
510
       ECHO_T='	';;
511
  esac;;
512
*)
513
  ECHO_N='-n';;
514
esac
515
516
rm -f conf$$ conf$$.exe conf$$.file
517
if test -d conf$$.dir; then
518
  rm -f conf$$.dir/conf$$.file
519
else
520
  rm -f conf$$.dir
521
  mkdir conf$$.dir 2>/dev/null
522
fi
523
if (echo >conf$$.file) 2>/dev/null; then
524
  if ln -s conf$$.file conf$$ 2>/dev/null; then
525
    as_ln_s='ln -s'
526
    # ... but there are two gotchas:
527
    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
528
    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
529
    # In both cases, we have to default to `cp -pR'.
530
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
531
      as_ln_s='cp -pR'
532
  elif ln conf$$.file conf$$ 2>/dev/null; then
533
    as_ln_s=ln
534
  else
535
    as_ln_s='cp -pR'
536
  fi
537
else
538
  as_ln_s='cp -pR'
539
fi
540
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
541
rmdir conf$$.dir 2>/dev/null
542
543
if mkdir -p . 2>/dev/null; then
544
  as_mkdir_p='mkdir -p "$as_dir"'
545
else
546
  test -d ./-p && rmdir ./-p
547
  as_mkdir_p=false
548
fi
549
550
as_test_x='test -x'
551
as_executable_p=as_fn_executable_p
552
553
# Sed expression to map a string onto a valid CPP name.
554
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
555
556
# Sed expression to map a string onto a valid variable name.
557
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
558
559
560
test -n "$DJDIR" || exec 7<&0 </dev/null
561
exec 6>&1
562
563
# Name of the host.
564
# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
565
# so uname gets run too.
566
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
567
568
#
569
# Initializations.
570
#
571
ac_default_prefix=/usr/local
572
ac_clean_files=
573
ac_config_libobj_dir=.
574
LIB@&t@OBJS=
575
cross_compiling=no
576
subdirs=
577
MFLAGS=
578
MAKEFLAGS=
579
580
# Identity of this package.
581
PACKAGE_NAME='libbgpdump'
582
PACKAGE_TARNAME='libbgpdump'
583
PACKAGE_VERSION='1.4.99.15'
584
PACKAGE_STRING='libbgpdump 1.4.99.15'
585
PACKAGE_BUGREPORT='ris@ripe.net'
586
PACKAGE_URL=''
587
588
ac_unique_file="bgpdump_lib.c"
589
# Factoring default headers for most tests.
590
ac_includes_default="\
591
#include <stdio.h>
592
#ifdef HAVE_SYS_TYPES_H
593
# include <sys/types.h>
594
#endif
595
#ifdef HAVE_SYS_STAT_H
596
# include <sys/stat.h>
597
#endif
598
#ifdef STDC_HEADERS
599
# include <stdlib.h>
600
# include <stddef.h>
601
#else
602
# ifdef HAVE_STDLIB_H
603
#  include <stdlib.h>
604
# endif
605
#endif
606
#ifdef HAVE_STRING_H
607
# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
608
#  include <memory.h>
609
# endif
610
# include <string.h>
611
#endif
612
#ifdef HAVE_STRINGS_H
613
# include <strings.h>
614
#endif
615
#ifdef HAVE_INTTYPES_H
616
# include <inttypes.h>
617
#endif
618
#ifdef HAVE_STDINT_H
619
# include <stdint.h>
620
#endif
621
#ifdef HAVE_UNISTD_H
622
# include <unistd.h>
623
#endif"
624
625
ac_subst_vars='LTLIBOBJS
626
LIB@&t@OBJS
627
EGREP
628
GREP
629
CPP
630
RANLIB
631
OBJEXT
632
EXEEXT
633
ac_ct_CC
634
CPPFLAGS
635
LDFLAGS
636
CFLAGS
637
CC
638
target_alias
639
host_alias
640
build_alias
641
LIBS
642
ECHO_T
643
ECHO_N
644
ECHO_C
645
DEFS
646
mandir
647
localedir
648
libdir
649
psdir
650
pdfdir
651
dvidir
652
htmldir
653
infodir
654
docdir
655
oldincludedir
656
includedir
657
localstatedir
658
sharedstatedir
659
sysconfdir
660
datadir
661
datarootdir
662
libexecdir
663
sbindir
664
bindir
665
program_transform_name
666
prefix
667
exec_prefix
668
PACKAGE_URL
669
PACKAGE_BUGREPORT
670
PACKAGE_STRING
671
PACKAGE_VERSION
672
PACKAGE_TARNAME
673
PACKAGE_NAME
674
PATH_SEPARATOR
675
SHELL'
676
ac_subst_files=''
677
ac_user_opts='
678
enable_option_checking
679
'
680
      ac_precious_vars='build_alias
681
host_alias
682
target_alias
683
CC
684
CFLAGS
685
LDFLAGS
686
LIBS
687
CPPFLAGS
688
CPP'
689
690
691
# Initialize some variables set by options.
692
ac_init_help=
693
ac_init_version=false
694
ac_unrecognized_opts=
695
ac_unrecognized_sep=
696
# The variables have the same names as the options, with
697
# dashes changed to underlines.
698
cache_file=/dev/null
699
exec_prefix=NONE
700
no_create=
701
no_recursion=
702
prefix=NONE
703
program_prefix=NONE
704
program_suffix=NONE
705
program_transform_name=s,x,x,
706
silent=
707
site=
708
srcdir=
709
verbose=
710
x_includes=NONE
711
x_libraries=NONE
712
713
# Installation directory options.
714
# These are left unexpanded so users can "make install exec_prefix=/foo"
715
# and all the variables that are supposed to be based on exec_prefix
716
# by default will actually change.
717
# Use braces instead of parens because sh, perl, etc. also accept them.
718
# (The list follows the same order as the GNU Coding Standards.)
719
bindir='${exec_prefix}/bin'
720
sbindir='${exec_prefix}/sbin'
721
libexecdir='${exec_prefix}/libexec'
722
datarootdir='${prefix}/share'
723
datadir='${datarootdir}'
724
sysconfdir='${prefix}/etc'
725
sharedstatedir='${prefix}/com'
726
localstatedir='${prefix}/var'
727
includedir='${prefix}/include'
728
oldincludedir='/usr/include'
729
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
730
infodir='${datarootdir}/info'
731
htmldir='${docdir}'
732
dvidir='${docdir}'
733
pdfdir='${docdir}'
734
psdir='${docdir}'
735
libdir='${exec_prefix}/lib'
736
localedir='${datarootdir}/locale'
737
mandir='${datarootdir}/man'
738
739
ac_prev=
740
ac_dashdash=
741
for ac_option
742
do
743
  # If the previous option needs an argument, assign it.
744
  if test -n "$ac_prev"; then
745
    eval $ac_prev=\$ac_option
746
    ac_prev=
747
    continue
748
  fi
749
750
  case $ac_option in
751
  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
752
  *=)   ac_optarg= ;;
753
  *)    ac_optarg=yes ;;
754
  esac
755
756
  # Accept the important Cygnus configure options, so we can diagnose typos.
757
758
  case $ac_dashdash$ac_option in
759
  --)
760
    ac_dashdash=yes ;;
761
762
  -bindir | --bindir | --bindi | --bind | --bin | --bi)
763
    ac_prev=bindir ;;
764
  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
765
    bindir=$ac_optarg ;;
766
767
  -build | --build | --buil | --bui | --bu)
768
    ac_prev=build_alias ;;
769
  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
770
    build_alias=$ac_optarg ;;
771
772
  -cache-file | --cache-file | --cache-fil | --cache-fi \
773
  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
774
    ac_prev=cache_file ;;
775
  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
776
  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
777
    cache_file=$ac_optarg ;;
778
779
  --config-cache | -C)
780
    cache_file=config.cache ;;
781
782
  -datadir | --datadir | --datadi | --datad)
783
    ac_prev=datadir ;;
784
  -datadir=* | --datadir=* | --datadi=* | --datad=*)
785
    datadir=$ac_optarg ;;
786
787
  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
788
  | --dataroo | --dataro | --datar)
789
    ac_prev=datarootdir ;;
790
  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
791
  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
792
    datarootdir=$ac_optarg ;;
793
794
  -disable-* | --disable-*)
795
    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
796
    # Reject names that are not valid shell variable names.
797
    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
798
      as_fn_error $? "invalid feature name: $ac_useropt"
799
    ac_useropt_orig=$ac_useropt
800
    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
801
    case $ac_user_opts in
802
      *"
803
"enable_$ac_useropt"
804
"*) ;;
805
      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
806
	 ac_unrecognized_sep=', ';;
807
    esac
808
    eval enable_$ac_useropt=no ;;
809
810
  -docdir | --docdir | --docdi | --doc | --do)
811
    ac_prev=docdir ;;
812
  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
813
    docdir=$ac_optarg ;;
814
815
  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
816
    ac_prev=dvidir ;;
817
  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
818
    dvidir=$ac_optarg ;;
819
820
  -enable-* | --enable-*)
821
    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
822
    # Reject names that are not valid shell variable names.
823
    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
824
      as_fn_error $? "invalid feature name: $ac_useropt"
825
    ac_useropt_orig=$ac_useropt
826
    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
827
    case $ac_user_opts in
828
      *"
829
"enable_$ac_useropt"
830
"*) ;;
831
      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
832
	 ac_unrecognized_sep=', ';;
833
    esac
834
    eval enable_$ac_useropt=\$ac_optarg ;;
835
836
  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
837
  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
838
  | --exec | --exe | --ex)
839
    ac_prev=exec_prefix ;;
840
  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
841
  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
842
  | --exec=* | --exe=* | --ex=*)
843
    exec_prefix=$ac_optarg ;;
844
845
  -gas | --gas | --ga | --g)
846
    # Obsolete; use --with-gas.
847
    with_gas=yes ;;
848
849
  -help | --help | --hel | --he | -h)
850
    ac_init_help=long ;;
851
  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
852
    ac_init_help=recursive ;;
853
  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
854
    ac_init_help=short ;;
855
856
  -host | --host | --hos | --ho)
857
    ac_prev=host_alias ;;
858
  -host=* | --host=* | --hos=* | --ho=*)
859
    host_alias=$ac_optarg ;;
860
861
  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
862
    ac_prev=htmldir ;;
863
  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
864
  | --ht=*)
865
    htmldir=$ac_optarg ;;
866
867
  -includedir | --includedir | --includedi | --included | --include \
868
  | --includ | --inclu | --incl | --inc)
869
    ac_prev=includedir ;;
870
  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
871
  | --includ=* | --inclu=* | --incl=* | --inc=*)
872
    includedir=$ac_optarg ;;
873
874
  -infodir | --infodir | --infodi | --infod | --info | --inf)
875
    ac_prev=infodir ;;
876
  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
877
    infodir=$ac_optarg ;;
878
879
  -libdir | --libdir | --libdi | --libd)
880
    ac_prev=libdir ;;
881
  -libdir=* | --libdir=* | --libdi=* | --libd=*)
882
    libdir=$ac_optarg ;;
883
884
  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
885
  | --libexe | --libex | --libe)
886
    ac_prev=libexecdir ;;
887
  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
888
  | --libexe=* | --libex=* | --libe=*)
889
    libexecdir=$ac_optarg ;;
890
891
  -localedir | --localedir | --localedi | --localed | --locale)
892
    ac_prev=localedir ;;
893
  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
894
    localedir=$ac_optarg ;;
895
896
  -localstatedir | --localstatedir | --localstatedi | --localstated \
897
  | --localstate | --localstat | --localsta | --localst | --locals)
898
    ac_prev=localstatedir ;;
899
  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
900
  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
901
    localstatedir=$ac_optarg ;;
902
903
  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
904
    ac_prev=mandir ;;
905
  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
906
    mandir=$ac_optarg ;;
907
908
  -nfp | --nfp | --nf)
909
    # Obsolete; use --without-fp.
910
    with_fp=no ;;
911
912
  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
913
  | --no-cr | --no-c | -n)
914
    no_create=yes ;;
915
916
  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
917
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
918
    no_recursion=yes ;;
919
920
  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
921
  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
922
  | --oldin | --oldi | --old | --ol | --o)
923
    ac_prev=oldincludedir ;;
924
  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
925
  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
926
  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
927
    oldincludedir=$ac_optarg ;;
928
929
  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
930
    ac_prev=prefix ;;
931
  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
932
    prefix=$ac_optarg ;;
933
934
  -program-prefix | --program-prefix | --program-prefi | --program-pref \
935
  | --program-pre | --program-pr | --program-p)
936
    ac_prev=program_prefix ;;
937
  -program-prefix=* | --program-prefix=* | --program-prefi=* \
938
  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
939
    program_prefix=$ac_optarg ;;
940
941
  -program-suffix | --program-suffix | --program-suffi | --program-suff \
942
  | --program-suf | --program-su | --program-s)
943
    ac_prev=program_suffix ;;
944
  -program-suffix=* | --program-suffix=* | --program-suffi=* \
945
  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
946
    program_suffix=$ac_optarg ;;
947
948
  -program-transform-name | --program-transform-name \
949
  | --program-transform-nam | --program-transform-na \
950
  | --program-transform-n | --program-transform- \
951
  | --program-transform | --program-transfor \
952
  | --program-transfo | --program-transf \
953
  | --program-trans | --program-tran \
954
  | --progr-tra | --program-tr | --program-t)
955
    ac_prev=program_transform_name ;;
956
  -program-transform-name=* | --program-transform-name=* \
957
  | --program-transform-nam=* | --program-transform-na=* \
958
  | --program-transform-n=* | --program-transform-=* \
959
  | --program-transform=* | --program-transfor=* \
960
  | --program-transfo=* | --program-transf=* \
961
  | --program-trans=* | --program-tran=* \
962
  | --progr-tra=* | --program-tr=* | --program-t=*)
963
    program_transform_name=$ac_optarg ;;
964
965
  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
966
    ac_prev=pdfdir ;;
967
  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
968
    pdfdir=$ac_optarg ;;
969
970
  -psdir | --psdir | --psdi | --psd | --ps)
971
    ac_prev=psdir ;;
972
  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
973
    psdir=$ac_optarg ;;
974
975
  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
976
  | -silent | --silent | --silen | --sile | --sil)
977
    silent=yes ;;
978
979
  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
980
    ac_prev=sbindir ;;
981
  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
982
  | --sbi=* | --sb=*)
983
    sbindir=$ac_optarg ;;
984
985
  -sharedstatedir | --sharedstatedir | --sharedstatedi \
986
  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
987
  | --sharedst | --shareds | --shared | --share | --shar \
988
  | --sha | --sh)
989
    ac_prev=sharedstatedir ;;
990
  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
991
  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
992
  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
993
  | --sha=* | --sh=*)
994
    sharedstatedir=$ac_optarg ;;
995
996
  -site | --site | --sit)
997
    ac_prev=site ;;
998
  -site=* | --site=* | --sit=*)
999
    site=$ac_optarg ;;
1000
1001
  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1002
    ac_prev=srcdir ;;
1003
  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1004
    srcdir=$ac_optarg ;;
1005
1006
  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1007
  | --syscon | --sysco | --sysc | --sys | --sy)
1008
    ac_prev=sysconfdir ;;
1009
  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1010
  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1011
    sysconfdir=$ac_optarg ;;
1012
1013
  -target | --target | --targe | --targ | --tar | --ta | --t)
1014
    ac_prev=target_alias ;;
1015
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1016
    target_alias=$ac_optarg ;;
1017
1018
  -v | -verbose | --verbose | --verbos | --verbo | --verb)
1019
    verbose=yes ;;
1020
1021
  -version | --version | --versio | --versi | --vers | -V)
1022
    ac_init_version=: ;;
1023
1024
  -with-* | --with-*)
1025
    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1026
    # Reject names that are not valid shell variable names.
1027
    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1028
      as_fn_error $? "invalid package name: $ac_useropt"
1029
    ac_useropt_orig=$ac_useropt
1030
    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1031
    case $ac_user_opts in
1032
      *"
1033
"with_$ac_useropt"
1034
"*) ;;
1035
      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
1036
	 ac_unrecognized_sep=', ';;
1037
    esac
1038
    eval with_$ac_useropt=\$ac_optarg ;;
1039
1040
  -without-* | --without-*)
1041
    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1042
    # Reject names that are not valid shell variable names.
1043
    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1044
      as_fn_error $? "invalid package name: $ac_useropt"
1045
    ac_useropt_orig=$ac_useropt
1046
    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1047
    case $ac_user_opts in
1048
      *"
1049
"with_$ac_useropt"
1050
"*) ;;
1051
      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
1052
	 ac_unrecognized_sep=', ';;
1053
    esac
1054
    eval with_$ac_useropt=no ;;
1055
1056
  --x)
1057
    # Obsolete; use --with-x.
1058
    with_x=yes ;;
1059
1060
  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1061
  | --x-incl | --x-inc | --x-in | --x-i)
1062
    ac_prev=x_includes ;;
1063
  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1064
  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1065
    x_includes=$ac_optarg ;;
1066
1067
  -x-libraries | --x-libraries | --x-librarie | --x-librari \
1068
  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1069
    ac_prev=x_libraries ;;
1070
  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1071
  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1072
    x_libraries=$ac_optarg ;;
1073
1074
  -*) as_fn_error $? "unrecognized option: \`$ac_option'
1075
Try \`$0 --help' for more information"
1076
    ;;
1077
1078
  *=*)
1079
    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
1080
    # Reject names that are not valid shell variable names.
1081
    case $ac_envvar in #(
1082
      '' | [0-9]* | *[!_$as_cr_alnum]* )
1083
      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
1084
    esac
1085
    eval $ac_envvar=\$ac_optarg
1086
    export $ac_envvar ;;
1087
1088
  *)
1089
    # FIXME: should be removed in autoconf 3.0.
1090
    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
1091
    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
1092
      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1093
    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
1094
    ;;
1095
1096
  esac
1097
done
1098
1099
if test -n "$ac_prev"; then
1100
  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1101
  as_fn_error $? "missing argument to $ac_option"
1102
fi
1103
1104
if test -n "$ac_unrecognized_opts"; then
1105
  case $enable_option_checking in
1106
    no) ;;
1107
    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
1108
    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1109
  esac
1110
fi
1111
1112
# Check all directory arguments for consistency.
1113
for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
1114
		datadir sysconfdir sharedstatedir localstatedir includedir \
1115
		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1116
		libdir localedir mandir
1117
do
1118
  eval ac_val=\$$ac_var
1119
  # Remove trailing slashes.
1120
  case $ac_val in
1121
    */ )
1122
      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
1123
      eval $ac_var=\$ac_val;;
1124
  esac
1125
  # Be sure to have absolute directory names.
1126
  case $ac_val in
1127
    [\\/$]* | ?:[\\/]* )  continue;;
1128
    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1129
  esac
1130
  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
1131
done
1132
1133
# There might be people who depend on the old broken behavior: `$host'
1134
# used to hold the argument of --host etc.
1135
# FIXME: To remove some day.
1136
build=$build_alias
1137
host=$host_alias
1138
target=$target_alias
1139
1140
# FIXME: To remove some day.
1141
if test "x$host_alias" != x; then
1142
  if test "x$build_alias" = x; then
1143
    cross_compiling=maybe
1144
  elif test "x$build_alias" != "x$host_alias"; then
1145
    cross_compiling=yes
1146
  fi
1147
fi
1148
1149
ac_tool_prefix=
1150
test -n "$host_alias" && ac_tool_prefix=$host_alias-
1151
1152
test "$silent" = yes && exec 6>/dev/null
1153
1154
1155
ac_pwd=`pwd` && test -n "$ac_pwd" &&
1156
ac_ls_di=`ls -di .` &&
1157
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1158
  as_fn_error $? "working directory cannot be determined"
1159
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1160
  as_fn_error $? "pwd does not report name of working directory"
1161
1162
1163
# Find the source files, if location was not specified.
1164
if test -z "$srcdir"; then
1165
  ac_srcdir_defaulted=yes
1166
  # Try the directory containing this script, then the parent directory.
1167
  ac_confdir=`$as_dirname -- "$as_myself" ||
1168
$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1169
	 X"$as_myself" : 'X\(//\)[^/]' \| \
1170
	 X"$as_myself" : 'X\(//\)$' \| \
1171
	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
1172
$as_echo X"$as_myself" |
1173
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1174
	    s//\1/
1175
	    q
1176
	  }
1177
	  /^X\(\/\/\)[^/].*/{
1178
	    s//\1/
1179
	    q
1180
	  }
1181
	  /^X\(\/\/\)$/{
1182
	    s//\1/
1183
	    q
1184
	  }
1185
	  /^X\(\/\).*/{
1186
	    s//\1/
1187
	    q
1188
	  }
1189
	  s/.*/./; q'`
1190
  srcdir=$ac_confdir
1191
  if test ! -r "$srcdir/$ac_unique_file"; then
1192
    srcdir=..
1193
  fi
1194
else
1195
  ac_srcdir_defaulted=no
1196
fi
1197
if test ! -r "$srcdir/$ac_unique_file"; then
1198
  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1199
  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
1200
fi
1201
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1202
ac_abs_confdir=`(
1203
	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
1204
	pwd)`
1205
# When building in place, set srcdir=.
1206
if test "$ac_abs_confdir" = "$ac_pwd"; then
1207
  srcdir=.
1208
fi
1209
# Remove unnecessary trailing slashes from srcdir.
1210
# Double slashes in file names in object file debugging info
1211
# mess up M-x gdb in Emacs.
1212
case $srcdir in
1213
*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1214
esac
1215
for ac_var in $ac_precious_vars; do
1216
  eval ac_env_${ac_var}_set=\${${ac_var}+set}
1217
  eval ac_env_${ac_var}_value=\$${ac_var}
1218
  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1219
  eval ac_cv_env_${ac_var}_value=\$${ac_var}
1220
done
1221
1222
#
1223
# Report the --help message.
1224
#
1225
if test "$ac_init_help" = "long"; then
1226
  # Omit some internal or obsolete options to make the list less imposing.
1227
  # This message is too long to be a string in the A/UX 3.1 sh.
1228
  cat <<_ACEOF
1229
\`configure' configures libbgpdump 1.4.99.15 to adapt to many kinds of systems.
1230
1231
Usage: $0 [OPTION]... [VAR=VALUE]...
1232
1233
To assign environment variables (e.g., CC, CFLAGS...), specify them as
1234
VAR=VALUE.  See below for descriptions of some of the useful variables.
1235
1236
Defaults for the options are specified in brackets.
1237
1238
Configuration:
1239
  -h, --help              display this help and exit
1240
      --help=short        display options specific to this package
1241
      --help=recursive    display the short help of all the included packages
1242
  -V, --version           display version information and exit
1243
  -q, --quiet, --silent   do not print \`checking ...' messages
1244
      --cache-file=FILE   cache test results in FILE [disabled]
1245
  -C, --config-cache      alias for \`--cache-file=config.cache'
1246
  -n, --no-create         do not create output files
1247
      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
1248
1249
Installation directories:
1250
  --prefix=PREFIX         install architecture-independent files in PREFIX
1251
                          @<:@@S|@ac_default_prefix@:>@
1252
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
1253
                          @<:@PREFIX@:>@
1254
1255
By default, \`make install' will install all the files in
1256
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
1257
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1258
for instance \`--prefix=\$HOME'.
1259
1260
For better control, use the options below.
1261
1262
Fine tuning of the installation directories:
1263
  --bindir=DIR            user executables [EPREFIX/bin]
1264
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
1265
  --libexecdir=DIR        program executables [EPREFIX/libexec]
1266
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
1267
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
1268
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
1269
  --libdir=DIR            object code libraries [EPREFIX/lib]
1270
  --includedir=DIR        C header files [PREFIX/include]
1271
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
1272
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
1273
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
1274
  --infodir=DIR           info documentation [DATAROOTDIR/info]
1275
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
1276
  --mandir=DIR            man documentation [DATAROOTDIR/man]
1277
  --docdir=DIR            documentation root @<:@DATAROOTDIR/doc/libbgpdump@:>@
1278
  --htmldir=DIR           html documentation [DOCDIR]
1279
  --dvidir=DIR            dvi documentation [DOCDIR]
1280
  --pdfdir=DIR            pdf documentation [DOCDIR]
1281
  --psdir=DIR             ps documentation [DOCDIR]
1282
_ACEOF
1283
1284
  cat <<\_ACEOF
1285
_ACEOF
1286
fi
1287
1288
if test -n "$ac_init_help"; then
1289
  case $ac_init_help in
1290
     short | recursive ) echo "Configuration of libbgpdump 1.4.99.15:";;
1291
   esac
1292
  cat <<\_ACEOF
1293
1294
Some influential environment variables:
1295
  CC          C compiler command
1296
  CFLAGS      C compiler flags
1297
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
1298
              nonstandard directory <lib dir>
1299
  LIBS        libraries to pass to the linker, e.g. -l<library>
1300
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
1301
              you have headers in a nonstandard directory <include dir>
1302
  CPP         C preprocessor
1303
1304
Use these variables to override the choices made by `configure' or to help
1305
it to find libraries and programs with nonstandard names/locations.
1306
1307
Report bugs to <ris@ripe.net>.
1308
_ACEOF
1309
ac_status=$?
1310
fi
1311
1312
if test "$ac_init_help" = "recursive"; then
1313
  # If there are subdirs, report their specific --help.
1314
  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1315
    test -d "$ac_dir" ||
1316
      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1317
      continue
1318
    ac_builddir=.
1319
1320
case "$ac_dir" in
1321
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1322
*)
1323
  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
1324
  # A ".." for each directory in $ac_dir_suffix.
1325
  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
1326
  case $ac_top_builddir_sub in
1327
  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1328
  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1329
  esac ;;
1330
esac
1331
ac_abs_top_builddir=$ac_pwd
1332
ac_abs_builddir=$ac_pwd$ac_dir_suffix
1333
# for backward compatibility:
1334
ac_top_builddir=$ac_top_build_prefix
1335
1336
case $srcdir in
1337
  .)  # We are building in place.
1338
    ac_srcdir=.
1339
    ac_top_srcdir=$ac_top_builddir_sub
1340
    ac_abs_top_srcdir=$ac_pwd ;;
1341
  [\\/]* | ?:[\\/]* )  # Absolute name.
1342
    ac_srcdir=$srcdir$ac_dir_suffix;
1343
    ac_top_srcdir=$srcdir
1344
    ac_abs_top_srcdir=$srcdir ;;
1345
  *) # Relative name.
1346
    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1347
    ac_top_srcdir=$ac_top_build_prefix$srcdir
1348
    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
1349
esac
1350
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1351
1352
    cd "$ac_dir" || { ac_status=$?; continue; }
1353
    # Check for guested configure.
1354
    if test -f "$ac_srcdir/configure.gnu"; then
1355
      echo &&
1356
      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1357
    elif test -f "$ac_srcdir/configure"; then
1358
      echo &&
1359
      $SHELL "$ac_srcdir/configure" --help=recursive
1360
    else
1361
      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1362
    fi || ac_status=$?
1363
    cd "$ac_pwd" || { ac_status=$?; break; }
1364
  done
1365
fi
1366
1367
test -n "$ac_init_help" && exit $ac_status
1368
if $ac_init_version; then
1369
  cat <<\_ACEOF
1370
libbgpdump configure 1.4.99.15
1371
generated by GNU Autoconf 2.69
1372
1373
Copyright (C) 2012 Free Software Foundation, Inc.
1374
This configure script is free software; the Free Software Foundation
1375
gives unlimited permission to copy, distribute and modify it.
1376
_ACEOF
1377
  exit
1378
fi
1379
1380
## ------------------------ ##
1381
## Autoconf initialization. ##
1382
## ------------------------ ##
1383
1384
@%:@ ac_fn_c_try_compile LINENO
1385
@%:@ --------------------------
1386
@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded.
1387
ac_fn_c_try_compile ()
1388
{
1389
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1390
  rm -f conftest.$ac_objext
1391
  if { { ac_try="$ac_compile"
1392
case "(($ac_try" in
1393
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1394
  *) ac_try_echo=$ac_try;;
1395
esac
1396
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1397
$as_echo "$ac_try_echo"; } >&5
1398
  (eval "$ac_compile") 2>conftest.err
1399
  ac_status=$?
1400
  if test -s conftest.err; then
1401
    grep -v '^ *+' conftest.err >conftest.er1
1402
    cat conftest.er1 >&5
1403
    mv -f conftest.er1 conftest.err
1404
  fi
1405
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1406
  test $ac_status = 0; } && {
1407
	 test -z "$ac_c_werror_flag" ||
1408
	 test ! -s conftest.err
1409
       } && test -s conftest.$ac_objext; then :
1410
  ac_retval=0
1411
else
1412
  $as_echo "$as_me: failed program was:" >&5
1413
sed 's/^/| /' conftest.$ac_ext >&5
1414
1415
	ac_retval=1
1416
fi
1417
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1418
  as_fn_set_status $ac_retval
1419
1420
} @%:@ ac_fn_c_try_compile
1421
1422
@%:@ ac_fn_c_try_cpp LINENO
1423
@%:@ ----------------------
1424
@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded.
1425
ac_fn_c_try_cpp ()
1426
{
1427
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1428
  if { { ac_try="$ac_cpp conftest.$ac_ext"
1429
case "(($ac_try" in
1430
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1431
  *) ac_try_echo=$ac_try;;
1432
esac
1433
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1434
$as_echo "$ac_try_echo"; } >&5
1435
  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
1436
  ac_status=$?
1437
  if test -s conftest.err; then
1438
    grep -v '^ *+' conftest.err >conftest.er1
1439
    cat conftest.er1 >&5
1440
    mv -f conftest.er1 conftest.err
1441
  fi
1442
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1443
  test $ac_status = 0; } > conftest.i && {
1444
	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
1445
	 test ! -s conftest.err
1446
       }; then :
1447
  ac_retval=0
1448
else
1449
  $as_echo "$as_me: failed program was:" >&5
1450
sed 's/^/| /' conftest.$ac_ext >&5
1451
1452
    ac_retval=1
1453
fi
1454
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1455
  as_fn_set_status $ac_retval
1456
1457
} @%:@ ac_fn_c_try_cpp
1458
1459
@%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
1460
@%:@ -------------------------------------------------------
1461
@%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using
1462
@%:@ the include files in INCLUDES and setting the cache variable VAR
1463
@%:@ accordingly.
1464
ac_fn_c_check_header_mongrel ()
1465
{
1466
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1467
  if eval \${$3+:} false; then :
1468
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1469
$as_echo_n "checking for $2... " >&6; }
1470
if eval \${$3+:} false; then :
1471
  $as_echo_n "(cached) " >&6
1472
fi
1473
eval ac_res=\$$3
1474
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1475
$as_echo "$ac_res" >&6; }
1476
else
1477
  # Is the header compilable?
1478
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
1479
$as_echo_n "checking $2 usability... " >&6; }
1480
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1481
/* end confdefs.h.  */
1482
$4
1483
@%:@include <$2>
1484
_ACEOF
1485
if ac_fn_c_try_compile "$LINENO"; then :
1486
  ac_header_compiler=yes
1487
else
1488
  ac_header_compiler=no
1489
fi
1490
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1491
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
1492
$as_echo "$ac_header_compiler" >&6; }
1493
1494
# Is the header present?
1495
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
1496
$as_echo_n "checking $2 presence... " >&6; }
1497
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1498
/* end confdefs.h.  */
1499
@%:@include <$2>
1500
_ACEOF
1501
if ac_fn_c_try_cpp "$LINENO"; then :
1502
  ac_header_preproc=yes
1503
else
1504
  ac_header_preproc=no
1505
fi
1506
rm -f conftest.err conftest.i conftest.$ac_ext
1507
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
1508
$as_echo "$ac_header_preproc" >&6; }
1509
1510
# So?  What about this header?
1511
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
1512
  yes:no: )
1513
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
1514
$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
1515
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1516
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1517
    ;;
1518
  no:yes:* )
1519
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
1520
$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
1521
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
1522
$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
1523
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
1524
$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
1525
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
1526
$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
1527
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1528
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1529
( $as_echo "## --------------------------- ##
1530
## Report this to ris@ripe.net ##
1531
## --------------------------- ##"
1532
     ) | sed "s/^/$as_me: WARNING:     /" >&2
1533
    ;;
1534
esac
1535
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1536
$as_echo_n "checking for $2... " >&6; }
1537
if eval \${$3+:} false; then :
1538
  $as_echo_n "(cached) " >&6
1539
else
1540
  eval "$3=\$ac_header_compiler"
1541
fi
1542
eval ac_res=\$$3
1543
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1544
$as_echo "$ac_res" >&6; }
1545
fi
1546
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1547
1548
} @%:@ ac_fn_c_check_header_mongrel
1549
1550
@%:@ ac_fn_c_try_run LINENO
1551
@%:@ ----------------------
1552
@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes
1553
@%:@ that executables *can* be run.
1554
ac_fn_c_try_run ()
1555
{
1556
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1557
  if { { ac_try="$ac_link"
1558
case "(($ac_try" in
1559
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1560
  *) ac_try_echo=$ac_try;;
1561
esac
1562
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1563
$as_echo "$ac_try_echo"; } >&5
1564
  (eval "$ac_link") 2>&5
1565
  ac_status=$?
1566
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1567
  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
1568
  { { case "(($ac_try" in
1569
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1570
  *) ac_try_echo=$ac_try;;
1571
esac
1572
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1573
$as_echo "$ac_try_echo"; } >&5
1574
  (eval "$ac_try") 2>&5
1575
  ac_status=$?
1576
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1577
  test $ac_status = 0; }; }; then :
1578
  ac_retval=0
1579
else
1580
  $as_echo "$as_me: program exited with status $ac_status" >&5
1581
       $as_echo "$as_me: failed program was:" >&5
1582
sed 's/^/| /' conftest.$ac_ext >&5
1583
1584
       ac_retval=$ac_status
1585
fi
1586
  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1587
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1588
  as_fn_set_status $ac_retval
1589
1590
} @%:@ ac_fn_c_try_run
1591
1592
@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
1593
@%:@ -------------------------------------------------------
1594
@%:@ Tests whether HEADER exists and can be compiled using the include files in
1595
@%:@ INCLUDES, setting the cache variable VAR accordingly.
1596
ac_fn_c_check_header_compile ()
1597
{
1598
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1599
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1600
$as_echo_n "checking for $2... " >&6; }
1601
if eval \${$3+:} false; then :
1602
  $as_echo_n "(cached) " >&6
1603
else
1604
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1605
/* end confdefs.h.  */
1606
$4
1607
@%:@include <$2>
1608
_ACEOF
1609
if ac_fn_c_try_compile "$LINENO"; then :
1610
  eval "$3=yes"
1611
else
1612
  eval "$3=no"
1613
fi
1614
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1615
fi
1616
eval ac_res=\$$3
1617
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1618
$as_echo "$ac_res" >&6; }
1619
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1620
1621
} @%:@ ac_fn_c_check_header_compile
1622
1623
@%:@ ac_fn_c_check_type LINENO TYPE VAR INCLUDES
1624
@%:@ -------------------------------------------
1625
@%:@ Tests whether TYPE exists after having included INCLUDES, setting cache
1626
@%:@ variable VAR accordingly.
1627
ac_fn_c_check_type ()
1628
{
1629
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1630
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1631
$as_echo_n "checking for $2... " >&6; }
1632
if eval \${$3+:} false; then :
1633
  $as_echo_n "(cached) " >&6
1634
else
1635
  eval "$3=no"
1636
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1637
/* end confdefs.h.  */
1638
$4
1639
int
1640
main ()
1641
{
1642
if (sizeof ($2))
1643
	 return 0;
1644
  ;
1645
  return 0;
1646
}
1647
_ACEOF
1648
if ac_fn_c_try_compile "$LINENO"; then :
1649
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1650
/* end confdefs.h.  */
1651
$4
1652
int
1653
main ()
1654
{
1655
if (sizeof (($2)))
1656
	    return 0;
1657
  ;
1658
  return 0;
1659
}
1660
_ACEOF
1661
if ac_fn_c_try_compile "$LINENO"; then :
1662
  
1663
else
1664
  eval "$3=yes"
1665
fi
1666
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1667
fi
1668
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1669
fi
1670
eval ac_res=\$$3
1671
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1672
$as_echo "$ac_res" >&6; }
1673
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1674
1675
} @%:@ ac_fn_c_check_type
1676
1677
@%:@ ac_fn_c_try_link LINENO
1678
@%:@ -----------------------
1679
@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded.
1680
ac_fn_c_try_link ()
1681
{
1682
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1683
  rm -f conftest.$ac_objext conftest$ac_exeext
1684
  if { { ac_try="$ac_link"
1685
case "(($ac_try" in
1686
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1687
  *) ac_try_echo=$ac_try;;
1688
esac
1689
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1690
$as_echo "$ac_try_echo"; } >&5
1691
  (eval "$ac_link") 2>conftest.err
1692
  ac_status=$?
1693
  if test -s conftest.err; then
1694
    grep -v '^ *+' conftest.err >conftest.er1
1695
    cat conftest.er1 >&5
1696
    mv -f conftest.er1 conftest.err
1697
  fi
1698
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1699
  test $ac_status = 0; } && {
1700
	 test -z "$ac_c_werror_flag" ||
1701
	 test ! -s conftest.err
1702
       } && test -s conftest$ac_exeext && {
1703
	 test "$cross_compiling" = yes ||
1704
	 test -x conftest$ac_exeext
1705
       }; then :
1706
  ac_retval=0
1707
else
1708
  $as_echo "$as_me: failed program was:" >&5
1709
sed 's/^/| /' conftest.$ac_ext >&5
1710
1711
	ac_retval=1
1712
fi
1713
  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1714
  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1715
  # interfere with the next link command; also delete a directory that is
1716
  # left behind by Apple's compiler.  We do this before executing the actions.
1717
  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1718
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1719
  as_fn_set_status $ac_retval
1720
1721
} @%:@ ac_fn_c_try_link
1722
1723
@%:@ ac_fn_c_check_func LINENO FUNC VAR
1724
@%:@ ----------------------------------
1725
@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly
1726
ac_fn_c_check_func ()
1727
{
1728
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1729
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1730
$as_echo_n "checking for $2... " >&6; }
1731
if eval \${$3+:} false; then :
1732
  $as_echo_n "(cached) " >&6
1733
else
1734
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1735
/* end confdefs.h.  */
1736
/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
1737
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
1738
#define $2 innocuous_$2
1739
1740
/* System header to define __stub macros and hopefully few prototypes,
1741
    which can conflict with char $2 (); below.
1742
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
1743
    <limits.h> exists even on freestanding compilers.  */
1744
1745
#ifdef __STDC__
1746
# include <limits.h>
1747
#else
1748
# include <assert.h>
1749
#endif
1750
1751
#undef $2
1752
1753
/* Override any GCC internal prototype to avoid an error.
1754
   Use char because int might match the return type of a GCC
1755
   builtin and then its argument prototype would still apply.  */
1756
#ifdef __cplusplus
1757
extern "C"
1758
#endif
1759
char $2 ();
1760
/* The GNU C library defines this for functions which it implements
1761
    to always fail with ENOSYS.  Some functions are actually named
1762
    something starting with __ and the normal name is an alias.  */
1763
#if defined __stub_$2 || defined __stub___$2
1764
choke me
1765
#endif
1766
1767
int
1768
main ()
1769
{
1770
return $2 ();
1771
  ;
1772
  return 0;
1773
}
1774
_ACEOF
1775
if ac_fn_c_try_link "$LINENO"; then :
1776
  eval "$3=yes"
1777
else
1778
  eval "$3=no"
1779
fi
1780
rm -f core conftest.err conftest.$ac_objext \
1781
    conftest$ac_exeext conftest.$ac_ext
1782
fi
1783
eval ac_res=\$$3
1784
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1785
$as_echo "$ac_res" >&6; }
1786
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1787
1788
} @%:@ ac_fn_c_check_func
1789
cat >config.log <<_ACEOF
1790
This file contains any messages produced by compilers while
1791
running configure, to aid debugging if configure makes a mistake.
1792
1793
It was created by libbgpdump $as_me 1.4.99.15, which was
1794
generated by GNU Autoconf 2.69.  Invocation command line was
1795
1796
  $ $0 $@
1797
1798
_ACEOF
1799
exec 5>>config.log
1800
{
1801
cat <<_ASUNAME
1802
## --------- ##
1803
## Platform. ##
1804
## --------- ##
1805
1806
hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1807
uname -m = `(uname -m) 2>/dev/null || echo unknown`
1808
uname -r = `(uname -r) 2>/dev/null || echo unknown`
1809
uname -s = `(uname -s) 2>/dev/null || echo unknown`
1810
uname -v = `(uname -v) 2>/dev/null || echo unknown`
1811
1812
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1813
/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
1814
1815
/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
1816
/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
1817
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1818
/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
1819
/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
1820
/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
1821
/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
1822
1823
_ASUNAME
1824
1825
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1826
for as_dir in $PATH
1827
do
1828
  IFS=$as_save_IFS
1829
  test -z "$as_dir" && as_dir=.
1830
    $as_echo "PATH: $as_dir"
1831
  done
1832
IFS=$as_save_IFS
1833
1834
} >&5
1835
1836
cat >&5 <<_ACEOF
1837
1838
1839
## ----------- ##
1840
## Core tests. ##
1841
## ----------- ##
1842
1843
_ACEOF
1844
1845
1846
# Keep a trace of the command line.
1847
# Strip out --no-create and --no-recursion so they do not pile up.
1848
# Strip out --silent because we don't want to record it for future runs.
1849
# Also quote any args containing shell meta-characters.
1850
# Make two passes to allow for proper duplicate-argument suppression.
1851
ac_configure_args=
1852
ac_configure_args0=
1853
ac_configure_args1=
1854
ac_must_keep_next=false
1855
for ac_pass in 1 2
1856
do
1857
  for ac_arg
1858
  do
1859
    case $ac_arg in
1860
    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
1861
    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1862
    | -silent | --silent | --silen | --sile | --sil)
1863
      continue ;;
1864
    *\'*)
1865
      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
1866
    esac
1867
    case $ac_pass in
1868
    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
1869
    2)
1870
      as_fn_append ac_configure_args1 " '$ac_arg'"
1871
      if test $ac_must_keep_next = true; then
1872
	ac_must_keep_next=false # Got value, back to normal.
1873
      else
1874
	case $ac_arg in
1875
	  *=* | --config-cache | -C | -disable-* | --disable-* \
1876
	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
1877
	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
1878
	  | -with-* | --with-* | -without-* | --without-* | --x)
1879
	    case "$ac_configure_args0 " in
1880
	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
1881
	    esac
1882
	    ;;
1883
	  -* ) ac_must_keep_next=true ;;
1884
	esac
1885
      fi
1886
      as_fn_append ac_configure_args " '$ac_arg'"
1887
      ;;
1888
    esac
1889
  done
1890
done
1891
{ ac_configure_args0=; unset ac_configure_args0;}
1892
{ ac_configure_args1=; unset ac_configure_args1;}
1893
1894
# When interrupted or exit'd, cleanup temporary files, and complete
1895
# config.log.  We remove comments because anyway the quotes in there
1896
# would cause problems or look ugly.
1897
# WARNING: Use '\'' to represent an apostrophe within the trap.
1898
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
1899
trap 'exit_status=$?
1900
  # Save into config.log some information that might help in debugging.
1901
  {
1902
    echo
1903
1904
    $as_echo "## ---------------- ##
1905
## Cache variables. ##
1906
## ---------------- ##"
1907
    echo
1908
    # The following way of writing the cache mishandles newlines in values,
1909
(
1910
  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
1911
    eval ac_val=\$$ac_var
1912
    case $ac_val in #(
1913
    *${as_nl}*)
1914
      case $ac_var in #(
1915
      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
1916
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
1917
      esac
1918
      case $ac_var in #(
1919
      _ | IFS | as_nl) ;; #(
1920
      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
1921
      *) { eval $ac_var=; unset $ac_var;} ;;
1922
      esac ;;
1923
    esac
1924
  done
1925
  (set) 2>&1 |
1926
    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
1927
    *${as_nl}ac_space=\ *)
1928
      sed -n \
1929
	"s/'\''/'\''\\\\'\'''\''/g;
1930
	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
1931
      ;; #(
1932
    *)
1933
      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
1934
      ;;
1935
    esac |
1936
    sort
1937
)
1938
    echo
1939
1940
    $as_echo "## ----------------- ##
1941
## Output variables. ##
1942
## ----------------- ##"
1943
    echo
1944
    for ac_var in $ac_subst_vars
1945
    do
1946
      eval ac_val=\$$ac_var
1947
      case $ac_val in
1948
      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1949
      esac
1950
      $as_echo "$ac_var='\''$ac_val'\''"
1951
    done | sort
1952
    echo
1953
1954
    if test -n "$ac_subst_files"; then
1955
      $as_echo "## ------------------- ##
1956
## File substitutions. ##
1957
## ------------------- ##"
1958
      echo
1959
      for ac_var in $ac_subst_files
1960
      do
1961
	eval ac_val=\$$ac_var
1962
	case $ac_val in
1963
	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1964
	esac
1965
	$as_echo "$ac_var='\''$ac_val'\''"
1966
      done | sort
1967
      echo
1968
    fi
1969
1970
    if test -s confdefs.h; then
1971
      $as_echo "## ----------- ##
1972
## confdefs.h. ##
1973
## ----------- ##"
1974
      echo
1975
      cat confdefs.h
1976
      echo
1977
    fi
1978
    test "$ac_signal" != 0 &&
1979
      $as_echo "$as_me: caught signal $ac_signal"
1980
    $as_echo "$as_me: exit $exit_status"
1981
  } >&5
1982
  rm -f core *.core core.conftest.* &&
1983
    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
1984
    exit $exit_status
1985
' 0
1986
for ac_signal in 1 2 13 15; do
1987
  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
1988
done
1989
ac_signal=0
1990
1991
# confdefs.h avoids OS command line length limits that DEFS can exceed.
1992
rm -f -r conftest* confdefs.h
1993
1994
$as_echo "/* confdefs.h */" > confdefs.h
1995
1996
# Predefined preprocessor variables.
1997
1998
cat >>confdefs.h <<_ACEOF
1999
@%:@define PACKAGE_NAME "$PACKAGE_NAME"
2000
_ACEOF
2001
2002
cat >>confdefs.h <<_ACEOF
2003
@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME"
2004
_ACEOF
2005
2006
cat >>confdefs.h <<_ACEOF
2007
@%:@define PACKAGE_VERSION "$PACKAGE_VERSION"
2008
_ACEOF
2009
2010
cat >>confdefs.h <<_ACEOF
2011
@%:@define PACKAGE_STRING "$PACKAGE_STRING"
2012
_ACEOF
2013
2014
cat >>confdefs.h <<_ACEOF
2015
@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
2016
_ACEOF
2017
2018
cat >>confdefs.h <<_ACEOF
2019
@%:@define PACKAGE_URL "$PACKAGE_URL"
2020
_ACEOF
2021
2022
2023
# Let the site file select an alternate cache file if it wants to.
2024
# Prefer an explicitly selected file to automatically selected ones.
2025
ac_site_file1=NONE
2026
ac_site_file2=NONE
2027
if test -n "$CONFIG_SITE"; then
2028
  # We do not want a PATH search for config.site.
2029
  case $CONFIG_SITE in @%:@((
2030
    -*)  ac_site_file1=./$CONFIG_SITE;;
2031
    */*) ac_site_file1=$CONFIG_SITE;;
2032
    *)   ac_site_file1=./$CONFIG_SITE;;
2033
  esac
2034
elif test "x$prefix" != xNONE; then
2035
  ac_site_file1=$prefix/share/config.site
2036
  ac_site_file2=$prefix/etc/config.site
2037
else
2038
  ac_site_file1=$ac_default_prefix/share/config.site
2039
  ac_site_file2=$ac_default_prefix/etc/config.site
2040
fi
2041
for ac_site_file in "$ac_site_file1" "$ac_site_file2"
2042
do
2043
  test "x$ac_site_file" = xNONE && continue
2044
  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
2045
    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
2046
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
2047
    sed 's/^/| /' "$ac_site_file" >&5
2048
    . "$ac_site_file" \
2049
      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2050
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2051
as_fn_error $? "failed to load site script $ac_site_file
2052
See \`config.log' for more details" "$LINENO" 5; }
2053
  fi
2054
done
2055
2056
if test -r "$cache_file"; then
2057
  # Some versions of bash will fail to source /dev/null (special files
2058
  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
2059
  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
2060
    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
2061
$as_echo "$as_me: loading cache $cache_file" >&6;}
2062
    case $cache_file in
2063
      [\\/]* | ?:[\\/]* ) . "$cache_file";;
2064
      *)                      . "./$cache_file";;
2065
    esac
2066
  fi
2067
else
2068
  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
2069
$as_echo "$as_me: creating cache $cache_file" >&6;}
2070
  >$cache_file
2071
fi
2072
2073
# Check that the precious variables saved in the cache have kept the same
2074
# value.
2075
ac_cache_corrupted=false
2076
for ac_var in $ac_precious_vars; do
2077
  eval ac_old_set=\$ac_cv_env_${ac_var}_set
2078
  eval ac_new_set=\$ac_env_${ac_var}_set
2079
  eval ac_old_val=\$ac_cv_env_${ac_var}_value
2080
  eval ac_new_val=\$ac_env_${ac_var}_value
2081
  case $ac_old_set,$ac_new_set in
2082
    set,)
2083
      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
2084
$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
2085
      ac_cache_corrupted=: ;;
2086
    ,set)
2087
      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
2088
$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
2089
      ac_cache_corrupted=: ;;
2090
    ,);;
2091
    *)
2092
      if test "x$ac_old_val" != "x$ac_new_val"; then
2093
	# differences in whitespace do not lead to failure.
2094
	ac_old_val_w=`echo x $ac_old_val`
2095
	ac_new_val_w=`echo x $ac_new_val`
2096
	if test "$ac_old_val_w" != "$ac_new_val_w"; then
2097
	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
2098
$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
2099
	  ac_cache_corrupted=:
2100
	else
2101
	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
2102
$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
2103
	  eval $ac_var=\$ac_old_val
2104
	fi
2105
	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
2106
$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
2107
	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
2108
$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
2109
      fi;;
2110
  esac
2111
  # Pass precious variables to config.status.
2112
  if test "$ac_new_set" = set; then
2113
    case $ac_new_val in
2114
    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
2115
    *) ac_arg=$ac_var=$ac_new_val ;;
2116
    esac
2117
    case " $ac_configure_args " in
2118
      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
2119
      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
2120
    esac
2121
  fi
2122
done
2123
if $ac_cache_corrupted; then
2124
  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2125
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2126
  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
2127
$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
2128
  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
2129
fi
2130
## -------------------- ##
2131
## Main body of script. ##
2132
## -------------------- ##
2133
2134
ac_ext=c
2135
ac_cpp='$CPP $CPPFLAGS'
2136
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2137
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2138
ac_compiler_gnu=$ac_cv_c_compiler_gnu
2139
2140
2141
2142
ac_config_headers="$ac_config_headers bgpdump-config.h"
2143
2144
2145
CFLAGS="-g -O3 $CFLAGS -Wall"
2146
CFLAGS="$CFLAGS -Wsystem-headers -Wno-format-y2k -Wno-sign-compare -Wcast-align"
2147
CFLAGS="$CFLAGS -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wswitch -Wshadow"
2148
2149
# Checks for programs.
2150
ac_ext=c
2151
ac_cpp='$CPP $CPPFLAGS'
2152
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2153
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2154
ac_compiler_gnu=$ac_cv_c_compiler_gnu
2155
if test -n "$ac_tool_prefix"; then
2156
  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
2157
set dummy ${ac_tool_prefix}gcc; ac_word=$2
2158
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2159
$as_echo_n "checking for $ac_word... " >&6; }
2160
if ${ac_cv_prog_CC+:} false; then :
2161
  $as_echo_n "(cached) " >&6
2162
else
2163
  if test -n "$CC"; then
2164
  ac_cv_prog_CC="$CC" # Let the user override the test.
2165
else
2166
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2167
for as_dir in $PATH
2168
do
2169
  IFS=$as_save_IFS
2170
  test -z "$as_dir" && as_dir=.
2171
    for ac_exec_ext in '' $ac_executable_extensions; do
2172
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2173
    ac_cv_prog_CC="${ac_tool_prefix}gcc"
2174
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2175
    break 2
2176
  fi
2177
done
2178
  done
2179
IFS=$as_save_IFS
2180
2181
fi
2182
fi
2183
CC=$ac_cv_prog_CC
2184
if test -n "$CC"; then
2185
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2186
$as_echo "$CC" >&6; }
2187
else
2188
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2189
$as_echo "no" >&6; }
2190
fi
2191
2192
2193
fi
2194
if test -z "$ac_cv_prog_CC"; then
2195
  ac_ct_CC=$CC
2196
  # Extract the first word of "gcc", so it can be a program name with args.
2197
set dummy gcc; ac_word=$2
2198
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2199
$as_echo_n "checking for $ac_word... " >&6; }
2200
if ${ac_cv_prog_ac_ct_CC+:} false; then :
2201
  $as_echo_n "(cached) " >&6
2202
else
2203
  if test -n "$ac_ct_CC"; then
2204
  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
2205
else
2206
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2207
for as_dir in $PATH
2208
do
2209
  IFS=$as_save_IFS
2210
  test -z "$as_dir" && as_dir=.
2211
    for ac_exec_ext in '' $ac_executable_extensions; do
2212
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2213
    ac_cv_prog_ac_ct_CC="gcc"
2214
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2215
    break 2
2216
  fi
2217
done
2218
  done
2219
IFS=$as_save_IFS
2220
2221
fi
2222
fi
2223
ac_ct_CC=$ac_cv_prog_ac_ct_CC
2224
if test -n "$ac_ct_CC"; then
2225
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
2226
$as_echo "$ac_ct_CC" >&6; }
2227
else
2228
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2229
$as_echo "no" >&6; }
2230
fi
2231
2232
  if test "x$ac_ct_CC" = x; then
2233
    CC=""
2234
  else
2235
    case $cross_compiling:$ac_tool_warned in
2236
yes:)
2237
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2238
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2239
ac_tool_warned=yes ;;
2240
esac
2241
    CC=$ac_ct_CC
2242
  fi
2243
else
2244
  CC="$ac_cv_prog_CC"
2245
fi
2246
2247
if test -z "$CC"; then
2248
          if test -n "$ac_tool_prefix"; then
2249
    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
2250
set dummy ${ac_tool_prefix}cc; ac_word=$2
2251
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2252
$as_echo_n "checking for $ac_word... " >&6; }
2253
if ${ac_cv_prog_CC+:} false; then :
2254
  $as_echo_n "(cached) " >&6
2255
else
2256
  if test -n "$CC"; then
2257
  ac_cv_prog_CC="$CC" # Let the user override the test.
2258
else
2259
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2260
for as_dir in $PATH
2261
do
2262
  IFS=$as_save_IFS
2263
  test -z "$as_dir" && as_dir=.
2264
    for ac_exec_ext in '' $ac_executable_extensions; do
2265
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2266
    ac_cv_prog_CC="${ac_tool_prefix}cc"
2267
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2268
    break 2
2269
  fi
2270
done
2271
  done
2272
IFS=$as_save_IFS
2273
2274
fi
2275
fi
2276
CC=$ac_cv_prog_CC
2277
if test -n "$CC"; then
2278
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2279
$as_echo "$CC" >&6; }
2280
else
2281
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2282
$as_echo "no" >&6; }
2283
fi
2284
2285
2286
  fi
2287
fi
2288
if test -z "$CC"; then
2289
  # Extract the first word of "cc", so it can be a program name with args.
2290
set dummy cc; ac_word=$2
2291
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2292
$as_echo_n "checking for $ac_word... " >&6; }
2293
if ${ac_cv_prog_CC+:} false; then :
2294
  $as_echo_n "(cached) " >&6
2295
else
2296
  if test -n "$CC"; then
2297
  ac_cv_prog_CC="$CC" # Let the user override the test.
2298
else
2299
  ac_prog_rejected=no
2300
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2301
for as_dir in $PATH
2302
do
2303
  IFS=$as_save_IFS
2304
  test -z "$as_dir" && as_dir=.
2305
    for ac_exec_ext in '' $ac_executable_extensions; do
2306
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2307
    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
2308
       ac_prog_rejected=yes
2309
       continue
2310
     fi
2311
    ac_cv_prog_CC="cc"
2312
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2313
    break 2
2314
  fi
2315
done
2316
  done
2317
IFS=$as_save_IFS
2318
2319
if test $ac_prog_rejected = yes; then
2320
  # We found a bogon in the path, so make sure we never use it.
2321
  set dummy $ac_cv_prog_CC
2322
  shift
2323
  if test $@%:@ != 0; then
2324
    # We chose a different compiler from the bogus one.
2325
    # However, it has the same basename, so the bogon will be chosen
2326
    # first if we set CC to just the basename; use the full file name.
2327
    shift
2328
    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
2329
  fi
2330
fi
2331
fi
2332
fi
2333
CC=$ac_cv_prog_CC
2334
if test -n "$CC"; then
2335
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2336
$as_echo "$CC" >&6; }
2337
else
2338
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2339
$as_echo "no" >&6; }
2340
fi
2341
2342
2343
fi
2344
if test -z "$CC"; then
2345
  if test -n "$ac_tool_prefix"; then
2346
  for ac_prog in cl.exe
2347
  do
2348
    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
2349
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
2350
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2351
$as_echo_n "checking for $ac_word... " >&6; }
2352
if ${ac_cv_prog_CC+:} false; then :
2353
  $as_echo_n "(cached) " >&6
2354
else
2355
  if test -n "$CC"; then
2356
  ac_cv_prog_CC="$CC" # Let the user override the test.
2357
else
2358
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2359
for as_dir in $PATH
2360
do
2361
  IFS=$as_save_IFS
2362
  test -z "$as_dir" && as_dir=.
2363
    for ac_exec_ext in '' $ac_executable_extensions; do
2364
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2365
    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
2366
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2367
    break 2
2368
  fi
2369
done
2370
  done
2371
IFS=$as_save_IFS
2372
2373
fi
2374
fi
2375
CC=$ac_cv_prog_CC
2376
if test -n "$CC"; then
2377
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2378
$as_echo "$CC" >&6; }
2379
else
2380
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2381
$as_echo "no" >&6; }
2382
fi
2383
2384
2385
    test -n "$CC" && break
2386
  done
2387
fi
2388
if test -z "$CC"; then
2389
  ac_ct_CC=$CC
2390
  for ac_prog in cl.exe
2391
do
2392
  # Extract the first word of "$ac_prog", so it can be a program name with args.
2393
set dummy $ac_prog; ac_word=$2
2394
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2395
$as_echo_n "checking for $ac_word... " >&6; }
2396
if ${ac_cv_prog_ac_ct_CC+:} false; then :
2397
  $as_echo_n "(cached) " >&6
2398
else
2399
  if test -n "$ac_ct_CC"; then
2400
  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
2401
else
2402
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2403
for as_dir in $PATH
2404
do
2405
  IFS=$as_save_IFS
2406
  test -z "$as_dir" && as_dir=.
2407
    for ac_exec_ext in '' $ac_executable_extensions; do
2408
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2409
    ac_cv_prog_ac_ct_CC="$ac_prog"
2410
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2411
    break 2
2412
  fi
2413
done
2414
  done
2415
IFS=$as_save_IFS
2416
2417
fi
2418
fi
2419
ac_ct_CC=$ac_cv_prog_ac_ct_CC
2420
if test -n "$ac_ct_CC"; then
2421
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
2422
$as_echo "$ac_ct_CC" >&6; }
2423
else
2424
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2425
$as_echo "no" >&6; }
2426
fi
2427
2428
2429
  test -n "$ac_ct_CC" && break
2430
done
2431
2432
  if test "x$ac_ct_CC" = x; then
2433
    CC=""
2434
  else
2435
    case $cross_compiling:$ac_tool_warned in
2436
yes:)
2437
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2438
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2439
ac_tool_warned=yes ;;
2440
esac
2441
    CC=$ac_ct_CC
2442
  fi
2443
fi
2444
2445
fi
2446
2447
2448
test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2449
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2450
as_fn_error $? "no acceptable C compiler found in \$PATH
2451
See \`config.log' for more details" "$LINENO" 5; }
2452
2453
# Provide some information about the compiler.
2454
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
2455
set X $ac_compile
2456
ac_compiler=$2
2457
for ac_option in --version -v -V -qversion; do
2458
  { { ac_try="$ac_compiler $ac_option >&5"
2459
case "(($ac_try" in
2460
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2461
  *) ac_try_echo=$ac_try;;
2462
esac
2463
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2464
$as_echo "$ac_try_echo"; } >&5
2465
  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
2466
  ac_status=$?
2467
  if test -s conftest.err; then
2468
    sed '10a\
2469
... rest of stderr output deleted ...
2470
         10q' conftest.err >conftest.er1
2471
    cat conftest.er1 >&5
2472
  fi
2473
  rm -f conftest.er1 conftest.err
2474
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2475
  test $ac_status = 0; }
2476
done
2477
2478
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2479
/* end confdefs.h.  */
2480
2481
int
2482
main ()
2483
{
2484
2485
  ;
2486
  return 0;
2487
}
2488
_ACEOF
2489
ac_clean_files_save=$ac_clean_files
2490
ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
2491
# Try to create an executable without -o first, disregard a.out.
2492
# It will help us diagnose broken compilers, and finding out an intuition
2493
# of exeext.
2494
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
2495
$as_echo_n "checking whether the C compiler works... " >&6; }
2496
ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
2497
2498
# The possible output files:
2499
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
2500
2501
ac_rmfiles=
2502
for ac_file in $ac_files
2503
do
2504
  case $ac_file in
2505
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
2506
    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
2507
  esac
2508
done
2509
rm -f $ac_rmfiles
2510
2511
if { { ac_try="$ac_link_default"
2512
case "(($ac_try" in
2513
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2514
  *) ac_try_echo=$ac_try;;
2515
esac
2516
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2517
$as_echo "$ac_try_echo"; } >&5
2518
  (eval "$ac_link_default") 2>&5
2519
  ac_status=$?
2520
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2521
  test $ac_status = 0; }; then :
2522
  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
2523
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
2524
# in a Makefile.  We should not override ac_cv_exeext if it was cached,
2525
# so that the user can short-circuit this test for compilers unknown to
2526
# Autoconf.
2527
for ac_file in $ac_files ''
2528
do
2529
  test -f "$ac_file" || continue
2530
  case $ac_file in
2531
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
2532
	;;
2533
    [ab].out )
2534
	# We found the default executable, but exeext='' is most
2535
	# certainly right.
2536
	break;;
2537
    *.* )
2538
	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
2539
	then :; else
2540
	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
2541
	fi
2542
	# We set ac_cv_exeext here because the later test for it is not
2543
	# safe: cross compilers may not add the suffix if given an `-o'
2544
	# argument, so we may need to know it at that point already.
2545
	# Even if this section looks crufty: it has the advantage of
2546
	# actually working.
2547
	break;;
2548
    * )
2549
	break;;
2550
  esac
2551
done
2552
test "$ac_cv_exeext" = no && ac_cv_exeext=
2553
2554
else
2555
  ac_file=''
2556
fi
2557
if test -z "$ac_file"; then :
2558
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2559
$as_echo "no" >&6; }
2560
$as_echo "$as_me: failed program was:" >&5
2561
sed 's/^/| /' conftest.$ac_ext >&5
2562
2563
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2564
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2565
as_fn_error 77 "C compiler cannot create executables
2566
See \`config.log' for more details" "$LINENO" 5; }
2567
else
2568
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
2569
$as_echo "yes" >&6; }
2570
fi
2571
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
2572
$as_echo_n "checking for C compiler default output file name... " >&6; }
2573
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
2574
$as_echo "$ac_file" >&6; }
2575
ac_exeext=$ac_cv_exeext
2576
2577
rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
2578
ac_clean_files=$ac_clean_files_save
2579
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
2580
$as_echo_n "checking for suffix of executables... " >&6; }
2581
if { { ac_try="$ac_link"
2582
case "(($ac_try" in
2583
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2584
  *) ac_try_echo=$ac_try;;
2585
esac
2586
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2587
$as_echo "$ac_try_echo"; } >&5
2588
  (eval "$ac_link") 2>&5
2589
  ac_status=$?
2590
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2591
  test $ac_status = 0; }; then :
2592
  # If both `conftest.exe' and `conftest' are `present' (well, observable)
2593
# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
2594
# work properly (i.e., refer to `conftest.exe'), while it won't with
2595
# `rm'.
2596
for ac_file in conftest.exe conftest conftest.*; do
2597
  test -f "$ac_file" || continue
2598
  case $ac_file in
2599
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
2600
    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
2601
	  break;;
2602
    * ) break;;
2603
  esac
2604
done
2605
else
2606
  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2607
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2608
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
2609
See \`config.log' for more details" "$LINENO" 5; }
2610
fi
2611
rm -f conftest conftest$ac_cv_exeext
2612
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
2613
$as_echo "$ac_cv_exeext" >&6; }
2614
2615
rm -f conftest.$ac_ext
2616
EXEEXT=$ac_cv_exeext
2617
ac_exeext=$EXEEXT
2618
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2619
/* end confdefs.h.  */
2620
@%:@include <stdio.h>
2621
int
2622
main ()
2623
{
2624
FILE *f = fopen ("conftest.out", "w");
2625
 return ferror (f) || fclose (f) != 0;
2626
2627
  ;
2628
  return 0;
2629
}
2630
_ACEOF
2631
ac_clean_files="$ac_clean_files conftest.out"
2632
# Check that the compiler produces executables we can run.  If not, either
2633
# the compiler is broken, or we cross compile.
2634
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
2635
$as_echo_n "checking whether we are cross compiling... " >&6; }
2636
if test "$cross_compiling" != yes; then
2637
  { { ac_try="$ac_link"
2638
case "(($ac_try" in
2639
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2640
  *) ac_try_echo=$ac_try;;
2641
esac
2642
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2643
$as_echo "$ac_try_echo"; } >&5
2644
  (eval "$ac_link") 2>&5
2645
  ac_status=$?
2646
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2647
  test $ac_status = 0; }
2648
  if { ac_try='./conftest$ac_cv_exeext'
2649
  { { case "(($ac_try" in
2650
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2651
  *) ac_try_echo=$ac_try;;
2652
esac
2653
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2654
$as_echo "$ac_try_echo"; } >&5
2655
  (eval "$ac_try") 2>&5
2656
  ac_status=$?
2657
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2658
  test $ac_status = 0; }; }; then
2659
    cross_compiling=no
2660
  else
2661
    if test "$cross_compiling" = maybe; then
2662
	cross_compiling=yes
2663
    else
2664
	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2665
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2666
as_fn_error $? "cannot run C compiled programs.
2667
If you meant to cross compile, use \`--host'.
2668
See \`config.log' for more details" "$LINENO" 5; }
2669
    fi
2670
  fi
2671
fi
2672
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
2673
$as_echo "$cross_compiling" >&6; }
2674
2675
rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
2676
ac_clean_files=$ac_clean_files_save
2677
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
2678
$as_echo_n "checking for suffix of object files... " >&6; }
2679
if ${ac_cv_objext+:} false; then :
2680
  $as_echo_n "(cached) " >&6
2681
else
2682
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2683
/* end confdefs.h.  */
2684
2685
int
2686
main ()
2687
{
2688
2689
  ;
2690
  return 0;
2691
}
2692
_ACEOF
2693
rm -f conftest.o conftest.obj
2694
if { { ac_try="$ac_compile"
2695
case "(($ac_try" in
2696
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2697
  *) ac_try_echo=$ac_try;;
2698
esac
2699
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2700
$as_echo "$ac_try_echo"; } >&5
2701
  (eval "$ac_compile") 2>&5
2702
  ac_status=$?
2703
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2704
  test $ac_status = 0; }; then :
2705
  for ac_file in conftest.o conftest.obj conftest.*; do
2706
  test -f "$ac_file" || continue;
2707
  case $ac_file in
2708
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
2709
    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
2710
       break;;
2711
  esac
2712
done
2713
else
2714
  $as_echo "$as_me: failed program was:" >&5
2715
sed 's/^/| /' conftest.$ac_ext >&5
2716
2717
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2718
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2719
as_fn_error $? "cannot compute suffix of object files: cannot compile
2720
See \`config.log' for more details" "$LINENO" 5; }
2721
fi
2722
rm -f conftest.$ac_cv_objext conftest.$ac_ext
2723
fi
2724
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
2725
$as_echo "$ac_cv_objext" >&6; }
2726
OBJEXT=$ac_cv_objext
2727
ac_objext=$OBJEXT
2728
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
2729
$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
2730
if ${ac_cv_c_compiler_gnu+:} false; then :
2731
  $as_echo_n "(cached) " >&6
2732
else
2733
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2734
/* end confdefs.h.  */
2735
2736
int
2737
main ()
2738
{
2739
#ifndef __GNUC__
2740
       choke me
2741
#endif
2742
2743
  ;
2744
  return 0;
2745
}
2746
_ACEOF
2747
if ac_fn_c_try_compile "$LINENO"; then :
2748
  ac_compiler_gnu=yes
2749
else
2750
  ac_compiler_gnu=no
2751
fi
2752
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2753
ac_cv_c_compiler_gnu=$ac_compiler_gnu
2754
2755
fi
2756
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
2757
$as_echo "$ac_cv_c_compiler_gnu" >&6; }
2758
if test $ac_compiler_gnu = yes; then
2759
  GCC=yes
2760
else
2761
  GCC=
2762
fi
2763
ac_test_CFLAGS=${CFLAGS+set}
2764
ac_save_CFLAGS=$CFLAGS
2765
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
2766
$as_echo_n "checking whether $CC accepts -g... " >&6; }
2767
if ${ac_cv_prog_cc_g+:} false; then :
2768
  $as_echo_n "(cached) " >&6
2769
else
2770
  ac_save_c_werror_flag=$ac_c_werror_flag
2771
   ac_c_werror_flag=yes
2772
   ac_cv_prog_cc_g=no
2773
   CFLAGS="-g"
2774
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2775
/* end confdefs.h.  */
2776
2777
int
2778
main ()
2779
{
2780
2781
  ;
2782
  return 0;
2783
}
2784
_ACEOF
2785
if ac_fn_c_try_compile "$LINENO"; then :
2786
  ac_cv_prog_cc_g=yes
2787
else
2788
  CFLAGS=""
2789
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2790
/* end confdefs.h.  */
2791
2792
int
2793
main ()
2794
{
2795
2796
  ;
2797
  return 0;
2798
}
2799
_ACEOF
2800
if ac_fn_c_try_compile "$LINENO"; then :
2801
  
2802
else
2803
  ac_c_werror_flag=$ac_save_c_werror_flag
2804
	 CFLAGS="-g"
2805
	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2806
/* end confdefs.h.  */
2807
2808
int
2809
main ()
2810
{
2811
2812
  ;
2813
  return 0;
2814
}
2815
_ACEOF
2816
if ac_fn_c_try_compile "$LINENO"; then :
2817
  ac_cv_prog_cc_g=yes
2818
fi
2819
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2820
fi
2821
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2822
fi
2823
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2824
   ac_c_werror_flag=$ac_save_c_werror_flag
2825
fi
2826
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
2827
$as_echo "$ac_cv_prog_cc_g" >&6; }
2828
if test "$ac_test_CFLAGS" = set; then
2829
  CFLAGS=$ac_save_CFLAGS
2830
elif test $ac_cv_prog_cc_g = yes; then
2831
  if test "$GCC" = yes; then
2832
    CFLAGS="-g -O2"
2833
  else
2834
    CFLAGS="-g"
2835
  fi
2836
else
2837
  if test "$GCC" = yes; then
2838
    CFLAGS="-O2"
2839
  else
2840
    CFLAGS=
2841
  fi
2842
fi
2843
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
2844
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
2845
if ${ac_cv_prog_cc_c89+:} false; then :
2846
  $as_echo_n "(cached) " >&6
2847
else
2848
  ac_cv_prog_cc_c89=no
2849
ac_save_CC=$CC
2850
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2851
/* end confdefs.h.  */
2852
#include <stdarg.h>
2853
#include <stdio.h>
2854
struct stat;
2855
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2856
struct buf { int x; };
2857
FILE * (*rcsopen) (struct buf *, struct stat *, int);
2858
static char *e (p, i)
2859
     char **p;
2860
     int i;
2861
{
2862
  return p[i];
2863
}
2864
static char *f (char * (*g) (char **, int), char **p, ...)
2865
{
2866
  char *s;
2867
  va_list v;
2868
  va_start (v,p);
2869
  s = g (p, va_arg (v,int));
2870
  va_end (v);
2871
  return s;
2872
}
2873
2874
/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
2875
   function prototypes and stuff, but not '\xHH' hex character constants.
2876
   These don't provoke an error unfortunately, instead are silently treated
2877
   as 'x'.  The following induces an error, until -std is added to get
2878
   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
2879
   array size at least.  It's necessary to write '\x00'==0 to get something
2880
   that's true only with -std.  */
2881
int osf4_cc_array ['\x00' == 0 ? 1 : -1];
2882
2883
/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
2884
   inside strings and character constants.  */
2885
#define FOO(x) 'x'
2886
int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
2887
2888
int test (int i, double x);
2889
struct s1 {int (*f) (int a);};
2890
struct s2 {int (*f) (double a);};
2891
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2892
int argc;
2893
char **argv;
2894
int
2895
main ()
2896
{
2897
return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2898
  ;
2899
  return 0;
2900
}
2901
_ACEOF
2902
for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
2903
	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2904
do
2905
  CC="$ac_save_CC $ac_arg"
2906
  if ac_fn_c_try_compile "$LINENO"; then :
2907
  ac_cv_prog_cc_c89=$ac_arg
2908
fi
2909
rm -f core conftest.err conftest.$ac_objext
2910
  test "x$ac_cv_prog_cc_c89" != "xno" && break
2911
done
2912
rm -f conftest.$ac_ext
2913
CC=$ac_save_CC
2914
2915
fi
2916
# AC_CACHE_VAL
2917
case "x$ac_cv_prog_cc_c89" in
2918
  x)
2919
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
2920
$as_echo "none needed" >&6; } ;;
2921
  xno)
2922
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
2923
$as_echo "unsupported" >&6; } ;;
2924
  *)
2925
    CC="$CC $ac_cv_prog_cc_c89"
2926
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
2927
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
2928
esac
2929
if test "x$ac_cv_prog_cc_c89" != xno; then :
2930
  
2931
fi
2932
2933
ac_ext=c
2934
ac_cpp='$CPP $CPPFLAGS'
2935
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2936
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2937
ac_compiler_gnu=$ac_cv_c_compiler_gnu
2938
2939
if test -n "$ac_tool_prefix"; then
2940
  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
2941
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
2942
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2943
$as_echo_n "checking for $ac_word... " >&6; }
2944
if ${ac_cv_prog_RANLIB+:} false; then :
2945
  $as_echo_n "(cached) " >&6
2946
else
2947
  if test -n "$RANLIB"; then
2948
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2949
else
2950
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2951
for as_dir in $PATH
2952
do
2953
  IFS=$as_save_IFS
2954
  test -z "$as_dir" && as_dir=.
2955
    for ac_exec_ext in '' $ac_executable_extensions; do
2956
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2957
    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
2958
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2959
    break 2
2960
  fi
2961
done
2962
  done
2963
IFS=$as_save_IFS
2964
2965
fi
2966
fi
2967
RANLIB=$ac_cv_prog_RANLIB
2968
if test -n "$RANLIB"; then
2969
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
2970
$as_echo "$RANLIB" >&6; }
2971
else
2972
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2973
$as_echo "no" >&6; }
2974
fi
2975
2976
2977
fi
2978
if test -z "$ac_cv_prog_RANLIB"; then
2979
  ac_ct_RANLIB=$RANLIB
2980
  # Extract the first word of "ranlib", so it can be a program name with args.
2981
set dummy ranlib; ac_word=$2
2982
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2983
$as_echo_n "checking for $ac_word... " >&6; }
2984
if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
2985
  $as_echo_n "(cached) " >&6
2986
else
2987
  if test -n "$ac_ct_RANLIB"; then
2988
  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
2989
else
2990
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2991
for as_dir in $PATH
2992
do
2993
  IFS=$as_save_IFS
2994
  test -z "$as_dir" && as_dir=.
2995
    for ac_exec_ext in '' $ac_executable_extensions; do
2996
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2997
    ac_cv_prog_ac_ct_RANLIB="ranlib"
2998
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2999
    break 2
3000
  fi
3001
done
3002
  done
3003
IFS=$as_save_IFS
3004
3005
fi
3006
fi
3007
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3008
if test -n "$ac_ct_RANLIB"; then
3009
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
3010
$as_echo "$ac_ct_RANLIB" >&6; }
3011
else
3012
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3013
$as_echo "no" >&6; }
3014
fi
3015
3016
  if test "x$ac_ct_RANLIB" = x; then
3017
    RANLIB=":"
3018
  else
3019
    case $cross_compiling:$ac_tool_warned in
3020
yes:)
3021
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3022
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3023
ac_tool_warned=yes ;;
3024
esac
3025
    RANLIB=$ac_ct_RANLIB
3026
  fi
3027
else
3028
  RANLIB="$ac_cv_prog_RANLIB"
3029
fi
3030
3031
3032
# Checks for header files.
3033
3034
ac_ext=c
3035
ac_cpp='$CPP $CPPFLAGS'
3036
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3037
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3038
ac_compiler_gnu=$ac_cv_c_compiler_gnu
3039
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
3040
$as_echo_n "checking how to run the C preprocessor... " >&6; }
3041
# On Suns, sometimes $CPP names a directory.
3042
if test -n "$CPP" && test -d "$CPP"; then
3043
  CPP=
3044
fi
3045
if test -z "$CPP"; then
3046
  if ${ac_cv_prog_CPP+:} false; then :
3047
  $as_echo_n "(cached) " >&6
3048
else
3049
      # Double quotes because CPP needs to be expanded
3050
    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
3051
    do
3052
      ac_preproc_ok=false
3053
for ac_c_preproc_warn_flag in '' yes
3054
do
3055
  # Use a header file that comes with gcc, so configuring glibc
3056
  # with a fresh cross-compiler works.
3057
  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3058
  # <limits.h> exists even on freestanding compilers.
3059
  # On the NeXT, cc -E runs the code through the compiler's parser,
3060
  # not just through cpp. "Syntax error" is here to catch this case.
3061
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3062
/* end confdefs.h.  */
3063
@%:@ifdef __STDC__
3064
@%:@ include <limits.h>
3065
@%:@else
3066
@%:@ include <assert.h>
3067
@%:@endif
3068
		     Syntax error
3069
_ACEOF
3070
if ac_fn_c_try_cpp "$LINENO"; then :
3071
  
3072
else
3073
  # Broken: fails on valid input.
3074
continue
3075
fi
3076
rm -f conftest.err conftest.i conftest.$ac_ext
3077
3078
  # OK, works on sane cases.  Now check whether nonexistent headers
3079
  # can be detected and how.
3080
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3081
/* end confdefs.h.  */
3082
@%:@include <ac_nonexistent.h>
3083
_ACEOF
3084
if ac_fn_c_try_cpp "$LINENO"; then :
3085
  # Broken: success on invalid input.
3086
continue
3087
else
3088
  # Passes both tests.
3089
ac_preproc_ok=:
3090
break
3091
fi
3092
rm -f conftest.err conftest.i conftest.$ac_ext
3093
3094
done
3095
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
3096
rm -f conftest.i conftest.err conftest.$ac_ext
3097
if $ac_preproc_ok; then :
3098
  break
3099
fi
3100
3101
    done
3102
    ac_cv_prog_CPP=$CPP
3103
  
3104
fi
3105
  CPP=$ac_cv_prog_CPP
3106
else
3107
  ac_cv_prog_CPP=$CPP
3108
fi
3109
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
3110
$as_echo "$CPP" >&6; }
3111
ac_preproc_ok=false
3112
for ac_c_preproc_warn_flag in '' yes
3113
do
3114
  # Use a header file that comes with gcc, so configuring glibc
3115
  # with a fresh cross-compiler works.
3116
  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3117
  # <limits.h> exists even on freestanding compilers.
3118
  # On the NeXT, cc -E runs the code through the compiler's parser,
3119
  # not just through cpp. "Syntax error" is here to catch this case.
3120
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3121
/* end confdefs.h.  */
3122
@%:@ifdef __STDC__
3123
@%:@ include <limits.h>
3124
@%:@else
3125
@%:@ include <assert.h>
3126
@%:@endif
3127
		     Syntax error
3128
_ACEOF
3129
if ac_fn_c_try_cpp "$LINENO"; then :
3130
  
3131
else
3132
  # Broken: fails on valid input.
3133
continue
3134
fi
3135
rm -f conftest.err conftest.i conftest.$ac_ext
3136
3137
  # OK, works on sane cases.  Now check whether nonexistent headers
3138
  # can be detected and how.
3139
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3140
/* end confdefs.h.  */
3141
@%:@include <ac_nonexistent.h>
3142
_ACEOF
3143
if ac_fn_c_try_cpp "$LINENO"; then :
3144
  # Broken: success on invalid input.
3145
continue
3146
else
3147
  # Passes both tests.
3148
ac_preproc_ok=:
3149
break
3150
fi
3151
rm -f conftest.err conftest.i conftest.$ac_ext
3152
3153
done
3154
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
3155
rm -f conftest.i conftest.err conftest.$ac_ext
3156
if $ac_preproc_ok; then :
3157
  
3158
else
3159
  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3160
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3161
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
3162
See \`config.log' for more details" "$LINENO" 5; }
3163
fi
3164
3165
ac_ext=c
3166
ac_cpp='$CPP $CPPFLAGS'
3167
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3168
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3169
ac_compiler_gnu=$ac_cv_c_compiler_gnu
3170
3171
3172
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
3173
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
3174
if ${ac_cv_path_GREP+:} false; then :
3175
  $as_echo_n "(cached) " >&6
3176
else
3177
  if test -z "$GREP"; then
3178
  ac_path_GREP_found=false
3179
  # Loop through the user's path and test for each of PROGNAME-LIST
3180
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3181
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
3182
do
3183
  IFS=$as_save_IFS
3184
  test -z "$as_dir" && as_dir=.
3185
    for ac_prog in grep ggrep; do
3186
    for ac_exec_ext in '' $ac_executable_extensions; do
3187
      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
3188
      as_fn_executable_p "$ac_path_GREP" || continue
3189
# Check for GNU ac_path_GREP and select it if it is found.
3190
  # Check for GNU $ac_path_GREP
3191
case `"$ac_path_GREP" --version 2>&1` in
3192
*GNU*)
3193
  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
3194
*)
3195
  ac_count=0
3196
  $as_echo_n 0123456789 >"conftest.in"
3197
  while :
3198
  do
3199
    cat "conftest.in" "conftest.in" >"conftest.tmp"
3200
    mv "conftest.tmp" "conftest.in"
3201
    cp "conftest.in" "conftest.nl"
3202
    $as_echo 'GREP' >> "conftest.nl"
3203
    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
3204
    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
3205
    as_fn_arith $ac_count + 1 && ac_count=$as_val
3206
    if test $ac_count -gt ${ac_path_GREP_max-0}; then
3207
      # Best one so far, save it but keep looking for a better one
3208
      ac_cv_path_GREP="$ac_path_GREP"
3209
      ac_path_GREP_max=$ac_count
3210
    fi
3211
    # 10*(2^10) chars as input seems more than enough
3212
    test $ac_count -gt 10 && break
3213
  done
3214
  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
3215
esac
3216
3217
      $ac_path_GREP_found && break 3
3218
    done
3219
  done
3220
  done
3221
IFS=$as_save_IFS
3222
  if test -z "$ac_cv_path_GREP"; then
3223
    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
3224
  fi
3225
else
3226
  ac_cv_path_GREP=$GREP
3227
fi
3228
3229
fi
3230
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
3231
$as_echo "$ac_cv_path_GREP" >&6; }
3232
 GREP="$ac_cv_path_GREP"
3233
 
3234
3235
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
3236
$as_echo_n "checking for egrep... " >&6; }
3237
if ${ac_cv_path_EGREP+:} false; then :
3238
  $as_echo_n "(cached) " >&6
3239
else
3240
  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
3241
   then ac_cv_path_EGREP="$GREP -E"
3242
   else
3243
     if test -z "$EGREP"; then
3244
  ac_path_EGREP_found=false
3245
  # Loop through the user's path and test for each of PROGNAME-LIST
3246
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3247
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
3248
do
3249
  IFS=$as_save_IFS
3250
  test -z "$as_dir" && as_dir=.
3251
    for ac_prog in egrep; do
3252
    for ac_exec_ext in '' $ac_executable_extensions; do
3253
      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
3254
      as_fn_executable_p "$ac_path_EGREP" || continue
3255
# Check for GNU ac_path_EGREP and select it if it is found.
3256
  # Check for GNU $ac_path_EGREP
3257
case `"$ac_path_EGREP" --version 2>&1` in
3258
*GNU*)
3259
  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
3260
*)
3261
  ac_count=0
3262
  $as_echo_n 0123456789 >"conftest.in"
3263
  while :
3264
  do
3265
    cat "conftest.in" "conftest.in" >"conftest.tmp"
3266
    mv "conftest.tmp" "conftest.in"
3267
    cp "conftest.in" "conftest.nl"
3268
    $as_echo 'EGREP' >> "conftest.nl"
3269
    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
3270
    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
3271
    as_fn_arith $ac_count + 1 && ac_count=$as_val
3272
    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
3273
      # Best one so far, save it but keep looking for a better one
3274
      ac_cv_path_EGREP="$ac_path_EGREP"
3275
      ac_path_EGREP_max=$ac_count
3276
    fi
3277
    # 10*(2^10) chars as input seems more than enough
3278
    test $ac_count -gt 10 && break
3279
  done
3280
  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
3281
esac
3282
3283
      $ac_path_EGREP_found && break 3
3284
    done
3285
  done
3286
  done
3287
IFS=$as_save_IFS
3288
  if test -z "$ac_cv_path_EGREP"; then
3289
    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
3290
  fi
3291
else
3292
  ac_cv_path_EGREP=$EGREP
3293
fi
3294
3295
   fi
3296
fi
3297
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
3298
$as_echo "$ac_cv_path_EGREP" >&6; }
3299
 EGREP="$ac_cv_path_EGREP"
3300
 
3301
3302
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
3303
$as_echo_n "checking for ANSI C header files... " >&6; }
3304
if ${ac_cv_header_stdc+:} false; then :
3305
  $as_echo_n "(cached) " >&6
3306
else
3307
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3308
/* end confdefs.h.  */
3309
#include <stdlib.h>
3310
#include <stdarg.h>
3311
#include <string.h>
3312
#include <float.h>
3313
3314
int
3315
main ()
3316
{
3317
3318
  ;
3319
  return 0;
3320
}
3321
_ACEOF
3322
if ac_fn_c_try_compile "$LINENO"; then :
3323
  ac_cv_header_stdc=yes
3324
else
3325
  ac_cv_header_stdc=no
3326
fi
3327
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3328
3329
if test $ac_cv_header_stdc = yes; then
3330
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3331
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3332
/* end confdefs.h.  */
3333
#include <string.h>
3334
3335
_ACEOF
3336
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3337
  $EGREP "memchr" >/dev/null 2>&1; then :
3338
  
3339
else
3340
  ac_cv_header_stdc=no
3341
fi
3342
rm -f conftest*
3343
3344
fi
3345
3346
if test $ac_cv_header_stdc = yes; then
3347
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3348
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3349
/* end confdefs.h.  */
3350
#include <stdlib.h>
3351
3352
_ACEOF
3353
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3354
  $EGREP "free" >/dev/null 2>&1; then :
3355
  
3356
else
3357
  ac_cv_header_stdc=no
3358
fi
3359
rm -f conftest*
3360
3361
fi
3362
3363
if test $ac_cv_header_stdc = yes; then
3364
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3365
  if test "$cross_compiling" = yes; then :
3366
  :
3367
else
3368
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3369
/* end confdefs.h.  */
3370
#include <ctype.h>
3371
#include <stdlib.h>
3372
#if ((' ' & 0x0FF) == 0x020)
3373
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3374
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3375
#else
3376
# define ISLOWER(c) \
3377
		   (('a' <= (c) && (c) <= 'i') \
3378
		     || ('j' <= (c) && (c) <= 'r') \
3379
		     || ('s' <= (c) && (c) <= 'z'))
3380
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
3381
#endif
3382
3383
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3384
int
3385
main ()
3386
{
3387
  int i;
3388
  for (i = 0; i < 256; i++)
3389
    if (XOR (islower (i), ISLOWER (i))
3390
	|| toupper (i) != TOUPPER (i))
3391
      return 2;
3392
  return 0;
3393
}
3394
_ACEOF
3395
if ac_fn_c_try_run "$LINENO"; then :
3396
  
3397
else
3398
  ac_cv_header_stdc=no
3399
fi
3400
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
3401
  conftest.$ac_objext conftest.beam conftest.$ac_ext
3402
fi
3403
3404
fi
3405
fi
3406
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
3407
$as_echo "$ac_cv_header_stdc" >&6; }
3408
if test $ac_cv_header_stdc = yes; then
3409
  
3410
$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h
3411
3412
fi
3413
3414
# On IRIX 5.3, sys/types and inttypes.h are conflicting.
3415
for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
3416
		  inttypes.h stdint.h unistd.h
3417
do :
3418
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
3419
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
3420
"
3421
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
3422
  cat >>confdefs.h <<_ACEOF
3423
@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
3424
_ACEOF
3425
 
3426
fi
3427
3428
done
3429
3430
3431
for ac_header in arpa/inet.h netinet/in.h syslog.h
3432
do :
3433
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
3434
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
3435
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
3436
  cat >>confdefs.h <<_ACEOF
3437
@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
3438
_ACEOF
3439
 
3440
fi
3441
3442
done
3443
3444
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
3445
$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
3446
if ${ac_cv_struct_tm+:} false; then :
3447
  $as_echo_n "(cached) " >&6
3448
else
3449
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3450
/* end confdefs.h.  */
3451
#include <sys/types.h>
3452
#include <time.h>
3453
3454
int
3455
main ()
3456
{
3457
struct tm tm;
3458
				     int *p = &tm.tm_sec;
3459
				     return !p;
3460
  ;
3461
  return 0;
3462
}
3463
_ACEOF
3464
if ac_fn_c_try_compile "$LINENO"; then :
3465
  ac_cv_struct_tm=time.h
3466
else
3467
  ac_cv_struct_tm=sys/time.h
3468
fi
3469
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3470
fi
3471
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
3472
$as_echo "$ac_cv_struct_tm" >&6; }
3473
if test $ac_cv_struct_tm = sys/time.h; then
3474
  
3475
$as_echo "@%:@define TM_IN_SYS_TIME 1" >>confdefs.h
3476
3477
fi
3478
3479
3480
# Check for u_*_t
3481
ac_fn_c_check_type "$LINENO" "u_char_t" "ac_cv_type_u_char_t" "$ac_includes_default"
3482
if test "x$ac_cv_type_u_char_t" = xyes; then :
3483
  
3484
else
3485
  
3486
$as_echo "@%:@define u_char_t uchar_t" >>confdefs.h
3487
3488
fi
3489
3490
ac_fn_c_check_type "$LINENO" "u_int8_t" "ac_cv_type_u_int8_t" "$ac_includes_default"
3491
if test "x$ac_cv_type_u_int8_t" = xyes; then :
3492
  
3493
else
3494
  
3495
$as_echo "@%:@define u_int8_t uint8_t" >>confdefs.h
3496
3497
fi
3498
3499
ac_fn_c_check_type "$LINENO" "u_int16_t" "ac_cv_type_u_int16_t" "$ac_includes_default"
3500
if test "x$ac_cv_type_u_int16_t" = xyes; then :
3501
  
3502
else
3503
  
3504
$as_echo "@%:@define u_int16_t uint16_t" >>confdefs.h
3505
3506
fi
3507
3508
ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "$ac_includes_default"
3509
if test "x$ac_cv_type_u_int32_t" = xyes; then :
3510
  
3511
else
3512
  
3513
$as_echo "@%:@define u_int32_t uint32_t" >>confdefs.h
3514
3515
fi
3516
3517
3518
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5
3519
$as_echo_n "checking for gzopen in -lz... " >&6; }
3520
if ${ac_cv_lib_z_gzopen+:} false; then :
3521
  $as_echo_n "(cached) " >&6
3522
else
3523
  ac_check_lib_save_LIBS=$LIBS
3524
LIBS="-lz  $LIBS"
3525
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3526
/* end confdefs.h.  */
3527
3528
/* Override any GCC internal prototype to avoid an error.
3529
   Use char because int might match the return type of a GCC
3530
   builtin and then its argument prototype would still apply.  */
3531
#ifdef __cplusplus
3532
extern "C"
3533
#endif
3534
char gzopen ();
3535
int
3536
main ()
3537
{
3538
return gzopen ();
3539
  ;
3540
  return 0;
3541
}
3542
_ACEOF
3543
if ac_fn_c_try_link "$LINENO"; then :
3544
  ac_cv_lib_z_gzopen=yes
3545
else
3546
  ac_cv_lib_z_gzopen=no
3547
fi
3548
rm -f core conftest.err conftest.$ac_objext \
3549
    conftest$ac_exeext conftest.$ac_ext
3550
LIBS=$ac_check_lib_save_LIBS
3551
fi
3552
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzopen" >&5
3553
$as_echo "$ac_cv_lib_z_gzopen" >&6; }
3554
if test "x$ac_cv_lib_z_gzopen" = xyes; then :
3555
  cat >>confdefs.h <<_ACEOF
3556
@%:@define HAVE_LIBZ 1
3557
_ACEOF
3558
3559
  LIBS="-lz $LIBS"
3560
3561
else
3562
  
3563
$as_echo "@%:@define DONT_HAVE_GZ 1" >>confdefs.h
3564
3565
fi
3566
3567
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzReadOpen in -lbz2" >&5
3568
$as_echo_n "checking for BZ2_bzReadOpen in -lbz2... " >&6; }
3569
if ${ac_cv_lib_bz2_BZ2_bzReadOpen+:} false; then :
3570
  $as_echo_n "(cached) " >&6
3571
else
3572
  ac_check_lib_save_LIBS=$LIBS
3573
LIBS="-lbz2  $LIBS"
3574
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3575
/* end confdefs.h.  */
3576
3577
/* Override any GCC internal prototype to avoid an error.
3578
   Use char because int might match the return type of a GCC
3579
   builtin and then its argument prototype would still apply.  */
3580
#ifdef __cplusplus
3581
extern "C"
3582
#endif
3583
char BZ2_bzReadOpen ();
3584
int
3585
main ()
3586
{
3587
return BZ2_bzReadOpen ();
3588
  ;
3589
  return 0;
3590
}
3591
_ACEOF
3592
if ac_fn_c_try_link "$LINENO"; then :
3593
  ac_cv_lib_bz2_BZ2_bzReadOpen=yes
3594
else
3595
  ac_cv_lib_bz2_BZ2_bzReadOpen=no
3596
fi
3597
rm -f core conftest.err conftest.$ac_objext \
3598
    conftest$ac_exeext conftest.$ac_ext
3599
LIBS=$ac_check_lib_save_LIBS
3600
fi
3601
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzReadOpen" >&5
3602
$as_echo "$ac_cv_lib_bz2_BZ2_bzReadOpen" >&6; }
3603
if test "x$ac_cv_lib_bz2_BZ2_bzReadOpen" = xyes; then :
3604
  cat >>confdefs.h <<_ACEOF
3605
@%:@define HAVE_LIBBZ2 1
3606
_ACEOF
3607
3608
  LIBS="-lbz2 $LIBS"
3609
3610
else
3611
  
3612
$as_echo "@%:@define DONT_HAVE_BZ2 1" >>confdefs.h
3613
3614
fi
3615
3616
3617
# Check for inet_ntoa in -lnsl if not found (Solaris)
3618
for ac_func in inet_ntoa
3619
do :
3620
  ac_fn_c_check_func "$LINENO" "inet_ntoa" "ac_cv_func_inet_ntoa"
3621
if test "x$ac_cv_func_inet_ntoa" = xyes; then :
3622
  cat >>confdefs.h <<_ACEOF
3623
@%:@define HAVE_INET_NTOA 1
3624
_ACEOF
3625
 
3626
else
3627
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnsl" >&5
3628
$as_echo_n "checking for inet_ntoa in -lnsl... " >&6; }
3629
if ${ac_cv_lib_nsl_inet_ntoa+:} false; then :
3630
  $as_echo_n "(cached) " >&6
3631
else
3632
  ac_check_lib_save_LIBS=$LIBS
3633
LIBS="-lnsl  $LIBS"
3634
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3635
/* end confdefs.h.  */
3636
3637
/* Override any GCC internal prototype to avoid an error.
3638
   Use char because int might match the return type of a GCC
3639
   builtin and then its argument prototype would still apply.  */
3640
#ifdef __cplusplus
3641
extern "C"
3642
#endif
3643
char inet_ntoa ();
3644
int
3645
main ()
3646
{
3647
return inet_ntoa ();
3648
  ;
3649
  return 0;
3650
}
3651
_ACEOF
3652
if ac_fn_c_try_link "$LINENO"; then :
3653
  ac_cv_lib_nsl_inet_ntoa=yes
3654
else
3655
  ac_cv_lib_nsl_inet_ntoa=no
3656
fi
3657
rm -f core conftest.err conftest.$ac_objext \
3658
    conftest$ac_exeext conftest.$ac_ext
3659
LIBS=$ac_check_lib_save_LIBS
3660
fi
3661
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_ntoa" >&5
3662
$as_echo "$ac_cv_lib_nsl_inet_ntoa" >&6; }
3663
if test "x$ac_cv_lib_nsl_inet_ntoa" = xyes; then :
3664
  cat >>confdefs.h <<_ACEOF
3665
@%:@define HAVE_LIBNSL 1
3666
_ACEOF
3667
3668
  LIBS="-lnsl $LIBS"
3669
3670
else
3671
  as_fn_error 1 "inet_ntoa not found" "$LINENO" 5
3672
fi
3673
3674
fi
3675
done
3676
3677
for ac_func in inet_ntop
3678
do :
3679
  ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
3680
if test "x$ac_cv_func_inet_ntop" = xyes; then :
3681
  cat >>confdefs.h <<_ACEOF
3682
@%:@define HAVE_INET_NTOP 1
3683
_ACEOF
3684
 
3685
else
3686
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lnsl" >&5
3687
$as_echo_n "checking for inet_ntop in -lnsl... " >&6; }
3688
if ${ac_cv_lib_nsl_inet_ntop+:} false; then :
3689
  $as_echo_n "(cached) " >&6
3690
else
3691
  ac_check_lib_save_LIBS=$LIBS
3692
LIBS="-lnsl  $LIBS"
3693
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3694
/* end confdefs.h.  */
3695
3696
/* Override any GCC internal prototype to avoid an error.
3697
   Use char because int might match the return type of a GCC
3698
   builtin and then its argument prototype would still apply.  */
3699
#ifdef __cplusplus
3700
extern "C"
3701
#endif
3702
char inet_ntop ();
3703
int
3704
main ()
3705
{
3706
return inet_ntop ();
3707
  ;
3708
  return 0;
3709
}
3710
_ACEOF
3711
if ac_fn_c_try_link "$LINENO"; then :
3712
  ac_cv_lib_nsl_inet_ntop=yes
3713
else
3714
  ac_cv_lib_nsl_inet_ntop=no
3715
fi
3716
rm -f core conftest.err conftest.$ac_objext \
3717
    conftest$ac_exeext conftest.$ac_ext
3718
LIBS=$ac_check_lib_save_LIBS
3719
fi
3720
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_ntop" >&5
3721
$as_echo "$ac_cv_lib_nsl_inet_ntop" >&6; }
3722
if test "x$ac_cv_lib_nsl_inet_ntop" = xyes; then :
3723
  cat >>confdefs.h <<_ACEOF
3724
@%:@define HAVE_LIBNSL 1
3725
_ACEOF
3726
3727
  LIBS="-lnsl $LIBS"
3728
3729
else
3730
  as_fn_error 1 "inet_ntop not found" "$LINENO" 5
3731
fi
3732
3733
fi
3734
done
3735
3736
3737
case `uname` in
3738
	Darwin*) LDFLAGS="$LDFLAGS -dynamiclib" ;;
3739
	*)       LDFLAGS="$LDFLAGS -shared" ;;
3740
esac
3741
3742
3743
3744
3745
ac_config_files="$ac_config_files bgpdump.spec Makefile"
3746
3747
cat >confcache <<\_ACEOF
3748
# This file is a shell script that caches the results of configure
3749
# tests run on this system so they can be shared between configure
3750
# scripts and configure runs, see configure's option --config-cache.
3751
# It is not useful on other systems.  If it contains results you don't
3752
# want to keep, you may remove or edit it.
3753
#
3754
# config.status only pays attention to the cache file if you give it
3755
# the --recheck option to rerun configure.
3756
#
3757
# `ac_cv_env_foo' variables (set or unset) will be overridden when
3758
# loading this file, other *unset* `ac_cv_foo' will be assigned the
3759
# following values.
3760
3761
_ACEOF
3762
3763
# The following way of writing the cache mishandles newlines in values,
3764
# but we know of no workaround that is simple, portable, and efficient.
3765
# So, we kill variables containing newlines.
3766
# Ultrix sh set writes to stderr and can't be redirected directly,
3767
# and sets the high bit in the cache file unless we assign to the vars.
3768
(
3769
  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
3770
    eval ac_val=\$$ac_var
3771
    case $ac_val in #(
3772
    *${as_nl}*)
3773
      case $ac_var in #(
3774
      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
3775
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
3776
      esac
3777
      case $ac_var in #(
3778
      _ | IFS | as_nl) ;; #(
3779
      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
3780
      *) { eval $ac_var=; unset $ac_var;} ;;
3781
      esac ;;
3782
    esac
3783
  done
3784
3785
  (set) 2>&1 |
3786
    case $as_nl`(ac_space=' '; set) 2>&1` in #(
3787
    *${as_nl}ac_space=\ *)
3788
      # `set' does not quote correctly, so add quotes: double-quote
3789
      # substitution turns \\\\ into \\, and sed turns \\ into \.
3790
      sed -n \
3791
	"s/'/'\\\\''/g;
3792
	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
3793
      ;; #(
3794
    *)
3795
      # `set' quotes correctly as required by POSIX, so do not add quotes.
3796
      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
3797
      ;;
3798
    esac |
3799
    sort
3800
) |
3801
  sed '
3802
     /^ac_cv_env_/b end
3803
     t clear
3804
     :clear
3805
     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
3806
     t end
3807
     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
3808
     :end' >>confcache
3809
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
3810
  if test -w "$cache_file"; then
3811
    if test "x$cache_file" != "x/dev/null"; then
3812
      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
3813
$as_echo "$as_me: updating cache $cache_file" >&6;}
3814
      if test ! -f "$cache_file" || test -h "$cache_file"; then
3815
	cat confcache >"$cache_file"
3816
      else
3817
        case $cache_file in #(
3818
        */* | ?:*)
3819
	  mv -f confcache "$cache_file"$$ &&
3820
	  mv -f "$cache_file"$$ "$cache_file" ;; #(
3821
        *)
3822
	  mv -f confcache "$cache_file" ;;
3823
	esac
3824
      fi
3825
    fi
3826
  else
3827
    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
3828
$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
3829
  fi
3830
fi
3831
rm -f confcache
3832
3833
test "x$prefix" = xNONE && prefix=$ac_default_prefix
3834
# Let make expand exec_prefix.
3835
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
3836
3837
DEFS=-DHAVE_CONFIG_H
3838
3839
ac_libobjs=
3840
ac_ltlibobjs=
3841
U=
3842
for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue
3843
  # 1. Remove the extension, and $U if already installed.
3844
  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
3845
  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
3846
  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
3847
  #    will be set to the directory where LIBOBJS objects are built.
3848
  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
3849
  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
3850
done
3851
LIB@&t@OBJS=$ac_libobjs
3852
3853
LTLIBOBJS=$ac_ltlibobjs
3854
3855
3856
3857
: "${CONFIG_STATUS=./config.status}"
3858
ac_write_fail=0
3859
ac_clean_files_save=$ac_clean_files
3860
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
3861
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
3862
$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
3863
as_write_fail=0
3864
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
3865
#! $SHELL
3866
# Generated by $as_me.
3867
# Run this file to recreate the current configuration.
3868
# Compiler output produced by configure, useful for debugging
3869
# configure, is in config.log if it exists.
3870
3871
debug=false
3872
ac_cs_recheck=false
3873
ac_cs_silent=false
3874
3875
SHELL=\${CONFIG_SHELL-$SHELL}
3876
export SHELL
3877
_ASEOF
3878
cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
3879
## -------------------- ##
3880
## M4sh Initialization. ##
3881
## -------------------- ##
3882
3883
# Be more Bourne compatible
3884
DUALCASE=1; export DUALCASE # for MKS sh
3885
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
3886
  emulate sh
3887
  NULLCMD=:
3888
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
3889
  # is contrary to our usage.  Disable this feature.
3890
  alias -g '${1+"$@"}'='"$@"'
3891
  setopt NO_GLOB_SUBST
3892
else
3893
  case `(set -o) 2>/dev/null` in @%:@(
3894
  *posix*) :
3895
    set -o posix ;; @%:@(
3896
  *) :
3897
     ;;
3898
esac
3899
fi
3900
3901
3902
as_nl='
3903
'
3904
export as_nl
3905
# Printing a long string crashes Solaris 7 /usr/bin/printf.
3906
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
3907
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
3908
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
3909
# Prefer a ksh shell builtin over an external printf program on Solaris,
3910
# but without wasting forks for bash or zsh.
3911
if test -z "$BASH_VERSION$ZSH_VERSION" \
3912
    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
3913
  as_echo='print -r --'
3914
  as_echo_n='print -rn --'
3915
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
3916
  as_echo='printf %s\n'
3917
  as_echo_n='printf %s'
3918
else
3919
  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
3920
    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
3921
    as_echo_n='/usr/ucb/echo -n'
3922
  else
3923
    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
3924
    as_echo_n_body='eval
3925
      arg=$1;
3926
      case $arg in @%:@(
3927
      *"$as_nl"*)
3928
	expr "X$arg" : "X\\(.*\\)$as_nl";
3929
	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
3930
      esac;
3931
      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
3932
    '
3933
    export as_echo_n_body
3934
    as_echo_n='sh -c $as_echo_n_body as_echo'
3935
  fi
3936
  export as_echo_body
3937
  as_echo='sh -c $as_echo_body as_echo'
3938
fi
3939
3940
# The user is always right.
3941
if test "${PATH_SEPARATOR+set}" != set; then
3942
  PATH_SEPARATOR=:
3943
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
3944
    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
3945
      PATH_SEPARATOR=';'
3946
  }
3947
fi
3948
3949
3950
# IFS
3951
# We need space, tab and new line, in precisely that order.  Quoting is
3952
# there to prevent editors from complaining about space-tab.
3953
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
3954
# splitting by setting IFS to empty value.)
3955
IFS=" ""	$as_nl"
3956
3957
# Find who we are.  Look in the path if we contain no directory separator.
3958
as_myself=
3959
case $0 in @%:@((
3960
  *[\\/]* ) as_myself=$0 ;;
3961
  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3962
for as_dir in $PATH
3963
do
3964
  IFS=$as_save_IFS
3965
  test -z "$as_dir" && as_dir=.
3966
    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
3967
  done
3968
IFS=$as_save_IFS
3969
3970
     ;;
3971
esac
3972
# We did not find ourselves, most probably we were run as `sh COMMAND'
3973
# in which case we are not to be found in the path.
3974
if test "x$as_myself" = x; then
3975
  as_myself=$0
3976
fi
3977
if test ! -f "$as_myself"; then
3978
  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
3979
  exit 1
3980
fi
3981
3982
# Unset variables that we do not need and which cause bugs (e.g. in
3983
# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
3984
# suppresses any "Segmentation fault" message there.  '((' could
3985
# trigger a bug in pdksh 5.2.14.
3986
for as_var in BASH_ENV ENV MAIL MAILPATH
3987
do eval test x\${$as_var+set} = xset \
3988
  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
3989
done
3990
PS1='$ '
3991
PS2='> '
3992
PS4='+ '
3993
3994
# NLS nuisances.
3995
LC_ALL=C
3996
export LC_ALL
3997
LANGUAGE=C
3998
export LANGUAGE
3999
4000
# CDPATH.
4001
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4002
4003
4004
@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD]
4005
@%:@ ----------------------------------------
4006
@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are
4007
@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the
4008
@%:@ script with STATUS, using 1 if that was 0.
4009
as_fn_error ()
4010
{
4011
  as_status=$1; test $as_status -eq 0 && as_status=1
4012
  if test "$4"; then
4013
    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
4014
    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
4015
  fi
4016
  $as_echo "$as_me: error: $2" >&2
4017
  as_fn_exit $as_status
4018
} @%:@ as_fn_error
4019
4020
4021
@%:@ as_fn_set_status STATUS
4022
@%:@ -----------------------
4023
@%:@ Set @S|@? to STATUS, without forking.
4024
as_fn_set_status ()
4025
{
4026
  return $1
4027
} @%:@ as_fn_set_status
4028
4029
@%:@ as_fn_exit STATUS
4030
@%:@ -----------------
4031
@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
4032
as_fn_exit ()
4033
{
4034
  set +e
4035
  as_fn_set_status $1
4036
  exit $1
4037
} @%:@ as_fn_exit
4038
4039
@%:@ as_fn_unset VAR
4040
@%:@ ---------------
4041
@%:@ Portably unset VAR.
4042
as_fn_unset ()
4043
{
4044
  { eval $1=; unset $1;}
4045
}
4046
as_unset=as_fn_unset
4047
@%:@ as_fn_append VAR VALUE
4048
@%:@ ----------------------
4049
@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take
4050
@%:@ advantage of any shell optimizations that allow amortized linear growth over
4051
@%:@ repeated appends, instead of the typical quadratic growth present in naive
4052
@%:@ implementations.
4053
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
4054
  eval 'as_fn_append ()
4055
  {
4056
    eval $1+=\$2
4057
  }'
4058
else
4059
  as_fn_append ()
4060
  {
4061
    eval $1=\$$1\$2
4062
  }
4063
fi # as_fn_append
4064
4065
@%:@ as_fn_arith ARG...
4066
@%:@ ------------------
4067
@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the
4068
@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments
4069
@%:@ must be portable across @S|@(()) and expr.
4070
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
4071
  eval 'as_fn_arith ()
4072
  {
4073
    as_val=$(( $* ))
4074
  }'
4075
else
4076
  as_fn_arith ()
4077
  {
4078
    as_val=`expr "$@" || test $? -eq 1`
4079
  }
4080
fi # as_fn_arith
4081
4082
4083
if expr a : '\(a\)' >/dev/null 2>&1 &&
4084
   test "X`expr 00001 : '.*\(...\)'`" = X001; then
4085
  as_expr=expr
4086
else
4087
  as_expr=false
4088
fi
4089
4090
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
4091
  as_basename=basename
4092
else
4093
  as_basename=false
4094
fi
4095
4096
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
4097
  as_dirname=dirname
4098
else
4099
  as_dirname=false
4100
fi
4101
4102
as_me=`$as_basename -- "$0" ||
4103
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
4104
	 X"$0" : 'X\(//\)$' \| \
4105
	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
4106
$as_echo X/"$0" |
4107
    sed '/^.*\/\([^/][^/]*\)\/*$/{
4108
	    s//\1/
4109
	    q
4110
	  }
4111
	  /^X\/\(\/\/\)$/{
4112
	    s//\1/
4113
	    q
4114
	  }
4115
	  /^X\/\(\/\).*/{
4116
	    s//\1/
4117
	    q
4118
	  }
4119
	  s/.*/./; q'`
4120
4121
# Avoid depending upon Character Ranges.
4122
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
4123
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
4124
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
4125
as_cr_digits='0123456789'
4126
as_cr_alnum=$as_cr_Letters$as_cr_digits
4127
4128
ECHO_C= ECHO_N= ECHO_T=
4129
case `echo -n x` in @%:@(((((
4130
-n*)
4131
  case `echo 'xy\c'` in
4132
  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
4133
  xy)  ECHO_C='\c';;
4134
  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
4135
       ECHO_T='	';;
4136
  esac;;
4137
*)
4138
  ECHO_N='-n';;
4139
esac
4140
4141
rm -f conf$$ conf$$.exe conf$$.file
4142
if test -d conf$$.dir; then
4143
  rm -f conf$$.dir/conf$$.file
4144
else
4145
  rm -f conf$$.dir
4146
  mkdir conf$$.dir 2>/dev/null
4147
fi
4148
if (echo >conf$$.file) 2>/dev/null; then
4149
  if ln -s conf$$.file conf$$ 2>/dev/null; then
4150
    as_ln_s='ln -s'
4151
    # ... but there are two gotchas:
4152
    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
4153
    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
4154
    # In both cases, we have to default to `cp -pR'.
4155
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
4156
      as_ln_s='cp -pR'
4157
  elif ln conf$$.file conf$$ 2>/dev/null; then
4158
    as_ln_s=ln
4159
  else
4160
    as_ln_s='cp -pR'
4161
  fi
4162
else
4163
  as_ln_s='cp -pR'
4164
fi
4165
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
4166
rmdir conf$$.dir 2>/dev/null
4167
4168
4169
@%:@ as_fn_mkdir_p
4170
@%:@ -------------
4171
@%:@ Create "@S|@as_dir" as a directory, including parents if necessary.
4172
as_fn_mkdir_p ()
4173
{
4174
4175
  case $as_dir in #(
4176
  -*) as_dir=./$as_dir;;
4177
  esac
4178
  test -d "$as_dir" || eval $as_mkdir_p || {
4179
    as_dirs=
4180
    while :; do
4181
      case $as_dir in #(
4182
      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
4183
      *) as_qdir=$as_dir;;
4184
      esac
4185
      as_dirs="'$as_qdir' $as_dirs"
4186
      as_dir=`$as_dirname -- "$as_dir" ||
4187
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
4188
	 X"$as_dir" : 'X\(//\)[^/]' \| \
4189
	 X"$as_dir" : 'X\(//\)$' \| \
4190
	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
4191
$as_echo X"$as_dir" |
4192
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
4193
	    s//\1/
4194
	    q
4195
	  }
4196
	  /^X\(\/\/\)[^/].*/{
4197
	    s//\1/
4198
	    q
4199
	  }
4200
	  /^X\(\/\/\)$/{
4201
	    s//\1/
4202
	    q
4203
	  }
4204
	  /^X\(\/\).*/{
4205
	    s//\1/
4206
	    q
4207
	  }
4208
	  s/.*/./; q'`
4209
      test -d "$as_dir" && break
4210
    done
4211
    test -z "$as_dirs" || eval "mkdir $as_dirs"
4212
  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
4213
4214
4215
} @%:@ as_fn_mkdir_p
4216
if mkdir -p . 2>/dev/null; then
4217
  as_mkdir_p='mkdir -p "$as_dir"'
4218
else
4219
  test -d ./-p && rmdir ./-p
4220
  as_mkdir_p=false
4221
fi
4222
4223
4224
@%:@ as_fn_executable_p FILE
4225
@%:@ -----------------------
4226
@%:@ Test if FILE is an executable regular file.
4227
as_fn_executable_p ()
4228
{
4229
  test -f "$1" && test -x "$1"
4230
} @%:@ as_fn_executable_p
4231
as_test_x='test -x'
4232
as_executable_p=as_fn_executable_p
4233
4234
# Sed expression to map a string onto a valid CPP name.
4235
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
4236
4237
# Sed expression to map a string onto a valid variable name.
4238
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
4239
4240
4241
exec 6>&1
4242
## ----------------------------------- ##
4243
## Main body of $CONFIG_STATUS script. ##
4244
## ----------------------------------- ##
4245
_ASEOF
4246
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
4247
4248
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4249
# Save the log message, to keep $0 and so on meaningful, and to
4250
# report actual input values of CONFIG_FILES etc. instead of their
4251
# values after options handling.
4252
ac_log="
4253
This file was extended by libbgpdump $as_me 1.4.99.15, which was
4254
generated by GNU Autoconf 2.69.  Invocation command line was
4255
4256
  CONFIG_FILES    = $CONFIG_FILES
4257
  CONFIG_HEADERS  = $CONFIG_HEADERS
4258
  CONFIG_LINKS    = $CONFIG_LINKS
4259
  CONFIG_COMMANDS = $CONFIG_COMMANDS
4260
  $ $0 $@
4261
4262
on `(hostname || uname -n) 2>/dev/null | sed 1q`
4263
"
4264
4265
_ACEOF
4266
4267
case $ac_config_files in *"
4268
"*) set x $ac_config_files; shift; ac_config_files=$*;;
4269
esac
4270
4271
case $ac_config_headers in *"
4272
"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
4273
esac
4274
4275
4276
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4277
# Files that config.status was made for.
4278
config_files="$ac_config_files"
4279
config_headers="$ac_config_headers"
4280
4281
_ACEOF
4282
4283
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4284
ac_cs_usage="\
4285
\`$as_me' instantiates files and other configuration actions
4286
from templates according to the current configuration.  Unless the files
4287
and actions are specified as TAGs, all are instantiated by default.
4288
4289
Usage: $0 [OPTION]... [TAG]...
4290
4291
  -h, --help       print this help, then exit
4292
  -V, --version    print version number and configuration settings, then exit
4293
      --config     print configuration, then exit
4294
  -q, --quiet, --silent
4295
                   do not print progress messages
4296
  -d, --debug      don't remove temporary files
4297
      --recheck    update $as_me by reconfiguring in the same conditions
4298
      --file=FILE[:TEMPLATE] 
4299
                   instantiate the configuration file FILE
4300
      --header=FILE[:TEMPLATE] 
4301
                   instantiate the configuration header FILE
4302
4303
Configuration files:
4304
$config_files
4305
4306
Configuration headers:
4307
$config_headers
4308
4309
Report bugs to <ris@ripe.net>."
4310
4311
_ACEOF
4312
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4313
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
4314
ac_cs_version="\\
4315
libbgpdump config.status 1.4.99.15
4316
configured by $0, generated by GNU Autoconf 2.69,
4317
  with options \\"\$ac_cs_config\\"
4318
4319
Copyright (C) 2012 Free Software Foundation, Inc.
4320
This config.status script is free software; the Free Software Foundation
4321
gives unlimited permission to copy, distribute and modify it."
4322
4323
ac_pwd='$ac_pwd'
4324
srcdir='$srcdir'
4325
test -n "\$AWK" || AWK=awk
4326
_ACEOF
4327
4328
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4329
# The default lists apply if the user does not specify any file.
4330
ac_need_defaults=:
4331
while test $# != 0
4332
do
4333
  case $1 in
4334
  --*=?*)
4335
    ac_option=`expr "X$1" : 'X\([^=]*\)='`
4336
    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
4337
    ac_shift=:
4338
    ;;
4339
  --*=)
4340
    ac_option=`expr "X$1" : 'X\([^=]*\)='`
4341
    ac_optarg=
4342
    ac_shift=:
4343
    ;;
4344
  *)
4345
    ac_option=$1
4346
    ac_optarg=$2
4347
    ac_shift=shift
4348
    ;;
4349
  esac
4350
4351
  case $ac_option in
4352
  # Handling of the options.
4353
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
4354
    ac_cs_recheck=: ;;
4355
  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
4356
    $as_echo "$ac_cs_version"; exit ;;
4357
  --config | --confi | --conf | --con | --co | --c )
4358
    $as_echo "$ac_cs_config"; exit ;;
4359
  --debug | --debu | --deb | --de | --d | -d )
4360
    debug=: ;;
4361
  --file | --fil | --fi | --f )
4362
    $ac_shift
4363
    case $ac_optarg in
4364
    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
4365
    '') as_fn_error $? "missing file argument" ;;
4366
    esac
4367
    as_fn_append CONFIG_FILES " '$ac_optarg'"
4368
    ac_need_defaults=false;;
4369
  --header | --heade | --head | --hea )
4370
    $ac_shift
4371
    case $ac_optarg in
4372
    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
4373
    esac
4374
    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
4375
    ac_need_defaults=false;;
4376
  --he | --h)
4377
    # Conflict between --help and --header
4378
    as_fn_error $? "ambiguous option: \`$1'
4379
Try \`$0 --help' for more information.";;
4380
  --help | --hel | -h )
4381
    $as_echo "$ac_cs_usage"; exit ;;
4382
  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
4383
  | -silent | --silent | --silen | --sile | --sil | --si | --s)
4384
    ac_cs_silent=: ;;
4385
4386
  # This is an error.
4387
  -*) as_fn_error $? "unrecognized option: \`$1'
4388
Try \`$0 --help' for more information." ;;
4389
4390
  *) as_fn_append ac_config_targets " $1"
4391
     ac_need_defaults=false ;;
4392
4393
  esac
4394
  shift
4395
done
4396
4397
ac_configure_extra_args=
4398
4399
if $ac_cs_silent; then
4400
  exec 6>/dev/null
4401
  ac_configure_extra_args="$ac_configure_extra_args --silent"
4402
fi
4403
4404
_ACEOF
4405
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4406
if \$ac_cs_recheck; then
4407
  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
4408
  shift
4409
  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
4410
  CONFIG_SHELL='$SHELL'
4411
  export CONFIG_SHELL
4412
  exec "\$@"
4413
fi
4414
4415
_ACEOF
4416
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4417
exec 5>>config.log
4418
{
4419
  echo
4420
  sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX
4421
@%:@@%:@ Running $as_me. @%:@@%:@
4422
_ASBOX
4423
  $as_echo "$ac_log"
4424
} >&5
4425
4426
_ACEOF
4427
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4428
_ACEOF
4429
4430
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4431
4432
# Handling of arguments.
4433
for ac_config_target in $ac_config_targets
4434
do
4435
  case $ac_config_target in
4436
    "bgpdump-config.h") CONFIG_HEADERS="$CONFIG_HEADERS bgpdump-config.h" ;;
4437
    "bgpdump.spec") CONFIG_FILES="$CONFIG_FILES bgpdump.spec" ;;
4438
    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
4439
4440
  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
4441
  esac
4442
done
4443
4444
4445
# If the user did not use the arguments to specify the items to instantiate,
4446
# then the envvar interface is used.  Set only those that are not.
4447
# We use the long form for the default assignment because of an extremely
4448
# bizarre bug on SunOS 4.1.3.
4449
if $ac_need_defaults; then
4450
  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
4451
  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
4452
fi
4453
4454
# Have a temporary directory for convenience.  Make it in the build tree
4455
# simply because there is no reason against having it here, and in addition,
4456
# creating and moving files from /tmp can sometimes cause problems.
4457
# Hook for its removal unless debugging.
4458
# Note that there is a small window in which the directory will not be cleaned:
4459
# after its creation but before its name has been assigned to `$tmp'.
4460
$debug ||
4461
{
4462
  tmp= ac_tmp=
4463
  trap 'exit_status=$?
4464
  : "${ac_tmp:=$tmp}"
4465
  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
4466
' 0
4467
  trap 'as_fn_exit 1' 1 2 13 15
4468
}
4469
# Create a (secure) tmp directory for tmp files.
4470
4471
{
4472
  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
4473
  test -d "$tmp"
4474
}  ||
4475
{
4476
  tmp=./conf$$-$RANDOM
4477
  (umask 077 && mkdir "$tmp")
4478
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
4479
ac_tmp=$tmp
4480
4481
# Set up the scripts for CONFIG_FILES section.
4482
# No need to generate them if there are no CONFIG_FILES.
4483
# This happens for instance with `./config.status config.h'.
4484
if test -n "$CONFIG_FILES"; then
4485
4486
4487
ac_cr=`echo X | tr X '\015'`
4488
# On cygwin, bash can eat \r inside `` if the user requested igncr.
4489
# But we know of no other shell where ac_cr would be empty at this
4490
# point, so we can use a bashism as a fallback.
4491
if test "x$ac_cr" = x; then
4492
  eval ac_cr=\$\'\\r\'
4493
fi
4494
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
4495
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
4496
  ac_cs_awk_cr='\\r'
4497
else
4498
  ac_cs_awk_cr=$ac_cr
4499
fi
4500
4501
echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
4502
_ACEOF
4503
4504
4505
{
4506
  echo "cat >conf$$subs.awk <<_ACEOF" &&
4507
  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
4508
  echo "_ACEOF"
4509
} >conf$$subs.sh ||
4510
  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
4511
ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
4512
ac_delim='%!_!# '
4513
for ac_last_try in false false false false false :; do
4514
  . ./conf$$subs.sh ||
4515
    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
4516
4517
  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
4518
  if test $ac_delim_n = $ac_delim_num; then
4519
    break
4520
  elif $ac_last_try; then
4521
    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
4522
  else
4523
    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
4524
  fi
4525
done
4526
rm -f conf$$subs.sh
4527
4528
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4529
cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
4530
_ACEOF
4531
sed -n '
4532
h
4533
s/^/S["/; s/!.*/"]=/
4534
p
4535
g
4536
s/^[^!]*!//
4537
:repl
4538
t repl
4539
s/'"$ac_delim"'$//
4540
t delim
4541
:nl
4542
h
4543
s/\(.\{148\}\)..*/\1/
4544
t more1
4545
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
4546
p
4547
n
4548
b repl
4549
:more1
4550
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
4551
p
4552
g
4553
s/.\{148\}//
4554
t nl
4555
:delim
4556
h
4557
s/\(.\{148\}\)..*/\1/
4558
t more2
4559
s/["\\]/\\&/g; s/^/"/; s/$/"/
4560
p
4561
b
4562
:more2
4563
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
4564
p
4565
g
4566
s/.\{148\}//
4567
t delim
4568
' <conf$$subs.awk | sed '
4569
/^[^""]/{
4570
  N
4571
  s/\n//
4572
}
4573
' >>$CONFIG_STATUS || ac_write_fail=1
4574
rm -f conf$$subs.awk
4575
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4576
_ACAWK
4577
cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
4578
  for (key in S) S_is_set[key] = 1
4579
  FS = ""
4580
4581
}
4582
{
4583
  line = $ 0
4584
  nfields = split(line, field, "@")
4585
  substed = 0
4586
  len = length(field[1])
4587
  for (i = 2; i < nfields; i++) {
4588
    key = field[i]
4589
    keylen = length(key)
4590
    if (S_is_set[key]) {
4591
      value = S[key]
4592
      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
4593
      len += length(value) + length(field[++i])
4594
      substed = 1
4595
    } else
4596
      len += 1 + keylen
4597
  }
4598
4599
  print line
4600
}
4601
4602
_ACAWK
4603
_ACEOF
4604
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4605
if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
4606
  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
4607
else
4608
  cat
4609
fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
4610
  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
4611
_ACEOF
4612
4613
# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
4614
# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
4615
# trailing colons and then remove the whole line if VPATH becomes empty
4616
# (actually we leave an empty line to preserve line numbers).
4617
if test "x$srcdir" = x.; then
4618
  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
4619
h
4620
s///
4621
s/^/:/
4622
s/[	 ]*$/:/
4623
s/:\$(srcdir):/:/g
4624
s/:\${srcdir}:/:/g
4625
s/:@srcdir@:/:/g
4626
s/^:*//
4627
s/:*$//
4628
x
4629
s/\(=[	 ]*\).*/\1/
4630
G
4631
s/\n//
4632
s/^[^=]*=[	 ]*$//
4633
}'
4634
fi
4635
4636
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4637
fi # test -n "$CONFIG_FILES"
4638
4639
# Set up the scripts for CONFIG_HEADERS section.
4640
# No need to generate them if there are no CONFIG_HEADERS.
4641
# This happens for instance with `./config.status Makefile'.
4642
if test -n "$CONFIG_HEADERS"; then
4643
cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
4644
BEGIN {
4645
_ACEOF
4646
4647
# Transform confdefs.h into an awk script `defines.awk', embedded as
4648
# here-document in config.status, that substitutes the proper values into
4649
# config.h.in to produce config.h.
4650
4651
# Create a delimiter string that does not exist in confdefs.h, to ease
4652
# handling of long lines.
4653
ac_delim='%!_!# '
4654
for ac_last_try in false false :; do
4655
  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
4656
  if test -z "$ac_tt"; then
4657
    break
4658
  elif $ac_last_try; then
4659
    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
4660
  else
4661
    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
4662
  fi
4663
done
4664
4665
# For the awk script, D is an array of macro values keyed by name,
4666
# likewise P contains macro parameters if any.  Preserve backslash
4667
# newline sequences.
4668
4669
ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
4670
sed -n '
4671
s/.\{148\}/&'"$ac_delim"'/g
4672
t rset
4673
:rset
4674
s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
4675
t def
4676
d
4677
:def
4678
s/\\$//
4679
t bsnl
4680
s/["\\]/\\&/g
4681
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
4682
D["\1"]=" \3"/p
4683
s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
4684
d
4685
:bsnl
4686
s/["\\]/\\&/g
4687
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
4688
D["\1"]=" \3\\\\\\n"\\/p
4689
t cont
4690
s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
4691
t cont
4692
d
4693
:cont
4694
n
4695
s/.\{148\}/&'"$ac_delim"'/g
4696
t clear
4697
:clear
4698
s/\\$//
4699
t bsnlc
4700
s/["\\]/\\&/g; s/^/"/; s/$/"/p
4701
d
4702
:bsnlc
4703
s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
4704
b cont
4705
' <confdefs.h | sed '
4706
s/'"$ac_delim"'/"\\\
4707
"/g' >>$CONFIG_STATUS || ac_write_fail=1
4708
4709
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4710
  for (key in D) D_is_set[key] = 1
4711
  FS = ""
4712
}
4713
/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
4714
  line = \$ 0
4715
  split(line, arg, " ")
4716
  if (arg[1] == "#") {
4717
    defundef = arg[2]
4718
    mac1 = arg[3]
4719
  } else {
4720
    defundef = substr(arg[1], 2)
4721
    mac1 = arg[2]
4722
  }
4723
  split(mac1, mac2, "(") #)
4724
  macro = mac2[1]
4725
  prefix = substr(line, 1, index(line, defundef) - 1)
4726
  if (D_is_set[macro]) {
4727
    # Preserve the white space surrounding the "#".
4728
    print prefix "define", macro P[macro] D[macro]
4729
    next
4730
  } else {
4731
    # Replace #undef with comments.  This is necessary, for example,
4732
    # in the case of _POSIX_SOURCE, which is predefined and required
4733
    # on some systems where configure will not decide to define it.
4734
    if (defundef == "undef") {
4735
      print "/*", prefix defundef, macro, "*/"
4736
      next
4737
    }
4738
  }
4739
}
4740
{ print }
4741
_ACAWK
4742
_ACEOF
4743
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4744
  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
4745
fi # test -n "$CONFIG_HEADERS"
4746
4747
4748
eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    "
4749
shift
4750
for ac_tag
4751
do
4752
  case $ac_tag in
4753
  :[FHLC]) ac_mode=$ac_tag; continue;;
4754
  esac
4755
  case $ac_mode$ac_tag in
4756
  :[FHL]*:*);;
4757
  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
4758
  :[FH]-) ac_tag=-:-;;
4759
  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
4760
  esac
4761
  ac_save_IFS=$IFS
4762
  IFS=:
4763
  set x $ac_tag
4764
  IFS=$ac_save_IFS
4765
  shift
4766
  ac_file=$1
4767
  shift
4768
4769
  case $ac_mode in
4770
  :L) ac_source=$1;;
4771
  :[FH])
4772
    ac_file_inputs=
4773
    for ac_f
4774
    do
4775
      case $ac_f in
4776
      -) ac_f="$ac_tmp/stdin";;
4777
      *) # Look for the file first in the build tree, then in the source tree
4778
	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
4779
	 # because $ac_f cannot contain `:'.
4780
	 test -f "$ac_f" ||
4781
	   case $ac_f in
4782
	   [\\/$]*) false;;
4783
	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
4784
	   esac ||
4785
	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
4786
      esac
4787
      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
4788
      as_fn_append ac_file_inputs " '$ac_f'"
4789
    done
4790
4791
    # Let's still pretend it is `configure' which instantiates (i.e., don't
4792
    # use $as_me), people would be surprised to read:
4793
    #    /* config.h.  Generated by config.status.  */
4794
    configure_input='Generated from '`
4795
	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
4796
	`' by configure.'
4797
    if test x"$ac_file" != x-; then
4798
      configure_input="$ac_file.  $configure_input"
4799
      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
4800
$as_echo "$as_me: creating $ac_file" >&6;}
4801
    fi
4802
    # Neutralize special characters interpreted by sed in replacement strings.
4803
    case $configure_input in #(
4804
    *\&* | *\|* | *\\* )
4805
       ac_sed_conf_input=`$as_echo "$configure_input" |
4806
       sed 's/[\\\\&|]/\\\\&/g'`;; #(
4807
    *) ac_sed_conf_input=$configure_input;;
4808
    esac
4809
4810
    case $ac_tag in
4811
    *:-:* | *:-) cat >"$ac_tmp/stdin" \
4812
      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
4813
    esac
4814
    ;;
4815
  esac
4816
4817
  ac_dir=`$as_dirname -- "$ac_file" ||
4818
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
4819
	 X"$ac_file" : 'X\(//\)[^/]' \| \
4820
	 X"$ac_file" : 'X\(//\)$' \| \
4821
	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
4822
$as_echo X"$ac_file" |
4823
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
4824
	    s//\1/
4825
	    q
4826
	  }
4827
	  /^X\(\/\/\)[^/].*/{
4828
	    s//\1/
4829
	    q
4830
	  }
4831
	  /^X\(\/\/\)$/{
4832
	    s//\1/
4833
	    q
4834
	  }
4835
	  /^X\(\/\).*/{
4836
	    s//\1/
4837
	    q
4838
	  }
4839
	  s/.*/./; q'`
4840
  as_dir="$ac_dir"; as_fn_mkdir_p
4841
  ac_builddir=.
4842
4843
case "$ac_dir" in
4844
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
4845
*)
4846
  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
4847
  # A ".." for each directory in $ac_dir_suffix.
4848
  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
4849
  case $ac_top_builddir_sub in
4850
  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
4851
  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
4852
  esac ;;
4853
esac
4854
ac_abs_top_builddir=$ac_pwd
4855
ac_abs_builddir=$ac_pwd$ac_dir_suffix
4856
# for backward compatibility:
4857
ac_top_builddir=$ac_top_build_prefix
4858
4859
case $srcdir in
4860
  .)  # We are building in place.
4861
    ac_srcdir=.
4862
    ac_top_srcdir=$ac_top_builddir_sub
4863
    ac_abs_top_srcdir=$ac_pwd ;;
4864
  [\\/]* | ?:[\\/]* )  # Absolute name.
4865
    ac_srcdir=$srcdir$ac_dir_suffix;
4866
    ac_top_srcdir=$srcdir
4867
    ac_abs_top_srcdir=$srcdir ;;
4868
  *) # Relative name.
4869
    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
4870
    ac_top_srcdir=$ac_top_build_prefix$srcdir
4871
    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
4872
esac
4873
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
4874
4875
4876
  case $ac_mode in
4877
  :F)
4878
  #
4879
  # CONFIG_FILE
4880
  #
4881
4882
_ACEOF
4883
4884
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4885
# If the template does not know about datarootdir, expand it.
4886
# FIXME: This hack should be removed a few years after 2.60.
4887
ac_datarootdir_hack=; ac_datarootdir_seen=
4888
ac_sed_dataroot='
4889
/datarootdir/ {
4890
  p
4891
  q
4892
}
4893
/@datadir@/p
4894
/@docdir@/p
4895
/@infodir@/p
4896
/@localedir@/p
4897
/@mandir@/p'
4898
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
4899
*datarootdir*) ac_datarootdir_seen=yes;;
4900
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
4901
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
4902
$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
4903
_ACEOF
4904
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4905
  ac_datarootdir_hack='
4906
  s&@datadir@&$datadir&g
4907
  s&@docdir@&$docdir&g
4908
  s&@infodir@&$infodir&g
4909
  s&@localedir@&$localedir&g
4910
  s&@mandir@&$mandir&g
4911
  s&\\\${datarootdir}&$datarootdir&g' ;;
4912
esac
4913
_ACEOF
4914
4915
# Neutralize VPATH when `$srcdir' = `.'.
4916
# Shell code in configure.ac might set extrasub.
4917
# FIXME: do we really want to maintain this feature?
4918
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4919
ac_sed_extra="$ac_vpsub
4920
$extrasub
4921
_ACEOF
4922
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4923
:t
4924
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
4925
s|@configure_input@|$ac_sed_conf_input|;t t
4926
s&@top_builddir@&$ac_top_builddir_sub&;t t
4927
s&@top_build_prefix@&$ac_top_build_prefix&;t t
4928
s&@srcdir@&$ac_srcdir&;t t
4929
s&@abs_srcdir@&$ac_abs_srcdir&;t t
4930
s&@top_srcdir@&$ac_top_srcdir&;t t
4931
s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
4932
s&@builddir@&$ac_builddir&;t t
4933
s&@abs_builddir@&$ac_abs_builddir&;t t
4934
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
4935
$ac_datarootdir_hack
4936
"
4937
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
4938
  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
4939
4940
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
4941
  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
4942
  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
4943
      "$ac_tmp/out"`; test -z "$ac_out"; } &&
4944
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
4945
which seems to be undefined.  Please make sure it is defined" >&5
4946
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
4947
which seems to be undefined.  Please make sure it is defined" >&2;}
4948
4949
  rm -f "$ac_tmp/stdin"
4950
  case $ac_file in
4951
  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
4952
  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
4953
  esac \
4954
  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
4955
 ;;
4956
  :H)
4957
  #
4958
  # CONFIG_HEADER
4959
  #
4960
  if test x"$ac_file" != x-; then
4961
    {
4962
      $as_echo "/* $configure_input  */" \
4963
      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
4964
    } >"$ac_tmp/config.h" \
4965
      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
4966
    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
4967
      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
4968
$as_echo "$as_me: $ac_file is unchanged" >&6;}
4969
    else
4970
      rm -f "$ac_file"
4971
      mv "$ac_tmp/config.h" "$ac_file" \
4972
	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
4973
    fi
4974
  else
4975
    $as_echo "/* $configure_input  */" \
4976
      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
4977
      || as_fn_error $? "could not create -" "$LINENO" 5
4978
  fi
4979
 ;;
4980
  
4981
  
4982
  esac
4983
4984
done # for ac_tag
4985
4986
4987
as_fn_exit 0
4988
_ACEOF
4989
ac_clean_files=$ac_clean_files_save
4990
4991
test $ac_write_fail = 0 ||
4992
  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
4993
4994
4995
# configure is writing to config.log, and then calls config.status.
4996
# config.status does its own redirection, appending to config.log.
4997
# Unfortunately, on DOS this fails, as config.log is still kept open
4998
# by configure, so config.status won't be able to write to it; its
4999
# output is simply discarded.  So we exec the FD to /dev/null,
5000
# effectively closing config.log, so it can be properly (re)opened and
5001
# appended to by config.status.  When coming back to configure, we
5002
# need to make the FD available again.
5003
if test "$no_create" != yes; then
5004
  ac_cs_success=:
5005
  ac_config_status_args=
5006
  test "$silent" = yes &&
5007
    ac_config_status_args="$ac_config_status_args --quiet"
5008
  exec 5>/dev/null
5009
  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
5010
  exec 5>>config.log
5011
  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
5012
  # would make configure fail if this is the last instruction.
5013
  $ac_cs_success || as_fn_exit 1
5014
fi
5015
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
5016
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
5017
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
5018
fi
5019
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/autom4te.cache/requests (+77 lines)
Line 0 Link Here
1
# This file was generated.
2
# It contains the lists of macros which have been traced.
3
# It can be safely removed.
4
5
@request = (
6
             bless( [
7
                      '0',
8
                      1,
9
                      [
10
                        '/usr/local/Cellar/autoconf/2.69/share/autoconf'
11
                      ],
12
                      [
13
                        '/usr/local/Cellar/autoconf/2.69/share/autoconf/autoconf/autoconf.m4f',
14
                        'configure.in'
15
                      ],
16
                      {
17
                        'AC_FC_FREEFORM' => 1,
18
                        'AC_PROG_LIBTOOL' => 1,
19
                        'AC_LIBSOURCE' => 1,
20
                        'AC_CONFIG_LIBOBJ_DIR' => 1,
21
                        'AM_PROG_MOC' => 1,
22
                        '_LT_AC_TAGCONFIG' => 1,
23
                        '_AM_COND_ENDIF' => 1,
24
                        'AC_CONFIG_LINKS' => 1,
25
                        'AM_ENABLE_MULTILIB' => 1,
26
                        'LT_SUPPORTED_TAG' => 1,
27
                        'AM_GNU_GETTEXT' => 1,
28
                        'AM_INIT_AUTOMAKE' => 1,
29
                        'LT_INIT' => 1,
30
                        'AC_CONFIG_AUX_DIR' => 1,
31
                        'AH_OUTPUT' => 1,
32
                        'AM_PROG_F77_C_O' => 1,
33
                        'AC_DEFINE_TRACE_LITERAL' => 1,
34
                        'AC_FC_PP_DEFINE' => 1,
35
                        'AM_PROG_CC_C_O' => 1,
36
                        'AM_PROG_FC_C_O' => 1,
37
                        'AM_POT_TOOLS' => 1,
38
                        'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
39
                        'AM_NLS' => 1,
40
                        'AM_CONDITIONAL' => 1,
41
                        'AC_REQUIRE_AUX_FILE' => 1,
42
                        'AM_SILENT_RULES' => 1,
43
                        '_AM_SUBST_NOTMAKE' => 1,
44
                        '_AM_MAKEFILE_INCLUDE' => 1,
45
                        'LT_CONFIG_LTDL_DIR' => 1,
46
                        'AC_FC_SRCEXT' => 1,
47
                        'AM_MAKEFILE_INCLUDE' => 1,
48
                        'm4_pattern_forbid' => 1,
49
                        'AM_PROG_AR' => 1,
50
                        'AC_SUBST_TRACE' => 1,
51
                        'm4_sinclude' => 1,
52
                        'AM_XGETTEXT_OPTION' => 1,
53
                        'sinclude' => 1,
54
                        '_m4_warn' => 1,
55
                        'AC_SUBST' => 1,
56
                        'AM_PATH_GUILE' => 1,
57
                        'AC_CONFIG_HEADERS' => 1,
58
                        'AM_AUTOMAKE_VERSION' => 1,
59
                        'AC_CANONICAL_HOST' => 1,
60
                        'AC_CANONICAL_SYSTEM' => 1,
61
                        '_AM_COND_IF' => 1,
62
                        'AC_CONFIG_FILES' => 1,
63
                        'AC_CONFIG_SUBDIRS' => 1,
64
                        'm4_pattern_allow' => 1,
65
                        'include' => 1,
66
                        'AC_CANONICAL_TARGET' => 1,
67
                        'AC_CANONICAL_BUILD' => 1,
68
                        'AM_MAINTAINER_MODE' => 1,
69
                        'AC_FC_PP_SRCEXT' => 1,
70
                        '_AM_COND_ELSE' => 1,
71
                        'AM_PROG_CXX_C_O' => 1,
72
                        'm4_include' => 1,
73
                        'AC_INIT' => 1
74
                      }
75
                    ], 'Autom4te::Request' )
76
           );
77
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/autom4te.cache/traces.0 (+307 lines)
Line 0 Link Here
1
m4trace:configure.in:4: -1- AC_INIT([libbgpdump], [1.4.99.15], [ris@ripe.net])
2
m4trace:configure.in:4: -1- m4_pattern_forbid([^_?A[CHUM]_])
3
m4trace:configure.in:4: -1- m4_pattern_forbid([_AC_])
4
m4trace:configure.in:4: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
5
m4trace:configure.in:4: -1- m4_pattern_allow([^AS_FLAGS$])
6
m4trace:configure.in:4: -1- m4_pattern_forbid([^_?m4_])
7
m4trace:configure.in:4: -1- m4_pattern_forbid([^dnl$])
8
m4trace:configure.in:4: -1- m4_pattern_forbid([^_?AS_])
9
m4trace:configure.in:4: -1- AC_SUBST([SHELL])
10
m4trace:configure.in:4: -1- AC_SUBST_TRACE([SHELL])
11
m4trace:configure.in:4: -1- m4_pattern_allow([^SHELL$])
12
m4trace:configure.in:4: -1- AC_SUBST([PATH_SEPARATOR])
13
m4trace:configure.in:4: -1- AC_SUBST_TRACE([PATH_SEPARATOR])
14
m4trace:configure.in:4: -1- m4_pattern_allow([^PATH_SEPARATOR$])
15
m4trace:configure.in:4: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME],      ['AC_PACKAGE_NAME'])])
16
m4trace:configure.in:4: -1- AC_SUBST_TRACE([PACKAGE_NAME])
17
m4trace:configure.in:4: -1- m4_pattern_allow([^PACKAGE_NAME$])
18
m4trace:configure.in:4: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME],   ['AC_PACKAGE_TARNAME'])])
19
m4trace:configure.in:4: -1- AC_SUBST_TRACE([PACKAGE_TARNAME])
20
m4trace:configure.in:4: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
21
m4trace:configure.in:4: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION],   ['AC_PACKAGE_VERSION'])])
22
m4trace:configure.in:4: -1- AC_SUBST_TRACE([PACKAGE_VERSION])
23
m4trace:configure.in:4: -1- m4_pattern_allow([^PACKAGE_VERSION$])
24
m4trace:configure.in:4: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING],    ['AC_PACKAGE_STRING'])])
25
m4trace:configure.in:4: -1- AC_SUBST_TRACE([PACKAGE_STRING])
26
m4trace:configure.in:4: -1- m4_pattern_allow([^PACKAGE_STRING$])
27
m4trace:configure.in:4: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
28
m4trace:configure.in:4: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT])
29
m4trace:configure.in:4: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
30
m4trace:configure.in:4: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL],       ['AC_PACKAGE_URL'])])
31
m4trace:configure.in:4: -1- AC_SUBST_TRACE([PACKAGE_URL])
32
m4trace:configure.in:4: -1- m4_pattern_allow([^PACKAGE_URL$])
33
m4trace:configure.in:4: -1- AC_SUBST([exec_prefix], [NONE])
34
m4trace:configure.in:4: -1- AC_SUBST_TRACE([exec_prefix])
35
m4trace:configure.in:4: -1- m4_pattern_allow([^exec_prefix$])
36
m4trace:configure.in:4: -1- AC_SUBST([prefix], [NONE])
37
m4trace:configure.in:4: -1- AC_SUBST_TRACE([prefix])
38
m4trace:configure.in:4: -1- m4_pattern_allow([^prefix$])
39
m4trace:configure.in:4: -1- AC_SUBST([program_transform_name], [s,x,x,])
40
m4trace:configure.in:4: -1- AC_SUBST_TRACE([program_transform_name])
41
m4trace:configure.in:4: -1- m4_pattern_allow([^program_transform_name$])
42
m4trace:configure.in:4: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
43
m4trace:configure.in:4: -1- AC_SUBST_TRACE([bindir])
44
m4trace:configure.in:4: -1- m4_pattern_allow([^bindir$])
45
m4trace:configure.in:4: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
46
m4trace:configure.in:4: -1- AC_SUBST_TRACE([sbindir])
47
m4trace:configure.in:4: -1- m4_pattern_allow([^sbindir$])
48
m4trace:configure.in:4: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
49
m4trace:configure.in:4: -1- AC_SUBST_TRACE([libexecdir])
50
m4trace:configure.in:4: -1- m4_pattern_allow([^libexecdir$])
51
m4trace:configure.in:4: -1- AC_SUBST([datarootdir], ['${prefix}/share'])
52
m4trace:configure.in:4: -1- AC_SUBST_TRACE([datarootdir])
53
m4trace:configure.in:4: -1- m4_pattern_allow([^datarootdir$])
54
m4trace:configure.in:4: -1- AC_SUBST([datadir], ['${datarootdir}'])
55
m4trace:configure.in:4: -1- AC_SUBST_TRACE([datadir])
56
m4trace:configure.in:4: -1- m4_pattern_allow([^datadir$])
57
m4trace:configure.in:4: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
58
m4trace:configure.in:4: -1- AC_SUBST_TRACE([sysconfdir])
59
m4trace:configure.in:4: -1- m4_pattern_allow([^sysconfdir$])
60
m4trace:configure.in:4: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
61
m4trace:configure.in:4: -1- AC_SUBST_TRACE([sharedstatedir])
62
m4trace:configure.in:4: -1- m4_pattern_allow([^sharedstatedir$])
63
m4trace:configure.in:4: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
64
m4trace:configure.in:4: -1- AC_SUBST_TRACE([localstatedir])
65
m4trace:configure.in:4: -1- m4_pattern_allow([^localstatedir$])
66
m4trace:configure.in:4: -1- AC_SUBST([includedir], ['${prefix}/include'])
67
m4trace:configure.in:4: -1- AC_SUBST_TRACE([includedir])
68
m4trace:configure.in:4: -1- m4_pattern_allow([^includedir$])
69
m4trace:configure.in:4: -1- AC_SUBST([oldincludedir], ['/usr/include'])
70
m4trace:configure.in:4: -1- AC_SUBST_TRACE([oldincludedir])
71
m4trace:configure.in:4: -1- m4_pattern_allow([^oldincludedir$])
72
m4trace:configure.in:4: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
73
				     ['${datarootdir}/doc/${PACKAGE_TARNAME}'],
74
				     ['${datarootdir}/doc/${PACKAGE}'])])
75
m4trace:configure.in:4: -1- AC_SUBST_TRACE([docdir])
76
m4trace:configure.in:4: -1- m4_pattern_allow([^docdir$])
77
m4trace:configure.in:4: -1- AC_SUBST([infodir], ['${datarootdir}/info'])
78
m4trace:configure.in:4: -1- AC_SUBST_TRACE([infodir])
79
m4trace:configure.in:4: -1- m4_pattern_allow([^infodir$])
80
m4trace:configure.in:4: -1- AC_SUBST([htmldir], ['${docdir}'])
81
m4trace:configure.in:4: -1- AC_SUBST_TRACE([htmldir])
82
m4trace:configure.in:4: -1- m4_pattern_allow([^htmldir$])
83
m4trace:configure.in:4: -1- AC_SUBST([dvidir], ['${docdir}'])
84
m4trace:configure.in:4: -1- AC_SUBST_TRACE([dvidir])
85
m4trace:configure.in:4: -1- m4_pattern_allow([^dvidir$])
86
m4trace:configure.in:4: -1- AC_SUBST([pdfdir], ['${docdir}'])
87
m4trace:configure.in:4: -1- AC_SUBST_TRACE([pdfdir])
88
m4trace:configure.in:4: -1- m4_pattern_allow([^pdfdir$])
89
m4trace:configure.in:4: -1- AC_SUBST([psdir], ['${docdir}'])
90
m4trace:configure.in:4: -1- AC_SUBST_TRACE([psdir])
91
m4trace:configure.in:4: -1- m4_pattern_allow([^psdir$])
92
m4trace:configure.in:4: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
93
m4trace:configure.in:4: -1- AC_SUBST_TRACE([libdir])
94
m4trace:configure.in:4: -1- m4_pattern_allow([^libdir$])
95
m4trace:configure.in:4: -1- AC_SUBST([localedir], ['${datarootdir}/locale'])
96
m4trace:configure.in:4: -1- AC_SUBST_TRACE([localedir])
97
m4trace:configure.in:4: -1- m4_pattern_allow([^localedir$])
98
m4trace:configure.in:4: -1- AC_SUBST([mandir], ['${datarootdir}/man'])
99
m4trace:configure.in:4: -1- AC_SUBST_TRACE([mandir])
100
m4trace:configure.in:4: -1- m4_pattern_allow([^mandir$])
101
m4trace:configure.in:4: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
102
m4trace:configure.in:4: -1- m4_pattern_allow([^PACKAGE_NAME$])
103
m4trace:configure.in:4: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
104
@%:@undef PACKAGE_NAME])
105
m4trace:configure.in:4: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
106
m4trace:configure.in:4: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
107
m4trace:configure.in:4: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
108
@%:@undef PACKAGE_TARNAME])
109
m4trace:configure.in:4: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
110
m4trace:configure.in:4: -1- m4_pattern_allow([^PACKAGE_VERSION$])
111
m4trace:configure.in:4: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
112
@%:@undef PACKAGE_VERSION])
113
m4trace:configure.in:4: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
114
m4trace:configure.in:4: -1- m4_pattern_allow([^PACKAGE_STRING$])
115
m4trace:configure.in:4: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
116
@%:@undef PACKAGE_STRING])
117
m4trace:configure.in:4: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
118
m4trace:configure.in:4: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
119
m4trace:configure.in:4: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
120
@%:@undef PACKAGE_BUGREPORT])
121
m4trace:configure.in:4: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL])
122
m4trace:configure.in:4: -1- m4_pattern_allow([^PACKAGE_URL$])
123
m4trace:configure.in:4: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */
124
@%:@undef PACKAGE_URL])
125
m4trace:configure.in:4: -1- AC_SUBST([DEFS])
126
m4trace:configure.in:4: -1- AC_SUBST_TRACE([DEFS])
127
m4trace:configure.in:4: -1- m4_pattern_allow([^DEFS$])
128
m4trace:configure.in:4: -1- AC_SUBST([ECHO_C])
129
m4trace:configure.in:4: -1- AC_SUBST_TRACE([ECHO_C])
130
m4trace:configure.in:4: -1- m4_pattern_allow([^ECHO_C$])
131
m4trace:configure.in:4: -1- AC_SUBST([ECHO_N])
132
m4trace:configure.in:4: -1- AC_SUBST_TRACE([ECHO_N])
133
m4trace:configure.in:4: -1- m4_pattern_allow([^ECHO_N$])
134
m4trace:configure.in:4: -1- AC_SUBST([ECHO_T])
135
m4trace:configure.in:4: -1- AC_SUBST_TRACE([ECHO_T])
136
m4trace:configure.in:4: -1- m4_pattern_allow([^ECHO_T$])
137
m4trace:configure.in:4: -1- AC_SUBST([LIBS])
138
m4trace:configure.in:4: -1- AC_SUBST_TRACE([LIBS])
139
m4trace:configure.in:4: -1- m4_pattern_allow([^LIBS$])
140
m4trace:configure.in:4: -1- AC_SUBST([build_alias])
141
m4trace:configure.in:4: -1- AC_SUBST_TRACE([build_alias])
142
m4trace:configure.in:4: -1- m4_pattern_allow([^build_alias$])
143
m4trace:configure.in:4: -1- AC_SUBST([host_alias])
144
m4trace:configure.in:4: -1- AC_SUBST_TRACE([host_alias])
145
m4trace:configure.in:4: -1- m4_pattern_allow([^host_alias$])
146
m4trace:configure.in:4: -1- AC_SUBST([target_alias])
147
m4trace:configure.in:4: -1- AC_SUBST_TRACE([target_alias])
148
m4trace:configure.in:4: -1- m4_pattern_allow([^target_alias$])
149
m4trace:configure.in:6: -1- AC_CONFIG_HEADERS([bgpdump-config.h])
150
m4trace:configure.in:13: -1- AC_SUBST([CC])
151
m4trace:configure.in:13: -1- AC_SUBST_TRACE([CC])
152
m4trace:configure.in:13: -1- m4_pattern_allow([^CC$])
153
m4trace:configure.in:13: -1- AC_SUBST([CFLAGS])
154
m4trace:configure.in:13: -1- AC_SUBST_TRACE([CFLAGS])
155
m4trace:configure.in:13: -1- m4_pattern_allow([^CFLAGS$])
156
m4trace:configure.in:13: -1- AC_SUBST([LDFLAGS])
157
m4trace:configure.in:13: -1- AC_SUBST_TRACE([LDFLAGS])
158
m4trace:configure.in:13: -1- m4_pattern_allow([^LDFLAGS$])
159
m4trace:configure.in:13: -1- AC_SUBST([LIBS])
160
m4trace:configure.in:13: -1- AC_SUBST_TRACE([LIBS])
161
m4trace:configure.in:13: -1- m4_pattern_allow([^LIBS$])
162
m4trace:configure.in:13: -1- AC_SUBST([CPPFLAGS])
163
m4trace:configure.in:13: -1- AC_SUBST_TRACE([CPPFLAGS])
164
m4trace:configure.in:13: -1- m4_pattern_allow([^CPPFLAGS$])
165
m4trace:configure.in:13: -1- AC_SUBST([CC])
166
m4trace:configure.in:13: -1- AC_SUBST_TRACE([CC])
167
m4trace:configure.in:13: -1- m4_pattern_allow([^CC$])
168
m4trace:configure.in:13: -1- AC_SUBST([CC])
169
m4trace:configure.in:13: -1- AC_SUBST_TRACE([CC])
170
m4trace:configure.in:13: -1- m4_pattern_allow([^CC$])
171
m4trace:configure.in:13: -1- AC_SUBST([CC])
172
m4trace:configure.in:13: -1- AC_SUBST_TRACE([CC])
173
m4trace:configure.in:13: -1- m4_pattern_allow([^CC$])
174
m4trace:configure.in:13: -1- AC_SUBST([CC])
175
m4trace:configure.in:13: -1- AC_SUBST_TRACE([CC])
176
m4trace:configure.in:13: -1- m4_pattern_allow([^CC$])
177
m4trace:configure.in:13: -1- AC_SUBST([ac_ct_CC])
178
m4trace:configure.in:13: -1- AC_SUBST_TRACE([ac_ct_CC])
179
m4trace:configure.in:13: -1- m4_pattern_allow([^ac_ct_CC$])
180
m4trace:configure.in:13: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
181
m4trace:configure.in:13: -1- AC_SUBST_TRACE([EXEEXT])
182
m4trace:configure.in:13: -1- m4_pattern_allow([^EXEEXT$])
183
m4trace:configure.in:13: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
184
m4trace:configure.in:13: -1- AC_SUBST_TRACE([OBJEXT])
185
m4trace:configure.in:13: -1- m4_pattern_allow([^OBJEXT$])
186
m4trace:configure.in:14: -1- AC_SUBST([RANLIB])
187
m4trace:configure.in:14: -1- AC_SUBST_TRACE([RANLIB])
188
m4trace:configure.in:14: -1- m4_pattern_allow([^RANLIB$])
189
m4trace:configure.in:17: -1- AH_OUTPUT([HAVE_ARPA_INET_H], [/* Define to 1 if you have the <arpa/inet.h> header file. */
190
@%:@undef HAVE_ARPA_INET_H])
191
m4trace:configure.in:17: -1- AH_OUTPUT([HAVE_NETINET_IN_H], [/* Define to 1 if you have the <netinet/in.h> header file. */
192
@%:@undef HAVE_NETINET_IN_H])
193
m4trace:configure.in:17: -1- AH_OUTPUT([HAVE_SYSLOG_H], [/* Define to 1 if you have the <syslog.h> header file. */
194
@%:@undef HAVE_SYSLOG_H])
195
m4trace:configure.in:17: -1- AC_SUBST([CPP])
196
m4trace:configure.in:17: -1- AC_SUBST_TRACE([CPP])
197
m4trace:configure.in:17: -1- m4_pattern_allow([^CPP$])
198
m4trace:configure.in:17: -1- AC_SUBST([CPPFLAGS])
199
m4trace:configure.in:17: -1- AC_SUBST_TRACE([CPPFLAGS])
200
m4trace:configure.in:17: -1- m4_pattern_allow([^CPPFLAGS$])
201
m4trace:configure.in:17: -1- AC_SUBST([CPP])
202
m4trace:configure.in:17: -1- AC_SUBST_TRACE([CPP])
203
m4trace:configure.in:17: -1- m4_pattern_allow([^CPP$])
204
m4trace:configure.in:17: -1- AC_SUBST([GREP])
205
m4trace:configure.in:17: -1- AC_SUBST_TRACE([GREP])
206
m4trace:configure.in:17: -1- m4_pattern_allow([^GREP$])
207
m4trace:configure.in:17: -1- AC_SUBST([EGREP])
208
m4trace:configure.in:17: -1- AC_SUBST_TRACE([EGREP])
209
m4trace:configure.in:17: -1- m4_pattern_allow([^EGREP$])
210
m4trace:configure.in:17: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
211
m4trace:configure.in:17: -1- m4_pattern_allow([^STDC_HEADERS$])
212
m4trace:configure.in:17: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
213
@%:@undef STDC_HEADERS])
214
m4trace:configure.in:17: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
215
@%:@undef HAVE_SYS_TYPES_H])
216
m4trace:configure.in:17: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
217
@%:@undef HAVE_SYS_STAT_H])
218
m4trace:configure.in:17: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
219
@%:@undef HAVE_STDLIB_H])
220
m4trace:configure.in:17: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
221
@%:@undef HAVE_STRING_H])
222
m4trace:configure.in:17: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
223
@%:@undef HAVE_MEMORY_H])
224
m4trace:configure.in:17: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
225
@%:@undef HAVE_STRINGS_H])
226
m4trace:configure.in:17: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
227
@%:@undef HAVE_INTTYPES_H])
228
m4trace:configure.in:17: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
229
@%:@undef HAVE_STDINT_H])
230
m4trace:configure.in:17: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
231
@%:@undef HAVE_UNISTD_H])
232
m4trace:configure.in:18: -1- AC_DEFINE_TRACE_LITERAL([TM_IN_SYS_TIME])
233
m4trace:configure.in:18: -1- m4_pattern_allow([^TM_IN_SYS_TIME$])
234
m4trace:configure.in:18: -1- AH_OUTPUT([TM_IN_SYS_TIME], [/* Define to 1 if your <sys/time.h> declares `struct tm\'. */
235
@%:@undef TM_IN_SYS_TIME])
236
m4trace:configure.in:21: -2- AC_DEFINE_TRACE_LITERAL([u_char_t])
237
m4trace:configure.in:21: -2- m4_pattern_allow([^u_char_t$])
238
m4trace:configure.in:21: -2- AH_OUTPUT([u_char_t], [/* Define if system headers do not define u_char_t */
239
@%:@undef u_char_t])
240
m4trace:configure.in:22: -2- AC_DEFINE_TRACE_LITERAL([u_int8_t])
241
m4trace:configure.in:22: -2- m4_pattern_allow([^u_int8_t$])
242
m4trace:configure.in:22: -2- AH_OUTPUT([u_int8_t], [/* Define if system headers do not define u_int8_t */
243
@%:@undef u_int8_t])
244
m4trace:configure.in:23: -2- AC_DEFINE_TRACE_LITERAL([u_int16_t])
245
m4trace:configure.in:23: -2- m4_pattern_allow([^u_int16_t$])
246
m4trace:configure.in:23: -2- AH_OUTPUT([u_int16_t], [/* Define if system headers do not define u_int16_t */
247
@%:@undef u_int16_t])
248
m4trace:configure.in:24: -2- AC_DEFINE_TRACE_LITERAL([u_int32_t])
249
m4trace:configure.in:24: -2- m4_pattern_allow([^u_int32_t$])
250
m4trace:configure.in:24: -2- AH_OUTPUT([u_int32_t], [/* Define if system headers do not define u_int32_t */
251
@%:@undef u_int32_t])
252
m4trace:configure.in:26: -2- AC_DEFINE_TRACE_LITERAL([DONT_HAVE_GZ])
253
m4trace:configure.in:26: -2- m4_pattern_allow([^DONT_HAVE_GZ$])
254
m4trace:configure.in:26: -2- AH_OUTPUT([DONT_HAVE_GZ], [/* Define if libz not present */
255
@%:@undef DONT_HAVE_GZ])
256
m4trace:configure.in:26: -1- AH_OUTPUT([HAVE_LIBZ], [/* Define to 1 if you have the `z\' library (-lz). */
257
@%:@undef HAVE_LIBZ])
258
m4trace:configure.in:26: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBZ])
259
m4trace:configure.in:26: -1- m4_pattern_allow([^HAVE_LIBZ$])
260
m4trace:configure.in:27: -2- AC_DEFINE_TRACE_LITERAL([DONT_HAVE_BZ2])
261
m4trace:configure.in:27: -2- m4_pattern_allow([^DONT_HAVE_BZ2$])
262
m4trace:configure.in:27: -2- AH_OUTPUT([DONT_HAVE_BZ2], [/* Define if libbzip2 not present */
263
@%:@undef DONT_HAVE_BZ2])
264
m4trace:configure.in:27: -1- AH_OUTPUT([HAVE_LIBBZ2], [/* Define to 1 if you have the `bz2\' library (-lbz2). */
265
@%:@undef HAVE_LIBBZ2])
266
m4trace:configure.in:27: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBBZ2])
267
m4trace:configure.in:27: -1- m4_pattern_allow([^HAVE_LIBBZ2$])
268
m4trace:configure.in:30: -2- AH_OUTPUT([HAVE_LIBNSL], [/* Define to 1 if you have the `nsl\' library (-lnsl). */
269
@%:@undef HAVE_LIBNSL])
270
m4trace:configure.in:30: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LIBNSL])
271
m4trace:configure.in:30: -2- m4_pattern_allow([^HAVE_LIBNSL$])
272
m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_INET_NTOA], [/* Define to 1 if you have the `inet_ntoa\' function. */
273
@%:@undef HAVE_INET_NTOA])
274
m4trace:configure.in:30: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_NTOA])
275
m4trace:configure.in:30: -1- m4_pattern_allow([^HAVE_INET_NTOA$])
276
m4trace:configure.in:31: -2- AH_OUTPUT([HAVE_LIBNSL], [/* Define to 1 if you have the `nsl\' library (-lnsl). */
277
@%:@undef HAVE_LIBNSL])
278
m4trace:configure.in:31: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LIBNSL])
279
m4trace:configure.in:31: -2- m4_pattern_allow([^HAVE_LIBNSL$])
280
m4trace:configure.in:31: -1- AH_OUTPUT([HAVE_INET_NTOP], [/* Define to 1 if you have the `inet_ntop\' function. */
281
@%:@undef HAVE_INET_NTOP])
282
m4trace:configure.in:31: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INET_NTOP])
283
m4trace:configure.in:31: -1- m4_pattern_allow([^HAVE_INET_NTOP$])
284
m4trace:configure.in:38: -1- AC_SUBST([CFLAGS])
285
m4trace:configure.in:38: -1- AC_SUBST_TRACE([CFLAGS])
286
m4trace:configure.in:38: -1- m4_pattern_allow([^CFLAGS$])
287
m4trace:configure.in:39: -1- AC_SUBST([LIBS])
288
m4trace:configure.in:39: -1- AC_SUBST_TRACE([LIBS])
289
m4trace:configure.in:39: -1- m4_pattern_allow([^LIBS$])
290
m4trace:configure.in:41: -1- AC_CONFIG_FILES([bgpdump.spec Makefile])
291
m4trace:configure.in:41: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments.
292
You should run autoupdate.], [])
293
m4trace:configure.in:41: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
294
m4trace:configure.in:41: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
295
m4trace:configure.in:41: -1- m4_pattern_allow([^LIB@&t@OBJS$])
296
m4trace:configure.in:41: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
297
m4trace:configure.in:41: -1- AC_SUBST_TRACE([LTLIBOBJS])
298
m4trace:configure.in:41: -1- m4_pattern_allow([^LTLIBOBJS$])
299
m4trace:configure.in:41: -1- AC_SUBST_TRACE([top_builddir])
300
m4trace:configure.in:41: -1- AC_SUBST_TRACE([top_build_prefix])
301
m4trace:configure.in:41: -1- AC_SUBST_TRACE([srcdir])
302
m4trace:configure.in:41: -1- AC_SUBST_TRACE([abs_srcdir])
303
m4trace:configure.in:41: -1- AC_SUBST_TRACE([top_srcdir])
304
m4trace:configure.in:41: -1- AC_SUBST_TRACE([abs_top_srcdir])
305
m4trace:configure.in:41: -1- AC_SUBST_TRACE([builddir])
306
m4trace:configure.in:41: -1- AC_SUBST_TRACE([abs_builddir])
307
m4trace:configure.in:41: -1- AC_SUBST_TRACE([abs_top_builddir])
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/bgpdump-config.h (+95 lines)
Line 0 Link Here
1
/* bgpdump-config.h.  Generated from bgpdump-config.h.in by configure.  */
2
/* bgpdump-config.h.in.  Generated from configure.in by autoheader.  */
3
4
/* Define if libbzip2 not present */
5
/* #undef DONT_HAVE_BZ2 */
6
7
/* Define if libz not present */
8
/* #undef DONT_HAVE_GZ */
9
10
/* Define to 1 if you have the <arpa/inet.h> header file. */
11
#define HAVE_ARPA_INET_H 1
12
13
/* Define to 1 if you have the `inet_ntoa' function. */
14
#define HAVE_INET_NTOA 1
15
16
/* Define to 1 if you have the `inet_ntop' function. */
17
#define HAVE_INET_NTOP 1
18
19
/* Define to 1 if you have the <inttypes.h> header file. */
20
#define HAVE_INTTYPES_H 1
21
22
/* Define to 1 if you have the `bz2' library (-lbz2). */
23
#define HAVE_LIBBZ2 1
24
25
/* Define to 1 if you have the `nsl' library (-lnsl). */
26
/* #undef HAVE_LIBNSL */
27
28
/* Define to 1 if you have the `z' library (-lz). */
29
#define HAVE_LIBZ 1
30
31
/* Define to 1 if you have the <memory.h> header file. */
32
#define HAVE_MEMORY_H 1
33
34
/* Define to 1 if you have the <netinet/in.h> header file. */
35
#define HAVE_NETINET_IN_H 1
36
37
/* Define to 1 if you have the <stdint.h> header file. */
38
#define HAVE_STDINT_H 1
39
40
/* Define to 1 if you have the <stdlib.h> header file. */
41
#define HAVE_STDLIB_H 1
42
43
/* Define to 1 if you have the <strings.h> header file. */
44
#define HAVE_STRINGS_H 1
45
46
/* Define to 1 if you have the <string.h> header file. */
47
#define HAVE_STRING_H 1
48
49
/* Define to 1 if you have the <syslog.h> header file. */
50
#define HAVE_SYSLOG_H 1
51
52
/* Define to 1 if you have the <sys/stat.h> header file. */
53
#define HAVE_SYS_STAT_H 1
54
55
/* Define to 1 if you have the <sys/types.h> header file. */
56
#define HAVE_SYS_TYPES_H 1
57
58
/* Define to 1 if you have the <unistd.h> header file. */
59
#define HAVE_UNISTD_H 1
60
61
/* Define to the address where bug reports for this package should be sent. */
62
#define PACKAGE_BUGREPORT "ris@ripe.net"
63
64
/* Define to the full name of this package. */
65
#define PACKAGE_NAME "libbgpdump"
66
67
/* Define to the full name and version of this package. */
68
#define PACKAGE_STRING "libbgpdump 1.4.99.15"
69
70
/* Define to the one symbol short name of this package. */
71
#define PACKAGE_TARNAME "libbgpdump"
72
73
/* Define to the home page for this package. */
74
#define PACKAGE_URL ""
75
76
/* Define to the version of this package. */
77
#define PACKAGE_VERSION "1.4.99.15"
78
79
/* Define to 1 if you have the ANSI C header files. */
80
#define STDC_HEADERS 1
81
82
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
83
/* #undef TM_IN_SYS_TIME */
84
85
/* Define if system headers do not define u_char_t */
86
#define u_char_t uchar_t
87
88
/* Define if system headers do not define u_int16_t */
89
/* #undef u_int16_t */
90
91
/* Define if system headers do not define u_int32_t */
92
/* #undef u_int32_t */
93
94
/* Define if system headers do not define u_int8_t */
95
/* #undef u_int8_t */
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/bgpdump-config.h.in (+94 lines)
Line 0 Link Here
1
/* bgpdump-config.h.in.  Generated from configure.in by autoheader.  */
2
3
/* Define if libbzip2 not present */
4
#undef DONT_HAVE_BZ2
5
6
/* Define if libz not present */
7
#undef DONT_HAVE_GZ
8
9
/* Define to 1 if you have the <arpa/inet.h> header file. */
10
#undef HAVE_ARPA_INET_H
11
12
/* Define to 1 if you have the `inet_ntoa' function. */
13
#undef HAVE_INET_NTOA
14
15
/* Define to 1 if you have the `inet_ntop' function. */
16
#undef HAVE_INET_NTOP
17
18
/* Define to 1 if you have the <inttypes.h> header file. */
19
#undef HAVE_INTTYPES_H
20
21
/* Define to 1 if you have the `bz2' library (-lbz2). */
22
#undef HAVE_LIBBZ2
23
24
/* Define to 1 if you have the `nsl' library (-lnsl). */
25
#undef HAVE_LIBNSL
26
27
/* Define to 1 if you have the `z' library (-lz). */
28
#undef HAVE_LIBZ
29
30
/* Define to 1 if you have the <memory.h> header file. */
31
#undef HAVE_MEMORY_H
32
33
/* Define to 1 if you have the <netinet/in.h> header file. */
34
#undef HAVE_NETINET_IN_H
35
36
/* Define to 1 if you have the <stdint.h> header file. */
37
#undef HAVE_STDINT_H
38
39
/* Define to 1 if you have the <stdlib.h> header file. */
40
#undef HAVE_STDLIB_H
41
42
/* Define to 1 if you have the <strings.h> header file. */
43
#undef HAVE_STRINGS_H
44
45
/* Define to 1 if you have the <string.h> header file. */
46
#undef HAVE_STRING_H
47
48
/* Define to 1 if you have the <syslog.h> header file. */
49
#undef HAVE_SYSLOG_H
50
51
/* Define to 1 if you have the <sys/stat.h> header file. */
52
#undef HAVE_SYS_STAT_H
53
54
/* Define to 1 if you have the <sys/types.h> header file. */
55
#undef HAVE_SYS_TYPES_H
56
57
/* Define to 1 if you have the <unistd.h> header file. */
58
#undef HAVE_UNISTD_H
59
60
/* Define to the address where bug reports for this package should be sent. */
61
#undef PACKAGE_BUGREPORT
62
63
/* Define to the full name of this package. */
64
#undef PACKAGE_NAME
65
66
/* Define to the full name and version of this package. */
67
#undef PACKAGE_STRING
68
69
/* Define to the one symbol short name of this package. */
70
#undef PACKAGE_TARNAME
71
72
/* Define to the home page for this package. */
73
#undef PACKAGE_URL
74
75
/* Define to the version of this package. */
76
#undef PACKAGE_VERSION
77
78
/* Define to 1 if you have the ANSI C header files. */
79
#undef STDC_HEADERS
80
81
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
82
#undef TM_IN_SYS_TIME
83
84
/* Define if system headers do not define u_char_t */
85
#undef u_char_t
86
87
/* Define if system headers do not define u_int16_t */
88
#undef u_int16_t
89
90
/* Define if system headers do not define u_int32_t */
91
#undef u_int32_t
92
93
/* Define if system headers do not define u_int8_t */
94
#undef u_int8_t
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/bgpdump.c (+1738 lines)
Line 0 Link Here
1
/*
2
 Copyright (c) 2007 - 2010 RIPE NCC - All Rights Reserved
3
 
4
 Permission to use, copy, modify, and distribute this software and its
5
 documentation for any purpose and without fee is hereby granted, provided
6
 that the above copyright notice appear in all copies and that both that
7
 copyright notice and this permission notice appear in supporting
8
 documentation, and that the name of the author not be used in advertising or
9
 publicity pertaining to distribution of the software without specific,
10
 written prior permission.
11
 
12
 THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
13
 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
14
 AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
15
 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
16
 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
 
19
Parts of this code have been engineered after analiyzing GNU Zebra's
20
source code and therefore might contain declarations/code from GNU
21
Zebra, Copyright (C) 1999 Kunihiro Ishiguro. Zebra is a free routing
22
software, distributed under the GNU General Public License. A copy of
23
this license is included with libbgpdump.
24
25
Original Author: Shufu Mao(msf98@mails.tsinghua.edu.cn) 
26
*/
27
28
#include "bgpdump-config.h"
29
#include "bgpdump_lib.h"
30
#include "util.h"
31
32
#include <time.h>
33
#include <unistd.h>
34
#include <fcntl.h>
35
#include <stdlib.h>
36
#include <netinet/in.h>
37
#include <sys/socket.h>
38
#include <arpa/inet.h>
39
#include <stdbool.h>
40
41
static void process(BGPDUMP_ENTRY *entry);
42
static void process_bgpdump_mrtd_bgp(BGPDUMP_ENTRY *entry);
43
static void show_ipv4_address(struct in_addr ip);
44
static void show_attr(attributes_t *attr);
45
static void show_prefixes(int count,struct prefix *prefix);
46
static void table_line_announce_1(struct mp_nlri *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str);
47
static void table_line_announce(struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str);
48
static void mrtd_table_line_withdraw(struct prefix *prefix, int count, BGPDUMP_ENTRY *entry, char *time_str);
49
static void mrtd_table_line_announce(struct prefix *prefix, int count, BGPDUMP_ENTRY *entry, char *time_str);
50
static void table_line_withdraw(struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str);
51
static void table_line_mrtd_route(BGPDUMP_MRTD_TABLE_DUMP *route,BGPDUMP_ENTRY *entry);
52
static void table_line_dump_v2_prefix(BGPDUMP_TABLE_DUMP_V2_PREFIX *e,BGPDUMP_ENTRY *entry);
53
static char *describe_origin(int origin);
54
55
#ifdef BGPDUMP_HAVE_IPV6
56
    void show_prefixes6(int count,struct prefix *prefix);
57
    static void table_line_withdraw6(struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str);
58
    static void table_line_announce6(struct mp_nlri *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str);
59
#endif
60
61
static void show_line_prefix(const char* format, long long ts, const char* time_str, const char* type);
62
63
/* If no aspath was present as a string in the packet, return an empty string
64
 * so everything stays machine parsable */
65
static char *attr_aspath(attributes_t *a) {
66
    if(a->flag & ATTR_FLAG_BIT(BGP_ATTR_AS_PATH) && a->aspath && a->aspath->str) {
67
        return a->aspath->str;
68
    }
69
    return "";
70
}
71
72
static int mode=0;
73
static int timetype=0;
74
static int show_packet_index = 0;
75
static int packet_index = 0;
76
77
static const char USAGE[] = "\
78
bgpdump version " PACKAGE_VERSION "\n\
79
Usage: bgpdump [-m|-M] [-t dump|-t change] [-O <output-file>] <input-file>\n\
80
bgpdump translates binary MRT files (possibly compressed) into readable output\n\
81
Output mode:\n\
82
    -H         multi-line, human-readable (the default)\n\
83
    -m         one-line per entry with unix timestamps\n\
84
    -M         one-line per entry with human readable timestamps\n\
85
    (there are other differences between -m and -M)\n\
86
\n\
87
Common options:\n\
88
    -O <file>  output to <file> instead of STDOUT\n\
89
    -s         log to syslog (the default)\n\
90
    -v         log to STDERR\n\
91
\n\
92
Options for -m and -M modes:\n\
93
    -t dump    timestamps for RIB dumps reflect the time of the dump (the default)\n\
94
    -t change  timestamps for RIB dumps reflect the last route modification\n\
95
    -p         show packet index at second position\n\
96
\n\
97
Special options:\n\
98
    -T         run unit tests and exit\n\
99
\n";
100
101
extern char *optarg;
102
extern int optind;
103
104
int main(int argc, char *argv[]) {
105
    
106
    char c;
107
    int fd;
108
    bool usage_error = false;
109
    bool use_syslog = true;
110
 
111
    log_to_stderr();
112
    
113
    while ((c=getopt(argc,argv,"if:o:t:mMHO:svTp"))!=-1)
114
	switch(c)
115
	{
116
       case 'H':
117
                mode=0;
118
                break;
119
	case 'm':
120
                mode=1;
121
                break;
122
	case 'M':
123
                mode=2;
124
                break;
125
	case 't':
126
                if(strcmp(optarg,"dump")==0){
127
                    timetype=0;
128
                } else if(strcmp(optarg,"change")==0){
129
                    timetype=1;
130
                } else {
131
                    printf("unknown -t option\n");
132
                    exit(1);
133
                }
134
                break;
135
        case 'O':
136
                fprintf(stderr, "redirecting output to '%s'\n", optarg); 
137
                fd = open(optarg, O_WRONLY|O_CREAT, 0666);
138
                if(fd < 0 || 0 > dup2(fd, STDOUT_FILENO)) {
139
                        perror("can't open output file");
140
                        exit(1);
141
                }
142
                break;
143
        case 's':
144
                use_syslog = true;
145
                break;
146
        case 'v':
147
                use_syslog = false;
148
                break;
149
        case 'i':
150
        case 'f':
151
        case 'o':
152
                warn("ignoring option '-%c'", c);
153
                break;
154
        case 'T':
155
                test_fmt_ip();
156
                test_utils();
157
                exit(0);
158
        case 'p':
159
                show_packet_index = 1;
160
                break;
161
        case '?':
162
        default:
163
                usage_error = true;
164
	}
165
    argc -= optind;
166
    argv += optind;
167
    
168
    if(use_syslog) {
169
        debug("logging to syslog");
170
        log_to_syslog();
171
    }
172
    
173
    if(usage_error || argc != 1) {
174
        if(argc != 1)
175
            err("you must supply exactly one file to process");
176
        fprintf(stderr, "%s", USAGE);
177
        exit(1);        
178
    }
179
180
    // more efficient then line buffering
181
    //    static char buffer[16000];
182
    //    setbuffer(stdout, buffer, sizeof buffer);
183
    
184
    BGPDUMP *my_dump = bgpdump_open_dump(argv[0]);
185
    if(! my_dump)
186
        return 1;
187
    
188
    do {
189
        BGPDUMP_ENTRY *my_entry = bgpdump_read_next(my_dump);
190
	if(my_entry) {
191
	    process(my_entry);
192
	    bgpdump_free_mem(my_entry);
193
            packet_index++;
194
	}
195
    } while(my_dump->eof==0);
196
197
    bgpdump_close_dump(my_dump);
198
    
199
    return 0;
200
}
201
202
const char *bgp_state_name[] = {
203
	"Unknown",
204
	"Idle",
205
	"Connect",
206
	"Active",
207
	"Opensent",
208
	"Openconfirm",
209
	"Established",
210
	NULL
211
};
212
213
void process(BGPDUMP_ENTRY *entry) {
214
215
	struct tm *date;
216
	char time_str[128];
217
	char time_str2[128];
218
	char time_str_fixed[128];
219
    char prefix[BGPDUMP_ADDRSTRLEN];  
220
	
221
	date=gmtime(&entry->time);
222
	time2str(date,time_str);	
223
	time2str(date,time_str_fixed);	
224
	if (mode==0)
225
	{
226
		printf("TIME: %s\n", time_str);
227
	}	
228
    //printf("TIME: %s",asctime(gmtime(&entry->time)));
229
    //printf("LENGTH          : %u\n", entry->length);
230
    switch(entry->type) {
231
	case BGPDUMP_TYPE_MRTD_TABLE_DUMP:
232
	     if(mode==0){
233
	        const char *prefix_str = NULL;
234
		switch(entry->subtype){
235
#ifdef BGPDUMP_HAVE_IPV6
236
	    	case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP6:
237
	    		printf("TYPE: TABLE_DUMP/INET6\n");
238
			prefix_str = fmt_ipv6(entry->body.mrtd_table_dump.prefix,prefix);
239
		break;
240
241
	    	case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP6_32BIT_AS:
242
	    		printf("TYPE: TABLE_DUMP/INET6_32BIT_AS\n");
243
			prefix_str = fmt_ipv6(entry->body.mrtd_table_dump.prefix,prefix);
244
		break;
245
246
#endif
247
		case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP:
248
			printf("TYPE: TABLE_DUMP/INET\n");
249
			prefix_str = inet_ntoa(entry->body.mrtd_table_dump.prefix.v4_addr);
250
		break;
251
252
		case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP_32BIT_AS:
253
			printf("TYPE: TABLE_DUMP/INET_32BIT_AS\n");
254
			prefix_str = inet_ntoa(entry->body.mrtd_table_dump.prefix.v4_addr);
255
		break;
256
257
		default:
258
			printf("Error: unknown table type %d\n", entry->subtype);
259
		return;
260
261
		}
262
		printf("VIEW: %d\n",entry->body.mrtd_table_dump.view);
263
	    	printf("SEQUENCE: %d\n",entry->body.mrtd_table_dump.sequence);
264
	    	printf("PREFIX: %s/%d\n",prefix_str,entry->body.mrtd_table_dump.mask);
265
	    	printf("FROM:");
266
		switch(entry->subtype)
267
		{
268
#ifdef BGPDUMP_HAVE_IPV6
269
		case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP6:
270
		case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP6_32BIT_AS:
271
272
			fmt_ipv6(entry->body.mrtd_table_dump.peer_ip,prefix);
273
			printf("%s ",prefix);
274
			break;
275
#endif
276
		case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP:
277
		case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP_32BIT_AS:
278
			if (entry->body.mrtd_table_dump.peer_ip.v4_addr.s_addr != 0x00000000L)
279
		    		printf("%s ",inet_ntoa(entry->body.mrtd_table_dump.peer_ip.v4_addr));
280
			else
281
				printf("N/A ");
282
283
		}
284
		printf("AS%u\n",entry->body.mrtd_table_dump.peer_as);
285
286
		//printf("FROM: %s AS%d\n",inet_ntoa(entry->body.mrtd_table_dump.peer_ip.v4_addr),entry->body.mrtd_table_dump.peer_as);
287
	 	//time2str(localtime(&entry->body.mrtd_table_dump.uptime),time_str2);
288
		time2str(gmtime(&entry->body.mrtd_table_dump.uptime),time_str2);
289
		printf("ORIGINATED: %s\n",time_str2); 	
290
		if (entry->attr && entry->attr->len)
291
				    	show_attr(entry->attr);
292
293
		printf("STATUS: 0x%x\n",entry->body.mrtd_table_dump.status);
294
	    
295
		
296
		//printf("    UPTIME      : %s",asctime(gmtime(&entry->body.mrtd_table_dump.uptime)));
297
	    //printf("    PEER IP     : %s\n",inet_ntoa(entry->body.mrtd_table_dump.peer_ip));
298
	    //printf("    PEER IP     : %s\n",inet_ntoa(entry->body.mrtd_table_dump.peer_ip.v4_addr));
299
	    //printf("    PEER AS     : %d\n",entry->body.mrtd_table_dump.peer_as);
300
	     }
301
	     else if (mode ==1 || mode ==2) // -m -M
302
	     {
303
	        table_line_mrtd_route(&entry->body.mrtd_table_dump,entry);	     
304
	     }
305
	    break;
306
307
	case BGPDUMP_TYPE_TABLE_DUMP_V2:
308
		if(mode == 0){
309
			char peer_ip[BGPDUMP_ADDRSTRLEN];
310
			//char time_str[30];
311
			int i;
312
313
			BGPDUMP_TABLE_DUMP_V2_PREFIX *e;
314
			e = &entry->body.mrtd_table_dump_v2_prefix;
315
316
			if(e->afi == AFI_IP){
317
				strncpy(prefix, inet_ntoa(e->prefix.v4_addr), BGPDUMP_ADDRSTRLEN);
318
#ifdef BGPDUMP_HAVE_IPV6
319
			} else if(e->afi == AFI_IP6){
320
				fmt_ipv6(e->prefix, prefix);
321
#endif
322
			}
323
324
			for(i = 0; i < e->entry_count; i++){
325
				// This is slightly nasty - as we want to print multiple entries
326
				// for multiple peers, we may need to print another TIME ourselves
327
				if(i) printf("\nTIME: %s\n",time_str_fixed);
328
				if(e->afi == AFI_IP){
329
    				printf("TYPE: TABLE_DUMP_V2/IPV4_UNICAST\n");
330
#ifdef BGPDUMP_HAVE_IPV6
331
				} else if(e->afi == AFI_IP6){
332
    				printf("TYPE: TABLE_DUMP_V2/IPV6_UNICAST\n");
333
#endif
334
				}
335
	    		printf("PREFIX: %s/%d\n",prefix, e->prefix_length);
336
    			printf("SEQUENCE: %d\n",e->seq);
337
338
				if(e->entries[i].peer->afi == AFI_IP){
339
					fmt_ipv4(e->entries[i].peer->peer_ip, peer_ip);
340
#ifdef BGPDUMP_HAVE_IPV6
341
				} else if (e->entries[i].peer->afi == AFI_IP6){
342
					fmt_ipv6(e->entries[i].peer->peer_ip, peer_ip);
343
#endif
344
				} else {
345
					sprintf(peer_ip, "[N/A, unsupported AF]");
346
				}
347
    			printf("FROM: %s AS%u\n", peer_ip, e->entries[i].peer->peer_as);
348
				time_t time_temp = (time_t)((e->entries[i]).originated_time);
349
				time2str(gmtime(&time_temp),time_str);
350
				printf("ORIGINATED: %s\n",time_str); 	
351
				if (e->entries[i].attr && e->entries[i].attr->len)
352
			    	show_attr(e->entries[i].attr);
353
			}
354
		} else if (mode==1 || mode==2) { // -m -M
355
                    table_line_dump_v2_prefix(&entry->body.mrtd_table_dump_v2_prefix,entry);	     
356
		}
357
	    break;
358
359
        case BGPDUMP_TYPE_MRTD_BGP:
360
            process_bgpdump_mrtd_bgp(entry);
361
            break;
362
	    
363
	case BGPDUMP_TYPE_ZEBRA_BGP:
364
	    
365
	    switch(entry->subtype) 
366
	    {
367
		case BGPDUMP_SUBTYPE_ZEBRA_BGP_MESSAGE:
368
		case BGPDUMP_SUBTYPE_ZEBRA_BGP_MESSAGE_AS4:
369
370
		    switch(entry->body.zebra_message.type) 
371
		    {
372
			case BGP_MSG_UPDATE:
373
			   if (mode ==0)
374
		    	   {
375
				printf("TYPE: BGP4MP/MESSAGE/Update\n");	 
376
				if (entry->body.zebra_message.source_as)
377
			        {
378
					printf("FROM:");
379
					switch(entry->body.zebra_message.address_family)
380
					{
381
#ifdef BGPDUMP_HAVE_IPV6
382
						case AFI_IP6:
383
384
							fmt_ipv6(entry->body.zebra_message.source_ip,prefix);
385
							printf(" %s ",prefix);
386
							break;
387
#endif
388
						case AFI_IP:
389
						default:
390
							if (entry->body.zebra_message.source_ip.v4_addr.s_addr != 0x00000000L)
391
		    						printf(" %s ",inet_ntoa(entry->body.zebra_message.source_ip.v4_addr));
392
							else
393
								printf(" N/A ");
394
					}
395
					printf("AS%u\n",entry->body.zebra_message.source_as);
396
                                }
397
				if (entry->body.zebra_message.destination_as)
398
				{
399
					printf("TO:");
400
					switch(entry->body.zebra_message.address_family)
401
					{
402
#ifdef BGPDUMP_HAVE_IPV6
403
						case AFI_IP6:
404
405
							fmt_ipv6(entry->body.zebra_message.destination_ip,prefix);
406
							printf(" %s ",prefix);
407
							break;
408
#endif
409
						case AFI_IP:
410
						default:
411
							if (entry->body.zebra_message.destination_ip.v4_addr.s_addr != 0x00000000L)
412
		    						printf(" %s ",inet_ntoa(entry->body.zebra_message.destination_ip.v4_addr));
413
							else
414
								printf(" N/A ");
415
					}	
416
		    			printf("AS%u\n",entry->body.zebra_message.destination_as);
417
				}
418
				if (entry->attr && entry->attr->len)
419
				    	show_attr(entry->attr);
420
				if (entry->body.zebra_message.cut_bytes)
421
				{
422
					u_int16_t cutted,idx;
423
					u_int8_t buf[128];
424
					
425
					printf("   INCOMPLETE PACKET: %d bytes cutted\n",entry->body.zebra_message.cut_bytes);
426
					printf("   INCOMPLETE PART: ");
427
					if (entry->body.zebra_message.incomplete.orig_len)
428
					{
429
					 	cutted=entry->body.zebra_message.incomplete.prefix.len/8+1;
430
						buf[0]=entry->body.zebra_message.incomplete.orig_len;
431
						memcpy(buf+1,&entry->body.zebra_message.incomplete.prefix.address,cutted-1);
432
						
433
						for (idx=0;idx<cutted;idx++)
434
						{
435
							if (buf[idx]<0x10)
436
								printf("0%x ",buf[idx]);
437
							else
438
								printf("%x ",buf[idx]);
439
						}
440
					}
441
					printf("\n");
442
				}
443
                               if(! entry->attr)
444
                                   return;
445
				if ((entry->body.zebra_message.withdraw_count) || (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MP_UNREACH_NLRI))) 
446
				{
447
#ifdef BGPDUMP_HAVE_IPV6
448
					if ((entry->body.zebra_message.withdraw_count)||(entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->prefix_count) || (entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->prefix_count) || (entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count) ||(entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->prefix_count) || (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->prefix_count) || (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count) )
449
450
#else
451
					if ((entry->body.zebra_message.withdraw_count)||(entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->prefix_count) || (entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->prefix_count) || (entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count))
452
453
#endif				
454
						printf("WITHDRAW\n");
455
					if (entry->body.zebra_message.withdraw_count)
456
			    			show_prefixes(entry->body.zebra_message.withdraw_count,entry->body.zebra_message.withdraw);
457
458
                                        if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->prefix_count)
459
                                                show_prefixes(entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->nlri);
460
                                
461
                                        if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->prefix_count)
462
                                                show_prefixes(entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->nlri);
463
464
                                        if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count)
465
                                                show_prefixes(entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->nlri);
466
467
#ifdef BGPDUMP_HAVE_IPV6
468
                                        if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->prefix_count)
469
                                                show_prefixes6(entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->nlri);
470
                                
471
                                        if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->prefix_count)
472
                                                show_prefixes6(entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->nlri);
473
474
                                        if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count)
475
                                                show_prefixes6(entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->nlri);
476
#endif
477
				}
478
				if ( (entry->body.zebra_message.announce_count) || (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MP_REACH_NLRI))) 
479
				{
480
					printf("ANNOUNCE\n");
481
			    		if (entry->body.zebra_message.announce_count)
482
			    			show_prefixes(entry->body.zebra_message.announce_count,entry->body.zebra_message.announce);
483
484
                                        if (entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->prefix_count)
485
                                                show_prefixes(entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->nlri);
486
                                
487
                                        if (entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->prefix_count)
488
                                                show_prefixes(entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->nlri);
489
490
                                        if (entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count)
491
                                                show_prefixes(entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->nlri);
492
493
#ifdef BGPDUMP_HAVE_IPV6
494
                                        if (entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->prefix_count)
495
                                                show_prefixes6(entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->nlri);
496
                                
497
                                        if (entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->prefix_count)
498
                                                show_prefixes6(entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->nlri);
499
500
                                        if (entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count)
501
                                                show_prefixes6(entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count,entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->nlri);
502
#endif					
503
				}
504
			   }
505
			   else if (mode == 1  || mode == 2) //-m -M
506
			   {
507
				if ((entry->body.zebra_message.withdraw_count) || (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MP_UNREACH_NLRI)))
508
				{
509
510
					table_line_withdraw(entry->body.zebra_message.withdraw,entry->body.zebra_message.withdraw_count,entry,time_str);
511
512
                                        if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->prefix_count)
513
                                                table_line_withdraw(entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST]->prefix_count,entry,time_str);	
514
515
                                        if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->prefix_count)
516
                                                table_line_withdraw(entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST]->prefix_count,entry,time_str);
517
                                        
518
                                        if (entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count)
519
                                                table_line_withdraw(entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count,entry,time_str);
520
521
#ifdef BGPDUMP_HAVE_IPV6						
522
                                        if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->prefix_count)
523
                                                table_line_withdraw6(entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST]->prefix_count,entry,time_str);	
524
                                        
525
                                        if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->prefix_count)
526
                                                table_line_withdraw6(entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST]->prefix_count,entry,time_str);
527
                                        
528
                                        if (entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count)
529
                                                table_line_withdraw6(entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->nlri,entry->attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count,entry,time_str);
530
#endif	
531
                        
532
				}
533
				if ( (entry->body.zebra_message.announce_count) || (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MP_REACH_NLRI)))
534
				{
535
					table_line_announce(entry->body.zebra_message.announce,entry->body.zebra_message.announce_count,entry,time_str);
536
                                        if (entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->prefix_count)
537
                                                table_line_announce_1(entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST],entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->prefix_count,entry,time_str);	
538
                                        if (entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->prefix_count)
539
                                                table_line_announce_1(entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST],entry->attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->prefix_count,entry,time_str);
540
                                        if (entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count)
541
                                                table_line_announce_1(entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST],entry->attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->prefix_count,entry,time_str);
542
#ifdef BGPDUMP_HAVE_IPV6						
543
                                        if (entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->prefix_count)
544
                                                table_line_announce6(entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST],entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->prefix_count,entry,time_str);	
545
                                        if (entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->prefix_count)
546
                                                table_line_announce6(entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST],entry->attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->prefix_count,entry,time_str);
547
                                        if (entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST] && entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count)
548
                                                table_line_announce6(entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST],entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->prefix_count,entry,time_str);
549
#endif
550
					
551
				}  
552
			   }
553
			   break;
554
		    
555
			case BGP_MSG_OPEN:
556
			    if (mode != 0)
557
				    break;
558
		            printf("TYPE: BGP4MP/MESSAGE/Open\n");
559
			    if (entry->body.zebra_message.source_as)
560
			    {
561
				printf("FROM:");
562
				switch(entry->body.zebra_message.address_family)
563
					{
564
#ifdef BGPDUMP_HAVE_IPV6
565
						case AFI_IP6:
566
567
							fmt_ipv6(entry->body.zebra_message.source_ip,prefix);
568
							printf(" %s ",prefix);
569
							break;
570
#endif
571
						case AFI_IP:
572
						default:
573
							if (entry->body.zebra_message.source_ip.v4_addr.s_addr != 0x00000000L)
574
		    						printf(" %s ",inet_ntoa(entry->body.zebra_message.source_ip.v4_addr));
575
							else
576
								printf(" N/A ");
577
					}
578
				printf("AS%u\n",entry->body.zebra_message.source_as);
579
			    }
580
			    if (entry->body.zebra_message.destination_as)
581
			    {
582
				printf("TO:");
583
				switch(entry->body.zebra_message.address_family)
584
					{
585
#ifdef BGPDUMP_HAVE_IPV6
586
						case AFI_IP6:
587
588
							fmt_ipv6(entry->body.zebra_message.destination_ip,prefix);
589
							printf(" %s ",prefix);
590
							break;
591
#endif
592
						case AFI_IP:
593
						default:
594
							if (entry->body.zebra_message.destination_ip.v4_addr.s_addr != 0x00000000L)
595
		    						printf(" %s ",inet_ntoa(entry->body.zebra_message.destination_ip.v4_addr));
596
							else
597
								printf(" N/A ");
598
					}
599
		    		printf("AS%u\n",entry->body.zebra_message.destination_as);
600
                            }
601
602
			    printf("VERSION: %d\n",entry->body.zebra_message.version);
603
			    printf("AS: %u\n",entry->body.zebra_message.my_as);
604
			    printf("HOLD_TIME: %d\n",entry->body.zebra_message.hold_time);
605
			    printf("ID: %s\n",inet_ntoa(entry->body.zebra_message.bgp_id));
606
			    printf("OPT_PARM_LEN: %d\n",entry->body.zebra_message.opt_len);
607
			    break;
608
			
609
			case BGP_MSG_NOTIFY:
610
			    if (mode != 0)
611
				    break;
612
			    printf("TYPE: BGP4MP/MESSAGE/Notify\n");
613
			    if (entry->body.zebra_message.source_as)
614
			    {
615
				printf("FROM:");
616
				switch(entry->body.zebra_message.address_family)
617
					{
618
#ifdef BGPDUMP_HAVE_IPV6
619
						case AFI_IP6:
620
621
							fmt_ipv6(entry->body.zebra_message.source_ip,prefix);
622
							printf(" %s ",prefix);
623
							break;
624
#endif
625
						case AFI_IP:
626
						default:
627
							if (entry->body.zebra_message.source_ip.v4_addr.s_addr != 0x00000000L)
628
		    						printf(" %s ",inet_ntoa(entry->body.zebra_message.source_ip.v4_addr));
629
							else
630
								printf(" N/A ");
631
					}
632
				printf("AS%u\n",entry->body.zebra_message.source_as);
633
	                    }
634
			    if (entry->body.zebra_message.destination_as)
635
		            {
636
				printf("TO:");
637
				switch(entry->body.zebra_message.address_family)
638
					{
639
#ifdef BGPDUMP_HAVE_IPV6
640
						case AFI_IP6:
641
642
							fmt_ipv6(entry->body.zebra_message.destination_ip,prefix);
643
							printf(" %s ",prefix);
644
							break;
645
#endif
646
						case AFI_IP:
647
						default:
648
							if (entry->body.zebra_message.destination_ip.v4_addr.s_addr != 0x00000000L)
649
		    						printf(" %s ",inet_ntoa(entry->body.zebra_message.destination_ip.v4_addr));
650
							else
651
								printf(" N/A ");
652
					}
653
		    		printf("AS%u\n",entry->body.zebra_message.destination_as);
654
                            }
655
656
		            switch (entry->body.zebra_message.error_code)
657
			    {
658
			    case 	1:
659
				    printf("    ERROR CODE  : 1 (Message Header Error)\n");
660
				    switch(entry->body.zebra_message.sub_error_code)
661
				    {
662
				    case	1:
663
					    printf("    SUB ERROR   : 1 (Connection Not Synchronized)\n");
664
					    break;
665
					    
666
				    case	2:
667
					    printf("    SUB ERROR   : 2 (Bad Message Length)\n");
668
					    break;
669
670
				    case	3:
671
					    printf("    SUB ERROR   : 3 (Bad Message Type)\n");
672
					    break;
673
					    
674
				    default:
675
					    printf("    SUB ERROR   : %d\n",entry->body.zebra_message.sub_error_code);
676
					    break;
677
			            }
678
				    break;
679
			    case	2:
680
                                    printf("    ERROR CODE  : 2 (OPEN Message Error)\n");
681
				    switch(entry->body.zebra_message.sub_error_code)
682
				    {
683
				    case	1:
684
					    printf("    SUB ERROR   : 1 (Unsupported Version Number)\n");
685
					    break;
686
					    
687
				    case	2:
688
					    printf("    SUB ERROR   : 2 (Bad Peer AS)\n");
689
					    break;
690
691
				    case	3:
692
					    printf("    SUB ERROR   : 3 (Bad BGP Identifier)\n");
693
					    break;
694
			           
695
				    case	4:
696
					    printf("    SUB ERROR   : 4 (Unsupported Optional Parameter)\n");
697
					    break;
698
699
				    case	5:
700
					    printf("    SUB ERROR   : 5 (Authentication Failure)\n");
701
					    break;
702
703
				    case	6:
704
					    printf("    SUB ERROR   : 6 (Unacceptable Hold Time)\n");
705
					    break;
706
					    
707
				    default:
708
					    printf("    SUB ERROR   : %d\n",entry->body.zebra_message.sub_error_code);
709
					    break;
710
			            }
711
				    break;
712
			    case	3:
713
				    printf("    ERROR CODE  : 3 (UPDATE Message Error)\n");
714
				    switch(entry->body.zebra_message.sub_error_code)
715
				    {
716
				    case	1:
717
					    printf("    SUB ERROR   : 1 (Malformed Attribute List)\n");
718
					    break;
719
					    
720
				    case	2:
721
					    printf("    SUB ERROR   : 2 (Unrecognized Well-known Attribute)\n");
722
					    break;
723
724
				    case	3:
725
					    printf("    SUB ERROR   : 3 (Missing Well-known Attribute)\n");
726
					    break;
727
			           
728
				    case	4:
729
					    printf("    SUB ERROR   : 4 (Attribute Flags Error)\n");
730
					    break;
731
732
				    case	5:
733
					    printf("    SUB ERROR   : 5 (Attribute Length Error)\n");
734
					    break;
735
736
				    case	6:
737
					    printf("    SUB ERROR   : 6 (Invalid ORIGIN Attribute)\n");
738
					    break;
739
				
740
				    case	7:
741
					    printf("    SUB ERROR   : 7 (AS Routing Loop)\n");
742
					    break;
743
					    
744
				    case	8:
745
					    printf("    SUB ERROR   : 8 (Invalid NEXT-HOP Attribute)\n");
746
					    break;
747
748
				    case	9:
749
					    printf("    SUB ERROR   : 9 (Optional Attribute Error)\n");
750
					    break;
751
			           
752
				    case	10:
753
					    printf("    SUB ERROR   : 10 (Invalid Network Field)\n");
754
					    break;
755
756
				    case	11:
757
					    printf("    SUB ERROR   : 11 (Malformed AS-PATH)\n");
758
					    break;
759
	    
760
				    default:
761
					    printf("    SUB ERROR   : %d\n",entry->body.zebra_message.sub_error_code);
762
					    break;
763
			            }
764
				    break;
765
			    case	4:
766
				    printf("    ERROR CODE  : 4 (Hold Timer Expired)\n");
767
				    break;
768
			    case	5:
769
				    printf("    ERROR CODE  : 5 (Finite State Machine Error)\n");
770
				    break;
771
			    case	6:
772
                                    printf("    ERROR CODE  : 6 (Cease)\n");
773
				    break;
774
			    default:
775
				    printf("    ERROR CODE  : %d\n",entry->body.zebra_message.error_code);	
776
				    break;
777
					    
778
			    }
779
			    break;
780
			    
781
			case BGP_MSG_KEEPALIVE:
782
			    	if ( mode != 0)
783
					break;
784
785
			    	printf("TYPE: BGP4MP/MESSAGE/Keepalive\n");
786
				if (entry->body.zebra_message.source_as)
787
				{
788
					printf("FROM:");
789
					switch(entry->body.zebra_message.address_family)
790
					{
791
#ifdef BGPDUMP_HAVE_IPV6
792
						case AFI_IP6:
793
794
							fmt_ipv6(entry->body.zebra_message.source_ip,prefix);
795
							printf(" %s ",prefix);
796
							break;
797
#endif
798
						case AFI_IP:
799
						default:
800
							if (entry->body.zebra_message.source_ip.v4_addr.s_addr != 0x00000000L)
801
		    						printf(" %s ",inet_ntoa(entry->body.zebra_message.source_ip.v4_addr));
802
							else
803
								printf(" N/A ");
804
					}
805
					printf("AS%u\n",entry->body.zebra_message.source_as);
806
				}
807
				if (entry->body.zebra_message.destination_as)
808
				{
809
					printf("TO:");
810
					switch(entry->body.zebra_message.address_family)
811
					{
812
#ifdef BGPDUMP_HAVE_IPV6
813
						case AFI_IP6:
814
815
							fmt_ipv6(entry->body.zebra_message.destination_ip,prefix);
816
							printf(" %s ",prefix);
817
							break;
818
#endif
819
						case AFI_IP:
820
						default:
821
							if (entry->body.zebra_message.destination_ip.v4_addr.s_addr != 0x00000000L)
822
		    						printf(" %s ",inet_ntoa(entry->body.zebra_message.destination_ip.v4_addr));
823
							else
824
								printf(" N/A ");
825
					}
826
		    			printf("AS%u\n",entry->body.zebra_message.destination_as);
827
				}
828
829
830
			    	break;
831
		    }
832
		    break;
833
834
		case BGPDUMP_SUBTYPE_ZEBRA_BGP_STATE_CHANGE:
835
		case BGPDUMP_SUBTYPE_ZEBRA_BGP_STATE_CHANGE_AS4:
836
		    if (mode==0)
837
		    {
838
		    	printf("TYPE: BGP4MP/STATE_CHANGE\n");
839
840
		    	printf("PEER:");
841
			switch(entry->body.zebra_state_change.address_family)
842
			{
843
#ifdef BGPDUMP_HAVE_IPV6
844
			case AFI_IP6:
845
846
				fmt_ipv6(entry->body.zebra_state_change.source_ip,prefix);
847
				printf(" %s ",prefix);
848
				break;
849
#endif
850
			case AFI_IP:
851
			default:
852
				if (entry->body.zebra_state_change.source_ip.v4_addr.s_addr != 0x00000000L)
853
		    			printf(" %s ",inet_ntoa(entry->body.zebra_message.source_ip.v4_addr));
854
				else
855
					printf(" N/A ");
856
			}	
857
		    	//if (entry->body.zebra_message.source_ip.s_addr != 0x00000000L)
858
		    	//	printf(" %s ",inet_ntoa(entry->body.zebra_message.source_ip));
859
		    	//else
860
			//	printf(" N/A ");
861
		    	printf("AS%u\n",entry->body.zebra_state_change.source_as);
862
863
		    	printf("STATE: %s/%s\n",bgp_state_name[entry->body.zebra_state_change.old_state],bgp_state_name[entry->body.zebra_state_change.new_state]);
864
		    }
865
		    else if (mode==1 || mode==2 ) //-m -M
866
		    {
867
			switch(entry->body.zebra_state_change.address_family)
868
			{
869
#ifdef BGPDUMP_HAVE_IPV6
870
				case AFI_IP6:
871
					fmt_ipv6(entry->body.zebra_state_change.source_ip,prefix);
872
                                        show_line_prefix("BGP4MP", entry->time, time_str, "STATE");
873
                                        printf("%s|%u|%d|%d\n",
874
                                               prefix,
875
                                               entry->body.zebra_state_change.source_as,
876
                                               entry->body.zebra_state_change.old_state,
877
                                               entry->body.zebra_state_change.new_state);
878
					break;
879
#endif
880
				case AFI_IP:
881
				default:
882
                                        show_line_prefix("BGP4MP", entry->time, time_str, "STATE");
883
                                        printf("%s|%u|%d|%d\n",
884
                                               inet_ntoa(entry->body.zebra_state_change.source_ip.v4_addr),
885
                                               entry->body.zebra_state_change.source_as,
886
                                               entry->body.zebra_state_change.old_state,
887
                                               entry->body.zebra_state_change.new_state);
888
					break;
889
			}
890
		    }
891
		    break;
892
		
893
	    } 
894
	    break;
895
    }
896
    if (mode==0)
897
    	printf("\n");
898
}
899
900
// print line prefix with respect of mode and show_packet_index flags
901
// output will have format:
902
// format|[packet_index|]time|type|
903
void show_line_prefix(const char* format, long long ts, const char* time_str, const char* type)
904
{
905
    printf("%s|", format);
906
    if (show_packet_index)
907
        printf("%d|", packet_index);
908
909
    if (mode == 1)
910
        printf("%lld|", ts);
911
    else 
912
        printf("%s|", time_str);
913
914
    printf("%s|", type);
915
} 
916
917
918
void process_bgpdump_mrtd_bgp(BGPDUMP_ENTRY *entry) {
919
    struct tm *date;
920
    char time_str[128];
921
    date=gmtime(&entry->time);
922
    time2str(date,time_str);	
923
924
    switch (entry->subtype) {
925
    case BGPDUMP_SUBTYPE_MRTD_BGP_UPDATE:
926
    case BGPDUMP_SUBTYPE_MRTD_BGP_KEEPALIVE:
927
        if (mode == 0) {
928
            if (entry->subtype == BGPDUMP_SUBTYPE_MRTD_BGP_UPDATE)
929
                printf("TYPE: BGP/MESSAGE/Update\n");
930
            else
931
                printf("TYPE: BGP/MESSAGE/Keepalive\n"); 
932
            if (entry->body.mrtd_message.source_as) {
933
                printf("FROM:");
934
                show_ipv4_address(entry->body.mrtd_message.source_ip);
935
                printf("AS%u\n", entry->body.mrtd_message.source_as);
936
            }
937
            if (entry->body.mrtd_message.destination_as) {
938
                printf("TO:");
939
                show_ipv4_address(entry->body.mrtd_message.destination_ip);
940
                printf("AS%u\n", entry->body.mrtd_message.destination_as);                
941
            }
942
            if (entry->attr && entry->attr->len)
943
                show_attr(entry->attr);
944
            if (entry->body.mrtd_message.withdraw_count) {
945
                printf("WITHDRAW\n");
946
                show_prefixes(entry->body.mrtd_message.withdraw_count, entry->body.mrtd_message.withdraw);
947
            }
948
            if (entry->body.mrtd_message.announce_count) {
949
                printf("ANNOUNCE\n");
950
                show_prefixes(entry->body.mrtd_message.announce_count, entry->body.mrtd_message.announce);
951
            }
952
        }
953
        else {
954
            if (entry->subtype != BGPDUMP_SUBTYPE_MRTD_BGP_UPDATE)
955
                break;
956
            if (entry->body.mrtd_message.withdraw_count)
957
                mrtd_table_line_withdraw(entry->body.mrtd_message.withdraw, entry->body.mrtd_message.withdraw_count,
958
                                         entry, time_str);
959
            if (entry->body.mrtd_message.announce_count)
960
                mrtd_table_line_announce(entry->body.mrtd_message.announce, entry->body.mrtd_message.announce_count,
961
                                         entry, time_str);
962
        }
963
        break;
964
    case BGPDUMP_SUBTYPE_MRTD_BGP_STATE_CHANGE:
965
        if (mode == 0) {
966
            printf("TYPE: BGP/STATE_CHANGE\n");
967
            printf("PEER:");
968
            show_ipv4_address(entry->body.mrtd_state_change.destination_ip);
969
            printf("AS%u\n", entry->body.mrtd_state_change.destination_as);
970
            printf("STATE: %s/%s\n", bgp_state_name[entry->body.mrtd_state_change.old_state],
971
                   bgp_state_name[entry->body.mrtd_state_change.new_state]);
972
        }
973
        else if (mode == 1 || mode == 2) {
974
            show_line_prefix("BGP", entry->time, time_str, "STATE");
975
            printf("%s|%u|%d|%d\n",
976
                   inet_ntoa(entry->body.mrtd_state_change.destination_ip),
977
                   entry->body.mrtd_state_change.destination_as,
978
                   entry->body.mrtd_state_change.old_state,
979
                   entry->body.mrtd_state_change.new_state);
980
        }
981
        break;
982
    default:
983
        if (mode == 0) {
984
            printf("TYPE: Subtype %d not supported yet\n", entry->subtype);
985
        }
986
    }
987
}
988
989
990
void mrtd_table_line_withdraw(struct prefix *prefix, int count, BGPDUMP_ENTRY *entry, char *time_str) {
991
    int i;
992
993
    for (i = 0; i < count; i++) {
994
        show_line_prefix("BGP", entry->time, time_str, "W");
995
        printf("%s|%u|%s/%d\n", inet_ntoa(entry->body.mrtd_message.source_ip),
996
               entry->body.mrtd_message.source_as,
997
               inet_ntoa(prefix[i].address.v4_addr), prefix[i].len);
998
    }
999
}
1000
1001
1002
void mrtd_table_line_announce(struct prefix *prefix, int count, BGPDUMP_ENTRY *entry, char *time_str) {
1003
    int i, npref, nmed;
1004
    char *aggregate = entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ATOMIC_AGGREGATE) ? "AG" : "NAG";
1005
1006
    for (i = 0; i < count; i++) {
1007
        show_line_prefix("BGP", entry->time, time_str, "A");
1008
        printf("%s|%u", inet_ntoa(entry->body.mrtd_message.source_ip),
1009
               entry->body.mrtd_message.source_as);
1010
        printf("|%s/%d|%s|%s", inet_ntoa(prefix[i].address.v4_addr), prefix[i].len,
1011
               attr_aspath(entry->attr), describe_origin(entry->attr->origin));
1012
        if (mode == 1) {
1013
            npref = ((entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF)) == 0) ? 0 : entry->attr->local_pref;
1014
            nmed  = ((entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC)) == 0) ? 0 : entry->attr->med;
1015
            printf("|%s|%u|%u", inet_ntoa(entry->attr->nexthop), npref, nmed);
1016
1017
            if ((entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES)) != 0)
1018
                printf("%s|%s|", entry->attr->community->str+1, aggregate);
1019
            else
1020
                printf("|%s|", aggregate);
1021
				
1022
            if (entry->attr->aggregator_addr.s_addr != -1)
1023
                printf("%u %s|\n", entry->attr->aggregator_as, inet_ntoa(entry->attr->aggregator_addr));
1024
            else
1025
                printf("|\n");
1026
        }
1027
        else
1028
            printf("\n");
1029
    }
1030
}
1031
1032
1033
1034
void show_ipv4_address(struct in_addr ip) {
1035
    if (ip.s_addr != 0x00000000L)
1036
        printf(" %s ", inet_ntoa(ip));
1037
    else
1038
        printf(" N/A ");
1039
}
1040
1041
1042
void show_attr(attributes_t *attr) {
1043
    
1044
    if(attr != NULL) {
1045
1046
	    if( (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_ORIGIN) ) !=0 )
1047
	    {
1048
		    switch (attr->origin)
1049
		    {
1050
	            case 0:
1051
			    printf("ORIGIN: IGP\n");
1052
			    break;
1053
		    case 1:
1054
			    printf("ORIGIN: EGP\n");
1055
		 	    break;
1056
	            case 2:
1057
			    printf("ORIGIN: INCOMPLETE\n");
1058
				    
1059
		    }
1060
		   
1061
	    }
1062
1063
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_AS_PATH) ) !=0)		
1064
		    printf("ASPATH: %s\n",attr->aspath->str);
1065
1066
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP) ) !=0)		
1067
		    printf("NEXT_HOP: %s\n",inet_ntoa(attr->nexthop));
1068
1069
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC) ) !=0)	
1070
		    printf("MULTI_EXIT_DISC: %u\n",attr->med);
1071
1072
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF) ) !=0)		
1073
		    printf("LOCAL_PREF: %u\n",attr->local_pref);
1074
1075
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ATOMIC_AGGREGATE) ) !=0)	
1076
		    printf("ATOMIC_AGGREGATE\n");
1077
1078
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_AGGREGATOR) ) !=0)		
1079
		    printf("AGGREGATOR: AS%u %s\n",attr->aggregator_as,inet_ntoa(attr->aggregator_addr));
1080
1081
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID) ) !=0)
1082
			printf("ORIGINATOR_ID: %s\n",inet_ntoa(attr->originator_id));
1083
	
1084
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_CLUSTER_LIST) ) !=0)
1085
		{
1086
			int cluster_index;
1087
1088
			printf("CLUSTER_LIST: ");
1089
1090
			for (cluster_index = 0;cluster_index<attr->cluster->length;cluster_index++)
1091
				printf("%s ",inet_ntoa(attr->cluster->list[cluster_index]));
1092
			printf("\n");
1093
		}
1094
1095
            int idx;
1096
            for (idx=0;idx<attr->unknown_num;idx++)
1097
            {
1098
                struct unknown_attr *unknown = attr->unknown + idx;
1099
                printf("   UNKNOWN_ATTR(%i, %i, %i):", unknown->flag, unknown->type, unknown->len);
1100
                int b;
1101
                for(b = 0; b < unknown->len; ++b)
1102
                    printf(" %02x", unknown->raw[b]);
1103
                printf("\n");
1104
            }
1105
1106
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MP_REACH_NLRI) )!=0)
1107
	    {
1108
		    printf("MP_REACH_NLRI");
1109
#ifdef BGPDUMP_HAVE_IPV6
1110
		    if (attr->mp_info->announce[AFI_IP6][SAFI_UNICAST] || attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST] || attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST])
1111
1112
		    {
1113
			   char buf[128];
1114
			    
1115
			   if (attr->mp_info->announce[AFI_IP6][SAFI_UNICAST])
1116
			   {
1117
				   printf("(IPv6 Unicast)\n");
1118
			   	   printf("NEXT_HOP: %s\n",fmt_ipv6(attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->nexthop,buf));
1119
			           if (attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->nexthop_len==32)
1120
					printf("NEXT_HOP: %s\n",fmt_ipv6(attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->nexthop_local,buf));
1121
			   }
1122
			   else if (attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST])	 
1123
		  	   {
1124
			   	   printf("(IPv6 Multicast)\n");
1125
				   printf("NEXT_HOP: %s\n",fmt_ipv6(attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->nexthop,buf));
1126
			           if (attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->nexthop_len==32)
1127
					printf("NEXT_HOP: %s\n",fmt_ipv6(attr->mp_info->announce[AFI_IP6][SAFI_MULTICAST]->nexthop_local,buf));
1128
1129
		           }
1130
			   else
1131
		           {
1132
				   printf("(IPv6 Both unicast and multicast)\n");
1133
				   printf("NEXT_HOP: %s\n",fmt_ipv6(attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->nexthop,buf));
1134
			           if (attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->nexthop_len==32)
1135
					printf("NEXT_HOP: %s\n",fmt_ipv6(attr->mp_info->announce[AFI_IP6][SAFI_UNICAST_MULTICAST]->nexthop_local,buf));
1136
1137
1138
			   }
1139
		    }
1140
		    else
1141
#endif
1142
		    {
1143
			   
1144
			   if (attr->mp_info->announce[AFI_IP][SAFI_UNICAST])
1145
			   {
1146
				   printf("(IPv4 Unicast)\n");
1147
				   printf("NEXT_HOP: %s\n",inet_ntoa(attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->nexthop.v4_addr));
1148
			           if (attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->nexthop_len==32)
1149
					printf("NEXT_HOP: %s\n",inet_ntoa(attr->mp_info->announce[AFI_IP][SAFI_UNICAST]->nexthop_local.v4_addr));
1150
			  
1151
			   }
1152
			   else if (attr->mp_info->announce[AFI_IP][SAFI_MULTICAST])	 
1153
		  	   {
1154
			   	   printf("(IPv4 Multicast)\n");
1155
			           printf("NEXT_HOP: %s\n",inet_ntoa(attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->nexthop.v4_addr));
1156
			           if (attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->nexthop_len==32)
1157
					printf("NEXT_HOP: %s\n",inet_ntoa(attr->mp_info->announce[AFI_IP][SAFI_MULTICAST]->nexthop_local.v4_addr));
1158
			  
1159
		
1160
		           }
1161
			   else if (attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST])
1162
		           {
1163
				   printf("(IPv4 Both unicast and multicast)\n");
1164
				   printf("NEXT_HOP: %s\n",inet_ntoa(attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->nexthop.v4_addr));
1165
			           if (attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->nexthop_len==32)
1166
					printf("NEXT_HOP: %s\n",inet_ntoa(attr->mp_info->announce[AFI_IP][SAFI_UNICAST_MULTICAST]->nexthop_local.v4_addr));
1167
			  
1168
1169
			   }
1170
  
1171
		    }
1172
	    }
1173
	    
1174
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MP_UNREACH_NLRI) )!=0)
1175
	    {
1176
		    printf("MP_UNREACH_NLRI");
1177
#ifdef BGPDUMP_HAVE_IPV6
1178
		    if (attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST] || attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST] || attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST_MULTICAST])
1179
1180
		    {
1181
			    
1182
			   if (attr->mp_info->withdraw[AFI_IP6][SAFI_UNICAST])
1183
			   {
1184
				   printf("(IPv6 Unicast)\n");
1185
			   }
1186
			   else if (attr->mp_info->withdraw[AFI_IP6][SAFI_MULTICAST])	 
1187
		  	   {
1188
			   	   printf("(IPv6 Multicast)\n");
1189
1190
		           }
1191
			   else
1192
		           {
1193
				   printf("(IPv6 Both unicast and multicast)\n");
1194
1195
1196
			   }
1197
		    }
1198
		    else
1199
#endif
1200
		    {
1201
			   
1202
			   if (attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST])
1203
			   {
1204
				   printf("(IPv4 Unicast)\n");
1205
			  
1206
			   }
1207
			   else if (attr->mp_info->withdraw[AFI_IP][SAFI_MULTICAST])	 
1208
		  	   {
1209
			   	   printf("(IPv4 Multicast)\n");
1210
			  
1211
		
1212
		           }
1213
			   else if (attr->mp_info->withdraw[AFI_IP][SAFI_UNICAST_MULTICAST])
1214
		           {
1215
				   printf("(IPv4 Both unicast and multicast)\n");
1216
			  
1217
1218
			   }
1219
  
1220
		    }
1221
	    } 
1222
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES) ) !=0)	
1223
		    printf("COMMUNITY:%s\n",attr->community->str);
1224
    }
1225
 
1226
}
1227
1228
void show_prefixes(int count,struct prefix *prefix) {
1229
    int i;
1230
    for(i=0;i<count;i++)
1231
	printf("  %s/%d\n",inet_ntoa(prefix[i].address.v4_addr),prefix[i].len);
1232
}
1233
#ifdef BGPDUMP_HAVE_IPV6
1234
void show_prefixes6(int count,struct prefix *prefix)
1235
{
1236
	int i;
1237
	char buf[128];
1238
1239
	for (i=0;i<count;i++)
1240
	 printf("  %s/%d\n",fmt_ipv6(prefix[i].address,buf),prefix[i].len);
1241
}
1242
#endif
1243
1244
1245
static void table_line_withdraw(struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str)
1246
{
1247
	int idx;
1248
	char buf[128];
1249
	
1250
	for (idx=0;idx<count;idx++)
1251
	{
1252
            show_line_prefix("BGP4MP", entry->time, time_str, "W");
1253
            switch(entry->body.zebra_message.address_family)
1254
            {
1255
#ifdef BGPDUMP_HAVE_IPV6
1256
            case AFI_IP6:
1257
                printf("%s|%u|",
1258
                       fmt_ipv6(entry->body.zebra_message.source_ip,buf),
1259
                       entry->body.zebra_message.source_as);
1260
                break;
1261
#endif
1262
            case AFI_IP:
1263
            default:
1264
                printf("%s|%u|",
1265
                       inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),
1266
                       entry->body.zebra_message.source_as);
1267
                break;
1268
            }
1269
            printf("%s/%d\n",inet_ntoa(prefix[idx].address.v4_addr),prefix[idx].len);
1270
        }
1271
}
1272
1273
#ifdef BGPDUMP_HAVE_IPV6
1274
1275
static void table_line_withdraw6(struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str)
1276
{
1277
	int idx;
1278
	char buf[128];
1279
	char buf1[128];
1280
1281
	for (idx=0;idx<count;idx++)
1282
	{
1283
            show_line_prefix("BGP4MP", entry->time, time_str, "W");
1284
            switch(entry->body.zebra_message.address_family)
1285
            {
1286
            case AFI_IP6:
1287
                printf("%s|%u|%s/%d\n",
1288
                       fmt_ipv6(entry->body.zebra_message.source_ip,buf1),
1289
                       entry->body.zebra_message.source_as,
1290
                       fmt_ipv6(prefix[idx].address,buf),prefix[idx].len);
1291
                break;
1292
            case AFI_IP:
1293
            default:
1294
                printf("%s|%u|%s/%d\n",
1295
                       fmt_ipv4(entry->body.zebra_message.source_ip,buf1),
1296
                       entry->body.zebra_message.source_as,
1297
                       fmt_ipv6(prefix[idx].address,buf),prefix[idx].len);
1298
                break;
1299
            }
1300
        }	
1301
}
1302
#endif
1303
1304
1305
static void table_line_announce(struct prefix *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str)
1306
{
1307
	int idx  ;
1308
	char buf[128];
1309
	char tmp2[20];
1310
	unsigned int npref;
1311
	unsigned int nmed;
1312
1313
	if (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ATOMIC_AGGREGATE))
1314
		sprintf(tmp2,"AG");
1315
	else
1316
		sprintf(tmp2,"NAG");
1317
1318
	for (idx=0;idx<count;idx++)
1319
	{
1320
                show_line_prefix("BGP4MP", entry->time, time_str, "A");
1321
		if (mode == 1)
1322
		{
1323
			switch(entry->body.zebra_message.address_family)
1324
			{
1325
#ifdef BGPDUMP_HAVE_IPV6
1326
			case AFI_IP6:
1327
				printf("%s|%u|",fmt_ipv6(entry->body.zebra_message.source_ip,buf),entry->body.zebra_message.source_as);
1328
				break;
1329
#endif
1330
			case AFI_IP:
1331
			default:
1332
				printf("%s|%u|",inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),entry->body.zebra_message.source_as);
1333
				break;
1334
			}
1335
			printf("%s/%d|%s|%s|",inet_ntoa(prefix[idx].address.v4_addr),prefix[idx].len,attr_aspath(entry->attr),describe_origin(entry->attr->origin));
1336
		    npref=entry->attr->local_pref;
1337
	            if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF) ) ==0)
1338
	            npref=0;
1339
		    nmed=entry->attr->med;
1340
	            if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC) ) ==0)
1341
	            nmed=0;
1342
			    
1343
			printf("%s|%u|%u|",inet_ntoa(entry->attr->nexthop),npref,nmed);
1344
			if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES) ) !=0)	
1345
		    		printf("%s|%s|",entry->attr->community->str+1,tmp2);
1346
			else
1347
				printf("|%s|",tmp2);
1348
				
1349
			if (entry->attr->aggregator_addr.s_addr != -1)
1350
				printf("%u %s|\n",entry->attr->aggregator_as,inet_ntoa(entry->attr->aggregator_addr));
1351
			else
1352
				printf("|\n");
1353
		}
1354
		else
1355
		{
1356
			switch(entry->body.zebra_message.address_family)
1357
			{
1358
#ifdef BGPDUMP_HAVE_IPV6
1359
			case AFI_IP6:
1360
				printf("%s|%u|",fmt_ipv6(entry->body.zebra_message.source_ip,buf),entry->body.zebra_message.source_as);
1361
				break;
1362
#endif
1363
			case AFI_IP:
1364
			default:
1365
				printf("%s|%u|",inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),entry->body.zebra_message.source_as);
1366
				break;
1367
			}
1368
			printf("%s/%d|%s|%s\n",inet_ntoa(prefix[idx].address.v4_addr),prefix[idx].len,attr_aspath(entry->attr),describe_origin(entry->attr->origin));
1369
				
1370
		}
1371
	}
1372
1373
}
1374
static void table_line_announce_1(struct mp_nlri *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str)
1375
{
1376
	int idx  ;
1377
	char buf[128];
1378
	char tmp2[20];
1379
	unsigned int npref;
1380
	unsigned int nmed;
1381
1382
	if (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ATOMIC_AGGREGATE))
1383
		sprintf(tmp2,"AG");
1384
	else
1385
		sprintf(tmp2,"NAG");
1386
1387
	for (idx=0;idx<count;idx++)
1388
	{
1389
                show_line_prefix("BGP4MP", entry->time, time_str, "A");
1390
		if (mode == 1)
1391
		{
1392
			if (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MP_REACH_NLRI))
1393
			{
1394
				switch(entry->body.zebra_message.address_family)
1395
				{
1396
#ifdef BGPDUMP_HAVE_IPV6
1397
				case AFI_IP6:
1398
					printf("%s|%u|",fmt_ipv6(entry->body.zebra_message.source_ip,buf),entry->body.zebra_message.source_as);
1399
					break;
1400
#endif
1401
				case AFI_IP:
1402
				default:
1403
					printf("%s|%u|",inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),entry->body.zebra_message.source_as);
1404
					break;
1405
				}
1406
				printf("%s/%d|%s|%s|",inet_ntoa(prefix->nlri[idx].address.v4_addr),prefix->nlri[idx].len,attr_aspath(entry->attr),describe_origin(entry->attr->origin));
1407
1408
		    npref=entry->attr->local_pref;
1409
	            if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF) ) ==0)
1410
	            npref=0;
1411
		    nmed=entry->attr->med;
1412
	            if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC) ) ==0)
1413
	            nmed=0;
1414
			    
1415
			printf("%s|%d|%d|",inet_ntoa(entry->attr->nexthop),npref,nmed);
1416
				//printf("%s|%d|%d|",inet_ntoa(prefix->nexthop.v4_addr),entry->attr->local_pref,entry->attr->med);
1417
				if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES) ) !=0)	
1418
		    			printf("%s|%s|",entry->attr->community->str+1,tmp2);
1419
				else
1420
					printf("|%s|",tmp2);
1421
1422
			}
1423
			else 
1424
			{
1425
				switch(entry->body.zebra_message.address_family)
1426
				{
1427
#ifdef BGPDUMP_HAVE_IPV6
1428
				case AFI_IP6:
1429
					printf("%s|%u|",fmt_ipv6(entry->body.zebra_message.source_ip,buf),entry->body.zebra_message.source_as);
1430
					break;
1431
#endif
1432
				case AFI_IP:
1433
				default:
1434
					printf("%s|%u|",inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),entry->body.zebra_message.source_as);
1435
					break;
1436
				}
1437
				printf("%s/%d|%s|%s|",inet_ntoa(prefix->nlri[idx].address.v4_addr),prefix->nlri[idx].len,attr_aspath(entry->attr),describe_origin(entry->attr->origin));
1438
1439
		    npref=entry->attr->local_pref;
1440
	            if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF) ) ==0)
1441
	            npref=0;
1442
		    nmed=entry->attr->med;
1443
	            if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC) ) ==0)
1444
	            nmed=0;
1445
			    
1446
			printf("%s|%d|%d|",inet_ntoa(entry->attr->nexthop),npref,nmed);
1447
				//printf("%s|%d|%d|",inet_ntoa(entry->attr->nexthop),entry->attr->local_pref,entry->attr->med);
1448
				if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES) ) !=0)	
1449
		    			printf("%s|%s|",entry->attr->community->str+1,tmp2);
1450
				else
1451
					printf("|%s|",tmp2);
1452
1453
1454
			}
1455
			if (entry->attr->aggregator_addr.s_addr != -1)
1456
				printf("%u %s|\n",entry->attr->aggregator_as,inet_ntoa(entry->attr->aggregator_addr));
1457
			else
1458
				printf("|\n");
1459
		}
1460
		else
1461
		{
1462
			switch(entry->body.zebra_message.address_family)
1463
			{
1464
#ifdef BGPDUMP_HAVE_IPV6
1465
			case AFI_IP6:
1466
				printf("%s|%u|",fmt_ipv6(entry->body.zebra_message.source_ip,buf),entry->body.zebra_message.source_as);
1467
				break;
1468
#endif
1469
			case AFI_IP:
1470
			default:
1471
				printf("%s|%u|",inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),entry->body.zebra_message.source_as);
1472
				break;
1473
			}
1474
			printf("%s/%d|%s|%s\n",inet_ntoa(prefix->nlri[idx].address.v4_addr),prefix->nlri[idx].len,attr_aspath(entry->attr),describe_origin(entry->attr->origin));
1475
				
1476
		}
1477
	}
1478
1479
}
1480
1481
#ifdef BGPDUMP_HAVE_IPV6
1482
static void table_line_announce6(struct mp_nlri *prefix,int count,BGPDUMP_ENTRY *entry,char *time_str)
1483
{
1484
	int idx  ;
1485
	char buf[128];
1486
	char buf1[128];
1487
	char buf2[128];
1488
	char tmp2[20];
1489
	unsigned int npref;
1490
	unsigned int nmed;
1491
1492
	if (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ATOMIC_AGGREGATE))
1493
		sprintf(tmp2,"AG");
1494
	else
1495
		sprintf(tmp2,"NAG");
1496
1497
	for (idx=0;idx<count;idx++)
1498
	{
1499
                show_line_prefix("BGP4MP", entry->time, time_str, "A");
1500
		if (mode == 1)
1501
		{
1502
			switch(entry->body.zebra_message.address_family)
1503
			{
1504
			case AFI_IP6:
1505
				
1506
		    npref=entry->attr->local_pref;
1507
	            if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF) ) ==0)
1508
	            npref=0;
1509
		    nmed=entry->attr->med;
1510
	            if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC) ) ==0)
1511
	            nmed=0;
1512
			    
1513
				printf("%s|%u|%s/%d|%s|%s|%s|%u|%u|",fmt_ipv6(entry->body.zebra_message.source_ip,buf1),entry->body.zebra_message.source_as,fmt_ipv6(prefix->nlri[idx].address,buf2),prefix->nlri[idx].len,attr_aspath(entry->attr),describe_origin(entry->attr->origin),fmt_ipv6(prefix->nexthop,buf),npref,nmed);
1514
				break;
1515
			case AFI_IP:
1516
			default:
1517
1518
		    npref=entry->attr->local_pref;
1519
	            if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF) ) ==0)
1520
	            npref=0;
1521
		    nmed=entry->attr->med;
1522
	            if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC) ) ==0)
1523
	            nmed=0;
1524
			    
1525
			//printf("%s|%d|%d|",inet_ntoa(entry->attr->nexthop),nprof,nmed);
1526
                    printf("%s|%u|%s/%d|%s|%s|%s|%u|%u|",fmt_ipv4(entry->body.zebra_message.source_ip,buf1),entry->body.zebra_message.source_as,fmt_ipv6(prefix->nlri[idx].address,buf2),prefix->nlri[idx].len,attr_aspath(entry->attr),describe_origin(entry->attr->origin),fmt_ipv6(prefix->nexthop,buf),npref,nmed);
1527
				break;
1528
			}
1529
			if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES) ) !=0)	
1530
		    		printf("%s|%s|",entry->attr->community->str+1,tmp2);
1531
			else
1532
				printf("|%s|",tmp2);
1533
1534
1535
			if (entry->attr->aggregator_addr.s_addr != -1)
1536
				printf("%u %s|\n",entry->attr->aggregator_as,inet_ntoa(entry->attr->aggregator_addr));
1537
			else
1538
				printf("|\n");
1539
1540
		}
1541
		else
1542
		{
1543
			switch(entry->body.zebra_message.address_family)
1544
			{
1545
			case AFI_IP6:
1546
				printf("%s|%u|%s/%d|%s|%s\n",fmt_ipv6(entry->body.zebra_message.source_ip,buf1),entry->body.zebra_message.source_as,fmt_ipv6(prefix->nlri[idx].address,buf),prefix->nlri[idx].len,attr_aspath(entry->attr),describe_origin(entry->attr->origin));
1547
				break;
1548
			case AFI_IP:
1549
			default:
1550
				printf("%s|%u|%s/%d|%s|%s\n",fmt_ipv4(entry->body.zebra_message.source_ip,buf1),entry->body.zebra_message.source_as,fmt_ipv6(prefix->nlri[idx].address,buf),prefix->nlri[idx].len,attr_aspath(entry->attr),describe_origin(entry->attr->origin));
1551
				break;
1552
			}
1553
		}		
1554
1555
	}
1556
1557
}
1558
#endif
1559
1560
1561
static void table_line_mrtd_route(BGPDUMP_MRTD_TABLE_DUMP *route,BGPDUMP_ENTRY *entry)
1562
{
1563
	
1564
	struct tm *date = NULL;
1565
	char tmp2[20];	
1566
	unsigned int npref;
1567
	unsigned int nmed;
1568
	char  time_str[20];
1569
        char peer[BGPDUMP_ADDRSTRLEN], prefix[BGPDUMP_ADDRSTRLEN], nexthop[BGPDUMP_ADDRSTRLEN];
1570
1571
	if (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ATOMIC_AGGREGATE))
1572
		sprintf(tmp2,"AG");
1573
	else
1574
		sprintf(tmp2,"NAG");
1575
1576
        if (timetype==0) {
1577
            date=gmtime(&entry->time);
1578
            time2str(date,time_str);	
1579
            show_line_prefix("TABLE_DUMP", entry->time, time_str, "B");
1580
        }
1581
        else {
1582
            date=gmtime(&route->uptime);
1583
            time2str(date,time_str);	
1584
            show_line_prefix("TABLE_DUMP", route->uptime, time_str, "B");
1585
        }
1586
1587
#ifdef BGPDUMP_HAVE_IPV6
1588
	    	if (entry->subtype == AFI_IP6)
1589
		{
1590
		    fmt_ipv6(route->peer_ip,peer);
1591
		    fmt_ipv6(route->prefix,prefix);
1592
		}
1593
	    	else
1594
#endif
1595
                {
1596
		    strncpy(peer, inet_ntoa(route->peer_ip.v4_addr), BGPDUMP_ADDRSTRLEN);
1597
                    strncpy(prefix, inet_ntoa(route->prefix.v4_addr), BGPDUMP_ADDRSTRLEN);
1598
		}
1599
1600
		if (mode == 1)
1601
		{
1602
                    printf("%s|%u|",peer,route->peer_as);
1603
                    printf("%s/%d|%s|%s|",prefix,route->mask,
1604
                           attr_aspath(entry->attr),describe_origin(entry->attr->origin));
1605
1606
		    npref=entry->attr->local_pref;
1607
	            if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF) ) ==0)
1608
	            npref=0;
1609
		    nmed=entry->attr->med;
1610
	            if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC) ) ==0)
1611
	            nmed=0;
1612
			    
1613
#ifdef BGPDUMP_HAVE_IPV6
1614
	    	if ((entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MP_REACH_NLRI)) && entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST])
1615
		{
1616
		    fmt_ipv6(entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->nexthop,nexthop);
1617
		}
1618
	    	else
1619
#endif
1620
                {
1621
		    strncpy(nexthop, inet_ntoa(entry->attr->nexthop), BGPDUMP_ADDRSTRLEN);
1622
		}
1623
		   printf("%s|%u|%u|",nexthop,npref,nmed);
1624
1625
		   if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES) ) !=0)	
1626
		    		printf("%s|%s|",entry->attr->community->str+1,tmp2);
1627
			else
1628
				printf("|%s|",tmp2);
1629
				
1630
			if (entry->attr->aggregator_addr.s_addr != -1)
1631
				printf("%u %s|\n",entry->attr->aggregator_as,inet_ntoa(entry->attr->aggregator_addr));
1632
			else
1633
				printf("|\n");
1634
		}
1635
		else
1636
		{
1637
	 	    printf("%s|%u|",peer,route->peer_as);
1638
                    printf("%s/%d|%s|%s\n",prefix,route->mask,attr_aspath(entry->attr),describe_origin(entry->attr->origin));
1639
		}
1640
1641
}
1642
1643
static char *describe_origin(int origin) {
1644
    if(origin == 0) return "IGP";
1645
    if(origin == 1) return "EGP";
1646
    return "INCOMPLETE";
1647
}
1648
1649
static void table_line_dump_v2_prefix(BGPDUMP_TABLE_DUMP_V2_PREFIX *e,BGPDUMP_ENTRY *entry)
1650
{
1651
    struct tm *date = NULL;
1652
    unsigned int npref;
1653
    unsigned int nmed;
1654
    char  time_str[20];
1655
    char peer[BGPDUMP_ADDRSTRLEN], prefix[BGPDUMP_ADDRSTRLEN], nexthop[BGPDUMP_ADDRSTRLEN];
1656
    
1657
    int i;
1658
    
1659
    for(i = 0; i < e->entry_count; i++) {
1660
        attributes_t *attr = e->entries[i].attr;
1661
        if(! attr)
1662
            continue;
1663
        
1664
        char *origin = describe_origin(attr->origin);
1665
        char *aspath_str = (attr->aspath) ? attr->aspath->str: "";
1666
        char *aggregate = attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ATOMIC_AGGREGATE) ? "AG" : "NAG";
1667
        
1668
        if(e->entries[i].peer->afi == AFI_IP){
1669
            fmt_ipv4(e->entries[i].peer->peer_ip, peer);
1670
#ifdef BGPDUMP_HAVE_IPV6
1671
        } else if(e->entries[i].peer->afi == AFI_IP6){
1672
            fmt_ipv6(e->entries[i].peer->peer_ip, peer);
1673
#endif
1674
        }
1675
        
1676
        if(e->afi == AFI_IP) {
1677
            fmt_ipv4(e->prefix, prefix);
1678
#ifdef BGPDUMP_HAVE_IPV6
1679
        } else if(e->afi == AFI_IP6) {
1680
            fmt_ipv6(e->prefix, prefix);
1681
#endif
1682
        }
1683
1684
        if (timetype==0) {
1685
            date=gmtime(&entry->time);            
1686
            time2str(date,time_str);
1687
            show_line_prefix("TABLE_DUMP2", entry->time, time_str, "B");
1688
        }
1689
        else {
1690
            time_t time_temp = (time_t)((e->entries[i]).originated_time);
1691
            date=gmtime(&time_temp);
1692
            time2str(date,time_str);
1693
            show_line_prefix("TABLE_DUMP2", e->entries[i].originated_time, time_str, "B");
1694
        }
1695
        
1696
        if (mode == 1)
1697
        {
1698
            printf("%s|%u|",peer,e->entries[i].peer->peer_as);
1699
            printf("%s/%d|%s|%s|",prefix,e->prefix_length,aspath_str,origin);
1700
            
1701
            npref=attr->local_pref;
1702
            if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF) ) ==0)
1703
                npref=0;
1704
            nmed=attr->med;
1705
            if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC) ) ==0)
1706
                nmed=0;
1707
            
1708
#ifdef BGPDUMP_HAVE_IPV6
1709
            if ((attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MP_REACH_NLRI)) && attr->mp_info->announce[AFI_IP6][SAFI_UNICAST])
1710
            {
1711
                fmt_ipv6(attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->nexthop,nexthop);
1712
            }
1713
            else
1714
#endif
1715
            {
1716
                strncpy(nexthop, inet_ntoa(attr->nexthop), BGPDUMP_ADDRSTRLEN);
1717
            }
1718
            printf("%s|%u|%u|",nexthop,npref,nmed);
1719
            
1720
            if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES) ) !=0)	
1721
                printf("%s|%s|",attr->community->str+1,aggregate);
1722
            else
1723
                printf("|%s|",aggregate);
1724
            
1725
            if (attr->aggregator_addr.s_addr != -1)
1726
                printf("%u %s|\n",attr->aggregator_as,inet_ntoa(attr->aggregator_addr));
1727
            else
1728
                printf("|\n");
1729
        }
1730
        else
1731
        {
1732
            printf("%s|%u|",peer,e->entries[i].peer->peer_as);
1733
            printf("%s/%d|%s|%s\n",prefix,e->prefix_length,aspath_str,origin);
1734
            
1735
        }
1736
    }
1737
    
1738
}
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/bgpdump.spec (+60 lines)
Line 0 Link Here
1
Summary: MRT file reader
2
Name: libbgpdump
3
Version: 1.4.99.15
4
Release: 1
5
License: GPL
6
URL: http://www.ris.ripe.net/source/
7
Vendor: RIPE NCC Information Services department
8
Group: System Environment/Libraries
9
Source: libbgpdump-1.4.99.15.tgz
10
BuildRoot: /var/tmp/%{name}-root
11
BuildRequires: bzip2-devel zlib-devel
12
13
%description
14
This library reads MRT files as, amongst others, produced
15
by the RIPE NCC routing information service.
16
17
This library is maintained by the RIPE NCC Information
18
Services department: ris@ripe.net
19
20
%package devel
21
Summary: Libraries, includes to develop applications with %{name}.
22
Group: Development/Libraries
23
Requires: %{name} = %{version}
24
25
%description devel
26
The %{name}-devel package contains the header files and static libraries for
27
building applications which use %{name}.
28
29
30
%prep
31
%setup
32
33
%build
34
%configure
35
make CFLAGS="$RPM_OPT_FLAGS"
36
37
%install
38
rm -rf %{buildroot}
39
%makeinstall
40
41
%clean
42
rm -rf %{buildroot}
43
44
%files
45
%defattr(0755,root,root)
46
%{_bindir}/bgpdump
47
%defattr(-,root,root)
48
%{_libdir}/libbgpdump.a
49
%{_libdir}/libbgpdump.so
50
51
%files devel
52
%defattr(-,root,root)
53
%{_includedir}/bgpdump_attr.h
54
%{_includedir}/bgpdump_formats.h
55
%{_includedir}/bgpdump_lib.h
56
%{_includedir}/bgpdump_mstream.h
57
58
%changelog
59
* Wed Jul 04 2008 Erik Romijn <eromijn@ripe.net> 1.4.99.9-1
60
- Initial release
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/bgpdump.spec.in (+60 lines)
Line 0 Link Here
1
Summary: MRT file reader
2
Name: @PACKAGE_NAME@
3
Version: @PACKAGE_VERSION@
4
Release: 1
5
License: GPL
6
URL: http://www.ris.ripe.net/source/
7
Vendor: RIPE NCC Information Services department
8
Group: System Environment/Libraries
9
Source: @PACKAGE_NAME@-@PACKAGE_VERSION@.tgz
10
BuildRoot: /var/tmp/%{name}-root
11
BuildRequires: bzip2-devel zlib-devel
12
13
%description
14
This library reads MRT files as, amongst others, produced
15
by the RIPE NCC routing information service.
16
17
This library is maintained by the RIPE NCC Information
18
Services department: ris@ripe.net
19
20
%package devel
21
Summary: Libraries, includes to develop applications with %{name}.
22
Group: Development/Libraries
23
Requires: %{name} = %{version}
24
25
%description devel
26
The %{name}-devel package contains the header files and static libraries for
27
building applications which use %{name}.
28
29
30
%prep
31
%setup
32
33
%build
34
%configure
35
make CFLAGS="$RPM_OPT_FLAGS"
36
37
%install
38
rm -rf %{buildroot}
39
%makeinstall
40
41
%clean
42
rm -rf %{buildroot}
43
44
%files
45
%defattr(0755,root,root)
46
%{_bindir}/bgpdump
47
%defattr(-,root,root)
48
%{_libdir}/libbgpdump.a
49
%{_libdir}/libbgpdump.so
50
51
%files devel
52
%defattr(-,root,root)
53
%{_includedir}/bgpdump_attr.h
54
%{_includedir}/bgpdump_formats.h
55
%{_includedir}/bgpdump_lib.h
56
%{_includedir}/bgpdump_mstream.h
57
58
%changelog
59
* Wed Jul 04 2008 Erik Romijn <eromijn@ripe.net> 1.4.99.9-1
60
- Initial release
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/bgpdump_attr.h (+226 lines)
Line 0 Link Here
1
/*
2
 Copyright (c) 2007 - 2010 RIPE NCC - All Rights Reserved
3
 
4
 Permission to use, copy, modify, and distribute this software and its
5
 documentation for any purpose and without fee is hereby granted, provided
6
 that the above copyright notice appear in all copies and that both that
7
 copyright notice and this permission notice appear in supporting
8
 documentation, and that the name of the author not be used in advertising or
9
 publicity pertaining to distribution of the software without specific,
10
 written prior permission.
11
 
12
 THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
13
 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
14
 AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
15
 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
16
 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
 
19
Parts of this code have been engineered after analiyzing GNU Zebra's
20
source code and therefore might contain declarations/code from GNU
21
Zebra, Copyright (C) 1999 Kunihiro Ishiguro. Zebra is a free routing
22
software, distributed under the GNU General Public License. A copy of
23
this license is included with libbgpdump.
24
25
Original Author: Dan Ardelean (dan@ripe.net)
26
*/
27
28
#ifndef _BGPDUMP_ATTR_H
29
#define _BGPDUMP_ATTR_H
30
31
#include <sys/types.h>
32
#include <netinet/in.h>
33
34
/* BGP Attribute flags. */
35
#define BGP_ATTR_FLAG_OPTIONAL  0x80	/* Attribute is optional. */
36
#define BGP_ATTR_FLAG_TRANS     0x40	/* Attribute is transitive. */
37
#define BGP_ATTR_FLAG_PARTIAL   0x20	/* Attribute is partial. */
38
#define BGP_ATTR_FLAG_EXTLEN    0x10	/* Extended length flag. */
39
40
/* BGP attribute type codes.  */
41
#define BGP_ATTR_ORIGIN                    1
42
#define BGP_ATTR_AS_PATH                   2
43
#define BGP_ATTR_NEXT_HOP                  3
44
#define BGP_ATTR_MULTI_EXIT_DISC           4
45
#define BGP_ATTR_LOCAL_PREF                5
46
#define BGP_ATTR_ATOMIC_AGGREGATE          6
47
#define BGP_ATTR_AGGREGATOR                7
48
#define BGP_ATTR_COMMUNITIES               8
49
#define BGP_ATTR_ORIGINATOR_ID             9
50
#define BGP_ATTR_CLUSTER_LIST             10
51
#define BGP_ATTR_DPA                      11
52
#define BGP_ATTR_ADVERTISER               12
53
#define BGP_ATTR_RCID_PATH                13
54
#define BGP_ATTR_MP_REACH_NLRI            14
55
#define BGP_ATTR_MP_UNREACH_NLRI          15
56
#define BGP_ATTR_EXT_COMMUNITIES          16
57
#define BGP_ATTR_NEW_AS_PATH              17
58
#define BGP_ATTR_NEW_AGGREGATOR           18
59
60
/* Flag macro */
61
#define ATTR_FLAG_BIT(X)  (1 << ((X) - 1))
62
63
/* BGP ASPATH attribute defines */
64
#define AS_HEADER_SIZE        2	 
65
66
#define AS_SET             1
67
#define AS_SEQUENCE        2
68
#define AS_CONFED_SEQUENCE 3
69
#define AS_CONFED_SET      4
70
71
#define AS_SEG_START 0
72
#define AS_SEG_END 1
73
74
#define ASPATH_STR_DEFAULT_LEN 32
75
#define ASPATH_STR_ERROR       "! Error !"
76
77
/* BGP COMMUNITY attribute defines */
78
79
#define COMMUNITY_NO_EXPORT             0xFFFFFF01
80
#define COMMUNITY_NO_ADVERTISE          0xFFFFFF02
81
#define COMMUNITY_NO_EXPORT_SUBCONFED   0xFFFFFF03
82
#define COMMUNITY_LOCAL_AS              0xFFFFFF03
83
84
#define com_nthval(X,n)  ((X)->val + (n))
85
86
/* MP-BGP address families */
87
#ifdef BGPDUMP_HAVE_IPV6
88
#define AFI_IP 1
89
#define AFI_IP6 2
90
#define BGPDUMP_MAX_AFI AFI_IP6
91
#else
92
#define AFI_IP 1
93
#define BGPDUMP_MAX_AFI AFI_IP
94
#endif
95
96
#define SAFI_UNICAST		1
97
#define SAFI_MULTICAST		2
98
#define SAFI_UNICAST_MULTICAST	3
99
#define BGPDUMP_MAX_SAFI SAFI_UNICAST_MULTICAST
100
101
struct unknown_attr
102
{
103
	int	flag;
104
	int	type;
105
	int	len;
106
	u_char *raw;
107
};
108
109
typedef u_int32_t as_t;
110
111
typedef struct attr attributes_t;
112
struct attr
113
{
114
  /* Flag of attribute is set or not. */
115
  u_int32_t flag;
116
117
  /* Attributes. */
118
  int                   origin;
119
  struct in_addr 	nexthop;
120
  u_int32_t 		med;
121
  u_int32_t 		local_pref;
122
  as_t 			aggregator_as;
123
  struct in_addr 	aggregator_addr;
124
  u_int32_t 		weight;
125
  struct in_addr 	originator_id;
126
  struct cluster_list	*cluster;
127
128
  struct aspath 	*aspath;
129
  struct community 	*community;
130
  struct ecommunity 	*ecommunity;
131
  struct transit 	*transit;
132
  
133
  /* libbgpdump additions */
134
  
135
  struct mp_info	*mp_info;
136
  u_int16_t		len;
137
  caddr_t		data;
138
139
  u_int16_t		unknown_num;
140
  struct unknown_attr	*unknown;
141
142
  /* ASN32 support */
143
  struct aspath 	*new_aspath;
144
  struct aspath 	*old_aspath;
145
  as_t			new_aggregator_as;
146
  as_t			old_aggregator_as;
147
  struct in_addr 	new_aggregator_addr;
148
  struct in_addr 	old_aggregator_addr;
149
};
150
151
struct community 
152
{
153
  int 			size;
154
  u_int32_t 		*val;
155
  char			*str;
156
};
157
158
struct cluster_list
159
{
160
  int			length;
161
  struct in_addr 	*list;
162
};
163
164
struct transit
165
{
166
  int 			length;
167
  u_char 		*val;
168
};
169
170
struct aspath 
171
{
172
  u_int8_t		asn_len;
173
  int 			length;
174
  int 			count;
175
  caddr_t 		data;
176
  char 			*str;
177
};
178
179
struct assegment
180
{
181
  u_char type;
182
  u_char length;
183
  char data[0];
184
};
185
186
struct mp_info {
187
  /* AFI and SAFI start from 1, so the arrays must be 1-based */
188
  struct mp_nlri	*withdraw[BGPDUMP_MAX_AFI+1][BGPDUMP_MAX_SAFI+1];
189
  struct mp_nlri	*announce[BGPDUMP_MAX_AFI+1][BGPDUMP_MAX_SAFI+1];
190
};
191
192
#ifdef BGPDUMP_HAVE_IPV6
193
#define MP_IPV6_ANNOUNCE(m) ((m)->announce[AFI_IP6][SAFI_UNICAST])
194
#define MP_IPV6_WITHDRAW(m) ((m)->withdraw[AFI_IP6][SAFI_UNICAST])
195
#endif
196
197
typedef union union_BGPDUMP_IP_ADDRESS {
198
    struct in_addr	v4_addr;
199
    struct in6_addr	v6_addr;
200
} BGPDUMP_IP_ADDRESS;
201
202
203
#define BGPDUMP_ADDRSTRLEN 46
204
205
#define ASN16_LEN sizeof(u_int16_t)
206
#define ASN32_LEN sizeof(u_int32_t)
207
208
#define AS_TRAN 23456
209
210
struct prefix {
211
    BGPDUMP_IP_ADDRESS	address;
212
    u_char		len;
213
};
214
215
#define MAX_PREFIXES 2050
216
struct mp_nlri {
217
  u_char		nexthop_len;
218
219
  BGPDUMP_IP_ADDRESS	nexthop;
220
  BGPDUMP_IP_ADDRESS 	nexthop_local;
221
222
  u_int16_t		prefix_count;
223
  struct prefix		nlri[MAX_PREFIXES];
224
};
225
226
#endif /* _BGPDUMP_ATTR_H */
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/bgpdump_formats.h (+263 lines)
Line 0 Link Here
1
/*
2
 Copyright (c) 2007 - 2010 RIPE NCC - All Rights Reserved
3
 
4
 Permission to use, copy, modify, and distribute this software and its
5
 documentation for any purpose and without fee is hereby granted, provided
6
 that the above copyright notice appear in all copies and that both that
7
 copyright notice and this permission notice appear in supporting
8
 documentation, and that the name of the author not be used in advertising or
9
 publicity pertaining to distribution of the software without specific,
10
 written prior permission.
11
 
12
 THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
13
 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
14
 AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
15
 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
16
 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
19
Parts of this code have been engineered after analiyzing GNU Zebra's
20
source code and therefore might contain declarations/code from GNU
21
Zebra, Copyright (C) 1999 Kunihiro Ishiguro. Zebra is a free routing
22
software, distributed under the GNU General Public License. A copy of
23
this license is included with libbgpdump.
24
25
Original Author: Dan Ardelean (dan@ripe.net)
26
*/
27
28
#ifndef _BGPDUMP_FORMATS_H
29
#define _BGPDUMP_FORMATS_H
30
31
#include "bgpdump_attr.h"
32
33
#include <stdio.h>
34
#include <sys/types.h>
35
#include <string.h>
36
#include <netinet/in.h>
37
38
/* type and subtypes values */
39
/* RFC6396 */
40
#define BGPDUMP_TYPE_MRTD_BGP			5
41
#define BGPDUMP_SUBTYPE_MRTD_BGP_NULL		0
42
#define BGPDUMP_SUBTYPE_MRTD_BGP_UPDATE		1
43
#define BGPDUMP_SUBTYPE_MRTD_BGP_PREFUPDATE	2
44
#define BGPDUMP_SUBTYPE_MRTD_BGP_STATE_CHANGE	3
45
#define BGPDUMP_SUBTYPE_MRTD_BGP_SYNC		4
46
#define BGPDUMP_SUBTYPE_MRTD_BGP_OPEN		5
47
#define BGPDUMP_SUBTYPE_MRTD_BGP_NOTIFICATION	6
48
#define BGPDUMP_SUBTYPE_MRTD_BGP_KEEPALIVE	7
49
#define BGPDUMP_SUBTYPE_MRTD_BGP_ROUT_REFRESH	133
50
51
#define BGPDUMP_TYPE_MRTD_TABLE_DUMP				12
52
#define BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP			1
53
#define BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP6			2
54
#define BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP_32BIT_AS		3
55
#define BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP6_32BIT_AS	4
56
57
#define BGPDUMP_TYPE_TABLE_DUMP_V2                       13
58
#define BGPDUMP_SUBTYPE_TABLE_DUMP_V2_PEER_INDEX_TABLE    1
59
#define BGPDUMP_SUBTYPE_TABLE_DUMP_V2_RIB_IPV4_UNICAST    2
60
#define BGPDUMP_SUBTYPE_TABLE_DUMP_V2_RIB_IPV4_MULTICAST  3
61
#define BGPDUMP_SUBTYPE_TABLE_DUMP_V2_RIB_IPV6_UNICAST    4
62
#define BGPDUMP_SUBTYPE_TABLE_DUMP_V2_RIB_IPV6_MULTICAST  5
63
#define BGPDUMP_SUBTYPE_TABLE_DUMP_V2_RIB_GENERIC         6
64
#define BGPDUMP_PEERTYPE_TABLE_DUMP_V2_AFI_IP             0
65
#define BGPDUMP_PEERTYPE_TABLE_DUMP_V2_AFI_IP6            1
66
#define BGPDUMP_PEERTYPE_TABLE_DUMP_V2_AS2                0
67
#define BGPDUMP_PEERTYPE_TABLE_DUMP_V2_AS4                2
68
#define BGPDUMP_TYPE_TABLE_DUMP_V2_MAX_VIEWNAME_LEN     255
69
70
/* Zebra record types */
71
#define BGPDUMP_TYPE_ZEBRA_BGP			16 /* MSG_PROTOCOL_BGP4MP */
72
#define BGPDUMP_SUBTYPE_ZEBRA_BGP_STATE_CHANGE	0  /* BGP4MP_STATE_CHANGE */
73
#define BGPDUMP_SUBTYPE_ZEBRA_BGP_MESSAGE	1  /* BGP4MP_MESSAGE */
74
#define BGPDUMP_SUBTYPE_ZEBRA_BGP_ENTRY		2  /* BGP4MP_ENTRY */
75
#define BGPDUMP_SUBTYPE_ZEBRA_BGP_SNAPSHOT	3  /* BGP4MP_SNAPSHOT */
76
#define BGPDUMP_SUBTYPE_ZEBRA_BGP_MESSAGE_AS4	4  /* BGP4MP_MESSAGE_AS4 */
77
#define BGPDUMP_SUBTYPE_ZEBRA_BGP_STATE_CHANGE_AS4	5  /* BGP4MP_STATE_CHANGE_AS4 */
78
79
/* BGP state - defined in RFC1771 */
80
#define BGP_STATE_IDLE		1
81
#define BGP_STATE_CONNECT	2
82
#define BGP_STATE_ACTIVE	3
83
#define BGP_STATE_OPENSENT	4
84
#define BGP_STATE_OPENCONFIRM	5
85
#define BGP_STATE_ESTABLISHED	6
86
87
/* BGP message types */
88
#define	BGP_MSG_OPEN		           1
89
#define	BGP_MSG_UPDATE		           2
90
#define	BGP_MSG_NOTIFY		           3
91
#define	BGP_MSG_KEEPALIVE	           4
92
#define BGP_MSG_ROUTE_REFRESH_01           5
93
#define BGP_MSG_ROUTE_REFRESH	         128
94
95
typedef struct struct_BGPDUMP_MRTD_TABLE_DUMP {
96
    u_int16_t		view;
97
    u_int16_t		sequence;
98
    BGPDUMP_IP_ADDRESS	prefix;
99
    u_char		mask;
100
    u_char		status;
101
    time_t		uptime;
102
    BGPDUMP_IP_ADDRESS	peer_ip;
103
    as_t		peer_as;
104
    u_int16_t		attr_len;
105
} BGPDUMP_MRTD_TABLE_DUMP;
106
107
108
typedef struct struct_BGPDUMP_TABLE_DUMP_V2_PEER_INDEX_TABLE_ENTRY {
109
	u_char              afi;
110
	BGPDUMP_IP_ADDRESS  peer_ip;
111
	struct in_addr      peer_bgp_id;
112
	as_t                peer_as;
113
} BGPDUMP_TABLE_DUMP_V2_PEER_INDEX_TABLE_ENTRY;
114
115
typedef struct struct_BGPDUMP_TABLE_DUMP_V2_PEER_INDEX_TABLE {
116
	struct in_addr      local_bgp_id;
117
	char                view_name[BGPDUMP_TYPE_TABLE_DUMP_V2_MAX_VIEWNAME_LEN];
118
	uint16_t            peer_count;
119
	BGPDUMP_TABLE_DUMP_V2_PEER_INDEX_TABLE_ENTRY  *entries;
120
} BGPDUMP_TABLE_DUMP_V2_PEER_INDEX_TABLE;
121
122
typedef struct struct_BGPDUMP_TABLE_DUMP_V2_ROUTE_ENTRY {
123
	uint16_t            peer_index;
124
	uint32_t            originated_time;
125
	BGPDUMP_TABLE_DUMP_V2_PEER_INDEX_TABLE_ENTRY *peer;
126
        attributes_t        *attr;
127
} BGPDUMP_TABLE_DUMP_V2_ROUTE_ENTRY;
128
129
typedef struct struct_BGPDUMP_TABLE_DUMP_V2_PREFIX {
130
	uint32_t            seq;
131
	uint16_t            afi;
132
	uint8_t             safi;
133
	u_char              prefix_length;
134
	BGPDUMP_IP_ADDRESS  prefix;
135
	uint16_t            entry_count;
136
	BGPDUMP_TABLE_DUMP_V2_ROUTE_ENTRY *entries;
137
} BGPDUMP_TABLE_DUMP_V2_PREFIX;
138
139
140
141
/* For Zebra BGP4MP_STATE_CHANGE */
142
typedef struct struct_BGPDUMP_ZEBRA_STATE_CHANGE {
143
    as_t		source_as;
144
    as_t		destination_as;
145
    u_int16_t		interface_index;
146
    u_int16_t		address_family;
147
    BGPDUMP_IP_ADDRESS	source_ip;
148
    BGPDUMP_IP_ADDRESS	destination_ip;
149
    u_int16_t		old_state;
150
    u_int16_t		new_state;
151
} BGPDUMP_ZEBRA_STATE_CHANGE;
152
153
struct zebra_incomplete {
154
    u_int16_t afi;
155
    u_int8_t orig_len;
156
    struct prefix prefix;
157
};
158
159
/* For Zebra BGP4MP_MESSAGE */
160
typedef struct struct_BGPDUMP_ZEBRA_MESSAGE {
161
    /* Zebra header */
162
    as_t		source_as;
163
    as_t		destination_as;
164
    u_int16_t		interface_index;
165
    u_int16_t		address_family;
166
    BGPDUMP_IP_ADDRESS	source_ip;
167
    BGPDUMP_IP_ADDRESS	destination_ip;
168
169
    /* BGP packet header fields */
170
    u_int16_t		size;
171
    u_char		type;
172
173
    /* For OPEN packets */
174
    u_char	version;
175
    as_t	my_as;
176
    u_int16_t	hold_time;
177
    struct	in_addr bgp_id;
178
    u_char	opt_len;
179
    u_char	*opt_data;
180
181
    /* For UPDATE packets */
182
    u_int16_t		withdraw_count;
183
    u_int16_t		announce_count;
184
    struct prefix	withdraw[MAX_PREFIXES];
185
    struct prefix	announce[MAX_PREFIXES];
186
187
    /* For corrupt update dumps */
188
    u_int16_t cut_bytes;
189
    struct zebra_incomplete incomplete;
190
191
    /* For NOTIFY packets */
192
    u_char error_code;
193
    u_char sub_error_code;
194
    u_int16_t notify_len;
195
    u_char *notify_data;
196
197
} BGPDUMP_ZEBRA_MESSAGE;
198
199
/* For Zebra BGP4MP_ENTRY */
200
typedef struct struct_BGPDUMP_ZEBRA_ENTRY {
201
    u_int16_t	view;
202
    u_int16_t	status;
203
    time_t	time_last_change;
204
    u_int16_t	address_family;
205
    u_char	SAFI;
206
    u_char	next_hop_len;
207
    u_char	prefix_length;
208
    u_char	*address_prefix;
209
    u_int16_t	empty;
210
    u_char	*bgp_atribute;
211
} BGPDUMP_ZEBRA_ENTRY;
212
213
/* For Zebra BGP4MP_SNAPSHOT */
214
typedef struct struct_BGPDUMP_ZEBRA_SNAPSHOT {
215
    u_int16_t	view;
216
    u_int16_t	file;
217
} BGPDUMP_ZEBRA_SNAPSHOT;
218
219
typedef struct struct_BGPDUMP_MRTD_MESSAGE {
220
    u_int16_t		source_as;
221
    struct in_addr	source_ip;
222
    u_int16_t		destination_as;
223
    struct in_addr	destination_ip;
224
225
    u_int16_t		withdraw_count;
226
    u_int16_t		announce_count;
227
    struct prefix	withdraw[MAX_PREFIXES];
228
    struct prefix	announce[MAX_PREFIXES];
229
230
    /* For corrupt update dumps */
231
    struct zebra_incomplete incomplete;
232
} BGPDUMP_MRTD_MESSAGE;
233
234
typedef struct struct_BGPDUMP_MRTD_STATE_CHANGE {
235
    u_int16_t           destination_as;
236
    struct in_addr      destination_ip;
237
    u_int16_t           old_state;
238
    u_int16_t           new_state;
239
} BGPDUMP_MRTD_STATE_CHANGE;
240
241
typedef union union_BGPDUMP_BODY {
242
	BGPDUMP_MRTD_MESSAGE		mrtd_message;
243
        BGPDUMP_MRTD_STATE_CHANGE       mrtd_state_change;
244
	BGPDUMP_MRTD_TABLE_DUMP		mrtd_table_dump;
245
	BGPDUMP_TABLE_DUMP_V2_PEER_INDEX_TABLE		mrtd_table_dump_v2_peer_table;
246
	BGPDUMP_TABLE_DUMP_V2_PREFIX		mrtd_table_dump_v2_prefix;
247
	BGPDUMP_ZEBRA_STATE_CHANGE	zebra_state_change;
248
	BGPDUMP_ZEBRA_MESSAGE		zebra_message;
249
	BGPDUMP_ZEBRA_ENTRY		zebra_entry;
250
	BGPDUMP_ZEBRA_SNAPSHOT		zebra_snapshot;
251
} BGPDUMP_BODY;
252
253
/* The MRT header. Common to all records. */
254
typedef struct struct_BGPDUMP_ENTRY {
255
    time_t		time;
256
    u_int16_t		type;
257
    u_int16_t		subtype;
258
    u_int32_t		length;
259
    attributes_t       *attr;
260
    BGPDUMP_BODY 	body;
261
} BGPDUMP_ENTRY;
262
263
#endif
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/bgpdump_lib.c (+1431 lines)
Line 0 Link Here
1
/*
2
 Copyright (c) 2007 - 2010 RIPE NCC - All Rights Reserved
3
 
4
 Permission to use, copy, modify, and distribute this software and its
5
 documentation for any purpose and without fee is hereby granted, provided
6
 that the above copyright notice appear in all copies and that both that
7
 copyright notice and this permission notice appear in supporting
8
 documentation, and that the name of the author not be used in advertising or
9
 publicity pertaining to distribution of the software without specific,
10
 written prior permission.
11
 
12
 THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
13
 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
14
 AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
15
 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
16
 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
 
19
Parts of this code have been engineered after analiyzing GNU Zebra's
20
source code and therefore might contain declarations/code from GNU
21
Zebra, Copyright (C) 1999 Kunihiro Ishiguro. Zebra is a free routing
22
software, distributed under the GNU General Public License. A copy of
23
this license is included with libbgpdump.
24
*/
25
26
#include "bgpdump-config.h"
27
#include "cfile_tools.h"
28
#include "bgpdump_lib.h"
29
#include "bgpdump_mstream.h"
30
#include "util.h"
31
32
#include <sys/stat.h>
33
#include <stdlib.h>
34
#include <unistd.h>
35
#include <stdbool.h>
36
37
#include <netinet/in.h>
38
#include <sys/socket.h>
39
#include <arpa/inet.h>
40
41
#include <zlib.h>
42
#include <assert.h>
43
44
void	  bgpdump_free_attr(attributes_t *attr);
45
static    int process_mrtd_table_dump(struct mstream *s,BGPDUMP_ENTRY *entry);
46
static    int process_mrtd_table_dump_v2(struct mstream *s,BGPDUMP_ENTRY *entry);
47
static    int process_mrtd_table_dump_v2_peer_index_table(struct mstream *s,BGPDUMP_ENTRY *entry);
48
static    int process_mrtd_table_dump_v2_ipv4_unicast(struct mstream *s,BGPDUMP_ENTRY *entry);
49
static    int process_mrtd_table_dump_v2_ipv6_unicast(struct mstream *s,BGPDUMP_ENTRY *entry);
50
static    int process_zebra_bgp(struct mstream *s,BGPDUMP_ENTRY *entry);
51
static    int process_zebra_bgp_state_change(struct mstream *s,BGPDUMP_ENTRY *entry, u_int8_t asn_len);
52
53
static    int process_zebra_bgp_message(struct mstream *s,BGPDUMP_ENTRY *entry, u_int8_t asn_len);
54
static    int process_zebra_bgp_message_update(struct mstream *s,BGPDUMP_ENTRY *entry, u_int8_t asn_len);
55
static    int process_zebra_bgp_message_open(struct mstream *s,BGPDUMP_ENTRY *entry, u_int8_t asn_len);
56
static    int process_zebra_bgp_message_notify(struct mstream *s,BGPDUMP_ENTRY *entry);
57
58
static    int process_zebra_bgp_entry(struct mstream *s,BGPDUMP_ENTRY *entry);
59
static    int process_zebra_bgp_snapshot(struct mstream *s,BGPDUMP_ENTRY *entry);
60
61
static    attributes_t *process_attributes(struct mstream *s, u_int8_t asn_len, struct zebra_incomplete *incomplete);
62
static    void process_attr_aspath_string(struct aspath *as);
63
static    char aspath_delimiter_char (u_char type, u_char which);
64
static    void process_attr_community_string(struct community *com);
65
66
static    void process_mp_announce(struct mstream *s, struct mp_info *info, struct zebra_incomplete *incomplete);
67
static    void process_mp_withdraw(struct mstream *s, struct mp_info *info, struct zebra_incomplete *incomplete);
68
static    int read_prefix_list(struct mstream *s, u_int16_t af, struct prefix *prefixes, struct zebra_incomplete *incomplete);
69
70
static    as_t read_asn(struct mstream *s, as_t *asn, u_int8_t len);
71
static    struct aspath *create_aspath(u_int16_t len, u_int8_t asn_len);
72
static    void aspath_error(struct aspath *as);
73
static    int check_new_aspath(struct aspath *aspath);
74
static    void process_asn32_trans(attributes_t *attr, u_int8_t asn_len);
75
static    struct aspath *asn32_merge_paths(struct aspath *path, struct aspath *newpath);
76
static    void asn32_expand_16_to_32(char *dst, char *src, int len);
77
78
BGPDUMP_TABLE_DUMP_V2_PEER_INDEX_TABLE *table_dump_v2_peer_index_table = NULL;
79
80
#if defined(linux)
81
static    size_t strlcat(char *dst, const char *src, size_t size);
82
#endif
83
84
char *bgpdump_version(void) {
85
    return PACKAGE_VERSION;
86
}
87
88
89
BGPDUMP *bgpdump_open_dump(const char *filename) {
90
91
    CFRFILE *f = cfr_open(filename);
92
    if(! f) {
93
        perror("can't open dumpfile");
94
        return NULL;
95
    }
96
    
97
    BGPDUMP *this_dump = malloc(sizeof(BGPDUMP));
98
    strcpy(this_dump->filename, "[STDIN]");
99
    if(filename && strcmp(filename, "-")) {
100
	strcpy(this_dump->filename, filename);
101
    }
102
103
    this_dump->f = f;
104
    this_dump->eof=0;
105
    this_dump->parsed = 0;
106
    this_dump->parsed_ok = 0;
107
108
    return this_dump;
109
}
110
111
void bgpdump_close_dump(BGPDUMP *dump) {
112
    if(dump!=NULL) {
113
114
    	if(table_dump_v2_peer_index_table){
115
		if(table_dump_v2_peer_index_table->entries) {
116
			free(table_dump_v2_peer_index_table->entries);
117
			table_dump_v2_peer_index_table->entries = NULL;
118
		}
119
		free(table_dump_v2_peer_index_table);
120
		table_dump_v2_peer_index_table = NULL;
121
	}
122
	cfr_close(dump->f);
123
        free(dump);
124
    }
125
}
126
127
BGPDUMP_ENTRY*	bgpdump_read_next(BGPDUMP *dump) {
128
    assert(dump);
129
130
    BGPDUMP_ENTRY *this_entry=NULL;
131
    struct mstream s;
132
    u_char *buffer;
133
    int ok=0;
134
    u_int32_t bytes_read;
135
136
    this_entry = malloc(sizeof(BGPDUMP_ENTRY));
137
138
    bytes_read = cfr_read_n(dump->f, &(this_entry->time), 4);
139
    bytes_read += cfr_read_n(dump->f, &(this_entry->type), 2);
140
    bytes_read += cfr_read_n(dump->f, &(this_entry->subtype), 2);
141
    bytes_read += cfr_read_n(dump->f, &(this_entry->length), 4);
142
    if(bytes_read != 12) {
143
	if(bytes_read > 0) {
144
	    /* Malformed record */
145
	    dump->parsed++;
146
	    err("bgpdump_read_next: incomplete MRT header (%d bytes read, expecting 12)",
147
		   bytes_read);
148
	}
149
	/* Nothing more to read, quit */
150
	free(this_entry);
151
	dump->eof=1;
152
	return(NULL);
153
    }
154
155
    dump->parsed++;
156
157
    /* Intel byte ordering stuff ... */
158
    this_entry->type=ntohs(this_entry->type);
159
    this_entry->subtype=ntohs(this_entry->subtype);
160
    this_entry->time=ntohl(this_entry->time);
161
    this_entry->length=ntohl(this_entry->length);
162
163
    this_entry->attr=NULL;
164
165
    buffer = malloc(this_entry->length);
166
    bytes_read = cfr_read_n(dump->f, buffer, this_entry->length);
167
    if(bytes_read != this_entry->length) {
168
	err("bgpdump_read_next: incomplete dump record (%d bytes read, expecting %d)",
169
	       bytes_read, this_entry->length);
170
	free(this_entry);
171
	free(buffer);
172
	dump->eof=1;
173
	return(NULL);
174
    }
175
176
177
    ok=0;
178
    mstream_init(&s,buffer,this_entry->length);
179
180
    switch(this_entry->type) {
181
	case BGPDUMP_TYPE_MRTD_BGP:
182
		ok = process_mrtd_bgp(&s,this_entry);
183
		break;
184
	case BGPDUMP_TYPE_MRTD_TABLE_DUMP:
185
		ok = process_mrtd_table_dump(&s,this_entry);
186
		break;
187
	case BGPDUMP_TYPE_ZEBRA_BGP:
188
		ok = process_zebra_bgp(&s,this_entry);
189
		break;
190
	case BGPDUMP_TYPE_TABLE_DUMP_V2:
191
		ok = process_mrtd_table_dump_v2(&s,this_entry);
192
		break;
193
    }
194
195
    free(buffer);
196
    if(ok) {
197
	dump->parsed_ok++;
198
    } else {
199
	bgpdump_free_mem(this_entry);
200
	return NULL;
201
    }
202
    return this_entry;
203
}
204
205
static void bgpdump_free_mp_info(struct mp_info *info) {
206
    u_int16_t afi;
207
    u_int8_t safi;
208
209
    for(afi = 1; afi <= BGPDUMP_MAX_AFI; afi++) {
210
	for(safi = 1; safi < BGPDUMP_MAX_SAFI; safi++) {
211
	    if(info->announce[afi][safi])
212
		free(info->announce[afi][safi]);
213
		info->announce[afi][safi] = NULL;
214
	    if(info->withdraw[afi][safi]) {
215
		free(info->withdraw[afi][safi]);
216
		info->withdraw[afi][safi] = NULL;
217
	    }
218
	}
219
    }
220
221
	free(info);
222
}
223
224
void bgpdump_free_mem(BGPDUMP_ENTRY *entry) {
225
226
    if(entry!=NULL) {
227
228
	bgpdump_free_attr(entry->attr);
229
230
	switch(entry->type) {
231
	    case BGPDUMP_TYPE_ZEBRA_BGP:
232
		switch(entry->subtype) {
233
		    case BGPDUMP_SUBTYPE_ZEBRA_BGP_MESSAGE:
234
			switch(entry->body.zebra_message.type) {
235
			    case BGP_MSG_NOTIFY:
236
				if(entry->body.zebra_message.notify_data)
237
				    free(entry->body.zebra_message.notify_data);
238
				break;
239
			    case BGP_MSG_OPEN:
240
				if(entry->body.zebra_message.opt_data)
241
				    free(entry->body.zebra_message.opt_data);
242
				break;
243
			}
244
			break;
245
		}
246
		break;
247
	    case BGPDUMP_TYPE_TABLE_DUMP_V2:
248
		if(entry->subtype == BGPDUMP_SUBTYPE_TABLE_DUMP_V2_RIB_IPV4_UNICAST ||
249
		   entry->subtype == BGPDUMP_SUBTYPE_TABLE_DUMP_V2_RIB_IPV6_UNICAST ){
250
251
			BGPDUMP_TABLE_DUMP_V2_PREFIX *e;
252
			e = &entry->body.mrtd_table_dump_v2_prefix;
253
			int i;
254
255
			for(i = 0; i < e->entry_count; i++){
256
				bgpdump_free_attr(e->entries[i].attr);
257
			}
258
			free(e->entries);
259
		}
260
		break;
261
	}
262
263
	free(entry);
264
    }
265
}
266
267
void bgpdump_free_attr(attributes_t *attr){
268
	if(attr != NULL) {
269
    	u_int16_t i;
270
    	struct aspath *path, *pathstofree[3] = { attr->aspath, attr->old_aspath, attr->new_aspath };
271
	    for(i = 0; i < sizeof(pathstofree) / sizeof(pathstofree[0]); i++) {
272
	      path = pathstofree[i];
273
	      if(path) {
274
		if(path->data)
275
		  free(path->data);
276
		if(path->str)
277
		  free(path->str);
278
		free(path);
279
	      }
280
	    }
281
282
	    if(attr->community != NULL) {
283
		if(attr->community->val != NULL)
284
		    free(attr->community->val);
285
286
		if(attr->community->str != NULL)
287
		    free(attr->community->str);
288
289
		free(attr->community);
290
	    }
291
292
	    if(attr->data != NULL)
293
		free(attr->data);
294
295
	    if(attr->mp_info != NULL)
296
		bgpdump_free_mp_info(attr->mp_info);
297
298
	    if(attr->cluster != NULL) {
299
			free(attr->cluster->list);
300
			free(attr->cluster);
301
		}
302
303
	    if (attr->unknown_num) {
304
		for (i = 0; i < attr->unknown_num; i++)
305
		    free(attr->unknown[i].raw);
306
		free(attr->unknown);
307
	    }
308
309
	    free(attr);
310
	}
311
}
312
313
314
int process_mrtd_bgp(struct mstream *s, BGPDUMP_ENTRY *entry) {
315
    switch(entry->subtype) {
316
    case BGPDUMP_SUBTYPE_MRTD_BGP_UPDATE:
317
    case BGPDUMP_SUBTYPE_MRTD_BGP_KEEPALIVE:
318
	read_asn(s, &entry->body.mrtd_message.source_as, ASN16_LEN);
319
	entry->body.mrtd_message.source_ip = mstream_get_ipv4(s);
320
321
	read_asn(s, &entry->body.mrtd_message.destination_as, ASN16_LEN);
322
	entry->body.mrtd_message.destination_ip = mstream_get_ipv4(s);
323
324
	mstream_t withdraw_stream = mstream_copy(s, mstream_getw(s, NULL));
325
	entry->body.mrtd_message.withdraw_count = read_prefix_list(&withdraw_stream, AFI_IP,
326
								   entry->body.mrtd_message.withdraw,
327
								   &entry->body.mrtd_message.incomplete);
328
329
	entry->attr = process_attributes(s, ASN16_LEN, &entry->body.mrtd_message.incomplete);
330
331
	entry->body.mrtd_message.announce_count = read_prefix_list(s, AFI_IP, 
332
								   entry->body.mrtd_message.announce,
333
								   &entry->body.mrtd_message.incomplete);
334
	break;
335
    case BGPDUMP_SUBTYPE_MRTD_BGP_STATE_CHANGE:
336
	read_asn(s, &entry->body.mrtd_state_change.destination_as, ASN16_LEN);
337
	entry->body.mrtd_state_change.destination_ip = mstream_get_ipv4(s);
338
	entry->body.mrtd_state_change.old_state = mstream_getw(s, NULL);
339
	entry->body.mrtd_state_change.new_state = mstream_getw(s, NULL);
340
	break;
341
    }
342
    return 1;
343
}
344
345
int process_mrtd_table_dump(struct mstream *s,BGPDUMP_ENTRY *entry) {
346
    int afi = entry->subtype;
347
    u_int8_t asn_len;
348
    u_int32_t temp_time = 0;
349
    mstream_getw(s,&entry->body.mrtd_table_dump.view);
350
    mstream_getw(s,&entry->body.mrtd_table_dump.sequence);
351
    switch(afi) {
352
	case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP:
353
	case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP_32BIT_AS:
354
	    entry->body.mrtd_table_dump.prefix.v4_addr = mstream_get_ipv4(s);
355
	    break;
356
#ifdef BGPDUMP_HAVE_IPV6
357
	case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP6:
358
	case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP6_32BIT_AS:
359
	    mstream_get(s, &entry->body.mrtd_table_dump.prefix.v6_addr.s6_addr, 16);
360
	    break;
361
#endif
362
	default:
363
	    warn("process_mrtd_table_dump: unknown AFI %d",  afi);
364
	    mstream_get(s, NULL, mstream_can_read(s));
365
	    return 0;
366
    }
367
    mstream_getc(s,&entry->body.mrtd_table_dump.mask);
368
    mstream_getc(s,&entry->body.mrtd_table_dump.status);
369
    mstream_getl(s,&temp_time);
370
    (entry->body).mrtd_table_dump.uptime = temp_time;
371
372
    switch(afi) {
373
      case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP:
374
      case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP_32BIT_AS:
375
	entry->body.mrtd_table_dump.peer_ip.v4_addr = mstream_get_ipv4(s);
376
	break;
377
#ifdef BGPDUMP_HAVE_IPV6
378
      case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP6:
379
      case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP6_32BIT_AS:
380
	mstream_get(s, &entry->body.mrtd_table_dump.peer_ip.v6_addr.s6_addr, 16);
381
	break;
382
#endif
383
    }
384
385
    switch(afi) {
386
      case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP:
387
      case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP6:
388
	asn_len = ASN16_LEN;
389
	break;
390
      case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP_32BIT_AS:
391
      case BGPDUMP_SUBTYPE_MRTD_TABLE_DUMP_AFI_IP6_32BIT_AS:
392
	asn_len = ASN32_LEN;
393
	break;
394
      default:
395
            assert(0); // unreachable
396
    }
397
398
    read_asn(s,&entry->body.mrtd_table_dump.peer_as, asn_len);
399
400
    entry->attr = process_attributes(s, asn_len, NULL);
401
402
    return 1;
403
}
404
405
406
int process_mrtd_table_dump_v2(struct mstream *s,BGPDUMP_ENTRY *entry) {
407
408
	switch(entry->subtype){
409
	case BGPDUMP_SUBTYPE_TABLE_DUMP_V2_PEER_INDEX_TABLE:
410
		return process_mrtd_table_dump_v2_peer_index_table(s, entry);
411
	break;
412
	case BGPDUMP_SUBTYPE_TABLE_DUMP_V2_RIB_IPV4_UNICAST:
413
		return process_mrtd_table_dump_v2_ipv4_unicast(s, entry);
414
	break;
415
	case BGPDUMP_SUBTYPE_TABLE_DUMP_V2_RIB_IPV6_UNICAST:
416
		return process_mrtd_table_dump_v2_ipv6_unicast(s, entry);
417
	break;
418
	case BGPDUMP_SUBTYPE_TABLE_DUMP_V2_RIB_GENERIC:
419
		//return process_mrtd_table_dump_v2_generic(s, entry);
420
	break;
421
	}
422
423
	return 0;
424
}
425
426
int process_mrtd_table_dump_v2_peer_index_table(struct mstream *s,BGPDUMP_ENTRY *entry) {
427
	BGPDUMP_TABLE_DUMP_V2_PEER_INDEX_TABLE *t;
428
	uint16_t i;
429
	uint8_t peertype;
430
	uint16_t view_name_len;
431
432
	if(table_dump_v2_peer_index_table){
433
		if(table_dump_v2_peer_index_table->entries)
434
			free(table_dump_v2_peer_index_table->entries);
435
		free(table_dump_v2_peer_index_table);
436
	}
437
438
	table_dump_v2_peer_index_table = malloc(sizeof(BGPDUMP_TABLE_DUMP_V2_PEER_INDEX_TABLE));
439
	t = table_dump_v2_peer_index_table;
440
	t->entries = NULL;
441
442
    t->local_bgp_id = mstream_get_ipv4(s);
443
444
    mstream_getw(s,&view_name_len);
445
	strcpy(t->view_name, "");
446
447
	// view_name_len is without trailing \0
448
	if(view_name_len+1 > BGPDUMP_TYPE_TABLE_DUMP_V2_MAX_VIEWNAME_LEN) {
449
	    warn("process_mrtd_table_dump_v2_peer_index_table: view name length more than maximum length (%d), ignoring view name", BGPDUMP_TYPE_TABLE_DUMP_V2_MAX_VIEWNAME_LEN);
450
	} else {
451
		mstream_get(s, t->view_name, view_name_len);
452
		t->view_name[view_name_len] = 0;
453
	}
454
455
    mstream_getw(s,&t->peer_count);
456
457
	t->entries = malloc(sizeof(BGPDUMP_TABLE_DUMP_V2_PEER_INDEX_TABLE_ENTRY) * t->peer_count);
458
	if(t->entries == NULL){
459
	    err("process_mrtd_table_dump_v2_peer_index_table: failed to allocate memory for index table");
460
		return 0;
461
	}
462
463
	for(i=0; i < t->peer_count; i++) {
464
    	mstream_getc(s,&peertype);
465
                t->entries[i].afi = AFI_IP;
466
#ifdef BGPDUMP_HAVE_IPV6
467
		if(peertype & BGPDUMP_PEERTYPE_TABLE_DUMP_V2_AFI_IP6)
468
			t->entries[i].afi = AFI_IP6;
469
#endif
470
471
                t->entries[i].peer_bgp_id = mstream_get_ipv4(s);
472
473
		if(t->entries[i].afi == AFI_IP)
474
			t->entries[i].peer_ip.v4_addr = mstream_get_ipv4(s);
475
#ifdef BGPDUMP_HAVE_IPV6
476
		else
477
			mstream_get(s, &t->entries[i].peer_ip.v6_addr.s6_addr, 16);
478
#endif
479
480
481
		if(peertype & BGPDUMP_PEERTYPE_TABLE_DUMP_V2_AS4)
482
			read_asn(s, &t->entries[i].peer_as, 4);
483
		else
484
			read_asn(s, &t->entries[i].peer_as, 2);
485
486
	}
487
	return 0;
488
}
489
490
491
int process_mrtd_table_dump_v2_ipv4_unicast(struct mstream *s, BGPDUMP_ENTRY *entry){
492
	BGPDUMP_TABLE_DUMP_V2_PREFIX *prefixdata;
493
	prefixdata = &entry->body.mrtd_table_dump_v2_prefix;
494
	uint16_t i;
495
496
	prefixdata->afi = AFI_IP;
497
	prefixdata->safi = SAFI_UNICAST;
498
499
	mstream_getl(s, &prefixdata->seq);
500
	mstream_getc(s, &prefixdata->prefix_length);
501
	bzero(&prefixdata->prefix.v4_addr.s_addr, 4);
502
	mstream_get(s, &prefixdata->prefix.v4_addr.s_addr, (prefixdata->prefix_length+7)/8);
503
	mstream_getw(s, &prefixdata->entry_count);
504
505
	prefixdata->entries = malloc(sizeof(BGPDUMP_TABLE_DUMP_V2_ROUTE_ENTRY) * prefixdata->entry_count);
506
	if(prefixdata->entries == NULL){
507
	    err("process_mrtd_table_dump_v2_ipv4_unicast: failed to allocate memory for entry table");
508
		return 0;
509
	}
510
511
	for(i=0; i < prefixdata->entry_count; i++){
512
		BGPDUMP_TABLE_DUMP_V2_ROUTE_ENTRY *e;
513
		e = &prefixdata->entries[i];
514
515
		mstream_getw(s, &e->peer_index);
516
		e->peer = &table_dump_v2_peer_index_table->entries[e->peer_index];
517
		mstream_getl(s, &e->originated_time);
518
            
519
		e->attr = process_attributes(s, 4, NULL);
520
	}
521
522
	return 1;
523
}
524
525
526
int process_mrtd_table_dump_v2_ipv6_unicast(struct mstream *s, BGPDUMP_ENTRY *entry){
527
#ifdef BGPDUMP_HAVE_IPV6
528
	BGPDUMP_TABLE_DUMP_V2_PREFIX *prefixdata;
529
	prefixdata = &entry->body.mrtd_table_dump_v2_prefix;
530
	uint16_t i;
531
532
	prefixdata->afi = AFI_IP6;
533
	prefixdata->safi = SAFI_UNICAST;
534
535
	mstream_getl(s, &prefixdata->seq);
536
537
	mstream_getc(s, &prefixdata->prefix_length);
538
	bzero(&prefixdata->prefix.v6_addr.s6_addr, 16);
539
	mstream_get(s, &prefixdata->prefix.v6_addr.s6_addr, (prefixdata->prefix_length+7)/8);
540
541
	mstream_getw(s, &prefixdata->entry_count);
542
543
	prefixdata->entries = malloc(sizeof(BGPDUMP_TABLE_DUMP_V2_ROUTE_ENTRY) * prefixdata->entry_count);
544
	if(prefixdata->entries == NULL){
545
	    err("process_mrtd_table_dump_v2_ipv6_unicast: failed to allocate memory for entry table");
546
		return 0;
547
	}
548
549
	for(i=0; i < prefixdata->entry_count; i++){
550
		BGPDUMP_TABLE_DUMP_V2_ROUTE_ENTRY *e;
551
		e = &prefixdata->entries[i];
552
553
		mstream_getw(s, &e->peer_index);
554
		e->peer = &table_dump_v2_peer_index_table->entries[e->peer_index];
555
		mstream_getl(s, &e->originated_time);
556
557
		e->attr = process_attributes(s, 4, NULL);
558
	}
559
560
#endif
561
	return 1;
562
}
563
564
int process_zebra_bgp(struct mstream *s,BGPDUMP_ENTRY *entry) {
565
    switch(entry->subtype) {
566
	case BGPDUMP_SUBTYPE_ZEBRA_BGP_STATE_CHANGE:
567
	    return process_zebra_bgp_state_change(s, entry, ASN16_LEN);
568
	case BGPDUMP_SUBTYPE_ZEBRA_BGP_STATE_CHANGE_AS4:
569
	    return process_zebra_bgp_state_change(s, entry, ASN32_LEN);
570
	case BGPDUMP_SUBTYPE_ZEBRA_BGP_MESSAGE:
571
	    return process_zebra_bgp_message(s, entry, ASN16_LEN);
572
	case BGPDUMP_SUBTYPE_ZEBRA_BGP_MESSAGE_AS4:
573
	    return process_zebra_bgp_message(s, entry, ASN32_LEN);
574
	case BGPDUMP_SUBTYPE_ZEBRA_BGP_ENTRY:
575
	    return process_zebra_bgp_entry(s,entry);
576
	case BGPDUMP_SUBTYPE_ZEBRA_BGP_SNAPSHOT:
577
	    return process_zebra_bgp_snapshot(s, entry);
578
	default:
579
	    warn("process_zebra_bgp: unknown subtype %d", entry->subtype);
580
	    return 0;
581
    }
582
}
583
584
int process_zebra_bgp_state_change(struct mstream *s,BGPDUMP_ENTRY *entry, u_int8_t asn_len) {
585
    read_asn(s, &entry->body.zebra_state_change.source_as, asn_len);
586
    read_asn(s, &entry->body.zebra_state_change.destination_as, asn_len);
587
588
    /* Work around Zebra dump corruption.
589
     * N.B. I don't see this in quagga 0.96.4 any more. Is it fixed? */
590
    if (entry->length == 8) {
591
	warn("process_zebra_bgp_state_change: 8-byte state change (zebra bug?)");
592
593
	mstream_getw(s,&entry->body.zebra_state_change.old_state);
594
	mstream_getw(s,&entry->body.zebra_state_change.new_state);
595
596
	/* Fill in with dummy values */
597
	entry->body.zebra_state_change.interface_index = 0;
598
	entry->body.zebra_state_change.address_family = AFI_IP;
599
	entry->body.zebra_state_change.source_ip.v4_addr.s_addr = 0;
600
	entry->body.zebra_state_change.destination_ip.v4_addr.s_addr = 0;
601
602
   	return 1;
603
    }
604
605
    mstream_getw(s,&entry->body.zebra_state_change.interface_index);
606
    mstream_getw(s,&entry->body.zebra_state_change.address_family);
607
608
    switch(entry->body.zebra_state_change.address_family) {
609
	case AFI_IP:
610
	    // length could be 20 or 24 (asn16 vs asn32)
611
	    if(entry->length != 20 && entry->length != 24) {
612
		warn("process_zebra_bgp_state_change: bad length %d",
613
		       entry->length);
614
		return 0;
615
	    }
616
617
	    entry->body.zebra_state_change.source_ip.v4_addr = mstream_get_ipv4(s);
618
	    entry->body.zebra_state_change.destination_ip.v4_addr = mstream_get_ipv4(s);
619
	    break;
620
#ifdef BGPDUMP_HAVE_IPV6
621
	case AFI_IP6:
622
	    // length could be 44 or 48 (asn16 vs asn32)
623
	    if(entry->length != 44 && entry->length != 48) {
624
		warn("process_zebra_bgp_state_change: bad length %d",
625
		       entry->length);
626
		return 0;
627
	    }
628
629
	    mstream_get(s, &entry->body.zebra_state_change.source_ip.v6_addr.s6_addr, 16);
630
	    mstream_get(s, &entry->body.zebra_state_change.destination_ip.v6_addr.s6_addr, 16);
631
	    break;
632
#endif
633
	default:
634
	    warn("process_zebra_bgp_state_change: unknown AFI %d",
635
		   entry->body.zebra_state_change.address_family);
636
	    return 0;
637
    }
638
    mstream_getw(s,&entry->body.zebra_state_change.old_state);
639
    mstream_getw(s,&entry->body.zebra_state_change.new_state);
640
641
    return 1;
642
}
643
644
int process_zebra_bgp_message(struct mstream *s,BGPDUMP_ENTRY *entry, u_int8_t asn_len) {
645
    u_char marker[16]; /* BGP marker */
646
647
    read_asn(s, &entry->body.zebra_message.source_as, asn_len);
648
    read_asn(s, &entry->body.zebra_message.destination_as, asn_len);
649
    mstream_getw(s,&entry->body.zebra_message.interface_index);
650
    mstream_getw(s,&entry->body.zebra_message.address_family);
651
652
    entry->body.zebra_message.opt_len = 0;
653
    entry->body.zebra_message.opt_data = NULL;
654
    entry->body.zebra_message.notify_len = 0;
655
    entry->body.zebra_message.notify_data = NULL;
656
657
    switch(entry->body.zebra_message.address_family) {
658
	case AFI_IP:
659
	    entry->body.zebra_message.source_ip.v4_addr = mstream_get_ipv4(s);
660
	    entry->body.zebra_message.destination_ip.v4_addr = mstream_get_ipv4(s);
661
	    mstream_get (s, marker, 16);
662
	    break;
663
#ifdef BGPDUMP_HAVE_IPV6
664
	case AFI_IP6:
665
	    mstream_get(s,&entry->body.zebra_message.source_ip.v6_addr.s6_addr, 16);
666
	    mstream_get(s,&entry->body.zebra_message.destination_ip.v6_addr.s6_addr, 16);
667
	    mstream_get (s, marker, 16);
668
	    break;
669
#endif
670
	case 0xFFFF:
671
	    /* Zebra doesn't dump ifindex or src/dest IPs in OPEN
672
	     * messages. Work around it. */
673
	    if (entry->body.zebra_message.interface_index == 0xFFFF) {
674
		memset(marker, 0xFF, 4);
675
		mstream_get (s, marker + 4, 12);
676
		entry->body.zebra_message.interface_index = 0;
677
		entry->body.zebra_message.address_family = AFI_IP;
678
		entry->body.zebra_message.source_ip.v4_addr.s_addr = 0;
679
		entry->body.zebra_message.destination_ip.v4_addr.s_addr = 0;
680
		break;
681
	    }
682
	    /* Note fall through! If we don't recognize this type of data corruption, we say
683
	     * the address family is unsupported (since FFFF is not a valid address family) */
684
	default:
685
	    /* unsupported address family */
686
	    warn("process_zebra_bgp_message: unsupported AFI %d",
687
		   entry->body.zebra_message.address_family);
688
	    return 0;
689
    }
690
691
    if(memcmp(marker, "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377", 16) != 0) {
692
	/* bad marker... ignore packet */
693
	warn(
694
	       "bgp_message: bad marker: %02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x",
695
	       marker[0],marker[1],marker[2],marker[3],marker[4],marker[5],marker[6],marker[7],
696
	       marker[8],marker[9],marker[10],marker[11],marker[12],marker[13],marker[14],marker[15]);
697
	return 0;
698
    }
699
700
    mstream_getw(s,&entry->body.zebra_message.size);
701
    
702
    int expected = entry->body.zebra_message.size - sizeof(marker) - sizeof(u_int16_t);
703
    
704
    mstream_t copy = mstream_copy(s, expected);
705
    
706
    entry->body.zebra_message.cut_bytes = expected - mstream_can_read(&copy);
707
708
    switch(mstream_getc (&copy, &entry->body.zebra_message.type)) {
709
	case BGP_MSG_OPEN:
710
	    return process_zebra_bgp_message_open(&copy, entry, asn_len);
711
	case BGP_MSG_UPDATE:
712
	    return process_zebra_bgp_message_update(&copy, entry, asn_len);
713
	case BGP_MSG_NOTIFY:
714
	    return process_zebra_bgp_message_notify(&copy, entry);
715
	case BGP_MSG_KEEPALIVE:
716
	    /* Nothing to do */
717
	    return 1;
718
	case BGP_MSG_ROUTE_REFRESH_01:
719
	    /* Not implemented yet */
720
	    warn("bgp_message: MSG_ROUTE_REFRESH_01 not implemented yet");
721
	    return 0;
722
	case BGP_MSG_ROUTE_REFRESH:
723
	    /* Not implemented yet */
724
	    warn("bgp_message: MSG_ROUTE_REFRESH not implemented yet");
725
	    return 0;
726
	default:
727
	    warn("bgp_message: unknown BGP message type %d",
728
		   entry->body.zebra_message.type);
729
	    return 0;
730
    }
731
}
732
733
int process_zebra_bgp_message_notify(struct mstream *s, BGPDUMP_ENTRY *entry) {
734
    mstream_getc(s, &entry->body.zebra_message.error_code);
735
    mstream_getc(s, &entry->body.zebra_message.sub_error_code);
736
    entry->body.zebra_message.notify_len = entry->body.zebra_message.size - 21;
737
738
    if(entry->body.zebra_message.notify_len > 0) {
739
	entry->body.zebra_message.notify_data = malloc(entry->body.zebra_message.notify_len);
740
	mstream_get(s, entry->body.zebra_message.notify_data, entry->body.zebra_message.notify_len);
741
    }
742
743
    return 1;
744
}
745
746
int process_zebra_bgp_message_open(struct mstream *s, BGPDUMP_ENTRY *entry, u_int8_t asn_len) {
747
    mstream_getc(s, &entry->body.zebra_message.version);
748
    read_asn(s, &entry->body.zebra_message.my_as, asn_len);
749
    mstream_getw(s, &entry->body.zebra_message.hold_time);
750
    entry->body.zebra_message.bgp_id = mstream_get_ipv4(s);
751
    mstream_getc(s, &entry->body.zebra_message.opt_len);
752
753
    if(entry->body.zebra_message.opt_len) {
754
	entry->body.zebra_message.opt_data = malloc(entry->body.zebra_message.opt_len);
755
	mstream_get(s, entry->body.zebra_message.opt_data, entry->body.zebra_message.opt_len);
756
    }
757
758
    return 1;
759
}
760
761
int process_zebra_bgp_message_update(struct mstream *s, BGPDUMP_ENTRY *entry, u_int8_t asn_len) {
762
    entry->body.zebra_message.incomplete.orig_len = 0;
763
764
    mstream_t withdraw_stream = mstream_copy(s, mstream_getw(s, NULL));
765
    entry->body.zebra_message.withdraw_count = read_prefix_list(&withdraw_stream, AFI_IP,
766
                         entry->body.zebra_message.withdraw,
767
			 &entry->body.zebra_message.incomplete);
768
769
    entry->attr = process_attributes(s, asn_len, &entry->body.zebra_message.incomplete);
770
771
    entry->body.zebra_message.announce_count = read_prefix_list(s, AFI_IP, 
772
                         entry->body.zebra_message.announce,
773
			 &entry->body.zebra_message.incomplete);
774
775
    return 1;
776
}
777
778
int process_zebra_bgp_entry(struct mstream *s, BGPDUMP_ENTRY *entry) {
779
    warn("process_zebra_bgp_entry: record type not implemented yet");
780
    return 0;
781
}
782
783
int process_zebra_bgp_snapshot(struct mstream *s, BGPDUMP_ENTRY *entry) {
784
    warn("process_zebra_bgp_snapshot: record type not implemented yet");
785
    return 0;
786
}
787
788
static attributes_t *attr_init(struct mstream *s, int len) {
789
790
    attributes_t *attr = malloc(sizeof(struct attr));
791
    
792
    attr->data=malloc(len);
793
    memcpy(attr->data, &s->start[s->position], len);
794
    
795
    attr->len = len;
796
    attr->flag			= 0;
797
    attr->origin		= -1;
798
    attr->nexthop.s_addr	= INADDR_NONE;
799
    attr->med			= -1;
800
    attr->local_pref		= -1;
801
    attr->aggregator_as		= -1;
802
    attr->aggregator_addr.s_addr = INADDR_NONE;
803
    attr->weight		= -1;
804
805
    attr->originator_id.s_addr	= -1;
806
    attr->cluster		= NULL;
807
808
    attr->aspath			= NULL;
809
    attr->community		= NULL;
810
    attr->transit		= NULL;
811
    attr->mp_info		= calloc(1, sizeof(struct mp_info));;
812
813
    attr->unknown_num = 0;
814
    attr->unknown = NULL;
815
816
    attr->new_aspath		= NULL;
817
    attr->old_aspath		= NULL;
818
    attr->new_aggregator_as	= -1;
819
    attr->new_aggregator_addr.s_addr = INADDR_NONE;
820
    
821
    return attr;
822
}
823
824
static void process_unknown_attr(struct mstream *s, attributes_t *attr, int flag, int type, int len) {
825
    /* Unknown attribute. Save as is */
826
    attr->unknown_num++;
827
    attr->unknown = realloc(attr->unknown, attr->unknown_num * sizeof(struct unknown_attr));
828
    
829
    /* Pointer to the unknown attribute we want to fill in */
830
    struct unknown_attr unknown = {
831
        .flag = flag,
832
        .type = type,
833
        .len = len,
834
        .raw = malloc(len)
835
    };
836
    
837
    attr->unknown[attr->unknown_num - 1] = unknown;
838
    
839
    mstream_get(s, unknown.raw, len);
840
}
841
842
static void process_one_attr(struct mstream *outer_stream, attributes_t *attr, u_int8_t asn_len, struct zebra_incomplete *incomplete) {
843
    int flag = mstream_getc(outer_stream, NULL);
844
    int type = mstream_getc(outer_stream, NULL);
845
    int len;
846
    
847
    if(flag & BGP_ATTR_FLAG_EXTLEN)
848
        len = mstream_getw(outer_stream,NULL);
849
    else
850
        len = mstream_getc(outer_stream,NULL);    
851
852
    //info("flag:%-2i type:%-2i length:%i", flag, type, len);
853
854
    mstream_t ms = mstream_copy(outer_stream, len), *s = &ms;
855
    if(mstream_can_read(s) != len) {
856
        warn("ERROR attribute is truncated: expected=%u remaining=%u\n", len, mstream_can_read(s));
857
        return;
858
    }
859
    
860
    /* Take note of all attributes, including unknown ones */
861
    if(type <= sizeof(attr->flag) * 8)
862
        attr->flag |= ATTR_FLAG_BIT(type);
863
        
864
    switch(type) {
865
        case BGP_ATTR_MP_REACH_NLRI:
866
            process_mp_announce(s, attr->mp_info, incomplete);
867
            break;
868
        case BGP_ATTR_MP_UNREACH_NLRI:
869
            process_mp_withdraw(s, attr->mp_info, incomplete);
870
            break;
871
        case BGP_ATTR_ORIGIN:
872
            assert(attr->origin == -1);
873
            attr->origin = mstream_getc(s, NULL);
874
            break;
875
        case BGP_ATTR_AS_PATH:
876
            assert(! attr->aspath);
877
            attr->aspath = create_aspath(len, asn_len);
878
            mstream_get(s, attr->aspath->data, len);
879
            process_attr_aspath_string(attr->aspath);
880
            break;
881
        case BGP_ATTR_NEXT_HOP:
882
            assert(INADDR_NONE == attr->nexthop.s_addr);
883
            attr->nexthop = mstream_get_ipv4(s);
884
            break;
885
        case BGP_ATTR_MULTI_EXIT_DISC:
886
            assert(-1 == attr->med);
887
            mstream_getl(s,&attr->med);
888
            break;
889
        case BGP_ATTR_LOCAL_PREF:
890
            assert(-1 == attr->local_pref);
891
            mstream_getl(s,&attr->local_pref);
892
            break;
893
        case BGP_ATTR_ATOMIC_AGGREGATE:
894
            break;
895
        case BGP_ATTR_AGGREGATOR:
896
            assert(-1 == attr->new_aggregator_as);
897
            read_asn(s, &attr->aggregator_as, asn_len);
898
            attr->aggregator_addr = mstream_get_ipv4(s);
899
            break;
900
        case BGP_ATTR_COMMUNITIES:
901
            assert(! attr->community);
902
            attr->community		= malloc(sizeof(struct community));
903
            attr->community->size	= len / 4;
904
            attr->community->val	= malloc(len);
905
            mstream_get(s,attr->community->val,len);
906
            attr->community->str	= NULL;
907
            process_attr_community_string(attr->community);
908
            break;
909
        case BGP_ATTR_NEW_AS_PATH:
910
            assert(! attr->new_aspath);
911
            attr->new_aspath = create_aspath(len, ASN32_LEN);
912
            mstream_get(s,attr->new_aspath->data, len);
913
            process_attr_aspath_string(attr->new_aspath);
914
            /* AS_CONFED_SEQUENCE and AS_CONFED_SET segments invalid in NEW_AS_PATH */
915
            check_new_aspath(attr->new_aspath);
916
            break;
917
        case BGP_ATTR_NEW_AGGREGATOR:
918
            assert(-1 == attr->new_aggregator_as);
919
            read_asn(s, &attr->new_aggregator_as, ASN32_LEN);
920
            attr->new_aggregator_addr = mstream_get_ipv4(s);
921
            break;
922
        case BGP_ATTR_ORIGINATOR_ID:
923
            assert(INADDR_NONE == attr->originator_id.s_addr);
924
            attr->originator_id = mstream_get_ipv4(s);
925
            break;
926
        case BGP_ATTR_CLUSTER_LIST:
927
            assert(! attr->cluster);
928
            attr->cluster		= malloc(sizeof(struct cluster_list));
929
            attr->cluster->length	= len/4;
930
            attr->cluster->list = malloc((attr->cluster->length) * sizeof(struct in_addr));
931
            
932
            int i; // cluster index
933
            for (i = 0; i < attr->cluster->length; i++)
934
                attr->cluster->list[i] = mstream_get_ipv4(s);
935
            break;
936
        default:
937
            process_unknown_attr(s, attr, flag, type, len);
938
    }    
939
}
940
941
attributes_t *process_attributes(struct mstream *s, u_int8_t asn_len, struct zebra_incomplete *incomplete) {
942
    int	total = mstream_getw(s, NULL);
943
    
944
    attributes_t *attr = attr_init(s, total);
945
    mstream_t copy = mstream_copy(s, total);
946
947
    if(mstream_can_read(&copy) != total)
948
        warn("entry is truncated: expected=%u remaining=%u", total, mstream_can_read(&copy));
949
    
950
    while(mstream_can_read(&copy))
951
        process_one_attr(&copy, attr, asn_len, incomplete);
952
    
953
    // Once all attributes have been read, take care of ASN32 transition
954
    process_asn32_trans(attr, asn_len);
955
    
956
    return attr;
957
}
958
959
struct aspath *create_aspath(u_int16_t len, u_int8_t asn_len) {
960
  struct aspath *aspath = malloc(sizeof(struct aspath));
961
  if(aspath) {
962
    aspath->asn_len	= asn_len;
963
    aspath->length	= len;
964
    aspath->count	= 0;
965
    aspath->str		= NULL;
966
    if(len > 0)
967
       aspath->data	= malloc(len);
968
    else
969
       aspath->data	= NULL;
970
  }
971
  return aspath;
972
}
973
974
void aspath_error(struct aspath *as) {
975
  as->count = 0;
976
977
  if(as->str) {
978
    free(as->str);
979
    as->str = NULL;
980
  }
981
982
  as->str = malloc(strlen(ASPATH_STR_ERROR) + 1);
983
  strcpy(as->str, ASPATH_STR_ERROR);
984
}
985
986
void process_attr_aspath_string(struct aspath *as) {
987
    const int MAX_ASPATH_LEN = 8000;  
988
    as->str = malloc(MAX_ASPATH_LEN);
989
    
990
    /* Set default values */
991
    int space = 0;
992
    u_char type = AS_SEQUENCE;
993
    int pos = 0;
994
    
995
    /* Set initial pointer. */
996
    caddr_t pnt = as->data;
997
    caddr_t end = pnt + as->length;
998
    struct assegment *segment = NULL;
999
    
1000
    while (pnt < end) {
1001
      int i;
1002
1003
      /* For fetch value. */
1004
      segment = (struct assegment *) pnt;
1005
1006
      /* Check AS type validity. */
1007
      if ((segment->type != AS_SET) &&
1008
	  (segment->type != AS_SEQUENCE) &&
1009
	  (segment->type != AS_CONFED_SET) &&
1010
	  (segment->type != AS_CONFED_SEQUENCE))
1011
	{
1012
	  aspath_error(as);
1013
	  return;
1014
	}
1015
1016
      /* Check AS length. */
1017
      if ((pnt + (segment->length * as->asn_len) + AS_HEADER_SIZE) > end)
1018
	{
1019
	  aspath_error(as);
1020
	  return;
1021
	}
1022
1023
      /* If segment type is changed, print previous type's end
1024
         character. */
1025
      if (type != AS_SEQUENCE)
1026
	as->str[pos++] = aspath_delimiter_char (type, AS_SEG_END);
1027
      if (space)
1028
	as->str[pos++] = ' ';
1029
1030
      if (segment->type != AS_SEQUENCE)
1031
	as->str[pos++] = aspath_delimiter_char (segment->type, AS_SEG_START);
1032
1033
      space = 0;
1034
1035
      /* Increment as->count - NOT ignoring CONFED_SETS/SEQUENCES any more.
1036
         I doubt anybody was relying on this behaviour anyway. */
1037
      switch(segment->type) {
1038
	case AS_SEQUENCE:
1039
	case AS_CONFED_SEQUENCE:
1040
	  as->count += segment->length;
1041
	break;
1042
	case AS_SET:
1043
	case AS_CONFED_SET:
1044
	  as->count += 1;
1045
	break;
1046
      }
1047
1048
      for (i = 0; i < segment->length; i++)
1049
	{
1050
	  as_t asn;
1051
1052
	  if (space)
1053
	    {
1054
	      if (segment->type == AS_SET
1055
		  || segment->type == AS_CONFED_SET)
1056
		as->str[pos++] = ',';
1057
	      else
1058
		as->str[pos++] = ' ';
1059
	    }
1060
	  else
1061
	    space = 1;
1062
1063
	  int asn_pos = i * as->asn_len;
1064
          switch(as->asn_len) {
1065
                case ASN16_LEN:
1066
                    asn = ntohs (*(u_int16_t *) (segment->data + asn_pos));
1067
                    break;
1068
                case ASN32_LEN:
1069
                    asn = ntohl (*(u_int32_t *) (segment->data + asn_pos));
1070
                    break;
1071
                default:
1072
                    assert("invalid asn_len" && false);
1073
          }
1074
1075
          pos += int2str(asn, as->str + pos);
1076
          if(pos > MAX_ASPATH_LEN - 100) {
1077
              strcpy(as->str + pos, "...");
1078
              return;
1079
          };
1080
	}
1081
1082
      type = segment->type;
1083
      pnt += (segment->length * as->asn_len) + AS_HEADER_SIZE;
1084
    }
1085
1086
  if (segment && segment->type != AS_SEQUENCE)
1087
    as->str[pos++] = aspath_delimiter_char (segment->type, AS_SEG_END);
1088
1089
  as->str[pos] = '\0';
1090
}
1091
1092
char aspath_delimiter_char (u_char type, u_char which) {
1093
  int i;
1094
  struct
1095
  {
1096
    int type;
1097
    char start;
1098
    char end;
1099
  } aspath_delim_char [] =
1100
    {
1101
      { AS_SET,             '{', '}' },
1102
      { AS_SEQUENCE,        ' ', ' ' },
1103
      { AS_CONFED_SET,      '[', ']' },
1104
      { AS_CONFED_SEQUENCE, '(', ')' },
1105
      { 0, '\0', '\0' }
1106
    };
1107
1108
  for (i = 0; aspath_delim_char[i].type != 0; i++)
1109
    {
1110
      if (aspath_delim_char[i].type == type)
1111
	{
1112
	  if (which == AS_SEG_START)
1113
	    return aspath_delim_char[i].start;
1114
	  else if (which == AS_SEG_END)
1115
	    return aspath_delim_char[i].end;
1116
	}
1117
    }
1118
  return ' ';
1119
}
1120
1121
1122
void process_attr_community_string(struct community *com) {
1123
1124
  char buf[BUFSIZ];
1125
  int i;
1126
  u_int32_t comval;
1127
  u_int16_t as;
1128
  u_int16_t val;
1129
1130
  memset (buf, 0, BUFSIZ);
1131
1132
  for (i = 0; i < com->size; i++)
1133
    {
1134
      memcpy (&comval, com_nthval (com, i), sizeof (u_int32_t));
1135
      comval = ntohl (comval);
1136
      switch (comval)
1137
	{
1138
	case COMMUNITY_NO_EXPORT:
1139
	  strlcat (buf, " no-export", BUFSIZ);
1140
	  break;
1141
	case COMMUNITY_NO_ADVERTISE:
1142
	  strlcat (buf, " no-advertise", BUFSIZ);
1143
	  break;
1144
	case COMMUNITY_LOCAL_AS:
1145
	  strlcat (buf, " local-AS", BUFSIZ);
1146
	  break;
1147
	default:
1148
	  as = (comval >> 16) & 0xFFFF;
1149
	  val = comval & 0xFFFF;
1150
	  snprintf (buf + strlen (buf), BUFSIZ - strlen (buf),
1151
		    " %d:%d", as, val);
1152
	  break;
1153
	}
1154
    }
1155
1156
    com->str = malloc(strlen(buf)+1);
1157
    strcpy(com->str, buf);
1158
}
1159
1160
static struct mp_nlri *get_nexthop(struct mstream *s, u_int16_t afi) {
1161
    struct mp_nlri *nlri = calloc(1, sizeof(struct mp_nlri));
1162
    
1163
    nlri->nexthop_len = mstream_getc(s, NULL);
1164
    
1165
    // sometimes nexthop_len is 0 - not sure what this means (see IS-626)
1166
    // if(mp_nlri->nexthop_len == 0)
1167
    //    return len;
1168
1169
    if(afi == AFI_IP) {
1170
        assert(nlri->nexthop_len == 4);
1171
        nlri->nexthop.v4_addr = mstream_get_ipv4(s);
1172
        return nlri;
1173
    }
1174
1175
#ifdef BGPDUMP_HAVE_IPV6
1176
    assert(afi == AFI_IP6);
1177
    mstream_get(s, &nlri->nexthop.v6_addr, 16);
1178
    if(nlri->nexthop_len == 32) {
1179
        /* Is there also a link-local address? */
1180
        mstream_get(s, &nlri->nexthop_local.v6_addr.s6_addr, 16);
1181
    } else if(nlri->nexthop_len != 16) {
1182
        warn("process_mp_announce: unknown MP nexthop length %d", nlri->nexthop_len);
1183
    }
1184
#endif
1185
    return nlri;
1186
}
1187
1188
void process_mp_announce(struct mstream *s, struct mp_info *info, struct zebra_incomplete *incomplete) {
1189
    u_int16_t afi;
1190
    u_int8_t safi;
1191
1192
    // look for MRT abbreviated MP_NLRI packets
1193
    if(s->start[s->position] != 0) {
1194
        assert(info->announce[AFI_IP6][SAFI_UNICAST] == NULL);
1195
        info->announce[AFI_IP6][SAFI_UNICAST] = get_nexthop(s, AFI_IP6);
1196
        return;
1197
    }
1198
    
1199
    mstream_getw(s, &afi);
1200
    mstream_getc(s, &safi);
1201
        
1202
    if(afi > BGPDUMP_MAX_AFI || safi > BGPDUMP_MAX_SAFI) {
1203
            warn("process_mp_announce: unknown protocol(AFI=%d, SAFI=%d)!", afi, safi);
1204
            return;
1205
    }
1206
1207
    if(info->announce[afi][safi] != NULL) {
1208
            warn("process_mp_announce: two MP_NLRI for the same protocol(%d, %d)!", afi, safi);
1209
            return;
1210
    }
1211
1212
    info->announce[afi][safi] = get_nexthop(s, afi);
1213
1214
    // SNPA is defunct and num_snpa should always be 0
1215
    u_int8_t num_snpa;
1216
    if(mstream_getc(s, &num_snpa))
1217
        warn("process_mp_announce: MP_NLRI contains SNPAs, skipping");
1218
    for(; num_snpa > 0; --num_snpa) {
1219
        mstream_get(s, NULL, mstream_getc(s, NULL));
1220
    }
1221
1222
    info->announce[afi][safi]->prefix_count = read_prefix_list(s, afi, info->announce[afi][safi]->nlri, incomplete);
1223
}
1224
1225
void process_mp_withdraw(struct mstream *s, struct mp_info *info, struct zebra_incomplete *incomplete) {
1226
	u_int16_t afi;
1227
	u_int8_t safi;
1228
	struct mp_nlri *mp_nlri;
1229
1230
	mstream_getw(s, &afi);
1231
	mstream_getc(s, &safi);
1232
1233
	/* Do we know about this address family? */
1234
	if(afi > BGPDUMP_MAX_AFI || safi > BGPDUMP_MAX_SAFI) {
1235
		warn("process_mp_withdraw: unknown AFI,SAFI %d,%d!", afi, safi);
1236
		return;
1237
	}
1238
1239
	/* If there are 2 NLRI's for the same protocol, fail but don't burn and die */
1240
	if(info->withdraw[afi][safi] != NULL) {
1241
		warn("process_mp_withdraw: update contains more than one MP_NLRI with AFI,SAFI %d,%d!", afi, safi);
1242
		return;
1243
	}
1244
1245
	/* Allocate structure */
1246
	mp_nlri = malloc(sizeof(struct mp_nlri));
1247
	memset(mp_nlri, 0, sizeof(struct mp_nlri));
1248
	info->withdraw[afi][safi] = mp_nlri;
1249
1250
	mp_nlri->prefix_count = read_prefix_list(s, afi, mp_nlri->nlri, incomplete);
1251
}
1252
1253
static int read_prefix_list(struct mstream *s, u_int16_t afi, struct prefix *prefixes, struct zebra_incomplete *incomplete) {
1254
    int count = 0;
1255
    
1256
    while(mstream_can_read(s)) {
1257
        u_int8_t p_len = mstream_getc(s,NULL); // length in bits
1258
        u_int8_t p_bytes = (p_len + 7) / 8;
1259
        
1260
        /* Truncated prefix list? */
1261
        if(mstream_can_read(s) < p_bytes) {
1262
            if(! incomplete)
1263
                break;
1264
            
1265
            /* Put prefix in incomplete structure */
1266
            incomplete->afi = afi;
1267
            incomplete->orig_len = p_len;
1268
            incomplete->prefix = (struct prefix) {
1269
                .len = mstream_can_read(s) * 8
1270
            };
1271
            mstream_get(s, &incomplete->prefix.address, p_bytes);
1272
            break;
1273
        }
1274
        
1275
        struct prefix *prefix = prefixes + count;
1276
        
1277
        if(count++ > MAX_PREFIXES)
1278
            continue;
1279
1280
        *prefix = (struct prefix) { .len = p_len };
1281
        mstream_get(s, &prefix->address, p_bytes);
1282
    }
1283
    
1284
    if(count > MAX_PREFIXES) {
1285
        err("too many prefixes (%i > %i)", count, MAX_PREFIXES);
1286
        return MAX_PREFIXES;
1287
    }
1288
    
1289
    return count;
1290
}
1291
1292
static as_t read_asn(struct mstream *s, as_t *asn, u_int8_t len) {
1293
  u_int16_t asn16;
1294
1295
  assert(len == sizeof(u_int32_t) || len == sizeof(u_int16_t));
1296
  switch(len) {
1297
    case sizeof(u_int32_t):
1298
      return mstream_getl(s, asn);
1299
    case sizeof(u_int16_t):
1300
      mstream_getw(s, &asn16);
1301
      if(asn)
1302
	*asn = asn16;
1303
	return asn16;
1304
    default:
1305
      /* Not reached. Avoid compiler warning */
1306
      return 0;
1307
  }
1308
}
1309
1310
int check_new_aspath(struct aspath *aspath) {
1311
  struct assegment *segment;
1312
  for(segment = (struct assegment *) aspath->data;
1313
      segment < (struct assegment *) (aspath->data + aspath->length);
1314
      segment = (struct assegment *) ((char *) segment + sizeof(*segment) + segment->length * ASN32_LEN)) {
1315
    if(segment->type == AS_CONFED_SEQUENCE || segment->type == AS_CONFED_SET) {
1316
      warn("check_new_aspath: invalid segment of type AS_CONFED_%s in NEW_AS_PATH",
1317
	     segment->type == AS_CONFED_SET ? "SET" : "SEQUENCE");
1318
      return 0;
1319
    }
1320
  }
1321
  return 1;
1322
}
1323
1324
void process_asn32_trans(attributes_t *attr, u_int8_t asn_len) {
1325
  if(asn_len == ASN32_LEN) {
1326
    /* These attributes "SHOULD NOT" be used with ASN32. */
1327
    if(attr->flag & ATTR_FLAG_BIT(BGP_ATTR_NEW_AS_PATH))
1328
      warn("process_asn32_trans: ASN32 message contains NEW_AS_PATH attribute");
1329
1330
    if(attr->flag & ATTR_FLAG_BIT(BGP_ATTR_NEW_AGGREGATOR))
1331
      warn("process_asn32_trans: ASN32 message contains NEW_AGGREGATOR attribute");
1332
1333
    /* Don't compute anything, just leave AS_PATH and AGGREGATOR as they are */
1334
    return;
1335
  }
1336
1337
  /* Process NEW_AGGREGATOR */
1338
  if(attr->flag & ATTR_FLAG_BIT(BGP_ATTR_AGGREGATOR) &&
1339
     attr->flag & ATTR_FLAG_BIT(BGP_ATTR_NEW_AGGREGATOR)) {
1340
      /* Both AGGREGATOR and NEW_AGGREGATOR present, merge */
1341
      if(attr->aggregator_as != AS_TRAN) {
1342
	/* Don't do anything */
1343
	return;
1344
      } else {
1345
	attr->old_aggregator_as = attr->aggregator_as;
1346
	attr->old_aggregator_addr = attr->aggregator_addr;
1347
	attr->aggregator_as = attr->new_aggregator_as;
1348
	attr->aggregator_addr = attr->new_aggregator_addr;
1349
      }
1350
  }
1351
1352
  /* Process NEW_AS_PATH */
1353
  if(! (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_NEW_AS_PATH)))
1354
    return;
1355
1356
  // attr->aspath may be NULL, at least in case of MP_UNREACH_NLRI
1357
  if(attr->aspath == NULL) return;
1358
  if(attr->aspath->count < attr->new_aspath->count) {
1359
    return;
1360
  }
1361
1362
  /* Merge paths */
1363
  attr->old_aspath = attr->aspath;
1364
  attr->aspath = asn32_merge_paths(attr->old_aspath, attr->new_aspath);
1365
  if(attr->aspath) {
1366
    process_attr_aspath_string(attr->aspath);
1367
  }
1368
}
1369
1370
struct aspath *asn32_merge_paths(struct aspath *path, struct aspath *newpath) {
1371
  struct aspath *mergedpath = create_aspath(0, ASN32_LEN);
1372
  struct assegment *segment, *mergedsegment;
1373
  int newlen;
1374
1375
  /* Keep copying segments from AS_PATH until our path is as long as AS_PATH - NEW_AS_PATH. */
1376
  segment = (struct assegment *) (path->data);
1377
  while(mergedpath->count < path->count - newpath->count) {
1378
    /* Make room */
1379
    newlen = mergedpath->length + sizeof(struct assegment) + segment->length * ASN32_LEN;
1380
    mergedpath->data = realloc(mergedpath->data, newlen);
1381
1382
    /* Create a new AS-path segment */
1383
    mergedsegment = (struct assegment *) (mergedpath->data + mergedpath->length);
1384
1385
    /* Copy segment over. AS_PATH contains 16-bit ASes, so expand */
1386
    mergedsegment->type = segment->type;
1387
    mergedsegment->length = segment->length;
1388
    asn32_expand_16_to_32(mergedsegment->data, segment->data, segment->length);
1389
1390
    /* Update length */
1391
    mergedpath->length = newlen;
1392
    if(segment->type == AS_SET || segment->type == AS_CONFED_SET) {
1393
      mergedpath->count += 1;
1394
    } else {
1395
      mergedpath->count += segment->length;
1396
      /* Did we copy too many ASes over? */
1397
      if(mergedpath->count > path->count - newpath->count) {
1398
	mergedsegment->length -= mergedpath->count - (path->count - newpath->count);
1399
	mergedpath->length -= (mergedpath->count - (path->count - newpath->count)) * ASN32_LEN;
1400
      }
1401
    }
1402
  }
1403
1404
  /* Append NEW_AS_PATH to merged path */
1405
  mergedpath->data = realloc(mergedpath->data, mergedpath->length + newpath->length);
1406
  memcpy(mergedpath->data + mergedpath->length, newpath->data, newpath->length);
1407
  mergedpath->length += newpath->length;
1408
1409
  return mergedpath;
1410
}
1411
1412
void asn32_expand_16_to_32(char *dst, char *src, int len) {
1413
  u_int32_t *dstarray = (u_int32_t *) dst;
1414
  u_int16_t *srcarray = (u_int16_t *) src;
1415
  int i;
1416
1417
  for(i = 0; i < len; i++) {
1418
    dstarray[i] = htonl(ntohs(srcarray[i]));
1419
  }
1420
}
1421
1422
#if defined(linux)
1423
size_t strlcat(char *dst, const char *src, size_t size) {
1424
  if (strlen (dst) + strlen (src) >= size)
1425
    return -1;
1426
1427
  strcat (dst, src);
1428
1429
  return (strlen(dst));
1430
}
1431
#endif
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/bgpdump_lib.h (+64 lines)
Line 0 Link Here
1
/*
2
 Copyright (c) 2007 - 2010 RIPE NCC - All Rights Reserved
3
 
4
 Permission to use, copy, modify, and distribute this software and its
5
 documentation for any purpose and without fee is hereby granted, provided
6
 that the above copyright notice appear in all copies and that both that
7
 copyright notice and this permission notice appear in supporting
8
 documentation, and that the name of the author not be used in advertising or
9
 publicity pertaining to distribution of the software without specific,
10
 written prior permission.
11
 
12
 THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
13
 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
14
 AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
15
 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
16
 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
 
19
Parts of this code have been engineered after analiyzing GNU Zebra's
20
source code and therefore might contain declarations/code from GNU
21
Zebra, Copyright (C) 1999 Kunihiro Ishiguro. Zebra is a free routing
22
software, distributed under the GNU General Public License. A copy of
23
this license is included with libbgpdump.
24
25
Original Author: Dan Ardelean (dan@ripe.net)
26
*/
27
28
#ifndef _BGPDUMP_LIB_H
29
#define _BGPDUMP_LIB_H
30
31
#include <stdio.h>
32
33
#define BGPDUMP_HAVE_IPV6
34
35
#include "bgpdump_attr.h"
36
#include "bgpdump_formats.h"
37
38
#define BGPDUMP_MAX_FILE_LEN	1024
39
#define BGPDUMP_MAX_AS_PATH_LEN	2000
40
41
// if you include cfile_tools.h, include it first
42
#ifndef _CFILE_TOOLS_DEFINES
43
typedef struct _CFRFILE CFRFILE;
44
#endif
45
46
typedef struct struct_BGPDUMP {
47
    CFRFILE	*f;
48
    int		f_type;
49
    int		eof;
50
    char	filename[BGPDUMP_MAX_FILE_LEN];
51
    int		parsed;
52
    int		parsed_ok;
53
} BGPDUMP;
54
55
/* prototypes */
56
57
BGPDUMP *bgpdump_open_dump(const char *filename);
58
void	bgpdump_close_dump(BGPDUMP *dump);
59
BGPDUMP_ENTRY*	bgpdump_read_next(BGPDUMP *dump);
60
void	bgpdump_free_mem(BGPDUMP_ENTRY *entry);
61
62
char *bgpdump_version(void);
63
64
#endif
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/bgpdump_mstream.c (+103 lines)
Line 0 Link Here
1
/*
2
 Copyright (c) 2007 - 2010 RIPE NCC - All Rights Reserved
3
 
4
 Permission to use, copy, modify, and distribute this software and its
5
 documentation for any purpose and without fee is hereby granted, provided
6
 that the above copyright notice appear in all copies and that both that
7
 copyright notice and this permission notice appear in supporting
8
 documentation, and that the name of the author not be used in advertising or
9
 publicity pertaining to distribution of the software without specific,
10
 written prior permission.
11
 
12
 THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
13
 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
14
 AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
15
 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
16
 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
 
19
Parts of this code have been engineered after analiyzing GNU Zebra's
20
source code and therefore might contain declarations/code from GNU
21
Zebra, Copyright (C) 1999 Kunihiro Ishiguro. Zebra is a free routing
22
software, distributed under the GNU General Public License. A copy of
23
this license is included with libbgpdump.
24
25
Original Author: Dan Ardelean (dan@ripe.net)
26
*/
27
28
#include "bgpdump-config.h"
29
#include "bgpdump_mstream.h"
30
31
#include <stdio.h>
32
#include <string.h>
33
#include <netinet/in.h>
34
35
void mstream_init(struct mstream *s, u_char *buffer, u_int32_t len) {
36
    s->start=buffer;
37
    s->position=0;
38
    s->len=len;
39
}
40
41
u_char mstream_getc(struct mstream *s, u_char *d) {
42
    u_char data;
43
44
    mstream_get(s, &data, sizeof(data));
45
    if(d!=NULL) memcpy(d,&data,sizeof(data));
46
    return data;
47
}
48
49
u_int16_t mstream_getw(struct mstream *s, u_int16_t *d) {
50
    u_int16_t data;
51
52
    mstream_get(s, &data, sizeof(data));
53
    data=ntohs(data);
54
    if(d!=NULL) memcpy(d,&data,sizeof(data));
55
    return data;
56
}
57
58
u_int32_t mstream_getl(struct mstream *s, u_int32_t *d) {
59
    u_int32_t data;
60
61
    mstream_get(s, &data, sizeof(data));
62
    data=ntohl(data);
63
    if(d!=NULL) memcpy(d,&data,sizeof(data));
64
    return data;
65
}
66
67
struct in_addr mstream_get_ipv4(struct mstream *s) {
68
    struct in_addr addr;
69
70
    mstream_get(s, &addr.s_addr, 4);
71
    return addr;
72
}
73
74
u_int32_t mstream_can_read(struct mstream *s) {
75
    return s->len - s->position;
76
}
77
78
// construct a partial mstream
79
mstream_t mstream_copy(mstream_t *s, int len) {
80
    mstream_t copy = {0};
81
    copy.start = s->start + s->position;
82
    copy.len = mstream_get(s, NULL, len);
83
    return copy;
84
}
85
86
u_int32_t mstream_get (struct mstream *s, void *d, u_int32_t len) {
87
    int room = mstream_can_read(s);
88
89
    if(room >= len) {
90
	if(d) memcpy(d, s->start + s->position, len);
91
	s->position += len;
92
	return len;
93
    } else {
94
	/* Reading past end of buffer!
95
	   Zero out extra bytes and set position to end of buffer */
96
	if(d) {
97
	    memcpy(d, s->start + s->position, room);
98
	    memset((char *)d + room, 0, len - room);
99
	}
100
	s->position = s->len;
101
	return room;
102
    }
103
}
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/bgpdump_mstream.h (+49 lines)
Line 0 Link Here
1
/*
2
 Copyright (c) 2007 - 2010 RIPE NCC - All Rights Reserved
3
 
4
 Permission to use, copy, modify, and distribute this software and its
5
 documentation for any purpose and without fee is hereby granted, provided
6
 that the above copyright notice appear in all copies and that both that
7
 copyright notice and this permission notice appear in supporting
8
 documentation, and that the name of the author not be used in advertising or
9
 publicity pertaining to distribution of the software without specific,
10
 written prior permission.
11
 
12
 THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
13
 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
14
 AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
15
 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
16
 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
 
19
Parts of this code have been engineered after analiyzing GNU Zebra's
20
source code and therefore might contain declarations/code from GNU
21
Zebra, Copyright (C) 1999 Kunihiro Ishiguro. Zebra is a free routing
22
software, distributed under the GNU General Public License. A copy of
23
this license is included with libbgpdump.
24
25
Original Author: Dan Ardelean (dan@ripe.net)
26
*/
27
28
#ifndef _BGPDUMP_MSTREAM_H
29
#define _BGPDUMP_MSTREAM_H
30
31
#include <sys/types.h>
32
#include <netinet/in.h>
33
34
typedef struct mstream {
35
    u_char	*start;
36
    u_int16_t	position;
37
    u_int32_t	len;
38
} mstream_t;
39
40
void      mstream_init(struct mstream *s, u_char *buffer,u_int32_t len);
41
u_char    mstream_getc(struct mstream *s, u_char *d);
42
u_int16_t mstream_getw(struct mstream *s, u_int16_t *d);
43
u_int32_t mstream_getl(struct mstream *s, u_int32_t *d);
44
struct in_addr mstream_get_ipv4(struct mstream *s);
45
u_int32_t mstream_can_read(struct mstream *s);
46
u_int32_t mstream_get (struct mstream *s, void *d, u_int32_t len);
47
mstream_t mstream_copy(mstream_t *s, int len);
48
49
#endif
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/bootstrap.sh (+5 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
autoheader
4
autoconf
5
./configure
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/cfile_tools.c (+551 lines)
Line 0 Link Here
1
/** 
2
  cfile_tools.c
3
 
4
  A library to deal transparently with possibly compressed files.  
5
  Documentation in the function headers and in cfile_tools.h
6
7
  Copyright (C) 2004 by Arno Wagner <arno.wagner@acm.org> 
8
  Distributed under the Gnu Public License version 2 or the modified
9
  BSD license (see file COPYING)
10
11
  Support for gzip added by Bernhard Tellenbach <bernhard.tellenbach@gmail.com>   
12
*/
13
14
#define _GNU_SOURCE
15
#define _FILE_OFFSET_BITS 64
16
17
//#ifndef DONT_HAVE_BZ2
18
//#include <bzlib.h>
19
//#endif
20
21
#include <stdlib.h>
22
#include <string.h>
23
#include <errno.h>
24
#include <assert.h>
25
#include "cfile_tools.h"
26
27
// Concrete formats. remember to adjust CFR_NUM_FORMATS if changed!
28
// Note: 0, 1 are special entries.
29
30
const char * cfr_formats[CFR_NUM_FORMATS] = {
31
  "not open",     //  0
32
  "uncompressed", //  1
33
#ifndef DONT_HAVE_BZ2
34
  "bzip2",         //  2
35
#endif
36
#ifndef DONT_HAVE_GZ
37
  "gzip",         //  3
38
#endif
39
};
40
41
const char * cfr_extensions[CFR_NUM_FORMATS] = {
42
  "",             //  0
43
  "",             //  1
44
#ifndef DONT_HAVE_BZ2
45
  ".bz2",          //  2
46
#endif
47
#ifndef DONT_HAVE_GZ
48
  ".gz"          //  3
49
#endif
50
};
51
52
53
// Prototypes of non API functions (don't use these from outside this file)
54
const char * _cfr_compressor_strerror(int format, int err);
55
const char * _bz2_strerror(int err);
56
57
58
// API Functions 
59
60
CFRFILE *cfr_open(const char *path) {
61
  /*******************************/
62
  // Analog to 'fopen'. Error in result has to be tested using
63
  // 'cfr_error' on the result!
64
  // Note: The user needs to free the reurn value!
65
  // Opens a possibly compressed file for reading.
66
  // File type is determined by file name ending
67
68
  int format, ext_len, name_len;
69
  CFRFILE * retval = NULL;
70
71
  // determine file format
72
  name_len = strlen(path);
73
  format = 2;  // skip specials 0, 1 
74
75
  // Do action dependent on file format
76
  retval = (CFRFILE *) calloc(1,sizeof(CFRFILE));
77
  retval->eof = 0;
78
  retval->error1 = 0;
79
  retval->error2 = 0;
80
81
82
#ifndef DONT_HAVE_GZ
83
  if((path == NULL) || (strcmp(path, "-") == 0)) {
84
	/* dump from stdin */
85
	gzFile *f;
86
	while (format < CFR_NUM_FORMATS) {
87
		if (strcmp(cfr_extensions[format], ".gz") == 0)
88
        		break;
89
    		format ++;
90
  	}
91
	f = gzdopen(0, "r");
92
	if(f == NULL) {
93
		free(retval);
94
		return (NULL);
95
    	}
96
        retval->data2 = f;
97
	retval->format = format;
98
	return (retval);
99
  }
100
#endif
101
  while (format < CFR_NUM_FORMATS) {
102
    ext_len = strlen(cfr_extensions[format]);
103
    if (strncmp(cfr_extensions[format],
104
                path+(name_len-ext_len),
105
                ext_len) == 0
106
        ) break;
107
    format ++;
108
  }
109
  if (format >= CFR_NUM_FORMATS) 
110
	format = 1;  // uncompressed 
111
  retval->format = format;
112
113
  switch (format) {
114
  case 1:  // uncompressed
115
    { 
116
      FILE * in;
117
      in = fopen(path,"r");
118
      if (in == NULL) { 
119
	free(retval);
120
        return(NULL);
121
      }
122
      retval->data1 = in;
123
      return(retval);
124
    }
125
    break;
126
#ifndef DONT_HAVE_BZ2
127
  case 2:  // bzip2
128
    { 
129
      int bzerror;
130
      BZFILE * bzin;
131
      FILE * in;
132
      
133
      retval->bz2_stream_end = 0;
134
      
135
      // get file
136
      in = fopen(path,"r");
137
      if (in == NULL) { 
138
        free(retval);
139
        return(NULL);
140
      }
141
      retval->data1 = in;
142
      
143
      // bzip2ify file
144
      bzin = BZ2_bzReadOpen( &bzerror, in, 0, 0, NULL, 0); 
145
      if (bzerror != BZ_OK) {
146
        errno = bzerror;
147
        BZ2_bzReadClose( &bzerror, bzin);
148
        fclose(in);
149
	free(retval);
150
        return(NULL);
151
      }
152
      retval->data2 = bzin;
153
      return(retval);
154
    }
155
    break;
156
#endif
157
#ifndef DONT_HAVE_GZ
158
  case 3:  // gzip
159
    { 
160
	gzFile *f;
161
      	// get file 
162
	f = gzopen(path, "r");
163
	if(f == NULL) {
164
		free(retval);
165
		return (NULL);
166
    	}
167
        retval->data2 = f;
168
	return (retval);
169
   }
170
   break;
171
#endif
172
  default:  // this is an internal error, no diag yet.
173
    fprintf(stderr,"illegal format '%d' in cfr_open!\n", format);
174
    exit(1);
175
  }
176
  return NULL;
177
} 
178
179
180
181
int cfr_close(CFRFILE *stream) {
182
  /**************************/
183
  // Analog to 'fclose'.
184
  // FIXME - why is stream->* set, then freed?
185
  if (stream == NULL || stream->closed) {
186
      errno = EBADF;
187
      return -1;
188
  }
189
    
190
  int retval = -1;
191
  
192
  switch (stream->format) {
193
  case 1:  // uncompressed
194
      retval = fclose((FILE *)(stream->data1));
195
      stream->error1 = retval;
196
      break;
197
  case 2: // bzip2
198
      #ifndef DONT_HAVE_BZ2
199
      BZ2_bzReadClose( &stream->error2, (BZFILE *)stream->data2);
200
      stream->error1 = retval = fclose((FILE *)(stream->data1));
201
      break;
202
      #endif
203
  case 3:  // gzip
204
      #ifndef DONT_HAVE_GZ
205
      if(stream->data2!=NULL)
206
          retval = gzclose(stream->data2);
207
      stream->error2 = retval;
208
      break;
209
      #endif
210
    default:  // internal error
211
          assert("illegal stream->format" && 0);
212
  }
213
  free(stream);
214
  return(retval);
215
}
216
217
size_t cfr_read_n(CFRFILE *stream, void *ptr, size_t bytes) {
218
  /******************************************************************/
219
  // Wrapper, will return either 'bytes' (the number of bytes to read) or 0 
220
  return(cfr_read(ptr, bytes, 1, stream)*bytes);
221
}
222
223
size_t cfr_read(void *ptr, size_t size, size_t nmemb, CFRFILE *stream) {
224
  /******************************************************************/
225
  // Analog to 'fread'. Will not return with partial elements, only
226
  // full ones. Hence calling this function with one large element
227
  // size will result in a complete or no read.
228
  
229
  size_t retval = 0;
230
  if (stream == NULL) return(0);
231
232
  // shortcut
233
  if (stream->eof) return(0);
234
235
  switch (stream->format) {
236
  case 1:  // uncompressed
237
    { 
238
      FILE * in;
239
      in = (FILE *)(stream->data1);
240
      retval = fread(ptr, size, nmemb, in);
241
      if (retval != nmemb) {
242
        // fprintf(stderr,"short read!!!\n");
243
        stream->eof = feof(in);
244
        stream->error1 = ferror(in);
245
	retval = 0;
246
      }
247
      return (retval);
248
    }
249
    break;
250
#ifndef DONT_HAVE_BZ2    
251
   case 2:  // bzip2
252
    { 
253
      BZFILE * bzin; 
254
      int bzerror;
255
      int buffsize;
256
257
      if (stream->bz2_stream_end == 1) {
258
        // feof-behaviour: Last read did consume last byte but not more
259
        stream->eof = 1;
260
        return(0);
261
      }
262
263
      bzerror = BZ_OK;
264
      bzin = (BZFILE *) (stream->data2);
265
      buffsize = size * nmemb;
266
267
      retval = BZ2_bzRead(&bzerror, bzin, ptr, buffsize);
268
269
      if (bzerror == BZ_STREAM_END ) {
270
        stream->bz2_stream_end = 1;
271
        stream->error2 = bzerror;
272
        if (retval == buffsize) {
273
          // feof-behaviour: no eof yet
274
        } else {
275
          // feof-behaviour: read past end, set eof
276
          stream->eof = 1;
277
	  retval = 0;
278
        }
279
        return(retval/size);
280
      }
281
      if (bzerror == BZ_OK) {
282
        // Normal case, no error.
283
        // A short read here is an error, so catch it
284
        if (retval == buffsize) {
285
          return(retval/size);
286
        }
287
      }
288
289
      // Other error...
290
      stream->error2 = bzerror;
291
      BZ2_bzReadClose( &bzerror, bzin );
292
      if (bzerror != BZ_OK) {
293
        stream->error2 = bzerror;
294
      }
295
      retval = fclose((FILE *)(stream->data1));
296
      stream->error1 = retval;
297
      stream->closed = 1;
298
      return(0);
299
    }
300
    break;
301
#endif    
302
#ifndef DONT_HAVE_GZ
303
  case 3:  // gzip
304
    { 
305
      gzFile * in;
306
      in = (gzFile *)(stream->data2);
307
      retval = gzread(in, ptr, size*nmemb);
308
      if (retval != nmemb*size) {
309
        // fprintf(stderr,"short read!!!\n");
310
        stream->eof = gzeof(in);
311
        stream->error2 = errno;
312
	retval = 0;
313
      }
314
      return (retval/size);
315
    }
316
    break;
317
#endif
318
  default:  // this is an internal error, no diag yet.
319
    fprintf(stderr,"illegal format '%d' in cfr_read!\n",stream->format);
320
    exit(1);
321
  }
322
} 
323
324
325
326
327
328
ssize_t cfr_getline(char **lineptr, size_t *n, CFRFILE *stream) {
329
  /************************************************************/
330
  // May not be very efficient, since it uses single-char reads
331
  // for formats where there is no native getline in the library.
332
  // For bzip2 the speedup for additional buffering was only 5%
333
  // so I dropped it.
334
  // Returns -1 in case of an error.
335
  
336
  if (stream == NULL) return(-1);  
337
338
  switch (stream->format) {
339
  case 1:  // uncompressed
340
    { 
341
      if (fgets(*lineptr, *n, (FILE *)(stream->data1)) == NULL) {
342
        stream->error1 = errno;
343
	return -1;
344
      }
345
      return 0;
346
    }
347
    break;
348
349
#ifndef DONT_HAVE_BZ2
350
  case 2:  // bzip2  
351
    {                
352
      size_t count;
353
      char c;
354
      size_t ret;
355
356
	  //bzin = (BZFILE *) (stream->data2);
357
358
      // allocate initial buffer if none was passed or size was zero
359
      if (*lineptr == NULL) {
360
        *lineptr = (char *) calloc(120, 1);
361
        *n = 120;
362
      }
363
      if (*n == 0) {
364
        *n = 120;
365
        *lineptr = (char *) realloc(*lineptr, *n); // to avoid memory-leaks
366
      }
367
368
      count = 0;
369
      // read until '\n'
370
      do {
371
        ret = cfr_read(&c, 1, 1, stream);
372
        if (ret != 1) {
373
          return(-1);
374
        }
375
        count ++;
376
        if (count >= *n) {
377
          *n = 2 * *n;
378
          *lineptr = (char *) realloc(*lineptr, *n);
379
          if (*lineptr == NULL) {
380
            stream->error1 = errno;
381
            return(-1);
382
          }
383
        }
384
        (*lineptr)[count-1] = c;
385
      } while (c != '\n');
386
      (*lineptr)[count] = 0;
387
      return(count);
388
    }
389
    break;
390
#endif
391
#ifndef DONT_HAVE_GZ
392
  case 3:  // gzip
393
    { 
394
      char * return_ptr = gzgets((gzFile *)(stream->data2), *lineptr, *n );
395
      if (return_ptr == Z_NULL) {
396
        stream->error2 = errno;
397
        return(-1);
398
      }
399
      return *n;
400
  
401
    }
402
    break;
403
#endif
404
  default:  // this is an internal error, no diag yet.
405
    fprintf(stderr,"illegal format '%d' in cfr_getline!\n",stream->format);
406
    exit(1);
407
    return(-1);
408
  }     
409
}
410
411
412
413
int cfr_eof(CFRFILE *stream) {
414
  // Returns true on end of file/end of compressed data.
415
  // The end of the compressed data is regarded as end of file
416
  // in this library, embedded or multiple compressed data per 
417
  // file is not supported by this library.
418
  //
419
  // Note: The sematics is that cfr_eof is true only after
420
  // the first byte after the end of file was read. Some compressors
421
  // report EOF already when the last availale character has been 
422
  // read (far more sensible IMO), but for consistency we follow the
423
  // convention of the standard c library here.
424
425
  return(stream->eof);
426
}
427
428
429
430
int cfr_error(CFRFILE *stream) {
431
  // Returns true on error.
432
  // Errors can be ordinary errors from fopen.fclose/fread
433
  // or can originate from the underlying compression.
434
  // This function just returns 0 when there is no error or
435
  // 1 in case of error.
436
  // To get a more detailed report cfr_strerror will try to
437
  // come up with a description of the whole situation.
438
  // For numeric details, more query functions would need to be
439
  // implemented.
440
  
441
  if (stream == NULL) return(1);
442
  return(stream->error1 || stream->error2);
443
}
444
445
446
char * cfr_strerror(CFRFILE *stream) {
447
  // Result is "stream-i/o: <stream-error> <compressor>[: <compressor error>]"
448
  // Do not modify result. 
449
  // Result may change on subsequent call to this function.
450
451
  static char res[120];
452
  char * msg, * msg2;
453
454
  if (stream == NULL) {
455
    asprintf(&msg,"Error: stream is NULL, i.e. not opened");
456
    return(msg);
457
  }
458
459
  asprintf(&msg,
460
           "stream-i/o: %s, %s  [%s]",
461
           stream->eof?"EOF":"",
462
           strerror(stream->error1),
463
           cfr_compressor_str(stream));
464
  if (stream->format == 2) {
465
    asprintf(&msg2, 
466
             "%s: %s",
467
             msg, 
468
             _cfr_compressor_strerror(stream->format, stream->error2));
469
    free(msg);
470
    msg = msg2;
471
  } 
472
  if (stream->format == 3) {
473
    asprintf(&msg2, 
474
             "%s: %s",
475
             msg, 
476
             gzerror((gzFile*)(stream->data2), &(stream->error2)));
477
    free(msg);
478
    msg = msg2;
479
  }
480
  snprintf(res, 120, "%s", msg);
481
  res[119] = 0;
482
  free(msg); 
483
  return(res);
484
}
485
486
const char * cfr_compressor_str(CFRFILE *stream) {
487
  // Returns the name of the compressor used
488
489
  if ((stream->format < 0) || (stream->format >= CFR_NUM_FORMATS)) {
490
    return("undefined compression type");
491
  } else {
492
    return (cfr_formats[stream->format]);
493
  }
494
}
495
496
497
// Utility functions for compressor errors. 
498
// * Not part of the API, do not call directly as they may change! *
499
500
const char * _cfr_compressor_strerror(int format, int err) {
501
  // Transforms error code to string for all compressors
502
  
503
  switch (format) {
504
  case 0: 
505
    return("file not open");
506
    break;
507
508
  case 1:
509
    return("file not compressed");
510
    break;
511
    
512
#ifndef DONT_HAVE_BZ2
513
  case 2:
514
    return(_bz2_strerror(err));
515
    break;
516
#endif          
517
#ifndef DONT_HAVE_GZ
518
  case 3:
519
    return NULL;
520
    break;
521
#endif          
522
  default:
523
    return("unknowen compressor code");
524
  }  
525
}
526
    
527
#ifndef DONT_HAVE_BZ2
528
const char * _bz2_strerror(int err) {
529
  // Since bzlib does not have strerror, we do it here manually.
530
  // This works for version 1.0 of 21 March 2000 of bzlib.h
531
  
532
  switch (err) {
533
  case BZ_OK: return("BZ_OK");
534
  case BZ_RUN_OK: return("BZ_RUN_OK");
535
  case BZ_FLUSH_OK: return("BZ_FLUSH_OK");
536
  case BZ_FINISH_OK: return("BZ_FINISH_OK");
537
  case BZ_STREAM_END: return("BZ_STREAM_END");
538
  case BZ_SEQUENCE_ERROR: return("BZ_SEQUENCE_ERROR");
539
  case BZ_PARAM_ERROR: return("BZ_PARAM_ERROR");
540
  case BZ_MEM_ERROR: return("BZ_MEM_ERROR");
541
  case BZ_DATA_ERROR: return("BZ_DATA_ERROR");
542
  case BZ_DATA_ERROR_MAGIC: return("BZ_DATA_ERROR_MAGIC");
543
  case BZ_IO_ERROR: return("BZ_IO_ERROR");
544
  case BZ_UNEXPECTED_EOF: return("BZ_UNEXPECTED_EOF");
545
  case BZ_OUTBUFF_FULL: return("BZ_OUTBUFF_FULL");
546
  case BZ_CONFIG_ERROR: return("BZ_CONFIG_ERROR");
547
  default: return("unknowen bzip2 error code");
548
  }
549
}
550
#endif
551
    
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/cfile_tools.h (+91 lines)
Line 0 Link Here
1
/** 
2
  cfile_tools.h
3
  A small library containing tools for dealing with files
4
  that are compressed with different compressors or not compressed
5
  at all. The idea is to recognize the compression automagically
6
  and transparently. Files can be opened for reading or writing,
7
  but not both. Reading and writing is by different function classes.
8
  Access is sequential only.
9
10
  Copyright (C) 2004 by Arno Wagner <arno.wagner@acm.org> 
11
  Distributed under the Gnu Public License version 2 or the modified
12
  BSD license (see file COPYING)
13
14
  Support for gzip added by Bernhard Tellenbach <bernhard.tellenbach@gmail.com>
15
16
  Function prefixes are: 
17
     cfr_ = compressed file read   
18
19
  Supported:
20
  Reading: 
21
  - type recognition from file name extension 
22
  - standard input (filename: '-' )
23
  - no compression
24
  - bzip2  
25
  - gzip
26
*/
27
28
#ifndef _CFILE_TOOLS_DEFINES
29
#define _CFILE_TOOLS_DEFINES
30
31
#define _GNU_SOURCE
32
#define _FILE_OFFSET_BITS 64
33
34
#include <stdio.h>
35
#include <unistd.h>
36
37
#ifndef DONT_HAVE_BZ2
38
#include <bzlib.h>
39
#endif
40
41
#ifndef DONT_HAVE_GZ
42
#include <zlib.h>
43
#endif
44
45
// Types
46
47
struct _CFRFILE {
48
  int format;       // 0 = not open, 1 = uncompressed, 2 = bzip2, 3 = gzip
49
  int eof;          // 0 = not eof 
50
  int closed;       // indicates whether fclose has been called, 0 = not yet
51
  int error1;       // errors from the sytem, 0 = no error
52
  int error2;       // for error messages from the compressor
53
  FILE * data1;     // for filehandle of the system 
54
  void * data2;     // addtional handle(s) of the compressor
55
  // compressor specific stuff 
56
  int bz2_stream_end; // True when a bz2 stream has ended. Needed since
57
                      // further reading returns error and not eof.
58
};
59
60
typedef struct _CFRFILE CFRFILE;
61
62
// Formats
63
64
#ifndef DONT_HAVE_BZ2
65
  #ifndef DONT_HAVE_GZ
66
	#define CFR_NUM_FORMATS 4
67
  #else
68
	#define CFR_NUM_FORMATS 3
69
  #endif
70
#else
71
	#define CFR_NUM_FORMATS 2
72
#endif
73
74
// Functions
75
76
CFRFILE    * cfr_open(const char *path); 
77
int          cfr_close(CFRFILE *stream);
78
size_t       cfr_read(void *ptr, size_t size, size_t nmemb, CFRFILE *stream);
79
size_t       cfr_read_n(CFRFILE *stream, void *ptr, size_t bytes);
80
ssize_t      cfr_getline(char **lineptr, size_t *n, CFRFILE *stream);
81
int          cfr_eof(CFRFILE *stream);
82
int          cfr_error(CFRFILE *stream);
83
char       * cfr_strerror(CFRFILE *stream);
84
const char * cfr_compressor_str(CFRFILE *stream);
85
86
#ifndef DONT_HAVE_BZ2
87
const char * _bz2_strerror(int err);
88
#endif
89
90
91
#endif
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/config.status (+997 lines)
Line 0 Link Here
1
#! /bin/sh
2
# Generated by configure.
3
# Run this file to recreate the current configuration.
4
# Compiler output produced by configure, useful for debugging
5
# configure, is in config.log if it exists.
6
7
debug=false
8
ac_cs_recheck=false
9
ac_cs_silent=false
10
11
SHELL=${CONFIG_SHELL-/bin/sh}
12
export SHELL
13
## -------------------- ##
14
## M4sh Initialization. ##
15
## -------------------- ##
16
17
# Be more Bourne compatible
18
DUALCASE=1; export DUALCASE # for MKS sh
19
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
20
  emulate sh
21
  NULLCMD=:
22
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
23
  # is contrary to our usage.  Disable this feature.
24
  alias -g '${1+"$@"}'='"$@"'
25
  setopt NO_GLOB_SUBST
26
else
27
  case `(set -o) 2>/dev/null` in #(
28
  *posix*) :
29
    set -o posix ;; #(
30
  *) :
31
     ;;
32
esac
33
fi
34
35
36
as_nl='
37
'
38
export as_nl
39
# Printing a long string crashes Solaris 7 /usr/bin/printf.
40
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
41
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
42
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
43
# Prefer a ksh shell builtin over an external printf program on Solaris,
44
# but without wasting forks for bash or zsh.
45
if test -z "$BASH_VERSION$ZSH_VERSION" \
46
    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
47
  as_echo='print -r --'
48
  as_echo_n='print -rn --'
49
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
50
  as_echo='printf %s\n'
51
  as_echo_n='printf %s'
52
else
53
  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
54
    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
55
    as_echo_n='/usr/ucb/echo -n'
56
  else
57
    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
58
    as_echo_n_body='eval
59
      arg=$1;
60
      case $arg in #(
61
      *"$as_nl"*)
62
	expr "X$arg" : "X\\(.*\\)$as_nl";
63
	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
64
      esac;
65
      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
66
    '
67
    export as_echo_n_body
68
    as_echo_n='sh -c $as_echo_n_body as_echo'
69
  fi
70
  export as_echo_body
71
  as_echo='sh -c $as_echo_body as_echo'
72
fi
73
74
# The user is always right.
75
if test "${PATH_SEPARATOR+set}" != set; then
76
  PATH_SEPARATOR=:
77
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
78
    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
79
      PATH_SEPARATOR=';'
80
  }
81
fi
82
83
84
# IFS
85
# We need space, tab and new line, in precisely that order.  Quoting is
86
# there to prevent editors from complaining about space-tab.
87
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
88
# splitting by setting IFS to empty value.)
89
IFS=" ""	$as_nl"
90
91
# Find who we are.  Look in the path if we contain no directory separator.
92
as_myself=
93
case $0 in #((
94
  *[\\/]* ) as_myself=$0 ;;
95
  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
96
for as_dir in $PATH
97
do
98
  IFS=$as_save_IFS
99
  test -z "$as_dir" && as_dir=.
100
    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
101
  done
102
IFS=$as_save_IFS
103
104
     ;;
105
esac
106
# We did not find ourselves, most probably we were run as `sh COMMAND'
107
# in which case we are not to be found in the path.
108
if test "x$as_myself" = x; then
109
  as_myself=$0
110
fi
111
if test ! -f "$as_myself"; then
112
  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
113
  exit 1
114
fi
115
116
# Unset variables that we do not need and which cause bugs (e.g. in
117
# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
118
# suppresses any "Segmentation fault" message there.  '((' could
119
# trigger a bug in pdksh 5.2.14.
120
for as_var in BASH_ENV ENV MAIL MAILPATH
121
do eval test x\${$as_var+set} = xset \
122
  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
123
done
124
PS1='$ '
125
PS2='> '
126
PS4='+ '
127
128
# NLS nuisances.
129
LC_ALL=C
130
export LC_ALL
131
LANGUAGE=C
132
export LANGUAGE
133
134
# CDPATH.
135
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
136
137
138
# as_fn_error STATUS ERROR [LINENO LOG_FD]
139
# ----------------------------------------
140
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
141
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
142
# script with STATUS, using 1 if that was 0.
143
as_fn_error ()
144
{
145
  as_status=$1; test $as_status -eq 0 && as_status=1
146
  if test "$4"; then
147
    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
148
    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
149
  fi
150
  $as_echo "$as_me: error: $2" >&2
151
  as_fn_exit $as_status
152
} # as_fn_error
153
154
155
# as_fn_set_status STATUS
156
# -----------------------
157
# Set $? to STATUS, without forking.
158
as_fn_set_status ()
159
{
160
  return $1
161
} # as_fn_set_status
162
163
# as_fn_exit STATUS
164
# -----------------
165
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
166
as_fn_exit ()
167
{
168
  set +e
169
  as_fn_set_status $1
170
  exit $1
171
} # as_fn_exit
172
173
# as_fn_unset VAR
174
# ---------------
175
# Portably unset VAR.
176
as_fn_unset ()
177
{
178
  { eval $1=; unset $1;}
179
}
180
as_unset=as_fn_unset
181
# as_fn_append VAR VALUE
182
# ----------------------
183
# Append the text in VALUE to the end of the definition contained in VAR. Take
184
# advantage of any shell optimizations that allow amortized linear growth over
185
# repeated appends, instead of the typical quadratic growth present in naive
186
# implementations.
187
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
188
  eval 'as_fn_append ()
189
  {
190
    eval $1+=\$2
191
  }'
192
else
193
  as_fn_append ()
194
  {
195
    eval $1=\$$1\$2
196
  }
197
fi # as_fn_append
198
199
# as_fn_arith ARG...
200
# ------------------
201
# Perform arithmetic evaluation on the ARGs, and store the result in the
202
# global $as_val. Take advantage of shells that can avoid forks. The arguments
203
# must be portable across $(()) and expr.
204
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
205
  eval 'as_fn_arith ()
206
  {
207
    as_val=$(( $* ))
208
  }'
209
else
210
  as_fn_arith ()
211
  {
212
    as_val=`expr "$@" || test $? -eq 1`
213
  }
214
fi # as_fn_arith
215
216
217
if expr a : '\(a\)' >/dev/null 2>&1 &&
218
   test "X`expr 00001 : '.*\(...\)'`" = X001; then
219
  as_expr=expr
220
else
221
  as_expr=false
222
fi
223
224
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
225
  as_basename=basename
226
else
227
  as_basename=false
228
fi
229
230
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
231
  as_dirname=dirname
232
else
233
  as_dirname=false
234
fi
235
236
as_me=`$as_basename -- "$0" ||
237
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
238
	 X"$0" : 'X\(//\)$' \| \
239
	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
240
$as_echo X/"$0" |
241
    sed '/^.*\/\([^/][^/]*\)\/*$/{
242
	    s//\1/
243
	    q
244
	  }
245
	  /^X\/\(\/\/\)$/{
246
	    s//\1/
247
	    q
248
	  }
249
	  /^X\/\(\/\).*/{
250
	    s//\1/
251
	    q
252
	  }
253
	  s/.*/./; q'`
254
255
# Avoid depending upon Character Ranges.
256
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
257
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
258
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
259
as_cr_digits='0123456789'
260
as_cr_alnum=$as_cr_Letters$as_cr_digits
261
262
ECHO_C= ECHO_N= ECHO_T=
263
case `echo -n x` in #(((((
264
-n*)
265
  case `echo 'xy\c'` in
266
  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
267
  xy)  ECHO_C='\c';;
268
  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
269
       ECHO_T='	';;
270
  esac;;
271
*)
272
  ECHO_N='-n';;
273
esac
274
275
rm -f conf$$ conf$$.exe conf$$.file
276
if test -d conf$$.dir; then
277
  rm -f conf$$.dir/conf$$.file
278
else
279
  rm -f conf$$.dir
280
  mkdir conf$$.dir 2>/dev/null
281
fi
282
if (echo >conf$$.file) 2>/dev/null; then
283
  if ln -s conf$$.file conf$$ 2>/dev/null; then
284
    as_ln_s='ln -s'
285
    # ... but there are two gotchas:
286
    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
287
    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
288
    # In both cases, we have to default to `cp -pR'.
289
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
290
      as_ln_s='cp -pR'
291
  elif ln conf$$.file conf$$ 2>/dev/null; then
292
    as_ln_s=ln
293
  else
294
    as_ln_s='cp -pR'
295
  fi
296
else
297
  as_ln_s='cp -pR'
298
fi
299
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
300
rmdir conf$$.dir 2>/dev/null
301
302
303
# as_fn_mkdir_p
304
# -------------
305
# Create "$as_dir" as a directory, including parents if necessary.
306
as_fn_mkdir_p ()
307
{
308
309
  case $as_dir in #(
310
  -*) as_dir=./$as_dir;;
311
  esac
312
  test -d "$as_dir" || eval $as_mkdir_p || {
313
    as_dirs=
314
    while :; do
315
      case $as_dir in #(
316
      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
317
      *) as_qdir=$as_dir;;
318
      esac
319
      as_dirs="'$as_qdir' $as_dirs"
320
      as_dir=`$as_dirname -- "$as_dir" ||
321
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
322
	 X"$as_dir" : 'X\(//\)[^/]' \| \
323
	 X"$as_dir" : 'X\(//\)$' \| \
324
	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
325
$as_echo X"$as_dir" |
326
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
327
	    s//\1/
328
	    q
329
	  }
330
	  /^X\(\/\/\)[^/].*/{
331
	    s//\1/
332
	    q
333
	  }
334
	  /^X\(\/\/\)$/{
335
	    s//\1/
336
	    q
337
	  }
338
	  /^X\(\/\).*/{
339
	    s//\1/
340
	    q
341
	  }
342
	  s/.*/./; q'`
343
      test -d "$as_dir" && break
344
    done
345
    test -z "$as_dirs" || eval "mkdir $as_dirs"
346
  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
347
348
349
} # as_fn_mkdir_p
350
if mkdir -p . 2>/dev/null; then
351
  as_mkdir_p='mkdir -p "$as_dir"'
352
else
353
  test -d ./-p && rmdir ./-p
354
  as_mkdir_p=false
355
fi
356
357
358
# as_fn_executable_p FILE
359
# -----------------------
360
# Test if FILE is an executable regular file.
361
as_fn_executable_p ()
362
{
363
  test -f "$1" && test -x "$1"
364
} # as_fn_executable_p
365
as_test_x='test -x'
366
as_executable_p=as_fn_executable_p
367
368
# Sed expression to map a string onto a valid CPP name.
369
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
370
371
# Sed expression to map a string onto a valid variable name.
372
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
373
374
375
exec 6>&1
376
## ----------------------------------- ##
377
## Main body of $CONFIG_STATUS script. ##
378
## ----------------------------------- ##
379
# Save the log message, to keep $0 and so on meaningful, and to
380
# report actual input values of CONFIG_FILES etc. instead of their
381
# values after options handling.
382
ac_log="
383
This file was extended by libbgpdump $as_me 1.4.99.15, which was
384
generated by GNU Autoconf 2.69.  Invocation command line was
385
386
  CONFIG_FILES    = $CONFIG_FILES
387
  CONFIG_HEADERS  = $CONFIG_HEADERS
388
  CONFIG_LINKS    = $CONFIG_LINKS
389
  CONFIG_COMMANDS = $CONFIG_COMMANDS
390
  $ $0 $@
391
392
on `(hostname || uname -n) 2>/dev/null | sed 1q`
393
"
394
395
# Files that config.status was made for.
396
config_files=" bgpdump.spec Makefile"
397
config_headers=" bgpdump-config.h"
398
399
ac_cs_usage="\
400
\`$as_me' instantiates files and other configuration actions
401
from templates according to the current configuration.  Unless the files
402
and actions are specified as TAGs, all are instantiated by default.
403
404
Usage: $0 [OPTION]... [TAG]...
405
406
  -h, --help       print this help, then exit
407
  -V, --version    print version number and configuration settings, then exit
408
      --config     print configuration, then exit
409
  -q, --quiet, --silent
410
                   do not print progress messages
411
  -d, --debug      don't remove temporary files
412
      --recheck    update $as_me by reconfiguring in the same conditions
413
      --file=FILE[:TEMPLATE]
414
                   instantiate the configuration file FILE
415
      --header=FILE[:TEMPLATE]
416
                   instantiate the configuration header FILE
417
418
Configuration files:
419
$config_files
420
421
Configuration headers:
422
$config_headers
423
424
Report bugs to <ris@ripe.net>."
425
426
ac_cs_config=""
427
ac_cs_version="\
428
libbgpdump config.status 1.4.99.15
429
configured by ./configure, generated by GNU Autoconf 2.69,
430
  with options \"$ac_cs_config\"
431
432
Copyright (C) 2012 Free Software Foundation, Inc.
433
This config.status script is free software; the Free Software Foundation
434
gives unlimited permission to copy, distribute and modify it."
435
436
ac_pwd='/Users/mlapan/tmp/0/ripencc-bgpdump-0cb1a4c59d10'
437
srcdir='.'
438
test -n "$AWK" || AWK=awk
439
# The default lists apply if the user does not specify any file.
440
ac_need_defaults=:
441
while test $# != 0
442
do
443
  case $1 in
444
  --*=?*)
445
    ac_option=`expr "X$1" : 'X\([^=]*\)='`
446
    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
447
    ac_shift=:
448
    ;;
449
  --*=)
450
    ac_option=`expr "X$1" : 'X\([^=]*\)='`
451
    ac_optarg=
452
    ac_shift=:
453
    ;;
454
  *)
455
    ac_option=$1
456
    ac_optarg=$2
457
    ac_shift=shift
458
    ;;
459
  esac
460
461
  case $ac_option in
462
  # Handling of the options.
463
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
464
    ac_cs_recheck=: ;;
465
  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
466
    $as_echo "$ac_cs_version"; exit ;;
467
  --config | --confi | --conf | --con | --co | --c )
468
    $as_echo "$ac_cs_config"; exit ;;
469
  --debug | --debu | --deb | --de | --d | -d )
470
    debug=: ;;
471
  --file | --fil | --fi | --f )
472
    $ac_shift
473
    case $ac_optarg in
474
    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
475
    '') as_fn_error $? "missing file argument" ;;
476
    esac
477
    as_fn_append CONFIG_FILES " '$ac_optarg'"
478
    ac_need_defaults=false;;
479
  --header | --heade | --head | --hea )
480
    $ac_shift
481
    case $ac_optarg in
482
    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
483
    esac
484
    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
485
    ac_need_defaults=false;;
486
  --he | --h)
487
    # Conflict between --help and --header
488
    as_fn_error $? "ambiguous option: \`$1'
489
Try \`$0 --help' for more information.";;
490
  --help | --hel | -h )
491
    $as_echo "$ac_cs_usage"; exit ;;
492
  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
493
  | -silent | --silent | --silen | --sile | --sil | --si | --s)
494
    ac_cs_silent=: ;;
495
496
  # This is an error.
497
  -*) as_fn_error $? "unrecognized option: \`$1'
498
Try \`$0 --help' for more information." ;;
499
500
  *) as_fn_append ac_config_targets " $1"
501
     ac_need_defaults=false ;;
502
503
  esac
504
  shift
505
done
506
507
ac_configure_extra_args=
508
509
if $ac_cs_silent; then
510
  exec 6>/dev/null
511
  ac_configure_extra_args="$ac_configure_extra_args --silent"
512
fi
513
514
if $ac_cs_recheck; then
515
  set X /bin/sh './configure'  $ac_configure_extra_args --no-create --no-recursion
516
  shift
517
  $as_echo "running CONFIG_SHELL=/bin/sh $*" >&6
518
  CONFIG_SHELL='/bin/sh'
519
  export CONFIG_SHELL
520
  exec "$@"
521
fi
522
523
exec 5>>config.log
524
{
525
  echo
526
  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
527
## Running $as_me. ##
528
_ASBOX
529
  $as_echo "$ac_log"
530
} >&5
531
532
533
# Handling of arguments.
534
for ac_config_target in $ac_config_targets
535
do
536
  case $ac_config_target in
537
    "bgpdump-config.h") CONFIG_HEADERS="$CONFIG_HEADERS bgpdump-config.h" ;;
538
    "bgpdump.spec") CONFIG_FILES="$CONFIG_FILES bgpdump.spec" ;;
539
    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
540
541
  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
542
  esac
543
done
544
545
546
# If the user did not use the arguments to specify the items to instantiate,
547
# then the envvar interface is used.  Set only those that are not.
548
# We use the long form for the default assignment because of an extremely
549
# bizarre bug on SunOS 4.1.3.
550
if $ac_need_defaults; then
551
  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
552
  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
553
fi
554
555
# Have a temporary directory for convenience.  Make it in the build tree
556
# simply because there is no reason against having it here, and in addition,
557
# creating and moving files from /tmp can sometimes cause problems.
558
# Hook for its removal unless debugging.
559
# Note that there is a small window in which the directory will not be cleaned:
560
# after its creation but before its name has been assigned to `$tmp'.
561
$debug ||
562
{
563
  tmp= ac_tmp=
564
  trap 'exit_status=$?
565
  : "${ac_tmp:=$tmp}"
566
  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
567
' 0
568
  trap 'as_fn_exit 1' 1 2 13 15
569
}
570
# Create a (secure) tmp directory for tmp files.
571
572
{
573
  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
574
  test -d "$tmp"
575
}  ||
576
{
577
  tmp=./conf$$-$RANDOM
578
  (umask 077 && mkdir "$tmp")
579
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
580
ac_tmp=$tmp
581
582
# Set up the scripts for CONFIG_FILES section.
583
# No need to generate them if there are no CONFIG_FILES.
584
# This happens for instance with `./config.status config.h'.
585
if test -n "$CONFIG_FILES"; then
586
587
588
ac_cr=`echo X | tr X '\015'`
589
# On cygwin, bash can eat \r inside `` if the user requested igncr.
590
# But we know of no other shell where ac_cr would be empty at this
591
# point, so we can use a bashism as a fallback.
592
if test "x$ac_cr" = x; then
593
  eval ac_cr=\$\'\\r\'
594
fi
595
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
596
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
597
  ac_cs_awk_cr='\\r'
598
else
599
  ac_cs_awk_cr=$ac_cr
600
fi
601
602
echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
603
cat >>"$ac_tmp/subs1.awk" <<\_ACAWK &&
604
S["LTLIBOBJS"]=""
605
S["LIBOBJS"]=""
606
S["EGREP"]="/usr/bin/grep -E"
607
S["GREP"]="/usr/bin/grep"
608
S["CPP"]="gcc -E"
609
S["RANLIB"]="ranlib"
610
S["OBJEXT"]="o"
611
S["EXEEXT"]=""
612
S["ac_ct_CC"]="gcc"
613
S["CPPFLAGS"]=""
614
S["LDFLAGS"]=" -dynamiclib"
615
S["CFLAGS"]="-g -O3  -Wall -Wsystem-headers -Wno-format-y2k -Wno-sign-compare -Wcast-align -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wswitch -Wshadow"
616
S["CC"]="gcc"
617
S["target_alias"]=""
618
S["host_alias"]=""
619
S["build_alias"]=""
620
S["LIBS"]="-lbz2 -lz "
621
S["ECHO_T"]=""
622
S["ECHO_N"]=""
623
S["ECHO_C"]="\\c"
624
S["DEFS"]="-DHAVE_CONFIG_H"
625
S["mandir"]="${datarootdir}/man"
626
S["localedir"]="${datarootdir}/locale"
627
S["libdir"]="${exec_prefix}/lib"
628
S["psdir"]="${docdir}"
629
S["pdfdir"]="${docdir}"
630
S["dvidir"]="${docdir}"
631
S["htmldir"]="${docdir}"
632
S["infodir"]="${datarootdir}/info"
633
S["docdir"]="${datarootdir}/doc/${PACKAGE_TARNAME}"
634
S["oldincludedir"]="/usr/include"
635
S["includedir"]="${prefix}/include"
636
S["localstatedir"]="${prefix}/var"
637
S["sharedstatedir"]="${prefix}/com"
638
S["sysconfdir"]="${prefix}/etc"
639
S["datadir"]="${datarootdir}"
640
S["datarootdir"]="${prefix}/share"
641
S["libexecdir"]="${exec_prefix}/libexec"
642
S["sbindir"]="${exec_prefix}/sbin"
643
S["bindir"]="${exec_prefix}/bin"
644
S["program_transform_name"]="s,x,x,"
645
S["prefix"]="/usr/local"
646
S["exec_prefix"]="${prefix}"
647
S["PACKAGE_URL"]=""
648
S["PACKAGE_BUGREPORT"]="ris@ripe.net"
649
S["PACKAGE_STRING"]="libbgpdump 1.4.99.15"
650
S["PACKAGE_VERSION"]="1.4.99.15"
651
S["PACKAGE_TARNAME"]="libbgpdump"
652
S["PACKAGE_NAME"]="libbgpdump"
653
S["PATH_SEPARATOR"]=":"
654
S["SHELL"]="/bin/sh"
655
_ACAWK
656
cat >>"$ac_tmp/subs1.awk" <<_ACAWK &&
657
  for (key in S) S_is_set[key] = 1
658
  FS = ""
659
660
}
661
{
662
  line = $ 0
663
  nfields = split(line, field, "@")
664
  substed = 0
665
  len = length(field[1])
666
  for (i = 2; i < nfields; i++) {
667
    key = field[i]
668
    keylen = length(key)
669
    if (S_is_set[key]) {
670
      value = S[key]
671
      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
672
      len += length(value) + length(field[++i])
673
      substed = 1
674
    } else
675
      len += 1 + keylen
676
  }
677
678
  print line
679
}
680
681
_ACAWK
682
if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
683
  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
684
else
685
  cat
686
fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
687
  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
688
fi # test -n "$CONFIG_FILES"
689
690
# Set up the scripts for CONFIG_HEADERS section.
691
# No need to generate them if there are no CONFIG_HEADERS.
692
# This happens for instance with `./config.status Makefile'.
693
if test -n "$CONFIG_HEADERS"; then
694
cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
695
BEGIN {
696
D["PACKAGE_NAME"]=" \"libbgpdump\""
697
D["PACKAGE_TARNAME"]=" \"libbgpdump\""
698
D["PACKAGE_VERSION"]=" \"1.4.99.15\""
699
D["PACKAGE_STRING"]=" \"libbgpdump 1.4.99.15\""
700
D["PACKAGE_BUGREPORT"]=" \"ris@ripe.net\""
701
D["PACKAGE_URL"]=" \"\""
702
D["STDC_HEADERS"]=" 1"
703
D["HAVE_SYS_TYPES_H"]=" 1"
704
D["HAVE_SYS_STAT_H"]=" 1"
705
D["HAVE_STDLIB_H"]=" 1"
706
D["HAVE_STRING_H"]=" 1"
707
D["HAVE_MEMORY_H"]=" 1"
708
D["HAVE_STRINGS_H"]=" 1"
709
D["HAVE_INTTYPES_H"]=" 1"
710
D["HAVE_STDINT_H"]=" 1"
711
D["HAVE_UNISTD_H"]=" 1"
712
D["HAVE_ARPA_INET_H"]=" 1"
713
D["HAVE_NETINET_IN_H"]=" 1"
714
D["HAVE_SYSLOG_H"]=" 1"
715
D["u_char_t"]=" uchar_t"
716
D["HAVE_LIBZ"]=" 1"
717
D["HAVE_LIBBZ2"]=" 1"
718
D["HAVE_INET_NTOA"]=" 1"
719
D["HAVE_INET_NTOP"]=" 1"
720
  for (key in D) D_is_set[key] = 1
721
  FS = ""
722
}
723
/^[\t ]*#[\t ]*(define|undef)[\t ]+[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*([\t (]|$)/ {
724
  line = $ 0
725
  split(line, arg, " ")
726
  if (arg[1] == "#") {
727
    defundef = arg[2]
728
    mac1 = arg[3]
729
  } else {
730
    defundef = substr(arg[1], 2)
731
    mac1 = arg[2]
732
  }
733
  split(mac1, mac2, "(") #)
734
  macro = mac2[1]
735
  prefix = substr(line, 1, index(line, defundef) - 1)
736
  if (D_is_set[macro]) {
737
    # Preserve the white space surrounding the "#".
738
    print prefix "define", macro P[macro] D[macro]
739
    next
740
  } else {
741
    # Replace #undef with comments.  This is necessary, for example,
742
    # in the case of _POSIX_SOURCE, which is predefined and required
743
    # on some systems where configure will not decide to define it.
744
    if (defundef == "undef") {
745
      print "/*", prefix defundef, macro, "*/"
746
      next
747
    }
748
  }
749
}
750
{ print }
751
_ACAWK
752
  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
753
fi # test -n "$CONFIG_HEADERS"
754
755
756
eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    "
757
shift
758
for ac_tag
759
do
760
  case $ac_tag in
761
  :[FHLC]) ac_mode=$ac_tag; continue;;
762
  esac
763
  case $ac_mode$ac_tag in
764
  :[FHL]*:*);;
765
  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
766
  :[FH]-) ac_tag=-:-;;
767
  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
768
  esac
769
  ac_save_IFS=$IFS
770
  IFS=:
771
  set x $ac_tag
772
  IFS=$ac_save_IFS
773
  shift
774
  ac_file=$1
775
  shift
776
777
  case $ac_mode in
778
  :L) ac_source=$1;;
779
  :[FH])
780
    ac_file_inputs=
781
    for ac_f
782
    do
783
      case $ac_f in
784
      -) ac_f="$ac_tmp/stdin";;
785
      *) # Look for the file first in the build tree, then in the source tree
786
	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
787
	 # because $ac_f cannot contain `:'.
788
	 test -f "$ac_f" ||
789
	   case $ac_f in
790
	   [\\/$]*) false;;
791
	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
792
	   esac ||
793
	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
794
      esac
795
      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
796
      as_fn_append ac_file_inputs " '$ac_f'"
797
    done
798
799
    # Let's still pretend it is `configure' which instantiates (i.e., don't
800
    # use $as_me), people would be surprised to read:
801
    #    /* config.h.  Generated by config.status.  */
802
    configure_input='Generated from '`
803
	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
804
	`' by configure.'
805
    if test x"$ac_file" != x-; then
806
      configure_input="$ac_file.  $configure_input"
807
      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
808
$as_echo "$as_me: creating $ac_file" >&6;}
809
    fi
810
    # Neutralize special characters interpreted by sed in replacement strings.
811
    case $configure_input in #(
812
    *\&* | *\|* | *\\* )
813
       ac_sed_conf_input=`$as_echo "$configure_input" |
814
       sed 's/[\\\\&|]/\\\\&/g'`;; #(
815
    *) ac_sed_conf_input=$configure_input;;
816
    esac
817
818
    case $ac_tag in
819
    *:-:* | *:-) cat >"$ac_tmp/stdin" \
820
      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
821
    esac
822
    ;;
823
  esac
824
825
  ac_dir=`$as_dirname -- "$ac_file" ||
826
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
827
	 X"$ac_file" : 'X\(//\)[^/]' \| \
828
	 X"$ac_file" : 'X\(//\)$' \| \
829
	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
830
$as_echo X"$ac_file" |
831
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
832
	    s//\1/
833
	    q
834
	  }
835
	  /^X\(\/\/\)[^/].*/{
836
	    s//\1/
837
	    q
838
	  }
839
	  /^X\(\/\/\)$/{
840
	    s//\1/
841
	    q
842
	  }
843
	  /^X\(\/\).*/{
844
	    s//\1/
845
	    q
846
	  }
847
	  s/.*/./; q'`
848
  as_dir="$ac_dir"; as_fn_mkdir_p
849
  ac_builddir=.
850
851
case "$ac_dir" in
852
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
853
*)
854
  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
855
  # A ".." for each directory in $ac_dir_suffix.
856
  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
857
  case $ac_top_builddir_sub in
858
  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
859
  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
860
  esac ;;
861
esac
862
ac_abs_top_builddir=$ac_pwd
863
ac_abs_builddir=$ac_pwd$ac_dir_suffix
864
# for backward compatibility:
865
ac_top_builddir=$ac_top_build_prefix
866
867
case $srcdir in
868
  .)  # We are building in place.
869
    ac_srcdir=.
870
    ac_top_srcdir=$ac_top_builddir_sub
871
    ac_abs_top_srcdir=$ac_pwd ;;
872
  [\\/]* | ?:[\\/]* )  # Absolute name.
873
    ac_srcdir=$srcdir$ac_dir_suffix;
874
    ac_top_srcdir=$srcdir
875
    ac_abs_top_srcdir=$srcdir ;;
876
  *) # Relative name.
877
    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
878
    ac_top_srcdir=$ac_top_build_prefix$srcdir
879
    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
880
esac
881
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
882
883
884
  case $ac_mode in
885
  :F)
886
  #
887
  # CONFIG_FILE
888
  #
889
890
# If the template does not know about datarootdir, expand it.
891
# FIXME: This hack should be removed a few years after 2.60.
892
ac_datarootdir_hack=; ac_datarootdir_seen=
893
ac_sed_dataroot='
894
/datarootdir/ {
895
  p
896
  q
897
}
898
/@datadir@/p
899
/@docdir@/p
900
/@infodir@/p
901
/@localedir@/p
902
/@mandir@/p'
903
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
904
*datarootdir*) ac_datarootdir_seen=yes;;
905
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
906
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
907
$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
908
  ac_datarootdir_hack='
909
  s&@datadir@&${datarootdir}&g
910
  s&@docdir@&${datarootdir}/doc/${PACKAGE_TARNAME}&g
911
  s&@infodir@&${datarootdir}/info&g
912
  s&@localedir@&${datarootdir}/locale&g
913
  s&@mandir@&${datarootdir}/man&g
914
  s&\${datarootdir}&${prefix}/share&g' ;;
915
esac
916
ac_sed_extra="/^[	 ]*VPATH[	 ]*=[	 ]*/{
917
h
918
s///
919
s/^/:/
920
s/[	 ]*$/:/
921
s/:\$(srcdir):/:/g
922
s/:\${srcdir}:/:/g
923
s/:@srcdir@:/:/g
924
s/^:*//
925
s/:*$//
926
x
927
s/\(=[	 ]*\).*/\1/
928
G
929
s/\n//
930
s/^[^=]*=[	 ]*$//
931
}
932
933
:t
934
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
935
s|@configure_input@|$ac_sed_conf_input|;t t
936
s&@top_builddir@&$ac_top_builddir_sub&;t t
937
s&@top_build_prefix@&$ac_top_build_prefix&;t t
938
s&@srcdir@&$ac_srcdir&;t t
939
s&@abs_srcdir@&$ac_abs_srcdir&;t t
940
s&@top_srcdir@&$ac_top_srcdir&;t t
941
s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
942
s&@builddir@&$ac_builddir&;t t
943
s&@abs_builddir@&$ac_abs_builddir&;t t
944
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
945
$ac_datarootdir_hack
946
"
947
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
948
  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
949
950
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
951
  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
952
  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
953
      "$ac_tmp/out"`; test -z "$ac_out"; } &&
954
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
955
which seems to be undefined.  Please make sure it is defined" >&5
956
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
957
which seems to be undefined.  Please make sure it is defined" >&2;}
958
959
  rm -f "$ac_tmp/stdin"
960
  case $ac_file in
961
  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
962
  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
963
  esac \
964
  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
965
 ;;
966
  :H)
967
  #
968
  # CONFIG_HEADER
969
  #
970
  if test x"$ac_file" != x-; then
971
    {
972
      $as_echo "/* $configure_input  */" \
973
      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
974
    } >"$ac_tmp/config.h" \
975
      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
976
    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
977
      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
978
$as_echo "$as_me: $ac_file is unchanged" >&6;}
979
    else
980
      rm -f "$ac_file"
981
      mv "$ac_tmp/config.h" "$ac_file" \
982
	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
983
    fi
984
  else
985
    $as_echo "/* $configure_input  */" \
986
      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
987
      || as_fn_error $? "could not create -" "$LINENO" 5
988
  fi
989
 ;;
990
991
992
  esac
993
994
done # for ac_tag
995
996
997
as_fn_exit 0
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/configure (+5019 lines)
Line 0 Link Here
1
#! /bin/sh
2
# From configure.in Revision.
3
# Guess values for system-dependent variables and create Makefiles.
4
# Generated by GNU Autoconf 2.69 for libbgpdump 1.4.99.15.
5
#
6
# Report bugs to <ris@ripe.net>.
7
#
8
#
9
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
10
#
11
#
12
# This configure script is free software; the Free Software Foundation
13
# gives unlimited permission to copy, distribute and modify it.
14
## -------------------- ##
15
## M4sh Initialization. ##
16
## -------------------- ##
17
18
# Be more Bourne compatible
19
DUALCASE=1; export DUALCASE # for MKS sh
20
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
21
  emulate sh
22
  NULLCMD=:
23
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
24
  # is contrary to our usage.  Disable this feature.
25
  alias -g '${1+"$@"}'='"$@"'
26
  setopt NO_GLOB_SUBST
27
else
28
  case `(set -o) 2>/dev/null` in #(
29
  *posix*) :
30
    set -o posix ;; #(
31
  *) :
32
     ;;
33
esac
34
fi
35
36
37
as_nl='
38
'
39
export as_nl
40
# Printing a long string crashes Solaris 7 /usr/bin/printf.
41
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
42
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
43
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
44
# Prefer a ksh shell builtin over an external printf program on Solaris,
45
# but without wasting forks for bash or zsh.
46
if test -z "$BASH_VERSION$ZSH_VERSION" \
47
    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
48
  as_echo='print -r --'
49
  as_echo_n='print -rn --'
50
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
51
  as_echo='printf %s\n'
52
  as_echo_n='printf %s'
53
else
54
  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
55
    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
56
    as_echo_n='/usr/ucb/echo -n'
57
  else
58
    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
59
    as_echo_n_body='eval
60
      arg=$1;
61
      case $arg in #(
62
      *"$as_nl"*)
63
	expr "X$arg" : "X\\(.*\\)$as_nl";
64
	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
65
      esac;
66
      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
67
    '
68
    export as_echo_n_body
69
    as_echo_n='sh -c $as_echo_n_body as_echo'
70
  fi
71
  export as_echo_body
72
  as_echo='sh -c $as_echo_body as_echo'
73
fi
74
75
# The user is always right.
76
if test "${PATH_SEPARATOR+set}" != set; then
77
  PATH_SEPARATOR=:
78
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
79
    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
80
      PATH_SEPARATOR=';'
81
  }
82
fi
83
84
85
# IFS
86
# We need space, tab and new line, in precisely that order.  Quoting is
87
# there to prevent editors from complaining about space-tab.
88
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
89
# splitting by setting IFS to empty value.)
90
IFS=" ""	$as_nl"
91
92
# Find who we are.  Look in the path if we contain no directory separator.
93
as_myself=
94
case $0 in #((
95
  *[\\/]* ) as_myself=$0 ;;
96
  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
97
for as_dir in $PATH
98
do
99
  IFS=$as_save_IFS
100
  test -z "$as_dir" && as_dir=.
101
    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
102
  done
103
IFS=$as_save_IFS
104
105
     ;;
106
esac
107
# We did not find ourselves, most probably we were run as `sh COMMAND'
108
# in which case we are not to be found in the path.
109
if test "x$as_myself" = x; then
110
  as_myself=$0
111
fi
112
if test ! -f "$as_myself"; then
113
  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
114
  exit 1
115
fi
116
117
# Unset variables that we do not need and which cause bugs (e.g. in
118
# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
119
# suppresses any "Segmentation fault" message there.  '((' could
120
# trigger a bug in pdksh 5.2.14.
121
for as_var in BASH_ENV ENV MAIL MAILPATH
122
do eval test x\${$as_var+set} = xset \
123
  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
124
done
125
PS1='$ '
126
PS2='> '
127
PS4='+ '
128
129
# NLS nuisances.
130
LC_ALL=C
131
export LC_ALL
132
LANGUAGE=C
133
export LANGUAGE
134
135
# CDPATH.
136
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
137
138
# Use a proper internal environment variable to ensure we don't fall
139
  # into an infinite loop, continuously re-executing ourselves.
140
  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
141
    _as_can_reexec=no; export _as_can_reexec;
142
    # We cannot yet assume a decent shell, so we have to provide a
143
# neutralization value for shells without unset; and this also
144
# works around shells that cannot unset nonexistent variables.
145
# Preserve -v and -x to the replacement shell.
146
BASH_ENV=/dev/null
147
ENV=/dev/null
148
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
149
case $- in # ((((
150
  *v*x* | *x*v* ) as_opts=-vx ;;
151
  *v* ) as_opts=-v ;;
152
  *x* ) as_opts=-x ;;
153
  * ) as_opts= ;;
154
esac
155
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
156
# Admittedly, this is quite paranoid, since all the known shells bail
157
# out after a failed `exec'.
158
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
159
as_fn_exit 255
160
  fi
161
  # We don't want this to propagate to other subprocesses.
162
          { _as_can_reexec=; unset _as_can_reexec;}
163
if test "x$CONFIG_SHELL" = x; then
164
  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
165
  emulate sh
166
  NULLCMD=:
167
  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
168
  # is contrary to our usage.  Disable this feature.
169
  alias -g '\${1+\"\$@\"}'='\"\$@\"'
170
  setopt NO_GLOB_SUBST
171
else
172
  case \`(set -o) 2>/dev/null\` in #(
173
  *posix*) :
174
    set -o posix ;; #(
175
  *) :
176
     ;;
177
esac
178
fi
179
"
180
  as_required="as_fn_return () { (exit \$1); }
181
as_fn_success () { as_fn_return 0; }
182
as_fn_failure () { as_fn_return 1; }
183
as_fn_ret_success () { return 0; }
184
as_fn_ret_failure () { return 1; }
185
186
exitcode=0
187
as_fn_success || { exitcode=1; echo as_fn_success failed.; }
188
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
189
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
190
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
191
if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
192
193
else
194
  exitcode=1; echo positional parameters were not saved.
195
fi
196
test x\$exitcode = x0 || exit 1
197
test -x / || exit 1"
198
  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
199
  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
200
  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
201
  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
202
test \$(( 1 + 1 )) = 2 || exit 1"
203
  if (eval "$as_required") 2>/dev/null; then :
204
  as_have_required=yes
205
else
206
  as_have_required=no
207
fi
208
  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
209
210
else
211
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
212
as_found=false
213
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
214
do
215
  IFS=$as_save_IFS
216
  test -z "$as_dir" && as_dir=.
217
  as_found=:
218
  case $as_dir in #(
219
	 /*)
220
	   for as_base in sh bash ksh sh5; do
221
	     # Try only shells that exist, to save several forks.
222
	     as_shell=$as_dir/$as_base
223
	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
224
		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
225
  CONFIG_SHELL=$as_shell as_have_required=yes
226
		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
227
  break 2
228
fi
229
fi
230
	   done;;
231
       esac
232
  as_found=false
233
done
234
$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
235
	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
236
  CONFIG_SHELL=$SHELL as_have_required=yes
237
fi; }
238
IFS=$as_save_IFS
239
240
241
      if test "x$CONFIG_SHELL" != x; then :
242
  export CONFIG_SHELL
243
             # We cannot yet assume a decent shell, so we have to provide a
244
# neutralization value for shells without unset; and this also
245
# works around shells that cannot unset nonexistent variables.
246
# Preserve -v and -x to the replacement shell.
247
BASH_ENV=/dev/null
248
ENV=/dev/null
249
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
250
case $- in # ((((
251
  *v*x* | *x*v* ) as_opts=-vx ;;
252
  *v* ) as_opts=-v ;;
253
  *x* ) as_opts=-x ;;
254
  * ) as_opts= ;;
255
esac
256
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
257
# Admittedly, this is quite paranoid, since all the known shells bail
258
# out after a failed `exec'.
259
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
260
exit 255
261
fi
262
263
    if test x$as_have_required = xno; then :
264
  $as_echo "$0: This script requires a shell more modern than all"
265
  $as_echo "$0: the shells that I found on your system."
266
  if test x${ZSH_VERSION+set} = xset ; then
267
    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
268
    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
269
  else
270
    $as_echo "$0: Please tell bug-autoconf@gnu.org and ris@ripe.net about
271
$0: your system, including any error possibly output before
272
$0: this message. Then install a modern shell, or manually
273
$0: run the script under such a shell if you do have one."
274
  fi
275
  exit 1
276
fi
277
fi
278
fi
279
SHELL=${CONFIG_SHELL-/bin/sh}
280
export SHELL
281
# Unset more variables known to interfere with behavior of common tools.
282
CLICOLOR_FORCE= GREP_OPTIONS=
283
unset CLICOLOR_FORCE GREP_OPTIONS
284
285
## --------------------- ##
286
## M4sh Shell Functions. ##
287
## --------------------- ##
288
# as_fn_unset VAR
289
# ---------------
290
# Portably unset VAR.
291
as_fn_unset ()
292
{
293
  { eval $1=; unset $1;}
294
}
295
as_unset=as_fn_unset
296
297
# as_fn_set_status STATUS
298
# -----------------------
299
# Set $? to STATUS, without forking.
300
as_fn_set_status ()
301
{
302
  return $1
303
} # as_fn_set_status
304
305
# as_fn_exit STATUS
306
# -----------------
307
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
308
as_fn_exit ()
309
{
310
  set +e
311
  as_fn_set_status $1
312
  exit $1
313
} # as_fn_exit
314
315
# as_fn_mkdir_p
316
# -------------
317
# Create "$as_dir" as a directory, including parents if necessary.
318
as_fn_mkdir_p ()
319
{
320
321
  case $as_dir in #(
322
  -*) as_dir=./$as_dir;;
323
  esac
324
  test -d "$as_dir" || eval $as_mkdir_p || {
325
    as_dirs=
326
    while :; do
327
      case $as_dir in #(
328
      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
329
      *) as_qdir=$as_dir;;
330
      esac
331
      as_dirs="'$as_qdir' $as_dirs"
332
      as_dir=`$as_dirname -- "$as_dir" ||
333
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
334
	 X"$as_dir" : 'X\(//\)[^/]' \| \
335
	 X"$as_dir" : 'X\(//\)$' \| \
336
	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
337
$as_echo X"$as_dir" |
338
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
339
	    s//\1/
340
	    q
341
	  }
342
	  /^X\(\/\/\)[^/].*/{
343
	    s//\1/
344
	    q
345
	  }
346
	  /^X\(\/\/\)$/{
347
	    s//\1/
348
	    q
349
	  }
350
	  /^X\(\/\).*/{
351
	    s//\1/
352
	    q
353
	  }
354
	  s/.*/./; q'`
355
      test -d "$as_dir" && break
356
    done
357
    test -z "$as_dirs" || eval "mkdir $as_dirs"
358
  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
359
360
361
} # as_fn_mkdir_p
362
363
# as_fn_executable_p FILE
364
# -----------------------
365
# Test if FILE is an executable regular file.
366
as_fn_executable_p ()
367
{
368
  test -f "$1" && test -x "$1"
369
} # as_fn_executable_p
370
# as_fn_append VAR VALUE
371
# ----------------------
372
# Append the text in VALUE to the end of the definition contained in VAR. Take
373
# advantage of any shell optimizations that allow amortized linear growth over
374
# repeated appends, instead of the typical quadratic growth present in naive
375
# implementations.
376
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
377
  eval 'as_fn_append ()
378
  {
379
    eval $1+=\$2
380
  }'
381
else
382
  as_fn_append ()
383
  {
384
    eval $1=\$$1\$2
385
  }
386
fi # as_fn_append
387
388
# as_fn_arith ARG...
389
# ------------------
390
# Perform arithmetic evaluation on the ARGs, and store the result in the
391
# global $as_val. Take advantage of shells that can avoid forks. The arguments
392
# must be portable across $(()) and expr.
393
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
394
  eval 'as_fn_arith ()
395
  {
396
    as_val=$(( $* ))
397
  }'
398
else
399
  as_fn_arith ()
400
  {
401
    as_val=`expr "$@" || test $? -eq 1`
402
  }
403
fi # as_fn_arith
404
405
406
# as_fn_error STATUS ERROR [LINENO LOG_FD]
407
# ----------------------------------------
408
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
409
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
410
# script with STATUS, using 1 if that was 0.
411
as_fn_error ()
412
{
413
  as_status=$1; test $as_status -eq 0 && as_status=1
414
  if test "$4"; then
415
    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
416
    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
417
  fi
418
  $as_echo "$as_me: error: $2" >&2
419
  as_fn_exit $as_status
420
} # as_fn_error
421
422
if expr a : '\(a\)' >/dev/null 2>&1 &&
423
   test "X`expr 00001 : '.*\(...\)'`" = X001; then
424
  as_expr=expr
425
else
426
  as_expr=false
427
fi
428
429
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
430
  as_basename=basename
431
else
432
  as_basename=false
433
fi
434
435
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
436
  as_dirname=dirname
437
else
438
  as_dirname=false
439
fi
440
441
as_me=`$as_basename -- "$0" ||
442
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
443
	 X"$0" : 'X\(//\)$' \| \
444
	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
445
$as_echo X/"$0" |
446
    sed '/^.*\/\([^/][^/]*\)\/*$/{
447
	    s//\1/
448
	    q
449
	  }
450
	  /^X\/\(\/\/\)$/{
451
	    s//\1/
452
	    q
453
	  }
454
	  /^X\/\(\/\).*/{
455
	    s//\1/
456
	    q
457
	  }
458
	  s/.*/./; q'`
459
460
# Avoid depending upon Character Ranges.
461
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
462
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
463
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
464
as_cr_digits='0123456789'
465
as_cr_alnum=$as_cr_Letters$as_cr_digits
466
467
468
  as_lineno_1=$LINENO as_lineno_1a=$LINENO
469
  as_lineno_2=$LINENO as_lineno_2a=$LINENO
470
  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
471
  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
472
  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
473
  sed -n '
474
    p
475
    /[$]LINENO/=
476
  ' <$as_myself |
477
    sed '
478
      s/[$]LINENO.*/&-/
479
      t lineno
480
      b
481
      :lineno
482
      N
483
      :loop
484
      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
485
      t loop
486
      s/-\n.*//
487
    ' >$as_me.lineno &&
488
  chmod +x "$as_me.lineno" ||
489
    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
490
491
  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
492
  # already done that, so ensure we don't try to do so again and fall
493
  # in an infinite loop.  This has already happened in practice.
494
  _as_can_reexec=no; export _as_can_reexec
495
  # Don't try to exec as it changes $[0], causing all sort of problems
496
  # (the dirname of $[0] is not the place where we might find the
497
  # original and so on.  Autoconf is especially sensitive to this).
498
  . "./$as_me.lineno"
499
  # Exit status is that of the last command.
500
  exit
501
}
502
503
ECHO_C= ECHO_N= ECHO_T=
504
case `echo -n x` in #(((((
505
-n*)
506
  case `echo 'xy\c'` in
507
  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
508
  xy)  ECHO_C='\c';;
509
  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
510
       ECHO_T='	';;
511
  esac;;
512
*)
513
  ECHO_N='-n';;
514
esac
515
516
rm -f conf$$ conf$$.exe conf$$.file
517
if test -d conf$$.dir; then
518
  rm -f conf$$.dir/conf$$.file
519
else
520
  rm -f conf$$.dir
521
  mkdir conf$$.dir 2>/dev/null
522
fi
523
if (echo >conf$$.file) 2>/dev/null; then
524
  if ln -s conf$$.file conf$$ 2>/dev/null; then
525
    as_ln_s='ln -s'
526
    # ... but there are two gotchas:
527
    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
528
    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
529
    # In both cases, we have to default to `cp -pR'.
530
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
531
      as_ln_s='cp -pR'
532
  elif ln conf$$.file conf$$ 2>/dev/null; then
533
    as_ln_s=ln
534
  else
535
    as_ln_s='cp -pR'
536
  fi
537
else
538
  as_ln_s='cp -pR'
539
fi
540
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
541
rmdir conf$$.dir 2>/dev/null
542
543
if mkdir -p . 2>/dev/null; then
544
  as_mkdir_p='mkdir -p "$as_dir"'
545
else
546
  test -d ./-p && rmdir ./-p
547
  as_mkdir_p=false
548
fi
549
550
as_test_x='test -x'
551
as_executable_p=as_fn_executable_p
552
553
# Sed expression to map a string onto a valid CPP name.
554
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
555
556
# Sed expression to map a string onto a valid variable name.
557
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
558
559
560
test -n "$DJDIR" || exec 7<&0 </dev/null
561
exec 6>&1
562
563
# Name of the host.
564
# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
565
# so uname gets run too.
566
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
567
568
#
569
# Initializations.
570
#
571
ac_default_prefix=/usr/local
572
ac_clean_files=
573
ac_config_libobj_dir=.
574
LIBOBJS=
575
cross_compiling=no
576
subdirs=
577
MFLAGS=
578
MAKEFLAGS=
579
580
# Identity of this package.
581
PACKAGE_NAME='libbgpdump'
582
PACKAGE_TARNAME='libbgpdump'
583
PACKAGE_VERSION='1.4.99.15'
584
PACKAGE_STRING='libbgpdump 1.4.99.15'
585
PACKAGE_BUGREPORT='ris@ripe.net'
586
PACKAGE_URL=''
587
588
ac_unique_file="bgpdump_lib.c"
589
# Factoring default headers for most tests.
590
ac_includes_default="\
591
#include <stdio.h>
592
#ifdef HAVE_SYS_TYPES_H
593
# include <sys/types.h>
594
#endif
595
#ifdef HAVE_SYS_STAT_H
596
# include <sys/stat.h>
597
#endif
598
#ifdef STDC_HEADERS
599
# include <stdlib.h>
600
# include <stddef.h>
601
#else
602
# ifdef HAVE_STDLIB_H
603
#  include <stdlib.h>
604
# endif
605
#endif
606
#ifdef HAVE_STRING_H
607
# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
608
#  include <memory.h>
609
# endif
610
# include <string.h>
611
#endif
612
#ifdef HAVE_STRINGS_H
613
# include <strings.h>
614
#endif
615
#ifdef HAVE_INTTYPES_H
616
# include <inttypes.h>
617
#endif
618
#ifdef HAVE_STDINT_H
619
# include <stdint.h>
620
#endif
621
#ifdef HAVE_UNISTD_H
622
# include <unistd.h>
623
#endif"
624
625
ac_subst_vars='LTLIBOBJS
626
LIBOBJS
627
EGREP
628
GREP
629
CPP
630
RANLIB
631
OBJEXT
632
EXEEXT
633
ac_ct_CC
634
CPPFLAGS
635
LDFLAGS
636
CFLAGS
637
CC
638
target_alias
639
host_alias
640
build_alias
641
LIBS
642
ECHO_T
643
ECHO_N
644
ECHO_C
645
DEFS
646
mandir
647
localedir
648
libdir
649
psdir
650
pdfdir
651
dvidir
652
htmldir
653
infodir
654
docdir
655
oldincludedir
656
includedir
657
localstatedir
658
sharedstatedir
659
sysconfdir
660
datadir
661
datarootdir
662
libexecdir
663
sbindir
664
bindir
665
program_transform_name
666
prefix
667
exec_prefix
668
PACKAGE_URL
669
PACKAGE_BUGREPORT
670
PACKAGE_STRING
671
PACKAGE_VERSION
672
PACKAGE_TARNAME
673
PACKAGE_NAME
674
PATH_SEPARATOR
675
SHELL'
676
ac_subst_files=''
677
ac_user_opts='
678
enable_option_checking
679
'
680
      ac_precious_vars='build_alias
681
host_alias
682
target_alias
683
CC
684
CFLAGS
685
LDFLAGS
686
LIBS
687
CPPFLAGS
688
CPP'
689
690
691
# Initialize some variables set by options.
692
ac_init_help=
693
ac_init_version=false
694
ac_unrecognized_opts=
695
ac_unrecognized_sep=
696
# The variables have the same names as the options, with
697
# dashes changed to underlines.
698
cache_file=/dev/null
699
exec_prefix=NONE
700
no_create=
701
no_recursion=
702
prefix=NONE
703
program_prefix=NONE
704
program_suffix=NONE
705
program_transform_name=s,x,x,
706
silent=
707
site=
708
srcdir=
709
verbose=
710
x_includes=NONE
711
x_libraries=NONE
712
713
# Installation directory options.
714
# These are left unexpanded so users can "make install exec_prefix=/foo"
715
# and all the variables that are supposed to be based on exec_prefix
716
# by default will actually change.
717
# Use braces instead of parens because sh, perl, etc. also accept them.
718
# (The list follows the same order as the GNU Coding Standards.)
719
bindir='${exec_prefix}/bin'
720
sbindir='${exec_prefix}/sbin'
721
libexecdir='${exec_prefix}/libexec'
722
datarootdir='${prefix}/share'
723
datadir='${datarootdir}'
724
sysconfdir='${prefix}/etc'
725
sharedstatedir='${prefix}/com'
726
localstatedir='${prefix}/var'
727
includedir='${prefix}/include'
728
oldincludedir='/usr/include'
729
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
730
infodir='${datarootdir}/info'
731
htmldir='${docdir}'
732
dvidir='${docdir}'
733
pdfdir='${docdir}'
734
psdir='${docdir}'
735
libdir='${exec_prefix}/lib'
736
localedir='${datarootdir}/locale'
737
mandir='${datarootdir}/man'
738
739
ac_prev=
740
ac_dashdash=
741
for ac_option
742
do
743
  # If the previous option needs an argument, assign it.
744
  if test -n "$ac_prev"; then
745
    eval $ac_prev=\$ac_option
746
    ac_prev=
747
    continue
748
  fi
749
750
  case $ac_option in
751
  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
752
  *=)   ac_optarg= ;;
753
  *)    ac_optarg=yes ;;
754
  esac
755
756
  # Accept the important Cygnus configure options, so we can diagnose typos.
757
758
  case $ac_dashdash$ac_option in
759
  --)
760
    ac_dashdash=yes ;;
761
762
  -bindir | --bindir | --bindi | --bind | --bin | --bi)
763
    ac_prev=bindir ;;
764
  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
765
    bindir=$ac_optarg ;;
766
767
  -build | --build | --buil | --bui | --bu)
768
    ac_prev=build_alias ;;
769
  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
770
    build_alias=$ac_optarg ;;
771
772
  -cache-file | --cache-file | --cache-fil | --cache-fi \
773
  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
774
    ac_prev=cache_file ;;
775
  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
776
  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
777
    cache_file=$ac_optarg ;;
778
779
  --config-cache | -C)
780
    cache_file=config.cache ;;
781
782
  -datadir | --datadir | --datadi | --datad)
783
    ac_prev=datadir ;;
784
  -datadir=* | --datadir=* | --datadi=* | --datad=*)
785
    datadir=$ac_optarg ;;
786
787
  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
788
  | --dataroo | --dataro | --datar)
789
    ac_prev=datarootdir ;;
790
  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
791
  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
792
    datarootdir=$ac_optarg ;;
793
794
  -disable-* | --disable-*)
795
    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
796
    # Reject names that are not valid shell variable names.
797
    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
798
      as_fn_error $? "invalid feature name: $ac_useropt"
799
    ac_useropt_orig=$ac_useropt
800
    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
801
    case $ac_user_opts in
802
      *"
803
"enable_$ac_useropt"
804
"*) ;;
805
      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
806
	 ac_unrecognized_sep=', ';;
807
    esac
808
    eval enable_$ac_useropt=no ;;
809
810
  -docdir | --docdir | --docdi | --doc | --do)
811
    ac_prev=docdir ;;
812
  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
813
    docdir=$ac_optarg ;;
814
815
  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
816
    ac_prev=dvidir ;;
817
  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
818
    dvidir=$ac_optarg ;;
819
820
  -enable-* | --enable-*)
821
    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
822
    # Reject names that are not valid shell variable names.
823
    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
824
      as_fn_error $? "invalid feature name: $ac_useropt"
825
    ac_useropt_orig=$ac_useropt
826
    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
827
    case $ac_user_opts in
828
      *"
829
"enable_$ac_useropt"
830
"*) ;;
831
      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
832
	 ac_unrecognized_sep=', ';;
833
    esac
834
    eval enable_$ac_useropt=\$ac_optarg ;;
835
836
  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
837
  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
838
  | --exec | --exe | --ex)
839
    ac_prev=exec_prefix ;;
840
  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
841
  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
842
  | --exec=* | --exe=* | --ex=*)
843
    exec_prefix=$ac_optarg ;;
844
845
  -gas | --gas | --ga | --g)
846
    # Obsolete; use --with-gas.
847
    with_gas=yes ;;
848
849
  -help | --help | --hel | --he | -h)
850
    ac_init_help=long ;;
851
  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
852
    ac_init_help=recursive ;;
853
  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
854
    ac_init_help=short ;;
855
856
  -host | --host | --hos | --ho)
857
    ac_prev=host_alias ;;
858
  -host=* | --host=* | --hos=* | --ho=*)
859
    host_alias=$ac_optarg ;;
860
861
  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
862
    ac_prev=htmldir ;;
863
  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
864
  | --ht=*)
865
    htmldir=$ac_optarg ;;
866
867
  -includedir | --includedir | --includedi | --included | --include \
868
  | --includ | --inclu | --incl | --inc)
869
    ac_prev=includedir ;;
870
  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
871
  | --includ=* | --inclu=* | --incl=* | --inc=*)
872
    includedir=$ac_optarg ;;
873
874
  -infodir | --infodir | --infodi | --infod | --info | --inf)
875
    ac_prev=infodir ;;
876
  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
877
    infodir=$ac_optarg ;;
878
879
  -libdir | --libdir | --libdi | --libd)
880
    ac_prev=libdir ;;
881
  -libdir=* | --libdir=* | --libdi=* | --libd=*)
882
    libdir=$ac_optarg ;;
883
884
  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
885
  | --libexe | --libex | --libe)
886
    ac_prev=libexecdir ;;
887
  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
888
  | --libexe=* | --libex=* | --libe=*)
889
    libexecdir=$ac_optarg ;;
890
891
  -localedir | --localedir | --localedi | --localed | --locale)
892
    ac_prev=localedir ;;
893
  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
894
    localedir=$ac_optarg ;;
895
896
  -localstatedir | --localstatedir | --localstatedi | --localstated \
897
  | --localstate | --localstat | --localsta | --localst | --locals)
898
    ac_prev=localstatedir ;;
899
  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
900
  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
901
    localstatedir=$ac_optarg ;;
902
903
  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
904
    ac_prev=mandir ;;
905
  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
906
    mandir=$ac_optarg ;;
907
908
  -nfp | --nfp | --nf)
909
    # Obsolete; use --without-fp.
910
    with_fp=no ;;
911
912
  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
913
  | --no-cr | --no-c | -n)
914
    no_create=yes ;;
915
916
  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
917
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
918
    no_recursion=yes ;;
919
920
  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
921
  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
922
  | --oldin | --oldi | --old | --ol | --o)
923
    ac_prev=oldincludedir ;;
924
  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
925
  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
926
  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
927
    oldincludedir=$ac_optarg ;;
928
929
  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
930
    ac_prev=prefix ;;
931
  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
932
    prefix=$ac_optarg ;;
933
934
  -program-prefix | --program-prefix | --program-prefi | --program-pref \
935
  | --program-pre | --program-pr | --program-p)
936
    ac_prev=program_prefix ;;
937
  -program-prefix=* | --program-prefix=* | --program-prefi=* \
938
  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
939
    program_prefix=$ac_optarg ;;
940
941
  -program-suffix | --program-suffix | --program-suffi | --program-suff \
942
  | --program-suf | --program-su | --program-s)
943
    ac_prev=program_suffix ;;
944
  -program-suffix=* | --program-suffix=* | --program-suffi=* \
945
  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
946
    program_suffix=$ac_optarg ;;
947
948
  -program-transform-name | --program-transform-name \
949
  | --program-transform-nam | --program-transform-na \
950
  | --program-transform-n | --program-transform- \
951
  | --program-transform | --program-transfor \
952
  | --program-transfo | --program-transf \
953
  | --program-trans | --program-tran \
954
  | --progr-tra | --program-tr | --program-t)
955
    ac_prev=program_transform_name ;;
956
  -program-transform-name=* | --program-transform-name=* \
957
  | --program-transform-nam=* | --program-transform-na=* \
958
  | --program-transform-n=* | --program-transform-=* \
959
  | --program-transform=* | --program-transfor=* \
960
  | --program-transfo=* | --program-transf=* \
961
  | --program-trans=* | --program-tran=* \
962
  | --progr-tra=* | --program-tr=* | --program-t=*)
963
    program_transform_name=$ac_optarg ;;
964
965
  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
966
    ac_prev=pdfdir ;;
967
  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
968
    pdfdir=$ac_optarg ;;
969
970
  -psdir | --psdir | --psdi | --psd | --ps)
971
    ac_prev=psdir ;;
972
  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
973
    psdir=$ac_optarg ;;
974
975
  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
976
  | -silent | --silent | --silen | --sile | --sil)
977
    silent=yes ;;
978
979
  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
980
    ac_prev=sbindir ;;
981
  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
982
  | --sbi=* | --sb=*)
983
    sbindir=$ac_optarg ;;
984
985
  -sharedstatedir | --sharedstatedir | --sharedstatedi \
986
  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
987
  | --sharedst | --shareds | --shared | --share | --shar \
988
  | --sha | --sh)
989
    ac_prev=sharedstatedir ;;
990
  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
991
  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
992
  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
993
  | --sha=* | --sh=*)
994
    sharedstatedir=$ac_optarg ;;
995
996
  -site | --site | --sit)
997
    ac_prev=site ;;
998
  -site=* | --site=* | --sit=*)
999
    site=$ac_optarg ;;
1000
1001
  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1002
    ac_prev=srcdir ;;
1003
  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1004
    srcdir=$ac_optarg ;;
1005
1006
  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1007
  | --syscon | --sysco | --sysc | --sys | --sy)
1008
    ac_prev=sysconfdir ;;
1009
  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1010
  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1011
    sysconfdir=$ac_optarg ;;
1012
1013
  -target | --target | --targe | --targ | --tar | --ta | --t)
1014
    ac_prev=target_alias ;;
1015
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1016
    target_alias=$ac_optarg ;;
1017
1018
  -v | -verbose | --verbose | --verbos | --verbo | --verb)
1019
    verbose=yes ;;
1020
1021
  -version | --version | --versio | --versi | --vers | -V)
1022
    ac_init_version=: ;;
1023
1024
  -with-* | --with-*)
1025
    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1026
    # Reject names that are not valid shell variable names.
1027
    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1028
      as_fn_error $? "invalid package name: $ac_useropt"
1029
    ac_useropt_orig=$ac_useropt
1030
    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1031
    case $ac_user_opts in
1032
      *"
1033
"with_$ac_useropt"
1034
"*) ;;
1035
      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
1036
	 ac_unrecognized_sep=', ';;
1037
    esac
1038
    eval with_$ac_useropt=\$ac_optarg ;;
1039
1040
  -without-* | --without-*)
1041
    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1042
    # Reject names that are not valid shell variable names.
1043
    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1044
      as_fn_error $? "invalid package name: $ac_useropt"
1045
    ac_useropt_orig=$ac_useropt
1046
    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1047
    case $ac_user_opts in
1048
      *"
1049
"with_$ac_useropt"
1050
"*) ;;
1051
      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
1052
	 ac_unrecognized_sep=', ';;
1053
    esac
1054
    eval with_$ac_useropt=no ;;
1055
1056
  --x)
1057
    # Obsolete; use --with-x.
1058
    with_x=yes ;;
1059
1060
  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1061
  | --x-incl | --x-inc | --x-in | --x-i)
1062
    ac_prev=x_includes ;;
1063
  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1064
  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1065
    x_includes=$ac_optarg ;;
1066
1067
  -x-libraries | --x-libraries | --x-librarie | --x-librari \
1068
  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1069
    ac_prev=x_libraries ;;
1070
  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1071
  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1072
    x_libraries=$ac_optarg ;;
1073
1074
  -*) as_fn_error $? "unrecognized option: \`$ac_option'
1075
Try \`$0 --help' for more information"
1076
    ;;
1077
1078
  *=*)
1079
    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
1080
    # Reject names that are not valid shell variable names.
1081
    case $ac_envvar in #(
1082
      '' | [0-9]* | *[!_$as_cr_alnum]* )
1083
      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
1084
    esac
1085
    eval $ac_envvar=\$ac_optarg
1086
    export $ac_envvar ;;
1087
1088
  *)
1089
    # FIXME: should be removed in autoconf 3.0.
1090
    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
1091
    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
1092
      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1093
    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
1094
    ;;
1095
1096
  esac
1097
done
1098
1099
if test -n "$ac_prev"; then
1100
  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1101
  as_fn_error $? "missing argument to $ac_option"
1102
fi
1103
1104
if test -n "$ac_unrecognized_opts"; then
1105
  case $enable_option_checking in
1106
    no) ;;
1107
    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
1108
    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1109
  esac
1110
fi
1111
1112
# Check all directory arguments for consistency.
1113
for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
1114
		datadir sysconfdir sharedstatedir localstatedir includedir \
1115
		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1116
		libdir localedir mandir
1117
do
1118
  eval ac_val=\$$ac_var
1119
  # Remove trailing slashes.
1120
  case $ac_val in
1121
    */ )
1122
      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
1123
      eval $ac_var=\$ac_val;;
1124
  esac
1125
  # Be sure to have absolute directory names.
1126
  case $ac_val in
1127
    [\\/$]* | ?:[\\/]* )  continue;;
1128
    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1129
  esac
1130
  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
1131
done
1132
1133
# There might be people who depend on the old broken behavior: `$host'
1134
# used to hold the argument of --host etc.
1135
# FIXME: To remove some day.
1136
build=$build_alias
1137
host=$host_alias
1138
target=$target_alias
1139
1140
# FIXME: To remove some day.
1141
if test "x$host_alias" != x; then
1142
  if test "x$build_alias" = x; then
1143
    cross_compiling=maybe
1144
  elif test "x$build_alias" != "x$host_alias"; then
1145
    cross_compiling=yes
1146
  fi
1147
fi
1148
1149
ac_tool_prefix=
1150
test -n "$host_alias" && ac_tool_prefix=$host_alias-
1151
1152
test "$silent" = yes && exec 6>/dev/null
1153
1154
1155
ac_pwd=`pwd` && test -n "$ac_pwd" &&
1156
ac_ls_di=`ls -di .` &&
1157
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1158
  as_fn_error $? "working directory cannot be determined"
1159
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1160
  as_fn_error $? "pwd does not report name of working directory"
1161
1162
1163
# Find the source files, if location was not specified.
1164
if test -z "$srcdir"; then
1165
  ac_srcdir_defaulted=yes
1166
  # Try the directory containing this script, then the parent directory.
1167
  ac_confdir=`$as_dirname -- "$as_myself" ||
1168
$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1169
	 X"$as_myself" : 'X\(//\)[^/]' \| \
1170
	 X"$as_myself" : 'X\(//\)$' \| \
1171
	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
1172
$as_echo X"$as_myself" |
1173
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1174
	    s//\1/
1175
	    q
1176
	  }
1177
	  /^X\(\/\/\)[^/].*/{
1178
	    s//\1/
1179
	    q
1180
	  }
1181
	  /^X\(\/\/\)$/{
1182
	    s//\1/
1183
	    q
1184
	  }
1185
	  /^X\(\/\).*/{
1186
	    s//\1/
1187
	    q
1188
	  }
1189
	  s/.*/./; q'`
1190
  srcdir=$ac_confdir
1191
  if test ! -r "$srcdir/$ac_unique_file"; then
1192
    srcdir=..
1193
  fi
1194
else
1195
  ac_srcdir_defaulted=no
1196
fi
1197
if test ! -r "$srcdir/$ac_unique_file"; then
1198
  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1199
  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
1200
fi
1201
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1202
ac_abs_confdir=`(
1203
	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
1204
	pwd)`
1205
# When building in place, set srcdir=.
1206
if test "$ac_abs_confdir" = "$ac_pwd"; then
1207
  srcdir=.
1208
fi
1209
# Remove unnecessary trailing slashes from srcdir.
1210
# Double slashes in file names in object file debugging info
1211
# mess up M-x gdb in Emacs.
1212
case $srcdir in
1213
*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1214
esac
1215
for ac_var in $ac_precious_vars; do
1216
  eval ac_env_${ac_var}_set=\${${ac_var}+set}
1217
  eval ac_env_${ac_var}_value=\$${ac_var}
1218
  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1219
  eval ac_cv_env_${ac_var}_value=\$${ac_var}
1220
done
1221
1222
#
1223
# Report the --help message.
1224
#
1225
if test "$ac_init_help" = "long"; then
1226
  # Omit some internal or obsolete options to make the list less imposing.
1227
  # This message is too long to be a string in the A/UX 3.1 sh.
1228
  cat <<_ACEOF
1229
\`configure' configures libbgpdump 1.4.99.15 to adapt to many kinds of systems.
1230
1231
Usage: $0 [OPTION]... [VAR=VALUE]...
1232
1233
To assign environment variables (e.g., CC, CFLAGS...), specify them as
1234
VAR=VALUE.  See below for descriptions of some of the useful variables.
1235
1236
Defaults for the options are specified in brackets.
1237
1238
Configuration:
1239
  -h, --help              display this help and exit
1240
      --help=short        display options specific to this package
1241
      --help=recursive    display the short help of all the included packages
1242
  -V, --version           display version information and exit
1243
  -q, --quiet, --silent   do not print \`checking ...' messages
1244
      --cache-file=FILE   cache test results in FILE [disabled]
1245
  -C, --config-cache      alias for \`--cache-file=config.cache'
1246
  -n, --no-create         do not create output files
1247
      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
1248
1249
Installation directories:
1250
  --prefix=PREFIX         install architecture-independent files in PREFIX
1251
                          [$ac_default_prefix]
1252
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
1253
                          [PREFIX]
1254
1255
By default, \`make install' will install all the files in
1256
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
1257
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1258
for instance \`--prefix=\$HOME'.
1259
1260
For better control, use the options below.
1261
1262
Fine tuning of the installation directories:
1263
  --bindir=DIR            user executables [EPREFIX/bin]
1264
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
1265
  --libexecdir=DIR        program executables [EPREFIX/libexec]
1266
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
1267
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
1268
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
1269
  --libdir=DIR            object code libraries [EPREFIX/lib]
1270
  --includedir=DIR        C header files [PREFIX/include]
1271
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
1272
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
1273
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
1274
  --infodir=DIR           info documentation [DATAROOTDIR/info]
1275
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
1276
  --mandir=DIR            man documentation [DATAROOTDIR/man]
1277
  --docdir=DIR            documentation root [DATAROOTDIR/doc/libbgpdump]
1278
  --htmldir=DIR           html documentation [DOCDIR]
1279
  --dvidir=DIR            dvi documentation [DOCDIR]
1280
  --pdfdir=DIR            pdf documentation [DOCDIR]
1281
  --psdir=DIR             ps documentation [DOCDIR]
1282
_ACEOF
1283
1284
  cat <<\_ACEOF
1285
_ACEOF
1286
fi
1287
1288
if test -n "$ac_init_help"; then
1289
  case $ac_init_help in
1290
     short | recursive ) echo "Configuration of libbgpdump 1.4.99.15:";;
1291
   esac
1292
  cat <<\_ACEOF
1293
1294
Some influential environment variables:
1295
  CC          C compiler command
1296
  CFLAGS      C compiler flags
1297
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
1298
              nonstandard directory <lib dir>
1299
  LIBS        libraries to pass to the linker, e.g. -l<library>
1300
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
1301
              you have headers in a nonstandard directory <include dir>
1302
  CPP         C preprocessor
1303
1304
Use these variables to override the choices made by `configure' or to help
1305
it to find libraries and programs with nonstandard names/locations.
1306
1307
Report bugs to <ris@ripe.net>.
1308
_ACEOF
1309
ac_status=$?
1310
fi
1311
1312
if test "$ac_init_help" = "recursive"; then
1313
  # If there are subdirs, report their specific --help.
1314
  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1315
    test -d "$ac_dir" ||
1316
      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1317
      continue
1318
    ac_builddir=.
1319
1320
case "$ac_dir" in
1321
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1322
*)
1323
  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
1324
  # A ".." for each directory in $ac_dir_suffix.
1325
  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
1326
  case $ac_top_builddir_sub in
1327
  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1328
  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1329
  esac ;;
1330
esac
1331
ac_abs_top_builddir=$ac_pwd
1332
ac_abs_builddir=$ac_pwd$ac_dir_suffix
1333
# for backward compatibility:
1334
ac_top_builddir=$ac_top_build_prefix
1335
1336
case $srcdir in
1337
  .)  # We are building in place.
1338
    ac_srcdir=.
1339
    ac_top_srcdir=$ac_top_builddir_sub
1340
    ac_abs_top_srcdir=$ac_pwd ;;
1341
  [\\/]* | ?:[\\/]* )  # Absolute name.
1342
    ac_srcdir=$srcdir$ac_dir_suffix;
1343
    ac_top_srcdir=$srcdir
1344
    ac_abs_top_srcdir=$srcdir ;;
1345
  *) # Relative name.
1346
    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1347
    ac_top_srcdir=$ac_top_build_prefix$srcdir
1348
    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
1349
esac
1350
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1351
1352
    cd "$ac_dir" || { ac_status=$?; continue; }
1353
    # Check for guested configure.
1354
    if test -f "$ac_srcdir/configure.gnu"; then
1355
      echo &&
1356
      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1357
    elif test -f "$ac_srcdir/configure"; then
1358
      echo &&
1359
      $SHELL "$ac_srcdir/configure" --help=recursive
1360
    else
1361
      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1362
    fi || ac_status=$?
1363
    cd "$ac_pwd" || { ac_status=$?; break; }
1364
  done
1365
fi
1366
1367
test -n "$ac_init_help" && exit $ac_status
1368
if $ac_init_version; then
1369
  cat <<\_ACEOF
1370
libbgpdump configure 1.4.99.15
1371
generated by GNU Autoconf 2.69
1372
1373
Copyright (C) 2012 Free Software Foundation, Inc.
1374
This configure script is free software; the Free Software Foundation
1375
gives unlimited permission to copy, distribute and modify it.
1376
_ACEOF
1377
  exit
1378
fi
1379
1380
## ------------------------ ##
1381
## Autoconf initialization. ##
1382
## ------------------------ ##
1383
1384
# ac_fn_c_try_compile LINENO
1385
# --------------------------
1386
# Try to compile conftest.$ac_ext, and return whether this succeeded.
1387
ac_fn_c_try_compile ()
1388
{
1389
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1390
  rm -f conftest.$ac_objext
1391
  if { { ac_try="$ac_compile"
1392
case "(($ac_try" in
1393
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1394
  *) ac_try_echo=$ac_try;;
1395
esac
1396
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1397
$as_echo "$ac_try_echo"; } >&5
1398
  (eval "$ac_compile") 2>conftest.err
1399
  ac_status=$?
1400
  if test -s conftest.err; then
1401
    grep -v '^ *+' conftest.err >conftest.er1
1402
    cat conftest.er1 >&5
1403
    mv -f conftest.er1 conftest.err
1404
  fi
1405
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1406
  test $ac_status = 0; } && {
1407
	 test -z "$ac_c_werror_flag" ||
1408
	 test ! -s conftest.err
1409
       } && test -s conftest.$ac_objext; then :
1410
  ac_retval=0
1411
else
1412
  $as_echo "$as_me: failed program was:" >&5
1413
sed 's/^/| /' conftest.$ac_ext >&5
1414
1415
	ac_retval=1
1416
fi
1417
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1418
  as_fn_set_status $ac_retval
1419
1420
} # ac_fn_c_try_compile
1421
1422
# ac_fn_c_try_cpp LINENO
1423
# ----------------------
1424
# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
1425
ac_fn_c_try_cpp ()
1426
{
1427
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1428
  if { { ac_try="$ac_cpp conftest.$ac_ext"
1429
case "(($ac_try" in
1430
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1431
  *) ac_try_echo=$ac_try;;
1432
esac
1433
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1434
$as_echo "$ac_try_echo"; } >&5
1435
  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
1436
  ac_status=$?
1437
  if test -s conftest.err; then
1438
    grep -v '^ *+' conftest.err >conftest.er1
1439
    cat conftest.er1 >&5
1440
    mv -f conftest.er1 conftest.err
1441
  fi
1442
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1443
  test $ac_status = 0; } > conftest.i && {
1444
	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
1445
	 test ! -s conftest.err
1446
       }; then :
1447
  ac_retval=0
1448
else
1449
  $as_echo "$as_me: failed program was:" >&5
1450
sed 's/^/| /' conftest.$ac_ext >&5
1451
1452
    ac_retval=1
1453
fi
1454
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1455
  as_fn_set_status $ac_retval
1456
1457
} # ac_fn_c_try_cpp
1458
1459
# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
1460
# -------------------------------------------------------
1461
# Tests whether HEADER exists, giving a warning if it cannot be compiled using
1462
# the include files in INCLUDES and setting the cache variable VAR
1463
# accordingly.
1464
ac_fn_c_check_header_mongrel ()
1465
{
1466
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1467
  if eval \${$3+:} false; then :
1468
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1469
$as_echo_n "checking for $2... " >&6; }
1470
if eval \${$3+:} false; then :
1471
  $as_echo_n "(cached) " >&6
1472
fi
1473
eval ac_res=\$$3
1474
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1475
$as_echo "$ac_res" >&6; }
1476
else
1477
  # Is the header compilable?
1478
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
1479
$as_echo_n "checking $2 usability... " >&6; }
1480
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1481
/* end confdefs.h.  */
1482
$4
1483
#include <$2>
1484
_ACEOF
1485
if ac_fn_c_try_compile "$LINENO"; then :
1486
  ac_header_compiler=yes
1487
else
1488
  ac_header_compiler=no
1489
fi
1490
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1491
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
1492
$as_echo "$ac_header_compiler" >&6; }
1493
1494
# Is the header present?
1495
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
1496
$as_echo_n "checking $2 presence... " >&6; }
1497
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1498
/* end confdefs.h.  */
1499
#include <$2>
1500
_ACEOF
1501
if ac_fn_c_try_cpp "$LINENO"; then :
1502
  ac_header_preproc=yes
1503
else
1504
  ac_header_preproc=no
1505
fi
1506
rm -f conftest.err conftest.i conftest.$ac_ext
1507
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
1508
$as_echo "$ac_header_preproc" >&6; }
1509
1510
# So?  What about this header?
1511
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
1512
  yes:no: )
1513
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
1514
$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
1515
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1516
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1517
    ;;
1518
  no:yes:* )
1519
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
1520
$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
1521
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
1522
$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
1523
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
1524
$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
1525
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
1526
$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
1527
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1528
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1529
( $as_echo "## --------------------------- ##
1530
## Report this to ris@ripe.net ##
1531
## --------------------------- ##"
1532
     ) | sed "s/^/$as_me: WARNING:     /" >&2
1533
    ;;
1534
esac
1535
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1536
$as_echo_n "checking for $2... " >&6; }
1537
if eval \${$3+:} false; then :
1538
  $as_echo_n "(cached) " >&6
1539
else
1540
  eval "$3=\$ac_header_compiler"
1541
fi
1542
eval ac_res=\$$3
1543
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1544
$as_echo "$ac_res" >&6; }
1545
fi
1546
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1547
1548
} # ac_fn_c_check_header_mongrel
1549
1550
# ac_fn_c_try_run LINENO
1551
# ----------------------
1552
# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
1553
# that executables *can* be run.
1554
ac_fn_c_try_run ()
1555
{
1556
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1557
  if { { ac_try="$ac_link"
1558
case "(($ac_try" in
1559
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1560
  *) ac_try_echo=$ac_try;;
1561
esac
1562
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1563
$as_echo "$ac_try_echo"; } >&5
1564
  (eval "$ac_link") 2>&5
1565
  ac_status=$?
1566
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1567
  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
1568
  { { case "(($ac_try" in
1569
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1570
  *) ac_try_echo=$ac_try;;
1571
esac
1572
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1573
$as_echo "$ac_try_echo"; } >&5
1574
  (eval "$ac_try") 2>&5
1575
  ac_status=$?
1576
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1577
  test $ac_status = 0; }; }; then :
1578
  ac_retval=0
1579
else
1580
  $as_echo "$as_me: program exited with status $ac_status" >&5
1581
       $as_echo "$as_me: failed program was:" >&5
1582
sed 's/^/| /' conftest.$ac_ext >&5
1583
1584
       ac_retval=$ac_status
1585
fi
1586
  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1587
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1588
  as_fn_set_status $ac_retval
1589
1590
} # ac_fn_c_try_run
1591
1592
# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
1593
# -------------------------------------------------------
1594
# Tests whether HEADER exists and can be compiled using the include files in
1595
# INCLUDES, setting the cache variable VAR accordingly.
1596
ac_fn_c_check_header_compile ()
1597
{
1598
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1599
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1600
$as_echo_n "checking for $2... " >&6; }
1601
if eval \${$3+:} false; then :
1602
  $as_echo_n "(cached) " >&6
1603
else
1604
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1605
/* end confdefs.h.  */
1606
$4
1607
#include <$2>
1608
_ACEOF
1609
if ac_fn_c_try_compile "$LINENO"; then :
1610
  eval "$3=yes"
1611
else
1612
  eval "$3=no"
1613
fi
1614
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1615
fi
1616
eval ac_res=\$$3
1617
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1618
$as_echo "$ac_res" >&6; }
1619
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1620
1621
} # ac_fn_c_check_header_compile
1622
1623
# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
1624
# -------------------------------------------
1625
# Tests whether TYPE exists after having included INCLUDES, setting cache
1626
# variable VAR accordingly.
1627
ac_fn_c_check_type ()
1628
{
1629
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1630
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1631
$as_echo_n "checking for $2... " >&6; }
1632
if eval \${$3+:} false; then :
1633
  $as_echo_n "(cached) " >&6
1634
else
1635
  eval "$3=no"
1636
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1637
/* end confdefs.h.  */
1638
$4
1639
int
1640
main ()
1641
{
1642
if (sizeof ($2))
1643
	 return 0;
1644
  ;
1645
  return 0;
1646
}
1647
_ACEOF
1648
if ac_fn_c_try_compile "$LINENO"; then :
1649
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1650
/* end confdefs.h.  */
1651
$4
1652
int
1653
main ()
1654
{
1655
if (sizeof (($2)))
1656
	    return 0;
1657
  ;
1658
  return 0;
1659
}
1660
_ACEOF
1661
if ac_fn_c_try_compile "$LINENO"; then :
1662
1663
else
1664
  eval "$3=yes"
1665
fi
1666
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1667
fi
1668
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1669
fi
1670
eval ac_res=\$$3
1671
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1672
$as_echo "$ac_res" >&6; }
1673
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1674
1675
} # ac_fn_c_check_type
1676
1677
# ac_fn_c_try_link LINENO
1678
# -----------------------
1679
# Try to link conftest.$ac_ext, and return whether this succeeded.
1680
ac_fn_c_try_link ()
1681
{
1682
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1683
  rm -f conftest.$ac_objext conftest$ac_exeext
1684
  if { { ac_try="$ac_link"
1685
case "(($ac_try" in
1686
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1687
  *) ac_try_echo=$ac_try;;
1688
esac
1689
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1690
$as_echo "$ac_try_echo"; } >&5
1691
  (eval "$ac_link") 2>conftest.err
1692
  ac_status=$?
1693
  if test -s conftest.err; then
1694
    grep -v '^ *+' conftest.err >conftest.er1
1695
    cat conftest.er1 >&5
1696
    mv -f conftest.er1 conftest.err
1697
  fi
1698
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1699
  test $ac_status = 0; } && {
1700
	 test -z "$ac_c_werror_flag" ||
1701
	 test ! -s conftest.err
1702
       } && test -s conftest$ac_exeext && {
1703
	 test "$cross_compiling" = yes ||
1704
	 test -x conftest$ac_exeext
1705
       }; then :
1706
  ac_retval=0
1707
else
1708
  $as_echo "$as_me: failed program was:" >&5
1709
sed 's/^/| /' conftest.$ac_ext >&5
1710
1711
	ac_retval=1
1712
fi
1713
  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1714
  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1715
  # interfere with the next link command; also delete a directory that is
1716
  # left behind by Apple's compiler.  We do this before executing the actions.
1717
  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1718
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1719
  as_fn_set_status $ac_retval
1720
1721
} # ac_fn_c_try_link
1722
1723
# ac_fn_c_check_func LINENO FUNC VAR
1724
# ----------------------------------
1725
# Tests whether FUNC exists, setting the cache variable VAR accordingly
1726
ac_fn_c_check_func ()
1727
{
1728
  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1729
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1730
$as_echo_n "checking for $2... " >&6; }
1731
if eval \${$3+:} false; then :
1732
  $as_echo_n "(cached) " >&6
1733
else
1734
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1735
/* end confdefs.h.  */
1736
/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
1737
   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
1738
#define $2 innocuous_$2
1739
1740
/* System header to define __stub macros and hopefully few prototypes,
1741
    which can conflict with char $2 (); below.
1742
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
1743
    <limits.h> exists even on freestanding compilers.  */
1744
1745
#ifdef __STDC__
1746
# include <limits.h>
1747
#else
1748
# include <assert.h>
1749
#endif
1750
1751
#undef $2
1752
1753
/* Override any GCC internal prototype to avoid an error.
1754
   Use char because int might match the return type of a GCC
1755
   builtin and then its argument prototype would still apply.  */
1756
#ifdef __cplusplus
1757
extern "C"
1758
#endif
1759
char $2 ();
1760
/* The GNU C library defines this for functions which it implements
1761
    to always fail with ENOSYS.  Some functions are actually named
1762
    something starting with __ and the normal name is an alias.  */
1763
#if defined __stub_$2 || defined __stub___$2
1764
choke me
1765
#endif
1766
1767
int
1768
main ()
1769
{
1770
return $2 ();
1771
  ;
1772
  return 0;
1773
}
1774
_ACEOF
1775
if ac_fn_c_try_link "$LINENO"; then :
1776
  eval "$3=yes"
1777
else
1778
  eval "$3=no"
1779
fi
1780
rm -f core conftest.err conftest.$ac_objext \
1781
    conftest$ac_exeext conftest.$ac_ext
1782
fi
1783
eval ac_res=\$$3
1784
	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1785
$as_echo "$ac_res" >&6; }
1786
  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1787
1788
} # ac_fn_c_check_func
1789
cat >config.log <<_ACEOF
1790
This file contains any messages produced by compilers while
1791
running configure, to aid debugging if configure makes a mistake.
1792
1793
It was created by libbgpdump $as_me 1.4.99.15, which was
1794
generated by GNU Autoconf 2.69.  Invocation command line was
1795
1796
  $ $0 $@
1797
1798
_ACEOF
1799
exec 5>>config.log
1800
{
1801
cat <<_ASUNAME
1802
## --------- ##
1803
## Platform. ##
1804
## --------- ##
1805
1806
hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1807
uname -m = `(uname -m) 2>/dev/null || echo unknown`
1808
uname -r = `(uname -r) 2>/dev/null || echo unknown`
1809
uname -s = `(uname -s) 2>/dev/null || echo unknown`
1810
uname -v = `(uname -v) 2>/dev/null || echo unknown`
1811
1812
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1813
/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
1814
1815
/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
1816
/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
1817
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1818
/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
1819
/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
1820
/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
1821
/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
1822
1823
_ASUNAME
1824
1825
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1826
for as_dir in $PATH
1827
do
1828
  IFS=$as_save_IFS
1829
  test -z "$as_dir" && as_dir=.
1830
    $as_echo "PATH: $as_dir"
1831
  done
1832
IFS=$as_save_IFS
1833
1834
} >&5
1835
1836
cat >&5 <<_ACEOF
1837
1838
1839
## ----------- ##
1840
## Core tests. ##
1841
## ----------- ##
1842
1843
_ACEOF
1844
1845
1846
# Keep a trace of the command line.
1847
# Strip out --no-create and --no-recursion so they do not pile up.
1848
# Strip out --silent because we don't want to record it for future runs.
1849
# Also quote any args containing shell meta-characters.
1850
# Make two passes to allow for proper duplicate-argument suppression.
1851
ac_configure_args=
1852
ac_configure_args0=
1853
ac_configure_args1=
1854
ac_must_keep_next=false
1855
for ac_pass in 1 2
1856
do
1857
  for ac_arg
1858
  do
1859
    case $ac_arg in
1860
    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
1861
    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1862
    | -silent | --silent | --silen | --sile | --sil)
1863
      continue ;;
1864
    *\'*)
1865
      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
1866
    esac
1867
    case $ac_pass in
1868
    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
1869
    2)
1870
      as_fn_append ac_configure_args1 " '$ac_arg'"
1871
      if test $ac_must_keep_next = true; then
1872
	ac_must_keep_next=false # Got value, back to normal.
1873
      else
1874
	case $ac_arg in
1875
	  *=* | --config-cache | -C | -disable-* | --disable-* \
1876
	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
1877
	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
1878
	  | -with-* | --with-* | -without-* | --without-* | --x)
1879
	    case "$ac_configure_args0 " in
1880
	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
1881
	    esac
1882
	    ;;
1883
	  -* ) ac_must_keep_next=true ;;
1884
	esac
1885
      fi
1886
      as_fn_append ac_configure_args " '$ac_arg'"
1887
      ;;
1888
    esac
1889
  done
1890
done
1891
{ ac_configure_args0=; unset ac_configure_args0;}
1892
{ ac_configure_args1=; unset ac_configure_args1;}
1893
1894
# When interrupted or exit'd, cleanup temporary files, and complete
1895
# config.log.  We remove comments because anyway the quotes in there
1896
# would cause problems or look ugly.
1897
# WARNING: Use '\'' to represent an apostrophe within the trap.
1898
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
1899
trap 'exit_status=$?
1900
  # Save into config.log some information that might help in debugging.
1901
  {
1902
    echo
1903
1904
    $as_echo "## ---------------- ##
1905
## Cache variables. ##
1906
## ---------------- ##"
1907
    echo
1908
    # The following way of writing the cache mishandles newlines in values,
1909
(
1910
  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
1911
    eval ac_val=\$$ac_var
1912
    case $ac_val in #(
1913
    *${as_nl}*)
1914
      case $ac_var in #(
1915
      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
1916
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
1917
      esac
1918
      case $ac_var in #(
1919
      _ | IFS | as_nl) ;; #(
1920
      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
1921
      *) { eval $ac_var=; unset $ac_var;} ;;
1922
      esac ;;
1923
    esac
1924
  done
1925
  (set) 2>&1 |
1926
    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
1927
    *${as_nl}ac_space=\ *)
1928
      sed -n \
1929
	"s/'\''/'\''\\\\'\'''\''/g;
1930
	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
1931
      ;; #(
1932
    *)
1933
      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
1934
      ;;
1935
    esac |
1936
    sort
1937
)
1938
    echo
1939
1940
    $as_echo "## ----------------- ##
1941
## Output variables. ##
1942
## ----------------- ##"
1943
    echo
1944
    for ac_var in $ac_subst_vars
1945
    do
1946
      eval ac_val=\$$ac_var
1947
      case $ac_val in
1948
      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1949
      esac
1950
      $as_echo "$ac_var='\''$ac_val'\''"
1951
    done | sort
1952
    echo
1953
1954
    if test -n "$ac_subst_files"; then
1955
      $as_echo "## ------------------- ##
1956
## File substitutions. ##
1957
## ------------------- ##"
1958
      echo
1959
      for ac_var in $ac_subst_files
1960
      do
1961
	eval ac_val=\$$ac_var
1962
	case $ac_val in
1963
	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1964
	esac
1965
	$as_echo "$ac_var='\''$ac_val'\''"
1966
      done | sort
1967
      echo
1968
    fi
1969
1970
    if test -s confdefs.h; then
1971
      $as_echo "## ----------- ##
1972
## confdefs.h. ##
1973
## ----------- ##"
1974
      echo
1975
      cat confdefs.h
1976
      echo
1977
    fi
1978
    test "$ac_signal" != 0 &&
1979
      $as_echo "$as_me: caught signal $ac_signal"
1980
    $as_echo "$as_me: exit $exit_status"
1981
  } >&5
1982
  rm -f core *.core core.conftest.* &&
1983
    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
1984
    exit $exit_status
1985
' 0
1986
for ac_signal in 1 2 13 15; do
1987
  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
1988
done
1989
ac_signal=0
1990
1991
# confdefs.h avoids OS command line length limits that DEFS can exceed.
1992
rm -f -r conftest* confdefs.h
1993
1994
$as_echo "/* confdefs.h */" > confdefs.h
1995
1996
# Predefined preprocessor variables.
1997
1998
cat >>confdefs.h <<_ACEOF
1999
#define PACKAGE_NAME "$PACKAGE_NAME"
2000
_ACEOF
2001
2002
cat >>confdefs.h <<_ACEOF
2003
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
2004
_ACEOF
2005
2006
cat >>confdefs.h <<_ACEOF
2007
#define PACKAGE_VERSION "$PACKAGE_VERSION"
2008
_ACEOF
2009
2010
cat >>confdefs.h <<_ACEOF
2011
#define PACKAGE_STRING "$PACKAGE_STRING"
2012
_ACEOF
2013
2014
cat >>confdefs.h <<_ACEOF
2015
#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
2016
_ACEOF
2017
2018
cat >>confdefs.h <<_ACEOF
2019
#define PACKAGE_URL "$PACKAGE_URL"
2020
_ACEOF
2021
2022
2023
# Let the site file select an alternate cache file if it wants to.
2024
# Prefer an explicitly selected file to automatically selected ones.
2025
ac_site_file1=NONE
2026
ac_site_file2=NONE
2027
if test -n "$CONFIG_SITE"; then
2028
  # We do not want a PATH search for config.site.
2029
  case $CONFIG_SITE in #((
2030
    -*)  ac_site_file1=./$CONFIG_SITE;;
2031
    */*) ac_site_file1=$CONFIG_SITE;;
2032
    *)   ac_site_file1=./$CONFIG_SITE;;
2033
  esac
2034
elif test "x$prefix" != xNONE; then
2035
  ac_site_file1=$prefix/share/config.site
2036
  ac_site_file2=$prefix/etc/config.site
2037
else
2038
  ac_site_file1=$ac_default_prefix/share/config.site
2039
  ac_site_file2=$ac_default_prefix/etc/config.site
2040
fi
2041
for ac_site_file in "$ac_site_file1" "$ac_site_file2"
2042
do
2043
  test "x$ac_site_file" = xNONE && continue
2044
  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
2045
    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
2046
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
2047
    sed 's/^/| /' "$ac_site_file" >&5
2048
    . "$ac_site_file" \
2049
      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2050
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2051
as_fn_error $? "failed to load site script $ac_site_file
2052
See \`config.log' for more details" "$LINENO" 5; }
2053
  fi
2054
done
2055
2056
if test -r "$cache_file"; then
2057
  # Some versions of bash will fail to source /dev/null (special files
2058
  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
2059
  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
2060
    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
2061
$as_echo "$as_me: loading cache $cache_file" >&6;}
2062
    case $cache_file in
2063
      [\\/]* | ?:[\\/]* ) . "$cache_file";;
2064
      *)                      . "./$cache_file";;
2065
    esac
2066
  fi
2067
else
2068
  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
2069
$as_echo "$as_me: creating cache $cache_file" >&6;}
2070
  >$cache_file
2071
fi
2072
2073
# Check that the precious variables saved in the cache have kept the same
2074
# value.
2075
ac_cache_corrupted=false
2076
for ac_var in $ac_precious_vars; do
2077
  eval ac_old_set=\$ac_cv_env_${ac_var}_set
2078
  eval ac_new_set=\$ac_env_${ac_var}_set
2079
  eval ac_old_val=\$ac_cv_env_${ac_var}_value
2080
  eval ac_new_val=\$ac_env_${ac_var}_value
2081
  case $ac_old_set,$ac_new_set in
2082
    set,)
2083
      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
2084
$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
2085
      ac_cache_corrupted=: ;;
2086
    ,set)
2087
      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
2088
$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
2089
      ac_cache_corrupted=: ;;
2090
    ,);;
2091
    *)
2092
      if test "x$ac_old_val" != "x$ac_new_val"; then
2093
	# differences in whitespace do not lead to failure.
2094
	ac_old_val_w=`echo x $ac_old_val`
2095
	ac_new_val_w=`echo x $ac_new_val`
2096
	if test "$ac_old_val_w" != "$ac_new_val_w"; then
2097
	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
2098
$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
2099
	  ac_cache_corrupted=:
2100
	else
2101
	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
2102
$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
2103
	  eval $ac_var=\$ac_old_val
2104
	fi
2105
	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
2106
$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
2107
	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
2108
$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
2109
      fi;;
2110
  esac
2111
  # Pass precious variables to config.status.
2112
  if test "$ac_new_set" = set; then
2113
    case $ac_new_val in
2114
    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
2115
    *) ac_arg=$ac_var=$ac_new_val ;;
2116
    esac
2117
    case " $ac_configure_args " in
2118
      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
2119
      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
2120
    esac
2121
  fi
2122
done
2123
if $ac_cache_corrupted; then
2124
  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2125
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2126
  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
2127
$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
2128
  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
2129
fi
2130
## -------------------- ##
2131
## Main body of script. ##
2132
## -------------------- ##
2133
2134
ac_ext=c
2135
ac_cpp='$CPP $CPPFLAGS'
2136
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2137
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2138
ac_compiler_gnu=$ac_cv_c_compiler_gnu
2139
2140
2141
2142
ac_config_headers="$ac_config_headers bgpdump-config.h"
2143
2144
2145
CFLAGS="-g -O3 $CFLAGS -Wall"
2146
CFLAGS="$CFLAGS -Wsystem-headers -Wno-format-y2k -Wno-sign-compare -Wcast-align"
2147
CFLAGS="$CFLAGS -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wswitch -Wshadow"
2148
2149
# Checks for programs.
2150
ac_ext=c
2151
ac_cpp='$CPP $CPPFLAGS'
2152
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2153
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2154
ac_compiler_gnu=$ac_cv_c_compiler_gnu
2155
if test -n "$ac_tool_prefix"; then
2156
  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
2157
set dummy ${ac_tool_prefix}gcc; ac_word=$2
2158
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2159
$as_echo_n "checking for $ac_word... " >&6; }
2160
if ${ac_cv_prog_CC+:} false; then :
2161
  $as_echo_n "(cached) " >&6
2162
else
2163
  if test -n "$CC"; then
2164
  ac_cv_prog_CC="$CC" # Let the user override the test.
2165
else
2166
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2167
for as_dir in $PATH
2168
do
2169
  IFS=$as_save_IFS
2170
  test -z "$as_dir" && as_dir=.
2171
    for ac_exec_ext in '' $ac_executable_extensions; do
2172
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2173
    ac_cv_prog_CC="${ac_tool_prefix}gcc"
2174
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2175
    break 2
2176
  fi
2177
done
2178
  done
2179
IFS=$as_save_IFS
2180
2181
fi
2182
fi
2183
CC=$ac_cv_prog_CC
2184
if test -n "$CC"; then
2185
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2186
$as_echo "$CC" >&6; }
2187
else
2188
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2189
$as_echo "no" >&6; }
2190
fi
2191
2192
2193
fi
2194
if test -z "$ac_cv_prog_CC"; then
2195
  ac_ct_CC=$CC
2196
  # Extract the first word of "gcc", so it can be a program name with args.
2197
set dummy gcc; ac_word=$2
2198
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2199
$as_echo_n "checking for $ac_word... " >&6; }
2200
if ${ac_cv_prog_ac_ct_CC+:} false; then :
2201
  $as_echo_n "(cached) " >&6
2202
else
2203
  if test -n "$ac_ct_CC"; then
2204
  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
2205
else
2206
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2207
for as_dir in $PATH
2208
do
2209
  IFS=$as_save_IFS
2210
  test -z "$as_dir" && as_dir=.
2211
    for ac_exec_ext in '' $ac_executable_extensions; do
2212
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2213
    ac_cv_prog_ac_ct_CC="gcc"
2214
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2215
    break 2
2216
  fi
2217
done
2218
  done
2219
IFS=$as_save_IFS
2220
2221
fi
2222
fi
2223
ac_ct_CC=$ac_cv_prog_ac_ct_CC
2224
if test -n "$ac_ct_CC"; then
2225
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
2226
$as_echo "$ac_ct_CC" >&6; }
2227
else
2228
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2229
$as_echo "no" >&6; }
2230
fi
2231
2232
  if test "x$ac_ct_CC" = x; then
2233
    CC=""
2234
  else
2235
    case $cross_compiling:$ac_tool_warned in
2236
yes:)
2237
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2238
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2239
ac_tool_warned=yes ;;
2240
esac
2241
    CC=$ac_ct_CC
2242
  fi
2243
else
2244
  CC="$ac_cv_prog_CC"
2245
fi
2246
2247
if test -z "$CC"; then
2248
          if test -n "$ac_tool_prefix"; then
2249
    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
2250
set dummy ${ac_tool_prefix}cc; ac_word=$2
2251
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2252
$as_echo_n "checking for $ac_word... " >&6; }
2253
if ${ac_cv_prog_CC+:} false; then :
2254
  $as_echo_n "(cached) " >&6
2255
else
2256
  if test -n "$CC"; then
2257
  ac_cv_prog_CC="$CC" # Let the user override the test.
2258
else
2259
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2260
for as_dir in $PATH
2261
do
2262
  IFS=$as_save_IFS
2263
  test -z "$as_dir" && as_dir=.
2264
    for ac_exec_ext in '' $ac_executable_extensions; do
2265
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2266
    ac_cv_prog_CC="${ac_tool_prefix}cc"
2267
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2268
    break 2
2269
  fi
2270
done
2271
  done
2272
IFS=$as_save_IFS
2273
2274
fi
2275
fi
2276
CC=$ac_cv_prog_CC
2277
if test -n "$CC"; then
2278
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2279
$as_echo "$CC" >&6; }
2280
else
2281
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2282
$as_echo "no" >&6; }
2283
fi
2284
2285
2286
  fi
2287
fi
2288
if test -z "$CC"; then
2289
  # Extract the first word of "cc", so it can be a program name with args.
2290
set dummy cc; ac_word=$2
2291
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2292
$as_echo_n "checking for $ac_word... " >&6; }
2293
if ${ac_cv_prog_CC+:} false; then :
2294
  $as_echo_n "(cached) " >&6
2295
else
2296
  if test -n "$CC"; then
2297
  ac_cv_prog_CC="$CC" # Let the user override the test.
2298
else
2299
  ac_prog_rejected=no
2300
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2301
for as_dir in $PATH
2302
do
2303
  IFS=$as_save_IFS
2304
  test -z "$as_dir" && as_dir=.
2305
    for ac_exec_ext in '' $ac_executable_extensions; do
2306
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2307
    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
2308
       ac_prog_rejected=yes
2309
       continue
2310
     fi
2311
    ac_cv_prog_CC="cc"
2312
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2313
    break 2
2314
  fi
2315
done
2316
  done
2317
IFS=$as_save_IFS
2318
2319
if test $ac_prog_rejected = yes; then
2320
  # We found a bogon in the path, so make sure we never use it.
2321
  set dummy $ac_cv_prog_CC
2322
  shift
2323
  if test $# != 0; then
2324
    # We chose a different compiler from the bogus one.
2325
    # However, it has the same basename, so the bogon will be chosen
2326
    # first if we set CC to just the basename; use the full file name.
2327
    shift
2328
    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
2329
  fi
2330
fi
2331
fi
2332
fi
2333
CC=$ac_cv_prog_CC
2334
if test -n "$CC"; then
2335
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2336
$as_echo "$CC" >&6; }
2337
else
2338
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2339
$as_echo "no" >&6; }
2340
fi
2341
2342
2343
fi
2344
if test -z "$CC"; then
2345
  if test -n "$ac_tool_prefix"; then
2346
  for ac_prog in cl.exe
2347
  do
2348
    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
2349
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
2350
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2351
$as_echo_n "checking for $ac_word... " >&6; }
2352
if ${ac_cv_prog_CC+:} false; then :
2353
  $as_echo_n "(cached) " >&6
2354
else
2355
  if test -n "$CC"; then
2356
  ac_cv_prog_CC="$CC" # Let the user override the test.
2357
else
2358
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2359
for as_dir in $PATH
2360
do
2361
  IFS=$as_save_IFS
2362
  test -z "$as_dir" && as_dir=.
2363
    for ac_exec_ext in '' $ac_executable_extensions; do
2364
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2365
    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
2366
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2367
    break 2
2368
  fi
2369
done
2370
  done
2371
IFS=$as_save_IFS
2372
2373
fi
2374
fi
2375
CC=$ac_cv_prog_CC
2376
if test -n "$CC"; then
2377
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2378
$as_echo "$CC" >&6; }
2379
else
2380
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2381
$as_echo "no" >&6; }
2382
fi
2383
2384
2385
    test -n "$CC" && break
2386
  done
2387
fi
2388
if test -z "$CC"; then
2389
  ac_ct_CC=$CC
2390
  for ac_prog in cl.exe
2391
do
2392
  # Extract the first word of "$ac_prog", so it can be a program name with args.
2393
set dummy $ac_prog; ac_word=$2
2394
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2395
$as_echo_n "checking for $ac_word... " >&6; }
2396
if ${ac_cv_prog_ac_ct_CC+:} false; then :
2397
  $as_echo_n "(cached) " >&6
2398
else
2399
  if test -n "$ac_ct_CC"; then
2400
  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
2401
else
2402
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2403
for as_dir in $PATH
2404
do
2405
  IFS=$as_save_IFS
2406
  test -z "$as_dir" && as_dir=.
2407
    for ac_exec_ext in '' $ac_executable_extensions; do
2408
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2409
    ac_cv_prog_ac_ct_CC="$ac_prog"
2410
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2411
    break 2
2412
  fi
2413
done
2414
  done
2415
IFS=$as_save_IFS
2416
2417
fi
2418
fi
2419
ac_ct_CC=$ac_cv_prog_ac_ct_CC
2420
if test -n "$ac_ct_CC"; then
2421
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
2422
$as_echo "$ac_ct_CC" >&6; }
2423
else
2424
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2425
$as_echo "no" >&6; }
2426
fi
2427
2428
2429
  test -n "$ac_ct_CC" && break
2430
done
2431
2432
  if test "x$ac_ct_CC" = x; then
2433
    CC=""
2434
  else
2435
    case $cross_compiling:$ac_tool_warned in
2436
yes:)
2437
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2438
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2439
ac_tool_warned=yes ;;
2440
esac
2441
    CC=$ac_ct_CC
2442
  fi
2443
fi
2444
2445
fi
2446
2447
2448
test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2449
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2450
as_fn_error $? "no acceptable C compiler found in \$PATH
2451
See \`config.log' for more details" "$LINENO" 5; }
2452
2453
# Provide some information about the compiler.
2454
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
2455
set X $ac_compile
2456
ac_compiler=$2
2457
for ac_option in --version -v -V -qversion; do
2458
  { { ac_try="$ac_compiler $ac_option >&5"
2459
case "(($ac_try" in
2460
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2461
  *) ac_try_echo=$ac_try;;
2462
esac
2463
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2464
$as_echo "$ac_try_echo"; } >&5
2465
  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
2466
  ac_status=$?
2467
  if test -s conftest.err; then
2468
    sed '10a\
2469
... rest of stderr output deleted ...
2470
         10q' conftest.err >conftest.er1
2471
    cat conftest.er1 >&5
2472
  fi
2473
  rm -f conftest.er1 conftest.err
2474
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2475
  test $ac_status = 0; }
2476
done
2477
2478
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2479
/* end confdefs.h.  */
2480
2481
int
2482
main ()
2483
{
2484
2485
  ;
2486
  return 0;
2487
}
2488
_ACEOF
2489
ac_clean_files_save=$ac_clean_files
2490
ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
2491
# Try to create an executable without -o first, disregard a.out.
2492
# It will help us diagnose broken compilers, and finding out an intuition
2493
# of exeext.
2494
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
2495
$as_echo_n "checking whether the C compiler works... " >&6; }
2496
ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
2497
2498
# The possible output files:
2499
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
2500
2501
ac_rmfiles=
2502
for ac_file in $ac_files
2503
do
2504
  case $ac_file in
2505
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
2506
    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
2507
  esac
2508
done
2509
rm -f $ac_rmfiles
2510
2511
if { { ac_try="$ac_link_default"
2512
case "(($ac_try" in
2513
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2514
  *) ac_try_echo=$ac_try;;
2515
esac
2516
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2517
$as_echo "$ac_try_echo"; } >&5
2518
  (eval "$ac_link_default") 2>&5
2519
  ac_status=$?
2520
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2521
  test $ac_status = 0; }; then :
2522
  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
2523
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
2524
# in a Makefile.  We should not override ac_cv_exeext if it was cached,
2525
# so that the user can short-circuit this test for compilers unknown to
2526
# Autoconf.
2527
for ac_file in $ac_files ''
2528
do
2529
  test -f "$ac_file" || continue
2530
  case $ac_file in
2531
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
2532
	;;
2533
    [ab].out )
2534
	# We found the default executable, but exeext='' is most
2535
	# certainly right.
2536
	break;;
2537
    *.* )
2538
	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
2539
	then :; else
2540
	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
2541
	fi
2542
	# We set ac_cv_exeext here because the later test for it is not
2543
	# safe: cross compilers may not add the suffix if given an `-o'
2544
	# argument, so we may need to know it at that point already.
2545
	# Even if this section looks crufty: it has the advantage of
2546
	# actually working.
2547
	break;;
2548
    * )
2549
	break;;
2550
  esac
2551
done
2552
test "$ac_cv_exeext" = no && ac_cv_exeext=
2553
2554
else
2555
  ac_file=''
2556
fi
2557
if test -z "$ac_file"; then :
2558
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2559
$as_echo "no" >&6; }
2560
$as_echo "$as_me: failed program was:" >&5
2561
sed 's/^/| /' conftest.$ac_ext >&5
2562
2563
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2564
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2565
as_fn_error 77 "C compiler cannot create executables
2566
See \`config.log' for more details" "$LINENO" 5; }
2567
else
2568
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
2569
$as_echo "yes" >&6; }
2570
fi
2571
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
2572
$as_echo_n "checking for C compiler default output file name... " >&6; }
2573
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
2574
$as_echo "$ac_file" >&6; }
2575
ac_exeext=$ac_cv_exeext
2576
2577
rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
2578
ac_clean_files=$ac_clean_files_save
2579
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
2580
$as_echo_n "checking for suffix of executables... " >&6; }
2581
if { { ac_try="$ac_link"
2582
case "(($ac_try" in
2583
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2584
  *) ac_try_echo=$ac_try;;
2585
esac
2586
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2587
$as_echo "$ac_try_echo"; } >&5
2588
  (eval "$ac_link") 2>&5
2589
  ac_status=$?
2590
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2591
  test $ac_status = 0; }; then :
2592
  # If both `conftest.exe' and `conftest' are `present' (well, observable)
2593
# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
2594
# work properly (i.e., refer to `conftest.exe'), while it won't with
2595
# `rm'.
2596
for ac_file in conftest.exe conftest conftest.*; do
2597
  test -f "$ac_file" || continue
2598
  case $ac_file in
2599
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
2600
    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
2601
	  break;;
2602
    * ) break;;
2603
  esac
2604
done
2605
else
2606
  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2607
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2608
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
2609
See \`config.log' for more details" "$LINENO" 5; }
2610
fi
2611
rm -f conftest conftest$ac_cv_exeext
2612
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
2613
$as_echo "$ac_cv_exeext" >&6; }
2614
2615
rm -f conftest.$ac_ext
2616
EXEEXT=$ac_cv_exeext
2617
ac_exeext=$EXEEXT
2618
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2619
/* end confdefs.h.  */
2620
#include <stdio.h>
2621
int
2622
main ()
2623
{
2624
FILE *f = fopen ("conftest.out", "w");
2625
 return ferror (f) || fclose (f) != 0;
2626
2627
  ;
2628
  return 0;
2629
}
2630
_ACEOF
2631
ac_clean_files="$ac_clean_files conftest.out"
2632
# Check that the compiler produces executables we can run.  If not, either
2633
# the compiler is broken, or we cross compile.
2634
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
2635
$as_echo_n "checking whether we are cross compiling... " >&6; }
2636
if test "$cross_compiling" != yes; then
2637
  { { ac_try="$ac_link"
2638
case "(($ac_try" in
2639
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2640
  *) ac_try_echo=$ac_try;;
2641
esac
2642
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2643
$as_echo "$ac_try_echo"; } >&5
2644
  (eval "$ac_link") 2>&5
2645
  ac_status=$?
2646
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2647
  test $ac_status = 0; }
2648
  if { ac_try='./conftest$ac_cv_exeext'
2649
  { { case "(($ac_try" in
2650
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2651
  *) ac_try_echo=$ac_try;;
2652
esac
2653
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2654
$as_echo "$ac_try_echo"; } >&5
2655
  (eval "$ac_try") 2>&5
2656
  ac_status=$?
2657
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2658
  test $ac_status = 0; }; }; then
2659
    cross_compiling=no
2660
  else
2661
    if test "$cross_compiling" = maybe; then
2662
	cross_compiling=yes
2663
    else
2664
	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2665
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2666
as_fn_error $? "cannot run C compiled programs.
2667
If you meant to cross compile, use \`--host'.
2668
See \`config.log' for more details" "$LINENO" 5; }
2669
    fi
2670
  fi
2671
fi
2672
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
2673
$as_echo "$cross_compiling" >&6; }
2674
2675
rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
2676
ac_clean_files=$ac_clean_files_save
2677
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
2678
$as_echo_n "checking for suffix of object files... " >&6; }
2679
if ${ac_cv_objext+:} false; then :
2680
  $as_echo_n "(cached) " >&6
2681
else
2682
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2683
/* end confdefs.h.  */
2684
2685
int
2686
main ()
2687
{
2688
2689
  ;
2690
  return 0;
2691
}
2692
_ACEOF
2693
rm -f conftest.o conftest.obj
2694
if { { ac_try="$ac_compile"
2695
case "(($ac_try" in
2696
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2697
  *) ac_try_echo=$ac_try;;
2698
esac
2699
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2700
$as_echo "$ac_try_echo"; } >&5
2701
  (eval "$ac_compile") 2>&5
2702
  ac_status=$?
2703
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2704
  test $ac_status = 0; }; then :
2705
  for ac_file in conftest.o conftest.obj conftest.*; do
2706
  test -f "$ac_file" || continue;
2707
  case $ac_file in
2708
    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
2709
    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
2710
       break;;
2711
  esac
2712
done
2713
else
2714
  $as_echo "$as_me: failed program was:" >&5
2715
sed 's/^/| /' conftest.$ac_ext >&5
2716
2717
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2718
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2719
as_fn_error $? "cannot compute suffix of object files: cannot compile
2720
See \`config.log' for more details" "$LINENO" 5; }
2721
fi
2722
rm -f conftest.$ac_cv_objext conftest.$ac_ext
2723
fi
2724
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
2725
$as_echo "$ac_cv_objext" >&6; }
2726
OBJEXT=$ac_cv_objext
2727
ac_objext=$OBJEXT
2728
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
2729
$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
2730
if ${ac_cv_c_compiler_gnu+:} false; then :
2731
  $as_echo_n "(cached) " >&6
2732
else
2733
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2734
/* end confdefs.h.  */
2735
2736
int
2737
main ()
2738
{
2739
#ifndef __GNUC__
2740
       choke me
2741
#endif
2742
2743
  ;
2744
  return 0;
2745
}
2746
_ACEOF
2747
if ac_fn_c_try_compile "$LINENO"; then :
2748
  ac_compiler_gnu=yes
2749
else
2750
  ac_compiler_gnu=no
2751
fi
2752
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2753
ac_cv_c_compiler_gnu=$ac_compiler_gnu
2754
2755
fi
2756
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
2757
$as_echo "$ac_cv_c_compiler_gnu" >&6; }
2758
if test $ac_compiler_gnu = yes; then
2759
  GCC=yes
2760
else
2761
  GCC=
2762
fi
2763
ac_test_CFLAGS=${CFLAGS+set}
2764
ac_save_CFLAGS=$CFLAGS
2765
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
2766
$as_echo_n "checking whether $CC accepts -g... " >&6; }
2767
if ${ac_cv_prog_cc_g+:} false; then :
2768
  $as_echo_n "(cached) " >&6
2769
else
2770
  ac_save_c_werror_flag=$ac_c_werror_flag
2771
   ac_c_werror_flag=yes
2772
   ac_cv_prog_cc_g=no
2773
   CFLAGS="-g"
2774
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2775
/* end confdefs.h.  */
2776
2777
int
2778
main ()
2779
{
2780
2781
  ;
2782
  return 0;
2783
}
2784
_ACEOF
2785
if ac_fn_c_try_compile "$LINENO"; then :
2786
  ac_cv_prog_cc_g=yes
2787
else
2788
  CFLAGS=""
2789
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2790
/* end confdefs.h.  */
2791
2792
int
2793
main ()
2794
{
2795
2796
  ;
2797
  return 0;
2798
}
2799
_ACEOF
2800
if ac_fn_c_try_compile "$LINENO"; then :
2801
2802
else
2803
  ac_c_werror_flag=$ac_save_c_werror_flag
2804
	 CFLAGS="-g"
2805
	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2806
/* end confdefs.h.  */
2807
2808
int
2809
main ()
2810
{
2811
2812
  ;
2813
  return 0;
2814
}
2815
_ACEOF
2816
if ac_fn_c_try_compile "$LINENO"; then :
2817
  ac_cv_prog_cc_g=yes
2818
fi
2819
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2820
fi
2821
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2822
fi
2823
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2824
   ac_c_werror_flag=$ac_save_c_werror_flag
2825
fi
2826
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
2827
$as_echo "$ac_cv_prog_cc_g" >&6; }
2828
if test "$ac_test_CFLAGS" = set; then
2829
  CFLAGS=$ac_save_CFLAGS
2830
elif test $ac_cv_prog_cc_g = yes; then
2831
  if test "$GCC" = yes; then
2832
    CFLAGS="-g -O2"
2833
  else
2834
    CFLAGS="-g"
2835
  fi
2836
else
2837
  if test "$GCC" = yes; then
2838
    CFLAGS="-O2"
2839
  else
2840
    CFLAGS=
2841
  fi
2842
fi
2843
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
2844
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
2845
if ${ac_cv_prog_cc_c89+:} false; then :
2846
  $as_echo_n "(cached) " >&6
2847
else
2848
  ac_cv_prog_cc_c89=no
2849
ac_save_CC=$CC
2850
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2851
/* end confdefs.h.  */
2852
#include <stdarg.h>
2853
#include <stdio.h>
2854
struct stat;
2855
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2856
struct buf { int x; };
2857
FILE * (*rcsopen) (struct buf *, struct stat *, int);
2858
static char *e (p, i)
2859
     char **p;
2860
     int i;
2861
{
2862
  return p[i];
2863
}
2864
static char *f (char * (*g) (char **, int), char **p, ...)
2865
{
2866
  char *s;
2867
  va_list v;
2868
  va_start (v,p);
2869
  s = g (p, va_arg (v,int));
2870
  va_end (v);
2871
  return s;
2872
}
2873
2874
/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
2875
   function prototypes and stuff, but not '\xHH' hex character constants.
2876
   These don't provoke an error unfortunately, instead are silently treated
2877
   as 'x'.  The following induces an error, until -std is added to get
2878
   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
2879
   array size at least.  It's necessary to write '\x00'==0 to get something
2880
   that's true only with -std.  */
2881
int osf4_cc_array ['\x00' == 0 ? 1 : -1];
2882
2883
/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
2884
   inside strings and character constants.  */
2885
#define FOO(x) 'x'
2886
int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
2887
2888
int test (int i, double x);
2889
struct s1 {int (*f) (int a);};
2890
struct s2 {int (*f) (double a);};
2891
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2892
int argc;
2893
char **argv;
2894
int
2895
main ()
2896
{
2897
return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2898
  ;
2899
  return 0;
2900
}
2901
_ACEOF
2902
for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
2903
	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2904
do
2905
  CC="$ac_save_CC $ac_arg"
2906
  if ac_fn_c_try_compile "$LINENO"; then :
2907
  ac_cv_prog_cc_c89=$ac_arg
2908
fi
2909
rm -f core conftest.err conftest.$ac_objext
2910
  test "x$ac_cv_prog_cc_c89" != "xno" && break
2911
done
2912
rm -f conftest.$ac_ext
2913
CC=$ac_save_CC
2914
2915
fi
2916
# AC_CACHE_VAL
2917
case "x$ac_cv_prog_cc_c89" in
2918
  x)
2919
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
2920
$as_echo "none needed" >&6; } ;;
2921
  xno)
2922
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
2923
$as_echo "unsupported" >&6; } ;;
2924
  *)
2925
    CC="$CC $ac_cv_prog_cc_c89"
2926
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
2927
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
2928
esac
2929
if test "x$ac_cv_prog_cc_c89" != xno; then :
2930
2931
fi
2932
2933
ac_ext=c
2934
ac_cpp='$CPP $CPPFLAGS'
2935
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2936
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2937
ac_compiler_gnu=$ac_cv_c_compiler_gnu
2938
2939
if test -n "$ac_tool_prefix"; then
2940
  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
2941
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
2942
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2943
$as_echo_n "checking for $ac_word... " >&6; }
2944
if ${ac_cv_prog_RANLIB+:} false; then :
2945
  $as_echo_n "(cached) " >&6
2946
else
2947
  if test -n "$RANLIB"; then
2948
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2949
else
2950
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2951
for as_dir in $PATH
2952
do
2953
  IFS=$as_save_IFS
2954
  test -z "$as_dir" && as_dir=.
2955
    for ac_exec_ext in '' $ac_executable_extensions; do
2956
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2957
    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
2958
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2959
    break 2
2960
  fi
2961
done
2962
  done
2963
IFS=$as_save_IFS
2964
2965
fi
2966
fi
2967
RANLIB=$ac_cv_prog_RANLIB
2968
if test -n "$RANLIB"; then
2969
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
2970
$as_echo "$RANLIB" >&6; }
2971
else
2972
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2973
$as_echo "no" >&6; }
2974
fi
2975
2976
2977
fi
2978
if test -z "$ac_cv_prog_RANLIB"; then
2979
  ac_ct_RANLIB=$RANLIB
2980
  # Extract the first word of "ranlib", so it can be a program name with args.
2981
set dummy ranlib; ac_word=$2
2982
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2983
$as_echo_n "checking for $ac_word... " >&6; }
2984
if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
2985
  $as_echo_n "(cached) " >&6
2986
else
2987
  if test -n "$ac_ct_RANLIB"; then
2988
  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
2989
else
2990
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2991
for as_dir in $PATH
2992
do
2993
  IFS=$as_save_IFS
2994
  test -z "$as_dir" && as_dir=.
2995
    for ac_exec_ext in '' $ac_executable_extensions; do
2996
  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2997
    ac_cv_prog_ac_ct_RANLIB="ranlib"
2998
    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2999
    break 2
3000
  fi
3001
done
3002
  done
3003
IFS=$as_save_IFS
3004
3005
fi
3006
fi
3007
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
3008
if test -n "$ac_ct_RANLIB"; then
3009
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
3010
$as_echo "$ac_ct_RANLIB" >&6; }
3011
else
3012
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3013
$as_echo "no" >&6; }
3014
fi
3015
3016
  if test "x$ac_ct_RANLIB" = x; then
3017
    RANLIB=":"
3018
  else
3019
    case $cross_compiling:$ac_tool_warned in
3020
yes:)
3021
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3022
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3023
ac_tool_warned=yes ;;
3024
esac
3025
    RANLIB=$ac_ct_RANLIB
3026
  fi
3027
else
3028
  RANLIB="$ac_cv_prog_RANLIB"
3029
fi
3030
3031
3032
# Checks for header files.
3033
3034
ac_ext=c
3035
ac_cpp='$CPP $CPPFLAGS'
3036
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3037
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3038
ac_compiler_gnu=$ac_cv_c_compiler_gnu
3039
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
3040
$as_echo_n "checking how to run the C preprocessor... " >&6; }
3041
# On Suns, sometimes $CPP names a directory.
3042
if test -n "$CPP" && test -d "$CPP"; then
3043
  CPP=
3044
fi
3045
if test -z "$CPP"; then
3046
  if ${ac_cv_prog_CPP+:} false; then :
3047
  $as_echo_n "(cached) " >&6
3048
else
3049
      # Double quotes because CPP needs to be expanded
3050
    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
3051
    do
3052
      ac_preproc_ok=false
3053
for ac_c_preproc_warn_flag in '' yes
3054
do
3055
  # Use a header file that comes with gcc, so configuring glibc
3056
  # with a fresh cross-compiler works.
3057
  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3058
  # <limits.h> exists even on freestanding compilers.
3059
  # On the NeXT, cc -E runs the code through the compiler's parser,
3060
  # not just through cpp. "Syntax error" is here to catch this case.
3061
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3062
/* end confdefs.h.  */
3063
#ifdef __STDC__
3064
# include <limits.h>
3065
#else
3066
# include <assert.h>
3067
#endif
3068
		     Syntax error
3069
_ACEOF
3070
if ac_fn_c_try_cpp "$LINENO"; then :
3071
3072
else
3073
  # Broken: fails on valid input.
3074
continue
3075
fi
3076
rm -f conftest.err conftest.i conftest.$ac_ext
3077
3078
  # OK, works on sane cases.  Now check whether nonexistent headers
3079
  # can be detected and how.
3080
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3081
/* end confdefs.h.  */
3082
#include <ac_nonexistent.h>
3083
_ACEOF
3084
if ac_fn_c_try_cpp "$LINENO"; then :
3085
  # Broken: success on invalid input.
3086
continue
3087
else
3088
  # Passes both tests.
3089
ac_preproc_ok=:
3090
break
3091
fi
3092
rm -f conftest.err conftest.i conftest.$ac_ext
3093
3094
done
3095
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
3096
rm -f conftest.i conftest.err conftest.$ac_ext
3097
if $ac_preproc_ok; then :
3098
  break
3099
fi
3100
3101
    done
3102
    ac_cv_prog_CPP=$CPP
3103
3104
fi
3105
  CPP=$ac_cv_prog_CPP
3106
else
3107
  ac_cv_prog_CPP=$CPP
3108
fi
3109
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
3110
$as_echo "$CPP" >&6; }
3111
ac_preproc_ok=false
3112
for ac_c_preproc_warn_flag in '' yes
3113
do
3114
  # Use a header file that comes with gcc, so configuring glibc
3115
  # with a fresh cross-compiler works.
3116
  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3117
  # <limits.h> exists even on freestanding compilers.
3118
  # On the NeXT, cc -E runs the code through the compiler's parser,
3119
  # not just through cpp. "Syntax error" is here to catch this case.
3120
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3121
/* end confdefs.h.  */
3122
#ifdef __STDC__
3123
# include <limits.h>
3124
#else
3125
# include <assert.h>
3126
#endif
3127
		     Syntax error
3128
_ACEOF
3129
if ac_fn_c_try_cpp "$LINENO"; then :
3130
3131
else
3132
  # Broken: fails on valid input.
3133
continue
3134
fi
3135
rm -f conftest.err conftest.i conftest.$ac_ext
3136
3137
  # OK, works on sane cases.  Now check whether nonexistent headers
3138
  # can be detected and how.
3139
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3140
/* end confdefs.h.  */
3141
#include <ac_nonexistent.h>
3142
_ACEOF
3143
if ac_fn_c_try_cpp "$LINENO"; then :
3144
  # Broken: success on invalid input.
3145
continue
3146
else
3147
  # Passes both tests.
3148
ac_preproc_ok=:
3149
break
3150
fi
3151
rm -f conftest.err conftest.i conftest.$ac_ext
3152
3153
done
3154
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
3155
rm -f conftest.i conftest.err conftest.$ac_ext
3156
if $ac_preproc_ok; then :
3157
3158
else
3159
  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3160
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3161
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
3162
See \`config.log' for more details" "$LINENO" 5; }
3163
fi
3164
3165
ac_ext=c
3166
ac_cpp='$CPP $CPPFLAGS'
3167
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3168
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3169
ac_compiler_gnu=$ac_cv_c_compiler_gnu
3170
3171
3172
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
3173
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
3174
if ${ac_cv_path_GREP+:} false; then :
3175
  $as_echo_n "(cached) " >&6
3176
else
3177
  if test -z "$GREP"; then
3178
  ac_path_GREP_found=false
3179
  # Loop through the user's path and test for each of PROGNAME-LIST
3180
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3181
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
3182
do
3183
  IFS=$as_save_IFS
3184
  test -z "$as_dir" && as_dir=.
3185
    for ac_prog in grep ggrep; do
3186
    for ac_exec_ext in '' $ac_executable_extensions; do
3187
      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
3188
      as_fn_executable_p "$ac_path_GREP" || continue
3189
# Check for GNU ac_path_GREP and select it if it is found.
3190
  # Check for GNU $ac_path_GREP
3191
case `"$ac_path_GREP" --version 2>&1` in
3192
*GNU*)
3193
  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
3194
*)
3195
  ac_count=0
3196
  $as_echo_n 0123456789 >"conftest.in"
3197
  while :
3198
  do
3199
    cat "conftest.in" "conftest.in" >"conftest.tmp"
3200
    mv "conftest.tmp" "conftest.in"
3201
    cp "conftest.in" "conftest.nl"
3202
    $as_echo 'GREP' >> "conftest.nl"
3203
    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
3204
    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
3205
    as_fn_arith $ac_count + 1 && ac_count=$as_val
3206
    if test $ac_count -gt ${ac_path_GREP_max-0}; then
3207
      # Best one so far, save it but keep looking for a better one
3208
      ac_cv_path_GREP="$ac_path_GREP"
3209
      ac_path_GREP_max=$ac_count
3210
    fi
3211
    # 10*(2^10) chars as input seems more than enough
3212
    test $ac_count -gt 10 && break
3213
  done
3214
  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
3215
esac
3216
3217
      $ac_path_GREP_found && break 3
3218
    done
3219
  done
3220
  done
3221
IFS=$as_save_IFS
3222
  if test -z "$ac_cv_path_GREP"; then
3223
    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
3224
  fi
3225
else
3226
  ac_cv_path_GREP=$GREP
3227
fi
3228
3229
fi
3230
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
3231
$as_echo "$ac_cv_path_GREP" >&6; }
3232
 GREP="$ac_cv_path_GREP"
3233
3234
3235
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
3236
$as_echo_n "checking for egrep... " >&6; }
3237
if ${ac_cv_path_EGREP+:} false; then :
3238
  $as_echo_n "(cached) " >&6
3239
else
3240
  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
3241
   then ac_cv_path_EGREP="$GREP -E"
3242
   else
3243
     if test -z "$EGREP"; then
3244
  ac_path_EGREP_found=false
3245
  # Loop through the user's path and test for each of PROGNAME-LIST
3246
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3247
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
3248
do
3249
  IFS=$as_save_IFS
3250
  test -z "$as_dir" && as_dir=.
3251
    for ac_prog in egrep; do
3252
    for ac_exec_ext in '' $ac_executable_extensions; do
3253
      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
3254
      as_fn_executable_p "$ac_path_EGREP" || continue
3255
# Check for GNU ac_path_EGREP and select it if it is found.
3256
  # Check for GNU $ac_path_EGREP
3257
case `"$ac_path_EGREP" --version 2>&1` in
3258
*GNU*)
3259
  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
3260
*)
3261
  ac_count=0
3262
  $as_echo_n 0123456789 >"conftest.in"
3263
  while :
3264
  do
3265
    cat "conftest.in" "conftest.in" >"conftest.tmp"
3266
    mv "conftest.tmp" "conftest.in"
3267
    cp "conftest.in" "conftest.nl"
3268
    $as_echo 'EGREP' >> "conftest.nl"
3269
    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
3270
    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
3271
    as_fn_arith $ac_count + 1 && ac_count=$as_val
3272
    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
3273
      # Best one so far, save it but keep looking for a better one
3274
      ac_cv_path_EGREP="$ac_path_EGREP"
3275
      ac_path_EGREP_max=$ac_count
3276
    fi
3277
    # 10*(2^10) chars as input seems more than enough
3278
    test $ac_count -gt 10 && break
3279
  done
3280
  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
3281
esac
3282
3283
      $ac_path_EGREP_found && break 3
3284
    done
3285
  done
3286
  done
3287
IFS=$as_save_IFS
3288
  if test -z "$ac_cv_path_EGREP"; then
3289
    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
3290
  fi
3291
else
3292
  ac_cv_path_EGREP=$EGREP
3293
fi
3294
3295
   fi
3296
fi
3297
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
3298
$as_echo "$ac_cv_path_EGREP" >&6; }
3299
 EGREP="$ac_cv_path_EGREP"
3300
3301
3302
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
3303
$as_echo_n "checking for ANSI C header files... " >&6; }
3304
if ${ac_cv_header_stdc+:} false; then :
3305
  $as_echo_n "(cached) " >&6
3306
else
3307
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3308
/* end confdefs.h.  */
3309
#include <stdlib.h>
3310
#include <stdarg.h>
3311
#include <string.h>
3312
#include <float.h>
3313
3314
int
3315
main ()
3316
{
3317
3318
  ;
3319
  return 0;
3320
}
3321
_ACEOF
3322
if ac_fn_c_try_compile "$LINENO"; then :
3323
  ac_cv_header_stdc=yes
3324
else
3325
  ac_cv_header_stdc=no
3326
fi
3327
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3328
3329
if test $ac_cv_header_stdc = yes; then
3330
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3331
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3332
/* end confdefs.h.  */
3333
#include <string.h>
3334
3335
_ACEOF
3336
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3337
  $EGREP "memchr" >/dev/null 2>&1; then :
3338
3339
else
3340
  ac_cv_header_stdc=no
3341
fi
3342
rm -f conftest*
3343
3344
fi
3345
3346
if test $ac_cv_header_stdc = yes; then
3347
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3348
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3349
/* end confdefs.h.  */
3350
#include <stdlib.h>
3351
3352
_ACEOF
3353
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3354
  $EGREP "free" >/dev/null 2>&1; then :
3355
3356
else
3357
  ac_cv_header_stdc=no
3358
fi
3359
rm -f conftest*
3360
3361
fi
3362
3363
if test $ac_cv_header_stdc = yes; then
3364
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3365
  if test "$cross_compiling" = yes; then :
3366
  :
3367
else
3368
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3369
/* end confdefs.h.  */
3370
#include <ctype.h>
3371
#include <stdlib.h>
3372
#if ((' ' & 0x0FF) == 0x020)
3373
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3374
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3375
#else
3376
# define ISLOWER(c) \
3377
		   (('a' <= (c) && (c) <= 'i') \
3378
		     || ('j' <= (c) && (c) <= 'r') \
3379
		     || ('s' <= (c) && (c) <= 'z'))
3380
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
3381
#endif
3382
3383
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3384
int
3385
main ()
3386
{
3387
  int i;
3388
  for (i = 0; i < 256; i++)
3389
    if (XOR (islower (i), ISLOWER (i))
3390
	|| toupper (i) != TOUPPER (i))
3391
      return 2;
3392
  return 0;
3393
}
3394
_ACEOF
3395
if ac_fn_c_try_run "$LINENO"; then :
3396
3397
else
3398
  ac_cv_header_stdc=no
3399
fi
3400
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
3401
  conftest.$ac_objext conftest.beam conftest.$ac_ext
3402
fi
3403
3404
fi
3405
fi
3406
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
3407
$as_echo "$ac_cv_header_stdc" >&6; }
3408
if test $ac_cv_header_stdc = yes; then
3409
3410
$as_echo "#define STDC_HEADERS 1" >>confdefs.h
3411
3412
fi
3413
3414
# On IRIX 5.3, sys/types and inttypes.h are conflicting.
3415
for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
3416
		  inttypes.h stdint.h unistd.h
3417
do :
3418
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
3419
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
3420
"
3421
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
3422
  cat >>confdefs.h <<_ACEOF
3423
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
3424
_ACEOF
3425
3426
fi
3427
3428
done
3429
3430
3431
for ac_header in arpa/inet.h netinet/in.h syslog.h
3432
do :
3433
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
3434
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
3435
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
3436
  cat >>confdefs.h <<_ACEOF
3437
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
3438
_ACEOF
3439
3440
fi
3441
3442
done
3443
3444
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
3445
$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
3446
if ${ac_cv_struct_tm+:} false; then :
3447
  $as_echo_n "(cached) " >&6
3448
else
3449
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3450
/* end confdefs.h.  */
3451
#include <sys/types.h>
3452
#include <time.h>
3453
3454
int
3455
main ()
3456
{
3457
struct tm tm;
3458
				     int *p = &tm.tm_sec;
3459
				     return !p;
3460
  ;
3461
  return 0;
3462
}
3463
_ACEOF
3464
if ac_fn_c_try_compile "$LINENO"; then :
3465
  ac_cv_struct_tm=time.h
3466
else
3467
  ac_cv_struct_tm=sys/time.h
3468
fi
3469
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3470
fi
3471
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
3472
$as_echo "$ac_cv_struct_tm" >&6; }
3473
if test $ac_cv_struct_tm = sys/time.h; then
3474
3475
$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
3476
3477
fi
3478
3479
3480
# Check for u_*_t
3481
ac_fn_c_check_type "$LINENO" "u_char_t" "ac_cv_type_u_char_t" "$ac_includes_default"
3482
if test "x$ac_cv_type_u_char_t" = xyes; then :
3483
3484
else
3485
3486
$as_echo "#define u_char_t uchar_t" >>confdefs.h
3487
3488
fi
3489
3490
ac_fn_c_check_type "$LINENO" "u_int8_t" "ac_cv_type_u_int8_t" "$ac_includes_default"
3491
if test "x$ac_cv_type_u_int8_t" = xyes; then :
3492
3493
else
3494
3495
$as_echo "#define u_int8_t uint8_t" >>confdefs.h
3496
3497
fi
3498
3499
ac_fn_c_check_type "$LINENO" "u_int16_t" "ac_cv_type_u_int16_t" "$ac_includes_default"
3500
if test "x$ac_cv_type_u_int16_t" = xyes; then :
3501
3502
else
3503
3504
$as_echo "#define u_int16_t uint16_t" >>confdefs.h
3505
3506
fi
3507
3508
ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "$ac_includes_default"
3509
if test "x$ac_cv_type_u_int32_t" = xyes; then :
3510
3511
else
3512
3513
$as_echo "#define u_int32_t uint32_t" >>confdefs.h
3514
3515
fi
3516
3517
3518
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5
3519
$as_echo_n "checking for gzopen in -lz... " >&6; }
3520
if ${ac_cv_lib_z_gzopen+:} false; then :
3521
  $as_echo_n "(cached) " >&6
3522
else
3523
  ac_check_lib_save_LIBS=$LIBS
3524
LIBS="-lz  $LIBS"
3525
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3526
/* end confdefs.h.  */
3527
3528
/* Override any GCC internal prototype to avoid an error.
3529
   Use char because int might match the return type of a GCC
3530
   builtin and then its argument prototype would still apply.  */
3531
#ifdef __cplusplus
3532
extern "C"
3533
#endif
3534
char gzopen ();
3535
int
3536
main ()
3537
{
3538
return gzopen ();
3539
  ;
3540
  return 0;
3541
}
3542
_ACEOF
3543
if ac_fn_c_try_link "$LINENO"; then :
3544
  ac_cv_lib_z_gzopen=yes
3545
else
3546
  ac_cv_lib_z_gzopen=no
3547
fi
3548
rm -f core conftest.err conftest.$ac_objext \
3549
    conftest$ac_exeext conftest.$ac_ext
3550
LIBS=$ac_check_lib_save_LIBS
3551
fi
3552
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzopen" >&5
3553
$as_echo "$ac_cv_lib_z_gzopen" >&6; }
3554
if test "x$ac_cv_lib_z_gzopen" = xyes; then :
3555
  cat >>confdefs.h <<_ACEOF
3556
#define HAVE_LIBZ 1
3557
_ACEOF
3558
3559
  LIBS="-lz $LIBS"
3560
3561
else
3562
3563
$as_echo "#define DONT_HAVE_GZ 1" >>confdefs.h
3564
3565
fi
3566
3567
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzReadOpen in -lbz2" >&5
3568
$as_echo_n "checking for BZ2_bzReadOpen in -lbz2... " >&6; }
3569
if ${ac_cv_lib_bz2_BZ2_bzReadOpen+:} false; then :
3570
  $as_echo_n "(cached) " >&6
3571
else
3572
  ac_check_lib_save_LIBS=$LIBS
3573
LIBS="-lbz2  $LIBS"
3574
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3575
/* end confdefs.h.  */
3576
3577
/* Override any GCC internal prototype to avoid an error.
3578
   Use char because int might match the return type of a GCC
3579
   builtin and then its argument prototype would still apply.  */
3580
#ifdef __cplusplus
3581
extern "C"
3582
#endif
3583
char BZ2_bzReadOpen ();
3584
int
3585
main ()
3586
{
3587
return BZ2_bzReadOpen ();
3588
  ;
3589
  return 0;
3590
}
3591
_ACEOF
3592
if ac_fn_c_try_link "$LINENO"; then :
3593
  ac_cv_lib_bz2_BZ2_bzReadOpen=yes
3594
else
3595
  ac_cv_lib_bz2_BZ2_bzReadOpen=no
3596
fi
3597
rm -f core conftest.err conftest.$ac_objext \
3598
    conftest$ac_exeext conftest.$ac_ext
3599
LIBS=$ac_check_lib_save_LIBS
3600
fi
3601
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzReadOpen" >&5
3602
$as_echo "$ac_cv_lib_bz2_BZ2_bzReadOpen" >&6; }
3603
if test "x$ac_cv_lib_bz2_BZ2_bzReadOpen" = xyes; then :
3604
  cat >>confdefs.h <<_ACEOF
3605
#define HAVE_LIBBZ2 1
3606
_ACEOF
3607
3608
  LIBS="-lbz2 $LIBS"
3609
3610
else
3611
3612
$as_echo "#define DONT_HAVE_BZ2 1" >>confdefs.h
3613
3614
fi
3615
3616
3617
# Check for inet_ntoa in -lnsl if not found (Solaris)
3618
for ac_func in inet_ntoa
3619
do :
3620
  ac_fn_c_check_func "$LINENO" "inet_ntoa" "ac_cv_func_inet_ntoa"
3621
if test "x$ac_cv_func_inet_ntoa" = xyes; then :
3622
  cat >>confdefs.h <<_ACEOF
3623
#define HAVE_INET_NTOA 1
3624
_ACEOF
3625
3626
else
3627
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnsl" >&5
3628
$as_echo_n "checking for inet_ntoa in -lnsl... " >&6; }
3629
if ${ac_cv_lib_nsl_inet_ntoa+:} false; then :
3630
  $as_echo_n "(cached) " >&6
3631
else
3632
  ac_check_lib_save_LIBS=$LIBS
3633
LIBS="-lnsl  $LIBS"
3634
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3635
/* end confdefs.h.  */
3636
3637
/* Override any GCC internal prototype to avoid an error.
3638
   Use char because int might match the return type of a GCC
3639
   builtin and then its argument prototype would still apply.  */
3640
#ifdef __cplusplus
3641
extern "C"
3642
#endif
3643
char inet_ntoa ();
3644
int
3645
main ()
3646
{
3647
return inet_ntoa ();
3648
  ;
3649
  return 0;
3650
}
3651
_ACEOF
3652
if ac_fn_c_try_link "$LINENO"; then :
3653
  ac_cv_lib_nsl_inet_ntoa=yes
3654
else
3655
  ac_cv_lib_nsl_inet_ntoa=no
3656
fi
3657
rm -f core conftest.err conftest.$ac_objext \
3658
    conftest$ac_exeext conftest.$ac_ext
3659
LIBS=$ac_check_lib_save_LIBS
3660
fi
3661
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_ntoa" >&5
3662
$as_echo "$ac_cv_lib_nsl_inet_ntoa" >&6; }
3663
if test "x$ac_cv_lib_nsl_inet_ntoa" = xyes; then :
3664
  cat >>confdefs.h <<_ACEOF
3665
#define HAVE_LIBNSL 1
3666
_ACEOF
3667
3668
  LIBS="-lnsl $LIBS"
3669
3670
else
3671
  as_fn_error 1 "inet_ntoa not found" "$LINENO" 5
3672
fi
3673
3674
fi
3675
done
3676
3677
for ac_func in inet_ntop
3678
do :
3679
  ac_fn_c_check_func "$LINENO" "inet_ntop" "ac_cv_func_inet_ntop"
3680
if test "x$ac_cv_func_inet_ntop" = xyes; then :
3681
  cat >>confdefs.h <<_ACEOF
3682
#define HAVE_INET_NTOP 1
3683
_ACEOF
3684
3685
else
3686
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop in -lnsl" >&5
3687
$as_echo_n "checking for inet_ntop in -lnsl... " >&6; }
3688
if ${ac_cv_lib_nsl_inet_ntop+:} false; then :
3689
  $as_echo_n "(cached) " >&6
3690
else
3691
  ac_check_lib_save_LIBS=$LIBS
3692
LIBS="-lnsl  $LIBS"
3693
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3694
/* end confdefs.h.  */
3695
3696
/* Override any GCC internal prototype to avoid an error.
3697
   Use char because int might match the return type of a GCC
3698
   builtin and then its argument prototype would still apply.  */
3699
#ifdef __cplusplus
3700
extern "C"
3701
#endif
3702
char inet_ntop ();
3703
int
3704
main ()
3705
{
3706
return inet_ntop ();
3707
  ;
3708
  return 0;
3709
}
3710
_ACEOF
3711
if ac_fn_c_try_link "$LINENO"; then :
3712
  ac_cv_lib_nsl_inet_ntop=yes
3713
else
3714
  ac_cv_lib_nsl_inet_ntop=no
3715
fi
3716
rm -f core conftest.err conftest.$ac_objext \
3717
    conftest$ac_exeext conftest.$ac_ext
3718
LIBS=$ac_check_lib_save_LIBS
3719
fi
3720
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_ntop" >&5
3721
$as_echo "$ac_cv_lib_nsl_inet_ntop" >&6; }
3722
if test "x$ac_cv_lib_nsl_inet_ntop" = xyes; then :
3723
  cat >>confdefs.h <<_ACEOF
3724
#define HAVE_LIBNSL 1
3725
_ACEOF
3726
3727
  LIBS="-lnsl $LIBS"
3728
3729
else
3730
  as_fn_error 1 "inet_ntop not found" "$LINENO" 5
3731
fi
3732
3733
fi
3734
done
3735
3736
3737
case `uname` in
3738
	Darwin*) LDFLAGS="$LDFLAGS -dynamiclib" ;;
3739
	*)       LDFLAGS="$LDFLAGS -shared" ;;
3740
esac
3741
3742
3743
3744
3745
ac_config_files="$ac_config_files bgpdump.spec Makefile"
3746
3747
cat >confcache <<\_ACEOF
3748
# This file is a shell script that caches the results of configure
3749
# tests run on this system so they can be shared between configure
3750
# scripts and configure runs, see configure's option --config-cache.
3751
# It is not useful on other systems.  If it contains results you don't
3752
# want to keep, you may remove or edit it.
3753
#
3754
# config.status only pays attention to the cache file if you give it
3755
# the --recheck option to rerun configure.
3756
#
3757
# `ac_cv_env_foo' variables (set or unset) will be overridden when
3758
# loading this file, other *unset* `ac_cv_foo' will be assigned the
3759
# following values.
3760
3761
_ACEOF
3762
3763
# The following way of writing the cache mishandles newlines in values,
3764
# but we know of no workaround that is simple, portable, and efficient.
3765
# So, we kill variables containing newlines.
3766
# Ultrix sh set writes to stderr and can't be redirected directly,
3767
# and sets the high bit in the cache file unless we assign to the vars.
3768
(
3769
  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
3770
    eval ac_val=\$$ac_var
3771
    case $ac_val in #(
3772
    *${as_nl}*)
3773
      case $ac_var in #(
3774
      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
3775
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
3776
      esac
3777
      case $ac_var in #(
3778
      _ | IFS | as_nl) ;; #(
3779
      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
3780
      *) { eval $ac_var=; unset $ac_var;} ;;
3781
      esac ;;
3782
    esac
3783
  done
3784
3785
  (set) 2>&1 |
3786
    case $as_nl`(ac_space=' '; set) 2>&1` in #(
3787
    *${as_nl}ac_space=\ *)
3788
      # `set' does not quote correctly, so add quotes: double-quote
3789
      # substitution turns \\\\ into \\, and sed turns \\ into \.
3790
      sed -n \
3791
	"s/'/'\\\\''/g;
3792
	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
3793
      ;; #(
3794
    *)
3795
      # `set' quotes correctly as required by POSIX, so do not add quotes.
3796
      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
3797
      ;;
3798
    esac |
3799
    sort
3800
) |
3801
  sed '
3802
     /^ac_cv_env_/b end
3803
     t clear
3804
     :clear
3805
     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
3806
     t end
3807
     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
3808
     :end' >>confcache
3809
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
3810
  if test -w "$cache_file"; then
3811
    if test "x$cache_file" != "x/dev/null"; then
3812
      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
3813
$as_echo "$as_me: updating cache $cache_file" >&6;}
3814
      if test ! -f "$cache_file" || test -h "$cache_file"; then
3815
	cat confcache >"$cache_file"
3816
      else
3817
        case $cache_file in #(
3818
        */* | ?:*)
3819
	  mv -f confcache "$cache_file"$$ &&
3820
	  mv -f "$cache_file"$$ "$cache_file" ;; #(
3821
        *)
3822
	  mv -f confcache "$cache_file" ;;
3823
	esac
3824
      fi
3825
    fi
3826
  else
3827
    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
3828
$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
3829
  fi
3830
fi
3831
rm -f confcache
3832
3833
test "x$prefix" = xNONE && prefix=$ac_default_prefix
3834
# Let make expand exec_prefix.
3835
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
3836
3837
DEFS=-DHAVE_CONFIG_H
3838
3839
ac_libobjs=
3840
ac_ltlibobjs=
3841
U=
3842
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
3843
  # 1. Remove the extension, and $U if already installed.
3844
  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
3845
  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
3846
  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
3847
  #    will be set to the directory where LIBOBJS objects are built.
3848
  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
3849
  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
3850
done
3851
LIBOBJS=$ac_libobjs
3852
3853
LTLIBOBJS=$ac_ltlibobjs
3854
3855
3856
3857
: "${CONFIG_STATUS=./config.status}"
3858
ac_write_fail=0
3859
ac_clean_files_save=$ac_clean_files
3860
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
3861
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
3862
$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
3863
as_write_fail=0
3864
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
3865
#! $SHELL
3866
# Generated by $as_me.
3867
# Run this file to recreate the current configuration.
3868
# Compiler output produced by configure, useful for debugging
3869
# configure, is in config.log if it exists.
3870
3871
debug=false
3872
ac_cs_recheck=false
3873
ac_cs_silent=false
3874
3875
SHELL=\${CONFIG_SHELL-$SHELL}
3876
export SHELL
3877
_ASEOF
3878
cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
3879
## -------------------- ##
3880
## M4sh Initialization. ##
3881
## -------------------- ##
3882
3883
# Be more Bourne compatible
3884
DUALCASE=1; export DUALCASE # for MKS sh
3885
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
3886
  emulate sh
3887
  NULLCMD=:
3888
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
3889
  # is contrary to our usage.  Disable this feature.
3890
  alias -g '${1+"$@"}'='"$@"'
3891
  setopt NO_GLOB_SUBST
3892
else
3893
  case `(set -o) 2>/dev/null` in #(
3894
  *posix*) :
3895
    set -o posix ;; #(
3896
  *) :
3897
     ;;
3898
esac
3899
fi
3900
3901
3902
as_nl='
3903
'
3904
export as_nl
3905
# Printing a long string crashes Solaris 7 /usr/bin/printf.
3906
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
3907
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
3908
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
3909
# Prefer a ksh shell builtin over an external printf program on Solaris,
3910
# but without wasting forks for bash or zsh.
3911
if test -z "$BASH_VERSION$ZSH_VERSION" \
3912
    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
3913
  as_echo='print -r --'
3914
  as_echo_n='print -rn --'
3915
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
3916
  as_echo='printf %s\n'
3917
  as_echo_n='printf %s'
3918
else
3919
  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
3920
    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
3921
    as_echo_n='/usr/ucb/echo -n'
3922
  else
3923
    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
3924
    as_echo_n_body='eval
3925
      arg=$1;
3926
      case $arg in #(
3927
      *"$as_nl"*)
3928
	expr "X$arg" : "X\\(.*\\)$as_nl";
3929
	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
3930
      esac;
3931
      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
3932
    '
3933
    export as_echo_n_body
3934
    as_echo_n='sh -c $as_echo_n_body as_echo'
3935
  fi
3936
  export as_echo_body
3937
  as_echo='sh -c $as_echo_body as_echo'
3938
fi
3939
3940
# The user is always right.
3941
if test "${PATH_SEPARATOR+set}" != set; then
3942
  PATH_SEPARATOR=:
3943
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
3944
    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
3945
      PATH_SEPARATOR=';'
3946
  }
3947
fi
3948
3949
3950
# IFS
3951
# We need space, tab and new line, in precisely that order.  Quoting is
3952
# there to prevent editors from complaining about space-tab.
3953
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
3954
# splitting by setting IFS to empty value.)
3955
IFS=" ""	$as_nl"
3956
3957
# Find who we are.  Look in the path if we contain no directory separator.
3958
as_myself=
3959
case $0 in #((
3960
  *[\\/]* ) as_myself=$0 ;;
3961
  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3962
for as_dir in $PATH
3963
do
3964
  IFS=$as_save_IFS
3965
  test -z "$as_dir" && as_dir=.
3966
    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
3967
  done
3968
IFS=$as_save_IFS
3969
3970
     ;;
3971
esac
3972
# We did not find ourselves, most probably we were run as `sh COMMAND'
3973
# in which case we are not to be found in the path.
3974
if test "x$as_myself" = x; then
3975
  as_myself=$0
3976
fi
3977
if test ! -f "$as_myself"; then
3978
  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
3979
  exit 1
3980
fi
3981
3982
# Unset variables that we do not need and which cause bugs (e.g. in
3983
# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
3984
# suppresses any "Segmentation fault" message there.  '((' could
3985
# trigger a bug in pdksh 5.2.14.
3986
for as_var in BASH_ENV ENV MAIL MAILPATH
3987
do eval test x\${$as_var+set} = xset \
3988
  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
3989
done
3990
PS1='$ '
3991
PS2='> '
3992
PS4='+ '
3993
3994
# NLS nuisances.
3995
LC_ALL=C
3996
export LC_ALL
3997
LANGUAGE=C
3998
export LANGUAGE
3999
4000
# CDPATH.
4001
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4002
4003
4004
# as_fn_error STATUS ERROR [LINENO LOG_FD]
4005
# ----------------------------------------
4006
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
4007
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
4008
# script with STATUS, using 1 if that was 0.
4009
as_fn_error ()
4010
{
4011
  as_status=$1; test $as_status -eq 0 && as_status=1
4012
  if test "$4"; then
4013
    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
4014
    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
4015
  fi
4016
  $as_echo "$as_me: error: $2" >&2
4017
  as_fn_exit $as_status
4018
} # as_fn_error
4019
4020
4021
# as_fn_set_status STATUS
4022
# -----------------------
4023
# Set $? to STATUS, without forking.
4024
as_fn_set_status ()
4025
{
4026
  return $1
4027
} # as_fn_set_status
4028
4029
# as_fn_exit STATUS
4030
# -----------------
4031
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
4032
as_fn_exit ()
4033
{
4034
  set +e
4035
  as_fn_set_status $1
4036
  exit $1
4037
} # as_fn_exit
4038
4039
# as_fn_unset VAR
4040
# ---------------
4041
# Portably unset VAR.
4042
as_fn_unset ()
4043
{
4044
  { eval $1=; unset $1;}
4045
}
4046
as_unset=as_fn_unset
4047
# as_fn_append VAR VALUE
4048
# ----------------------
4049
# Append the text in VALUE to the end of the definition contained in VAR. Take
4050
# advantage of any shell optimizations that allow amortized linear growth over
4051
# repeated appends, instead of the typical quadratic growth present in naive
4052
# implementations.
4053
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
4054
  eval 'as_fn_append ()
4055
  {
4056
    eval $1+=\$2
4057
  }'
4058
else
4059
  as_fn_append ()
4060
  {
4061
    eval $1=\$$1\$2
4062
  }
4063
fi # as_fn_append
4064
4065
# as_fn_arith ARG...
4066
# ------------------
4067
# Perform arithmetic evaluation on the ARGs, and store the result in the
4068
# global $as_val. Take advantage of shells that can avoid forks. The arguments
4069
# must be portable across $(()) and expr.
4070
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
4071
  eval 'as_fn_arith ()
4072
  {
4073
    as_val=$(( $* ))
4074
  }'
4075
else
4076
  as_fn_arith ()
4077
  {
4078
    as_val=`expr "$@" || test $? -eq 1`
4079
  }
4080
fi # as_fn_arith
4081
4082
4083
if expr a : '\(a\)' >/dev/null 2>&1 &&
4084
   test "X`expr 00001 : '.*\(...\)'`" = X001; then
4085
  as_expr=expr
4086
else
4087
  as_expr=false
4088
fi
4089
4090
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
4091
  as_basename=basename
4092
else
4093
  as_basename=false
4094
fi
4095
4096
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
4097
  as_dirname=dirname
4098
else
4099
  as_dirname=false
4100
fi
4101
4102
as_me=`$as_basename -- "$0" ||
4103
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
4104
	 X"$0" : 'X\(//\)$' \| \
4105
	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
4106
$as_echo X/"$0" |
4107
    sed '/^.*\/\([^/][^/]*\)\/*$/{
4108
	    s//\1/
4109
	    q
4110
	  }
4111
	  /^X\/\(\/\/\)$/{
4112
	    s//\1/
4113
	    q
4114
	  }
4115
	  /^X\/\(\/\).*/{
4116
	    s//\1/
4117
	    q
4118
	  }
4119
	  s/.*/./; q'`
4120
4121
# Avoid depending upon Character Ranges.
4122
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
4123
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
4124
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
4125
as_cr_digits='0123456789'
4126
as_cr_alnum=$as_cr_Letters$as_cr_digits
4127
4128
ECHO_C= ECHO_N= ECHO_T=
4129
case `echo -n x` in #(((((
4130
-n*)
4131
  case `echo 'xy\c'` in
4132
  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
4133
  xy)  ECHO_C='\c';;
4134
  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
4135
       ECHO_T='	';;
4136
  esac;;
4137
*)
4138
  ECHO_N='-n';;
4139
esac
4140
4141
rm -f conf$$ conf$$.exe conf$$.file
4142
if test -d conf$$.dir; then
4143
  rm -f conf$$.dir/conf$$.file
4144
else
4145
  rm -f conf$$.dir
4146
  mkdir conf$$.dir 2>/dev/null
4147
fi
4148
if (echo >conf$$.file) 2>/dev/null; then
4149
  if ln -s conf$$.file conf$$ 2>/dev/null; then
4150
    as_ln_s='ln -s'
4151
    # ... but there are two gotchas:
4152
    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
4153
    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
4154
    # In both cases, we have to default to `cp -pR'.
4155
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
4156
      as_ln_s='cp -pR'
4157
  elif ln conf$$.file conf$$ 2>/dev/null; then
4158
    as_ln_s=ln
4159
  else
4160
    as_ln_s='cp -pR'
4161
  fi
4162
else
4163
  as_ln_s='cp -pR'
4164
fi
4165
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
4166
rmdir conf$$.dir 2>/dev/null
4167
4168
4169
# as_fn_mkdir_p
4170
# -------------
4171
# Create "$as_dir" as a directory, including parents if necessary.
4172
as_fn_mkdir_p ()
4173
{
4174
4175
  case $as_dir in #(
4176
  -*) as_dir=./$as_dir;;
4177
  esac
4178
  test -d "$as_dir" || eval $as_mkdir_p || {
4179
    as_dirs=
4180
    while :; do
4181
      case $as_dir in #(
4182
      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
4183
      *) as_qdir=$as_dir;;
4184
      esac
4185
      as_dirs="'$as_qdir' $as_dirs"
4186
      as_dir=`$as_dirname -- "$as_dir" ||
4187
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
4188
	 X"$as_dir" : 'X\(//\)[^/]' \| \
4189
	 X"$as_dir" : 'X\(//\)$' \| \
4190
	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
4191
$as_echo X"$as_dir" |
4192
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
4193
	    s//\1/
4194
	    q
4195
	  }
4196
	  /^X\(\/\/\)[^/].*/{
4197
	    s//\1/
4198
	    q
4199
	  }
4200
	  /^X\(\/\/\)$/{
4201
	    s//\1/
4202
	    q
4203
	  }
4204
	  /^X\(\/\).*/{
4205
	    s//\1/
4206
	    q
4207
	  }
4208
	  s/.*/./; q'`
4209
      test -d "$as_dir" && break
4210
    done
4211
    test -z "$as_dirs" || eval "mkdir $as_dirs"
4212
  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
4213
4214
4215
} # as_fn_mkdir_p
4216
if mkdir -p . 2>/dev/null; then
4217
  as_mkdir_p='mkdir -p "$as_dir"'
4218
else
4219
  test -d ./-p && rmdir ./-p
4220
  as_mkdir_p=false
4221
fi
4222
4223
4224
# as_fn_executable_p FILE
4225
# -----------------------
4226
# Test if FILE is an executable regular file.
4227
as_fn_executable_p ()
4228
{
4229
  test -f "$1" && test -x "$1"
4230
} # as_fn_executable_p
4231
as_test_x='test -x'
4232
as_executable_p=as_fn_executable_p
4233
4234
# Sed expression to map a string onto a valid CPP name.
4235
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
4236
4237
# Sed expression to map a string onto a valid variable name.
4238
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
4239
4240
4241
exec 6>&1
4242
## ----------------------------------- ##
4243
## Main body of $CONFIG_STATUS script. ##
4244
## ----------------------------------- ##
4245
_ASEOF
4246
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
4247
4248
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4249
# Save the log message, to keep $0 and so on meaningful, and to
4250
# report actual input values of CONFIG_FILES etc. instead of their
4251
# values after options handling.
4252
ac_log="
4253
This file was extended by libbgpdump $as_me 1.4.99.15, which was
4254
generated by GNU Autoconf 2.69.  Invocation command line was
4255
4256
  CONFIG_FILES    = $CONFIG_FILES
4257
  CONFIG_HEADERS  = $CONFIG_HEADERS
4258
  CONFIG_LINKS    = $CONFIG_LINKS
4259
  CONFIG_COMMANDS = $CONFIG_COMMANDS
4260
  $ $0 $@
4261
4262
on `(hostname || uname -n) 2>/dev/null | sed 1q`
4263
"
4264
4265
_ACEOF
4266
4267
case $ac_config_files in *"
4268
"*) set x $ac_config_files; shift; ac_config_files=$*;;
4269
esac
4270
4271
case $ac_config_headers in *"
4272
"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
4273
esac
4274
4275
4276
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4277
# Files that config.status was made for.
4278
config_files="$ac_config_files"
4279
config_headers="$ac_config_headers"
4280
4281
_ACEOF
4282
4283
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4284
ac_cs_usage="\
4285
\`$as_me' instantiates files and other configuration actions
4286
from templates according to the current configuration.  Unless the files
4287
and actions are specified as TAGs, all are instantiated by default.
4288
4289
Usage: $0 [OPTION]... [TAG]...
4290
4291
  -h, --help       print this help, then exit
4292
  -V, --version    print version number and configuration settings, then exit
4293
      --config     print configuration, then exit
4294
  -q, --quiet, --silent
4295
                   do not print progress messages
4296
  -d, --debug      don't remove temporary files
4297
      --recheck    update $as_me by reconfiguring in the same conditions
4298
      --file=FILE[:TEMPLATE]
4299
                   instantiate the configuration file FILE
4300
      --header=FILE[:TEMPLATE]
4301
                   instantiate the configuration header FILE
4302
4303
Configuration files:
4304
$config_files
4305
4306
Configuration headers:
4307
$config_headers
4308
4309
Report bugs to <ris@ripe.net>."
4310
4311
_ACEOF
4312
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4313
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
4314
ac_cs_version="\\
4315
libbgpdump config.status 1.4.99.15
4316
configured by $0, generated by GNU Autoconf 2.69,
4317
  with options \\"\$ac_cs_config\\"
4318
4319
Copyright (C) 2012 Free Software Foundation, Inc.
4320
This config.status script is free software; the Free Software Foundation
4321
gives unlimited permission to copy, distribute and modify it."
4322
4323
ac_pwd='$ac_pwd'
4324
srcdir='$srcdir'
4325
test -n "\$AWK" || AWK=awk
4326
_ACEOF
4327
4328
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4329
# The default lists apply if the user does not specify any file.
4330
ac_need_defaults=:
4331
while test $# != 0
4332
do
4333
  case $1 in
4334
  --*=?*)
4335
    ac_option=`expr "X$1" : 'X\([^=]*\)='`
4336
    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
4337
    ac_shift=:
4338
    ;;
4339
  --*=)
4340
    ac_option=`expr "X$1" : 'X\([^=]*\)='`
4341
    ac_optarg=
4342
    ac_shift=:
4343
    ;;
4344
  *)
4345
    ac_option=$1
4346
    ac_optarg=$2
4347
    ac_shift=shift
4348
    ;;
4349
  esac
4350
4351
  case $ac_option in
4352
  # Handling of the options.
4353
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
4354
    ac_cs_recheck=: ;;
4355
  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
4356
    $as_echo "$ac_cs_version"; exit ;;
4357
  --config | --confi | --conf | --con | --co | --c )
4358
    $as_echo "$ac_cs_config"; exit ;;
4359
  --debug | --debu | --deb | --de | --d | -d )
4360
    debug=: ;;
4361
  --file | --fil | --fi | --f )
4362
    $ac_shift
4363
    case $ac_optarg in
4364
    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
4365
    '') as_fn_error $? "missing file argument" ;;
4366
    esac
4367
    as_fn_append CONFIG_FILES " '$ac_optarg'"
4368
    ac_need_defaults=false;;
4369
  --header | --heade | --head | --hea )
4370
    $ac_shift
4371
    case $ac_optarg in
4372
    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
4373
    esac
4374
    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
4375
    ac_need_defaults=false;;
4376
  --he | --h)
4377
    # Conflict between --help and --header
4378
    as_fn_error $? "ambiguous option: \`$1'
4379
Try \`$0 --help' for more information.";;
4380
  --help | --hel | -h )
4381
    $as_echo "$ac_cs_usage"; exit ;;
4382
  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
4383
  | -silent | --silent | --silen | --sile | --sil | --si | --s)
4384
    ac_cs_silent=: ;;
4385
4386
  # This is an error.
4387
  -*) as_fn_error $? "unrecognized option: \`$1'
4388
Try \`$0 --help' for more information." ;;
4389
4390
  *) as_fn_append ac_config_targets " $1"
4391
     ac_need_defaults=false ;;
4392
4393
  esac
4394
  shift
4395
done
4396
4397
ac_configure_extra_args=
4398
4399
if $ac_cs_silent; then
4400
  exec 6>/dev/null
4401
  ac_configure_extra_args="$ac_configure_extra_args --silent"
4402
fi
4403
4404
_ACEOF
4405
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4406
if \$ac_cs_recheck; then
4407
  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
4408
  shift
4409
  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
4410
  CONFIG_SHELL='$SHELL'
4411
  export CONFIG_SHELL
4412
  exec "\$@"
4413
fi
4414
4415
_ACEOF
4416
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4417
exec 5>>config.log
4418
{
4419
  echo
4420
  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
4421
## Running $as_me. ##
4422
_ASBOX
4423
  $as_echo "$ac_log"
4424
} >&5
4425
4426
_ACEOF
4427
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4428
_ACEOF
4429
4430
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4431
4432
# Handling of arguments.
4433
for ac_config_target in $ac_config_targets
4434
do
4435
  case $ac_config_target in
4436
    "bgpdump-config.h") CONFIG_HEADERS="$CONFIG_HEADERS bgpdump-config.h" ;;
4437
    "bgpdump.spec") CONFIG_FILES="$CONFIG_FILES bgpdump.spec" ;;
4438
    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
4439
4440
  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
4441
  esac
4442
done
4443
4444
4445
# If the user did not use the arguments to specify the items to instantiate,
4446
# then the envvar interface is used.  Set only those that are not.
4447
# We use the long form for the default assignment because of an extremely
4448
# bizarre bug on SunOS 4.1.3.
4449
if $ac_need_defaults; then
4450
  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
4451
  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
4452
fi
4453
4454
# Have a temporary directory for convenience.  Make it in the build tree
4455
# simply because there is no reason against having it here, and in addition,
4456
# creating and moving files from /tmp can sometimes cause problems.
4457
# Hook for its removal unless debugging.
4458
# Note that there is a small window in which the directory will not be cleaned:
4459
# after its creation but before its name has been assigned to `$tmp'.
4460
$debug ||
4461
{
4462
  tmp= ac_tmp=
4463
  trap 'exit_status=$?
4464
  : "${ac_tmp:=$tmp}"
4465
  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
4466
' 0
4467
  trap 'as_fn_exit 1' 1 2 13 15
4468
}
4469
# Create a (secure) tmp directory for tmp files.
4470
4471
{
4472
  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
4473
  test -d "$tmp"
4474
}  ||
4475
{
4476
  tmp=./conf$$-$RANDOM
4477
  (umask 077 && mkdir "$tmp")
4478
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
4479
ac_tmp=$tmp
4480
4481
# Set up the scripts for CONFIG_FILES section.
4482
# No need to generate them if there are no CONFIG_FILES.
4483
# This happens for instance with `./config.status config.h'.
4484
if test -n "$CONFIG_FILES"; then
4485
4486
4487
ac_cr=`echo X | tr X '\015'`
4488
# On cygwin, bash can eat \r inside `` if the user requested igncr.
4489
# But we know of no other shell where ac_cr would be empty at this
4490
# point, so we can use a bashism as a fallback.
4491
if test "x$ac_cr" = x; then
4492
  eval ac_cr=\$\'\\r\'
4493
fi
4494
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
4495
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
4496
  ac_cs_awk_cr='\\r'
4497
else
4498
  ac_cs_awk_cr=$ac_cr
4499
fi
4500
4501
echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
4502
_ACEOF
4503
4504
4505
{
4506
  echo "cat >conf$$subs.awk <<_ACEOF" &&
4507
  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
4508
  echo "_ACEOF"
4509
} >conf$$subs.sh ||
4510
  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
4511
ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
4512
ac_delim='%!_!# '
4513
for ac_last_try in false false false false false :; do
4514
  . ./conf$$subs.sh ||
4515
    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
4516
4517
  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
4518
  if test $ac_delim_n = $ac_delim_num; then
4519
    break
4520
  elif $ac_last_try; then
4521
    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
4522
  else
4523
    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
4524
  fi
4525
done
4526
rm -f conf$$subs.sh
4527
4528
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4529
cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
4530
_ACEOF
4531
sed -n '
4532
h
4533
s/^/S["/; s/!.*/"]=/
4534
p
4535
g
4536
s/^[^!]*!//
4537
:repl
4538
t repl
4539
s/'"$ac_delim"'$//
4540
t delim
4541
:nl
4542
h
4543
s/\(.\{148\}\)..*/\1/
4544
t more1
4545
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
4546
p
4547
n
4548
b repl
4549
:more1
4550
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
4551
p
4552
g
4553
s/.\{148\}//
4554
t nl
4555
:delim
4556
h
4557
s/\(.\{148\}\)..*/\1/
4558
t more2
4559
s/["\\]/\\&/g; s/^/"/; s/$/"/
4560
p
4561
b
4562
:more2
4563
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
4564
p
4565
g
4566
s/.\{148\}//
4567
t delim
4568
' <conf$$subs.awk | sed '
4569
/^[^""]/{
4570
  N
4571
  s/\n//
4572
}
4573
' >>$CONFIG_STATUS || ac_write_fail=1
4574
rm -f conf$$subs.awk
4575
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4576
_ACAWK
4577
cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
4578
  for (key in S) S_is_set[key] = 1
4579
  FS = ""
4580
4581
}
4582
{
4583
  line = $ 0
4584
  nfields = split(line, field, "@")
4585
  substed = 0
4586
  len = length(field[1])
4587
  for (i = 2; i < nfields; i++) {
4588
    key = field[i]
4589
    keylen = length(key)
4590
    if (S_is_set[key]) {
4591
      value = S[key]
4592
      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
4593
      len += length(value) + length(field[++i])
4594
      substed = 1
4595
    } else
4596
      len += 1 + keylen
4597
  }
4598
4599
  print line
4600
}
4601
4602
_ACAWK
4603
_ACEOF
4604
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4605
if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
4606
  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
4607
else
4608
  cat
4609
fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
4610
  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
4611
_ACEOF
4612
4613
# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
4614
# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
4615
# trailing colons and then remove the whole line if VPATH becomes empty
4616
# (actually we leave an empty line to preserve line numbers).
4617
if test "x$srcdir" = x.; then
4618
  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
4619
h
4620
s///
4621
s/^/:/
4622
s/[	 ]*$/:/
4623
s/:\$(srcdir):/:/g
4624
s/:\${srcdir}:/:/g
4625
s/:@srcdir@:/:/g
4626
s/^:*//
4627
s/:*$//
4628
x
4629
s/\(=[	 ]*\).*/\1/
4630
G
4631
s/\n//
4632
s/^[^=]*=[	 ]*$//
4633
}'
4634
fi
4635
4636
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4637
fi # test -n "$CONFIG_FILES"
4638
4639
# Set up the scripts for CONFIG_HEADERS section.
4640
# No need to generate them if there are no CONFIG_HEADERS.
4641
# This happens for instance with `./config.status Makefile'.
4642
if test -n "$CONFIG_HEADERS"; then
4643
cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
4644
BEGIN {
4645
_ACEOF
4646
4647
# Transform confdefs.h into an awk script `defines.awk', embedded as
4648
# here-document in config.status, that substitutes the proper values into
4649
# config.h.in to produce config.h.
4650
4651
# Create a delimiter string that does not exist in confdefs.h, to ease
4652
# handling of long lines.
4653
ac_delim='%!_!# '
4654
for ac_last_try in false false :; do
4655
  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
4656
  if test -z "$ac_tt"; then
4657
    break
4658
  elif $ac_last_try; then
4659
    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
4660
  else
4661
    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
4662
  fi
4663
done
4664
4665
# For the awk script, D is an array of macro values keyed by name,
4666
# likewise P contains macro parameters if any.  Preserve backslash
4667
# newline sequences.
4668
4669
ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
4670
sed -n '
4671
s/.\{148\}/&'"$ac_delim"'/g
4672
t rset
4673
:rset
4674
s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
4675
t def
4676
d
4677
:def
4678
s/\\$//
4679
t bsnl
4680
s/["\\]/\\&/g
4681
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
4682
D["\1"]=" \3"/p
4683
s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
4684
d
4685
:bsnl
4686
s/["\\]/\\&/g
4687
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
4688
D["\1"]=" \3\\\\\\n"\\/p
4689
t cont
4690
s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
4691
t cont
4692
d
4693
:cont
4694
n
4695
s/.\{148\}/&'"$ac_delim"'/g
4696
t clear
4697
:clear
4698
s/\\$//
4699
t bsnlc
4700
s/["\\]/\\&/g; s/^/"/; s/$/"/p
4701
d
4702
:bsnlc
4703
s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
4704
b cont
4705
' <confdefs.h | sed '
4706
s/'"$ac_delim"'/"\\\
4707
"/g' >>$CONFIG_STATUS || ac_write_fail=1
4708
4709
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4710
  for (key in D) D_is_set[key] = 1
4711
  FS = ""
4712
}
4713
/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
4714
  line = \$ 0
4715
  split(line, arg, " ")
4716
  if (arg[1] == "#") {
4717
    defundef = arg[2]
4718
    mac1 = arg[3]
4719
  } else {
4720
    defundef = substr(arg[1], 2)
4721
    mac1 = arg[2]
4722
  }
4723
  split(mac1, mac2, "(") #)
4724
  macro = mac2[1]
4725
  prefix = substr(line, 1, index(line, defundef) - 1)
4726
  if (D_is_set[macro]) {
4727
    # Preserve the white space surrounding the "#".
4728
    print prefix "define", macro P[macro] D[macro]
4729
    next
4730
  } else {
4731
    # Replace #undef with comments.  This is necessary, for example,
4732
    # in the case of _POSIX_SOURCE, which is predefined and required
4733
    # on some systems where configure will not decide to define it.
4734
    if (defundef == "undef") {
4735
      print "/*", prefix defundef, macro, "*/"
4736
      next
4737
    }
4738
  }
4739
}
4740
{ print }
4741
_ACAWK
4742
_ACEOF
4743
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4744
  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
4745
fi # test -n "$CONFIG_HEADERS"
4746
4747
4748
eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    "
4749
shift
4750
for ac_tag
4751
do
4752
  case $ac_tag in
4753
  :[FHLC]) ac_mode=$ac_tag; continue;;
4754
  esac
4755
  case $ac_mode$ac_tag in
4756
  :[FHL]*:*);;
4757
  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
4758
  :[FH]-) ac_tag=-:-;;
4759
  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
4760
  esac
4761
  ac_save_IFS=$IFS
4762
  IFS=:
4763
  set x $ac_tag
4764
  IFS=$ac_save_IFS
4765
  shift
4766
  ac_file=$1
4767
  shift
4768
4769
  case $ac_mode in
4770
  :L) ac_source=$1;;
4771
  :[FH])
4772
    ac_file_inputs=
4773
    for ac_f
4774
    do
4775
      case $ac_f in
4776
      -) ac_f="$ac_tmp/stdin";;
4777
      *) # Look for the file first in the build tree, then in the source tree
4778
	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
4779
	 # because $ac_f cannot contain `:'.
4780
	 test -f "$ac_f" ||
4781
	   case $ac_f in
4782
	   [\\/$]*) false;;
4783
	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
4784
	   esac ||
4785
	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
4786
      esac
4787
      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
4788
      as_fn_append ac_file_inputs " '$ac_f'"
4789
    done
4790
4791
    # Let's still pretend it is `configure' which instantiates (i.e., don't
4792
    # use $as_me), people would be surprised to read:
4793
    #    /* config.h.  Generated by config.status.  */
4794
    configure_input='Generated from '`
4795
	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
4796
	`' by configure.'
4797
    if test x"$ac_file" != x-; then
4798
      configure_input="$ac_file.  $configure_input"
4799
      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
4800
$as_echo "$as_me: creating $ac_file" >&6;}
4801
    fi
4802
    # Neutralize special characters interpreted by sed in replacement strings.
4803
    case $configure_input in #(
4804
    *\&* | *\|* | *\\* )
4805
       ac_sed_conf_input=`$as_echo "$configure_input" |
4806
       sed 's/[\\\\&|]/\\\\&/g'`;; #(
4807
    *) ac_sed_conf_input=$configure_input;;
4808
    esac
4809
4810
    case $ac_tag in
4811
    *:-:* | *:-) cat >"$ac_tmp/stdin" \
4812
      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
4813
    esac
4814
    ;;
4815
  esac
4816
4817
  ac_dir=`$as_dirname -- "$ac_file" ||
4818
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
4819
	 X"$ac_file" : 'X\(//\)[^/]' \| \
4820
	 X"$ac_file" : 'X\(//\)$' \| \
4821
	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
4822
$as_echo X"$ac_file" |
4823
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
4824
	    s//\1/
4825
	    q
4826
	  }
4827
	  /^X\(\/\/\)[^/].*/{
4828
	    s//\1/
4829
	    q
4830
	  }
4831
	  /^X\(\/\/\)$/{
4832
	    s//\1/
4833
	    q
4834
	  }
4835
	  /^X\(\/\).*/{
4836
	    s//\1/
4837
	    q
4838
	  }
4839
	  s/.*/./; q'`
4840
  as_dir="$ac_dir"; as_fn_mkdir_p
4841
  ac_builddir=.
4842
4843
case "$ac_dir" in
4844
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
4845
*)
4846
  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
4847
  # A ".." for each directory in $ac_dir_suffix.
4848
  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
4849
  case $ac_top_builddir_sub in
4850
  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
4851
  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
4852
  esac ;;
4853
esac
4854
ac_abs_top_builddir=$ac_pwd
4855
ac_abs_builddir=$ac_pwd$ac_dir_suffix
4856
# for backward compatibility:
4857
ac_top_builddir=$ac_top_build_prefix
4858
4859
case $srcdir in
4860
  .)  # We are building in place.
4861
    ac_srcdir=.
4862
    ac_top_srcdir=$ac_top_builddir_sub
4863
    ac_abs_top_srcdir=$ac_pwd ;;
4864
  [\\/]* | ?:[\\/]* )  # Absolute name.
4865
    ac_srcdir=$srcdir$ac_dir_suffix;
4866
    ac_top_srcdir=$srcdir
4867
    ac_abs_top_srcdir=$srcdir ;;
4868
  *) # Relative name.
4869
    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
4870
    ac_top_srcdir=$ac_top_build_prefix$srcdir
4871
    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
4872
esac
4873
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
4874
4875
4876
  case $ac_mode in
4877
  :F)
4878
  #
4879
  # CONFIG_FILE
4880
  #
4881
4882
_ACEOF
4883
4884
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4885
# If the template does not know about datarootdir, expand it.
4886
# FIXME: This hack should be removed a few years after 2.60.
4887
ac_datarootdir_hack=; ac_datarootdir_seen=
4888
ac_sed_dataroot='
4889
/datarootdir/ {
4890
  p
4891
  q
4892
}
4893
/@datadir@/p
4894
/@docdir@/p
4895
/@infodir@/p
4896
/@localedir@/p
4897
/@mandir@/p'
4898
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
4899
*datarootdir*) ac_datarootdir_seen=yes;;
4900
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
4901
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
4902
$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
4903
_ACEOF
4904
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4905
  ac_datarootdir_hack='
4906
  s&@datadir@&$datadir&g
4907
  s&@docdir@&$docdir&g
4908
  s&@infodir@&$infodir&g
4909
  s&@localedir@&$localedir&g
4910
  s&@mandir@&$mandir&g
4911
  s&\\\${datarootdir}&$datarootdir&g' ;;
4912
esac
4913
_ACEOF
4914
4915
# Neutralize VPATH when `$srcdir' = `.'.
4916
# Shell code in configure.ac might set extrasub.
4917
# FIXME: do we really want to maintain this feature?
4918
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
4919
ac_sed_extra="$ac_vpsub
4920
$extrasub
4921
_ACEOF
4922
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
4923
:t
4924
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
4925
s|@configure_input@|$ac_sed_conf_input|;t t
4926
s&@top_builddir@&$ac_top_builddir_sub&;t t
4927
s&@top_build_prefix@&$ac_top_build_prefix&;t t
4928
s&@srcdir@&$ac_srcdir&;t t
4929
s&@abs_srcdir@&$ac_abs_srcdir&;t t
4930
s&@top_srcdir@&$ac_top_srcdir&;t t
4931
s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
4932
s&@builddir@&$ac_builddir&;t t
4933
s&@abs_builddir@&$ac_abs_builddir&;t t
4934
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
4935
$ac_datarootdir_hack
4936
"
4937
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
4938
  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
4939
4940
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
4941
  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
4942
  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
4943
      "$ac_tmp/out"`; test -z "$ac_out"; } &&
4944
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
4945
which seems to be undefined.  Please make sure it is defined" >&5
4946
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
4947
which seems to be undefined.  Please make sure it is defined" >&2;}
4948
4949
  rm -f "$ac_tmp/stdin"
4950
  case $ac_file in
4951
  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
4952
  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
4953
  esac \
4954
  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
4955
 ;;
4956
  :H)
4957
  #
4958
  # CONFIG_HEADER
4959
  #
4960
  if test x"$ac_file" != x-; then
4961
    {
4962
      $as_echo "/* $configure_input  */" \
4963
      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
4964
    } >"$ac_tmp/config.h" \
4965
      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
4966
    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
4967
      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
4968
$as_echo "$as_me: $ac_file is unchanged" >&6;}
4969
    else
4970
      rm -f "$ac_file"
4971
      mv "$ac_tmp/config.h" "$ac_file" \
4972
	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
4973
    fi
4974
  else
4975
    $as_echo "/* $configure_input  */" \
4976
      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
4977
      || as_fn_error $? "could not create -" "$LINENO" 5
4978
  fi
4979
 ;;
4980
4981
4982
  esac
4983
4984
done # for ac_tag
4985
4986
4987
as_fn_exit 0
4988
_ACEOF
4989
ac_clean_files=$ac_clean_files_save
4990
4991
test $ac_write_fail = 0 ||
4992
  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
4993
4994
4995
# configure is writing to config.log, and then calls config.status.
4996
# config.status does its own redirection, appending to config.log.
4997
# Unfortunately, on DOS this fails, as config.log is still kept open
4998
# by configure, so config.status won't be able to write to it; its
4999
# output is simply discarded.  So we exec the FD to /dev/null,
5000
# effectively closing config.log, so it can be properly (re)opened and
5001
# appended to by config.status.  When coming back to configure, we
5002
# need to make the FD available again.
5003
if test "$no_create" != yes; then
5004
  ac_cs_success=:
5005
  ac_config_status_args=
5006
  test "$silent" = yes &&
5007
    ac_config_status_args="$ac_config_status_args --quiet"
5008
  exec 5>/dev/null
5009
  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
5010
  exec 5>>config.log
5011
  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
5012
  # would make configure fail if this is the last instruction.
5013
  $ac_cs_success || as_fn_exit 1
5014
fi
5015
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
5016
  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
5017
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
5018
fi
5019
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/configure.in (+41 lines)
Line 0 Link Here
1
dnl Process this file with autoconf to produce a configure script.
2
AC_REVISION($Revision$)
3
4
AC_INIT([libbgpdump], 1.4.99.15, [ris@ripe.net])
5
AC_CONFIG_SRCDIR([bgpdump_lib.c])
6
AC_CONFIG_HEADERS([bgpdump-config.h])
7
8
CFLAGS="-g -O3 $CFLAGS -Wall"
9
CFLAGS="$CFLAGS -Wsystem-headers -Wno-format-y2k -Wno-sign-compare -Wcast-align"
10
CFLAGS="$CFLAGS -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wswitch -Wshadow"
11
12
# Checks for programs.
13
AC_PROG_CC
14
AC_PROG_RANLIB
15
16
# Checks for header files.
17
AC_CHECK_HEADERS([arpa/inet.h netinet/in.h syslog.h])
18
AC_STRUCT_TM
19
20
# Check for u_*_t
21
AC_CHECK_TYPE(u_char_t, , AC_DEFINE(u_char_t, uchar_t, [Define if system headers do not define u_char_t]))
22
AC_CHECK_TYPE(u_int8_t, , AC_DEFINE(u_int8_t, uint8_t, [Define if system headers do not define u_int8_t]))
23
AC_CHECK_TYPE(u_int16_t, , AC_DEFINE(u_int16_t, uint16_t, [Define if system headers do not define u_int16_t]))
24
AC_CHECK_TYPE(u_int32_t, , AC_DEFINE(u_int32_t, uint32_t, [Define if system headers do not define u_int32_t]))
25
26
AC_CHECK_LIB(z, gzopen, [], AC_DEFINE(DONT_HAVE_GZ, 1, Define if libz not present))
27
AC_CHECK_LIB(bz2, BZ2_bzReadOpen, [], AC_DEFINE(DONT_HAVE_BZ2, 1, Define if libbzip2 not present))
28
29
# Check for inet_ntoa in -lnsl if not found (Solaris)
30
AC_CHECK_FUNCS(inet_ntoa, [], AC_CHECK_LIB(nsl, inet_ntoa, [], AC_MSG_ERROR([inet_ntoa not found],1)))
31
AC_CHECK_FUNCS(inet_ntop, [], AC_CHECK_LIB(nsl, inet_ntop, [], AC_MSG_ERROR([inet_ntop not found],1)))
32
33
case `uname` in
34
	Darwin*) LDFLAGS="$LDFLAGS -dynamiclib" ;;
35
	*)       LDFLAGS="$LDFLAGS -shared" ;;
36
esac
37
38
AC_SUBST(CFLAGS)
39
AC_SUBST(LIBS)
40
41
AC_OUTPUT([bgpdump.spec Makefile])
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/example.c (+433 lines)
Line 0 Link Here
1
/*
2
 Copyright (c) 2007 - 2010 RIPE NCC - All Rights Reserved
3
 
4
 Permission to use, copy, modify, and distribute this software and its
5
 documentation for any purpose and without fee is hereby granted, provided
6
 that the above copyright notice appear in all copies and that both that
7
 copyright notice and this permission notice appear in supporting
8
 documentation, and that the name of the author not be used in advertising or
9
 publicity pertaining to distribution of the software without specific,
10
 written prior permission.
11
 
12
 THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
13
 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
14
 AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
15
 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
16
 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
 
19
Parts of this code have been engineered after analiyzing GNU Zebra's
20
source code and therefore might contain declarations/code from GNU
21
Zebra, Copyright (C) 1999 Kunihiro Ishiguro. Zebra is a free routing
22
software, distributed under the GNU General Public License. A copy of
23
this license is included with libbgpdump.
24
25
Author: Dan Ardelean (dan@ripe.net)
26
*/
27
28
#include "bgpdump_lib.h"
29
#include <time.h>
30
31
#include <stdlib.h>
32
#include <netinet/in.h>
33
#include <sys/socket.h>
34
#include <arpa/inet.h>
35
36
    void process(BGPDUMP_ENTRY *entry);
37
    void show_attr(attributes_t *attr);
38
    void show_prefixes(int count,struct prefix *prefix);
39
#ifdef BGPDUMP_HAVE_IPV6
40
    void show_v6_prefixes(int count, struct prefix *prefix);
41
#endif
42
43
int main(int argc, char **argv) {  
44
    BGPDUMP *my_dump;
45
    BGPDUMP_ENTRY *my_entry=NULL;
46
47
    if(argc>1) {
48
	my_dump=bgpdump_open_dump(argv[1]);
49
    } else {
50
	my_dump=bgpdump_open_dump("dumps/updates.20020701.0032");
51
    }
52
53
    if(my_dump==NULL) {
54
	printf("Error opening dump file ...\n");
55
	exit(1);
56
    }
57
58
    do {
59
//fprintf(stdout, "Offset: %d\n", gztell(my_dump->f));
60
	my_entry=bgpdump_read_next(my_dump);
61
	if(my_entry!=NULL) {
62
	    process(my_entry);
63
	    bgpdump_free_mem(my_entry);
64
	}
65
    } while(my_dump->eof==0);
66
67
    bgpdump_close_dump(my_dump);
68
//fprintf(stderr, "%s: OK=%d, BAD=%d (%f%% OK)\n", my_dump->filename, my_dump->parsed_ok, my_dump->parsed - my_dump->parsed_ok, (float) my_dump->parsed_ok / my_dump->parsed * 100);
69
    
70
 return 0;
71
}
72
73
char *bgp_state_name[] = {
74
    "Unknown",
75
    "IDLE",
76
    "CONNECT",
77
    "ACTIVE",
78
    "OPEN_SENT",
79
    "OPEN_CONFIRM",
80
    "ESTABLISHED",
81
    NULL
82
};
83
84
char *bgp_message_types[] = {
85
    "Unknown",
86
    "Open",
87
    "Update/Withdraw",
88
    "Notification",
89
    "Keepalive"
90
};
91
92
char *notify_codes[] = {
93
    "Unknown",
94
    "Message Header Error",
95
    "OPEN Message Error",
96
    "UPDATE Message Error",
97
    "Hold Timer Expired",
98
    "Finite State Machine Error",
99
    "Cease"
100
};
101
102
char *notify_subcodes[][12] = {
103
    { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
104
    /* Message Header Error */
105
    {
106
	"None",
107
 	"Connection Not Synchronized",
108
	"Bad Message Length",
109
	"Bad Message Type",
110
	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 
111
    },
112
    /* OPEN Message Error */
113
    {
114
	"None",
115
	"Unsupported Version Number",
116
	"Bad Peer AS",
117
	"Bad BGP Identifier",
118
	"Unsupported Optional Parameter",
119
	"Authentication Failure",
120
	"Unacceptable Hold Time",
121
	NULL, NULL, NULL, NULL, NULL
122
    },
123
    /* UPDATE Message Error */
124
    {
125
	"None",
126
	"Malformed Attribute List",
127
	"Unrecognized Well-known Attribute",
128
	"Missing Well-known Attribute",
129
	"Attribute Flags Error",
130
	"Attribute Length Error",
131
	"Invalid ORIGIN Attribute",
132
	"AS Routing Loop",
133
	"Invalid NEXT_HOP Attribute",
134
	"Optional Attribute Error",
135
	"Invalid Network Field",
136
	"Malformed AS_PATH"
137
    },
138
    /* Hold Timer Expired */
139
    { "None", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
140
    /* Finite State Machine Error */
141
    { "None", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },
142
    /* Cease */
143
    { "None", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
144
145
};
146
147
void process(BGPDUMP_ENTRY *entry) {
148
    char prefix[BGPDUMP_ADDRSTRLEN], peer_ip[BGPDUMP_ADDRSTRLEN];
149
    char source_ip[BGPDUMP_ADDRSTRLEN], destination_ip[BGPDUMP_ADDRSTRLEN];
150
    struct mp_nlri *mp_announce, *mp_withdraw;
151
    int i, code, subcode;
152
	BGPDUMP_TABLE_DUMP_V2_PREFIX *e;
153
154
if(entry->type == BGPDUMP_TYPE_ZEBRA_BGP && entry->subtype == BGPDUMP_SUBTYPE_ZEBRA_BGP_MESSAGE && entry->body.zebra_message.type == BGP_MSG_KEEPALIVE) return;
155
if(entry->type == BGPDUMP_TYPE_ZEBRA_BGP && entry->subtype == BGPDUMP_SUBTYPE_ZEBRA_BGP_MESSAGE && entry->body.zebra_message.type == BGP_MSG_OPEN) return;
156
if(entry->type == BGPDUMP_TYPE_ZEBRA_BGP && entry->subtype == BGPDUMP_SUBTYPE_ZEBRA_BGP_MESSAGE && entry->body.zebra_message.type == BGP_MSG_NOTIFY) return;
157
if(entry->type == BGPDUMP_TYPE_ZEBRA_BGP && entry->subtype == BGPDUMP_SUBTYPE_ZEBRA_BGP_STATE_CHANGE && entry->length == 8) return;
158
159
    printf("TIME            : %s",asctime(gmtime(&entry->time)));
160
    printf("LENGTH          : %u\n", entry->length);
161
    switch(entry->type) {
162
	case BGPDUMP_TYPE_MRTD_TABLE_DUMP:
163
	    if(entry->subtype == AFI_IP) {
164
		strcpy(prefix, inet_ntoa(entry->body.mrtd_table_dump.prefix.v4_addr));
165
		strcpy(peer_ip, inet_ntoa(entry->body.mrtd_table_dump.peer_ip.v4_addr));
166
#ifdef BGPDUMP_HAVE_IPV6
167
	    } else if(entry->subtype == AFI_IP6) {
168
		inet_ntop(AF_INET6, &entry->body.mrtd_table_dump.prefix.v6_addr, prefix,
169
			  sizeof(prefix));
170
		inet_ntop(AF_INET6, &entry->body.mrtd_table_dump.peer_ip.v6_addr, peer_ip,
171
			  sizeof(peer_ip));
172
#endif
173
	    } else {
174
		*prefix = '\0';
175
		*peer_ip = '\0';
176
	    }
177
	    printf("TYPE            : BGP Table Dump Entry\n");
178
	    printf("    VIEW        : %d\n",entry->body.mrtd_table_dump.view);
179
	    printf("    SEQUENCE    : %d\n",entry->body.mrtd_table_dump.sequence);
180
	    printf("    PREFIX      : %s/%d\n",prefix,entry->body.mrtd_table_dump.mask);
181
	    printf("    STATUS      : %d\n",entry->body.mrtd_table_dump.status);
182
	    printf("    UPTIME      : %s",asctime(gmtime(&entry->body.mrtd_table_dump.uptime)));
183
	    printf("    PEER IP     : %s\n",peer_ip);
184
	    printf("    PEER AS     : %u\n",entry->body.mrtd_table_dump.peer_as);
185
    	show_attr(entry->attr);
186
	    break;
187
188
	case BGPDUMP_TYPE_TABLE_DUMP_V2:
189
190
		e = &entry->body.mrtd_table_dump_v2_prefix;
191
192
	    if(e->afi == AFI_IP) {
193
			strcpy(prefix, inet_ntoa(e->prefix.v4_addr));
194
#ifdef BGPDUMP_HAVE_IPV6
195
	    } else if(e->afi == AFI_IP6) {
196
			inet_ntop(AF_INET6, &e->prefix.v6_addr, prefix, INET6_ADDRSTRLEN);
197
#endif
198
	    } else {
199
			printf("Error: BGP table dump version 2 entry with unknown subtype\n");
200
			break;
201
	    }
202
203
		for(i = 0; i < e->entry_count; i++){
204
			if(i){
205
    			printf("\nTIME            : %s",asctime(gmtime(&entry->time)));
206
    			printf("LENGTH          : %u\n", entry->length);
207
			}
208
209
210
    		printf("TYPE            : BGP Table Dump version 2 Entry\n");
211
    		printf("    SEQUENCE    : %d\n",e->seq);
212
    		printf("    PREFIX      : %s/%d\n",prefix,e->prefix_length);
213
214
			if(e->entries[i].peer->afi == AFI_IP){
215
				inet_ntop(AF_INET, &e->entries[i].peer->peer_ip, peer_ip, INET6_ADDRSTRLEN);
216
#ifdef BGPDUMP_HAVE_IPV6
217
			} else if (e->entries[i].peer->afi == AFI_IP6){
218
				inet_ntop(AF_INET6, &e->entries[i].peer->peer_ip, peer_ip, INET6_ADDRSTRLEN);
219
#endif
220
			} else {
221
				sprintf(peer_ip, "N/A, unsupported AF");
222
			}
223
    		printf("    PEER IP     : %s\n",peer_ip);
224
    		printf("    PEER AS     : %u\n",e->entries[i].peer->peer_as);
225
226
   			show_attr(e->entries[i].attr);
227
		}
228
229
	    break;
230
231
	case BGPDUMP_TYPE_ZEBRA_BGP:
232
	    printf("TYPE            : Zebra BGP \n");
233
		if(entry->body.zebra_message.address_family == AFI_IP) {
234
		    strcpy(source_ip, inet_ntoa(entry->body.zebra_message.source_ip.v4_addr));
235
		    strcpy(destination_ip, inet_ntoa(entry->body.zebra_message.destination_ip.v4_addr));
236
#ifdef BGPDUMP_HAVE_IPV6
237
		} else if(entry->body.zebra_message.address_family == AFI_IP6) {
238
		    inet_ntop(AF_INET6, &entry->body.zebra_message.source_ip.v6_addr, source_ip,
239
			      sizeof(source_ip));
240
		    inet_ntop(AF_INET6, &entry->body.zebra_message.destination_ip.v6_addr, destination_ip,
241
			      sizeof(destination_ip));
242
#endif
243
		} else {
244
		    *source_ip = '\0';
245
		    *destination_ip = '\0';
246
		}
247
	    switch(entry->subtype) {
248
		case BGPDUMP_SUBTYPE_ZEBRA_BGP_MESSAGE:
249
		case BGPDUMP_SUBTYPE_ZEBRA_BGP_MESSAGE_AS4:
250
		    printf("SUBTYPE         : Zebra BGP Message");
251
		    if(entry->subtype == BGPDUMP_SUBTYPE_ZEBRA_BGP_MESSAGE_AS4) {
252
		      printf(" (32-bit ASN)\n");
253
		    } else {
254
		      printf("\n");
255
		    }
256
		    printf("    SOURCE_AS   : %u\n",entry->body.zebra_message.source_as);
257
		    printf("    DEST_AS     : %u\n",entry->body.zebra_message.destination_as);
258
		    printf("    INTERFACE   : %d\n",entry->body.zebra_message.interface_index);
259
		    printf("    SOURCE_IP   : %s\n",source_ip);
260
		    printf("    DEST_IP     : %s\n",destination_ip);
261
262
		    if(entry->body.zebra_message.type > sizeof(bgp_message_types) / sizeof(bgp_message_types[0]))
263
			printf("MESSAGE TYPE    : Unknown\n");
264
		    else
265
			printf("MESSAGE TYPE    : %s\n", bgp_message_types[entry->body.zebra_message.type]);
266
267
		    switch(entry->body.zebra_message.type) {
268
			case BGP_MSG_UPDATE:
269
			    printf("WITHDRAW        :\n");
270
			    show_prefixes(entry->body.zebra_message.withdraw_count,entry->body.zebra_message.withdraw);
271
#ifdef BGPDUMP_HAVE_IPV6
272
			    if(entry->attr->mp_info &&
273
			       (mp_withdraw = MP_IPV6_WITHDRAW(entry->attr->mp_info)) != NULL) {
274
				show_v6_prefixes(mp_withdraw->prefix_count, mp_withdraw->nlri);
275
			    }
276
#endif
277
			    printf("ANNOUNCE        :\n");
278
			    show_prefixes(entry->body.zebra_message.announce_count,entry->body.zebra_message.announce);
279
#ifdef BGPDUMP_HAVE_IPV6
280
			    if(entry->attr->mp_info &&
281
			       (mp_announce = MP_IPV6_ANNOUNCE(entry->attr->mp_info)) != NULL) {
282
				show_v6_prefixes(mp_announce->prefix_count, mp_announce->nlri);
283
			    }
284
#endif
285
			    break;
286
			case BGP_MSG_KEEPALIVE:
287
			    /* Nothing to do */
288
			    break;
289
			case BGP_MSG_OPEN:
290
			    printf("    VERSION     : %d\n",entry->body.zebra_message.version);
291
			    printf("    MY_ASN      : %u\n",entry->body.zebra_message.my_as);
292
			    printf("    HOLD_TIME   : %d\n",entry->body.zebra_message.hold_time);
293
			    printf("    ROUTER_ID   : %s\n",inet_ntoa(entry->body.zebra_message.bgp_id));
294
			    printf("    OPTION_LEN  : %d\n",entry->body.zebra_message.opt_len);
295
			    printf("    OPTION_DATA :");
296
			    for(i = 0; i < entry->body.zebra_message.opt_len; i++) {
297
				printf(" %02x", entry->body.zebra_message.opt_data[i]);
298
			    }
299
			    printf("\n");
300
			    break;
301
			case BGP_MSG_NOTIFY:
302
			    code = entry->body.zebra_message.error_code;
303
			    subcode = entry->body.zebra_message.sub_error_code;
304
305
			    printf("    CODE        : %d", code);
306
			    if(code >= sizeof(notify_codes) / sizeof(notify_codes[0]))
307
				printf(" (Unknown)\n");
308
			    else
309
				printf(" (%s)\n", notify_codes[code]);
310
311
			    printf("    SUBCODE     : %d", subcode);
312
			    if(code >= sizeof(notify_codes) / sizeof(notify_codes[0]) ||
313
			       subcode >= sizeof(notify_subcodes[0]) / sizeof(notify_subcodes[0][0]) ||
314
			       notify_subcodes[code][subcode] == NULL)
315
				printf(" (Unknown)\n");
316
			    else
317
				printf(" (%s)\n", notify_subcodes[code][subcode]);
318
319
			    printf("    DATA        :");
320
			    for(i = 0; i < entry->body.zebra_message.notify_len; i++) {
321
				printf(" %02x", entry->body.zebra_message.notify_data[i]);
322
			    }
323
			    printf("\n");
324
			    break;
325
			default:
326
			    break;
327
		    }
328
		    break;
329
330
		case BGPDUMP_SUBTYPE_ZEBRA_BGP_STATE_CHANGE:
331
		    printf("SUBTYPE         : Zebra BGP State Change\n");
332
		    printf("    SOURCE_AS   : %u\n",entry->body.zebra_state_change.source_as);
333
		    printf("    DEST_AS     : %u\n",entry->body.zebra_state_change.destination_as);
334
		    printf("    INTERFACE   : %d\n",entry->body.zebra_state_change.interface_index);
335
		    printf("    SOURCE_IP   : %s\n",source_ip);
336
		    printf("    DEST_IP     : %s\n",destination_ip);
337
		    printf("    OLD_STATE   : %s\n",bgp_state_name[entry->body.zebra_state_change.old_state]);
338
		    printf("    NEW_STATE   : %s\n",bgp_state_name[entry->body.zebra_state_change.new_state]);
339
    		show_attr(entry->attr);
340
		    break;
341
342
		default:
343
		    printf("SUBTYPE         : Unknown %d\n", entry->subtype);
344
	    }
345
    	show_attr(entry->attr);
346
	    break;
347
	default:
348
	    printf("TYPE            : Unknown %d\n", entry->type);
349
    	show_attr(entry->attr);
350
	    
351
    }
352
    printf("\n");
353
}
354
355
void show_attr(attributes_t *attr) {
356
    int have_nexthop = 0;
357
    printf("ATTRIBUTES      :\n");
358
    
359
    if(attr != NULL) {
360
	    printf("   ATTR_LEN     : %d\n",attr->len);
361
362
	    if( (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_ORIGIN) ) !=0 )		printf("   ORIGIN       : %d\n",attr->origin);
363
	    else printf("   ORIGIN       : N/A\n");
364
365
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_AS_PATH) ) !=0)		printf("   ASPATH       : %s\n",attr->aspath->str);
366
	    else printf("   ASPATH       : N/A\n");
367
368
	    printf("   NEXT_HOP     : ");
369
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP) ) !=0) {
370
		have_nexthop = 1;
371
		printf("%s", inet_ntoa(attr->nexthop));
372
	    }
373
374
#ifdef BGPDUMP_HAVE_IPV6
375
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MP_REACH_NLRI)) &&
376
	         MP_IPV6_ANNOUNCE(attr->mp_info) != NULL) {
377
		char addr[INET6_ADDRSTRLEN];
378
		struct mp_nlri *mp_nlri = MP_IPV6_ANNOUNCE(attr->mp_info);
379
		u_int8_t len = mp_nlri->nexthop_len;
380
381
		if(have_nexthop)
382
		    printf(" ");
383
384
		have_nexthop = 1;
385
		printf("%s", inet_ntop(AF_INET6, &mp_nlri->nexthop, addr, sizeof(addr)));
386
		if(len == 32)
387
		    printf(" %s", inet_ntop(AF_INET6, &mp_nlri->nexthop_local, addr, sizeof(addr)));
388
	    }
389
#endif
390
391
	    printf(have_nexthop ? "\n" : "N/A\n");
392
393
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC) ) !=0)	printf("   MED          : %d\n",attr->med);
394
	    else printf("   MED          : N/A\n");
395
396
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF) ) !=0)		printf("   LOCAL_PREF   : %d\n",attr->local_pref);
397
	    else printf("   LOCAL_PREF   : N/A\n");
398
399
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ATOMIC_AGGREGATE) ) !=0)	printf("   ATOMIC_AGREG : Present\n");
400
	    else printf("   ATOMIC_AGREG : N/A\n");
401
402
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_AGGREGATOR) ) !=0)		printf("   AGGREGATOR   : %s AS%u\n",inet_ntoa(attr->aggregator_addr),attr->aggregator_as);
403
	    else printf("   AGGREGATOR   : N/A\n");
404
405
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES) ) !=0)	printf("   COMMUNITIES  : %s\n",attr->community->str);
406
	    else printf("   COMMUNITIES  : N/A\n");
407
408
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_NEW_AS_PATH) ) !=0) {
409
		printf("   NEW_ASPATH   : %s\n",attr->new_aspath->str);
410
	    	printf("   OLD_ASPATH   : %s\n",attr->old_aspath->str);
411
	    }
412
413
	    if( (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_NEW_AGGREGATOR) ) !=0)	printf("   NEW_AGGREGTR : %s AS%u\n",inet_ntoa(attr->new_aggregator_addr),attr->new_aggregator_as);
414
    }
415
}
416
417
void show_prefixes(int count,struct prefix *prefix) {
418
    int i;
419
    for(i=0;i<count;i++)
420
	printf("      %s/%d\n",inet_ntoa(prefix[i].address.v4_addr),prefix[i].len);
421
}
422
423
#ifdef BGPDUMP_HAVE_IPV6
424
void show_v6_prefixes(int count, struct prefix *prefix) {
425
    int i;
426
    char str[INET6_ADDRSTRLEN];
427
428
    for(i=0;i<count;i++){
429
	inet_ntop(AF_INET6, &prefix[i].address.v6_addr, str, sizeof(str));
430
	printf("      %s/%d\n",str, prefix[i].len);
431
    }
432
}
433
#endif
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/inet_ntop.c (+259 lines)
Line 0 Link Here
1
/*
2
 Copyright (c) 2007 - 2010 RIPE NCC - All Rights Reserved
3
 
4
 Permission to use, copy, modify, and distribute this software and its
5
 documentation for any purpose and without fee is hereby granted, provided
6
 that the above copyright notice appear in all copies and that both that
7
 copyright notice and this permission notice appear in supporting
8
 documentation, and that the name of the author not be used in advertising or
9
 publicity pertaining to distribution of the software without specific,
10
 written prior permission.
11
 
12
 THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
13
 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
14
 AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
15
 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
16
 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
*/
19
20
/*
21
 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
22
 *
23
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
24
 * 
25
 * This file contains Original Code and/or Modifications of Original Code
26
 * as defined in and that are subject to the Apple Public Source License
27
 * Version 2.0 (the 'License'). You may not use this file except in
28
 * compliance with the License. The rights granted to you under the License
29
 * may not be used to create, or enable the creation or redistribution of,
30
 * unlawful or unlicensed copies of an Apple operating system, or to
31
 * circumvent, violate, or enable the circumvention or violation of, any
32
 * terms of an Apple operating system software license agreement.
33
 * 
34
 * Please obtain a copy of the License at
35
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
36
 * 
37
 * The Original Code and all software distributed under the License are
38
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
39
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
40
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
41
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
42
 * Please see the License for the specific language governing rights and
43
 * limitations under the License.
44
 * 
45
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
46
 */
47
48
/*
49
 * Copyright 1994, 1995 Massachusetts Institute of Technology
50
 *
51
 * Permission to use, copy, modify, and distribute this software and
52
 * its documentation for any purpose and without fee is hereby
53
 * granted, provided that both the above copyright notice and this
54
 * permission notice appear in all copies, that both the above
55
 * copyright notice and this permission notice appear in all
56
 * supporting documentation, and that the name of M.I.T. not be used
57
 * in advertising or publicity pertaining to distribution of the
58
 * software without specific, written prior permission.  M.I.T. makes
59
 * no representations about the suitability of this software for any
60
 * purpose.  It is provided "as is" without express or implied
61
 * warranty.
62
 *
63
 * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''.  M.I.T. DISCLAIMS
64
 * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
65
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
66
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
67
 * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
68
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
69
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
70
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
71
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
72
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
73
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
74
 * SUCH DAMAGE.
75
 */
76
77
#include <sys/param.h>
78
#include <netinet/in.h>
79
#include <string.h>
80
#include <stdio.h>
81
#include <stdbool.h>
82
#include <assert.h>
83
#include <sys/types.h>
84
#include <sys/socket.h>
85
#include <arpa/inet.h>
86
87
#include "util.h"
88
89
const char OCTETS[][4] = {        
90
     "0",  "1",  "2",  "3",  "4",  "5",  "6",  "7",  "8",  "9", "10", "11", "12", "13", "14", "15",
91
    "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31",
92
    "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47",
93
    "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63",
94
    "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79",
95
    "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "94", "95",
96
    "96", "97", "98", "99",
97
    "100", "101", "102", "103", "104", "105", "106", "107", "108", "109",
98
    "110", "111", "112", "113", "114", "115", "116", "117", "118", "119", "120", "121", "122",
99
    "123", "124", "125", "126", "127", "128", "129", "130", "131", "132", "133", "134", "135",
100
    "136", "137", "138", "139", "140", "141", "142", "143", "144", "145", "146", "147", "148",
101
    "149", "150", "151", "152", "153", "154", "155", "156", "157", "158", "159", "160", "161",
102
    "162", "163", "164", "165", "166", "167", "168", "169", "170", "171", "172", "173", "174",
103
    "175", "176", "177", "178", "179", "180", "181", "182", "183", "184", "185", "186", "187", 
104
    "188", "189", "190", "191", "192", "193", "194", "195", "196", "197", "198", "199", "200",
105
    "201", "202", "203", "204", "205", "206", "207", "208", "209", "210", "211", "212", "213",
106
    "214", "215", "216", "217", "218", "219", "220", "221", "222", "223", "224", "225", "226",
107
    "227", "228", "229", "230", "231", "232", "233", "234", "235", "236", "237", "238", "239",
108
    "240", "241", "242", "243", "244", "245", "246", "247", "248", "249", "250", "251", "252",
109
    "253", "254", "255"
110
};
111
112
char *fmt_ipv4(BGPDUMP_IP_ADDRESS addr, char *buffer)
113
{
114
    assert(buffer);
115
    uint8_t *ap = (uint8_t *)&addr.v4_addr.s_addr;
116
    
117
    int pos = 0;
118
    int i;
119
    for(i = 0; i < 4; ++i) {
120
        const char *octet = OCTETS[ap[i]];
121
        buffer[pos++] = octet[0];
122
        octet[1] ? buffer[pos++] = octet[1] : (void)0;
123
        octet[2] ? buffer[pos++] = octet[2] : (void)0;
124
        buffer[pos++] = '.';
125
    }
126
    
127
    buffer[pos - 1] = '\0';
128
    
129
    return buffer;
130
}
131
132
char *fmt_ipv6(BGPDUMP_IP_ADDRESS addr, char *buffer)
133
{    
134
    static const char hexchars[] = "0123456789abcdef";
135
136
    assert(buffer);
137
        
138
    /*  check for mapped or compat addresses */
139
    bool m = IN6_IS_ADDR_V4MAPPED(&addr.v6_addr);
140
    bool c = IN6_IS_ADDR_V4COMPAT(&addr.v6_addr);
141
    if (m || c) {
142
        char buffer2[100];
143
        BGPDUMP_IP_ADDRESS mapped = { .v4_addr.s_addr = ((uint32_t *)addr.v6_addr.s6_addr)[3] };
144
        
145
        sprintf(buffer, "::%s%s", m ? "ffff:" : "", fmt_ipv4(mapped, buffer2));
146
        return buffer;
147
    }
148
    
149
    char hexa[8][5];
150
    int zr[8];
151
    size_t len;
152
    uint8_t x8, hx8;
153
    uint16_t x16;
154
    
155
    int i, k = 0;
156
    for (i = 0; i < 16; i += 2) {
157
        int j = 0;
158
        bool skip = 1;
159
        
160
        memset(hexa[k], 0, 5);
161
        
162
        x8 = addr.v6_addr.s6_addr[i];
163
        
164
        hx8 = x8 >> 4;
165
        if (hx8 != 0)
166
        {
167
            skip = 0;
168
            hexa[k][j++] = hexchars[hx8];
169
        }
170
        
171
        hx8 = x8 & 0x0f;
172
        if ((skip == 0) || ((skip == 1) && (hx8 != 0)))
173
        {
174
            skip = 0;
175
            hexa[k][j++] = hexchars[hx8];
176
        }
177
        
178
        x8 = addr.v6_addr.s6_addr[i + 1];
179
        
180
        hx8 = x8 >> 4;
181
        if ((skip == 0) || ((skip == 1) && (hx8 != 0)))
182
        {
183
            hexa[k][j++] = hexchars[hx8];
184
        }
185
        
186
        hx8 = x8 & 0x0f;
187
        hexa[k][j] = hexchars[hx8];
188
        
189
        k++;
190
    }
191
    
192
    /* find runs of zeros for :: convention */
193
    int j = 0;
194
    for (i = 7; i >= 0; i--)
195
    {
196
        zr[i] = j;
197
        x16 = ((uint16_t *)addr.v6_addr.s6_addr)[i];
198
        if (x16 == 0) j++;
199
        else j = 0;
200
        zr[i] = j;
201
    }
202
    
203
    /* find longest run of zeros */
204
    k = -1;
205
    j = 0;
206
    for(i = 0; i < 8; i++)
207
    {
208
        if (zr[i] > j)
209
        {
210
            k = i;
211
            j = zr[i];
212
        }
213
    }
214
    
215
    for(i = 0; i < 8; i++)
216
    {
217
        if (i != k) zr[i] = 0;
218
    }
219
    
220
    len = 0;
221
    for (i = 0; i < 8; i++)
222
    {
223
        if (zr[i] != 0)
224
        {
225
            /* check for leading zero */
226
            if (i == 0)
227
                buffer[len++] = ':';
228
            buffer[len++] = ':';
229
            i += (zr[i] - 1);
230
            continue;
231
        }
232
        for (j = 0; hexa[i][j] != '\0'; j++)
233
            buffer[len++] = hexa[i][j];
234
        if (i != 7)
235
            buffer[len++] = ':';
236
    }
237
    
238
    buffer[len] = '\0';
239
    
240
    return buffer;
241
}
242
243
static void test_roundtrip(char *str)
244
{
245
    BGPDUMP_IP_ADDRESS addr;
246
    inet_pton(AF_INET6, str, &addr.v6_addr);
247
    char tmp[1000];
248
    fmt_ipv6(addr, tmp);
249
    printf("%s -> %s [%s]\n", str, tmp, strcmp(str, tmp) ? "ERROR" : "ok");
250
}
251
252
void test_fmt_ip()
253
{
254
    test_roundtrip("fe80::");
255
    test_roundtrip("2001:db8::1");
256
    test_roundtrip("::ffff:192.168.2.1");
257
    test_roundtrip("::192.168.1.2");
258
    test_roundtrip("2001:7f8:30::2:1:0:8447");
259
}
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/util.c (+93 lines)
Line 0 Link Here
1
/*
2
 Copyright (c) 2007 - 2010 RIPE NCC - All Rights Reserved
3
 
4
 Permission to use, copy, modify, and distribute this software and its
5
 documentation for any purpose and without fee is hereby granted, provided
6
 that the above copyright notice appear in all copies and that both that
7
 copyright notice and this permission notice appear in supporting
8
 documentation, and that the name of the author not be used in advertising or
9
 publicity pertaining to distribution of the software without specific,
10
 written prior permission.
11
 
12
 THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
13
 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
14
 AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
15
 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
16
 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
 
19
 Created by Devin Bayer on 9/1/10.
20
*/
21
22
#include "util.h"
23
24
#include <stdlib.h>
25
#include <stdio.h>
26
#include <stdarg.h>
27
#include <assert.h>
28
#include <stdbool.h>
29
#include <syslog.h>
30
#include <time.h>
31
#include <string.h>
32
33
static bool use_syslog = true;
34
35
void log_to_syslog() {
36
    use_syslog = true;
37
}
38
39
void log_to_stderr() {
40
    use_syslog = false;
41
}
42
43
#define log(lvl, lvl_str) \
44
    va_list args; \
45
    va_start(args, fmt); \
46
    _log(LOG_##lvl, #lvl_str, fmt, args)
47
48
static char *now_str() {
49
    static char buffer[1000];
50
    time_t now = time(0);
51
    strftime(buffer, sizeof buffer, "%Y-%m-%d %H:%M:%S", localtime(&now));
52
    return buffer;
53
}
54
55
static void _log(int lvl, char *lvl_str, const char *fmt, va_list args) {
56
    if(use_syslog) {
57
        syslog(lvl, fmt, args);
58
    } else {
59
        char prefix[strlen(fmt) + 1000];
60
        sprintf(prefix, "%s [%s] %s\n", now_str(), lvl_str, fmt);
61
        vfprintf(stderr, prefix, args);
62
    }
63
}
64
65
void err(const char *fmt, ...) { log(ERR, error); }
66
void warn(const char *fmt, ...) { log(WARNING, warn); }
67
void debug(const char *fmt, ...) { log(INFO, info); }
68
69
void time2str(struct tm* date,char *time_str)
70
{
71
    sprintf(time_str, "%02d/%02d/%02d %02d:%02d:%02d", date->tm_mon+1, date->tm_mday, date->tm_year%100,
72
            date->tm_hour, date->tm_min, date->tm_sec);
73
}
74
75
int int2str(uint32_t value, char* str)
76
{
77
    return sprintf(str, "%u", value);
78
}
79
80
static void ti2s(uint32_t value) {
81
    char buf[100], ref[100];
82
    sprintf(ref, "%u", value);
83
    int len = int2str(value, buf);
84
    printf("%s =?= %s (%i)\n", ref, buf, len);
85
}
86
87
void test_utils()
88
{
89
    ti2s(0);
90
    ti2s(99999);
91
    ti2s(4294967295L);
92
}
93
(-)libbgpdump-new/work/libbgpdump-1.4.99.15/util.h (+45 lines)
Line 0 Link Here
1
/*
2
 Copyright (c) 2007 - 2010 RIPE NCC - All Rights Reserved
3
 
4
 Permission to use, copy, modify, and distribute this software and its
5
 documentation for any purpose and without fee is hereby granted, provided
6
 that the above copyright notice appear in all copies and that both that
7
 copyright notice and this permission notice appear in supporting
8
 documentation, and that the name of the author not be used in advertising or
9
 publicity pertaining to distribution of the software without specific,
10
 written prior permission.
11
 
12
 THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
13
 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
14
 AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
15
 DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
16
 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
19
 Created by Devin Bayer on 9/1/10.
20
*/
21
22
#ifndef _UTIL_H
23
#define _UTIL_H
24
#include <time.h>
25
26
#include "bgpdump_attr.h"
27
28
void log_to_stderr(void);
29
void log_to_syslog(void);
30
31
void err(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
32
void warn(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
33
void debug(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
34
35
// system inet_ntop() functions format IPv6 addresses
36
// inconsistently, so use these versions
37
char *fmt_ipv4(BGPDUMP_IP_ADDRESS addr, char *buffer);
38
char *fmt_ipv6(BGPDUMP_IP_ADDRESS addr, char *buffer);
39
void test_fmt_ip(void);
40
41
void time2str(struct tm* date,char *time_str);
42
int int2str(uint32_t value, char* str);
43
void test_utils(void);
44
45
#endif

Return to bug 203182