aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-h248_3gpp.c
blob: ff954d5e78d6f7163900a48998dbda239dd2426b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
/*
 *  packet-h248_3gpp.c
 *  3GPP H.248 Packages
 *
 *  (c) 2006, Luis E. Garcia Ontanon <luis@ontanon.org>
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#include "config.h"

#include <epan/packet.h>
#include <epan/asn1.h>

#include "packet-ber.h"
#include "packet-isup.h"
#include "packet-h248.h"

void proto_register_h248_3gpp(void);

#define PNAME  "H.248 3GPP"
#define PSNAME "H2483GPP"
#define PFNAME "h248.3gpp"

#include "packet-gsm_a_common.h"

/*
 * 3GUP Package
 * 3GPP TS 29.232 -- 15.1.1
 */
static int proto_h248_package_3GUP = -1;

static int hf_h248_package_3GUP_Mode = -1;
static int hf_h248_package_3GUP_UPversions = -1;
static int hf_h248_package_3GUP_delerrsdu = -1;
static int hf_h248_package_3GUP_interface = -1;
static int hf_h248_package_3GUP_initdir = -1;

static gint ett_h248_package_3GUP = -1;

static gboolean implicit = FALSE;

static const value_string h248_3GUP_properties_vals[] = {
	{ 0x0000, "threegup (3G User Plane)" },
	{ 0x0001, "Mode" },
	{ 0x0002, "Versions" },
	{ 0x0003, "delerrsdu" },
	{ 0x0004, "interface" },
	{ 0x0005, "initdir" },
	{0,     NULL}
};

static const value_string h248_3GUP_Mode_vals[] = {
	{   0x00000001, "Transparent mode" },
	{   0x00000002, "Support mode for predefined SDU sizes" },
	{0,     NULL}
};

static const value_string h248_3GUP_upversions_vals[] = {
	{   0x01, "Version 1" },
	{   0x02, "Version 2" },
	{   0x03, "Version 3" },
	{   0x04, "Version 4" },
	{   0x05, "Version 5" },
	{   0x06, "Version 6" },
	{   0x07, "Version 7" },
	{   0x08, "Version 8" },
	{   0x09, "Version 9" },
	{   0x0A, "Version 10" },
	{   0x0B, "Version 11" },
	{   0x0C, "Version 12" },
	{   0x0D, "Version 13" },
	{   0x0E, "Version 14" },
	{   0x0F, "Version 15" },
	{   0x10, "Version 16" },
	{0,     NULL}
};

static const value_string h248_3GUP_delerrsdu_vals[] = {
	{   0x0001, "Yes" },
	{   0x0002, "No" },
	{   0x0003, "Not Applicable" },
	{0,     NULL}
};

static const value_string h248_3GUP_interface_vals[] = {
	{   0x0001, "RAN (Iu interface)" },
	{   0x0002, "CN (Nb interface)" },
	{0,     NULL}
};

static const value_string h248_3GUP_initdir_vals[] = {
	{   0x0001, "Incoming" },
	{   0x0002, "Outgoing" },
	{0,     NULL}
};

static const value_string h248_3GUP_parameters[] _U_ = {
	{   0x0001, "Mode" },
	{   0x0002, "UPversions" },
	{   0x0003, "Delivery of erroneous SDUs" },
	{   0x0004, "Interface" },
	{   0x0005, "Initialisation Direction" },
	{0,     NULL}
};

static const h248_pkg_param_t h248_package_3GUP_properties[] = {
	{ 0x0001, &hf_h248_package_3GUP_Mode, h248_param_ber_integer, &implicit },
	{ 0x0002, &hf_h248_package_3GUP_UPversions, h248_param_ber_integer, &implicit },
	{ 0x0003, &hf_h248_package_3GUP_delerrsdu, h248_param_ber_integer, &implicit },
	{ 0x0004, &hf_h248_package_3GUP_interface, h248_param_ber_integer, &implicit },
	{ 0x0005, &hf_h248_package_3GUP_initdir, h248_param_ber_integer, &implicit },
	{ 0x0000, NULL, NULL, NULL }
};

static h248_package_t h248_package_3GUP = {
	0x002f,
	&proto_h248_package_3GUP,
	&ett_h248_package_3GUP,
	h248_3GUP_properties_vals,
	NULL,
	NULL,
	NULL,
	h248_package_3GUP_properties,
	NULL,
	NULL,
	NULL
};


/*
 * Circuit Switched Data package
 * 3GPP TS 29.232 -- 15.2.1
 */

static int hf_h248_package_3GCSD = -1;

static int hf_h248_package_3GCSD_plmnbc = -1;
static int hf_h248_package_3GCSD_gsmchancod = -1;
static int hf_h248_pkg_3GCSD_evt_protres = -1;
static int hf_h248_pkg_3GCSD_evt_protres_result = -1;
static int hf_h248_pkg_3GCSD_evt_protres_cause = -1;
static int hf_h248_pkg_3GCSD_evt_ratechg = -1;
static int hf_h248_pkg_3GCSD_evt_ratechg_rate = -1;
static int hf_h248_pkg_3GCSD_sig_actprot = -1;
static int hf_h248_pkg_3GCSD_actprot_sig_localpeer = -1;

static gint ett_h248_package_3GCSD = -1;
static gint ett_h248_3GCSD_evt_protres = -1;
static gint ett_h248_3GCSD_evt_ratechg = -1;
static gint ett_pkg_3GCSD_sig_actprot = -1;

static void dissect_3gcsd_plmnbc(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* cu _U_, void* implicit_param) {
	asn1_ctx_t asn1_ctx;

	asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
	dissect_ber_octet_string(implicit_param ? *((gboolean*)implicit_param) : FALSE, &asn1_ctx, tree, tvb, 0, hfid, NULL);
	de_bearer_cap(tvb, tree, pinfo, 4, tvb_reported_length(tvb)-4, NULL, 0);
}

static const value_string h248_3GCSD_properties_vals[] = {
	{ 0x0000, "Circuit Switched Data (threegcsd)"},
	{ 0x0001, "plmnbc"},
	{ 0x0002, "gsmchancod"},
	{0,     NULL}
};

static const value_string h248_3GCSD_signals_vals[] = {
	{ 0x0001, "actprot" },
	{0,     NULL}
};

static const value_string h248_3GCSD_signal_actprot_vals[] = {
	{ 0x0001, "localpeer" },
	{0,     NULL}
};

static const value_string h248_3GCSD_events_vals[] = {
	{ 0x0001, "protres"},
	{ 0x0002, "ratechg"},
	{0,     NULL}
};

static const value_string h248_3GCSD_event_protres_vals[] = {
	{ 0x0001, "result"},
	{ 0x0002, "cause"},
	{0,     NULL}
};

static const value_string h248_3GCSD_event_ratechg_vals[] = {
	{ 0x0001, "rate"},
	{0,     NULL}
};

static const value_string h248_3GCSD_evt_protres_result_vals[] = {
	{1,"Success"},
	{0,"Failure"},
	{0,NULL}
};

static const value_string h248_3GCSD_evt_protres_cause_vals[] = {
	{1,"Unsp"},
	{2,"V8V34"},
	{0,NULL}
};

static const value_string h248_3GCSD_actprot_sig_localpeer_vals[] = {
	{0,"Orig"},
	{1,"Term"},
	{0,NULL}
};

static const h248_pkg_param_t h248_package_3GCSD_props[] = {
	{ 0x0001, &hf_h248_package_3GCSD_plmnbc, dissect_3gcsd_plmnbc, &implicit},
	{ 0x0002, &hf_h248_package_3GCSD_gsmchancod, h248_param_ber_octetstring, &implicit },
	{ 0x0000, NULL, NULL, NULL }
};

static const h248_pkg_param_t h248_pkg_3GCSD_evt_protres_params[] = {
	{ 0x0001, &hf_h248_pkg_3GCSD_evt_protres_result, h248_param_ber_integer, &implicit },
	{ 0x0002, &hf_h248_pkg_3GCSD_evt_protres_cause, h248_param_ber_integer, &implicit },
	{ 0, NULL, NULL, NULL}
};

static const h248_pkg_param_t h248_pkg_3GCSD_evt_ratechg_params[] = {
	{ 0x0001, &hf_h248_pkg_3GCSD_evt_ratechg_rate, h248_param_ber_integer, &implicit },
	{ 0, NULL, NULL, NULL}
};

static const h248_pkg_evt_t h248_package_3GCSD_evts[] = {
	{ 0x0001, &hf_h248_pkg_3GCSD_evt_protres, &ett_h248_3GCSD_evt_protres, h248_pkg_3GCSD_evt_protres_params, h248_3GCSD_event_protres_vals},
	{ 0x0002, &hf_h248_pkg_3GCSD_evt_ratechg, &ett_h248_3GCSD_evt_ratechg, h248_pkg_3GCSD_evt_ratechg_params, h248_3GCSD_event_ratechg_vals},
	{ 0, NULL, NULL, NULL,NULL}
};

static const h248_pkg_param_t h248_pkg_3GCSD_actprot_sig_params[] = {
	{ 0x0001, &hf_h248_pkg_3GCSD_actprot_sig_localpeer, h248_param_ber_integer, &implicit },
	{ 0, NULL, NULL, NULL}
};

static const h248_pkg_sig_t h248_package_3GCSD_sigs[] = {
	{ 0x0010, &hf_h248_pkg_3GCSD_sig_actprot, &ett_pkg_3GCSD_sig_actprot, h248_pkg_3GCSD_actprot_sig_params, h248_3GCSD_signal_actprot_vals },
	{ 0, NULL, NULL, NULL,NULL}
};

static h248_package_t h248_package_3GCSD = {
	0x0030,
	&hf_h248_package_3GCSD,
	&ett_h248_package_3GCSD,
	h248_3GCSD_properties_vals,
	h248_3GCSD_signals_vals,
	h248_3GCSD_events_vals,
	NULL,
	h248_package_3GCSD_props,
	h248_package_3GCSD_sigs,
	h248_package_3GCSD_evts,
	NULL
};


/*
 * TFO package
 * 3GPP TS 29.232 -- 15.2.2
 */
static int hf_h248_package_3GTFO = -1;

static int hf_h248_pkg_3GTFO_evt_codec_modify = -1;
static int hf_h248_pkg_3GTFO_evt_distant_codec_list = -1;
static int hf_h248_pkg_3GTFO_evt_status = -1;
static int hf_h248_pkg_3GTFO_enable = -1;
static int hf_h248_pkg_3GTFO_codeclist = -1;
static int hf_h248_pkg_3GTFO_evt_codec_modify_optimalcodec = -1;
static int hf_h248_pkg_3GTFO_evt_distant_codec_list_distlist = -1;
static int hf_h248_pkg_3GTFO_evt_status_tfostatus = -1;

static gint ett_h248_package_3GTFO = -1;
static gint ett_h248_3GTFO_evt_status = -1;
static gint ett_h248_3GTFO_evt_distant_codec_list = -1;
static gint ett_h248_3GTFO_evt_codec_modify = -1;
static gint ett_h248_3GTFO_codec_list = -1;
static gint ett_h248_3GTFO_codec = -1;


static void dissect_3GTFO_codec_mode(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* cu _U_, void* ignored _U_) {
	tvbuff_t* sub_tvb = NULL;
	gint8 appclass;
	gboolean pc;
	gint32 tag;
	asn1_ctx_t asn1_ctx;

	asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);

	get_ber_identifier(tvb, 0, &appclass, &pc, &tag);

	/* XXX: is this enough to guess it? */
	if (tag==BER_UNI_TAG_OCTETSTRING) {
		dissect_ber_octet_string(FALSE, &asn1_ctx, tree, tvb, 0, hfid, &sub_tvb );

		if (sub_tvb) {
			proto_tree* pt = proto_item_add_subtree(asn1_ctx.created_item, ett_h248_3GTFO_codec);
			dissect_codec_mode(pt, sub_tvb, 0, tvb_reported_length(tvb));
		}
	} else {
		proto_tree_add_item(tree,hfid,tvb,0,-1,ENC_NA);
	}

}

static void dissect_3GTFO_codec_list(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo, int hfid, h248_curr_info_t* cu _U_, void* ignored _U_) {
	tvbuff_t* sub_tvb = NULL;
	gint8 appclass;
	gboolean pc;
	gint32 tag;
	asn1_ctx_t asn1_ctx;

	asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);

	get_ber_identifier(tvb, 0, &appclass, &pc, &tag);

	if (tag==BER_UNI_TAG_OCTETSTRING) {
		dissect_ber_octet_string(FALSE, &asn1_ctx, tree, tvb, 0, hfid, &sub_tvb );

		if (sub_tvb) {
			proto_tree* pt = proto_item_add_subtree(asn1_ctx.created_item,ett_h248_3GTFO_codec_list);
			int len = tvb_reported_length(sub_tvb);
			int offset = 0;
			do {
				offset = dissect_codec_mode(pt, sub_tvb, offset, len);
			} while(offset < len);
		}
	} else {
		proto_tree_add_item(tree,hfid,tvb,0,-1,ENC_NA);
	}
}


static const value_string h248_package_3GTFO_props_vals[] = {
	{0,"3G Tandem Free Operation (3gtfo)"},
	{1,"enable"},
	{2,"codeclist"},
	{0,NULL}
};

static const value_string h248_pkg_3GTFO_evt_codec_modify_params_vals[] = {
	{11,"optimalcodec"},
	{0,NULL}
};


static const value_string h248_pkg_3GTFO_evt_distant_codec_list_params_vals[] = {
	{13,"distlist"},
	{0,NULL}
};

static const value_string h248_pkg_3GTFO_evt_status_params_vals[] = {
	{1,"tfostatus"},
	{0,NULL}
};


static const value_string h248_package_3GTFO_evts_vals[] = {
	{10,"codec_modify"},
	{12,"distant_codec_list"},
	{14,"status"},
	{0,NULL}
};

static const value_string tfoenable_vals[] = {
	{1,"On"},
	{2,"Off"},
	{0,NULL}
};

static const h248_pkg_param_t h248_package_3GTFO_props[] = {
	{ 0x0001, &hf_h248_pkg_3GTFO_enable, h248_param_ber_integer, &implicit },
	{ 0x0002, &hf_h248_pkg_3GTFO_codeclist, dissect_3GTFO_codec_list, NULL }, /* Sub-list of Octet string Q.765.5 + TS 26.103 .*/
	{ 0, NULL, NULL, NULL}
};


static const h248_pkg_param_t h248_pkg_3GTFO_evt_codec_modify_params[] = {
	{ 0x0011, &hf_h248_pkg_3GTFO_evt_codec_modify_optimalcodec, dissect_3GTFO_codec_mode, NULL }, /* Q.765.5 + TS 26.103 .*/
	{ 0, NULL, NULL, NULL}
};


static const h248_pkg_param_t h248_pkg_3GTFO_evt_distant_codec_list_params[] = {
	{ 0x0013, &hf_h248_pkg_3GTFO_evt_distant_codec_list_distlist, dissect_3GTFO_codec_list, NULL }, /* Sub-list of Octet string Q.765.5 + TS 26.103 .*/
	{ 0, NULL, NULL, NULL}
};

static const h248_pkg_param_t h248_pkg_3GTFO_evt_status_params[] = {
	{ 0x0001, &hf_h248_pkg_3GTFO_evt_status_tfostatus, h248_param_ber_boolean, &implicit },
	{ 0, NULL, NULL, NULL}
};

static const h248_pkg_evt_t h248_package_3GTFO_evts[] = {
	{ 0x0010, &hf_h248_pkg_3GTFO_evt_codec_modify, &ett_h248_3GTFO_evt_codec_modify, h248_pkg_3GTFO_evt_codec_modify_params, h248_pkg_3GTFO_evt_codec_modify_params_vals},
	{ 0x0012, &hf_h248_pkg_3GTFO_evt_distant_codec_list, &ett_h248_3GTFO_evt_distant_codec_list, h248_pkg_3GTFO_evt_distant_codec_list_params, h248_pkg_3GTFO_evt_distant_codec_list_params_vals},
	{ 0x0014, &hf_h248_pkg_3GTFO_evt_status, &ett_h248_3GTFO_evt_status, h248_pkg_3GTFO_evt_status_params, h248_pkg_3GTFO_evt_status_params_vals},
	{ 0, NULL, NULL, NULL,NULL}
};

static h248_package_t h248_package_3GTFO = {
	0x0031,
	&hf_h248_package_3GTFO,
	&ett_h248_package_3GTFO,
	h248_package_3GTFO_props_vals,
	NULL,
	h248_package_3GTFO_evts_vals,
	NULL,
	h248_package_3GTFO_props,
	NULL,
	h248_package_3GTFO_evts,
	NULL};

/*
 * 3G Expanded Call Progress Tones Generator Package
 * 3GPP TS 29.232 -- 15.2.3
 */
/*
 * Modification Of Link Characteristics Bearer Capability
 * 3GPP TS 29.232 -- 15.2.4
 */
/*
 * Enhanced Circuit Switched Data package
 * 3GPP TS 29.232 -- 15.2.5
 */
/*
 * Cellular Text telephone Modem Text Transport
 * 3GPP TS 29.232 -- 15.2.6
 */
/*
 * IP transport package
 * 3GPP TS 29.232 -- 15.2.7
 */
static int hf_h248_package_threegiptra = -1;
static int hf_h248_package_threegiptra_ipv4trans = -1;
static int hf_h248_package_threegiptra_ipv6trans = -1;
static int hf_h248_package_threegiptra_UDport = -1;

static int ett_h248_package_threegiptra = -1;

static const value_string h248_threegiptra_properties_vals[] = {
	{ 0x0000, "threegiptra (3G IP transport)" },
	{ 0001,  "IP V4 transport address" },
	{ 0002,  "IP V6 transport address" },
	{ 0003,  "UDP port" },
	{ 0,  NULL }
};

static const h248_pkg_param_t h248_package_threegiptra_properties[] = {
	{ 0x0001, &hf_h248_package_threegiptra_ipv4trans, h248_param_ber_octetstring, &implicit },
	{ 0x0002, &hf_h248_package_threegiptra_ipv6trans, h248_param_ber_octetstring, &implicit },
	{ 0x0003, &hf_h248_package_threegiptra_UDport, h248_param_ber_integer, &implicit },
	{ 0x0000, NULL, NULL, NULL }
};

static h248_package_t h248_package_threegiptra = {
	0x0083,                                    /* Package ID = threegiptra  */
	&hf_h248_package_threegiptra,              /* hf_id */
	&ett_h248_package_threegiptra,
	h248_threegiptra_properties_vals,
	NULL,                                      /* signal_names */
	NULL,                                      /* event_names */
	NULL,                                      /* stats_names */
	h248_package_threegiptra_properties,       /* h248_pkg_param_t */
	NULL,
	NULL,
	NULL
};

/*
 * Flexible Tone Generator Package
 * 3GPP TS 29.232 -- 15.2.8
 */
/*
 * Trace Package
 * 3GPP TS 29.232 -- 15.2.9
 */
/*
 * ASCI Group call package
 * 3GPP TS 29.232 -- 15.2.10
 */
/*
 * 3G Interface Type package
 * 3GPP TS 29.232 -- 15.2.11
 */
static int hf_h248_package_threegint = -1;
static int hf_h248_package_threegint_ipint = -1;

static int ett_h248_package_threegint = -1;

static const value_string h248_threegint_properties_vals[] = {
	{0000,  "3G Interface Type"},
	{0001,  "IP Interface Type"},
	{0,  NULL}
};

static const value_string h248_threegint_ipint_vals[] = {
	{1,  "NboIP (Nb over IP with SIP-I based Nc,)"},
	{2,  "AoIP (A interface over IP)"},
	{3,  "MboIP (Mb interface)"},
	{4,  "ExtSIPI (External SIP-I based network)"},
	{0,  NULL}
};

static const h248_pkg_param_t h248_package_threegint_properties[] = {
	{ 0x0001, &hf_h248_package_threegint_ipint, h248_param_ber_integer, &implicit },
	{ 0x0000, NULL, NULL, NULL }
};

static h248_package_t h248_package_threegint = {
	0x00e3,                                    /* Package ID = threegint */
	&hf_h248_package_threegint,                /* hf_id */
	&ett_h248_package_threegint,
	h248_threegint_properties_vals,
	NULL,                                      /* signal_names */
	NULL,                                      /* event_names */
	NULL,                                      /* stats_names */
	h248_package_threegint_properties,         /* h248_pkg_param_t */
	NULL,
	NULL,
	NULL
};

void proto_register_h248_3gpp(void) {
	static hf_register_info hf[] = {
		{ &hf_h248_package_3GUP_Mode,
		{ "Mode", "h248.package_3GUP.Mode",
			FT_UINT32, BASE_DEC, VALS(h248_3GUP_Mode_vals), 0,
			NULL, HFILL }},
		{ &hf_h248_package_3GUP_UPversions,
		{ "UPversions", "h248.package_3GUP.upversions",
			FT_UINT32, BASE_DEC, VALS(h248_3GUP_upversions_vals), 0,
			NULL, HFILL }},
		{ &hf_h248_package_3GUP_delerrsdu,
		{ "Delivery of erroneous SDUs", "h248.package_3GUP.delerrsdu",
			FT_UINT32, BASE_DEC, VALS(h248_3GUP_delerrsdu_vals), 0,
			NULL, HFILL }},
		{ &hf_h248_package_3GUP_interface,
		{ "Interface", "h248.package_3GUP.interface",
			FT_UINT32, BASE_DEC, VALS(h248_3GUP_interface_vals), 0,
			NULL, HFILL }},
		{ &hf_h248_package_3GUP_initdir,
		{ "Initialisation Direction", "h248.package_3GUP.initdir",
			FT_UINT32, BASE_DEC, VALS(h248_3GUP_initdir_vals), 0,
			NULL, HFILL }},


		{ &hf_h248_package_3GCSD,
		{ "CSD Package", "h248.package_3GCSD",
			FT_BYTES, BASE_NONE, NULL, 0,
			"Circuit Switched Data Package", HFILL }},
		{ &hf_h248_package_3GCSD_plmnbc,
		{ "PLMN Bearer Capability", "h248.package_3GCSD.plmnbc",
			FT_BYTES, BASE_NONE, NULL, 0,
			"The PLMN Bearer Capability", HFILL }},
		{ &hf_h248_package_3GCSD_gsmchancod,
		{ "GSM channel coding", "h248.package_3GCSD.gsmchancod",
			FT_BYTES, BASE_NONE, NULL, 0,
			"Channel information needed for GSM", HFILL }},
		{ &hf_h248_pkg_3GCSD_evt_protres,
		{ "Protocol Negotiation Result", "h248.package_3GCSD.protres",
			FT_BYTES, BASE_NONE, NULL, 0,
			"This event is used to report the result of the protocol negotiation", HFILL }},
		{ &hf_h248_pkg_3GCSD_evt_protres_result,
		{ "Negotiation Result", "h248.package_3GCSD.protres.result",
			FT_UINT32, BASE_DEC, VALS(h248_3GCSD_evt_protres_result_vals), 0,
			"reports whether the protocol negotiation has been successful", HFILL }},
		{ &hf_h248_pkg_3GCSD_evt_protres_cause,
		{ "Possible Failure Cause", "h248.package_3GCSD.protres.cause",
			FT_UINT32, BASE_DEC, VALS(h248_3GCSD_evt_protres_cause_vals), 0,
			"indicates the possible failure cause", HFILL }},
		{ &hf_h248_pkg_3GCSD_evt_ratechg,
		{ "Rate Change", "h248.package_3GCSD.ratechg",
			FT_BYTES, BASE_NONE, NULL, 0,
			"This event is used to report a rate change", HFILL }},
		{ &hf_h248_pkg_3GCSD_evt_ratechg_rate,
		{ "New Rate", "h248.package_3GCSD.ratechg.rate",
			FT_UINT32, BASE_DEC, NULL, 0,
			"reports the new rate for the termination", HFILL }},
		{ &hf_h248_pkg_3GCSD_sig_actprot,
		{ "Activate Protocol", "h248.package_3GCSD.actprot",
			FT_BYTES, BASE_NONE, NULL, 0,
			"Activate the higher layer protocol", HFILL }},
		{ &hf_h248_pkg_3GCSD_actprot_sig_localpeer,
		{ "Local Peer Role", "h248.package_3GCSD.actprot.localpeer",
			FT_UINT32, BASE_DEC, VALS(h248_3GCSD_actprot_sig_localpeer_vals), 0,
			"It is used to inform the modem whether it should act as originating or terminating peer", HFILL }},


		{ &hf_h248_package_3GTFO,
		{ "Tandem Free Operation", "h248.package_3GTFO",
			FT_BYTES, BASE_NONE, NULL, 0,
			"This package defines events and properties for Tandem Free Operation (TFO) control", HFILL }},
		{ &hf_h248_pkg_3GTFO_enable,
		{ "TFO Activity Control", "h248.package_3GTFO.tfoenable",
			FT_UINT32, BASE_DEC, VALS(tfoenable_vals), 0,
			"Defines if TFO is enabled or not", HFILL }},
		{ &hf_h248_pkg_3GTFO_codeclist,
		{ "TFO Codec List", "h248.package_3GTFO.codeclist",
			FT_BYTES, BASE_NONE, NULL, 0,
			"List of codecs for use in TFO protocol", HFILL }},

		{ &hf_h248_pkg_3GTFO_evt_codec_modify,
		{ "Optimal Codec Event", "h248.package_3GTFO.codec_modify",
			FT_BYTES, BASE_NONE, NULL, 0,
			"The event is used to notify the MGC that TFO negotiation has resulted in an optimal codec type being proposed", HFILL }},
		{ &hf_h248_pkg_3GTFO_evt_codec_modify_optimalcodec,
		{ "Optimal Codec Type", "h248.package_3GTFO.codec_modify.optimalcodec",
			FT_BYTES, BASE_NONE, NULL, 0,
			"indicates which is the proposed codec type for TFO", HFILL }},

		{ &hf_h248_pkg_3GTFO_evt_distant_codec_list,
		{ "Codec List Event", "h248.package_3GTFO.distant_codec_list",
			FT_BYTES, BASE_NONE, NULL, 0,
			"The event is used to notify the MGC of the distant TFO partner's supported codec list", HFILL }},

		{ &hf_h248_pkg_3GTFO_evt_distant_codec_list_distlist,
		{ "Distant Codec List", "h248.package_3GTFO.distant_codec_list.distlist",
			FT_BYTES, BASE_NONE, NULL, 0,
			"indicates the codec list for TFO", HFILL }},

		{ &hf_h248_pkg_3GTFO_evt_status,
		{ "TFO Status Event", "h248.package_3GTFO.status",
			FT_BYTES, BASE_NONE, NULL, 0,
			"The event is used to notify the MGC that a TFO link has been established or broken", HFILL }},
		{ &hf_h248_pkg_3GTFO_evt_status_tfostatus,
		{ "TFO Status", "h248.package_3GTFO.status.tfostatus",
			FT_BOOLEAN, BASE_NONE, NULL, 0x0,
			"reports whether TFO has been established or broken", HFILL }},
		{ &hf_h248_package_threegint,
		{ "3G Interface Type", "h248.package_threegint",
			FT_BYTES, BASE_NONE, NULL, 0,
			"This package contains a property to specify the used interface type for IP terminations", HFILL }},
		{ &hf_h248_package_threegint_ipint,
		{ "IP Interface Type", "h248.package_threegint.ipint",
			FT_UINT32, BASE_DEC, VALS(h248_threegint_ipint_vals), 0,
			NULL, HFILL }},


		{ &hf_h248_package_threegiptra,
		{ "IP transport", "h248.package_threegiptra",
			FT_BYTES, BASE_NONE, NULL, 0,
			"This package contains the information needed to be able to support IP transport from RAN to the media gateway", HFILL }},
		{ &hf_h248_package_threegiptra_ipv4trans,
		{ "IPv4 Address", "h248.package_threegiptra.ipv4trans",
			FT_BYTES, BASE_NONE, NULL, 0,
			NULL, HFILL }},
		{ &hf_h248_package_threegiptra_ipv6trans,
		{ "IPv6 Address", "h248.package_threegiptra.ipv6trans",
			FT_BYTES, BASE_NONE, NULL, 0,
			NULL, HFILL }},
		{ &hf_h248_package_threegiptra_UDport,
		{ "UDP Port", "h248.package_threegiptra.udport",
			FT_UINT32, BASE_DEC, NULL, 0,
			NULL, HFILL }},

	};

	static gint *ett[] = {
		&ett_h248_package_3GUP,
		&ett_h248_package_3GCSD,
		&ett_h248_3GCSD_evt_protres,
		&ett_h248_3GCSD_evt_ratechg,
		&ett_h248_package_3GTFO,
		&ett_h248_3GTFO_evt_status,
		&ett_h248_3GTFO_evt_distant_codec_list,
		&ett_h248_3GTFO_evt_codec_modify,
		&ett_h248_3GTFO_codec_list,
		&ett_h248_3GTFO_codec,
		&ett_pkg_3GCSD_sig_actprot,
		&ett_h248_package_threegiptra,
		&ett_h248_package_threegint
	};

	proto_h248_package_3GUP = proto_register_protocol(PNAME, PSNAME, PFNAME);

	proto_register_field_array(proto_h248_package_3GUP, hf, array_length(hf));

	proto_register_subtree_array(ett, array_length(ett));

	h248_register_package(&h248_package_3GUP,REPLACE_PKG);
	h248_register_package(&h248_package_3GCSD, REPLACE_PKG);
	h248_register_package(&h248_package_3GTFO, REPLACE_PKG);
	h248_register_package(&h248_package_threegint, REPLACE_PKG);
	h248_register_package(&h248_package_threegiptra, REPLACE_PKG);

}

/*
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
 *
 * Local variables:
 * c-basic-offset: 8
 * tab-width: 8
 * indent-tabs-mode: t
 * End:
 *
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
 * :indentSize=8:tabSize=8:noTabs=false:
 */