2005-11-23 07:24:18 +00:00
|
|
|
# cdt.cnf
|
|
|
|
# Compressed Data Type conformation file
|
|
|
|
|
|
|
|
# $Id$
|
|
|
|
|
|
|
|
#.EXPORTS
|
|
|
|
CompressedData
|
|
|
|
|
|
|
|
#.REGISTER
|
|
|
|
CompressedData B "1.3.26.0.4406.0.4.2" "cdt"
|
|
|
|
|
2008-10-02 15:45:54 +00:00
|
|
|
#.FN_BODY CompressedData
|
|
|
|
content_type = 0;
|
|
|
|
|
|
|
|
%(DEFAULT_BODY)s
|
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
#.FN_PARS AlgorithmID-ShortForm
|
2005-11-23 07:24:18 +00:00
|
|
|
VAL_PTR = &value
|
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
#.FN_BODY AlgorithmID-ShortForm
|
2005-11-23 07:24:18 +00:00
|
|
|
guint32 value;
|
|
|
|
|
|
|
|
%(DEFAULT_BODY)s
|
|
|
|
proto_item_append_text (cdt_item, ", %%s",
|
|
|
|
val_to_str (value, cdt_AlgorithmID_ShortForm_vals,
|
|
|
|
"unknown"));
|
|
|
|
|
2009-07-07 10:07:42 +00:00
|
|
|
col_append_fstr (actx->pinfo->cinfo, COL_INFO, "%%s ",
|
|
|
|
val_to_str (value, cdt_AlgorithmID_ShortForm_vals,
|
|
|
|
"unknown"));
|
2005-11-23 07:24:18 +00:00
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
#.FN_PARS ContentType-ShortForm
|
2008-10-02 15:45:54 +00:00
|
|
|
VAL_PTR = &content_type
|
2005-11-23 07:24:18 +00:00
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
#.FN_BODY ContentType-ShortForm
|
2005-11-23 07:24:18 +00:00
|
|
|
|
|
|
|
%(DEFAULT_BODY)s
|
|
|
|
proto_item_append_text (cdt_item, ", %%s",
|
2008-10-02 15:45:54 +00:00
|
|
|
val_to_str (content_type, cdt_ContentType_ShortForm_vals,
|
2005-11-23 07:24:18 +00:00
|
|
|
"unknown"));
|
|
|
|
|
2009-07-07 10:07:42 +00:00
|
|
|
col_append_fstr (actx->pinfo->cinfo, COL_INFO, "%%s ",
|
|
|
|
val_to_str (content_type, cdt_ContentType_ShortForm_vals,
|
|
|
|
"unknown"));
|
2005-11-23 07:24:18 +00:00
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
#.FN_PARS CompressedContentInfo/contentType/contentType-OID
|
2005-11-23 07:24:18 +00:00
|
|
|
FN_VARIANT = _str VAL_PTR = &obj_id
|
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
#.FN_BODY CompressedContentInfo/contentType/contentType-OID
|
2005-11-23 07:24:18 +00:00
|
|
|
const char *obj_id = NULL;
|
|
|
|
|
|
|
|
%(DEFAULT_BODY)s
|
|
|
|
if (obj_id) {
|
2007-11-01 19:36:39 +00:00
|
|
|
const char *name = oid_resolved_from_string (obj_id);
|
2005-11-23 07:24:18 +00:00
|
|
|
|
|
|
|
if (!name) {
|
|
|
|
name = obj_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
proto_item_append_text (cdt_item, ", %%s", name);
|
|
|
|
|
2009-07-07 10:07:42 +00:00
|
|
|
col_append_fstr (actx->pinfo->cinfo, COL_INFO, "%%s ", name);
|
2005-11-23 07:24:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#.FN_PARS CompressedContent
|
|
|
|
VAL_PTR = &compr_tvb
|
|
|
|
|
|
|
|
#.FN_BODY CompressedContent
|
|
|
|
tvbuff_t *next_tvb = NULL, *compr_tvb = NULL;
|
2007-02-08 17:12:38 +00:00
|
|
|
proto_item *tf = NULL;
|
2005-11-23 07:24:18 +00:00
|
|
|
int save_offset = offset;
|
|
|
|
|
|
|
|
%(DEFAULT_BODY)s
|
|
|
|
if (compr_tvb == NULL) {
|
2007-02-08 17:12:38 +00:00
|
|
|
tf = proto_tree_add_text (top_tree, tvb, save_offset, -1,
|
|
|
|
"[Error: Unable to get compressed content]");
|
2013-06-03 03:42:36 +00:00
|
|
|
expert_add_info(actx->pinfo, tf, &ei_cdt_unable_compress_content);
|
2009-07-07 10:07:42 +00:00
|
|
|
col_append_str (actx->pinfo->cinfo, COL_INFO,
|
|
|
|
"[Error: Unable to get compressed content]");
|
2005-11-23 07:24:18 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2009-05-14 09:29:22 +00:00
|
|
|
next_tvb = tvb_child_uncompress (tvb, compr_tvb, 0, tvb_length (compr_tvb));
|
2005-11-23 07:24:18 +00:00
|
|
|
|
|
|
|
if (next_tvb == NULL) {
|
2007-02-08 17:12:38 +00:00
|
|
|
tf = proto_tree_add_text (top_tree, tvb, save_offset, -1,
|
|
|
|
"[Error: Unable to uncompress content]");
|
2013-06-03 03:42:36 +00:00
|
|
|
expert_add_info(actx->pinfo, tf, &ei_cdt_unable_uncompress_content);
|
2009-07-07 10:07:42 +00:00
|
|
|
col_append_str (actx->pinfo->cinfo, COL_INFO,
|
|
|
|
"[Error: Unable to uncompress content]");
|
2005-11-23 07:24:18 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2007-05-13 20:58:29 +00:00
|
|
|
add_new_data_source (actx->pinfo, next_tvb, "Uncompressed Content");
|
2005-11-23 07:24:18 +00:00
|
|
|
|
2008-10-02 15:45:54 +00:00
|
|
|
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:
|
2011-02-20 17:03:29 +00:00
|
|
|
dissect_p1_mts_apdu (next_tvb, actx->pinfo, top_tree);
|
2008-10-02 15:45:54 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
call_dissector (data_handle, next_tvb, actx->pinfo, top_tree);
|
|
|
|
break;
|
|
|
|
}
|
2005-11-23 07:24:18 +00:00
|
|
|
|
|
|
|
#.END
|