aboutsummaryrefslogtreecommitdiffstats
path: root/packet-tns.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-07-08 22:57:55 +0000
committerGuy Harris <guy@alum.mit.edu>2002-07-08 22:57:55 +0000
commitc3fc75e610411cec24a2f74089e93849537abb7a (patch)
tree76b97c1ba30a95c259337666324c79aaba08830e /packet-tns.c
parent225914a34380fe363cf1caf8a65eb26dd0072797 (diff)
Desegmentation of multi-TCP-segment TNS messages (and support for
multiple TNS messages per TCP segment), from Bernd Becker. svn path=/trunk/; revision=5844
Diffstat (limited to 'packet-tns.c')
-rw-r--r--packet-tns.c36
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