Commit Graph

2798 Commits

Author SHA1 Message Date
peppe
6e3dfa3ca3 The peer polling interval is an exponent; treat it as such.
RFC 1119 says

	Peer Poll Interval (peer.ppoll, pkt.ppoll): This is a signed
	    integer indicating the minimum interval between messages
	    sent by the peer, in seconds as a power of two.  For
	    instance, a alue of six indicates a minimum interval of 64
	    seconds.

so print both the raw value and 2^{raw value}, showing the latter.

Patch from Debian bug 686276.

Reviewed-By: Guy Harris <guy@alum.mit.edu>
2012-11-12 22:01:16 -08:00
Xin LI
6ad73bbdf8 "the the" -> "the". 2012-10-06 12:05:42 -07:00
Guy Harris
47a1858cb4 More strictly check for numbers as arguments to -i.
Use strtol() and only treat the argument as a number if it's *all*
number, so that interface names such as 192_1_2 aren't treated as
"interface number 192".
2012-09-27 21:13:02 -07:00
Guy Harris
e9a15a0dab Use PATH_MAX, not NAME_MAX.
NAME_MAX is the maximum length of a file pathname *component*; PATH_MAX
is the maximum length of a file pathname.  We're dealing with pathnames,
so use PATH_MAX.  (On some systems, NAME_MAX can be as low as 14,
presumably for binary compatibility with V7-era data structures
containing file names, as there are probably few if any non-historic
UN*Xes around with 14-character file name limitations.)

Boost the default PATH_MAX to 1024 while we're at it.
2012-09-27 20:50:35 -07:00
Guy Harris
d16e61a7f3 As we're always printing "LLDP, length XXX", don't do it for the system name. 2012-06-30 16:11:10 -07:00
Guy Harris
53343822c5 Note that we now document "-T carp". 2012-06-30 15:51:32 -07:00
Guy Harris
a1ef0f05fe Document "-T carp". 2012-06-30 15:50:11 -07:00
Guy Harris
063ac47407 Update for changes in the 4.3 branch. 2012-06-30 12:46:50 -07:00
Romain Francoise
edc8f18cab LLDP: print packet protocol at all verbosity levels
The LLDP printer doesn't show the packet protocol unless -v is used,
which results in pretty useless output lines where only the timestamp is
present. Make sure we include the default protocol+length output even in
default mode.
2012-06-30 12:43:15 -07:00
Guy Harris
9c3e5c52c1 No declarations in the middle of a block - not all C compilers support that. 2012-06-10 13:31:14 -07:00
Guy Harris
baff59beb6 Fix "no IPv6" code path. 2012-06-09 12:18:59 -07:00
Guy Harris
32c0d7b91a Get rid of unused (but set) variable. 2012-06-08 19:15:51 -07:00
Guy Harris
eb55734b6d Check the return value of some print routines.
Some routines return -1 on error; bail and return -1 if they do.
2012-06-08 19:14:32 -07:00
Guy Harris
723ebba2d3 Add some attribute/TLV length checks.
Make sure we don't run past the end of a BGP attribute or LDP TLV when
dissecting the attribute/TLV.

Make some of the code do a bit more of a "step the pointer through the
data"-style dissection; that was done while debugging the changes in
question.  It also fixes up some code to not check for more data than
should actually be there.

Update references to RFC 4906 from the draft, and note that RFC 4447
replaces it.
2012-06-08 19:07:53 -07:00
yekm
42a8c230d4 minor manpage fix 2012-06-08 11:08:45 -07:00
Romain Francoise
3055784739 spelling fixes 2012-06-08 11:08:07 -07:00
Michael Richardson
396c4a6d1f updated platforms 2012-06-08 11:06:52 -07:00
Guy Harris
6c3decf09f 0x%02d is silly - 0x means "hex", so it should be 0x%02x.
Found by Xavier Heiny.
2012-06-08 10:14:55 -07:00
Guy Harris
7efa1d76d8 "lmp.new" isn't a checked-in file; don't make it part of the distribution. 2012-06-08 00:43:53 -07:00
Guy Harris
d35aab4779 Fix printing of 64-bit quantities.
Do *NOT* assume that "%l[doxu]x" - or "%ll[doxu]" - is the way to print
a 64-bit quantity; on UN*X, it might be a "long" or a "long long",
depending on whether you're on a 32-bit or 64-bit platform and, on
Windows with MSVC++, it's not a long (even in 64-bit mode) and doesn't
use "%ll[doxu]", either.  Instead, use PRI[doxu]64; that's what C99
defines, and what we define ourselves if the C environment doesn't
define it.
2012-06-07 22:13:07 -07:00
Michael Richardson
1a0dfc6140 added missing test files to releasetar 2012-04-07 21:18:44 -04:00
Michael Richardson
0b756f1349 do not ship bittypes.h 2012-04-07 20:47:44 -04:00
Michael Richardson
0020be6612 do not convert protocol to names if -n flag 2012-04-07 20:46:35 -04:00
Michael Richardson
3cc6f4ea2a updated test case outputs 2012-04-03 15:57:13 -04:00
Michael Richardson
61ee5b8385 prep for 4.3.0 release 2012-04-03 13:28:00 -04:00
Michael Richardson
e3581ca17e fixes from Jamal Hadi Salim <hadi@mojatatu.com> for forces: SPARSE data (per RFC 5810) 2012-03-29 16:08:35 +02:00
Michael Richardson
f6d656854a whitespace changes in print-ip.c 2012-03-29 16:05:15 +02:00
Michael Richardson
02da8c74d9 added icmpv6 test case 2012-03-29 16:04:51 +02:00
Michael Richardson
4944846e5d error in passed calculation 2012-03-29 16:04:02 +02:00
Guy Harris
56a6db2e51 Give more information on -l, and note that -U works without -w.
Note that -l, on Windows (i.e., in WinDump), is unbuffered, not
line-buffered, and describe -U as an alternative (that doesn't have that
problem on Windows).

Note that -U does packet-buffering without -w.

Fix up the formatting of the example command lines with -l.
2012-03-10 15:23:50 -08:00
Guy Harris
eb7f8679ca Discuss buffering when describing the -w flag.
Mention that the output of tcpdump -w is buffered, and note that this
means packets won't necessarily show up in the output as soon as they're
received, so programs reading that output won't see them immediately,
and note that the -U flag forces "packet buffering" so that a reader
will see the packets as soon as they're received.
2012-03-10 14:57:00 -08:00
Guy Harris
02efb7bdd0 Fix the other typo, so setting CPPFLAGS in the environment works correctly.
Based-On-Patch-From: Simon Ruderich <simon@ruderich.org>
2012-03-05 08:12:32 -08:00
Guy Harris
a02d547a6f Ask for the libpcap Makefile while we're at it.
...so that we can see what's being used to turn grammar.y into
grammar.c.

While we're at it, say "config.log file from the libpcap source
directory", in the hopes of making it more likely that we'll get it in
addition to the tcpdump config.log.
2012-03-03 16:10:42 -08:00
Guy Harris
29c908c198 Fix typo, so setting CPPFLAGS in the environment works correctly.
Based-On-Patch-From: Simon Ruderich <simon@ruderich.org>
2012-03-03 13:36:17 -08:00
Guy Harris
e2b98d2cc6 Ask for more information if we don't find pcap_loop.
I give up.

People keep reporting that the configure process for tcpdump fails to
find pcap_loop, and the config.log file they send us says there's no
pcap_parse in libpcap, which suggests that something went wrong in the
build process for libpcap; perhaps they don't have Bison and the
configure script got confused and failed to cause the parser to be named
"pcap_parse", or something such as that, or perhaps Bison was recently
"improved" in a fashion that breaks that, but I've never been able to
reproduce this on any of the Linux distribution installations to which
*I* have access.

I therefore ask them to send the config.log output and make output for
libpcap; *not one of the reporters of this problem* has bothered to send
that information, so we're stuck.  Perhaps they don't care enough (in
which case, why did they bother asking us about it?), or perhaps they're
annoyed that we asked them a further question rather than Just Fixing
The Problem(TM) (in which case, all I have to say is "welcome to the
Wonderful World Of Computer Software(TM) - get used to it").

So let's just ask for all that information.  (I would not be surprised
if this doesn't suffice and that they *still* just send us the tcpdump
config.log output, but at least I'll be able to tell them that they
should have Read The Fine Error Message(TM).)
2012-03-03 13:32:11 -08:00
Guy Harris
7e4eb0a86c Fix printing of BGP optional headers.
Anonymously contributed patch; tested with Cisco and Arista routers by
the patch contributor.
2012-03-02 17:30:32 -08: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
Guy Harris
54825f266a Put the addresses early in the message format, and handle short messages.
Putting the addresses after "TIPC vX.Y" matches other protocols, such as
IPv4/IPv6.

Not all messages have full headers.

Also, constify some parameters and variables.
2012-02-29 01:09:40 -08:00
Guy Harris
9918c89832 Print only one line in non-verbose mode.
Also, don't print extra blank lines in verbose mode.
2012-02-28 21:12:26 -08:00
ABHIMANYU
2c233065b6 TIPC support.
Reviewed-and-much-modified-by: Guy Harris <guy@alum.mit.edu>
2012-02-28 20:36:55 -08:00
Guy Harris
93f33e57f5 Print a space after the options if there are any options. 2012-02-28 15:45:48 -08:00
Matthew Luckie
329023dbb2 Get rid of extra blank after unknown options.
Reviewed-By: Guy Harris <guy@alum.mit.edu>
2012-02-28 15:41:12 -08:00
Dagobert Michelsen
5d61759b24 Use expr instead of bashisms.
Reviewed-By: Guy Harris <guy@alum.mit.edu>
2012-02-28 15:31:38 -08:00
Michael Richardson
d02caa897a Merge remote branch 'github/master' 2012-02-23 20:15:15 -05:00
Michael Richardson
424d115b8b Merge pull request #7 from clifffrey/fix-lldp-network-policy
Fix LLDP Network Policy bit definitions.
2012-02-23 17:14:29 -08:00
Michael Richardson
aa7d6575c6 Merge pull request #6 from fenner/master
IGMPv3 Max Response Time is in units of 0.1 second.
2012-02-23 17:13:35 -08:00
Michael Richardson
dbe12c41ed Merge pull request #5 from kmaehashi/feature-SIGUSR1
Use SIGUSR1 to request info when SIGINFO is not defined
2012-02-23 17:12:26 -08:00
Michael Richardson
a50985b582 added test packet for icmpv6 advertisement interval fix 2012-02-23 20:11:32 -05:00
Cliff Frey
a71e402b5c Fix LLDP Network Policy bit definitions. 2012-02-23 11:19:48 -08:00