summaryrefslogtreecommitdiff
path: root/print-pppoe.c
Commit message (Collapse)AuthorAgeFilesLines
* PPPoE: Update the link-layer dissector to a void functionFrancois-Xavier Le Bail2020-07-311-8/+13
| | | | | | | | | Moreover: Add a length check. Fix a return. Use nd_print_trunc(). Remove trailing "_if" from the protocol name. Style.
* Don't use <ctype.h> macros.Guy Harris2019-09-011-1/+3
| | | | | | | | | | | | | | Some of them are locale-dependent, and all of them run the risk of failing if you hand them a char with the 8th bit set. Move our replacements to a new netdissect-ctype.h file, and, for the ones that check for particular character types, add _ASCII to the name, to indicate that only ASCII characters pass the check. Do the same for the ones that map between cases, to indicate that they only map ASCII letters. For isspace(), explicitly check for the characters we care about, to make it clearer what we're doing.
* Use the new GET_ macros instead of the EXTRACT_ onesFrancois-Xavier Le Bail2019-03-261-10/+10
| | | | | | | The exceptions are currently: Some EXTRACT_ in print-juniper.c, not used on packet buffer pointer. An EXTRACT_BE_U_3 in addrtoname.c, not always used on packet buffer pointer.
* Add more nd_print_trunc() callsFrancois-Xavier Le Bail2018-05-101-1/+1
| | | | | | | Update the output of some tests accordingly. Moreover: Add a ndo_protocol field assignment.
* Add the ndo_protocol field in the netdissect_options structureFrancois-Xavier Le Bail2018-03-161-0/+2
| | | | | Update this field in printer entry functions. It will be used for some printings.
* Always include <config.h> rather than "config.h".Guy Harris2018-01-211-1/+1
| | | | | | | | This can prevent bizarre failures if, for example, you've done a configuration in the top-level source directory, leaving behind one config.h file, and then do an out-of-tree build in another directory, with different configuration options. This way, we always pick up the same config.h, in the build directory.
* Use quoted include netdissect-stdinc.h instead of angle-bracketed oneFrancois-Xavier Le Bail2018-01-211-1/+1
|
* Clean up signed vs. unsigned.Guy Harris2018-01-111-2/+2
|
* Update ND_PRINT() as a variadic macroFrancois-Xavier Le Bail2018-01-071-16/+16
|
* Remove all storage class specifier 'register'Francois-Xavier Le Bail2017-12-131-2/+2
| | | | | | Let the compiler do the optimizations (or not) based on build options. Avoid 'value has been optimized out' messages in gdb using '-O0'.
* Replace ND_TTEST2()/ND_TCHECK2() macros by macros using pointers (1/n)Francois-Xavier Le Bail2017-12-111-2/+2
| | | | | ND_TTEST2(var, l) -> ND_TTEST_LEN(p, l) ND_TCHECK2(var, l) -> ND_TCHECK_LEN(p, l)
* Use more the EXTRACT_U_1() macro (53/n)Francois-Xavier Le Bail2017-12-101-2/+2
| | | | Assignment, p[n], (more)
* Use more the EXTRACT_U_1() macro (52/n)Francois-Xavier Le Bail2017-12-091-1/+1
| | | | Assignment, p[n]
* Use more the EXTRACT_U_1() macro (51/n)Francois-Xavier Le Bail2017-12-091-1/+1
| | | | Moreover: Use more the ND_ISPRINT() macro.
* Use more the EXTRACT_U_1() macro (49/n)Francois-Xavier Le Bail2017-12-091-1/+1
| | | | Assignment, *(p)
* Use more the EXTRACT_U_1() macro (31/n)Francois-Xavier Le Bail2017-11-271-1/+1
| | | | | | In ND_PRINT() macro call(s) (step 9). *(p)
* Use more ND_TCHECK_n()/ND_TTEST_n() macrosFrancois-Xavier Le Bail2017-11-241-1/+1
|
* Rename EXTRACT_ macrosFrancois-Xavier Le Bail2017-11-221-4/+4
| | | | | | | | | | | | | | | | Now all the macros have a name meaning a count in bytes. With _S_: signed, _U_: unsigned e.g.: EXTRACT_BE_32BITS -> EXTRACT_BE_U_4 EXTRACT_LE_32BITS -> EXTRACT_LE_U_4 ... EXTRACT_BE_INT32 -> EXTRACT_BE_S_4 and have: EXTRACT_8BITS -> EXTRACT_U_1 EXTRACT_INT8 -> EXTRACT_S_1
* Rename EXTRACT_nBITS() macros to EXTRACT_BE_nBITS()Francois-Xavier Le Bail2017-11-181-4/+4
| | | | | It indicates clearly that these macros are used to extract big-endian integral values.
* 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
* 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
* Remove obsolete commentsFrancois-Xavier Le Bail2015-09-071-1/+1
|
* Printers must include 'netdissect.h', not 'interface.h'Francois-Xavier Le Bail2015-09-051-1/+1
|
* Avoid collisions with isascii().Guy Harris2015-08-311-4/+4
| | | | Those variables are counts, so just give them names that reflects that.
* 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.
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-1/+1
| | | | | | | | | 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.
* convert some stray printf()'sDenis Ovsienko2014-04-021-1/+1
|
* NDOize LLDP, PPP and RSVP decodersDenis Ovsienko2014-04-021-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 8 more small decodersDenis Ovsienko2014-03-131-27/+21
| | | | | This change converts ZeroMQ, IPX, MPLS, IPv6 options, PPPoE, RIPng, PFLOG and Sun RPC decoders.
* don't include addrtoname.h needlesslyDenis Ovsienko2014-02-251-1/+0
|
* remove tcpdump's own CVS keywordsDenis Ovsienko2014-01-031-5/+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-3/+3
|
* justify declarations of struct tok arraysDenis Ovsienko2013-09-241-2/+2
| | | | | | 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.
* Get rid of unnecessary initialization.Guy Harris2012-11-301-1/+1
| | | | v is set to p later in a loop, and isn't used until then.
* Teach PPPoE parser about RFC 4638Matt Dainty2011-12-091-0/+2
|
* According to RFC 2516, use of the End-Of-List tag is not required, andguy2005-04-261-16/+1
| | | | | at least one PPPoE implementation doesn't put that tag into the tag list, so we can't ignore the payload length.
* Use %u to print unsigned quantities.guy2004-08-271-18/+22
| | | | | | | | | Check, and use, the supplied packet length in the PPPoE dissector. (It reflects the actual packet length; snapend reflects the captured packet length.) As we're now doing bounds checks with TCHECK, the loop over the tagged fields doesn't have to check against snapend.
* Add some bounds checks.guy2004-08-271-1/+3
|
* Improve bounds checking.guy2004-03-241-6/+6
|
* 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.
* Use the right format to print a value as 2 hex digits.guy2003-11-151-2/+2
|
* 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".
* Get rid of an unused variable.guy2003-07-011-3/+5
| | | | | | | | | Cast lengths to "int" when using them in "%*" formats. Restore the "TODO print UTF-8 decoded text" comment, as RFC 2516 says that text in PPPoE is, in fact, UTF-8, and we could, in principle, do more than just dumping stuff as hex if there are more non-printable than printable characters (and dumping it as text if there aren't).
* credit Greg Stark as being the original Author of the PPPoE decoderhannes2003-06-141-1/+3
|
* from Greg Stark <gsstark[AT]mit.edu>:hannes2003-06-131-20/+37
| | | | | honor the payload length in PPPoE frames to match actual BRAS and client behaviour
* Hoist a bunch of stuff that should be done by all if_print routines intoguy2002-12-191-31/+4
| | | | | | 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-5/+4
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Get rid of the "-Wno-unused" flag, and fix up most of theguy2002-09-051-2/+2
| | | | | | | | | | | | | | | 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".