aboutsummaryrefslogtreecommitdiffstats
path: root/packet-x25.c
AgeCommit message (Collapse)AuthorFilesLines
2003-10-07Put the "X.264 protocol identifier" and "X.264 sharing strategy" fieldsOlivier Abad1-3/+3
in the "User data" subtree. svn path=/trunk/; revision=8642
2003-04-20Add a pointer to an hf_ value for a "reassembled_in" field (which can beGuy Harris1-1/+2
null) to the "fragment_items" structure, and don't pass that value into "process_reassembled_data()", just have it use the value in the "fragment_items" structure passed to it. Make "process_reassembled_data()" capable of handling reassembly done by "fragment_add_seq_check()", and use it in the ATP and 802.11 dissectors; give them "reassembled_in" fields. Make "process_reassembled_data()" handle only the case of a completed reassembly (fd_head != NULL) so that we can use it in those dissectors without gunking the code up too much. svn path=/trunk/; revision=7513
2003-03-05Distinguish between the two directions of X.25 traffic when doingGuy Harris1-8/+48
reassembly - don't reassemble packets from different directions into a single packet. We don't need to check whether we have enough data for reassembly - "fragment_add_seq_next()" does that for us. If we're doing reassembly, show the user data of packets with the M bit set as "User data". svn path=/trunk/; revision=7281
2003-03-05When reassembling, test the correct M bit based on whether it's mod-8 orGuy Harris1-32/+47
mod-128. Don't reassemble if we don't have all the payload (e.g., if we have a short frame). Clean up indentation. Remove the "_x25" at the end of the preference for reassembling X.25 packets - it already has "x25." at the beginning. Add a bunch of #defines for various bits to be tested, and use them. svn path=/trunk/; revision=7279
2003-03-04From Laurent Meyer: reassemble fragmented X.25 packets, and fix up aGuy Harris1-5/+104
test. svn path=/trunk/; revision=7276
2003-03-01X.29 call user data in CALL REQUEST packets starts with an SPI and 3Guy Harris1-1/+10
bytes of other information, currently not used; that data is not to be dissected as X.29 packet data. svn path=/trunk/; revision=7241
2003-03-01If *all* you have in the user data portion of a Call Request packet isGuy Harris1-12/+22
an NLPID, don't dissect the user data as a packet for that protocol. svn path=/trunk/; revision=7234
2003-02-28From Laurent Meyer: let the user data in CALL REQUEST and CALL CONFIRMGuy Harris1-17/+27
PDUs be dissected by the appropriate dissector for the connection. svn path=/trunk/; revision=7216
2003-02-16According to ITU/X.25 (refer to table G.2), only the bits 1 to 6Laurent Deniel1-3/+3
represent the number of semi-octets in the calling/called address extension facility. So bits 7 and 8 shall be masked. This fix avoids an incorrect detection of malformed packets. svn path=/trunk/; revision=7157
2003-01-31Get rid of BASE_BIN - it's just the same as BASE_DEC, but people seemedGuy Harris1-2/+2
to be using it for stuff that should be hex, and for stuff that should be Boolean. Use BASE_DEC if it should be decimal, BASE_HEX if it should be hex, and make it Boolean if it should be Boolean. svn path=/trunk/; revision=7053
2003-01-11Only do stuff to circuits on the first pass.Guy Harris1-13/+20
svn path=/trunk/; revision=6914
2003-01-08Display the packet type as a bitfield for Data, RR, RNR, and REJGuy Harris1-24/+46
packets. Fix some displays of the packet type to include the "Packet Type:" tag. Display the M bit with an indication of what it means. svn path=/trunk/; revision=6877
2003-01-06Show the M bit regardless of whether it's set or not.Guy Harris1-11/+9
Show sequence numbers in decimal, not hex. svn path=/trunk/; revision=6862
2003-01-06Add an X.29 dissector.Guy Harris1-32/+51
The Q bit in X.25 doesn't mean "this is QLLC traffic", it's just a "this packet is special" indication. Have the X.25 dissector pass as the "private_data" pointer a pointer to a gboolean indicating whether the Q bit was set or not. Replace the "decode non-Q-bit traffic as SNA" option with a "decode traffic as QLLC/SNA if we didn't see the Call Request packet and thus don't know what it is" option, which hands traffic to the QLLC dissector for that traffic. Have the QLLC dissector hand traffic to the SNA dissector if the Q bit isn't set. Arrange that we determine whether the Q bit is set regardless of whether we're building the protocol tree or not. If we don't just dissect traffic as QLLC/SNA if we didn't see the Call Request packet, check not only for 0x45 (as an indication that it's probably IP), check also for NLPID_ISO8473_CLNP and treat that as an indication that it's probably OSI CLNP. svn path=/trunk/; revision=6854
2002-11-08Allow more than one circuit with the same circuit ID; a circuit has aGuy Harris1-225/+47
starting and ending frame number, and circuits with the same circuit ID are sorted by the starting frame number (the last circuit can have 0 as the ending frame number, meaning "unknown"), and, when looking up a circuit, we take a frame number as an argument and return the circuit that includes that frame. Add a new circuit ID type for X.25 virtual circuits, and use the circuit mechanism to keep track of the dissector for an X.25 virtual circuit rather than having a private mechanism. svn path=/trunk/; revision=6580
2002-09-01Update my email.Olivier Abad1-2/+2
svn path=/trunk/; revision=6166
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-6/+6
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-5/+1
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-05-09Process address lengths according to the X.25 spec.Guy Harris1-38/+118
Put in a comment noting that the address data should, if the A bit is set, be processed according to the spec. Label addresses for registration requests and confirmations appropriately. svn path=/trunk/; revision=5429
2002-05-09From Martin Thomas: handle address lengths based on TOA bit in X.25.Guy Harris1-1/+8
svn path=/trunk/; revision=5423
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