Document option to hide the capture info dialog
[obnox/wireshark/wip.git] / asn1 / s4406 / packet-s4406-template.c
1 /* packet-s4406.c
2  * Routines for STANAG 4406 (X.400 Military Message Extensions)  packet dissection
3  * Graeme Lunt 2005
4  *
5  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 #ifdef HAVE_CONFIG_H
27 # include "config.h"
28 #endif
29
30 #include <glib.h>
31 #include <epan/packet.h>
32 #include <epan/conversation.h>
33
34 #include <stdio.h>
35 #include <string.h>
36
37 #include "packet-ber.h"
38
39 #include "packet-x509if.h"
40
41 #include "packet-s4406.h"
42 #include "packet-x411.h" 
43 #include "packet-x420.h" 
44
45 #define PNAME  "STANAG 4406 Military Message"
46 #define PSNAME "STANAG 4406"
47 #define PFNAME "s4406"
48
49 /* Initialize the protocol and registered fields */
50 int proto_s4406 = -1;
51
52 #include "packet-s4406-hf.c"
53
54 /* Initialize the subtree pointers */
55 static gint ett_s4406 = -1;
56 #include "packet-s4406-ett.c"
57
58 #include "packet-s4406-fn.c"
59
60
61 /*
62 * Dissect STANAG 4406 PDUs inside a PPDU.
63 */
64 static void
65 dissect_s4406(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
66 {
67         int offset = 0;
68         proto_item *item=NULL;
69         proto_tree *tree=NULL;
70
71         if(parent_tree){
72                 item = proto_tree_add_item(parent_tree, proto_s4406, tvb, 0, -1, FALSE);
73                 tree = proto_item_add_subtree(item, ett_s4406);
74         }
75
76         if (check_col(pinfo->cinfo, COL_PROTOCOL))
77                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "S4406");
78         if (check_col(pinfo->cinfo, COL_INFO))
79           col_add_str(pinfo->cinfo, COL_INFO, "Military");
80
81         dissect_s4406_InformationObject(TRUE, tvb, offset, pinfo , tree, -1);
82 }
83
84
85
86 /*--- proto_register_s4406 -------------------------------------------*/
87 void proto_register_s4406(void) {
88
89   /* List of fields */
90   static hf_register_info hf[] =
91   {
92 #include "packet-s4406-hfarr.c"
93   };
94
95   /* List of subtrees */
96   static gint *ett[] = {
97     &ett_s4406,
98 #include "packet-s4406-ettarr.c"
99   };
100
101   /* Register protocol */
102   proto_s4406 = proto_register_protocol(PNAME, PSNAME, PFNAME);
103
104   /* Register fields and subtrees */
105   proto_register_field_array(proto_s4406, hf, array_length(hf));
106   proto_register_subtree_array(ett, array_length(ett));
107
108 }
109
110
111 /*--- proto_reg_handoff_s4406 --- */
112 void proto_reg_handoff_s4406(void) {
113 #include "packet-s4406-dis-tab.c"
114
115   register_ber_oid_dissector("1.3.26.0.4406.0.4.1", dissect_s4406, proto_s4406, "Military Message");
116 }