Kerberos: add kerberos_inject_longterm_key() helper function
[wireshark-sm.git] / epan / dissectors / asn1 / h225 / h225.cnf
blob6bb7bf4ce9a79f09f3bf4ef69d10fbbb3951c2ff
1 # h225.cnf
2 # H.225 conformation file
3 # Copyright 2004 Anders Broman
5 #.IMPORT ../h235/h235-exp.cnf
12 #.IMPORT ../h245/h245-exp.cnf
14 #----------------------------------------------------------------------------------------
15 #.EXPORTS  ONLY_VALS WS_DLL NO_PROT_PREFIX
16 H323-UU-PDU/h323-message-body
17 FacilityReason
18 GatekeeperRejectReason
19 UnregRequestReason
20 UnregRejectReason
21 BandRejectReason
22 DisengageReason
23 DisengageRejectReason
24 InfoRequestNakReason
25 AdmissionRejectReason
26 LocationRejectReason
27 RegistrationRejectReason
29 #.MODULE_EXPORTS
30 RasMessage  EXTERN WS_DLL
31 NonStandardParameter
32 PublicTypeOfNumber
33 PrivateTypeOfNumber
34 AliasAddress      NO_PROT_PREFIX
35 PartyNumber
36 PresentationIndicator
37 ScreeningIndicator
38 CallIdentifier
39 ConferenceIdentifier
40 CircuitIdentifier
41 GenericIdentifier
42 GenericData
43 BandWidth
44 TimeToLive
45 TransportAddress
46 AlternateTransportAddresses
47 TransportChannelInfo
48 CallReferenceValue
49 GloballyUniqueID
50 TunnelledProtocol
51 IntegrityMechanism
52 ICV
53 CryptoH323Token
54 TransportQOS
55 FeatureSet
56 CircuitInfo
57 EndpointType
58 SupportedProtocols
59 GatekeeperIdentifier
60 ServiceControlSession
61 ReleaseCompleteReason  EXTERN WS_DLL
62 ExtendedAliasAddress_PDU
63 #.END
65 #.PDU
66 H323-UserInformation
67 RasMessage
68 ExtendedAliasAddress
69 #.END
71 #----------------------------------------------------------------------------------------
73 #.OMIT_ASSIGNMENT
74 EncodedFastStartToken
75 FastStartToken
76 #.END
78 #.VIRTUAL_ASSGN
79 FastStart  Setup-UUIE/fastStart
80 #.SET_TYPE
81 Setup-UUIE/fastStart           FastStart
82 CallProceeding-UUIE/fastStart  FastStart
83 Connect-UUIE/fastStart         FastStart
84 Alerting-UUIE/fastStart        FastStart
85 Information-UUIE/fastStart     FastStart
86 Facility-UUIE/fastStart        FastStart
87 Progress-UUIE/fastStart        FastStart
89 #.VIRTUAL_ASSGN
90 H245Control  H323-UU-PDU/h245Control
91 ParallelH245Control  Setup-UUIE/parallelH245Control
92 DialedDigits  AliasAddress/dialledDigits
94 #.VIRTUAL_ASSGN
95 DestinationInfo  AdmissionRequest/destinationInfo
96 #.SET_TYPE
97 AdmissionRequest/destinationInfo  DestinationInfo
98 AdmissionConfirm/destinationInfo  DestinationInfo
99 LocationRequest/destinationInfo   DestinationInfo
100 LocationConfirm/destinationInfo   DestinationInfo
102 #.VIRTUAL_ASSGN
103 H245TransportAddress  TransportAddress
104 #.SET_TYPE
105 Setup-UUIE/h245Address           H245TransportAddress
106 CallProceeding-UUIE/h245Address  H245TransportAddress
107 Connect-UUIE/h245Address         H245TransportAddress
108 Alerting-UUIE/h245Address        H245TransportAddress
109 Facility-UUIE/h245Address        H245TransportAddress
110 Progress-UUIE/h245Address        H245TransportAddress
111 #.FIELD_RENAME
112 H245TransportAddress/ipAddress              h245IpAddress
113 H245TransportAddress/ipAddress/ip           h245Ip
114 H245TransportAddress/ipAddress/port         h245IpPort
115 H245TransportAddress/ipSourceRoute          h245IpSourceRoute
116 H245TransportAddress/ipSourceRoute/route    h245Route
117 H245TransportAddress/ipSourceRoute/routing  h245Routing
118 H245TransportAddress/ipxAddress             h245IpxAddress
119 H245TransportAddress/ipxAddress/port        h245IpxPort
120 H245TransportAddress/ip6Address             h245Ip6Address
121 H245TransportAddress/ip6Address/ip          h245Ip6
122 H245TransportAddress/ip6Address/port        h245Ip6port
123 DisplayName/language                        displayName_language
124 Endpoint/remoteExtensionAddress/_item       ep_remoteExtensionAddress_item
125 AdmissionConfirm/remoteExtensionAddress/_item ac_remoteExtensionAddress_item
127 #.FIELD_ATTR
128 H245TransportAddress/ipAddress/ip             ABBREV=h245Ip
129 H245TransportAddress/ipAddress/port           ABBREV=h245IpPort
130 H245TransportAddress/ip6Address/ip            ABBREV=h245Ip6
131 H245TransportAddress/ip6Address/port          ABBREV=h245Ip6port
132 H245TransportAddress/ipxAddress/port          ABBREV=h245IpxPort
133 TransportAddress/ipSourceRoute/ip             ABBREV=src_route_ipV4
134 TransportAddress/ipSourceRoute/port           ABBREV=ipV4_src_port
135 TransportAddress/ipAddress/ip                 ABBREV=ipV4
136 TransportAddress/ipAddress/port               ABBREV=ipV4_port
137 TransportAddress/ip6Address/ip                ABBREV=ipV6
138 TransportAddress/ip6Address/port              ABBREV=ipV6_port
139 TransportAddress/ipxAddress/port              ABBREV=ipx_port
140 DisplayName/language                          ABBREV=displayName_language
141 ExtendedAliasAddress/address                  ABBREV=extAliasAddress
142 Endpoint/remoteExtensionAddress/_item         ABBREV=remoteExtensionAddress.item
143 AdmissionConfirm/remoteExtensionAddress/_item ABBREV=ac_remoteExtensionAddress_item
145 #.VIRTUAL_ASSGN
146 Language           Setup-UUIE/language
147 #.SET_TYPE
148 Connect-UUIE/language         Language
149 Setup-UUIE/language           Language
150 RegistrationRequest/language  Language
151 AdmissionConfirm/language     Language
152 LocationRequest/language      Language
154 #----------------------------------------------------------------------------------------
155 #.TYPE_RENAME
156 CallCreditServiceControl/callStartingPoint CallCreditServiceControl_callStartingPoint
157 TunnelledProtocol/id TunnelledProtocol_id
158 ServiceControlSession/reason ServiceControlSession_reason
159 RasUsageSpecification/callStartingPoint RasUsageSpecificationcallStartingPoint
160 CapacityReportingSpecification/when CapacityReportingSpecification_when
161 RasUsageSpecification/when RasUsageSpecification_when
162 TransportAddress/ipAddress/ip IpV4
163 #----------------------------------------------------------------------------------------
164 #.FIELD_RENAME
165 RasUsageSpecification/callStartingPoint/alerting alerting_flg
166 CallCreditServiceControl/callStartingPoint/alerting alerting_flg
167 UseSpecifiedTransport/annexE annexE_flg
169 UUIEsRequested/callProceeding callProceeding_flg
171 CicInfo/cic cic_2_4
172 UUIEsRequested/connect connect_bool
173 NonStandardIdentifier/object nsiOID
174 NonStandardParameter/data nsp_data
175 H323-UU-PDU/h323-message-body/empty empty_flg
176 RasUsageInfoTypes/endTime endTime_flg
177 UUIEsRequested/facility facility_bool
178 CallsAvailable/group group_IA5String
179 GroupID/group group_IA5String
181 Setup-UUIE/hopCount hopCount_1_31
182 UUIEsRequested/information information_bool
183 TransportAddress/ip6Address/ip ipV6
184 TransportAddress/ipAddress/ip ipV4
185 TransportAddress/ipSourceRoute/ip src_route_ipV4
186 RTPSession/multicast multicast_flg
188 UUIEsRequested/notify notify_bool
189 TransportAddress/ipxAddress/port ipx_port
190 TransportAddress/ipAddress/port ipV4_port
191 TransportAddress/ipSourceRoute/port ipV4_src_port
192 TransportAddress/ip6Address/port ipV6_port
193 UUIEsRequested/progress progress_bool
195 Facility-UUIE/reason facilityReason
196 UnregistrationRequest/reason unregRequestReason
197 ReleaseComplete-UUIE/reason releaseCompleteReason
198 BandwidthReject/rejectReason bandRejectReason
199 UnregistrationReject/rejectReason unregRejectReason
200 RegistrationReject/rejectReason registrationRejectReason
201 LocationReject/rejectReason locationRejectReason
202 DisengageReject/rejectReason disengageRejectReason
203 GatekeeperReject/rejectReason gatekeeperRejectReason
205 UUIEsRequested/releaseComplete releaseComplete_bool
206 UseSpecifiedTransport/sctp sctp_flg
207 ServiceControlSession/sessionId sessionId_0_255
208 UUIEsRequested/setup setup_bool
209 UUIEsRequested/setupAcknowledge setupAcknowledge_bool
210 Setup-UUIE/sourceInfo setup-UUIE_sourceInfo
212 UUIEsRequested/status status_bool
213 UUIEsRequested/statusInquiry statusInquiry_bool
214 RasUsageInfoTypes/terminationCause terminationCause_flg
215 CapacityReportingSpecification/when capacityReportingSpecification_when
216 UUIEsRequested/alerting alerting_bool
218 LocationConfirm/callSignalAddress locationConfirm_callSignalAddress
220 RasUsageSpecification/callStartingPoint/connect connect_flg
221 CallCreditServiceControl/callStartingPoint/connect connect_flg
223 Alerting-UUIE/destinationInfo uUIE_destinationInfo
224 CallProceeding-UUIE/destinationInfo uUIE_destinationInfo
225 Connect-UUIE/destinationInfo uUIE_destinationInfo
226 Facility-UUIE/destinationInfo uUIE_destinationInfo
227 Progress-UUIE/destinationInfo uUIE_destinationInfo
229 TunnelledProtocol/id tunnelledProtocol_id
230 SecurityCapabilities/integrity securityCapabilities_integrity
232 GenericIdentifier/nonStandard genericIdentifier_nonStandard
233 AlternateGK/rasAddress alternateGK_rasAddress
234 GatekeeperRequest/rasAddress gatekeeperRequest_rasAddress
235 GatekeeperConfirm/rasAddress gatekeeperConfirm_rasAddress
236 LocationConfirm/rasAddress locationConfirm_rasAddress
237 InfoRequestResponse/rasAddress infoRequestResponse_rasAddress
240 Setup-UUIE/remoteExtensionAddress uUIE_remoteExtensionAddress
241 Facility-UUIE/remoteExtensionAddress uUIE_remoteExtensionAddress
243 VendorIdentifier/vendor vendorIdentifier_vendor
245 RasUsageSpecification/callStartingPoint ras_callStartingPoint
247 ReleaseCompleteReason/securityError rLC_securityError
248 GatekeeperRejectReason/securityError gkRej_securityError
249 RegistrationRejectReason/securityError reg_securityError
251 CallIdentifier/guid guid
253 ExtendedAliasAddress/address  extAliasAddress
255 IsupNumber/e164Number                  isupE164Number
256 IsupNumber/dataPartyNumber             isupDataPartyNumber
257 IsupNumber/telexPartyNumber            isupTelexPartyNumber
258 IsupNumber/privateNumber               isupPrivateNumber
259 IsupNumber/nationalStandardPartyNumber isupNationalStandardPartyNumber
261 #----------------------------------------------------------------------------------------
262 #.FN_BODY H323-UU-PDU/h323-message-body  VAL_PTR = &message_body_val
263   int32_t message_body_val;
264   h225_packet_info* h225_pi;
266   contains_faststart = false;
267   call_id_guid = NULL;
268 %(DEFAULT_BODY)s
269   col_append_fstr(actx->pinfo->cinfo, COL_INFO, "CS: %%s ",
270     val_to_str_const(message_body_val, T_h323_message_body_vals, "<unknown>"));
272   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
273   if (h225_pi != NULL) {
274     if (h225_pi->msg_type == H225_CS) {
275       /* Don't override msg_tag value from IRR */
276       h225_pi->msg_tag = message_body_val;
277     }
279     if (call_id_guid) {
280       h225_pi->guid = *call_id_guid;
281     }
282   }
284   if (contains_faststart == true )
285   {
286     col_append_str(actx->pinfo->cinfo, COL_INFO, "OpenLogicalChannel " );
287   }
289   col_set_fence(actx->pinfo->cinfo,COL_INFO);
291 #.END
292 #----------------------------------------------------------------------------------------
293 #.FN_BODY FastStart/_item  VAL_PTR = &value_tvb
294   tvbuff_t *value_tvb = NULL;
295   char codec_str[50];
296   h225_packet_info* h225_pi;
297   codec_str[0] = '\0';
299 %(DEFAULT_BODY)s
300   if (value_tvb && tvb_reported_length(value_tvb)) {
301     dissect_h245_FastStart_OLC(value_tvb, actx->pinfo, tree, codec_str);
302   }
304   /* Add to packet info */
305   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
306   if (h225_pi != NULL) {
307     char temp[50];
308     snprintf(temp, 50, "%%s %%s", h225_pi->frame_label, codec_str);
309     (void) g_strlcpy(h225_pi->frame_label, temp, 50);
310     h225_pi->is_faststart = true;
311   }
312   contains_faststart = true;
313 #.END
314 #----------------------------------------------------------------------------------------
315 #.FN_BODY RasMessage  VAL_PTR = &rasmessage_value
316     int32_t rasmessage_value;
317     h225_packet_info* h225_pi;
319   call_id_guid = NULL;
320 %(DEFAULT_BODY)s
321   col_add_fstr(actx->pinfo->cinfo, COL_INFO, "RAS: %%s ",
322     val_to_str_const(rasmessage_value, h225_RasMessage_vals, "<unknown>"));
324   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
325   if (h225_pi != NULL) {
326     h225_pi->msg_tag = rasmessage_value;
327     if (call_id_guid) {
328       h225_pi->guid = *call_id_guid;
329     }
330   }
331 #.END
332 #----------------------------------------------------------------------------------------
333 #.FN_HDR DestinationInfo/_item
334   h225_packet_info* h225_pi;
336   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
337   if (h225_pi != NULL) {
338     h225_pi->is_destinationInfo = true;
339   }
340 #.END
341 #----------------------------------------------------------------------------------------
342 #.FN_BODY DialedDigits  VAL_PTR = &value_tvb
343   tvbuff_t *value_tvb = NULL;
344   unsigned len = 0;
345   h225_packet_info* h225_pi;
347 %(DEFAULT_BODY)s
348   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
349   if (h225_pi && h225_pi->is_destinationInfo == true) {
350     if (value_tvb) {
351       len = tvb_reported_length(value_tvb);
352       /* XXX - should this be allocated as an ephemeral string? */
353       if (len > sizeof h225_pi->dialedDigits - 1)
354         len = sizeof h225_pi->dialedDigits - 1;
355       tvb_memcpy(value_tvb, (uint8_t*)h225_pi->dialedDigits, 0, len);
356     }
357     h225_pi->dialedDigits[len] = '\0';
358     h225_pi->is_destinationInfo = false;
359   }
360 #.END
361 #----------------------------------------------------------------------------------------
362 #.FN_BODY H245TransportAddress/ipAddress/ip  VAL_PTR = &value_tvb
363   tvbuff_t *value_tvb;
365   ipv4_address = 0;
366 %(DEFAULT_BODY)s
367   if (value_tvb)
368     ipv4_address = tvb_get_ipv4(value_tvb, 0);
369 #.END
370 #----------------------------------------------------------------------------------------
371 #.FN_BODY H245TransportAddress/ip6Address/ip  VAL_PTR = &value_tvb
372   tvbuff_t *value_tvb;
374   ipv6_address = ipv6_address_zeros;
375 %(DEFAULT_BODY)s
376   if (value_tvb)
377     tvb_get_ipv6(value_tvb, 0, &ipv6_address);
378 #.END
379 #----------------------------------------------------------------------------------------
380 #.FN_PARS H245TransportAddress/ipAddress/port  VAL_PTR = &ip_port
381 #----------------------------------------------------------------------------------------
382 #.FN_PARS H245TransportAddress/ip6Address/port  VAL_PTR = &ip_port
383 #----------------------------------------------------------------------------------------
384 #.FN_BODY ParallelH245Control/_item  VAL_PTR = &h245_tvb
385   tvbuff_t *h245_tvb = NULL;
387 %(DEFAULT_BODY)s
388   next_tvb_add_handle(h245_list, h245_tvb, (h225_h245_in_tree)?tree:NULL, h245dg_handle);
389 #.END
390 #----------------------------------------------------------------------------------------
391 #.FN_BODY H245Control/_item  VAL_PTR = &h245_tvb
392   tvbuff_t *h245_tvb = NULL;
394 %(DEFAULT_BODY)s
395   next_tvb_add_handle(h245_list, h245_tvb, (h225_h245_in_tree)?tree:NULL, h245dg_handle);
396 #.END
397 #----------------------------------------------------------------------------------------
398 #.FN_HDR H323-UU-PDU/h323-message-body/empty
399   h225_packet_info* h225_pi;
400 #.END
401 #----------------------------------------------------------------------------------------
402 #.FN_FTR H323-UU-PDU/h323-message-body/empty
403   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
404   if (h225_pi != NULL) {
405     h225_pi->cs_type = H225_EMPTY;
406   }
407 #.END
408 #----------------------------------------------------------------------------------------
409 #.FN_HDR Status-UUIE
410   h225_packet_info* h225_pi;
411 #.END
412 #----------------------------------------------------------------------------------------
413 #.FN_FTR Status-UUIE
414   /* Add to packet info */
415   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
416   if (h225_pi != NULL) {
417     h225_pi->cs_type = H225_STATUS;
418     snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
419   }
420 #.END
421 #----------------------------------------------------------------------------------------
422 #.FN_HDR Information-UUIE
423   h225_packet_info* h225_pi;
424 #.END
425 #----------------------------------------------------------------------------------------
426 #.FN_FTR Information-UUIE
427   /* Add to packet info */
428   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
429   if (h225_pi != NULL) {
430     h225_pi->cs_type = H225_INFORMATION;
431     snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
432   }
433 #.END
434 #----------------------------------------------------------------------------------------
435 #.FN_HDR Progress-UUIE
436   h225_packet_info* h225_pi;
437 #.END
438 #----------------------------------------------------------------------------------------
439 #.FN_FTR Progress-UUIE
440   /* Add to packet info */
441   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
442   if (h225_pi != NULL) {
443     h225_pi->cs_type = H225_PROGRESS;
444     if (contains_faststart) {
445       char temp[50];
446       snprintf(temp, 50, "%s OLC (%s)", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"), h225_pi->frame_label);
447       (void) g_strlcpy(h225_pi->frame_label, temp, 50);
448     } else
449       snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
450   }
451 #.END
452 #----------------------------------------------------------------------------------------
453 #.FN_HDR SetupAcknowledge-UUIE
454   h225_packet_info* h225_pi;
455 #.END
456 #----------------------------------------------------------------------------------------
457 #.FN_FTR SetupAcknowledge-UUIE
458   /* Add to packet info */
459   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
460   if (h225_pi != NULL) {
461     h225_pi->cs_type = H225_SETUP_ACK;
462     snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
463   }
464 #.END
465 #----------------------------------------------------------------------------------------
466 #.FN_HDR Facility-UUIE
467   h225_packet_info* h225_pi;
468 #.END
469 #----------------------------------------------------------------------------------------
470 #.FN_FTR Facility-UUIE
471   /* Add to packet info */
472   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
473   if (h225_pi != NULL) {
474     h225_pi->cs_type = H225_FACILITY;
475     snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
476   }
477 #.END
478 #----------------------------------------------------------------------------------------
479 #.FN_HDR H323-UU-PDU/h245Tunnelling
480   h225_packet_info* h225_pi;
481   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
482   if (h225_pi != NULL) {
483 #.END
484 #----------------------------------------------------------------------------------------
485 #.FN_PARS H323-UU-PDU/h245Tunnelling  VAL_PTR = &(h225_pi->is_h245Tunneling)
486 #----------------------------------------------------------------------------------------
487 #.FN_FTR H323-UU-PDU/h245Tunnelling
488   }
489 #.END
490 #----------------------------------------------------------------------------------------
491 #.FN_HDR Setup-UUIE
492   h225_packet_info* h225_pi;
493   contains_faststart = false;
494 #.END
495 #----------------------------------------------------------------------------------------
496 #.FN_FTR Setup-UUIE
497   /* Add to packet info */
498   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
499   if (h225_pi != NULL) {
500     h225_pi->cs_type = H225_SETUP;
501     if (contains_faststart) {
502       char temp[50];
503       snprintf(temp, 50, "%s OLC (%s)", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"), h225_pi->frame_label);
504       (void) g_strlcpy(h225_pi->frame_label, temp, 50);
505     } else
506       snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
507   }
508 #.END
509 #----------------------------------------------------------------------------------------
510 #.FN_HDR CallProceeding-UUIE
511   h225_packet_info* h225_pi;
512 #.END
513 #----------------------------------------------------------------------------------------
514 #.FN_FTR CallProceeding-UUIE
515   /* Add to packet info */
516   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
517   if (h225_pi != NULL) {
518     h225_pi->cs_type = H225_CALL_PROCEDING;
519     if (contains_faststart) {
520       char temp[50];
521       snprintf(temp, 50, "%s OLC (%s)", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"), h225_pi->frame_label);
522       (void) g_strlcpy(h225_pi->frame_label, temp, 50);
523     } else
524       snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
525   }
526 #.END
527 #----------------------------------------------------------------------------------------
528 #.FN_HDR Alerting-UUIE
529   h225_packet_info* h225_pi;
530 #.END
531 #----------------------------------------------------------------------------------------
532 #.FN_FTR Alerting-UUIE
533   /* Add to packet info */
534   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
535   if (h225_pi != NULL) {
536     h225_pi->cs_type = H225_ALERTING;
537     if (contains_faststart) {
538       char temp[50];
539       snprintf(temp, 50, "%s OLC (%s)", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"), h225_pi->frame_label);
540       (void) g_strlcpy(h225_pi->frame_label, temp, 50);
541     } else
542       snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
543   }
544 #.END
545 #----------------------------------------------------------------------------------------
546 #.FN_HDR ReleaseComplete-UUIE
547   h225_packet_info* h225_pi;
548 #.END
549 #----------------------------------------------------------------------------------------
550 #.FN_FTR ReleaseComplete-UUIE
551   /* Add to packet info */
552   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
553   if (h225_pi != NULL) {
554     h225_pi->cs_type = H225_RELEASE_COMPLET;
555     snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
556   }
557 #.END
558 #----------------------------------------------------------------------------------------
559 #.FN_HDR Connect-UUIE
560   h225_packet_info* h225_pi;
561 #.END
562 #----------------------------------------------------------------------------------------
563 #.FN_FTR Connect-UUIE
564   /* Add to packet info */
565   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
566   if (h225_pi != NULL) {
567     h225_pi->cs_type = H225_CONNECT;
568     if (contains_faststart) {
569       char temp[50];
570       snprintf(temp, 50, "%s OLC (%s)", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"), h225_pi->frame_label);
571       (void) g_strlcpy(h225_pi->frame_label, temp, 50);
572     } else
573       snprintf(h225_pi->frame_label, 50, "%s", val_to_str_const(h225_pi->cs_type, T_h323_message_body_vals, "<unknown>"));
574   }
575 #.END
576 #----------------------------------------------------------------------------------------
577 #.FN_HDR H245TransportAddress
578   h225_packet_info* h225_pi;
579   ipv4_address=0;
580   ipv6_address = ipv6_address_zeros;
581   ip_port=0;
583 #.END
584 #----------------------------------------------------------------------------------------
585 #.FN_FTR H245TransportAddress
586   /* we need this info for TAPing */
587   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
589   if (h225_pi) {
590     h225_pi->is_h245 = true;
591     h225_pi->h245_address = ipv4_address;
592     h225_pi->h245_port = ip_port;
593   }
594   if ( !actx->pinfo->fd->visited && h245_handle && ip_port!=0 ) {
595     address src_addr;
596     conversation_t *conv=NULL;
598     if (ipv4_address!=0) {
599       set_address(&src_addr, AT_IPv4, 4, &ipv4_address);
600     } else if (memcmp(ipv6_address.bytes, ipv6_address_zeros.bytes, sizeof(ipv6_address.bytes))!=0) {
601       set_address(&src_addr, AT_IPv6, 16, ipv6_address.bytes);
602     } else {
603       return offset;
604     }
606     conv=find_conversation(actx->pinfo->num, &src_addr, &src_addr, CONVERSATION_TCP, ip_port, ip_port, NO_ADDR_B|NO_PORT_B);
607     if(!conv){
608       conv=conversation_new(actx->pinfo->num, &src_addr, &src_addr, CONVERSATION_TCP, ip_port, ip_port, NO_ADDR2|NO_PORT2);
609       conversation_set_dissector(conv, h245_handle);
610     }
611   }
612 #.END
613 #----------------------------------------------------------------------------------------
614 #.FN_BODY FacilityReason  VAL_PTR = &value
615   int32_t value;
616   h225_packet_info* h225_pi;
617   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
619 %(DEFAULT_BODY)s
620   if (h225_pi != NULL) {
621     h225_pi->reason = value;
622   }
623 #.END
624 #----------------------------------------------------------------------------------------
625 #.FN_BODY GatekeeperRejectReason  VAL_PTR = &value
626   int32_t value;
627   h225_packet_info* h225_pi;
628   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
630 %(DEFAULT_BODY)s
631   if (h225_pi != NULL) {
632     h225_pi->reason = value;
633   }
634 #.END
635 #----------------------------------------------------------------------------------------
636 #.FN_BODY UnregRequestReason  VAL_PTR = &value
637   int32_t value;
638   h225_packet_info* h225_pi;
639   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
641 %(DEFAULT_BODY)s
642   if (h225_pi != NULL) {
643     h225_pi->reason = value;
644   }
645 #.END
646 #----------------------------------------------------------------------------------------
647 #.FN_BODY UnregRejectReason  VAL_PTR = &value
648   int32_t value;
649   h225_packet_info* h225_pi;
650   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
652 %(DEFAULT_BODY)s
653   if (h225_pi != NULL) {
654     h225_pi->reason = value;
655   }
656 #.END
657 #----------------------------------------------------------------------------------------
658 #.FN_BODY BandRejectReason  VAL_PTR = &value
659   int32_t value;
660   h225_packet_info* h225_pi;
661   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
663 %(DEFAULT_BODY)s
664   if (h225_pi != NULL) {
665     h225_pi->reason = value;
666   }
667 #.END
668 #----------------------------------------------------------------------------------------
669 #.FN_BODY DisengageReason  VAL_PTR = &value
670   int32_t value;
671   h225_packet_info* h225_pi;
672   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
674 %(DEFAULT_BODY)s
675   if (h225_pi != NULL) {
676     h225_pi->reason = value;
677   }
678 #----------------------------------------------------------------------------------------
679 #.FN_BODY DisengageRejectReason  VAL_PTR = &value
680   int32_t value;
681   h225_packet_info* h225_pi;
682   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
684 %(DEFAULT_BODY)s
685   if (h225_pi != NULL) {
686     h225_pi->reason = value;
687   }
688 #.END
689 #----------------------------------------------------------------------------------------
690 #.FN_BODY AdmissionRejectReason  VAL_PTR = &value
691   int32_t value;
692   h225_packet_info* h225_pi;
693   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
695 %(DEFAULT_BODY)s
696   if (h225_pi != NULL) {
697     h225_pi->reason = value;
698   }
699 #.END
700 #----------------------------------------------------------------------------------------
701 #.FN_BODY LocationRejectReason  VAL_PTR = &value
702   int32_t value;
703   h225_packet_info* h225_pi;
704   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
706 %(DEFAULT_BODY)s
707   if (h225_pi != NULL) {
708     h225_pi->reason = value;
709   }
710 #.END
711 #----------------------------------------------------------------------------------------
712 #.FN_BODY RegistrationRejectReason  VAL_PTR = &value
713   int32_t value;
714   h225_packet_info* h225_pi;
715   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
717 %(DEFAULT_BODY)s
718   if (h225_pi != NULL) {
719     h225_pi->reason = value;
720   }
721 #.END
722 #----------------------------------------------------------------------------------------
723 #.FN_BODY InfoRequestNakReason  VAL_PTR = &value
724   int32_t value;
725   h225_packet_info* h225_pi;
726   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
728 %(DEFAULT_BODY)s
729   if (h225_pi != NULL) {
730     h225_pi->reason = value;
731   }
732 #.END
733 #----------------------------------------------------------------------------------------
734 #.FN_BODY ReleaseCompleteReason  VAL_PTR = &value
735   int32_t value;
736   h225_packet_info* h225_pi;
737   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
739 %(DEFAULT_BODY)s
740   if (h225_pi != NULL) {
741     h225_pi->reason = value;
742   }
743 #.END
744 #----------------------------------------------------------------------------------------
745 #.FN_BODY CallIdentifier/guid
746   tvbuff_t *guid_tvb = NULL;
748   actx->value_ptr = &guid_tvb;
749 %(DEFAULT_BODY)s
750   if (guid_tvb)
751     tvb_get_ntohguid(guid_tvb, 0, call_id_guid = wmem_new(actx->pinfo->pool, e_guid_t));
752   actx->value_ptr = NULL;
753 #.END
754 #----------------------------------------------------------------------------------------
755 #.FN_PARS GloballyUniqueID  VAL_PTR = (tvbuff_t **)actx->value_ptr
756 #----------------------------------------------------------------------------------------
757 #.FN_HDR RequestSeqNum
758   h225_packet_info* h225_pi;
759   h225_pi = (h225_packet_info*)p_get_proto_data(actx->pinfo->pool, actx->pinfo, proto_h225, 0);
760   if (h225_pi != NULL) {
761 #.END
762 #----------------------------------------------------------------------------------------
763 #.FN_PARS RequestSeqNum  VAL_PTR = &(h225_pi->requestSeqNum)
764 #----------------------------------------------------------------------------------------
765 #.FN_FTR RequestSeqNum
766   }
767 #.END
768 #----------------------------------------------------------------------------------------
769 #.FN_BODY H323-UU-PDU/h4501SupplementaryService/_item  VAL_PTR = &h4501_tvb
770   tvbuff_t *h4501_tvb = NULL;
772 %(DEFAULT_BODY)s
773   if (h4501_tvb && tvb_reported_length(h4501_tvb)) {
774     call_dissector(h4501_handle, h4501_tvb, actx->pinfo, tree);
775   }
776 #.END
777 #----------------------------------------------------------------------------------------
779 #--- TunnelledProtocol ------------------------------------------------------------------
781 #.FN_HDR TunnelledProtocol
782   tpOID = "";
783 #.FN_FTR TunnelledProtocol
784   tp_handle = dissector_get_string_handle(tp_dissector_table, tpOID);
785 #.FN_PARS TunnelledProtocol/id/tunnelledProtocolObjectID
786   FN_VARIANT = _str  VAL_PTR = &tpOID
787 #.END
789 #.FN_HDR H323-UU-PDU/tunnelledSignallingMessage
790   tp_handle = NULL;
791 #.FN_BODY H323-UU-PDU/tunnelledSignallingMessage/messageContent/_item  VAL_PTR = &next_tvb
792   tvbuff_t *next_tvb = NULL;
794 %(DEFAULT_BODY)s
795   next_tvb_add_handle(tp_list, next_tvb, (h225_tp_in_tree)?tree:NULL, tp_handle);
796 #.END
798 #--- NonStandardParameter ---------------------------------------------------------------
800 #.FN_PARS
801 NonStandardIdentifier/object  FN_VARIANT = _str  VAL_PTR = &nsiOID
802 #.END
804 #.FN_BODY NonStandardIdentifier  VAL_PTR = &value
805   int32_t value;
807   nsiOID = "";
808   h221NonStandard = 0;
810 %(DEFAULT_BODY)s
811   switch (value) {
812     case 0 :  /* object */
813       nsp_handle = dissector_get_string_handle(nsp_object_dissector_table, nsiOID);
814       break;
815     case 1 :  /* h221NonStandard */
816       nsp_handle = dissector_get_uint_handle(nsp_h221_dissector_table, h221NonStandard);
817       break;
818     default :
819       nsp_handle = NULL;
820     }
821 #.END
823 #.FN_HDR H221NonStandard
824   t35CountryCode = 0;
825   t35Extension = 0;
826   manufacturerCode = 0;
827 #.FN_FTR H221NonStandard
828   h221NonStandard = ((t35CountryCode * 256) + t35Extension) * 65536 + manufacturerCode;
829   proto_tree_add_uint(tree, hf_h221Manufacturer, tvb, (offset>>3)-4, 4, h221NonStandard);
830 #.FN_PARS
831 H221NonStandard/t35CountryCode    VAL_PTR = &t35CountryCode
832 H221NonStandard/t35Extension      VAL_PTR = &t35Extension
833 H221NonStandard/manufacturerCode  VAL_PTR = &manufacturerCode
834 #.END
836 #.FN_HDR NonStandardParameter
837   nsp_handle = NULL;
838 #.FN_BODY NonStandardParameter/data  VAL_PTR = &next_tvb
839   tvbuff_t *next_tvb = NULL;
841 %(DEFAULT_BODY)s
842   if (next_tvb && tvb_reported_length(next_tvb)) {
843     call_dissector((nsp_handle)?nsp_handle:data_handle, next_tvb, actx->pinfo, tree);
844   }
845 #.END
847 #=== Generic Extensible Framework =======================================================
849 #.FN_HDR GenericData
850   void *priv_data = actx->private_data;
851   gef_ctx_t *gefx;
853   /* check if not inherited from FeatureDescriptor */
854   gefx = gef_ctx_get(actx->private_data);
855   if (!gefx) {
856     gefx = gef_ctx_alloc(actx->pinfo->pool, NULL, "GenericData");
857     actx->private_data = gefx;
858   }
859 #.FN_FTR
860   actx->private_data = priv_data;
861 #.END
863 #.FN_HDR EnumeratedParameter
864   gef_ctx_t *parent_gefx;
866   parent_gefx = gef_ctx_get(actx->private_data);
867   actx->private_data = gef_ctx_alloc(actx->pinfo->pool, parent_gefx, NULL);
868 #.FN_FTR
869   actx->private_data = parent_gefx;
870 #.END
872 #----------------------------------------------------------------------------------------
873 #.FN_HDR FeatureDescriptor
874   void *priv_data = actx->private_data;
875   actx->private_data = gef_ctx_alloc(actx->pinfo->pool, NULL, "FeatureDescriptor");
876 #.FN_FTR
877   actx->private_data = priv_data;
878 #.END
879 #----------------------------------------------------------------------------------------
881 #.FN_HDR GenericIdentifier
882   gef_ctx_t *gefx;
883   proto_item* ti;
884 #.FN_FTR
885   gef_ctx_update_key(actx->pinfo->pool, gef_ctx_get(actx->private_data));
886   gefx = gef_ctx_get(actx->private_data);
887   if (gefx) {
888     ti = proto_tree_add_string(tree, hf_h225_debug_dissector_try_string, tvb, offset>>3, 0, gefx->key);
889   proto_item_set_hidden(ti);
890     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);
891   }
892   actx->private_data = gefx;  /* subdissector could overwrite it */
893 #.END
895 #.FN_BODY GenericIdentifier/standard  VAL_PTR = &value_int
896   uint32_t value_int = (uint32_t)-1;
897   gef_ctx_t *gefx;
899 %(DEFAULT_BODY)s
900   gefx = gef_ctx_get(actx->private_data);
901   if (gefx) gefx->id = wmem_strdup_printf(actx->pinfo->pool, "%%u", value_int);
902 #.END
904 #.FN_BODY GenericIdentifier/oid  FN_VARIANT = _str  VAL_PTR = &oid_str
905   const char *oid_str = NULL;
906   gef_ctx_t *gefx;
908 %(DEFAULT_BODY)s
909   gefx = gef_ctx_get(actx->private_data);
910   if (gefx) gefx->id = oid_str;
911 #.END
913 #----------------------------------------------------------------------------------------
914 #.FN_BODY Content/raw  VAL_PTR = &value_tvb
915   tvbuff_t *value_tvb;
916   gef_ctx_t *gefx;
917   proto_item* ti;
919 %(DEFAULT_BODY)s
920   gefx = gef_ctx_get(actx->private_data);
921   if (gefx) {
922     ti = proto_tree_add_string(tree, hf_h225_debug_dissector_try_string, tvb, offset>>3, 0, gefx->key);
923   proto_item_set_hidden(ti);
924     dissector_try_string(gef_content_dissector_table, gefx->key, value_tvb, actx->pinfo, %(TREE)s, actx);
925   }
926 #.END
928 #=== end of GEF =========================================================================
930 # TBCD-STRING is additionally constrained
931 # parameter stack is used for passing this constraint
933 #.FN_HDR TBCD-STRING
934   int min_len, max_len;
935   bool has_extension;
937   get_size_constraint_from_stack(actx, "TBCD_STRING", &min_len, &max_len, &has_extension);
938 #.FN_PARS TBCD-STRING
939 MIN_VAL = min_len
940 MAX_VAL = max_len
941 EXT = has_extension
942 #.END
945 #.TYPE_ATTR
946 H221NonStandard/t35CountryCode TYPE = FT_UINT32  DISPLAY = BASE_DEC  STRINGS = VALS(T35CountryCode_vals)
947 TransportAddress/ipAddress/ip  TYPE = FT_IPv4  DISPLAY = BASE_NONE  STRINGS = NULL
948 TransportAddress/ip6Address/ip  TYPE = FT_IPv6  DISPLAY = BASE_NONE  STRINGS = NULL
949 H245TransportAddress/ipAddress/ip  TYPE = FT_IPv4  DISPLAY = BASE_NONE  STRINGS = NULL
950 H245TransportAddress/ip6Address/ip  TYPE = FT_IPv6  DISPLAY = BASE_NONE  STRINGS = NULL
951 VendorIdentifier/productId TYPE = FT_STRING DISPLAY = BASE_NONE STRINGS = NULL
952 VendorIdentifier/versionId TYPE = FT_STRING DISPLAY = BASE_NONE STRINGS = NULL
953 H323-UserInformation/user-data/protocol-discriminator TYPE = FT_UINT32 DISPLAY = BASE_DEC|BASE_EXT_STRING STRINGS = &q931_protocol_discriminator_vals_ext
954 H323-UU-PDU/tunnelledSignallingMessage/messageContent/_item  TYPE = FT_UINT32 DISPLAY = BASE_DEC
955 NonStandardParameter/data  TYPE = FT_UINT32 DISPLAY = BASE_DEC
956 FastStart/_item  TYPE = FT_UINT32 DISPLAY = BASE_DEC
957 ParallelH245Control/_item  TYPE = FT_UINT32 DISPLAY = BASE_DEC
958 H245Control/_item  TYPE = FT_UINT32 DISPLAY = BASE_DEC
959 GloballyUniqueID  TYPE = FT_GUID  DISPLAY = BASE_NONE
960 H323-UU-PDU/h4501SupplementaryService/_item  TYPE = FT_UINT32 DISPLAY = BASE_DEC
961 #.END