diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-08-04 23:36:13 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-08-04 23:36:13 +0000 |
commit | f9ded39a635765af24d18359bab9972af3ff2a23 (patch) | |
tree | 670053bcf5f5130c37bc6190822abb116014c35b /packet-wsp.c | |
parent | 3d16d6a0c0b95916346a93aadfe17d4ab88bf69f (diff) |
From Lo�c Minier: if the field name for "x-wap.tod" is shown as a text
string, decode the value as a text string, as per 1.0, section 8.4.1.2
("Field Values"):
If the field name is encoded in text format, textual values MUST
be used.
svn path=/trunk/; revision=8130
Diffstat (limited to 'packet-wsp.c')
-rw-r--r-- | packet-wsp.c | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/packet-wsp.c b/packet-wsp.c index 7e215bb709..a3f3204773 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.73 2003/07/29 21:30:32 guy Exp $ + * $Id: packet-wsp.c,v 1.74 2003/08/04 23:36:12 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -2299,28 +2299,41 @@ add_application_header (proto_tree *tree, tvbuff_t *tvb, int offset) { valueType = get_value_type_len (tvb, offset, &subvalueLen, &subvalueOffset, &offset); - if (get_integer (tvb, subvalueOffset, subvalueLen, - valueType, &secs) == 0) + if (valueType == VALUE_IS_TEXT_STRING) { - /* - * Fill in the "struct timeval", and add it to the - * protocol tree. - * Note: this will succeed even if it's a Short-integer. - * A Short-integer would work, but, as the time values - * are UNIX seconds-since-the-Epoch value, and as - * there weren't WAP phones or Web servers back in - * late 1969/early 1970, they're unlikely to be used. - */ - timeValue.secs = secs; - timeValue.nsecs = 0; - proto_tree_add_time (tree, hf_wsp_header_x_wap_tod, - tvb, startOffset, offset - startOffset, &timeValue); + proto_tree_add_text (tree, tvb, startOffset, + offset - startOffset, "%s: %s", token, + tvb_get_ptr (tvb, subvalueOffset, subvalueLen)); } else { - proto_tree_add_text (tree, tvb, startOffset, - offset - startOffset, - "%s: invalid date value", token); + if (get_integer (tvb, subvalueOffset, subvalueLen, + valueType, &secs) == 0) + { + /* + * Fill in the "struct timeval", and add it + * to the protocol tree. + * Note: this will succeed even if it's a + * Short-integer rather than an Integer. + * A Short-integer would work, but, as the + * time values are UNIX seconds-since-the- + * Epoch value, and as there weren't WAP + * phones or Web servers back in late + * 1969/early 1970, they're unlikely to be + * used. + */ + timeValue.secs = secs; + timeValue.nsecs = 0; + proto_tree_add_time (tree, hf_wsp_header_x_wap_tod, + tvb, startOffset, offset - startOffset, + &timeValue); + } + else + { + proto_tree_add_text (tree, tvb, startOffset, + offset - startOffset, + "%s: invalid date value", token); + } } } else |