2 * Routines for STANAG 4406 (X.400 Military Message Extensions) packet dissection
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
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.
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.
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.
31 #include <epan/packet.h>
32 #include <epan/conversation.h>
33 #include <epan/asn1.h>
38 #include "packet-ber.h"
40 #include "packet-x509if.h"
42 #include "packet-s4406.h"
43 #include "packet-x411.h"
44 #include "packet-x420.h"
46 #define PNAME "STANAG 4406 Military Message"
47 #define PSNAME "STANAG 4406"
48 #define PFNAME "s4406"
50 /* Initialize the protocol and registered fields */
53 #include "packet-s4406-hf.c"
55 /* Initialize the subtree pointers */
56 static gint ett_s4406 = -1;
57 #include "packet-s4406-ett.c"
59 #include "packet-s4406-fn.c"
63 * Dissect STANAG 4406 PDUs inside a PPDU.
66 dissect_s4406(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
69 proto_item *item=NULL;
70 proto_tree *tree=NULL;
72 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
75 item = proto_tree_add_item(parent_tree, proto_s4406, tvb, 0, -1, FALSE);
76 tree = proto_item_add_subtree(item, ett_s4406);
79 if (check_col(pinfo->cinfo, COL_PROTOCOL))
80 col_set_str(pinfo->cinfo, COL_PROTOCOL, "S4406");
81 if (check_col(pinfo->cinfo, COL_INFO))
82 col_set_str(pinfo->cinfo, COL_INFO, "Military");
84 dissect_s4406_InformationObject(TRUE, tvb, offset, &asn1_ctx , tree, -1);
89 /*--- proto_register_s4406 -------------------------------------------*/
90 void proto_register_s4406(void) {
93 static hf_register_info hf[] =
95 #include "packet-s4406-hfarr.c"
98 /* List of subtrees */
99 static gint *ett[] = {
101 #include "packet-s4406-ettarr.c"
104 /* Register protocol */
105 proto_s4406 = proto_register_protocol(PNAME, PSNAME, PFNAME);
107 /* Register fields and subtrees */
108 proto_register_field_array(proto_s4406, hf, array_length(hf));
109 proto_register_subtree_array(ett, array_length(ett));
114 /*--- proto_reg_handoff_s4406 --- */
115 void proto_reg_handoff_s4406(void) {
116 #include "packet-s4406-dis-tab.c"
118 register_ber_oid_dissector("1.3.26.0.4406.0.4.1", dissect_s4406, proto_s4406, "Military Message");
120 register_ber_syntax_dissector("MilitaryMessage", proto_s4406, dissect_s4406);
121 register_ber_oid_syntax(".p772", NULL, "MilitaryMessage");