MSWSP: fix dissect_mswsp_smb()
[wireshark-wip.git] / epan / dissectors / packet-h248_7.c
blob2e12f0377a2d24e81aa4ef390a6a75b2bf9628aa
1 /*
2 * packet-h248_7.c
3 * H.248.7
4 * Gateway control protocol: Generic Announcement package
6 * (c) 2007, Luis E. Garcia Ontanon <luis@ontanon.org>
8 * $Id$
10 * Wireshark - Network traffic analyzer
11 * By Gerald Combs <gerald@wireshark.org>
12 * Copyright 1998 Gerald Combs
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 #include "config.h"
31 #include "packet-h248.h"
33 #define PNAME "H.248.7"
34 #define PSNAME "H248AN"
35 #define PFNAME "h248.an"
37 static int proto_h248_an = -1;
39 static int hf_h248_an_apf = -1;
40 static int hf_h248_an_apf_an = -1;
41 static int hf_h248_an_apf_noc = -1;
42 static int hf_h248_an_apf_av = -1;
43 static int hf_h248_an_apf_di = -1;
45 static int hf_h248_an_apv = -1;
46 static int hf_h248_an_apv_an = -1;
47 static int hf_h248_an_apv_noc = -1;
48 static int hf_h248_an_apv_av = -1;
49 static int hf_h248_an_apv_num = -1;
50 static int hf_h248_an_apv_spi = -1;
51 static int hf_h248_an_apv_sp = -1;
52 static int hf_h248_an_apv_di = -1;
54 static gint ett_h248_an = -1;
55 static gint ett_h248_an_apf = -1;
56 static gint ett_h248_an_apv = -1;
58 static const value_string h248_an_prop_vals[] = {
59 { 0, "Generic Announcment Package (an) (H.248.7)" },
60 { 0, NULL }
63 static const value_string h248_an_signals_vals[] = {
64 { 0x0001, "Annoumcement Play Fixed (apf)"},
65 { 0x0002, "Announcement Play Variable (apv)"},
66 {0,NULL}
70 static const value_string h248_an_apf_params_vals[] = {
71 { 0x0001, "Name (an)"},
72 { 0x0002, "Number of Cycles (noc)"},
73 { 0x0003, "Variant (av)"},
74 { 0x0004, "Direction (di)"},
75 {0,NULL}
78 static const value_string h248_an_apv_params_vals[] = {
79 { 0x0001, "Name (an)"},
80 { 0x0002, "Number of Cycles (noc)"},
81 { 0x0003, "Variant (av)"},
82 { 0x0004, "Number (num)"},
83 { 0x0005, "Specific Parameters Interpretation (spi)"},
84 { 0x0006, "Specific Parameters (sp)"},
85 { 0x0007, "Direction (di)"},
86 {0,NULL}
89 static const value_string h248_an_di_vals[] = {
90 { 0x0001, "External (ext)"},
91 { 0x0002, "Internal (int)"},
92 { 0x0003, "Both (both)"},
93 {0,NULL}
99 static const h248_pkg_param_t h248_an_apf_params[] = {
100 { 0x0001, &hf_h248_an_apf_an, h248_param_ber_integer, NULL },
101 { 0x0002, &hf_h248_an_apf_noc, h248_param_ber_integer, NULL },
102 { 0x0003, &hf_h248_an_apf_av, h248_param_ber_octetstring, NULL },
103 { 0x0004, &hf_h248_an_apf_di, h248_param_ber_integer, NULL },
104 { 0, NULL, NULL, NULL}
107 static const h248_pkg_param_t h248_an_apv_params[] = {
108 { 0x0001, &hf_h248_an_apv_an, h248_param_ber_integer, NULL },
109 { 0x0002, &hf_h248_an_apv_noc, h248_param_ber_integer, NULL },
110 { 0x0003, &hf_h248_an_apv_av, h248_param_ber_octetstring, NULL },
111 { 0x0004, &hf_h248_an_apv_num, h248_param_ber_integer, NULL },
112 { 0x0005, &hf_h248_an_apv_spi, h248_param_ber_integer, NULL },
113 { 0x0006, &hf_h248_an_apv_sp, h248_param_ber_integer, NULL },
114 { 0x0007, &hf_h248_an_apv_di, h248_param_ber_integer, NULL },
115 { 0, NULL, NULL, NULL}
118 static const h248_pkg_sig_t h248_an_signals[] = {
119 { 0x0001, &hf_h248_an_apf, &ett_h248_an_apf, h248_an_apf_params, h248_an_apf_params_vals },
120 { 0x0002, &hf_h248_an_apv, &ett_h248_an_apv, h248_an_apv_params, h248_an_apv_params_vals },
121 { 0, NULL, NULL, NULL, NULL}
124 static const h248_package_t h248_pkg_an = {
125 0x001d,
126 &proto_h248_an,
127 &ett_h248_an,
128 h248_an_prop_vals,
129 h248_an_signals_vals,
130 NULL,
131 NULL,
132 NULL, /* Properties */
133 h248_an_signals, /* signals */
134 NULL, /* events */
135 NULL /* statistics */
143 void proto_register_h248_7(void) {
144 static hf_register_info hf[] = {
145 { &hf_h248_an_apf, { "Fixed Announcement Play", "h248.an.apf", FT_BYTES, BASE_NONE, NULL, 0, "Initiates the play of a fixed announcement", HFILL }},
146 { &hf_h248_an_apf_an, { "Announcement name", "h248.an.apf.an", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
147 { &hf_h248_an_apf_noc, { "Number of cycles", "h248.an.apf.noc", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
148 { &hf_h248_an_apf_av, { "Announcement Variant", "h248.an.apf.av", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
149 { &hf_h248_an_apf_di, {"Announcement Direction","h248.an.apf.di",FT_UINT32, BASE_HEX, VALS(h248_an_di_vals), 0, NULL, HFILL}},
151 { &hf_h248_an_apv, { "Fixed Announcement Play", "h248.an.apv", FT_BYTES, BASE_NONE, NULL, 0, "Initiates the play of a fixed announcement", HFILL }},
152 { &hf_h248_an_apv_an, { "Announcement name", "h248.an.apv.an", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
153 { &hf_h248_an_apv_noc, { "Number of cycles", "h248.an.apv.noc", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
154 { &hf_h248_an_apv_av, { "Announcement Variant", "h248.an.apv.av", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
155 { &hf_h248_an_apv_num, { "Number", "h248.an.apv.num", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
156 { &hf_h248_an_apv_spi, { "Specific parameters interpretation", "h248.an.apv.spi", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
157 { &hf_h248_an_apv_sp, { "Specific parameters", "h248.an.apv.sp", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
158 { &hf_h248_an_apv_di, {"Announcement Direction","h248.an.apv.di",FT_UINT32, BASE_HEX, VALS(h248_an_di_vals), 0, NULL, HFILL}}
162 static gint *ett[] = {
163 &ett_h248_an,
164 &ett_h248_an_apf,
165 &ett_h248_an_apv
168 proto_h248_an = proto_register_protocol(PNAME, PSNAME, PFNAME);
170 proto_register_field_array(proto_h248_an, hf, array_length(hf));
172 proto_register_subtree_array(ett, array_length(ett));
174 h248_register_package(&h248_pkg_an,REPLACE_PKG);