Commit Graph

22 Commits

Author SHA1 Message Date
Guy Harris
db3f9f277f Make the hex-dumping routines for addresses take a uint8_t * argument.
Hopefully, that will convince Coverity that the result of dereferencing
those pointers will have a value between 0x00 and 0xff, and therefore
that shifting that result right by 4 bits will yield a value between 0x0
and 0xf, and therefore that this result can safely be used as an index
into the 16-element hex[] array.

I guess Coverity wants us to realize that there really *are* C
implementations out there with non-8-bit char and unsigned char values,
even though getting tcpdump to work on them will probably be a highly
entertaining exercise (not to mention that the only one I know of that's
actually being *used* are the Unisys Clearpath Dorado series, and
they're one's complement, which is yet *another* place where the port
could be entertaining...).
2018-05-14 01:52:54 -07:00
Francois-Xavier Le Bail
1d7b43bd7e Remove the etherproto_string() unused function 2018-03-09 20:49:53 +01:00
Guy Harris
0dad1934af Have ip{6}addr_string take a u_char * as the second argument.
Fix warnings that introduces.
2018-01-31 00:43:45 -08:00
Francois-Xavier Le Bail
5cea270318 Remove all storage class specifier 'register'
Let the compiler do the optimizations (or not) based on build options.

Avoid 'value has been optimized out' messages in gdb using '-O0'.
2017-12-13 19:17:47 +01:00
Francois-Xavier Le Bail
a7fc606fd5 Remove the protoid_string() unused function 2017-11-21 08:21:40 +01:00
Guy Harris
c177cb3800 CVE-2017-13016/ES-IS: Fix printing of addresses in RD PDUs.
Always print the SNPA, and flag it as such; only print it as a MAC
address if it's 6 bytes long.

Identify the NET as such.

This fixes a buffer over-read discovered by Bhargava Shastry,
SecT/TU Berlin.

Add tests using the capture files supplied by the reporter(s), modified
so the capture files won't be rejected as an invalid capture.
2017-09-13 12:25:44 +01:00
Guy Harris
11f73ad248 Don't require IPv6 library support in order to support IPv6 addresses.
Have our own routines to convert between IPv4/IPv6 addresses and
strings; that helps if, for example, we want to build binary versions of
tcpdump for Windows that can run both on NT 5 (W2K/WXP), which doesn't
have inet_ntop() or inet_pton(), and NT 6 (Vista/7/8/10), which do.  It
also means that we don't require IPv6 library support on UN*X to print
addresses (if somebody wants to build tcpdump for older UN*Xes lacking
IPv6 support in the system library or in add-on libraries).

Get rid of files in the missing directory that we don't need, and
various no-longer-necessary autoconf tests.
2015-09-17 14:56:44 -07:00
Francois-Xavier Le Bail
e847135d66 Functions in libnetdissect must use ndo_error() function 2015-09-05 22:52:11 +02:00
Denis Ovsienko
1d66439981 refine 802.1Q VLAN TCI decoding
Factor the common code out to a new function and rename the CFI bit to
DEI to match the terminology in Clause 9.6 of IEEE 802.1Q-2011.
2015-01-29 20:38:54 +00:00
Guy Harris
dbddfda2c8 More getting rid of old u_intN_t. 2014-04-23 00:45:13 -07:00
Guy Harris
1cde6435df Netdissectify the to-name resolution routines.
Have them take a netdissect_options * argument, and get the "no name
resolution" flag from it.

Move the declaration of dnaddr_string to addrtoname.h, along with the
other XXX-to-string routines.
2014-04-04 00:43:46 -07:00
Denis Ovsienko
eaef83c9ea refine some declarations in header files
Remove duplicate declarations and move some other declarations to
addrtoname.h where they belong.
2014-04-03 13:08:48 +04:00
Denis Ovsienko
fe3253b9b8 remove tcpdump's own CVS keywords
Remove lots of $Header's and a few $Id's that all belong to the former
CVS repository of tcpdump itself. These keywords have been frozen since
the migration to git in late 2008.
2014-01-03 00:59:08 +04:00
Guy Harris
2886b89df6 Back out DLT_PFSYNC support.
Unfortunately, the DLT_PFSYNC support depends on header files included
from the pfctl command's source tree, and trying to arrange to find that
would be too much trouble.
2012-02-29 21:14:50 -08:00
Guy Harris
0d2d222ffb Add DLT_PFSYNC support.
From FreeBSD PR bin/124825: tcpdump(8) does not support pfsync(4) data,
which in turn was ported over from OpenBSD.  We already have CARP
support, so we did not port that part over.
2012-02-29 01:51:27 -08:00
Dmitry Eremin-Solenikov
4e25f49680 addrtoname.[ch]: add a printer for Little-Endian 64-bit address
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
2010-03-09 18:12:39 +03:00
hannes
c15c709252 expose the BUFSIZE def to the outside world 2007-08-08 14:06:34 +00:00
hannes
aebfcfe1f6 rework the ARP printer & add support for Frame-Relay ARP 2006-02-11 22:11:40 +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
itojun
ae68164cc6 make arp_print() L2 neutral. from netbsd
TODO: recover portions that peep L2 src/dst, by passing more args from
L2 printing to arp_print().  the current code can bomb when L2 = arcnet
(because the code assumes that L2 address len == 6), for example.
2001-06-18 09:12:27 +00:00
itojun
c9d84d15c5 Bring in KAME IPv6 tcpdump. replaces esp/ah/isakmp decoder.
Hope I did not break anything.  Portability on IPv4-only node needs checking,
I'll do this very soon.  (sorry for rather jumbo commit)

XXx what is _FAVOR_BSD?
1999-10-30 05:11:06 +00:00
mcr
f555c163f9 Initial revision 1999-10-07 23:47:09 +00:00