Commit Graph

39 Commits

Author SHA1 Message Date
Guy Harris
0318fa8b61 CVE-2017-12900/Properly terminate all struct tok arrays.
This fixes a buffer over-read discovered by Forcepoint's security
researchers Otto Airamo & Antti Levomäki.

Add tests using the capture files supplied by the reporter(s).
2017-09-13 12:25:44 +01:00
Hannes Gredler
ff8464bffd zero change: update Hannes Gredler's email 2017-07-28 17:44:12 +02:00
Guy Harris
40185ca67a Discard result of fn_printn() calls.
We've already done checks to see whether we'll run past the end of the
packet, so there's no need to see whether fn_printn() did so.

Squelches some Coverity complaints.
2017-01-18 09:16:42 +01:00
Guy Harris
42718eb6f8 Clean up white space. 2017-01-13 20:23:46 -08:00
Eliot Lear
4b2804bffd Updating to use fn_printn 2016-12-31 08:22:35 +01:00
Eliot Lear
01e8e1485f Implement IANA OUI and LLDP MUD option
The changes associated with this commit introduce the IANA subtree
for LLDP and its first element, the MUDURL, as documented in
draft-ietf-opsawg-mud.  This is similar to the changes made for
DHCP and DHCPv6.

[updated to use fn_printn]
2016-12-31 08:17:55 +01:00
Eliot Lear
637e93289d Implement IANA OUI and LLDP MUD option
The changes associated with this commit introduce the IANA subtree
for LLDP and its first element, the MUDURL, as documented in
draft-ietf-opsawg-mud.  This is similar to the changes made for
DHCP and DHCPv6.
2016-12-30 14:52:56 +01:00
Francois-Xavier Le Bail
b38f324af9 Add a summary comment in all other printers
Moreover:
Remove some redundant comments
Update some summary comments
Update the specification URL for ATA over Ethernet (AoE) protocol
2016-08-15 22:42:38 +02:00
Denis Ovsienko
bd2b067d7b call ipaddr_string() instead of getname()
Same as in the previous commit.
2016-07-11 11:56:53 +01:00
Denis Ovsienko
d2aa4eec28 call ip6addr_string() instead of getname6()
This replaces a few explicit type casts with one type cast in the macro
and makes the source code mean one thing with one term instead of two.
2016-07-11 11:56:29 +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
99c91c3aec Rename 'tcpdump-stdinc.h' to 'netdissect-stdinc.h'
Get the full log via: git log --follow netdissect-stdinc.h
2015-09-10 08:50:40 +02:00
Francois-Xavier Le Bail
c1c3c77463 Printers must include 'netdissect.h', not 'interface.h' 2015-09-05 23:35:58 +02:00
Denis Ovsienko
38700c7f24 dismiss NETDISSECT_REWORKED macro
The purpose of this macro was to enable the file-by-file switch to NDO,
after which only tcpdump.c had a use of it and the definitions guarded
by it. Update tcpdump.c not to require them any more and dismiss the
unused definitions.
2015-03-22 10:06:15 +00:00
Denis Ovsienko
60a835d80f clean K&R style up in function declarations a bit
The function body should have its opening brace on the next line.
2015-03-05 10:35:03 +00:00
Guy Harris
1363a442cc Get rid of fetch whose result isn't used.
Put in a comment to indicate what we're processing (and that we fetch
the entire array as a 32-bit number and extract the nibbles from it).
2014-07-07 14:22:08 -07:00
Guy Harris
ed85e20e4d u_intN_t is dead, long live uintN_t.
And, as we require at least autoconf 2.61, and as autoconf 2.61 and
later have AC_TYPE_UINTn_T and AC_TYPE_INTn_T macros, we use them to
define the uintN_t and intN_t macros if the system doesn't define them
for us.

This lets us get rid of bitypes.h as well.
2014-04-23 00:20:40 -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
fc6f112b40 NDOize LLDP, PPP and RSVP decoders 2014-04-02 18:22:28 +04:00
Denis Ovsienko
51670d1949 NDOize safeputs() and safeputchar() 2014-04-01 19:46:05 +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
Michael Richardson
ac910c086e ndo-ize print-ascii: hex_print_with_offset() 2014-01-01 21:31:18 -05:00
Michael Richardson
a97fb2f3ae whitespace changes 2014-01-01 21:31:18 -05:00
Guy Harris
1da88e5c5d Make some routines used outside print-lldp.c static. 2013-08-29 10:49:43 -07:00
Udayakumar
81896b0728 Added support for DCB and EVB TLVs
Added the support for ETS Configuration TLV, ETS Recommendation TLV, PFC Configuration TLV, Application Priority TLV, EVB TLV and CDCP TLV.
2013-08-29 10:12:37 +05:30
Guy Harris
5941b99aef As we're always printing "LLDP, length XXX", don't do it for the system name. 2012-06-30 16:10:40 -07:00
Romain Francoise
a2fe74dd71 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:42:41 -07:00
Cliff Frey
a71e402b5c Fix LLDP Network Policy bit definitions. 2012-02-23 11:19:48 -08:00
Guy Harris
1ac5009987 Add error checking and support for DCB Exchange protocol (DCBX) version 1.01.
From Kaladhar Musunuru <kaladharm@sourceforge.net>:

Added support for DCB Exchange protocol (DCBX) version 1.01.
http://www.ieee802.org/1/files/public/docs2008/az-wadekar-dcbx-capability-exchange-discovery-protocol-1108-v1.01.pdf

DCBX protocol exchanges control state machine and generic feature state
machine parameters as Organizationally specific TLVs.  The OUI used for
the DCBX TLV 1.01 is 0x001B21.  Following TLVs are decoded:

- Control state
- Priority Groups (PG)
- Priority-based Flow Control (PFC)
- Application Protocol (APP)

From me:

Add a bunch of additional error checking, and sort the main switch
statement by TLV code (and thus by the order in the specification).
Also update/add indications of what standards document what items.
2011-04-28 11:24:12 -07:00
hannes
a7c56c0155 bugfix in the lldp printer, when referencing the key for printing aggregation values 2008-03-20 09:30:56 +00:00
hannes
33808368e6 From Carles Kishimoto <carles.kishimoto@gmail.com>:
add support for the IEEE 802.1 private extensions to the lldp printer
2008-01-09 09:40:47 +00:00
hannes
73b4367162 From Carles Kishimoto <carles.kishimoto@gmail.com>:
bugfix: macphy codepoints in the lldp printer
  misc typos
2007-12-08 09:52:31 +00:00
hannes
353c35e93f from Carles Kishimoto <carles.kishimoto@gmail.com>: add support for the TIA/MED location ids 2007-08-20 12:18:30 +00:00
hannes
707a7ce369 from Carles Kishimoto <carles.kishimoto@gmail.com>: add TIA/MED private extensions to the LLDP printer 2007-08-19 09:14:49 +00:00
hannes
1449434b8a move the IEEE printer to a dedicated function as there will be more private TLV printers to come 2007-08-14 17:09:35 +00:00
hannes
d7d590ddeb from Carles Kishimoto <carles.kishimoto@gmail.com>: add IEEE organisation specific subtype printing to the LLDP printer 2007-08-13 12:55:17 +00:00
hannes
d97155c53f fix a couple of code-style issues in the LLDP printer 2007-08-09 18:43:44 +00:00
hannes
af9219c6d8 add support for all the outstanding LLDP TLVs 2007-08-08 14:39:52 +00:00
hannes
bbb4050969 add basic support for the IEEE Link Discovery Protocol as per 802.1ab 2007-08-03 11:03:19 +00:00