aboutsummaryrefslogtreecommitdiffstats
path: root/packet-tns.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-04-08 07:07:42 +0000
committerGuy Harris <guy@alum.mit.edu>2000-04-08 07:07:42 +0000
commit42107e86146c473a06a11769ef2f5a8bedc1ef88 (patch)
tree8c2187183a707d04b8678a4cbfddb5577187c015 /packet-tns.c
parent160928a318385aa2fb59af968ab1cd85847ad963 (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-tns.c')
-rw-r--r--packet-tns.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/packet-tns.c b/packet-tns.c
index 2b537c1e20..f03deb4b6b 100644
--- a/packet-tns.c
+++ b/packet-tns.c
@@ -1,7 +1,7 @@
/* packet-tns.c
* Routines for MSX tns packet dissection
*
- * $Id: packet-tns.c,v 1.4 2000/01/07 22:05:41 guy Exp $
+ * $Id: packet-tns.c,v 1.5 2000/04/08 07:07:40 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -63,12 +63,14 @@ static gint ett_tns_sns = -1;
static gint ett_tns_connect = -1;
static gint ett_sql = -1;
+#define TCP_PORT_TNS 1521
+
static const value_string tns_type_vals[] = {
{TNS_TYPE_CONNECT, "Connect" },
{TNS_TYPE_ACCEPT, "Accept" },
{TNS_TYPE_DATA, "Data" },
{TNS_TYPE_RESEND, "Resend"},
- {0, NULL}
+ {0, NULL}
};
@@ -76,7 +78,7 @@ static const value_string tns_type_vals[] = {
#define TRUNC(length) if ( ! BYTES_ARE_IN_FRAME(offset, length)) { \
dissect_data(pd,offset,fd,tree); return; }
-void dissect_tns_sns(const u_char *pd, int offset, frame_data *fd,
+static void dissect_tns_sns(const u_char *pd, int offset, frame_data *fd,
proto_tree *tree, proto_tree *tns_tree)
{
proto_tree *sns_tree = NULL, *ti;
@@ -100,7 +102,7 @@ void dissect_tns_sns(const u_char *pd, int offset, frame_data *fd,
}
}
-void dissect_tns_data(const u_char *pd, int offset, frame_data *fd,
+static void dissect_tns_data(const u_char *pd, int offset, frame_data *fd,
proto_tree *tree, proto_tree *tns_tree)
{
@@ -126,7 +128,7 @@ void dissect_tns_data(const u_char *pd, int offset, frame_data *fd,
return;
}
-void dissect_tns_connect(const u_char *pd, int offset, frame_data *fd,
+static void dissect_tns_connect(const u_char *pd, int offset, frame_data *fd,
proto_tree *tree, proto_tree *tns_tree)
{
proto_tree *connect_tree = NULL, *ti;
@@ -176,7 +178,7 @@ void dissect_tns_connect(const u_char *pd, int offset, frame_data *fd,
return;
}
-void dissect_tns_accept(const u_char *pd, int offset, frame_data *fd,
+static void dissect_tns_accept(const u_char *pd, int offset, frame_data *fd,
proto_tree *tree, proto_tree *tns_tree)
{
dissect_data(pd,offset,fd,tns_tree);
@@ -184,7 +186,7 @@ void dissect_tns_accept(const u_char *pd, int offset, frame_data *fd,
}
-void
+static void
dissect_tns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
{
proto_tree *tns_tree = NULL, *ti;
@@ -192,7 +194,7 @@ dissect_tns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
guint16 type;
if (check_col(fd, COL_PROTOCOL))
- col_add_str(fd, COL_PROTOCOL, "TNS");
+ col_add_str(fd, COL_PROTOCOL, "TNS");
if (check_col(fd, COL_INFO))
{
@@ -343,3 +345,9 @@ void proto_register_tns(void)
proto_register_field_array(proto_tns, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
+
+void
+proto_reg_handoff_tns(void)
+{
+ dissector_add("tcp.port", TCP_PORT_TNS, dissect_tns);
+}