aboutsummaryrefslogtreecommitdiffstats
path: root/packet-atm.c
AgeCommit message (Collapse)AuthorFilesLines
2003-03-07Add another sanity check - there shouldn't be more than 47 bytes ofGuy Harris1-15/+32
padding before the AAL5 trailer. svn path=/trunk/; revision=7308
2003-03-04There might well be more than 40 bytes of padding in an AAL5 frame - itGuy Harris1-8/+12
doesn't always appear to be the case that the minimum number of cells is used for an AAL5 packet. Instead, do the sanity check on the AAL5 length field - require it to be non-zero and to be less than or equal to the amount of space left over in the packet after the trailer is removed. svn path=/trunk/; revision=7275
2003-03-04Attempt to better handle bogus AAL5 lengths (by assuming that the packetGuy Harris1-12/+18
doesn't have padding and the AAL5 trailer). svn path=/trunk/; revision=7269
2003-01-11Put the correct/incorrect flag after the CRC value, as is done for otherGuy Harris1-3/+3
checksums. svn path=/trunk/; revision=6903
2003-01-11The OAM type and function type are packed into a single byte; set theGuy Harris1-6/+6
length of the entries for them to 1, not 2. svn path=/trunk/; revision=6902
2003-01-10Put the traffic type right after the AAL.Guy Harris1-6/+14
Dump unknown AAL purportedly-reassembled data as raw data. svn path=/trunk/; revision=6895
2003-01-10Oops, a last-minute name change didn't get into packet-atm.c.Guy Harris1-2/+2
svn path=/trunk/; revision=6890
2003-01-10The Sniffer file formats include a file to identify raw cells; exportGuy Harris1-7/+6
that flag in the ATM pseudo-header, and use it to determine whether a frame is a raw cell or a reassembled frame, rather than using the AAL, as you can have raw AAL5 cells in a capture. svn path=/trunk/; revision=6889
2003-01-09Check the CRC-10 on AAL3/4 and OAM cells.Guy Harris1-5/+74
svn path=/trunk/; revision=6884
2003-01-09Check the HEC in ATM cells.Guy Harris1-2/+121
svn path=/trunk/; revision=6883
2003-01-09Add code to check the AAL5 CRC, and report it as a CRC rather than as aGuy Harris1-7/+134
checksum. svn path=/trunk/; revision=6882
2003-01-09It appears that a channel number of 0 means DTE->DCE, and a channelGuy Harris1-11/+11
number of 1 means DCE->DTE, in DOS Sniffer ATM captures. svn path=/trunk/; revision=6881
2003-01-08Make the AAL for a packet a filterable field.Guy Harris1-263/+309
Put the code to handle AAL5 and Signalling AAL traffic, and to handle raw cells, into routines of their own. Don't put the VPI/VCI/cell count information from the pseudo-header into the protocol tree for raw cells - just get the VPI/VCI from the raw cell, and leave out the cell count. Set the Protocol and Info column for AAL1 and AAL3/4 cells. Clean up the names of some of the raw cell fields, as displayed. Make the payload type text match what's in various specs. Display the cell loss priority symbolically. Fix up the code that displays the AAL3/4 trailer information to use the AAL3/4 trailer rather than the AAL3/4 header. Show the number of cells if we have reassembled traffic complete with the AAL5 trailer. svn path=/trunk/; revision=6878
2003-01-08Dissect non-AAL5 packets as single cells.Guy Harris1-10/+189
Dissect the U2U data as UU and CPI. svn path=/trunk/; revision=6876
2003-01-03Rename WTAP_ENCAP_ATM_SNIFFER to WTAP_ENCAP_ATM_PDUS, as it's not justGuy Harris1-16/+82
used for the DOS-based ATM Sniffer. (That's not a great name, but I couldn't think of a better one.) Add a new WTAP_ENCAP_ATM_PDUS_UNTRUNCATED encapsulation type for capture files where reassembled frames don't have trailers, such as the AAL5 trailer, chopped off. That's what at least some versions of the Windows-based ATM Sniffer appear to have. Map the ATM capture file type for NetXRay captures to WTAP_ENCAP_ATM_PDUS_UNTRUNCATED, and put in stuff to fill in what we've reverse-engineered, so far, for the pseudo-header; there's more that needs to be done on it, e.g. getting the channel, AAL type, and traffic type (or inferring them if they're not in the packet header). svn path=/trunk/; revision=6840
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-5/+5
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6117
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hJörg Mayer1-7/+3
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-06-07Add a Wiretap routine to process packets captured via libpcap, possiblyGuy Harris1-1/+56
extracting a pseudo-header, for the use of SunATM captures. Add support for SunATM capture. svn path=/trunk/; revision=5652
2002-05-25Get rid of the routine to dissect LANE topology change frames, asGuy Harris1-9/+2
there's nothing in them past the flags. svn path=/trunk/; revision=5555
2002-05-24Add LANE 2.0 stuff.Guy Harris1-56/+288
Show the maximum frame size symbolically. For the various LANE frame types, show only the fields those frame types are specified to contain, and show only the flag bits that are specified for those frame types. Use the ELAN name size when putting the name into the protocol tree, and don't put it in if the name size is 0. svn path=/trunk/; revision=5543
2002-04-30Don't bother telling the user twice that the traffic is LLC multiplexedGuy Harris1-5/+1
traffic; once is enough. svn path=/trunk/; revision=5315
2002-04-30Move the code to guess the traffic type based on the packet contentsGuy Harris1-97/+1
into Wiretap, so that if you read a frame from Wiretap you have what traffic type information could be gleaned from the information in the capture file, and can write the frame out to a capture file where the file contains some or all of that information without having to determine it outside of Wiretap. svn path=/trunk/; revision=5314
2002-04-30Replace the "ngsniffer_atm" with an "atm" pseudo-header, which isn'tGuy Harris1-187/+176
just an image of the ATM Sniffer data. This means that Ethereal doesn't have to know any ATM Sniffer-specific details (that's all hidden in Wiretap), and allows us to add to that pseudo-header fields, traffic types, etc. unknown to ATM Sniffers. Have Wiretap map VPI 0/VCI 5 to the signalling AAL - for some capture files, this might not be necessary, as they may mark all signalling traffic as such, but, on other platforms, we don't know the AAL, so we assume AAL5 except for 0/5 traffic. Doing it in Wiretap lets us hide those details from Ethereal (and lets Ethereal interpret 0/5 traffic as non-signalling traffic, in case that happens to be what it is). We may know that traffic is LANE, but not whether it's LE Control or emulated 802.3/802.5; handle that case. svn path=/trunk/; revision=5302
2002-03-31Put the LANE packet type in the Info column for ATM LANE traffic.Guy Harris1-16/+34
Get rid of an unused variable. svn path=/trunk/; revision=5054
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
2001-12-10Move the pointer to the "column_info" structure in the "frame_data"Guy Harris1-20/+20
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-03Make "dissector_add()", "dissector_delete()", and "dissector_change()"Guy Harris1-4/+6
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-26Moved from using dissect_data to using call_dissector()Ed Warnicke1-4/+6
svn path=/trunk/; revision=4266
2001-06-18From Joerg Mayer: explicitly fill in all members of aGuy Harris1-3/+3
"header_field_info" structure, including the ones that are later set by the routines to register fields. svn path=/trunk/; revision=3561
2001-05-27Call the LANE dissector through a handle.Guy Harris1-13/+24
Create an ILMI dissector and call it through a handle. Update Gerald's e-mail address. svn path=/trunk/; revision=3465
2001-05-27Call the SSCOP dissector through a handle. That lets us get rid of theGuy Harris1-4/+6
CHECK_DISPLAY_AS_DATA call and code to set "pinfo->current_proto", as "call_dissector()" does that for us. svn path=/trunk/; revision=3457
2001-04-15Tvbuffify the ASN.1 code and the Kerberos, LDAP, and SNMP dissectors.Guy Harris1-9/+2
Clean up some problems that revealed. svn path=/trunk/; revision=3301
2001-01-21Always call the Ethernet and Token Ring dissectors through a dissectorGuy Harris1-9/+10
handle, and make them static. svn path=/trunk/; revision=2925
2001-01-09Add an additional "protocol index" argument to "{old_}dissector_add()",Guy Harris1-2/+3
"{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-03Have the TR MAC and LLC dissectors register themselves, make themGuy Harris1-2/+9
static, and have other dissectors call them through handles. svn path=/trunk/; revision=2816
2001-01-03Have "proto_register_protocol()" build a list of data structures forGuy Harris1-4/+5
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-11-29Wrap the dissect_fddi() call (with a 4th argument) withGilbert Ramirez1-3/+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-9/+9
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-16Tvbuffify the STP dissector, have it register itself and have the LLCGuy Harris1-4/+4
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-11-13Move "bytes_to_str()" to "strutil.c" from "packet.c" - it's just aGuy Harris1-4/+4
string formatter, like "format_text()", and, as "tvbuff.c" now calls it (*vide infra*), we don't want to have to make "tvbuff.c" drag "packet.h" in just to declare "bytes_to_str()". It's now declared in "strutil.h", so include it in modules that use "bytes_to_str()" and weren't already including it. Add a "tvb_bytes_to_str()" wrapper that calls "tvb_get_ptr()" to get a pointer to a chunk of N bytes at a given offset in a tvbuff and then hands that chunk to "bytes_to_str()". Convert the code that was doing that to use "tvb_bytes_to_str()" instead (which caught what I suspect is a bug in the Q.2931 dissector, where it was handing an offset of 0 to "tvb_get_ptr()" - a cut-and-pasteo, I think). Tvbuffify the ARP dissector. svn path=/trunk/; revision=2634
2000-08-13Add the "Edit:Protocols..." feature which currently only implementsLaurent Deniel1-1/+6
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-4/+4
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-05-31Add routines for adding items to a protocol tree that take arguments ofGuy Harris1-3/+3
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
2000-05-29Add "tvb_reported_length()" to get the "reported length" of a tvbuffGuy Harris1-152/+158
(i.e., the amount of data that was in the packet, even if not all of it was captured), for use when dissecting packets containing data that fills the packet (we want the dissector to try to dissect all of it; if it runs past the end of the captured data, we want it to throw an exception so that we'll put a "Short Frame" note in the protocol tree). This means we always want a tvbuff to have a real reported length value, so we make it an unsigned integer, and don't bother checking it for -1, as it should never be -1. If the reported length passed in to "tvb_set_subset()" is -1, set the reported length to the reported length of the tvbuff of which the new tvbuff will be a subset minus the offset in that tvbuff of the subset, so that "-1" means "what's left of the packet after we chop off the header". This is necessary in order to ensure that all tvbuffs have a real reported length value. Have "dissect_packet()" set the reported length of the top-level tvbuff to the reported length of the frame, so that we start out with a tvbuff with a real reported length value. Have "tvb_offset_exists()" return FALSE if the offset is past the end of the tvbuff. If the offset passed to it is postitive, have "compute_offset_length()" check for that it's not more than one byte past the end of the tvbuff - if it's just past the end, we don't want the check to fail, as we don't want attempts to create a subset tvbuff containing zero bytes to fail; that would be done if a captured packet was all header and no payload, and we'd want the dissector of the payload, not the dissector of the header, to throw an exception, as the problem isn't with the protocol for the header, it's with the protocol for the payload. Convert the ATM dissector, the SSCOP dissector, the Q.2931 dissector, and the Q.931 dissector to use tvbuffs. Make the LAPD dissector set up a tvbuff for the Q.931 dissector (it's not converted yet). svn path=/trunk/; revision=2023
2000-05-19Add wtap-int.h. Move definitions relevant to the internal workins of wiretapGilbert Ramirez1-4/+4
to that file, leave public definitions in wtap.h. Rename "union pseudo_header" to "union wtap_pseudo_header". Make the wtap_pseudo_header pointer available in packet_info struct. svn path=/trunk/; revision=1989
2000-05-18Remove the "union pseudo_header" from the "frame_data" structure;Guy Harris1-33/+37
there's no need to keep it around in memory - when the frame data is read in when handing a frame, read in the information, if any, necessary to reconstruct the frame header, and reconstruct it. This saves some memory. This requires that the seek-and-read function be implemented inside Wiretap, and that the Wiretap handle remain open even after we've finished reading the file sequentially. This also points out that we can't really do X.25-over-Ethernet correctly, as we don't know where the direction (DTE->DCE or DCE->DTE) flag is stored; it's not clear how the Ethernet type 0x0805 for X.25 Layer 3 is supposed to be handled in any case. We eliminate X.25-over-Ethernet support (until we find out what we're supposed to do). svn path=/trunk/; revision=1975
2000-05-16Convert Ethernet and Lucent/Ascend dissectors to use tvbuff.Gilbert Ramirez1-6/+7
Note in AUTHORS file that we use the exception module from kazlib. svn path=/trunk/; revision=1966
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-15Convert token-ring dissector to use tvbuffs.Gilbert Ramirez1-3/+7
Modify ethernet dissector to catch BoundsError if the attempt to create next_tvb with the length specified in the ethernet header throws an exception. In that case, next_tv is created with as many bytes as are available in the frame. Both dissect_tr() and dissect_eth() now have TRY blocks, which means I had to fiddle with 'volatile' and 'static' storage options to get things right (at least according to gcc). svn path=/trunk/; revision=1962
2000-05-11Convert LLC dissector to use tvbuffs.Gilbert Ramirez1-2/+4
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