Commit Graph

60 Commits

Author SHA1 Message Date
guy
eda8cfcc72 From Greg Minshall:
print the TTL for DNS entries with 3 or more "-v" flags;

	print the addresses in A, AAAA, and A6 entries numerically (the
	point of A, AAAA, and A6 entries being to give the address
	corresponding to a name).

Better late than never - do at least a little de-spamification of
addresses in the CREDITS file.  (Greg's address was despammed in his
sourceforge.net submission for this.)

Move the late Jun-ichiro itojun Hagino to a "Past maintainers" section.
2007-12-09 01:40:32 +00:00
guy
1c628f1595 Only print (QU) and (QM) for mDNS queries.
Make the code a little clearer about what's done for DNS vs. what's done
for mDNS.
2007-02-13 19:19:00 +00:00
guy
c6fe76b166 From Kevin Steves: get rid of extra leading spaces. 2007-01-15 11:15:26 +00:00
guy
99296888f0 Mark Krochmal says that the class field should be treated in mDNS as a
flag and a 15-bit field even for OPT RRs.
2006-11-12 23:12:03 +00:00
guy
ee98a5bb16 For OPT resource records, the class field is used as a length, so, if one
happens to be in an mDNS packet, we don't split it into a class and a
"cache flush" flag.
2006-11-12 22:21:44 +00:00
guy
f0ededcff9 The topmost bit in the class field isn't a "cache flush" flag in mDNS
queries.  Display that bit correctly (as per Marc Krochmal's request).

In mDNS, the topmost bit of the class field should be handled the same
way regardless of the value of the lower 15 bits, and *vice versa* -
they're independent fields.
2006-11-10 03:18:21 +00:00
guy
5c335855de From Wesley Griffin <wgriffin@users.sourceforge.net>: print out the
DNSSEC OK bit (RFC3225) which is encoded in the TTL field of the OPT
pseudo RR.
2006-04-07 08:58:29 +00:00
guy
c245819b11 From Wesley Griffin <wgriffin@users.sourceforge.net>: update the list of
DNS RR typecodes.
2006-04-07 08:47:34 +00:00
guy
07e39d93fc If we get an ELT other than a bit label in labellen(), log it. 2005-04-20 20:59:30 +00:00
fenner
5da3b647ac Rewrite bitstring truncation check; it would incorrectly trigger
on a query like
 IP 127.0.0.1.49859 > 127.0.0.1.53:  13041+ PTR? \[xdead000000000000000000000000beef/128].ip6.arpa. (44)
2004-03-23 19:03:03 +00:00
guy
bbc1cfa669 Have the configure script arrange that the Makefile define _U_
appropriately, and that GNUmakefile and the MSVC++ project file define
it apppriately, as we do with libpcap, rather than defining it in
"interface.h".

Undo the rcsid-shuffling and addition of extra #includes, as we no
longer need to arrange that "interface.h" be included before using _U_
in an RCS ID or copyright.
2003-11-16 09:36:07 +00:00
guy
3824a6c041 From Neil Spring:
use "_U_" in the definitions of "rcsid[]", to eliminate
	complaints about those variables being unused;

	move the definitions after the include of "interface.h", or add
	an include of "interface.h", so that "_U_" is defined.

Include "config.h" before including "tcpdump-stdinc.h" in
"missing/datalinks.c".
2003-11-15 00:39:12 +00:00
guy
f4d64fe38b In mDNS, report IN-class records with the "cache flush" bit set as such,
rather than as "Class 32769".
2003-11-05 06:02:58 +00:00
guy
454da66983 From Scott Rose <syberpunk@users.sourceforge.net>:
The test for DNS message dnssec bit flags in the query and
	response are backwards.  The CD bit has meaning in a query, and
	the AD bit has meaning in a response.
2003-09-25 22:30:22 +00:00
fenner
3972747931 Insert references to type definition RFCs.
Use EXTRACT_16BITS to get type, class, length instead of manual
 byte extraction.
Print multiple <character-string>s if present in TXT records.
Don't print arbitrary junk from the packet when parsing an
 [illegal] 0-length TXT record.
2003-04-04 03:49:25 +00:00
fenner
b09ea5197b Teach ns_nskip() that pointers can occur anywhere, not just as
the first label.
Add SRV record data section printing, in the form
 SRV target:port priority weight
2003-04-04 00:18:54 +00:00
guy
fcc82f451d The "__attribute__((packed))" tag on structures causes some files not to
compile with Sun C, as "interface.h" isn't being included before the
structures are being declared.

Furthermore, in the files that Sun C *can* compile, it doesn't cause Sun
C to generate code that's safe with unaligned accesses, as
"__attribute__" is defined as a do-nothing macro with compilers that
don't support it.

Therefore, we get rid of that tag on the structures to which it was
added, and instead use "EXTRACT_16BIT()" and "EXTRACT_32BIT()" to fetch
16-bit and 32-bit big-endian quantities from packets.  We also fix some
other references to multi-byte quantities to get rid of code that tries
to do unaligned loads on platforms that don't support them.

We also throw in a hack that makes those macros use
"__attribute__((packed))" on structures containing only one 16-bit or
32-bit integer to get the compiler to generate unaligned-safe code
rather than doing it by hand.  (GCC on SPARC produces the same code that
doing it by hand does; I don't know if GCC on any other big-endian
strict-alignment processor generates better code for that case.  On
little-endian processors, as "ntohs()" and "ntohl()" might be functions,
that might actually produce worse code.)

Fix some places to use "%u" rather than "%d" to print unsigned
quantities.
2002-12-11 07:13:49 +00:00
guy
c422d3ab0f Get rid of the "-Wno-unused" flag, and fix up most of the
unused-parameter problems reported by GCC.  Add an _U_ tag to label
parameters as unused if the function is called through a pointer (so
that you can't change its signature by removing parameters) or if there
are unused parameters only because the function isn't complete.

Add some additional bounds checks the necessity for which was revealed
while cleaning up unused-parameter problems.

Make some routines static.

"lcp_print()", defined in "print-lcp.c", isn't called anywhere -
"print-ppp.c" has the code to dissect LCP.  Get rid of "print-lcp.c".
2002-09-05 21:25:34 +00:00
guy
edb0e92cdc Add a few more GCC warnings on GCC >= 2 for ".devel" builds.
From Neil T. Spring: fixes for many of those warnings:

	addrtoname.c, configure.in: Linux needs netinet/ether.h for
	ether_ntohost

	print-*.c: change char *foo = "bar" to const char *foo = "bar"
	to appease -Wwrite-strings; should affect no run-time behavior.

	print-*.c: make some variables unsigned.

	print-bgp.c: plen ('prefix len') is unsigned, no reason to
	validate by comparing to zero.

	print-cnfp.c, print-rx.c: use intoa, provided by addrtoname,
	instead of inet_ntoa.

	print-domain.c: unsigned int l; (l=foo()) < 0 is guaranteed to
	be false, so check for (u_int)-1, which represents failure,
	explicitly.

	print-isakmp.c: complete initialization of attrmap objects.

	print-lwres.c: "if(x); print foo;" seemed much more likely to be
	intended to be "if(x) { print foo; }".

	print-smb.c: complete initialization of some structures.

In addition, add some fixes for the signed vs. unsigned comparison
warnings:

	extract.h: cast the result of the byte-extraction-and-combining,
	as, at least for the 16-bit version, C's integral promotions
	will turn "u_int16_t" into "int" if there are other "int"s
	nearby.

	print-*.c: make some more variables unsigned, or add casts to an
	unsigned type of signed values known not to be negative, or add
	casts to "int" of unsigned values known to fit in an "int", and
	make other changes needed to handle the aforementioned variables
	now being unsigned.

	print-isakmp.c: clean up the handling of error/status indicators
	in notify messages.

	print-ppp.c: get rid of a check that an unsigned quantity is >=
	0.

	print-radius.c: clean up some of the bounds checking.

	print-smb.c: extract the word count into a "u_int" to avoid the
	aforementioned problems with C's integral promotions.

	print-snmp.c: change a check that an unsigned variable is >= 0
	to a check that it's != 0.

Also, fix some formats to use "%u" rather than "%d" for unsigned
quantities.
2002-09-05 00:00:07 +00:00
risso
3d932490b8 Added support for Win32, based on WinPcap. 2002-08-01 08:52:55 +00:00
guy
8df5006c28 Get rid of a null-pointer dereference when dissecting DNS requests with
a query count of 0 (no, such a request makes no sense, but that's what
tcpdump thought it saw in one DNS-over-TCP capture).
2001-10-19 09:00:48 +00:00
fenner
c672f00276 Eliminate some unused parameters.
Use const more.
Use EXTRACT_* macros more.
Use TCHECK* more.
Use tok2str() to replace some home-grown workalikes.
smb:
 - Get rid of private types, use tcpdump-defined types
 - Rename fdata and fdata1 to smb_fdata and smb_fdata1 to avoid conflict
   with IRIX library function.
2001-09-17 21:57:50 +00:00
guy
e4b93879cf Move all the "undefine so that the compiler doesn't whine about
redefinitions" stuff from files that include "nameser.h" to "nameser.h"
itself (we used to include <arpa/nameser.h>, over which we had no
control so we couldn't do that, but we now have our own "nameser.h").
Add T_OPT to the list of things we undefine, and undefine T_UNSPEC iff
T_UNSPEC is defined, not iff NOERROR is defined.

Replace the include of <arpa/nameser.h> in "print-rx.c" with an include
of "nameser.h", and "#if 0" it out pending a determination of whether
it's necessary (why would AFS's RX care about the internals of DNS
packets?) or not.
2001-06-26 06:19:03 +00:00
guy
46de5c986c Audit DNS printer for buffer overflows. Use TTEST2() in tests, and make
some additional tests (some of which might, in theory, be unnecessary,
but...).  Check for null pointers *before* checking whether there's
enough data at the pointer in question.
2001-02-23 08:55:21 +00:00
guy
998f4f88c9 Add an additional check for a truncated packet, as per a patch from Jim
Hutchins <jim@ca.sandia.gov>.
2001-02-21 08:52:30 +00:00
itojun
a7e2c51dfd slightly better TSIG decoding. 2001-02-20 07:22:17 +00:00
itojun
e8bcb0d14e add TKEY, TSIG and IXFR 2001-02-20 06:31:34 +00:00
itojun
2ff2c4c9a7 print dynamic update a little bit better 2001-02-20 06:22:57 +00:00
itojun
de0e71c99b do not SEGV if there's no query section 2001-02-20 06:03:42 +00:00
itojun
0e44b855f2 fix query section decoding 2001-02-03 05:04:33 +00:00
itojun
d15d3f3a1e full support of lwres dissector 2001-01-29 20:04:00 +00:00
itojun
000a90c61a remove extra space after type name 2001-01-28 07:56:21 +00:00
itojun
c981dfc94b move T_xx and C_xx fallback definitions into nameser.h. 2001-01-28 07:47:56 +00:00
itojun
277c15d74a print truncated message in a more friendly manner. from jinmei@kame.net 2001-01-12 15:06:06 +00:00
guy
0947e63cde Remove some uninitialized variable complaints. 2001-01-02 23:24:51 +00:00
itojun
16ce7b4be2 avoid segfault (NULL pointer deref) 2001-01-01 04:22:56 +00:00
itojun
5d5b5e03ac fix bit string label decoding again. from jinmei@kame.net 2000-12-31 07:12:18 +00:00
itojun
f4bc38ab26 correct bit string label decoding. jinmei@kame.net 2000-12-30 15:47:58 +00:00
itojun
79ce1730d7 spacing 2000-12-30 09:07:40 +00:00
itojun
8ad280b397 parse EDNS0. 2000-12-30 09:06:21 +00:00
itojun
041e99f6c0 support DNAME and bit string label. more pedantic snapend validation.
{jinmei,itojun}@kame.net
2000-12-28 20:30:41 +00:00
itojun
6eeb04bfe0 fix A6 decoding. jinmei@kame.net 2000-12-27 12:23:27 +00:00
itojun
ce3c0b3c62 fix A6 decoding. 2000-12-20 05:09:56 +00:00
guy
1869f416f3 Remove some includes of <sys/socket.h>, and add includes of
<netinet/in.h> to declare "ntoh[sl]" and "hton[sl]".
2000-10-10 05:05:07 +00:00
guy
e11ed169b1 Get rid of some includes of <net/route.h>, and empty declarations of
"struct mbuf" and "struct rtentry" - they shouldn't be necessary (and
weren't on the platforms on which I tested, both with GCC and the native
compiler if it isn't GCC).
2000-10-06 04:23:10 +00:00
guy
5bad3420c9 Bitfield layout in memory is not specified by the ANSI C spec; don't use
C bitfields to specify the layout of a DNS request or response header,
use shifts and masks to extract the bitfields.
2000-10-03 09:13:25 +00:00
guy
cf53dc05f1 Get rid of includes of <netinet/in_systm.h>, and replace "n_short",
"n_long", and "n_time", defined in that file, with other types.
2000-09-29 04:58:33 +00:00
guy
8b67f77134 Get rid of unneeded includes of <net/if.h>. 2000-09-28 06:42:55 +00:00
guy
37543fd5b1 Cast an string constant argument to "u_char *", to avoid warnings from
some compilers.
2000-09-24 07:43:26 +00:00
guy
536f512583 Add an "ip.h" header, to declare the IP stuff needed by dissectors, and
have dissectors include them rather than <netinet/ip.h> or
<netinet/ip_var.h>, if they actually need that stuff.

Put the declarations of the ICMP stuff directly into "print-icmp.c".

Remove all unnecessary includes of <netinet/ip*.h> files.

Copy the byte-order stuff from "nameser.h" into "tcp.h".
2000-09-23 08:54:24 +00:00