diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-04-04 05:37:36 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-04-04 05:37:36 +0000 |
commit | f540888bd4ae622605edff82ac7bdcab2d73902a (patch) | |
tree | 06ee1d68b057c33dedd1a3b78c446af56ffe763e /packet.h | |
parent | 05fe159e74f1bcaa3f2dc9e60846bd3022483279 (diff) |
Make a routine that takes a dissector table, a port number, and
pd/offset/fd/tree arguments, looks up the port number in the dissector
table, and:
if it finds it, call the corresponding dissector routine with
the pd/offset/fd/tree arguments, and return TRUE;
if it doesn't find it, return FALSE.
Use that in the TCP and UDP dissectors.
Don't add arbitrary UDP ports for which a dissector is found in the
table as ports that should be dissected as TFTP; this should only be
done if we find a packet going from port XXX to the official TFTP port.
Don't register TFTP in UDP's dissector table, as it has to be handled
specially (i.e., we have to add the source port as a TFTP port, although
we really should register the source port *and* IP address); eventually,
we should move that registration to the TFTP dissector itself, at which
point we can register TFTP normally.
svn path=/trunk/; revision=1785
Diffstat (limited to 'packet.h')
-rw-r--r-- | packet.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1,7 +1,7 @@ /* packet.h * Definitions for packet disassembly structures and routines * - * $Id: packet.h,v 1.177 2000/04/03 09:41:13 guy Exp $ + * $Id: packet.h,v 1.178 2000/04/04 05:37:34 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -228,6 +228,11 @@ void dissector_add( char *abbrev, guint32 pattern, dissector_t dissector); /* that wants to de-register a sub-dissector. */ void dissector_delete( char *abbrev, guint32 pattern, dissector_t dissector); +/* Look for a given port in a given dissector table and, if found, call + the dissector with the arguments supplied, and return TRUE, otherwise + return FALSE. */ +gboolean dissector_try_port(dissector_table_t sub_dissectors, guint32 port, + const u_char *pd, int offset, frame_data *fd, proto_tree *tree); /* Many of the structs and definitions below and in packet-*.c files * were taken from include files in the Linux distribution. */ |