3 * Routines for Compressed Data Type packet dissection.
5 * Copyright 2005, Stig Bjorlykke <stig@bjorlykke.org>, Thales Norway AS
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * SPDX-License-Identifier: GPL-2.0-or-later
13 * Ref: STANAG 4406 Annex E
18 #include <epan/packet.h>
19 #include <epan/oids.h>
20 #include <epan/expert.h>
21 #include <epan/asn1.h>
22 #include <wsutil/array.h>
23 #include "packet-ber.h"
24 #include "packet-p1.h"
26 #include "packet-cdt.h"
28 #define CDT_UNDEFINED 0
29 #define CDT_EXTERNAL 1
34 #define PNAME "Compressed Data Type"
38 void proto_register_cdt(void);
39 void proto_reg_handoff_cdt(void);
41 static proto_tree
*top_tree
;
42 static proto_item
*cdt_item
;
44 static uint32_t content_type
;
46 /* Initialize the protocol and registered fields */
48 #include "packet-cdt-hf.c"
50 /* Initialize the subtree pointers */
51 #include "packet-cdt-ett.c"
53 static expert_field ei_cdt_unable_compress_content
;
54 static expert_field ei_cdt_unable_uncompress_content
;
56 #include "packet-cdt-fn.c"
59 /*--- proto_register_cdt -------------------------------------------*/
62 ** Dissect Compressed Data Type
64 void dissect_cdt (tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*parent_tree
)
66 proto_tree
*tree
= NULL
;
68 /* save parent_tree so subdissectors can create new top nodes */
69 top_tree
= parent_tree
;
72 cdt_item
= proto_tree_add_item (parent_tree
, proto_cdt
, tvb
, 0, -1, ENC_NA
);
73 tree
= proto_item_add_subtree (cdt_item
, ett_cdt_CompressedData
);
78 col_set_str (pinfo
->cinfo
, COL_PROTOCOL
, "CDT");
79 col_clear (pinfo
->cinfo
, COL_INFO
);
81 dissect_CompressedData_PDU (tvb
, pinfo
, tree
, NULL
);
84 void proto_register_cdt (void) {
87 static hf_register_info hf
[] = {
88 #include "packet-cdt-hfarr.c"
91 /* List of subtrees */
93 #include "packet-cdt-ettarr.c"
96 static ei_register_info ei
[] = {
97 { &ei_cdt_unable_compress_content
, { "cdt.unable_compress_content", PI_UNDECODED
, PI_ERROR
, "Unable to get compressed content", EXPFILL
}},
98 { &ei_cdt_unable_uncompress_content
, { "cdt.unable_uncompress_content", PI_UNDECODED
, PI_ERROR
, "Unable to get uncompressed content", EXPFILL
}},
101 expert_module_t
* expert_cdt
;
103 /* Register protocol */
104 proto_cdt
= proto_register_protocol (PNAME
, PSNAME
, PFNAME
);
106 /* Register fields and subtrees */
107 proto_register_field_array (proto_cdt
, hf
, array_length(hf
));
108 proto_register_subtree_array (ett
, array_length(ett
));
109 expert_cdt
= expert_register_protocol(proto_cdt
);
110 expert_register_field_array(expert_cdt
, ei
, array_length(ei
));
114 /*--- proto_reg_handoff_cdt ---------------------------------------*/
115 void proto_reg_handoff_cdt (void) {
116 #include "packet-cdt-dis-tab.c"