aboutsummaryrefslogtreecommitdiffstats
path: root/packet-llc.c
AgeCommit message (Collapse)AuthorFilesLines
2000-05-19Add protection against 0-length FT_BYTES being added to proto_tree.Gilbert Ramirez1-3/+3
Convert ethertype() and dissect_null() to use tvbuff. svn path=/trunk/; revision=1979
2000-05-16Have tvbuff's keep track of cap_len and pkt_len ('length' and 'reported_length'Gilbert Ramirez1-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
2000-05-12In wiretap, set err to 0 before doing anything inside wtap_loop().Gilbert Ramirez1-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
2000-05-12<sheepish grin>Gilbert Ramirez1-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
2000-05-11Convert LLC dissector to use tvbuffs.Gilbert Ramirez1-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
2000-05-11Add tvbuff class.Gilbert Ramirez1-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
2000-04-17Register a "llc.dsap" dissector table for 802.2 LLC, and have dissectorsGuy Harris1-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
2000-04-13For I and S frames, the LLC control field is 2 bytes, so make itGuy Harris1-2/+2
FT_UINT16 (that won't break things for U frames, where it's 1 byte). svn path=/trunk/; revision=1838
2000-04-12Change my e-mail address from @tivoli.com to @xiexie.orgGilbert Ramirez1-2/+2
svn path=/trunk/; revision=1831
2000-04-10Add DOCSIS BPDU patch from Johannes Hennecke <Johannes.Hennecke@elsa.de>.Gerald Combs1-1/+10
svn path=/trunk/; revision=1826
2000-04-09The "llc_ctrl_vals[]" value_string table isn't used to generate theGuy Harris1-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
2000-04-08The "llc_ctrl_vals[]" value_string table isn't used to generate theGuy Harris1-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
2000-02-15Create a header file for every packet-*.c file. Prune the packet.h file.Gilbert Ramirez1-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
2000-02-12Squelch a complaint from Visual C++ 6.0 (the code was OK beforehand, atGuy Harris1-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
2000-02-05Note the document that specified the PIDs for VTP and DRiP that go alongGuy Harris1-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
2000-02-05Dissector for Cisco's Virtual Trunking Protocol.Guy Harris1-1/+5
svn path=/trunk/; revision=1603
2000-02-05Cisco Group Management Protocol dissector.Guy Harris1-1/+5
svn path=/trunk/; revision=1601
2000-01-24Add some new SAP values fromGuy Harris1-47/+61
http://www.optimized.com/COMPENDI/REF-SAP.htm svn path=/trunk/; revision=1529
2000-01-24xDLC frames other than I and UI frames may have a payload, e.g. TESTGuy Harris1-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
2000-01-24Put the PID of SNAP frames into the protocol tree regardless of whetherGuy Harris1-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
2000-01-23In "dissect_eth()", update "pi.len" and "pi.captured_len" regardless ofGuy Harris1-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
2000-01-22Merge Paul Ionescu's CDP fixes with Guy's. Add #defines to oui.h for CiscoGerald Combs1-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
2000-01-12For the Cisco OUI, always add the protocol ID to the tree if we'reGuy Harris1-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
2000-01-12Cisco CDP packets appears to be sent as LLC packets with an OUI ofGuy Harris1-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
2000-01-07Fix Gerald's e-mail address.Guy Harris1-2/+2
svn path=/trunk/; revision=1437
1999-12-29Put a list of known OUIs in "oui.h", along with a declaration ofGuy Harris1-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
1999-12-14*** empty log message ***Guy Harris1-6/+5
svn path=/trunk/; revision=1325
1999-12-13Provide #defines for the Group/Individual bit in the DSAP, theGuy Harris1-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
1999-12-13Break out IG and CR bits of SSAP and DSAPNathan Neulinger1-24/+45
Handle figuring out correct dsap/ssap if the last bit is 0/1 svn path=/trunk/; revision=1315
1999-12-05Apple, for some unknown reason, doesn't just encapsulate AppleTalk dataGuy Harris1-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
1999-12-05Fix a typo.Guy Harris1-2/+2
svn path=/trunk/; revision=1218
1999-12-05Don't assume that the OUI of all SNAP frames is 00-00-00; treat onlyGuy Harris1-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
1999-11-30Add IPX to packet stats during capture.Gilbert Ramirez1-2/+2
svn path=/trunk/; revision=1173
1999-11-16Replace the ETT_ "enum" members, declared in "packet.h", withGuy Harris1-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
1999-11-11"XDLC_CONTROL_LEN()" actually returned the length of the entire xDLCGuy Harris1-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
1999-10-12New proto_tree header_field_info stuff. Header_field_infos now containGilbert Ramirez1-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
1999-10-08Christophe Tronche's BPDU dissector.Guy Harris1-2/+2
svn path=/trunk/; revision=790
1999-09-27Don't bother setting the length of the LLC header when we create the LLCGuy Harris1-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
1999-09-26Handle the length of the LLC(+SNAP) header correctly for SNAP frames.Guy Harris1-6/+14
svn path=/trunk/; revision=728
1999-09-26Have "get_xdlc_control()" and "dissect_xdlc_control()" return theGuy Harris1-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
1999-08-23Have "get_xdlc_control()" and "dissect_xdlc_control()" just return aGuy Harris1-18/+14
Boolean indicating whether the frame has any payload to dissect or not. svn path=/trunk/; revision=556
1999-08-23The only LLC frame types that should be dissected based on their SAP or,Guy Harris1-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
1999-08-10Jeff Foster's changes to add support for NetBEUI/NBF (NetBIOS atop 802.2Guy Harris1-2/+2
LLC, the original NetBIOS encapsulation). svn path=/trunk/; revision=466
1999-08-04Add a "dissect_xdlc_control()" routine, to dissect the control field ofGuy Harris1-4/+32
SDLC-derived protocols such as HDLC and derivatives of it such as LAPB, IEEE 802.2 LLC, and so on. Have the LLC and LAPB dissectors use it. Make "dissect_numeric_bitfield()" put the low-order bit of the bitfield in the low-order bit of an integer when printing it, so that the right value is printed. svn path=/trunk/; revision=434
1999-07-29Made the protocol (but not the fields) use the new proto_tree routine,Gilbert Ramirez1-7/+7
allowing users to filter on the existence of these protocols. I also added packet-clip.c to the Nmake makefile. svn path=/trunk/; revision=402
1999-07-15Modified the proto_register_field_array usage again. Thanks to Guy'sGilbert Ramirez1-8/+15
suggestion, this new method using a static array should use less memory and be faster. It also has a nice side-effect of making the source-code more readble, IMHO. Changed the print routines to look for protocol proto_data instead of looking at the text label as they did before, hoping that the data hex dump field item starts with "Data (". Added the -G keyword to ethereal to make it dump a glossary of display filter keywords to stdout and exit. This data is then formatted with the doc/dfilter2pod perl program to pod format, which is combined with doc/ethereal.pod.template to create doc/ethereal.pod, from which the ethereal manpage is created. This way we can keep the manpage up-to-date with a list of fields that can be filtered on. svn path=/trunk/; revision=364
1999-07-07Created a new protocol tree implementation and a new display filterGilbert Ramirez1-78/+116
mechanism that is built into ethereal. Wiretap is now used to read all file formats. Libpcap is used only for capturing. svn path=/trunk/; revision=342
1999-03-23Removed all references to gtk objects from packet*.[ch] files. They nowGilbert Ramirez1-18/+13
reference the protocol tree with struct proto_tree and struct proto_item objects. That way, the packet decoding source code file can be used with non-gtk packet decoders, like a curses-based ethereal, e.g. I also re-arranged some of the information in packet.h to more appropriate places (like other packet-*.[ch] files). svn path=/trunk/; revision=223
1999-03-22Well, that was dumb. I didn't have to add a "capture_data()" routine; IGuy Harris1-2/+2
just had to make "sap_capture_func()" return NULL if it didn't find an entry for the SAP it was passed. svn path=/trunk/; revision=220
1999-03-22Have "sap_capture_func()" return "capture_data" rather thanGuy Harris1-8/+11
"dissect_data"; if you call "dissect_data()" with an argument list of the type expected by a "capture_XXX()" routine, it won't do the right thing (and may do the wrong thing, e.g. crash). Have "sap_capture_func()" (and "sap_dissect_func()") return function pointers rather than "void *"s, so that I don't make a mistake like the above in the future.... svn path=/trunk/; revision=219