aboutsummaryrefslogtreecommitdiffstats
path: root/packet-nbns.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-nbns.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-nbns.c')
-rw-r--r--packet-nbns.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/packet-nbns.c b/packet-nbns.c
index c9ad53dc5f..d1afb8ab5e 100644
--- a/packet-nbns.c
+++ b/packet-nbns.c
@@ -4,7 +4,7 @@
* Gilbert Ramirez <gram@xiexie.org>
* Much stuff added by Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-nbns.c,v 1.38 2000/03/12 04:47:42 gram Exp $
+ * $Id: packet-nbns.c,v 1.39 2000/04/08 07:07:29 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -79,6 +79,10 @@ static int hf_nbss_flags = -1;
static gint ett_nbss = -1;
static gint ett_nbss_flags = -1;
+#define UDP_PORT_NBNS 137
+#define UDP_PORT_NBDGM 138
+#define TCP_PORT_NBSS 139
+
/* Packet structure taken from RFC 1002. See also RFC 1001.
* Opcode, flags, and rcode treated as "flags", similarly to DNS,
* to make it easier to lift the dissection code from "packet-dns.c". */
@@ -1110,7 +1114,7 @@ dissect_answer_records(const u_char *pd, int cur_off, int nbns_data_offset,
return cur_off - start_off;
}
-void
+static void
dissect_nbns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
{
int nbns_data_offset;
@@ -1238,7 +1242,7 @@ struct nbdgm_header {
guint8 error_code;
};
-void
+static void
dissect_nbdgm(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
{
proto_tree *nbdgm_tree = NULL;
@@ -1543,7 +1547,7 @@ dissect_nbss_packet(const u_char *pd, int offset, frame_data *fd, proto_tree *tr
return length + 4;
}
-void
+static void
dissect_nbss(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
{
guint8 msg_type;
@@ -1705,3 +1709,11 @@ proto_register_nbt(void)
proto_register_subtree_array(ett, array_length(ett));
}
+
+void
+proto_reg_handoff_nbt(void)
+{
+ dissector_add("udp.port", UDP_PORT_NBNS, dissect_nbns);
+ dissector_add("udp.port", UDP_PORT_NBDGM, dissect_nbdgm);
+ dissector_add("tcp.port", TCP_PORT_NBSS, dissect_nbss);
+}