aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ucp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-12-03 08:47:31 +0000
committerGuy Harris <guy@alum.mit.edu>2001-12-03 08:47:31 +0000
commitc22d3fdc96ececf2318f7f04b790866b8add4407 (patch)
tree5bfef0321ca6a449ecb44ec7e0d6d4221522a3c1 /packet-ucp.c
parent21b9a88b2942558536c9b0f5191261a874b8034a (diff)
Get rid of the lists of conversation dissectors; instead, have a
dissector table contain both a hash table, to use to look up port numbers to find a dissector, and a list of all dissectors that *could* be assigned to ports in that hash table, to be used by user interface code. Make the "Decode As" dialog box code use that. Also make it *not* let you choose whether to set the dissector for both the UDP and TCP versions of a port; some protocols run only atop TCP, some run only atop UDP, and even those that can run atop both may have different dissector handles to use over TCP and UDP, so handling a single merged list would be a mess. (If the user is setting the dissector for a TCP port, only those protocols that Ethereal can handle over TCP should be listed; if the user is setting the dissector for a UDP port, only those protocols that Ethereal can handle over TCP should be listed; if the user is setting a dissector for both, only those protocols that Ethereal can handle over *both* TCP *and* UDP should be listed, *and* there needs to be a way to let the "Decode As" code get both the TCP handle *and* the UDP handle and use the right ones. If somebody really wants that, they need to implement all of the above if they want the code to be correct.) Fix the code that handles setting the dissection for the IP protocol number to correctly update the lists of protocols being dissected as TCP and as UDP; the code before this change wasn't updating the single such list to add new protocols. svn path=/trunk/; revision=4311
Diffstat (limited to 'packet-ucp.c')
-rw-r--r--packet-ucp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/packet-ucp.c b/packet-ucp.c
index 17018cd37a..e4ab13cb0d 100644
--- a/packet-ucp.c
+++ b/packet-ucp.c
@@ -2,7 +2,7 @@
* Routines for Universal Computer Protocol dissection
* Copyright 2001, Tom Uijldert <tom.uijldert@cmg.nl>
*
- * $Id: packet-ucp.c,v 1.6 2001/12/03 03:59:40 guy Exp $
+ * $Id: packet-ucp.c,v 1.7 2001/12/03 08:47:28 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -2510,9 +2510,10 @@ proto_reg_handoff_ucp(void)
* one whenever TCP is spoken.
*/
heur_dissector_add("tcp", dissect_ucp_heur, proto_ucp);
+
/*
- * Also register as one that can be assigned to a TCP conversation.
+ * Also register as one that can be selected by a TCP port number.
*/
ucp_handle = create_dissector_handle(dissect_ucp, proto_ucp);
- conv_dissector_add("tcp", ucp_handle);
+ dissector_add_handle("tcp.port", ucp_handle);
}