summaryrefslogtreecommitdiff
path: root/print-lane.c
Commit message (Collapse)AuthorAgeFilesLines
* Use the ndo argument to lane_hdr_print().Guy Harris2010-11-061-1/+1
|
* reworked print-ether to use netdissectMichael Richardson2010-10-071-2/+2
|
* Process VLAN frames and Alteon jumbo frames in the Ethernet printer.Guy Harris2010-02-211-59/+10
| | | | | | | | | | | | | | | | | 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.
* Have print_llc() clear out the extracted_ethertype argument, rather thanguy2005-11-131-2/+1
| | | | | | | | | | | | | | 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.
* 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-28/+5
| | | | | | 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-3/+11
| | | | | | | | | | | | | | | | | | | | | | | 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-5/+4
| | | | | | | | | | | | | 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.
* The "__attribute__((packed))" tag on structures causes some files not toguy2002-12-111-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | compile with Sun C, as "interface.h" isn't being included before the structures are being declared. Furthermore, in the files that Sun C *can* compile, it doesn't cause Sun C to generate code that's safe with unaligned accesses, as "__attribute__" is defined as a do-nothing macro with compilers that don't support it. Therefore, we get rid of that tag on the structures to which it was added, and instead use "EXTRACT_16BIT()" and "EXTRACT_32BIT()" to fetch 16-bit and 32-bit big-endian quantities from packets. We also fix some other references to multi-byte quantities to get rid of code that tries to do unaligned loads on platforms that don't support them. We also throw in a hack that makes those macros use "__attribute__((packed))" on structures containing only one 16-bit or 32-bit integer to get the compiler to generate unaligned-safe code rather than doing it by hand. (GCC on SPARC produces the same code that doing it by hand does; I don't know if GCC on any other big-endian strict-alignment processor generates better code for that case. On little-endian processors, as "ntohs()" and "ntohl()" might be functions, that might actually produce worse code.) Fix some places to use "%u" rather than "%d" to print unsigned quantities.
* 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-8/+2
|
* Add SunATM support, based on code from Yen Yen Lim at North Dakota Stateguy2002-07-111-16/+62
| | | | University.
* whitespace cleanupitojun2002-06-111-5/+5
|
* 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()".
* Put the LINUX_SLL_P_ definitions back, and check for at least some ofguy2000-12-221-2/+2
| | | | | | | | | | | | | | | | | 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).
* Making "extracted_ethertype" static to "print-ether.c" broke otherguy2000-12-181-3/+5
| | | | | | | | | | | | | | dissectors that expected calls to "llc_print()" to set it. (Thanks and a tip of the hat to Olaf Kirch <okir@caldera.de> for noticing this.) Make "ether_encap_print()" and "llc_print()" take a pointer to an extracted-Ethertype variable as an argument, have "llc_print()" pass it to "ether_encap_print()", and have "ether_encap_print()" set what it points to rather than setting a static "extracted_ethertype" variable. Get rid of said static "extracted_ethertype" variable in favor of one local to "ether_if_print()", just as other link-layer dissectors have local "extracted_ethertype" variables.
* Get rid of includes of <netinet/in_systm.h>, and replace "n_short",guy2000-09-291-2/+1
| | | | "n_long", and "n_time", defined in that file, with other types.
* Get rid of unneeded includes of <net/if.h>.guy2000-09-281-2/+1
|
* Add an "ip.h" header, to declare the IP stuff needed by dissectors, andguy2000-09-231-3/+1
| | | | | | | | | | | have dissectors include them rather than <netinet/ip.h> or <netinet/ip_var.h>, if they actually need that stuff. Put the declarations of the ICMP stuff directly into "print-icmp.c". Remove all unnecessary includes of <netinet/ip*.h> files. Copy the byte-order stuff from "nameser.h" into "tcp.h".
* Add "tcp.h" and "udp.h" headers, to declare the TCP and UDP stuff neededguy2000-09-231-4/+1
| | | | | | | | | by dissectors, and have dissectors include them rather than <netinet/udp.h>, <netinet/udp_var.h>, or <netinet/tcp.h>, if they actually need that stuff. Remove all unnecessary includes of <netinet/udp*.h> or <netinet/tcp*.h> files.
* Add definitions of Ethernet types fromguy2000-09-231-2/+2
| | | | | | | | | | | | | | | | "linux-includes/netinet/if_ether.h" to "ethertype.h". Move other stuff used by dissectors from <netinet/if_ether.h> to "ether.h", along the lines of "fddi.h" and "token.h". Move ARP declarations from BSD include files to "print-arp.c". Remove from dissectors includes of <netinet/if_ether.h>, and add includes of "ethertype.h" and/or "ether.h" as necessary. Get rid of configuration options that test declarations now made in "ether.h" or "print-arp.c", as those declarations are now under our control, not the OS's control.
* (packetp, snapend): remove duplicate static declarationsassar2000-07-101-4/+1
|
* remove <netinet/tcpip.h>. including this header causes errors withassar2000-01-091-2/+1
| | | | Kame V6 stack and nothing from it was used anyway.
* Switch to config.h instead of passing defines in DEFS.fenner1999-11-211-1/+5
|
* print of ATM LanEmulation. From Marko Kiiskila <carnil@cs.tut.fi> by way of ↵assar1999-11-211-0/+144
<kuznet@ms2.inr.ac.ru>