diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-07-08 22:57:55 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-07-08 22:57:55 +0000 |
commit | ae1aadfe3aa9257f6e7cc4ebc9e28557c77c3430 (patch) | |
tree | 76b97c1ba30a95c259337666324c79aaba08830e /packet-tns.c | |
parent | a7f232ed674f28928266a44a4fc59eaf3e6fa282 (diff) |
Desegmentation of multi-TCP-segment TNS messages (and support for
multiple TNS messages per TCP segment), from Bernd Becker.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5844 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-tns.c')
-rw-r--r-- | packet-tns.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/packet-tns.c b/packet-tns.c index 717cab0e55..1b6558dcbb 100644 --- a/packet-tns.c +++ b/packet-tns.c @@ -1,7 +1,7 @@ /* packet-tns.c * Routines for Oracle TNS packet dissection * - * $Id: packet-tns.c,v 1.32 2002/06/06 13:17:49 nneul Exp $ + * $Id: packet-tns.c,v 1.33 2002/07/08 22:57:55 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -41,8 +41,14 @@ #include <string.h> #include <glib.h> #include <epan/packet.h> +#include "packet-tcp.h" #include "packet-tns.h" +#include "prefs.h" + +/* desegmentation of TNS over TCP */ +static gboolean tns_desegment = TRUE; + static int proto_tns = -1; static int hf_tns_request = -1; static int hf_tns_response = -1; @@ -197,6 +203,10 @@ static const value_string tns_control_cmds[] = { {0, NULL} }; +void proto_reg_handoff_tns(void); +static guint get_tns_pdu_len(tvbuff_t *tvb, int offset); +static void dissect_tns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); + static void dissect_tns_service_options(tvbuff_t *tvb, int offset, proto_tree *sopt_tree) { @@ -838,11 +848,25 @@ static void dissect_tns_control(tvbuff_t *tvb, int offset, packet_info *pinfo, return; } - +static guint +get_tns_pdu_len(tvbuff_t *tvb, int offset) +{ + /* + * Get the length of the TNS message, including header + */ + return tvb_get_ntohs(tvb, offset); +} static void dissect_tns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + tcp_dissect_pdus(tvb, pinfo, tree, tns_desegment, 2, + get_tns_pdu_len, dissect_tns_pdu); +} + +static void +dissect_tns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ proto_tree *tns_tree = NULL, *ti; int offset = 0; guint16 length; @@ -1276,10 +1300,18 @@ void proto_register_tns(void) &ett_tns_conn_flag, &ett_sql }; + module_t *tns_module; + proto_tns = proto_register_protocol( "Transparent Network Substrate Protocol", "TNS", "tns"); proto_register_field_array(proto_tns, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + tns_module = prefs_register_protocol(proto_tns, NULL); + prefs_register_bool_preference(tns_module, "desegment_tns_messages", + "Desegment all TNS messages spanning multiple TCP segments", + "Whether the TNS dissector should desegment all messages spanning multiple TCP segments", + &tns_desegment); } void |