aboutsummaryrefslogtreecommitdiffstats
path: root/packet-x25.c
AgeCommit message (Collapse)AuthorFilesLines
2002-04-09Move the definition of the FROM_DCE bit in the "flags" field of aGuy Harris1-34/+133
"struct x25_phdr" to "wiretap/wtap.h". Have two X.25 dissectors, one of which assumes that there's a "struct x25_phdr" pseudo-header and one of which doesn't; the former uses the information in that pseudo-header to determine whether the packet is DTE->DCE or DCE->DTE, and the latter assumes it has no clue whether the packet is DTE->DCE or DCE->TDE. Use the former one in the LAPB dissector, and the latter one in the XOT dissector and in the LLC dissector table. In the X.25-over-TCP dissector, handle multiple X.25 packets per TCP segment, and handle X.25 packets split across TCP segments. svn path=/trunk/; revision=5134
2002-01-24Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls inGuy Harris1-7/+6
arguments to "proto_tree_add_text()", and to "proto_tree_add_XXX()" calls that add FT_NONE or FT_PROTO items to the protocol tree, with -1. Replace some calls to "tvb_length()" or "tvb_length_remaining()" with calls to "tvb_reported_length()" and "tvb_reported_length_remaining()", as those give the actual length of the data in the packet, not just the data that happened to be captured. svn path=/trunk/; revision=4605
2002-01-21Include files from the "epan" directory and subdirectories thereof withGuy Harris1-2/+2
"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-57/+57
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-05Add a heuristic dissector for protocols running atop X.25.Guy Harris1-19/+31
svn path=/trunk/; revision=4336
2001-12-03Add a routine tro look for a given port in a given dissector table and,Guy Harris1-63/+41
if found, return the dissector handle for that port. Use that routine in the X.25 dissector; revert to attaching a dissector handle to an X.25 virtual circuit. svn path=/trunk/; revision=4310
2001-12-03Make "dissector_add()", "dissector_delete()", and "dissector_change()"Guy Harris1-2/+5
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-12-02Add a new header file for X.264 transport protocol IDs.Guy Harris1-11/+17
Handle ISO 8602 as a protocol ID on top of X.25. svn path=/trunk/; revision=4302
2001-12-02An NLPID of 1 means T.70 when used as an X.263/ISO 9577 initial protocolGuy Harris1-124/+273
identifier, but means X.29 when used as an X.263/ISO 9577 secondary protocol identifier. Add support for the IPv6 NLPID, and Ethernet type, in more places. Fix up the handling of the user data of a CALL REQUEST packet to more correctly distinguish between user data containing an NLPID and user data containing an X.264/ISO 11570 UN TPDU. If it's an NLPID, use "nlpid_vals" to show its value. Put that user data in a subtree. Create a new "x.25.spi" dissector table, for protocols running atop X.25, rather than having a built-in switch statement, so that other protocols can register themselves by NLPID. svn path=/trunk/; revision=4300
2001-11-25Switched from calling dissect_data to using call_dissectorEd Warnicke1-2/+4
svn path=/trunk/; revision=4263
2001-11-15Add support for SNA-over-X.25. Add QLLC dissector. I still need toGilbert Ramirez1-30/+68
work on dissecting the Information frame of QLLC packets. Thanks to mario.ferreira@hsbc.com.br for lots of information on SNA over X.25. svn path=/trunk/; revision=4207
2001-07-18- get_x25_pkt_len() :Olivier Abad1-1/+6
In "call accept" packets, the address block is not mandatory. Check the packet length before trying to read the addresses. svn path=/trunk/; revision=3739
2001-07-16Fix a typo.Guy Harris1-2/+2
svn path=/trunk/; revision=3733
2001-07-14Dissect more diagnostic codes.Olivier Abad1-13/+94
svn path=/trunk/; revision=3719
2001-07-05fixed some warning: comparison between signed and unsignedOlivier Abad1-4/+4
svn path=/trunk/; revision=3657
2001-06-18From Joerg Mayer: explicitly fill in all members of aGuy Harris1-14/+14
"header_field_info" structure, including the ones that are later set by the routines to register fields. svn path=/trunk/; revision=3561
2001-04-07Mention RFC 1356 in the comment about handling NLPIDs other than theGuy Harris1-3/+6
0xCC one for IP. svn path=/trunk/; revision=3268
2001-03-30NLPID's of 0x08 and 0x09 should be labeled as Q.933 and LMI,Guy Harris1-4/+1
respectively, not Q.931 and Q.2931, in Frame Relay. When dissecting Q.933-style multiprotocol encapsulated Frame Relay frames, use the "osinl" dissector table to check for OSI network layer protocols, include the NLPID in the tvbuff you hand to "dissector_try_port()" with that dissector table, and put the NLPID into the protocol tree as an invisible item - the NLPID is considered part of the PDU for those protocols, so you have to include it in the tvbuff, and the dissector will put it into the protocol tree. Also, make sure the top-level entry for the Frame Relay protocol includes all the bytes preceding the payload, and none of the payload bytes. Export a routine to do Q.933-style dissection, and have the WCP dissector call it, rather than duplicating that code in the WCP dissector. Don't register OSI network layer protocols with the "fr.ietf" dissector table; it's now sufficient to register them with the "osinl" dissector table, as the Frame Relay dissector now checks that. Get rid of unnecessary checks for protocols being enabled (if the dissector is always called through handles or dissector tables, the common code for handles and dissector tables will do the checks for you). Get rid of some unnecessary #includes. svn path=/trunk/; revision=3211
2001-02-12If you register more than one field with the same name, the dfilter codeGuy Harris1-163/+93
can now handle that; this allows us to register both the modulo-8 and the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names, which lets us get rid of the "ex.25" protocol stuff completely and use "x.25" for both modulo-8 and modulo-128 X.25. Do so. (Also, fix up some cases where we appeared to be using the modulo-8 fields when dissecting modulo-128 X.25.) This, in turn, allows us to register the X.25 dissector, as there's now only one protocol with which it's associated, and make it static and have it called only through a handle, and to, when registering it with the "llc.dsap" dissector table, associate it with "proto_x25". That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()" calls, and the code to set "pinfo->current_proto", in the X.25 dissector. The code for the display filter expression dialog would, if there are two fields with the same name registered under a protocol, list both of them; have it list only one of them - the fields should have the same type, the same radix, and the same value_string/true_false_string table if any (if they don't, they're really not the same field...). svn path=/trunk/; revision=3023
2001-01-09Add an additional "protocol index" argument to "{old_}dissector_add()",Guy Harris1-2/+9
"{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-05X.25-over-LLC support, from Paul Ionescu.Guy Harris1-2/+5
svn path=/trunk/; revision=2829
2001-01-03- replace x25 with x.25 in all protocol fieldsOlivier Abad1-24/+56
- displays the GFI (the a/q/d bits and modulo are displayed in a subtree of the GFI) - correctly dissect the first bit of the GFI : Address bit in call set-up and clearing packets, Qualifier bit in data packets. svn path=/trunk/; revision=2820
2001-01-03Have "proto_register_protocol()" build a list of data structures forGuy Harris1-3/+4
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-29Modify X.25 dissector to accept a search string of x.25 and ex.25, not x25 ↵Richard Sharpe1-3/+3
and ex25. svn path=/trunk/; revision=2797
2000-11-27The length of FT_BOOLEAN bitfields must be specified in bits, not bytes.Olivier Abad1-7/+7
svn path=/trunk/; revision=2702
2000-11-19For each column, have both a buffer into which strings for that columnGuy Harris1-6/+6
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-19Register the OSI transport dissector by name, and make it static.Guy Harris1-11/+23
"packet-clnp.h" no longer exports anything, so remove it. Have the X.25 dissector call subdissectors through dissector handles (now that all the dissectors it uses are registered by name). svn path=/trunk/; revision=2668
2000-11-18Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSIGuy Harris1-17/+14
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/+7
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-2/+2
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-07-01Add support for OSI CLTP.Guy Harris1-2/+2
Redo the way the variable part of COTP and CLTP packets are handled, by having a single routine to handle it for all packets, rather than having the dissector for each type of packet handle the parameters those packets are supposed to have. Fix "is_LI_NORMAL_AK()" to test (heuristically) whether an AK COTP packet is normal rather than extended, rather than testing whether it's normal, and invert the test where it's used (i.e. make what it does correspond to what its name says, which means we invert the test it does, and then change the code that uses it appropriately). Add support for the "preferred maximum TPDU size" and "inactivity timer" parameters, and fix various problems in the dissection of particular parameters. svn path=/trunk/; revision=2100
2000-05-31Add routines for adding items to a protocol tree that take arguments ofGuy Harris1-44/+44
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-291 - Use "tvb_reported_length()" in the X.25 dissector.Olivier Abad1-28/+28
2 - Consistantly display LCN in decimal (they used to be displayed in decimal in the packet list, and in hexadecimal in the tree view). svn path=/trunk/; revision=2026
2000-05-28Changed my mail address to oabad@cybercable.fr (dhis.net is tooOlivier Abad1-2/+2
unreliable). svn path=/trunk/; revision=2019
2000-05-28Properly register hf_x25_dbit and hf_ex25_dbit.Gilbert Ramirez1-3/+3
svn path=/trunk/; revision=2018
2000-05-25Convert X.25 dissector to use tvbuffs.Olivier Abad1-544/+582
svn path=/trunk/; revision=2007
2000-05-19Add wtap-int.h. Move definitions relevant to the internal workins of wiretapGilbert Ramirez1-2/+2
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-25/+21
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-11Add tvbuff class.Gilbert Ramirez1-153/+153
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-15Ralf Schneider's changes to enhance to OSI CLNP, CLTP, and ISIS supportGuy Harris1-1/+2
and to add OSI ESIS support. svn path=/trunk/; revision=1865
2000-04-13Change the sub-dissector handoff registration routines so that theGilbert Ramirez1-1/+8
sub-dissector table is not stored in the header_field_info struct, but in a separate namespace. Dissector tables are now registered by name and not by field ID. For example: udp_dissector_table = register_dissector_table("udp.port"); Because of this different namespace, dissector tables can have names that are not field names. This is useful for ethertype, since multiple fields are "ethertypes". packet-ethertype.c replaces ethertype.c (the name was changed so that it would be named in the same fashion as all the filenames passed to make-reg-dotc) Although it registers no protocol or field, it registers one dissector table: ethertype_dissector_table = register_dissector_table("ethertype"); All protocols that can be called because of an ethertype field now register that fact with dissector_add() calls. In this way, one dissector_table services all ethertype fields (hf_eth_type, hf_llc_type, hf_null_etype, hf_vlan_etype) Furthermore, the code allows for names of protocols to exist in the etype_vals, yet a dissector for that protocol doesn't exist. The name of the dissector is printed in COL_INFO. You're welcome, Richard. :-) svn path=/trunk/; revision=1848
2000-03-12Break proto_tree_add_item_format() into multiple functions:Gilbert Ramirez1-8/+8
proto_tree_add_protocol_format() proto_tree_add_uint_format() proto_tree_add_ipxnet_format() proto_tree_add_ipv4_format() proto_tree_add_ipv6_format() proto_tree_add_bytes_format() proto_tree_add_string_format() proto_tree_add_ether_format() proto_tree_add_time_format() proto_tree_add_double_format() proto_tree_add_boolean_format() If using GCC 2.x, we can check the print-format against the variable args passed in. Regardless of compiler, we can now check at run-time that the field type passed into the function corresponds to what that function expects (FT_UINT, FT_BOOLEAN, etc.) Note that proto_tree_add_protocol_format() does not require a value field, since the value of a protocol is always NULL. It's more intuitive w/o the vestigial argument. Fixed a proto_tree_add_item_format-related bug in packet-isis-hello.c Fixed a variable usage bug in packet-v120.c. (ett_* was used instead of hf_*) Checked in Guy's fix for the function declearation for proto_tree_add_text() and proto_tree_add_notext(). svn path=/trunk/; revision=1713
2000-02-22Make "reinit_x25_hashtable()" static (it's not explicitly called fromGuy Harris1-3/+3
outside "packet-x25.c", it's only registered as a protocol init routine), and explicitly declare it as taking no arguments (GCC doesn't complain about passing a pointer to a routine with an unspecified argument list to "register_init_routine()", which expects a pointer to a routine with no arguments, but Microsoft Visual C{++} 6.0 does complain about it). svn path=/trunk/; revision=1664
2000-02-19Used register_init_routine() to register "reinit_x25_hashtable()" as aOlivier Abad1-1/+2
routine to be called every time a new capture file is opened instead of calling it in read_cap_file() and do_capture(). svn path=/trunk/; revision=1651
2000-02-18Renamed init_dissect_x25() to reinit_x25_hashtable() and actually used it !Olivier Abad1-2/+2
This function is used to re-initialize the hash table used by the X.25 dissector to record the upper layer protocol used by each VC. The hash table should be re-initialized each time we read / start a new capture. I moved the definition of the function from packet.h to packet-x25.h, and added calls to reinit_x25_hashtable() in read_cap_file (file.c) and do_capture (capture.c). svn path=/trunk/; revision=1644
2000-02-15Create a header file for every packet-*.c file. Prune the packet.h file.Gilbert Ramirez1-1/+3
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-01-30Dissect the user data of an incoming CALL REQUEST/INCOMING CALL packetGuy Harris1-23/+94
as per X.224 and X.264. svn path=/trunk/; revision=1584
2000-01-29The user data in an X.25 call request packet is - at least for IP and,Guy Harris1-2/+6
if I correctly read the Windows NT DDK documentation on WAN drivers, for PPP as well - an ISO NLPID, so use the "nlpid.h" values where they exist. Currently doesn't treat NLPID_PPP as PPP, but if we get a PPP-over-X.25 capture, we may find that it should do so. svn path=/trunk/; revision=1577