aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/cdt
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2008-10-02 15:45:54 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2008-10-02 15:45:54 +0000
commit55cc2f5adc7f7fa9b2f235df125f969deb59fac2 (patch)
tree9a51f914af31af68fddc77c2403e6d28b58d0f5d /asn1/cdt
parent9be273b75b4618b6287172b602694150482b0de3 (diff)
Decode content according to given content type.
svn path=/trunk/; revision=26338
Diffstat (limited to 'asn1/cdt')
-rw-r--r--asn1/cdt/cdt.cnf27
-rw-r--r--asn1/cdt/packet-cdt-template.c12
2 files changed, 34 insertions, 5 deletions
diff --git a/asn1/cdt/cdt.cnf b/asn1/cdt/cdt.cnf
index 49afdb2ab9..194c292869 100644
--- a/asn1/cdt/cdt.cnf
+++ b/asn1/cdt/cdt.cnf
@@ -9,6 +9,11 @@ CompressedData
#.REGISTER
CompressedData B "1.3.26.0.4406.0.4.2" "cdt"
+#.FN_BODY CompressedData
+ content_type = 0;
+
+ %(DEFAULT_BODY)s
+
#.FN_PARS AlgorithmID-ShortForm
VAL_PTR = &value
@@ -26,19 +31,18 @@ CompressedData B "1.3.26.0.4406.0.4.2" "cdt"
"unknown"));
#.FN_PARS ContentType-ShortForm
- VAL_PTR = &value
+ VAL_PTR = &content_type
#.FN_BODY ContentType-ShortForm
- guint32 value;
%(DEFAULT_BODY)s
proto_item_append_text (cdt_item, ", %%s",
- val_to_str (value, cdt_ContentType_ShortForm_vals,
+ val_to_str (content_type, cdt_ContentType_ShortForm_vals,
"unknown"));
if (check_col (actx->pinfo->cinfo, COL_INFO))
col_append_fstr (actx->pinfo->cinfo, COL_INFO, "%%s ",
- val_to_str (value, cdt_ContentType_ShortForm_vals,
+ val_to_str (content_type, cdt_ContentType_ShortForm_vals,
"unknown"));
#.FN_PARS CompressedContentInfo/contentType/contentType-OID
@@ -97,6 +101,19 @@ CompressedData B "1.3.26.0.4406.0.4.2" "cdt"
tvb_set_child_real_data_tvbuff (tvb, next_tvb);
add_new_data_source (actx->pinfo, next_tvb, "Uncompressed Content");
- dissect_x411_mts_apdu (next_tvb, actx->pinfo, top_tree);
+ switch (content_type) {
+ case CDT_UNDEFINED:
+ call_dissector (data_handle, next_tvb, actx->pinfo, top_tree);
+ break;
+ case CDT_EXTERNAL:
+ dissect_unknown_ber (actx->pinfo, next_tvb, 0, top_tree);
+ break;
+ case CDT_P1:
+ dissect_x411_mts_apdu (next_tvb, actx->pinfo, top_tree);
+ break;
+ default:
+ call_dissector (data_handle, next_tvb, actx->pinfo, top_tree);
+ break;
+ }
#.END
diff --git a/asn1/cdt/packet-cdt-template.c b/asn1/cdt/packet-cdt-template.c
index 0edfeeccbd..7b08333715 100644
--- a/asn1/cdt/packet-cdt-template.c
+++ b/asn1/cdt/packet-cdt-template.c
@@ -41,6 +41,12 @@
#include "packet-cdt.h"
+#define CDT_UNDEFINED 0
+#define CDT_EXTERNAL 1
+#define CDT_P1 2
+#define CDT_P3 3
+#define CDT_P7 4
+
#define PNAME "Compressed Data Type"
#define PSNAME "CDT"
#define PFNAME "cdt"
@@ -48,10 +54,14 @@
static proto_tree *top_tree = NULL;
static proto_item *cdt_item = NULL;
+static guint32 content_type = 0;
+
/* Initialize the protocol and registered fields */
int proto_cdt = -1;
#include "packet-cdt-hf.c"
+static dissector_handle_t data_handle = NULL;
+
/* Initialize the subtree pointers */
#include "packet-cdt-ett.c"
@@ -108,4 +118,6 @@ void proto_register_cdt (void) {
/*--- proto_reg_handoff_cdt ---------------------------------------*/
void proto_reg_handoff_cdt (void) {
#include "packet-cdt-dis-tab.c"
+
+ data_handle = find_dissector ("data");
}