3 * Routines for Compressed Data Type packet dissection.
5 * Copyright 2005, Stig Bj>rlykke <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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 * Ref: STANAG 4406 Annex E
34 #include <epan/packet.h>
36 #include "packet-ber.h"
37 #include "packet-x411.h"
39 #define PNAME "Compressed Data Type"
43 static proto_tree *top_tree = NULL;
44 static proto_item *cdt_item = NULL;
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 #include "packet-cdt-fn.c"
56 /*--- proto_register_cdt -------------------------------------------*/
59 ** Dissect Compressed Data Type
61 void dissect_cdt (tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
63 proto_tree *tree = NULL;
65 /* save parent_tree so subdissectors can create new top nodes */
66 top_tree = parent_tree;
69 cdt_item = proto_tree_add_item (parent_tree, proto_cdt, tvb, 0, -1, FALSE);
70 tree = proto_item_add_subtree (cdt_item, ett_cdt_CompressedData);
73 if (check_col (pinfo->cinfo, COL_PROTOCOL))
74 col_set_str (pinfo->cinfo, COL_PROTOCOL, "CDT");
75 if (check_col (pinfo->cinfo, COL_INFO))
76 col_clear (pinfo->cinfo, COL_INFO);
78 dissect_CompressedData_PDU (tvb, pinfo, tree);
81 void proto_register_cdt (void) {
84 static hf_register_info hf[] = {
85 #include "packet-cdt-hfarr.c"
88 /* List of subtrees */
89 static gint *ett[] = {
90 #include "packet-cdt-ettarr.c"
93 /* Register protocol */
94 proto_cdt = proto_register_protocol (PNAME, PSNAME, PFNAME);
96 /* Register fields and subtrees */
97 proto_register_field_array (proto_cdt, hf, array_length(hf));
98 proto_register_subtree_array (ett, array_length(ett));
103 /*--- proto_reg_handoff_cdt ---------------------------------------*/
104 void proto_reg_handoff_cdt (void) {
105 #include "packet-cdt-dis-tab.c"