name change
[obnox/wireshark/wip.git] / asn1 / gnm / packet-gnm-template.c
1 /* packet-gnm.c
2  * Routines for GENERIC NETWORK INFORMATION MODEL Data dissection
3  *
4  * Copyright 2005 , Anders Broman <anders.broman [AT] ericsson.com>
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  * References:
27  * ITU-T recommendatiom M.3100
28  */
29
30 #ifdef HAVE_CONFIG_H
31 # include "config.h"
32 #endif
33
34 #include <glib.h>
35 #include <epan/packet.h>
36 #include <epan/conversation.h>
37
38 #include <stdio.h>
39 #include <string.h>
40 #include "packet-cmip.h"
41 #include "packet-ber.h"
42 #include "packet-gnm.h"
43
44 #define PNAME  "ITU M.3100 Generic Network Information Model"
45 #define PSNAME "GNM"
46 #define PFNAME "gnm"
47
48 /* Initialize the protocol and registered fields */
49 int proto_gnm = -1;
50
51 static int hf_gnm_AdministrativeState = -1;
52 #include "packet-gnm-hf.c"
53
54 /* Initialize the subtree pointers */
55 #include "packet-gnm-ett.c"
56
57 #include "packet-gnm-fn.c"
58
59
60
61 static void
62 dissect_gnm_attribute_ObjectInstance(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
63 {
64
65         dissect_cmip_ObjectInstance(FALSE, tvb, 0, pinfo, parent_tree, -1);
66
67 }
68
69 void
70 dissect_gnm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
71 {
72   /* Dymmy function */
73 }
74
75 /*--- proto_register_gnm -------------------------------------------*/
76 void proto_register_gnm(void) {
77
78   /* List of fields */
79   static hf_register_info hf[] = {
80     { &hf_gnm_AdministrativeState,
81       { "AdministrativeState", "gnm.AdministrativeState",
82         FT_UINT32, BASE_DEC, VALS(gnm_AdministrativeState_vals), 0,
83         "", HFILL }},
84
85 #include "packet-gnm-hfarr.c"
86   };
87
88   /* List of subtrees */
89   static gint *ett[] = {
90 #include "packet-gnm-ettarr.c"
91   };
92
93   /* Register protocol */
94   proto_gnm = proto_register_protocol(PNAME, PSNAME, PFNAME);
95   register_dissector("gnm", dissect_gnm, proto_gnm);
96   /* Register fields and subtrees */
97   proto_register_field_array(proto_gnm, hf, array_length(hf));
98   proto_register_subtree_array(ett, array_length(ett));
99
100 }
101
102
103 /*--- proto_reg_handoff_gnm ---------------------------------------*/
104 void proto_reg_handoff_gnm(void) {
105 #include "packet-gnm-dis-tab.c"
106         register_ber_oid_dissector("0.0.13.3100.0.7.9", dissect_gnm_attribute_ObjectInstance, proto_gnm, "clientConnection(9)");
107         register_ber_oid_dissector("0.0.13.3100.0.7.10", dissect_gnm_attribute_ObjectInstance, proto_gnm, "clientTrail(10)");
108         register_ber_oid_dissector("0.0.13.3100.0.7.31", dissect_gnm_attribute_ObjectInstance, proto_gnm, "networkLevelPointer(31)");
109         register_ber_oid_dissector("0.0.13.3100.0.7.46", dissect_gnm_attribute_ObjectInstance, proto_gnm, "networkLevelPointer(31)");
110
111 }