aboutsummaryrefslogtreecommitdiffstats
path: root/packet-llc.c
Commit message (Collapse)AuthorAgeFilesLines
* Include the control-field information in the Info column for LLC frames.Guy Harris2000-08-251-9/+4
| | | | svn path=/trunk/; revision=2370
* Add the "Edit:Protocols..." feature which currently only implementsLaurent Deniel2000-08-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Don't bump "offset" in the non-SNAP case - it hasn't been set, and weGuy Harris2000-08-111-3/+1
| | | | | | don't use it there. svn path=/trunk/; revision=2252
* Allow either old-style (pre-tvbuff) or new-style (tvbuffified)Guy Harris2000-08-071-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add routines for adding items to a protocol tree that take arguments ofGuy Harris2000-05-311-11/+11
| | | | | | | | | | | | | | | | | 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
* Convert LAPD and V.120 dissector to use tvbuff. Convert xdlc dissector-helper,Gilbert Ramirez2000-05-311-4/+3
| | | | | | too. svn path=/trunk/; revision=2030
* In the FDDI and LLC dissectors, extract fields as we use them, so thatGuy Harris2000-05-281-6/+9
| | | | | | | we don't get an exception (and thus a "Short Frame" or "Malformed Frame" entry) until we get to a field that isn't in the frame. svn path=/trunk/; revision=2021
* Use "tvb_get_ntoh24()" to extract the OUI from a SNAP header, ratherGuy Harris2000-05-281-4/+2
| | | | | | | than extracting each byte with "tvb_get_guint8()" and then putting them together. svn path=/trunk/; revision=2020
* Add protection against 0-length FT_BYTES being added to proto_tree.Gilbert Ramirez2000-05-191-3/+3
| | | | | | Convert ethertype() and dissect_null() to use tvbuff. svn path=/trunk/; revision=1979
* Have tvbuff's keep track of cap_len and pkt_len ('length' and 'reported_length'Gilbert Ramirez2000-05-161-3/+3
| | | | | | | | | | | | | | | in tvbuff terminology). This is implemented for TVBUFF_REAL and TVBUFF_SUBSET so far; support for TVBUFF_COMPOSITE is coming soon. Throw either ReportedBoundsError or BoundsError. A ReportedBoundsError is reported as "Malformed Frame" since the protocol stated that a certain number of bytes should be available but they weren't. A BoundsError is reported as a "Short Frame" since the snaplen was too short. Register proto_short (BoundsError) and proto_malformed (ReportedBounds) so searches can be made on "short" and "malformed". svn path=/trunk/; revision=1965
* In wiretap, set err to 0 before doing anything inside wtap_loop().Gilbert Ramirez2000-05-121-7/+7
| | | | | | | | | | | | | | | | | | | | | | | Tethereal was dying on me because err was initialized to some random value. It was this section of code that would exit even if wtap_loop was successful (returned TRUE) because err was never initialized or set to anything. err = load_cap_file(&cf, out_file_type); if (err != 0) { dissect_cleanup(); exit(2); } <BIGGER sheepish grin> Fixed even more errors in LLC dissector. I had inadvertantly used the wrong tvbuff_t* when calling dissect_data_tvb(). There is no way we are going to be successful in this tvbuff conversion w/o regression testing. I'm working on setting up a simple Makefile for regression testing tonight. That's why I'm finding so many bugs in my LLC conversion. </BIGGER sheepish grin> svn path=/trunk/; revision=1946
* <sheepish grin>Gilbert Ramirez2000-05-121-7/+7
| | | | | | | | | | Fix error in my conversion to tvbuff routines. Because offset was calculated based on next_tvb, which already knew to skip 8 bytes, I don't have to use "offset+8" in calls to the next non-tvbuff dissectors. </sheepish grin> svn path=/trunk/; revision=1945
* Convert LLC dissector to use tvbuffs.Gilbert Ramirez2000-05-111-56/+65
| | | | | | | | Non-tvbuff dissectors create a tvbuff when calling dissect_llc() Changed name of current_proto to match string in COL_PROTO ("FDDI" instead of "fddi") Changed short text to be: [Short Frame: %s] where %s is current_proto. svn path=/trunk/; revision=1943
* Add tvbuff class.Gilbert Ramirez2000-05-111-10/+10
| | | | | | | | | | | | | | | Add exceptions routines. Convert proto_tree_add_*() routines to require tvbuff_t* argument. Convert all dissectors to pass NULL argument ("NullTVB" macro == NULL) as the tvbuff_t* argument to proto_tree_add_*() routines. dissect_packet() creates a tvbuff_t, wraps the next dissect call in a TRY block, will print "Short Frame" on the proto_tree if a BoundsError exception is caught. The FDDI dissector is converted to use tvbuff's. svn path=/trunk/; revision=1939
* Register a "llc.dsap" dissector table for 802.2 LLC, and have dissectorsGuy Harris2000-04-171-81/+47
| | | | | | | | | | for protocols that run inside 802.2 LLC register themselves with it using "dissector_add()". Make various dissectors static if they can be, and remove from header files declarations of those dissectors. svn path=/trunk/; revision=1872
* For I and S frames, the LLC control field is 2 bytes, so make itGuy Harris2000-04-131-2/+2
| | | | | | FT_UINT16 (that won't break things for U frames, where it's 1 byte). svn path=/trunk/; revision=1838
* Change my e-mail address from @tivoli.com to @xiexie.orgGilbert Ramirez2000-04-121-2/+2
| | | | svn path=/trunk/; revision=1831
* Add DOCSIS BPDU patch from Johannes Hennecke <Johannes.Hennecke@elsa.de>.Gerald Combs2000-04-101-1/+10
| | | | svn path=/trunk/; revision=1826
* The "llc_ctrl_vals[]" value_string table isn't used to generate theGuy Harris2000-04-091-3/+5
| | | | | | | | | | protocol tree text for the control field - that protocol tree entry is added by "dissect_xdlc_control()", which uses "proto_tree_add_uint_format()" - and it's not a simple enumerated field (which is why "proto_tree_add_uint_format()" is used, to show all the various bits of the field). Eliminate it. svn path=/trunk/; revision=1825
* The "llc_ctrl_vals[]" value_string table isn't used to generate theGuy Harris2000-04-081-10/+2
| | | | | | | | | | protocol tree text for the control field - that protocol tree entry is added by "dissect_xdlc_control()", which uses "proto_tree_add_uint_format()" - and it's not a simple enumerated field (which is why "proto_tree_add_uint_format()" is used, to more fully describe the field). Eliminate it. svn path=/trunk/; revision=1824
* Create a header file for every packet-*.c file. Prune the packet.h file.Gilbert Ramirez2000-02-151-2/+11
| | | | | | | | | | | | | This change allows you to add a new packet-*.c file and not cause a recompilation of everything that #include's packet.h Add the plugin_api.[ch] files ot the plugins/Makefile.am packaging list. Add #define YY_NO_UNPUT 1 to the lex source so that the yyunput symbol is not defined, squelching a compiler complaint when compiling the generated C file. svn path=/trunk/; revision=1637
* Squelch a complaint from Visual C++ 6.0 (the code was OK beforehand, atGuy Harris2000-02-121-2/+2
| | | | | | | | least as I remember the ANSI C standard, but I guess they're warning you that you might've intended to return the return value of a function but forgot to put a parameter list after the function name). svn path=/trunk/; revision=1626
* Note the document that specified the PIDs for VTP and DRiP that go alongGuy Harris2000-02-051-1/+14
| | | | | | | with Cisco's "wacky proprietary protocols atop LLC/SNAP" OUI, and put in "#if 0"ed out code for Cisco's DRiP. svn path=/trunk/; revision=1604
* Dissector for Cisco's Virtual Trunking Protocol.Guy Harris2000-02-051-1/+5
| | | | svn path=/trunk/; revision=1603
* Cisco Group Management Protocol dissector.Guy Harris2000-02-051-1/+5
| | | | svn path=/trunk/; revision=1601
* Add some new SAP values fromGuy Harris2000-01-241-47/+61
| | | | | | http://www.optimized.com/COMPENDI/REF-SAP.htm svn path=/trunk/; revision=1529
* xDLC frames other than I and UI frames may have a payload, e.g. TESTGuy Harris2000-01-241-42/+13
| | | | | | | | frames; rename "XDLC_HAS_PAYLOAD()" to "XDLC_IS_INFORMATION()", and if the frame isn't an "information" frame, dissect its payload (if any) as data. svn path=/trunk/; revision=1528
* Put the PID of SNAP frames into the protocol tree regardless of whetherGuy Harris2000-01-241-36/+61
| | | | | | | | | the frame has a payload or not. Note in a comment that in one capture there's a U frame with a function of TEST, rather than UI, that appears to have a payload. svn path=/trunk/; revision=1527
* In "dissect_eth()", update "pi.len" and "pi.captured_len" regardless ofGuy Harris2000-01-231-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | whether we're building a protocol tree or not. Make "dissect_eth()" use "BYTES_ARE_IN_FRAME()" to see if we have a full Ethernet header - it can be called with a non-zero offset, if Ethernet frames are encapsulated inside other frames (e.g., ATM LANE). Make capture routines take an "offset" argument if the corresponding dissect routine takes one (for symmetry, and for Cisco ISL or any other protocol that encapsulates Ethernet or Token-Ring frames inside other frames). Pass the frame lengths to capture routines via the "pi" structure, rather than as an in-line argument, so that they can macros such as "BYTES_ARE_IN_FRAME()" the way the corresponding dissect routines do. Make capture routines update "pi.len" and "pi.captured_len" the same way the corresponding diseect routines do, if the capture routines then call other capture routines. Make "capture_vlan()" count as "other" frames that are too short, the way other capture routines do. svn path=/trunk/; revision=1525
* Merge Paul Ionescu's CDP fixes with Guy's. Add #defines to oui.h for CiscoGerald Combs2000-01-221-4/+8
| | | | | | | IOS 9.0 and bridged frame relay and update packet-llc.c accordingly. Add CDP handler to capture_llc() in packet-llc.c. svn path=/trunk/; revision=1524
* For the Cisco OUI, always add the protocol ID to the tree if we'reGuy Harris2000-01-121-8/+9
| | | | | | | | | constructing a protocol tree. Don't add the protocol ID for unknown OUIs unless we're constructing a protocol tree. svn path=/trunk/; revision=1453
* Cisco CDP packets appears to be sent as LLC packets with an OUI ofGuy Harris2000-01-121-2/+22
| | | | | | | | | | 0x00000c and a protocol ID of 0x2000 - we used to recognize those as CDP because we ignored the OUI and treated all LLC packets as SNAP-encapsulated packets, and treated 0x2000 as an Ethertype, but we now treat only encapsulated-Ethernet and Apple packets as SNAP-encapsulated (and arguably we should handle Apple separately). svn path=/trunk/; revision=1452
* Fix Gerald's e-mail address.Guy Harris2000-01-071-2/+2
| | | | svn path=/trunk/; revision=1437
* Put a list of known OUIs in "oui.h", along with a declaration ofGuy Harris1999-12-291-7/+6
| | | | | | | | | | | | | | | | "value_string" array for OUIs. Add the OUI for the ATM Forum to that list. Handle the OUI for the ATM Forum in the layer 3 information for ISO TR 9577 in a Broadband Low Layer Information information element (for ATM LANE). Add an initial version of the dissection of TLV values in LANE LE Control frames (I have no frames with TLV values against which to test it, alas). svn path=/trunk/; revision=1385
* *** empty log message ***Guy Harris1999-12-141-6/+5
| | | | svn path=/trunk/; revision=1325
* Provide #defines for the Group/Individual bit in the DSAP, theGuy Harris1999-12-131-41/+57
| | | | | | | Command/Response bit in the SSAP, and the mask that extracts the rest of the {D,S}SAP. svn path=/trunk/; revision=1316
* Break out IG and CR bits of SSAP and DSAPNathan Neulinger1999-12-131-24/+45
| | | | | | Handle figuring out correct dsap/ssap if the last bit is 0/1 svn path=/trunk/; revision=1315
* Apple, for some unknown reason, doesn't just encapsulate AppleTalk dataGuy Harris1999-12-051-7/+44
| | | | | | | | | | | | | | | | | packets as SNAP-encapsulated Ethernet; instead, they use one of their *own* OUIs, followed by the Ethernet packet type for AppleTalk. (Even more oddly, they *do* use SNAP-encapsulated Ethernet for AARP....) Dissect OUI 08-00-07 the same way we dissect the SNAP-encapsulated Ethernet OUI of 00-00-00, and identify it as an Apple OUI. Add checks to make sure we actually have a full LLC header and, if it's a SNAP frame, that we have a full SNAP header as well. For non-SNAP frames, list both the DSAP and the SSAP in the Info column, and, for SNAP frames, list the OUI and PID. svn path=/trunk/; revision=1220
* Fix a typo.Guy Harris1999-12-051-2/+2
| | | | svn path=/trunk/; revision=1218
* Don't assume that the OUI of all SNAP frames is 00-00-00; treat onlyGuy Harris1999-12-051-16/+45
| | | | | | | | frames with an OUI of 00-00-00 as SNAP-encapsulated Ethernet, and, for other SNAP frames, display the protocol ID as hex and dissect the payload as data. svn path=/trunk/; revision=1217
* Add IPX to packet stats during capture.Gilbert Ramirez1999-11-301-2/+2
| | | | svn path=/trunk/; revision=1173
* Replace the ETT_ "enum" members, declared in "packet.h", withGuy Harris1999-11-161-3/+12
| | | | | | | | | | | | | | | | | dynamically-assigned "ett_" integer values, assigned by "proto_register_subtree_array()"; this: obviates the need to update "packet.h" whenever you add a new subtree type - you only have to add a call to "proto_register_subtree_array()" to a "register" routine and an array of pointers to "ett_", if they're not already there, and add a pointer to the new "ett_" variable to the array, if they are there; would allow run-time-loaded dissectors to allocate subtree types when they're loaded. svn path=/trunk/; revision=1043
* "XDLC_CONTROL_LEN()" actually returned the length of the entire xDLCGuy Harris1999-11-111-12/+14
| | | | | | | | | | header, under the assumption that the address field was two octets. It should return the length of the *control* field, and leave it up to its caller to add in the length of the address field. (The address field appears to be one byte in SNA, not two bytes.) svn path=/trunk/; revision=1006
* New proto_tree header_field_info stuff. Header_field_infos now containGilbert Ramirez1999-10-121-7/+12
| | | | | | | | | | | | | | | | | | | | | the base for numbers to be displayed in, bitmasks for bitfields, and blurbs (which are one or two sentences describing the field). proto_tree_add*() routines now automatically handle bitfields. You tell it which header field you are adding, and just pass it the value of the entire field, and the proto_tree routines will do the masking and shifting for you. This means that bitfields are more naturally filtered via dfilter now. Added Phil Techau's support for signed integers in dfilters/proto_tree. Added the beginning of the SNA dissector. It's not complete, but I'm committing it now because it has example after example of how to use bitfields with the new header_field_info struct and proto_tree routines. It was the impetus to change how header_field_info works. svn path=/trunk/; revision=815
* Christophe Tronche's BPDU dissector.Guy Harris1999-10-081-2/+2
| | | | svn path=/trunk/; revision=790
* Don't bother setting the length of the LLC header when we create the LLCGuy Harris1999-09-271-2/+2
| | | | | | | tree to anything other than 0, as we're going to change it to the right value once the control field has been parsed and we know the right value. svn path=/trunk/; revision=731
* Handle the length of the LLC(+SNAP) header correctly for SNAP frames.Guy Harris1999-09-261-6/+14
| | | | svn path=/trunk/; revision=728
* Have "get_xdlc_control()" and "dissect_xdlc_control()" return theGuy Harris1999-09-261-12/+14
| | | | | | | | | | | xDLC control field, so that its caller can not only determine from it whether the frame has a payload, but can also determine how long the control field is. Put macros in "xdlc.h" to determine both of those. Have "capture_llc()" and "dissect_llc()" use that information appropriately. svn path=/trunk/; revision=727
* Have "get_xdlc_control()" and "dissect_xdlc_control()" just return aGuy Harris1999-08-231-18/+14
| | | | | | Boolean indicating whether the frame has any payload to dissect or not. svn path=/trunk/; revision=556
* The only LLC frame types that should be dissected based on their SAP or,Guy Harris1999-08-231-37/+76
| | | | | | | | if the SAPs are SNAP, based on their ethertype are I frames and UI frames; others don't have payload to be dissected as belonging to other protocols. svn path=/trunk/; revision=555