Commit Graph

522 Commits

Author SHA1 Message Date
guy
8d35bf0e1c Fix some comments to reflect current reality. 2000-12-23 20:48:13 +00:00
guy
16011e473a It's a bit more convenient for Ethereal if the "sll_protocol" field is
at the end of the link-layer header; put it there.

Put in a comment indicating that the layout of the link-layer header
shouldn't be changed; if a new header is necessary, a new DLL_ type
should be introduced for it.
2000-12-23 07:52:11 +00:00
guy
737c58073a Put the LINUX_SLL_P_ definitions back, and check for at least some of
them in "print-sll.c" - as a cooked-mode capture may be reading from
non-Ethernet, non-802.x devices, it may well see some
ETH_P_/LINUX_SLL_P_ types that don't mean "this is an 802.2 LLC frame".

We currently assume that the ETH_P_ values won't change in the kernel,
so we don't have to explicitly map them.

In various link-layer packet printers, if we don't handle the next layer
up of packet type, and are printing the link-layer header, use the
correct pointer to that header (i.e., if we've stepped "p" past the
link-layer header, don't use "p", use a pointer to the beginning of the
packet), and use the correct length (i.e., if we've subtracted the
length of the link-layer header, add it back in, so that we always print
the full packet length).
2000-12-22 22:45:09 +00:00
guy
4154b2a823 Update a comment. 2000-12-22 12:18:32 +00:00
guy
71eb51233f Add support for a new link layer type DLT_LINUX_SLL, for use when doing
live captures with a "cooked" (SOCK_DGRAM) rather than a "raw"
(SOCK_RAW) PF_PACKET socket; it includes a bunch of the fields from the
"struct sockaddr_ll" you get in a "recvfrom()", including the Ethernet
protocol field.
2000-12-21 10:43:19 +00:00
itojun
ce3c0b3c62 fix A6 decoding. 2000-12-20 05:09:56 +00:00
guy
7c298117dd Update Alfredo Andres's e-mail address, as per his request. 2000-12-18 08:16:58 +00:00
guy
d7254f081d Pass only I frames and UI frames to the NetBEUI printer; thanks and a
tip of the Hatlo hat to Pascal Hennequin <pascal.hennequin@int-evry.fr>
for catching this one.

Also, the control field in an S or I frame is little-endian; treat it as
such, fixing various #defines in "llc.h" to match.
2000-12-18 07:55:36 +00:00
guy
7c4458eb6a Making "extracted_ethertype" static to "print-ether.c" broke other
dissectors that expected calls to "llc_print()" to set it.  (Thanks and
a tip of the hat to Olaf Kirch <okir@caldera.de> for noticing this.)

Make "ether_encap_print()" and "llc_print()" take a pointer to an
extracted-Ethertype variable as an argument, have "llc_print()" pass it
to "ether_encap_print()", and have "ether_encap_print()" set what it
points to rather than setting a static "extracted_ethertype" variable.

Get rid of said static "extracted_ethertype" variable in favor of one
local to "ether_if_print()", just as other link-layer dissectors have
local "extracted_ethertype" variables.
2000-12-18 05:41:58 +00:00
guy
93b36b0a34 Give a bunch of files RCS and SCCS IDs. 2000-12-17 23:13:32 +00:00
guy
4881292df0 Give a bunch of files RCS and SCCS IDs. 2000-12-17 23:07:48 +00:00
guy
364f621bdf Add in one missing CHANGES entry. 2000-12-17 19:37:57 +00:00
fenner
cd19693679 Update config.guess and config.sub to revision 2000-12-15
from ftp://ftp.gnu.org/gnu/config/
2000-12-17 15:16:51 +00:00
guy
aa22569a90 Handle DLT_NULL correctly - the AF_ value is in host byte order, which
may not be *our* byte order if we're reading a capture file from another
machine; we currently handle that by checking whether it looks like an
integer < 65536 or not and, if it's not, byte-swap it.

This also lets us handle OpenBSD DLT_LOOP as well - it's like DLT_NULL
except that the AF_ value is in *network* byte order.

(Old-style Linux loopback captures were also DLT_NULL, but the header
had an Ethernet type in it; there have also been captures where the
header was a PPP header.  For now, we just continue to assume that all
DLT_NULL packets are IP, and check the IP version field to decide
whether it's IPv4, IPv6, or something else.

We may want to consider adopting Ethereal's heuristics, which would at
least mean we wouldn't be reporting bogus packet types for old-style
Linux loopback captures and those weird PPP - ISDN4BSD? - captures,
although the version of libpcap that goes with this version of tcpdump
doesn't produce bogus DLT_NULL captures for Linux loopback devices.)
2000-12-16 22:00:50 +00:00
guy
86eb0bec35 Clean up promiscuous mode, when using SOCK_PACKET, as best we can;
remember which pcap_t's were opened (with SOCK_PACKET) in promiscuous
mode on interfaces not already in promiscuous mode, turn promiscuous
mode off when closing such a pcap_t, and arrange that, when the program
exits, all pcap_t's of that sort not already closed have their
interfaces taken out of promiscuous mode.  (It's not sufficient to do
this on exit - applications may close a pcap_t without exiting, e.g.
Ethereal.)

This won't always work right (if somebody else requests promiscuous mode
after it's opened by libpcap, we'll turn promiscuous mode off when we
close the pcap_t, and if the program doesn't exit cleanly, it won't
clean up the interfaces), but neither of those problems are fixable -
the only way to get things to work correctly is to use PF_PACKET
sockets, which requires a 2.2 or later kernel.

On a 2.0[.x] kernel, when doing a "recvfrom()" on a SOCK_PACKET socket
to read a captured packet, don't pass a byte count value based on the
snapshot length - "recvfrom()" won't return the actual packet length if
you do that.  (2.2 and later kernels will return the actual packet
length if MSG_TRUNC is passed in.)

Update the documentation to reflect improved Appletalk support.
2000-12-16 10:57:26 +00:00
guy
f243e70b91 The stuff in the "linux-include" directory is no longer needed, as we no
longer depend on the OS's header files for packet format and packet
field value definitions; get rid of the stuff in that directory.
2000-12-16 09:07:45 +00:00
itojun
f3b1a28284 add mobile-ip6 option handling. patches@tcpdump.org #113
from Timo Koskiahde.
2000-12-13 07:57:04 +00:00
itojun
8e338956f8 print SPI in hex. 2000-12-12 09:58:40 +00:00
itojun
8f9b0fb4a1 do not try to pass pointer to data-on-stack. broken during align-friendly fix. 2000-12-12 09:20:26 +00:00
itojun
9eb2750139 regen, have HAVE_BPF_DUMP 2000-12-12 09:19:27 +00:00
fenner
97fdf34d3f Regenerate. 2000-12-09 19:09:55 +00:00
fenner
f5c79aedbe Allow tcpdump to work with earlier libpcaps.
(Tested with libpcap-0.4 as comes with FreeBSD 3.4)
2000-12-09 02:58:45 +00:00
guy
0f2d613352 Get rid of blank line at the end - it causes two lines to be generated
in "version.c", both defining the "version" variable.
2000-12-08 07:35:00 +00:00
mcr
364b683b89 preliminary edits for 3.6 2000-12-08 06:59:10 +00:00
guy
393ce0607f The control field of an LLC frame is 1 byte for a U frame and 2 bytes
for an S or I frame; have the LLC dissector pass the control field value
as an argument to the NetBEUI dissector, rather than having the NetBEUI
dissector extract the control field value itself, and have it pass a
pointer to the beginning of the LLC *payload* rather than to the control
field.

Keep the NetBEUI dissector from running past the end of the buffer.

Add support for the NetBEUI SESSION ALIVE frame.
2000-12-05 06:42:47 +00:00
guy
dbd42e772c Fix a "printf". 2000-12-05 05:48:35 +00:00
guy
4c76b82852 If "-n" is specified along with "-e", print the address family value as
"AF <n>" for DLT_NULL captures.

Print the packet length for DLT_NULL captures when "-e" is specified
(somebody complained on "freebsd-isp" about the lack of any packet
length from tcpdump when capturing traffic on a "tunX" device).

Make sure we always print the packet length on PPP when "-e" is
specified (the person in question also complained that the packet length
disappeared between FreeBSD 2.2.8 and FreeBSD 3.4, which was the result
of a new "print-ppp.c" that didn't print the length).
2000-12-04 06:47:17 +00:00
fenner
f3e835f6be Updated patch from Jim Vaughan (especially fixing my stupid TCHECK() bugs) 2000-12-04 05:27:49 +00:00
fenner
e3e36b4b68 Add some truncation checks.
#include <netdb.h> for MAXHOSTNAMELEN on Solaris
Use EXTRACT_16BITS to extract 16-bit quantities
Print withdrawn routes if we think we can
Print must-be-zero attribute flags if they're not zero

Partly from: Jim Vaughn, http://www.tcpdump.org/lists/patches/107
2000-12-04 00:43:39 +00:00
guy
fb298cf2dd Add a bunch of checks to make sure we don't go past the end of the
packet.
2000-12-04 00:35:44 +00:00
fenner
0e6bd5e431 Use EXTRACT_* instead of memcpy() to extract numeric values to handle
byte orders properly.
2000-12-04 00:00:08 +00:00
fenner
0eeb5dba9d Undo spamming of rev 1.50 2000-12-03 23:45:37 +00:00
fenner
e89bfcd207 Update for new RFC's and IANA assignments. Many special-format options
are printed as binary strings.  Any of these that are in common use
 can get their own printers.
2000-12-03 23:42:23 +00:00
guy
c6429d0f1b Don't print the value of a RADIUS attribute if the length is less than
or equal to 2 (the length includes the two bytes of type and length).

Don't print the values of RADIUS attributes that are supposed to be of a
particular length if they have a different length.

Don't use the result of "ctime()", unmodified, when printing an
attribute value; the string "ctime()" supplies includes a newline, which
we need to remove.

The "PRINT_HEX()" macro expands into code that modifies its first
argument; always set the variable in question to the appropriate value
before calling the macro.
2000-12-03 20:31:26 +00:00
itojun
8f002a3ccc do not try to compute tcp/udp checksum for fragmented datagram.
from: jinmei@kame.net
2000-11-17 19:08:14 +00:00
itojun
c237b80b77 simplify case statement 2000-11-12 15:16:16 +00:00
fenner
7a58cc284c Resize 2 statically allocated hostname buffers.
This was in http://www.tcpdump.org/lists/patches/89 , and also
ftp://ftp.freebsd.org/pub/FreeBSD/CERT/patches/SA-00%3A61/tcpdump-4.x.patch.v1.1
2000-11-10 17:52:02 +00:00
fenner
2576276449 Some verbose format diffs from Juergen Schoenwaelder 2000-11-10 17:34:10 +00:00
itojun
1395abcd2b repair IPv6 ESP decoder 2000-11-09 07:43:50 +00:00
itojun
5243609316 always print router renumber sequence number, even without -v. 2000-11-08 13:03:12 +00:00
itojun
a620483952 print sequence number in router renumber message. 2000-11-08 13:01:37 +00:00
itojun
ce233ff12b rrenum minor tweaks (endian conversion for reserved field printing) 2000-11-08 10:10:59 +00:00
itojun
f21bc658b8 unbroken BSDI build (should be revisited). from jinmei@kame.net 2000-11-08 09:41:39 +00:00
itojun
f91a43ad6c RFC2894 (router renumber) decoding. more to go. 2000-11-08 09:28:43 +00:00
itojun
335771982d correct router renumber bits to sync with RFC2894 (not used yet) 2000-11-08 07:10:58 +00:00
itojun
e35056d284 remove #ifdef no longer necessary (due to inclusion of icmp6.h into tcpdump kit) 2000-11-08 07:03:04 +00:00
fenner
721bd3430d Update for libsmi v0.2.x . Attempt to retain libsmi v0.1.x compatibility
(but didn't test it).
2000-11-04 22:50:23 +00:00
guy
029007b0fd Include the new "print-igmp.c" file. 2000-11-04 08:35:02 +00:00
fenner
6389dc2f6f Eliminate unused #includes 2000-11-02 18:02:52 +00:00
fenner
3c34fb6170 Add Wilbert de Graaf for IGMPv3 patches 2000-11-02 02:19:57 +00:00