diff options
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/cdt/cdt.cnf | 27 | ||||
-rw-r--r-- | asn1/cdt/packet-cdt-template.c | 12 |
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"); } |