Commit Graph

42 Commits

Author SHA1 Message Date
Guy Harris 6dcb948ca2 From Andreas Sikkema: put the H.225 stuff at the top level of the
protocol tree.

svn path=/trunk/; revision=5017
2002-03-25 20:23:17 +00:00
Guy Harris a7553a5586 There's just a single H.225 dissector, for both Call Signaling and
Registration, Admission, and Status, so just call it "h225", not
"h225_cs".

svn path=/trunk/; revision=4871
2002-03-05 03:10:52 +00:00
Guy Harris f4f3208a00 In the Q.931-over-TPKT-over-TCP dissector, if the TCP segment we're
handed looks as if it contains only a TPKT header (4 bytes long, and
those 4 bytes look like a TPKT header according to "is_tpkt()"), call
the "dissect TPKT over a TCP stream" routine.  If we're doing
reassembly, that routine will force a reassembly because the TPKT
payload isn't in that segment, and the various heuristic XXX-over-TPKT
dissectors will be called again, this time with enough data for them to
say whether the TPKT payload is for them or not; if we're not doing
reassembly, we'll dissect the TPKT header and then call the "dissect a
Q.931 PDU" routine, which will throw an exception because there isn't
any payload from which to fetch data (and that's what we want to
happen).

In the "dissect TPKT over a TCP stream" routine, if reassembly is
enabled, do the check to see if we need to do reassembly to get the
payload before dissecting the TPKT header, so that we don't dissect the
TPKT header and then decide "oops, we need some more data to get the
TPKT payload".

svn path=/trunk/; revision=4792
2002-02-23 21:07:48 +00:00
Guy Harris 7027650b5c "is_tpkt()" is always used to check a TCP segment to see if it might
have a TPKT header at the beginning, so there's not need for it to have
an offset as an argument; its callers don't have to know how big the
TPKT header is (or we can put a #define in "packet-tpkt.h" for it).  Get
rid of the second argument.

svn path=/trunk/; revision=4791
2002-02-23 02:30:16 +00:00
Guy Harris e9bc3da370 Handle TPKT packets split across segment boundaries, and multiple TPKT
packets per segment.

Instead of having a routine for dissectors such as the Q.931 dissector
to call to dissect the TPKT header, have a routine that does all the
reassembly and multiple-packets-per-segment work, and have the Q.931
dissector call it.  Export "is_tpkt()", and the new routine, to plugins.

Add preferences for TPKT and Q.931 reassembly.

svn path=/trunk/; revision=4778
2002-02-22 08:56:48 +00:00
Guy Harris 8bf31f9c18 Have a Q.931-over-TPKT TCP heuristic dissector.
Have the Q.931 PDU dissector, if it's Q.931-over-TPKT, check for
user-user IEs with a protocol discriminator of "X.208 and X.209 coded
user information" and, if it sees one, call an H.225.0 Call Setup
dissector if it could find the handle for it.

svn path=/trunk/; revision=4723
2002-02-12 10:21:05 +00:00
Guy Harris 02d0d90682 Clean up the heuristic code in the Q.931 dissector. If it's a heuristic
dissector, it's looking for Q.931 encapsulated inside TPKT, so it
shouldn't check whether the first byte is NLPID_Q_931 or not, as it
*won't* be NLPID_Q_931, it'll be 3, for the TPKT version.  It should
first check whether "is_tpkt()" thinks it's a TPKT packet, and then
check that the packet has at least 3 bytes past the TPKT header, then
check the first byte in the payload to see whether it's NLPID_Q_931.  If
that all succeeds, treat it as Q.931 inside TPKT.

Make "is_tpkt()" return the length from the TPKT header on success, and
-1 on failure, and return the offset past the TPKT header via a pointer
(so clients don't have to know that the TPKT header is 4 bytes long).

svn path=/trunk/; revision=4669
2002-02-02 02:51:20 +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 1d42c94b05 Make the resolution for time values be nanoseconds rather than
microseconds.

Fix some "signed vs. unsigned" comparison warnings.

svn path=/trunk/; revision=3934
2001-09-14 07:10:13 +00:00
Guy Harris 541af0c740 Use the "pinfo" argument, rather than the global "pi", to refer to the
packet information in tvbuffified dissectors.

svn path=/trunk/; revision=3645
2001-07-03 04:56:46 +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 9baeab5cab Call the Q.931 dissector through a handle.
Update Gerald's e-mail address.

svn path=/trunk/; revision=3462
2001-05-27 07:27:21 +00:00
Guy Harris 4f61e8c410 Q.931 protocol discriminators aren't, at least as I read Q.931, the same
as ISO/IEC TR 9577 protocol identifiers, even if they may, in some
cases, use the same value for the same protocol.

svn path=/trunk/; revision=3210
2001-03-30 07:57:38 +00:00
Guy Harris e8775b6c34 Handle, in the Q.931 heuristic dissector, the case where TPKT isn't
enabled.

Fix comments to explain that a return of -1 from "dissect_tpkt_header()"
means "TPKT wasn't enabled".

svn path=/trunk/; revision=3200
2001-03-28 08:06:07 +00:00
Guy Harris c00e9c43dc Support for TPKT being used for its original purpose (TCP port > 102,
containing OSI transport layer PDUs).

Enable the Q.931-inside-TPKT code (but not the H.225 stuff, as that
requires Andreas Sikkema's H.225 dissector).  Update it to match his
current modified Q.931 dissector.

svn path=/trunk/; revision=3199
2001-03-28 07:49:41 +00:00
Guy Harris 31cb40ce44 Fix a comment.
svn path=/trunk/; revision=3197
2001-03-27 08:00:00 +00:00
Guy Harris 9c2f1a5005 Fixes to some typos, from Thomas Gimpel.
svn path=/trunk/; revision=3118
2001-03-08 19:15:33 +00:00
Guy Harris 6e250ba730 "Off-hoke"? What had I been smoking when I typed that?
svn path=/trunk/; revision=3021
2001-02-11 23:19:00 +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
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 99c98f9e74 Move "bytes_to_str()" to "strutil.c" from "packet.c" - it's just a
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-11-13 07:19:37 +00:00
Guy Harris 964ef65673 Note that we might not want the dissector for Q.931-inside-TPKT to be
heuristic - we may just want to make port 1720 be Q.931-inside-TPKT.

svn path=/trunk/; revision=2512
2000-10-19 07:01:32 +00:00
Guy Harris 3f8b7cd0fc Andreas Sikkema's new H.261 and TPKT dissectors, replacement RTCP and
RTP dissectors, and changes to the Q.931 dissector for use with H.323.

svn path=/trunk/; revision=2511
2000-10-19 06:45:11 +00:00
Laurent Deniel cc36f0b931 Add the "Edit:Protocols..." feature which currently only implements
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-13 14:09:15 +00:00
Guy Harris 283ce59938 Add routines for adding items to a protocol tree that take arguments of
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-31 05:09:07 +00:00
Guy Harris 10ea13ed18 Add "tvb_reported_length()" to get the "reported length" of a tvbuff
(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-29 08:57:42 +00:00
Gilbert Ramirez 292e38e2c6 Add tvbuff class.
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-05-11 08:18:09 +00:00
Guy Harris 7368e42aac Add the NLPID value for PPP.
In Q.931 and Q.2931, the TR 9577 values are NLPIDs, so use "nlpid_vals"
to dissect them, and values from "nlpid.h" to refer to them.

svn path=/trunk/; revision=1461
2000-01-13 05:41:24 +00:00
Guy Harris 12610535b4 Patches from Bert Driehuis to:
1) fix the check for the IE identifier to check all bits,
	   including the topmost bit;

	2) print all fields in the Date IE as 2 digits.

svn path=/trunk/; revision=1335
1999-12-14 23:25:17 +00:00
Guy Harris e02dab4a85 Minor bug fix.
svn path=/trunk/; revision=1109
1999-11-25 22:49:01 +00:00
Guy Harris f90037ac8d Small bug fix.
svn path=/trunk/; revision=1105
1999-11-25 11:00:27 +00:00
Guy Harris d1c36982c6 Fixes to Q.931 dissector, and additions from a recent copy of Q.931.
Export some functions from the Q.931 dissector, so the Q.2931 dissector
can use them.

Add a pile of information element dissection to the Q.2931 dissector.

svn path=/trunk/; revision=1104
1999-11-25 10:01:18 +00:00
Guy Harris a8dfc56400 There are no protocols under Q.931, so mark everything up to the end of
the frame as being Q.931 stuff.

svn path=/trunk/; revision=1067
1999-11-19 09:46:51 +00:00
Guy Harris 26288653d7 Fix a typo.
svn path=/trunk/; revision=1066
1999-11-19 09:11:44 +00:00
Guy Harris a7aba0a288 Replace the ETT_ "enum" members, declared in "packet.h", with
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-16 11:44:20 +00:00
Guy Harris fa2e49f503 Dissect a whole pile of Q.931 information elements.
svn path=/trunk/; revision=1023
1999-11-13 10:13:24 +00:00
Guy Harris 172d11b138 A few cause codes more (cue Ennio Morricone).
svn path=/trunk/; revision=1021
1999-11-13 02:07:59 +00:00
Guy Harris 6b82439020 Add initial support for decoding information elements.
svn path=/trunk/; revision=1020
1999-11-13 01:32:31 +00:00
Guy Harris 8835700b89 Support all lengths of call reference value (1 to 15 octets).
svn path=/trunk/; revision=1009
1999-11-11 10:17:29 +00:00
Guy Harris 6c10717158 Add #defines for bits in the LAPD address field and for the LAPD SAPI
values.

Dissect the LAPD payload, if present.

Add the beginnings of a Q.931 dissector.

svn path=/trunk/; revision=1007
1999-11-11 08:35:11 +00:00