aboutsummaryrefslogtreecommitdiffstats
path: root/packet-icp.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-icp.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-icp.c')
-rw-r--r--packet-icp.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/packet-icp.c b/packet-icp.c
index c283bb7cd5..2562f502d5 100644
--- a/packet-icp.c
+++ b/packet-icp.c
@@ -2,7 +2,7 @@
* Routines for ICP (internet cache protocol) packet disassembly
* RFC 2186 && RFC 2187
*
- * $Id: packet-icp.c,v 1.5 2000/03/12 04:47:38 gram Exp $
+ * $Id: packet-icp.c,v 1.6 2000/04/08 07:07:18 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Peter Torvals
@@ -51,6 +51,8 @@ static int hf_icp_request_nr=-1;
static gint ett_icp = -1;
static gint ett_icp_payload = -1;
+#define UDP_PORT_ICP 3130
+
#define CODE_ICP_OP_QUERY 1
#define CODE_ICP_OP_INVALID 0
#define CODE_ICP_OP_HIT 2
@@ -100,7 +102,8 @@ typedef struct _e_icphdr
} e_icphdr;
static gchar textbuf[MAX_TEXTBUF_LENGTH];
-void dissect_icp_payload( const u_char *pd, int offset,
+
+static void dissect_icp_payload( const u_char *pd, int offset,
frame_data *fd,proto_tree *pload_tree, e_icphdr *icph)
{
/* To Be Done take care of fragmentation*/
@@ -169,7 +172,8 @@ guint16 objectlength;
}
}
-void dissect_icp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
+static void dissect_icp(const u_char *pd, int offset, frame_data *fd,
+ proto_tree *tree)
{
proto_tree *icp_tree , *payload_tree;
proto_item *ti , *payloadtf;
@@ -286,3 +290,9 @@ proto_register_icp(void)
proto_register_field_array(proto_icp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
+
+void
+proto_reg_handoff_icp(void)
+{
+ dissector_add("udp.port", UDP_PORT_ICP, dissect_icp);
+}