summaryrefslogtreecommitdiff
path: root/print-ether.c
Commit message (Collapse)AuthorAgeFilesLines
...
* CVE-2016-7985,7986/Change the way protocols print link-layer addresses.Guy Harris2017-01-181-7/+13
| | | | | | | | | | | | | | | If a protocol that runs under a link-layer protocol would print the link-layer addresses for the packet as source and destination addresses for the packet, don't have it blithely assume those link-layer addresses are present or are at a particular offset from the beginning of that protocol's data; Ethertypes, for example, are used by a number of protocols, not all of which have Ethernet headers and not all of which have any MAC headers. Instead, pass the printers for those protocols structures with a pointer to the address data and a pointer to a routine that prints the address. Fixes some heap overflows found with American Fuzzy Lop by Hanno Böck.
* Move the printer summaries from INSTALL.txt to each printerFrancois-Xavier Le Bail2016-08-141-0/+2
| | | | | | | | with the tag '\summary:' for greping. Remark: Currently some printers have no summary line. Moreover: Summarize all printers with a single line in INSTALL.txt
* The last 2 bytes of an Ethernet header are the "length/type field".Guy Harris2015-12-161-22/+22
| | | | | | | | | | Call it that, to indicate that it's not necessarily a type field. While we're at it, get rid of references to "DEC/Intel/Xerox" and "802.3" Ethernet headers in comments; since 802.3y, the 802.3 standard supports both "DIX" frames, with a type field, and earlier 802.3 frames, with a length field, so there's only one version of Ethernet, 802.3, which supports frames with type fields and frames with length fields.
* Ethernet: Print the Length/Type field as length when neededFrancois-Xavier Le Bail2015-12-161-8/+10
| | | | | | | | | | Reference: IEEE Std 802.3-2012 "If the value of this field is less than or equal to 1500 decimal (05DC hexadecimal), then the Length/Type field indicates the number of MAC client data octets contained in the subsequent MAC Client Data field of the basic frame (Length interpretation)." Update the output of a test accordingly.
* Fix some commentsFrancois-Xavier Le Bail2015-10-271-11/+11
| | | | | Moreover: Fix mixed spaces/tabs.
* Rename 'tcpdump-stdinc.h' to 'netdissect-stdinc.h'Francois-Xavier Le Bail2015-09-101-1/+1
| | | | Get the full log via: git log --follow netdissect-stdinc.h
* Printers must include 'netdissect.h', not 'interface.h'Francois-Xavier Le Bail2015-09-051-1/+1
|
* Fix a bunch of de-constifications.Guy Harris2015-04-261-3/+3
|
* Add support for the Marvell Extended Distributed Switch Architecture headerAndrew Lunn2015-04-251-0/+5
| | | | | | | | | | This header can be used with Marvell switches to direct packets in/out of a specific port in a tree of interconnected switches. The header uses its own Ethertype of 0xdada. By default, only brief output is printed, showing the switch device, port, and vlan the packet is to/from. However if -e is given, to print the link-level header, all fields are printed.
* Skip the LLC and SNAP headers with -x.Guy Harris2015-04-171-18/+31
| | | | | | | Have llc_print() return the length of the LLC header, plus the length of the SNAP header, if available - or, if it couldn't dissect the payload, return the *negative* of that sum. Use that return value in link-layer printers.
* Clean up printing of LLC packets.Guy Harris2015-04-171-17/+2
| | | | | | | | | | | | | | | | | | | Don't print LLC header information for SNAP packets; if we have a SNAP header, just call snap_print() and return its return value, regardless of whether it's 1 or 0, don't fall into the code to print raw LLC header information - and don't print it with -e, either. If llc_print() returns 0, just call the default packet printer, don't print the MAC-layer header or the extracted ethertype - llc_print() will print the source and destination MAC addresses and whatever type information is in the LLC or SNAP headers. If we don't know the DSAP/LSAP, and it's an information frame (numbered or not) and not an XID frame, return 0, so that we give a hex dump of the raw payload. In addition, print the length when printing SNAP header information with -e.
* dismiss NETDISSECT_REWORKED macroDenis Ovsienko2015-03-221-1/+0
| | | | | | | 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.
* refine 802.1Q VLAN TCI decodingDenis Ovsienko2015-01-291-4/+1
| | | | | 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.
* Leave it up to ip6_print() to handle non-IPv6-capable systems.Guy Harris2014-10-011-2/+0
| | | | | | | | | | | | Always define and declare ip6_print(), always compile print-ip6.c, and always call it if we recognize a payload as IPv6. If INET6 isn't defined, ip6_print() will just print the length and note that printing isn't supported. That way, we don't do weird dissection of IPv6 packets on systems without IPv6 support, due to, for example, ethertype_print() returning 0 ("not dissected") for IPv6 packets on those systems (IPv6-over-Frame Relay was dissected weirdly due to this).
* print-ether: print 'ethertype IEEE1905.1' instead of 'ethertype Unknown'Francois-Xavier Le Bail2014-05-051-0/+2
| | | | | not a full decoder, uses default print reference: http://standards.ieee.org/develop/regauth/ethertype/eth.txt
* AoE: add version 1 decoder (GH #298)Denis Ovsienko2014-05-041-0/+5
| | | | | | | The sample capture was produced with two Linux hosts (aoetools version 36, kernel module version 85, vblade version 21). One of the hosts exported a 1MB block device containing a freshly created filesystem and the other mounted it, wrote a small file and then unmounted.
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-2/+2
| | | | | | | | | 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.
* Netdissectify the to-name resolution routines.Guy Harris2014-04-041-2/+2
| | | | | | | | 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.
* NDOize LLDP, PPP and RSVP decodersDenis Ovsienko2014-04-021-2/+2
|
* NDOize DECnet, OSPF and TCP decodersDenis Ovsienko2014-04-021-1/+1
|
* NDOize EAP, IEEE CFM, lwres, SIP & Syslog decodersDenis Ovsienko2014-04-011-1/+1
|
* NDOize AppleTalk, CDP and Kerberos decodersDenis Ovsienko2014-03-281-2/+2
|
* NDOize ISO CLNS decoderDenis Ovsienko2014-03-281-3/+3
|
* make use of ND_DEFAULTPRINT()Denis Ovsienko2014-03-261-3/+3
|
* finalize some previous NDO conversionsDenis Ovsienko2014-03-261-7/+7
| | | | | | Eliminate a number of fputs(), putchar() and fflush() uses. Justify preprocessor directives. Don't typecast ND_PRINT() to void and fix some indentation.
* NDOize OpenFlow, IEEE slow and telnet decodersDenis Ovsienko2014-03-171-1/+1
|
* NDOize LLC decoderDenis Ovsienko2014-03-151-2/+2
|
* finish switching Ethernet decoder to NDODenis Ovsienko2014-03-151-5/+3
|
* NDOize FDDI, MPCP, Token Ring, VQP and Zephyr decodersDenis Ovsienko2014-03-141-1/+1
|
* NDOize 8 more small decodersDenis Ovsienko2014-03-131-3/+3
| | | | | This change converts ZeroMQ, IPX, MPLS, IPv6 options, PPPoE, RIPng, PFLOG and Sun RPC decoders.
* don't include pcap.h needlesslyDenis Ovsienko2014-02-281-1/+0
| | | | | | | | | | Both interface.h and netdissect.h include <pcap.h>, thus most files should not include it regardless if these need it or not. The only exceptions so far remain: * addrtoname.c * missing/datalinks.c * missing/dlnames.c * tcpdump.c
* add a decoder for Loopback/CTPDenis Ovsienko2014-01-091-0/+1
| | | | | | | tcpdump used to print an empty line for a Loopback (CTP) packet, which many Cisco switches send by default every 10 seconds. This commit adds a decoder for the protocol and a test case, which uses the sample capture from Wireshark wiki (configuration_test_protocol_aka_loop.pcap).
* remove tcpdump's own CVS keywordsDenis Ovsienko2014-01-031-4/+0
| | | | | | 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.
* whitespace changesMichael Richardson2014-01-011-4/+4
|
* Adding support for ISO CALM FAST and ETSI GeoNetworkingOla Martin Lykkja2013-06-251-0/+12
|
* fix function 'msnlb_print', unused parameter 'length'fxlb2013-03-151-1/+1
|
* Add MS NLB heartbeat ethertype, as well as a basic printerRomain Francoise2013-02-231-0/+5
| | | | | The protocol is undocumented but Wireshark extracts some useful bits of info from the packet, so it was used as a reference.
* TIPC support.ABHIMANYU2012-02-281-1/+5
| | | | Reviewed-and-much-modified-by: Guy Harris <guy@alum.mit.edu>
* Change name of Hilscher link types to say NETANALYER.Guy Harris2011-09-151-9/+9
| | | | | That makes the names a bit shorter, and mentions the specific Hilscher product to which they apply.
* Add printers for the Hilscher Ethernet link-layer types.Guy Harris2011-09-151-0/+57
|
* Convert the IPv6 printer to use netdissect.Guy Harris2010-11-071-1/+1
|
* Use ND_PRINT().Guy Harris2010-11-061-14/+14
|
* added support and test case for QinQ packetsMichael Richardson2010-10-071-1/+7
|
* reworked print-ether to use netdissectMichael Richardson2010-10-071-46/+52
|
* Process VLAN frames and Alteon jumbo frames in the Ethernet printer.Guy Harris2010-02-211-89/+86
| | | | | | | | | | | | | | | | | Instead of having the Ethernet-type handler process the VLAN and Alteon jumbo frame Ethernet type values, process them in the Ethernet (and Linux cooked-mode) dissectors. This makes it easier for the right MAC addresses to be printed for those packets. As part of that, rename ether_encap_print() to ethertype_print() - it doesn't print encapsulated Ethernet frames, it prints payloads whose packet type is indicated by an Ethernet type field value - and remove the no-longer-needed "extracted Ethernet type" argument. That also lets us eliminate it from the SNAP print routine. Make ether_print() take a function, and an argument to pass to that function, as parameters, so that, for example, the ATM LANE printer can use it and put the LEC ID into the link-layer headeer printout.
* Don't directly fetch multi-byte integers from packets.Guy Harris2010-02-211-13/+20
| | | | | | | | Use the EXTRACT_ macros to extract multi-byte integral values from packets, rather than just dereferencing pointers into the packet; there is no guarantee that the packet data will be aligned on the right boundary, and there is no guarantee that, if they're not, a direct access will work correctly.
* From FreeBSD: handle the non-standard Ethertypes for PPPoE that someGuy Harris2009-07-251-0/+2
| | | | 3Com hardware uses.
* From William J. Hulley: support for the Transparent Ethernet BridgeGuy Harris2009-02-261-0/+1
| | | | ethertype in GRE.
* From Andrew Silent: Realtek Remote Control Protocol support (seeguy2008-02-061-1/+6
| | | | OpenRRCP.org.ru for details).
* add basic support for the IEEE Link Discovery Protocol as per 802.1abhannes2007-08-031-1/+6
|