summaryrefslogtreecommitdiff
path: root/print-sll.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* More fixes for uint8_t being shorter than u_int8_t.Guy Harris2014-04-231-1/+1
| | | | Fix a typo while we're at it.
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-6/+6
| | | | | | | | | 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-1/+1
| | | | | | | | 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.
* make use of ND_DEFAULTPRINT()Denis Ovsienko2014-03-261-2/+2
|
* NDOize LLC decoderDenis Ovsienko2014-03-151-1/+1
|
* make use of NETDISSECT_REWORKEDDenis Ovsienko2014-03-151-0/+1
| | | | | Update the already converted decoders to define the macro and to include interface.h instead of netdissect.h. Fix incurred compile errors.
* NDOize DCCP, Linux socket and RPKI-Router decodersDenis Ovsienko2014-03-141-37/+34
|
* NDOize 8 more small decodersDenis Ovsienko2014-03-131-1/+1
| | | | | 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
* 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.
* Merge branch 'master' of git+ssh://bpf.tcpdump.org/tcpdump/master/git/tcpdumpMichael Richardson2014-01-011-1/+88
|\ | | | | | | | | Conflicts: enc.h
| * Pull a bunch of headers into the only source file that includes them.Guy Harris2013-12-301-1/+88
| | | | | | | | | | | | For headers included in only one source file, put the header contents in the source file in question, and get rid of a bunch of stuff from the header not used in the source file.
* | whitespace changesMichael Richardson2014-01-011-1/+1
|/
* justify declarations of struct tok arraysDenis Ovsienko2013-09-241-1/+1
| | | | | | Make sure all of them are declared const and most of them -- static. Proper declaration of token arrays is a common review point for new code that is based on existing decoders. Thus fix the issue at its root.
* reworked print-ether to use netdissectMichael Richardson2010-10-071-1/+1
|
* Process VLAN frames and Alteon jumbo frames in the Ethernet printer.Guy Harris2010-02-211-7/+38
| | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | 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 Joao Medeiros: fix typo in print-sll.c (report 802.2 packets asGuy (Core OS) Harris2009-06-031-1/+1
| | | | 802.2, not 802.3).
* Have print_llc() clear out the extracted_ethertype argument, rather thanguy2005-11-131-2/+4
| | | | | | | | | | | | | | having its callers do so - some of its callers *weren't* doing so, leaving random junk in that argument in some cases. When checking for "802.3-encapsulated" IPX, check the raw values of the SSAP and DSAP for 0xFF, don't check them after the low-order bit has been masked off. The "flag" values in the LLC header aren't bits, they're combinations of bits, including the combination "no bits"; don't use "bittok2str()" on them. Also, combine the proper bits, namely the C/R bit (which we weren't combining) and the P/F bit (which we were).
* Add a flag to suppress the "default_print()" call made in variousguy2005-07-071-3/+3
| | | | | | | | link-layer print routines if no other print routine claimed the packet. Test whether that flag is set rather than testing whether neither of -x or -q were specified, and have -x, -q, *and* -X set that flag, so that -X suppresses it just as -x does. That way you don't get those pckets dumped twice if -X was specified.
* Don't show the packet type as an Ethernet type if it's not one.guy2005-04-261-6/+41
|
* -use tok2str() for pkt type printinghannes2004-10-281-33/+17
| | | | | | -use the strings "In" "Out" when printing directions -make more use of EXTRACT_ macros -use the token table for printing the ethertypes
* Fix up a bunch of comments - the on-the-wire length field in aguy2004-03-171-2/+2
| | | | pcap_pkthdr is "len", not "length".
* Have the configure script arrange that the Makefile define _U_guy2003-11-161-4/+4
| | | | | | | | | | 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.
* From Neil Spring:guy2003-11-151-4/+4
| | | | | | | | | | | 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".
* Hoist a bunch of stuff that should be done by all if_print routines intoguy2002-12-191-30/+6
| | | | | | tcpdump.c. Have if_print routines return the length of the link-layer header, so that the common code knows how to skip the link-layer header when printing the packet in hex/ASCII.
* Add a new routine "default_print_packet()", which takes a pointer to theguy2002-12-181-2/+14
| | | | | | | | | | | | | | | | | | | | | | | beginning of the raw packet data, the captured length of the raw packet data, and the length of the link-layer header, and: if "-e" was specified, prints all the raw packet data; if "-e" was not specified, prints all the raw packet data past the link-layer header, if there is any. Use that routine in all the "xxx_if_print()" routines if "-x" was specified. Make "arcnet_encap_print()" static - it's not used outside "print-arcnet.c". Add missing info printing code to "atm_if_print()". Print the packet data in "lane_if_print()", not in "lane_print()", as "lane_print()" can be called from other "xxx_if_print()" routines, and those routines will also print the packet data if "-x" was specified - no need to print it twice.
* We no longer use "packetp" for anything, so eliminate it. (If anyguy2002-12-181-54/+6
| | | | | | | | | | | | | dissector really needs source and destination MAC addresses, we should make global pointers to them - which would be null for packets lacking MAC addresses, so dissectors that need them will need to do something sensible if those pointers are null.) Don't fake up an Ethernet header if there aren't any MAC addresses to use when faking it up. "bp_chaddr" in "print-bootp.c" is an array, so "bp->bp_chaddr" cannot be null, and there's no need to test for it not being null.
* Get rid of the "-Wno-unused" flag, and fix up most of theguy2002-09-051-4/+4
| | | | | | | | | | | | | | | 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".
* Added support for Win32, based on WinPcap.risso2002-08-011-6/+2
|
* Get rid of unneeded incomplete definitions of "struct mbuf" and "structguy2002-06-011-4/+1
| | | | | rtentry", and unneded includes of <sys/uio.h>, <sys/file.h>, and <sys/ioctl.h>.
* Put the infodelay wrapping into the remaining "XXX_if_print()" routines.guy2001-07-051-1/+5
| | | | | | | | | | | | | | Split the Cisco HDLC printer into "chdlc_if_print()", which does the stuff expected of a low-level print routine (printing the time stamp, printing the final newline, doing the infodelay stuff) and "chdlc_print()", which doesn't do that stuff. This lets us clean up "ppp_hdlc_if_print()" a bit - it can just print the time stamp at the beginning, and do the infodelay stuff at the end, without having to treat Cisco HDLC specially by skipping the time stamp printing. (This also ensures that the time stamp is always printed, which wasn't the case before.) Print the missing final newline in "pppoe_if_print()".
* Get rid of definitions of "packetp" and "snapend" outsideguy2001-06-081-4/+1
| | | | "print-ether.c" - the one in "print-ether.c" is sufficient.
* LLC frames with a DSAP and LSAP of 0xe0 are IPX frames, and so are Linuxguy2001-01-151-1/+8
| | | | | cooked frames with a type value of LINUX_SLL_P_802_3; dissect them as such.
* Have the Linux cooked dissector set "packetp" to point to the fakeguy2000-12-231-9/+12
| | | | Ethernet header it constructs.
* Put the LINUX_SLL_P_ definitions back, and check for at least some ofguy2000-12-221-7/+23
| | | | | | | | | | | | | | | | | them in "print-sll.c" - as a cooked-mode capture may be reading from non-Ethernet, non-802.x devices, it may well see some ETH_P_/LINUX_SLL_P_ types that don't mean "this is an 802.2 LLC frame". We currently assume that the ETH_P_ values won't change in the kernel, so we don't have to explicitly map them. In various link-layer packet printers, if we don't handle the next layer up of packet type, and are printing the link-layer header, use the correct pointer to that header (i.e., if we've stepped "p" past the link-layer header, don't use "p", use a pointer to the beginning of the packet), and use the correct length (i.e., if we've subtracted the length of the link-layer header, add it back in, so that we always print the full packet length).
* Add support for a new link layer type DLT_LINUX_SLL, for use when doingguy2000-12-211-0/+219
live captures with a "cooked" (SOCK_DGRAM) rather than a "raw" (SOCK_RAW) PF_PACKET socket; it includes a bunch of the fields from the "struct sockaddr_ll" you get in a "recvfrom()", including the Ethernet protocol field.