Commit Graph

2447 Commits

Author SHA1 Message Date
Guy Harris
aae14f93d9 Merge in stuff from the current top-of-tree FreeBSD tcpdump; this picks
up changes from Sam Leffler for 802.11n and 802.11s.

Clean up ieee802_11_radio.h a bit.
2009-07-14 18:23:06 -07:00
Guy Harris
ce952c7dc4 Get rid of some autoconf macros not used, or no longer used, with
tcpdump.

Check whether __attribute__((format)) can be applied to function
pointers and, if not, don't apply it to function pointers; some older
versions of GCC appear to support applying it to functions, but not
pointers to functions.

As we've gotten rid of missing/getaddrinfo.c, don't use it.
2009-07-08 01:22:27 -07:00
Guy Harris
a2fb078ab4 Nothing in missing/getaddrinfo.c is used in tcpdump, and it's a pain to
make it build on Tru64 UNIX, so get rid of it.
2009-07-08 01:18:11 -07:00
Guy Harris
706103b136 In AC_LBL_C_INIT, don't explicitly set V_CCOPT, just set $1, as is done
elsewhere in the macro.

For the Alpha C compiler, don't set -std1 unless it's necessary for ANSI
mode - we don't want to limit the compiler only to C89 features and,
more importantly, C89 headers (<inttypes.h> doesn't work, on at least
some versions of Digital UNIX and some C compiler versions, with -std1).
2009-07-04 17:57:01 -07:00
Guy Harris
2a5fc2e1fc Copy a comment from the libpcap configure.in. 2009-07-02 19:49:53 -07:00
Guy Harris
bee8bec6a4 Include Makefile-devel-adds in the release tarball, just in case
somebody creates .devel.
2009-07-02 19:48:54 -07:00
Guy Harris
9076e3c01a Add a comment to the AC_DEFINE call for const, just as we did for
libpcap; that eliminates the need to list it in acconfig.h, so get rid
of that.
2009-07-02 19:28:34 -07:00
Guy Harris
0491b33dc0 Expand another AC_DEFINE comment. 2009-07-02 19:01:20 -07:00
Guy Harris
4cf4925027 Pick up some AC_DEFINE comments from libpcap's aclocal.m4.
Remove unused items, and items for which we now have AC_DEFINE() calls
that supply a comment, from acconfig.h.

Note that a host OS that matches "osf*" is assumed to be DEC
OSF1/Digital UNIX/Tru64 UNIX.
2009-07-02 18:59:24 -07:00
Guy Harris
c6461afb66 At least on HP-UX:
1) getrpcbynumber() is declared in <netdb.h>, not any of the RPC
	   header files

and

	2) if _XOPEN_SOURCE_EXTENDED is defined, <netdb.h> doesn't declare
	   it

so we undefine it.
2009-07-02 18:43:40 -07:00
Guy Harris
7c567e9ae8 Cast argument to isdigit to unsigned char, so if the characters 8th bit
is set, it doesn't get treated as a negative number.
2009-07-02 12:00:55 -07:00
Guy Harris
02ae5549fc As with libpcap, so with tcpdump; when testing whether "inline" works,
use the V_CCOPT flags, because some of those might disable inlining;
otherwise, the test for inlining will succeed, but inlining won't work
with the options we're using when compiling.
2009-07-02 11:55:55 -07:00
Guy Harris
e6a083238b As with libpcap, so with tcpdump; when testing whether "inline" works,
use the V_CCOPT flags, because some of those might disable inlining;
otherwise, the test for inlining will succeed, but inlining won't work
with the options we're using when compiling.
2009-07-02 11:55:00 -07:00
Guy Harris
2425b023c1 Use <sys/bitypes.h> in all tests for types. 2009-06-29 00:58:33 -07:00
Guy Harris
8ab0a995a9 "sa_len" is, on some platforms, #defined to something else; use
"sa_length" instead, so as not to have compilation fail on those
platforms.  Do the same with "osa_len" while we're at it.
2009-06-29 00:55:07 -07:00
Guy Harris
b02163ba7d Use fn_printn() to print strings, to catch non-printable characters. 2009-06-28 13:53:02 -07:00
Guy Harris
429c8b46ee Fix up length checking for the MID message to check before *each*
interface address, not just the *first* interface address.

For the name service message:

	add length checking, both against truncated packets and bogus
	lengths;

	use fn_printn to print the name, to protect against control
	characters, etc. in the name.
2009-06-28 12:16:43 -07:00
Guy Harris
2ef070a02f Fix indentation to make it clearer what the arguments to a printf call
are.

To extract a 32-bit big-endian quantity from a particular address, use
EXTRACT_32BITS(), don't do pointer casting - casting a "char *" or
"unsigned char *" to point to a multi-byte quantity doesn't guarantee
the pointer can be dereferenced and give you the right answer (SPARC
traps on unaligned pointer accesses, some other processor types might
also trap, or might ignore the low bits of the pointer).
2009-06-28 11:06:01 -07:00
Guy Harris
ab73c1d5d9 Make the presence bit unsigned; some compilers might warn about 1<<31
overflowing, as, with 32-bit signed numbers, the 1 becomes the sign bit.
2009-06-28 10:58:16 -07:00
Guy Harris
6b510e1a1b On AIX, if we have pcap-config, rely on it to supply the right extra
flags for linking with libpcap.
2009-06-16 00:21:06 -07:00
Guy (Core OS) Harris
88efc43576 From Marc Binderberger:
attached a patch for print-rsvp.c to decode the "label"
	subobject for Record Route Objects (RRO).
2009-06-09 20:54:49 -07:00
Guy (Core OS) Harris
d972c8c862 From Marc Binderberger:
I think this is a mistake in the procedure used to display the
	bitfield.  Instead of tok2str() it should be bittok2str() - at
	least since I changed it it display the flag field of the RSVP
	session attribute correctly.

	Diff file attached.

	Additionally I've taken the freedom to shorten the displayed
	strings a bit, taking the "desired" away that was in every
	string.  While correct RFC it fills the screen.  Not sure about
	your procedures changing output but as it never displayed before
	anyway ...  ;-)
2009-06-09 20:51:30 -07:00
Guy Harris
4cc68d7f36 Initialize the appropriate member of the msg_ptr union in all case arms
where it's used.
2009-06-09 17:19:33 -07:00
Guy Harris
ddf1f5ff8f Make the definition of ikev1_print() match its declaration - at least
one version of HP's C compiler complains otherwise.
2009-06-09 17:18:31 -07:00
Guy Harris
579d53d4aa execlp() is a varargs function, so if NULL is defined as 0, the compiler
doesn't know that it needs to be converted to a null pointer constant;
add an explicit cast.
2009-06-09 15:05:28 -07:00
Guy Harris
97b52f9f3f Don't put -L/usr/lib into LDFLAGS - it would cause linking with -lpcap,
on a system that comes with libpcap, to link with the system libpcap
even if, say, you've installed a newer libpcap under /usr/local and its
pcap-config added -L/usr/local/lib to LDFLAGS, as the -L/usr/lib comes
earlier in LDFLAGS.  (For "would", read "did, when I tried it".)
2009-06-07 18:19:59 -07:00
Guy Harris
4b8ca1e7c2 Add stamp-h files to the list of files to ignore. 2009-06-07 14:30:38 -07:00
Guy Harris
6c24bfd422 Add the release tarball to the .gitignore list and the list of files to
clean.
2009-06-07 14:29:45 -07:00
Guy Harris
e8c09a5302 Explicitly list the config.* files to ignore; config.guess and
config.sub are in the Git repository.

Also list .devel as a file to ignore.
2009-06-07 14:27:06 -07:00
Guy (Core OS) Harris
7e6045579a From Francois-Xavier Le Bail: use hyphens, rather than spaces, in DHCPv6
option names, so that the "-v" display, which prints options separated
by spaces, isn't ambiguous.  (The BOOTP dissector has hyphens in the
BOOTP/DHCP option names.)
2009-06-03 13:58:27 -07:00
Guy (Core OS) Harris
ff4b26cf2f From Joao Medeiros: fix typo in print-sll.c (report 802.2 packets as
802.2, not 802.3).
2009-06-03 13:49:01 -07:00
Guy Harris
4049e2eafc Don't use structures to define the layout of DHCP options. For one
thing, there's no guarantee that __attribute__ ((__packed__)) works.
2009-05-24 15:47:38 -07:00
Guy Harris
83236cce65 Add __attribute__((format)) to the declarations of the ndo_printf,
ndo_error, and ndo_warning function pointers in a netdissect_options
structure.

Fix some errors adding that caught.

Have the RRCP dissector extract fields itself, with the EXTRACT_ macros
and a u_char pointer, rather than printing numbers from a structure
which doesn't put structure members on natural boundaries
(__attribute__((packed)) doesn't help, as not all compilers support it)
- note also that not all processors support dereferencing unaligned
pointers, e.g. SPARC - and assuming some fields are in the "right" byte
order.  Also have it check whether data is available in the packet
before referring to it.
2009-05-24 14:06:10 -07:00
Guy Harris
4ba67d9a00 Get rid of __attribute__((__packed__)) - not all compilers support it,
so we can't rely on it, and it shouldn't be necessary in any case (all
items in that structure are aligned on their natural boundaries, and the
structure length is a multiple of the natural boundary of the most
strictly aligned member).
2009-05-24 13:25:35 -07:00
Guy Harris
018e7fe40d If we're using a local libpcap library, check for a local pcap-config
script and, if we find it, query it to see what additional libraries are
needed to link with that library.

If we're not, check for a system pcap-config script and, if we find it,
query it to see what C compiler flags and linker flags are needed to
build with that library.
2009-05-22 18:45:27 -07:00
Guy Harris
68fcda9beb Make the FCS length unsigned; this squelches a signed vs. unsigned
comparison warning.
2009-05-21 10:50:08 -07:00
Guy Harris
57bc7f6ef5 Just use u_int, even for values that fit in 16 bits; that squelches a
(irrelevant, but true for the way C works) signed vs. unsigned
comparison warning.  It also probably produces better machine code.
2009-05-21 10:48:19 -07:00
Florian Forster
289e0aed7d print-olsr: Add basic IPv6 support.
Unfortunately OLSR uses the same IDs for IPv4 and IPv6 packets, even
though the size of "messages" differ. The version of the internet protocol
is therefore handed to the "olsr_print" function.

The code isn't very nice, due to a high density of #ifdef INET6'es. If
IPv6-support really should be optional, I'm afraid this is inevitable.
Both, compilation with and without IPv6 support has been tested.

The patch addresses fixes other issues, too. The length given in the packet
was used for pointer arithmetic without checking if the value was in a
reasonable range first in several places. It should now be possible to
decode more than one "namespace message" within a single packet. Other
changes remove trailing whitespace or fix lines indented with tabs (the
majority of the file is indented using spaces).

Signed-off-by: Florian Forster <octo@leeloo.lan.home.verplant.org>
2009-05-21 10:38:40 -07:00
Guy Harris
e3d44c4e89 Remove Florian Forster's name, so his patch to add his name applies when
I do "git am".  I love git so much I could just scream.
2009-05-21 10:37:58 -07:00
Guy Harris
c19f2e8f2b Squelch a warning, style normalization. 2009-05-21 10:32:59 -07:00
Florian Forster
127b352b40 util.c: Add the `mask62plen' utility function.
The function does the same as `mask2plen' but for IPv6.

Signed-off-by: Florian Forster <octo@leeloo.lan.home.verplant.org>
2009-05-21 10:29:24 -07:00
Guy Harris
72553e343d Check to make sure we have all of the USB header before trying to print
it.
2009-05-21 10:26:44 -07:00
Guy Harris
c855c8a7e2 Add Florian Forster to the list of patch suppliers. 2009-05-21 10:15:10 -07:00
Guy Harris
b0dc4a55ea Get rid of trailing whitespace. 2009-05-21 10:14:22 -07:00
Florian Forster
efb465c5a8 print-olsr: Don't trust the package payload.
Especially not to do pointer arithmetic.

This is a real problem even without malicious people around if you use
OLSR via IPv6, because the message IDs didn't change but addresses are
now longer than four bytes.

Signed-off-by: Florian Forster <octo@leeloo.lan.home.verplant.org>
2009-05-21 10:09:45 -07:00
Guy Harris
dc4380a690 Based on a fix from Miroslav Lichvar: don't crash with "-i <num>" if
there are no interfaces available.
2009-04-28 01:20:38 -07:00
Guy Harris
044afa7d59 From Robert Edmonds: free the string that contains the filter as soon as
we're done with it.
2009-04-18 14:34:47 -07:00
Guy Harris
1d8d0b50dd signature.h is a header file, not a source file, so add it to HDR rather
than CSRC.
2009-04-04 12:33:20 -07:00
Guy Harris
2c28d8f466 From Bert Vermeulen: add a USB printer, and fix the error message
printed when trying to print packets for a DLT_ for which we don't have
a printer to indicate that you can still save to a capture file in that
case.  (Slightly changed not to require DLT_USB_LINUX_MMAPPED to be
defined, for older libpcaps that only define DLT_USB_LINUX.)
2009-04-04 12:30:27 -07:00
Guy Harris
3e49644114 Based on a patch from Marc Binderberger, fix the handling of non-control
packets.
2009-03-27 01:25:39 -07:00