aboutsummaryrefslogtreecommitdiffstats
path: root/packet-h245.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2003-07-07 10:22:59 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2003-07-07 10:22:59 +0000
commit882af4f8bd5dacb32d00a49ce53ad3f5cd27576a (patch)
tree3c2684179db2f8ea6ec398fe8114ef996a1e2a28 /packet-h245.c
parent065a6ff7cbd0433358c4a9179622044ad28e7719 (diff)
Attempt to decode GeneralString.
RFC2833 is a bit "unclear" but I guess this type is encoded as first a length-determinant followed by the actual ascii data. I belive the length-determinant is byte aligned in aligned-per so the entire field is so. at best, this is pure guesswork but it does decode the single capture i do have containing GeneralString types properly. Anyone interested are welcome to purchase and provide proper h323 standard docs from itu-t and snail-mail them to me. A random asn file from www.packetyzer.com together with the X.691 pdf file is "difficult". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7969 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-h245.c')
-rw-r--r--packet-h245.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/packet-h245.c b/packet-h245.c
index c3660e90e6..e2308e458d 100644
--- a/packet-h245.c
+++ b/packet-h245.c
@@ -92,7 +92,7 @@ proper helper routines
* Routines for H.245 packet dissection
* 2003 Ronnie Sahlberg
*
- * $Id: packet-h245.c,v 1.3 2003/07/06 11:11:41 sahlberg Exp $
+ * $Id: packet-h245.c,v 1.4 2003/07/07 10:22:59 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -131,6 +131,7 @@ static dissector_handle_t MultimediaSystemControlMessage_handle;
static int proto_h245 = -1;
static int hf_h245_pdu_type = -1;
+static int hf_h245_GeneralString_length = -1;
static int hf_h245_extension_bit = -1;
static int hf_h245_extension_present_bit = -1;
static int hf_h245_choice_extension = -1;
@@ -1704,11 +1705,29 @@ DEBUG_ENTRY("dissect_per_normally_small_nonnegative_whole_number");
/* this function reads a GeneralString */
+/* currently based on pure guesswork since RFC2833 didnt tell me much
+ i guess that the PER encoding for this is a normally-small-whole-number
+ followed by a ascii string.
+
+ based on pure guesswork. it looks ok in the only capture i have where
+ there is a 1 byte general string encoded
+*/
guint32
-dissect_per_GeneralString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index _U_)
+dissect_per_GeneralString(tvbuff_t *tvb, guint32 offset, packet_info *pinfo, proto_tree *tree, int hf_index)
{
-DEBUG_ENTRY("dissect_per_GeneralString");
-NOT_DECODED_YET("GeneralString");
+ proto_tree *etr=NULL;
+ guint32 length;
+
+ if(display_internal_per_fields){
+ etr=tree;
+ }
+
+ offset=dissect_per_length_determinant(tvb, offset, pinfo, etr, hf_h245_GeneralString_length, &length);
+
+ proto_tree_add_string(tree, hf_index, tvb, (offset>>3), length, tvb_get_ptr(tvb, (offset>>3), length));
+
+ offset+=length*8;
+
return offset;
}
@@ -22444,6 +22463,9 @@ proto_register_h245(void)
{ &hf_h245_object_identifier_length,
{ "Object Length", "h245.object_length", FT_UINT32, BASE_DEC,
NULL, 0, "Length of the object identifier", HFILL }},
+ { &hf_h245_GeneralString_length,
+ { "GeneralString Length", "h245.generalstring_length", FT_UINT32, BASE_DEC,
+ NULL, 0, "Length of the GeneralString", HFILL }},
{ &hf_h245_object,
{ "Object", "h245.object", FT_STRING, BASE_NONE,
NULL, 0, "Object Identifier", HFILL }},