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=2268
This commit is contained in:
Laurent Deniel 2000-08-13 14:20:32 +00:00
parent cc36f0b931
commit 5a5e16ced7
2 changed files with 13 additions and 3 deletions

View File

@ -1,4 +1,4 @@
$Id: README.developer,v 1.14 2000/08/11 13:46:34 deniel Exp $
$Id: README.developer,v 1.15 2000/08/13 14:20:31 deniel Exp $
This file is a HOWTO for Ethereal developers. It describes how to start coding
a protocol dissector and the use some of the important functions and variables
@ -57,7 +57,7 @@ code inside
is needed only if you are using the "snprintf()" function.
The "$Id: README.developer,v 1.14 2000/08/11 13:46:34 deniel Exp $" in the comment will be updated by CVS when the file is
The "$Id: README.developer,v 1.15 2000/08/13 14:20:31 deniel Exp $" in the comment will be updated by CVS when the file is
checked in; it will allow the RCS "ident" command to report which
version of the file is currently checked out.
@ -66,7 +66,7 @@ version of the file is currently checked out.
* Routines for PROTONAME dissection
* Copyright 2000, YOUR_NAME <YOUR_EMAIL_ADDRESS>
*
* $Id: README.developer,v 1.14 2000/08/11 13:46:34 deniel Exp $
* $Id: README.developer,v 1.15 2000/08/13 14:20:31 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@ -129,6 +129,10 @@ dissect_PROTOABBREV(cont u_char *pd, int offset, frame_data *fd, proto_tree *tre
/* Set up structures we will need to add the protocol subtree and manage it */
proto_item *ti;
proto_tree *PROTOABBREV_tree;
/* Check if protocol decoding is enabled else decode as data and return */
OLD_CHECK_DISPLAY_AS_DATA(proto_PROTOABBREV, pd, offset, fd, tree);
/* Make entries in Protocol column and Info column on summary display */
if (check_col(fd, COL_PROTOCOL))
@ -1243,3 +1247,4 @@ James Coe <jammer@cin.net>
Gilbert Ramirez <gram@xiexie.org>
Jeff Foster <jfoste@woodward.com>
Olivier Abad <oabad@cybercable.fr>
Laurent Deniel <deniel@worldnet.fr>

View File

@ -253,6 +253,11 @@ Edits the saved list of filters, allowing filters to be added, changed,
or deleted, and lets a selected filter be applied to the current
capture, if any.
=item Edit:Protocols
Edits the list of protocols, allowing protocol dissection to be
enabled or disabled.
=item Capture:Start
Initiates a live packet capture (see L<"Capture Preferences"> below). A