Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / asn1 / cdt / cdt.cnf
blobe288bbdc59c6fe7e00ca19a324f9316063fa14ab
1 # cdt.cnf
2 # Compressed Data Type conformation file
4 #.EXPORTS
5 CompressedData
7 #.REGISTER
8 CompressedData    B "1.3.26.0.4406.0.4.2"  "cdt"
10 #.FN_BODY CompressedData
11   content_type = 0;
13   %(DEFAULT_BODY)s
15 #.FN_PARS AlgorithmID-ShortForm
16   VAL_PTR = &value
18 #.FN_BODY AlgorithmID-ShortForm
19   uint32_t value;
21   %(DEFAULT_BODY)s
22   proto_item_append_text (cdt_item, ", %%s",
23                           val_to_str (value, cdt_AlgorithmID_ShortForm_vals,
24                                       "unknown"));
26   col_append_fstr (actx->pinfo->cinfo, COL_INFO, "%%s ",
27                    val_to_str (value, cdt_AlgorithmID_ShortForm_vals,
28                                "unknown"));
30 #.FN_PARS ContentType-ShortForm
31   VAL_PTR = &content_type
33 #.FN_BODY ContentType-ShortForm
35   %(DEFAULT_BODY)s
36   proto_item_append_text (cdt_item, ", %%s",
37                           val_to_str (content_type, cdt_ContentType_ShortForm_vals,
38                                       "unknown"));
40   col_append_fstr (actx->pinfo->cinfo, COL_INFO, "%%s ",
41                    val_to_str (content_type, cdt_ContentType_ShortForm_vals,
42                                "unknown"));
44 #.FN_PARS CompressedContentInfo/contentType/contentType-OID
45   FN_VARIANT = _str  VAL_PTR = &obj_id
47 #.FN_BODY CompressedContentInfo/contentType/contentType-OID
48   const char *obj_id = NULL;
50   %(DEFAULT_BODY)s
51   if (obj_id) {
52     const char *name = oid_resolved_from_string (actx->pinfo->pool, obj_id);
54     if (!name) {
55       name = obj_id;
56     }
58     proto_item_append_text (cdt_item, ", %%s", name);
60     col_append_fstr (actx->pinfo->cinfo, COL_INFO, "%%s ", name);
61   }
63 #.FN_PARS CompressedContent
64   VAL_PTR = &compr_tvb
66 #.FN_BODY CompressedContent
67   tvbuff_t   *next_tvb = NULL, *compr_tvb = NULL;
68   int         save_offset = offset;
70   %(DEFAULT_BODY)s
71   if (compr_tvb == NULL) {
72     proto_tree_add_expert(top_tree, actx->pinfo, &ei_cdt_unable_compress_content,
73                                                         tvb, save_offset, -1);
74     col_append_str (actx->pinfo->cinfo, COL_INFO,
75                     "[Error: Unable to get compressed content]");
76     return offset;
77   }
79   next_tvb = tvb_child_uncompress_zlib(tvb, compr_tvb, 0, tvb_reported_length (compr_tvb));
81   if (next_tvb == NULL) {
82     proto_tree_add_expert(top_tree, actx->pinfo, &ei_cdt_unable_uncompress_content,
83                                                         tvb, save_offset, -1);
84     col_append_str (actx->pinfo->cinfo, COL_INFO,
85                     "[Error: Unable to uncompress content]");
86     return offset;
87   }
89   add_new_data_source (actx->pinfo, next_tvb, "Uncompressed Content");
91    switch (content_type) {
92    case CDT_UNDEFINED:
93      call_data_dissector(next_tvb, actx->pinfo, top_tree);
94      break;
95    case CDT_EXTERNAL:
96      dissect_unknown_ber (actx->pinfo, next_tvb, 0, top_tree);
97      break;
98    case CDT_P1:
99      dissect_p1_mts_apdu (next_tvb, actx->pinfo, top_tree, NULL);
100      break;
101    default:
102      call_data_dissector(next_tvb, actx->pinfo, top_tree);
103      break;
104    }
106 #.END