summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/h225/h225.cnf
blob: 6bb7bf4ce9a79f09f3bf4ef69d10fbbb3951c2ff (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
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
# h225.cnf
# H.225 conformation file
# Copyright 2004 Anders Broman

#.IMPORT ../h235/h235-exp.cnf






#.IMPORT ../h245/h245-exp.cnf

#----------------------------------------------------------------------------------------
#.EXPORTS  ONLY_VALS WS_DLL NO_PROT_PREFIX
H323-UU-PDU/h323-message-body
FacilityReason
GatekeeperRejectReason
UnregRequestReason
UnregRejectReason
BandRejectReason
DisengageReason
DisengageRejectReason
InfoRequestNakReason
AdmissionRejectReason
LocationRejectReason
RegistrationRejectReason

#.MODULE_EXPORTS
RasMessage  EXTERN WS_DLL
NonStandardParameter
PublicTypeOfNumber
PrivateTypeOfNumber
AliasAddress      NO_PROT_PREFIX
PartyNumber
PresentationIndicator
ScreeningIndicator
CallIdentifier
ConferenceIdentifier
CircuitIdentifier
GenericIdentifier
GenericData
BandWidth
TimeToLive
TransportAddress
AlternateTransportAddresses
TransportChannelInfo
CallReferenceValue
GloballyUniqueID
TunnelledProtocol
IntegrityMechanism
ICV
CryptoH323Token
TransportQOS
FeatureSet
CircuitInfo
EndpointType
SupportedProtocols
GatekeeperIdentifier
ServiceControlSession
ReleaseCompleteReason  EXTERN WS_DLL
ExtendedAliasAddress_PDU
#.END

#.PDU
H323-UserInformation
RasMessage
ExtendedAliasAddress
#.END

#----------------------------------------------------------------------------------------

#.OMIT_ASSIGNMENT
EncodedFastStartToken
FastStartToken
#.END

#.VIRTUAL_ASSGN
FastStart  Setup-UUIE/fastStart
#.SET_TYPE
Setup-UUIE/fastStart           FastStart
CallProceeding-UUIE/fastStart  FastStart
Connect-UUIE/fastStart         FastStart
Alerting-UUIE/fastStart        FastStart
Information-UUIE/fastStart     FastStart
Facility-UUIE/fastStart        FastStart
Progress-UUIE/fastStart        FastStart

#.VIRTUAL_ASSGN
H245Control  H323-UU-PDU/h245Control
ParallelH245Control  Setup-UUIE/parallelH245Control
DialedDigits  AliasAddress/dialledDigits

#.VIRTUAL_ASSGN
DestinationInfo  AdmissionRequest/destinationInfo
#.SET_TYPE
AdmissionRequest/destinationInfo  DestinationInfo
AdmissionConfirm/destinationInfo  DestinationInfo
LocationRequest/destinationInfo   DestinationInfo
LocationConfirm/destinationInfo   DestinationInfo

#.VIRTUAL_ASSGN
H245TransportAddress  TransportAddress
#.SET_TYPE
Setup-UUIE/h245Address           H245TransportAddress
CallProceeding-UUIE/h245Address  H245TransportAddress
Connect-UUIE/h245Address         H245TransportAddress
Alerting-UUIE/h245Address        H245TransportAddress
Facility-UUIE/h245Address        H245TransportAddress
Progress-UUIE/h245Address        H245TransportAddress
#.FIELD_RENAME
H245TransportAddress/ipAddress              h245IpAddress
H245TransportAddress/ipAddress/ip           h245Ip
H245TransportAddress/ipAddress/port         h245IpPort
H245TransportAddress/ipSourceRoute          h245IpSourceRoute
H245TransportAddress/ipSourceRoute/route    h245Route
H245TransportAddress/ipSourceRoute/routing  h245Routing
H245TransportAddress/ipxAddress             h245IpxAddress
H245TransportAddress/ipxAddress/port        h245IpxPort
H245TransportAddress/ip6Address             h245Ip6Address
H245TransportAddress/ip6Address/ip          h245Ip6
H245TransportAddress/ip6Address/port        h245Ip6port
DisplayName/language                        displayName_language
Endpoint/remoteExtensionAddress/_item       ep_remoteExtensionAddress_item
AdmissionConfirm/remoteExtensionAddress/_item ac_remoteExtensionAddress_item

#.FIELD_ATTR
H245TransportAddress/ipAddress/ip             ABBREV=h245Ip
H245TransportAddress/ipAddress/port           ABBREV=h245IpPort
H245TransportAddress/ip6Address/ip            ABBREV=h245Ip6
H245TransportAddress/ip6Address/port          ABBREV=h245Ip6port
H245TransportAddress/ipxAddress/port          ABBREV=h245IpxPort
TransportAddress/ipSourceRoute/ip             ABBREV=src_route_ipV4
TransportAddress/ipSourceRoute/port           ABBREV=ipV4_src_port
TransportAddress/ipAddress/ip                 ABBREV=ipV4
TransportAddress/ipAddress/port               ABBREV=ipV4_port
TransportAddress/ip6Address/ip                ABBREV=ipV6
TransportAddress/ip6Address/port              ABBREV=ipV6_port
TransportAddress/ipxAddress/port              ABBREV=ipx_port
DisplayName/language                          ABBREV=displayName_language
ExtendedAliasAddress/address                  ABBREV=extAliasAddress
Endpoint/remoteExtensionAddress/_item         ABBREV=remoteExtensionAddress.item
AdmissionConfirm/remoteExtensionAddress/_item ABBREV=ac_remoteExtensionAddress_item

#.VIRTUAL_ASSGN
Language           Setup-UUIE/language
#.SET_TYPE
Connect-UUIE/language         Language
Setup-UUIE/language           Language
RegistrationRequest/language  Language
AdmissionConfirm/language     Language
LocationRequest/language      Language

#----------------------------------------------------------------------------------------
#.TYPE_RENAME
CallCreditServiceControl/callStartingPoint CallCreditServiceControl_callStartingPoint
TunnelledProtocol/id TunnelledProtocol_id
ServiceControlSession/reason ServiceControlSession_reason
RasUsageSpecification/callStartingPoint RasUsageSpecificationcallStartingPoint
CapacityReportingSpecification/when CapacityReportingSpecification_when
RasUsageSpecification/when RasUsageSpecification_when
TransportAddress/ipAddress/ip IpV4
#----------------------------------------------------------------------------------------
#.FIELD_RENAME
RasUsageSpecification/callStartingPoint/alerting alerting_flg
CallCreditServiceControl/callStartingPoint/alerting alerting_flg
UseSpecifiedTransport/annexE annexE_flg

UUIEsRequested/callProceeding callProceeding_flg

CicInfo/cic cic_2_4
UUIEsRequested/connect connect_bool
NonStandardIdentifier/object nsiOID
NonStandardParameter/data nsp_data
H323-UU-PDU/h323-message-body/empty empty_flg
RasUsageInfoTypes/endTime endTime_flg
UUIEsRequested/facility facility_bool
CallsAvailable/group group_IA5String
GroupID/group group_IA5String

Setup-UUIE/hopCount hopCount_1_31
UUIEsRequested/information information_bool
TransportAddress/ip6Address/ip ipV6
TransportAddress/ipAddress/ip ipV4
TransportAddress/ipSourceRoute/ip src_route_ipV4
RTPSession/multicast multicast_flg

UUIEsRequested/notify notify_bool
TransportAddress/ipxAddress/port ipx_port
TransportAddress/ipAddress/port ipV4_port
TransportAddress/ipSourceRoute/port ipV4_src_port
TransportAddress/ip6Address/port ipV6_port
UUIEsRequested/progress progress_bool

Facility-UUIE/reason facilityReason
UnregistrationRequest/reason unregRequestReason
ReleaseComplete-UUIE/reason releaseCompleteReason
BandwidthReject/rejectReason bandRejectReason
UnregistrationReject/rejectReason unregRejectReason
RegistrationReject/rejectReason registrationRejectReason
LocationReject/rejectReason locationRejectReason
DisengageReject/rejectReason disengageRejectReason
GatekeeperReject/rejectReason gatekeeperRejectReason

UUIEsRequested/releaseComplete releaseComplete_bool
UseSpecifiedTransport/sctp sctp_flg
ServiceControlSession/sessionId sessionId_0_255
UUIEsRequested/setup setup_bool
UUIEsRequested/setupAcknowledge setupAcknowledge_bool
Setup-UUIE/sourceInfo setup-UUIE_sourceInfo

UUIEsRequested/status status_bool
UUIEsRequested/statusInquiry statusInquiry_bool
RasUsageInfoTypes/terminationCause terminationCause_flg
CapacityReportingSpecification/when capacityReportingSpecification_when
UUIEsRequested/alerting alerting_bool

LocationConfirm/callSignalAddress locationConfirm_callSignalAddress

RasUsageSpecification/callStartingPoint/connect connect_flg
CallCreditServiceControl/callStartingPoint/connect connect_flg

Alerting-UUIE/destinationInfo uUIE_destinationInfo
CallProceeding-UUIE/destinationInfo uUIE_destinationInfo
Connect-UUIE/destinationInfo uUIE_destinationInfo
Facility-UUIE/destinationInfo uUIE_destinationInfo
Progress-UUIE/destinationInfo uUIE_destinationInfo

TunnelledProtocol/id tunnelledProtocol_id
SecurityCapabilities/integrity securityCapabilities_integrity

GenericIdentifier/nonStandard genericIdentifier_nonStandard
AlternateGK/rasAddress alternateGK_rasAddress
GatekeeperRequest/rasAddress gatekeeperRequest_rasAddress
GatekeeperConfirm/rasAddress gatekeeperConfirm_rasAddress
LocationConfirm/rasAddress locationConfirm_rasAddress
InfoRequestResponse/rasAddress infoRequestResponse_rasAddress


Setup-UUIE/remoteExtensionAddress uUIE_remoteExtensionAddress
Facility-UUIE/remoteExtensionAddress uUIE_remoteExtensionAddress

VendorIdentifier/vendor vendorIdentifier_vendor

RasUsageSpecification/callStartingPoint ras_callStartingPoint

ReleaseCompleteReason/securityError rLC_securityError
GatekeeperRejectReason/securityError gkRej_securityError
RegistrationRejectReason/securityError reg_securityError

CallIdentifier/guid guid

ExtendedAliasAddress/address  extAliasAddress

IsupNumber/e164Number                  isupE164Number
IsupNumber/dataPartyNumber             isupDataPartyNumber
IsupNumber/telexPartyNumber            isupTelexPartyNumber
IsupNumber/privateNumber               isupPrivateNumber
IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber

#----------------------------------------------------------------------------------------
#.FN_BODY H323-UU-PDU/h323-message-body  VAL_PTR = &message_body_val
  int32_t message_body_val;
  h225_packet_info* h225_pi;

  contains_faststart = false;
  call_id_guid = NULL;
%(DEFAULT_BODY)s
  col_append_fstr(actx->pinfo->cinfo, COL_INFO, "CS: %%s ",
    val_to_str_const(message_body_val, T_h323_message_body_vals, "<unknown>"));

  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
    if (h225_pi->msg_type == H225_CS) {
      /* Don't override msg_tag value from IRR */
      h225_pi->msg_tag = message_body_val;
    }

    if (call_id_guid) {
      h225_pi->guid = *call_id_guid;
    }
  }

  if (contains_faststart == true )
  {
    col_append_str(actx->pinfo->cinfo, COL_INFO, "OpenLogicalChannel " );
  }

  col_set_fence(actx->pinfo->cinfo,COL_INFO);

#.END
#----------------------------------------------------------------------------------------
#.FN_BODY FastStart/_item  VAL_PTR = &value_tvb
  tvbuff_t *value_tvb = NULL;
  char codec_str[50];
  h225_packet_info* h225_pi;
  codec_str[0] = '\0';

%(DEFAULT_BODY)s
  if (value_tvb && tvb_reported_length(value_tvb)) {
    dissect_h245_FastStart_OLC(value_tvb, actx->pinfo, tree, codec_str);
  }

  /* Add to packet info */
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
    char temp[50];
    snprintf(temp, 50, "%%s %%s", h225_pi->frame_label, codec_str);
    (void) g_strlcpy(h225_pi->frame_label, temp, 50);
    h225_pi->is_faststart = true;
  }
  contains_faststart = true;
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY RasMessage  VAL_PTR = &rasmessage_value
    int32_t rasmessage_value;
    h225_packet_info* h225_pi;

  call_id_guid = NULL;
%(DEFAULT_BODY)s
  col_add_fstr(actx->pinfo->cinfo, COL_INFO, "RAS: %%s ",
    val_to_str_const(rasmessage_value, h225_RasMessage_vals, "<unknown>"));

  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
    h225_pi->msg_tag = rasmessage_value;
    if (call_id_guid) {
      h225_pi->guid = *call_id_guid;
    }
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_HDR DestinationInfo/_item
  h225_packet_info* h225_pi;

  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
    h225_pi->is_destinationInfo = true;
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY DialedDigits  VAL_PTR = &value_tvb
  tvbuff_t *value_tvb = NULL;
  unsigned len = 0;
  h225_packet_info* h225_pi;

%(DEFAULT_BODY)s
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi && h225_pi->is_destinationInfo == true) {
    if (value_tvb) {
      len = tvb_reported_length(value_tvb);
      /* XXX - should this be allocated as an ephemeral string? */
      if (len > sizeof h225_pi->dialedDigits - 1)
        len = sizeof h225_pi->dialedDigits - 1;
      tvb_memcpy(value_tvb, (uint8_t*)h225_pi->dialedDigits, 0, len);
    }
    h225_pi->dialedDigits[len] = '\0';
    h225_pi->is_destinationInfo = false;
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY H245TransportAddress/ipAddress/ip  VAL_PTR = &value_tvb
  tvbuff_t *value_tvb;

  ipv4_address = 0;
%(DEFAULT_BODY)s
  if (value_tvb)
    ipv4_address = tvb_get_ipv4(value_tvb, 0);
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY H245TransportAddress/ip6Address/ip  VAL_PTR = &value_tvb
  tvbuff_t *value_tvb;

  ipv6_address = ipv6_address_zeros;
%(DEFAULT_BODY)s
  if (value_tvb)
    tvb_get_ipv6(value_tvb, 0, &ipv6_address);
#.END
#----------------------------------------------------------------------------------------
#.FN_PARS H245TransportAddress/ipAddress/port  VAL_PTR = &ip_port
#----------------------------------------------------------------------------------------
#.FN_PARS H245TransportAddress/ip6Address/port  VAL_PTR = &ip_port
#----------------------------------------------------------------------------------------
#.FN_BODY ParallelH245Control/_item  VAL_PTR = &h245_tvb
  tvbuff_t *h245_tvb = NULL;

%(DEFAULT_BODY)s
  next_tvb_add_handle(h245_list, h245_tvb, (h225_h245_in_tree)?tree:NULL, h245dg_handle);
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY H245Control/_item  VAL_PTR = &h245_tvb
  tvbuff_t *h245_tvb = NULL;

%(DEFAULT_BODY)s
  next_tvb_add_handle(h245_list, h245_tvb, (h225_h245_in_tree)?tree:NULL, h245dg_handle);
#.END
#----------------------------------------------------------------------------------------
#.FN_HDR H323-UU-PDU/h323-message-body/empty
  h225_packet_info* h225_pi;
#.END
#----------------------------------------------------------------------------------------
#.FN_FTR H323-UU-PDU/h323-message-body/empty
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
    h225_pi->cs_type = H225_EMPTY;
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_HDR Status-UUIE
  h225_packet_info* h225_pi;
#.END
#----------------------------------------------------------------------------------------
#.FN_FTR Status-UUIE
  /* Add to packet info */
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
    h225_pi->cs_type = H225_STATUS;
    snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_HDR Information-UUIE
  h225_packet_info* h225_pi;
#.END
#----------------------------------------------------------------------------------------
#.FN_FTR Information-UUIE
  /* Add to packet info */
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
    h225_pi->cs_type = H225_INFORMATION;
    snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_HDR Progress-UUIE
  h225_packet_info* h225_pi;
#.END
#----------------------------------------------------------------------------------------
#.FN_FTR Progress-UUIE
  /* Add to packet info */
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
    h225_pi->cs_type = H225_PROGRESS;
    if (contains_faststart) {
      char temp[50];
      snprintf(temp, 50, "%s OLC (%s)", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"), h225_pi->frame_label);
      (void) g_strlcpy(h225_pi->frame_label, temp, 50);
    } else
      snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_HDR SetupAcknowledge-UUIE
  h225_packet_info* h225_pi;
#.END
#----------------------------------------------------------------------------------------
#.FN_FTR SetupAcknowledge-UUIE
  /* Add to packet info */
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
    h225_pi->cs_type = H225_SETUP_ACK;
    snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_HDR Facility-UUIE
  h225_packet_info* h225_pi;
#.END
#----------------------------------------------------------------------------------------
#.FN_FTR Facility-UUIE
  /* Add to packet info */
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
    h225_pi->cs_type = H225_FACILITY;
    snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_HDR H323-UU-PDU/h245Tunnelling
  h225_packet_info* h225_pi;
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
#.END
#----------------------------------------------------------------------------------------
#.FN_PARS H323-UU-PDU/h245Tunnelling  VAL_PTR = &(h225_pi->is_h245Tunneling)
#----------------------------------------------------------------------------------------
#.FN_FTR H323-UU-PDU/h245Tunnelling
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_HDR Setup-UUIE
  h225_packet_info* h225_pi;
  contains_faststart = false;
#.END
#----------------------------------------------------------------------------------------
#.FN_FTR Setup-UUIE
  /* Add to packet info */
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
    h225_pi->cs_type = H225_SETUP;
    if (contains_faststart) {
      char temp[50];
      snprintf(temp, 50, "%s OLC (%s)", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"), h225_pi->frame_label);
      (void) g_strlcpy(h225_pi->frame_label, temp, 50);
    } else
      snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_HDR CallProceeding-UUIE
  h225_packet_info* h225_pi;
#.END
#----------------------------------------------------------------------------------------
#.FN_FTR CallProceeding-UUIE
  /* Add to packet info */
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
    h225_pi->cs_type = H225_CALL_PROCEDING;
    if (contains_faststart) {
      char temp[50];
      snprintf(temp, 50, "%s OLC (%s)", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"), h225_pi->frame_label);
      (void) g_strlcpy(h225_pi->frame_label, temp, 50);
    } else
      snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_HDR Alerting-UUIE
  h225_packet_info* h225_pi;
#.END
#----------------------------------------------------------------------------------------
#.FN_FTR Alerting-UUIE
  /* Add to packet info */
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
    h225_pi->cs_type = H225_ALERTING;
    if (contains_faststart) {
      char temp[50];
      snprintf(temp, 50, "%s OLC (%s)", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"), h225_pi->frame_label);
      (void) g_strlcpy(h225_pi->frame_label, temp, 50);
    } else
      snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_HDR ReleaseComplete-UUIE
  h225_packet_info* h225_pi;
#.END
#----------------------------------------------------------------------------------------
#.FN_FTR ReleaseComplete-UUIE
  /* Add to packet info */
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
    h225_pi->cs_type = H225_RELEASE_COMPLET;
    snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_HDR Connect-UUIE
  h225_packet_info* h225_pi;
#.END
#----------------------------------------------------------------------------------------
#.FN_FTR Connect-UUIE
  /* Add to packet info */
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
    h225_pi->cs_type = H225_CONNECT;
    if (contains_faststart) {
      char temp[50];
      snprintf(temp, 50, "%s OLC (%s)", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"), h225_pi->frame_label);
      (void) g_strlcpy(h225_pi->frame_label, temp, 50);
    } else
      snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_HDR H245TransportAddress
  h225_packet_info* h225_pi;
  ipv4_address=0;
  ipv6_address = ipv6_address_zeros;
  ip_port=0;

#.END
#----------------------------------------------------------------------------------------
#.FN_FTR H245TransportAddress
  /* we need this info for TAPing */
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);

  if (h225_pi) {
    h225_pi->is_h245 = true;
    h225_pi->h245_address = ipv4_address;
    h225_pi->h245_port = ip_port;
  }
  if ( !actx->pinfo->fd->visited && h245_handle && ip_port!=0 ) {
    address src_addr;
    conversation_t *conv=NULL;

    if (ipv4_address!=0) {
      set_address(&src_addr, AT_IPv4, 4, &ipv4_address);
    } else if (memcmp(ipv6_address.bytes, ipv6_address_zeros.bytes, sizeof(ipv6_address.bytes))!=0) {
      set_address(&src_addr, AT_IPv6, 16, ipv6_address.bytes);
    } else {
      return offset;
    }

    conv=find_conversation(actx->pinfo->num, &src_addr, &src_addr, CONVERSATION_TCP, ip_port, ip_port, NO_ADDR_B|NO_PORT_B);
    if(!conv){
      conv=conversation_new(actx->pinfo->num, &src_addr, &src_addr, CONVERSATION_TCP, ip_port, ip_port, NO_ADDR2|NO_PORT2);
      conversation_set_dissector(conv, h245_handle);
    }
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY FacilityReason  VAL_PTR = &value
  int32_t value;
  h225_packet_info* h225_pi;
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);

%(DEFAULT_BODY)s
  if (h225_pi != NULL) {
    h225_pi->reason = value;
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY GatekeeperRejectReason  VAL_PTR = &value
  int32_t value;
  h225_packet_info* h225_pi;
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);

%(DEFAULT_BODY)s
  if (h225_pi != NULL) {
    h225_pi->reason = value;
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY UnregRequestReason  VAL_PTR = &value
  int32_t value;
  h225_packet_info* h225_pi;
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);

%(DEFAULT_BODY)s
  if (h225_pi != NULL) {
    h225_pi->reason = value;
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY UnregRejectReason  VAL_PTR = &value
  int32_t value;
  h225_packet_info* h225_pi;
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);

%(DEFAULT_BODY)s
  if (h225_pi != NULL) {
    h225_pi->reason = value;
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY BandRejectReason  VAL_PTR = &value
  int32_t value;
  h225_packet_info* h225_pi;
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);

%(DEFAULT_BODY)s
  if (h225_pi != NULL) {
    h225_pi->reason = value;
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY DisengageReason  VAL_PTR = &value
  int32_t value;
  h225_packet_info* h225_pi;
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);

%(DEFAULT_BODY)s
  if (h225_pi != NULL) {
    h225_pi->reason = value;
  }
#----------------------------------------------------------------------------------------
#.FN_BODY DisengageRejectReason  VAL_PTR = &value
  int32_t value;
  h225_packet_info* h225_pi;
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);

%(DEFAULT_BODY)s
  if (h225_pi != NULL) {
    h225_pi->reason = value;
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY AdmissionRejectReason  VAL_PTR = &value
  int32_t value;
  h225_packet_info* h225_pi;
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);

%(DEFAULT_BODY)s
  if (h225_pi != NULL) {
    h225_pi->reason = value;
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY LocationRejectReason  VAL_PTR = &value
  int32_t value;
  h225_packet_info* h225_pi;
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);

%(DEFAULT_BODY)s
  if (h225_pi != NULL) {
    h225_pi->reason = value;
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY RegistrationRejectReason  VAL_PTR = &value
  int32_t value;
  h225_packet_info* h225_pi;
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);

%(DEFAULT_BODY)s
  if (h225_pi != NULL) {
    h225_pi->reason = value;
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY InfoRequestNakReason  VAL_PTR = &value
  int32_t value;
  h225_packet_info* h225_pi;
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);

%(DEFAULT_BODY)s
  if (h225_pi != NULL) {
    h225_pi->reason = value;
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY ReleaseCompleteReason  VAL_PTR = &value
  int32_t value;
  h225_packet_info* h225_pi;
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);

%(DEFAULT_BODY)s
  if (h225_pi != NULL) {
    h225_pi->reason = value;
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY CallIdentifier/guid
  tvbuff_t *guid_tvb = NULL;

  actx->value_ptr = &guid_tvb;
%(DEFAULT_BODY)s
  if (guid_tvb)
    tvb_get_ntohguid(guid_tvb, 0, call_id_guid = wmem_new(actx->pinfo->pool, e_guid_t));
  actx->value_ptr = NULL;
#.END
#----------------------------------------------------------------------------------------
#.FN_PARS GloballyUniqueID  VAL_PTR = (tvbuff_t **)actx->value_ptr
#----------------------------------------------------------------------------------------
#.FN_HDR RequestSeqNum
  h225_packet_info* h225_pi;
  h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
  if (h225_pi != NULL) {
#.END
#----------------------------------------------------------------------------------------
#.FN_PARS RequestSeqNum  VAL_PTR = &(h225_pi->requestSeqNum)
#----------------------------------------------------------------------------------------
#.FN_FTR RequestSeqNum
  }
#.END
#----------------------------------------------------------------------------------------
#.FN_BODY H323-UU-PDU/h4501SupplementaryService/_item  VAL_PTR = &h4501_tvb
  tvbuff_t *h4501_tvb = NULL;

%(DEFAULT_BODY)s
  if (h4501_tvb && tvb_reported_length(h4501_tvb)) {
    call_dissector(h4501_handle, h4501_tvb, actx->pinfo, tree);
  }
#.END
#----------------------------------------------------------------------------------------

#--- TunnelledProtocol ------------------------------------------------------------------

#.FN_HDR TunnelledProtocol
  tpOID = "";
#.FN_FTR TunnelledProtocol
  tp_handle = dissector_get_string_handle(tp_dissector_table, tpOID);
#.FN_PARS TunnelledProtocol/id/tunnelledProtocolObjectID
  FN_VARIANT = _str  VAL_PTR = &tpOID
#.END

#.FN_HDR H323-UU-PDU/tunnelledSignallingMessage
  tp_handle = NULL;
#.FN_BODY H323-UU-PDU/tunnelledSignallingMessage/messageContent/_item  VAL_PTR = &next_tvb
  tvbuff_t *next_tvb = NULL;

%(DEFAULT_BODY)s
  next_tvb_add_handle(tp_list, next_tvb, (h225_tp_in_tree)?tree:NULL, tp_handle);
#.END

#--- NonStandardParameter ---------------------------------------------------------------

#.FN_PARS
NonStandardIdentifier/object  FN_VARIANT = _str  VAL_PTR = &nsiOID
#.END

#.FN_BODY NonStandardIdentifier  VAL_PTR = &value
  int32_t value;

  nsiOID = "";
  h221NonStandard = 0;

%(DEFAULT_BODY)s
  switch (value) {
    case 0 :  /* object */
      nsp_handle = dissector_get_string_handle(nsp_object_dissector_table, nsiOID);
      break;
    case 1 :  /* h221NonStandard */
      nsp_handle = dissector_get_uint_handle(nsp_h221_dissector_table, h221NonStandard);
      break;
    default :
      nsp_handle = NULL;
    }
#.END

#.FN_HDR H221NonStandard
  t35CountryCode = 0;
  t35Extension = 0;
  manufacturerCode = 0;
#.FN_FTR H221NonStandard
  h221NonStandard = ((t35CountryCode * 256) + t35Extension) * 65536 + manufacturerCode;
  proto_tree_add_uint(tree, hf_h221Manufacturer, tvb, (offset>>3)-4, 4, h221NonStandard);
#.FN_PARS
H221NonStandard/t35CountryCode    VAL_PTR = &t35CountryCode
H221NonStandard/t35Extension      VAL_PTR = &t35Extension
H221NonStandard/manufacturerCode  VAL_PTR = &manufacturerCode
#.END

#.FN_HDR NonStandardParameter
  nsp_handle = NULL;
#.FN_BODY NonStandardParameter/data  VAL_PTR = &next_tvb
  tvbuff_t *next_tvb = NULL;

%(DEFAULT_BODY)s
  if (next_tvb && tvb_reported_length(next_tvb)) {
    call_dissector((nsp_handle)?nsp_handle:data_handle, next_tvb, actx->pinfo, tree);
  }
#.END

#=== Generic Extensible Framework =======================================================

#.FN_HDR GenericData
  void *priv_data = actx->private_data;
  gef_ctx_t *gefx;

  /* check if not inherited from FeatureDescriptor */
  gefx = gef_ctx_get(actx->private_data);
  if (!gefx) {
    gefx = gef_ctx_alloc(actx->pinfo->pool, NULL, "GenericData");
    actx->private_data = gefx;
  }
#.FN_FTR
  actx->private_data = priv_data;
#.END

#.FN_HDR EnumeratedParameter
  gef_ctx_t *parent_gefx;

  parent_gefx = gef_ctx_get(actx->private_data);
  actx->private_data = gef_ctx_alloc(actx->pinfo->pool, parent_gefx, NULL);
#.FN_FTR
  actx->private_data = parent_gefx;
#.END

#----------------------------------------------------------------------------------------
#.FN_HDR FeatureDescriptor
  void *priv_data = actx->private_data;
  actx->private_data = gef_ctx_alloc(actx->pinfo->pool, NULL, "FeatureDescriptor");
#.FN_FTR
  actx->private_data = priv_data;
#.END
#----------------------------------------------------------------------------------------

#.FN_HDR GenericIdentifier
  gef_ctx_t *gefx;
  proto_item* ti;
#.FN_FTR
  gef_ctx_update_key(actx->pinfo->pool, gef_ctx_get(actx->private_data));
  gefx = gef_ctx_get(actx->private_data);
  if (gefx) {
    ti = proto_tree_add_string(tree, hf_h225_debug_dissector_try_string, tvb, offset>>3, 0, gefx->key);
  proto_item_set_hidden(ti);
    dissector_try_string_new(gef_name_dissector_table, gefx->key, tvb_new_subset_length_caplen(tvb, offset>>3, 0, 0), actx->pinfo, tree, false, actx);
  }
  actx->private_data = gefx;  /* subdissector could overwrite it */
#.END

#.FN_BODY GenericIdentifier/standard  VAL_PTR = &value_int
  uint32_t value_int = (uint32_t)-1;
  gef_ctx_t *gefx;

%(DEFAULT_BODY)s
  gefx = gef_ctx_get(actx->private_data);
  if (gefx) gefx->id = wmem_strdup_printf(actx->pinfo->pool, "%%u", value_int);
#.END

#.FN_BODY GenericIdentifier/oid  FN_VARIANT = _str  VAL_PTR = &oid_str
  const char *oid_str = NULL;
  gef_ctx_t *gefx;

%(DEFAULT_BODY)s
  gefx = gef_ctx_get(actx->private_data);
  if (gefx) gefx->id = oid_str;
#.END

#----------------------------------------------------------------------------------------
#.FN_BODY Content/raw  VAL_PTR = &value_tvb
  tvbuff_t *value_tvb;
  gef_ctx_t *gefx;
  proto_item* ti;

%(DEFAULT_BODY)s
  gefx = gef_ctx_get(actx->private_data);
  if (gefx) {
    ti = proto_tree_add_string(tree, hf_h225_debug_dissector_try_string, tvb, offset>>3, 0, gefx->key);
  proto_item_set_hidden(ti);
    dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, actx->pinfo, %(TREE)s, actx);
  }
#.END

#=== end of GEF =========================================================================

# TBCD-STRING is additionally constrained
# parameter stack is used for passing this constraint

#.FN_HDR TBCD-STRING
  int min_len, max_len;
  bool has_extension;

  get_size_constraint_from_stack(actx, "TBCD_STRING", &min_len, &max_len, &has_extension);
#.FN_PARS TBCD-STRING
MIN_VAL = min_len
MAX_VAL = max_len
EXT = has_extension
#.END


#.TYPE_ATTR
H221NonStandard/t35CountryCode TYPE = FT_UINT32  DISPLAY = BASE_DEC  STRINGS = VALS(T35CountryCode_vals)
TransportAddress/ipAddress/ip  TYPE = FT_IPv4  DISPLAY = BASE_NONE  STRINGS = NULL
TransportAddress/ip6Address/ip  TYPE = FT_IPv6  DISPLAY = BASE_NONE  STRINGS = NULL
H245TransportAddress/ipAddress/ip  TYPE = FT_IPv4  DISPLAY = BASE_NONE  STRINGS = NULL
H245TransportAddress/ip6Address/ip  TYPE = FT_IPv6  DISPLAY = BASE_NONE  STRINGS = NULL
VendorIdentifier/productId TYPE = FT_STRING DISPLAY = BASE_NONE STRINGS = NULL
VendorIdentifier/versionId TYPE = FT_STRING DISPLAY = BASE_NONE STRINGS = NULL
H323-UserInformation/user-data/protocol-discriminator TYPE = FT_UINT32 DISPLAY = BASE_DEC|BASE_EXT_STRING STRINGS = &q931_protocol_discriminator_vals_ext
H323-UU-PDU/tunnelledSignallingMessage/messageContent/_item  TYPE = FT_UINT32 DISPLAY = BASE_DEC
NonStandardParameter/data  TYPE = FT_UINT32 DISPLAY = BASE_DEC
FastStart/_item  TYPE = FT_UINT32 DISPLAY = BASE_DEC
ParallelH245Control/_item  TYPE = FT_UINT32 DISPLAY = BASE_DEC
H245Control/_item  TYPE = FT_UINT32 DISPLAY = BASE_DEC
GloballyUniqueID  TYPE = FT_GUID  DISPLAY = BASE_NONE
H323-UU-PDU/h4501SupplementaryService/_item  TYPE = FT_UINT32 DISPLAY = BASE_DEC
#.END