2013-04-11 18:14:53 +00:00
|
|
|
/* Do not modify this file. Changes will be overwritten. */
|
|
|
|
/* Generated automatically by the ASN.1 to Wireshark dissector compiler */
|
2007-11-01 19:36:39 +00:00
|
|
|
/* packet-cdt.c */
|
2011-10-15 19:27:27 +00:00
|
|
|
/* ../../tools/asn2wrs.py -b -p cdt -c ./cdt.cnf -s ./packet-cdt-template -D . -O ../../epan/dissectors cdt.asn */
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
/* Input file: packet-cdt-template.c */
|
|
|
|
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/cdt/packet-cdt-template.c"
|
2005-11-23 07:32:24 +00:00
|
|
|
/* packet-cdt.c
|
|
|
|
*
|
|
|
|
* Routines for Compressed Data Type packet dissection.
|
|
|
|
*
|
2009-03-15 21:13:27 +00:00
|
|
|
* Copyright 2005, Stig Bjorlykke <stig@bjorlykke.org>, Thales Norway AS
|
2005-11-23 07:32:24 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2005-11-23 07:32:24 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2005-11-23 07:32:24 +00:00
|
|
|
*
|
|
|
|
* Ref: STANAG 4406 Annex E
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <epan/packet.h>
|
2007-08-25 01:14:24 +00:00
|
|
|
#include <epan/oids.h>
|
2007-02-08 17:12:38 +00:00
|
|
|
#include <epan/expert.h>
|
2007-05-13 20:58:29 +00:00
|
|
|
#include <epan/asn1.h>
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
#include "packet-ber.h"
|
2011-02-20 17:03:29 +00:00
|
|
|
#include "packet-p1.h"
|
2005-11-23 07:32:24 +00:00
|
|
|
|
2006-07-09 11:18:13 +00:00
|
|
|
#include "packet-cdt.h"
|
|
|
|
|
2008-10-02 15:45:54 +00:00
|
|
|
#define CDT_UNDEFINED 0
|
|
|
|
#define CDT_EXTERNAL 1
|
|
|
|
#define CDT_P1 2
|
|
|
|
#define CDT_P3 3
|
|
|
|
#define CDT_P7 4
|
|
|
|
|
2005-11-23 07:32:24 +00:00
|
|
|
#define PNAME "Compressed Data Type"
|
|
|
|
#define PSNAME "CDT"
|
|
|
|
#define PFNAME "cdt"
|
|
|
|
|
2013-12-08 22:11:18 +00:00
|
|
|
void proto_register_cdt(void);
|
|
|
|
void proto_reg_handoff_cdt(void);
|
|
|
|
|
2005-11-23 07:32:24 +00:00
|
|
|
static proto_tree *top_tree = NULL;
|
|
|
|
static proto_item *cdt_item = NULL;
|
|
|
|
|
2008-10-02 15:45:54 +00:00
|
|
|
static guint32 content_type = 0;
|
|
|
|
|
2005-11-23 07:32:24 +00:00
|
|
|
/* Initialize the protocol and registered fields */
|
2009-10-11 16:24:29 +00:00
|
|
|
static int proto_cdt = -1;
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
/*--- Included file: packet-cdt-hf.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/cdt/packet-cdt-hf.c"
|
2005-11-23 07:32:24 +00:00
|
|
|
static int hf_cdt_CompressedData_PDU = -1; /* CompressedData */
|
|
|
|
static int hf_cdt_compressionAlgorithm = -1; /* CompressionAlgorithmIdentifier */
|
|
|
|
static int hf_cdt_compressedContentInfo = -1; /* CompressedContentInfo */
|
|
|
|
static int hf_cdt_algorithmID_ShortForm = -1; /* AlgorithmID_ShortForm */
|
|
|
|
static int hf_cdt_algorithmID_OID = -1; /* OBJECT_IDENTIFIER */
|
|
|
|
static int hf_cdt_contentType = -1; /* T_contentType */
|
|
|
|
static int hf_cdt_contentType_ShortForm = -1; /* ContentType_ShortForm */
|
2007-06-05 12:00:57 +00:00
|
|
|
static int hf_cdt_contentType_OID = -1; /* T_contentType_OID */
|
2005-11-23 07:32:24 +00:00
|
|
|
static int hf_cdt_compressedContent = -1; /* CompressedContent */
|
|
|
|
|
|
|
|
/*--- End of included file: packet-cdt-hf.c ---*/
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 61 "../../asn1/cdt/packet-cdt-template.c"
|
2008-10-02 15:45:54 +00:00
|
|
|
|
|
|
|
static dissector_handle_t data_handle = NULL;
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
|
|
|
|
/*--- Included file: packet-cdt-ett.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/cdt/packet-cdt-ett.c"
|
2005-11-23 07:32:24 +00:00
|
|
|
static gint ett_cdt_CompressedData = -1;
|
|
|
|
static gint ett_cdt_CompressionAlgorithmIdentifier = -1;
|
|
|
|
static gint ett_cdt_CompressedContentInfo = -1;
|
|
|
|
static gint ett_cdt_T_contentType = -1;
|
|
|
|
|
|
|
|
/*--- End of included file: packet-cdt-ett.c ---*/
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 66 "../../asn1/cdt/packet-cdt-template.c"
|
2005-11-23 07:32:24 +00:00
|
|
|
|
2013-06-03 03:42:36 +00:00
|
|
|
static expert_field ei_cdt_unable_compress_content = EI_INIT;
|
|
|
|
static expert_field ei_cdt_unable_uncompress_content = EI_INIT;
|
|
|
|
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
/*--- Included file: packet-cdt-fn.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/cdt/packet-cdt-fn.c"
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
static const value_string cdt_AlgorithmID_ShortForm_vals[] = {
|
|
|
|
{ 0, "zlibCompress" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_cdt_AlgorithmID_ShortForm(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 19 "../../asn1/cdt/cdt.cnf"
|
2005-11-23 07:32:24 +00:00
|
|
|
guint32 value;
|
|
|
|
|
2007-05-15 05:49:43 +00:00
|
|
|
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
|
2008-10-02 15:45:54 +00:00
|
|
|
&value);
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
proto_item_append_text (cdt_item, ", %s",
|
|
|
|
val_to_str (value, cdt_AlgorithmID_ShortForm_vals,
|
|
|
|
"unknown"));
|
|
|
|
|
2014-02-26 19:29:17 +00:00
|
|
|
col_append_fstr (actx->pinfo->cinfo, COL_INFO, "%s ",
|
|
|
|
val_to_str (value, cdt_AlgorithmID_ShortForm_vals,
|
2009-07-07 10:07:42 +00:00
|
|
|
"unknown"));
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
|
2005-12-08 23:29:21 +00:00
|
|
|
|
2005-11-23 07:32:24 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_cdt_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2007-06-05 12:00:57 +00:00
|
|
|
offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
|
2005-12-08 23:29:21 +00:00
|
|
|
|
2005-11-23 07:32:24 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const value_string cdt_CompressionAlgorithmIdentifier_vals[] = {
|
|
|
|
{ 0, "algorithmID-ShortForm" },
|
|
|
|
{ 1, "algorithmID-OID" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2007-08-15 23:42:29 +00:00
|
|
|
static const ber_choice_t CompressionAlgorithmIdentifier_choice[] = {
|
|
|
|
{ 0, &hf_cdt_algorithmID_ShortForm, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_cdt_AlgorithmID_ShortForm },
|
|
|
|
{ 1, &hf_cdt_algorithmID_OID , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_cdt_OBJECT_IDENTIFIER },
|
|
|
|
{ 0, NULL, 0, 0, 0, NULL }
|
2005-11-23 07:32:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_cdt_CompressionAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2007-08-15 23:42:29 +00:00
|
|
|
offset = dissect_ber_choice(actx, tree, tvb, offset,
|
|
|
|
CompressionAlgorithmIdentifier_choice, hf_index, ett_cdt_CompressionAlgorithmIdentifier,
|
|
|
|
NULL);
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const value_string cdt_ContentType_ShortForm_vals[] = {
|
|
|
|
{ 0, "unidentified" },
|
|
|
|
{ 1, "external" },
|
|
|
|
{ 2, "p1" },
|
|
|
|
{ 3, "p3" },
|
|
|
|
{ 4, "p7" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_cdt_ContentType_ShortForm(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 34 "../../asn1/cdt/cdt.cnf"
|
2005-11-23 07:32:24 +00:00
|
|
|
|
2007-05-15 05:49:43 +00:00
|
|
|
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
|
2008-10-02 15:45:54 +00:00
|
|
|
&content_type);
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
proto_item_append_text (cdt_item, ", %s",
|
2014-02-26 19:29:17 +00:00
|
|
|
val_to_str (content_type, cdt_ContentType_ShortForm_vals,
|
2005-11-23 07:32:24 +00:00
|
|
|
"unknown"));
|
|
|
|
|
2014-02-26 19:29:17 +00:00
|
|
|
col_append_fstr (actx->pinfo->cinfo, COL_INFO, "%s ",
|
|
|
|
val_to_str (content_type, cdt_ContentType_ShortForm_vals,
|
2009-07-07 10:07:42 +00:00
|
|
|
"unknown"));
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
|
2005-12-08 23:29:21 +00:00
|
|
|
|
2005-11-23 07:32:24 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_cdt_T_contentType_OID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 48 "../../asn1/cdt/cdt.cnf"
|
2007-06-05 12:00:57 +00:00
|
|
|
const char *obj_id = NULL;
|
|
|
|
|
|
|
|
offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &obj_id);
|
|
|
|
|
|
|
|
if (obj_id) {
|
2015-01-17 19:11:29 +00:00
|
|
|
const char *name = oid_resolved_from_string (wmem_packet_scope(), obj_id);
|
2007-06-05 12:00:57 +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);
|
2007-06-05 12:00:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-11-23 07:32:24 +00:00
|
|
|
static const value_string cdt_T_contentType_vals[] = {
|
|
|
|
{ 0, "contentType-ShortForm" },
|
|
|
|
{ 1, "contentType-OID" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2007-08-15 23:42:29 +00:00
|
|
|
static const ber_choice_t T_contentType_choice[] = {
|
|
|
|
{ 0, &hf_cdt_contentType_ShortForm, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_cdt_ContentType_ShortForm },
|
|
|
|
{ 1, &hf_cdt_contentType_OID , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_cdt_T_contentType_OID },
|
|
|
|
{ 0, NULL, 0, 0, 0, NULL }
|
2005-11-23 07:32:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_cdt_T_contentType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2007-08-15 23:42:29 +00:00
|
|
|
offset = dissect_ber_choice(actx, tree, tvb, offset,
|
|
|
|
T_contentType_choice, hf_index, ett_cdt_T_contentType,
|
|
|
|
NULL);
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_cdt_CompressedContent(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 67 "../../asn1/cdt/cdt.cnf"
|
2005-11-23 07:32:24 +00:00
|
|
|
tvbuff_t *next_tvb = NULL, *compr_tvb = NULL;
|
|
|
|
int save_offset = offset;
|
|
|
|
|
2007-05-15 05:49:43 +00:00
|
|
|
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
|
2005-11-23 07:32:24 +00:00
|
|
|
&compr_tvb);
|
|
|
|
|
|
|
|
if (compr_tvb == NULL) {
|
2013-07-03 02:59:31 +00:00
|
|
|
proto_tree_add_expert(top_tree, actx->pinfo, &ei_cdt_unable_compress_content,
|
|
|
|
tvb, save_offset, -1);
|
2014-02-26 19:29:17 +00:00
|
|
|
col_append_str (actx->pinfo->cinfo, COL_INFO,
|
2009-07-07 10:07:42 +00:00
|
|
|
"[Error: Unable to get compressed content]");
|
2005-11-23 07:32:24 +00:00
|
|
|
return offset;
|
|
|
|
}
|
2014-02-26 19:29:17 +00:00
|
|
|
|
2015-04-09 12:01:25 +00:00
|
|
|
next_tvb = tvb_child_uncompress (tvb, compr_tvb, 0, tvb_reported_length (compr_tvb));
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
if (next_tvb == NULL) {
|
2013-07-03 02:59:31 +00:00
|
|
|
proto_tree_add_expert(top_tree, actx->pinfo, &ei_cdt_unable_uncompress_content,
|
|
|
|
tvb, save_offset, -1);
|
2014-02-26 19:29:17 +00:00
|
|
|
col_append_str (actx->pinfo->cinfo, COL_INFO,
|
2009-07-07 10:07:42 +00:00
|
|
|
"[Error: Unable to uncompress content]");
|
2005-11-23 07:32:24 +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:32:24 +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;
|
|
|
|
}
|
2014-02-26 19:29:17 +00:00
|
|
|
|
2005-11-23 07:32:24 +00:00
|
|
|
|
2005-12-08 23:29:21 +00:00
|
|
|
|
2005-11-23 07:32:24 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-15 23:42:29 +00:00
|
|
|
static const ber_sequence_t CompressedContentInfo_sequence[] = {
|
|
|
|
{ &hf_cdt_contentType , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cdt_T_contentType },
|
|
|
|
{ &hf_cdt_compressedContent, BER_CLASS_CON, 0, 0, dissect_cdt_CompressedContent },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2005-11-23 07:32:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_cdt_CompressedContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2007-08-15 23:42:29 +00:00
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
|
|
|
CompressedContentInfo_sequence, hf_index, ett_cdt_CompressedContentInfo);
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-15 23:42:29 +00:00
|
|
|
static const ber_sequence_t CompressedData_sequence[] = {
|
|
|
|
{ &hf_cdt_compressionAlgorithm, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cdt_CompressionAlgorithmIdentifier },
|
|
|
|
{ &hf_cdt_compressedContentInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cdt_CompressedContentInfo },
|
|
|
|
{ NULL, 0, 0, 0, NULL }
|
2005-11-23 07:32:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_cdt_CompressedData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 11 "../../asn1/cdt/cdt.cnf"
|
2008-10-02 15:45:54 +00:00
|
|
|
content_type = 0;
|
|
|
|
|
|
|
|
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
|
2007-08-15 23:42:29 +00:00
|
|
|
CompressedData_sequence, hf_index, ett_cdt_CompressedData);
|
2005-11-23 07:32:24 +00:00
|
|
|
|
2008-10-02 15:45:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2005-11-23 07:32:24 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*--- PDUs ---*/
|
|
|
|
|
2014-10-06 13:31:47 +00:00
|
|
|
static int dissect_CompressedData_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
|
|
|
|
int offset = 0;
|
2007-05-13 20:58:29 +00:00
|
|
|
asn1_ctx_t asn1_ctx;
|
|
|
|
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
2014-10-06 13:31:47 +00:00
|
|
|
offset = dissect_cdt_CompressedData(FALSE, tvb, offset, &asn1_ctx, tree, hf_cdt_CompressedData_PDU);
|
|
|
|
return offset;
|
2005-11-23 07:32:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*--- End of included file: packet-cdt-fn.c ---*/
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 71 "../../asn1/cdt/packet-cdt-template.c"
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*--- proto_register_cdt -------------------------------------------*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Dissect Compressed Data Type
|
|
|
|
*/
|
|
|
|
void dissect_cdt (tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
|
|
|
|
{
|
|
|
|
proto_tree *tree = NULL;
|
|
|
|
|
|
|
|
/* save parent_tree so subdissectors can create new top nodes */
|
|
|
|
top_tree = parent_tree;
|
|
|
|
|
|
|
|
if (parent_tree) {
|
2011-07-19 18:48:31 +00:00
|
|
|
cdt_item = proto_tree_add_item (parent_tree, proto_cdt, tvb, 0, -1, ENC_NA);
|
2005-11-23 07:32:24 +00:00
|
|
|
tree = proto_item_add_subtree (cdt_item, ett_cdt_CompressedData);
|
2013-12-04 09:39:19 +00:00
|
|
|
} else {
|
|
|
|
cdt_item = NULL;
|
2005-11-23 07:32:24 +00:00
|
|
|
}
|
|
|
|
|
2009-07-07 10:07:42 +00:00
|
|
|
col_set_str (pinfo->cinfo, COL_PROTOCOL, "CDT");
|
|
|
|
col_clear (pinfo->cinfo, COL_INFO);
|
2005-11-23 07:32:24 +00:00
|
|
|
|
2014-10-06 13:31:47 +00:00
|
|
|
dissect_CompressedData_PDU (tvb, pinfo, tree, NULL);
|
2005-11-23 07:32:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void proto_register_cdt (void) {
|
|
|
|
|
|
|
|
/* List of fields */
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
|
|
|
|
/*--- Included file: packet-cdt-hfarr.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/cdt/packet-cdt-hfarr.c"
|
2005-11-23 07:32:24 +00:00
|
|
|
{ &hf_cdt_CompressedData_PDU,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "CompressedData", "cdt.CompressedData_element",
|
2005-11-23 07:32:24 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:13:26 +00:00
|
|
|
NULL, HFILL }},
|
2005-11-23 07:32:24 +00:00
|
|
|
{ &hf_cdt_compressionAlgorithm,
|
|
|
|
{ "compressionAlgorithm", "cdt.compressionAlgorithm",
|
|
|
|
FT_UINT32, BASE_DEC, VALS(cdt_CompressionAlgorithmIdentifier_vals), 0,
|
2010-05-11 02:13:26 +00:00
|
|
|
"CompressionAlgorithmIdentifier", HFILL }},
|
2005-11-23 07:32:24 +00:00
|
|
|
{ &hf_cdt_compressedContentInfo,
|
2013-05-27 20:26:49 +00:00
|
|
|
{ "compressedContentInfo", "cdt.compressedContentInfo_element",
|
2005-11-23 07:32:24 +00:00
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
2010-05-11 02:13:26 +00:00
|
|
|
NULL, HFILL }},
|
2005-11-23 07:32:24 +00:00
|
|
|
{ &hf_cdt_algorithmID_ShortForm,
|
|
|
|
{ "algorithmID-ShortForm", "cdt.algorithmID_ShortForm",
|
|
|
|
FT_INT32, BASE_DEC, VALS(cdt_AlgorithmID_ShortForm_vals), 0,
|
2010-05-11 02:13:26 +00:00
|
|
|
NULL, HFILL }},
|
2005-11-23 07:32:24 +00:00
|
|
|
{ &hf_cdt_algorithmID_OID,
|
|
|
|
{ "algorithmID-OID", "cdt.algorithmID_OID",
|
2005-12-08 23:29:21 +00:00
|
|
|
FT_OID, BASE_NONE, NULL, 0,
|
2010-05-11 02:13:26 +00:00
|
|
|
"OBJECT_IDENTIFIER", HFILL }},
|
2005-11-23 07:32:24 +00:00
|
|
|
{ &hf_cdt_contentType,
|
|
|
|
{ "contentType", "cdt.contentType",
|
|
|
|
FT_UINT32, BASE_DEC, VALS(cdt_T_contentType_vals), 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2005-11-23 07:32:24 +00:00
|
|
|
{ &hf_cdt_contentType_ShortForm,
|
|
|
|
{ "contentType-ShortForm", "cdt.contentType_ShortForm",
|
|
|
|
FT_INT32, BASE_DEC, VALS(cdt_ContentType_ShortForm_vals), 0,
|
2010-05-11 02:13:26 +00:00
|
|
|
NULL, HFILL }},
|
2005-11-23 07:32:24 +00:00
|
|
|
{ &hf_cdt_contentType_OID,
|
|
|
|
{ "contentType-OID", "cdt.contentType_OID",
|
2005-12-08 23:29:21 +00:00
|
|
|
FT_OID, BASE_NONE, NULL, 0,
|
2010-05-11 03:53:31 +00:00
|
|
|
NULL, HFILL }},
|
2005-11-23 07:32:24 +00:00
|
|
|
{ &hf_cdt_compressedContent,
|
|
|
|
{ "compressedContent", "cdt.compressedContent",
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
2010-05-11 02:13:26 +00:00
|
|
|
NULL, HFILL }},
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
/*--- End of included file: packet-cdt-hfarr.c ---*/
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 103 "../../asn1/cdt/packet-cdt-template.c"
|
2005-11-23 07:32:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* List of subtrees */
|
|
|
|
static gint *ett[] = {
|
|
|
|
|
|
|
|
/*--- Included file: packet-cdt-ettarr.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/cdt/packet-cdt-ettarr.c"
|
2005-11-23 07:32:24 +00:00
|
|
|
&ett_cdt_CompressedData,
|
|
|
|
&ett_cdt_CompressionAlgorithmIdentifier,
|
|
|
|
&ett_cdt_CompressedContentInfo,
|
|
|
|
&ett_cdt_T_contentType,
|
|
|
|
|
|
|
|
/*--- End of included file: packet-cdt-ettarr.c ---*/
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 108 "../../asn1/cdt/packet-cdt-template.c"
|
2013-06-03 03:42:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static ei_register_info ei[] = {
|
|
|
|
{ &ei_cdt_unable_compress_content, { "cdt.unable_compress_content", PI_UNDECODED, PI_ERROR, "Unable to get compressed content", EXPFILL }},
|
|
|
|
{ &ei_cdt_unable_uncompress_content, { "cdt.unable_uncompress_content", PI_UNDECODED, PI_ERROR, "Unable to get uncompressed content", EXPFILL }},
|
2005-11-23 07:32:24 +00:00
|
|
|
};
|
|
|
|
|
2013-06-03 03:42:36 +00:00
|
|
|
expert_module_t* expert_cdt;
|
|
|
|
|
2005-11-23 07:32:24 +00:00
|
|
|
/* Register protocol */
|
|
|
|
proto_cdt = proto_register_protocol (PNAME, PSNAME, PFNAME);
|
|
|
|
|
|
|
|
/* Register fields and subtrees */
|
|
|
|
proto_register_field_array (proto_cdt, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array (ett, array_length(ett));
|
2013-06-03 03:42:36 +00:00
|
|
|
expert_cdt = expert_register_protocol(proto_cdt);
|
|
|
|
expert_register_field_array(expert_cdt, ei, array_length(ei));
|
2005-11-23 07:32:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*--- proto_reg_handoff_cdt ---------------------------------------*/
|
|
|
|
void proto_reg_handoff_cdt (void) {
|
|
|
|
|
|
|
|
/*--- Included file: packet-cdt-dis-tab.c ---*/
|
2011-05-13 08:12:27 +00:00
|
|
|
#line 1 "../../asn1/cdt/packet-cdt-dis-tab.c"
|
2014-10-06 13:31:47 +00:00
|
|
|
new_register_ber_oid_dissector("1.3.26.0.4406.0.4.2", dissect_CompressedData_PDU, proto_cdt, "cdt");
|
2005-11-23 07:32:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*--- End of included file: packet-cdt-dis-tab.c ---*/
|
2014-02-18 03:02:21 +00:00
|
|
|
#line 131 "../../asn1/cdt/packet-cdt-template.c"
|
2008-10-02 15:45:54 +00:00
|
|
|
|
|
|
|
data_handle = find_dissector ("data");
|
2005-11-23 07:32:24 +00:00
|
|
|
}
|