diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-04-08 07:07:42 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-04-08 07:07:42 +0000 |
commit | 42107e86146c473a06a11769ef2f5a8bedc1ef88 (patch) | |
tree | 8c2187183a707d04b8678a4cbfddb5577187c015 /packet-ftp.c | |
parent | 160928a318385aa2fb59af968ab1cd85847ad963 (diff) |
Move calls to "dissector_add()" out of the register routines for TCP and
UDP and into the handoff registration routines for the protocols in
question.
Make the dissectors for those protocols static if they're not called
outside the dissector's source file.
Get rid of header files if all they did was declare dissectors that are
now static; remove declarations of now-static dissectors from header
files that do more than just declare the dissector.
svn path=/trunk/; revision=1823
Diffstat (limited to 'packet-ftp.c')
-rw-r--r-- | packet-ftp.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/packet-ftp.c b/packet-ftp.c index 62a97d50d4..9e8497c62d 100644 --- a/packet-ftp.c +++ b/packet-ftp.c @@ -2,7 +2,7 @@ * Routines for ftp packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-ftp.c,v 1.12 2000/03/12 04:47:37 gram Exp $ + * $Id: packet-ftp.c,v 1.13 2000/04/08 07:07:16 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -54,7 +54,10 @@ static int hf_ftp_response_data = -1; static gint ett_ftp = -1; -void +#define TCP_PORT_FTPDATA 20 +#define TCP_PORT_FTP 21 + +static void dissect_ftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { proto_tree *ftp_tree, *ti; @@ -137,7 +140,7 @@ dissect_ftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } } -void +static void dissect_ftpdata(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { proto_tree *ti; @@ -195,3 +198,11 @@ proto_register_ftp(void) proto_register_field_array(proto_ftp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } + +void +proto_reg_handoff_ftp(void) +{ + dissector_add("tcp.port", TCP_PORT_FTPDATA, &dissect_ftpdata); + dissector_add("tcp.port", TCP_PORT_FTP, &dissect_ftp); +} + |