3 * Routines for Compressed Data Type packet dissection.
5 * Copyright 2005, Stig Bjorlykke <stig@bjorlykke.org>, Thales Norway AS
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 * Ref: STANAG 4406 Annex E
32 #include <epan/packet.h>
33 #include <epan/oids.h>
34 #include <epan/expert.h>
35 #include <epan/asn1.h>
37 #include "packet-ber.h"
38 #include "packet-p1.h"
40 #include "packet-cdt.h"
42 #define CDT_UNDEFINED 0
43 #define CDT_EXTERNAL 1
48 #define PNAME "Compressed Data Type"
52 static proto_tree *top_tree = NULL;
53 static proto_item *cdt_item = NULL;
55 static guint32 content_type = 0;
57 /* Initialize the protocol and registered fields */
58 static int proto_cdt = -1;
59 #include "packet-cdt-hf.c"
61 static dissector_handle_t data_handle = NULL;
63 /* Initialize the subtree pointers */
64 #include "packet-cdt-ett.c"
66 #include "packet-cdt-fn.c"
69 /*--- proto_register_cdt -------------------------------------------*/
72 ** Dissect Compressed Data Type
74 void dissect_cdt (tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
76 proto_tree *tree = NULL;
78 /* save parent_tree so subdissectors can create new top nodes */
79 top_tree = parent_tree;
82 cdt_item = proto_tree_add_item (parent_tree, proto_cdt, tvb, 0, -1, ENC_NA);
83 tree = proto_item_add_subtree (cdt_item, ett_cdt_CompressedData);
86 col_set_str (pinfo->cinfo, COL_PROTOCOL, "CDT");
87 col_clear (pinfo->cinfo, COL_INFO);
89 dissect_CompressedData_PDU (tvb, pinfo, tree);
92 void proto_register_cdt (void) {
95 static hf_register_info hf[] = {
96 #include "packet-cdt-hfarr.c"
99 /* List of subtrees */
100 static gint *ett[] = {
101 #include "packet-cdt-ettarr.c"
104 /* Register protocol */
105 proto_cdt = proto_register_protocol (PNAME, PSNAME, PFNAME);
107 /* Register fields and subtrees */
108 proto_register_field_array (proto_cdt, hf, array_length(hf));
109 proto_register_subtree_array (ett, array_length(ett));
114 /*--- proto_reg_handoff_cdt ---------------------------------------*/
115 void proto_reg_handoff_cdt (void) {
116 #include "packet-cdt-dis-tab.c"
118 data_handle = find_dissector ("data");