Some warning fixes for "no previous declaration"
[obnox/wireshark/wip.git] / epan / dissectors / packet-h248_package_bcp.c
1 /* Do not modify this file.                                                   */
2 /* It is created automatically by the ASN.1 to Ethereal dissector compiler    */
3 /* ./packet-h248_package_bcp.c                                                */
4 /* ../../tools/asn2eth.py -X -b -e -p h248_package_bcp -c h248_package_bcp.cnf -s packet-h248_package_bcp-template BCP.asn */
5
6 /* Input file: packet-h248_package_bcp-template.c */
7
8 /* packet-h248_package_bcp.c
9  * Routines for H.248/MEGACO-Package_bcp packet dissection
10  * Ronnie Sahlberg 2004
11  *
12  * $Id$
13  *
14  * Ethereal - Network traffic analyzer
15  * By Gerald Combs <gerald@ethereal.com>
16  * Copyright 1998 Gerald Combs
17  *
18  * This program is free software; you can redistribute it and/or
19  * modify it under the terms of the GNU General Public License
20  * as published by the Free Software Foundation; either version 2
21  * of the License, or (at your option) any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with this program; if not, write to the Free Software
30  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
31  */
32
33 #ifdef HAVE_CONFIG_H
34 # include "config.h"
35 #endif
36
37 #include <glib.h>
38 #include <epan/packet.h>
39 #include <epan/conversation.h>
40
41 #include <stdio.h>
42 #include <string.h>
43
44 #include "packet-ber.h"
45 #include "packet-h248_package_bcp.h"
46
47 #define PNAME  "H.248 MEGACO/BCP"
48 #define PSNAME "H248BCP"
49 #define PFNAME "h248bcp"
50
51 /* Initialize the protocol and registered fields */
52 static int proto_h248_package_bcp = -1;
53
54 /*--- Included file: packet-h248_package_bcp-hf.c ---*/
55
56 static int hf_h248_package_bcp_BNCChar_PDU = -1;  /* BNCChar */
57
58 /*--- End of included file: packet-h248_package_bcp-hf.c ---*/
59
60
61 /* Initialize the subtree pointers */
62 static gint ett_h248_package_bcp = -1;
63 /*#include "packet-h248_package_bcp-ett.c"*/
64
65
66
67 /*--- Included file: packet-h248_package_bcp-fn.c ---*/
68
69 /*--- Fields for imported types ---*/
70
71
72
73 static const value_string BNCChar_vals[] = {
74   {   1, "aal1" },
75   {   2, "aal2" },
76   {   3, "aal1struct" },
77   {   4, "ipRtp" },
78   {   5, "tdm" },
79   { 0, NULL }
80 };
81
82
83 static int
84 dissect_h248_package_bcp_BNCChar(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
85   offset = dissect_ber_integer(FALSE, pinfo, tree, tvb, offset, hf_index, NULL);
86
87   return offset;
88 }
89
90 /*--- PDUs ---*/
91
92 static void dissect_BNCChar_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
93   dissect_h248_package_bcp_BNCChar(FALSE, tvb, 0, pinfo, tree, hf_h248_package_bcp_BNCChar_PDU);
94 }
95
96
97 /*--- End of included file: packet-h248_package_bcp-fn.c ---*/
98
99
100
101 /*--- proto_register_h248_package_bcp ----------------------------------------------*/
102 void proto_register_h248_package_bcp(void) {
103
104   /* List of fields */
105   static hf_register_info hf[] = {
106
107 /*--- Included file: packet-h248_package_bcp-hfarr.c ---*/
108
109     { &hf_h248_package_bcp_BNCChar_PDU,
110       { "BNCChar", "h248_package_bcp.BNCChar",
111         FT_UINT32, BASE_DEC, VALS(BNCChar_vals), 0,
112         "BNCChar", HFILL }},
113
114 /*--- End of included file: packet-h248_package_bcp-hfarr.c ---*/
115
116   };
117
118   /* List of subtrees */
119   static gint *ett[] = {
120     &ett_h248_package_bcp,
121     /*#include "packet-h248_package_bcp-ettarr.c"*/
122   };
123
124   /* Register protocol */
125   proto_h248_package_bcp = proto_register_protocol(PNAME, PSNAME, PFNAME);
126
127   /* Register fields and subtrees */
128   proto_register_field_array(proto_h248_package_bcp, hf, array_length(hf));
129   proto_register_subtree_array(ett, array_length(ett));
130
131 }
132
133
134 /*--- proto_reg_handoff_h248_package_bcp -------------------------------------------*/
135 void proto_reg_handoff_h248_package_bcp(void) {
136   dissector_handle_t h248_package_bcp_handle;
137
138
139   h248_package_bcp_handle = create_dissector_handle(dissect_BNCChar_PDU, proto_h248_package_bcp);
140   dissector_add("h248.package.bin", 0x001e0001, h248_package_bcp_handle);
141 }
142