Commit Graph

13 Commits

Author SHA1 Message Date
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 56b989e0ad Allow either old-style (pre-tvbuff) or new-style (tvbuffified)
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-08-07 03:21:25 +00:00
Laurent Deniel a60203b3c6 Add some preferences in OSI CLNP/COTP/CLTP module to allow the user to:
- specify the NSAP selector for OSI transport decoding (default is still 0x21
  which is valid for DECNet-OSI at least).
- force the OSI C{L,O}TP decoding whatever the NSAP is (option disabled by default).

svn path=/trunk/; revision=2217
2000-08-06 15:54:42 +00:00
Guy Harris 4c3db57f20 Treat only ASCII characters as printable in TSAPs; otherwise, as 0xff
and 0xfe, for example, are printable characters in many locales (they're
printable in ISO 8859/x, for example), a TSAP of 0xfffffffefffffffe will
be treated as printable if your locale is one of those, even though the
chances that the TSAP is should be read as a string of y-with-diaresis
and lower-case thorn are pretty slim.

svn path=/trunk/; revision=2131
2000-07-10 06:52:29 +00:00
Guy Harris c3587ce540 Add support for OSI CLTP.
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-07-01 08:55:28 +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
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 6bbfd97bde Add routines to:
register lists of "heuristic" dissectors, which are handed a
	frame that may or may contain a payload for the protocol they
	dissect, and that return FALSE if it's not or dissect the packet
	and return TRUE if it is;

	add a dissector to such a list;

	go through such a list, calling each dissector until either a
	dissector returns TRUE, in which case the routine returns TRUE,
	or it runs out of entries in the list, in which case the routine
	returns FALSE.

Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.

Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".

Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).

svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
Guy Harris cdc06969c7 Changes from Gerrit Gehnen to
1) fix some problems with the SINEC H1 dissector;

	2) make it easier to plug in other dissectors atop OSI transport
	   protocols (by making the H1 dissector return an indication of
	   whether it recognizes the packet as an H1 packet or not, so
	   that, if it doesn't, additional dissectors can be tried).

svn path=/trunk/; revision=1895
2000-04-28 19:35:41 +00:00
Laurent Deniel 61908ba2c2 Fix the checksum option decoding in the CC/CR TPDU variable part.
svn path=/trunk/; revision=1879
2000-04-18 18:01:50 +00:00
Guy Harris 27ca639e86 Register an "osinl" dissector table for ISO/IEC TR 9577 NLPID values,
and have dissectors for protocols that run at the OSI network layer
register themselves with it using "dissector_add()".

Make various dissectors static if they can be, and remove from header
files declarations of those dissectors.

svn path=/trunk/; revision=1873
2000-04-17 01:36:31 +00:00
Laurent Deniel a5719d1448 Remove TODO comments about NSAP and ISIS decodings since
this is implemented now.

svn path=/trunk/; revision=1868
2000-04-16 09:10:53 +00:00
Guy Harris c9d4dd080d Ralf Schneider's changes to enhance to OSI CLNP, CLTP, and ISIS support
and to add OSI ESIS support.

svn path=/trunk/; revision=1865
2000-04-15 22:11:26 +00:00