Merge lp:~logan/ubuntu/quantal/tcpdump/debian-merge into lp:ubuntu/quantal/tcpdump

Proposed by Logan Rosen
Status: Merged
Merged at revision: 30
Proposed branch: lp:~logan/ubuntu/quantal/tcpdump/debian-merge
Merge into: lp:ubuntu/quantal/tcpdump
Diff against target: 16960 lines (+1638/-13853)
57 files modified
.pc/10_man_install.diff/Makefile.in (+0/-448)
.pc/15_install.diff/Makefile.in (+0/-448)
.pc/20_man_fixes.diff/tcpdump.1.in (+0/-1744)
.pc/40_openssl.diff/configure.in (+0/-1111)
.pc/50_autotools-dev.diff/config.guess (+0/-1502)
.pc/50_autotools-dev.diff/config.sub (+0/-1708)
.pc/50_hurd.diff/tcpdump-stdinc.h (+0/-226)
.pc/50_kfreebsd.diff/configure.in (+0/-1056)
.pc/90_man_apparmor.diff/tcpdump.1.in (+0/-1744)
.pc/applied-patches (+0/-8)
CHANGES (+16/-0)
CREDITS (+3/-0)
Makefile.in (+12/-8)
VERSION (+1/-1)
aclocal.m4 (+8/-1)
config.guess (+0/-5)
config.sub (+0/-5)
configure (+18/-4)
configure.in (+58/-4)
debian/changelog (+31/-0)
debian/control (+1/-1)
debian/patches/40_openssl.diff (+3/-1)
debian/patches/50_kfreebsd.diff (+0/-16)
debian/patches/series (+0/-1)
decode_prefix.h (+2/-2)
ethertype.h (+3/-0)
forces.h (+1/-1)
netdissect.h (+1/-0)
print-802_11.c (+1/-1)
print-bgp.c (+319/-198)
print-ether.c (+5/-1)
print-forces.c (+16/-16)
print-icmp6.c (+1/-1)
print-igmp.c (+5/-1)
print-ip.c (+13/-13)
print-ip6opts.c (+4/-1)
print-ldp.c (+71/-18)
print-lldp.c (+2/-2)
print-lwapp.c (+1/-2)
print-ospf6.c (+131/-76)
print-pim.c (+2/-2)
print-pppoe.c (+2/-0)
print-rrcp.c (+2/-2)
print-tipc.c (+392/-0)
tcpdump-stdinc.h (+0/-4)
tcpdump.1.in (+58/-16)
tcpdump.c (+10/-4)
tests/TESTLIST (+8/-2)
tests/TESTrun.sh (+4/-4)
tests/forces1vvv.out (+3/-3)
tests/forces1vvvv.out (+3/-3)
tests/forces2.out (+0/-491)
tests/forces2v.out (+0/-982)
tests/forces2vv.out (+377/-1965)
tests/icmpv6.out (+13/-0)
tests/lmp.new (+36/-0)
tests/pppoe.out (+1/-0)
To merge this branch: bzr merge lp:~logan/ubuntu/quantal/tcpdump/debian-merge
Reviewer Review Type Date Requested Status
Jamie Strandboge Approve
Ubuntu branches Pending
Review via email: mp+118851@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

ACK. Looks great. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed directory '.pc/10_man_install.diff'
=== removed file '.pc/10_man_install.diff/Makefile.in'
--- .pc/10_man_install.diff/Makefile.in 2012-01-04 10:33:48 +0000
+++ .pc/10_man_install.diff/Makefile.in 1970-01-01 00:00:00 +0000
@@ -1,448 +0,0 @@
1# Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
2# The Regents of the University of California. All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that: (1) source code distributions
6# retain the above copyright notice and this paragraph in its entirety, (2)
7# distributions including binary code include the above copyright notice and
8# this paragraph in its entirety in the documentation or other materials
9# provided with the distribution, and (3) all advertising materials mentioning
10# features or use of this software display the following acknowledgement:
11# ``This product includes software developed by the University of California,
12# Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
13# the University nor the names of its contributors may be used to endorse
14# or promote products derived from this software without specific prior
15# written permission.
16# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
17# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19#
20# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.325 2008-11-21 23:17:26 guy Exp $ (LBL)
21
22#
23# Various configurable paths (remember to edit Makefile.in, not Makefile)
24#
25
26# Top level hierarchy
27prefix = @prefix@
28exec_prefix = @exec_prefix@
29datarootdir = @datarootdir@
30# Pathname of directory to install the binary
31sbindir = @sbindir@
32# Pathname of directory to install the man page
33mandir = @mandir@
34
35# VPATH
36srcdir = @srcdir@
37VPATH = @srcdir@
38
39#
40# You shouldn't need to edit anything below here.
41#
42
43CC = @CC@
44PROG = tcpdump
45CCOPT = @V_CCOPT@
46INCLS = -I. @V_INCLS@
47DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@
48
49# Standard CFLAGS
50CFLAGS = @CFLAGS@
51FULL_CFLAGS = $(CCOPT) $(DEFS) $(INCLS) $(CFLAGS)
52
53# Standard LDFLAGS
54LDFLAGS = @LDFLAGS@
55
56# Standard LIBS
57LIBS = @LIBS@
58
59INSTALL = @INSTALL@
60INSTALL_PROGRAM = @INSTALL_PROGRAM@
61INSTALL_DATA = @INSTALL_DATA@
62RANLIB = @RANLIB@
63
64# Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
65# Also, gcc does not remove the .o before forking 'as', which can be a
66# problem if you don't own the file but can write to the directory.
67.c.o:
68 @rm -f $@
69 $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c
70
71CSRC = addrtoname.c af.c checksum.c cpack.c gmpls.c oui.c gmt2local.c ipproto.c \
72 nlpid.c l2vpn.c machdep.c parsenfsfh.c in_cksum.c \
73 print-802_11.c print-802_15_4.c print-ap1394.c print-ah.c \
74 print-arcnet.c print-aodv.c print-arp.c print-ascii.c print-atalk.c \
75 print-atm.c print-beep.c print-bfd.c print-bgp.c \
76 print-bootp.c print-bt.c print-carp.c print-cdp.c print-cfm.c \
77 print-chdlc.c print-cip.c print-cnfp.c print-dccp.c print-decnet.c \
78 print-domain.c print-dtp.c print-dvmrp.c print-enc.c print-egp.c \
79 print-eap.c print-eigrp.c\
80 print-esp.c print-ether.c print-fddi.c print-fr.c \
81 print-gre.c print-hsrp.c print-icmp.c print-igmp.c \
82 print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c print-ipnet.c \
83 print-ipx.c print-isoclns.c print-juniper.c print-krb.c \
84 print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \
85 print-lmp.c print-lspping.c print-lwapp.c \
86 print-lwres.c print-mobile.c print-mpcp.c print-mpls.c print-msdp.c \
87 print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \
88 print-pgm.c print-pim.c \
89 print-ppi.c print-ppp.c print-pppoe.c print-pptp.c \
90 print-radius.c print-raw.c print-rip.c print-rpki-rtr.c print-rrcp.c print-rsvp.c \
91 print-rx.c print-sctp.c print-sflow.c print-sip.c print-sl.c print-sll.c \
92 print-slow.c print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \
93 print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \
94 print-timed.c print-token.c print-udld.c print-udp.c print-usb.c \
95 print-vjc.c print-vqp.c print-vrrp.c print-vtp.c print-forces.c \
96 print-wb.c print-zephyr.c signature.c setsignal.c tcpdump.c util.c
97
98LIBNETDISSECT_SRC=print-isakmp.c
99LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o)
100LIBNETDISSECT=libnetdissect.a
101
102LOCALSRC = @LOCALSRC@
103GENSRC = version.c
104LIBOBJS = @LIBOBJS@
105
106SRC = $(CSRC) $(GENSRC) $(LOCALSRC) $(LIBNETDISSECT_SRC)
107
108# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
109# hack the extra indirection
110OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LOCALSRC:.c=.o) $(LIBOBJS) $(LIBNETDISSECT_OBJ)
111HDR = \
112 acconfig.h \
113 addrtoname.h \
114 af.h \
115 ah.h \
116 aodv.h \
117 appletalk.h \
118 arcnet.h \
119 atm.h \
120 atmuni31.h \
121 bootp.h \
122 bgp.h \
123 chdlc.h \
124 cpack.h \
125 dccp.h \
126 decnet.h \
127 decode_prefix.h \
128 enc.h \
129 esp.h \
130 ether.h \
131 ethertype.h \
132 extract.h \
133 fddi.h \
134 forces.h \
135 gmpls.h \
136 gmt2local.h \
137 icmp6.h \
138 ieee802_11.h \
139 ieee802_11_radio.h \
140 igrp.h \
141 interface.h \
142 interface.h \
143 ip.h \
144 ip6.h \
145 ipfc.h \
146 ipnet.h \
147 ipproto.h \
148 ipsec_doi.h \
149 ipx.h \
150 isakmp.h \
151 l2tp.h \
152 l2vpn.h \
153 lane.h \
154 llc.h \
155 machdep.h \
156 mib.h \
157 mpls.h \
158 nameser.h \
159 netbios.h \
160 netdissect.h \
161 nfs.h \
162 nfsfh.h \
163 nlpid.h \
164 ntp.h \
165 oakley.h \
166 ospf.h \
167 ospf6.h \
168 oui.h \
169 pcap-missing.h \
170 pmap_prot.h \
171 ppi.h \
172 ppp.h \
173 route6d.h \
174 rpc_auth.h \
175 rpc_msg.h \
176 rx.h \
177 sctpConstants.h \
178 sctpHeader.h \
179 setsignal.h \
180 signature.h \
181 slcompress.h \
182 slip.h \
183 sll.h \
184 smb.h \
185 tcp.h \
186 tcpdump-stdinc.h \
187 telnet.h \
188 tftp.h \
189 timed.h \
190 token.h \
191 udp.h
192
193TAGHDR = \
194 /usr/include/arpa/tftp.h \
195 /usr/include/net/if_arp.h \
196 /usr/include/net/slip.h \
197 /usr/include/netinet/if_ether.h \
198 /usr/include/netinet/in.h \
199 /usr/include/netinet/ip_icmp.h \
200 /usr/include/netinet/tcp.h \
201 /usr/include/netinet/udp.h \
202 /usr/include/protocols/routed.h
203
204TAGFILES = $(SRC) $(HDR) $(TAGHDR)
205
206CLEANFILES = $(PROG) $(OBJ) $(GENSRC)
207
208EXTRA_DIST = \
209 CHANGES \
210 CREDITS \
211 INSTALL.txt \
212 LICENSE \
213 Makefile.in \
214 Makefile-devel-adds \
215 README \
216 Readme.Win32 \
217 VERSION \
218 aclocal.m4 \
219 atime.awk \
220 bpf_dump.c \
221 config.guess \
222 config.h.in \
223 config.sub \
224 configure \
225 configure.in \
226 install-sh \
227 lbl/os-osf4.h \
228 lbl/os-solaris2.h \
229 lbl/os-sunos4.h \
230 lbl/os-ultrix4.h \
231 makemib \
232 missing/addrinfo.h \
233 missing/dlnames.c \
234 missing/datalinks.c \
235 missing/getnameinfo.c \
236 missing/inet_aton.c \
237 missing/inet_ntop.c \
238 missing/inet_pton.c \
239 missing/snprintf.c \
240 missing/sockstorage.h \
241 missing/strdup.c \
242 missing/strlcat.c \
243 missing/strlcpy.c \
244 missing/strsep.c \
245 mkdep \
246 packetdat.awk \
247 pcap_dump_ftell.c \
248 print-babel.c \
249 print-dhcp6.c \
250 print-frag6.c \
251 print-icmp6.c \
252 print-ip6.c \
253 print-ip6opts.c \
254 print-mobility.c \
255 print-netbios.c \
256 print-ospf6.c \
257 print-pflog.c \
258 print-ripng.c \
259 print-rt6.c \
260 print-smb.c \
261 send-ack.awk \
262 smbutil.c \
263 stime.awk \
264 strcasecmp.c \
265 tcpdump.1.in \
266 tests/02-sunrise-sunset-esp.pcap \
267 tests/08-sunrise-sunset-aes.pcap \
268 tests/08-sunrise-sunset-esp2.pcap \
269 tests/QinQpacket.out \
270 tests/QinQpacket.pcap \
271 tests/QinQpacketv.out \
272 tests/TESTLIST \
273 tests/TESTonce \
274 tests/TESTrun.sh \
275 tests/babel.pcap \
276 tests/babel1.out \
277 tests/babel1v.out \
278 tests/bgp-infinite-loop.pcap \
279 tests/bgp_vpn_attrset.out \
280 tests/bgp_vpn_attrset.pcap \
281 tests/chdlc-slarp-short.pcap \
282 tests/chdlc-slarp.pcap \
283 tests/dio.out \
284 tests/dio.pcap \
285 tests/e1000g.out \
286 tests/e1000g.pcap \
287 tests/eapon1.gdbinit \
288 tests/eapon1.out \
289 tests/eapon1.pcap \
290 tests/empty.uu \
291 tests/esp-secrets.txt \
292 tests/esp0.out \
293 tests/esp1.gdbinit \
294 tests/esp1.out \
295 tests/esp2.gdbinit \
296 tests/esp2.out \
297 tests/esp3.gdbinit \
298 tests/esp4.gdbinit \
299 tests/esp5.gdbinit \
300 tests/esp5.out \
301 tests/espudp1.out \
302 tests/espudp1.pcap \
303 tests/forces1.out \
304 tests/forces1.pcap \
305 tests/forces1vvv.out \
306 tests/forces1vvvv.out \
307 tests/forces2.out \
308 tests/forces2v.out \
309 tests/forces2vv.out \
310 tests/forces3vvv.out \
311 tests/ikev2four.out \
312 tests/ikev2four.pcap \
313 tests/ikev2fourv.out \
314 tests/ikev2fourv4.out \
315 tests/ikev2pI2-secrets.txt \
316 tests/ikev2pI2.out \
317 tests/ikev2pI2.pcap \
318 tests/isakmp-delete-segfault.pcap \
319 tests/isakmp-identification-segfault.pcap \
320 tests/isakmp-pointer-loop.pcap \
321 tests/isakmp1.out \
322 tests/isakmp2.out \
323 tests/isakmp3.out \
324 tests/isakmp4.out \
325 tests/isakmp4500.pcap \
326 tests/isis-infinite-loop.pcap \
327 tests/ldp-infinite-loop.pcap \
328 tests/lmp.out \
329 tests/lmp.pcap \
330 tests/lmp.sh \
331 tests/lspping-fec-ldp.pcap \
332 tests/lspping-fec-rsvp.pcap \
333 tests/mpls-ldp-hello.out \
334 tests/mpls-ldp-hello.pcap \
335 tests/mpls-traceroute.pcap \
336 tests/ospf-gmpls.out \
337 tests/ospf-gmpls.pcap \
338 tests/print-A.out \
339 tests/print-AA.out \
340 tests/print-capX.out \
341 tests/print-capXX.out \
342 tests/print-flags.pcap \
343 tests/print-flags.sh \
344 tests/print-x.out \
345 tests/print-xx.out \
346 tests/rsvp-infinite-loop.pcap \
347 tests/sflow_multiple_counter_30_pdus.out \
348 tests/sflow_multiple_counter_30_pdus.pcap \
349 vfprintf.c \
350 win32/Include/errno.h \
351 win32/Include/getopt.h \
352 win32/Include/w32_fzs.h \
353 win32/Src/getopt.c \
354 win32/prj/GNUmakefile \
355 win32/prj/WinDump.dsp \
356 win32/prj/WinDump.dsw
357
358all: $(PROG)
359
360$(PROG): $(OBJ) @V_PCAPDEP@
361 @rm -f $@
362 $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
363
364$(LIBNETDISSECT): $(LIBNETDISSECT_OBJ)
365 @rm -f $@
366 $(AR) cr $@ $(LIBNETDISSECT_OBJ)
367 $(RANLIB) $@
368
369datalinks.o: $(srcdir)/missing/datalinks.c
370 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
371dlnames.o: $(srcdir)/missing/dlnames.c
372 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c
373getnameinfo.o: $(srcdir)/missing/getnameinfo.c
374 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c
375getaddrinfo.o: $(srcdir)/missing/getaddrinfo.c
376 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getaddrinfo.c
377inet_pton.o: $(srcdir)/missing/inet_pton.c
378 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_pton.c
379inet_ntop.o: $(srcdir)/missing/inet_ntop.c
380 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_ntop.c
381inet_aton.o: $(srcdir)/missing/inet_aton.c
382 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_aton.c
383snprintf.o: $(srcdir)/missing/snprintf.c
384 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
385strlcat.o: $(srcdir)/missing/strlcat.c
386 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
387strlcpy.o: $(srcdir)/missing/strlcpy.c
388 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c
389strsep.o: $(srcdir)/missing/strsep.c
390 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c
391
392version.o: version.c
393 $(CC) $(FULL_CFLAGS) -c version.c
394
395version.c: $(srcdir)/VERSION
396 @rm -f $@
397 if grep GIT ${srcdir}/VERSION >/dev/null; then \
398 read ver <${srcdir}/VERSION; \
399 echo $$ver | tr -d '\012'; \
400 date +_%Y_%m_%d; \
401 else \
402 cat ${srcdir}/VERSION; \
403 fi | sed -e 's/.*/const char version[] = "&";/' > $@
404
405install: all
406 [ -d $(DESTDIR)$(sbindir) ] || \
407 (mkdir -p $(DESTDIR)$(sbindir); chmod 755 $(DESTDIR)$(sbindir))
408 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG)
409 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG).`cat ${srcdir}/VERSION`
410 [ -d $(DESTDIR)$(mandir)/man1 ] || \
411 (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
412 $(INSTALL_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
413
414uninstall:
415 rm -f $(DESTDIR)$(sbindir)/$(PROG)
416 rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1
417
418lint: $(GENSRC)
419 lint -hbxn $(SRC) | \
420 grep -v 'struct/union .* never defined' | \
421 grep -v 'possible pointer alignment problem'
422
423clean:
424 rm -f $(CLEANFILES) $(PROG)-`cat VERSION`.tar.gz
425
426distclean:
427 rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
428 config.h gnuc.h os-proto.h stamp-h stamp-h.in $(PROG).1
429 rm -rf autom4te.cache
430
431check: tcpdump
432 (cd tests && ./TESTrun.sh)
433
434tags: $(TAGFILES)
435 ctags -wtd $(TAGFILES)
436
437TAGS: $(TAGFILES)
438 etags $(TAGFILES)
439
440releasetar:
441 @cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
442 mkdir $$name; \
443 tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) | (cd $$name; tar xf -); \
444 tar -c -z -f $$name.tar.gz $$name; \
445 rm -rf $$name
446
447depend: $(GENSRC)
448 ${srcdir}/mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
4490
=== removed directory '.pc/15_install.diff'
=== removed file '.pc/15_install.diff/Makefile.in'
--- .pc/15_install.diff/Makefile.in 2012-01-04 10:33:48 +0000
+++ .pc/15_install.diff/Makefile.in 1970-01-01 00:00:00 +0000
@@ -1,448 +0,0 @@
1# Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
2# The Regents of the University of California. All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that: (1) source code distributions
6# retain the above copyright notice and this paragraph in its entirety, (2)
7# distributions including binary code include the above copyright notice and
8# this paragraph in its entirety in the documentation or other materials
9# provided with the distribution, and (3) all advertising materials mentioning
10# features or use of this software display the following acknowledgement:
11# ``This product includes software developed by the University of California,
12# Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
13# the University nor the names of its contributors may be used to endorse
14# or promote products derived from this software without specific prior
15# written permission.
16# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
17# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19#
20# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.325 2008-11-21 23:17:26 guy Exp $ (LBL)
21
22#
23# Various configurable paths (remember to edit Makefile.in, not Makefile)
24#
25
26# Top level hierarchy
27prefix = @prefix@
28exec_prefix = @exec_prefix@
29datarootdir = @datarootdir@
30# Pathname of directory to install the binary
31sbindir = @sbindir@
32# Pathname of directory to install the man page
33mandir = @mandir@
34
35# VPATH
36srcdir = @srcdir@
37VPATH = @srcdir@
38
39#
40# You shouldn't need to edit anything below here.
41#
42
43CC = @CC@
44PROG = tcpdump
45CCOPT = @V_CCOPT@
46INCLS = -I. @V_INCLS@
47DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@
48
49# Standard CFLAGS
50CFLAGS = @CFLAGS@
51FULL_CFLAGS = $(CCOPT) $(DEFS) $(INCLS) $(CFLAGS)
52
53# Standard LDFLAGS
54LDFLAGS = @LDFLAGS@
55
56# Standard LIBS
57LIBS = @LIBS@
58
59INSTALL = @INSTALL@
60INSTALL_PROGRAM = @INSTALL_PROGRAM@
61INSTALL_DATA = @INSTALL_DATA@
62RANLIB = @RANLIB@
63
64# Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
65# Also, gcc does not remove the .o before forking 'as', which can be a
66# problem if you don't own the file but can write to the directory.
67.c.o:
68 @rm -f $@
69 $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c
70
71CSRC = addrtoname.c af.c checksum.c cpack.c gmpls.c oui.c gmt2local.c ipproto.c \
72 nlpid.c l2vpn.c machdep.c parsenfsfh.c in_cksum.c \
73 print-802_11.c print-802_15_4.c print-ap1394.c print-ah.c \
74 print-arcnet.c print-aodv.c print-arp.c print-ascii.c print-atalk.c \
75 print-atm.c print-beep.c print-bfd.c print-bgp.c \
76 print-bootp.c print-bt.c print-carp.c print-cdp.c print-cfm.c \
77 print-chdlc.c print-cip.c print-cnfp.c print-dccp.c print-decnet.c \
78 print-domain.c print-dtp.c print-dvmrp.c print-enc.c print-egp.c \
79 print-eap.c print-eigrp.c\
80 print-esp.c print-ether.c print-fddi.c print-fr.c \
81 print-gre.c print-hsrp.c print-icmp.c print-igmp.c \
82 print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c print-ipnet.c \
83 print-ipx.c print-isoclns.c print-juniper.c print-krb.c \
84 print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \
85 print-lmp.c print-lspping.c print-lwapp.c \
86 print-lwres.c print-mobile.c print-mpcp.c print-mpls.c print-msdp.c \
87 print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \
88 print-pgm.c print-pim.c \
89 print-ppi.c print-ppp.c print-pppoe.c print-pptp.c \
90 print-radius.c print-raw.c print-rip.c print-rpki-rtr.c print-rrcp.c print-rsvp.c \
91 print-rx.c print-sctp.c print-sflow.c print-sip.c print-sl.c print-sll.c \
92 print-slow.c print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \
93 print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \
94 print-timed.c print-token.c print-udld.c print-udp.c print-usb.c \
95 print-vjc.c print-vqp.c print-vrrp.c print-vtp.c print-forces.c \
96 print-wb.c print-zephyr.c signature.c setsignal.c tcpdump.c util.c
97
98LIBNETDISSECT_SRC=print-isakmp.c
99LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o)
100LIBNETDISSECT=libnetdissect.a
101
102LOCALSRC = @LOCALSRC@
103GENSRC = version.c
104LIBOBJS = @LIBOBJS@
105
106SRC = $(CSRC) $(GENSRC) $(LOCALSRC) $(LIBNETDISSECT_SRC)
107
108# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
109# hack the extra indirection
110OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LOCALSRC:.c=.o) $(LIBOBJS) $(LIBNETDISSECT_OBJ)
111HDR = \
112 acconfig.h \
113 addrtoname.h \
114 af.h \
115 ah.h \
116 aodv.h \
117 appletalk.h \
118 arcnet.h \
119 atm.h \
120 atmuni31.h \
121 bootp.h \
122 bgp.h \
123 chdlc.h \
124 cpack.h \
125 dccp.h \
126 decnet.h \
127 decode_prefix.h \
128 enc.h \
129 esp.h \
130 ether.h \
131 ethertype.h \
132 extract.h \
133 fddi.h \
134 forces.h \
135 gmpls.h \
136 gmt2local.h \
137 icmp6.h \
138 ieee802_11.h \
139 ieee802_11_radio.h \
140 igrp.h \
141 interface.h \
142 interface.h \
143 ip.h \
144 ip6.h \
145 ipfc.h \
146 ipnet.h \
147 ipproto.h \
148 ipsec_doi.h \
149 ipx.h \
150 isakmp.h \
151 l2tp.h \
152 l2vpn.h \
153 lane.h \
154 llc.h \
155 machdep.h \
156 mib.h \
157 mpls.h \
158 nameser.h \
159 netbios.h \
160 netdissect.h \
161 nfs.h \
162 nfsfh.h \
163 nlpid.h \
164 ntp.h \
165 oakley.h \
166 ospf.h \
167 ospf6.h \
168 oui.h \
169 pcap-missing.h \
170 pmap_prot.h \
171 ppi.h \
172 ppp.h \
173 route6d.h \
174 rpc_auth.h \
175 rpc_msg.h \
176 rx.h \
177 sctpConstants.h \
178 sctpHeader.h \
179 setsignal.h \
180 signature.h \
181 slcompress.h \
182 slip.h \
183 sll.h \
184 smb.h \
185 tcp.h \
186 tcpdump-stdinc.h \
187 telnet.h \
188 tftp.h \
189 timed.h \
190 token.h \
191 udp.h
192
193TAGHDR = \
194 /usr/include/arpa/tftp.h \
195 /usr/include/net/if_arp.h \
196 /usr/include/net/slip.h \
197 /usr/include/netinet/if_ether.h \
198 /usr/include/netinet/in.h \
199 /usr/include/netinet/ip_icmp.h \
200 /usr/include/netinet/tcp.h \
201 /usr/include/netinet/udp.h \
202 /usr/include/protocols/routed.h
203
204TAGFILES = $(SRC) $(HDR) $(TAGHDR)
205
206CLEANFILES = $(PROG) $(OBJ) $(GENSRC)
207
208EXTRA_DIST = \
209 CHANGES \
210 CREDITS \
211 INSTALL.txt \
212 LICENSE \
213 Makefile.in \
214 Makefile-devel-adds \
215 README \
216 Readme.Win32 \
217 VERSION \
218 aclocal.m4 \
219 atime.awk \
220 bpf_dump.c \
221 config.guess \
222 config.h.in \
223 config.sub \
224 configure \
225 configure.in \
226 install-sh \
227 lbl/os-osf4.h \
228 lbl/os-solaris2.h \
229 lbl/os-sunos4.h \
230 lbl/os-ultrix4.h \
231 makemib \
232 missing/addrinfo.h \
233 missing/dlnames.c \
234 missing/datalinks.c \
235 missing/getnameinfo.c \
236 missing/inet_aton.c \
237 missing/inet_ntop.c \
238 missing/inet_pton.c \
239 missing/snprintf.c \
240 missing/sockstorage.h \
241 missing/strdup.c \
242 missing/strlcat.c \
243 missing/strlcpy.c \
244 missing/strsep.c \
245 mkdep \
246 packetdat.awk \
247 pcap_dump_ftell.c \
248 print-babel.c \
249 print-dhcp6.c \
250 print-frag6.c \
251 print-icmp6.c \
252 print-ip6.c \
253 print-ip6opts.c \
254 print-mobility.c \
255 print-netbios.c \
256 print-ospf6.c \
257 print-pflog.c \
258 print-ripng.c \
259 print-rt6.c \
260 print-smb.c \
261 send-ack.awk \
262 smbutil.c \
263 stime.awk \
264 strcasecmp.c \
265 tcpdump.1.in \
266 tests/02-sunrise-sunset-esp.pcap \
267 tests/08-sunrise-sunset-aes.pcap \
268 tests/08-sunrise-sunset-esp2.pcap \
269 tests/QinQpacket.out \
270 tests/QinQpacket.pcap \
271 tests/QinQpacketv.out \
272 tests/TESTLIST \
273 tests/TESTonce \
274 tests/TESTrun.sh \
275 tests/babel.pcap \
276 tests/babel1.out \
277 tests/babel1v.out \
278 tests/bgp-infinite-loop.pcap \
279 tests/bgp_vpn_attrset.out \
280 tests/bgp_vpn_attrset.pcap \
281 tests/chdlc-slarp-short.pcap \
282 tests/chdlc-slarp.pcap \
283 tests/dio.out \
284 tests/dio.pcap \
285 tests/e1000g.out \
286 tests/e1000g.pcap \
287 tests/eapon1.gdbinit \
288 tests/eapon1.out \
289 tests/eapon1.pcap \
290 tests/empty.uu \
291 tests/esp-secrets.txt \
292 tests/esp0.out \
293 tests/esp1.gdbinit \
294 tests/esp1.out \
295 tests/esp2.gdbinit \
296 tests/esp2.out \
297 tests/esp3.gdbinit \
298 tests/esp4.gdbinit \
299 tests/esp5.gdbinit \
300 tests/esp5.out \
301 tests/espudp1.out \
302 tests/espudp1.pcap \
303 tests/forces1.out \
304 tests/forces1.pcap \
305 tests/forces1vvv.out \
306 tests/forces1vvvv.out \
307 tests/forces2.out \
308 tests/forces2v.out \
309 tests/forces2vv.out \
310 tests/forces3vvv.out \
311 tests/ikev2four.out \
312 tests/ikev2four.pcap \
313 tests/ikev2fourv.out \
314 tests/ikev2fourv4.out \
315 tests/ikev2pI2-secrets.txt \
316 tests/ikev2pI2.out \
317 tests/ikev2pI2.pcap \
318 tests/isakmp-delete-segfault.pcap \
319 tests/isakmp-identification-segfault.pcap \
320 tests/isakmp-pointer-loop.pcap \
321 tests/isakmp1.out \
322 tests/isakmp2.out \
323 tests/isakmp3.out \
324 tests/isakmp4.out \
325 tests/isakmp4500.pcap \
326 tests/isis-infinite-loop.pcap \
327 tests/ldp-infinite-loop.pcap \
328 tests/lmp.out \
329 tests/lmp.pcap \
330 tests/lmp.sh \
331 tests/lspping-fec-ldp.pcap \
332 tests/lspping-fec-rsvp.pcap \
333 tests/mpls-ldp-hello.out \
334 tests/mpls-ldp-hello.pcap \
335 tests/mpls-traceroute.pcap \
336 tests/ospf-gmpls.out \
337 tests/ospf-gmpls.pcap \
338 tests/print-A.out \
339 tests/print-AA.out \
340 tests/print-capX.out \
341 tests/print-capXX.out \
342 tests/print-flags.pcap \
343 tests/print-flags.sh \
344 tests/print-x.out \
345 tests/print-xx.out \
346 tests/rsvp-infinite-loop.pcap \
347 tests/sflow_multiple_counter_30_pdus.out \
348 tests/sflow_multiple_counter_30_pdus.pcap \
349 vfprintf.c \
350 win32/Include/errno.h \
351 win32/Include/getopt.h \
352 win32/Include/w32_fzs.h \
353 win32/Src/getopt.c \
354 win32/prj/GNUmakefile \
355 win32/prj/WinDump.dsp \
356 win32/prj/WinDump.dsw
357
358all: $(PROG)
359
360$(PROG): $(OBJ) @V_PCAPDEP@
361 @rm -f $@
362 $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
363
364$(LIBNETDISSECT): $(LIBNETDISSECT_OBJ)
365 @rm -f $@
366 $(AR) cr $@ $(LIBNETDISSECT_OBJ)
367 $(RANLIB) $@
368
369datalinks.o: $(srcdir)/missing/datalinks.c
370 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
371dlnames.o: $(srcdir)/missing/dlnames.c
372 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c
373getnameinfo.o: $(srcdir)/missing/getnameinfo.c
374 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c
375getaddrinfo.o: $(srcdir)/missing/getaddrinfo.c
376 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getaddrinfo.c
377inet_pton.o: $(srcdir)/missing/inet_pton.c
378 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_pton.c
379inet_ntop.o: $(srcdir)/missing/inet_ntop.c
380 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_ntop.c
381inet_aton.o: $(srcdir)/missing/inet_aton.c
382 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_aton.c
383snprintf.o: $(srcdir)/missing/snprintf.c
384 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
385strlcat.o: $(srcdir)/missing/strlcat.c
386 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
387strlcpy.o: $(srcdir)/missing/strlcpy.c
388 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c
389strsep.o: $(srcdir)/missing/strsep.c
390 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c
391
392version.o: version.c
393 $(CC) $(FULL_CFLAGS) -c version.c
394
395version.c: $(srcdir)/VERSION
396 @rm -f $@
397 if grep GIT ${srcdir}/VERSION >/dev/null; then \
398 read ver <${srcdir}/VERSION; \
399 echo $$ver | tr -d '\012'; \
400 date +_%Y_%m_%d; \
401 else \
402 cat ${srcdir}/VERSION; \
403 fi | sed -e 's/.*/const char version[] = "&";/' > $@
404
405install: all
406 [ -d $(DESTDIR)$(sbindir) ] || \
407 (mkdir -p $(DESTDIR)$(sbindir); chmod 755 $(DESTDIR)$(sbindir))
408 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG)
409 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG).`cat ${srcdir}/VERSION`
410 [ -d $(DESTDIR)$(mandir)/man8 ] || \
411 (mkdir -p $(DESTDIR)$(mandir)/man8; chmod 755 $(DESTDIR)$(mandir)/man8)
412 $(INSTALL_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man8/$(PROG).8
413
414uninstall:
415 rm -f $(DESTDIR)$(sbindir)/$(PROG)
416 rm -f $(DESTDIR)$(mandir)/man8/$(PROG).8
417
418lint: $(GENSRC)
419 lint -hbxn $(SRC) | \
420 grep -v 'struct/union .* never defined' | \
421 grep -v 'possible pointer alignment problem'
422
423clean:
424 rm -f $(CLEANFILES) $(PROG)-`cat VERSION`.tar.gz
425
426distclean:
427 rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
428 config.h gnuc.h os-proto.h stamp-h stamp-h.in $(PROG).1
429 rm -rf autom4te.cache
430
431check: tcpdump
432 (cd tests && ./TESTrun.sh)
433
434tags: $(TAGFILES)
435 ctags -wtd $(TAGFILES)
436
437TAGS: $(TAGFILES)
438 etags $(TAGFILES)
439
440releasetar:
441 @cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
442 mkdir $$name; \
443 tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) | (cd $$name; tar xf -); \
444 tar -c -z -f $$name.tar.gz $$name; \
445 rm -rf $$name
446
447depend: $(GENSRC)
448 ${srcdir}/mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
4490
=== removed directory '.pc/20_man_fixes.diff'
=== removed file '.pc/20_man_fixes.diff/tcpdump.1.in'
--- .pc/20_man_fixes.diff/tcpdump.1.in 2012-01-02 20:19:22 +0000
+++ .pc/20_man_fixes.diff/tcpdump.1.in 1970-01-01 00:00:00 +0000
@@ -1,1744 +0,0 @@
1.\" @(#) $Header: /tcpdump/master/tcpdump/tcpdump.1.in,v 1.2 2008-11-09 23:35:03 mcr Exp $ (LBL)
2.\"
3.\" $NetBSD: tcpdump.8,v 1.9 2003/03/31 00:18:17 perry Exp $
4.\"
5.\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997
6.\" The Regents of the University of California. All rights reserved.
7.\" All rights reserved.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that: (1) source code distributions
11.\" retain the above copyright notice and this paragraph in its entirety, (2)
12.\" distributions including binary code include the above copyright notice and
13.\" this paragraph in its entirety in the documentation or other materials
14.\" provided with the distribution, and (3) all advertising materials mentioning
15.\" features or use of this software display the following acknowledgement:
16.\" ``This product includes software developed by the University of California,
17.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
18.\" the University nor the names of its contributors may be used to endorse
19.\" or promote products derived from this software without specific prior
20.\" written permission.
21.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
22.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
23.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
24.\"
25.TH TCPDUMP 1 "05 March 2009"
26.SH NAME
27tcpdump \- dump traffic on a network
28.SH SYNOPSIS
29.na
30.B tcpdump
31[
32.B \-AbdDefhHIJKlLnNOpqRStuUvxX
33] [
34.B \-B
35.I buffer_size
36] [
37.B \-c
38.I count
39]
40.br
41.ti +8
42[
43.B \-C
44.I file_size
45] [
46.B \-G
47.I rotate_seconds
48] [
49.B \-F
50.I file
51]
52.br
53.ti +8
54[
55.B \-i
56.I interface
57]
58[
59.B \-j
60.I tstamp_type
61]
62[
63.B \-m
64.I module
65]
66[
67.B \-M
68.I secret
69]
70.br
71.ti +8
72[
73.B \-r
74.I file
75]
76[
77.B \-s
78.I snaplen
79]
80[
81.B \-T
82.I type
83]
84[
85.B \-w
86.I file
87]
88.br
89.ti +8
90[
91.B \-W
92.I filecount
93]
94.br
95.ti +8
96[
97.B \-E
98.I spi@ipaddr algo:secret,...
99]
100.br
101.ti +8
102[
103.B \-y
104.I datalinktype
105]
106[
107.B \-z
108.I postrotate-command
109]
110[
111.B \-Z
112.I user
113]
114.ti +8
115[
116.I expression
117]
118.br
119.ad
120.SH DESCRIPTION
121.LP
122\fITcpdump\fP prints out a description of the contents of packets on a
123network interface that match the boolean \fIexpression\fP. It can also
124be run with the
125.B \-w
126flag, which causes it to save the packet data to a file for later
127analysis, and/or with the
128.B \-r
129flag, which causes it to read from a saved packet file rather than to
130read packets from a network interface. In all cases, only packets that
131match
132.I expression
133will be processed by
134.IR tcpdump .
135.LP
136.I Tcpdump
137will, if not run with the
138.B \-c
139flag, continue capturing packets until it is interrupted by a SIGINT
140signal (generated, for example, by typing your interrupt character,
141typically control-C) or a SIGTERM signal (typically generated with the
142.BR kill (1)
143command); if run with the
144.B \-c
145flag, it will capture packets until it is interrupted by a SIGINT or
146SIGTERM signal or the specified number of packets have been processed.
147.LP
148When
149.I tcpdump
150finishes capturing packets, it will report counts of:
151.IP
152packets ``captured'' (this is the number of packets that
153.I tcpdump
154has received and processed);
155.IP
156packets ``received by filter'' (the meaning of this depends on the OS on
157which you're running
158.IR tcpdump ,
159and possibly on the way the OS was configured - if a filter was
160specified on the command line, on some OSes it counts packets regardless
161of whether they were matched by the filter expression and, even if they
162were matched by the filter expression, regardless of whether
163.I tcpdump
164has read and processed them yet, on other OSes it counts only packets that were
165matched by the filter expression regardless of whether
166.I tcpdump
167has read and processed them yet, and on other OSes it counts only
168packets that were matched by the filter expression and were processed by
169.IR tcpdump );
170.IP
171packets ``dropped by kernel'' (this is the number of packets that were
172dropped, due to a lack of buffer space, by the packet capture mechanism
173in the OS on which
174.I tcpdump
175is running, if the OS reports that information to applications; if not,
176it will be reported as 0).
177.LP
178On platforms that support the SIGINFO signal, such as most BSDs
179(including Mac OS X) and Digital/Tru64 UNIX, it will report those counts
180when it receives a SIGINFO signal (generated, for example, by typing
181your ``status'' character, typically control-T, although on some
182platforms, such as Mac OS X, the ``status'' character is not set by
183default, so you must set it with
184.BR stty (1)
185in order to use it) and will continue capturing packets.
186.LP
187Reading packets from a network interface may require that you have
188special privileges; see the
189.B pcap (3PCAP)
190man page for details. Reading a saved packet file doesn't require
191special privileges.
192.SH OPTIONS
193.TP
194.B \-A
195Print each packet (minus its link level header) in ASCII. Handy for
196capturing web pages.
197.TP
198.B \-b
199Print the AS number in BGP packets in ASDOT notation rather than ASPLAIN
200notation.
201.TP
202.B \-B
203Set the operating system capture buffer size to \fIbuffer_size\fP.
204.TP
205.B \-c
206Exit after receiving \fIcount\fP packets.
207.TP
208.B \-C
209Before writing a raw packet to a savefile, check whether the file is
210currently larger than \fIfile_size\fP and, if so, close the current
211savefile and open a new one. Savefiles after the first savefile will
212have the name specified with the
213.B \-w
214flag, with a number after it, starting at 1 and continuing upward.
215The units of \fIfile_size\fP are millions of bytes (1,000,000 bytes,
216not 1,048,576 bytes).
217.TP
218.B \-d
219Dump the compiled packet-matching code in a human readable form to
220standard output and stop.
221.TP
222.B \-dd
223Dump packet-matching code as a
224.B C
225program fragment.
226.TP
227.B \-ddd
228Dump packet-matching code as decimal numbers (preceded with a count).
229.TP
230.B \-D
231Print the list of the network interfaces available on the system and on
232which
233.I tcpdump
234can capture packets. For each network interface, a number and an
235interface name, possibly followed by a text description of the
236interface, is printed. The interface name or the number can be supplied
237to the
238.B \-i
239flag to specify an interface on which to capture.
240.IP
241This can be useful on systems that don't have a command to list them
242(e.g., Windows systems, or UNIX systems lacking
243.BR "ifconfig \-a" );
244the number can be useful on Windows 2000 and later systems, where the
245interface name is a somewhat complex string.
246.IP
247The
248.B \-D
249flag will not be supported if
250.I tcpdump
251was built with an older version of
252.I libpcap
253that lacks the
254.B pcap_findalldevs()
255function.
256.TP
257.B \-e
258Print the link-level header on each dump line.
259.TP
260.B \-E
261Use \fIspi@ipaddr algo:secret\fP for decrypting IPsec ESP packets that
262are addressed to \fIaddr\fP and contain Security Parameter Index value
263\fIspi\fP. This combination may be repeated with comma or newline separation.
264.IP
265Note that setting the secret for IPv4 ESP packets is supported at this time.
266.IP
267Algorithms may be
268\fBdes-cbc\fP,
269\fB3des-cbc\fP,
270\fBblowfish-cbc\fP,
271\fBrc3-cbc\fP,
272\fBcast128-cbc\fP, or
273\fBnone\fP.
274The default is \fBdes-cbc\fP.
275The ability to decrypt packets is only present if \fItcpdump\fP was compiled
276with cryptography enabled.
277.IP
278\fIsecret\fP is the ASCII text for ESP secret key.
279If preceded by 0x, then a hex value will be read.
280.IP
281The option assumes RFC2406 ESP, not RFC1827 ESP.
282The option is only for debugging purposes, and
283the use of this option with a true `secret' key is discouraged.
284By presenting IPsec secret key onto command line
285you make it visible to others, via
286.IR ps (1)
287and other occasions.
288.IP
289In addition to the above syntax, the syntax \fIfile name\fP may be used
290to have tcpdump read the provided file in. The file is opened upon
291receiving the first ESP packet, so any special permissions that tcpdump
292may have been given should already have been given up.
293.TP
294.B \-f
295Print `foreign' IPv4 addresses numerically rather than symbolically
296(this option is intended to get around serious brain damage in
297Sun's NIS server \(em usually it hangs forever translating non-local
298internet numbers).
299.IP
300The test for `foreign' IPv4 addresses is done using the IPv4 address and
301netmask of the interface on which capture is being done. If that
302address or netmask are not available, available, either because the
303interface on which capture is being done has no address or netmask or
304because the capture is being done on the Linux "any" interface, which
305can capture on more than one interface, this option will not work
306correctly.
307.TP
308.B \-F
309Use \fIfile\fP as input for the filter expression.
310An additional expression given on the command line is ignored.
311.TP
312.B \-G
313If specified, rotates the dump file specified with the
314.B \-w
315option every \fIrotate_seconds\fP seconds.
316Savefiles will have the name specified by
317.B \-w
318which should include a time format as defined by
319.BR strftime (3).
320If no time format is specified, each new file will overwrite the previous.
321.IP
322If used in conjunction with the
323.B \-C
324option, filenames will take the form of `\fIfile\fP<count>'.
325.TP
326.B \-h
327Print the tcpdump and libpcap version strings, print a usage message,
328and exit.
329.TP
330.B \-H
331Attempt to detect 802.11s draft mesh headers.
332.TP
333.B \-i
334Listen on \fIinterface\fP.
335If unspecified, \fItcpdump\fP searches the system interface list for the
336lowest numbered, configured up interface (excluding loopback).
337Ties are broken by choosing the earliest match.
338.IP
339On Linux systems with 2.2 or later kernels, an
340.I interface
341argument of ``any'' can be used to capture packets from all interfaces.
342Note that captures on the ``any'' device will not be done in promiscuous
343mode.
344.IP
345If the
346.B \-D
347flag is supported, an interface number as printed by that flag can be
348used as the
349.I interface
350argument.
351.TP
352.B \-I
353Put the interface in "monitor mode"; this is supported only on IEEE
354802.11 Wi-Fi interfaces, and supported only on some operating systems.
355.IP
356Note that in monitor mode the adapter might disassociate from the
357network with which it's associated, so that you will not be able to use
358any wireless networks with that adapter. This could prevent accessing
359files on a network server, or resolving host names or network addresses,
360if you are capturing in monitor mode and are not connected to another
361network with another adapter.
362.IP
363This flag will affect the output of the
364.B \-L
365flag. If
366.B \-I
367isn't specified, only those link-layer types available when not in
368monitor mode will be shown; if
369.B \-I
370is specified, only those link-layer types available when in monitor mode
371will be shown.
372.TP
373.B \-j
374Set the time stamp type for the capture to \fItstamp_type\fP. The names
375to use for the time stamp types are given in
376.BR pcap-tstamp-type (@MAN_MISC_INFO@);
377not all the types listed there will necessarily be valid for any given
378interface.
379.TP
380.B \-J
381List the supported time stamp types for the interface and exit. If the
382time stamp type cannot be set for the interface, no time stamp types are
383listed.
384.TP
385.B \-K
386Don't attempt to verify IP, TCP, or UDP checksums. This is useful for
387interfaces that perform some or all of those checksum calculation in
388hardware; otherwise, all outgoing TCP checksums will be flagged as bad.
389.TP
390.B \-l
391Make stdout line buffered.
392Useful if you want to see the data
393while capturing it.
394E.g.,
395.br
396``tcpdump\ \ \-l\ \ |\ \ tee dat'' or
397``tcpdump\ \ \-l \ \ > dat\ \ &\ \ tail\ \ \-f\ \ dat''.
398.TP
399.B \-L
400List the known data link types for the interface, in the specified mode,
401and exit. The list of known data link types may be dependent on the
402specified mode; for example, on some platforms, a Wi-Fi interface might
403support one set of data link types when not in monitor mode (for
404example, it might support only fake Ethernet headers, or might support
405802.11 headers but not support 802.11 headers with radio information)
406and another set of data link types when in monitor mode (for example, it
407might support 802.11 headers, or 802.11 headers with radio information,
408only in monitor mode).
409.TP
410.B \-m
411Load SMI MIB module definitions from file \fImodule\fR.
412This option
413can be used several times to load several MIB modules into \fItcpdump\fP.
414.TP
415.B \-M
416Use \fIsecret\fP as a shared secret for validating the digests found in
417TCP segments with the TCP-MD5 option (RFC 2385), if present.
418.TP
419.B \-n
420Don't convert addresses (i.e., host addresses, port numbers, etc.) to names.
421.TP
422.B \-N
423Don't print domain name qualification of host names.
424E.g.,
425if you give this flag then \fItcpdump\fP will print ``nic''
426instead of ``nic.ddn.mil''.
427.TP
428.B \-O
429Do not run the packet-matching code optimizer.
430This is useful only
431if you suspect a bug in the optimizer.
432.TP
433.B \-p
434\fIDon't\fP put the interface
435into promiscuous mode.
436Note that the interface might be in promiscuous
437mode for some other reason; hence, `-p' cannot be used as an abbreviation for
438`ether host {local-hw-addr} or ether broadcast'.
439.TP
440.B \-q
441Quick (quiet?) output.
442Print less protocol information so output
443lines are shorter.
444.TP
445.B \-R
446Assume ESP/AH packets to be based on old specification (RFC1825 to RFC1829).
447If specified, \fItcpdump\fP will not print replay prevention field.
448Since there is no protocol version field in ESP/AH specification,
449\fItcpdump\fP cannot deduce the version of ESP/AH protocol.
450.TP
451.B \-r
452Read packets from \fIfile\fR (which was created with the
453.B \-w
454option).
455Standard input is used if \fIfile\fR is ``-''.
456.TP
457.B \-S
458Print absolute, rather than relative, TCP sequence numbers.
459.TP
460.B \-s
461Snarf \fIsnaplen\fP bytes of data from each packet rather than the
462default of 65535 bytes.
463Packets truncated because of a limited snapshot
464are indicated in the output with ``[|\fIproto\fP]'', where \fIproto\fP
465is the name of the protocol level at which the truncation has occurred.
466Note that taking larger snapshots both increases
467the amount of time it takes to process packets and, effectively,
468decreases the amount of packet buffering.
469This may cause packets to be
470lost.
471You should limit \fIsnaplen\fP to the smallest number that will
472capture the protocol information you're interested in.
473Setting
474\fIsnaplen\fP to 0 sets it to the default of 65535,
475for backwards compatibility with recent older versions of
476.IR tcpdump .
477.TP
478.B \-T
479Force packets selected by "\fIexpression\fP" to be interpreted the
480specified \fItype\fR.
481Currently known types are
482\fBaodv\fR (Ad-hoc On-demand Distance Vector protocol),
483\fBcnfp\fR (Cisco NetFlow protocol),
484\fBrpc\fR (Remote Procedure Call),
485\fBrtp\fR (Real-Time Applications protocol),
486\fBrtcp\fR (Real-Time Applications control protocol),
487\fBsnmp\fR (Simple Network Management Protocol),
488\fBtftp\fR (Trivial File Transfer Protocol),
489\fBvat\fR (Visual Audio Tool),
490and
491\fBwb\fR (distributed White Board).
492.TP
493.B \-t
494\fIDon't\fP print a timestamp on each dump line.
495.TP
496.B \-tt
497Print an unformatted timestamp on each dump line.
498.TP
499.B \-ttt
500Print a delta (micro-second resolution) between current and previous line
501on each dump line.
502.TP
503.B \-tttt
504Print a timestamp in default format proceeded by date on each dump line.
505.TP
506.B \-ttttt
507Print a delta (micro-second resolution) between current and first line
508on each dump line.
509.TP
510.B \-u
511Print undecoded NFS handles.
512.TP
513.B \-U
514Make output saved via the
515.B \-w
516option ``packet-buffered''; i.e., as each packet is saved, it will be
517written to the output file, rather than being written only when the
518output buffer fills.
519.IP
520The
521.B \-U
522flag will not be supported if
523.I tcpdump
524was built with an older version of
525.I libpcap
526that lacks the
527.B pcap_dump_flush()
528function.
529.TP
530.B \-v
531When parsing and printing, produce (slightly more) verbose output.
532For example, the time to live,
533identification, total length and options in an IP packet are printed.
534Also enables additional packet integrity checks such as verifying the
535IP and ICMP header checksum.
536.IP
537When writing to a file with the
538.B \-w
539option, report, every 10 seconds, the number of packets captured.
540.TP
541.B \-vv
542Even more verbose output.
543For example, additional fields are
544printed from NFS reply packets, and SMB packets are fully decoded.
545.TP
546.B \-vvv
547Even more verbose output.
548For example,
549telnet \fBSB\fP ... \fBSE\fP options
550are printed in full.
551With
552.B \-X
553Telnet options are printed in hex as well.
554.TP
555.B \-w
556Write the raw packets to \fIfile\fR rather than parsing and printing
557them out.
558They can later be printed with the \-r option.
559Standard output is used if \fIfile\fR is ``-''.
560See
561.BR pcap-savefile (@MAN_FILE_FORMATS@)
562for a description of the file format.
563.TP
564.B \-W
565Used in conjunction with the
566.B \-C
567option, this will limit the number
568of files created to the specified number, and begin overwriting files
569from the beginning, thus creating a 'rotating' buffer.
570In addition, it will name
571the files with enough leading 0s to support the maximum number of
572files, allowing them to sort correctly.
573.IP
574Used in conjunction with the
575.B \-G
576option, this will limit the number of rotated dump files that get
577created, exiting with status 0 when reaching the limit. If used with
578.B \-C
579as well, the behavior will result in cyclical files per timeslice.
580.TP
581.B \-x
582When parsing and printing,
583in addition to printing the headers of each packet, print the data of
584each packet (minus its link level header) in hex.
585The smaller of the entire packet or
586.I snaplen
587bytes will be printed. Note that this is the entire link-layer
588packet, so for link layers that pad (e.g. Ethernet), the padding bytes
589will also be printed when the higher layer packet is shorter than the
590required padding.
591.TP
592.B \-xx
593When parsing and printing,
594in addition to printing the headers of each packet, print the data of
595each packet,
596.I including
597its link level header, in hex.
598.TP
599.B \-X
600When parsing and printing,
601in addition to printing the headers of each packet, print the data of
602each packet (minus its link level header) in hex and ASCII.
603This is very handy for analysing new protocols.
604.TP
605.B \-XX
606When parsing and printing,
607in addition to printing the headers of each packet, print the data of
608each packet,
609.I including
610its link level header, in hex and ASCII.
611.TP
612.B \-y
613Set the data link type to use while capturing packets to \fIdatalinktype\fP.
614.TP
615.B \-z
616Used in conjunction with the
617.B -C
618or
619.B -G
620options, this will make
621.I tcpdump
622run "
623.I command file
624" where
625.I file
626is the savefile being closed after each rotation. For example, specifying
627.B \-z gzip
628or
629.B \-z bzip2
630will compress each savefile using gzip or bzip2.
631.IP
632Note that tcpdump will run the command in parallel to the capture, using
633the lowest priority so that this doesn't disturb the capture process.
634.IP
635And in case you would like to use a command that itself takes flags or
636different arguments, you can always write a shell script that will take the
637savefile name as the only argument, make the flags & arguments arrangements
638and execute the command that you want.
639.TP
640.B \-Z
641If
642.I tcpdump
643is running as root, after opening the capture device or input savefile,
644but before opening any savefiles for output, change the user ID to
645.I user
646and the group ID to the primary group of
647.IR user .
648.IP
649This behavior can also be enabled by default at compile time.
650.IP "\fI expression\fP"
651.RS
652selects which packets will be dumped.
653If no \fIexpression\fP
654is given, all packets on the net will be dumped.
655Otherwise,
656only packets for which \fIexpression\fP is `true' will be dumped.
657.LP
658For the \fIexpression\fP syntax, see
659.BR pcap-filter (@MAN_MISC_INFO@).
660.LP
661Expression arguments can be passed to \fItcpdump\fP as either a single
662argument or as multiple arguments, whichever is more convenient.
663Generally, if the expression contains Shell metacharacters, it is
664easier to pass it as a single, quoted argument.
665Multiple arguments are concatenated with spaces before being parsed.
666.SH EXAMPLES
667.LP
668To print all packets arriving at or departing from \fIsundown\fP:
669.RS
670.nf
671\fBtcpdump host sundown\fP
672.fi
673.RE
674.LP
675To print traffic between \fIhelios\fR and either \fIhot\fR or \fIace\fR:
676.RS
677.nf
678\fBtcpdump host helios and \\( hot or ace \\)\fP
679.fi
680.RE
681.LP
682To print all IP packets between \fIace\fR and any host except \fIhelios\fR:
683.RS
684.nf
685\fBtcpdump ip host ace and not helios\fP
686.fi
687.RE
688.LP
689To print all traffic between local hosts and hosts at Berkeley:
690.RS
691.nf
692.B
693tcpdump net ucb-ether
694.fi
695.RE
696.LP
697To print all ftp traffic through internet gateway \fIsnup\fP:
698(note that the expression is quoted to prevent the shell from
699(mis-)interpreting the parentheses):
700.RS
701.nf
702.B
703tcpdump 'gateway snup and (port ftp or ftp-data)'
704.fi
705.RE
706.LP
707To print traffic neither sourced from nor destined for local hosts
708(if you gateway to one other net, this stuff should never make it
709onto your local net).
710.RS
711.nf
712.B
713tcpdump ip and not net \fIlocalnet\fP
714.fi
715.RE
716.LP
717To print the start and end packets (the SYN and FIN packets) of each
718TCP conversation that involves a non-local host.
719.RS
720.nf
721.B
722tcpdump 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net \fIlocalnet\fP'
723.fi
724.RE
725.LP
726To print all IPv4 HTTP packets to and from port 80, i.e. print only
727packets that contain data, not, for example, SYN and FIN packets and
728ACK-only packets. (IPv6 is left as an exercise for the reader.)
729.RS
730.nf
731.B
732tcpdump 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
733.fi
734.RE
735.LP
736To print IP packets longer than 576 bytes sent through gateway \fIsnup\fP:
737.RS
738.nf
739.B
740tcpdump 'gateway snup and ip[2:2] > 576'
741.fi
742.RE
743.LP
744To print IP broadcast or multicast packets that were
745.I not
746sent via Ethernet broadcast or multicast:
747.RS
748.nf
749.B
750tcpdump 'ether[0] & 1 = 0 and ip[16] >= 224'
751.fi
752.RE
753.LP
754To print all ICMP packets that are not echo requests/replies (i.e., not
755ping packets):
756.RS
757.nf
758.B
759tcpdump 'icmp[icmptype] != icmp-echo and icmp[icmptype] != icmp-echoreply'
760.fi
761.RE
762.SH OUTPUT FORMAT
763.LP
764The output of \fItcpdump\fP is protocol dependent.
765The following
766gives a brief description and examples of most of the formats.
767.de HD
768.sp 1.5
769.B
770..
771.HD
772Link Level Headers
773.LP
774If the '-e' option is given, the link level header is printed out.
775On Ethernets, the source and destination addresses, protocol,
776and packet length are printed.
777.LP
778On FDDI networks, the '-e' option causes \fItcpdump\fP to print
779the `frame control' field, the source and destination addresses,
780and the packet length.
781(The `frame control' field governs the
782interpretation of the rest of the packet.
783Normal packets (such
784as those containing IP datagrams) are `async' packets, with a priority
785value between 0 and 7; for example, `\fBasync4\fR'.
786Such packets
787are assumed to contain an 802.2 Logical Link Control (LLC) packet;
788the LLC header is printed if it is \fInot\fR an ISO datagram or a
789so-called SNAP packet.
790.LP
791On Token Ring networks, the '-e' option causes \fItcpdump\fP to print
792the `access control' and `frame control' fields, the source and
793destination addresses, and the packet length.
794As on FDDI networks,
795packets are assumed to contain an LLC packet.
796Regardless of whether
797the '-e' option is specified or not, the source routing information is
798printed for source-routed packets.
799.LP
800On 802.11 networks, the '-e' option causes \fItcpdump\fP to print
801the `frame control' fields, all of the addresses in the 802.11 header,
802and the packet length.
803As on FDDI networks,
804packets are assumed to contain an LLC packet.
805.LP
806\fI(N.B.: The following description assumes familiarity with
807the SLIP compression algorithm described in RFC-1144.)\fP
808.LP
809On SLIP links, a direction indicator (``I'' for inbound, ``O'' for outbound),
810packet type, and compression information are printed out.
811The packet type is printed first.
812The three types are \fIip\fP, \fIutcp\fP, and \fIctcp\fP.
813No further link information is printed for \fIip\fR packets.
814For TCP packets, the connection identifier is printed following the type.
815If the packet is compressed, its encoded header is printed out.
816The special cases are printed out as
817\fB*S+\fIn\fR and \fB*SA+\fIn\fR, where \fIn\fR is the amount by which
818the sequence number (or sequence number and ack) has changed.
819If it is not a special case,
820zero or more changes are printed.
821A change is indicated by U (urgent pointer), W (window), A (ack),
822S (sequence number), and I (packet ID), followed by a delta (+n or -n),
823or a new value (=n).
824Finally, the amount of data in the packet and compressed header length
825are printed.
826.LP
827For example, the following line shows an outbound compressed TCP packet,
828with an implicit connection identifier; the ack has changed by 6,
829the sequence number by 49, and the packet ID by 6; there are 3 bytes of
830data and 6 bytes of compressed header:
831.RS
832.nf
833\fBO ctcp * A+6 S+49 I+6 3 (6)\fP
834.fi
835.RE
836.HD
837ARP/RARP Packets
838.LP
839Arp/rarp output shows the type of request and its arguments.
840The
841format is intended to be self explanatory.
842Here is a short sample taken from the start of an `rlogin' from
843host \fIrtsg\fP to host \fIcsam\fP:
844.RS
845.nf
846.sp .5
847\f(CWarp who-has csam tell rtsg
848arp reply csam is-at CSAM\fR
849.sp .5
850.fi
851.RE
852The first line says that rtsg sent an arp packet asking
853for the Ethernet address of internet host csam.
854Csam
855replies with its Ethernet address (in this example, Ethernet addresses
856are in caps and internet addresses in lower case).
857.LP
858This would look less redundant if we had done \fItcpdump \-n\fP:
859.RS
860.nf
861.sp .5
862\f(CWarp who-has 128.3.254.6 tell 128.3.254.68
863arp reply 128.3.254.6 is-at 02:07:01:00:01:c4\fP
864.fi
865.RE
866.LP
867If we had done \fItcpdump \-e\fP, the fact that the first packet is
868broadcast and the second is point-to-point would be visible:
869.RS
870.nf
871.sp .5
872\f(CWRTSG Broadcast 0806 64: arp who-has csam tell rtsg
873CSAM RTSG 0806 64: arp reply csam is-at CSAM\fR
874.sp .5
875.fi
876.RE
877For the first packet this says the Ethernet source address is RTSG, the
878destination is the Ethernet broadcast address, the type field
879contained hex 0806 (type ETHER_ARP) and the total length was 64 bytes.
880.HD
881TCP Packets
882.LP
883\fI(N.B.:The following description assumes familiarity with
884the TCP protocol described in RFC-793.
885If you are not familiar
886with the protocol, neither this description nor \fItcpdump\fP will
887be of much use to you.)\fP
888.LP
889The general format of a tcp protocol line is:
890.RS
891.nf
892.sp .5
893\fIsrc > dst: flags data-seqno ack window urgent options\fP
894.sp .5
895.fi
896.RE
897\fISrc\fP and \fIdst\fP are the source and destination IP
898addresses and ports.
899\fIFlags\fP are some combination of S (SYN),
900F (FIN), P (PUSH), R (RST), U (URG), W (ECN CWR), E (ECN-Echo) or
901`.' (ACK), or `none' if no flags are set.
902\fIData-seqno\fP describes the portion of sequence space covered
903by the data in this packet (see example below).
904\fIAck\fP is sequence number of the next data expected the other
905direction on this connection.
906\fIWindow\fP is the number of bytes of receive buffer space available
907the other direction on this connection.
908\fIUrg\fP indicates there is `urgent' data in the packet.
909\fIOptions\fP are tcp options enclosed in angle brackets (e.g., <mss 1024>).
910.LP
911\fISrc, dst\fP and \fIflags\fP are always present.
912The other fields
913depend on the contents of the packet's tcp protocol header and
914are output only if appropriate.
915.LP
916Here is the opening portion of an rlogin from host \fIrtsg\fP to
917host \fIcsam\fP.
918.RS
919.nf
920.sp .5
921\s-2\f(CWrtsg.1023 > csam.login: S 768512:768512(0) win 4096 <mss 1024>
922csam.login > rtsg.1023: S 947648:947648(0) ack 768513 win 4096 <mss 1024>
923rtsg.1023 > csam.login: . ack 1 win 4096
924rtsg.1023 > csam.login: P 1:2(1) ack 1 win 4096
925csam.login > rtsg.1023: . ack 2 win 4096
926rtsg.1023 > csam.login: P 2:21(19) ack 1 win 4096
927csam.login > rtsg.1023: P 1:2(1) ack 21 win 4077
928csam.login > rtsg.1023: P 2:3(1) ack 21 win 4077 urg 1
929csam.login > rtsg.1023: P 3:4(1) ack 21 win 4077 urg 1\fR\s+2
930.sp .5
931.fi
932.RE
933The first line says that tcp port 1023 on rtsg sent a packet
934to port \fIlogin\fP
935on csam.
936The \fBS\fP indicates that the \fISYN\fP flag was set.
937The packet sequence number was 768512 and it contained no data.
938(The notation is `first:last(nbytes)' which means `sequence
939numbers \fIfirst\fP
940up to but not including \fIlast\fP which is \fInbytes\fP bytes of user data'.)
941There was no piggy-backed ack, the available receive window was 4096
942bytes and there was a max-segment-size option requesting an mss of
9431024 bytes.
944.LP
945Csam replies with a similar packet except it includes a piggy-backed
946ack for rtsg's SYN.
947Rtsg then acks csam's SYN.
948The `.' means the ACK flag was set.
949The packet contained no data so there is no data sequence number.
950Note that the ack sequence
951number is a small integer (1).
952The first time \fItcpdump\fP sees a
953tcp `conversation', it prints the sequence number from the packet.
954On subsequent packets of the conversation, the difference between
955the current packet's sequence number and this initial sequence number
956is printed.
957This means that sequence numbers after the
958first can be interpreted
959as relative byte positions in the conversation's data stream (with the
960first data byte each direction being `1').
961`-S' will override this
962feature, causing the original sequence numbers to be output.
963.LP
964On the 6th line, rtsg sends csam 19 bytes of data (bytes 2 through 20
965in the rtsg \(-> csam side of the conversation).
966The PUSH flag is set in the packet.
967On the 7th line, csam says it's received data sent by rtsg up to
968but not including byte 21.
969Most of this data is apparently sitting in the
970socket buffer since csam's receive window has gotten 19 bytes smaller.
971Csam also sends one byte of data to rtsg in this packet.
972On the 8th and 9th lines,
973csam sends two bytes of urgent, pushed data to rtsg.
974.LP
975If the snapshot was small enough that \fItcpdump\fP didn't capture
976the full TCP header, it interprets as much of the header as it can
977and then reports ``[|\fItcp\fP]'' to indicate the remainder could not
978be interpreted.
979If the header contains a bogus option (one with a length
980that's either too small or beyond the end of the header), \fItcpdump\fP
981reports it as ``[\fIbad opt\fP]'' and does not interpret any further
982options (since it's impossible to tell where they start).
983If the header
984length indicates options are present but the IP datagram length is not
985long enough for the options to actually be there, \fItcpdump\fP reports
986it as ``[\fIbad hdr length\fP]''.
987.HD
988.B Capturing TCP packets with particular flag combinations (SYN-ACK, URG-ACK, etc.)
989.PP
990There are 8 bits in the control bits section of the TCP header:
991.IP
992.I CWR | ECE | URG | ACK | PSH | RST | SYN | FIN
993.PP
994Let's assume that we want to watch packets used in establishing
995a TCP connection.
996Recall that TCP uses a 3-way handshake protocol
997when it initializes a new connection; the connection sequence with
998regard to the TCP control bits is
999.PP
1000.RS
10011) Caller sends SYN
1002.RE
1003.RS
10042) Recipient responds with SYN, ACK
1005.RE
1006.RS
10073) Caller sends ACK
1008.RE
1009.PP
1010Now we're interested in capturing packets that have only the
1011SYN bit set (Step 1).
1012Note that we don't want packets from step 2
1013(SYN-ACK), just a plain initial SYN.
1014What we need is a correct filter
1015expression for \fItcpdump\fP.
1016.PP
1017Recall the structure of a TCP header without options:
1018.PP
1019.nf
1020 0 15 31
1021-----------------------------------------------------------------
1022| source port | destination port |
1023-----------------------------------------------------------------
1024| sequence number |
1025-----------------------------------------------------------------
1026| acknowledgment number |
1027-----------------------------------------------------------------
1028| HL | rsvd |C|E|U|A|P|R|S|F| window size |
1029-----------------------------------------------------------------
1030| TCP checksum | urgent pointer |
1031-----------------------------------------------------------------
1032.fi
1033.PP
1034A TCP header usually holds 20 octets of data, unless options are
1035present.
1036The first line of the graph contains octets 0 - 3, the
1037second line shows octets 4 - 7 etc.
1038.PP
1039Starting to count with 0, the relevant TCP control bits are contained
1040in octet 13:
1041.PP
1042.nf
1043 0 7| 15| 23| 31
1044----------------|---------------|---------------|----------------
1045| HL | rsvd |C|E|U|A|P|R|S|F| window size |
1046----------------|---------------|---------------|----------------
1047| | 13th octet | | |
1048.fi
1049.PP
1050Let's have a closer look at octet no. 13:
1051.PP
1052.nf
1053 | |
1054 |---------------|
1055 |C|E|U|A|P|R|S|F|
1056 |---------------|
1057 |7 5 3 0|
1058.fi
1059.PP
1060These are the TCP control bits we are interested
1061in.
1062We have numbered the bits in this octet from 0 to 7, right to
1063left, so the PSH bit is bit number 3, while the URG bit is number 5.
1064.PP
1065Recall that we want to capture packets with only SYN set.
1066Let's see what happens to octet 13 if a TCP datagram arrives
1067with the SYN bit set in its header:
1068.PP
1069.nf
1070 |C|E|U|A|P|R|S|F|
1071 |---------------|
1072 |0 0 0 0 0 0 1 0|
1073 |---------------|
1074 |7 6 5 4 3 2 1 0|
1075.fi
1076.PP
1077Looking at the
1078control bits section we see that only bit number 1 (SYN) is set.
1079.PP
1080Assuming that octet number 13 is an 8-bit unsigned integer in
1081network byte order, the binary value of this octet is
1082.IP
108300000010
1084.PP
1085and its decimal representation is
1086.PP
1087.nf
1088 7 6 5 4 3 2 1 0
10890*2 + 0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 1*2 + 0*2 = 2
1090.fi
1091.PP
1092We're almost done, because now we know that if only SYN is set,
1093the value of the 13th octet in the TCP header, when interpreted
1094as a 8-bit unsigned integer in network byte order, must be exactly 2.
1095.PP
1096This relationship can be expressed as
1097.RS
1098.B
1099tcp[13] == 2
1100.RE
1101.PP
1102We can use this expression as the filter for \fItcpdump\fP in order
1103to watch packets which have only SYN set:
1104.RS
1105.B
1106tcpdump -i xl0 tcp[13] == 2
1107.RE
1108.PP
1109The expression says "let the 13th octet of a TCP datagram have
1110the decimal value 2", which is exactly what we want.
1111.PP
1112Now, let's assume that we need to capture SYN packets, but we
1113don't care if ACK or any other TCP control bit is set at the
1114same time.
1115Let's see what happens to octet 13 when a TCP datagram
1116with SYN-ACK set arrives:
1117.PP
1118.nf
1119 |C|E|U|A|P|R|S|F|
1120 |---------------|
1121 |0 0 0 1 0 0 1 0|
1122 |---------------|
1123 |7 6 5 4 3 2 1 0|
1124.fi
1125.PP
1126Now bits 1 and 4 are set in the 13th octet.
1127The binary value of
1128octet 13 is
1129.IP
1130 00010010
1131.PP
1132which translates to decimal
1133.PP
1134.nf
1135 7 6 5 4 3 2 1 0
11360*2 + 0*2 + 0*2 + 1*2 + 0*2 + 0*2 + 1*2 + 0*2 = 18
1137.fi
1138.PP
1139Now we can't just use 'tcp[13] == 18' in the \fItcpdump\fP filter
1140expression, because that would select only those packets that have
1141SYN-ACK set, but not those with only SYN set.
1142Remember that we don't care
1143if ACK or any other control bit is set as long as SYN is set.
1144.PP
1145In order to achieve our goal, we need to logically AND the
1146binary value of octet 13 with some other value to preserve
1147the SYN bit.
1148We know that we want SYN to be set in any case,
1149so we'll logically AND the value in the 13th octet with
1150the binary value of a SYN:
1151.PP
1152.nf
1153
1154 00010010 SYN-ACK 00000010 SYN
1155 AND 00000010 (we want SYN) AND 00000010 (we want SYN)
1156 -------- --------
1157 = 00000010 = 00000010
1158.fi
1159.PP
1160We see that this AND operation delivers the same result
1161regardless whether ACK or another TCP control bit is set.
1162The decimal representation of the AND value as well as
1163the result of this operation is 2 (binary 00000010),
1164so we know that for packets with SYN set the following
1165relation must hold true:
1166.IP
1167( ( value of octet 13 ) AND ( 2 ) ) == ( 2 )
1168.PP
1169This points us to the \fItcpdump\fP filter expression
1170.RS
1171.B
1172 tcpdump -i xl0 'tcp[13] & 2 == 2'
1173.RE
1174.PP
1175Some offsets and field values may be expressed as names
1176rather than as numeric values. For example tcp[13] may
1177be replaced with tcp[tcpflags]. The following TCP flag
1178field values are also available: tcp-fin, tcp-syn, tcp-rst,
1179tcp-push, tcp-act, tcp-urg.
1180.PP
1181This can be demonstrated as:
1182.RS
1183.B
1184 tcpdump -i xl0 'tcp[tcpflags] & tcp-push != 0'
1185.RE
1186.PP
1187Note that you should use single quotes or a backslash
1188in the expression to hide the AND ('&') special character
1189from the shell.
1190.HD
1191.B
1192UDP Packets
1193.LP
1194UDP format is illustrated by this rwho packet:
1195.RS
1196.nf
1197.sp .5
1198\f(CWactinide.who > broadcast.who: udp 84\fP
1199.sp .5
1200.fi
1201.RE
1202This says that port \fIwho\fP on host \fIactinide\fP sent a udp
1203datagram to port \fIwho\fP on host \fIbroadcast\fP, the Internet
1204broadcast address.
1205The packet contained 84 bytes of user data.
1206.LP
1207Some UDP services are recognized (from the source or destination
1208port number) and the higher level protocol information printed.
1209In particular, Domain Name service requests (RFC-1034/1035) and Sun
1210RPC calls (RFC-1050) to NFS.
1211.HD
1212UDP Name Server Requests
1213.LP
1214\fI(N.B.:The following description assumes familiarity with
1215the Domain Service protocol described in RFC-1035.
1216If you are not familiar
1217with the protocol, the following description will appear to be written
1218in greek.)\fP
1219.LP
1220Name server requests are formatted as
1221.RS
1222.nf
1223.sp .5
1224\fIsrc > dst: id op? flags qtype qclass name (len)\fP
1225.sp .5
1226\f(CWh2opolo.1538 > helios.domain: 3+ A? ucbvax.berkeley.edu. (37)\fR
1227.sp .5
1228.fi
1229.RE
1230Host \fIh2opolo\fP asked the domain server on \fIhelios\fP for an
1231address record (qtype=A) associated with the name \fIucbvax.berkeley.edu.\fP
1232The query id was `3'.
1233The `+' indicates the \fIrecursion desired\fP flag
1234was set.
1235The query length was 37 bytes, not including the UDP and
1236IP protocol headers.
1237The query operation was the normal one, \fIQuery\fP,
1238so the op field was omitted.
1239If the op had been anything else, it would
1240have been printed between the `3' and the `+'.
1241Similarly, the qclass was the normal one,
1242\fIC_IN\fP, and omitted.
1243Any other qclass would have been printed
1244immediately after the `A'.
1245.LP
1246A few anomalies are checked and may result in extra fields enclosed in
1247square brackets: If a query contains an answer, authority records or
1248additional records section,
1249.IR ancount ,
1250.IR nscount ,
1251or
1252.I arcount
1253are printed as `[\fIn\fPa]', `[\fIn\fPn]' or `[\fIn\fPau]' where \fIn\fP
1254is the appropriate count.
1255If any of the response bits are set (AA, RA or rcode) or any of the
1256`must be zero' bits are set in bytes two and three, `[b2&3=\fIx\fP]'
1257is printed, where \fIx\fP is the hex value of header bytes two and three.
1258.HD
1259UDP Name Server Responses
1260.LP
1261Name server responses are formatted as
1262.RS
1263.nf
1264.sp .5
1265\fIsrc > dst: id op rcode flags a/n/au type class data (len)\fP
1266.sp .5
1267\f(CWhelios.domain > h2opolo.1538: 3 3/3/7 A 128.32.137.3 (273)
1268helios.domain > h2opolo.1537: 2 NXDomain* 0/1/0 (97)\fR
1269.sp .5
1270.fi
1271.RE
1272In the first example, \fIhelios\fP responds to query id 3 from \fIh2opolo\fP
1273with 3 answer records, 3 name server records and 7 additional records.
1274The first answer record is type A (address) and its data is internet
1275address 128.32.137.3.
1276The total size of the response was 273 bytes,
1277excluding UDP and IP headers.
1278The op (Query) and response code
1279(NoError) were omitted, as was the class (C_IN) of the A record.
1280.LP
1281In the second example, \fIhelios\fP responds to query 2 with a
1282response code of non-existent domain (NXDomain) with no answers,
1283one name server and no authority records.
1284The `*' indicates that
1285the \fIauthoritative answer\fP bit was set.
1286Since there were no
1287answers, no type, class or data were printed.
1288.LP
1289Other flag characters that might appear are `\-' (recursion available,
1290RA, \fInot\fP set) and `|' (truncated message, TC, set).
1291If the
1292`question' section doesn't contain exactly one entry, `[\fIn\fPq]'
1293is printed.
1294.HD
1295SMB/CIFS decoding
1296.LP
1297\fItcpdump\fP now includes fairly extensive SMB/CIFS/NBT decoding for data
1298on UDP/137, UDP/138 and TCP/139.
1299Some primitive decoding of IPX and
1300NetBEUI SMB data is also done.
1301.LP
1302By default a fairly minimal decode is done, with a much more detailed
1303decode done if -v is used.
1304Be warned that with -v a single SMB packet
1305may take up a page or more, so only use -v if you really want all the
1306gory details.
1307.LP
1308For information on SMB packet formats and what all the fields mean see
1309www.cifs.org or the pub/samba/specs/ directory on your favorite
1310samba.org mirror site.
1311The SMB patches were written by Andrew Tridgell
1312(tridge@samba.org).
1313.HD
1314NFS Requests and Replies
1315.LP
1316Sun NFS (Network File System) requests and replies are printed as:
1317.RS
1318.nf
1319.sp .5
1320\fIsrc.xid > dst.nfs: len op args\fP
1321\fIsrc.nfs > dst.xid: reply stat len op results\fP
1322.sp .5
1323\f(CW
1324sushi.6709 > wrl.nfs: 112 readlink fh 21,24/10.73165
1325wrl.nfs > sushi.6709: reply ok 40 readlink "../var"
1326sushi.201b > wrl.nfs:
1327 144 lookup fh 9,74/4096.6878 "xcolors"
1328wrl.nfs > sushi.201b:
1329 reply ok 128 lookup fh 9,74/4134.3150
1330\fR
1331.sp .5
1332.fi
1333.RE
1334In the first line, host \fIsushi\fP sends a transaction with id \fI6709\fP
1335to \fIwrl\fP (note that the number following the src host is a
1336transaction id, \fInot\fP the source port).
1337The request was 112 bytes,
1338excluding the UDP and IP headers.
1339The operation was a \fIreadlink\fP
1340(read symbolic link) on file handle (\fIfh\fP) 21,24/10.731657119.
1341(If one is lucky, as in this case, the file handle can be interpreted
1342as a major,minor device number pair, followed by the inode number and
1343generation number.)
1344\fIWrl\fP replies `ok' with the contents of the link.
1345.LP
1346In the third line, \fIsushi\fP asks \fIwrl\fP to lookup the name
1347`\fIxcolors\fP' in directory file 9,74/4096.6878.
1348Note that the data printed
1349depends on the operation type.
1350The format is intended to be self
1351explanatory if read in conjunction with
1352an NFS protocol spec.
1353.LP
1354If the \-v (verbose) flag is given, additional information is printed.
1355For example:
1356.RS
1357.nf
1358.sp .5
1359\f(CW
1360sushi.1372a > wrl.nfs:
1361 148 read fh 21,11/12.195 8192 bytes @ 24576
1362wrl.nfs > sushi.1372a:
1363 reply ok 1472 read REG 100664 ids 417/0 sz 29388
1364\fP
1365.sp .5
1366.fi
1367.RE
1368(\-v also prints the IP header TTL, ID, length, and fragmentation fields,
1369which have been omitted from this example.) In the first line,
1370\fIsushi\fP asks \fIwrl\fP to read 8192 bytes from file 21,11/12.195,
1371at byte offset 24576.
1372\fIWrl\fP replies `ok'; the packet shown on the
1373second line is the first fragment of the reply, and hence is only 1472
1374bytes long (the other bytes will follow in subsequent fragments, but
1375these fragments do not have NFS or even UDP headers and so might not be
1376printed, depending on the filter expression used).
1377Because the \-v flag
1378is given, some of the file attributes (which are returned in addition
1379to the file data) are printed: the file type (``REG'', for regular file),
1380the file mode (in octal), the uid and gid, and the file size.
1381.LP
1382If the \-v flag is given more than once, even more details are printed.
1383.LP
1384Note that NFS requests are very large and much of the detail won't be printed
1385unless \fIsnaplen\fP is increased.
1386Try using `\fB\-s 192\fP' to watch
1387NFS traffic.
1388.LP
1389NFS reply packets do not explicitly identify the RPC operation.
1390Instead,
1391\fItcpdump\fP keeps track of ``recent'' requests, and matches them to the
1392replies using the transaction ID.
1393If a reply does not closely follow the
1394corresponding request, it might not be parsable.
1395.HD
1396AFS Requests and Replies
1397.LP
1398Transarc AFS (Andrew File System) requests and replies are printed
1399as:
1400.HD
1401.RS
1402.nf
1403.sp .5
1404\fIsrc.sport > dst.dport: rx packet-type\fP
1405\fIsrc.sport > dst.dport: rx packet-type service call call-name args\fP
1406\fIsrc.sport > dst.dport: rx packet-type service reply call-name args\fP
1407.sp .5
1408\f(CW
1409elvis.7001 > pike.afsfs:
1410 rx data fs call rename old fid 536876964/1/1 ".newsrc.new"
1411 new fid 536876964/1/1 ".newsrc"
1412pike.afsfs > elvis.7001: rx data fs reply rename
1413\fR
1414.sp .5
1415.fi
1416.RE
1417In the first line, host elvis sends a RX packet to pike.
1418This was
1419a RX data packet to the fs (fileserver) service, and is the start of
1420an RPC call.
1421The RPC call was a rename, with the old directory file id
1422of 536876964/1/1 and an old filename of `.newsrc.new', and a new directory
1423file id of 536876964/1/1 and a new filename of `.newsrc'.
1424The host pike
1425responds with a RPC reply to the rename call (which was successful, because
1426it was a data packet and not an abort packet).
1427.LP
1428In general, all AFS RPCs are decoded at least by RPC call name.
1429Most
1430AFS RPCs have at least some of the arguments decoded (generally only
1431the `interesting' arguments, for some definition of interesting).
1432.LP
1433The format is intended to be self-describing, but it will probably
1434not be useful to people who are not familiar with the workings of
1435AFS and RX.
1436.LP
1437If the -v (verbose) flag is given twice, acknowledgement packets and
1438additional header information is printed, such as the the RX call ID,
1439call number, sequence number, serial number, and the RX packet flags.
1440.LP
1441If the -v flag is given twice, additional information is printed,
1442such as the the RX call ID, serial number, and the RX packet flags.
1443The MTU negotiation information is also printed from RX ack packets.
1444.LP
1445If the -v flag is given three times, the security index and service id
1446are printed.
1447.LP
1448Error codes are printed for abort packets, with the exception of Ubik
1449beacon packets (because abort packets are used to signify a yes vote
1450for the Ubik protocol).
1451.LP
1452Note that AFS requests are very large and many of the arguments won't
1453be printed unless \fIsnaplen\fP is increased.
1454Try using `\fB-s 256\fP'
1455to watch AFS traffic.
1456.LP
1457AFS reply packets do not explicitly identify the RPC operation.
1458Instead,
1459\fItcpdump\fP keeps track of ``recent'' requests, and matches them to the
1460replies using the call number and service ID.
1461If a reply does not closely
1462follow the
1463corresponding request, it might not be parsable.
1464
1465.HD
1466KIP AppleTalk (DDP in UDP)
1467.LP
1468AppleTalk DDP packets encapsulated in UDP datagrams are de-encapsulated
1469and dumped as DDP packets (i.e., all the UDP header information is
1470discarded).
1471The file
1472.I /etc/atalk.names
1473is used to translate AppleTalk net and node numbers to names.
1474Lines in this file have the form
1475.RS
1476.nf
1477.sp .5
1478\fInumber name\fP
1479
1480\f(CW1.254 ether
148116.1 icsd-net
14821.254.110 ace\fR
1483.sp .5
1484.fi
1485.RE
1486The first two lines give the names of AppleTalk networks.
1487The third
1488line gives the name of a particular host (a host is distinguished
1489from a net by the 3rd octet in the number \-
1490a net number \fImust\fP have two octets and a host number \fImust\fP
1491have three octets.) The number and name should be separated by
1492whitespace (blanks or tabs).
1493The
1494.I /etc/atalk.names
1495file may contain blank lines or comment lines (lines starting with
1496a `#').
1497.LP
1498AppleTalk addresses are printed in the form
1499.RS
1500.nf
1501.sp .5
1502\fInet.host.port\fP
1503
1504\f(CW144.1.209.2 > icsd-net.112.220
1505office.2 > icsd-net.112.220
1506jssmag.149.235 > icsd-net.2\fR
1507.sp .5
1508.fi
1509.RE
1510(If the
1511.I /etc/atalk.names
1512doesn't exist or doesn't contain an entry for some AppleTalk
1513host/net number, addresses are printed in numeric form.)
1514In the first example, NBP (DDP port 2) on net 144.1 node 209
1515is sending to whatever is listening on port 220 of net icsd node 112.
1516The second line is the same except the full name of the source node
1517is known (`office').
1518The third line is a send from port 235 on
1519net jssmag node 149 to broadcast on the icsd-net NBP port (note that
1520the broadcast address (255) is indicated by a net name with no host
1521number \- for this reason it's a good idea to keep node names and
1522net names distinct in /etc/atalk.names).
1523.LP
1524NBP (name binding protocol) and ATP (AppleTalk transaction protocol)
1525packets have their contents interpreted.
1526Other protocols just dump
1527the protocol name (or number if no name is registered for the
1528protocol) and packet size.
1529
1530\fBNBP packets\fP are formatted like the following examples:
1531.RS
1532.nf
1533.sp .5
1534\s-2\f(CWicsd-net.112.220 > jssmag.2: nbp-lkup 190: "=:LaserWriter@*"
1535jssmag.209.2 > icsd-net.112.220: nbp-reply 190: "RM1140:LaserWriter@*" 250
1536techpit.2 > icsd-net.112.220: nbp-reply 190: "techpit:LaserWriter@*" 186\fR\s+2
1537.sp .5
1538.fi
1539.RE
1540The first line is a name lookup request for laserwriters sent by net icsd host
1541112 and broadcast on net jssmag.
1542The nbp id for the lookup is 190.
1543The second line shows a reply for this request (note that it has the
1544same id) from host jssmag.209 saying that it has a laserwriter
1545resource named "RM1140" registered on port 250.
1546The third line is
1547another reply to the same request saying host techpit has laserwriter
1548"techpit" registered on port 186.
1549
1550\fBATP packet\fP formatting is demonstrated by the following example:
1551.RS
1552.nf
1553.sp .5
1554\s-2\f(CWjssmag.209.165 > helios.132: atp-req 12266<0-7> 0xae030001
1555helios.132 > jssmag.209.165: atp-resp 12266:0 (512) 0xae040000
1556helios.132 > jssmag.209.165: atp-resp 12266:1 (512) 0xae040000
1557helios.132 > jssmag.209.165: atp-resp 12266:2 (512) 0xae040000
1558helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000
1559helios.132 > jssmag.209.165: atp-resp 12266:4 (512) 0xae040000
1560helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000
1561helios.132 > jssmag.209.165: atp-resp 12266:6 (512) 0xae040000
1562helios.132 > jssmag.209.165: atp-resp*12266:7 (512) 0xae040000
1563jssmag.209.165 > helios.132: atp-req 12266<3,5> 0xae030001
1564helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000
1565helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000
1566jssmag.209.165 > helios.132: atp-rel 12266<0-7> 0xae030001
1567jssmag.209.133 > helios.132: atp-req* 12267<0-7> 0xae030002\fR\s+2
1568.sp .5
1569.fi
1570.RE
1571Jssmag.209 initiates transaction id 12266 with host helios by requesting
1572up to 8 packets (the `<0-7>').
1573The hex number at the end of the line
1574is the value of the `userdata' field in the request.
1575.LP
1576Helios responds with 8 512-byte packets.
1577The `:digit' following the
1578transaction id gives the packet sequence number in the transaction
1579and the number in parens is the amount of data in the packet,
1580excluding the atp header.
1581The `*' on packet 7 indicates that the
1582EOM bit was set.
1583.LP
1584Jssmag.209 then requests that packets 3 & 5 be retransmitted.
1585Helios
1586resends them then jssmag.209 releases the transaction.
1587Finally,
1588jssmag.209 initiates the next request.
1589The `*' on the request
1590indicates that XO (`exactly once') was \fInot\fP set.
1591
1592.HD
1593IP Fragmentation
1594.LP
1595Fragmented Internet datagrams are printed as
1596.RS
1597.nf
1598.sp .5
1599\fB(frag \fIid\fB:\fIsize\fB@\fIoffset\fB+)\fR
1600\fB(frag \fIid\fB:\fIsize\fB@\fIoffset\fB)\fR
1601.sp .5
1602.fi
1603.RE
1604(The first form indicates there are more fragments.
1605The second
1606indicates this is the last fragment.)
1607.LP
1608\fIId\fP is the fragment id.
1609\fISize\fP is the fragment
1610size (in bytes) excluding the IP header.
1611\fIOffset\fP is this
1612fragment's offset (in bytes) in the original datagram.
1613.LP
1614The fragment information is output for each fragment.
1615The first
1616fragment contains the higher level protocol header and the frag
1617info is printed after the protocol info.
1618Fragments
1619after the first contain no higher level protocol header and the
1620frag info is printed after the source and destination addresses.
1621For example, here is part of an ftp from arizona.edu to lbl-rtsg.arpa
1622over a CSNET connection that doesn't appear to handle 576 byte datagrams:
1623.RS
1624.nf
1625.sp .5
1626\s-2\f(CWarizona.ftp-data > rtsg.1170: . 1024:1332(308) ack 1 win 4096 (frag 595a:328@0+)
1627arizona > rtsg: (frag 595a:204@328)
1628rtsg.1170 > arizona.ftp-data: . ack 1536 win 2560\fP\s+2
1629.sp .5
1630.fi
1631.RE
1632There are a couple of things to note here: First, addresses in the
16332nd line don't include port numbers.
1634This is because the TCP
1635protocol information is all in the first fragment and we have no idea
1636what the port or sequence numbers are when we print the later fragments.
1637Second, the tcp sequence information in the first line is printed as if there
1638were 308 bytes of user data when, in fact, there are 512 bytes (308 in
1639the first frag and 204 in the second).
1640If you are looking for holes
1641in the sequence space or trying to match up acks
1642with packets, this can fool you.
1643.LP
1644A packet with the IP \fIdon't fragment\fP flag is marked with a
1645trailing \fB(DF)\fP.
1646.HD
1647Timestamps
1648.LP
1649By default, all output lines are preceded by a timestamp.
1650The timestamp
1651is the current clock time in the form
1652.RS
1653.nf
1654\fIhh:mm:ss.frac\fP
1655.fi
1656.RE
1657and is as accurate as the kernel's clock.
1658The timestamp reflects the time the kernel first saw the packet.
1659No attempt
1660is made to account for the time lag between when the
1661Ethernet interface removed the packet from the wire and when the kernel
1662serviced the `new packet' interrupt.
1663.SH "SEE ALSO"
1664stty(1), pcap(3PCAP), bpf(4), nit(4P), pcap-savefile(@MAN_FILE_FORMATS@),
1665pcap-filter(@MAN_MISC_INFO@), pcap-tstamp-type(@MAN_MISC_INFO@)
1666.SH AUTHORS
1667The original authors are:
1668.LP
1669Van Jacobson,
1670Craig Leres and
1671Steven McCanne, all of the
1672Lawrence Berkeley National Laboratory, University of California, Berkeley, CA.
1673.LP
1674It is currently being maintained by tcpdump.org.
1675.LP
1676The current version is available via http:
1677.LP
1678.RS
1679.I http://www.tcpdump.org/
1680.RE
1681.LP
1682The original distribution is available via anonymous ftp:
1683.LP
1684.RS
1685.I ftp://ftp.ee.lbl.gov/tcpdump.tar.Z
1686.RE
1687.LP
1688IPv6/IPsec support is added by WIDE/KAME project.
1689This program uses Eric Young's SSLeay library, under specific configurations.
1690.SH BUGS
1691Please send problems, bugs, questions, desirable enhancements, patches
1692etc. to:
1693.LP
1694.RS
1695tcpdump-workers@lists.tcpdump.org
1696.RE
1697.LP
1698NIT doesn't let you watch your own outbound traffic, BPF will.
1699We recommend that you use the latter.
1700.LP
1701On Linux systems with 2.0[.x] kernels:
1702.IP
1703packets on the loopback device will be seen twice;
1704.IP
1705packet filtering cannot be done in the kernel, so that all packets must
1706be copied from the kernel in order to be filtered in user mode;
1707.IP
1708all of a packet, not just the part that's within the snapshot length,
1709will be copied from the kernel (the 2.0[.x] packet capture mechanism, if
1710asked to copy only part of a packet to userland, will not report the
1711true length of the packet; this would cause most IP packets to get an
1712error from
1713.BR tcpdump );
1714.IP
1715capturing on some PPP devices won't work correctly.
1716.LP
1717We recommend that you upgrade to a 2.2 or later kernel.
1718.LP
1719Some attempt should be made to reassemble IP fragments or, at least
1720to compute the right length for the higher level protocol.
1721.LP
1722Name server inverse queries are not dumped correctly: the (empty)
1723question section is printed rather than real query in the answer
1724section.
1725Some believe that inverse queries are themselves a bug and
1726prefer to fix the program generating them rather than \fItcpdump\fP.
1727.LP
1728A packet trace that crosses a daylight savings time change will give
1729skewed time stamps (the time change is ignored).
1730.LP
1731Filter expressions on fields other than those in Token Ring headers will
1732not correctly handle source-routed Token Ring packets.
1733.LP
1734Filter expressions on fields other than those in 802.11 headers will not
1735correctly handle 802.11 data packets with both To DS and From DS set.
1736.LP
1737.BR "ip6 proto"
1738should chase header chain, but at this moment it does not.
1739.BR "ip6 protochain"
1740is supplied for this behavior.
1741.LP
1742Arithmetic expression against transport layer headers, like \fBtcp[0]\fP,
1743does not work against IPv6 packets.
1744It only looks at IPv4 packets.
17450
=== removed directory '.pc/40_openssl.diff'
=== removed file '.pc/40_openssl.diff/configure.in'
--- .pc/40_openssl.diff/configure.in 2012-01-02 20:19:22 +0000
+++ .pc/40_openssl.diff/configure.in 1970-01-01 00:00:00 +0000
@@ -1,1111 +0,0 @@
1dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.204 2008-11-18 07:39:20 guy Exp $ (LBL)
2dnl
3dnl Copyright (c) 1994, 1995, 1996, 1997
4dnl The Regents of the University of California. All rights reserved.
5dnl
6dnl Process this file with autoconf to produce a configure script.
7dnl
8
9#
10# See
11#
12# http://ftp.gnu.org/gnu/config/README
13#
14# for the URLs to use to fetch new versions of config.guess and
15# config.sub.
16#
17
18AC_REVISION($Revision: 1.204 $)
19AC_PREREQ(2.50)
20AC_INIT(tcpdump.c)
21
22AC_CANONICAL_HOST
23
24AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS)
25AC_PROG_CC
26AC_LBL_C_INIT(V_CCOPT, V_INCLS)
27AC_LBL_C_INLINE
28AC_C___ATTRIBUTE__
29if test "$ac_cv___attribute__" = "yes"; then
30 AC_C___ATTRIBUTE___FORMAT_FUNCTION_POINTER
31fi
32AC_CHECK_HEADERS(fcntl.h rpc/rpc.h rpc/rpcent.h netdnet/dnetdb.h)
33AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
34#include <sys/socket.h>
35#include <net/if.h>])
36if test "$ac_cv_header_net_pfvar_h" = yes; then
37 LOCALSRC="print-pflog.c $LOCALSRC"
38fi
39AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
40#include <sys/socket.h>])
41if test "$ac_cv_header_netinet_if_ether_h" != yes; then
42 #
43 # The simple test didn't work.
44 # Do we need to include <net/if.h> first?
45 # Unset ac_cv_header_netinet_if_ether_h so we don't
46 # treat the previous failure as a cached value and
47 # suppress the next test.
48 #
49 AC_MSG_NOTICE([Rechecking with some additional includes])
50 unset ac_cv_header_netinet_if_ether_h
51 AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
52#include <sys/socket.h>
53#include <netinet/in.h>
54struct mbuf;
55struct rtentry;
56#include <net/if.h>])
57fi
58
59AC_HEADER_TIME
60
61case "$host_os" in
62
63darwin*)
64 AC_ARG_ENABLE(universal,
65 AC_HELP_STRING([--disable-universal],[don't build universal on OS X]))
66 if test "$enable_universal" != "no"; then
67 case "$host_os" in
68
69 darwin9.*)
70 #
71 # Leopard. Build for x86 and 32-bit PowerPC, with
72 # x86 first. (That's what Apple does.)
73 #
74 V_CCOPT="$V_CCOPT -arch i386 -arch ppc"
75 LDFLAGS="$LDFLAGS -arch i386 -arch ppc"
76 ;;
77
78 darwin10.*)
79 #
80 # Snow Leopard. Build for x86-64 and x86, with
81 # x86-64 first. (That's what Apple does.)
82 #
83 V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
84 LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
85 ;;
86 esac
87 fi
88 ;;
89
90linux*)
91 AC_MSG_CHECKING(Linux kernel version)
92 if test "$cross_compiling" = yes; then
93 AC_CACHE_VAL(ac_cv_linux_vers,
94 ac_cv_linux_vers=unknown)
95 else
96 AC_CACHE_VAL(ac_cv_linux_vers,
97 ac_cv_linux_vers=`uname -r 2>&1 | \
98 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
99 fi
100 AC_MSG_RESULT($ac_cv_linux_vers)
101 if test $ac_cv_linux_vers = unknown ; then
102 AC_MSG_ERROR(cannot determine linux version when cross-compiling)
103 fi
104 if test $ac_cv_linux_vers -lt 2 ; then
105 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
106 fi
107 ;;
108
109*)
110 ;;
111esac
112
113
114AC_ARG_WITH(smi,
115[ --with-smi link with libsmi (allows to load MIBs on the fly to decode SNMP packets. [default=yes]
116 --without-smi don't link with libsmi],,
117 with_smi=yes)
118
119if test "x$with_smi" != "xno" ; then
120AC_CHECK_HEADERS(smi.h)
121AC_CHECK_LIB(smi, smiInit)
122if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
123then
124AC_MSG_CHECKING([whether to enable libsmi])
125 AC_TRY_RUN([ /* libsmi available check */
126#include <smi.h>
127main()
128{
129 int current, revision, age, n;
130 const int required = 2;
131 if (smiInit(""))
132 exit(1);
133 if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
134 exit(2);
135 n = sscanf(smi_library_version, "%d:%d:%d", &current, &revision, &age);
136 if (n != 3)
137 exit(3);
138 if (required < current - age || required > current)
139 exit(4);
140 exit(0);
141}
142],
143[ AC_MSG_RESULT(yes)
144 AC_DEFINE(LIBSMI)
145 libsmi=yes],
146dnl autoconf documentation says that $? contains the exit value.
147dnl reality is that it does not. We leave this in just in case
148dnl autoconf ever comes back to match the documentation.
149[ case $? in
150 1) AC_MSG_RESULT(no - smiInit failed) ;;
151 2) AC_MSG_RESULT(no - header/library version mismatch) ;;
152 3) AC_MSG_RESULT(no - can't determine library version) ;;
153 4) AC_MSG_RESULT(no - too old) ;;
154 *) AC_MSG_RESULT(no) ;;
155 esac
156 libsmi=no],
157[ AC_MSG_RESULT(not when cross-compiling)
158 libsmi=no]
159)
160fi
161fi
162
163AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
164AC_ARG_ENABLE(smb,
165[ --enable-smb enable possibly-buggy SMB printer [default=yes]
166 --disable-smb disable possibly-buggy SMB printer],,
167 enableval=yes)
168case "$enableval" in
169yes) AC_MSG_RESULT(yes)
170 AC_WARN([The SMB printer may have exploitable buffer overflows!!!])
171 AC_DEFINE(TCPDUMP_DO_SMB)
172 LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
173 ;;
174*) AC_MSG_RESULT(no)
175 ;;
176esac
177
178AC_ARG_WITH(user, [ --with-user=USERNAME drop privileges by default to USERNAME])
179AC_MSG_CHECKING([whether to drop root privileges by default])
180if test ! -z "$with_user" ; then
181 AC_DEFINE_UNQUOTED(WITH_USER, "$withval")
182 AC_MSG_RESULT(to \"$withval\")
183else
184 AC_MSG_RESULT(no)
185fi
186
187AC_ARG_WITH(chroot, [ --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY])
188AC_MSG_CHECKING([whether to chroot])
189if test ! -z "$with_chroot" && test "$with_chroot" != "no" ; then
190 AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval")
191 AC_MSG_RESULT(to \"$withval\")
192else
193 AC_MSG_RESULT(no)
194fi
195
196AC_MSG_CHECKING([whether to enable ipv6])
197AC_ARG_ENABLE(ipv6,
198[ --enable-ipv6 enable ipv6 (with ipv4) support
199 --disable-ipv6 disable ipv6 support],
200[ case "$enableval" in
201yes) AC_MSG_RESULT(yes)
202 LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
203 AC_DEFINE(INET6)
204 ipv6=yes
205 ;;
206*)
207 AC_MSG_RESULT(no)
208 ipv6=no
209 ;;
210 esac ],
211
212 AC_TRY_RUN([ /* AF_INET6 available check */
213#include <sys/types.h>
214#include <sys/socket.h>
215main()
216{
217 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
218 exit(1);
219 else
220 exit(0);
221}
222],
223[ AC_MSG_RESULT(yes)
224 LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
225 AC_DEFINE(INET6)
226 ipv6=yes],
227[ AC_MSG_RESULT(no)
228 ipv6=no],
229[ AC_MSG_RESULT(no)
230 ipv6=no]
231))
232
233ipv6type=unknown
234ipv6lib=none
235ipv6trylibc=no
236
237if test "$ipv6" = "yes"; then
238 AC_MSG_CHECKING([ipv6 stack type])
239 for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
240 case $i in
241 inria)
242 dnl http://www.kame.net/
243 AC_EGREP_CPP(yes,
244[#include <netinet/in.h>
245#ifdef IPV6_INRIA_VERSION
246yes
247#endif],
248 [ipv6type=$i;
249 CFLAGS="-DINET6 $CFLAGS"])
250 ;;
251 kame)
252 dnl http://www.kame.net/
253 AC_EGREP_CPP(yes,
254[#include <netinet/in.h>
255#ifdef __KAME__
256yes
257#endif],
258 [ipv6type=$i;
259 ipv6lib=inet6;
260 ipv6libdir=/usr/local/v6/lib;
261 ipv6trylibc=yes;
262 CFLAGS="-DINET6 $CFLAGS"])
263 ;;
264 linux-glibc)
265 dnl http://www.v6.linux.or.jp/
266 AC_EGREP_CPP(yes,
267[#include <features.h>
268#if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
269yes
270#endif],
271 [ipv6type=$i;
272 CFLAGS="-DINET6 $CFLAGS"])
273 ;;
274 linux-libinet6)
275 dnl http://www.v6.linux.or.jp/
276 dnl
277 dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
278 dnl and possibly other versions of those OSes
279 dnl
280 if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
281 ipv6type=$i
282 ipv6lib=inet6
283 ipv6libdir=/usr/inet6/lib
284 ipv6trylibc=yes;
285 CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
286 fi
287 ;;
288 toshiba)
289 AC_EGREP_CPP(yes,
290[#include <sys/param.h>
291#ifdef _TOSHIBA_INET6
292yes
293#endif],
294 [ipv6type=$i;
295 ipv6lib=inet6;
296 ipv6libdir=/usr/local/v6/lib;
297 CFLAGS="-DINET6 $CFLAGS"])
298 ;;
299 v6d)
300 AC_EGREP_CPP(yes,
301[#include </usr/local/v6/include/sys/v6config.h>
302#ifdef __V6D__
303yes
304#endif],
305 [ipv6type=$i;
306 ipv6lib=v6;
307 ipv6libdir=/usr/local/v6/lib;
308 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
309 ;;
310 zeta)
311 AC_EGREP_CPP(yes,
312[#include <sys/param.h>
313#ifdef _ZETA_MINAMI_INET6
314yes
315#endif],
316 [ipv6type=$i;
317 ipv6lib=inet6;
318 ipv6libdir=/usr/local/v6/lib;
319 CFLAGS="-DINET6 $CFLAGS"])
320 ;;
321 esac
322 if test "$ipv6type" != "unknown"; then
323 break
324 fi
325 done
326 AC_MSG_RESULT($ipv6type)
327fi
328
329if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
330 if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
331 LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
332 echo "You have $ipv6lib library, using it"
333 else
334 if test "$ipv6trylibc" = "yes"; then
335 echo "You do not have $ipv6lib library, using libc"
336 else
337 echo 'Fatal: no $ipv6lib library found. cannot continue.'
338 echo "You need to fetch lib$ipv6lib.a from appropriate"
339 echo 'ipv6 kit and compile beforehand.'
340 exit 1
341 fi
342 fi
343fi
344
345
346if test "$ipv6" = "yes"; then
347 #
348 # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
349 # function in libc; there are "ngetaddrinfo()" and
350 # "ogetaddrinfo()" functions, and <netdb.h> #defines
351 # "getaddrinfo" to be either "ngetaddrinfo" or
352 # "ogetaddrinfo", depending on whether _SOCKADDR_LEN
353 # or _XOPEN_SOURCE_EXTENDED are defined or not.
354 #
355 # So this test doesn't work on Tru64 5.1, and possibly
356 # on other 5.x releases. This causes the configure
357 # script to become confused, and results in libpcap
358 # being unbuildable.
359 #
360 AC_SEARCH_LIBS(getaddrinfo, socket, [dnl
361 AC_MSG_CHECKING(getaddrinfo bug)
362 AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([
363#include <sys/types.h>
364#include <netdb.h>
365#include <string.h>
366#include <sys/socket.h>
367#include <netinet/in.h>
368
369main()
370{
371 int passive, gaierr, inet4 = 0, inet6 = 0;
372 struct addrinfo hints, *ai, *aitop;
373 char straddr[INET6_ADDRSTRLEN], strport[16];
374
375 for (passive = 0; passive <= 1; passive++) {
376 memset(&hints, 0, sizeof(hints));
377 hints.ai_family = AF_UNSPEC;
378 hints.ai_flags = passive ? AI_PASSIVE : 0;
379 hints.ai_socktype = SOCK_STREAM;
380 hints.ai_protocol = IPPROTO_TCP;
381 if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
382 (void)gai_strerror(gaierr);
383 goto bad;
384 }
385 for (ai = aitop; ai; ai = ai->ai_next) {
386 if (ai->ai_addr == NULL ||
387 ai->ai_addrlen == 0 ||
388 getnameinfo(ai->ai_addr, ai->ai_addrlen,
389 straddr, sizeof(straddr), strport, sizeof(strport),
390 NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
391 goto bad;
392 }
393 switch (ai->ai_family) {
394 case AF_INET:
395 if (strcmp(strport, "54321") != 0) {
396 goto bad;
397 }
398 if (passive) {
399 if (strcmp(straddr, "0.0.0.0") != 0) {
400 goto bad;
401 }
402 } else {
403 if (strcmp(straddr, "127.0.0.1") != 0) {
404 goto bad;
405 }
406 }
407 inet4++;
408 break;
409 case AF_INET6:
410 if (strcmp(strport, "54321") != 0) {
411 goto bad;
412 }
413 if (passive) {
414 if (strcmp(straddr, "::") != 0) {
415 goto bad;
416 }
417 } else {
418 if (strcmp(straddr, "::1") != 0) {
419 goto bad;
420 }
421 }
422 inet6++;
423 break;
424 case AF_UNSPEC:
425 goto bad;
426 break;
427#ifdef AF_UNIX
428 case AF_UNIX:
429#else
430#ifdef AF_LOCAL
431 case AF_LOCAL:
432#endif
433#endif
434 default:
435 /* another family support? */
436 break;
437 }
438 }
439 }
440
441 /* supported family should be 2, unsupported family should be 0 */
442 if (!(inet4 == 0 || inet4 == 2))
443 goto bad;
444 if (!(inet6 == 0 || inet6 == 2))
445 goto bad;
446
447 if (aitop)
448 freeaddrinfo(aitop);
449 exit(0);
450
451 bad:
452 if (aitop)
453 freeaddrinfo(aitop);
454 exit(1);
455}
456],
457 td_cv_buggygetaddrinfo=no,
458 td_cv_buggygetaddrinfo=yes,
459 td_cv_buggygetaddrinfo=yes)])
460 if test "$td_cv_buggygetaddrinfo" = no; then
461 AC_MSG_RESULT(good)
462 else
463 AC_MSG_RESULT(buggy)
464 fi
465
466 if test "$td_cv_buggygetaddrinfo" = "yes"; then
467 #
468 # XXX - it doesn't appear that "ipv6type" can ever be
469 # set to "linux". Should this be testing for
470 # "linux-glibc", or for that *or* "linux-libinet6"?
471 # If the latter, note that "linux-libinet6" is also
472 # the type given to some non-Linux OSes.
473 #
474 if test "$ipv6type" != "linux"; then
475 echo 'Fatal: You must get working getaddrinfo() function.'
476 echo ' or you can specify "--disable-ipv6"'.
477 exit 1
478 else
479 echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
480 echo ' Better upgrade your system library to newest version'
481 echo ' of GNU C library (aka glibc).'
482 fi
483 fi
484 ])
485 AC_REPLACE_FUNCS(getnameinfo)
486fi
487
488AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
489[td_cv_decl_netdnet_dnetdb_h_dnet_htoa],
490[AC_EGREP_HEADER(dnet_htoa, netdnet/dnetdb.h,
491 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes,
492 td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)])
493if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
494 AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA)
495fi
496
497dnl
498dnl Checks for addrinfo structure
499AC_STRUCT_ADDRINFO(ac_cv_addrinfo)
500if test "$ac_cv_addrinfo" = no; then
501 missing_includes=yes
502fi
503
504dnl
505dnl Checks for NI_MAXSERV
506AC_NI_MAXSERV(ac_cv_maxserv)
507if test "$ac_cv_maxserv" = no; then
508 missing_includes=yes
509fi
510
511dnl
512dnl Checks for NI_NAMEREQD
513AC_NI_NAMEREQD(ac_cv_namereqd)
514if test "$ac_cv_namereqd" = no; then
515 missing_includes=yes
516fi
517
518dnl
519dnl Checks for sockaddr_storage structure
520AC_STRUCT_SA_STORAGE(ac_cv_sa_storage)
521if test "$ac_cv_sa_storage" = no; then
522 missing_includes=yes
523fi
524
525AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep)
526AC_CHECK_FUNCS(fork vfork strftime)
527AC_CHECK_FUNCS(setlinebuf alarm)
528
529needsnprintf=no
530AC_CHECK_FUNCS(vsnprintf snprintf,,
531 [needsnprintf=yes])
532if test $needsnprintf = yes; then
533 AC_LIBOBJ(snprintf)
534fi
535
536AC_LBL_TYPE_SIGNAL
537
538AC_SEARCH_LIBS(dnet_htoa, dnet, AC_DEFINE(HAVE_DNET_HTOA))
539
540AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
541
542dnl Some platforms may need -lnsl for getrpcbynumber.
543AC_SEARCH_LIBS(getrpcbynumber, nsl, AC_DEFINE(HAVE_GETRPCBYNUMBER))
544
545dnl AC_CHECK_LIB(z, uncompress)
546dnl AC_CHECK_HEADERS(zlib.h)
547
548AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
549
550#
551# Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
552# libraries (e.g., "-lsocket -lnsl" on Solaris).
553#
554# We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
555# use AC_CHECK_FUNC which doesn't let us specify the right #includes
556# to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8
557# resolver, and the way it defines inet_{ntop,pton} is rather strange;
558# it does not ship with a libc symbol "inet_ntop()", it ships with
559# "_inet_ntop()", and has a #define macro in one of the system headers
560# to rename it.
561#
562dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton)
563AC_MSG_CHECKING(for inet_ntop)
564AC_TRY_LINK([#include <sys/types.h>
565#include <sys/socket.h>
566#include <netinet/in.h>
567#include <arpa/inet.h>], [char src[4], dst[128];
568inet_ntop(AF_INET, src, dst, sizeof(dst));],
569 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
570 AC_LIBOBJ(inet_ntop)])
571AC_MSG_CHECKING(for inet_pton)
572AC_TRY_LINK([#include <sys/types.h>
573#include <sys/socket.h>
574#include <netinet/in.h>
575#include <arpa/inet.h>], [char src[128], dst[4];
576inet_pton(AF_INET, src, dst);],
577 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
578 AC_LIBOBJ(inet_pton)])
579AC_MSG_CHECKING(for inet_aton)
580AC_TRY_LINK([#include <sys/types.h>
581#include <netinet/in.h>
582#include <arpa/inet.h>], [char src[128];
583struct in_addr dst;
584inet_aton(src, &dst);],
585 [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
586 AC_LIBOBJ(inet_aton)])
587
588#
589# Check for these after AC_LBL_LIBPCAP, for the same reason.
590#
591# You are in a twisty little maze of UN*Xes, all different.
592# Some might not have ether_ntohost().
593# Some might have it, but not declare it in any header file.
594# Some might have it, but declare it in <netinet/if_ether.h>.
595# Some might have it, but declare it in <netinet/ether.h>
596# (And some might have it but document it as something declared in
597# <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
598#
599# Before you is a C compiler.
600#
601AC_CHECK_FUNCS(ether_ntohost, [
602 AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
603 AC_TRY_RUN([
604 #include <netdb.h>
605 #include <sys/types.h>
606 #include <sys/param.h>
607 #include <sys/socket.h>
608
609 int
610 main(int argc, char **argv)
611 {
612 u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
613 char name[MAXHOSTNAMELEN];
614
615 ether_ntohost(name, (struct ether_addr *)ea);
616 exit(0);
617 }
618 ], [ac_cv_buggy_ether_ntohost=no],
619 [ac_cv_buggy_ether_ntohost=yes],
620 [ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
621 if test "$ac_cv_buggy_ether_ntohost" = "no"; then
622 AC_DEFINE(USE_ETHER_NTOHOST)
623 fi
624])
625if test "$ac_cv_func_ether_ntohost" = yes -a \
626 "$ac_cv_buggy_ether_ntohost" = "no"; then
627 #
628 # OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>?
629 #
630 if test "$ac_cv_header_netinet_if_ether_h" = yes; then
631 #
632 # Yes. Does it declare ether_ntohost()?
633 #
634 AC_CHECK_DECL(ether_ntohost,
635 [
636 AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
637 [Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
638 ],,
639 [
640#include <sys/types.h>
641#include <sys/socket.h>
642#include <netinet/in.h>
643#include <arpa/inet.h>
644struct mbuf;
645struct rtentry;
646#include <net/if.h>
647#include <netinet/if_ether.h>
648 ])
649 fi
650 #
651 # Did that succeed?
652 #
653 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
654 #
655 # No, how about <netinet/ether.h>, as on Linux?
656 #
657 AC_CHECK_HEADERS(netinet/ether.h)
658 if test "$ac_cv_header_netinet_ether_h" = yes; then
659 #
660 # We have it - does it declare ether_ntohost()?
661 # Unset ac_cv_have_decl_ether_ntohost so we don't
662 # treat the previous failure as a cached value and
663 # suppress the next test.
664 #
665 unset ac_cv_have_decl_ether_ntohost
666 AC_CHECK_DECL(ether_ntohost,
667 [
668 AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,,
669 [Define to 1 if netinet/ether.h declares `ether_ntohost'])
670 ],,
671 [
672#include <netinet/ether.h>
673 ])
674 fi
675 fi
676 #
677 # Is ether_ntohost() declared?
678 #
679 if test "$ac_cv_have_decl_ether_ntohost" != yes; then
680 #
681 # No, we'll have to declare it ourselves.
682 # Do we have "struct ether_addr"?
683 #
684 AC_CHECK_TYPES(struct ether_addr,,,
685 [
686#include <sys/types.h>
687#include <sys/socket.h>
688#include <netinet/in.h>
689#include <arpa/inet.h>
690struct mbuf;
691struct rtentry;
692#include <net/if.h>
693#include <netinet/if_ether.h>
694 ])
695 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 0,
696 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
697don't.])
698 else
699 AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1,
700 [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
701don't.])
702 fi
703fi
704
705# libdlpi is needed for Solaris 11 and later.
706AC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS", ,-L/lib)
707
708dnl portability macros for getaddrinfo/getnameinfo
709dnl
710dnl Check for sa_len
711AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
712if test "$ac_cv_sockaddr_has_sa_len" = no; then
713 missing_includes=yes
714fi
715
716#
717# Do we have the new open API? Check for pcap_create, and assume that,
718# if we do, we also have pcap_activate() and the other new routines
719# introduced in libpcap 1.0.0.
720#
721AC_CHECK_FUNCS(pcap_create)
722if test $ac_cv_func_pcap_create = "yes" ; then
723 #
724 # OK, do we have pcap_set_tstamp_type? If so, assume we have
725 # pcap_list_tstamp_types and pcap_free_tstamp_types as well.
726 #
727 AC_CHECK_FUNCS(pcap_set_tstamp_type)
728fi
729
730AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
731if test $ac_cv_func_pcap_findalldevs = "yes" ; then
732dnl Check for Mac OS X, which may ship pcap.h from 0.6 but libpcap may
733dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't
734dnl have pcap_if_t.
735 savedppflags="$CPPLAGS"
736 CPPFLAGS="$CPPFLAGS $V_INCLS"
737 AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
738 CPPFLAGS="$savedcppflags"
739fi
740
741if test $ac_cv_func_pcap_lib_version = "no" ; then
742 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
743 AC_TRY_LINK([],
744 [
745 extern char pcap_version[];
746
747 return (int)pcap_version;
748 ],
749 ac_lbl_cv_pcap_version_defined=yes,
750 ac_lbl_cv_pcap_version_defined=no)
751 if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
752 AC_MSG_RESULT(yes)
753 AC_DEFINE(HAVE_PCAP_VERSION)
754 else
755 AC_MSG_RESULT(no)
756 fi
757fi
758AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
759AC_TRY_LINK([],
760 [
761 extern int pcap_debug;
762
763 return pcap_debug;
764 ],
765 ac_lbl_cv_pcap_debug_defined=yes,
766 ac_lbl_cv_pcap_debug_defined=no)
767if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
768 AC_MSG_RESULT(yes)
769 AC_DEFINE(HAVE_PCAP_DEBUG)
770else
771 AC_MSG_RESULT(no)
772 #
773 # OK, what about "yydebug"?
774 #
775 AC_MSG_CHECKING(whether yydebug is defined by libpcap)
776 AC_TRY_LINK([],
777 [
778 extern int yydebug;
779
780 return yydebug;
781 ],
782 ac_lbl_cv_yydebug_defined=yes,
783 ac_lbl_cv_yydebug_defined=no)
784 if test "$ac_lbl_cv_yydebug_defined" = yes ; then
785 AC_MSG_RESULT(yes)
786 AC_DEFINE(HAVE_YYDEBUG)
787 else
788 AC_MSG_RESULT(no)
789 fi
790fi
791AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
792
793V_GROUP=0
794if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
795 V_GROUP=wheel
796fi
797#
798# Assume V7/BSD convention for man pages (file formats in section 5,
799# miscellaneous info in section 7).
800#
801MAN_FILE_FORMATS=5
802MAN_MISC_INFO=7
803case "$host_os" in
804
805aix*)
806 dnl Workaround to enable certain features
807 AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
808 ;;
809
810hpux*)
811 #
812 # Use System V conventions for man pages.
813 #
814 MAN_FILE_FORMATS=4
815 MAN_MISC_INFO=5
816 ;;
817
818irix*)
819 V_GROUP=sys
820
821 #
822 # Use System V conventions for man pages.
823 #
824 MAN_FILE_FORMATS=4
825 MAN_MISC_INFO=5
826 ;;
827
828osf*)
829 V_GROUP=system
830
831 #
832 # Use System V conventions for man pages.
833 #
834 MAN_FILE_FORMATS=4
835 MAN_MISC_INFO=5
836 ;;
837
838solaris*)
839 V_GROUP=sys
840
841 #
842 # Use System V conventions for man pages.
843 #
844 MAN_FILE_FORMATS=4
845 MAN_MISC_INFO=5
846 ;;
847esac
848
849if test -f /dev/bpf0 ; then
850 V_GROUP=bpf
851fi
852
853AC_CHECK_HEADERS(sys/bitypes.h)
854
855AC_CHECK_TYPE([int8_t], ,
856 [AC_DEFINE([int8_t], [signed char],
857 [Define to `signed char' if int8_t not defined.])],
858 [AC_INCLUDES_DEFAULT
859#ifdef HAVE_SYS_BITYPES_H
860#include <sys/bitypes.h>
861#endif])
862AC_CHECK_TYPE([u_int8_t], ,
863 [AC_DEFINE([u_int8_t], [unsigned char],
864 [Define to `unsigned char' if u_int8_t not defined.])],
865 [AC_INCLUDES_DEFAULT
866#ifdef HAVE_SYS_BITYPES_H
867#include <sys/bitypes.h>
868#endif])
869AC_CHECK_TYPE([int16_t], ,
870 [AC_DEFINE([int16_t], [short],
871 [Define to `short' if int16_t not defined.])]
872 [AC_INCLUDES_DEFAULT
873#ifdef HAVE_SYS_BITYPES_H
874#include <sys/bitypes.h>
875#endif])
876AC_CHECK_TYPE([u_int16_t], ,
877 [AC_DEFINE([u_int16_t], [unsigned short],
878 [Define to `unsigned short' if u_int16_t not defined.])],
879 [AC_INCLUDES_DEFAULT
880#ifdef HAVE_SYS_BITYPES_H
881#include <sys/bitypes.h>
882#endif])
883AC_CHECK_TYPE([int32_t], ,
884 [AC_DEFINE([int32_t], [int],
885 [Define to `int' if int32_t not defined.])],
886 [AC_INCLUDES_DEFAULT
887#ifdef HAVE_SYS_BITYPES_H
888#include <sys/bitypes.h>
889#endif])
890AC_CHECK_TYPE([u_int32_t], ,
891 [AC_DEFINE([u_int32_t], [unsigned int],
892 [Define to `unsigned int' if u_int32_t not defined.])],
893 [AC_INCLUDES_DEFAULT
894#ifdef HAVE_SYS_BITYPES_H
895#include <sys/bitypes.h>
896#endif])
897AC_CHECK_TYPE([int64_t], ,
898 [AC_DEFINE([int64_t], [long long],
899 [Define to `long long' if int64_t not defined.])],
900 [AC_INCLUDES_DEFAULT
901#ifdef HAVE_SYS_BITYPES_H
902#include <sys/bitypes.h>
903#endif])
904AC_CHECK_TYPE([u_int64_t], ,
905 [AC_DEFINE([u_int64_t], [unsigned long long],
906 [Define to `unsigned long long' if u_int64_t not defined.])],
907 [AC_INCLUDES_DEFAULT
908#ifdef HAVE_SYS_BITYPES_H
909#include <sys/bitypes.h>
910#endif])
911
912#
913# We can't just check for <inttypes.h> - some systems have one that
914# doesn't define all the PRI[doxu]64 macros.
915#
916AC_CHECK_HEADERS(inttypes.h,
917 [
918 #
919 # OK, we have inttypes.h, but does it define those macros?
920 #
921 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
922 AC_COMPILE_IFELSE(
923 [
924 AC_LANG_SOURCE(
925 [[
926 #include <inttypes.h>
927 #include <stdio.h>
928 #include <sys/types.h>
929 #ifdef HAVE_SYS_BITYPES_H
930 #include <sys/bitypes.h>
931 #endif
932
933 main()
934 {
935 printf("%" PRId64 "\n", (u_int64_t)1);
936 printf("%" PRIo64 "\n", (u_int64_t)1);
937 printf("%" PRIx64 "\n", (u_int64_t)1);
938 printf("%" PRIu64 "\n", (u_int64_t)1);
939 }
940 ]])
941 ],
942 [
943 AC_MSG_RESULT(yes)
944 ac_lbl_inttypes_h_defines_formats=yes
945 ],
946 [
947 AC_MSG_RESULT(no)
948 ac_lbl_inttypes_h_defines_formats=no
949 ])
950 ],
951 [
952 #
953 # We don't have inttypes.h, so it obviously can't define those
954 # macros.
955 #
956 ac_lbl_inttypes_h_defines_formats=no
957 ])
958if test "$ac_lbl_inttypes_h_defines_formats" = no; then
959 AC_LBL_CHECK_64BIT_FORMAT(l,
960 [
961 AC_LBL_CHECK_64BIT_FORMAT(ll,
962 [
963 AC_LBL_CHECK_64BIT_FORMAT(L,
964 [
965 AC_LBL_CHECK_64BIT_FORMAT(q,
966 [
967 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
968 ])
969 ])
970 ])
971 ])
972fi
973
974#
975# Check for some headers introduced in later versions of libpcap
976# and used by some printers.
977#
978# Those headers use the {u_}intN_t types, so we must do this after
979# we check for what's needed to get them defined.
980#
981savedcppflags="$CPPFLAGS"
982CPPFLAGS="$CPPFLAGS $V_INCLS"
983AC_CHECK_HEADERS(pcap/bluetooth.h,,,[#include <tcpdump-stdinc.h>])
984AC_CHECK_HEADERS(pcap/usb.h,,,[#include <tcpdump-stdinc.h>])
985CPPFLAGS="$savedcppflags"
986
987AC_PROG_RANLIB
988
989AC_LBL_DEVEL(V_CCOPT)
990
991AC_LBL_SOCKADDR_SA_LEN
992
993AC_LBL_UNALIGNED_ACCESS
994
995AC_VAR_H_ERRNO
996
997# Check for SSLeay
998AC_MSG_CHECKING(whether to use SSLeay libcrypto)
999# Specify location for both includes and libraries.
1000want_libcrypto=youmama
1001AC_ARG_WITH(crypto,
1002 AS_HELP_STRING([--with-crypto@<:@=PATH@:>@],
1003 [use SSLeay libcrypto (located in directory PATH, if supplied). @<:@default=yes, if available@:>@]),
1004[
1005 if test $withval = no
1006 then
1007 want_libcrypto=no
1008 AC_MSG_RESULT(no)
1009 elif test $withval = yes
1010 then
1011 want_libcrypto=yes
1012 AC_MSG_RESULT(yes)
1013 else
1014 want_libcrypto=yes
1015 AC_MSG_RESULT(yes)
1016 crypto_dir=$withval
1017 fi
1018],[
1019 #
1020 # Use libcrypto if it's present, otherwise don't.
1021 #
1022 want_libcrypto=ifavailable
1023 AC_MSG_RESULT([yes, if available])
1024])
1025if test "$want_libcrypto" != "no"; then
1026 ac_cv_ssleay_path=no
1027 incdir=no
1028 if test "x$crypto_dir" = x; then
1029 #
1030 # Location not specified; check the default locations.
1031 #
1032 AC_MSG_CHECKING(where SSLeay is located)
1033 dirs="/usr /usr/local /usr/local/ssl /usr/pkg"
1034 if test "x${host_alias}" != x; then
1035 dirs="/usr/${host_alias} $dirs"
1036 fi
1037 for dir in $dirs; do
1038 AC_LBL_SSLEAY($dir)
1039
1040 if test "$ac_cv_ssleay_path" != "no" -a "$incdir" != "no"; then
1041 break;
1042 else
1043 ac_cv_ssleay_path=no
1044 incdir=no
1045 fi
1046 done
1047 if test "$ac_cv_ssleay_path" != no; then
1048 AC_MSG_RESULT($ac_cv_ssleay_path)
1049 fi
1050 else
1051 AC_MSG_CHECKING(for SSLeay in $crypto_dir)
1052 AC_LBL_SSLEAY($crypto_dir)
1053 if test "$ac_cv_ssleay_path" != no; then
1054 AC_MSG_RESULT(found)
1055 fi
1056 fi
1057 if test "$ac_cv_ssleay_path" != no; then
1058 V_INCLS="$V_INCLS $incdir"
1059 if test "$dir" != "/usr"; then
1060 LDFLAGS="-L$dir/lib $LDFLAGS"
1061 fi
1062 if test -f $ac_cv_ssleay_path/lib/libRSAglue.a; then
1063 LIBS="$LIBS -lRSAglue"
1064 fi
1065 if test -f $ac_cv_ssleay_path/lib/librsaref.a; then
1066 LIBS="$LIBS -lrsaref"
1067 fi
1068 AC_CHECK_LIB(crypto, DES_cbc_encrypt)
1069
1070 savedppflags="$CPPLAGS"
1071 CPPFLAGS="$CPPFLAGS $V_INCLS"
1072 AC_CHECK_HEADERS(openssl/evp.h)
1073 CPPFLAGS="$savedcppflags"
1074 else
1075 #
1076 # Not found. Did the user explicitly ask for it?
1077 #
1078 AC_MSG_RESULT(not found)
1079 if test "$want_libcrypto" = yes; then
1080 AC_MSG_ERROR(SSLeay not found)
1081 fi
1082 fi
1083fi
1084
1085dnl
1086dnl set additional include path if necessary
1087if test "$missing_includes" = "yes"; then
1088 CPPFLAGS="$CPPFLAGS -I$srcdir/missing"
1089 V_INCLS="$V_INCLS -I$srcdir/missing"
1090fi
1091
1092AC_SUBST(V_CCOPT)
1093AC_SUBST(V_DEFS)
1094AC_SUBST(V_GROUP)
1095AC_SUBST(V_INCLS)
1096AC_SUBST(V_PCAPDEP)
1097AC_SUBST(LOCALSRC)
1098AC_SUBST(MAN_FILE_FORMATS)
1099AC_SUBST(MAN_MISC_INFO)
1100
1101AC_PROG_INSTALL
1102
1103AC_CONFIG_HEADER(config.h)
1104
1105AC_OUTPUT_COMMANDS([if test -f .devel; then
1106 echo timestamp > stamp-h
1107 cat Makefile-devel-adds >> Makefile
1108 make depend
1109fi])
1110AC_OUTPUT(Makefile tcpdump.1)
1111exit 0
11120
=== removed directory '.pc/50_autotools-dev.diff'
=== removed file '.pc/50_autotools-dev.diff/config.guess'
--- .pc/50_autotools-dev.diff/config.guess 2010-06-22 12:44:32 +0000
+++ .pc/50_autotools-dev.diff/config.guess 1970-01-01 00:00:00 +0000
@@ -1,1502 +0,0 @@
1#! /bin/sh
2# Attempt to guess a canonical system name.
3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5# Free Software Foundation, Inc.
6
7timestamp='2009-12-30'
8
9# This file is free software; you can redistribute it and/or modify it
10# under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful, but
15# WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17# General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, write to the Free Software
21# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
22# 02110-1301, USA.
23#
24# As a special exception to the GNU General Public License, if you
25# distribute this file as part of a program that contains a
26# configuration script generated by Autoconf, you may include it under
27# the same distribution terms that you use for the rest of that program.
28
29
30# Originally written by Per Bothner. Please send patches (context
31# diff format) to <config-patches@gnu.org> and include a ChangeLog
32# entry.
33#
34# This script attempts to guess a canonical system name similar to
35# config.sub. If it succeeds, it prints the system name on stdout, and
36# exits with 0. Otherwise, it exits with 1.
37#
38# You can get the latest version of this script from:
39# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
40
41me=`echo "$0" | sed -e 's,.*/,,'`
42
43usage="\
44Usage: $0 [OPTION]
45
46Output the configuration name of the system \`$me' is run on.
47
48Operation modes:
49 -h, --help print this help, then exit
50 -t, --time-stamp print date of last modification, then exit
51 -v, --version print version number, then exit
52
53Report bugs and patches to <config-patches@gnu.org>."
54
55version="\
56GNU config.guess ($timestamp)
57
58Originally written by Per Bothner.
59Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
602001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
61Software Foundation, Inc.
62
63This is free software; see the source for copying conditions. There is NO
64warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
65
66help="
67Try \`$me --help' for more information."
68
69# Parse command line
70while test $# -gt 0 ; do
71 case $1 in
72 --time-stamp | --time* | -t )
73 echo "$timestamp" ; exit ;;
74 --version | -v )
75 echo "$version" ; exit ;;
76 --help | --h* | -h )
77 echo "$usage"; exit ;;
78 -- ) # Stop option processing
79 shift; break ;;
80 - ) # Use stdin as input.
81 break ;;
82 -* )
83 echo "$me: invalid option $1$help" >&2
84 exit 1 ;;
85 * )
86 break ;;
87 esac
88done
89
90if test $# != 0; then
91 echo "$me: too many arguments$help" >&2
92 exit 1
93fi
94
95trap 'exit 1' 1 2 15
96
97# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
98# compiler to aid in system detection is discouraged as it requires
99# temporary files to be created and, as you can see below, it is a
100# headache to deal with in a portable fashion.
101
102# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
103# use `HOST_CC' if defined, but it is deprecated.
104
105# Portable tmp directory creation inspired by the Autoconf team.
106
107set_cc_for_build='
108trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
109trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
110: ${TMPDIR=/tmp} ;
111 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
112 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
113 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
114 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
115dummy=$tmp/dummy ;
116tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
117case $CC_FOR_BUILD,$HOST_CC,$CC in
118 ,,) echo "int x;" > $dummy.c ;
119 for c in cc gcc c89 c99 ; do
120 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
121 CC_FOR_BUILD="$c"; break ;
122 fi ;
123 done ;
124 if test x"$CC_FOR_BUILD" = x ; then
125 CC_FOR_BUILD=no_compiler_found ;
126 fi
127 ;;
128 ,,*) CC_FOR_BUILD=$CC ;;
129 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
130esac ; set_cc_for_build= ;'
131
132# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
133# (ghazi@noc.rutgers.edu 1994-08-24)
134if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
135 PATH=$PATH:/.attbin ; export PATH
136fi
137
138UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
139UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
140UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
141UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
142
143# Note: order is significant - the case branches are not exclusive.
144
145case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
146 *:NetBSD:*:*)
147 # NetBSD (nbsd) targets should (where applicable) match one or
148 # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
149 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
150 # switched to ELF, *-*-netbsd* would select the old
151 # object file format. This provides both forward
152 # compatibility and a consistent mechanism for selecting the
153 # object file format.
154 #
155 # Note: NetBSD doesn't particularly care about the vendor
156 # portion of the name. We always set it to "unknown".
157 sysctl="sysctl -n hw.machine_arch"
158 UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
159 /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
160 case "${UNAME_MACHINE_ARCH}" in
161 armeb) machine=armeb-unknown ;;
162 arm*) machine=arm-unknown ;;
163 sh3el) machine=shl-unknown ;;
164 sh3eb) machine=sh-unknown ;;
165 sh5el) machine=sh5le-unknown ;;
166 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
167 esac
168 # The Operating System including object format, if it has switched
169 # to ELF recently, or will in the future.
170 case "${UNAME_MACHINE_ARCH}" in
171 arm*|i386|m68k|ns32k|sh3*|sparc|vax)
172 eval $set_cc_for_build
173 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
174 | grep -q __ELF__
175 then
176 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
177 # Return netbsd for either. FIX?
178 os=netbsd
179 else
180 os=netbsdelf
181 fi
182 ;;
183 *)
184 os=netbsd
185 ;;
186 esac
187 # The OS release
188 # Debian GNU/NetBSD machines have a different userland, and
189 # thus, need a distinct triplet. However, they do not need
190 # kernel version information, so it can be replaced with a
191 # suitable tag, in the style of linux-gnu.
192 case "${UNAME_VERSION}" in
193 Debian*)
194 release='-gnu'
195 ;;
196 *)
197 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
198 ;;
199 esac
200 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
201 # contains redundant information, the shorter form:
202 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
203 echo "${machine}-${os}${release}"
204 exit ;;
205 *:OpenBSD:*:*)
206 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
207 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
208 exit ;;
209 *:ekkoBSD:*:*)
210 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
211 exit ;;
212 *:SolidBSD:*:*)
213 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
214 exit ;;
215 macppc:MirBSD:*:*)
216 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
217 exit ;;
218 *:MirBSD:*:*)
219 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
220 exit ;;
221 alpha:OSF1:*:*)
222 case $UNAME_RELEASE in
223 *4.0)
224 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
225 ;;
226 *5.*)
227 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
228 ;;
229 esac
230 # According to Compaq, /usr/sbin/psrinfo has been available on
231 # OSF/1 and Tru64 systems produced since 1995. I hope that
232 # covers most systems running today. This code pipes the CPU
233 # types through head -n 1, so we only detect the type of CPU 0.
234 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
235 case "$ALPHA_CPU_TYPE" in
236 "EV4 (21064)")
237 UNAME_MACHINE="alpha" ;;
238 "EV4.5 (21064)")
239 UNAME_MACHINE="alpha" ;;
240 "LCA4 (21066/21068)")
241 UNAME_MACHINE="alpha" ;;
242 "EV5 (21164)")
243 UNAME_MACHINE="alphaev5" ;;
244 "EV5.6 (21164A)")
245 UNAME_MACHINE="alphaev56" ;;
246 "EV5.6 (21164PC)")
247 UNAME_MACHINE="alphapca56" ;;
248 "EV5.7 (21164PC)")
249 UNAME_MACHINE="alphapca57" ;;
250 "EV6 (21264)")
251 UNAME_MACHINE="alphaev6" ;;
252 "EV6.7 (21264A)")
253 UNAME_MACHINE="alphaev67" ;;
254 "EV6.8CB (21264C)")
255 UNAME_MACHINE="alphaev68" ;;
256 "EV6.8AL (21264B)")
257 UNAME_MACHINE="alphaev68" ;;
258 "EV6.8CX (21264D)")
259 UNAME_MACHINE="alphaev68" ;;
260 "EV6.9A (21264/EV69A)")
261 UNAME_MACHINE="alphaev69" ;;
262 "EV7 (21364)")
263 UNAME_MACHINE="alphaev7" ;;
264 "EV7.9 (21364A)")
265 UNAME_MACHINE="alphaev79" ;;
266 esac
267 # A Pn.n version is a patched version.
268 # A Vn.n version is a released version.
269 # A Tn.n version is a released field test version.
270 # A Xn.n version is an unreleased experimental baselevel.
271 # 1.2 uses "1.2" for uname -r.
272 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
273 exit ;;
274 Alpha\ *:Windows_NT*:*)
275 # How do we know it's Interix rather than the generic POSIX subsystem?
276 # Should we change UNAME_MACHINE based on the output of uname instead
277 # of the specific Alpha model?
278 echo alpha-pc-interix
279 exit ;;
280 21064:Windows_NT:50:3)
281 echo alpha-dec-winnt3.5
282 exit ;;
283 Amiga*:UNIX_System_V:4.0:*)
284 echo m68k-unknown-sysv4
285 exit ;;
286 *:[Aa]miga[Oo][Ss]:*:*)
287 echo ${UNAME_MACHINE}-unknown-amigaos
288 exit ;;
289 *:[Mm]orph[Oo][Ss]:*:*)
290 echo ${UNAME_MACHINE}-unknown-morphos
291 exit ;;
292 *:OS/390:*:*)
293 echo i370-ibm-openedition
294 exit ;;
295 *:z/VM:*:*)
296 echo s390-ibm-zvmoe
297 exit ;;
298 *:OS400:*:*)
299 echo powerpc-ibm-os400
300 exit ;;
301 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
302 echo arm-acorn-riscix${UNAME_RELEASE}
303 exit ;;
304 arm:riscos:*:*|arm:RISCOS:*:*)
305 echo arm-unknown-riscos
306 exit ;;
307 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
308 echo hppa1.1-hitachi-hiuxmpp
309 exit ;;
310 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
311 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
312 if test "`(/bin/universe) 2>/dev/null`" = att ; then
313 echo pyramid-pyramid-sysv3
314 else
315 echo pyramid-pyramid-bsd
316 fi
317 exit ;;
318 NILE*:*:*:dcosx)
319 echo pyramid-pyramid-svr4
320 exit ;;
321 DRS?6000:unix:4.0:6*)
322 echo sparc-icl-nx6
323 exit ;;
324 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
325 case `/usr/bin/uname -p` in
326 sparc) echo sparc-icl-nx7; exit ;;
327 esac ;;
328 s390x:SunOS:*:*)
329 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
330 exit ;;
331 sun4H:SunOS:5.*:*)
332 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
333 exit ;;
334 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
335 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
336 exit ;;
337 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
338 echo i386-pc-auroraux${UNAME_RELEASE}
339 exit ;;
340 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
341 eval $set_cc_for_build
342 SUN_ARCH="i386"
343 # If there is a compiler, see if it is configured for 64-bit objects.
344 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
345 # This test works for both compilers.
346 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
347 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
348 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
349 grep IS_64BIT_ARCH >/dev/null
350 then
351 SUN_ARCH="x86_64"
352 fi
353 fi
354 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
355 exit ;;
356 sun4*:SunOS:6*:*)
357 # According to config.sub, this is the proper way to canonicalize
358 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
359 # it's likely to be more like Solaris than SunOS4.
360 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
361 exit ;;
362 sun4*:SunOS:*:*)
363 case "`/usr/bin/arch -k`" in
364 Series*|S4*)
365 UNAME_RELEASE=`uname -v`
366 ;;
367 esac
368 # Japanese Language versions have a version number like `4.1.3-JL'.
369 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
370 exit ;;
371 sun3*:SunOS:*:*)
372 echo m68k-sun-sunos${UNAME_RELEASE}
373 exit ;;
374 sun*:*:4.2BSD:*)
375 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
376 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
377 case "`/bin/arch`" in
378 sun3)
379 echo m68k-sun-sunos${UNAME_RELEASE}
380 ;;
381 sun4)
382 echo sparc-sun-sunos${UNAME_RELEASE}
383 ;;
384 esac
385 exit ;;
386 aushp:SunOS:*:*)
387 echo sparc-auspex-sunos${UNAME_RELEASE}
388 exit ;;
389 # The situation for MiNT is a little confusing. The machine name
390 # can be virtually everything (everything which is not
391 # "atarist" or "atariste" at least should have a processor
392 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
393 # to the lowercase version "mint" (or "freemint"). Finally
394 # the system name "TOS" denotes a system which is actually not
395 # MiNT. But MiNT is downward compatible to TOS, so this should
396 # be no problem.
397 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
398 echo m68k-atari-mint${UNAME_RELEASE}
399 exit ;;
400 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
401 echo m68k-atari-mint${UNAME_RELEASE}
402 exit ;;
403 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
404 echo m68k-atari-mint${UNAME_RELEASE}
405 exit ;;
406 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
407 echo m68k-milan-mint${UNAME_RELEASE}
408 exit ;;
409 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
410 echo m68k-hades-mint${UNAME_RELEASE}
411 exit ;;
412 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
413 echo m68k-unknown-mint${UNAME_RELEASE}
414 exit ;;
415 m68k:machten:*:*)
416 echo m68k-apple-machten${UNAME_RELEASE}
417 exit ;;
418 powerpc:machten:*:*)
419 echo powerpc-apple-machten${UNAME_RELEASE}
420 exit ;;
421 RISC*:Mach:*:*)
422 echo mips-dec-mach_bsd4.3
423 exit ;;
424 RISC*:ULTRIX:*:*)
425 echo mips-dec-ultrix${UNAME_RELEASE}
426 exit ;;
427 VAX*:ULTRIX*:*:*)
428 echo vax-dec-ultrix${UNAME_RELEASE}
429 exit ;;
430 2020:CLIX:*:* | 2430:CLIX:*:*)
431 echo clipper-intergraph-clix${UNAME_RELEASE}
432 exit ;;
433 mips:*:*:UMIPS | mips:*:*:RISCos)
434 eval $set_cc_for_build
435 sed 's/^ //' << EOF >$dummy.c
436#ifdef __cplusplus
437#include <stdio.h> /* for printf() prototype */
438 int main (int argc, char *argv[]) {
439#else
440 int main (argc, argv) int argc; char *argv[]; {
441#endif
442 #if defined (host_mips) && defined (MIPSEB)
443 #if defined (SYSTYPE_SYSV)
444 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
445 #endif
446 #if defined (SYSTYPE_SVR4)
447 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
448 #endif
449 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
450 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
451 #endif
452 #endif
453 exit (-1);
454 }
455EOF
456 $CC_FOR_BUILD -o $dummy $dummy.c &&
457 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
458 SYSTEM_NAME=`$dummy $dummyarg` &&
459 { echo "$SYSTEM_NAME"; exit; }
460 echo mips-mips-riscos${UNAME_RELEASE}
461 exit ;;
462 Motorola:PowerMAX_OS:*:*)
463 echo powerpc-motorola-powermax
464 exit ;;
465 Motorola:*:4.3:PL8-*)
466 echo powerpc-harris-powermax
467 exit ;;
468 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
469 echo powerpc-harris-powermax
470 exit ;;
471 Night_Hawk:Power_UNIX:*:*)
472 echo powerpc-harris-powerunix
473 exit ;;
474 m88k:CX/UX:7*:*)
475 echo m88k-harris-cxux7
476 exit ;;
477 m88k:*:4*:R4*)
478 echo m88k-motorola-sysv4
479 exit ;;
480 m88k:*:3*:R3*)
481 echo m88k-motorola-sysv3
482 exit ;;
483 AViiON:dgux:*:*)
484 # DG/UX returns AViiON for all architectures
485 UNAME_PROCESSOR=`/usr/bin/uname -p`
486 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
487 then
488 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
489 [ ${TARGET_BINARY_INTERFACE}x = x ]
490 then
491 echo m88k-dg-dgux${UNAME_RELEASE}
492 else
493 echo m88k-dg-dguxbcs${UNAME_RELEASE}
494 fi
495 else
496 echo i586-dg-dgux${UNAME_RELEASE}
497 fi
498 exit ;;
499 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
500 echo m88k-dolphin-sysv3
501 exit ;;
502 M88*:*:R3*:*)
503 # Delta 88k system running SVR3
504 echo m88k-motorola-sysv3
505 exit ;;
506 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
507 echo m88k-tektronix-sysv3
508 exit ;;
509 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
510 echo m68k-tektronix-bsd
511 exit ;;
512 *:IRIX*:*:*)
513 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
514 exit ;;
515 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
516 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
517 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
518 i*86:AIX:*:*)
519 echo i386-ibm-aix
520 exit ;;
521 ia64:AIX:*:*)
522 if [ -x /usr/bin/oslevel ] ; then
523 IBM_REV=`/usr/bin/oslevel`
524 else
525 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
526 fi
527 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
528 exit ;;
529 *:AIX:2:3)
530 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
531 eval $set_cc_for_build
532 sed 's/^ //' << EOF >$dummy.c
533 #include <sys/systemcfg.h>
534
535 main()
536 {
537 if (!__power_pc())
538 exit(1);
539 puts("powerpc-ibm-aix3.2.5");
540 exit(0);
541 }
542EOF
543 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
544 then
545 echo "$SYSTEM_NAME"
546 else
547 echo rs6000-ibm-aix3.2.5
548 fi
549 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
550 echo rs6000-ibm-aix3.2.4
551 else
552 echo rs6000-ibm-aix3.2
553 fi
554 exit ;;
555 *:AIX:*:[456])
556 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
557 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
558 IBM_ARCH=rs6000
559 else
560 IBM_ARCH=powerpc
561 fi
562 if [ -x /usr/bin/oslevel ] ; then
563 IBM_REV=`/usr/bin/oslevel`
564 else
565 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
566 fi
567 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
568 exit ;;
569 *:AIX:*:*)
570 echo rs6000-ibm-aix
571 exit ;;
572 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
573 echo romp-ibm-bsd4.4
574 exit ;;
575 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
576 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
577 exit ;; # report: romp-ibm BSD 4.3
578 *:BOSX:*:*)
579 echo rs6000-bull-bosx
580 exit ;;
581 DPX/2?00:B.O.S.:*:*)
582 echo m68k-bull-sysv3
583 exit ;;
584 9000/[34]??:4.3bsd:1.*:*)
585 echo m68k-hp-bsd
586 exit ;;
587 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
588 echo m68k-hp-bsd4.4
589 exit ;;
590 9000/[34678]??:HP-UX:*:*)
591 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
592 case "${UNAME_MACHINE}" in
593 9000/31? ) HP_ARCH=m68000 ;;
594 9000/[34]?? ) HP_ARCH=m68k ;;
595 9000/[678][0-9][0-9])
596 if [ -x /usr/bin/getconf ]; then
597 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
598 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
599 case "${sc_cpu_version}" in
600 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
601 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
602 532) # CPU_PA_RISC2_0
603 case "${sc_kernel_bits}" in
604 32) HP_ARCH="hppa2.0n" ;;
605 64) HP_ARCH="hppa2.0w" ;;
606 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
607 esac ;;
608 esac
609 fi
610 if [ "${HP_ARCH}" = "" ]; then
611 eval $set_cc_for_build
612 sed 's/^ //' << EOF >$dummy.c
613
614 #define _HPUX_SOURCE
615 #include <stdlib.h>
616 #include <unistd.h>
617
618 int main ()
619 {
620 #if defined(_SC_KERNEL_BITS)
621 long bits = sysconf(_SC_KERNEL_BITS);
622 #endif
623 long cpu = sysconf (_SC_CPU_VERSION);
624
625 switch (cpu)
626 {
627 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
628 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
629 case CPU_PA_RISC2_0:
630 #if defined(_SC_KERNEL_BITS)
631 switch (bits)
632 {
633 case 64: puts ("hppa2.0w"); break;
634 case 32: puts ("hppa2.0n"); break;
635 default: puts ("hppa2.0"); break;
636 } break;
637 #else /* !defined(_SC_KERNEL_BITS) */
638 puts ("hppa2.0"); break;
639 #endif
640 default: puts ("hppa1.0"); break;
641 }
642 exit (0);
643 }
644EOF
645 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
646 test -z "$HP_ARCH" && HP_ARCH=hppa
647 fi ;;
648 esac
649 if [ ${HP_ARCH} = "hppa2.0w" ]
650 then
651 eval $set_cc_for_build
652
653 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
654 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
655 # generating 64-bit code. GNU and HP use different nomenclature:
656 #
657 # $ CC_FOR_BUILD=cc ./config.guess
658 # => hppa2.0w-hp-hpux11.23
659 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
660 # => hppa64-hp-hpux11.23
661
662 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
663 grep -q __LP64__
664 then
665 HP_ARCH="hppa2.0w"
666 else
667 HP_ARCH="hppa64"
668 fi
669 fi
670 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
671 exit ;;
672 ia64:HP-UX:*:*)
673 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
674 echo ia64-hp-hpux${HPUX_REV}
675 exit ;;
676 3050*:HI-UX:*:*)
677 eval $set_cc_for_build
678 sed 's/^ //' << EOF >$dummy.c
679 #include <unistd.h>
680 int
681 main ()
682 {
683 long cpu = sysconf (_SC_CPU_VERSION);
684 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
685 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
686 results, however. */
687 if (CPU_IS_PA_RISC (cpu))
688 {
689 switch (cpu)
690 {
691 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
692 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
693 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
694 default: puts ("hppa-hitachi-hiuxwe2"); break;
695 }
696 }
697 else if (CPU_IS_HP_MC68K (cpu))
698 puts ("m68k-hitachi-hiuxwe2");
699 else puts ("unknown-hitachi-hiuxwe2");
700 exit (0);
701 }
702EOF
703 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
704 { echo "$SYSTEM_NAME"; exit; }
705 echo unknown-hitachi-hiuxwe2
706 exit ;;
707 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
708 echo hppa1.1-hp-bsd
709 exit ;;
710 9000/8??:4.3bsd:*:*)
711 echo hppa1.0-hp-bsd
712 exit ;;
713 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
714 echo hppa1.0-hp-mpeix
715 exit ;;
716 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
717 echo hppa1.1-hp-osf
718 exit ;;
719 hp8??:OSF1:*:*)
720 echo hppa1.0-hp-osf
721 exit ;;
722 i*86:OSF1:*:*)
723 if [ -x /usr/sbin/sysversion ] ; then
724 echo ${UNAME_MACHINE}-unknown-osf1mk
725 else
726 echo ${UNAME_MACHINE}-unknown-osf1
727 fi
728 exit ;;
729 parisc*:Lites*:*:*)
730 echo hppa1.1-hp-lites
731 exit ;;
732 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
733 echo c1-convex-bsd
734 exit ;;
735 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
736 if getsysinfo -f scalar_acc
737 then echo c32-convex-bsd
738 else echo c2-convex-bsd
739 fi
740 exit ;;
741 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
742 echo c34-convex-bsd
743 exit ;;
744 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
745 echo c38-convex-bsd
746 exit ;;
747 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
748 echo c4-convex-bsd
749 exit ;;
750 CRAY*Y-MP:*:*:*)
751 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
752 exit ;;
753 CRAY*[A-Z]90:*:*:*)
754 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
755 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
756 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
757 -e 's/\.[^.]*$/.X/'
758 exit ;;
759 CRAY*TS:*:*:*)
760 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
761 exit ;;
762 CRAY*T3E:*:*:*)
763 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
764 exit ;;
765 CRAY*SV1:*:*:*)
766 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
767 exit ;;
768 *:UNICOS/mp:*:*)
769 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
770 exit ;;
771 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
772 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
773 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
774 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
775 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
776 exit ;;
777 5000:UNIX_System_V:4.*:*)
778 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
779 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
780 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
781 exit ;;
782 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
783 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
784 exit ;;
785 sparc*:BSD/OS:*:*)
786 echo sparc-unknown-bsdi${UNAME_RELEASE}
787 exit ;;
788 *:BSD/OS:*:*)
789 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
790 exit ;;
791 *:FreeBSD:*:*)
792 case ${UNAME_MACHINE} in
793 pc98)
794 echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
795 amd64)
796 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
797 *)
798 echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
799 esac
800 exit ;;
801 i*:CYGWIN*:*)
802 echo ${UNAME_MACHINE}-pc-cygwin
803 exit ;;
804 *:MINGW*:*)
805 echo ${UNAME_MACHINE}-pc-mingw32
806 exit ;;
807 i*:windows32*:*)
808 # uname -m includes "-pc" on this system.
809 echo ${UNAME_MACHINE}-mingw32
810 exit ;;
811 i*:PW*:*)
812 echo ${UNAME_MACHINE}-pc-pw32
813 exit ;;
814 *:Interix*:*)
815 case ${UNAME_MACHINE} in
816 x86)
817 echo i586-pc-interix${UNAME_RELEASE}
818 exit ;;
819 authenticamd | genuineintel | EM64T)
820 echo x86_64-unknown-interix${UNAME_RELEASE}
821 exit ;;
822 IA64)
823 echo ia64-unknown-interix${UNAME_RELEASE}
824 exit ;;
825 esac ;;
826 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
827 echo i${UNAME_MACHINE}-pc-mks
828 exit ;;
829 8664:Windows_NT:*)
830 echo x86_64-pc-mks
831 exit ;;
832 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
833 # How do we know it's Interix rather than the generic POSIX subsystem?
834 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
835 # UNAME_MACHINE based on the output of uname instead of i386?
836 echo i586-pc-interix
837 exit ;;
838 i*:UWIN*:*)
839 echo ${UNAME_MACHINE}-pc-uwin
840 exit ;;
841 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
842 echo x86_64-unknown-cygwin
843 exit ;;
844 p*:CYGWIN*:*)
845 echo powerpcle-unknown-cygwin
846 exit ;;
847 prep*:SunOS:5.*:*)
848 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
849 exit ;;
850 *:GNU:*:*)
851 # the GNU system
852 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
853 exit ;;
854 *:GNU/*:*:*)
855 # other systems with GNU libc and userland
856 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
857 exit ;;
858 i*86:Minix:*:*)
859 echo ${UNAME_MACHINE}-pc-minix
860 exit ;;
861 alpha:Linux:*:*)
862 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
863 EV5) UNAME_MACHINE=alphaev5 ;;
864 EV56) UNAME_MACHINE=alphaev56 ;;
865 PCA56) UNAME_MACHINE=alphapca56 ;;
866 PCA57) UNAME_MACHINE=alphapca56 ;;
867 EV6) UNAME_MACHINE=alphaev6 ;;
868 EV67) UNAME_MACHINE=alphaev67 ;;
869 EV68*) UNAME_MACHINE=alphaev68 ;;
870 esac
871 objdump --private-headers /bin/sh | grep -q ld.so.1
872 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
873 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
874 exit ;;
875 arm*:Linux:*:*)
876 eval $set_cc_for_build
877 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
878 | grep -q __ARM_EABI__
879 then
880 echo ${UNAME_MACHINE}-unknown-linux-gnu
881 else
882 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
883 fi
884 exit ;;
885 avr32*:Linux:*:*)
886 echo ${UNAME_MACHINE}-unknown-linux-gnu
887 exit ;;
888 cris:Linux:*:*)
889 echo cris-axis-linux-gnu
890 exit ;;
891 crisv32:Linux:*:*)
892 echo crisv32-axis-linux-gnu
893 exit ;;
894 frv:Linux:*:*)
895 echo frv-unknown-linux-gnu
896 exit ;;
897 i*86:Linux:*:*)
898 LIBC=gnu
899 eval $set_cc_for_build
900 sed 's/^ //' << EOF >$dummy.c
901 #ifdef __dietlibc__
902 LIBC=dietlibc
903 #endif
904EOF
905 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
906 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
907 exit ;;
908 ia64:Linux:*:*)
909 echo ${UNAME_MACHINE}-unknown-linux-gnu
910 exit ;;
911 m32r*:Linux:*:*)
912 echo ${UNAME_MACHINE}-unknown-linux-gnu
913 exit ;;
914 m68*:Linux:*:*)
915 echo ${UNAME_MACHINE}-unknown-linux-gnu
916 exit ;;
917 mips:Linux:*:* | mips64:Linux:*:*)
918 eval $set_cc_for_build
919 sed 's/^ //' << EOF >$dummy.c
920 #undef CPU
921 #undef ${UNAME_MACHINE}
922 #undef ${UNAME_MACHINE}el
923 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
924 CPU=${UNAME_MACHINE}el
925 #else
926 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
927 CPU=${UNAME_MACHINE}
928 #else
929 CPU=
930 #endif
931 #endif
932EOF
933 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
934 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
935 ;;
936 or32:Linux:*:*)
937 echo or32-unknown-linux-gnu
938 exit ;;
939 padre:Linux:*:*)
940 echo sparc-unknown-linux-gnu
941 exit ;;
942 parisc64:Linux:*:* | hppa64:Linux:*:*)
943 echo hppa64-unknown-linux-gnu
944 exit ;;
945 parisc:Linux:*:* | hppa:Linux:*:*)
946 # Look for CPU level
947 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
948 PA7*) echo hppa1.1-unknown-linux-gnu ;;
949 PA8*) echo hppa2.0-unknown-linux-gnu ;;
950 *) echo hppa-unknown-linux-gnu ;;
951 esac
952 exit ;;
953 ppc64:Linux:*:*)
954 echo powerpc64-unknown-linux-gnu
955 exit ;;
956 ppc:Linux:*:*)
957 echo powerpc-unknown-linux-gnu
958 exit ;;
959 s390:Linux:*:* | s390x:Linux:*:*)
960 echo ${UNAME_MACHINE}-ibm-linux
961 exit ;;
962 sh64*:Linux:*:*)
963 echo ${UNAME_MACHINE}-unknown-linux-gnu
964 exit ;;
965 sh*:Linux:*:*)
966 echo ${UNAME_MACHINE}-unknown-linux-gnu
967 exit ;;
968 sparc:Linux:*:* | sparc64:Linux:*:*)
969 echo ${UNAME_MACHINE}-unknown-linux-gnu
970 exit ;;
971 vax:Linux:*:*)
972 echo ${UNAME_MACHINE}-dec-linux-gnu
973 exit ;;
974 x86_64:Linux:*:*)
975 echo x86_64-unknown-linux-gnu
976 exit ;;
977 xtensa*:Linux:*:*)
978 echo ${UNAME_MACHINE}-unknown-linux-gnu
979 exit ;;
980 i*86:DYNIX/ptx:4*:*)
981 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
982 # earlier versions are messed up and put the nodename in both
983 # sysname and nodename.
984 echo i386-sequent-sysv4
985 exit ;;
986 i*86:UNIX_SV:4.2MP:2.*)
987 # Unixware is an offshoot of SVR4, but it has its own version
988 # number series starting with 2...
989 # I am not positive that other SVR4 systems won't match this,
990 # I just have to hope. -- rms.
991 # Use sysv4.2uw... so that sysv4* matches it.
992 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
993 exit ;;
994 i*86:OS/2:*:*)
995 # If we were able to find `uname', then EMX Unix compatibility
996 # is probably installed.
997 echo ${UNAME_MACHINE}-pc-os2-emx
998 exit ;;
999 i*86:XTS-300:*:STOP)
1000 echo ${UNAME_MACHINE}-unknown-stop
1001 exit ;;
1002 i*86:atheos:*:*)
1003 echo ${UNAME_MACHINE}-unknown-atheos
1004 exit ;;
1005 i*86:syllable:*:*)
1006 echo ${UNAME_MACHINE}-pc-syllable
1007 exit ;;
1008 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1009 echo i386-unknown-lynxos${UNAME_RELEASE}
1010 exit ;;
1011 i*86:*DOS:*:*)
1012 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1013 exit ;;
1014 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1015 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1016 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1017 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1018 else
1019 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1020 fi
1021 exit ;;
1022 i*86:*:5:[678]*)
1023 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1024 case `/bin/uname -X | grep "^Machine"` in
1025 *486*) UNAME_MACHINE=i486 ;;
1026 *Pentium) UNAME_MACHINE=i586 ;;
1027 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1028 esac
1029 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1030 exit ;;
1031 i*86:*:3.2:*)
1032 if test -f /usr/options/cb.name; then
1033 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1034 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1035 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1036 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1037 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1038 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1039 && UNAME_MACHINE=i586
1040 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1041 && UNAME_MACHINE=i686
1042 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1043 && UNAME_MACHINE=i686
1044 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1045 else
1046 echo ${UNAME_MACHINE}-pc-sysv32
1047 fi
1048 exit ;;
1049 pc:*:*:*)
1050 # Left here for compatibility:
1051 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1052 # the processor, so we play safe by assuming i586.
1053 # Note: whatever this is, it MUST be the same as what config.sub
1054 # prints for the "djgpp" host, or else GDB configury will decide that
1055 # this is a cross-build.
1056 echo i586-pc-msdosdjgpp
1057 exit ;;
1058 Intel:Mach:3*:*)
1059 echo i386-pc-mach3
1060 exit ;;
1061 paragon:*:*:*)
1062 echo i860-intel-osf1
1063 exit ;;
1064 i860:*:4.*:*) # i860-SVR4
1065 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1066 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1067 else # Add other i860-SVR4 vendors below as they are discovered.
1068 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1069 fi
1070 exit ;;
1071 mini*:CTIX:SYS*5:*)
1072 # "miniframe"
1073 echo m68010-convergent-sysv
1074 exit ;;
1075 mc68k:UNIX:SYSTEM5:3.51m)
1076 echo m68k-convergent-sysv
1077 exit ;;
1078 M680?0:D-NIX:5.3:*)
1079 echo m68k-diab-dnix
1080 exit ;;
1081 M68*:*:R3V[5678]*:*)
1082 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1083 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
1084 OS_REL=''
1085 test -r /etc/.relid \
1086 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1087 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1088 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1089 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1090 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1091 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1092 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1093 && { echo i486-ncr-sysv4; exit; } ;;
1094 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1095 OS_REL='.3'
1096 test -r /etc/.relid \
1097 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1098 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1099 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1100 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1101 && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1102 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1103 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1104 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1105 echo m68k-unknown-lynxos${UNAME_RELEASE}
1106 exit ;;
1107 mc68030:UNIX_System_V:4.*:*)
1108 echo m68k-atari-sysv4
1109 exit ;;
1110 TSUNAMI:LynxOS:2.*:*)
1111 echo sparc-unknown-lynxos${UNAME_RELEASE}
1112 exit ;;
1113 rs6000:LynxOS:2.*:*)
1114 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1115 exit ;;
1116 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1117 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1118 exit ;;
1119 SM[BE]S:UNIX_SV:*:*)
1120 echo mips-dde-sysv${UNAME_RELEASE}
1121 exit ;;
1122 RM*:ReliantUNIX-*:*:*)
1123 echo mips-sni-sysv4
1124 exit ;;
1125 RM*:SINIX-*:*:*)
1126 echo mips-sni-sysv4
1127 exit ;;
1128 *:SINIX-*:*:*)
1129 if uname -p 2>/dev/null >/dev/null ; then
1130 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1131 echo ${UNAME_MACHINE}-sni-sysv4
1132 else
1133 echo ns32k-sni-sysv
1134 fi
1135 exit ;;
1136 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1137 # says <Richard.M.Bartel@ccMail.Census.GOV>
1138 echo i586-unisys-sysv4
1139 exit ;;
1140 *:UNIX_System_V:4*:FTX*)
1141 # From Gerald Hewes <hewes@openmarket.com>.
1142 # How about differentiating between stratus architectures? -djm
1143 echo hppa1.1-stratus-sysv4
1144 exit ;;
1145 *:*:*:FTX*)
1146 # From seanf@swdc.stratus.com.
1147 echo i860-stratus-sysv4
1148 exit ;;
1149 i*86:VOS:*:*)
1150 # From Paul.Green@stratus.com.
1151 echo ${UNAME_MACHINE}-stratus-vos
1152 exit ;;
1153 *:VOS:*:*)
1154 # From Paul.Green@stratus.com.
1155 echo hppa1.1-stratus-vos
1156 exit ;;
1157 mc68*:A/UX:*:*)
1158 echo m68k-apple-aux${UNAME_RELEASE}
1159 exit ;;
1160 news*:NEWS-OS:6*:*)
1161 echo mips-sony-newsos6
1162 exit ;;
1163 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1164 if [ -d /usr/nec ]; then
1165 echo mips-nec-sysv${UNAME_RELEASE}
1166 else
1167 echo mips-unknown-sysv${UNAME_RELEASE}
1168 fi
1169 exit ;;
1170 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1171 echo powerpc-be-beos
1172 exit ;;
1173 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1174 echo powerpc-apple-beos
1175 exit ;;
1176 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1177 echo i586-pc-beos
1178 exit ;;
1179 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1180 echo i586-pc-haiku
1181 exit ;;
1182 SX-4:SUPER-UX:*:*)
1183 echo sx4-nec-superux${UNAME_RELEASE}
1184 exit ;;
1185 SX-5:SUPER-UX:*:*)
1186 echo sx5-nec-superux${UNAME_RELEASE}
1187 exit ;;
1188 SX-6:SUPER-UX:*:*)
1189 echo sx6-nec-superux${UNAME_RELEASE}
1190 exit ;;
1191 SX-7:SUPER-UX:*:*)
1192 echo sx7-nec-superux${UNAME_RELEASE}
1193 exit ;;
1194 SX-8:SUPER-UX:*:*)
1195 echo sx8-nec-superux${UNAME_RELEASE}
1196 exit ;;
1197 SX-8R:SUPER-UX:*:*)
1198 echo sx8r-nec-superux${UNAME_RELEASE}
1199 exit ;;
1200 Power*:Rhapsody:*:*)
1201 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1202 exit ;;
1203 *:Rhapsody:*:*)
1204 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1205 exit ;;
1206 *:Darwin:*:*)
1207 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1208 case $UNAME_PROCESSOR in
1209 i386)
1210 eval $set_cc_for_build
1211 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1212 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1213 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1214 grep IS_64BIT_ARCH >/dev/null
1215 then
1216 UNAME_PROCESSOR="x86_64"
1217 fi
1218 fi ;;
1219 unknown) UNAME_PROCESSOR=powerpc ;;
1220 esac
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: