Fix for bug 5422:
[obnox/wireshark/wip.git] / epan / dissectors / packet-h248_q1950.c
1 /*
2  *  packet-h248_q1950.c
3  *  Q.1950 annex A
4  *
5  *  (c) 2006, Anders Broman <anders.broman@telia.com>
6  *
7  * $Id$
8  *
9  * Wireshark - Network traffic analyzer
10  * By Gerald Combs <gerald@wireshark.org>
11  * Copyright 1998 Gerald Combs
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
26  *
27  * Ref ITU-T Rec. Q.1950 (12/2002)
28  */
29
30 #ifdef HAVE_CONFIG_H
31 # include "config.h"
32 #endif
33
34 #include "packet-h248.h"
35 #include "packet-isup.h"
36
37 #define PNAME  "H.248 Q.1950 Annex A"
38 #define PSNAME "H248Q1950"
39 #define PFNAME "h248q1950"
40
41 static int proto_q1950 = -1;
42 static gboolean implicit = FALSE;
43
44 /* A.3 Bearer characteristics package */
45 static int hf_h248_pkg_BCP = -1;
46 static int hf_h248_pkg_BCP_BNCChar = -1;
47
48 static int ett_h248_pkg_BCP = -1;
49
50 static const value_string h248_pkg_BCP_parameters[] _U_ = {
51         {   0x0001, "BNCChar (BNC Characteristics)" },
52         {0,     NULL}
53 };
54
55 static const value_string h248_pkg_BCP_props_vals[] = {
56         {1,"BNCChar"},
57         {0,NULL}
58 };
59
60 /* Properties */
61 h248_pkg_param_t h248_pkg_BCP_props[] = {
62         { 0x0001, &hf_h248_pkg_BCP_BNCChar, h248_param_ber_integer, &implicit },
63         { 0, NULL, NULL, NULL}
64 };
65
66 /* Packet defenitions */
67 static h248_package_t h248_pkg_BCP = {
68         0x001e,
69         &hf_h248_pkg_BCP,
70         &ett_h248_pkg_BCP,
71         h248_pkg_BCP_props_vals,
72         NULL,
73         NULL,
74         NULL,
75         h248_pkg_BCP_props,                     /* Properties */
76         NULL,                                           /* signals */
77         NULL,                                           /* events */
78         NULL                                            /* statistics */
79 };
80
81 /* A.4 Bearer Network connection cut-through package */
82 static int hf_h248_pkg_BNCCT = -1;
83
84 static int hf_h248_pkg_BNCCT_prop = -1;
85
86 static int ett_h248_pkg_BNCCT = -1;
87
88 static const value_string h248_pkg_BNCCT_parameters[] _U_ = {
89         {   0x0001, "BNC Cut Through Capability" },
90         { 0, NULL }
91 };
92
93 static const value_string h248_pkg_BNCCT_props_vals[] = {
94         {1,"BNCCT"},
95         {0,NULL}
96 };
97
98 static const value_string h248_pkg_BNCCT_prop_vals[]  = {
99         {1,"Early"},
100         {2,"Late"},
101         {0,NULL}
102 };
103
104 /* Properties */
105 static const h248_pkg_param_t h248_pkg_BNCCT_props[] = {
106         { 0x0001, &hf_h248_pkg_BNCCT_prop, h248_param_ber_integer, &implicit },
107         { 0, NULL, NULL, NULL}
108 };
109
110 /* Packet defenitions */
111 static h248_package_t h248_pkg_BNCCT = {
112         0x001f,
113         &hf_h248_pkg_BNCCT,
114         &ett_h248_pkg_BNCCT,
115         h248_pkg_BNCCT_props_vals,
116         NULL,
117         NULL,
118         NULL,
119         h248_pkg_BNCCT_props,                   /* Properties */
120         NULL,                                           /* signals */
121         NULL,                                           /* events */
122         NULL                                            /* statistics */
123 };
124
125 /* A.5 Bearer Reuse Idle Package  */
126 static int hf_h248_pkg_RI = -1;
127
128 static int hf_h248_pkg_RII= -1;
129
130 static int ett_h248_pkg_RI= -1;
131
132 static const value_string h248_pkg_RI_parameters[] = {
133         {   0x0001, "Reuse Idle Indication" },
134         { 0, NULL }
135 };
136
137 static const value_string h248_pkg_RII_vals[]  = {
138         {0,"Not_Reuse_Idle"},
139         {1,"ReUse_Idle"},
140         {0,NULL}
141 };
142
143 /* Properties */
144 h248_pkg_param_t h248_pkg_RI_props[] = {
145         { 0x0001, &hf_h248_pkg_RII, h248_param_ber_integer, &implicit },
146         { 0, NULL, NULL, NULL}
147 };
148
149 /* Packet defenitions */
150 static h248_package_t h248_pkg_RI = {
151         0x0020,
152         &hf_h248_pkg_RI,
153         &ett_h248_pkg_RI,
154         h248_pkg_RI_parameters,
155         NULL,
156         NULL,
157         NULL,
158         h248_pkg_RI_props,                      /* Properties */
159         NULL,                                           /* signals */
160         NULL,                                           /* events */
161         NULL                                            /* statistics */
162 };
163
164
165 /* A.5 Bearer Reuse Idle Package  */
166
167 /* A.6 Generic bearer connection package 
168         Package Name: GB
169         Package ID: 0x0021
170  */
171
172 static int hf_h248_pkg_GB= -1;
173 static int hf_h248_pkg_GB_BNCChange= -1;
174 static int hf_h248_pkg_GB_BNCChange_type= -1;
175 static int hf_h248_pkg_GB_EstBNC= -1;
176 static int hf_h248_pkg_GB_ModBNC= -1;
177 static int hf_h248_pkg_GB_RelBNC = -1;
178 static int hf_h248_pkg_GB_RelBNC_Generalcause = -1;
179 static int hf_h248_pkg_GB_RelBNC_Failurecause = -1;
180 static int hf_h248_pkg_GB_RelBNC_Reset = -1;
181
182 static gint ett_h248_pkg_GB= -1;
183 static gint ett_h248_pkg_GB_EstBNC= -1;
184 static gint ett_h248_pkg_GB_ModBNC= -1;
185 static gint ett_h248_pkg_GB_RelBNC= -1;
186 static gint ett_h248_pkg_GB_BNCChange= -1;
187
188 static const value_string h248_pkg_GB_events_vals[] = {
189         { 0x0001, "BNCChange" },
190         { 0, NULL }
191 };
192
193
194 static const value_string h248_pkg_GB_BNCChange_type_vals[] = {
195         {0x01, "Bearer Established"},
196         {0x02,"Bearer Modified"},
197         {0x03,"Bearer Cut through"},
198         {0x04,"Bearer Modification Failure"},
199         {0,NULL}
200 };
201
202 static const value_string h248_pkg_GB_BNCChange_params_vals[] = {
203         {0x01, "Type"},
204         {0,NULL}
205 };
206
207 static const h248_pkg_param_t h248_pkg_GB_BNCChange_pars[] = {
208         { 0x0001, &hf_h248_pkg_GB_BNCChange_type, h248_param_ber_integer, &implicit },
209         { 0, NULL, NULL, NULL}
210 };
211
212 static const h248_pkg_evt_t h248_pkg_GB_events[] = {
213         { 0x0001, &hf_h248_pkg_GB_BNCChange, &ett_h248_pkg_GB_BNCChange, h248_pkg_GB_BNCChange_pars, h248_pkg_GB_BNCChange_params_vals},
214         { 0, NULL, NULL, NULL, NULL}
215 };
216
217 static const value_string h248_pkg_GB_signals_vals[] = {
218         {0x01, "Establish BNC"},
219         {0x02,"Modify BNC"},
220         {0,NULL}
221 };
222
223 static const value_string h248_pkg_GB_RelBNC_vals[] = {
224         {0x01, "Generalcause"},
225         {0x02,"Failurecause"},
226         {0x03,"Reset"},
227         {0,NULL}
228 };
229
230 static const value_string h248_pkg_GB_RelBNC_Generalcause_vals[] = {
231         {0x01, "Normal Release"},
232         {0x02,"Unavailable Resources"},
233         {0x03,"Failure, Temporary"},
234         {0x04,"Failure, Permanent"},
235         {0x05,"Interworking Error"},
236         {0x06,"Unsupported"},
237         {0,NULL}
238 };
239
240 static const h248_pkg_param_t h248_pkg_GB_RelBNC_pars[] = {
241         { 0x0001, &hf_h248_pkg_GB_RelBNC_Generalcause, h248_param_ber_integer, &implicit },
242         { 0x0002, &hf_h248_pkg_GB_RelBNC_Failurecause, h248_param_ber_octetstring, &implicit },
243         { 0x0003, &hf_h248_pkg_GB_RelBNC_Reset, h248_param_ber_boolean, &implicit },
244         { 0, NULL, NULL, NULL}
245 };
246
247
248 static const h248_pkg_sig_t h248_pkg_GB_signals[] = {
249         { 0x0001,&hf_h248_pkg_GB_EstBNC,&ett_h248_pkg_GB_EstBNC, NULL, NULL},
250         { 0x0002,&hf_h248_pkg_GB_ModBNC,&ett_h248_pkg_GB_ModBNC, NULL, NULL},
251         { 0x0003,&hf_h248_pkg_GB_RelBNC,&ett_h248_pkg_GB_RelBNC, h248_pkg_GB_RelBNC_pars, h248_pkg_GB_RelBNC_vals},
252         { 0, NULL, NULL, NULL, NULL}
253 };
254
255 static h248_package_t h248_pkg_GB = {
256         0x0021,
257         &hf_h248_pkg_GB,
258         &ett_h248_pkg_GB,
259         NULL,
260         h248_pkg_GB_signals_vals,
261         h248_pkg_GB_events_vals,
262         NULL,
263         NULL,                                           /* Properties */
264         h248_pkg_GB_signals,                    /* signals */
265         h248_pkg_GB_events,                     /* events */
266         NULL                                            /* statistics */
267 };
268
269
270 /* A.7 Bearer control tunnelling package */
271 static dissector_handle_t bctp_dissector = NULL;
272
273 static int hf_h248_pkg_bt = -1;
274 static int hf_h248_pkg_bt_tind = -1;
275 static int hf_h248_pkg_bt_tunopt = -1;
276 static int hf_h248_pkg_bt_bit = -1;
277
278 static gint ett_h248_pkg_bt = -1;
279 static gint ett_h248_pkg_bt_tind = -1;
280 static gint ett_h248_pkg_bt_bit= -1;
281
282 static void dissect_bt_tunneled_proto(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* i _U_, void* d _U_) {
283         tvbuff_t* bctp_tvb = NULL;
284         gint8 class;
285         gboolean pc;
286         gint32 tag;
287         asn1_ctx_t asn1_ctx;
288
289         asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
290         
291         get_ber_identifier(tvb, 0, &class, &pc, &tag);
292         
293         /* XXX: is this enough to guess it? */
294         if ((tag==BER_UNI_TAG_OCTETSTRING)) {
295                 dissect_ber_octet_string(FALSE, &asn1_ctx, tree, tvb, 0, hfid, &bctp_tvb);
296                 
297                 if (bctp_tvb) {
298                         call_dissector(bctp_dissector,bctp_tvb,pinfo,tree);
299                 }
300         } else {
301                 proto_tree_add_item(tree,hfid,tvb,0,-1,FALSE);
302         }
303         
304 }
305
306
307 /* Properties */
308 static const value_string h248_pkg_bt_props_vals[] = {
309         {1,"Tunnelling Options"},
310         {0,NULL}
311 };
312
313 static const  value_string h248_pkg_bt_tunopt_vals[] _U_ = {
314         {1,"1 (In the same message as the command response to the command which generated the bearer control tunnel)"},
315         {2,"2 (Tunnel message at any time)"},
316         {3,"NO"},
317         {0,NULL}
318 };
319
320 static const h248_pkg_param_t h248_pkg_bt_props[] _U_ = {
321         { 0x0001, &hf_h248_pkg_bt_tunopt, h248_param_ber_integer, &implicit },
322         { 0, NULL, NULL, NULL}
323 };
324
325 /* Events */
326 static const value_string h248_pkg_bt_evt_vals[] = {
327         {1,"Tunnel indication"},
328         {0,NULL}
329 };
330
331 static const value_string h248_pkg_bt_tind_vals[] = {
332         {1,"Tunnel Indication"},
333         {0,NULL}
334 };
335
336 static const h248_pkg_param_t h248_pkg_bt_bit_params[] = {
337         { 0x0001, &hf_h248_pkg_bt_bit, dissect_bt_tunneled_proto, &implicit },
338         { 0, NULL, NULL, NULL}
339 };
340
341 static const value_string h248_pkg_bt_sigs_vals[] = {
342         {1,"Bearer Information Tunnel"},
343         {0,NULL}
344 };
345
346 static const h248_pkg_evt_t h248_pkg_bt_events[] = {
347         { 0x0001, &hf_h248_pkg_bt_tind, &ett_h248_pkg_bt_tind, h248_pkg_bt_bit_params, h248_pkg_bt_tind_vals},
348         { 0, NULL, NULL, NULL, NULL}
349 };
350
351 static const h248_pkg_sig_t h248_pkg_bt_signals[] = {
352         { 0x0001,&hf_h248_pkg_bt_bit,&ett_h248_pkg_bt_bit, h248_pkg_bt_bit_params, h248_pkg_bt_tind_vals},
353         { 0, NULL, NULL, NULL, NULL}
354 };
355
356 /* Packet defenitions */
357 static h248_package_t h248_pkg_bct = {
358         0x0022,
359         &hf_h248_pkg_bt,
360         &ett_h248_pkg_bt,
361         h248_pkg_bt_props_vals,
362         h248_pkg_bt_sigs_vals,
363         h248_pkg_bt_evt_vals,
364         NULL,
365         NULL,                                           /* Properties */
366         h248_pkg_bt_signals,                    /* signals */
367         h248_pkg_bt_events,                     /* events */
368         NULL                                            /* statistics */
369 };
370
371 /* A.8 Basic call progress tones generator with directionality */
372 static int hf_h248_pkg_bcg = -1;
373 static int hf_h248_pkg_bcg_sig_bdt_par_btd = -1;
374 static int hf_h248_pkg_bcg_sig_bdt = -1;
375 static int hf_h248_pkg_bcg_sig_brt = -1;
376 static int hf_h248_pkg_bcg_sig_bbt = -1;
377 static int hf_h248_pkg_bcg_sig_bct = -1;
378 static int hf_h248_pkg_bcg_sig_bsit = -1;
379 static int hf_h248_pkg_bcg_sig_bwt = -1;
380 static int hf_h248_pkg_bcg_sig_bpt = -1;
381 static int hf_h248_pkg_bcg_sig_bcw = -1;
382 static int hf_h248_pkg_bcg_sig_bcr = -1;
383 static int hf_h248_pkg_bcg_sig_bpy = -1;
384
385 static int ett_h248_pkg_bcg = -1;
386 static int ett_h248_pkg_bcg_sig_bdt = -1;
387
388 static const value_string h248_pkg_bcg_sig_bdt_par_btd_vals[] = {
389         {   0x0001, "ext (External)" },
390         {   0x0002, "int (Internal)" },
391         {   0x0003, "both (Both)" },
392         {0,     NULL},
393 };
394
395 static h248_pkg_param_t  h248_pkg_h248_pkg_bcg_sig_bdt_params[] = {
396         { 0x0001, &hf_h248_pkg_bcg_sig_bdt_par_btd, h248_param_ber_integer, &implicit },
397         { 0, NULL, NULL, NULL}
398 };
399
400 static h248_pkg_sig_t h248_pkg_bcg_signals[] = {
401         /* All the tones have the same parameters */
402         { 0x0040, &hf_h248_pkg_bcg_sig_bdt, &ett_h248_pkg_bcg_sig_bdt, h248_pkg_h248_pkg_bcg_sig_bdt_params, NULL },
403         { 0x0041, &hf_h248_pkg_bcg_sig_brt, &ett_h248_pkg_bcg_sig_bdt, h248_pkg_h248_pkg_bcg_sig_bdt_params, NULL },
404         { 0x0042, &hf_h248_pkg_bcg_sig_bbt, &ett_h248_pkg_bcg_sig_bdt, h248_pkg_h248_pkg_bcg_sig_bdt_params, NULL },
405         { 0x0043, &hf_h248_pkg_bcg_sig_bct, &ett_h248_pkg_bcg_sig_bdt, h248_pkg_h248_pkg_bcg_sig_bdt_params, NULL },
406         { 0x0044, &hf_h248_pkg_bcg_sig_bsit, &ett_h248_pkg_bcg_sig_bdt, h248_pkg_h248_pkg_bcg_sig_bdt_params, NULL },
407         { 0x0045, &hf_h248_pkg_bcg_sig_bwt, &ett_h248_pkg_bcg_sig_bdt, h248_pkg_h248_pkg_bcg_sig_bdt_params, NULL},
408         { 0x0046, &hf_h248_pkg_bcg_sig_bpt, &ett_h248_pkg_bcg_sig_bdt, h248_pkg_h248_pkg_bcg_sig_bdt_params, NULL },
409         { 0x0047, &hf_h248_pkg_bcg_sig_bcw, &ett_h248_pkg_bcg_sig_bdt, h248_pkg_h248_pkg_bcg_sig_bdt_params, NULL },
410         { 0x0048, &hf_h248_pkg_bcg_sig_bcr, &ett_h248_pkg_bcg_sig_bdt, h248_pkg_h248_pkg_bcg_sig_bdt_params, NULL },
411         { 0x0049, &hf_h248_pkg_bcg_sig_bpy, &ett_h248_pkg_bcg_sig_bdt, h248_pkg_h248_pkg_bcg_sig_bdt_params, NULL },
412         { 0, NULL, NULL, NULL,NULL}
413 };
414
415 /* Packet defenitions */
416 static h248_package_t h248_pkg_bcg = {
417         0x0023,
418         &hf_h248_pkg_bcg,
419         &ett_h248_pkg_bcg,
420         NULL,
421         NULL,
422         NULL,
423         NULL,
424         NULL,                                           /* Properties */
425         h248_pkg_bcg_signals,                   /* signals */
426         NULL,                                           /* events */
427         NULL                                            /* statistics */
428 };
429
430
431 void proto_reg_handoff_q1950(void) {
432         bctp_dissector = find_dissector("bctp");
433         
434 }
435
436 /* Register dissector */
437 void proto_register_q1950(void) {
438         static hf_register_info hf[] = {
439                 /* A.3 Bearer characteristics package */
440                 { &hf_h248_pkg_BCP,
441                         { "BCP (Bearer characteristics package)", "h248.pkg.BCP", 
442                         FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
443                 },
444                 { &hf_h248_pkg_BCP_BNCChar,
445                         { "BNCChar (BNC Characteristics)", "h248.pkg.bcp.bncchar", 
446                         FT_UINT32, BASE_HEX|BASE_EXT_STRING, &bearer_network_connection_characteristics_vals_ext, 0, "BNC Characteristics", HFILL }
447                 },
448                 
449                 /* A.4 Bearer Network connection cut-through package */
450                 { &hf_h248_pkg_BNCCT,
451                         { "BNCCT (Bearer network connection cut-through package)", "h248.pkg.BNCCT", 
452                         FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
453                 },
454                 { &hf_h248_pkg_BNCCT_prop,
455                         { "Bearer network connection cut-through capability", "h248.pkg.bcp.bncct", 
456                         FT_UINT32, BASE_HEX, VALS(h248_pkg_BNCCT_prop_vals), 0, "This property allows the MGC to ask the MG when the cut through of a bearer will occur, early or late.", HFILL }
457                 },
458                 
459                 { &hf_h248_pkg_GB,
460                         { "GB (Generic bearer connection)", "h248.pkg.GB", 
461                         FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
462                 },
463                 { &hf_h248_pkg_GB_BNCChange,
464                         { "BNCChange", "h248.pkg.GB.BNCChang", 
465                         FT_BYTES, BASE_NONE, NULL, 0, "This event occurs whenever a change to a Bearer Network connection occurs", HFILL }
466                 },
467                 { &hf_h248_pkg_GB_BNCChange_type,
468                         { "Type", "h248.pkg.GB.BNCChang.Type", 
469                         FT_UINT32, BASE_HEX, VALS(h248_pkg_GB_BNCChange_type_vals), 0, NULL, HFILL }
470                 },
471                 { &hf_h248_pkg_GB_EstBNC,
472                         { "Type", "h248.pkg.GB.BNCChang.EstBNC", 
473                         FT_BYTES, BASE_NONE, NULL, 0, "This signal triggers the bearer control function to send bearer establishment signalling", HFILL }
474                 },
475                 { &hf_h248_pkg_GB_ModBNC,
476                         { "Type", "h248.pkg.GB.BNCChang.Type", 
477                         FT_BYTES, BASE_NONE, NULL, 0, "This signal triggers the bearer control function to send bearer modification", HFILL }
478                 },
479                 { &hf_h248_pkg_GB_RelBNC,
480                         { "RelBNC", "h248.pkg.GB.BNCChang.RelBNC", 
481                         FT_BYTES, BASE_NONE, NULL, 0, "This signal triggers the bearer control function to send bearer release", HFILL }
482                 },
483                 { &hf_h248_pkg_GB_RelBNC_Generalcause,
484                         { "Generalcause", "h248.pkg.GB.BNCChang.RelBNC.Generalcause", 
485                         FT_UINT32, BASE_HEX, VALS(h248_pkg_GB_RelBNC_Generalcause_vals), 0, "This indicates the general reason for the Release", HFILL }
486                 },
487                 { &hf_h248_pkg_GB_RelBNC_Failurecause,
488                         { "Failurecause", "h248.pkg.GB.BNCChang.RelBNC.Failurecause", 
489                         FT_BYTES, BASE_NONE, NULL, 0, "The Release Cause is the value generated by the Released equipment", HFILL }
490                 },
491                 { &hf_h248_pkg_GB_RelBNC_Reset,
492                         { "RelBNC", "h248.pkg.GB.BNCChang.RelBNC", 
493                         FT_BOOLEAN, BASE_NONE, NULL, 0x0, "This signal triggers the bearer control function to send bearer release", HFILL }
494                 },
495
496                 /* A.5 Bearer Network connection cut-through package */
497                 { &hf_h248_pkg_RI,
498                         { "RI (Reuse idle package)", "h248.pkg.RI", 
499                         FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
500                 },
501                 { &hf_h248_pkg_RII,
502                         { "Reuse Idle Indication", "h248.pkg.bcp.rii", 
503                         FT_UINT32, BASE_HEX, VALS(h248_pkg_RII_vals), 0, "This property indicates that the provided bearer network connection relates to an Idle Bearer.", HFILL }
504                 },
505
506                 { &hf_h248_pkg_bt,
507                         { "BT (Bearer control Tunneling)", "h248.pkg.BT", 
508                         FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
509                 },
510                 { &hf_h248_pkg_bt_tunopt,
511                         { "Tunnelling Options", "h248.pkg.BT.TunOpt", 
512                                 FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }
513                 },
514                 { &hf_h248_pkg_bt_tind,
515                         { "tind (Tunnel INDication)", "h248.pkg.BT.TIND", 
516                                 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
517                 },
518                 { &hf_h248_pkg_bt_bit,
519                         { "Bearer Information Transport", "h248.pkg.BT.BIT", 
520                                 FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
521                 },
522                 
523                 
524                 /* A.8 Basic call progress tones generator with directionality */
525                 { &hf_h248_pkg_bcg,
526                         { "bcg (Basic call progress tones generator with directionality)", "h248.pkg.bcg", 
527                         FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
528                 },
529                 { &hf_h248_pkg_bcg_sig_bdt_par_btd,
530                         { "btd (Tone Direction)", "h248.pkg.bcp.btd", 
531                         FT_UINT32, BASE_HEX, VALS(h248_pkg_bcg_sig_bdt_par_btd_vals), 0, NULL, HFILL }
532                 },
533                 { &hf_h248_pkg_bcg_sig_bdt,
534                         { "bdt (Dial Tone)", "h248.pkg.bcg.bdt", 
535                         FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }
536                 },
537                 { &hf_h248_pkg_bcg_sig_brt,
538                         { "brt (Ringing tone)", "h248.pkg.bcg.brt", 
539                         FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }
540                 },
541                 { &hf_h248_pkg_bcg_sig_bbt,
542                         { "bbt (Busy tone)", "h248.pkg.bcg.bbt", 
543                         FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }
544                 },
545                 { &hf_h248_pkg_bcg_sig_bct,
546                         { "bct (Congestion tone)", "h248.pkg.bcg.bct", 
547                         FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }
548                 },
549                 { &hf_h248_pkg_bcg_sig_bsit,
550                         { "bsit (Special information tone)", "h248.pkg.bcg.bsit", 
551                         FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }
552                 },
553                 { &hf_h248_pkg_bcg_sig_bwt,
554                         { "bwt (Warning tone)", "h248.pkg.bcg.bwt", 
555                         FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }
556                 },
557                 { &hf_h248_pkg_bcg_sig_bpt,
558                         { "bpt (Payphone recognition tone)", "h248.pkg.bcg.bpt", 
559                         FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }
560                 },
561                 { &hf_h248_pkg_bcg_sig_bcw,
562                         { "bcw (Call waiting tone)", "h248.pkg.bcg.bcw", 
563                         FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }
564                 },
565                 { &hf_h248_pkg_bcg_sig_bcr,
566                         { "bcr (Call ringing tone)", "h248.pkg.bcg.bcr", 
567                         FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }
568                 },
569                 { &hf_h248_pkg_bcg_sig_bpy,
570                         { "bpy (Pay tone)", "h248.pkg.bcg.bpy", 
571                         FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }
572                 },
573         };
574
575         static gint *ett[] = {
576                 &ett_h248_pkg_BCP,
577                 &ett_h248_pkg_bt,
578                 &ett_h248_pkg_bt_tind,
579                 &ett_h248_pkg_bt_bit,
580                 &ett_h248_pkg_BNCCT,
581                 &ett_h248_pkg_RI,
582         };
583         
584         proto_q1950 = proto_register_protocol(PNAME, PSNAME, PFNAME);
585
586         proto_register_field_array(proto_q1950, hf, array_length(hf));
587
588         proto_register_subtree_array(ett, array_length(ett));
589         
590         /* Register the packages */
591         h248_register_package(&h248_pkg_BCP);
592         h248_register_package(&h248_pkg_BNCCT);
593         h248_register_package(&h248_pkg_RI);
594         h248_register_package(&h248_pkg_GB);
595         h248_register_package(&h248_pkg_bcg);
596         h248_register_package(&h248_pkg_bct);
597
598 }