Merge lp:~logan/ubuntu/quantal/tcpdump/debian-merge into lp:ubuntu/quantal/tcpdump
- Quantal (12.10)
- debian-merge
- Merge into quantal
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jamie Strandboge | Approve | ||
Ubuntu branches | Pending | ||
Review via email: mp+118851@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === removed directory '.pc/10_man_install.diff' | |||
2 | === removed file '.pc/10_man_install.diff/Makefile.in' | |||
3 | --- .pc/10_man_install.diff/Makefile.in 2012-01-04 10:33:48 +0000 | |||
4 | +++ .pc/10_man_install.diff/Makefile.in 1970-01-01 00:00:00 +0000 | |||
5 | @@ -1,448 +0,0 @@ | |||
6 | 1 | # Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 | ||
7 | 2 | # The Regents of the University of California. All rights reserved. | ||
8 | 3 | # | ||
9 | 4 | # Redistribution and use in source and binary forms, with or without | ||
10 | 5 | # modification, are permitted provided that: (1) source code distributions | ||
11 | 6 | # retain the above copyright notice and this paragraph in its entirety, (2) | ||
12 | 7 | # distributions including binary code include the above copyright notice and | ||
13 | 8 | # this paragraph in its entirety in the documentation or other materials | ||
14 | 9 | # provided with the distribution, and (3) all advertising materials mentioning | ||
15 | 10 | # features or use of this software display the following acknowledgement: | ||
16 | 11 | # ``This product includes software developed by the University of California, | ||
17 | 12 | # Lawrence Berkeley Laboratory and its contributors.'' Neither the name of | ||
18 | 13 | # the University nor the names of its contributors may be used to endorse | ||
19 | 14 | # or promote products derived from this software without specific prior | ||
20 | 15 | # written permission. | ||
21 | 16 | # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED | ||
22 | 17 | # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF | ||
23 | 18 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
24 | 19 | # | ||
25 | 20 | # @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.325 2008-11-21 23:17:26 guy Exp $ (LBL) | ||
26 | 21 | |||
27 | 22 | # | ||
28 | 23 | # Various configurable paths (remember to edit Makefile.in, not Makefile) | ||
29 | 24 | # | ||
30 | 25 | |||
31 | 26 | # Top level hierarchy | ||
32 | 27 | prefix = @prefix@ | ||
33 | 28 | exec_prefix = @exec_prefix@ | ||
34 | 29 | datarootdir = @datarootdir@ | ||
35 | 30 | # Pathname of directory to install the binary | ||
36 | 31 | sbindir = @sbindir@ | ||
37 | 32 | # Pathname of directory to install the man page | ||
38 | 33 | mandir = @mandir@ | ||
39 | 34 | |||
40 | 35 | # VPATH | ||
41 | 36 | srcdir = @srcdir@ | ||
42 | 37 | VPATH = @srcdir@ | ||
43 | 38 | |||
44 | 39 | # | ||
45 | 40 | # You shouldn't need to edit anything below here. | ||
46 | 41 | # | ||
47 | 42 | |||
48 | 43 | CC = @CC@ | ||
49 | 44 | PROG = tcpdump | ||
50 | 45 | CCOPT = @V_CCOPT@ | ||
51 | 46 | INCLS = -I. @V_INCLS@ | ||
52 | 47 | DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@ | ||
53 | 48 | |||
54 | 49 | # Standard CFLAGS | ||
55 | 50 | CFLAGS = @CFLAGS@ | ||
56 | 51 | FULL_CFLAGS = $(CCOPT) $(DEFS) $(INCLS) $(CFLAGS) | ||
57 | 52 | |||
58 | 53 | # Standard LDFLAGS | ||
59 | 54 | LDFLAGS = @LDFLAGS@ | ||
60 | 55 | |||
61 | 56 | # Standard LIBS | ||
62 | 57 | LIBS = @LIBS@ | ||
63 | 58 | |||
64 | 59 | INSTALL = @INSTALL@ | ||
65 | 60 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
66 | 61 | INSTALL_DATA = @INSTALL_DATA@ | ||
67 | 62 | RANLIB = @RANLIB@ | ||
68 | 63 | |||
69 | 64 | # Explicitly define compilation rule since SunOS 4's make doesn't like gcc. | ||
70 | 65 | # Also, gcc does not remove the .o before forking 'as', which can be a | ||
71 | 66 | # problem if you don't own the file but can write to the directory. | ||
72 | 67 | .c.o: | ||
73 | 68 | @rm -f $@ | ||
74 | 69 | $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c | ||
75 | 70 | |||
76 | 71 | CSRC = addrtoname.c af.c checksum.c cpack.c gmpls.c oui.c gmt2local.c ipproto.c \ | ||
77 | 72 | nlpid.c l2vpn.c machdep.c parsenfsfh.c in_cksum.c \ | ||
78 | 73 | print-802_11.c print-802_15_4.c print-ap1394.c print-ah.c \ | ||
79 | 74 | print-arcnet.c print-aodv.c print-arp.c print-ascii.c print-atalk.c \ | ||
80 | 75 | print-atm.c print-beep.c print-bfd.c print-bgp.c \ | ||
81 | 76 | print-bootp.c print-bt.c print-carp.c print-cdp.c print-cfm.c \ | ||
82 | 77 | print-chdlc.c print-cip.c print-cnfp.c print-dccp.c print-decnet.c \ | ||
83 | 78 | print-domain.c print-dtp.c print-dvmrp.c print-enc.c print-egp.c \ | ||
84 | 79 | print-eap.c print-eigrp.c\ | ||
85 | 80 | print-esp.c print-ether.c print-fddi.c print-fr.c \ | ||
86 | 81 | print-gre.c print-hsrp.c print-icmp.c print-igmp.c \ | ||
87 | 82 | print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c print-ipnet.c \ | ||
88 | 83 | print-ipx.c print-isoclns.c print-juniper.c print-krb.c \ | ||
89 | 84 | print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \ | ||
90 | 85 | print-lmp.c print-lspping.c print-lwapp.c \ | ||
91 | 86 | print-lwres.c print-mobile.c print-mpcp.c print-mpls.c print-msdp.c \ | ||
92 | 87 | print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \ | ||
93 | 88 | print-pgm.c print-pim.c \ | ||
94 | 89 | print-ppi.c print-ppp.c print-pppoe.c print-pptp.c \ | ||
95 | 90 | print-radius.c print-raw.c print-rip.c print-rpki-rtr.c print-rrcp.c print-rsvp.c \ | ||
96 | 91 | print-rx.c print-sctp.c print-sflow.c print-sip.c print-sl.c print-sll.c \ | ||
97 | 92 | print-slow.c print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \ | ||
98 | 93 | print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \ | ||
99 | 94 | print-timed.c print-token.c print-udld.c print-udp.c print-usb.c \ | ||
100 | 95 | print-vjc.c print-vqp.c print-vrrp.c print-vtp.c print-forces.c \ | ||
101 | 96 | print-wb.c print-zephyr.c signature.c setsignal.c tcpdump.c util.c | ||
102 | 97 | |||
103 | 98 | LIBNETDISSECT_SRC=print-isakmp.c | ||
104 | 99 | LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) | ||
105 | 100 | LIBNETDISSECT=libnetdissect.a | ||
106 | 101 | |||
107 | 102 | LOCALSRC = @LOCALSRC@ | ||
108 | 103 | GENSRC = version.c | ||
109 | 104 | LIBOBJS = @LIBOBJS@ | ||
110 | 105 | |||
111 | 106 | SRC = $(CSRC) $(GENSRC) $(LOCALSRC) $(LIBNETDISSECT_SRC) | ||
112 | 107 | |||
113 | 108 | # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot | ||
114 | 109 | # hack the extra indirection | ||
115 | 110 | OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LOCALSRC:.c=.o) $(LIBOBJS) $(LIBNETDISSECT_OBJ) | ||
116 | 111 | HDR = \ | ||
117 | 112 | acconfig.h \ | ||
118 | 113 | addrtoname.h \ | ||
119 | 114 | af.h \ | ||
120 | 115 | ah.h \ | ||
121 | 116 | aodv.h \ | ||
122 | 117 | appletalk.h \ | ||
123 | 118 | arcnet.h \ | ||
124 | 119 | atm.h \ | ||
125 | 120 | atmuni31.h \ | ||
126 | 121 | bootp.h \ | ||
127 | 122 | bgp.h \ | ||
128 | 123 | chdlc.h \ | ||
129 | 124 | cpack.h \ | ||
130 | 125 | dccp.h \ | ||
131 | 126 | decnet.h \ | ||
132 | 127 | decode_prefix.h \ | ||
133 | 128 | enc.h \ | ||
134 | 129 | esp.h \ | ||
135 | 130 | ether.h \ | ||
136 | 131 | ethertype.h \ | ||
137 | 132 | extract.h \ | ||
138 | 133 | fddi.h \ | ||
139 | 134 | forces.h \ | ||
140 | 135 | gmpls.h \ | ||
141 | 136 | gmt2local.h \ | ||
142 | 137 | icmp6.h \ | ||
143 | 138 | ieee802_11.h \ | ||
144 | 139 | ieee802_11_radio.h \ | ||
145 | 140 | igrp.h \ | ||
146 | 141 | interface.h \ | ||
147 | 142 | interface.h \ | ||
148 | 143 | ip.h \ | ||
149 | 144 | ip6.h \ | ||
150 | 145 | ipfc.h \ | ||
151 | 146 | ipnet.h \ | ||
152 | 147 | ipproto.h \ | ||
153 | 148 | ipsec_doi.h \ | ||
154 | 149 | ipx.h \ | ||
155 | 150 | isakmp.h \ | ||
156 | 151 | l2tp.h \ | ||
157 | 152 | l2vpn.h \ | ||
158 | 153 | lane.h \ | ||
159 | 154 | llc.h \ | ||
160 | 155 | machdep.h \ | ||
161 | 156 | mib.h \ | ||
162 | 157 | mpls.h \ | ||
163 | 158 | nameser.h \ | ||
164 | 159 | netbios.h \ | ||
165 | 160 | netdissect.h \ | ||
166 | 161 | nfs.h \ | ||
167 | 162 | nfsfh.h \ | ||
168 | 163 | nlpid.h \ | ||
169 | 164 | ntp.h \ | ||
170 | 165 | oakley.h \ | ||
171 | 166 | ospf.h \ | ||
172 | 167 | ospf6.h \ | ||
173 | 168 | oui.h \ | ||
174 | 169 | pcap-missing.h \ | ||
175 | 170 | pmap_prot.h \ | ||
176 | 171 | ppi.h \ | ||
177 | 172 | ppp.h \ | ||
178 | 173 | route6d.h \ | ||
179 | 174 | rpc_auth.h \ | ||
180 | 175 | rpc_msg.h \ | ||
181 | 176 | rx.h \ | ||
182 | 177 | sctpConstants.h \ | ||
183 | 178 | sctpHeader.h \ | ||
184 | 179 | setsignal.h \ | ||
185 | 180 | signature.h \ | ||
186 | 181 | slcompress.h \ | ||
187 | 182 | slip.h \ | ||
188 | 183 | sll.h \ | ||
189 | 184 | smb.h \ | ||
190 | 185 | tcp.h \ | ||
191 | 186 | tcpdump-stdinc.h \ | ||
192 | 187 | telnet.h \ | ||
193 | 188 | tftp.h \ | ||
194 | 189 | timed.h \ | ||
195 | 190 | token.h \ | ||
196 | 191 | udp.h | ||
197 | 192 | |||
198 | 193 | TAGHDR = \ | ||
199 | 194 | /usr/include/arpa/tftp.h \ | ||
200 | 195 | /usr/include/net/if_arp.h \ | ||
201 | 196 | /usr/include/net/slip.h \ | ||
202 | 197 | /usr/include/netinet/if_ether.h \ | ||
203 | 198 | /usr/include/netinet/in.h \ | ||
204 | 199 | /usr/include/netinet/ip_icmp.h \ | ||
205 | 200 | /usr/include/netinet/tcp.h \ | ||
206 | 201 | /usr/include/netinet/udp.h \ | ||
207 | 202 | /usr/include/protocols/routed.h | ||
208 | 203 | |||
209 | 204 | TAGFILES = $(SRC) $(HDR) $(TAGHDR) | ||
210 | 205 | |||
211 | 206 | CLEANFILES = $(PROG) $(OBJ) $(GENSRC) | ||
212 | 207 | |||
213 | 208 | EXTRA_DIST = \ | ||
214 | 209 | CHANGES \ | ||
215 | 210 | CREDITS \ | ||
216 | 211 | INSTALL.txt \ | ||
217 | 212 | LICENSE \ | ||
218 | 213 | Makefile.in \ | ||
219 | 214 | Makefile-devel-adds \ | ||
220 | 215 | README \ | ||
221 | 216 | Readme.Win32 \ | ||
222 | 217 | VERSION \ | ||
223 | 218 | aclocal.m4 \ | ||
224 | 219 | atime.awk \ | ||
225 | 220 | bpf_dump.c \ | ||
226 | 221 | config.guess \ | ||
227 | 222 | config.h.in \ | ||
228 | 223 | config.sub \ | ||
229 | 224 | configure \ | ||
230 | 225 | configure.in \ | ||
231 | 226 | install-sh \ | ||
232 | 227 | lbl/os-osf4.h \ | ||
233 | 228 | lbl/os-solaris2.h \ | ||
234 | 229 | lbl/os-sunos4.h \ | ||
235 | 230 | lbl/os-ultrix4.h \ | ||
236 | 231 | makemib \ | ||
237 | 232 | missing/addrinfo.h \ | ||
238 | 233 | missing/dlnames.c \ | ||
239 | 234 | missing/datalinks.c \ | ||
240 | 235 | missing/getnameinfo.c \ | ||
241 | 236 | missing/inet_aton.c \ | ||
242 | 237 | missing/inet_ntop.c \ | ||
243 | 238 | missing/inet_pton.c \ | ||
244 | 239 | missing/snprintf.c \ | ||
245 | 240 | missing/sockstorage.h \ | ||
246 | 241 | missing/strdup.c \ | ||
247 | 242 | missing/strlcat.c \ | ||
248 | 243 | missing/strlcpy.c \ | ||
249 | 244 | missing/strsep.c \ | ||
250 | 245 | mkdep \ | ||
251 | 246 | packetdat.awk \ | ||
252 | 247 | pcap_dump_ftell.c \ | ||
253 | 248 | print-babel.c \ | ||
254 | 249 | print-dhcp6.c \ | ||
255 | 250 | print-frag6.c \ | ||
256 | 251 | print-icmp6.c \ | ||
257 | 252 | print-ip6.c \ | ||
258 | 253 | print-ip6opts.c \ | ||
259 | 254 | print-mobility.c \ | ||
260 | 255 | print-netbios.c \ | ||
261 | 256 | print-ospf6.c \ | ||
262 | 257 | print-pflog.c \ | ||
263 | 258 | print-ripng.c \ | ||
264 | 259 | print-rt6.c \ | ||
265 | 260 | print-smb.c \ | ||
266 | 261 | send-ack.awk \ | ||
267 | 262 | smbutil.c \ | ||
268 | 263 | stime.awk \ | ||
269 | 264 | strcasecmp.c \ | ||
270 | 265 | tcpdump.1.in \ | ||
271 | 266 | tests/02-sunrise-sunset-esp.pcap \ | ||
272 | 267 | tests/08-sunrise-sunset-aes.pcap \ | ||
273 | 268 | tests/08-sunrise-sunset-esp2.pcap \ | ||
274 | 269 | tests/QinQpacket.out \ | ||
275 | 270 | tests/QinQpacket.pcap \ | ||
276 | 271 | tests/QinQpacketv.out \ | ||
277 | 272 | tests/TESTLIST \ | ||
278 | 273 | tests/TESTonce \ | ||
279 | 274 | tests/TESTrun.sh \ | ||
280 | 275 | tests/babel.pcap \ | ||
281 | 276 | tests/babel1.out \ | ||
282 | 277 | tests/babel1v.out \ | ||
283 | 278 | tests/bgp-infinite-loop.pcap \ | ||
284 | 279 | tests/bgp_vpn_attrset.out \ | ||
285 | 280 | tests/bgp_vpn_attrset.pcap \ | ||
286 | 281 | tests/chdlc-slarp-short.pcap \ | ||
287 | 282 | tests/chdlc-slarp.pcap \ | ||
288 | 283 | tests/dio.out \ | ||
289 | 284 | tests/dio.pcap \ | ||
290 | 285 | tests/e1000g.out \ | ||
291 | 286 | tests/e1000g.pcap \ | ||
292 | 287 | tests/eapon1.gdbinit \ | ||
293 | 288 | tests/eapon1.out \ | ||
294 | 289 | tests/eapon1.pcap \ | ||
295 | 290 | tests/empty.uu \ | ||
296 | 291 | tests/esp-secrets.txt \ | ||
297 | 292 | tests/esp0.out \ | ||
298 | 293 | tests/esp1.gdbinit \ | ||
299 | 294 | tests/esp1.out \ | ||
300 | 295 | tests/esp2.gdbinit \ | ||
301 | 296 | tests/esp2.out \ | ||
302 | 297 | tests/esp3.gdbinit \ | ||
303 | 298 | tests/esp4.gdbinit \ | ||
304 | 299 | tests/esp5.gdbinit \ | ||
305 | 300 | tests/esp5.out \ | ||
306 | 301 | tests/espudp1.out \ | ||
307 | 302 | tests/espudp1.pcap \ | ||
308 | 303 | tests/forces1.out \ | ||
309 | 304 | tests/forces1.pcap \ | ||
310 | 305 | tests/forces1vvv.out \ | ||
311 | 306 | tests/forces1vvvv.out \ | ||
312 | 307 | tests/forces2.out \ | ||
313 | 308 | tests/forces2v.out \ | ||
314 | 309 | tests/forces2vv.out \ | ||
315 | 310 | tests/forces3vvv.out \ | ||
316 | 311 | tests/ikev2four.out \ | ||
317 | 312 | tests/ikev2four.pcap \ | ||
318 | 313 | tests/ikev2fourv.out \ | ||
319 | 314 | tests/ikev2fourv4.out \ | ||
320 | 315 | tests/ikev2pI2-secrets.txt \ | ||
321 | 316 | tests/ikev2pI2.out \ | ||
322 | 317 | tests/ikev2pI2.pcap \ | ||
323 | 318 | tests/isakmp-delete-segfault.pcap \ | ||
324 | 319 | tests/isakmp-identification-segfault.pcap \ | ||
325 | 320 | tests/isakmp-pointer-loop.pcap \ | ||
326 | 321 | tests/isakmp1.out \ | ||
327 | 322 | tests/isakmp2.out \ | ||
328 | 323 | tests/isakmp3.out \ | ||
329 | 324 | tests/isakmp4.out \ | ||
330 | 325 | tests/isakmp4500.pcap \ | ||
331 | 326 | tests/isis-infinite-loop.pcap \ | ||
332 | 327 | tests/ldp-infinite-loop.pcap \ | ||
333 | 328 | tests/lmp.out \ | ||
334 | 329 | tests/lmp.pcap \ | ||
335 | 330 | tests/lmp.sh \ | ||
336 | 331 | tests/lspping-fec-ldp.pcap \ | ||
337 | 332 | tests/lspping-fec-rsvp.pcap \ | ||
338 | 333 | tests/mpls-ldp-hello.out \ | ||
339 | 334 | tests/mpls-ldp-hello.pcap \ | ||
340 | 335 | tests/mpls-traceroute.pcap \ | ||
341 | 336 | tests/ospf-gmpls.out \ | ||
342 | 337 | tests/ospf-gmpls.pcap \ | ||
343 | 338 | tests/print-A.out \ | ||
344 | 339 | tests/print-AA.out \ | ||
345 | 340 | tests/print-capX.out \ | ||
346 | 341 | tests/print-capXX.out \ | ||
347 | 342 | tests/print-flags.pcap \ | ||
348 | 343 | tests/print-flags.sh \ | ||
349 | 344 | tests/print-x.out \ | ||
350 | 345 | tests/print-xx.out \ | ||
351 | 346 | tests/rsvp-infinite-loop.pcap \ | ||
352 | 347 | tests/sflow_multiple_counter_30_pdus.out \ | ||
353 | 348 | tests/sflow_multiple_counter_30_pdus.pcap \ | ||
354 | 349 | vfprintf.c \ | ||
355 | 350 | win32/Include/errno.h \ | ||
356 | 351 | win32/Include/getopt.h \ | ||
357 | 352 | win32/Include/w32_fzs.h \ | ||
358 | 353 | win32/Src/getopt.c \ | ||
359 | 354 | win32/prj/GNUmakefile \ | ||
360 | 355 | win32/prj/WinDump.dsp \ | ||
361 | 356 | win32/prj/WinDump.dsw | ||
362 | 357 | |||
363 | 358 | all: $(PROG) | ||
364 | 359 | |||
365 | 360 | $(PROG): $(OBJ) @V_PCAPDEP@ | ||
366 | 361 | @rm -f $@ | ||
367 | 362 | $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) | ||
368 | 363 | |||
369 | 364 | $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ) | ||
370 | 365 | @rm -f $@ | ||
371 | 366 | $(AR) cr $@ $(LIBNETDISSECT_OBJ) | ||
372 | 367 | $(RANLIB) $@ | ||
373 | 368 | |||
374 | 369 | datalinks.o: $(srcdir)/missing/datalinks.c | ||
375 | 370 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c | ||
376 | 371 | dlnames.o: $(srcdir)/missing/dlnames.c | ||
377 | 372 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c | ||
378 | 373 | getnameinfo.o: $(srcdir)/missing/getnameinfo.c | ||
379 | 374 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c | ||
380 | 375 | getaddrinfo.o: $(srcdir)/missing/getaddrinfo.c | ||
381 | 376 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getaddrinfo.c | ||
382 | 377 | inet_pton.o: $(srcdir)/missing/inet_pton.c | ||
383 | 378 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_pton.c | ||
384 | 379 | inet_ntop.o: $(srcdir)/missing/inet_ntop.c | ||
385 | 380 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_ntop.c | ||
386 | 381 | inet_aton.o: $(srcdir)/missing/inet_aton.c | ||
387 | 382 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_aton.c | ||
388 | 383 | snprintf.o: $(srcdir)/missing/snprintf.c | ||
389 | 384 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c | ||
390 | 385 | strlcat.o: $(srcdir)/missing/strlcat.c | ||
391 | 386 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c | ||
392 | 387 | strlcpy.o: $(srcdir)/missing/strlcpy.c | ||
393 | 388 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c | ||
394 | 389 | strsep.o: $(srcdir)/missing/strsep.c | ||
395 | 390 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c | ||
396 | 391 | |||
397 | 392 | version.o: version.c | ||
398 | 393 | $(CC) $(FULL_CFLAGS) -c version.c | ||
399 | 394 | |||
400 | 395 | version.c: $(srcdir)/VERSION | ||
401 | 396 | @rm -f $@ | ||
402 | 397 | if grep GIT ${srcdir}/VERSION >/dev/null; then \ | ||
403 | 398 | read ver <${srcdir}/VERSION; \ | ||
404 | 399 | echo $$ver | tr -d '\012'; \ | ||
405 | 400 | date +_%Y_%m_%d; \ | ||
406 | 401 | else \ | ||
407 | 402 | cat ${srcdir}/VERSION; \ | ||
408 | 403 | fi | sed -e 's/.*/const char version[] = "&";/' > $@ | ||
409 | 404 | |||
410 | 405 | install: all | ||
411 | 406 | [ -d $(DESTDIR)$(sbindir) ] || \ | ||
412 | 407 | (mkdir -p $(DESTDIR)$(sbindir); chmod 755 $(DESTDIR)$(sbindir)) | ||
413 | 408 | $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) | ||
414 | 409 | $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG).`cat ${srcdir}/VERSION` | ||
415 | 410 | [ -d $(DESTDIR)$(mandir)/man1 ] || \ | ||
416 | 411 | (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1) | ||
417 | 412 | $(INSTALL_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1 | ||
418 | 413 | |||
419 | 414 | uninstall: | ||
420 | 415 | rm -f $(DESTDIR)$(sbindir)/$(PROG) | ||
421 | 416 | rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1 | ||
422 | 417 | |||
423 | 418 | lint: $(GENSRC) | ||
424 | 419 | lint -hbxn $(SRC) | \ | ||
425 | 420 | grep -v 'struct/union .* never defined' | \ | ||
426 | 421 | grep -v 'possible pointer alignment problem' | ||
427 | 422 | |||
428 | 423 | clean: | ||
429 | 424 | rm -f $(CLEANFILES) $(PROG)-`cat VERSION`.tar.gz | ||
430 | 425 | |||
431 | 426 | distclean: | ||
432 | 427 | rm -f $(CLEANFILES) Makefile config.cache config.log config.status \ | ||
433 | 428 | config.h gnuc.h os-proto.h stamp-h stamp-h.in $(PROG).1 | ||
434 | 429 | rm -rf autom4te.cache | ||
435 | 430 | |||
436 | 431 | check: tcpdump | ||
437 | 432 | (cd tests && ./TESTrun.sh) | ||
438 | 433 | |||
439 | 434 | tags: $(TAGFILES) | ||
440 | 435 | ctags -wtd $(TAGFILES) | ||
441 | 436 | |||
442 | 437 | TAGS: $(TAGFILES) | ||
443 | 438 | etags $(TAGFILES) | ||
444 | 439 | |||
445 | 440 | releasetar: | ||
446 | 441 | @cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \ | ||
447 | 442 | mkdir $$name; \ | ||
448 | 443 | tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) | (cd $$name; tar xf -); \ | ||
449 | 444 | tar -c -z -f $$name.tar.gz $$name; \ | ||
450 | 445 | rm -rf $$name | ||
451 | 446 | |||
452 | 447 | depend: $(GENSRC) | ||
453 | 448 | ${srcdir}/mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC) | ||
454 | 449 | 0 | ||
455 | === removed directory '.pc/15_install.diff' | |||
456 | === removed file '.pc/15_install.diff/Makefile.in' | |||
457 | --- .pc/15_install.diff/Makefile.in 2012-01-04 10:33:48 +0000 | |||
458 | +++ .pc/15_install.diff/Makefile.in 1970-01-01 00:00:00 +0000 | |||
459 | @@ -1,448 +0,0 @@ | |||
460 | 1 | # Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 | ||
461 | 2 | # The Regents of the University of California. All rights reserved. | ||
462 | 3 | # | ||
463 | 4 | # Redistribution and use in source and binary forms, with or without | ||
464 | 5 | # modification, are permitted provided that: (1) source code distributions | ||
465 | 6 | # retain the above copyright notice and this paragraph in its entirety, (2) | ||
466 | 7 | # distributions including binary code include the above copyright notice and | ||
467 | 8 | # this paragraph in its entirety in the documentation or other materials | ||
468 | 9 | # provided with the distribution, and (3) all advertising materials mentioning | ||
469 | 10 | # features or use of this software display the following acknowledgement: | ||
470 | 11 | # ``This product includes software developed by the University of California, | ||
471 | 12 | # Lawrence Berkeley Laboratory and its contributors.'' Neither the name of | ||
472 | 13 | # the University nor the names of its contributors may be used to endorse | ||
473 | 14 | # or promote products derived from this software without specific prior | ||
474 | 15 | # written permission. | ||
475 | 16 | # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED | ||
476 | 17 | # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF | ||
477 | 18 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
478 | 19 | # | ||
479 | 20 | # @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.325 2008-11-21 23:17:26 guy Exp $ (LBL) | ||
480 | 21 | |||
481 | 22 | # | ||
482 | 23 | # Various configurable paths (remember to edit Makefile.in, not Makefile) | ||
483 | 24 | # | ||
484 | 25 | |||
485 | 26 | # Top level hierarchy | ||
486 | 27 | prefix = @prefix@ | ||
487 | 28 | exec_prefix = @exec_prefix@ | ||
488 | 29 | datarootdir = @datarootdir@ | ||
489 | 30 | # Pathname of directory to install the binary | ||
490 | 31 | sbindir = @sbindir@ | ||
491 | 32 | # Pathname of directory to install the man page | ||
492 | 33 | mandir = @mandir@ | ||
493 | 34 | |||
494 | 35 | # VPATH | ||
495 | 36 | srcdir = @srcdir@ | ||
496 | 37 | VPATH = @srcdir@ | ||
497 | 38 | |||
498 | 39 | # | ||
499 | 40 | # You shouldn't need to edit anything below here. | ||
500 | 41 | # | ||
501 | 42 | |||
502 | 43 | CC = @CC@ | ||
503 | 44 | PROG = tcpdump | ||
504 | 45 | CCOPT = @V_CCOPT@ | ||
505 | 46 | INCLS = -I. @V_INCLS@ | ||
506 | 47 | DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@ | ||
507 | 48 | |||
508 | 49 | # Standard CFLAGS | ||
509 | 50 | CFLAGS = @CFLAGS@ | ||
510 | 51 | FULL_CFLAGS = $(CCOPT) $(DEFS) $(INCLS) $(CFLAGS) | ||
511 | 52 | |||
512 | 53 | # Standard LDFLAGS | ||
513 | 54 | LDFLAGS = @LDFLAGS@ | ||
514 | 55 | |||
515 | 56 | # Standard LIBS | ||
516 | 57 | LIBS = @LIBS@ | ||
517 | 58 | |||
518 | 59 | INSTALL = @INSTALL@ | ||
519 | 60 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
520 | 61 | INSTALL_DATA = @INSTALL_DATA@ | ||
521 | 62 | RANLIB = @RANLIB@ | ||
522 | 63 | |||
523 | 64 | # Explicitly define compilation rule since SunOS 4's make doesn't like gcc. | ||
524 | 65 | # Also, gcc does not remove the .o before forking 'as', which can be a | ||
525 | 66 | # problem if you don't own the file but can write to the directory. | ||
526 | 67 | .c.o: | ||
527 | 68 | @rm -f $@ | ||
528 | 69 | $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c | ||
529 | 70 | |||
530 | 71 | CSRC = addrtoname.c af.c checksum.c cpack.c gmpls.c oui.c gmt2local.c ipproto.c \ | ||
531 | 72 | nlpid.c l2vpn.c machdep.c parsenfsfh.c in_cksum.c \ | ||
532 | 73 | print-802_11.c print-802_15_4.c print-ap1394.c print-ah.c \ | ||
533 | 74 | print-arcnet.c print-aodv.c print-arp.c print-ascii.c print-atalk.c \ | ||
534 | 75 | print-atm.c print-beep.c print-bfd.c print-bgp.c \ | ||
535 | 76 | print-bootp.c print-bt.c print-carp.c print-cdp.c print-cfm.c \ | ||
536 | 77 | print-chdlc.c print-cip.c print-cnfp.c print-dccp.c print-decnet.c \ | ||
537 | 78 | print-domain.c print-dtp.c print-dvmrp.c print-enc.c print-egp.c \ | ||
538 | 79 | print-eap.c print-eigrp.c\ | ||
539 | 80 | print-esp.c print-ether.c print-fddi.c print-fr.c \ | ||
540 | 81 | print-gre.c print-hsrp.c print-icmp.c print-igmp.c \ | ||
541 | 82 | print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c print-ipnet.c \ | ||
542 | 83 | print-ipx.c print-isoclns.c print-juniper.c print-krb.c \ | ||
543 | 84 | print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \ | ||
544 | 85 | print-lmp.c print-lspping.c print-lwapp.c \ | ||
545 | 86 | print-lwres.c print-mobile.c print-mpcp.c print-mpls.c print-msdp.c \ | ||
546 | 87 | print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \ | ||
547 | 88 | print-pgm.c print-pim.c \ | ||
548 | 89 | print-ppi.c print-ppp.c print-pppoe.c print-pptp.c \ | ||
549 | 90 | print-radius.c print-raw.c print-rip.c print-rpki-rtr.c print-rrcp.c print-rsvp.c \ | ||
550 | 91 | print-rx.c print-sctp.c print-sflow.c print-sip.c print-sl.c print-sll.c \ | ||
551 | 92 | print-slow.c print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \ | ||
552 | 93 | print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \ | ||
553 | 94 | print-timed.c print-token.c print-udld.c print-udp.c print-usb.c \ | ||
554 | 95 | print-vjc.c print-vqp.c print-vrrp.c print-vtp.c print-forces.c \ | ||
555 | 96 | print-wb.c print-zephyr.c signature.c setsignal.c tcpdump.c util.c | ||
556 | 97 | |||
557 | 98 | LIBNETDISSECT_SRC=print-isakmp.c | ||
558 | 99 | LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) | ||
559 | 100 | LIBNETDISSECT=libnetdissect.a | ||
560 | 101 | |||
561 | 102 | LOCALSRC = @LOCALSRC@ | ||
562 | 103 | GENSRC = version.c | ||
563 | 104 | LIBOBJS = @LIBOBJS@ | ||
564 | 105 | |||
565 | 106 | SRC = $(CSRC) $(GENSRC) $(LOCALSRC) $(LIBNETDISSECT_SRC) | ||
566 | 107 | |||
567 | 108 | # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot | ||
568 | 109 | # hack the extra indirection | ||
569 | 110 | OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LOCALSRC:.c=.o) $(LIBOBJS) $(LIBNETDISSECT_OBJ) | ||
570 | 111 | HDR = \ | ||
571 | 112 | acconfig.h \ | ||
572 | 113 | addrtoname.h \ | ||
573 | 114 | af.h \ | ||
574 | 115 | ah.h \ | ||
575 | 116 | aodv.h \ | ||
576 | 117 | appletalk.h \ | ||
577 | 118 | arcnet.h \ | ||
578 | 119 | atm.h \ | ||
579 | 120 | atmuni31.h \ | ||
580 | 121 | bootp.h \ | ||
581 | 122 | bgp.h \ | ||
582 | 123 | chdlc.h \ | ||
583 | 124 | cpack.h \ | ||
584 | 125 | dccp.h \ | ||
585 | 126 | decnet.h \ | ||
586 | 127 | decode_prefix.h \ | ||
587 | 128 | enc.h \ | ||
588 | 129 | esp.h \ | ||
589 | 130 | ether.h \ | ||
590 | 131 | ethertype.h \ | ||
591 | 132 | extract.h \ | ||
592 | 133 | fddi.h \ | ||
593 | 134 | forces.h \ | ||
594 | 135 | gmpls.h \ | ||
595 | 136 | gmt2local.h \ | ||
596 | 137 | icmp6.h \ | ||
597 | 138 | ieee802_11.h \ | ||
598 | 139 | ieee802_11_radio.h \ | ||
599 | 140 | igrp.h \ | ||
600 | 141 | interface.h \ | ||
601 | 142 | interface.h \ | ||
602 | 143 | ip.h \ | ||
603 | 144 | ip6.h \ | ||
604 | 145 | ipfc.h \ | ||
605 | 146 | ipnet.h \ | ||
606 | 147 | ipproto.h \ | ||
607 | 148 | ipsec_doi.h \ | ||
608 | 149 | ipx.h \ | ||
609 | 150 | isakmp.h \ | ||
610 | 151 | l2tp.h \ | ||
611 | 152 | l2vpn.h \ | ||
612 | 153 | lane.h \ | ||
613 | 154 | llc.h \ | ||
614 | 155 | machdep.h \ | ||
615 | 156 | mib.h \ | ||
616 | 157 | mpls.h \ | ||
617 | 158 | nameser.h \ | ||
618 | 159 | netbios.h \ | ||
619 | 160 | netdissect.h \ | ||
620 | 161 | nfs.h \ | ||
621 | 162 | nfsfh.h \ | ||
622 | 163 | nlpid.h \ | ||
623 | 164 | ntp.h \ | ||
624 | 165 | oakley.h \ | ||
625 | 166 | ospf.h \ | ||
626 | 167 | ospf6.h \ | ||
627 | 168 | oui.h \ | ||
628 | 169 | pcap-missing.h \ | ||
629 | 170 | pmap_prot.h \ | ||
630 | 171 | ppi.h \ | ||
631 | 172 | ppp.h \ | ||
632 | 173 | route6d.h \ | ||
633 | 174 | rpc_auth.h \ | ||
634 | 175 | rpc_msg.h \ | ||
635 | 176 | rx.h \ | ||
636 | 177 | sctpConstants.h \ | ||
637 | 178 | sctpHeader.h \ | ||
638 | 179 | setsignal.h \ | ||
639 | 180 | signature.h \ | ||
640 | 181 | slcompress.h \ | ||
641 | 182 | slip.h \ | ||
642 | 183 | sll.h \ | ||
643 | 184 | smb.h \ | ||
644 | 185 | tcp.h \ | ||
645 | 186 | tcpdump-stdinc.h \ | ||
646 | 187 | telnet.h \ | ||
647 | 188 | tftp.h \ | ||
648 | 189 | timed.h \ | ||
649 | 190 | token.h \ | ||
650 | 191 | udp.h | ||
651 | 192 | |||
652 | 193 | TAGHDR = \ | ||
653 | 194 | /usr/include/arpa/tftp.h \ | ||
654 | 195 | /usr/include/net/if_arp.h \ | ||
655 | 196 | /usr/include/net/slip.h \ | ||
656 | 197 | /usr/include/netinet/if_ether.h \ | ||
657 | 198 | /usr/include/netinet/in.h \ | ||
658 | 199 | /usr/include/netinet/ip_icmp.h \ | ||
659 | 200 | /usr/include/netinet/tcp.h \ | ||
660 | 201 | /usr/include/netinet/udp.h \ | ||
661 | 202 | /usr/include/protocols/routed.h | ||
662 | 203 | |||
663 | 204 | TAGFILES = $(SRC) $(HDR) $(TAGHDR) | ||
664 | 205 | |||
665 | 206 | CLEANFILES = $(PROG) $(OBJ) $(GENSRC) | ||
666 | 207 | |||
667 | 208 | EXTRA_DIST = \ | ||
668 | 209 | CHANGES \ | ||
669 | 210 | CREDITS \ | ||
670 | 211 | INSTALL.txt \ | ||
671 | 212 | LICENSE \ | ||
672 | 213 | Makefile.in \ | ||
673 | 214 | Makefile-devel-adds \ | ||
674 | 215 | README \ | ||
675 | 216 | Readme.Win32 \ | ||
676 | 217 | VERSION \ | ||
677 | 218 | aclocal.m4 \ | ||
678 | 219 | atime.awk \ | ||
679 | 220 | bpf_dump.c \ | ||
680 | 221 | config.guess \ | ||
681 | 222 | config.h.in \ | ||
682 | 223 | config.sub \ | ||
683 | 224 | configure \ | ||
684 | 225 | configure.in \ | ||
685 | 226 | install-sh \ | ||
686 | 227 | lbl/os-osf4.h \ | ||
687 | 228 | lbl/os-solaris2.h \ | ||
688 | 229 | lbl/os-sunos4.h \ | ||
689 | 230 | lbl/os-ultrix4.h \ | ||
690 | 231 | makemib \ | ||
691 | 232 | missing/addrinfo.h \ | ||
692 | 233 | missing/dlnames.c \ | ||
693 | 234 | missing/datalinks.c \ | ||
694 | 235 | missing/getnameinfo.c \ | ||
695 | 236 | missing/inet_aton.c \ | ||
696 | 237 | missing/inet_ntop.c \ | ||
697 | 238 | missing/inet_pton.c \ | ||
698 | 239 | missing/snprintf.c \ | ||
699 | 240 | missing/sockstorage.h \ | ||
700 | 241 | missing/strdup.c \ | ||
701 | 242 | missing/strlcat.c \ | ||
702 | 243 | missing/strlcpy.c \ | ||
703 | 244 | missing/strsep.c \ | ||
704 | 245 | mkdep \ | ||
705 | 246 | packetdat.awk \ | ||
706 | 247 | pcap_dump_ftell.c \ | ||
707 | 248 | print-babel.c \ | ||
708 | 249 | print-dhcp6.c \ | ||
709 | 250 | print-frag6.c \ | ||
710 | 251 | print-icmp6.c \ | ||
711 | 252 | print-ip6.c \ | ||
712 | 253 | print-ip6opts.c \ | ||
713 | 254 | print-mobility.c \ | ||
714 | 255 | print-netbios.c \ | ||
715 | 256 | print-ospf6.c \ | ||
716 | 257 | print-pflog.c \ | ||
717 | 258 | print-ripng.c \ | ||
718 | 259 | print-rt6.c \ | ||
719 | 260 | print-smb.c \ | ||
720 | 261 | send-ack.awk \ | ||
721 | 262 | smbutil.c \ | ||
722 | 263 | stime.awk \ | ||
723 | 264 | strcasecmp.c \ | ||
724 | 265 | tcpdump.1.in \ | ||
725 | 266 | tests/02-sunrise-sunset-esp.pcap \ | ||
726 | 267 | tests/08-sunrise-sunset-aes.pcap \ | ||
727 | 268 | tests/08-sunrise-sunset-esp2.pcap \ | ||
728 | 269 | tests/QinQpacket.out \ | ||
729 | 270 | tests/QinQpacket.pcap \ | ||
730 | 271 | tests/QinQpacketv.out \ | ||
731 | 272 | tests/TESTLIST \ | ||
732 | 273 | tests/TESTonce \ | ||
733 | 274 | tests/TESTrun.sh \ | ||
734 | 275 | tests/babel.pcap \ | ||
735 | 276 | tests/babel1.out \ | ||
736 | 277 | tests/babel1v.out \ | ||
737 | 278 | tests/bgp-infinite-loop.pcap \ | ||
738 | 279 | tests/bgp_vpn_attrset.out \ | ||
739 | 280 | tests/bgp_vpn_attrset.pcap \ | ||
740 | 281 | tests/chdlc-slarp-short.pcap \ | ||
741 | 282 | tests/chdlc-slarp.pcap \ | ||
742 | 283 | tests/dio.out \ | ||
743 | 284 | tests/dio.pcap \ | ||
744 | 285 | tests/e1000g.out \ | ||
745 | 286 | tests/e1000g.pcap \ | ||
746 | 287 | tests/eapon1.gdbinit \ | ||
747 | 288 | tests/eapon1.out \ | ||
748 | 289 | tests/eapon1.pcap \ | ||
749 | 290 | tests/empty.uu \ | ||
750 | 291 | tests/esp-secrets.txt \ | ||
751 | 292 | tests/esp0.out \ | ||
752 | 293 | tests/esp1.gdbinit \ | ||
753 | 294 | tests/esp1.out \ | ||
754 | 295 | tests/esp2.gdbinit \ | ||
755 | 296 | tests/esp2.out \ | ||
756 | 297 | tests/esp3.gdbinit \ | ||
757 | 298 | tests/esp4.gdbinit \ | ||
758 | 299 | tests/esp5.gdbinit \ | ||
759 | 300 | tests/esp5.out \ | ||
760 | 301 | tests/espudp1.out \ | ||
761 | 302 | tests/espudp1.pcap \ | ||
762 | 303 | tests/forces1.out \ | ||
763 | 304 | tests/forces1.pcap \ | ||
764 | 305 | tests/forces1vvv.out \ | ||
765 | 306 | tests/forces1vvvv.out \ | ||
766 | 307 | tests/forces2.out \ | ||
767 | 308 | tests/forces2v.out \ | ||
768 | 309 | tests/forces2vv.out \ | ||
769 | 310 | tests/forces3vvv.out \ | ||
770 | 311 | tests/ikev2four.out \ | ||
771 | 312 | tests/ikev2four.pcap \ | ||
772 | 313 | tests/ikev2fourv.out \ | ||
773 | 314 | tests/ikev2fourv4.out \ | ||
774 | 315 | tests/ikev2pI2-secrets.txt \ | ||
775 | 316 | tests/ikev2pI2.out \ | ||
776 | 317 | tests/ikev2pI2.pcap \ | ||
777 | 318 | tests/isakmp-delete-segfault.pcap \ | ||
778 | 319 | tests/isakmp-identification-segfault.pcap \ | ||
779 | 320 | tests/isakmp-pointer-loop.pcap \ | ||
780 | 321 | tests/isakmp1.out \ | ||
781 | 322 | tests/isakmp2.out \ | ||
782 | 323 | tests/isakmp3.out \ | ||
783 | 324 | tests/isakmp4.out \ | ||
784 | 325 | tests/isakmp4500.pcap \ | ||
785 | 326 | tests/isis-infinite-loop.pcap \ | ||
786 | 327 | tests/ldp-infinite-loop.pcap \ | ||
787 | 328 | tests/lmp.out \ | ||
788 | 329 | tests/lmp.pcap \ | ||
789 | 330 | tests/lmp.sh \ | ||
790 | 331 | tests/lspping-fec-ldp.pcap \ | ||
791 | 332 | tests/lspping-fec-rsvp.pcap \ | ||
792 | 333 | tests/mpls-ldp-hello.out \ | ||
793 | 334 | tests/mpls-ldp-hello.pcap \ | ||
794 | 335 | tests/mpls-traceroute.pcap \ | ||
795 | 336 | tests/ospf-gmpls.out \ | ||
796 | 337 | tests/ospf-gmpls.pcap \ | ||
797 | 338 | tests/print-A.out \ | ||
798 | 339 | tests/print-AA.out \ | ||
799 | 340 | tests/print-capX.out \ | ||
800 | 341 | tests/print-capXX.out \ | ||
801 | 342 | tests/print-flags.pcap \ | ||
802 | 343 | tests/print-flags.sh \ | ||
803 | 344 | tests/print-x.out \ | ||
804 | 345 | tests/print-xx.out \ | ||
805 | 346 | tests/rsvp-infinite-loop.pcap \ | ||
806 | 347 | tests/sflow_multiple_counter_30_pdus.out \ | ||
807 | 348 | tests/sflow_multiple_counter_30_pdus.pcap \ | ||
808 | 349 | vfprintf.c \ | ||
809 | 350 | win32/Include/errno.h \ | ||
810 | 351 | win32/Include/getopt.h \ | ||
811 | 352 | win32/Include/w32_fzs.h \ | ||
812 | 353 | win32/Src/getopt.c \ | ||
813 | 354 | win32/prj/GNUmakefile \ | ||
814 | 355 | win32/prj/WinDump.dsp \ | ||
815 | 356 | win32/prj/WinDump.dsw | ||
816 | 357 | |||
817 | 358 | all: $(PROG) | ||
818 | 359 | |||
819 | 360 | $(PROG): $(OBJ) @V_PCAPDEP@ | ||
820 | 361 | @rm -f $@ | ||
821 | 362 | $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) | ||
822 | 363 | |||
823 | 364 | $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ) | ||
824 | 365 | @rm -f $@ | ||
825 | 366 | $(AR) cr $@ $(LIBNETDISSECT_OBJ) | ||
826 | 367 | $(RANLIB) $@ | ||
827 | 368 | |||
828 | 369 | datalinks.o: $(srcdir)/missing/datalinks.c | ||
829 | 370 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c | ||
830 | 371 | dlnames.o: $(srcdir)/missing/dlnames.c | ||
831 | 372 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c | ||
832 | 373 | getnameinfo.o: $(srcdir)/missing/getnameinfo.c | ||
833 | 374 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c | ||
834 | 375 | getaddrinfo.o: $(srcdir)/missing/getaddrinfo.c | ||
835 | 376 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getaddrinfo.c | ||
836 | 377 | inet_pton.o: $(srcdir)/missing/inet_pton.c | ||
837 | 378 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_pton.c | ||
838 | 379 | inet_ntop.o: $(srcdir)/missing/inet_ntop.c | ||
839 | 380 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_ntop.c | ||
840 | 381 | inet_aton.o: $(srcdir)/missing/inet_aton.c | ||
841 | 382 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_aton.c | ||
842 | 383 | snprintf.o: $(srcdir)/missing/snprintf.c | ||
843 | 384 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c | ||
844 | 385 | strlcat.o: $(srcdir)/missing/strlcat.c | ||
845 | 386 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c | ||
846 | 387 | strlcpy.o: $(srcdir)/missing/strlcpy.c | ||
847 | 388 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c | ||
848 | 389 | strsep.o: $(srcdir)/missing/strsep.c | ||
849 | 390 | $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c | ||
850 | 391 | |||
851 | 392 | version.o: version.c | ||
852 | 393 | $(CC) $(FULL_CFLAGS) -c version.c | ||
853 | 394 | |||
854 | 395 | version.c: $(srcdir)/VERSION | ||
855 | 396 | @rm -f $@ | ||
856 | 397 | if grep GIT ${srcdir}/VERSION >/dev/null; then \ | ||
857 | 398 | read ver <${srcdir}/VERSION; \ | ||
858 | 399 | echo $$ver | tr -d '\012'; \ | ||
859 | 400 | date +_%Y_%m_%d; \ | ||
860 | 401 | else \ | ||
861 | 402 | cat ${srcdir}/VERSION; \ | ||
862 | 403 | fi | sed -e 's/.*/const char version[] = "&";/' > $@ | ||
863 | 404 | |||
864 | 405 | install: all | ||
865 | 406 | [ -d $(DESTDIR)$(sbindir) ] || \ | ||
866 | 407 | (mkdir -p $(DESTDIR)$(sbindir); chmod 755 $(DESTDIR)$(sbindir)) | ||
867 | 408 | $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) | ||
868 | 409 | $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG).`cat ${srcdir}/VERSION` | ||
869 | 410 | [ -d $(DESTDIR)$(mandir)/man8 ] || \ | ||
870 | 411 | (mkdir -p $(DESTDIR)$(mandir)/man8; chmod 755 $(DESTDIR)$(mandir)/man8) | ||
871 | 412 | $(INSTALL_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man8/$(PROG).8 | ||
872 | 413 | |||
873 | 414 | uninstall: | ||
874 | 415 | rm -f $(DESTDIR)$(sbindir)/$(PROG) | ||
875 | 416 | rm -f $(DESTDIR)$(mandir)/man8/$(PROG).8 | ||
876 | 417 | |||
877 | 418 | lint: $(GENSRC) | ||
878 | 419 | lint -hbxn $(SRC) | \ | ||
879 | 420 | grep -v 'struct/union .* never defined' | \ | ||
880 | 421 | grep -v 'possible pointer alignment problem' | ||
881 | 422 | |||
882 | 423 | clean: | ||
883 | 424 | rm -f $(CLEANFILES) $(PROG)-`cat VERSION`.tar.gz | ||
884 | 425 | |||
885 | 426 | distclean: | ||
886 | 427 | rm -f $(CLEANFILES) Makefile config.cache config.log config.status \ | ||
887 | 428 | config.h gnuc.h os-proto.h stamp-h stamp-h.in $(PROG).1 | ||
888 | 429 | rm -rf autom4te.cache | ||
889 | 430 | |||
890 | 431 | check: tcpdump | ||
891 | 432 | (cd tests && ./TESTrun.sh) | ||
892 | 433 | |||
893 | 434 | tags: $(TAGFILES) | ||
894 | 435 | ctags -wtd $(TAGFILES) | ||
895 | 436 | |||
896 | 437 | TAGS: $(TAGFILES) | ||
897 | 438 | etags $(TAGFILES) | ||
898 | 439 | |||
899 | 440 | releasetar: | ||
900 | 441 | @cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \ | ||
901 | 442 | mkdir $$name; \ | ||
902 | 443 | tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) | (cd $$name; tar xf -); \ | ||
903 | 444 | tar -c -z -f $$name.tar.gz $$name; \ | ||
904 | 445 | rm -rf $$name | ||
905 | 446 | |||
906 | 447 | depend: $(GENSRC) | ||
907 | 448 | ${srcdir}/mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC) | ||
908 | 449 | 0 | ||
909 | === removed directory '.pc/20_man_fixes.diff' | |||
910 | === removed file '.pc/20_man_fixes.diff/tcpdump.1.in' | |||
911 | --- .pc/20_man_fixes.diff/tcpdump.1.in 2012-01-02 20:19:22 +0000 | |||
912 | +++ .pc/20_man_fixes.diff/tcpdump.1.in 1970-01-01 00:00:00 +0000 | |||
913 | @@ -1,1744 +0,0 @@ | |||
914 | 1 | .\" @(#) $Header: /tcpdump/master/tcpdump/tcpdump.1.in,v 1.2 2008-11-09 23:35:03 mcr Exp $ (LBL) | ||
915 | 2 | .\" | ||
916 | 3 | .\" $NetBSD: tcpdump.8,v 1.9 2003/03/31 00:18:17 perry Exp $ | ||
917 | 4 | .\" | ||
918 | 5 | .\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997 | ||
919 | 6 | .\" The Regents of the University of California. All rights reserved. | ||
920 | 7 | .\" All rights reserved. | ||
921 | 8 | .\" | ||
922 | 9 | .\" Redistribution and use in source and binary forms, with or without | ||
923 | 10 | .\" modification, are permitted provided that: (1) source code distributions | ||
924 | 11 | .\" retain the above copyright notice and this paragraph in its entirety, (2) | ||
925 | 12 | .\" distributions including binary code include the above copyright notice and | ||
926 | 13 | .\" this paragraph in its entirety in the documentation or other materials | ||
927 | 14 | .\" provided with the distribution, and (3) all advertising materials mentioning | ||
928 | 15 | .\" features or use of this software display the following acknowledgement: | ||
929 | 16 | .\" ``This product includes software developed by the University of California, | ||
930 | 17 | .\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of | ||
931 | 18 | .\" the University nor the names of its contributors may be used to endorse | ||
932 | 19 | .\" or promote products derived from this software without specific prior | ||
933 | 20 | .\" written permission. | ||
934 | 21 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED | ||
935 | 22 | .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF | ||
936 | 23 | .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
937 | 24 | .\" | ||
938 | 25 | .TH TCPDUMP 1 "05 March 2009" | ||
939 | 26 | .SH NAME | ||
940 | 27 | tcpdump \- dump traffic on a network | ||
941 | 28 | .SH SYNOPSIS | ||
942 | 29 | .na | ||
943 | 30 | .B tcpdump | ||
944 | 31 | [ | ||
945 | 32 | .B \-AbdDefhHIJKlLnNOpqRStuUvxX | ||
946 | 33 | ] [ | ||
947 | 34 | .B \-B | ||
948 | 35 | .I buffer_size | ||
949 | 36 | ] [ | ||
950 | 37 | .B \-c | ||
951 | 38 | .I count | ||
952 | 39 | ] | ||
953 | 40 | .br | ||
954 | 41 | .ti +8 | ||
955 | 42 | [ | ||
956 | 43 | .B \-C | ||
957 | 44 | .I file_size | ||
958 | 45 | ] [ | ||
959 | 46 | .B \-G | ||
960 | 47 | .I rotate_seconds | ||
961 | 48 | ] [ | ||
962 | 49 | .B \-F | ||
963 | 50 | .I file | ||
964 | 51 | ] | ||
965 | 52 | .br | ||
966 | 53 | .ti +8 | ||
967 | 54 | [ | ||
968 | 55 | .B \-i | ||
969 | 56 | .I interface | ||
970 | 57 | ] | ||
971 | 58 | [ | ||
972 | 59 | .B \-j | ||
973 | 60 | .I tstamp_type | ||
974 | 61 | ] | ||
975 | 62 | [ | ||
976 | 63 | .B \-m | ||
977 | 64 | .I module | ||
978 | 65 | ] | ||
979 | 66 | [ | ||
980 | 67 | .B \-M | ||
981 | 68 | .I secret | ||
982 | 69 | ] | ||
983 | 70 | .br | ||
984 | 71 | .ti +8 | ||
985 | 72 | [ | ||
986 | 73 | .B \-r | ||
987 | 74 | .I file | ||
988 | 75 | ] | ||
989 | 76 | [ | ||
990 | 77 | .B \-s | ||
991 | 78 | .I snaplen | ||
992 | 79 | ] | ||
993 | 80 | [ | ||
994 | 81 | .B \-T | ||
995 | 82 | .I type | ||
996 | 83 | ] | ||
997 | 84 | [ | ||
998 | 85 | .B \-w | ||
999 | 86 | .I file | ||
1000 | 87 | ] | ||
1001 | 88 | .br | ||
1002 | 89 | .ti +8 | ||
1003 | 90 | [ | ||
1004 | 91 | .B \-W | ||
1005 | 92 | .I filecount | ||
1006 | 93 | ] | ||
1007 | 94 | .br | ||
1008 | 95 | .ti +8 | ||
1009 | 96 | [ | ||
1010 | 97 | .B \-E | ||
1011 | 98 | .I spi@ipaddr algo:secret,... | ||
1012 | 99 | ] | ||
1013 | 100 | .br | ||
1014 | 101 | .ti +8 | ||
1015 | 102 | [ | ||
1016 | 103 | .B \-y | ||
1017 | 104 | .I datalinktype | ||
1018 | 105 | ] | ||
1019 | 106 | [ | ||
1020 | 107 | .B \-z | ||
1021 | 108 | .I postrotate-command | ||
1022 | 109 | ] | ||
1023 | 110 | [ | ||
1024 | 111 | .B \-Z | ||
1025 | 112 | .I user | ||
1026 | 113 | ] | ||
1027 | 114 | .ti +8 | ||
1028 | 115 | [ | ||
1029 | 116 | .I expression | ||
1030 | 117 | ] | ||
1031 | 118 | .br | ||
1032 | 119 | .ad | ||
1033 | 120 | .SH DESCRIPTION | ||
1034 | 121 | .LP | ||
1035 | 122 | \fITcpdump\fP prints out a description of the contents of packets on a | ||
1036 | 123 | network interface that match the boolean \fIexpression\fP. It can also | ||
1037 | 124 | be run with the | ||
1038 | 125 | .B \-w | ||
1039 | 126 | flag, which causes it to save the packet data to a file for later | ||
1040 | 127 | analysis, and/or with the | ||
1041 | 128 | .B \-r | ||
1042 | 129 | flag, which causes it to read from a saved packet file rather than to | ||
1043 | 130 | read packets from a network interface. In all cases, only packets that | ||
1044 | 131 | match | ||
1045 | 132 | .I expression | ||
1046 | 133 | will be processed by | ||
1047 | 134 | .IR tcpdump . | ||
1048 | 135 | .LP | ||
1049 | 136 | .I Tcpdump | ||
1050 | 137 | will, if not run with the | ||
1051 | 138 | .B \-c | ||
1052 | 139 | flag, continue capturing packets until it is interrupted by a SIGINT | ||
1053 | 140 | signal (generated, for example, by typing your interrupt character, | ||
1054 | 141 | typically control-C) or a SIGTERM signal (typically generated with the | ||
1055 | 142 | .BR kill (1) | ||
1056 | 143 | command); if run with the | ||
1057 | 144 | .B \-c | ||
1058 | 145 | flag, it will capture packets until it is interrupted by a SIGINT or | ||
1059 | 146 | SIGTERM signal or the specified number of packets have been processed. | ||
1060 | 147 | .LP | ||
1061 | 148 | When | ||
1062 | 149 | .I tcpdump | ||
1063 | 150 | finishes capturing packets, it will report counts of: | ||
1064 | 151 | .IP | ||
1065 | 152 | packets ``captured'' (this is the number of packets that | ||
1066 | 153 | .I tcpdump | ||
1067 | 154 | has received and processed); | ||
1068 | 155 | .IP | ||
1069 | 156 | packets ``received by filter'' (the meaning of this depends on the OS on | ||
1070 | 157 | which you're running | ||
1071 | 158 | .IR tcpdump , | ||
1072 | 159 | and possibly on the way the OS was configured - if a filter was | ||
1073 | 160 | specified on the command line, on some OSes it counts packets regardless | ||
1074 | 161 | of whether they were matched by the filter expression and, even if they | ||
1075 | 162 | were matched by the filter expression, regardless of whether | ||
1076 | 163 | .I tcpdump | ||
1077 | 164 | has read and processed them yet, on other OSes it counts only packets that were | ||
1078 | 165 | matched by the filter expression regardless of whether | ||
1079 | 166 | .I tcpdump | ||
1080 | 167 | has read and processed them yet, and on other OSes it counts only | ||
1081 | 168 | packets that were matched by the filter expression and were processed by | ||
1082 | 169 | .IR tcpdump ); | ||
1083 | 170 | .IP | ||
1084 | 171 | packets ``dropped by kernel'' (this is the number of packets that were | ||
1085 | 172 | dropped, due to a lack of buffer space, by the packet capture mechanism | ||
1086 | 173 | in the OS on which | ||
1087 | 174 | .I tcpdump | ||
1088 | 175 | is running, if the OS reports that information to applications; if not, | ||
1089 | 176 | it will be reported as 0). | ||
1090 | 177 | .LP | ||
1091 | 178 | On platforms that support the SIGINFO signal, such as most BSDs | ||
1092 | 179 | (including Mac OS X) and Digital/Tru64 UNIX, it will report those counts | ||
1093 | 180 | when it receives a SIGINFO signal (generated, for example, by typing | ||
1094 | 181 | your ``status'' character, typically control-T, although on some | ||
1095 | 182 | platforms, such as Mac OS X, the ``status'' character is not set by | ||
1096 | 183 | default, so you must set it with | ||
1097 | 184 | .BR stty (1) | ||
1098 | 185 | in order to use it) and will continue capturing packets. | ||
1099 | 186 | .LP | ||
1100 | 187 | Reading packets from a network interface may require that you have | ||
1101 | 188 | special privileges; see the | ||
1102 | 189 | .B pcap (3PCAP) | ||
1103 | 190 | man page for details. Reading a saved packet file doesn't require | ||
1104 | 191 | special privileges. | ||
1105 | 192 | .SH OPTIONS | ||
1106 | 193 | .TP | ||
1107 | 194 | .B \-A | ||
1108 | 195 | Print each packet (minus its link level header) in ASCII. Handy for | ||
1109 | 196 | capturing web pages. | ||
1110 | 197 | .TP | ||
1111 | 198 | .B \-b | ||
1112 | 199 | Print the AS number in BGP packets in ASDOT notation rather than ASPLAIN | ||
1113 | 200 | notation. | ||
1114 | 201 | .TP | ||
1115 | 202 | .B \-B | ||
1116 | 203 | Set the operating system capture buffer size to \fIbuffer_size\fP. | ||
1117 | 204 | .TP | ||
1118 | 205 | .B \-c | ||
1119 | 206 | Exit after receiving \fIcount\fP packets. | ||
1120 | 207 | .TP | ||
1121 | 208 | .B \-C | ||
1122 | 209 | Before writing a raw packet to a savefile, check whether the file is | ||
1123 | 210 | currently larger than \fIfile_size\fP and, if so, close the current | ||
1124 | 211 | savefile and open a new one. Savefiles after the first savefile will | ||
1125 | 212 | have the name specified with the | ||
1126 | 213 | .B \-w | ||
1127 | 214 | flag, with a number after it, starting at 1 and continuing upward. | ||
1128 | 215 | The units of \fIfile_size\fP are millions of bytes (1,000,000 bytes, | ||
1129 | 216 | not 1,048,576 bytes). | ||
1130 | 217 | .TP | ||
1131 | 218 | .B \-d | ||
1132 | 219 | Dump the compiled packet-matching code in a human readable form to | ||
1133 | 220 | standard output and stop. | ||
1134 | 221 | .TP | ||
1135 | 222 | .B \-dd | ||
1136 | 223 | Dump packet-matching code as a | ||
1137 | 224 | .B C | ||
1138 | 225 | program fragment. | ||
1139 | 226 | .TP | ||
1140 | 227 | .B \-ddd | ||
1141 | 228 | Dump packet-matching code as decimal numbers (preceded with a count). | ||
1142 | 229 | .TP | ||
1143 | 230 | .B \-D | ||
1144 | 231 | Print the list of the network interfaces available on the system and on | ||
1145 | 232 | which | ||
1146 | 233 | .I tcpdump | ||
1147 | 234 | can capture packets. For each network interface, a number and an | ||
1148 | 235 | interface name, possibly followed by a text description of the | ||
1149 | 236 | interface, is printed. The interface name or the number can be supplied | ||
1150 | 237 | to the | ||
1151 | 238 | .B \-i | ||
1152 | 239 | flag to specify an interface on which to capture. | ||
1153 | 240 | .IP | ||
1154 | 241 | This can be useful on systems that don't have a command to list them | ||
1155 | 242 | (e.g., Windows systems, or UNIX systems lacking | ||
1156 | 243 | .BR "ifconfig \-a" ); | ||
1157 | 244 | the number can be useful on Windows 2000 and later systems, where the | ||
1158 | 245 | interface name is a somewhat complex string. | ||
1159 | 246 | .IP | ||
1160 | 247 | The | ||
1161 | 248 | .B \-D | ||
1162 | 249 | flag will not be supported if | ||
1163 | 250 | .I tcpdump | ||
1164 | 251 | was built with an older version of | ||
1165 | 252 | .I libpcap | ||
1166 | 253 | that lacks the | ||
1167 | 254 | .B pcap_findalldevs() | ||
1168 | 255 | function. | ||
1169 | 256 | .TP | ||
1170 | 257 | .B \-e | ||
1171 | 258 | Print the link-level header on each dump line. | ||
1172 | 259 | .TP | ||
1173 | 260 | .B \-E | ||
1174 | 261 | Use \fIspi@ipaddr algo:secret\fP for decrypting IPsec ESP packets that | ||
1175 | 262 | are addressed to \fIaddr\fP and contain Security Parameter Index value | ||
1176 | 263 | \fIspi\fP. This combination may be repeated with comma or newline separation. | ||
1177 | 264 | .IP | ||
1178 | 265 | Note that setting the secret for IPv4 ESP packets is supported at this time. | ||
1179 | 266 | .IP | ||
1180 | 267 | Algorithms may be | ||
1181 | 268 | \fBdes-cbc\fP, | ||
1182 | 269 | \fB3des-cbc\fP, | ||
1183 | 270 | \fBblowfish-cbc\fP, | ||
1184 | 271 | \fBrc3-cbc\fP, | ||
1185 | 272 | \fBcast128-cbc\fP, or | ||
1186 | 273 | \fBnone\fP. | ||
1187 | 274 | The default is \fBdes-cbc\fP. | ||
1188 | 275 | The ability to decrypt packets is only present if \fItcpdump\fP was compiled | ||
1189 | 276 | with cryptography enabled. | ||
1190 | 277 | .IP | ||
1191 | 278 | \fIsecret\fP is the ASCII text for ESP secret key. | ||
1192 | 279 | If preceded by 0x, then a hex value will be read. | ||
1193 | 280 | .IP | ||
1194 | 281 | The option assumes RFC2406 ESP, not RFC1827 ESP. | ||
1195 | 282 | The option is only for debugging purposes, and | ||
1196 | 283 | the use of this option with a true `secret' key is discouraged. | ||
1197 | 284 | By presenting IPsec secret key onto command line | ||
1198 | 285 | you make it visible to others, via | ||
1199 | 286 | .IR ps (1) | ||
1200 | 287 | and other occasions. | ||
1201 | 288 | .IP | ||
1202 | 289 | In addition to the above syntax, the syntax \fIfile name\fP may be used | ||
1203 | 290 | to have tcpdump read the provided file in. The file is opened upon | ||
1204 | 291 | receiving the first ESP packet, so any special permissions that tcpdump | ||
1205 | 292 | may have been given should already have been given up. | ||
1206 | 293 | .TP | ||
1207 | 294 | .B \-f | ||
1208 | 295 | Print `foreign' IPv4 addresses numerically rather than symbolically | ||
1209 | 296 | (this option is intended to get around serious brain damage in | ||
1210 | 297 | Sun's NIS server \(em usually it hangs forever translating non-local | ||
1211 | 298 | internet numbers). | ||
1212 | 299 | .IP | ||
1213 | 300 | The test for `foreign' IPv4 addresses is done using the IPv4 address and | ||
1214 | 301 | netmask of the interface on which capture is being done. If that | ||
1215 | 302 | address or netmask are not available, available, either because the | ||
1216 | 303 | interface on which capture is being done has no address or netmask or | ||
1217 | 304 | because the capture is being done on the Linux "any" interface, which | ||
1218 | 305 | can capture on more than one interface, this option will not work | ||
1219 | 306 | correctly. | ||
1220 | 307 | .TP | ||
1221 | 308 | .B \-F | ||
1222 | 309 | Use \fIfile\fP as input for the filter expression. | ||
1223 | 310 | An additional expression given on the command line is ignored. | ||
1224 | 311 | .TP | ||
1225 | 312 | .B \-G | ||
1226 | 313 | If specified, rotates the dump file specified with the | ||
1227 | 314 | .B \-w | ||
1228 | 315 | option every \fIrotate_seconds\fP seconds. | ||
1229 | 316 | Savefiles will have the name specified by | ||
1230 | 317 | .B \-w | ||
1231 | 318 | which should include a time format as defined by | ||
1232 | 319 | .BR strftime (3). | ||
1233 | 320 | If no time format is specified, each new file will overwrite the previous. | ||
1234 | 321 | .IP | ||
1235 | 322 | If used in conjunction with the | ||
1236 | 323 | .B \-C | ||
1237 | 324 | option, filenames will take the form of `\fIfile\fP<count>'. | ||
1238 | 325 | .TP | ||
1239 | 326 | .B \-h | ||
1240 | 327 | Print the tcpdump and libpcap version strings, print a usage message, | ||
1241 | 328 | and exit. | ||
1242 | 329 | .TP | ||
1243 | 330 | .B \-H | ||
1244 | 331 | Attempt to detect 802.11s draft mesh headers. | ||
1245 | 332 | .TP | ||
1246 | 333 | .B \-i | ||
1247 | 334 | Listen on \fIinterface\fP. | ||
1248 | 335 | If unspecified, \fItcpdump\fP searches the system interface list for the | ||
1249 | 336 | lowest numbered, configured up interface (excluding loopback). | ||
1250 | 337 | Ties are broken by choosing the earliest match. | ||
1251 | 338 | .IP | ||
1252 | 339 | On Linux systems with 2.2 or later kernels, an | ||
1253 | 340 | .I interface | ||
1254 | 341 | argument of ``any'' can be used to capture packets from all interfaces. | ||
1255 | 342 | Note that captures on the ``any'' device will not be done in promiscuous | ||
1256 | 343 | mode. | ||
1257 | 344 | .IP | ||
1258 | 345 | If the | ||
1259 | 346 | .B \-D | ||
1260 | 347 | flag is supported, an interface number as printed by that flag can be | ||
1261 | 348 | used as the | ||
1262 | 349 | .I interface | ||
1263 | 350 | argument. | ||
1264 | 351 | .TP | ||
1265 | 352 | .B \-I | ||
1266 | 353 | Put the interface in "monitor mode"; this is supported only on IEEE | ||
1267 | 354 | 802.11 Wi-Fi interfaces, and supported only on some operating systems. | ||
1268 | 355 | .IP | ||
1269 | 356 | Note that in monitor mode the adapter might disassociate from the | ||
1270 | 357 | network with which it's associated, so that you will not be able to use | ||
1271 | 358 | any wireless networks with that adapter. This could prevent accessing | ||
1272 | 359 | files on a network server, or resolving host names or network addresses, | ||
1273 | 360 | if you are capturing in monitor mode and are not connected to another | ||
1274 | 361 | network with another adapter. | ||
1275 | 362 | .IP | ||
1276 | 363 | This flag will affect the output of the | ||
1277 | 364 | .B \-L | ||
1278 | 365 | flag. If | ||
1279 | 366 | .B \-I | ||
1280 | 367 | isn't specified, only those link-layer types available when not in | ||
1281 | 368 | monitor mode will be shown; if | ||
1282 | 369 | .B \-I | ||
1283 | 370 | is specified, only those link-layer types available when in monitor mode | ||
1284 | 371 | will be shown. | ||
1285 | 372 | .TP | ||
1286 | 373 | .B \-j | ||
1287 | 374 | Set the time stamp type for the capture to \fItstamp_type\fP. The names | ||
1288 | 375 | to use for the time stamp types are given in | ||
1289 | 376 | .BR pcap-tstamp-type (@MAN_MISC_INFO@); | ||
1290 | 377 | not all the types listed there will necessarily be valid for any given | ||
1291 | 378 | interface. | ||
1292 | 379 | .TP | ||
1293 | 380 | .B \-J | ||
1294 | 381 | List the supported time stamp types for the interface and exit. If the | ||
1295 | 382 | time stamp type cannot be set for the interface, no time stamp types are | ||
1296 | 383 | listed. | ||
1297 | 384 | .TP | ||
1298 | 385 | .B \-K | ||
1299 | 386 | Don't attempt to verify IP, TCP, or UDP checksums. This is useful for | ||
1300 | 387 | interfaces that perform some or all of those checksum calculation in | ||
1301 | 388 | hardware; otherwise, all outgoing TCP checksums will be flagged as bad. | ||
1302 | 389 | .TP | ||
1303 | 390 | .B \-l | ||
1304 | 391 | Make stdout line buffered. | ||
1305 | 392 | Useful if you want to see the data | ||
1306 | 393 | while capturing it. | ||
1307 | 394 | E.g., | ||
1308 | 395 | .br | ||
1309 | 396 | ``tcpdump\ \ \-l\ \ |\ \ tee dat'' or | ||
1310 | 397 | ``tcpdump\ \ \-l \ \ > dat\ \ &\ \ tail\ \ \-f\ \ dat''. | ||
1311 | 398 | .TP | ||
1312 | 399 | .B \-L | ||
1313 | 400 | List the known data link types for the interface, in the specified mode, | ||
1314 | 401 | and exit. The list of known data link types may be dependent on the | ||
1315 | 402 | specified mode; for example, on some platforms, a Wi-Fi interface might | ||
1316 | 403 | support one set of data link types when not in monitor mode (for | ||
1317 | 404 | example, it might support only fake Ethernet headers, or might support | ||
1318 | 405 | 802.11 headers but not support 802.11 headers with radio information) | ||
1319 | 406 | and another set of data link types when in monitor mode (for example, it | ||
1320 | 407 | might support 802.11 headers, or 802.11 headers with radio information, | ||
1321 | 408 | only in monitor mode). | ||
1322 | 409 | .TP | ||
1323 | 410 | .B \-m | ||
1324 | 411 | Load SMI MIB module definitions from file \fImodule\fR. | ||
1325 | 412 | This option | ||
1326 | 413 | can be used several times to load several MIB modules into \fItcpdump\fP. | ||
1327 | 414 | .TP | ||
1328 | 415 | .B \-M | ||
1329 | 416 | Use \fIsecret\fP as a shared secret for validating the digests found in | ||
1330 | 417 | TCP segments with the TCP-MD5 option (RFC 2385), if present. | ||
1331 | 418 | .TP | ||
1332 | 419 | .B \-n | ||
1333 | 420 | Don't convert addresses (i.e., host addresses, port numbers, etc.) to names. | ||
1334 | 421 | .TP | ||
1335 | 422 | .B \-N | ||
1336 | 423 | Don't print domain name qualification of host names. | ||
1337 | 424 | E.g., | ||
1338 | 425 | if you give this flag then \fItcpdump\fP will print ``nic'' | ||
1339 | 426 | instead of ``nic.ddn.mil''. | ||
1340 | 427 | .TP | ||
1341 | 428 | .B \-O | ||
1342 | 429 | Do not run the packet-matching code optimizer. | ||
1343 | 430 | This is useful only | ||
1344 | 431 | if you suspect a bug in the optimizer. | ||
1345 | 432 | .TP | ||
1346 | 433 | .B \-p | ||
1347 | 434 | \fIDon't\fP put the interface | ||
1348 | 435 | into promiscuous mode. | ||
1349 | 436 | Note that the interface might be in promiscuous | ||
1350 | 437 | mode for some other reason; hence, `-p' cannot be used as an abbreviation for | ||
1351 | 438 | `ether host {local-hw-addr} or ether broadcast'. | ||
1352 | 439 | .TP | ||
1353 | 440 | .B \-q | ||
1354 | 441 | Quick (quiet?) output. | ||
1355 | 442 | Print less protocol information so output | ||
1356 | 443 | lines are shorter. | ||
1357 | 444 | .TP | ||
1358 | 445 | .B \-R | ||
1359 | 446 | Assume ESP/AH packets to be based on old specification (RFC1825 to RFC1829). | ||
1360 | 447 | If specified, \fItcpdump\fP will not print replay prevention field. | ||
1361 | 448 | Since there is no protocol version field in ESP/AH specification, | ||
1362 | 449 | \fItcpdump\fP cannot deduce the version of ESP/AH protocol. | ||
1363 | 450 | .TP | ||
1364 | 451 | .B \-r | ||
1365 | 452 | Read packets from \fIfile\fR (which was created with the | ||
1366 | 453 | .B \-w | ||
1367 | 454 | option). | ||
1368 | 455 | Standard input is used if \fIfile\fR is ``-''. | ||
1369 | 456 | .TP | ||
1370 | 457 | .B \-S | ||
1371 | 458 | Print absolute, rather than relative, TCP sequence numbers. | ||
1372 | 459 | .TP | ||
1373 | 460 | .B \-s | ||
1374 | 461 | Snarf \fIsnaplen\fP bytes of data from each packet rather than the | ||
1375 | 462 | default of 65535 bytes. | ||
1376 | 463 | Packets truncated because of a limited snapshot | ||
1377 | 464 | are indicated in the output with ``[|\fIproto\fP]'', where \fIproto\fP | ||
1378 | 465 | is the name of the protocol level at which the truncation has occurred. | ||
1379 | 466 | Note that taking larger snapshots both increases | ||
1380 | 467 | the amount of time it takes to process packets and, effectively, | ||
1381 | 468 | decreases the amount of packet buffering. | ||
1382 | 469 | This may cause packets to be | ||
1383 | 470 | lost. | ||
1384 | 471 | You should limit \fIsnaplen\fP to the smallest number that will | ||
1385 | 472 | capture the protocol information you're interested in. | ||
1386 | 473 | Setting | ||
1387 | 474 | \fIsnaplen\fP to 0 sets it to the default of 65535, | ||
1388 | 475 | for backwards compatibility with recent older versions of | ||
1389 | 476 | .IR tcpdump . | ||
1390 | 477 | .TP | ||
1391 | 478 | .B \-T | ||
1392 | 479 | Force packets selected by "\fIexpression\fP" to be interpreted the | ||
1393 | 480 | specified \fItype\fR. | ||
1394 | 481 | Currently known types are | ||
1395 | 482 | \fBaodv\fR (Ad-hoc On-demand Distance Vector protocol), | ||
1396 | 483 | \fBcnfp\fR (Cisco NetFlow protocol), | ||
1397 | 484 | \fBrpc\fR (Remote Procedure Call), | ||
1398 | 485 | \fBrtp\fR (Real-Time Applications protocol), | ||
1399 | 486 | \fBrtcp\fR (Real-Time Applications control protocol), | ||
1400 | 487 | \fBsnmp\fR (Simple Network Management Protocol), | ||
1401 | 488 | \fBtftp\fR (Trivial File Transfer Protocol), | ||
1402 | 489 | \fBvat\fR (Visual Audio Tool), | ||
1403 | 490 | and | ||
1404 | 491 | \fBwb\fR (distributed White Board). | ||
1405 | 492 | .TP | ||
1406 | 493 | .B \-t | ||
1407 | 494 | \fIDon't\fP print a timestamp on each dump line. | ||
1408 | 495 | .TP | ||
1409 | 496 | .B \-tt | ||
1410 | 497 | Print an unformatted timestamp on each dump line. | ||
1411 | 498 | .TP | ||
1412 | 499 | .B \-ttt | ||
1413 | 500 | Print a delta (micro-second resolution) between current and previous line | ||
1414 | 501 | on each dump line. | ||
1415 | 502 | .TP | ||
1416 | 503 | .B \-tttt | ||
1417 | 504 | Print a timestamp in default format proceeded by date on each dump line. | ||
1418 | 505 | .TP | ||
1419 | 506 | .B \-ttttt | ||
1420 | 507 | Print a delta (micro-second resolution) between current and first line | ||
1421 | 508 | on each dump line. | ||
1422 | 509 | .TP | ||
1423 | 510 | .B \-u | ||
1424 | 511 | Print undecoded NFS handles. | ||
1425 | 512 | .TP | ||
1426 | 513 | .B \-U | ||
1427 | 514 | Make output saved via the | ||
1428 | 515 | .B \-w | ||
1429 | 516 | option ``packet-buffered''; i.e., as each packet is saved, it will be | ||
1430 | 517 | written to the output file, rather than being written only when the | ||
1431 | 518 | output buffer fills. | ||
1432 | 519 | .IP | ||
1433 | 520 | The | ||
1434 | 521 | .B \-U | ||
1435 | 522 | flag will not be supported if | ||
1436 | 523 | .I tcpdump | ||
1437 | 524 | was built with an older version of | ||
1438 | 525 | .I libpcap | ||
1439 | 526 | that lacks the | ||
1440 | 527 | .B pcap_dump_flush() | ||
1441 | 528 | function. | ||
1442 | 529 | .TP | ||
1443 | 530 | .B \-v | ||
1444 | 531 | When parsing and printing, produce (slightly more) verbose output. | ||
1445 | 532 | For example, the time to live, | ||
1446 | 533 | identification, total length and options in an IP packet are printed. | ||
1447 | 534 | Also enables additional packet integrity checks such as verifying the | ||
1448 | 535 | IP and ICMP header checksum. | ||
1449 | 536 | .IP | ||
1450 | 537 | When writing to a file with the | ||
1451 | 538 | .B \-w | ||
1452 | 539 | option, report, every 10 seconds, the number of packets captured. | ||
1453 | 540 | .TP | ||
1454 | 541 | .B \-vv | ||
1455 | 542 | Even more verbose output. | ||
1456 | 543 | For example, additional fields are | ||
1457 | 544 | printed from NFS reply packets, and SMB packets are fully decoded. | ||
1458 | 545 | .TP | ||
1459 | 546 | .B \-vvv | ||
1460 | 547 | Even more verbose output. | ||
1461 | 548 | For example, | ||
1462 | 549 | telnet \fBSB\fP ... \fBSE\fP options | ||
1463 | 550 | are printed in full. | ||
1464 | 551 | With | ||
1465 | 552 | .B \-X | ||
1466 | 553 | Telnet options are printed in hex as well. | ||
1467 | 554 | .TP | ||
1468 | 555 | .B \-w | ||
1469 | 556 | Write the raw packets to \fIfile\fR rather than parsing and printing | ||
1470 | 557 | them out. | ||
1471 | 558 | They can later be printed with the \-r option. | ||
1472 | 559 | Standard output is used if \fIfile\fR is ``-''. | ||
1473 | 560 | See | ||
1474 | 561 | .BR pcap-savefile (@MAN_FILE_FORMATS@) | ||
1475 | 562 | for a description of the file format. | ||
1476 | 563 | .TP | ||
1477 | 564 | .B \-W | ||
1478 | 565 | Used in conjunction with the | ||
1479 | 566 | .B \-C | ||
1480 | 567 | option, this will limit the number | ||
1481 | 568 | of files created to the specified number, and begin overwriting files | ||
1482 | 569 | from the beginning, thus creating a 'rotating' buffer. | ||
1483 | 570 | In addition, it will name | ||
1484 | 571 | the files with enough leading 0s to support the maximum number of | ||
1485 | 572 | files, allowing them to sort correctly. | ||
1486 | 573 | .IP | ||
1487 | 574 | Used in conjunction with the | ||
1488 | 575 | .B \-G | ||
1489 | 576 | option, this will limit the number of rotated dump files that get | ||
1490 | 577 | created, exiting with status 0 when reaching the limit. If used with | ||
1491 | 578 | .B \-C | ||
1492 | 579 | as well, the behavior will result in cyclical files per timeslice. | ||
1493 | 580 | .TP | ||
1494 | 581 | .B \-x | ||
1495 | 582 | When parsing and printing, | ||
1496 | 583 | in addition to printing the headers of each packet, print the data of | ||
1497 | 584 | each packet (minus its link level header) in hex. | ||
1498 | 585 | The smaller of the entire packet or | ||
1499 | 586 | .I snaplen | ||
1500 | 587 | bytes will be printed. Note that this is the entire link-layer | ||
1501 | 588 | packet, so for link layers that pad (e.g. Ethernet), the padding bytes | ||
1502 | 589 | will also be printed when the higher layer packet is shorter than the | ||
1503 | 590 | required padding. | ||
1504 | 591 | .TP | ||
1505 | 592 | .B \-xx | ||
1506 | 593 | When parsing and printing, | ||
1507 | 594 | in addition to printing the headers of each packet, print the data of | ||
1508 | 595 | each packet, | ||
1509 | 596 | .I including | ||
1510 | 597 | its link level header, in hex. | ||
1511 | 598 | .TP | ||
1512 | 599 | .B \-X | ||
1513 | 600 | When parsing and printing, | ||
1514 | 601 | in addition to printing the headers of each packet, print the data of | ||
1515 | 602 | each packet (minus its link level header) in hex and ASCII. | ||
1516 | 603 | This is very handy for analysing new protocols. | ||
1517 | 604 | .TP | ||
1518 | 605 | .B \-XX | ||
1519 | 606 | When parsing and printing, | ||
1520 | 607 | in addition to printing the headers of each packet, print the data of | ||
1521 | 608 | each packet, | ||
1522 | 609 | .I including | ||
1523 | 610 | its link level header, in hex and ASCII. | ||
1524 | 611 | .TP | ||
1525 | 612 | .B \-y | ||
1526 | 613 | Set the data link type to use while capturing packets to \fIdatalinktype\fP. | ||
1527 | 614 | .TP | ||
1528 | 615 | .B \-z | ||
1529 | 616 | Used in conjunction with the | ||
1530 | 617 | .B -C | ||
1531 | 618 | or | ||
1532 | 619 | .B -G | ||
1533 | 620 | options, this will make | ||
1534 | 621 | .I tcpdump | ||
1535 | 622 | run " | ||
1536 | 623 | .I command file | ||
1537 | 624 | " where | ||
1538 | 625 | .I file | ||
1539 | 626 | is the savefile being closed after each rotation. For example, specifying | ||
1540 | 627 | .B \-z gzip | ||
1541 | 628 | or | ||
1542 | 629 | .B \-z bzip2 | ||
1543 | 630 | will compress each savefile using gzip or bzip2. | ||
1544 | 631 | .IP | ||
1545 | 632 | Note that tcpdump will run the command in parallel to the capture, using | ||
1546 | 633 | the lowest priority so that this doesn't disturb the capture process. | ||
1547 | 634 | .IP | ||
1548 | 635 | And in case you would like to use a command that itself takes flags or | ||
1549 | 636 | different arguments, you can always write a shell script that will take the | ||
1550 | 637 | savefile name as the only argument, make the flags & arguments arrangements | ||
1551 | 638 | and execute the command that you want. | ||
1552 | 639 | .TP | ||
1553 | 640 | .B \-Z | ||
1554 | 641 | If | ||
1555 | 642 | .I tcpdump | ||
1556 | 643 | is running as root, after opening the capture device or input savefile, | ||
1557 | 644 | but before opening any savefiles for output, change the user ID to | ||
1558 | 645 | .I user | ||
1559 | 646 | and the group ID to the primary group of | ||
1560 | 647 | .IR user . | ||
1561 | 648 | .IP | ||
1562 | 649 | This behavior can also be enabled by default at compile time. | ||
1563 | 650 | .IP "\fI expression\fP" | ||
1564 | 651 | .RS | ||
1565 | 652 | selects which packets will be dumped. | ||
1566 | 653 | If no \fIexpression\fP | ||
1567 | 654 | is given, all packets on the net will be dumped. | ||
1568 | 655 | Otherwise, | ||
1569 | 656 | only packets for which \fIexpression\fP is `true' will be dumped. | ||
1570 | 657 | .LP | ||
1571 | 658 | For the \fIexpression\fP syntax, see | ||
1572 | 659 | .BR pcap-filter (@MAN_MISC_INFO@). | ||
1573 | 660 | .LP | ||
1574 | 661 | Expression arguments can be passed to \fItcpdump\fP as either a single | ||
1575 | 662 | argument or as multiple arguments, whichever is more convenient. | ||
1576 | 663 | Generally, if the expression contains Shell metacharacters, it is | ||
1577 | 664 | easier to pass it as a single, quoted argument. | ||
1578 | 665 | Multiple arguments are concatenated with spaces before being parsed. | ||
1579 | 666 | .SH EXAMPLES | ||
1580 | 667 | .LP | ||
1581 | 668 | To print all packets arriving at or departing from \fIsundown\fP: | ||
1582 | 669 | .RS | ||
1583 | 670 | .nf | ||
1584 | 671 | \fBtcpdump host sundown\fP | ||
1585 | 672 | .fi | ||
1586 | 673 | .RE | ||
1587 | 674 | .LP | ||
1588 | 675 | To print traffic between \fIhelios\fR and either \fIhot\fR or \fIace\fR: | ||
1589 | 676 | .RS | ||
1590 | 677 | .nf | ||
1591 | 678 | \fBtcpdump host helios and \\( hot or ace \\)\fP | ||
1592 | 679 | .fi | ||
1593 | 680 | .RE | ||
1594 | 681 | .LP | ||
1595 | 682 | To print all IP packets between \fIace\fR and any host except \fIhelios\fR: | ||
1596 | 683 | .RS | ||
1597 | 684 | .nf | ||
1598 | 685 | \fBtcpdump ip host ace and not helios\fP | ||
1599 | 686 | .fi | ||
1600 | 687 | .RE | ||
1601 | 688 | .LP | ||
1602 | 689 | To print all traffic between local hosts and hosts at Berkeley: | ||
1603 | 690 | .RS | ||
1604 | 691 | .nf | ||
1605 | 692 | .B | ||
1606 | 693 | tcpdump net ucb-ether | ||
1607 | 694 | .fi | ||
1608 | 695 | .RE | ||
1609 | 696 | .LP | ||
1610 | 697 | To print all ftp traffic through internet gateway \fIsnup\fP: | ||
1611 | 698 | (note that the expression is quoted to prevent the shell from | ||
1612 | 699 | (mis-)interpreting the parentheses): | ||
1613 | 700 | .RS | ||
1614 | 701 | .nf | ||
1615 | 702 | .B | ||
1616 | 703 | tcpdump 'gateway snup and (port ftp or ftp-data)' | ||
1617 | 704 | .fi | ||
1618 | 705 | .RE | ||
1619 | 706 | .LP | ||
1620 | 707 | To print traffic neither sourced from nor destined for local hosts | ||
1621 | 708 | (if you gateway to one other net, this stuff should never make it | ||
1622 | 709 | onto your local net). | ||
1623 | 710 | .RS | ||
1624 | 711 | .nf | ||
1625 | 712 | .B | ||
1626 | 713 | tcpdump ip and not net \fIlocalnet\fP | ||
1627 | 714 | .fi | ||
1628 | 715 | .RE | ||
1629 | 716 | .LP | ||
1630 | 717 | To print the start and end packets (the SYN and FIN packets) of each | ||
1631 | 718 | TCP conversation that involves a non-local host. | ||
1632 | 719 | .RS | ||
1633 | 720 | .nf | ||
1634 | 721 | .B | ||
1635 | 722 | tcpdump 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net \fIlocalnet\fP' | ||
1636 | 723 | .fi | ||
1637 | 724 | .RE | ||
1638 | 725 | .LP | ||
1639 | 726 | To print all IPv4 HTTP packets to and from port 80, i.e. print only | ||
1640 | 727 | packets that contain data, not, for example, SYN and FIN packets and | ||
1641 | 728 | ACK-only packets. (IPv6 is left as an exercise for the reader.) | ||
1642 | 729 | .RS | ||
1643 | 730 | .nf | ||
1644 | 731 | .B | ||
1645 | 732 | tcpdump 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | ||
1646 | 733 | .fi | ||
1647 | 734 | .RE | ||
1648 | 735 | .LP | ||
1649 | 736 | To print IP packets longer than 576 bytes sent through gateway \fIsnup\fP: | ||
1650 | 737 | .RS | ||
1651 | 738 | .nf | ||
1652 | 739 | .B | ||
1653 | 740 | tcpdump 'gateway snup and ip[2:2] > 576' | ||
1654 | 741 | .fi | ||
1655 | 742 | .RE | ||
1656 | 743 | .LP | ||
1657 | 744 | To print IP broadcast or multicast packets that were | ||
1658 | 745 | .I not | ||
1659 | 746 | sent via Ethernet broadcast or multicast: | ||
1660 | 747 | .RS | ||
1661 | 748 | .nf | ||
1662 | 749 | .B | ||
1663 | 750 | tcpdump 'ether[0] & 1 = 0 and ip[16] >= 224' | ||
1664 | 751 | .fi | ||
1665 | 752 | .RE | ||
1666 | 753 | .LP | ||
1667 | 754 | To print all ICMP packets that are not echo requests/replies (i.e., not | ||
1668 | 755 | ping packets): | ||
1669 | 756 | .RS | ||
1670 | 757 | .nf | ||
1671 | 758 | .B | ||
1672 | 759 | tcpdump 'icmp[icmptype] != icmp-echo and icmp[icmptype] != icmp-echoreply' | ||
1673 | 760 | .fi | ||
1674 | 761 | .RE | ||
1675 | 762 | .SH OUTPUT FORMAT | ||
1676 | 763 | .LP | ||
1677 | 764 | The output of \fItcpdump\fP is protocol dependent. | ||
1678 | 765 | The following | ||
1679 | 766 | gives a brief description and examples of most of the formats. | ||
1680 | 767 | .de HD | ||
1681 | 768 | .sp 1.5 | ||
1682 | 769 | .B | ||
1683 | 770 | .. | ||
1684 | 771 | .HD | ||
1685 | 772 | Link Level Headers | ||
1686 | 773 | .LP | ||
1687 | 774 | If the '-e' option is given, the link level header is printed out. | ||
1688 | 775 | On Ethernets, the source and destination addresses, protocol, | ||
1689 | 776 | and packet length are printed. | ||
1690 | 777 | .LP | ||
1691 | 778 | On FDDI networks, the '-e' option causes \fItcpdump\fP to print | ||
1692 | 779 | the `frame control' field, the source and destination addresses, | ||
1693 | 780 | and the packet length. | ||
1694 | 781 | (The `frame control' field governs the | ||
1695 | 782 | interpretation of the rest of the packet. | ||
1696 | 783 | Normal packets (such | ||
1697 | 784 | as those containing IP datagrams) are `async' packets, with a priority | ||
1698 | 785 | value between 0 and 7; for example, `\fBasync4\fR'. | ||
1699 | 786 | Such packets | ||
1700 | 787 | are assumed to contain an 802.2 Logical Link Control (LLC) packet; | ||
1701 | 788 | the LLC header is printed if it is \fInot\fR an ISO datagram or a | ||
1702 | 789 | so-called SNAP packet. | ||
1703 | 790 | .LP | ||
1704 | 791 | On Token Ring networks, the '-e' option causes \fItcpdump\fP to print | ||
1705 | 792 | the `access control' and `frame control' fields, the source and | ||
1706 | 793 | destination addresses, and the packet length. | ||
1707 | 794 | As on FDDI networks, | ||
1708 | 795 | packets are assumed to contain an LLC packet. | ||
1709 | 796 | Regardless of whether | ||
1710 | 797 | the '-e' option is specified or not, the source routing information is | ||
1711 | 798 | printed for source-routed packets. | ||
1712 | 799 | .LP | ||
1713 | 800 | On 802.11 networks, the '-e' option causes \fItcpdump\fP to print | ||
1714 | 801 | the `frame control' fields, all of the addresses in the 802.11 header, | ||
1715 | 802 | and the packet length. | ||
1716 | 803 | As on FDDI networks, | ||
1717 | 804 | packets are assumed to contain an LLC packet. | ||
1718 | 805 | .LP | ||
1719 | 806 | \fI(N.B.: The following description assumes familiarity with | ||
1720 | 807 | the SLIP compression algorithm described in RFC-1144.)\fP | ||
1721 | 808 | .LP | ||
1722 | 809 | On SLIP links, a direction indicator (``I'' for inbound, ``O'' for outbound), | ||
1723 | 810 | packet type, and compression information are printed out. | ||
1724 | 811 | The packet type is printed first. | ||
1725 | 812 | The three types are \fIip\fP, \fIutcp\fP, and \fIctcp\fP. | ||
1726 | 813 | No further link information is printed for \fIip\fR packets. | ||
1727 | 814 | For TCP packets, the connection identifier is printed following the type. | ||
1728 | 815 | If the packet is compressed, its encoded header is printed out. | ||
1729 | 816 | The special cases are printed out as | ||
1730 | 817 | \fB*S+\fIn\fR and \fB*SA+\fIn\fR, where \fIn\fR is the amount by which | ||
1731 | 818 | the sequence number (or sequence number and ack) has changed. | ||
1732 | 819 | If it is not a special case, | ||
1733 | 820 | zero or more changes are printed. | ||
1734 | 821 | A change is indicated by U (urgent pointer), W (window), A (ack), | ||
1735 | 822 | S (sequence number), and I (packet ID), followed by a delta (+n or -n), | ||
1736 | 823 | or a new value (=n). | ||
1737 | 824 | Finally, the amount of data in the packet and compressed header length | ||
1738 | 825 | are printed. | ||
1739 | 826 | .LP | ||
1740 | 827 | For example, the following line shows an outbound compressed TCP packet, | ||
1741 | 828 | with an implicit connection identifier; the ack has changed by 6, | ||
1742 | 829 | the sequence number by 49, and the packet ID by 6; there are 3 bytes of | ||
1743 | 830 | data and 6 bytes of compressed header: | ||
1744 | 831 | .RS | ||
1745 | 832 | .nf | ||
1746 | 833 | \fBO ctcp * A+6 S+49 I+6 3 (6)\fP | ||
1747 | 834 | .fi | ||
1748 | 835 | .RE | ||
1749 | 836 | .HD | ||
1750 | 837 | ARP/RARP Packets | ||
1751 | 838 | .LP | ||
1752 | 839 | Arp/rarp output shows the type of request and its arguments. | ||
1753 | 840 | The | ||
1754 | 841 | format is intended to be self explanatory. | ||
1755 | 842 | Here is a short sample taken from the start of an `rlogin' from | ||
1756 | 843 | host \fIrtsg\fP to host \fIcsam\fP: | ||
1757 | 844 | .RS | ||
1758 | 845 | .nf | ||
1759 | 846 | .sp .5 | ||
1760 | 847 | \f(CWarp who-has csam tell rtsg | ||
1761 | 848 | arp reply csam is-at CSAM\fR | ||
1762 | 849 | .sp .5 | ||
1763 | 850 | .fi | ||
1764 | 851 | .RE | ||
1765 | 852 | The first line says that rtsg sent an arp packet asking | ||
1766 | 853 | for the Ethernet address of internet host csam. | ||
1767 | 854 | Csam | ||
1768 | 855 | replies with its Ethernet address (in this example, Ethernet addresses | ||
1769 | 856 | are in caps and internet addresses in lower case). | ||
1770 | 857 | .LP | ||
1771 | 858 | This would look less redundant if we had done \fItcpdump \-n\fP: | ||
1772 | 859 | .RS | ||
1773 | 860 | .nf | ||
1774 | 861 | .sp .5 | ||
1775 | 862 | \f(CWarp who-has 128.3.254.6 tell 128.3.254.68 | ||
1776 | 863 | arp reply 128.3.254.6 is-at 02:07:01:00:01:c4\fP | ||
1777 | 864 | .fi | ||
1778 | 865 | .RE | ||
1779 | 866 | .LP | ||
1780 | 867 | If we had done \fItcpdump \-e\fP, the fact that the first packet is | ||
1781 | 868 | broadcast and the second is point-to-point would be visible: | ||
1782 | 869 | .RS | ||
1783 | 870 | .nf | ||
1784 | 871 | .sp .5 | ||
1785 | 872 | \f(CWRTSG Broadcast 0806 64: arp who-has csam tell rtsg | ||
1786 | 873 | CSAM RTSG 0806 64: arp reply csam is-at CSAM\fR | ||
1787 | 874 | .sp .5 | ||
1788 | 875 | .fi | ||
1789 | 876 | .RE | ||
1790 | 877 | For the first packet this says the Ethernet source address is RTSG, the | ||
1791 | 878 | destination is the Ethernet broadcast address, the type field | ||
1792 | 879 | contained hex 0806 (type ETHER_ARP) and the total length was 64 bytes. | ||
1793 | 880 | .HD | ||
1794 | 881 | TCP Packets | ||
1795 | 882 | .LP | ||
1796 | 883 | \fI(N.B.:The following description assumes familiarity with | ||
1797 | 884 | the TCP protocol described in RFC-793. | ||
1798 | 885 | If you are not familiar | ||
1799 | 886 | with the protocol, neither this description nor \fItcpdump\fP will | ||
1800 | 887 | be of much use to you.)\fP | ||
1801 | 888 | .LP | ||
1802 | 889 | The general format of a tcp protocol line is: | ||
1803 | 890 | .RS | ||
1804 | 891 | .nf | ||
1805 | 892 | .sp .5 | ||
1806 | 893 | \fIsrc > dst: flags data-seqno ack window urgent options\fP | ||
1807 | 894 | .sp .5 | ||
1808 | 895 | .fi | ||
1809 | 896 | .RE | ||
1810 | 897 | \fISrc\fP and \fIdst\fP are the source and destination IP | ||
1811 | 898 | addresses and ports. | ||
1812 | 899 | \fIFlags\fP are some combination of S (SYN), | ||
1813 | 900 | F (FIN), P (PUSH), R (RST), U (URG), W (ECN CWR), E (ECN-Echo) or | ||
1814 | 901 | `.' (ACK), or `none' if no flags are set. | ||
1815 | 902 | \fIData-seqno\fP describes the portion of sequence space covered | ||
1816 | 903 | by the data in this packet (see example below). | ||
1817 | 904 | \fIAck\fP is sequence number of the next data expected the other | ||
1818 | 905 | direction on this connection. | ||
1819 | 906 | \fIWindow\fP is the number of bytes of receive buffer space available | ||
1820 | 907 | the other direction on this connection. | ||
1821 | 908 | \fIUrg\fP indicates there is `urgent' data in the packet. | ||
1822 | 909 | \fIOptions\fP are tcp options enclosed in angle brackets (e.g., <mss 1024>). | ||
1823 | 910 | .LP | ||
1824 | 911 | \fISrc, dst\fP and \fIflags\fP are always present. | ||
1825 | 912 | The other fields | ||
1826 | 913 | depend on the contents of the packet's tcp protocol header and | ||
1827 | 914 | are output only if appropriate. | ||
1828 | 915 | .LP | ||
1829 | 916 | Here is the opening portion of an rlogin from host \fIrtsg\fP to | ||
1830 | 917 | host \fIcsam\fP. | ||
1831 | 918 | .RS | ||
1832 | 919 | .nf | ||
1833 | 920 | .sp .5 | ||
1834 | 921 | \s-2\f(CWrtsg.1023 > csam.login: S 768512:768512(0) win 4096 <mss 1024> | ||
1835 | 922 | csam.login > rtsg.1023: S 947648:947648(0) ack 768513 win 4096 <mss 1024> | ||
1836 | 923 | rtsg.1023 > csam.login: . ack 1 win 4096 | ||
1837 | 924 | rtsg.1023 > csam.login: P 1:2(1) ack 1 win 4096 | ||
1838 | 925 | csam.login > rtsg.1023: . ack 2 win 4096 | ||
1839 | 926 | rtsg.1023 > csam.login: P 2:21(19) ack 1 win 4096 | ||
1840 | 927 | csam.login > rtsg.1023: P 1:2(1) ack 21 win 4077 | ||
1841 | 928 | csam.login > rtsg.1023: P 2:3(1) ack 21 win 4077 urg 1 | ||
1842 | 929 | csam.login > rtsg.1023: P 3:4(1) ack 21 win 4077 urg 1\fR\s+2 | ||
1843 | 930 | .sp .5 | ||
1844 | 931 | .fi | ||
1845 | 932 | .RE | ||
1846 | 933 | The first line says that tcp port 1023 on rtsg sent a packet | ||
1847 | 934 | to port \fIlogin\fP | ||
1848 | 935 | on csam. | ||
1849 | 936 | The \fBS\fP indicates that the \fISYN\fP flag was set. | ||
1850 | 937 | The packet sequence number was 768512 and it contained no data. | ||
1851 | 938 | (The notation is `first:last(nbytes)' which means `sequence | ||
1852 | 939 | numbers \fIfirst\fP | ||
1853 | 940 | up to but not including \fIlast\fP which is \fInbytes\fP bytes of user data'.) | ||
1854 | 941 | There was no piggy-backed ack, the available receive window was 4096 | ||
1855 | 942 | bytes and there was a max-segment-size option requesting an mss of | ||
1856 | 943 | 1024 bytes. | ||
1857 | 944 | .LP | ||
1858 | 945 | Csam replies with a similar packet except it includes a piggy-backed | ||
1859 | 946 | ack for rtsg's SYN. | ||
1860 | 947 | Rtsg then acks csam's SYN. | ||
1861 | 948 | The `.' means the ACK flag was set. | ||
1862 | 949 | The packet contained no data so there is no data sequence number. | ||
1863 | 950 | Note that the ack sequence | ||
1864 | 951 | number is a small integer (1). | ||
1865 | 952 | The first time \fItcpdump\fP sees a | ||
1866 | 953 | tcp `conversation', it prints the sequence number from the packet. | ||
1867 | 954 | On subsequent packets of the conversation, the difference between | ||
1868 | 955 | the current packet's sequence number and this initial sequence number | ||
1869 | 956 | is printed. | ||
1870 | 957 | This means that sequence numbers after the | ||
1871 | 958 | first can be interpreted | ||
1872 | 959 | as relative byte positions in the conversation's data stream (with the | ||
1873 | 960 | first data byte each direction being `1'). | ||
1874 | 961 | `-S' will override this | ||
1875 | 962 | feature, causing the original sequence numbers to be output. | ||
1876 | 963 | .LP | ||
1877 | 964 | On the 6th line, rtsg sends csam 19 bytes of data (bytes 2 through 20 | ||
1878 | 965 | in the rtsg \(-> csam side of the conversation). | ||
1879 | 966 | The PUSH flag is set in the packet. | ||
1880 | 967 | On the 7th line, csam says it's received data sent by rtsg up to | ||
1881 | 968 | but not including byte 21. | ||
1882 | 969 | Most of this data is apparently sitting in the | ||
1883 | 970 | socket buffer since csam's receive window has gotten 19 bytes smaller. | ||
1884 | 971 | Csam also sends one byte of data to rtsg in this packet. | ||
1885 | 972 | On the 8th and 9th lines, | ||
1886 | 973 | csam sends two bytes of urgent, pushed data to rtsg. | ||
1887 | 974 | .LP | ||
1888 | 975 | If the snapshot was small enough that \fItcpdump\fP didn't capture | ||
1889 | 976 | the full TCP header, it interprets as much of the header as it can | ||
1890 | 977 | and then reports ``[|\fItcp\fP]'' to indicate the remainder could not | ||
1891 | 978 | be interpreted. | ||
1892 | 979 | If the header contains a bogus option (one with a length | ||
1893 | 980 | that's either too small or beyond the end of the header), \fItcpdump\fP | ||
1894 | 981 | reports it as ``[\fIbad opt\fP]'' and does not interpret any further | ||
1895 | 982 | options (since it's impossible to tell where they start). | ||
1896 | 983 | If the header | ||
1897 | 984 | length indicates options are present but the IP datagram length is not | ||
1898 | 985 | long enough for the options to actually be there, \fItcpdump\fP reports | ||
1899 | 986 | it as ``[\fIbad hdr length\fP]''. | ||
1900 | 987 | .HD | ||
1901 | 988 | .B Capturing TCP packets with particular flag combinations (SYN-ACK, URG-ACK, etc.) | ||
1902 | 989 | .PP | ||
1903 | 990 | There are 8 bits in the control bits section of the TCP header: | ||
1904 | 991 | .IP | ||
1905 | 992 | .I CWR | ECE | URG | ACK | PSH | RST | SYN | FIN | ||
1906 | 993 | .PP | ||
1907 | 994 | Let's assume that we want to watch packets used in establishing | ||
1908 | 995 | a TCP connection. | ||
1909 | 996 | Recall that TCP uses a 3-way handshake protocol | ||
1910 | 997 | when it initializes a new connection; the connection sequence with | ||
1911 | 998 | regard to the TCP control bits is | ||
1912 | 999 | .PP | ||
1913 | 1000 | .RS | ||
1914 | 1001 | 1) Caller sends SYN | ||
1915 | 1002 | .RE | ||
1916 | 1003 | .RS | ||
1917 | 1004 | 2) Recipient responds with SYN, ACK | ||
1918 | 1005 | .RE | ||
1919 | 1006 | .RS | ||
1920 | 1007 | 3) Caller sends ACK | ||
1921 | 1008 | .RE | ||
1922 | 1009 | .PP | ||
1923 | 1010 | Now we're interested in capturing packets that have only the | ||
1924 | 1011 | SYN bit set (Step 1). | ||
1925 | 1012 | Note that we don't want packets from step 2 | ||
1926 | 1013 | (SYN-ACK), just a plain initial SYN. | ||
1927 | 1014 | What we need is a correct filter | ||
1928 | 1015 | expression for \fItcpdump\fP. | ||
1929 | 1016 | .PP | ||
1930 | 1017 | Recall the structure of a TCP header without options: | ||
1931 | 1018 | .PP | ||
1932 | 1019 | .nf | ||
1933 | 1020 | 0 15 31 | ||
1934 | 1021 | ----------------------------------------------------------------- | ||
1935 | 1022 | | source port | destination port | | ||
1936 | 1023 | ----------------------------------------------------------------- | ||
1937 | 1024 | | sequence number | | ||
1938 | 1025 | ----------------------------------------------------------------- | ||
1939 | 1026 | | acknowledgment number | | ||
1940 | 1027 | ----------------------------------------------------------------- | ||
1941 | 1028 | | HL | rsvd |C|E|U|A|P|R|S|F| window size | | ||
1942 | 1029 | ----------------------------------------------------------------- | ||
1943 | 1030 | | TCP checksum | urgent pointer | | ||
1944 | 1031 | ----------------------------------------------------------------- | ||
1945 | 1032 | .fi | ||
1946 | 1033 | .PP | ||
1947 | 1034 | A TCP header usually holds 20 octets of data, unless options are | ||
1948 | 1035 | present. | ||
1949 | 1036 | The first line of the graph contains octets 0 - 3, the | ||
1950 | 1037 | second line shows octets 4 - 7 etc. | ||
1951 | 1038 | .PP | ||
1952 | 1039 | Starting to count with 0, the relevant TCP control bits are contained | ||
1953 | 1040 | in octet 13: | ||
1954 | 1041 | .PP | ||
1955 | 1042 | .nf | ||
1956 | 1043 | 0 7| 15| 23| 31 | ||
1957 | 1044 | ----------------|---------------|---------------|---------------- | ||
1958 | 1045 | | HL | rsvd |C|E|U|A|P|R|S|F| window size | | ||
1959 | 1046 | ----------------|---------------|---------------|---------------- | ||
1960 | 1047 | | | 13th octet | | | | ||
1961 | 1048 | .fi | ||
1962 | 1049 | .PP | ||
1963 | 1050 | Let's have a closer look at octet no. 13: | ||
1964 | 1051 | .PP | ||
1965 | 1052 | .nf | ||
1966 | 1053 | | | | ||
1967 | 1054 | |---------------| | ||
1968 | 1055 | |C|E|U|A|P|R|S|F| | ||
1969 | 1056 | |---------------| | ||
1970 | 1057 | |7 5 3 0| | ||
1971 | 1058 | .fi | ||
1972 | 1059 | .PP | ||
1973 | 1060 | These are the TCP control bits we are interested | ||
1974 | 1061 | in. | ||
1975 | 1062 | We have numbered the bits in this octet from 0 to 7, right to | ||
1976 | 1063 | left, so the PSH bit is bit number 3, while the URG bit is number 5. | ||
1977 | 1064 | .PP | ||
1978 | 1065 | Recall that we want to capture packets with only SYN set. | ||
1979 | 1066 | Let's see what happens to octet 13 if a TCP datagram arrives | ||
1980 | 1067 | with the SYN bit set in its header: | ||
1981 | 1068 | .PP | ||
1982 | 1069 | .nf | ||
1983 | 1070 | |C|E|U|A|P|R|S|F| | ||
1984 | 1071 | |---------------| | ||
1985 | 1072 | |0 0 0 0 0 0 1 0| | ||
1986 | 1073 | |---------------| | ||
1987 | 1074 | |7 6 5 4 3 2 1 0| | ||
1988 | 1075 | .fi | ||
1989 | 1076 | .PP | ||
1990 | 1077 | Looking at the | ||
1991 | 1078 | control bits section we see that only bit number 1 (SYN) is set. | ||
1992 | 1079 | .PP | ||
1993 | 1080 | Assuming that octet number 13 is an 8-bit unsigned integer in | ||
1994 | 1081 | network byte order, the binary value of this octet is | ||
1995 | 1082 | .IP | ||
1996 | 1083 | 00000010 | ||
1997 | 1084 | .PP | ||
1998 | 1085 | and its decimal representation is | ||
1999 | 1086 | .PP | ||
2000 | 1087 | .nf | ||
2001 | 1088 | 7 6 5 4 3 2 1 0 | ||
2002 | 1089 | 0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 1*2 + 0*2 = 2 | ||
2003 | 1090 | .fi | ||
2004 | 1091 | .PP | ||
2005 | 1092 | We're almost done, because now we know that if only SYN is set, | ||
2006 | 1093 | the value of the 13th octet in the TCP header, when interpreted | ||
2007 | 1094 | as a 8-bit unsigned integer in network byte order, must be exactly 2. | ||
2008 | 1095 | .PP | ||
2009 | 1096 | This relationship can be expressed as | ||
2010 | 1097 | .RS | ||
2011 | 1098 | .B | ||
2012 | 1099 | tcp[13] == 2 | ||
2013 | 1100 | .RE | ||
2014 | 1101 | .PP | ||
2015 | 1102 | We can use this expression as the filter for \fItcpdump\fP in order | ||
2016 | 1103 | to watch packets which have only SYN set: | ||
2017 | 1104 | .RS | ||
2018 | 1105 | .B | ||
2019 | 1106 | tcpdump -i xl0 tcp[13] == 2 | ||
2020 | 1107 | .RE | ||
2021 | 1108 | .PP | ||
2022 | 1109 | The expression says "let the 13th octet of a TCP datagram have | ||
2023 | 1110 | the decimal value 2", which is exactly what we want. | ||
2024 | 1111 | .PP | ||
2025 | 1112 | Now, let's assume that we need to capture SYN packets, but we | ||
2026 | 1113 | don't care if ACK or any other TCP control bit is set at the | ||
2027 | 1114 | same time. | ||
2028 | 1115 | Let's see what happens to octet 13 when a TCP datagram | ||
2029 | 1116 | with SYN-ACK set arrives: | ||
2030 | 1117 | .PP | ||
2031 | 1118 | .nf | ||
2032 | 1119 | |C|E|U|A|P|R|S|F| | ||
2033 | 1120 | |---------------| | ||
2034 | 1121 | |0 0 0 1 0 0 1 0| | ||
2035 | 1122 | |---------------| | ||
2036 | 1123 | |7 6 5 4 3 2 1 0| | ||
2037 | 1124 | .fi | ||
2038 | 1125 | .PP | ||
2039 | 1126 | Now bits 1 and 4 are set in the 13th octet. | ||
2040 | 1127 | The binary value of | ||
2041 | 1128 | octet 13 is | ||
2042 | 1129 | .IP | ||
2043 | 1130 | 00010010 | ||
2044 | 1131 | .PP | ||
2045 | 1132 | which translates to decimal | ||
2046 | 1133 | .PP | ||
2047 | 1134 | .nf | ||
2048 | 1135 | 7 6 5 4 3 2 1 0 | ||
2049 | 1136 | 0*2 + 0*2 + 0*2 + 1*2 + 0*2 + 0*2 + 1*2 + 0*2 = 18 | ||
2050 | 1137 | .fi | ||
2051 | 1138 | .PP | ||
2052 | 1139 | Now we can't just use 'tcp[13] == 18' in the \fItcpdump\fP filter | ||
2053 | 1140 | expression, because that would select only those packets that have | ||
2054 | 1141 | SYN-ACK set, but not those with only SYN set. | ||
2055 | 1142 | Remember that we don't care | ||
2056 | 1143 | if ACK or any other control bit is set as long as SYN is set. | ||
2057 | 1144 | .PP | ||
2058 | 1145 | In order to achieve our goal, we need to logically AND the | ||
2059 | 1146 | binary value of octet 13 with some other value to preserve | ||
2060 | 1147 | the SYN bit. | ||
2061 | 1148 | We know that we want SYN to be set in any case, | ||
2062 | 1149 | so we'll logically AND the value in the 13th octet with | ||
2063 | 1150 | the binary value of a SYN: | ||
2064 | 1151 | .PP | ||
2065 | 1152 | .nf | ||
2066 | 1153 | |||
2067 | 1154 | 00010010 SYN-ACK 00000010 SYN | ||
2068 | 1155 | AND 00000010 (we want SYN) AND 00000010 (we want SYN) | ||
2069 | 1156 | -------- -------- | ||
2070 | 1157 | = 00000010 = 00000010 | ||
2071 | 1158 | .fi | ||
2072 | 1159 | .PP | ||
2073 | 1160 | We see that this AND operation delivers the same result | ||
2074 | 1161 | regardless whether ACK or another TCP control bit is set. | ||
2075 | 1162 | The decimal representation of the AND value as well as | ||
2076 | 1163 | the result of this operation is 2 (binary 00000010), | ||
2077 | 1164 | so we know that for packets with SYN set the following | ||
2078 | 1165 | relation must hold true: | ||
2079 | 1166 | .IP | ||
2080 | 1167 | ( ( value of octet 13 ) AND ( 2 ) ) == ( 2 ) | ||
2081 | 1168 | .PP | ||
2082 | 1169 | This points us to the \fItcpdump\fP filter expression | ||
2083 | 1170 | .RS | ||
2084 | 1171 | .B | ||
2085 | 1172 | tcpdump -i xl0 'tcp[13] & 2 == 2' | ||
2086 | 1173 | .RE | ||
2087 | 1174 | .PP | ||
2088 | 1175 | Some offsets and field values may be expressed as names | ||
2089 | 1176 | rather than as numeric values. For example tcp[13] may | ||
2090 | 1177 | be replaced with tcp[tcpflags]. The following TCP flag | ||
2091 | 1178 | field values are also available: tcp-fin, tcp-syn, tcp-rst, | ||
2092 | 1179 | tcp-push, tcp-act, tcp-urg. | ||
2093 | 1180 | .PP | ||
2094 | 1181 | This can be demonstrated as: | ||
2095 | 1182 | .RS | ||
2096 | 1183 | .B | ||
2097 | 1184 | tcpdump -i xl0 'tcp[tcpflags] & tcp-push != 0' | ||
2098 | 1185 | .RE | ||
2099 | 1186 | .PP | ||
2100 | 1187 | Note that you should use single quotes or a backslash | ||
2101 | 1188 | in the expression to hide the AND ('&') special character | ||
2102 | 1189 | from the shell. | ||
2103 | 1190 | .HD | ||
2104 | 1191 | .B | ||
2105 | 1192 | UDP Packets | ||
2106 | 1193 | .LP | ||
2107 | 1194 | UDP format is illustrated by this rwho packet: | ||
2108 | 1195 | .RS | ||
2109 | 1196 | .nf | ||
2110 | 1197 | .sp .5 | ||
2111 | 1198 | \f(CWactinide.who > broadcast.who: udp 84\fP | ||
2112 | 1199 | .sp .5 | ||
2113 | 1200 | .fi | ||
2114 | 1201 | .RE | ||
2115 | 1202 | This says that port \fIwho\fP on host \fIactinide\fP sent a udp | ||
2116 | 1203 | datagram to port \fIwho\fP on host \fIbroadcast\fP, the Internet | ||
2117 | 1204 | broadcast address. | ||
2118 | 1205 | The packet contained 84 bytes of user data. | ||
2119 | 1206 | .LP | ||
2120 | 1207 | Some UDP services are recognized (from the source or destination | ||
2121 | 1208 | port number) and the higher level protocol information printed. | ||
2122 | 1209 | In particular, Domain Name service requests (RFC-1034/1035) and Sun | ||
2123 | 1210 | RPC calls (RFC-1050) to NFS. | ||
2124 | 1211 | .HD | ||
2125 | 1212 | UDP Name Server Requests | ||
2126 | 1213 | .LP | ||
2127 | 1214 | \fI(N.B.:The following description assumes familiarity with | ||
2128 | 1215 | the Domain Service protocol described in RFC-1035. | ||
2129 | 1216 | If you are not familiar | ||
2130 | 1217 | with the protocol, the following description will appear to be written | ||
2131 | 1218 | in greek.)\fP | ||
2132 | 1219 | .LP | ||
2133 | 1220 | Name server requests are formatted as | ||
2134 | 1221 | .RS | ||
2135 | 1222 | .nf | ||
2136 | 1223 | .sp .5 | ||
2137 | 1224 | \fIsrc > dst: id op? flags qtype qclass name (len)\fP | ||
2138 | 1225 | .sp .5 | ||
2139 | 1226 | \f(CWh2opolo.1538 > helios.domain: 3+ A? ucbvax.berkeley.edu. (37)\fR | ||
2140 | 1227 | .sp .5 | ||
2141 | 1228 | .fi | ||
2142 | 1229 | .RE | ||
2143 | 1230 | Host \fIh2opolo\fP asked the domain server on \fIhelios\fP for an | ||
2144 | 1231 | address record (qtype=A) associated with the name \fIucbvax.berkeley.edu.\fP | ||
2145 | 1232 | The query id was `3'. | ||
2146 | 1233 | The `+' indicates the \fIrecursion desired\fP flag | ||
2147 | 1234 | was set. | ||
2148 | 1235 | The query length was 37 bytes, not including the UDP and | ||
2149 | 1236 | IP protocol headers. | ||
2150 | 1237 | The query operation was the normal one, \fIQuery\fP, | ||
2151 | 1238 | so the op field was omitted. | ||
2152 | 1239 | If the op had been anything else, it would | ||
2153 | 1240 | have been printed between the `3' and the `+'. | ||
2154 | 1241 | Similarly, the qclass was the normal one, | ||
2155 | 1242 | \fIC_IN\fP, and omitted. | ||
2156 | 1243 | Any other qclass would have been printed | ||
2157 | 1244 | immediately after the `A'. | ||
2158 | 1245 | .LP | ||
2159 | 1246 | A few anomalies are checked and may result in extra fields enclosed in | ||
2160 | 1247 | square brackets: If a query contains an answer, authority records or | ||
2161 | 1248 | additional records section, | ||
2162 | 1249 | .IR ancount , | ||
2163 | 1250 | .IR nscount , | ||
2164 | 1251 | or | ||
2165 | 1252 | .I arcount | ||
2166 | 1253 | are printed as `[\fIn\fPa]', `[\fIn\fPn]' or `[\fIn\fPau]' where \fIn\fP | ||
2167 | 1254 | is the appropriate count. | ||
2168 | 1255 | If any of the response bits are set (AA, RA or rcode) or any of the | ||
2169 | 1256 | `must be zero' bits are set in bytes two and three, `[b2&3=\fIx\fP]' | ||
2170 | 1257 | is printed, where \fIx\fP is the hex value of header bytes two and three. | ||
2171 | 1258 | .HD | ||
2172 | 1259 | UDP Name Server Responses | ||
2173 | 1260 | .LP | ||
2174 | 1261 | Name server responses are formatted as | ||
2175 | 1262 | .RS | ||
2176 | 1263 | .nf | ||
2177 | 1264 | .sp .5 | ||
2178 | 1265 | \fIsrc > dst: id op rcode flags a/n/au type class data (len)\fP | ||
2179 | 1266 | .sp .5 | ||
2180 | 1267 | \f(CWhelios.domain > h2opolo.1538: 3 3/3/7 A 128.32.137.3 (273) | ||
2181 | 1268 | helios.domain > h2opolo.1537: 2 NXDomain* 0/1/0 (97)\fR | ||
2182 | 1269 | .sp .5 | ||
2183 | 1270 | .fi | ||
2184 | 1271 | .RE | ||
2185 | 1272 | In the first example, \fIhelios\fP responds to query id 3 from \fIh2opolo\fP | ||
2186 | 1273 | with 3 answer records, 3 name server records and 7 additional records. | ||
2187 | 1274 | The first answer record is type A (address) and its data is internet | ||
2188 | 1275 | address 128.32.137.3. | ||
2189 | 1276 | The total size of the response was 273 bytes, | ||
2190 | 1277 | excluding UDP and IP headers. | ||
2191 | 1278 | The op (Query) and response code | ||
2192 | 1279 | (NoError) were omitted, as was the class (C_IN) of the A record. | ||
2193 | 1280 | .LP | ||
2194 | 1281 | In the second example, \fIhelios\fP responds to query 2 with a | ||
2195 | 1282 | response code of non-existent domain (NXDomain) with no answers, | ||
2196 | 1283 | one name server and no authority records. | ||
2197 | 1284 | The `*' indicates that | ||
2198 | 1285 | the \fIauthoritative answer\fP bit was set. | ||
2199 | 1286 | Since there were no | ||
2200 | 1287 | answers, no type, class or data were printed. | ||
2201 | 1288 | .LP | ||
2202 | 1289 | Other flag characters that might appear are `\-' (recursion available, | ||
2203 | 1290 | RA, \fInot\fP set) and `|' (truncated message, TC, set). | ||
2204 | 1291 | If the | ||
2205 | 1292 | `question' section doesn't contain exactly one entry, `[\fIn\fPq]' | ||
2206 | 1293 | is printed. | ||
2207 | 1294 | .HD | ||
2208 | 1295 | SMB/CIFS decoding | ||
2209 | 1296 | .LP | ||
2210 | 1297 | \fItcpdump\fP now includes fairly extensive SMB/CIFS/NBT decoding for data | ||
2211 | 1298 | on UDP/137, UDP/138 and TCP/139. | ||
2212 | 1299 | Some primitive decoding of IPX and | ||
2213 | 1300 | NetBEUI SMB data is also done. | ||
2214 | 1301 | .LP | ||
2215 | 1302 | By default a fairly minimal decode is done, with a much more detailed | ||
2216 | 1303 | decode done if -v is used. | ||
2217 | 1304 | Be warned that with -v a single SMB packet | ||
2218 | 1305 | may take up a page or more, so only use -v if you really want all the | ||
2219 | 1306 | gory details. | ||
2220 | 1307 | .LP | ||
2221 | 1308 | For information on SMB packet formats and what all the fields mean see | ||
2222 | 1309 | www.cifs.org or the pub/samba/specs/ directory on your favorite | ||
2223 | 1310 | samba.org mirror site. | ||
2224 | 1311 | The SMB patches were written by Andrew Tridgell | ||
2225 | 1312 | (tridge@samba.org). | ||
2226 | 1313 | .HD | ||
2227 | 1314 | NFS Requests and Replies | ||
2228 | 1315 | .LP | ||
2229 | 1316 | Sun NFS (Network File System) requests and replies are printed as: | ||
2230 | 1317 | .RS | ||
2231 | 1318 | .nf | ||
2232 | 1319 | .sp .5 | ||
2233 | 1320 | \fIsrc.xid > dst.nfs: len op args\fP | ||
2234 | 1321 | \fIsrc.nfs > dst.xid: reply stat len op results\fP | ||
2235 | 1322 | .sp .5 | ||
2236 | 1323 | \f(CW | ||
2237 | 1324 | sushi.6709 > wrl.nfs: 112 readlink fh 21,24/10.73165 | ||
2238 | 1325 | wrl.nfs > sushi.6709: reply ok 40 readlink "../var" | ||
2239 | 1326 | sushi.201b > wrl.nfs: | ||
2240 | 1327 | 144 lookup fh 9,74/4096.6878 "xcolors" | ||
2241 | 1328 | wrl.nfs > sushi.201b: | ||
2242 | 1329 | reply ok 128 lookup fh 9,74/4134.3150 | ||
2243 | 1330 | \fR | ||
2244 | 1331 | .sp .5 | ||
2245 | 1332 | .fi | ||
2246 | 1333 | .RE | ||
2247 | 1334 | In the first line, host \fIsushi\fP sends a transaction with id \fI6709\fP | ||
2248 | 1335 | to \fIwrl\fP (note that the number following the src host is a | ||
2249 | 1336 | transaction id, \fInot\fP the source port). | ||
2250 | 1337 | The request was 112 bytes, | ||
2251 | 1338 | excluding the UDP and IP headers. | ||
2252 | 1339 | The operation was a \fIreadlink\fP | ||
2253 | 1340 | (read symbolic link) on file handle (\fIfh\fP) 21,24/10.731657119. | ||
2254 | 1341 | (If one is lucky, as in this case, the file handle can be interpreted | ||
2255 | 1342 | as a major,minor device number pair, followed by the inode number and | ||
2256 | 1343 | generation number.) | ||
2257 | 1344 | \fIWrl\fP replies `ok' with the contents of the link. | ||
2258 | 1345 | .LP | ||
2259 | 1346 | In the third line, \fIsushi\fP asks \fIwrl\fP to lookup the name | ||
2260 | 1347 | `\fIxcolors\fP' in directory file 9,74/4096.6878. | ||
2261 | 1348 | Note that the data printed | ||
2262 | 1349 | depends on the operation type. | ||
2263 | 1350 | The format is intended to be self | ||
2264 | 1351 | explanatory if read in conjunction with | ||
2265 | 1352 | an NFS protocol spec. | ||
2266 | 1353 | .LP | ||
2267 | 1354 | If the \-v (verbose) flag is given, additional information is printed. | ||
2268 | 1355 | For example: | ||
2269 | 1356 | .RS | ||
2270 | 1357 | .nf | ||
2271 | 1358 | .sp .5 | ||
2272 | 1359 | \f(CW | ||
2273 | 1360 | sushi.1372a > wrl.nfs: | ||
2274 | 1361 | 148 read fh 21,11/12.195 8192 bytes @ 24576 | ||
2275 | 1362 | wrl.nfs > sushi.1372a: | ||
2276 | 1363 | reply ok 1472 read REG 100664 ids 417/0 sz 29388 | ||
2277 | 1364 | \fP | ||
2278 | 1365 | .sp .5 | ||
2279 | 1366 | .fi | ||
2280 | 1367 | .RE | ||
2281 | 1368 | (\-v also prints the IP header TTL, ID, length, and fragmentation fields, | ||
2282 | 1369 | which have been omitted from this example.) In the first line, | ||
2283 | 1370 | \fIsushi\fP asks \fIwrl\fP to read 8192 bytes from file 21,11/12.195, | ||
2284 | 1371 | at byte offset 24576. | ||
2285 | 1372 | \fIWrl\fP replies `ok'; the packet shown on the | ||
2286 | 1373 | second line is the first fragment of the reply, and hence is only 1472 | ||
2287 | 1374 | bytes long (the other bytes will follow in subsequent fragments, but | ||
2288 | 1375 | these fragments do not have NFS or even UDP headers and so might not be | ||
2289 | 1376 | printed, depending on the filter expression used). | ||
2290 | 1377 | Because the \-v flag | ||
2291 | 1378 | is given, some of the file attributes (which are returned in addition | ||
2292 | 1379 | to the file data) are printed: the file type (``REG'', for regular file), | ||
2293 | 1380 | the file mode (in octal), the uid and gid, and the file size. | ||
2294 | 1381 | .LP | ||
2295 | 1382 | If the \-v flag is given more than once, even more details are printed. | ||
2296 | 1383 | .LP | ||
2297 | 1384 | Note that NFS requests are very large and much of the detail won't be printed | ||
2298 | 1385 | unless \fIsnaplen\fP is increased. | ||
2299 | 1386 | Try using `\fB\-s 192\fP' to watch | ||
2300 | 1387 | NFS traffic. | ||
2301 | 1388 | .LP | ||
2302 | 1389 | NFS reply packets do not explicitly identify the RPC operation. | ||
2303 | 1390 | Instead, | ||
2304 | 1391 | \fItcpdump\fP keeps track of ``recent'' requests, and matches them to the | ||
2305 | 1392 | replies using the transaction ID. | ||
2306 | 1393 | If a reply does not closely follow the | ||
2307 | 1394 | corresponding request, it might not be parsable. | ||
2308 | 1395 | .HD | ||
2309 | 1396 | AFS Requests and Replies | ||
2310 | 1397 | .LP | ||
2311 | 1398 | Transarc AFS (Andrew File System) requests and replies are printed | ||
2312 | 1399 | as: | ||
2313 | 1400 | .HD | ||
2314 | 1401 | .RS | ||
2315 | 1402 | .nf | ||
2316 | 1403 | .sp .5 | ||
2317 | 1404 | \fIsrc.sport > dst.dport: rx packet-type\fP | ||
2318 | 1405 | \fIsrc.sport > dst.dport: rx packet-type service call call-name args\fP | ||
2319 | 1406 | \fIsrc.sport > dst.dport: rx packet-type service reply call-name args\fP | ||
2320 | 1407 | .sp .5 | ||
2321 | 1408 | \f(CW | ||
2322 | 1409 | elvis.7001 > pike.afsfs: | ||
2323 | 1410 | rx data fs call rename old fid 536876964/1/1 ".newsrc.new" | ||
2324 | 1411 | new fid 536876964/1/1 ".newsrc" | ||
2325 | 1412 | pike.afsfs > elvis.7001: rx data fs reply rename | ||
2326 | 1413 | \fR | ||
2327 | 1414 | .sp .5 | ||
2328 | 1415 | .fi | ||
2329 | 1416 | .RE | ||
2330 | 1417 | In the first line, host elvis sends a RX packet to pike. | ||
2331 | 1418 | This was | ||
2332 | 1419 | a RX data packet to the fs (fileserver) service, and is the start of | ||
2333 | 1420 | an RPC call. | ||
2334 | 1421 | The RPC call was a rename, with the old directory file id | ||
2335 | 1422 | of 536876964/1/1 and an old filename of `.newsrc.new', and a new directory | ||
2336 | 1423 | file id of 536876964/1/1 and a new filename of `.newsrc'. | ||
2337 | 1424 | The host pike | ||
2338 | 1425 | responds with a RPC reply to the rename call (which was successful, because | ||
2339 | 1426 | it was a data packet and not an abort packet). | ||
2340 | 1427 | .LP | ||
2341 | 1428 | In general, all AFS RPCs are decoded at least by RPC call name. | ||
2342 | 1429 | Most | ||
2343 | 1430 | AFS RPCs have at least some of the arguments decoded (generally only | ||
2344 | 1431 | the `interesting' arguments, for some definition of interesting). | ||
2345 | 1432 | .LP | ||
2346 | 1433 | The format is intended to be self-describing, but it will probably | ||
2347 | 1434 | not be useful to people who are not familiar with the workings of | ||
2348 | 1435 | AFS and RX. | ||
2349 | 1436 | .LP | ||
2350 | 1437 | If the -v (verbose) flag is given twice, acknowledgement packets and | ||
2351 | 1438 | additional header information is printed, such as the the RX call ID, | ||
2352 | 1439 | call number, sequence number, serial number, and the RX packet flags. | ||
2353 | 1440 | .LP | ||
2354 | 1441 | If the -v flag is given twice, additional information is printed, | ||
2355 | 1442 | such as the the RX call ID, serial number, and the RX packet flags. | ||
2356 | 1443 | The MTU negotiation information is also printed from RX ack packets. | ||
2357 | 1444 | .LP | ||
2358 | 1445 | If the -v flag is given three times, the security index and service id | ||
2359 | 1446 | are printed. | ||
2360 | 1447 | .LP | ||
2361 | 1448 | Error codes are printed for abort packets, with the exception of Ubik | ||
2362 | 1449 | beacon packets (because abort packets are used to signify a yes vote | ||
2363 | 1450 | for the Ubik protocol). | ||
2364 | 1451 | .LP | ||
2365 | 1452 | Note that AFS requests are very large and many of the arguments won't | ||
2366 | 1453 | be printed unless \fIsnaplen\fP is increased. | ||
2367 | 1454 | Try using `\fB-s 256\fP' | ||
2368 | 1455 | to watch AFS traffic. | ||
2369 | 1456 | .LP | ||
2370 | 1457 | AFS reply packets do not explicitly identify the RPC operation. | ||
2371 | 1458 | Instead, | ||
2372 | 1459 | \fItcpdump\fP keeps track of ``recent'' requests, and matches them to the | ||
2373 | 1460 | replies using the call number and service ID. | ||
2374 | 1461 | If a reply does not closely | ||
2375 | 1462 | follow the | ||
2376 | 1463 | corresponding request, it might not be parsable. | ||
2377 | 1464 | |||
2378 | 1465 | .HD | ||
2379 | 1466 | KIP AppleTalk (DDP in UDP) | ||
2380 | 1467 | .LP | ||
2381 | 1468 | AppleTalk DDP packets encapsulated in UDP datagrams are de-encapsulated | ||
2382 | 1469 | and dumped as DDP packets (i.e., all the UDP header information is | ||
2383 | 1470 | discarded). | ||
2384 | 1471 | The file | ||
2385 | 1472 | .I /etc/atalk.names | ||
2386 | 1473 | is used to translate AppleTalk net and node numbers to names. | ||
2387 | 1474 | Lines in this file have the form | ||
2388 | 1475 | .RS | ||
2389 | 1476 | .nf | ||
2390 | 1477 | .sp .5 | ||
2391 | 1478 | \fInumber name\fP | ||
2392 | 1479 | |||
2393 | 1480 | \f(CW1.254 ether | ||
2394 | 1481 | 16.1 icsd-net | ||
2395 | 1482 | 1.254.110 ace\fR | ||
2396 | 1483 | .sp .5 | ||
2397 | 1484 | .fi | ||
2398 | 1485 | .RE | ||
2399 | 1486 | The first two lines give the names of AppleTalk networks. | ||
2400 | 1487 | The third | ||
2401 | 1488 | line gives the name of a particular host (a host is distinguished | ||
2402 | 1489 | from a net by the 3rd octet in the number \- | ||
2403 | 1490 | a net number \fImust\fP have two octets and a host number \fImust\fP | ||
2404 | 1491 | have three octets.) The number and name should be separated by | ||
2405 | 1492 | whitespace (blanks or tabs). | ||
2406 | 1493 | The | ||
2407 | 1494 | .I /etc/atalk.names | ||
2408 | 1495 | file may contain blank lines or comment lines (lines starting with | ||
2409 | 1496 | a `#'). | ||
2410 | 1497 | .LP | ||
2411 | 1498 | AppleTalk addresses are printed in the form | ||
2412 | 1499 | .RS | ||
2413 | 1500 | .nf | ||
2414 | 1501 | .sp .5 | ||
2415 | 1502 | \fInet.host.port\fP | ||
2416 | 1503 | |||
2417 | 1504 | \f(CW144.1.209.2 > icsd-net.112.220 | ||
2418 | 1505 | office.2 > icsd-net.112.220 | ||
2419 | 1506 | jssmag.149.235 > icsd-net.2\fR | ||
2420 | 1507 | .sp .5 | ||
2421 | 1508 | .fi | ||
2422 | 1509 | .RE | ||
2423 | 1510 | (If the | ||
2424 | 1511 | .I /etc/atalk.names | ||
2425 | 1512 | doesn't exist or doesn't contain an entry for some AppleTalk | ||
2426 | 1513 | host/net number, addresses are printed in numeric form.) | ||
2427 | 1514 | In the first example, NBP (DDP port 2) on net 144.1 node 209 | ||
2428 | 1515 | is sending to whatever is listening on port 220 of net icsd node 112. | ||
2429 | 1516 | The second line is the same except the full name of the source node | ||
2430 | 1517 | is known (`office'). | ||
2431 | 1518 | The third line is a send from port 235 on | ||
2432 | 1519 | net jssmag node 149 to broadcast on the icsd-net NBP port (note that | ||
2433 | 1520 | the broadcast address (255) is indicated by a net name with no host | ||
2434 | 1521 | number \- for this reason it's a good idea to keep node names and | ||
2435 | 1522 | net names distinct in /etc/atalk.names). | ||
2436 | 1523 | .LP | ||
2437 | 1524 | NBP (name binding protocol) and ATP (AppleTalk transaction protocol) | ||
2438 | 1525 | packets have their contents interpreted. | ||
2439 | 1526 | Other protocols just dump | ||
2440 | 1527 | the protocol name (or number if no name is registered for the | ||
2441 | 1528 | protocol) and packet size. | ||
2442 | 1529 | |||
2443 | 1530 | \fBNBP packets\fP are formatted like the following examples: | ||
2444 | 1531 | .RS | ||
2445 | 1532 | .nf | ||
2446 | 1533 | .sp .5 | ||
2447 | 1534 | \s-2\f(CWicsd-net.112.220 > jssmag.2: nbp-lkup 190: "=:LaserWriter@*" | ||
2448 | 1535 | jssmag.209.2 > icsd-net.112.220: nbp-reply 190: "RM1140:LaserWriter@*" 250 | ||
2449 | 1536 | techpit.2 > icsd-net.112.220: nbp-reply 190: "techpit:LaserWriter@*" 186\fR\s+2 | ||
2450 | 1537 | .sp .5 | ||
2451 | 1538 | .fi | ||
2452 | 1539 | .RE | ||
2453 | 1540 | The first line is a name lookup request for laserwriters sent by net icsd host | ||
2454 | 1541 | 112 and broadcast on net jssmag. | ||
2455 | 1542 | The nbp id for the lookup is 190. | ||
2456 | 1543 | The second line shows a reply for this request (note that it has the | ||
2457 | 1544 | same id) from host jssmag.209 saying that it has a laserwriter | ||
2458 | 1545 | resource named "RM1140" registered on port 250. | ||
2459 | 1546 | The third line is | ||
2460 | 1547 | another reply to the same request saying host techpit has laserwriter | ||
2461 | 1548 | "techpit" registered on port 186. | ||
2462 | 1549 | |||
2463 | 1550 | \fBATP packet\fP formatting is demonstrated by the following example: | ||
2464 | 1551 | .RS | ||
2465 | 1552 | .nf | ||
2466 | 1553 | .sp .5 | ||
2467 | 1554 | \s-2\f(CWjssmag.209.165 > helios.132: atp-req 12266<0-7> 0xae030001 | ||
2468 | 1555 | helios.132 > jssmag.209.165: atp-resp 12266:0 (512) 0xae040000 | ||
2469 | 1556 | helios.132 > jssmag.209.165: atp-resp 12266:1 (512) 0xae040000 | ||
2470 | 1557 | helios.132 > jssmag.209.165: atp-resp 12266:2 (512) 0xae040000 | ||
2471 | 1558 | helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000 | ||
2472 | 1559 | helios.132 > jssmag.209.165: atp-resp 12266:4 (512) 0xae040000 | ||
2473 | 1560 | helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000 | ||
2474 | 1561 | helios.132 > jssmag.209.165: atp-resp 12266:6 (512) 0xae040000 | ||
2475 | 1562 | helios.132 > jssmag.209.165: atp-resp*12266:7 (512) 0xae040000 | ||
2476 | 1563 | jssmag.209.165 > helios.132: atp-req 12266<3,5> 0xae030001 | ||
2477 | 1564 | helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000 | ||
2478 | 1565 | helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000 | ||
2479 | 1566 | jssmag.209.165 > helios.132: atp-rel 12266<0-7> 0xae030001 | ||
2480 | 1567 | jssmag.209.133 > helios.132: atp-req* 12267<0-7> 0xae030002\fR\s+2 | ||
2481 | 1568 | .sp .5 | ||
2482 | 1569 | .fi | ||
2483 | 1570 | .RE | ||
2484 | 1571 | Jssmag.209 initiates transaction id 12266 with host helios by requesting | ||
2485 | 1572 | up to 8 packets (the `<0-7>'). | ||
2486 | 1573 | The hex number at the end of the line | ||
2487 | 1574 | is the value of the `userdata' field in the request. | ||
2488 | 1575 | .LP | ||
2489 | 1576 | Helios responds with 8 512-byte packets. | ||
2490 | 1577 | The `:digit' following the | ||
2491 | 1578 | transaction id gives the packet sequence number in the transaction | ||
2492 | 1579 | and the number in parens is the amount of data in the packet, | ||
2493 | 1580 | excluding the atp header. | ||
2494 | 1581 | The `*' on packet 7 indicates that the | ||
2495 | 1582 | EOM bit was set. | ||
2496 | 1583 | .LP | ||
2497 | 1584 | Jssmag.209 then requests that packets 3 & 5 be retransmitted. | ||
2498 | 1585 | Helios | ||
2499 | 1586 | resends them then jssmag.209 releases the transaction. | ||
2500 | 1587 | Finally, | ||
2501 | 1588 | jssmag.209 initiates the next request. | ||
2502 | 1589 | The `*' on the request | ||
2503 | 1590 | indicates that XO (`exactly once') was \fInot\fP set. | ||
2504 | 1591 | |||
2505 | 1592 | .HD | ||
2506 | 1593 | IP Fragmentation | ||
2507 | 1594 | .LP | ||
2508 | 1595 | Fragmented Internet datagrams are printed as | ||
2509 | 1596 | .RS | ||
2510 | 1597 | .nf | ||
2511 | 1598 | .sp .5 | ||
2512 | 1599 | \fB(frag \fIid\fB:\fIsize\fB@\fIoffset\fB+)\fR | ||
2513 | 1600 | \fB(frag \fIid\fB:\fIsize\fB@\fIoffset\fB)\fR | ||
2514 | 1601 | .sp .5 | ||
2515 | 1602 | .fi | ||
2516 | 1603 | .RE | ||
2517 | 1604 | (The first form indicates there are more fragments. | ||
2518 | 1605 | The second | ||
2519 | 1606 | indicates this is the last fragment.) | ||
2520 | 1607 | .LP | ||
2521 | 1608 | \fIId\fP is the fragment id. | ||
2522 | 1609 | \fISize\fP is the fragment | ||
2523 | 1610 | size (in bytes) excluding the IP header. | ||
2524 | 1611 | \fIOffset\fP is this | ||
2525 | 1612 | fragment's offset (in bytes) in the original datagram. | ||
2526 | 1613 | .LP | ||
2527 | 1614 | The fragment information is output for each fragment. | ||
2528 | 1615 | The first | ||
2529 | 1616 | fragment contains the higher level protocol header and the frag | ||
2530 | 1617 | info is printed after the protocol info. | ||
2531 | 1618 | Fragments | ||
2532 | 1619 | after the first contain no higher level protocol header and the | ||
2533 | 1620 | frag info is printed after the source and destination addresses. | ||
2534 | 1621 | For example, here is part of an ftp from arizona.edu to lbl-rtsg.arpa | ||
2535 | 1622 | over a CSNET connection that doesn't appear to handle 576 byte datagrams: | ||
2536 | 1623 | .RS | ||
2537 | 1624 | .nf | ||
2538 | 1625 | .sp .5 | ||
2539 | 1626 | \s-2\f(CWarizona.ftp-data > rtsg.1170: . 1024:1332(308) ack 1 win 4096 (frag 595a:328@0+) | ||
2540 | 1627 | arizona > rtsg: (frag 595a:204@328) | ||
2541 | 1628 | rtsg.1170 > arizona.ftp-data: . ack 1536 win 2560\fP\s+2 | ||
2542 | 1629 | .sp .5 | ||
2543 | 1630 | .fi | ||
2544 | 1631 | .RE | ||
2545 | 1632 | There are a couple of things to note here: First, addresses in the | ||
2546 | 1633 | 2nd line don't include port numbers. | ||
2547 | 1634 | This is because the TCP | ||
2548 | 1635 | protocol information is all in the first fragment and we have no idea | ||
2549 | 1636 | what the port or sequence numbers are when we print the later fragments. | ||
2550 | 1637 | Second, the tcp sequence information in the first line is printed as if there | ||
2551 | 1638 | were 308 bytes of user data when, in fact, there are 512 bytes (308 in | ||
2552 | 1639 | the first frag and 204 in the second). | ||
2553 | 1640 | If you are looking for holes | ||
2554 | 1641 | in the sequence space or trying to match up acks | ||
2555 | 1642 | with packets, this can fool you. | ||
2556 | 1643 | .LP | ||
2557 | 1644 | A packet with the IP \fIdon't fragment\fP flag is marked with a | ||
2558 | 1645 | trailing \fB(DF)\fP. | ||
2559 | 1646 | .HD | ||
2560 | 1647 | Timestamps | ||
2561 | 1648 | .LP | ||
2562 | 1649 | By default, all output lines are preceded by a timestamp. | ||
2563 | 1650 | The timestamp | ||
2564 | 1651 | is the current clock time in the form | ||
2565 | 1652 | .RS | ||
2566 | 1653 | .nf | ||
2567 | 1654 | \fIhh:mm:ss.frac\fP | ||
2568 | 1655 | .fi | ||
2569 | 1656 | .RE | ||
2570 | 1657 | and is as accurate as the kernel's clock. | ||
2571 | 1658 | The timestamp reflects the time the kernel first saw the packet. | ||
2572 | 1659 | No attempt | ||
2573 | 1660 | is made to account for the time lag between when the | ||
2574 | 1661 | Ethernet interface removed the packet from the wire and when the kernel | ||
2575 | 1662 | serviced the `new packet' interrupt. | ||
2576 | 1663 | .SH "SEE ALSO" | ||
2577 | 1664 | stty(1), pcap(3PCAP), bpf(4), nit(4P), pcap-savefile(@MAN_FILE_FORMATS@), | ||
2578 | 1665 | pcap-filter(@MAN_MISC_INFO@), pcap-tstamp-type(@MAN_MISC_INFO@) | ||
2579 | 1666 | .SH AUTHORS | ||
2580 | 1667 | The original authors are: | ||
2581 | 1668 | .LP | ||
2582 | 1669 | Van Jacobson, | ||
2583 | 1670 | Craig Leres and | ||
2584 | 1671 | Steven McCanne, all of the | ||
2585 | 1672 | Lawrence Berkeley National Laboratory, University of California, Berkeley, CA. | ||
2586 | 1673 | .LP | ||
2587 | 1674 | It is currently being maintained by tcpdump.org. | ||
2588 | 1675 | .LP | ||
2589 | 1676 | The current version is available via http: | ||
2590 | 1677 | .LP | ||
2591 | 1678 | .RS | ||
2592 | 1679 | .I http://www.tcpdump.org/ | ||
2593 | 1680 | .RE | ||
2594 | 1681 | .LP | ||
2595 | 1682 | The original distribution is available via anonymous ftp: | ||
2596 | 1683 | .LP | ||
2597 | 1684 | .RS | ||
2598 | 1685 | .I ftp://ftp.ee.lbl.gov/tcpdump.tar.Z | ||
2599 | 1686 | .RE | ||
2600 | 1687 | .LP | ||
2601 | 1688 | IPv6/IPsec support is added by WIDE/KAME project. | ||
2602 | 1689 | This program uses Eric Young's SSLeay library, under specific configurations. | ||
2603 | 1690 | .SH BUGS | ||
2604 | 1691 | Please send problems, bugs, questions, desirable enhancements, patches | ||
2605 | 1692 | etc. to: | ||
2606 | 1693 | .LP | ||
2607 | 1694 | .RS | ||
2608 | 1695 | tcpdump-workers@lists.tcpdump.org | ||
2609 | 1696 | .RE | ||
2610 | 1697 | .LP | ||
2611 | 1698 | NIT doesn't let you watch your own outbound traffic, BPF will. | ||
2612 | 1699 | We recommend that you use the latter. | ||
2613 | 1700 | .LP | ||
2614 | 1701 | On Linux systems with 2.0[.x] kernels: | ||
2615 | 1702 | .IP | ||
2616 | 1703 | packets on the loopback device will be seen twice; | ||
2617 | 1704 | .IP | ||
2618 | 1705 | packet filtering cannot be done in the kernel, so that all packets must | ||
2619 | 1706 | be copied from the kernel in order to be filtered in user mode; | ||
2620 | 1707 | .IP | ||
2621 | 1708 | all of a packet, not just the part that's within the snapshot length, | ||
2622 | 1709 | will be copied from the kernel (the 2.0[.x] packet capture mechanism, if | ||
2623 | 1710 | asked to copy only part of a packet to userland, will not report the | ||
2624 | 1711 | true length of the packet; this would cause most IP packets to get an | ||
2625 | 1712 | error from | ||
2626 | 1713 | .BR tcpdump ); | ||
2627 | 1714 | .IP | ||
2628 | 1715 | capturing on some PPP devices won't work correctly. | ||
2629 | 1716 | .LP | ||
2630 | 1717 | We recommend that you upgrade to a 2.2 or later kernel. | ||
2631 | 1718 | .LP | ||
2632 | 1719 | Some attempt should be made to reassemble IP fragments or, at least | ||
2633 | 1720 | to compute the right length for the higher level protocol. | ||
2634 | 1721 | .LP | ||
2635 | 1722 | Name server inverse queries are not dumped correctly: the (empty) | ||
2636 | 1723 | question section is printed rather than real query in the answer | ||
2637 | 1724 | section. | ||
2638 | 1725 | Some believe that inverse queries are themselves a bug and | ||
2639 | 1726 | prefer to fix the program generating them rather than \fItcpdump\fP. | ||
2640 | 1727 | .LP | ||
2641 | 1728 | A packet trace that crosses a daylight savings time change will give | ||
2642 | 1729 | skewed time stamps (the time change is ignored). | ||
2643 | 1730 | .LP | ||
2644 | 1731 | Filter expressions on fields other than those in Token Ring headers will | ||
2645 | 1732 | not correctly handle source-routed Token Ring packets. | ||
2646 | 1733 | .LP | ||
2647 | 1734 | Filter expressions on fields other than those in 802.11 headers will not | ||
2648 | 1735 | correctly handle 802.11 data packets with both To DS and From DS set. | ||
2649 | 1736 | .LP | ||
2650 | 1737 | .BR "ip6 proto" | ||
2651 | 1738 | should chase header chain, but at this moment it does not. | ||
2652 | 1739 | .BR "ip6 protochain" | ||
2653 | 1740 | is supplied for this behavior. | ||
2654 | 1741 | .LP | ||
2655 | 1742 | Arithmetic expression against transport layer headers, like \fBtcp[0]\fP, | ||
2656 | 1743 | does not work against IPv6 packets. | ||
2657 | 1744 | It only looks at IPv4 packets. | ||
2658 | 1745 | 0 | ||
2659 | === removed directory '.pc/40_openssl.diff' | |||
2660 | === removed file '.pc/40_openssl.diff/configure.in' | |||
2661 | --- .pc/40_openssl.diff/configure.in 2012-01-02 20:19:22 +0000 | |||
2662 | +++ .pc/40_openssl.diff/configure.in 1970-01-01 00:00:00 +0000 | |||
2663 | @@ -1,1111 +0,0 @@ | |||
2664 | 1 | dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.204 2008-11-18 07:39:20 guy Exp $ (LBL) | ||
2665 | 2 | dnl | ||
2666 | 3 | dnl Copyright (c) 1994, 1995, 1996, 1997 | ||
2667 | 4 | dnl The Regents of the University of California. All rights reserved. | ||
2668 | 5 | dnl | ||
2669 | 6 | dnl Process this file with autoconf to produce a configure script. | ||
2670 | 7 | dnl | ||
2671 | 8 | |||
2672 | 9 | # | ||
2673 | 10 | # See | ||
2674 | 11 | # | ||
2675 | 12 | # http://ftp.gnu.org/gnu/config/README | ||
2676 | 13 | # | ||
2677 | 14 | # for the URLs to use to fetch new versions of config.guess and | ||
2678 | 15 | # config.sub. | ||
2679 | 16 | # | ||
2680 | 17 | |||
2681 | 18 | AC_REVISION($Revision: 1.204 $) | ||
2682 | 19 | AC_PREREQ(2.50) | ||
2683 | 20 | AC_INIT(tcpdump.c) | ||
2684 | 21 | |||
2685 | 22 | AC_CANONICAL_HOST | ||
2686 | 23 | |||
2687 | 24 | AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS) | ||
2688 | 25 | AC_PROG_CC | ||
2689 | 26 | AC_LBL_C_INIT(V_CCOPT, V_INCLS) | ||
2690 | 27 | AC_LBL_C_INLINE | ||
2691 | 28 | AC_C___ATTRIBUTE__ | ||
2692 | 29 | if test "$ac_cv___attribute__" = "yes"; then | ||
2693 | 30 | AC_C___ATTRIBUTE___FORMAT_FUNCTION_POINTER | ||
2694 | 31 | fi | ||
2695 | 32 | AC_CHECK_HEADERS(fcntl.h rpc/rpc.h rpc/rpcent.h netdnet/dnetdb.h) | ||
2696 | 33 | AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h> | ||
2697 | 34 | #include <sys/socket.h> | ||
2698 | 35 | #include <net/if.h>]) | ||
2699 | 36 | if test "$ac_cv_header_net_pfvar_h" = yes; then | ||
2700 | 37 | LOCALSRC="print-pflog.c $LOCALSRC" | ||
2701 | 38 | fi | ||
2702 | 39 | AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h> | ||
2703 | 40 | #include <sys/socket.h>]) | ||
2704 | 41 | if test "$ac_cv_header_netinet_if_ether_h" != yes; then | ||
2705 | 42 | # | ||
2706 | 43 | # The simple test didn't work. | ||
2707 | 44 | # Do we need to include <net/if.h> first? | ||
2708 | 45 | # Unset ac_cv_header_netinet_if_ether_h so we don't | ||
2709 | 46 | # treat the previous failure as a cached value and | ||
2710 | 47 | # suppress the next test. | ||
2711 | 48 | # | ||
2712 | 49 | AC_MSG_NOTICE([Rechecking with some additional includes]) | ||
2713 | 50 | unset ac_cv_header_netinet_if_ether_h | ||
2714 | 51 | AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h> | ||
2715 | 52 | #include <sys/socket.h> | ||
2716 | 53 | #include <netinet/in.h> | ||
2717 | 54 | struct mbuf; | ||
2718 | 55 | struct rtentry; | ||
2719 | 56 | #include <net/if.h>]) | ||
2720 | 57 | fi | ||
2721 | 58 | |||
2722 | 59 | AC_HEADER_TIME | ||
2723 | 60 | |||
2724 | 61 | case "$host_os" in | ||
2725 | 62 | |||
2726 | 63 | darwin*) | ||
2727 | 64 | AC_ARG_ENABLE(universal, | ||
2728 | 65 | AC_HELP_STRING([--disable-universal],[don't build universal on OS X])) | ||
2729 | 66 | if test "$enable_universal" != "no"; then | ||
2730 | 67 | case "$host_os" in | ||
2731 | 68 | |||
2732 | 69 | darwin9.*) | ||
2733 | 70 | # | ||
2734 | 71 | # Leopard. Build for x86 and 32-bit PowerPC, with | ||
2735 | 72 | # x86 first. (That's what Apple does.) | ||
2736 | 73 | # | ||
2737 | 74 | V_CCOPT="$V_CCOPT -arch i386 -arch ppc" | ||
2738 | 75 | LDFLAGS="$LDFLAGS -arch i386 -arch ppc" | ||
2739 | 76 | ;; | ||
2740 | 77 | |||
2741 | 78 | darwin10.*) | ||
2742 | 79 | # | ||
2743 | 80 | # Snow Leopard. Build for x86-64 and x86, with | ||
2744 | 81 | # x86-64 first. (That's what Apple does.) | ||
2745 | 82 | # | ||
2746 | 83 | V_CCOPT="$V_CCOPT -arch x86_64 -arch i386" | ||
2747 | 84 | LDFLAGS="$LDFLAGS -arch x86_64 -arch i386" | ||
2748 | 85 | ;; | ||
2749 | 86 | esac | ||
2750 | 87 | fi | ||
2751 | 88 | ;; | ||
2752 | 89 | |||
2753 | 90 | linux*) | ||
2754 | 91 | AC_MSG_CHECKING(Linux kernel version) | ||
2755 | 92 | if test "$cross_compiling" = yes; then | ||
2756 | 93 | AC_CACHE_VAL(ac_cv_linux_vers, | ||
2757 | 94 | ac_cv_linux_vers=unknown) | ||
2758 | 95 | else | ||
2759 | 96 | AC_CACHE_VAL(ac_cv_linux_vers, | ||
2760 | 97 | ac_cv_linux_vers=`uname -r 2>&1 | \ | ||
2761 | 98 | sed -n -e '$s/.* //' -e '$s/\..*//p'`) | ||
2762 | 99 | fi | ||
2763 | 100 | AC_MSG_RESULT($ac_cv_linux_vers) | ||
2764 | 101 | if test $ac_cv_linux_vers = unknown ; then | ||
2765 | 102 | AC_MSG_ERROR(cannot determine linux version when cross-compiling) | ||
2766 | 103 | fi | ||
2767 | 104 | if test $ac_cv_linux_vers -lt 2 ; then | ||
2768 | 105 | AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info) | ||
2769 | 106 | fi | ||
2770 | 107 | ;; | ||
2771 | 108 | |||
2772 | 109 | *) | ||
2773 | 110 | ;; | ||
2774 | 111 | esac | ||
2775 | 112 | |||
2776 | 113 | |||
2777 | 114 | AC_ARG_WITH(smi, | ||
2778 | 115 | [ --with-smi link with libsmi (allows to load MIBs on the fly to decode SNMP packets. [default=yes] | ||
2779 | 116 | --without-smi don't link with libsmi],, | ||
2780 | 117 | with_smi=yes) | ||
2781 | 118 | |||
2782 | 119 | if test "x$with_smi" != "xno" ; then | ||
2783 | 120 | AC_CHECK_HEADERS(smi.h) | ||
2784 | 121 | AC_CHECK_LIB(smi, smiInit) | ||
2785 | 122 | if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes | ||
2786 | 123 | then | ||
2787 | 124 | AC_MSG_CHECKING([whether to enable libsmi]) | ||
2788 | 125 | AC_TRY_RUN([ /* libsmi available check */ | ||
2789 | 126 | #include <smi.h> | ||
2790 | 127 | main() | ||
2791 | 128 | { | ||
2792 | 129 | int current, revision, age, n; | ||
2793 | 130 | const int required = 2; | ||
2794 | 131 | if (smiInit("")) | ||
2795 | 132 | exit(1); | ||
2796 | 133 | if (strcmp(SMI_LIBRARY_VERSION, smi_library_version)) | ||
2797 | 134 | exit(2); | ||
2798 | 135 | n = sscanf(smi_library_version, "%d:%d:%d", ¤t, &revision, &age); | ||
2799 | 136 | if (n != 3) | ||
2800 | 137 | exit(3); | ||
2801 | 138 | if (required < current - age || required > current) | ||
2802 | 139 | exit(4); | ||
2803 | 140 | exit(0); | ||
2804 | 141 | } | ||
2805 | 142 | ], | ||
2806 | 143 | [ AC_MSG_RESULT(yes) | ||
2807 | 144 | AC_DEFINE(LIBSMI) | ||
2808 | 145 | libsmi=yes], | ||
2809 | 146 | dnl autoconf documentation says that $? contains the exit value. | ||
2810 | 147 | dnl reality is that it does not. We leave this in just in case | ||
2811 | 148 | dnl autoconf ever comes back to match the documentation. | ||
2812 | 149 | [ case $? in | ||
2813 | 150 | 1) AC_MSG_RESULT(no - smiInit failed) ;; | ||
2814 | 151 | 2) AC_MSG_RESULT(no - header/library version mismatch) ;; | ||
2815 | 152 | 3) AC_MSG_RESULT(no - can't determine library version) ;; | ||
2816 | 153 | 4) AC_MSG_RESULT(no - too old) ;; | ||
2817 | 154 | *) AC_MSG_RESULT(no) ;; | ||
2818 | 155 | esac | ||
2819 | 156 | libsmi=no], | ||
2820 | 157 | [ AC_MSG_RESULT(not when cross-compiling) | ||
2821 | 158 | libsmi=no] | ||
2822 | 159 | ) | ||
2823 | 160 | fi | ||
2824 | 161 | fi | ||
2825 | 162 | |||
2826 | 163 | AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer]) | ||
2827 | 164 | AC_ARG_ENABLE(smb, | ||
2828 | 165 | [ --enable-smb enable possibly-buggy SMB printer [default=yes] | ||
2829 | 166 | --disable-smb disable possibly-buggy SMB printer],, | ||
2830 | 167 | enableval=yes) | ||
2831 | 168 | case "$enableval" in | ||
2832 | 169 | yes) AC_MSG_RESULT(yes) | ||
2833 | 170 | AC_WARN([The SMB printer may have exploitable buffer overflows!!!]) | ||
2834 | 171 | AC_DEFINE(TCPDUMP_DO_SMB) | ||
2835 | 172 | LOCALSRC="print-smb.c smbutil.c $LOCALSRC" | ||
2836 | 173 | ;; | ||
2837 | 174 | *) AC_MSG_RESULT(no) | ||
2838 | 175 | ;; | ||
2839 | 176 | esac | ||
2840 | 177 | |||
2841 | 178 | AC_ARG_WITH(user, [ --with-user=USERNAME drop privileges by default to USERNAME]) | ||
2842 | 179 | AC_MSG_CHECKING([whether to drop root privileges by default]) | ||
2843 | 180 | if test ! -z "$with_user" ; then | ||
2844 | 181 | AC_DEFINE_UNQUOTED(WITH_USER, "$withval") | ||
2845 | 182 | AC_MSG_RESULT(to \"$withval\") | ||
2846 | 183 | else | ||
2847 | 184 | AC_MSG_RESULT(no) | ||
2848 | 185 | fi | ||
2849 | 186 | |||
2850 | 187 | AC_ARG_WITH(chroot, [ --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY]) | ||
2851 | 188 | AC_MSG_CHECKING([whether to chroot]) | ||
2852 | 189 | if test ! -z "$with_chroot" && test "$with_chroot" != "no" ; then | ||
2853 | 190 | AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval") | ||
2854 | 191 | AC_MSG_RESULT(to \"$withval\") | ||
2855 | 192 | else | ||
2856 | 193 | AC_MSG_RESULT(no) | ||
2857 | 194 | fi | ||
2858 | 195 | |||
2859 | 196 | AC_MSG_CHECKING([whether to enable ipv6]) | ||
2860 | 197 | AC_ARG_ENABLE(ipv6, | ||
2861 | 198 | [ --enable-ipv6 enable ipv6 (with ipv4) support | ||
2862 | 199 | --disable-ipv6 disable ipv6 support], | ||
2863 | 200 | [ case "$enableval" in | ||
2864 | 201 | yes) AC_MSG_RESULT(yes) | ||
2865 | 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" | ||
2866 | 203 | AC_DEFINE(INET6) | ||
2867 | 204 | ipv6=yes | ||
2868 | 205 | ;; | ||
2869 | 206 | *) | ||
2870 | 207 | AC_MSG_RESULT(no) | ||
2871 | 208 | ipv6=no | ||
2872 | 209 | ;; | ||
2873 | 210 | esac ], | ||
2874 | 211 | |||
2875 | 212 | AC_TRY_RUN([ /* AF_INET6 available check */ | ||
2876 | 213 | #include <sys/types.h> | ||
2877 | 214 | #include <sys/socket.h> | ||
2878 | 215 | main() | ||
2879 | 216 | { | ||
2880 | 217 | if (socket(AF_INET6, SOCK_STREAM, 0) < 0) | ||
2881 | 218 | exit(1); | ||
2882 | 219 | else | ||
2883 | 220 | exit(0); | ||
2884 | 221 | } | ||
2885 | 222 | ], | ||
2886 | 223 | [ AC_MSG_RESULT(yes) | ||
2887 | 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" | ||
2888 | 225 | AC_DEFINE(INET6) | ||
2889 | 226 | ipv6=yes], | ||
2890 | 227 | [ AC_MSG_RESULT(no) | ||
2891 | 228 | ipv6=no], | ||
2892 | 229 | [ AC_MSG_RESULT(no) | ||
2893 | 230 | ipv6=no] | ||
2894 | 231 | )) | ||
2895 | 232 | |||
2896 | 233 | ipv6type=unknown | ||
2897 | 234 | ipv6lib=none | ||
2898 | 235 | ipv6trylibc=no | ||
2899 | 236 | |||
2900 | 237 | if test "$ipv6" = "yes"; then | ||
2901 | 238 | AC_MSG_CHECKING([ipv6 stack type]) | ||
2902 | 239 | for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do | ||
2903 | 240 | case $i in | ||
2904 | 241 | inria) | ||
2905 | 242 | dnl http://www.kame.net/ | ||
2906 | 243 | AC_EGREP_CPP(yes, | ||
2907 | 244 | [#include <netinet/in.h> | ||
2908 | 245 | #ifdef IPV6_INRIA_VERSION | ||
2909 | 246 | yes | ||
2910 | 247 | #endif], | ||
2911 | 248 | [ipv6type=$i; | ||
2912 | 249 | CFLAGS="-DINET6 $CFLAGS"]) | ||
2913 | 250 | ;; | ||
2914 | 251 | kame) | ||
2915 | 252 | dnl http://www.kame.net/ | ||
2916 | 253 | AC_EGREP_CPP(yes, | ||
2917 | 254 | [#include <netinet/in.h> | ||
2918 | 255 | #ifdef __KAME__ | ||
2919 | 256 | yes | ||
2920 | 257 | #endif], | ||
2921 | 258 | [ipv6type=$i; | ||
2922 | 259 | ipv6lib=inet6; | ||
2923 | 260 | ipv6libdir=/usr/local/v6/lib; | ||
2924 | 261 | ipv6trylibc=yes; | ||
2925 | 262 | CFLAGS="-DINET6 $CFLAGS"]) | ||
2926 | 263 | ;; | ||
2927 | 264 | linux-glibc) | ||
2928 | 265 | dnl http://www.v6.linux.or.jp/ | ||
2929 | 266 | AC_EGREP_CPP(yes, | ||
2930 | 267 | [#include <features.h> | ||
2931 | 268 | #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 | ||
2932 | 269 | yes | ||
2933 | 270 | #endif], | ||
2934 | 271 | [ipv6type=$i; | ||
2935 | 272 | CFLAGS="-DINET6 $CFLAGS"]) | ||
2936 | 273 | ;; | ||
2937 | 274 | linux-libinet6) | ||
2938 | 275 | dnl http://www.v6.linux.or.jp/ | ||
2939 | 276 | dnl | ||
2940 | 277 | dnl This also matches Solaris 8 and Tru64 UNIX 5.1, | ||
2941 | 278 | dnl and possibly other versions of those OSes | ||
2942 | 279 | dnl | ||
2943 | 280 | if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then | ||
2944 | 281 | ipv6type=$i | ||
2945 | 282 | ipv6lib=inet6 | ||
2946 | 283 | ipv6libdir=/usr/inet6/lib | ||
2947 | 284 | ipv6trylibc=yes; | ||
2948 | 285 | CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS" | ||
2949 | 286 | fi | ||
2950 | 287 | ;; | ||
2951 | 288 | toshiba) | ||
2952 | 289 | AC_EGREP_CPP(yes, | ||
2953 | 290 | [#include <sys/param.h> | ||
2954 | 291 | #ifdef _TOSHIBA_INET6 | ||
2955 | 292 | yes | ||
2956 | 293 | #endif], | ||
2957 | 294 | [ipv6type=$i; | ||
2958 | 295 | ipv6lib=inet6; | ||
2959 | 296 | ipv6libdir=/usr/local/v6/lib; | ||
2960 | 297 | CFLAGS="-DINET6 $CFLAGS"]) | ||
2961 | 298 | ;; | ||
2962 | 299 | v6d) | ||
2963 | 300 | AC_EGREP_CPP(yes, | ||
2964 | 301 | [#include </usr/local/v6/include/sys/v6config.h> | ||
2965 | 302 | #ifdef __V6D__ | ||
2966 | 303 | yes | ||
2967 | 304 | #endif], | ||
2968 | 305 | [ipv6type=$i; | ||
2969 | 306 | ipv6lib=v6; | ||
2970 | 307 | ipv6libdir=/usr/local/v6/lib; | ||
2971 | 308 | CFLAGS="-I/usr/local/v6/include $CFLAGS"]) | ||
2972 | 309 | ;; | ||
2973 | 310 | zeta) | ||
2974 | 311 | AC_EGREP_CPP(yes, | ||
2975 | 312 | [#include <sys/param.h> | ||
2976 | 313 | #ifdef _ZETA_MINAMI_INET6 | ||
2977 | 314 | yes | ||
2978 | 315 | #endif], | ||
2979 | 316 | [ipv6type=$i; | ||
2980 | 317 | ipv6lib=inet6; | ||
2981 | 318 | ipv6libdir=/usr/local/v6/lib; | ||
2982 | 319 | CFLAGS="-DINET6 $CFLAGS"]) | ||
2983 | 320 | ;; | ||
2984 | 321 | esac | ||
2985 | 322 | if test "$ipv6type" != "unknown"; then | ||
2986 | 323 | break | ||
2987 | 324 | fi | ||
2988 | 325 | done | ||
2989 | 326 | AC_MSG_RESULT($ipv6type) | ||
2990 | 327 | fi | ||
2991 | 328 | |||
2992 | 329 | if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then | ||
2993 | 330 | if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then | ||
2994 | 331 | LIBS="-L$ipv6libdir -l$ipv6lib $LIBS" | ||
2995 | 332 | echo "You have $ipv6lib library, using it" | ||
2996 | 333 | else | ||
2997 | 334 | if test "$ipv6trylibc" = "yes"; then | ||
2998 | 335 | echo "You do not have $ipv6lib library, using libc" | ||
2999 | 336 | else | ||
3000 | 337 | echo 'Fatal: no $ipv6lib library found. cannot continue.' | ||
3001 | 338 | echo "You need to fetch lib$ipv6lib.a from appropriate" | ||
3002 | 339 | echo 'ipv6 kit and compile beforehand.' | ||
3003 | 340 | exit 1 | ||
3004 | 341 | fi | ||
3005 | 342 | fi | ||
3006 | 343 | fi | ||
3007 | 344 | |||
3008 | 345 | |||
3009 | 346 | if test "$ipv6" = "yes"; then | ||
3010 | 347 | # | ||
3011 | 348 | # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()" | ||
3012 | 349 | # function in libc; there are "ngetaddrinfo()" and | ||
3013 | 350 | # "ogetaddrinfo()" functions, and <netdb.h> #defines | ||
3014 | 351 | # "getaddrinfo" to be either "ngetaddrinfo" or | ||
3015 | 352 | # "ogetaddrinfo", depending on whether _SOCKADDR_LEN | ||
3016 | 353 | # or _XOPEN_SOURCE_EXTENDED are defined or not. | ||
3017 | 354 | # | ||
3018 | 355 | # So this test doesn't work on Tru64 5.1, and possibly | ||
3019 | 356 | # on other 5.x releases. This causes the configure | ||
3020 | 357 | # script to become confused, and results in libpcap | ||
3021 | 358 | # being unbuildable. | ||
3022 | 359 | # | ||
3023 | 360 | AC_SEARCH_LIBS(getaddrinfo, socket, [dnl | ||
3024 | 361 | AC_MSG_CHECKING(getaddrinfo bug) | ||
3025 | 362 | AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([ | ||
3026 | 363 | #include <sys/types.h> | ||
3027 | 364 | #include <netdb.h> | ||
3028 | 365 | #include <string.h> | ||
3029 | 366 | #include <sys/socket.h> | ||
3030 | 367 | #include <netinet/in.h> | ||
3031 | 368 | |||
3032 | 369 | main() | ||
3033 | 370 | { | ||
3034 | 371 | int passive, gaierr, inet4 = 0, inet6 = 0; | ||
3035 | 372 | struct addrinfo hints, *ai, *aitop; | ||
3036 | 373 | char straddr[INET6_ADDRSTRLEN], strport[16]; | ||
3037 | 374 | |||
3038 | 375 | for (passive = 0; passive <= 1; passive++) { | ||
3039 | 376 | memset(&hints, 0, sizeof(hints)); | ||
3040 | 377 | hints.ai_family = AF_UNSPEC; | ||
3041 | 378 | hints.ai_flags = passive ? AI_PASSIVE : 0; | ||
3042 | 379 | hints.ai_socktype = SOCK_STREAM; | ||
3043 | 380 | hints.ai_protocol = IPPROTO_TCP; | ||
3044 | 381 | if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) { | ||
3045 | 382 | (void)gai_strerror(gaierr); | ||
3046 | 383 | goto bad; | ||
3047 | 384 | } | ||
3048 | 385 | for (ai = aitop; ai; ai = ai->ai_next) { | ||
3049 | 386 | if (ai->ai_addr == NULL || | ||
3050 | 387 | ai->ai_addrlen == 0 || | ||
3051 | 388 | getnameinfo(ai->ai_addr, ai->ai_addrlen, | ||
3052 | 389 | straddr, sizeof(straddr), strport, sizeof(strport), | ||
3053 | 390 | NI_NUMERICHOST|NI_NUMERICSERV) != 0) { | ||
3054 | 391 | goto bad; | ||
3055 | 392 | } | ||
3056 | 393 | switch (ai->ai_family) { | ||
3057 | 394 | case AF_INET: | ||
3058 | 395 | if (strcmp(strport, "54321") != 0) { | ||
3059 | 396 | goto bad; | ||
3060 | 397 | } | ||
3061 | 398 | if (passive) { | ||
3062 | 399 | if (strcmp(straddr, "0.0.0.0") != 0) { | ||
3063 | 400 | goto bad; | ||
3064 | 401 | } | ||
3065 | 402 | } else { | ||
3066 | 403 | if (strcmp(straddr, "127.0.0.1") != 0) { | ||
3067 | 404 | goto bad; | ||
3068 | 405 | } | ||
3069 | 406 | } | ||
3070 | 407 | inet4++; | ||
3071 | 408 | break; | ||
3072 | 409 | case AF_INET6: | ||
3073 | 410 | if (strcmp(strport, "54321") != 0) { | ||
3074 | 411 | goto bad; | ||
3075 | 412 | } | ||
3076 | 413 | if (passive) { | ||
3077 | 414 | if (strcmp(straddr, "::") != 0) { | ||
3078 | 415 | goto bad; | ||
3079 | 416 | } | ||
3080 | 417 | } else { | ||
3081 | 418 | if (strcmp(straddr, "::1") != 0) { | ||
3082 | 419 | goto bad; | ||
3083 | 420 | } | ||
3084 | 421 | } | ||
3085 | 422 | inet6++; | ||
3086 | 423 | break; | ||
3087 | 424 | case AF_UNSPEC: | ||
3088 | 425 | goto bad; | ||
3089 | 426 | break; | ||
3090 | 427 | #ifdef AF_UNIX | ||
3091 | 428 | case AF_UNIX: | ||
3092 | 429 | #else | ||
3093 | 430 | #ifdef AF_LOCAL | ||
3094 | 431 | case AF_LOCAL: | ||
3095 | 432 | #endif | ||
3096 | 433 | #endif | ||
3097 | 434 | default: | ||
3098 | 435 | /* another family support? */ | ||
3099 | 436 | break; | ||
3100 | 437 | } | ||
3101 | 438 | } | ||
3102 | 439 | } | ||
3103 | 440 | |||
3104 | 441 | /* supported family should be 2, unsupported family should be 0 */ | ||
3105 | 442 | if (!(inet4 == 0 || inet4 == 2)) | ||
3106 | 443 | goto bad; | ||
3107 | 444 | if (!(inet6 == 0 || inet6 == 2)) | ||
3108 | 445 | goto bad; | ||
3109 | 446 | |||
3110 | 447 | if (aitop) | ||
3111 | 448 | freeaddrinfo(aitop); | ||
3112 | 449 | exit(0); | ||
3113 | 450 | |||
3114 | 451 | bad: | ||
3115 | 452 | if (aitop) | ||
3116 | 453 | freeaddrinfo(aitop); | ||
3117 | 454 | exit(1); | ||
3118 | 455 | } | ||
3119 | 456 | ], | ||
3120 | 457 | td_cv_buggygetaddrinfo=no, | ||
3121 | 458 | td_cv_buggygetaddrinfo=yes, | ||
3122 | 459 | td_cv_buggygetaddrinfo=yes)]) | ||
3123 | 460 | if test "$td_cv_buggygetaddrinfo" = no; then | ||
3124 | 461 | AC_MSG_RESULT(good) | ||
3125 | 462 | else | ||
3126 | 463 | AC_MSG_RESULT(buggy) | ||
3127 | 464 | fi | ||
3128 | 465 | |||
3129 | 466 | if test "$td_cv_buggygetaddrinfo" = "yes"; then | ||
3130 | 467 | # | ||
3131 | 468 | # XXX - it doesn't appear that "ipv6type" can ever be | ||
3132 | 469 | # set to "linux". Should this be testing for | ||
3133 | 470 | # "linux-glibc", or for that *or* "linux-libinet6"? | ||
3134 | 471 | # If the latter, note that "linux-libinet6" is also | ||
3135 | 472 | # the type given to some non-Linux OSes. | ||
3136 | 473 | # | ||
3137 | 474 | if test "$ipv6type" != "linux"; then | ||
3138 | 475 | echo 'Fatal: You must get working getaddrinfo() function.' | ||
3139 | 476 | echo ' or you can specify "--disable-ipv6"'. | ||
3140 | 477 | exit 1 | ||
3141 | 478 | else | ||
3142 | 479 | echo 'Warning: getaddrinfo() implementation on your system seems be buggy.' | ||
3143 | 480 | echo ' Better upgrade your system library to newest version' | ||
3144 | 481 | echo ' of GNU C library (aka glibc).' | ||
3145 | 482 | fi | ||
3146 | 483 | fi | ||
3147 | 484 | ]) | ||
3148 | 485 | AC_REPLACE_FUNCS(getnameinfo) | ||
3149 | 486 | fi | ||
3150 | 487 | |||
3151 | 488 | AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h], | ||
3152 | 489 | [td_cv_decl_netdnet_dnetdb_h_dnet_htoa], | ||
3153 | 490 | [AC_EGREP_HEADER(dnet_htoa, netdnet/dnetdb.h, | ||
3154 | 491 | td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes, | ||
3155 | 492 | td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)]) | ||
3156 | 493 | if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then | ||
3157 | 494 | AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA) | ||
3158 | 495 | fi | ||
3159 | 496 | |||
3160 | 497 | dnl | ||
3161 | 498 | dnl Checks for addrinfo structure | ||
3162 | 499 | AC_STRUCT_ADDRINFO(ac_cv_addrinfo) | ||
3163 | 500 | if test "$ac_cv_addrinfo" = no; then | ||
3164 | 501 | missing_includes=yes | ||
3165 | 502 | fi | ||
3166 | 503 | |||
3167 | 504 | dnl | ||
3168 | 505 | dnl Checks for NI_MAXSERV | ||
3169 | 506 | AC_NI_MAXSERV(ac_cv_maxserv) | ||
3170 | 507 | if test "$ac_cv_maxserv" = no; then | ||
3171 | 508 | missing_includes=yes | ||
3172 | 509 | fi | ||
3173 | 510 | |||
3174 | 511 | dnl | ||
3175 | 512 | dnl Checks for NI_NAMEREQD | ||
3176 | 513 | AC_NI_NAMEREQD(ac_cv_namereqd) | ||
3177 | 514 | if test "$ac_cv_namereqd" = no; then | ||
3178 | 515 | missing_includes=yes | ||
3179 | 516 | fi | ||
3180 | 517 | |||
3181 | 518 | dnl | ||
3182 | 519 | dnl Checks for sockaddr_storage structure | ||
3183 | 520 | AC_STRUCT_SA_STORAGE(ac_cv_sa_storage) | ||
3184 | 521 | if test "$ac_cv_sa_storage" = no; then | ||
3185 | 522 | missing_includes=yes | ||
3186 | 523 | fi | ||
3187 | 524 | |||
3188 | 525 | AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep) | ||
3189 | 526 | AC_CHECK_FUNCS(fork vfork strftime) | ||
3190 | 527 | AC_CHECK_FUNCS(setlinebuf alarm) | ||
3191 | 528 | |||
3192 | 529 | needsnprintf=no | ||
3193 | 530 | AC_CHECK_FUNCS(vsnprintf snprintf,, | ||
3194 | 531 | [needsnprintf=yes]) | ||
3195 | 532 | if test $needsnprintf = yes; then | ||
3196 | 533 | AC_LIBOBJ(snprintf) | ||
3197 | 534 | fi | ||
3198 | 535 | |||
3199 | 536 | AC_LBL_TYPE_SIGNAL | ||
3200 | 537 | |||
3201 | 538 | AC_SEARCH_LIBS(dnet_htoa, dnet, AC_DEFINE(HAVE_DNET_HTOA)) | ||
3202 | 539 | |||
3203 | 540 | AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc | ||
3204 | 541 | |||
3205 | 542 | dnl Some platforms may need -lnsl for getrpcbynumber. | ||
3206 | 543 | AC_SEARCH_LIBS(getrpcbynumber, nsl, AC_DEFINE(HAVE_GETRPCBYNUMBER)) | ||
3207 | 544 | |||
3208 | 545 | dnl AC_CHECK_LIB(z, uncompress) | ||
3209 | 546 | dnl AC_CHECK_HEADERS(zlib.h) | ||
3210 | 547 | |||
3211 | 548 | AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS) | ||
3212 | 549 | |||
3213 | 550 | # | ||
3214 | 551 | # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate | ||
3215 | 552 | # libraries (e.g., "-lsocket -lnsl" on Solaris). | ||
3216 | 553 | # | ||
3217 | 554 | # We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which | ||
3218 | 555 | # use AC_CHECK_FUNC which doesn't let us specify the right #includes | ||
3219 | 556 | # to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8 | ||
3220 | 557 | # resolver, and the way it defines inet_{ntop,pton} is rather strange; | ||
3221 | 558 | # it does not ship with a libc symbol "inet_ntop()", it ships with | ||
3222 | 559 | # "_inet_ntop()", and has a #define macro in one of the system headers | ||
3223 | 560 | # to rename it. | ||
3224 | 561 | # | ||
3225 | 562 | dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton) | ||
3226 | 563 | AC_MSG_CHECKING(for inet_ntop) | ||
3227 | 564 | AC_TRY_LINK([#include <sys/types.h> | ||
3228 | 565 | #include <sys/socket.h> | ||
3229 | 566 | #include <netinet/in.h> | ||
3230 | 567 | #include <arpa/inet.h>], [char src[4], dst[128]; | ||
3231 | 568 | inet_ntop(AF_INET, src, dst, sizeof(dst));], | ||
3232 | 569 | [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) | ||
3233 | 570 | AC_LIBOBJ(inet_ntop)]) | ||
3234 | 571 | AC_MSG_CHECKING(for inet_pton) | ||
3235 | 572 | AC_TRY_LINK([#include <sys/types.h> | ||
3236 | 573 | #include <sys/socket.h> | ||
3237 | 574 | #include <netinet/in.h> | ||
3238 | 575 | #include <arpa/inet.h>], [char src[128], dst[4]; | ||
3239 | 576 | inet_pton(AF_INET, src, dst);], | ||
3240 | 577 | [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) | ||
3241 | 578 | AC_LIBOBJ(inet_pton)]) | ||
3242 | 579 | AC_MSG_CHECKING(for inet_aton) | ||
3243 | 580 | AC_TRY_LINK([#include <sys/types.h> | ||
3244 | 581 | #include <netinet/in.h> | ||
3245 | 582 | #include <arpa/inet.h>], [char src[128]; | ||
3246 | 583 | struct in_addr dst; | ||
3247 | 584 | inet_aton(src, &dst);], | ||
3248 | 585 | [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) | ||
3249 | 586 | AC_LIBOBJ(inet_aton)]) | ||
3250 | 587 | |||
3251 | 588 | # | ||
3252 | 589 | # Check for these after AC_LBL_LIBPCAP, for the same reason. | ||
3253 | 590 | # | ||
3254 | 591 | # You are in a twisty little maze of UN*Xes, all different. | ||
3255 | 592 | # Some might not have ether_ntohost(). | ||
3256 | 593 | # Some might have it, but not declare it in any header file. | ||
3257 | 594 | # Some might have it, but declare it in <netinet/if_ether.h>. | ||
3258 | 595 | # Some might have it, but declare it in <netinet/ether.h> | ||
3259 | 596 | # (And some might have it but document it as something declared in | ||
3260 | 597 | # <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.) | ||
3261 | 598 | # | ||
3262 | 599 | # Before you is a C compiler. | ||
3263 | 600 | # | ||
3264 | 601 | AC_CHECK_FUNCS(ether_ntohost, [ | ||
3265 | 602 | AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [ | ||
3266 | 603 | AC_TRY_RUN([ | ||
3267 | 604 | #include <netdb.h> | ||
3268 | 605 | #include <sys/types.h> | ||
3269 | 606 | #include <sys/param.h> | ||
3270 | 607 | #include <sys/socket.h> | ||
3271 | 608 | |||
3272 | 609 | int | ||
3273 | 610 | main(int argc, char **argv) | ||
3274 | 611 | { | ||
3275 | 612 | u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff }; | ||
3276 | 613 | char name[MAXHOSTNAMELEN]; | ||
3277 | 614 | |||
3278 | 615 | ether_ntohost(name, (struct ether_addr *)ea); | ||
3279 | 616 | exit(0); | ||
3280 | 617 | } | ||
3281 | 618 | ], [ac_cv_buggy_ether_ntohost=no], | ||
3282 | 619 | [ac_cv_buggy_ether_ntohost=yes], | ||
3283 | 620 | [ac_cv_buggy_ether_ntohost="not while cross-compiling"])]) | ||
3284 | 621 | if test "$ac_cv_buggy_ether_ntohost" = "no"; then | ||
3285 | 622 | AC_DEFINE(USE_ETHER_NTOHOST) | ||
3286 | 623 | fi | ||
3287 | 624 | ]) | ||
3288 | 625 | if test "$ac_cv_func_ether_ntohost" = yes -a \ | ||
3289 | 626 | "$ac_cv_buggy_ether_ntohost" = "no"; then | ||
3290 | 627 | # | ||
3291 | 628 | # OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>? | ||
3292 | 629 | # | ||
3293 | 630 | if test "$ac_cv_header_netinet_if_ether_h" = yes; then | ||
3294 | 631 | # | ||
3295 | 632 | # Yes. Does it declare ether_ntohost()? | ||
3296 | 633 | # | ||
3297 | 634 | AC_CHECK_DECL(ether_ntohost, | ||
3298 | 635 | [ | ||
3299 | 636 | AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,, | ||
3300 | 637 | [Define to 1 if netinet/if_ether.h declares `ether_ntohost']) | ||
3301 | 638 | ],, | ||
3302 | 639 | [ | ||
3303 | 640 | #include <sys/types.h> | ||
3304 | 641 | #include <sys/socket.h> | ||
3305 | 642 | #include <netinet/in.h> | ||
3306 | 643 | #include <arpa/inet.h> | ||
3307 | 644 | struct mbuf; | ||
3308 | 645 | struct rtentry; | ||
3309 | 646 | #include <net/if.h> | ||
3310 | 647 | #include <netinet/if_ether.h> | ||
3311 | 648 | ]) | ||
3312 | 649 | fi | ||
3313 | 650 | # | ||
3314 | 651 | # Did that succeed? | ||
3315 | 652 | # | ||
3316 | 653 | if test "$ac_cv_have_decl_ether_ntohost" != yes; then | ||
3317 | 654 | # | ||
3318 | 655 | # No, how about <netinet/ether.h>, as on Linux? | ||
3319 | 656 | # | ||
3320 | 657 | AC_CHECK_HEADERS(netinet/ether.h) | ||
3321 | 658 | if test "$ac_cv_header_netinet_ether_h" = yes; then | ||
3322 | 659 | # | ||
3323 | 660 | # We have it - does it declare ether_ntohost()? | ||
3324 | 661 | # Unset ac_cv_have_decl_ether_ntohost so we don't | ||
3325 | 662 | # treat the previous failure as a cached value and | ||
3326 | 663 | # suppress the next test. | ||
3327 | 664 | # | ||
3328 | 665 | unset ac_cv_have_decl_ether_ntohost | ||
3329 | 666 | AC_CHECK_DECL(ether_ntohost, | ||
3330 | 667 | [ | ||
3331 | 668 | AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,, | ||
3332 | 669 | [Define to 1 if netinet/ether.h declares `ether_ntohost']) | ||
3333 | 670 | ],, | ||
3334 | 671 | [ | ||
3335 | 672 | #include <netinet/ether.h> | ||
3336 | 673 | ]) | ||
3337 | 674 | fi | ||
3338 | 675 | fi | ||
3339 | 676 | # | ||
3340 | 677 | # Is ether_ntohost() declared? | ||
3341 | 678 | # | ||
3342 | 679 | if test "$ac_cv_have_decl_ether_ntohost" != yes; then | ||
3343 | 680 | # | ||
3344 | 681 | # No, we'll have to declare it ourselves. | ||
3345 | 682 | # Do we have "struct ether_addr"? | ||
3346 | 683 | # | ||
3347 | 684 | AC_CHECK_TYPES(struct ether_addr,,, | ||
3348 | 685 | [ | ||
3349 | 686 | #include <sys/types.h> | ||
3350 | 687 | #include <sys/socket.h> | ||
3351 | 688 | #include <netinet/in.h> | ||
3352 | 689 | #include <arpa/inet.h> | ||
3353 | 690 | struct mbuf; | ||
3354 | 691 | struct rtentry; | ||
3355 | 692 | #include <net/if.h> | ||
3356 | 693 | #include <netinet/if_ether.h> | ||
3357 | 694 | ]) | ||
3358 | 695 | AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 0, | ||
3359 | 696 | [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you | ||
3360 | 697 | don't.]) | ||
3361 | 698 | else | ||
3362 | 699 | AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1, | ||
3363 | 700 | [Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you | ||
3364 | 701 | don't.]) | ||
3365 | 702 | fi | ||
3366 | 703 | fi | ||
3367 | 704 | |||
3368 | 705 | # libdlpi is needed for Solaris 11 and later. | ||
3369 | 706 | AC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS", ,-L/lib) | ||
3370 | 707 | |||
3371 | 708 | dnl portability macros for getaddrinfo/getnameinfo | ||
3372 | 709 | dnl | ||
3373 | 710 | dnl Check for sa_len | ||
3374 | 711 | AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len) | ||
3375 | 712 | if test "$ac_cv_sockaddr_has_sa_len" = no; then | ||
3376 | 713 | missing_includes=yes | ||
3377 | 714 | fi | ||
3378 | 715 | |||
3379 | 716 | # | ||
3380 | 717 | # Do we have the new open API? Check for pcap_create, and assume that, | ||
3381 | 718 | # if we do, we also have pcap_activate() and the other new routines | ||
3382 | 719 | # introduced in libpcap 1.0.0. | ||
3383 | 720 | # | ||
3384 | 721 | AC_CHECK_FUNCS(pcap_create) | ||
3385 | 722 | if test $ac_cv_func_pcap_create = "yes" ; then | ||
3386 | 723 | # | ||
3387 | 724 | # OK, do we have pcap_set_tstamp_type? If so, assume we have | ||
3388 | 725 | # pcap_list_tstamp_types and pcap_free_tstamp_types as well. | ||
3389 | 726 | # | ||
3390 | 727 | AC_CHECK_FUNCS(pcap_set_tstamp_type) | ||
3391 | 728 | fi | ||
3392 | 729 | |||
3393 | 730 | AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version) | ||
3394 | 731 | if test $ac_cv_func_pcap_findalldevs = "yes" ; then | ||
3395 | 732 | dnl Check for Mac OS X, which may ship pcap.h from 0.6 but libpcap may | ||
3396 | 733 | dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't | ||
3397 | 734 | dnl have pcap_if_t. | ||
3398 | 735 | savedppflags="$CPPLAGS" | ||
3399 | 736 | CPPFLAGS="$CPPFLAGS $V_INCLS" | ||
3400 | 737 | AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>]) | ||
3401 | 738 | CPPFLAGS="$savedcppflags" | ||
3402 | 739 | fi | ||
3403 | 740 | |||
3404 | 741 | if test $ac_cv_func_pcap_lib_version = "no" ; then | ||
3405 | 742 | AC_MSG_CHECKING(whether pcap_version is defined by libpcap) | ||
3406 | 743 | AC_TRY_LINK([], | ||
3407 | 744 | [ | ||
3408 | 745 | extern char pcap_version[]; | ||
3409 | 746 | |||
3410 | 747 | return (int)pcap_version; | ||
3411 | 748 | ], | ||
3412 | 749 | ac_lbl_cv_pcap_version_defined=yes, | ||
3413 | 750 | ac_lbl_cv_pcap_version_defined=no) | ||
3414 | 751 | if test "$ac_lbl_cv_pcap_version_defined" = yes ; then | ||
3415 | 752 | AC_MSG_RESULT(yes) | ||
3416 | 753 | AC_DEFINE(HAVE_PCAP_VERSION) | ||
3417 | 754 | else | ||
3418 | 755 | AC_MSG_RESULT(no) | ||
3419 | 756 | fi | ||
3420 | 757 | fi | ||
3421 | 758 | AC_MSG_CHECKING(whether pcap_debug is defined by libpcap) | ||
3422 | 759 | AC_TRY_LINK([], | ||
3423 | 760 | [ | ||
3424 | 761 | extern int pcap_debug; | ||
3425 | 762 | |||
3426 | 763 | return pcap_debug; | ||
3427 | 764 | ], | ||
3428 | 765 | ac_lbl_cv_pcap_debug_defined=yes, | ||
3429 | 766 | ac_lbl_cv_pcap_debug_defined=no) | ||
3430 | 767 | if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then | ||
3431 | 768 | AC_MSG_RESULT(yes) | ||
3432 | 769 | AC_DEFINE(HAVE_PCAP_DEBUG) | ||
3433 | 770 | else | ||
3434 | 771 | AC_MSG_RESULT(no) | ||
3435 | 772 | # | ||
3436 | 773 | # OK, what about "yydebug"? | ||
3437 | 774 | # | ||
3438 | 775 | AC_MSG_CHECKING(whether yydebug is defined by libpcap) | ||
3439 | 776 | AC_TRY_LINK([], | ||
3440 | 777 | [ | ||
3441 | 778 | extern int yydebug; | ||
3442 | 779 | |||
3443 | 780 | return yydebug; | ||
3444 | 781 | ], | ||
3445 | 782 | ac_lbl_cv_yydebug_defined=yes, | ||
3446 | 783 | ac_lbl_cv_yydebug_defined=no) | ||
3447 | 784 | if test "$ac_lbl_cv_yydebug_defined" = yes ; then | ||
3448 | 785 | AC_MSG_RESULT(yes) | ||
3449 | 786 | AC_DEFINE(HAVE_YYDEBUG) | ||
3450 | 787 | else | ||
3451 | 788 | AC_MSG_RESULT(no) | ||
3452 | 789 | fi | ||
3453 | 790 | fi | ||
3454 | 791 | AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6 | ||
3455 | 792 | |||
3456 | 793 | V_GROUP=0 | ||
3457 | 794 | if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then | ||
3458 | 795 | V_GROUP=wheel | ||
3459 | 796 | fi | ||
3460 | 797 | # | ||
3461 | 798 | # Assume V7/BSD convention for man pages (file formats in section 5, | ||
3462 | 799 | # miscellaneous info in section 7). | ||
3463 | 800 | # | ||
3464 | 801 | MAN_FILE_FORMATS=5 | ||
3465 | 802 | MAN_MISC_INFO=7 | ||
3466 | 803 | case "$host_os" in | ||
3467 | 804 | |||
3468 | 805 | aix*) | ||
3469 | 806 | dnl Workaround to enable certain features | ||
3470 | 807 | AC_DEFINE(_SUN,1,[define on AIX to get certain functions]) | ||
3471 | 808 | ;; | ||
3472 | 809 | |||
3473 | 810 | hpux*) | ||
3474 | 811 | # | ||
3475 | 812 | # Use System V conventions for man pages. | ||
3476 | 813 | # | ||
3477 | 814 | MAN_FILE_FORMATS=4 | ||
3478 | 815 | MAN_MISC_INFO=5 | ||
3479 | 816 | ;; | ||
3480 | 817 | |||
3481 | 818 | irix*) | ||
3482 | 819 | V_GROUP=sys | ||
3483 | 820 | |||
3484 | 821 | # | ||
3485 | 822 | # Use System V conventions for man pages. | ||
3486 | 823 | # | ||
3487 | 824 | MAN_FILE_FORMATS=4 | ||
3488 | 825 | MAN_MISC_INFO=5 | ||
3489 | 826 | ;; | ||
3490 | 827 | |||
3491 | 828 | osf*) | ||
3492 | 829 | V_GROUP=system | ||
3493 | 830 | |||
3494 | 831 | # | ||
3495 | 832 | # Use System V conventions for man pages. | ||
3496 | 833 | # | ||
3497 | 834 | MAN_FILE_FORMATS=4 | ||
3498 | 835 | MAN_MISC_INFO=5 | ||
3499 | 836 | ;; | ||
3500 | 837 | |||
3501 | 838 | solaris*) | ||
3502 | 839 | V_GROUP=sys | ||
3503 | 840 | |||
3504 | 841 | # | ||
3505 | 842 | # Use System V conventions for man pages. | ||
3506 | 843 | # | ||
3507 | 844 | MAN_FILE_FORMATS=4 | ||
3508 | 845 | MAN_MISC_INFO=5 | ||
3509 | 846 | ;; | ||
3510 | 847 | esac | ||
3511 | 848 | |||
3512 | 849 | if test -f /dev/bpf0 ; then | ||
3513 | 850 | V_GROUP=bpf | ||
3514 | 851 | fi | ||
3515 | 852 | |||
3516 | 853 | AC_CHECK_HEADERS(sys/bitypes.h) | ||
3517 | 854 | |||
3518 | 855 | AC_CHECK_TYPE([int8_t], , | ||
3519 | 856 | [AC_DEFINE([int8_t], [signed char], | ||
3520 | 857 | [Define to `signed char' if int8_t not defined.])], | ||
3521 | 858 | [AC_INCLUDES_DEFAULT | ||
3522 | 859 | #ifdef HAVE_SYS_BITYPES_H | ||
3523 | 860 | #include <sys/bitypes.h> | ||
3524 | 861 | #endif]) | ||
3525 | 862 | AC_CHECK_TYPE([u_int8_t], , | ||
3526 | 863 | [AC_DEFINE([u_int8_t], [unsigned char], | ||
3527 | 864 | [Define to `unsigned char' if u_int8_t not defined.])], | ||
3528 | 865 | [AC_INCLUDES_DEFAULT | ||
3529 | 866 | #ifdef HAVE_SYS_BITYPES_H | ||
3530 | 867 | #include <sys/bitypes.h> | ||
3531 | 868 | #endif]) | ||
3532 | 869 | AC_CHECK_TYPE([int16_t], , | ||
3533 | 870 | [AC_DEFINE([int16_t], [short], | ||
3534 | 871 | [Define to `short' if int16_t not defined.])] | ||
3535 | 872 | [AC_INCLUDES_DEFAULT | ||
3536 | 873 | #ifdef HAVE_SYS_BITYPES_H | ||
3537 | 874 | #include <sys/bitypes.h> | ||
3538 | 875 | #endif]) | ||
3539 | 876 | AC_CHECK_TYPE([u_int16_t], , | ||
3540 | 877 | [AC_DEFINE([u_int16_t], [unsigned short], | ||
3541 | 878 | [Define to `unsigned short' if u_int16_t not defined.])], | ||
3542 | 879 | [AC_INCLUDES_DEFAULT | ||
3543 | 880 | #ifdef HAVE_SYS_BITYPES_H | ||
3544 | 881 | #include <sys/bitypes.h> | ||
3545 | 882 | #endif]) | ||
3546 | 883 | AC_CHECK_TYPE([int32_t], , | ||
3547 | 884 | [AC_DEFINE([int32_t], [int], | ||
3548 | 885 | [Define to `int' if int32_t not defined.])], | ||
3549 | 886 | [AC_INCLUDES_DEFAULT | ||
3550 | 887 | #ifdef HAVE_SYS_BITYPES_H | ||
3551 | 888 | #include <sys/bitypes.h> | ||
3552 | 889 | #endif]) | ||
3553 | 890 | AC_CHECK_TYPE([u_int32_t], , | ||
3554 | 891 | [AC_DEFINE([u_int32_t], [unsigned int], | ||
3555 | 892 | [Define to `unsigned int' if u_int32_t not defined.])], | ||
3556 | 893 | [AC_INCLUDES_DEFAULT | ||
3557 | 894 | #ifdef HAVE_SYS_BITYPES_H | ||
3558 | 895 | #include <sys/bitypes.h> | ||
3559 | 896 | #endif]) | ||
3560 | 897 | AC_CHECK_TYPE([int64_t], , | ||
3561 | 898 | [AC_DEFINE([int64_t], [long long], | ||
3562 | 899 | [Define to `long long' if int64_t not defined.])], | ||
3563 | 900 | [AC_INCLUDES_DEFAULT | ||
3564 | 901 | #ifdef HAVE_SYS_BITYPES_H | ||
3565 | 902 | #include <sys/bitypes.h> | ||
3566 | 903 | #endif]) | ||
3567 | 904 | AC_CHECK_TYPE([u_int64_t], , | ||
3568 | 905 | [AC_DEFINE([u_int64_t], [unsigned long long], | ||
3569 | 906 | [Define to `unsigned long long' if u_int64_t not defined.])], | ||
3570 | 907 | [AC_INCLUDES_DEFAULT | ||
3571 | 908 | #ifdef HAVE_SYS_BITYPES_H | ||
3572 | 909 | #include <sys/bitypes.h> | ||
3573 | 910 | #endif]) | ||
3574 | 911 | |||
3575 | 912 | # | ||
3576 | 913 | # We can't just check for <inttypes.h> - some systems have one that | ||
3577 | 914 | # doesn't define all the PRI[doxu]64 macros. | ||
3578 | 915 | # | ||
3579 | 916 | AC_CHECK_HEADERS(inttypes.h, | ||
3580 | 917 | [ | ||
3581 | 918 | # | ||
3582 | 919 | # OK, we have inttypes.h, but does it define those macros? | ||
3583 | 920 | # | ||
3584 | 921 | AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]]) | ||
3585 | 922 | AC_COMPILE_IFELSE( | ||
3586 | 923 | [ | ||
3587 | 924 | AC_LANG_SOURCE( | ||
3588 | 925 | [[ | ||
3589 | 926 | #include <inttypes.h> | ||
3590 | 927 | #include <stdio.h> | ||
3591 | 928 | #include <sys/types.h> | ||
3592 | 929 | #ifdef HAVE_SYS_BITYPES_H | ||
3593 | 930 | #include <sys/bitypes.h> | ||
3594 | 931 | #endif | ||
3595 | 932 | |||
3596 | 933 | main() | ||
3597 | 934 | { | ||
3598 | 935 | printf("%" PRId64 "\n", (u_int64_t)1); | ||
3599 | 936 | printf("%" PRIo64 "\n", (u_int64_t)1); | ||
3600 | 937 | printf("%" PRIx64 "\n", (u_int64_t)1); | ||
3601 | 938 | printf("%" PRIu64 "\n", (u_int64_t)1); | ||
3602 | 939 | } | ||
3603 | 940 | ]]) | ||
3604 | 941 | ], | ||
3605 | 942 | [ | ||
3606 | 943 | AC_MSG_RESULT(yes) | ||
3607 | 944 | ac_lbl_inttypes_h_defines_formats=yes | ||
3608 | 945 | ], | ||
3609 | 946 | [ | ||
3610 | 947 | AC_MSG_RESULT(no) | ||
3611 | 948 | ac_lbl_inttypes_h_defines_formats=no | ||
3612 | 949 | ]) | ||
3613 | 950 | ], | ||
3614 | 951 | [ | ||
3615 | 952 | # | ||
3616 | 953 | # We don't have inttypes.h, so it obviously can't define those | ||
3617 | 954 | # macros. | ||
3618 | 955 | # | ||
3619 | 956 | ac_lbl_inttypes_h_defines_formats=no | ||
3620 | 957 | ]) | ||
3621 | 958 | if test "$ac_lbl_inttypes_h_defines_formats" = no; then | ||
3622 | 959 | AC_LBL_CHECK_64BIT_FORMAT(l, | ||
3623 | 960 | [ | ||
3624 | 961 | AC_LBL_CHECK_64BIT_FORMAT(ll, | ||
3625 | 962 | [ | ||
3626 | 963 | AC_LBL_CHECK_64BIT_FORMAT(L, | ||
3627 | 964 | [ | ||
3628 | 965 | AC_LBL_CHECK_64BIT_FORMAT(q, | ||
3629 | 966 | [ | ||
3630 | 967 | AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer]) | ||
3631 | 968 | ]) | ||
3632 | 969 | ]) | ||
3633 | 970 | ]) | ||
3634 | 971 | ]) | ||
3635 | 972 | fi | ||
3636 | 973 | |||
3637 | 974 | # | ||
3638 | 975 | # Check for some headers introduced in later versions of libpcap | ||
3639 | 976 | # and used by some printers. | ||
3640 | 977 | # | ||
3641 | 978 | # Those headers use the {u_}intN_t types, so we must do this after | ||
3642 | 979 | # we check for what's needed to get them defined. | ||
3643 | 980 | # | ||
3644 | 981 | savedcppflags="$CPPFLAGS" | ||
3645 | 982 | CPPFLAGS="$CPPFLAGS $V_INCLS" | ||
3646 | 983 | AC_CHECK_HEADERS(pcap/bluetooth.h,,,[#include <tcpdump-stdinc.h>]) | ||
3647 | 984 | AC_CHECK_HEADERS(pcap/usb.h,,,[#include <tcpdump-stdinc.h>]) | ||
3648 | 985 | CPPFLAGS="$savedcppflags" | ||
3649 | 986 | |||
3650 | 987 | AC_PROG_RANLIB | ||
3651 | 988 | |||
3652 | 989 | AC_LBL_DEVEL(V_CCOPT) | ||
3653 | 990 | |||
3654 | 991 | AC_LBL_SOCKADDR_SA_LEN | ||
3655 | 992 | |||
3656 | 993 | AC_LBL_UNALIGNED_ACCESS | ||
3657 | 994 | |||
3658 | 995 | AC_VAR_H_ERRNO | ||
3659 | 996 | |||
3660 | 997 | # Check for SSLeay | ||
3661 | 998 | AC_MSG_CHECKING(whether to use SSLeay libcrypto) | ||
3662 | 999 | # Specify location for both includes and libraries. | ||
3663 | 1000 | want_libcrypto=youmama | ||
3664 | 1001 | AC_ARG_WITH(crypto, | ||
3665 | 1002 | AS_HELP_STRING([--with-crypto@<:@=PATH@:>@], | ||
3666 | 1003 | [use SSLeay libcrypto (located in directory PATH, if supplied). @<:@default=yes, if available@:>@]), | ||
3667 | 1004 | [ | ||
3668 | 1005 | if test $withval = no | ||
3669 | 1006 | then | ||
3670 | 1007 | want_libcrypto=no | ||
3671 | 1008 | AC_MSG_RESULT(no) | ||
3672 | 1009 | elif test $withval = yes | ||
3673 | 1010 | then | ||
3674 | 1011 | want_libcrypto=yes | ||
3675 | 1012 | AC_MSG_RESULT(yes) | ||
3676 | 1013 | else | ||
3677 | 1014 | want_libcrypto=yes | ||
3678 | 1015 | AC_MSG_RESULT(yes) | ||
3679 | 1016 | crypto_dir=$withval | ||
3680 | 1017 | fi | ||
3681 | 1018 | ],[ | ||
3682 | 1019 | # | ||
3683 | 1020 | # Use libcrypto if it's present, otherwise don't. | ||
3684 | 1021 | # | ||
3685 | 1022 | want_libcrypto=ifavailable | ||
3686 | 1023 | AC_MSG_RESULT([yes, if available]) | ||
3687 | 1024 | ]) | ||
3688 | 1025 | if test "$want_libcrypto" != "no"; then | ||
3689 | 1026 | ac_cv_ssleay_path=no | ||
3690 | 1027 | incdir=no | ||
3691 | 1028 | if test "x$crypto_dir" = x; then | ||
3692 | 1029 | # | ||
3693 | 1030 | # Location not specified; check the default locations. | ||
3694 | 1031 | # | ||
3695 | 1032 | AC_MSG_CHECKING(where SSLeay is located) | ||
3696 | 1033 | dirs="/usr /usr/local /usr/local/ssl /usr/pkg" | ||
3697 | 1034 | if test "x${host_alias}" != x; then | ||
3698 | 1035 | dirs="/usr/${host_alias} $dirs" | ||
3699 | 1036 | fi | ||
3700 | 1037 | for dir in $dirs; do | ||
3701 | 1038 | AC_LBL_SSLEAY($dir) | ||
3702 | 1039 | |||
3703 | 1040 | if test "$ac_cv_ssleay_path" != "no" -a "$incdir" != "no"; then | ||
3704 | 1041 | break; | ||
3705 | 1042 | else | ||
3706 | 1043 | ac_cv_ssleay_path=no | ||
3707 | 1044 | incdir=no | ||
3708 | 1045 | fi | ||
3709 | 1046 | done | ||
3710 | 1047 | if test "$ac_cv_ssleay_path" != no; then | ||
3711 | 1048 | AC_MSG_RESULT($ac_cv_ssleay_path) | ||
3712 | 1049 | fi | ||
3713 | 1050 | else | ||
3714 | 1051 | AC_MSG_CHECKING(for SSLeay in $crypto_dir) | ||
3715 | 1052 | AC_LBL_SSLEAY($crypto_dir) | ||
3716 | 1053 | if test "$ac_cv_ssleay_path" != no; then | ||
3717 | 1054 | AC_MSG_RESULT(found) | ||
3718 | 1055 | fi | ||
3719 | 1056 | fi | ||
3720 | 1057 | if test "$ac_cv_ssleay_path" != no; then | ||
3721 | 1058 | V_INCLS="$V_INCLS $incdir" | ||
3722 | 1059 | if test "$dir" != "/usr"; then | ||
3723 | 1060 | LDFLAGS="-L$dir/lib $LDFLAGS" | ||
3724 | 1061 | fi | ||
3725 | 1062 | if test -f $ac_cv_ssleay_path/lib/libRSAglue.a; then | ||
3726 | 1063 | LIBS="$LIBS -lRSAglue" | ||
3727 | 1064 | fi | ||
3728 | 1065 | if test -f $ac_cv_ssleay_path/lib/librsaref.a; then | ||
3729 | 1066 | LIBS="$LIBS -lrsaref" | ||
3730 | 1067 | fi | ||
3731 | 1068 | AC_CHECK_LIB(crypto, DES_cbc_encrypt) | ||
3732 | 1069 | |||
3733 | 1070 | savedppflags="$CPPLAGS" | ||
3734 | 1071 | CPPFLAGS="$CPPFLAGS $V_INCLS" | ||
3735 | 1072 | AC_CHECK_HEADERS(openssl/evp.h) | ||
3736 | 1073 | CPPFLAGS="$savedcppflags" | ||
3737 | 1074 | else | ||
3738 | 1075 | # | ||
3739 | 1076 | # Not found. Did the user explicitly ask for it? | ||
3740 | 1077 | # | ||
3741 | 1078 | AC_MSG_RESULT(not found) | ||
3742 | 1079 | if test "$want_libcrypto" = yes; then | ||
3743 | 1080 | AC_MSG_ERROR(SSLeay not found) | ||
3744 | 1081 | fi | ||
3745 | 1082 | fi | ||
3746 | 1083 | fi | ||
3747 | 1084 | |||
3748 | 1085 | dnl | ||
3749 | 1086 | dnl set additional include path if necessary | ||
3750 | 1087 | if test "$missing_includes" = "yes"; then | ||
3751 | 1088 | CPPFLAGS="$CPPFLAGS -I$srcdir/missing" | ||
3752 | 1089 | V_INCLS="$V_INCLS -I$srcdir/missing" | ||
3753 | 1090 | fi | ||
3754 | 1091 | |||
3755 | 1092 | AC_SUBST(V_CCOPT) | ||
3756 | 1093 | AC_SUBST(V_DEFS) | ||
3757 | 1094 | AC_SUBST(V_GROUP) | ||
3758 | 1095 | AC_SUBST(V_INCLS) | ||
3759 | 1096 | AC_SUBST(V_PCAPDEP) | ||
3760 | 1097 | AC_SUBST(LOCALSRC) | ||
3761 | 1098 | AC_SUBST(MAN_FILE_FORMATS) | ||
3762 | 1099 | AC_SUBST(MAN_MISC_INFO) | ||
3763 | 1100 | |||
3764 | 1101 | AC_PROG_INSTALL | ||
3765 | 1102 | |||
3766 | 1103 | AC_CONFIG_HEADER(config.h) | ||
3767 | 1104 | |||
3768 | 1105 | AC_OUTPUT_COMMANDS([if test -f .devel; then | ||
3769 | 1106 | echo timestamp > stamp-h | ||
3770 | 1107 | cat Makefile-devel-adds >> Makefile | ||
3771 | 1108 | make depend | ||
3772 | 1109 | fi]) | ||
3773 | 1110 | AC_OUTPUT(Makefile tcpdump.1) | ||
3774 | 1111 | exit 0 | ||
3775 | 1112 | 0 | ||
3776 | === removed directory '.pc/50_autotools-dev.diff' | |||
3777 | === removed file '.pc/50_autotools-dev.diff/config.guess' | |||
3778 | --- .pc/50_autotools-dev.diff/config.guess 2010-06-22 12:44:32 +0000 | |||
3779 | +++ .pc/50_autotools-dev.diff/config.guess 1970-01-01 00:00:00 +0000 | |||
3780 | @@ -1,1502 +0,0 @@ | |||
3781 | 1 | #! /bin/sh | ||
3782 | 2 | # Attempt to guess a canonical system name. | ||
3783 | 3 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | ||
3784 | 4 | # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 | ||
3785 | 5 | # Free Software Foundation, Inc. | ||
3786 | 6 | |||
3787 | 7 | timestamp='2009-12-30' | ||
3788 | 8 | |||
3789 | 9 | # This file is free software; you can redistribute it and/or modify it | ||
3790 | 10 | # under the terms of the GNU General Public License as published by | ||
3791 | 11 | # the Free Software Foundation; either version 2 of the License, or | ||
3792 | 12 | # (at your option) any later version. | ||
3793 | 13 | # | ||
3794 | 14 | # This program is distributed in the hope that it will be useful, but | ||
3795 | 15 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3796 | 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
3797 | 17 | # General Public License for more details. | ||
3798 | 18 | # | ||
3799 | 19 | # You should have received a copy of the GNU General Public License | ||
3800 | 20 | # along with this program; if not, write to the Free Software | ||
3801 | 21 | # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA | ||
3802 | 22 | # 02110-1301, USA. | ||
3803 | 23 | # | ||
3804 | 24 | # As a special exception to the GNU General Public License, if you | ||
3805 | 25 | # distribute this file as part of a program that contains a | ||
3806 | 26 | # configuration script generated by Autoconf, you may include it under | ||
3807 | 27 | # the same distribution terms that you use for the rest of that program. | ||
3808 | 28 | |||
3809 | 29 | |||
3810 | 30 | # Originally written by Per Bothner. Please send patches (context | ||
3811 | 31 | # diff format) to <config-patches@gnu.org> and include a ChangeLog | ||
3812 | 32 | # entry. | ||
3813 | 33 | # | ||
3814 | 34 | # This script attempts to guess a canonical system name similar to | ||
3815 | 35 | # config.sub. If it succeeds, it prints the system name on stdout, and | ||
3816 | 36 | # exits with 0. Otherwise, it exits with 1. | ||
3817 | 37 | # | ||
3818 | 38 | # You can get the latest version of this script from: | ||
3819 | 39 | # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD | ||
3820 | 40 | |||
3821 | 41 | me=`echo "$0" | sed -e 's,.*/,,'` | ||
3822 | 42 | |||
3823 | 43 | usage="\ | ||
3824 | 44 | Usage: $0 [OPTION] | ||
3825 | 45 | |||
3826 | 46 | Output the configuration name of the system \`$me' is run on. | ||
3827 | 47 | |||
3828 | 48 | Operation modes: | ||
3829 | 49 | -h, --help print this help, then exit | ||
3830 | 50 | -t, --time-stamp print date of last modification, then exit | ||
3831 | 51 | -v, --version print version number, then exit | ||
3832 | 52 | |||
3833 | 53 | Report bugs and patches to <config-patches@gnu.org>." | ||
3834 | 54 | |||
3835 | 55 | version="\ | ||
3836 | 56 | GNU config.guess ($timestamp) | ||
3837 | 57 | |||
3838 | 58 | Originally written by Per Bothner. | ||
3839 | 59 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, | ||
3840 | 60 | 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free | ||
3841 | 61 | Software Foundation, Inc. | ||
3842 | 62 | |||
3843 | 63 | This is free software; see the source for copying conditions. There is NO | ||
3844 | 64 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." | ||
3845 | 65 | |||
3846 | 66 | help=" | ||
3847 | 67 | Try \`$me --help' for more information." | ||
3848 | 68 | |||
3849 | 69 | # Parse command line | ||
3850 | 70 | while test $# -gt 0 ; do | ||
3851 | 71 | case $1 in | ||
3852 | 72 | --time-stamp | --time* | -t ) | ||
3853 | 73 | echo "$timestamp" ; exit ;; | ||
3854 | 74 | --version | -v ) | ||
3855 | 75 | echo "$version" ; exit ;; | ||
3856 | 76 | --help | --h* | -h ) | ||
3857 | 77 | echo "$usage"; exit ;; | ||
3858 | 78 | -- ) # Stop option processing | ||
3859 | 79 | shift; break ;; | ||
3860 | 80 | - ) # Use stdin as input. | ||
3861 | 81 | break ;; | ||
3862 | 82 | -* ) | ||
3863 | 83 | echo "$me: invalid option $1$help" >&2 | ||
3864 | 84 | exit 1 ;; | ||
3865 | 85 | * ) | ||
3866 | 86 | break ;; | ||
3867 | 87 | esac | ||
3868 | 88 | done | ||
3869 | 89 | |||
3870 | 90 | if test $# != 0; then | ||
3871 | 91 | echo "$me: too many arguments$help" >&2 | ||
3872 | 92 | exit 1 | ||
3873 | 93 | fi | ||
3874 | 94 | |||
3875 | 95 | trap 'exit 1' 1 2 15 | ||
3876 | 96 | |||
3877 | 97 | # CC_FOR_BUILD -- compiler used by this script. Note that the use of a | ||
3878 | 98 | # compiler to aid in system detection is discouraged as it requires | ||
3879 | 99 | # temporary files to be created and, as you can see below, it is a | ||
3880 | 100 | # headache to deal with in a portable fashion. | ||
3881 | 101 | |||
3882 | 102 | # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still | ||
3883 | 103 | # use `HOST_CC' if defined, but it is deprecated. | ||
3884 | 104 | |||
3885 | 105 | # Portable tmp directory creation inspired by the Autoconf team. | ||
3886 | 106 | |||
3887 | 107 | set_cc_for_build=' | ||
3888 | 108 | trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; | ||
3889 | 109 | trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; | ||
3890 | 110 | : ${TMPDIR=/tmp} ; | ||
3891 | 111 | { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || | ||
3892 | 112 | { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || | ||
3893 | 113 | { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || | ||
3894 | 114 | { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; | ||
3895 | 115 | dummy=$tmp/dummy ; | ||
3896 | 116 | tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; | ||
3897 | 117 | case $CC_FOR_BUILD,$HOST_CC,$CC in | ||
3898 | 118 | ,,) echo "int x;" > $dummy.c ; | ||
3899 | 119 | for c in cc gcc c89 c99 ; do | ||
3900 | 120 | if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then | ||
3901 | 121 | CC_FOR_BUILD="$c"; break ; | ||
3902 | 122 | fi ; | ||
3903 | 123 | done ; | ||
3904 | 124 | if test x"$CC_FOR_BUILD" = x ; then | ||
3905 | 125 | CC_FOR_BUILD=no_compiler_found ; | ||
3906 | 126 | fi | ||
3907 | 127 | ;; | ||
3908 | 128 | ,,*) CC_FOR_BUILD=$CC ;; | ||
3909 | 129 | ,*,*) CC_FOR_BUILD=$HOST_CC ;; | ||
3910 | 130 | esac ; set_cc_for_build= ;' | ||
3911 | 131 | |||
3912 | 132 | # This is needed to find uname on a Pyramid OSx when run in the BSD universe. | ||
3913 | 133 | # (ghazi@noc.rutgers.edu 1994-08-24) | ||
3914 | 134 | if (test -f /.attbin/uname) >/dev/null 2>&1 ; then | ||
3915 | 135 | PATH=$PATH:/.attbin ; export PATH | ||
3916 | 136 | fi | ||
3917 | 137 | |||
3918 | 138 | UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown | ||
3919 | 139 | UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown | ||
3920 | 140 | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown | ||
3921 | 141 | UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown | ||
3922 | 142 | |||
3923 | 143 | # Note: order is significant - the case branches are not exclusive. | ||
3924 | 144 | |||
3925 | 145 | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in | ||
3926 | 146 | *:NetBSD:*:*) | ||
3927 | 147 | # NetBSD (nbsd) targets should (where applicable) match one or | ||
3928 | 148 | # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, | ||
3929 | 149 | # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently | ||
3930 | 150 | # switched to ELF, *-*-netbsd* would select the old | ||
3931 | 151 | # object file format. This provides both forward | ||
3932 | 152 | # compatibility and a consistent mechanism for selecting the | ||
3933 | 153 | # object file format. | ||
3934 | 154 | # | ||
3935 | 155 | # Note: NetBSD doesn't particularly care about the vendor | ||
3936 | 156 | # portion of the name. We always set it to "unknown". | ||
3937 | 157 | sysctl="sysctl -n hw.machine_arch" | ||
3938 | 158 | UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ | ||
3939 | 159 | /usr/sbin/$sysctl 2>/dev/null || echo unknown)` | ||
3940 | 160 | case "${UNAME_MACHINE_ARCH}" in | ||
3941 | 161 | armeb) machine=armeb-unknown ;; | ||
3942 | 162 | arm*) machine=arm-unknown ;; | ||
3943 | 163 | sh3el) machine=shl-unknown ;; | ||
3944 | 164 | sh3eb) machine=sh-unknown ;; | ||
3945 | 165 | sh5el) machine=sh5le-unknown ;; | ||
3946 | 166 | *) machine=${UNAME_MACHINE_ARCH}-unknown ;; | ||
3947 | 167 | esac | ||
3948 | 168 | # The Operating System including object format, if it has switched | ||
3949 | 169 | # to ELF recently, or will in the future. | ||
3950 | 170 | case "${UNAME_MACHINE_ARCH}" in | ||
3951 | 171 | arm*|i386|m68k|ns32k|sh3*|sparc|vax) | ||
3952 | 172 | eval $set_cc_for_build | ||
3953 | 173 | if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | ||
3954 | 174 | | grep -q __ELF__ | ||
3955 | 175 | then | ||
3956 | 176 | # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). | ||
3957 | 177 | # Return netbsd for either. FIX? | ||
3958 | 178 | os=netbsd | ||
3959 | 179 | else | ||
3960 | 180 | os=netbsdelf | ||
3961 | 181 | fi | ||
3962 | 182 | ;; | ||
3963 | 183 | *) | ||
3964 | 184 | os=netbsd | ||
3965 | 185 | ;; | ||
3966 | 186 | esac | ||
3967 | 187 | # The OS release | ||
3968 | 188 | # Debian GNU/NetBSD machines have a different userland, and | ||
3969 | 189 | # thus, need a distinct triplet. However, they do not need | ||
3970 | 190 | # kernel version information, so it can be replaced with a | ||
3971 | 191 | # suitable tag, in the style of linux-gnu. | ||
3972 | 192 | case "${UNAME_VERSION}" in | ||
3973 | 193 | Debian*) | ||
3974 | 194 | release='-gnu' | ||
3975 | 195 | ;; | ||
3976 | 196 | *) | ||
3977 | 197 | release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` | ||
3978 | 198 | ;; | ||
3979 | 199 | esac | ||
3980 | 200 | # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: | ||
3981 | 201 | # contains redundant information, the shorter form: | ||
3982 | 202 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. | ||
3983 | 203 | echo "${machine}-${os}${release}" | ||
3984 | 204 | exit ;; | ||
3985 | 205 | *:OpenBSD:*:*) | ||
3986 | 206 | UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` | ||
3987 | 207 | echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} | ||
3988 | 208 | exit ;; | ||
3989 | 209 | *:ekkoBSD:*:*) | ||
3990 | 210 | echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} | ||
3991 | 211 | exit ;; | ||
3992 | 212 | *:SolidBSD:*:*) | ||
3993 | 213 | echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} | ||
3994 | 214 | exit ;; | ||
3995 | 215 | macppc:MirBSD:*:*) | ||
3996 | 216 | echo powerpc-unknown-mirbsd${UNAME_RELEASE} | ||
3997 | 217 | exit ;; | ||
3998 | 218 | *:MirBSD:*:*) | ||
3999 | 219 | echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} | ||
4000 | 220 | exit ;; | ||
4001 | 221 | alpha:OSF1:*:*) | ||
4002 | 222 | case $UNAME_RELEASE in | ||
4003 | 223 | *4.0) | ||
4004 | 224 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` | ||
4005 | 225 | ;; | ||
4006 | 226 | *5.*) | ||
4007 | 227 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` | ||
4008 | 228 | ;; | ||
4009 | 229 | esac | ||
4010 | 230 | # According to Compaq, /usr/sbin/psrinfo has been available on | ||
4011 | 231 | # OSF/1 and Tru64 systems produced since 1995. I hope that | ||
4012 | 232 | # covers most systems running today. This code pipes the CPU | ||
4013 | 233 | # types through head -n 1, so we only detect the type of CPU 0. | ||
4014 | 234 | ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` | ||
4015 | 235 | case "$ALPHA_CPU_TYPE" in | ||
4016 | 236 | "EV4 (21064)") | ||
4017 | 237 | UNAME_MACHINE="alpha" ;; | ||
4018 | 238 | "EV4.5 (21064)") | ||
4019 | 239 | UNAME_MACHINE="alpha" ;; | ||
4020 | 240 | "LCA4 (21066/21068)") | ||
4021 | 241 | UNAME_MACHINE="alpha" ;; | ||
4022 | 242 | "EV5 (21164)") | ||
4023 | 243 | UNAME_MACHINE="alphaev5" ;; | ||
4024 | 244 | "EV5.6 (21164A)") | ||
4025 | 245 | UNAME_MACHINE="alphaev56" ;; | ||
4026 | 246 | "EV5.6 (21164PC)") | ||
4027 | 247 | UNAME_MACHINE="alphapca56" ;; | ||
4028 | 248 | "EV5.7 (21164PC)") | ||
4029 | 249 | UNAME_MACHINE="alphapca57" ;; | ||
4030 | 250 | "EV6 (21264)") | ||
4031 | 251 | UNAME_MACHINE="alphaev6" ;; | ||
4032 | 252 | "EV6.7 (21264A)") | ||
4033 | 253 | UNAME_MACHINE="alphaev67" ;; | ||
4034 | 254 | "EV6.8CB (21264C)") | ||
4035 | 255 | UNAME_MACHINE="alphaev68" ;; | ||
4036 | 256 | "EV6.8AL (21264B)") | ||
4037 | 257 | UNAME_MACHINE="alphaev68" ;; | ||
4038 | 258 | "EV6.8CX (21264D)") | ||
4039 | 259 | UNAME_MACHINE="alphaev68" ;; | ||
4040 | 260 | "EV6.9A (21264/EV69A)") | ||
4041 | 261 | UNAME_MACHINE="alphaev69" ;; | ||
4042 | 262 | "EV7 (21364)") | ||
4043 | 263 | UNAME_MACHINE="alphaev7" ;; | ||
4044 | 264 | "EV7.9 (21364A)") | ||
4045 | 265 | UNAME_MACHINE="alphaev79" ;; | ||
4046 | 266 | esac | ||
4047 | 267 | # A Pn.n version is a patched version. | ||
4048 | 268 | # A Vn.n version is a released version. | ||
4049 | 269 | # A Tn.n version is a released field test version. | ||
4050 | 270 | # A Xn.n version is an unreleased experimental baselevel. | ||
4051 | 271 | # 1.2 uses "1.2" for uname -r. | ||
4052 | 272 | echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` | ||
4053 | 273 | exit ;; | ||
4054 | 274 | Alpha\ *:Windows_NT*:*) | ||
4055 | 275 | # How do we know it's Interix rather than the generic POSIX subsystem? | ||
4056 | 276 | # Should we change UNAME_MACHINE based on the output of uname instead | ||
4057 | 277 | # of the specific Alpha model? | ||
4058 | 278 | echo alpha-pc-interix | ||
4059 | 279 | exit ;; | ||
4060 | 280 | 21064:Windows_NT:50:3) | ||
4061 | 281 | echo alpha-dec-winnt3.5 | ||
4062 | 282 | exit ;; | ||
4063 | 283 | Amiga*:UNIX_System_V:4.0:*) | ||
4064 | 284 | echo m68k-unknown-sysv4 | ||
4065 | 285 | exit ;; | ||
4066 | 286 | *:[Aa]miga[Oo][Ss]:*:*) | ||
4067 | 287 | echo ${UNAME_MACHINE}-unknown-amigaos | ||
4068 | 288 | exit ;; | ||
4069 | 289 | *:[Mm]orph[Oo][Ss]:*:*) | ||
4070 | 290 | echo ${UNAME_MACHINE}-unknown-morphos | ||
4071 | 291 | exit ;; | ||
4072 | 292 | *:OS/390:*:*) | ||
4073 | 293 | echo i370-ibm-openedition | ||
4074 | 294 | exit ;; | ||
4075 | 295 | *:z/VM:*:*) | ||
4076 | 296 | echo s390-ibm-zvmoe | ||
4077 | 297 | exit ;; | ||
4078 | 298 | *:OS400:*:*) | ||
4079 | 299 | echo powerpc-ibm-os400 | ||
4080 | 300 | exit ;; | ||
4081 | 301 | arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) | ||
4082 | 302 | echo arm-acorn-riscix${UNAME_RELEASE} | ||
4083 | 303 | exit ;; | ||
4084 | 304 | arm:riscos:*:*|arm:RISCOS:*:*) | ||
4085 | 305 | echo arm-unknown-riscos | ||
4086 | 306 | exit ;; | ||
4087 | 307 | SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) | ||
4088 | 308 | echo hppa1.1-hitachi-hiuxmpp | ||
4089 | 309 | exit ;; | ||
4090 | 310 | Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) | ||
4091 | 311 | # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. | ||
4092 | 312 | if test "`(/bin/universe) 2>/dev/null`" = att ; then | ||
4093 | 313 | echo pyramid-pyramid-sysv3 | ||
4094 | 314 | else | ||
4095 | 315 | echo pyramid-pyramid-bsd | ||
4096 | 316 | fi | ||
4097 | 317 | exit ;; | ||
4098 | 318 | NILE*:*:*:dcosx) | ||
4099 | 319 | echo pyramid-pyramid-svr4 | ||
4100 | 320 | exit ;; | ||
4101 | 321 | DRS?6000:unix:4.0:6*) | ||
4102 | 322 | echo sparc-icl-nx6 | ||
4103 | 323 | exit ;; | ||
4104 | 324 | DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) | ||
4105 | 325 | case `/usr/bin/uname -p` in | ||
4106 | 326 | sparc) echo sparc-icl-nx7; exit ;; | ||
4107 | 327 | esac ;; | ||
4108 | 328 | s390x:SunOS:*:*) | ||
4109 | 329 | echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | ||
4110 | 330 | exit ;; | ||
4111 | 331 | sun4H:SunOS:5.*:*) | ||
4112 | 332 | echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | ||
4113 | 333 | exit ;; | ||
4114 | 334 | sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) | ||
4115 | 335 | echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | ||
4116 | 336 | exit ;; | ||
4117 | 337 | i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) | ||
4118 | 338 | echo i386-pc-auroraux${UNAME_RELEASE} | ||
4119 | 339 | exit ;; | ||
4120 | 340 | i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) | ||
4121 | 341 | eval $set_cc_for_build | ||
4122 | 342 | SUN_ARCH="i386" | ||
4123 | 343 | # If there is a compiler, see if it is configured for 64-bit objects. | ||
4124 | 344 | # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. | ||
4125 | 345 | # This test works for both compilers. | ||
4126 | 346 | if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then | ||
4127 | 347 | if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ | ||
4128 | 348 | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ | ||
4129 | 349 | grep IS_64BIT_ARCH >/dev/null | ||
4130 | 350 | then | ||
4131 | 351 | SUN_ARCH="x86_64" | ||
4132 | 352 | fi | ||
4133 | 353 | fi | ||
4134 | 354 | echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | ||
4135 | 355 | exit ;; | ||
4136 | 356 | sun4*:SunOS:6*:*) | ||
4137 | 357 | # According to config.sub, this is the proper way to canonicalize | ||
4138 | 358 | # SunOS6. Hard to guess exactly what SunOS6 will be like, but | ||
4139 | 359 | # it's likely to be more like Solaris than SunOS4. | ||
4140 | 360 | echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | ||
4141 | 361 | exit ;; | ||
4142 | 362 | sun4*:SunOS:*:*) | ||
4143 | 363 | case "`/usr/bin/arch -k`" in | ||
4144 | 364 | Series*|S4*) | ||
4145 | 365 | UNAME_RELEASE=`uname -v` | ||
4146 | 366 | ;; | ||
4147 | 367 | esac | ||
4148 | 368 | # Japanese Language versions have a version number like `4.1.3-JL'. | ||
4149 | 369 | echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` | ||
4150 | 370 | exit ;; | ||
4151 | 371 | sun3*:SunOS:*:*) | ||
4152 | 372 | echo m68k-sun-sunos${UNAME_RELEASE} | ||
4153 | 373 | exit ;; | ||
4154 | 374 | sun*:*:4.2BSD:*) | ||
4155 | 375 | UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` | ||
4156 | 376 | test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 | ||
4157 | 377 | case "`/bin/arch`" in | ||
4158 | 378 | sun3) | ||
4159 | 379 | echo m68k-sun-sunos${UNAME_RELEASE} | ||
4160 | 380 | ;; | ||
4161 | 381 | sun4) | ||
4162 | 382 | echo sparc-sun-sunos${UNAME_RELEASE} | ||
4163 | 383 | ;; | ||
4164 | 384 | esac | ||
4165 | 385 | exit ;; | ||
4166 | 386 | aushp:SunOS:*:*) | ||
4167 | 387 | echo sparc-auspex-sunos${UNAME_RELEASE} | ||
4168 | 388 | exit ;; | ||
4169 | 389 | # The situation for MiNT is a little confusing. The machine name | ||
4170 | 390 | # can be virtually everything (everything which is not | ||
4171 | 391 | # "atarist" or "atariste" at least should have a processor | ||
4172 | 392 | # > m68000). The system name ranges from "MiNT" over "FreeMiNT" | ||
4173 | 393 | # to the lowercase version "mint" (or "freemint"). Finally | ||
4174 | 394 | # the system name "TOS" denotes a system which is actually not | ||
4175 | 395 | # MiNT. But MiNT is downward compatible to TOS, so this should | ||
4176 | 396 | # be no problem. | ||
4177 | 397 | atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) | ||
4178 | 398 | echo m68k-atari-mint${UNAME_RELEASE} | ||
4179 | 399 | exit ;; | ||
4180 | 400 | atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) | ||
4181 | 401 | echo m68k-atari-mint${UNAME_RELEASE} | ||
4182 | 402 | exit ;; | ||
4183 | 403 | *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) | ||
4184 | 404 | echo m68k-atari-mint${UNAME_RELEASE} | ||
4185 | 405 | exit ;; | ||
4186 | 406 | milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) | ||
4187 | 407 | echo m68k-milan-mint${UNAME_RELEASE} | ||
4188 | 408 | exit ;; | ||
4189 | 409 | hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) | ||
4190 | 410 | echo m68k-hades-mint${UNAME_RELEASE} | ||
4191 | 411 | exit ;; | ||
4192 | 412 | *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) | ||
4193 | 413 | echo m68k-unknown-mint${UNAME_RELEASE} | ||
4194 | 414 | exit ;; | ||
4195 | 415 | m68k:machten:*:*) | ||
4196 | 416 | echo m68k-apple-machten${UNAME_RELEASE} | ||
4197 | 417 | exit ;; | ||
4198 | 418 | powerpc:machten:*:*) | ||
4199 | 419 | echo powerpc-apple-machten${UNAME_RELEASE} | ||
4200 | 420 | exit ;; | ||
4201 | 421 | RISC*:Mach:*:*) | ||
4202 | 422 | echo mips-dec-mach_bsd4.3 | ||
4203 | 423 | exit ;; | ||
4204 | 424 | RISC*:ULTRIX:*:*) | ||
4205 | 425 | echo mips-dec-ultrix${UNAME_RELEASE} | ||
4206 | 426 | exit ;; | ||
4207 | 427 | VAX*:ULTRIX*:*:*) | ||
4208 | 428 | echo vax-dec-ultrix${UNAME_RELEASE} | ||
4209 | 429 | exit ;; | ||
4210 | 430 | 2020:CLIX:*:* | 2430:CLIX:*:*) | ||
4211 | 431 | echo clipper-intergraph-clix${UNAME_RELEASE} | ||
4212 | 432 | exit ;; | ||
4213 | 433 | mips:*:*:UMIPS | mips:*:*:RISCos) | ||
4214 | 434 | eval $set_cc_for_build | ||
4215 | 435 | sed 's/^ //' << EOF >$dummy.c | ||
4216 | 436 | #ifdef __cplusplus | ||
4217 | 437 | #include <stdio.h> /* for printf() prototype */ | ||
4218 | 438 | int main (int argc, char *argv[]) { | ||
4219 | 439 | #else | ||
4220 | 440 | int main (argc, argv) int argc; char *argv[]; { | ||
4221 | 441 | #endif | ||
4222 | 442 | #if defined (host_mips) && defined (MIPSEB) | ||
4223 | 443 | #if defined (SYSTYPE_SYSV) | ||
4224 | 444 | printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); | ||
4225 | 445 | #endif | ||
4226 | 446 | #if defined (SYSTYPE_SVR4) | ||
4227 | 447 | printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); | ||
4228 | 448 | #endif | ||
4229 | 449 | #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) | ||
4230 | 450 | printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); | ||
4231 | 451 | #endif | ||
4232 | 452 | #endif | ||
4233 | 453 | exit (-1); | ||
4234 | 454 | } | ||
4235 | 455 | EOF | ||
4236 | 456 | $CC_FOR_BUILD -o $dummy $dummy.c && | ||
4237 | 457 | dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && | ||
4238 | 458 | SYSTEM_NAME=`$dummy $dummyarg` && | ||
4239 | 459 | { echo "$SYSTEM_NAME"; exit; } | ||
4240 | 460 | echo mips-mips-riscos${UNAME_RELEASE} | ||
4241 | 461 | exit ;; | ||
4242 | 462 | Motorola:PowerMAX_OS:*:*) | ||
4243 | 463 | echo powerpc-motorola-powermax | ||
4244 | 464 | exit ;; | ||
4245 | 465 | Motorola:*:4.3:PL8-*) | ||
4246 | 466 | echo powerpc-harris-powermax | ||
4247 | 467 | exit ;; | ||
4248 | 468 | Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) | ||
4249 | 469 | echo powerpc-harris-powermax | ||
4250 | 470 | exit ;; | ||
4251 | 471 | Night_Hawk:Power_UNIX:*:*) | ||
4252 | 472 | echo powerpc-harris-powerunix | ||
4253 | 473 | exit ;; | ||
4254 | 474 | m88k:CX/UX:7*:*) | ||
4255 | 475 | echo m88k-harris-cxux7 | ||
4256 | 476 | exit ;; | ||
4257 | 477 | m88k:*:4*:R4*) | ||
4258 | 478 | echo m88k-motorola-sysv4 | ||
4259 | 479 | exit ;; | ||
4260 | 480 | m88k:*:3*:R3*) | ||
4261 | 481 | echo m88k-motorola-sysv3 | ||
4262 | 482 | exit ;; | ||
4263 | 483 | AViiON:dgux:*:*) | ||
4264 | 484 | # DG/UX returns AViiON for all architectures | ||
4265 | 485 | UNAME_PROCESSOR=`/usr/bin/uname -p` | ||
4266 | 486 | if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] | ||
4267 | 487 | then | ||
4268 | 488 | if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ | ||
4269 | 489 | [ ${TARGET_BINARY_INTERFACE}x = x ] | ||
4270 | 490 | then | ||
4271 | 491 | echo m88k-dg-dgux${UNAME_RELEASE} | ||
4272 | 492 | else | ||
4273 | 493 | echo m88k-dg-dguxbcs${UNAME_RELEASE} | ||
4274 | 494 | fi | ||
4275 | 495 | else | ||
4276 | 496 | echo i586-dg-dgux${UNAME_RELEASE} | ||
4277 | 497 | fi | ||
4278 | 498 | exit ;; | ||
4279 | 499 | M88*:DolphinOS:*:*) # DolphinOS (SVR3) | ||
4280 | 500 | echo m88k-dolphin-sysv3 | ||
4281 | 501 | exit ;; | ||
4282 | 502 | M88*:*:R3*:*) | ||
4283 | 503 | # Delta 88k system running SVR3 | ||
4284 | 504 | echo m88k-motorola-sysv3 | ||
4285 | 505 | exit ;; | ||
4286 | 506 | XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) | ||
4287 | 507 | echo m88k-tektronix-sysv3 | ||
4288 | 508 | exit ;; | ||
4289 | 509 | Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) | ||
4290 | 510 | echo m68k-tektronix-bsd | ||
4291 | 511 | exit ;; | ||
4292 | 512 | *:IRIX*:*:*) | ||
4293 | 513 | echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` | ||
4294 | 514 | exit ;; | ||
4295 | 515 | ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. | ||
4296 | 516 | echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id | ||
4297 | 517 | exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' | ||
4298 | 518 | i*86:AIX:*:*) | ||
4299 | 519 | echo i386-ibm-aix | ||
4300 | 520 | exit ;; | ||
4301 | 521 | ia64:AIX:*:*) | ||
4302 | 522 | if [ -x /usr/bin/oslevel ] ; then | ||
4303 | 523 | IBM_REV=`/usr/bin/oslevel` | ||
4304 | 524 | else | ||
4305 | 525 | IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} | ||
4306 | 526 | fi | ||
4307 | 527 | echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} | ||
4308 | 528 | exit ;; | ||
4309 | 529 | *:AIX:2:3) | ||
4310 | 530 | if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then | ||
4311 | 531 | eval $set_cc_for_build | ||
4312 | 532 | sed 's/^ //' << EOF >$dummy.c | ||
4313 | 533 | #include <sys/systemcfg.h> | ||
4314 | 534 | |||
4315 | 535 | main() | ||
4316 | 536 | { | ||
4317 | 537 | if (!__power_pc()) | ||
4318 | 538 | exit(1); | ||
4319 | 539 | puts("powerpc-ibm-aix3.2.5"); | ||
4320 | 540 | exit(0); | ||
4321 | 541 | } | ||
4322 | 542 | EOF | ||
4323 | 543 | if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` | ||
4324 | 544 | then | ||
4325 | 545 | echo "$SYSTEM_NAME" | ||
4326 | 546 | else | ||
4327 | 547 | echo rs6000-ibm-aix3.2.5 | ||
4328 | 548 | fi | ||
4329 | 549 | elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then | ||
4330 | 550 | echo rs6000-ibm-aix3.2.4 | ||
4331 | 551 | else | ||
4332 | 552 | echo rs6000-ibm-aix3.2 | ||
4333 | 553 | fi | ||
4334 | 554 | exit ;; | ||
4335 | 555 | *:AIX:*:[456]) | ||
4336 | 556 | IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` | ||
4337 | 557 | if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then | ||
4338 | 558 | IBM_ARCH=rs6000 | ||
4339 | 559 | else | ||
4340 | 560 | IBM_ARCH=powerpc | ||
4341 | 561 | fi | ||
4342 | 562 | if [ -x /usr/bin/oslevel ] ; then | ||
4343 | 563 | IBM_REV=`/usr/bin/oslevel` | ||
4344 | 564 | else | ||
4345 | 565 | IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} | ||
4346 | 566 | fi | ||
4347 | 567 | echo ${IBM_ARCH}-ibm-aix${IBM_REV} | ||
4348 | 568 | exit ;; | ||
4349 | 569 | *:AIX:*:*) | ||
4350 | 570 | echo rs6000-ibm-aix | ||
4351 | 571 | exit ;; | ||
4352 | 572 | ibmrt:4.4BSD:*|romp-ibm:BSD:*) | ||
4353 | 573 | echo romp-ibm-bsd4.4 | ||
4354 | 574 | exit ;; | ||
4355 | 575 | ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and | ||
4356 | 576 | echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to | ||
4357 | 577 | exit ;; # report: romp-ibm BSD 4.3 | ||
4358 | 578 | *:BOSX:*:*) | ||
4359 | 579 | echo rs6000-bull-bosx | ||
4360 | 580 | exit ;; | ||
4361 | 581 | DPX/2?00:B.O.S.:*:*) | ||
4362 | 582 | echo m68k-bull-sysv3 | ||
4363 | 583 | exit ;; | ||
4364 | 584 | 9000/[34]??:4.3bsd:1.*:*) | ||
4365 | 585 | echo m68k-hp-bsd | ||
4366 | 586 | exit ;; | ||
4367 | 587 | hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) | ||
4368 | 588 | echo m68k-hp-bsd4.4 | ||
4369 | 589 | exit ;; | ||
4370 | 590 | 9000/[34678]??:HP-UX:*:*) | ||
4371 | 591 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` | ||
4372 | 592 | case "${UNAME_MACHINE}" in | ||
4373 | 593 | 9000/31? ) HP_ARCH=m68000 ;; | ||
4374 | 594 | 9000/[34]?? ) HP_ARCH=m68k ;; | ||
4375 | 595 | 9000/[678][0-9][0-9]) | ||
4376 | 596 | if [ -x /usr/bin/getconf ]; then | ||
4377 | 597 | sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` | ||
4378 | 598 | sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` | ||
4379 | 599 | case "${sc_cpu_version}" in | ||
4380 | 600 | 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 | ||
4381 | 601 | 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 | ||
4382 | 602 | 532) # CPU_PA_RISC2_0 | ||
4383 | 603 | case "${sc_kernel_bits}" in | ||
4384 | 604 | 32) HP_ARCH="hppa2.0n" ;; | ||
4385 | 605 | 64) HP_ARCH="hppa2.0w" ;; | ||
4386 | 606 | '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 | ||
4387 | 607 | esac ;; | ||
4388 | 608 | esac | ||
4389 | 609 | fi | ||
4390 | 610 | if [ "${HP_ARCH}" = "" ]; then | ||
4391 | 611 | eval $set_cc_for_build | ||
4392 | 612 | sed 's/^ //' << EOF >$dummy.c | ||
4393 | 613 | |||
4394 | 614 | #define _HPUX_SOURCE | ||
4395 | 615 | #include <stdlib.h> | ||
4396 | 616 | #include <unistd.h> | ||
4397 | 617 | |||
4398 | 618 | int main () | ||
4399 | 619 | { | ||
4400 | 620 | #if defined(_SC_KERNEL_BITS) | ||
4401 | 621 | long bits = sysconf(_SC_KERNEL_BITS); | ||
4402 | 622 | #endif | ||
4403 | 623 | long cpu = sysconf (_SC_CPU_VERSION); | ||
4404 | 624 | |||
4405 | 625 | switch (cpu) | ||
4406 | 626 | { | ||
4407 | 627 | case CPU_PA_RISC1_0: puts ("hppa1.0"); break; | ||
4408 | 628 | case CPU_PA_RISC1_1: puts ("hppa1.1"); break; | ||
4409 | 629 | case CPU_PA_RISC2_0: | ||
4410 | 630 | #if defined(_SC_KERNEL_BITS) | ||
4411 | 631 | switch (bits) | ||
4412 | 632 | { | ||
4413 | 633 | case 64: puts ("hppa2.0w"); break; | ||
4414 | 634 | case 32: puts ("hppa2.0n"); break; | ||
4415 | 635 | default: puts ("hppa2.0"); break; | ||
4416 | 636 | } break; | ||
4417 | 637 | #else /* !defined(_SC_KERNEL_BITS) */ | ||
4418 | 638 | puts ("hppa2.0"); break; | ||
4419 | 639 | #endif | ||
4420 | 640 | default: puts ("hppa1.0"); break; | ||
4421 | 641 | } | ||
4422 | 642 | exit (0); | ||
4423 | 643 | } | ||
4424 | 644 | EOF | ||
4425 | 645 | (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` | ||
4426 | 646 | test -z "$HP_ARCH" && HP_ARCH=hppa | ||
4427 | 647 | fi ;; | ||
4428 | 648 | esac | ||
4429 | 649 | if [ ${HP_ARCH} = "hppa2.0w" ] | ||
4430 | 650 | then | ||
4431 | 651 | eval $set_cc_for_build | ||
4432 | 652 | |||
4433 | 653 | # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating | ||
4434 | 654 | # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler | ||
4435 | 655 | # generating 64-bit code. GNU and HP use different nomenclature: | ||
4436 | 656 | # | ||
4437 | 657 | # $ CC_FOR_BUILD=cc ./config.guess | ||
4438 | 658 | # => hppa2.0w-hp-hpux11.23 | ||
4439 | 659 | # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess | ||
4440 | 660 | # => hppa64-hp-hpux11.23 | ||
4441 | 661 | |||
4442 | 662 | if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | | ||
4443 | 663 | grep -q __LP64__ | ||
4444 | 664 | then | ||
4445 | 665 | HP_ARCH="hppa2.0w" | ||
4446 | 666 | else | ||
4447 | 667 | HP_ARCH="hppa64" | ||
4448 | 668 | fi | ||
4449 | 669 | fi | ||
4450 | 670 | echo ${HP_ARCH}-hp-hpux${HPUX_REV} | ||
4451 | 671 | exit ;; | ||
4452 | 672 | ia64:HP-UX:*:*) | ||
4453 | 673 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` | ||
4454 | 674 | echo ia64-hp-hpux${HPUX_REV} | ||
4455 | 675 | exit ;; | ||
4456 | 676 | 3050*:HI-UX:*:*) | ||
4457 | 677 | eval $set_cc_for_build | ||
4458 | 678 | sed 's/^ //' << EOF >$dummy.c | ||
4459 | 679 | #include <unistd.h> | ||
4460 | 680 | int | ||
4461 | 681 | main () | ||
4462 | 682 | { | ||
4463 | 683 | long cpu = sysconf (_SC_CPU_VERSION); | ||
4464 | 684 | /* The order matters, because CPU_IS_HP_MC68K erroneously returns | ||
4465 | 685 | true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct | ||
4466 | 686 | results, however. */ | ||
4467 | 687 | if (CPU_IS_PA_RISC (cpu)) | ||
4468 | 688 | { | ||
4469 | 689 | switch (cpu) | ||
4470 | 690 | { | ||
4471 | 691 | case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; | ||
4472 | 692 | case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; | ||
4473 | 693 | case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; | ||
4474 | 694 | default: puts ("hppa-hitachi-hiuxwe2"); break; | ||
4475 | 695 | } | ||
4476 | 696 | } | ||
4477 | 697 | else if (CPU_IS_HP_MC68K (cpu)) | ||
4478 | 698 | puts ("m68k-hitachi-hiuxwe2"); | ||
4479 | 699 | else puts ("unknown-hitachi-hiuxwe2"); | ||
4480 | 700 | exit (0); | ||
4481 | 701 | } | ||
4482 | 702 | EOF | ||
4483 | 703 | $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && | ||
4484 | 704 | { echo "$SYSTEM_NAME"; exit; } | ||
4485 | 705 | echo unknown-hitachi-hiuxwe2 | ||
4486 | 706 | exit ;; | ||
4487 | 707 | 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) | ||
4488 | 708 | echo hppa1.1-hp-bsd | ||
4489 | 709 | exit ;; | ||
4490 | 710 | 9000/8??:4.3bsd:*:*) | ||
4491 | 711 | echo hppa1.0-hp-bsd | ||
4492 | 712 | exit ;; | ||
4493 | 713 | *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) | ||
4494 | 714 | echo hppa1.0-hp-mpeix | ||
4495 | 715 | exit ;; | ||
4496 | 716 | hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) | ||
4497 | 717 | echo hppa1.1-hp-osf | ||
4498 | 718 | exit ;; | ||
4499 | 719 | hp8??:OSF1:*:*) | ||
4500 | 720 | echo hppa1.0-hp-osf | ||
4501 | 721 | exit ;; | ||
4502 | 722 | i*86:OSF1:*:*) | ||
4503 | 723 | if [ -x /usr/sbin/sysversion ] ; then | ||
4504 | 724 | echo ${UNAME_MACHINE}-unknown-osf1mk | ||
4505 | 725 | else | ||
4506 | 726 | echo ${UNAME_MACHINE}-unknown-osf1 | ||
4507 | 727 | fi | ||
4508 | 728 | exit ;; | ||
4509 | 729 | parisc*:Lites*:*:*) | ||
4510 | 730 | echo hppa1.1-hp-lites | ||
4511 | 731 | exit ;; | ||
4512 | 732 | C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) | ||
4513 | 733 | echo c1-convex-bsd | ||
4514 | 734 | exit ;; | ||
4515 | 735 | C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) | ||
4516 | 736 | if getsysinfo -f scalar_acc | ||
4517 | 737 | then echo c32-convex-bsd | ||
4518 | 738 | else echo c2-convex-bsd | ||
4519 | 739 | fi | ||
4520 | 740 | exit ;; | ||
4521 | 741 | C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) | ||
4522 | 742 | echo c34-convex-bsd | ||
4523 | 743 | exit ;; | ||
4524 | 744 | C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) | ||
4525 | 745 | echo c38-convex-bsd | ||
4526 | 746 | exit ;; | ||
4527 | 747 | C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) | ||
4528 | 748 | echo c4-convex-bsd | ||
4529 | 749 | exit ;; | ||
4530 | 750 | CRAY*Y-MP:*:*:*) | ||
4531 | 751 | echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | ||
4532 | 752 | exit ;; | ||
4533 | 753 | CRAY*[A-Z]90:*:*:*) | ||
4534 | 754 | echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | ||
4535 | 755 | | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ | ||
4536 | 756 | -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ | ||
4537 | 757 | -e 's/\.[^.]*$/.X/' | ||
4538 | 758 | exit ;; | ||
4539 | 759 | CRAY*TS:*:*:*) | ||
4540 | 760 | echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | ||
4541 | 761 | exit ;; | ||
4542 | 762 | CRAY*T3E:*:*:*) | ||
4543 | 763 | echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | ||
4544 | 764 | exit ;; | ||
4545 | 765 | CRAY*SV1:*:*:*) | ||
4546 | 766 | echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | ||
4547 | 767 | exit ;; | ||
4548 | 768 | *:UNICOS/mp:*:*) | ||
4549 | 769 | echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | ||
4550 | 770 | exit ;; | ||
4551 | 771 | F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) | ||
4552 | 772 | FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` | ||
4553 | 773 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` | ||
4554 | 774 | FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` | ||
4555 | 775 | echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" | ||
4556 | 776 | exit ;; | ||
4557 | 777 | 5000:UNIX_System_V:4.*:*) | ||
4558 | 778 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` | ||
4559 | 779 | FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` | ||
4560 | 780 | echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" | ||
4561 | 781 | exit ;; | ||
4562 | 782 | i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) | ||
4563 | 783 | echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} | ||
4564 | 784 | exit ;; | ||
4565 | 785 | sparc*:BSD/OS:*:*) | ||
4566 | 786 | echo sparc-unknown-bsdi${UNAME_RELEASE} | ||
4567 | 787 | exit ;; | ||
4568 | 788 | *:BSD/OS:*:*) | ||
4569 | 789 | echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} | ||
4570 | 790 | exit ;; | ||
4571 | 791 | *:FreeBSD:*:*) | ||
4572 | 792 | case ${UNAME_MACHINE} in | ||
4573 | 793 | pc98) | ||
4574 | 794 | echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; | ||
4575 | 795 | amd64) | ||
4576 | 796 | echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; | ||
4577 | 797 | *) | ||
4578 | 798 | echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; | ||
4579 | 799 | esac | ||
4580 | 800 | exit ;; | ||
4581 | 801 | i*:CYGWIN*:*) | ||
4582 | 802 | echo ${UNAME_MACHINE}-pc-cygwin | ||
4583 | 803 | exit ;; | ||
4584 | 804 | *:MINGW*:*) | ||
4585 | 805 | echo ${UNAME_MACHINE}-pc-mingw32 | ||
4586 | 806 | exit ;; | ||
4587 | 807 | i*:windows32*:*) | ||
4588 | 808 | # uname -m includes "-pc" on this system. | ||
4589 | 809 | echo ${UNAME_MACHINE}-mingw32 | ||
4590 | 810 | exit ;; | ||
4591 | 811 | i*:PW*:*) | ||
4592 | 812 | echo ${UNAME_MACHINE}-pc-pw32 | ||
4593 | 813 | exit ;; | ||
4594 | 814 | *:Interix*:*) | ||
4595 | 815 | case ${UNAME_MACHINE} in | ||
4596 | 816 | x86) | ||
4597 | 817 | echo i586-pc-interix${UNAME_RELEASE} | ||
4598 | 818 | exit ;; | ||
4599 | 819 | authenticamd | genuineintel | EM64T) | ||
4600 | 820 | echo x86_64-unknown-interix${UNAME_RELEASE} | ||
4601 | 821 | exit ;; | ||
4602 | 822 | IA64) | ||
4603 | 823 | echo ia64-unknown-interix${UNAME_RELEASE} | ||
4604 | 824 | exit ;; | ||
4605 | 825 | esac ;; | ||
4606 | 826 | [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) | ||
4607 | 827 | echo i${UNAME_MACHINE}-pc-mks | ||
4608 | 828 | exit ;; | ||
4609 | 829 | 8664:Windows_NT:*) | ||
4610 | 830 | echo x86_64-pc-mks | ||
4611 | 831 | exit ;; | ||
4612 | 832 | i*:Windows_NT*:* | Pentium*:Windows_NT*:*) | ||
4613 | 833 | # How do we know it's Interix rather than the generic POSIX subsystem? | ||
4614 | 834 | # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we | ||
4615 | 835 | # UNAME_MACHINE based on the output of uname instead of i386? | ||
4616 | 836 | echo i586-pc-interix | ||
4617 | 837 | exit ;; | ||
4618 | 838 | i*:UWIN*:*) | ||
4619 | 839 | echo ${UNAME_MACHINE}-pc-uwin | ||
4620 | 840 | exit ;; | ||
4621 | 841 | amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) | ||
4622 | 842 | echo x86_64-unknown-cygwin | ||
4623 | 843 | exit ;; | ||
4624 | 844 | p*:CYGWIN*:*) | ||
4625 | 845 | echo powerpcle-unknown-cygwin | ||
4626 | 846 | exit ;; | ||
4627 | 847 | prep*:SunOS:5.*:*) | ||
4628 | 848 | echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | ||
4629 | 849 | exit ;; | ||
4630 | 850 | *:GNU:*:*) | ||
4631 | 851 | # the GNU system | ||
4632 | 852 | echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` | ||
4633 | 853 | exit ;; | ||
4634 | 854 | *:GNU/*:*:*) | ||
4635 | 855 | # other systems with GNU libc and userland | ||
4636 | 856 | echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu | ||
4637 | 857 | exit ;; | ||
4638 | 858 | i*86:Minix:*:*) | ||
4639 | 859 | echo ${UNAME_MACHINE}-pc-minix | ||
4640 | 860 | exit ;; | ||
4641 | 861 | alpha:Linux:*:*) | ||
4642 | 862 | case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in | ||
4643 | 863 | EV5) UNAME_MACHINE=alphaev5 ;; | ||
4644 | 864 | EV56) UNAME_MACHINE=alphaev56 ;; | ||
4645 | 865 | PCA56) UNAME_MACHINE=alphapca56 ;; | ||
4646 | 866 | PCA57) UNAME_MACHINE=alphapca56 ;; | ||
4647 | 867 | EV6) UNAME_MACHINE=alphaev6 ;; | ||
4648 | 868 | EV67) UNAME_MACHINE=alphaev67 ;; | ||
4649 | 869 | EV68*) UNAME_MACHINE=alphaev68 ;; | ||
4650 | 870 | esac | ||
4651 | 871 | objdump --private-headers /bin/sh | grep -q ld.so.1 | ||
4652 | 872 | if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi | ||
4653 | 873 | echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} | ||
4654 | 874 | exit ;; | ||
4655 | 875 | arm*:Linux:*:*) | ||
4656 | 876 | eval $set_cc_for_build | ||
4657 | 877 | if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | ||
4658 | 878 | | grep -q __ARM_EABI__ | ||
4659 | 879 | then | ||
4660 | 880 | echo ${UNAME_MACHINE}-unknown-linux-gnu | ||
4661 | 881 | else | ||
4662 | 882 | echo ${UNAME_MACHINE}-unknown-linux-gnueabi | ||
4663 | 883 | fi | ||
4664 | 884 | exit ;; | ||
4665 | 885 | avr32*:Linux:*:*) | ||
4666 | 886 | echo ${UNAME_MACHINE}-unknown-linux-gnu | ||
4667 | 887 | exit ;; | ||
4668 | 888 | cris:Linux:*:*) | ||
4669 | 889 | echo cris-axis-linux-gnu | ||
4670 | 890 | exit ;; | ||
4671 | 891 | crisv32:Linux:*:*) | ||
4672 | 892 | echo crisv32-axis-linux-gnu | ||
4673 | 893 | exit ;; | ||
4674 | 894 | frv:Linux:*:*) | ||
4675 | 895 | echo frv-unknown-linux-gnu | ||
4676 | 896 | exit ;; | ||
4677 | 897 | i*86:Linux:*:*) | ||
4678 | 898 | LIBC=gnu | ||
4679 | 899 | eval $set_cc_for_build | ||
4680 | 900 | sed 's/^ //' << EOF >$dummy.c | ||
4681 | 901 | #ifdef __dietlibc__ | ||
4682 | 902 | LIBC=dietlibc | ||
4683 | 903 | #endif | ||
4684 | 904 | EOF | ||
4685 | 905 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` | ||
4686 | 906 | echo "${UNAME_MACHINE}-pc-linux-${LIBC}" | ||
4687 | 907 | exit ;; | ||
4688 | 908 | ia64:Linux:*:*) | ||
4689 | 909 | echo ${UNAME_MACHINE}-unknown-linux-gnu | ||
4690 | 910 | exit ;; | ||
4691 | 911 | m32r*:Linux:*:*) | ||
4692 | 912 | echo ${UNAME_MACHINE}-unknown-linux-gnu | ||
4693 | 913 | exit ;; | ||
4694 | 914 | m68*:Linux:*:*) | ||
4695 | 915 | echo ${UNAME_MACHINE}-unknown-linux-gnu | ||
4696 | 916 | exit ;; | ||
4697 | 917 | mips:Linux:*:* | mips64:Linux:*:*) | ||
4698 | 918 | eval $set_cc_for_build | ||
4699 | 919 | sed 's/^ //' << EOF >$dummy.c | ||
4700 | 920 | #undef CPU | ||
4701 | 921 | #undef ${UNAME_MACHINE} | ||
4702 | 922 | #undef ${UNAME_MACHINE}el | ||
4703 | 923 | #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) | ||
4704 | 924 | CPU=${UNAME_MACHINE}el | ||
4705 | 925 | #else | ||
4706 | 926 | #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) | ||
4707 | 927 | CPU=${UNAME_MACHINE} | ||
4708 | 928 | #else | ||
4709 | 929 | CPU= | ||
4710 | 930 | #endif | ||
4711 | 931 | #endif | ||
4712 | 932 | EOF | ||
4713 | 933 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` | ||
4714 | 934 | test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } | ||
4715 | 935 | ;; | ||
4716 | 936 | or32:Linux:*:*) | ||
4717 | 937 | echo or32-unknown-linux-gnu | ||
4718 | 938 | exit ;; | ||
4719 | 939 | padre:Linux:*:*) | ||
4720 | 940 | echo sparc-unknown-linux-gnu | ||
4721 | 941 | exit ;; | ||
4722 | 942 | parisc64:Linux:*:* | hppa64:Linux:*:*) | ||
4723 | 943 | echo hppa64-unknown-linux-gnu | ||
4724 | 944 | exit ;; | ||
4725 | 945 | parisc:Linux:*:* | hppa:Linux:*:*) | ||
4726 | 946 | # Look for CPU level | ||
4727 | 947 | case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in | ||
4728 | 948 | PA7*) echo hppa1.1-unknown-linux-gnu ;; | ||
4729 | 949 | PA8*) echo hppa2.0-unknown-linux-gnu ;; | ||
4730 | 950 | *) echo hppa-unknown-linux-gnu ;; | ||
4731 | 951 | esac | ||
4732 | 952 | exit ;; | ||
4733 | 953 | ppc64:Linux:*:*) | ||
4734 | 954 | echo powerpc64-unknown-linux-gnu | ||
4735 | 955 | exit ;; | ||
4736 | 956 | ppc:Linux:*:*) | ||
4737 | 957 | echo powerpc-unknown-linux-gnu | ||
4738 | 958 | exit ;; | ||
4739 | 959 | s390:Linux:*:* | s390x:Linux:*:*) | ||
4740 | 960 | echo ${UNAME_MACHINE}-ibm-linux | ||
4741 | 961 | exit ;; | ||
4742 | 962 | sh64*:Linux:*:*) | ||
4743 | 963 | echo ${UNAME_MACHINE}-unknown-linux-gnu | ||
4744 | 964 | exit ;; | ||
4745 | 965 | sh*:Linux:*:*) | ||
4746 | 966 | echo ${UNAME_MACHINE}-unknown-linux-gnu | ||
4747 | 967 | exit ;; | ||
4748 | 968 | sparc:Linux:*:* | sparc64:Linux:*:*) | ||
4749 | 969 | echo ${UNAME_MACHINE}-unknown-linux-gnu | ||
4750 | 970 | exit ;; | ||
4751 | 971 | vax:Linux:*:*) | ||
4752 | 972 | echo ${UNAME_MACHINE}-dec-linux-gnu | ||
4753 | 973 | exit ;; | ||
4754 | 974 | x86_64:Linux:*:*) | ||
4755 | 975 | echo x86_64-unknown-linux-gnu | ||
4756 | 976 | exit ;; | ||
4757 | 977 | xtensa*:Linux:*:*) | ||
4758 | 978 | echo ${UNAME_MACHINE}-unknown-linux-gnu | ||
4759 | 979 | exit ;; | ||
4760 | 980 | i*86:DYNIX/ptx:4*:*) | ||
4761 | 981 | # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. | ||
4762 | 982 | # earlier versions are messed up and put the nodename in both | ||
4763 | 983 | # sysname and nodename. | ||
4764 | 984 | echo i386-sequent-sysv4 | ||
4765 | 985 | exit ;; | ||
4766 | 986 | i*86:UNIX_SV:4.2MP:2.*) | ||
4767 | 987 | # Unixware is an offshoot of SVR4, but it has its own version | ||
4768 | 988 | # number series starting with 2... | ||
4769 | 989 | # I am not positive that other SVR4 systems won't match this, | ||
4770 | 990 | # I just have to hope. -- rms. | ||
4771 | 991 | # Use sysv4.2uw... so that sysv4* matches it. | ||
4772 | 992 | echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} | ||
4773 | 993 | exit ;; | ||
4774 | 994 | i*86:OS/2:*:*) | ||
4775 | 995 | # If we were able to find `uname', then EMX Unix compatibility | ||
4776 | 996 | # is probably installed. | ||
4777 | 997 | echo ${UNAME_MACHINE}-pc-os2-emx | ||
4778 | 998 | exit ;; | ||
4779 | 999 | i*86:XTS-300:*:STOP) | ||
4780 | 1000 | echo ${UNAME_MACHINE}-unknown-stop | ||
4781 | 1001 | exit ;; | ||
4782 | 1002 | i*86:atheos:*:*) | ||
4783 | 1003 | echo ${UNAME_MACHINE}-unknown-atheos | ||
4784 | 1004 | exit ;; | ||
4785 | 1005 | i*86:syllable:*:*) | ||
4786 | 1006 | echo ${UNAME_MACHINE}-pc-syllable | ||
4787 | 1007 | exit ;; | ||
4788 | 1008 | i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) | ||
4789 | 1009 | echo i386-unknown-lynxos${UNAME_RELEASE} | ||
4790 | 1010 | exit ;; | ||
4791 | 1011 | i*86:*DOS:*:*) | ||
4792 | 1012 | echo ${UNAME_MACHINE}-pc-msdosdjgpp | ||
4793 | 1013 | exit ;; | ||
4794 | 1014 | i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) | ||
4795 | 1015 | UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` | ||
4796 | 1016 | if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then | ||
4797 | 1017 | echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} | ||
4798 | 1018 | else | ||
4799 | 1019 | echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} | ||
4800 | 1020 | fi | ||
4801 | 1021 | exit ;; | ||
4802 | 1022 | i*86:*:5:[678]*) | ||
4803 | 1023 | # UnixWare 7.x, OpenUNIX and OpenServer 6. | ||
4804 | 1024 | case `/bin/uname -X | grep "^Machine"` in | ||
4805 | 1025 | *486*) UNAME_MACHINE=i486 ;; | ||
4806 | 1026 | *Pentium) UNAME_MACHINE=i586 ;; | ||
4807 | 1027 | *Pent*|*Celeron) UNAME_MACHINE=i686 ;; | ||
4808 | 1028 | esac | ||
4809 | 1029 | echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} | ||
4810 | 1030 | exit ;; | ||
4811 | 1031 | i*86:*:3.2:*) | ||
4812 | 1032 | if test -f /usr/options/cb.name; then | ||
4813 | 1033 | UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` | ||
4814 | 1034 | echo ${UNAME_MACHINE}-pc-isc$UNAME_REL | ||
4815 | 1035 | elif /bin/uname -X 2>/dev/null >/dev/null ; then | ||
4816 | 1036 | UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` | ||
4817 | 1037 | (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 | ||
4818 | 1038 | (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ | ||
4819 | 1039 | && UNAME_MACHINE=i586 | ||
4820 | 1040 | (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ | ||
4821 | 1041 | && UNAME_MACHINE=i686 | ||
4822 | 1042 | (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ | ||
4823 | 1043 | && UNAME_MACHINE=i686 | ||
4824 | 1044 | echo ${UNAME_MACHINE}-pc-sco$UNAME_REL | ||
4825 | 1045 | else | ||
4826 | 1046 | echo ${UNAME_MACHINE}-pc-sysv32 | ||
4827 | 1047 | fi | ||
4828 | 1048 | exit ;; | ||
4829 | 1049 | pc:*:*:*) | ||
4830 | 1050 | # Left here for compatibility: | ||
4831 | 1051 | # uname -m prints for DJGPP always 'pc', but it prints nothing about | ||
4832 | 1052 | # the processor, so we play safe by assuming i586. | ||
4833 | 1053 | # Note: whatever this is, it MUST be the same as what config.sub | ||
4834 | 1054 | # prints for the "djgpp" host, or else GDB configury will decide that | ||
4835 | 1055 | # this is a cross-build. | ||
4836 | 1056 | echo i586-pc-msdosdjgpp | ||
4837 | 1057 | exit ;; | ||
4838 | 1058 | Intel:Mach:3*:*) | ||
4839 | 1059 | echo i386-pc-mach3 | ||
4840 | 1060 | exit ;; | ||
4841 | 1061 | paragon:*:*:*) | ||
4842 | 1062 | echo i860-intel-osf1 | ||
4843 | 1063 | exit ;; | ||
4844 | 1064 | i860:*:4.*:*) # i860-SVR4 | ||
4845 | 1065 | if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then | ||
4846 | 1066 | echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 | ||
4847 | 1067 | else # Add other i860-SVR4 vendors below as they are discovered. | ||
4848 | 1068 | echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 | ||
4849 | 1069 | fi | ||
4850 | 1070 | exit ;; | ||
4851 | 1071 | mini*:CTIX:SYS*5:*) | ||
4852 | 1072 | # "miniframe" | ||
4853 | 1073 | echo m68010-convergent-sysv | ||
4854 | 1074 | exit ;; | ||
4855 | 1075 | mc68k:UNIX:SYSTEM5:3.51m) | ||
4856 | 1076 | echo m68k-convergent-sysv | ||
4857 | 1077 | exit ;; | ||
4858 | 1078 | M680?0:D-NIX:5.3:*) | ||
4859 | 1079 | echo m68k-diab-dnix | ||
4860 | 1080 | exit ;; | ||
4861 | 1081 | M68*:*:R3V[5678]*:*) | ||
4862 | 1082 | test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; | ||
4863 | 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) | ||
4864 | 1084 | OS_REL='' | ||
4865 | 1085 | test -r /etc/.relid \ | ||
4866 | 1086 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` | ||
4867 | 1087 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ | ||
4868 | 1088 | && { echo i486-ncr-sysv4.3${OS_REL}; exit; } | ||
4869 | 1089 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ | ||
4870 | 1090 | && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; | ||
4871 | 1091 | 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) | ||
4872 | 1092 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ | ||
4873 | 1093 | && { echo i486-ncr-sysv4; exit; } ;; | ||
4874 | 1094 | NCR*:*:4.2:* | MPRAS*:*:4.2:*) | ||
4875 | 1095 | OS_REL='.3' | ||
4876 | 1096 | test -r /etc/.relid \ | ||
4877 | 1097 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` | ||
4878 | 1098 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ | ||
4879 | 1099 | && { echo i486-ncr-sysv4.3${OS_REL}; exit; } | ||
4880 | 1100 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ | ||
4881 | 1101 | && { echo i586-ncr-sysv4.3${OS_REL}; exit; } | ||
4882 | 1102 | /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ | ||
4883 | 1103 | && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; | ||
4884 | 1104 | m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) | ||
4885 | 1105 | echo m68k-unknown-lynxos${UNAME_RELEASE} | ||
4886 | 1106 | exit ;; | ||
4887 | 1107 | mc68030:UNIX_System_V:4.*:*) | ||
4888 | 1108 | echo m68k-atari-sysv4 | ||
4889 | 1109 | exit ;; | ||
4890 | 1110 | TSUNAMI:LynxOS:2.*:*) | ||
4891 | 1111 | echo sparc-unknown-lynxos${UNAME_RELEASE} | ||
4892 | 1112 | exit ;; | ||
4893 | 1113 | rs6000:LynxOS:2.*:*) | ||
4894 | 1114 | echo rs6000-unknown-lynxos${UNAME_RELEASE} | ||
4895 | 1115 | exit ;; | ||
4896 | 1116 | PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) | ||
4897 | 1117 | echo powerpc-unknown-lynxos${UNAME_RELEASE} | ||
4898 | 1118 | exit ;; | ||
4899 | 1119 | SM[BE]S:UNIX_SV:*:*) | ||
4900 | 1120 | echo mips-dde-sysv${UNAME_RELEASE} | ||
4901 | 1121 | exit ;; | ||
4902 | 1122 | RM*:ReliantUNIX-*:*:*) | ||
4903 | 1123 | echo mips-sni-sysv4 | ||
4904 | 1124 | exit ;; | ||
4905 | 1125 | RM*:SINIX-*:*:*) | ||
4906 | 1126 | echo mips-sni-sysv4 | ||
4907 | 1127 | exit ;; | ||
4908 | 1128 | *:SINIX-*:*:*) | ||
4909 | 1129 | if uname -p 2>/dev/null >/dev/null ; then | ||
4910 | 1130 | UNAME_MACHINE=`(uname -p) 2>/dev/null` | ||
4911 | 1131 | echo ${UNAME_MACHINE}-sni-sysv4 | ||
4912 | 1132 | else | ||
4913 | 1133 | echo ns32k-sni-sysv | ||
4914 | 1134 | fi | ||
4915 | 1135 | exit ;; | ||
4916 | 1136 | PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort | ||
4917 | 1137 | # says <Richard.M.Bartel@ccMail.Census.GOV> | ||
4918 | 1138 | echo i586-unisys-sysv4 | ||
4919 | 1139 | exit ;; | ||
4920 | 1140 | *:UNIX_System_V:4*:FTX*) | ||
4921 | 1141 | # From Gerald Hewes <hewes@openmarket.com>. | ||
4922 | 1142 | # How about differentiating between stratus architectures? -djm | ||
4923 | 1143 | echo hppa1.1-stratus-sysv4 | ||
4924 | 1144 | exit ;; | ||
4925 | 1145 | *:*:*:FTX*) | ||
4926 | 1146 | # From seanf@swdc.stratus.com. | ||
4927 | 1147 | echo i860-stratus-sysv4 | ||
4928 | 1148 | exit ;; | ||
4929 | 1149 | i*86:VOS:*:*) | ||
4930 | 1150 | # From Paul.Green@stratus.com. | ||
4931 | 1151 | echo ${UNAME_MACHINE}-stratus-vos | ||
4932 | 1152 | exit ;; | ||
4933 | 1153 | *:VOS:*:*) | ||
4934 | 1154 | # From Paul.Green@stratus.com. | ||
4935 | 1155 | echo hppa1.1-stratus-vos | ||
4936 | 1156 | exit ;; | ||
4937 | 1157 | mc68*:A/UX:*:*) | ||
4938 | 1158 | echo m68k-apple-aux${UNAME_RELEASE} | ||
4939 | 1159 | exit ;; | ||
4940 | 1160 | news*:NEWS-OS:6*:*) | ||
4941 | 1161 | echo mips-sony-newsos6 | ||
4942 | 1162 | exit ;; | ||
4943 | 1163 | R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) | ||
4944 | 1164 | if [ -d /usr/nec ]; then | ||
4945 | 1165 | echo mips-nec-sysv${UNAME_RELEASE} | ||
4946 | 1166 | else | ||
4947 | 1167 | echo mips-unknown-sysv${UNAME_RELEASE} | ||
4948 | 1168 | fi | ||
4949 | 1169 | exit ;; | ||
4950 | 1170 | BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. | ||
4951 | 1171 | echo powerpc-be-beos | ||
4952 | 1172 | exit ;; | ||
4953 | 1173 | BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. | ||
4954 | 1174 | echo powerpc-apple-beos | ||
4955 | 1175 | exit ;; | ||
4956 | 1176 | BePC:BeOS:*:*) # BeOS running on Intel PC compatible. | ||
4957 | 1177 | echo i586-pc-beos | ||
4958 | 1178 | exit ;; | ||
4959 | 1179 | BePC:Haiku:*:*) # Haiku running on Intel PC compatible. | ||
4960 | 1180 | echo i586-pc-haiku | ||
4961 | 1181 | exit ;; | ||
4962 | 1182 | SX-4:SUPER-UX:*:*) | ||
4963 | 1183 | echo sx4-nec-superux${UNAME_RELEASE} | ||
4964 | 1184 | exit ;; | ||
4965 | 1185 | SX-5:SUPER-UX:*:*) | ||
4966 | 1186 | echo sx5-nec-superux${UNAME_RELEASE} | ||
4967 | 1187 | exit ;; | ||
4968 | 1188 | SX-6:SUPER-UX:*:*) | ||
4969 | 1189 | echo sx6-nec-superux${UNAME_RELEASE} | ||
4970 | 1190 | exit ;; | ||
4971 | 1191 | SX-7:SUPER-UX:*:*) | ||
4972 | 1192 | echo sx7-nec-superux${UNAME_RELEASE} | ||
4973 | 1193 | exit ;; | ||
4974 | 1194 | SX-8:SUPER-UX:*:*) | ||
4975 | 1195 | echo sx8-nec-superux${UNAME_RELEASE} | ||
4976 | 1196 | exit ;; | ||
4977 | 1197 | SX-8R:SUPER-UX:*:*) | ||
4978 | 1198 | echo sx8r-nec-superux${UNAME_RELEASE} | ||
4979 | 1199 | exit ;; | ||
4980 | 1200 | Power*:Rhapsody:*:*) | ||
4981 | 1201 | echo powerpc-apple-rhapsody${UNAME_RELEASE} | ||
4982 | 1202 | exit ;; | ||
4983 | 1203 | *:Rhapsody:*:*) | ||
4984 | 1204 | echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} | ||
4985 | 1205 | exit ;; | ||
4986 | 1206 | *:Darwin:*:*) | ||
4987 | 1207 | UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown | ||
4988 | 1208 | case $UNAME_PROCESSOR in | ||
4989 | 1209 | i386) | ||
4990 | 1210 | eval $set_cc_for_build | ||
4991 | 1211 | if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then | ||
4992 | 1212 | if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ | ||
4993 | 1213 | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ | ||
4994 | 1214 | grep IS_64BIT_ARCH >/dev/null | ||
4995 | 1215 | then | ||
4996 | 1216 | UNAME_PROCESSOR="x86_64" | ||
4997 | 1217 | fi | ||
4998 | 1218 | fi ;; | ||
4999 | 1219 | unknown) UNAME_PROCESSOR=powerpc ;; | ||
5000 | 1220 | esac |
The diff has been truncated for viewing.
ACK. Looks great. Thanks!