aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ppp.c
AgeCommit message (Collapse)AuthorFilesLines
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
2001-06-16Set the Protocol column in dissectors for PPP-specific subprotocols.Guy Harris1-1/+9
svn path=/trunk/; revision=3556
2001-06-15PAP support, from Laurent Rabret.Guy Harris1-6/+151
svn path=/trunk/; revision=3555
2001-06-15Explain why we have to be ready to handle Ethernet frames withGuy Harris1-1/+23
protocol type values that are PPP protocol types. svn path=/trunk/; revision=3554
2001-06-14LCP-over Ethernet and IPCP-over-Ethernet support, from Laurent Rabret.Guy Harris1-1/+3
svn path=/trunk/; revision=3547
2001-04-23Get rid of some unnecessary includes.Guy Harris1-3/+2
Fix up Gerald's e-mail address. svn path=/trunk/; revision=3371
2001-04-16Assorted ISIS enhancements from Hannes Gredler.Guy Harris1-1/+3
When dissecting the ISIS NLPID CLV, use the "nlpid_vals" array to convert NLPID values to protocol names. svn path=/trunk/; revision=3308
2001-03-31In various Frame Relay and PPP routines that set the length of theGuy Harris1-3/+4
top-level protocol tree items, use "offset" to set the length, rather than fetching the length of the item - "offset" is the offset from the beginning of the Frame Relay or PPP header just past the last field processed in that header, so it indicates how much of the header we've processed. svn path=/trunk/; revision=3215
2001-03-30Call the capture routine for PPP-in-HDLC-like-framing (RFC 1662) theGuy Harris1-2/+2
"ppp_hdlc" capture routine. svn path=/trunk/; revision=3209
2001-03-30Call the dissector for PPP-in-HDLC-like-framing (RFC 1662) theGuy Harris1-26/+19
"ppp_hdlc" dissector, and call the dissector for "raw" PPP (just RFC 1661, no HDLC encapsulation) the "ppp" dissector. Have the common routine used by both those dissectors take the offset in the tvbuff of the PPP protocol field as an argument, rather than assuming that the protocol field begins at the beginning of the tvbuff, so we don't have to construct a new tvbuff in the PPP-in-HDLC-like-framing dissector. Use the PPP dissector, not the PPP-in-HDLC-like-framing dissector, for PPP over Frame Relay - there's no HDLC header in PPP over Frame Relay, at least according to http://www.cisco.com/univercd/cc/td/doc/product/software/ios120/120newft/120t/120t1/pppframe.htm svn path=/trunk/; revision=3208
2001-03-29Have "dissect_ppp_stuff()" set the Protocol column for unknownGuy Harris1-53/+57
protocols; this obviates the need for "dissect_ppp()" to look at the protocol field at all. Have "dissect_ppp_stuff()" add the length of the protocol field to the length of the top-level protocol tree item, as only it knows how long the field is. Have "dissect_mp()" call "dissect_ppp_payload()", rather than duplicating what "dissect_ppp_payload()" does itself. Don't fetch the address and control fields in "dissect_ppp()" until you're ready to put them into the protocol tree. svn path=/trunk/; revision=3207
2001-03-22Move appletalk- and sna-related address routines out of the dissectorsGilbert Ramirez1-2/+2
and into epan. svn path=/trunk/; revision=3160
2001-03-15Add a new Wiretap encapsulation type for Cisco HDLC. Map the NetBSDGuy Harris1-15/+22
DLT_HDLC to it. Make a separate dissector for Cisco HDLC, and add a dissector for Cisco SLARP. Have the PPP dissector call the Cisco HDLC dissector if the address field is the Cisco HDLC unicast or multicast address. Use the Cisco HDLC dissector for the Cisco HDLC Wiretap encapsulation type. Add a new dissector table "chdlctype", for Cisco HDLC packet types (they're *almost* the same as Ethernet types, but 0x8035 is SLARP, not Reverse ARP, and 0x2000 is the Cisco Discovery protocol, for example), replacing "fr.chdlc". Have a "chdlctype()" routine, similar to "ethertype()", used both by the Cisco HDLC and Frame Relay dissectors. Have a "chdlc_vals[]" "value_string" table for Cisco HDLC types and protocol names. Split the packet type field in the Frame Relay dissector into separate SNAP and Cisco HDLC fields, and give them the Ethernet type and Cisco HDLC type "value_string" tables, respectively. svn path=/trunk/; revision=3133
2001-01-21Start removing "{OLD_}CHECK_DISPLAY_AS_DATA()" calls, and code to setGuy Harris1-119/+150
"pinfo->current_proto"; dissectors called only through dissector tables and handles don't need to do either of those, as the dissector table and handle code will do it for them. (Dissectors called directly, or dissectors that can be attached to conversations, still have to do it themselves.) Register the PPP Multilink Protocol, PPP Link Control Protocol, and PPP IP Control Protocol as official protocols, and register them in PPP's dissector table rather than having PPP handle them specially; change "dissect_cp()" to take a protocol ID, get the protocol short name information from it, and use the protocol ID for the top-level protocol tree item. Set the Protocol column in the PPP Multilink Protocol dissector, and set the Info column before extracting anything from the frame, so that if an exception is thrown, the Info and Protocol columns will reflect that the packet is supposed to be a PPP Multilink Protocol frame. Make the "First fragment" and "Last fragment" flags in the PPP Multilink Protocol header boolean bitfields, and let "proto_tree_add_boolean()" do all the heavy lifting when displaying them, rather than doing it by hand. Don't extract the sequence number in the PPP Multilink Protocol until you're ready to put it into the tree, just in case the captured packet includes the flags but not the sequence number. Clean up the code to check the FCS of PPP frames - extract it with "tvb_get_letohs()" or "tvb_get_letohl()", don't extract it byte-by-byte and then put it together yourself. svn path=/trunk/; revision=2926
2001-01-14Add the PPP types for the DEC LANBridge100 Spanning Tree protocol andGuy Harris1-4/+6
for "Bridging PDU"s (which I'm assuming are 802.1d Spanning Tree BPDUs), and have the STP and LANBridge100 STP dissectors register them with the "ppp.protocol" dissector table. Fix the value for the PPP type for MPLS Multicast (it's 0x0283, not 0x0281). svn path=/trunk/; revision=2896
2001-01-13Make GRE use a dissector table for its protocol types, and registerGuy Harris1-1/+2
dissectors for protcools that can be encapsulated inside GRE in that table. Fix a bug in the handling of WCCPv2 IP encapsulation (it was constructing the next tvbuff before, rather than after, advancing the offset past the redirection header). svn path=/trunk/; revision=2893
2001-01-10Make the stuff to handle SNAP frames (OUI, PID, payload) a routine ofGuy Harris1-7/+10
its own; it's used not only by LLC, but by Frame Relay with RFC 2427 and ATM with RFC 2684. Support for RFC 2427-encapsulation Frame Relay packets, from Paul Ionescu. Get rid of the CISCO_IP PPP protocol type - Cisco HDLC uses, in most cases, Ethernet packet types, so use ETHERTYPE_IP instead (they're both 0x0800). svn path=/trunk/; revision=2854
2001-01-09Add an additional "protocol index" argument to "{old_}dissector_add()",Guy Harris1-5/+5
"{old_}heur_dissector_add()", "{old_}conv_dissector_add()", and "register_dissector()", so that an entry in those tables has associated with it the protocol index of the protocol the dissector handles (or -1, if there is no protocol index for it). This is for future use in a number of places. (Arguably, "proto_register_protocol()" should take a dissector pointer as an argument, but 1) it'd have to handle both regular and heuristic dissectors; 2) making it take either a "dissector_t" or a union of that and a "heur_dissector_t" introduces some painful header-file interdependencies so I'm punting on that for now. As with other Ethereal internal APIs, these APIs are subject to change in the future, at least until Ethereal 1.0 comes out....) svn path=/trunk/; revision=2849
2001-01-03Add a new "prefs_register_protocol()" routine, which is likeGuy Harris1-2/+2
"prefs_register_module()" except that it takes a protocol index as returned by "proto_register_protocol()" as its first argument, rather than taking two character strings as arguments as its first two arguments, and uses the protocol's abbreviation as the name to use for preferences in the preferences file and the "-o" flag and uses the protocol's short name as the name to use in the tabs in the "Edit->Preferences" window. svn path=/trunk/; revision=2812
2001-01-03Have "proto_register_protocol()" build a list of data structures forGuy Harris1-17/+18
protocols, in addition to adding structures to the list of filterable fields. Give it an extra argument that specifies a "short name" for the protocol, for use in such places as pinfo->current_proto; the dialog box for constructing filters; the preferences tab for the protocol; and so on (although we're not yet using it in all those places). Make the preference name that appears in the preferences file and the command line for the DIAMETER protocol "diameter", not "Diameter"; the convention is that the name in question be all-lower-case. Make some routines and variables that aren't exported static. Update a comment in the ICP dissector to make it clear that the dissector won't see fragments other than the first fragment of a fragmented datagram. svn path=/trunk/; revision=2810
2000-12-14PPP patches from Burke Lau to:Guy Harris1-1/+224
add FCS checking; support Cisco HDLC format in the PPP dissector; handle MPLS-over-PPP. svn path=/trunk/; revision=2754
2000-12-04Add a "col_clear()" routine, to clear a column; it appears (and itGuy Harris1-30/+46
doesn't just seem to be a profiling artifact) that, at least on FreeBSD 3.4, it's significantly more efficient to clear out a column by stuffing a '\0' into the first byte of the column data than to do so by copying a null string (I guess when copying one byte, the fixed overhead of the procedure call and of "strcpy()" is significant). Have the TCP dissector set the Protocol column, and clear the Info column, before doing anything that might cause an exception to be thrown, so that if we *do* get an exception thrown, the frame at least shows up as TCP. Instead of, in the TCP dissector, constructing a string and then stuffing it into the Info column, just append to the Info column, which avoids one string copy. Pass a "frame_data" pointer to dissectors for TCP and IP (and PPP) options, so they can use it to append to the Info column. svn path=/trunk/; revision=2744
2000-12-03"dissect_ppp()" isn't called directly from outside of "packet-ppp.c", soGuy Harris1-2/+2
make it static. svn path=/trunk/; revision=2737
2000-11-29Wrap the dissect_fddi() call (with a 4th argument) withGilbert Ramirez1-1/+8
dissect_fddi_not_bitswapped() and dissect_fddi_bitswapped(), both of which use the standard 3-argument tvbuffified-dissector argument list. Add a dissector table called "wtap_encap" which is used to call dissectors from dissect_frame(). The switch() statement from this top-level dissector is removed. The link-layer dissectors register themselves with the "wtap_encap" dissector table. The dissectors are now static where possible. svn path=/trunk/; revision=2708
2000-11-19For each column, have both a buffer into which strings for that columnGuy Harris1-4/+4
can be put, and a pointer to the string for the column, which might or might not point to that buffer. Add a routine "col_set_str()", which sets the string for the column to the string passed to it as an argument; it should only be handed a static string (a string constant would be ideal). It doesn't do any copying, so it's faster than "col_add_str()". Make the routines that append to columns check whether the pointer to the string for the column points to the buffer for the column and, if not, copy the string for the column to the buffer for the column so that you can append to it (so you can use "col_set_str()" and then use "col_append_str()" or "col_append_fstr()"). Convert a bunch of "col_add_str()" calls that take a string constant as an argument to "col_set_str()" calls. Convert some "col_add_fstr()" calls that take a string constant as the only argument - i.e., the format string doesn't have any "%" slots into which to put strings for subsequent arguments to "col_set_str()" calls (those calls are just like "col_add_str()" calls). Replace an END_OF_FRAME reference in a tvbuffified dissector with a "tvb_length(tvb)" call. svn path=/trunk/; revision=2670
2000-11-19Get rid of a now-unused variable.Guy Harris1-2/+1
svn path=/trunk/; revision=2665
2000-11-19Have the Etherenet and PPP dissectors register themselves, and haveGuy Harris1-14/+11
other dissectors call them through handles. Do the same for the "PPP payload" dissector, after tvbuffifying it. Tvbuffify the PPPoE dissector. Do the last little bit of tvbuffifying the L2TP dissector (it takes old-style arguments and immediately generates a tvbuff out of them; make it take new-style arguments). svn path=/trunk/; revision=2664
2000-11-18Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSIGuy Harris1-99/+96
ESIS dissectors. Register the IP dissector and have dissectors that call it directly (rather than through a port table) call it through a handle. Add a routine "tvb_set_reported_length()" which a dissector can use if it was handed a tvbuff that contains more data than is actually in its part of the packet - for example, handing a padded Ethernet frame to IP; the routine sets the reported length of the tvbuff (and also adjusts the actual length, as appropriate). Then use it in IP. Given that, "ethertype()" can determine how much of the Ethernet frame was actually part of an IP datagram (and can do the same for other protocols under Ethernet that use "tvb_set_reported_length()"; have it return the actual length, and have "dissect_eth()" and "dissect_vlan()" use that to mark trailer data in Ethernet II frames as well as in 802.3 frames. svn path=/trunk/; revision=2658
2000-11-16Tvbuffify the STP dissector, have it register itself and have the LLCGuy Harris1-2/+2
dissector call it through a handle, and make it static. Give "dissect_data()" an "offset" argument, so dissectors can use it to dissect part of the packet without having to cook up a new tvbuff. Go back to using "dissect_data()" to dissect the data in an IPP request. svn path=/trunk/; revision=2651
2000-08-13Add the "Edit:Protocols..." feature which currently only implementsLaurent Deniel1-1/+5
the following: It is now possible to enable/disable a particular protocol decoding (i.e. the protocol dissector is void or not). When a protocol is disabled, it is displayed as Data and of course, all linked sub-protocols are disabled as well. Disabling a protocol could be interesting: - in case of buggy dissectors - in case of wrong heuristics - for performance reasons - to decode the data as another protocol (TODO) Currently (if I am not wrong), all dissectors but NFS can be disabled (and dissectors that do not register protocols :-) I do not like the way the RPC sub-dissectors are disabled (in the sub-dissectors) since this could be done in the RPC dissector itself, knowing the sub-protocol hfinfo entry (this is why, I've not modified the NFS one yet). Two functions are added in proto.c : gboolean proto_is_protocol_enabled(int n); void proto_set_decoding(int n, gboolean enabled); and two MACROs which can be used in dissectors: OLD_CHECK_DISPLAY_AS_DATA(index, pd, offset, fd, tree) CHECK_DISPLAY_AS_DATA(index, tvb, pinfo, tree) See also the XXX in proto_dlg.c and proto.c around the new functions. svn path=/trunk/; revision=2267
2000-08-07Allow either old-style (pre-tvbuff) or new-style (tvbuffified)Guy Harris1-3/+3
dissectors to be registered as dissectors for particular ports, registered as heuristic dissectors, and registered as dissectors for conversations, and have routines to be used both by old-style and new-style dissectors to call registered dissectors. Have the code that calls those dissectors translate the arguments as necessary. (For conversation dissectors, replace "find_conversation_dissector()", which just returns a pointer to the dissector, with "old_try_conversation_dissector()" and "try_conversation_dissector()", which actually call the dissector, so that there's a single place at which we can do that translation. Also make "dissector_lookup()" static and, instead of calling it and, if it returns a non-null pointer, calling that dissector, just use "old_dissector_try_port()" or "dissector_try_port()", for the same reason.) This allows some dissectors that took old-style arguments and immediately translated them to new-style arguments to just take new-style arguments; make them do so. It also allows some new-style dissectors not to have to translate arguments before calling routines to look up and call dissectors; make them not do so. Get rid of checks for too-short frames in new-style dissectors - the tvbuff code does those checks for you. Give the routines to register old-style dissectors, and to call dissectors from old-style dissectors, names beginning with "old_", with the routines for new-style dissectors not having the "old_". Update the dissectors that use those routines appropriately. Rename "dissect_data()" to "old_dissect_data()", and "dissect_data_tvb()" to "dissect_data()". svn path=/trunk/; revision=2218
2000-06-15Convert IPX-and-friend dissectors in packet-ipx.c to useGilbert Ramirez1-2/+2
tvbuffs. In doing so, I realied that my recommendation for using tvb_new_subset(pi.compat_top_tvb, -1, -1) was incorrect, because some dissectors (ethernet!) change pi.len and pi.cap_len. So, I have to take those two variables into account instead of using -1 and -1. So, I provide a macro called tvb_create_from_top(offset), where offset is the name of your offset variable. It is a wrapper around tvb_new_subset(). I converted the lines that followed my suggestion to use tvb_create_from_top(). In proto.c I added proto_tree_add_debug_text(proto_tree*, const char*, ...) It's much like proto_tree_add_text(), except that it takes no offset or length; it's soley for temporarily putting debug text into the proto_tree while debugging a dissector. In making sure that its use is temporary, the funciton also prints the debug string to stdout to remind the programmer that the debug code needs to be removed before shipping the code. svn path=/trunk/; revision=2068
2000-05-31Add routines for adding items to a protocol tree that take arguments ofGuy Harris1-6/+6
a particular type, rather than taking a varargs list, along the lines of the "proto_tree_add_XXX_format()" routines. Replace most calls to "proto_tree_add_item()" and "proto_tree_add_item_hidden()" with calls to those routines. Rename "proto_tree_add_item()" and "proto_tree_add_item_hidden()" to "proto_tree_add_item_old()" and "proto_tree_add_item_hidden_old()", and add new "proto_tree_add_item()" and "proto_tree_add_item_hidden()" routines that don't take the item to be added as an argument - instead, they fetch the argument from the packet whose tvbuff was handed to them, from the offset handed to them. svn path=/trunk/; revision=2031