aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-10-07 08:37:29 +0000
committerGuy Harris <guy@alum.mit.edu>2001-10-07 08:37:29 +0000
commit421f1b6a6c048d0f14c68f4e5c4727540367c6f5 (patch)
treeabaa135246241bd375b0352217ea0c4d391eae4e
parentcaacc419202a3508338974bddde273606dde43c5 (diff)
From Georg von Zezschwitz:
- A bug related to "WSP header pages" is fixed, that resulted into "malformed WSP frame" alerts - "Concatenated PDUs" (Multiple PDUs within one UDP packet) are now supported (used e.g. by Nokia 8310) - The URL of WSP GET/POST requests is display in the info column, same like HTTP GET requests svn path=/trunk/; revision=4004
-rw-r--r--AUTHORS6
-rw-r--r--doc/ethereal.pod.template1
-rw-r--r--packet-wsp.c75
-rw-r--r--packet-wtp.c58
4 files changed, 98 insertions, 42 deletions
diff --git a/AUTHORS b/AUTHORS
index b9a726c280..db12bb5687 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -813,6 +813,12 @@ Pasi Eronen <pasi.eronen[at]nixu.com> {
Patches to the dcerpc dissector for data representation decoding
}
+Georg von Zezschwitz <gvz[AT]2scale.net> {
+ WSP fixes
+ Support for concatenated PDUs
+ Put URL of WSP GET/POST in the Info column
+}
+
Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to
give his permission to use his version of snprintf.c.
diff --git a/doc/ethereal.pod.template b/doc/ethereal.pod.template
index 8b28c4f5f1..a33367ff56 100644
--- a/doc/ethereal.pod.template
+++ b/doc/ethereal.pod.template
@@ -1160,6 +1160,7 @@ B<http://www.ethereal.com>.
Endoh Akira <endoh[AT]netmarks.co.jp>
Graeme Hewson <graeme.hewson[AT]oracle.com>
Pasi Eronen <pasi.eronen[at]nixu.com>
+ Georg von Zezschwitz <gvz[AT]2scale.net>
Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to give his
permission to use his version of snprintf.c.
diff --git a/packet-wsp.c b/packet-wsp.c
index 9d255f00f9..833a82afef 100644
--- a/packet-wsp.c
+++ b/packet-wsp.c
@@ -2,7 +2,7 @@
*
* Routines to dissect WSP component of WAP traffic.
*
- * $Id: packet-wsp.c,v 1.38 2001/09/28 18:59:30 guy Exp $
+ * $Id: packet-wsp.c,v 1.39 2001/10/07 08:37:28 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -225,6 +225,7 @@ static const value_string vals_status[] = {
{ 0x33, "See Other" },
{ 0x34, "Not Modified" },
{ 0x35, "Use Proxy" },
+ { 0x37, "Temporary Redirect" },
{ 0x40, "Bad Request" },
{ 0x41, "Unauthorised" },
@@ -242,6 +243,8 @@ static const value_string vals_status[] = {
{ 0x4D, "Request Entity Too Large" },
{ 0x4E, "Request-URI Too Large" },
{ 0x4F, "Unsupported Media Type" },
+ { 0x50, "Requested Range Not Satisfiable" },
+ { 0x51, "Expectation Failed" },
{ 0x60, "Internal Server Error" },
{ 0x61, "Not Implemented" },
@@ -323,6 +326,10 @@ static const value_string vals_status[] = {
#define FN_SET_COOKIE 0x41
#define FN_COOKIE 0x42
#define FN_ENCODING_VERSION 0x43
+#define FN_PROFILE_WARNING14 0x44 /* encoding version 1.4 */
+#define FN_CONTENT_DISPOSITION14 0x45 /* encoding version 1.4 */
+#define FN_X_WAP_SECURITY 0x46
+#define FN_CACHE_CONTROL14 0x47 /* encoding version 1.4 */
static const value_string vals_field_names[] = {
{ FN_ACCEPT, "Accept" },
@@ -393,6 +400,10 @@ static const value_string vals_field_names[] = {
{ FN_SET_COOKIE, "Set-Cookie" },
{ FN_COOKIE, "Cookie" },
{ FN_ENCODING_VERSION, "Encoding-Version" },
+ { FN_PROFILE_WARNING, "Profile-Warning (encoding 1.4)" },
+ { FN_CONTENT_DISPOSITION14,"Content-Disposition (encoding 1.4)" },
+ { FN_X_WAP_SECURITY, "X-WAP-Security" },
+ { FN_CACHE_CONTROL14, "Cache-Control (encoding 1.4)" },
{ 0, NULL }
};
@@ -721,7 +732,7 @@ typedef enum {
static heur_dissector_list_t heur_subdissector_list;
-static void add_uri (proto_tree *, tvbuff_t *, guint, guint);
+static void add_uri (proto_tree *, frame_data *, tvbuff_t *, guint, guint);
static void add_headers (proto_tree *, tvbuff_t *);
static int add_well_known_header (proto_tree *, tvbuff_t *, int, guint8);
static int add_unknown_header (proto_tree *, tvbuff_t *, int, guint8);
@@ -987,12 +998,6 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
it, if possible, summarize what's in the packet, so that a user looking
at the list of packets can tell what type of packet it is. */
- /* Clear the Info column before we fetch anything from the packet */
- if (check_col(fdata, COL_INFO))
- {
- col_clear(fdata, COL_INFO);
- }
-
/* Connection-less mode has a TID first */
if (is_connectionless)
{
@@ -1005,7 +1010,7 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Develop the string to put in the Info column */
if (check_col(fdata, COL_INFO))
{
- col_add_fstr(fdata, COL_INFO, "WSP %s",
+ col_append_fstr(fdata, COL_INFO, "WSP %s",
val_to_str (pdut, vals_pdu_type, "Unknown PDU type (0x%02x)"));
};
@@ -1128,12 +1133,12 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
case GET:
- if (tree) {
- count = 0; /* Initialise count */
+ count = 0; /* Initialise count */
/* Length of URI and size of URILen field */
- value = tvb_get_guintvar (tvb, offset, &count);
- nextOffset = offset + count;
- add_uri (wsp_tree, tvb, offset, nextOffset);
+ value = tvb_get_guintvar (tvb, offset, &count);
+ nextOffset = offset + count;
+ add_uri (wsp_tree, fdata, tvb, offset, nextOffset);
+ if (tree) {
offset += (value+count); /* VERIFY */
tmp_tvb = tvb_new_subset (tvb, offset, -1, -1);
add_headers (wsp_tree, tmp_tvb);
@@ -1149,8 +1154,8 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
headersLength = tvb_get_guintvar (tvb, headerStart, &count);
offset = headerStart + count;
+ add_uri (wsp_tree, fdata, tvb, uriStart, offset);
if (tree) {
- add_uri (wsp_tree, tvb, uriStart, offset);
offset += uriLength;
ti = proto_tree_add_uint (wsp_tree, hf_wsp_header_length,tvb,headerStart,count,headersLength);
@@ -1280,6 +1285,8 @@ dissect_wsp_fromudp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "WSP" );
+ if (check_col(pinfo->fd, COL_INFO))
+ col_clear(pinfo->fd, COL_INFO);
dissect_wsp_common(tvb, pinfo, tree, dissect_wsp_fromudp, TRUE);
}
@@ -1309,35 +1316,35 @@ dissect_wsp_fromwap_cl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* XXX - what about WTLS->WSP?
*/
+ if (check_col(pinfo->fd, COL_INFO))
+ {
+ col_clear(pinfo->fd, COL_INFO);
+ }
dissect_wsp_common(tvb, pinfo, tree, dissect_wtp_fromudp, TRUE);
}
static void
-add_uri (proto_tree *tree, tvbuff_t *tvb, guint URILenOffset, guint URIOffset)
+add_uri (proto_tree *tree, frame_data *fdata, tvbuff_t *tvb, guint URILenOffset, guint URIOffset)
{
proto_item *ti;
- guint8 terminator = 0;
char *newBuffer;
guint count = 0;
guint uriLen = tvb_get_guintvar (tvb, URILenOffset, &count);
- ti = proto_tree_add_uint (tree, hf_wsp_header_uri_len,tvb,URILenOffset,count,uriLen);
-
- /* If string doesn't end with a 0x00, we need to add one to be on the safe side */
- terminator = tvb_get_guint8 (tvb, URIOffset+uriLen-1);
- if (terminator != 0)
- {
- newBuffer = g_malloc (uriLen+1);
- strncpy (newBuffer, tvb_get_ptr (tvb, URIOffset, uriLen), uriLen);
- newBuffer[uriLen] = 0;
- ti = proto_tree_add_string (tree, hf_wsp_header_uri,tvb,URIOffset,uriLen,newBuffer);
- g_free (newBuffer);
- }
- else
- {
- ti = proto_tree_add_item (tree, hf_wsp_header_uri,tvb,URIOffset,uriLen,bo_little_endian);
- }
+ if (tree)
+ ti = proto_tree_add_uint (tree, hf_wsp_header_uri_len,tvb,URILenOffset,count,uriLen);
+
+ newBuffer = g_malloc (uriLen+2);
+ newBuffer[0] = ' '; /* This is for COL_INFO */
+ strncpy (newBuffer+1, tvb_get_ptr (tvb, URIOffset, uriLen), uriLen);
+ newBuffer[uriLen+1] = 0;
+ if (tree)
+ ti = proto_tree_add_string (tree, hf_wsp_header_uri,tvb,URIOffset,uriLen,newBuffer+1);
+ if (check_col(fdata, COL_INFO)) {
+ col_append_str(fdata, COL_INFO, newBuffer);
+ };
+ g_free (newBuffer);
}
static void
@@ -2584,7 +2591,7 @@ add_capabilities (proto_tree *tree, tvbuff_t *tvb, int type)
case 0x06 : /* Header Code Pages */
offsetStr = offset;
offset++;
- add_capability_vals(tvb, TRUE,
+ add_capability_vals(tvb, (type == CONNECT),
offsetStr, length, capabilitiesStart,
valString, sizeof valString);
proto_tree_add_string(wsp_capabilities, hf_wsp_capabilities_header_code_pages, tvb, capabilitiesStart, length+1, valString);
diff --git a/packet-wtp.c b/packet-wtp.c
index 9640dd76d8..73391d3f63 100644
--- a/packet-wtp.c
+++ b/packet-wtp.c
@@ -2,7 +2,7 @@
*
* Routines to dissect WTP component of WAP traffic.
*
- * $Id: packet-wtp.c,v 1.19 2001/09/11 14:36:31 guy Exp $
+ * $Id: packet-wtp.c,v 1.20 2001/10/07 08:37:28 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -148,6 +148,7 @@ static int proto_wtp = HF_EMPTY;
/* These fields used by fixed part of header */
static int hf_wtp_header_fixed_part = HF_EMPTY;
+static int hf_wtp_header_sub_pdu_size = HF_EMPTY;
static int hf_wtp_header_flag_continue = HF_EMPTY;
static int hf_wtp_header_pdu_type = HF_EMPTY;
static int hf_wtp_header_flag_Trailer = HF_EMPTY;
@@ -210,7 +211,7 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Set up structures we will need to add the protocol subtree and manage it */
proto_item *ti;
- proto_tree *wtp_tree;
+ proto_tree *wtp_tree = NULL;
proto_tree *wtp_header_fixed;
char pdut;
@@ -224,11 +225,38 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
fprintf( stderr, "dissect_wtp: (Entering) Frame data at %p\n", fdata );
fprintf( stderr, "dissect_wtp: tvb length is %d\n", tvb_reported_length( tvb ) );
#endif
- if (check_col(fdata, COL_INFO)) {
- col_clear(fdata, COL_INFO);
- };
-
b0 = tvb_get_guint8 (tvb, offCur + 0);
+ /* Discover Concatenated PDUs */
+ if (b0 == 0) {
+ if (tree) {
+ wtp_tree = proto_tree_add_item(tree, proto_wtp, tvb, offCur, 1, bo_little_endian);
+ }
+ offCur = 1;
+ i = 1;
+ while (offCur < (int) tvb_reported_length (tvb)) {
+ b0 = tvb_get_guint8 (tvb, offCur + 0);
+ if (b0 & 0x80) {
+ vHeader = 2;
+ cbHeader = ((b0 & 0x7f) << 8) |
+ tvb_get_guint8 (tvb, offCur + 1);
+ } else {
+ vHeader = 1;
+ cbHeader = b0;
+ }
+ if (tree) {
+ proto_tree_add_item(wtp_tree, hf_wtp_header_sub_pdu_size, tvb, offCur, vHeader, bo_big_endian);
+ }
+ if (i > 1 && check_col(fdata, COL_INFO)) {
+ col_append_str (fdata, COL_INFO, ", ");
+ }
+ wsp_tvb = tvb_new_subset(tvb,
+ offCur + vHeader, -1, cbHeader);
+ dissect_wtp_common (wsp_tvb, pinfo, wtp_tree);
+ offCur += vHeader + cbHeader;
+ i++;
+ }
+ return;
+ }
fCon = b0 & 0x80;
fRID = retransmission_indicator( b0 );
pdut = pdu_type( b0 );
@@ -288,11 +316,12 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* This field shows up as the "Info" column in the display; you should make
it, if possible, summarize what's in the packet, so that a user looking
at the list of packets can tell what type of packet it is. */
- if (check_col(fdata, COL_INFO)) {
+ if (check_col(fdata, COL_INFO) &&
+ tvb_reported_length (tvb) <= cbHeader + vHeader) {
#ifdef DEBUG
fprintf( stderr, "dissect_wtp: (6) About to set info_col header to %s\n", szInfo );
#endif
- col_add_str(fdata, COL_INFO, szInfo );
+ col_append_str(fdata, COL_INFO, szInfo );
};
/* In the interest of speed, if "tree" is NULL, don't do any work not
necessary to generate protocol tree items. */
@@ -457,6 +486,9 @@ dissect_wtp_fromudp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "WTP+WSP" );
+ if (check_col(pinfo->fd, COL_INFO)) {
+ col_clear(pinfo->fd, COL_INFO);
+ }
dissect_wtp_common(tvb, pinfo, tree);
}
@@ -475,6 +507,9 @@ dissect_wtp_fromwap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "WTLS+WTP+WSP" );
+ if (check_col(pinfo->fd, COL_INFO)) {
+ col_clear(pinfo->fd, COL_INFO);
+ }
dissect_wtp_common(tvb, pinfo, tree);
}
@@ -521,6 +556,13 @@ proto_register_wtp(void)
"Fixed part of the header", HFILL
}
},
+ { &hf_wtp_header_sub_pdu_size,
+ { "Sub PDU size",
+ "wtp.sub_pdu_size",
+ FT_BYTES, BASE_HEX, NULL, 0x0,
+ "Size of Sub-PDU", HFILL
+ }
+ },
{ &hf_wtp_header_flag_continue,
{ "Continue Flag",
"wtp.continue_flag",