aboutsummaryrefslogtreecommitdiffstats
path: root/packet-msproxy.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-11-27 07:13:32 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-11-27 07:13:32 +0000
commitf8783ef2faf90cd0a2d4c98608afc70ebd2b58ca (patch)
tree21d265bf7402a2739905bd87227383ae0a9f78ab /packet-msproxy.c
parent5f90e47799c83f2e69f021af2622bebadaa37176 (diff)
Change "conversation_set_dissector()" to take a dissector handle, rather
than a pointer to a dissector function, as an argument. This means that the conversation dissector is called through "call_dissector()", so the dissector itself doesn't have to worry about checking whether the protocol is enabled or setting "pinfo->current_proto", so get rid of the code that does that in conversation dissectors. Also, make the conversation dissectors static. Get rid of some direct calls to dissectors; replace them with calls through handles, and, again, get rid of code to check whether a protocol is enabled and set "pinfo->current_proto" where that code isn't needed. Make those dissectors static if they aren't already static. Add a routine "create_dissector_handle()" to create a dissector handle without registering it by name, if the dissector isn't used outside the module in which it's defined. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4281 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-msproxy.c')
-rw-r--r--packet-msproxy.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/packet-msproxy.c b/packet-msproxy.c
index 65b80c0bdc..fa265f6844 100644
--- a/packet-msproxy.c
+++ b/packet-msproxy.c
@@ -2,7 +2,7 @@
* Routines for Microsoft Proxy packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-msproxy.c,v 1.22 2001/09/03 10:33:05 guy Exp $
+ * $Id: packet-msproxy.c,v 1.23 2001/11/27 07:13:25 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -100,6 +100,8 @@ static int hf_msproxy_server_int_port = -1;
static int hf_msproxy_server_ext_addr = -1;
static int hf_msproxy_server_ext_port = -1;
+static dissector_handle_t msproxy_sub_handle;
+
#define UDP_PORT_MSPROXY 1745
@@ -207,7 +209,7 @@ static void msproxy_sub_dissector( tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree) {
/* Conversation dissector called from TCP or UDP dissector. Decode and */
-/* display the socks header, the pass the rest of the data to the tcp */
+/* display the msproxy header, the pass the rest of the data to the tcp */
/* or udp port decode routine to handle the payload. */
guint32 *ptr;
@@ -301,7 +303,7 @@ static void add_msproxy_conversation( packet_info *pinfo,
hash_info->proto, hash_info->server_int_port,
hash_info->clnt_port, 0);
}
- conversation_set_dissector(conversation, msproxy_sub_dissector);
+ conversation_set_dissector(conversation, msproxy_sub_handle);
new_conv_info = g_mem_chunk_alloc(redirect_vals);
@@ -1288,6 +1290,9 @@ proto_register_msproxy( void){
proto_register_subtree_array(ett, array_length(ett));
register_init_routine( &msproxy_reinit); /* register re-init routine */
+
+ msproxy_sub_handle = create_dissector_handle(msproxy_sub_dissector,
+ proto_msproxy);
}
@@ -1295,7 +1300,7 @@ void
proto_reg_handoff_msproxy(void) {
/* dissector install routine */
-
+
dissector_add("udp.port", UDP_PORT_MSPROXY, dissect_msproxy,
proto_msproxy);
}