Commit Graph

85 Commits

Author SHA1 Message Date
Olivier Abad 7144508132 Put the "X.264 protocol identifier" and "X.264 sharing strategy" fields
in the "User data" subtree.

svn path=/trunk/; revision=8642
2003-10-07 18:19:59 +00:00
Guy Harris d359286841 Add a pointer to an hf_ value for a "reassembled_in" field (which can be
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-04-20 11:36:16 +00:00
Guy Harris 72a00f19ca Distinguish between the two directions of X.25 traffic when doing
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-05 05:20:38 +00:00
Guy Harris bc0799079d When reassembling, test the correct M bit based on whether it's mod-8 or
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-05 01:12:11 +00:00
Guy Harris a0ff4bd8fa From Laurent Meyer: reassemble fragmented X.25 packets, and fix up a
test.

svn path=/trunk/; revision=7276
2003-03-04 19:50:23 +00:00
Guy Harris cec47aeb6b X.29 call user data in CALL REQUEST packets starts with an SPI and 3
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-01 10:02:35 +00:00
Guy Harris 1f7f3e4178 If *all* you have in the user data portion of a Call Request packet is
an NLPID, don't dissect the user data as a packet for that protocol.

svn path=/trunk/; revision=7234
2003-03-01 08:50:46 +00:00
Guy Harris 608e53fb5e From Laurent Meyer: let the user data in CALL REQUEST and CALL CONFIRM
PDUs be dissected by the appropriate dissector for the connection.

svn path=/trunk/; revision=7216
2003-02-28 00:48:06 +00:00
Laurent Deniel 33b251a58f According to ITU/X.25 (refer to table G.2), only the bits 1 to 6
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-02-16 20:55:10 +00:00
Guy Harris ab552d3746 Get rid of BASE_BIN - it's just the same as BASE_DEC, but people seemed
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-31 03:17:56 +00:00
Guy Harris d6f3718f07 Only do stuff to circuits on the first pass.
svn path=/trunk/; revision=6914
2003-01-11 10:03:12 +00:00
Guy Harris 3c06116a05 Display the packet type as a bitfield for Data, RR, RNR, and REJ
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-08 08:43:09 +00:00
Guy Harris 3347d672c8 Show the M bit regardless of whether it's set or not.
Show sequence numbers in decimal, not hex.

svn path=/trunk/; revision=6862
2003-01-06 23:34:33 +00:00
Guy Harris 0551b7030f Add an X.29 dissector.
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
2003-01-06 02:24:57 +00:00
Guy Harris 8181a83657 Allow more than one circuit with the same circuit ID; a circuit has a
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-11-08 01:00:07 +00:00
Olivier Abad ca3fcebd1c Update my email.
svn path=/trunk/; revision=6166
2002-09-01 14:30:34 +00:00
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Jörg Mayer 173fe5aef4 Replace the types from sys/types.h and netinet/in.h by their glib.h
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-08-02 23:36:07 +00:00
Guy Harris a0c1d24f5f Process address lengths according to the X.25 spec.
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-09 11:18:47 +00:00
Guy Harris cbad622d0e From Martin Thomas: handle address lengths based on TOA bit in X.25.
svn path=/trunk/; revision=5423
2002-05-09 05:49:28 +00:00
Guy Harris bf7e4ce909 Move the definition of the FROM_DCE bit in the "flags" field of a
"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-04-09 08:15:04 +00:00
Guy Harris eb2d6593dc Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls in
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-24 09:20:54 +00:00
Guy Harris ee5ca25d31 Include files from the "epan" directory and subdirectories thereof with
"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
2002-01-21 07:37:49 +00:00
Guy Harris 23319ff023 Move the pointer to the "column_info" structure in the "frame_data"
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-10 00:26:21 +00:00
Guy Harris 75cc056222 Attach a descriptive name field type and base to dissector tables; that
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-08 06:41:48 +00:00
Guy Harris 15816babc1 Add a heuristic dissector for protocols running atop X.25.
svn path=/trunk/; revision=4336
2001-12-05 08:43:26 +00:00
Guy Harris 21b9a88b29 Add a routine tro look for a given port in a given dissector table and,
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-03 05:07:18 +00:00
Guy Harris bced8711f6 Make "dissector_add()", "dissector_delete()", and "dissector_change()"
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-03 04:00:26 +00:00
Guy Harris 2a21356d42 Add a new header file for X.264 transport protocol IDs.
Handle ISO 8602 as a protocol ID on top of X.25.

svn path=/trunk/; revision=4302
2001-12-02 00:38:54 +00:00
Guy Harris 8eba148155 An NLPID of 1 means T.70 when used as an X.263/ISO 9577 initial protocol
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-12-02 00:07:46 +00:00
Ed Warnicke a810a01338 Switched from calling dissect_data to using call_dissector
svn path=/trunk/; revision=4263
2001-11-25 22:19:25 +00:00
Gilbert Ramirez e1bf78d708 Add support for SNA-over-X.25. Add QLLC dissector. I still need to
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-11-15 21:11:01 +00:00
Olivier Abad fc603eaf9a - get_x25_pkt_len() :
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-18 15:49:29 +00:00
Guy Harris 1d7f9049c6 Fix a typo.
svn path=/trunk/; revision=3733
2001-07-16 20:57:42 +00:00
Olivier Abad a97279a8cb Dissect more diagnostic codes.
svn path=/trunk/; revision=3719
2001-07-14 09:30:01 +00:00
Olivier Abad 7ad33a9836 fixed some warning: comparison between signed and unsigned
svn path=/trunk/; revision=3657
2001-07-05 22:10:09 +00:00
Guy Harris 8412393197 From Joerg Mayer: explicitly fill in all members of a
"header_field_info" structure, including the ones that are later set by
the routines to register fields.

svn path=/trunk/; revision=3561
2001-06-18 02:18:27 +00:00
Guy Harris d57831fd29 Mention RFC 1356 in the comment about handling NLPIDs other than the
0xCC one for IP.

svn path=/trunk/; revision=3268
2001-04-07 08:33:12 +00:00
Guy Harris a8cbb073d4 NLPID's of 0x08 and 0x09 should be labeled as Q.933 and LMI,
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-03-30 10:51:50 +00:00
Guy Harris 32a7b693f9 If you register more than one field with the same name, the dfilter code
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-02-12 09:06:19 +00:00
Guy Harris 43ccfd8054 Add an additional "protocol index" argument to "{old_}dissector_add()",
"{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-09 06:32:10 +00:00
Guy Harris bde0b86caf X.25-over-LLC support, from Paul Ionescu.
svn path=/trunk/; revision=2829
2001-01-05 19:07:38 +00:00
Olivier Abad 19a997a7ad - replace x25 with x.25 in all protocol fields
- 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-03 23:30:50 +00:00
Guy Harris 0e7c1de08a Have "proto_register_protocol()" build a list of data structures for
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
2001-01-03 06:56:03 +00:00
Richard Sharpe b226f348ad Modify X.25 dissector to accept a search string of x.25 and ex.25, not x25 and ex25.
svn path=/trunk/; revision=2797
2000-12-29 01:27:35 +00:00
Olivier Abad ce54dc3d54 The length of FT_BOOLEAN bitfields must be specified in bits, not bytes.
svn path=/trunk/; revision=2702
2000-11-27 06:23:42 +00:00
Guy Harris 252d55d80f For each column, have both a buffer into which strings for that column
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-19 08:54:37 +00:00
Guy Harris 6ed0c8ac68 Register the OSI transport dissector by name, and make it static.
"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-19 04:14:26 +00:00
Guy Harris c8196a1d1c Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
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-18 10:38:33 +00:00
Guy Harris ee1b884ee9 Tvbuffify the STP dissector, have it register itself and have the LLC
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-16 07:35:43 +00:00