aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ppp.c
AgeCommit message (Collapse)AuthorFilesLines
2003-11-16Export "protocol_t" as an opaque type.Guy Harris1-21/+11
Make "proto_is_protocol_enabled()" and "proto_get_protocol_short_name()" take a "protocol_t *" as an argument, so they don't have to look up the "protocol_t" - this will probably speed them up considerably, and they're called on almost every dissector handoff. Get rid of a number of "proto_is_protocol_enabled()" calls that aren't necessary (dissectors called through handles, including those called through dissector tables, or called as heuristic dissectors, aren't even called if their protocol isn't enabled). Change some direct dissector calls to go through handles. svn path=/trunk/; revision=8979
2003-08-26Make the CRC-32 routines take a tvbuff and a length as arguments.Guy Harris1-2/+2
Rename "crc32()" so as not to collide with the one in zlib; rename "crc32_802()" to match. svn path=/trunk/; revision=8268
2003-08-26From Jesper Peterson:Guy Harris1-207/+143
Extract the FCS decoding section of the PPP_HDLC dissector to allow the CHDLC dissector to use the same routine. The ppp_options used for preferences has been renamed to fcs_options and exported via packet-ppp.h so CHDLC gets a separate (but identical) FCS preference. This means prefs.h has to be included before packet-ppp.h so a couple of ppp related files (packet-{gtp,null,raw,vj}.c) had their includes slightly re-arranged. From me: make the PPP/CHDLC FCS code use "crc32()" to check the 32-bit FCS. svn path=/trunk/; revision=8266
2003-07-11Add a routine "dissect_ipv6_options()" that works likeGuy Harris1-1/+2
"dissect_ip_tcp_options()" but for options that are like IPv6 options (i.e., the length byte has a value that doesn't include the option code or length byte). Add an "ip_opts.h" header to declare it, and move the declaration of stuff used by it and "dissect_ip_tcp_options()", and the declaration of "dissect_ip_tcp_options()", to that header. Use "dissect_ipv6_options()" for Mobile IPv6 options. Get rid of the unused "mip6_opt_types[]" array in "packet-mip6.h". svn path=/trunk/; revision=8015
2003-06-13"tvb_format_text()" should be able to handle a length argument of 0.Guy Harris1-4/+2
svn path=/trunk/; revision=7871
2003-06-12Add new routines:Guy Harris1-20/+46
tvb_get_string() - takes a tvbuff, an offset, and a length as arguments, allocates a buffer big enough to hold a string with the specified number of bytes plus an added null terminator (i.e., length+1), copies the specified number of bytes from the tvbuff, at the specified offset, to that buffer and puts in a null terminator, and returns a pointer to that buffer (or throws an exception before allocating the buffer if that many bytes aren't available in the tvbuff); tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to a "gint" as arguments, gets the size of the null-terminated string starting at the specified offset in the tvbuff (throwing an exception if the null terminator isn't found), allocates a buffer big enough to hold that string, copies the string to that buffer, and returns a pointer to that buffer and stores the length of the string (including the terminating null) in the variable pointed to by the "gint" pointer. Replace many pieces of code allocating a buffer and copying a string with calls to "tvb_get_string()" (for one thing, "tvb_get_string()" doesn't require you to remember that the argument to "tvb_get_nstringz0()" is the size of the buffer into which you're copying the string, which might be the length of the string to be copied *plus 1*). Don't use fixed-length buffers for null-terminated strings (even if the code that generates those packets has a #define to limit the length of the string). Use "tvb_get_stringz()", instead. In some cases where a value is fetched but is only used to pass an argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()" instead. svn path=/trunk/; revision=7859
2003-05-19More tvb_get_nstringz0() fixes. Timo Sirainen pointed out that BadGerald Combs1-6/+10
Things can happen if we pass a zero buffer length to tvb_get_nstringz0(). Throw an exception if this happens. In various dissectors make sure the tvb_get_nstringz0()'s buffer length is greater than zero. svn path=/trunk/; revision=7688
2003-04-29Don't export "osinl_subdissector_table" or "ppp_subdissector_table" -Guy Harris1-5/+2
have other dissectors that use them fetch them with "find_dissector_table()". svn path=/trunk/; revision=7601
2003-04-28Fix several buffer and integer overflow issues discovered by Timo Sirainen.Gerald Combs1-3/+8
tvbuff.c: Lots of existing code assumes that you can safely do the following: #define MAX_BUF 64 guint8 *buf[MAX_BUF]; ... tvb_get_nstringz0 (tvb, offset, MAX_BUF, buf, &bytes_copied); In reality, tvb_get_nstringz*() can potentially write one byte past "buf". Modify _tvb_get_nstringz() not to do that. packet-ppp.c: Check for a valid BAP suboption length. packet-mount.c: Fix a possible integer overflow in dissect_group(). svn path=/trunk/; revision=7590
2003-02-07From Thierry Pelle: updates (use the correct RFC 2472 term - "interfaceGuy Harris1-11/+11
identifier", not "interface token" - and print the octets of the interface identifier with zero padding). svn path=/trunk/; revision=7094
2003-01-28Panic if a preference starts with the name of the module to which itGuy Harris1-15/+15
belongs, as that's redundant. Fix a bunch of cases where that was done, and map the old name to the new name. Instead of marking "mtp3.mtp3_standard" as obsolete, map it to "mtp3.standard". svn path=/trunk/; revision=7030
2003-01-20Move into "call_dissector_work()" the stuff to handle dissecting, inGuy Harris1-50/+6
error packets, the copy of the packet that got the error, rather than doing it in the CLNP dissector and the ICMP dissector and the ICMPv6 dissector and the PPP dissector for various control protocols; have it do that work iff "pinfo->in_error_pkt" is set. svn path=/trunk/; revision=6942
2003-01-06If we have packet direction information, display it.Guy Harris1-5/+25
svn path=/trunk/; revision=6861
2003-01-03I must've been on drugs when I checked in revision 1.56; put in theGuy Harris1-1/+2
"return" that should've been there, so we don't try to dissect Cisco HDLC frames as PPP after having finished dissecting them as Cisco HDLC. svn path=/trunk/; revision=6844
2002-12-11From Andreas Trauer: dissect the L2TP AVPs Initial Received LCP CONFREQ,Guy Harris1-1/+9
Last Received LCP CONFREQ, Last Sent LCP CONFREQ, and correct some AVP names. svn path=/trunk/; revision=6779
2002-11-28Before dissecting the payload of a Protocol-Reject LCP packet, save theGuy Harris1-1/+12
current "this is an error packet" flag and set that flag, so the payload is dissected as the payload of an error packet rather than as a "real" packet. svn path=/trunk/; revision=6701
2002-11-28From Pasi Eronen: dissect the packet inside an LCP Protocol Reject message.Guy Harris1-9/+65
svn path=/trunk/; revision=6698
2002-11-11Instead of tweaking a "Protocol configuration options" extension headerGuy Harris1-7/+13
item to look more-or-less like a PPP packet, just dissect it in place and hand off to the appropriate subdissector using the PPP dissector's handoff table (which we export, along with its value_string table for protocol IDs, which we use to report the protocol ID symbolically). This means there's no point in having a configurable option to control whether to do that tweaking; make it an obsolete option. Bring "col_get_writable()" back from the dead, and have the GTP dissector save the current "writable" flag for columns, mark the columns non-writable before calling the subdissector for the PPP configuration protocol, and restore the state of the writable flag, rather than putting the columns back after the PPP configuration protocol's dissector is done. Fix some more typos in comments. Don't register the IP dissector in the "ppp.protocol" table in the GTP dissector's handoff registration routine - it's already being done in the IP dissector's handoff routine. Fix the name for CHAP to match what RFC 1994 calls it (if the name changed, it should be changed in all places, but, at least according to this message, a while ago, from Bob Sutterfield, "since the RFC defines the protocol, the RFC defines the name": http://mail-index.netbsd.org/netbsd-help/1996/05/16/0011.html and the RFC defines the name as "PPP Challenge Handshake Authentication Protocol (CHAP)"). svn path=/trunk/; revision=6617
2002-11-04Register (and initialize) ett_mplscp_options and ett_cdpcp_options. FixGerald Combs1-5/+7
some indentation inconsistencies. svn path=/trunk/; revision=6557
2002-10-14From Thierry Pelle: IPv6CP support.Guy Harris1-1/+93
svn path=/trunk/; revision=6419
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-135/+135
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6117
2002-08-18From ENDOH Akira:Gerald Combs1-4/+172
- displaying PPP datalink layer protocol names based on iana database: http://www.iana.org/assignments/ppp-numbers - dissecting MPLSCP and CDPCP - dissecting CDP over PPP svn path=/trunk/; revision=6011
2002-08-04From Hidetaka Ogawa: fix PPP FCS computation to include address andGuy Harris1-5/+5
control field if present. Add Sergei Shokhor to the contributor list in the Ethereal man page. svn path=/trunk/; revision=5949
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hJörg Mayer1-6/+2
equivalents for the toplevel directory. The removal of winsock2.h will hopefully not cause any problems under MSVC++, as those files using struct timeval still include wtap.h, which still includes winsock2.h. svn path=/trunk/; revision=5932
2002-05-22Fix a typo.Guy Harris1-2/+2
svn path=/trunk/; revision=5521
2002-05-20Don't include the FCS in the tvbuff handed to "dissect_ppp_common()", soGuy Harris1-43/+139
that it's not included in the tvbuff handed to subdissectors. Use that tvbuff to compute the FCS. Properly handle the FCS in frames that don't include all the captured data. In VJ-compressed packets, put the VJ compression information into the protocol tree, and set the Protocol and Info columns, and don't worry about the CRC - as per the above, it's no longer in the tvbuff (and never *was* in the tvbuff in some cases). Also, clean up some other stuff in the VJ dissector. svn path=/trunk/; revision=5510
2002-04-24From Joerg Mayer: get rid of extra arguments to capture routines.Guy Harris1-3/+3
svn path=/trunk/; revision=5233
2002-04-14From Joerg Mayer:Guy Harris1-5/+6
Declares some variables static. Creates a new include file packet-rsvp.h, and make use of it (change some extern decls to #inlcude). Move the file packet-pgm.h into packet-pgm.c as it is not used by anything outside packet-pgm.c. svn path=/trunk/; revision=5162
2002-04-01Get rid of ett_ values for options with no subtrees.Guy Harris1-89/+144
Show the names of the control characters being mapped by the async control character map option. Use "proto_item_add_subtree()" to establish a subtree, so that the ett_ value gets associated with it. (Unfortunately, "proto_item" and "proto_tree" are typedefs for the same type, so checks for use of one when you should be using the other aren't done at compile time.) Get rid of some extra blanks before colons. svn path=/trunk/; revision=5067
2002-03-31Mark unused variables with _U_ if they can't be eliminated.Guy Harris1-49/+53
Use the "optp" argument in more option dissectors, and set the name of the option in the table entries for those options - and for one option where that name *was* being used. Get rid of unused variables. svn path=/trunk/; revision=5061
2002-01-21Include files from the "epan" directory and subdirectories thereof withGuy Harris1-3/+3
"epan/..." pathnames, so as to avoid collisions with header files in any of the directories in which we look (e.g., "proto.h", as some other package has its own "proto.h" file which it installs in the top-level include directory). Don't add "-I" flags to search "epan", as that's no longer necessary (and we want includes of "epan" headers to fail if the "epan/" is left out, so that we don't re-introduce includes lacking "epan/"). svn path=/trunk/; revision=4586
2002-01-20Allow a length of -1 to be specified when adding FT_NONE and FT_PROTOCOLGuy Harris1-6/+5
items to the protocol tree; it's interpreted as "the rest of the data in the tvbuff". This can be used if 1) the item covers the entire packet or the remaining payload in the packet or 2) the item's length won't be known until it's dissected, and will be then set with "proto_item_set_len()" - if an exception is thrown in the dissection, it means the item ran *past* the end of the tvbuff, so saying it runs to the end of the tvbuff is reasonable. Convert a number of "proto_tree_add_XXX()" calls using "tvb_length_remaining()", values derived from the result of "tvb_length()", or 0 (in the case of items whose length is unknown) to use -1 instead (using 0 means that if an exception is thrown, selecting the item highlights nothing; using -1 means it highlights all the data for that item that's available). In some places where "tvb_length()" or "tvb_length_remaining()" was used to determine how large a packet is, use "tvb_reported_length()" or "tvb_reported_length_remaining()", instead - the first two calls indicate how much captured data was in the packet, the latter two calls indicate how large the packet actually was (and the fact that using the latter could cause BoundsError exceptions to be thrown is a feature - if such an exception is thrown, the frame really *was* short, and it should be tagged as such). Replace some "proto_tree_add_XXX()" calls with equivalent "proto_tree_add_item()" calls. Fix some indentation. svn path=/trunk/; revision=4578
2002-01-11Support for BSD Compress, MVRCA, and Deflate compression options inGuy Harris1-6/+104
CCP, from Motonori Shindo. svn path=/trunk/; revision=4530
2002-01-03PPP multiplexing support, from Jayaram V.R.Guy Harris1-1/+243
svn path=/trunk/; revision=4469
2001-12-20Make the address and control fields in the PPP/HDLC header, and theGuy Harris1-52/+61
protocol field in the PPP header, filterable fields. Show the FCS value with a leading "0x". svn path=/trunk/; revision=4430
2001-12-19Van Jacobson decompression support for PPP, from Irfan Khan.Guy Harris1-3/+9
svn path=/trunk/; revision=4427
2001-12-10Move the pointer to the "column_info" structure in the "frame_data"Guy Harris1-89/+89
structure to the "packet_info" structure; only stuff that's permanently stored with each frame should be in the "frame_data" structure, and the "column_info" structure is not guaranteed to hold the column values for that frame at all times - it was only in the "frame_data" structure so that it could be passed to dissectors, and, as all dissectors are now passed a pointer to a "packet_info" structure, it could just as well be put in the "packet_info" structure. That saves memory, by shrinking the "frame_data" structure (there's one of those per frame), and also lets us clean up the code a bit. svn path=/trunk/; revision=4370
2001-12-08Attach a descriptive name field type and base to dissector tables; thatGuy Harris1-2/+3
specifies how the selector values used as keys in those tables are to be displayed, and the title to use when displaying the table. Use that information in the code to display the initial and current entries of various dissector tables. Have the dissector for BACnet APDUs register itself by name, and have the BACnet NPDU dissector call it iff the BAC_CONTROL_NET bit isn't set, rather than doing it with a dissector table. svn path=/trunk/; revision=4358
2001-12-08BACP and BAP support in PPP dissector, from Motonori Shindo.Guy Harris1-5/+561
svn path=/trunk/; revision=4356
2001-12-03Make "dissector_add()", "dissector_delete()", and "dissector_change()"Guy Harris1-20/+49
take a dissector handle as an argument, rather than a pointer to a dissector function and a protocol ID. Associate dissector handles with dissector table entries. svn path=/trunk/; revision=4308
2001-11-25Moved from using dissect_data to using call_dissector()Ed Warnicke1-2/+4
svn path=/trunk/; revision=4264
2001-11-21Get rid of some unused variables.Guy Harris1-3/+1
svn path=/trunk/; revision=4241
2001-11-20Make the capture routines take an additional argument giving the amountGuy Harris1-6/+14
of packet data captured. Make the "BYTES_ARE_IN_FRAME()" macro take a "captured length of the packet" argument. Add some length checks to capture routines. svn path=/trunk/; revision=4235
2001-11-04CBCP support in PPP, from Motonori Shindo.Guy Harris1-1/+154
svn path=/trunk/; revision=4153
2001-10-30Small fix to previous patch, from Motonori Shindo.Guy Harris1-5/+5
svn path=/trunk/; revision=4106
2001-10-29PPP CCP support, from Motonori Shindo.Guy Harris1-2/+300
svn path=/trunk/; revision=4096
2001-09-30Committing Montonori Shindo's patched to ppp for chap support.Richard Sharpe1-1/+150
svn path=/trunk/; revision=3979
2001-08-05Patch from Motonori Shindo to add support for decoding additional data,Guy Harris1-3/+55
for CHAP, in LCP Authentication Protocol option. Fix a typo. svn path=/trunk/; revision=3827
2001-08-05Patch from Motonori Shindo, addingGuy Harris1-1/+5
1) Shiva PAP (SPAP) and Extensible Authentication Protocol (EAP) 2) CBCP negotiation in LCP Callback Operation Field to the PPP dissector. svn path=/trunk/; revision=3826
2001-06-18From Joerg Mayer: explicitly fill in all members of aGuy Harris1-4/+4
"header_field_info" structure, including the ones that are later set by the routines to register fields. svn path=/trunk/; revision=3561