summaryrefslogtreecommitdiff
path: root/print-fr.c
Commit message (Collapse)AuthorAgeFilesLines
* Process VLAN frames and Alteon jumbo frames in the Ethernet printer.Guy Harris2010-02-211-4/+3
| | | | | | | | | | | | | | | | | 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.
* code cosmetics: bracketize the on-liners after if statements, proper length ↵hannes2006-06-231-36/+54
| | | | decrement for ANSI LMI frames
* rework the ARP printer & add support for Frame-Relay ARPhannes2006-02-111-8/+19
|
* add support for FRF.16 Multilink Frame-Relay (DLT_MFR)hannes2005-12-131-1/+19
|
* Clear out the flags field when parsing the Frame Relay header, ratherguy2005-11-131-1/+3
| | | | than leaving random junk in the lower 16 bits.
* add support for PPP over Frame-Relayhannes2005-11-041-1/+5
|
* Fix a test (as per a compiler warning).guy2005-08-231-2/+2
|
* hexdump MFR middle or last fragmentshannes2005-08-091-7/+15
|
* -share some code between the FRF.15 and FRF.16 printerhannes2005-07-271-20/+23
| | | | | | -display B, E & C header flags in the FRF.16 printer -evaluate the correct data [!flags] in the FRF.15 printer for deciding if the frame is a end-to-end frag or an interface frag
* Pointers into packet data should usually be pointers to unsigned 1-byteguy2005-07-271-2/+2
| | | | values.
* don't print the null-termination byte in FRF.16 link/bundle msgshannes2005-07-261-3/+7
|
* fix 'Bundle ID' typohannes2005-07-211-2/+2
|
* link codeset 1 (lmi messages) to codeset 5, add IE = 0 sanity check, print ↵hannes2005-07-211-30/+40
| | | | codeset
* add support for MFR FRF.16 IE Message printing, add boundary checkshannes2005-07-211-15/+88
|
* add basic support for FRF.16 Frame-Relay dissector, fix garbled output from ↵hannes2005-07-201-8/+100
| | | | twice calling fr_q933_print_ie_codeset
* Add a flag to suppress the "default_print()" call made in variousguy2005-07-071-2/+2
| | | | | | | | 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.
* split up the frame-relay printer intohannes2005-05-271-22/+32
| | | | | fr_if_print and fr_print similar to PPP; fr_print can be called from outside without supplying a pcap_header;
* Make "snap_print()" handle fetching and printing the OUI.guy2005-04-261-16/+2
| | | | | | | | | | | | | | | | | | Don't copy the LLC header to a "struct llc", just construct the individual fields. Fetch the control field early in the dissection process, and check to make sure we have at least 4 bytes of LLC header if it's not a U frame. Fetch both bytes of the control field for I and S frames, and display all 4 hex digits of it. Only dissect UI frames as BPDUs, and pass the BPDU dissector a pointer to the beginning of the BPDU, not the beginning of the LLC header - not all BPDUs are encapsulated in LLC headers. Only dissect UI frames as IP packets. Do bounds checking in "snap_print()".
* Dereference the *right* function pointer.guy2005-04-251-2/+2
|
* Base all interpretion of IE contents on the code set.guy2005-04-251-48/+84
| | | | Get rid of an extra blank.
* refactored ip_print() so that chained header parser (ESP/AH) canmcr2005-04-061-2/+2
| | | | more easily call the inner parts.
* move the SNAP OUI values out of the llc printer intohannes2005-04-061-8/+13
| | | | | | | the global oui.c file and make all SNAP printers use it make the display output of the frame-relay SNAP printer consistent to the LLC SNAP printer (= print oui{id,name}, proto-id)
* -add basic support for codeset shifting for IE printing in the frame-relay ↵hannes2005-03-211-5/+28
| | | | | | | | printer -harden tok2str() and bittok2str() to catch NULL refs -don't attempt to print a frame-relay IE if there is not enough bytes on the wire to print at least a full TLV
* -export the q933 printer and call it from the OSI printerhannes2005-01-271-5/+3
| | | | | | | -display cosmetics: make the comma settings eflag compatible place a colon after printing the OSI proto-ID to indicate that we are crossing a layer boundary
* bugfix: OSI printers require data to start with the NLPIDhannes2005-01-251-2/+2
|
* clean up some confusion between Q.933 and LMI:hannes2004-10-181-15/+15
| | | | | | | | - NLPID 0x8 is Q9.33 - 0x9 is LMI - the lmi printer in frint-fr.c is actually a (light) q.933 printer -> rename routines and trunc marks;
* add baseline FRF.15 (=fragmentation) support for frame-relayhannes2004-10-121-3/+56
|
* -add frame-relay header documentationhannes2004-10-091-151/+221
| | | | | | | | | | | | -make more use of tok2str() and bittok2str() -move the cisco-style frame format printer to fr_hdr_print -rework the LMI decoder - spit out just a single line in non-verbose mode (plus all the interesting information like TX, RX Seq Nr) -make more use of tok2str() -reword some #define statments to make it appear frame-relay or LMI specific
* print frame-relay flags & DLCI # for cisco style encapshannes2004-10-071-2/+5
|
* add support for cisco-style ethertype encaps within frame-relayhannes2004-10-071-3/+22
|
* -move the nlpid definitions and tokens to a dedicated file(s)hannes2004-10-071-57/+8
| | | | -make use of it in the ISO, Frame-relay and CDP printers
* Make the "addr_len" variable a "u_int", as we pass a pointer to it to aguy2004-04-021-2/+2
| | | | | routine that expects a "u_int *", and we never use it in a way that requires it to be signed.
* Make the "dlci" variable a u_int, as all the code that refers to itguy2003-12-151-2/+3
| | | | thinks it's unsigned.
* 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".
* Fix a typo.guy2003-11-081-2/+2
|
* From Krzysztof Halasa: ignore single octet IEs.guy2003-10-181-13/+1
|
* From Krzysztof Halasa <khc@pm.waw.pl>:guy2003-10-161-176/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Unused things (mbuf, rtentry) have been removed. 2. I've dropped FR_CR_BIT etc. definitions as they have only meaning in specific location in Q.922 address. FR_EA_BIT is still there as it's used by all Q.922 bytes. 3. a new parse_q922_addr() parses the whole Q.922 address structure and produces DLCI, Q.922 byte count and flags in ASCII. While I can't test 3- and 4-byte Q.922 addresses (using only default 2-byte ones), they are supported. 4. I've trimmed comments regarding HDLC flags and CRC/FCS bytes in FR packet. They are wire-only things and as such are never seen by libpcap/tcpdump. 5. Changed NLPID_LMI into NLPID_CISCO_LMI and NLPID_Q933 into NLPID_LMI (the latter is used by both ANSI (T1.617 annex D) and CCITT (Q.933 annex A) LMI). 6. fr_hdrlen() now correctly returns FR header length (4 - 6 bytes, 7 bytes with 4-byte Q.922 and incorrectly used pad byte). 7. I've changed output text formatting: "xxx-value-yyy-value" into "xxx value, yyy value", to be consistent with Ethernet. Not sure if it's correct. 8. added IPv6 support 9. q933_print() now reads lmi_print() 10. CCITT (Q.933 annex A) LMI is now supported, and both CCITT and ANSI fields are now correctly displayed 10. lmi_print() no longer prints constant fields (such as always zeroed Q.922 C/R bit or LMI Call Reference byte) unless they are set incorrectly. 11. I've added ANSI_ and CCITT_ prefixes to appropriate #defines. 12. a new parse_dlci_el() should handle all (10, 16 and 23-bit) DLCIs correctly (corresponding to 2, 3 and 4-byte Q.922 addresses, respectively).
* use strlcpy/catitojun2003-08-131-6/+6
|
* use snprintfitojun2003-08-131-2/+2
|
* don't pass on src & dst MAC adresses to the isoclns decoder as MAC adresseshannes2003-05-221-2/+2
| | | | should be really printed in ether_print() using the eflag
* Hoist a bunch of stuff that should be done by all if_print routines intoguy2002-12-191-27/+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-2/+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-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* put __attribute__((packed)) to packet headers. s/u_short/u_int16_t/ and soitojun2002-11-091-7/+7
| | | | forth while i'm here
* 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".
* Add a few more GCC warnings on GCC >= 2 for ".devel" builds.guy2002-09-051-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Neil T. Spring: fixes for many of those warnings: addrtoname.c, configure.in: Linux needs netinet/ether.h for ether_ntohost print-*.c: change char *foo = "bar" to const char *foo = "bar" to appease -Wwrite-strings; should affect no run-time behavior. print-*.c: make some variables unsigned. print-bgp.c: plen ('prefix len') is unsigned, no reason to validate by comparing to zero. print-cnfp.c, print-rx.c: use intoa, provided by addrtoname, instead of inet_ntoa. print-domain.c: unsigned int l; (l=foo()) < 0 is guaranteed to be false, so check for (u_int)-1, which represents failure, explicitly. print-isakmp.c: complete initialization of attrmap objects. print-lwres.c: "if(x); print foo;" seemed much more likely to be intended to be "if(x) { print foo; }". print-smb.c: complete initialization of some structures. In addition, add some fixes for the signed vs. unsigned comparison warnings: extract.h: cast the result of the byte-extraction-and-combining, as, at least for the 16-bit version, C's integral promotions will turn "u_int16_t" into "int" if there are other "int"s nearby. print-*.c: make some more variables unsigned, or add casts to an unsigned type of signed values known not to be negative, or add casts to "int" of unsigned values known to fit in an "int", and make other changes needed to handle the aforementioned variables now being unsigned. print-isakmp.c: clean up the handling of error/status indicators in notify messages. print-ppp.c: get rid of a check that an unsigned quantity is >= 0. print-radius.c: clean up some of the bounds checking. print-smb.c: extract the word count into a "u_int" to avoid the aforementioned problems with C's integral promotions. print-snmp.c: change a check that an unsigned variable is >= 0 to a check that it's != 0. Also, fix some formats to use "%u" rather than "%d" for unsigned quantities.
* Added support for Win32, based on WinPcap.risso2002-08-011-6/+2
|
* ETHERTYPE_IP will never show up as an NLPID in a Frame Relay packet, asguy2002-07-161-2/+1
| | | | the NLPID is 1 byte and 0x800 doesn't fit in one byte.