Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2547 lines
74 KiB

  1. /* Copyright (C) Microsoft Corporation, 1995-1999. All rights reserved. */
  2. /* ASN.1 definitions for H.323 Messages Call Setup (Q.931) */
  3. #include <windows.h>
  4. #include "q931asn.h"
  5. ASN1module_t Q931ASN_Module = NULL;
  6. static int ASN1CALL ASN1Enc_TransportAddress_ipSourceRoute_routing(ASN1encoding_t enc, TransportAddress_ipSourceRoute_routing *val);
  7. static int ASN1CALL ASN1Enc_TransportAddress_ipSourceRoute_route(ASN1encoding_t enc, PTransportAddress_ipSourceRoute_route *val);
  8. static int ASN1CALL ASN1Enc_H323_UserInformation_user_data(ASN1encoding_t enc, H323_UserInformation_user_data *val);
  9. static int ASN1CALL ASN1Enc_Setup_UUIE_conferenceGoal(ASN1encoding_t enc, Setup_UUIE_conferenceGoal *val);
  10. static int ASN1CALL ASN1Enc_Setup_UUIE_destExtraCRV(ASN1encoding_t enc, PSetup_UUIE_destExtraCRV *val);
  11. static int ASN1CALL ASN1Enc_TransportAddress_ip6Address(ASN1encoding_t enc, TransportAddress_ip6Address *val);
  12. static int ASN1CALL ASN1Enc_TransportAddress_ipxAddress(ASN1encoding_t enc, TransportAddress_ipxAddress *val);
  13. static int ASN1CALL ASN1Enc_TransportAddress_ipSourceRoute(ASN1encoding_t enc, TransportAddress_ipSourceRoute *val);
  14. static int ASN1CALL ASN1Enc_TransportAddress_ipAddress(ASN1encoding_t enc, TransportAddress_ipAddress *val);
  15. static int ASN1CALL ASN1Enc_H221NonStandard(ASN1encoding_t enc, H221NonStandard *val);
  16. static int ASN1CALL ASN1Enc_NonStandardIdentifier(ASN1encoding_t enc, NonStandardIdentifier *val);
  17. static int ASN1CALL ASN1Enc_NonStandardParameter(ASN1encoding_t enc, NonStandardParameter *val);
  18. static int ASN1CALL ASN1Enc_CallType(ASN1encoding_t enc, CallType *val);
  19. static int ASN1CALL ASN1Enc_Q954Details(ASN1encoding_t enc, Q954Details *val);
  20. static int ASN1CALL ASN1Enc_QseriesOptions(ASN1encoding_t enc, QseriesOptions *val);
  21. static int ASN1CALL ASN1Enc_H310Caps(ASN1encoding_t enc, H310Caps *val);
  22. static int ASN1CALL ASN1Enc_H320Caps(ASN1encoding_t enc, H320Caps *val);
  23. static int ASN1CALL ASN1Enc_H321Caps(ASN1encoding_t enc, H321Caps *val);
  24. static int ASN1CALL ASN1Enc_H322Caps(ASN1encoding_t enc, H322Caps *val);
  25. static int ASN1CALL ASN1Enc_H323Caps(ASN1encoding_t enc, H323Caps *val);
  26. static int ASN1CALL ASN1Enc_H324Caps(ASN1encoding_t enc, H324Caps *val);
  27. static int ASN1CALL ASN1Enc_VoiceCaps(ASN1encoding_t enc, VoiceCaps *val);
  28. static int ASN1CALL ASN1Enc_T120OnlyCaps(ASN1encoding_t enc, T120OnlyCaps *val);
  29. static int ASN1CALL ASN1Enc_McuInfo(ASN1encoding_t enc, McuInfo *val);
  30. static int ASN1CALL ASN1Enc_TerminalInfo(ASN1encoding_t enc, TerminalInfo *val);
  31. static int ASN1CALL ASN1Enc_GatekeeperInfo(ASN1encoding_t enc, GatekeeperInfo *val);
  32. static int ASN1CALL ASN1Enc_VendorIdentifier(ASN1encoding_t enc, VendorIdentifier *val);
  33. static int ASN1CALL ASN1Enc_SupportedProtocols(ASN1encoding_t enc, SupportedProtocols *val);
  34. static int ASN1CALL ASN1Enc_GatewayInfo(ASN1encoding_t enc, GatewayInfo *val);
  35. static int ASN1CALL ASN1Enc_EndpointType(ASN1encoding_t enc, EndpointType *val);
  36. static int ASN1CALL ASN1Enc_TransportAddress(ASN1encoding_t enc, TransportAddress *val);
  37. static int ASN1CALL ASN1Enc_AliasAddress(ASN1encoding_t enc, AliasAddress *val);
  38. static int ASN1CALL ASN1Enc_Setup_UUIE(ASN1encoding_t enc, Setup_UUIE *val);
  39. static int ASN1CALL ASN1Enc_CallProceeding_UUIE(ASN1encoding_t enc, CallProceeding_UUIE *val);
  40. static int ASN1CALL ASN1Enc_Connect_UUIE(ASN1encoding_t enc, Connect_UUIE *val);
  41. static int ASN1CALL ASN1Enc_Alerting_UUIE(ASN1encoding_t enc, Alerting_UUIE *val);
  42. static int ASN1CALL ASN1Enc_UI_UUIE(ASN1encoding_t enc, UI_UUIE *val);
  43. static int ASN1CALL ASN1Enc_ReleaseCompleteReason(ASN1encoding_t enc, ReleaseCompleteReason *val);
  44. static int ASN1CALL ASN1Enc_ReleaseComplete_UUIE(ASN1encoding_t enc, ReleaseComplete_UUIE *val);
  45. static int ASN1CALL ASN1Enc_FacilityReason(ASN1encoding_t enc, FacilityReason *val);
  46. static int ASN1CALL ASN1Enc_Facility_UUIE(ASN1encoding_t enc, Facility_UUIE *val);
  47. static int ASN1CALL ASN1Enc_H323_UU_PDU_h323_message_body(ASN1encoding_t enc, H323_UU_PDU_h323_message_body *val);
  48. static int ASN1CALL ASN1Enc_Facility_UUIE_alternativeAliasAddress(ASN1encoding_t enc, PFacility_UUIE_alternativeAliasAddress *val);
  49. static int ASN1CALL ASN1Enc_Setup_UUIE_destExtraCallInfo(ASN1encoding_t enc, PSetup_UUIE_destExtraCallInfo *val);
  50. static int ASN1CALL ASN1Enc_Setup_UUIE_destinationAddress(ASN1encoding_t enc, PSetup_UUIE_destinationAddress *val);
  51. static int ASN1CALL ASN1Enc_Setup_UUIE_sourceAddress(ASN1encoding_t enc, PSetup_UUIE_sourceAddress *val);
  52. static int ASN1CALL ASN1Enc_GatewayInfo_protocol(ASN1encoding_t enc, PGatewayInfo_protocol *val);
  53. static int ASN1CALL ASN1Enc_H323_UU_PDU(ASN1encoding_t enc, H323_UU_PDU *val);
  54. static int ASN1CALL ASN1Enc_H323_UserInformation(ASN1encoding_t enc, H323_UserInformation *val);
  55. static int ASN1CALL ASN1Dec_TransportAddress_ipSourceRoute_routing(ASN1decoding_t dec, TransportAddress_ipSourceRoute_routing *val);
  56. static int ASN1CALL ASN1Dec_TransportAddress_ipSourceRoute_route(ASN1decoding_t dec, PTransportAddress_ipSourceRoute_route *val);
  57. static int ASN1CALL ASN1Dec_H323_UserInformation_user_data(ASN1decoding_t dec, H323_UserInformation_user_data *val);
  58. static int ASN1CALL ASN1Dec_Setup_UUIE_conferenceGoal(ASN1decoding_t dec, Setup_UUIE_conferenceGoal *val);
  59. static int ASN1CALL ASN1Dec_Setup_UUIE_destExtraCRV(ASN1decoding_t dec, PSetup_UUIE_destExtraCRV *val);
  60. static int ASN1CALL ASN1Dec_TransportAddress_ip6Address(ASN1decoding_t dec, TransportAddress_ip6Address *val);
  61. static int ASN1CALL ASN1Dec_TransportAddress_ipxAddress(ASN1decoding_t dec, TransportAddress_ipxAddress *val);
  62. static int ASN1CALL ASN1Dec_TransportAddress_ipSourceRoute(ASN1decoding_t dec, TransportAddress_ipSourceRoute *val);
  63. static int ASN1CALL ASN1Dec_TransportAddress_ipAddress(ASN1decoding_t dec, TransportAddress_ipAddress *val);
  64. static int ASN1CALL ASN1Dec_H221NonStandard(ASN1decoding_t dec, H221NonStandard *val);
  65. static int ASN1CALL ASN1Dec_NonStandardIdentifier(ASN1decoding_t dec, NonStandardIdentifier *val);
  66. static int ASN1CALL ASN1Dec_NonStandardParameter(ASN1decoding_t dec, NonStandardParameter *val);
  67. static int ASN1CALL ASN1Dec_CallType(ASN1decoding_t dec, CallType *val);
  68. static int ASN1CALL ASN1Dec_Q954Details(ASN1decoding_t dec, Q954Details *val);
  69. static int ASN1CALL ASN1Dec_QseriesOptions(ASN1decoding_t dec, QseriesOptions *val);
  70. static int ASN1CALL ASN1Dec_H310Caps(ASN1decoding_t dec, H310Caps *val);
  71. static int ASN1CALL ASN1Dec_H320Caps(ASN1decoding_t dec, H320Caps *val);
  72. static int ASN1CALL ASN1Dec_H321Caps(ASN1decoding_t dec, H321Caps *val);
  73. static int ASN1CALL ASN1Dec_H322Caps(ASN1decoding_t dec, H322Caps *val);
  74. static int ASN1CALL ASN1Dec_H323Caps(ASN1decoding_t dec, H323Caps *val);
  75. static int ASN1CALL ASN1Dec_H324Caps(ASN1decoding_t dec, H324Caps *val);
  76. static int ASN1CALL ASN1Dec_VoiceCaps(ASN1decoding_t dec, VoiceCaps *val);
  77. static int ASN1CALL ASN1Dec_T120OnlyCaps(ASN1decoding_t dec, T120OnlyCaps *val);
  78. static int ASN1CALL ASN1Dec_McuInfo(ASN1decoding_t dec, McuInfo *val);
  79. static int ASN1CALL ASN1Dec_TerminalInfo(ASN1decoding_t dec, TerminalInfo *val);
  80. static int ASN1CALL ASN1Dec_GatekeeperInfo(ASN1decoding_t dec, GatekeeperInfo *val);
  81. static int ASN1CALL ASN1Dec_VendorIdentifier(ASN1decoding_t dec, VendorIdentifier *val);
  82. static int ASN1CALL ASN1Dec_SupportedProtocols(ASN1decoding_t dec, SupportedProtocols *val);
  83. static int ASN1CALL ASN1Dec_GatewayInfo(ASN1decoding_t dec, GatewayInfo *val);
  84. static int ASN1CALL ASN1Dec_EndpointType(ASN1decoding_t dec, EndpointType *val);
  85. static int ASN1CALL ASN1Dec_TransportAddress(ASN1decoding_t dec, TransportAddress *val);
  86. static int ASN1CALL ASN1Dec_AliasAddress(ASN1decoding_t dec, AliasAddress *val);
  87. static int ASN1CALL ASN1Dec_Setup_UUIE(ASN1decoding_t dec, Setup_UUIE *val);
  88. static int ASN1CALL ASN1Dec_CallProceeding_UUIE(ASN1decoding_t dec, CallProceeding_UUIE *val);
  89. static int ASN1CALL ASN1Dec_Connect_UUIE(ASN1decoding_t dec, Connect_UUIE *val);
  90. static int ASN1CALL ASN1Dec_Alerting_UUIE(ASN1decoding_t dec, Alerting_UUIE *val);
  91. static int ASN1CALL ASN1Dec_UI_UUIE(ASN1decoding_t dec, UI_UUIE *val);
  92. static int ASN1CALL ASN1Dec_ReleaseCompleteReason(ASN1decoding_t dec, ReleaseCompleteReason *val);
  93. static int ASN1CALL ASN1Dec_ReleaseComplete_UUIE(ASN1decoding_t dec, ReleaseComplete_UUIE *val);
  94. static int ASN1CALL ASN1Dec_FacilityReason(ASN1decoding_t dec, FacilityReason *val);
  95. static int ASN1CALL ASN1Dec_Facility_UUIE(ASN1decoding_t dec, Facility_UUIE *val);
  96. static int ASN1CALL ASN1Dec_H323_UU_PDU_h323_message_body(ASN1decoding_t dec, H323_UU_PDU_h323_message_body *val);
  97. static int ASN1CALL ASN1Dec_Facility_UUIE_alternativeAliasAddress(ASN1decoding_t dec, PFacility_UUIE_alternativeAliasAddress *val);
  98. static int ASN1CALL ASN1Dec_Setup_UUIE_destExtraCallInfo(ASN1decoding_t dec, PSetup_UUIE_destExtraCallInfo *val);
  99. static int ASN1CALL ASN1Dec_Setup_UUIE_destinationAddress(ASN1decoding_t dec, PSetup_UUIE_destinationAddress *val);
  100. static int ASN1CALL ASN1Dec_Setup_UUIE_sourceAddress(ASN1decoding_t dec, PSetup_UUIE_sourceAddress *val);
  101. static int ASN1CALL ASN1Dec_GatewayInfo_protocol(ASN1decoding_t dec, PGatewayInfo_protocol *val);
  102. static int ASN1CALL ASN1Dec_H323_UU_PDU(ASN1decoding_t dec, H323_UU_PDU *val);
  103. static int ASN1CALL ASN1Dec_H323_UserInformation(ASN1decoding_t dec, H323_UserInformation *val);
  104. static void ASN1CALL ASN1Free_TransportAddress_ipSourceRoute_route(PTransportAddress_ipSourceRoute_route *val);
  105. static void ASN1CALL ASN1Free_H323_UserInformation_user_data(H323_UserInformation_user_data *val);
  106. static void ASN1CALL ASN1Free_Setup_UUIE_destExtraCRV(PSetup_UUIE_destExtraCRV *val);
  107. static void ASN1CALL ASN1Free_TransportAddress_ip6Address(TransportAddress_ip6Address *val);
  108. static void ASN1CALL ASN1Free_TransportAddress_ipxAddress(TransportAddress_ipxAddress *val);
  109. static void ASN1CALL ASN1Free_TransportAddress_ipSourceRoute(TransportAddress_ipSourceRoute *val);
  110. static void ASN1CALL ASN1Free_TransportAddress_ipAddress(TransportAddress_ipAddress *val);
  111. static void ASN1CALL ASN1Free_NonStandardIdentifier(NonStandardIdentifier *val);
  112. static void ASN1CALL ASN1Free_NonStandardParameter(NonStandardParameter *val);
  113. static void ASN1CALL ASN1Free_H310Caps(H310Caps *val);
  114. static void ASN1CALL ASN1Free_H320Caps(H320Caps *val);
  115. static void ASN1CALL ASN1Free_H321Caps(H321Caps *val);
  116. static void ASN1CALL ASN1Free_H322Caps(H322Caps *val);
  117. static void ASN1CALL ASN1Free_H323Caps(H323Caps *val);
  118. static void ASN1CALL ASN1Free_H324Caps(H324Caps *val);
  119. static void ASN1CALL ASN1Free_VoiceCaps(VoiceCaps *val);
  120. static void ASN1CALL ASN1Free_T120OnlyCaps(T120OnlyCaps *val);
  121. static void ASN1CALL ASN1Free_McuInfo(McuInfo *val);
  122. static void ASN1CALL ASN1Free_TerminalInfo(TerminalInfo *val);
  123. static void ASN1CALL ASN1Free_GatekeeperInfo(GatekeeperInfo *val);
  124. static void ASN1CALL ASN1Free_VendorIdentifier(VendorIdentifier *val);
  125. static void ASN1CALL ASN1Free_SupportedProtocols(SupportedProtocols *val);
  126. static void ASN1CALL ASN1Free_GatewayInfo(GatewayInfo *val);
  127. static void ASN1CALL ASN1Free_EndpointType(EndpointType *val);
  128. static void ASN1CALL ASN1Free_TransportAddress(TransportAddress *val);
  129. static void ASN1CALL ASN1Free_AliasAddress(AliasAddress *val);
  130. static void ASN1CALL ASN1Free_Setup_UUIE(Setup_UUIE *val);
  131. static void ASN1CALL ASN1Free_CallProceeding_UUIE(CallProceeding_UUIE *val);
  132. static void ASN1CALL ASN1Free_Connect_UUIE(Connect_UUIE *val);
  133. static void ASN1CALL ASN1Free_Alerting_UUIE(Alerting_UUIE *val);
  134. static void ASN1CALL ASN1Free_UI_UUIE(UI_UUIE *val);
  135. static void ASN1CALL ASN1Free_ReleaseComplete_UUIE(ReleaseComplete_UUIE *val);
  136. static void ASN1CALL ASN1Free_Facility_UUIE(Facility_UUIE *val);
  137. static void ASN1CALL ASN1Free_H323_UU_PDU_h323_message_body(H323_UU_PDU_h323_message_body *val);
  138. static void ASN1CALL ASN1Free_Facility_UUIE_alternativeAliasAddress(PFacility_UUIE_alternativeAliasAddress *val);
  139. static void ASN1CALL ASN1Free_Setup_UUIE_destExtraCallInfo(PSetup_UUIE_destExtraCallInfo *val);
  140. static void ASN1CALL ASN1Free_Setup_UUIE_destinationAddress(PSetup_UUIE_destinationAddress *val);
  141. static void ASN1CALL ASN1Free_Setup_UUIE_sourceAddress(PSetup_UUIE_sourceAddress *val);
  142. static void ASN1CALL ASN1Free_GatewayInfo_protocol(PGatewayInfo_protocol *val);
  143. static void ASN1CALL ASN1Free_H323_UU_PDU(H323_UU_PDU *val);
  144. static void ASN1CALL ASN1Free_H323_UserInformation(H323_UserInformation *val);
  145. typedef ASN1PerEncFun_t ASN1EncFun_t;
  146. static const ASN1EncFun_t encfntab[1] = {
  147. (ASN1EncFun_t) ASN1Enc_H323_UserInformation,
  148. };
  149. typedef ASN1PerDecFun_t ASN1DecFun_t;
  150. static const ASN1DecFun_t decfntab[1] = {
  151. (ASN1DecFun_t) ASN1Dec_H323_UserInformation,
  152. };
  153. static const ASN1FreeFun_t freefntab[1] = {
  154. (ASN1FreeFun_t) ASN1Free_H323_UserInformation,
  155. };
  156. static const ULONG sizetab[1] = {
  157. SIZE_Q931ASN_Module_PDU_0,
  158. };
  159. /* forward declarations of values: */
  160. /* definitions of value components: */
  161. /* definitions of values: */
  162. void ASN1CALL Q931ASN_Module_Startup(void)
  163. {
  164. Q931ASN_Module = ASN1_CreateModule(0x10000, ASN1_PER_RULE_ALIGNED, ASN1FLAGS_NONE, 1, (const ASN1GenericFun_t *) encfntab, (const ASN1GenericFun_t *) decfntab, freefntab, sizetab, 0x31333971);
  165. }
  166. void ASN1CALL Q931ASN_Module_Cleanup(void)
  167. {
  168. ASN1_CloseModule(Q931ASN_Module);
  169. Q931ASN_Module = NULL;
  170. }
  171. static int ASN1CALL ASN1Enc_TransportAddress_ipSourceRoute_routing(ASN1encoding_t enc, TransportAddress_ipSourceRoute_routing *val)
  172. {
  173. if (!ASN1PEREncSimpleChoiceEx(enc, (val)->choice, 1))
  174. return 0;
  175. return 1;
  176. }
  177. static int ASN1CALL ASN1Dec_TransportAddress_ipSourceRoute_routing(ASN1decoding_t dec, TransportAddress_ipSourceRoute_routing *val)
  178. {
  179. if (!ASN1PERDecSimpleChoiceEx(dec, &(val)->choice, 1))
  180. return 0;
  181. return 1;
  182. }
  183. static int ASN1CALL ASN1Enc_TransportAddress_ipSourceRoute_route(ASN1encoding_t enc, PTransportAddress_ipSourceRoute_route *val)
  184. {
  185. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_TransportAddress_ipSourceRoute_route_ElmFn);
  186. }
  187. static int ASN1CALL ASN1Enc_TransportAddress_ipSourceRoute_route_ElmFn(ASN1encoding_t enc, PTransportAddress_ipSourceRoute_route val)
  188. {
  189. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &val->value, 4))
  190. return 0;
  191. return 1;
  192. }
  193. static int ASN1CALL ASN1Dec_TransportAddress_ipSourceRoute_route(ASN1decoding_t dec, PTransportAddress_ipSourceRoute_route *val)
  194. {
  195. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_TransportAddress_ipSourceRoute_route_ElmFn, sizeof(**val));
  196. }
  197. static int ASN1CALL ASN1Dec_TransportAddress_ipSourceRoute_route_ElmFn(ASN1decoding_t dec, PTransportAddress_ipSourceRoute_route val)
  198. {
  199. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &val->value, 4))
  200. return 0;
  201. return 1;
  202. }
  203. static void ASN1CALL ASN1Free_TransportAddress_ipSourceRoute_route(PTransportAddress_ipSourceRoute_route *val)
  204. {
  205. if (val) {
  206. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_TransportAddress_ipSourceRoute_route_ElmFn);
  207. }
  208. }
  209. static void ASN1CALL ASN1Free_TransportAddress_ipSourceRoute_route_ElmFn(PTransportAddress_ipSourceRoute_route val)
  210. {
  211. if (val) {
  212. }
  213. }
  214. static int ASN1CALL ASN1Enc_H323_UserInformation_user_data(ASN1encoding_t enc, H323_UserInformation_user_data *val)
  215. {
  216. if (!ASN1PEREncExtensionBitClear(enc))
  217. return 0;
  218. ASN1PEREncAlignment(enc);
  219. if (!ASN1PEREncBitVal(enc, 8, (val)->protocol_discriminator))
  220. return 0;
  221. if (!ASN1PEREncOctetString_VarSize(enc, (ASN1octetstring2_t *) &(val)->user_information, 1, 131, 8))
  222. return 0;
  223. return 1;
  224. }
  225. static int ASN1CALL ASN1Dec_H323_UserInformation_user_data(ASN1decoding_t dec, H323_UserInformation_user_data *val)
  226. {
  227. ASN1uint32_t y;
  228. if (!ASN1PERDecExtensionBit(dec, &y))
  229. return 0;
  230. ASN1PERDecAlignment(dec);
  231. if (!ASN1PERDecU16Val(dec, 8, &(val)->protocol_discriminator))
  232. return 0;
  233. if (!ASN1PERDecOctetString_VarSize(dec, (ASN1octetstring2_t *) &(val)->user_information, 1, 131, 8))
  234. return 0;
  235. if (y) {
  236. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  237. return 0;
  238. }
  239. return 1;
  240. }
  241. static void ASN1CALL ASN1Free_H323_UserInformation_user_data(H323_UserInformation_user_data *val)
  242. {
  243. if (val) {
  244. }
  245. }
  246. static int ASN1CALL ASN1Enc_Setup_UUIE_conferenceGoal(ASN1encoding_t enc, Setup_UUIE_conferenceGoal *val)
  247. {
  248. if (!ASN1PEREncSimpleChoiceEx(enc, (val)->choice, 2))
  249. return 0;
  250. return 1;
  251. }
  252. static int ASN1CALL ASN1Dec_Setup_UUIE_conferenceGoal(ASN1decoding_t dec, Setup_UUIE_conferenceGoal *val)
  253. {
  254. if (!ASN1PERDecSimpleChoiceEx(dec, &(val)->choice, 2))
  255. return 0;
  256. return 1;
  257. }
  258. static int ASN1CALL ASN1Enc_Setup_UUIE_destExtraCRV(ASN1encoding_t enc, PSetup_UUIE_destExtraCRV *val)
  259. {
  260. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_Setup_UUIE_destExtraCRV_ElmFn);
  261. }
  262. static int ASN1CALL ASN1Enc_Setup_UUIE_destExtraCRV_ElmFn(ASN1encoding_t enc, PSetup_UUIE_destExtraCRV val)
  263. {
  264. if (!ASN1PEREncUnsignedShort(enc, val->value - 1))
  265. return 0;
  266. return 1;
  267. }
  268. static int ASN1CALL ASN1Dec_Setup_UUIE_destExtraCRV(ASN1decoding_t dec, PSetup_UUIE_destExtraCRV *val)
  269. {
  270. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_Setup_UUIE_destExtraCRV_ElmFn, sizeof(**val));
  271. }
  272. static int ASN1CALL ASN1Dec_Setup_UUIE_destExtraCRV_ElmFn(ASN1decoding_t dec, PSetup_UUIE_destExtraCRV val)
  273. {
  274. if (!ASN1PERDecUnsignedShort(dec, &val->value))
  275. return 0;
  276. val->value += 1;
  277. return 1;
  278. }
  279. static void ASN1CALL ASN1Free_Setup_UUIE_destExtraCRV(PSetup_UUIE_destExtraCRV *val)
  280. {
  281. if (val) {
  282. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_Setup_UUIE_destExtraCRV_ElmFn);
  283. }
  284. }
  285. static void ASN1CALL ASN1Free_Setup_UUIE_destExtraCRV_ElmFn(PSetup_UUIE_destExtraCRV val)
  286. {
  287. if (val) {
  288. }
  289. }
  290. static int ASN1CALL ASN1Enc_TransportAddress_ip6Address(ASN1encoding_t enc, TransportAddress_ip6Address *val)
  291. {
  292. if (!ASN1PEREncExtensionBitClear(enc))
  293. return 0;
  294. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &(val)->ip, 16))
  295. return 0;
  296. if (!ASN1PEREncUnsignedShort(enc, (val)->port))
  297. return 0;
  298. return 1;
  299. }
  300. static int ASN1CALL ASN1Dec_TransportAddress_ip6Address(ASN1decoding_t dec, TransportAddress_ip6Address *val)
  301. {
  302. ASN1uint32_t y;
  303. if (!ASN1PERDecExtensionBit(dec, &y))
  304. return 0;
  305. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &(val)->ip, 16))
  306. return 0;
  307. if (!ASN1PERDecUnsignedShort(dec, &(val)->port))
  308. return 0;
  309. if (y) {
  310. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  311. return 0;
  312. }
  313. return 1;
  314. }
  315. static void ASN1CALL ASN1Free_TransportAddress_ip6Address(TransportAddress_ip6Address *val)
  316. {
  317. if (val) {
  318. }
  319. }
  320. static int ASN1CALL ASN1Enc_TransportAddress_ipxAddress(ASN1encoding_t enc, TransportAddress_ipxAddress *val)
  321. {
  322. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &(val)->node, 6))
  323. return 0;
  324. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &(val)->netnum, 4))
  325. return 0;
  326. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &(val)->port, 2))
  327. return 0;
  328. return 1;
  329. }
  330. static int ASN1CALL ASN1Dec_TransportAddress_ipxAddress(ASN1decoding_t dec, TransportAddress_ipxAddress *val)
  331. {
  332. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &(val)->node, 6))
  333. return 0;
  334. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &(val)->netnum, 4))
  335. return 0;
  336. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &(val)->port, 2))
  337. return 0;
  338. return 1;
  339. }
  340. static void ASN1CALL ASN1Free_TransportAddress_ipxAddress(TransportAddress_ipxAddress *val)
  341. {
  342. if (val) {
  343. }
  344. }
  345. static int ASN1CALL ASN1Enc_TransportAddress_ipSourceRoute(ASN1encoding_t enc, TransportAddress_ipSourceRoute *val)
  346. {
  347. if (!ASN1PEREncExtensionBitClear(enc))
  348. return 0;
  349. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &(val)->ip, 4))
  350. return 0;
  351. if (!ASN1PEREncUnsignedShort(enc, (val)->port))
  352. return 0;
  353. if (!ASN1Enc_TransportAddress_ipSourceRoute_route(enc, &(val)->route))
  354. return 0;
  355. if (!ASN1Enc_TransportAddress_ipSourceRoute_routing(enc, &(val)->routing))
  356. return 0;
  357. return 1;
  358. }
  359. static int ASN1CALL ASN1Dec_TransportAddress_ipSourceRoute(ASN1decoding_t dec, TransportAddress_ipSourceRoute *val)
  360. {
  361. ASN1uint32_t y;
  362. if (!ASN1PERDecExtensionBit(dec, &y))
  363. return 0;
  364. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &(val)->ip, 4))
  365. return 0;
  366. if (!ASN1PERDecUnsignedShort(dec, &(val)->port))
  367. return 0;
  368. if (!ASN1Dec_TransportAddress_ipSourceRoute_route(dec, &(val)->route))
  369. return 0;
  370. if (!ASN1Dec_TransportAddress_ipSourceRoute_routing(dec, &(val)->routing))
  371. return 0;
  372. if (y) {
  373. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  374. return 0;
  375. }
  376. return 1;
  377. }
  378. static void ASN1CALL ASN1Free_TransportAddress_ipSourceRoute(TransportAddress_ipSourceRoute *val)
  379. {
  380. if (val) {
  381. ASN1Free_TransportAddress_ipSourceRoute_route(&(val)->route);
  382. }
  383. }
  384. static int ASN1CALL ASN1Enc_TransportAddress_ipAddress(ASN1encoding_t enc, TransportAddress_ipAddress *val)
  385. {
  386. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &(val)->ip, 4))
  387. return 0;
  388. if (!ASN1PEREncUnsignedShort(enc, (val)->port))
  389. return 0;
  390. return 1;
  391. }
  392. static int ASN1CALL ASN1Dec_TransportAddress_ipAddress(ASN1decoding_t dec, TransportAddress_ipAddress *val)
  393. {
  394. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &(val)->ip, 4))
  395. return 0;
  396. if (!ASN1PERDecUnsignedShort(dec, &(val)->port))
  397. return 0;
  398. return 1;
  399. }
  400. static void ASN1CALL ASN1Free_TransportAddress_ipAddress(TransportAddress_ipAddress *val)
  401. {
  402. if (val) {
  403. }
  404. }
  405. static int ASN1CALL ASN1Enc_H221NonStandard(ASN1encoding_t enc, H221NonStandard *val)
  406. {
  407. if (!ASN1PEREncExtensionBitClear(enc))
  408. return 0;
  409. ASN1PEREncAlignment(enc);
  410. if (!ASN1PEREncBitVal(enc, 8, (val)->t35CountryCode))
  411. return 0;
  412. ASN1PEREncAlignment(enc);
  413. if (!ASN1PEREncBitVal(enc, 8, (val)->t35Extension))
  414. return 0;
  415. if (!ASN1PEREncUnsignedShort(enc, (val)->manufacturerCode))
  416. return 0;
  417. return 1;
  418. }
  419. static int ASN1CALL ASN1Dec_H221NonStandard(ASN1decoding_t dec, H221NonStandard *val)
  420. {
  421. ASN1uint32_t y;
  422. if (!ASN1PERDecExtensionBit(dec, &y))
  423. return 0;
  424. ASN1PERDecAlignment(dec);
  425. if (!ASN1PERDecU16Val(dec, 8, &(val)->t35CountryCode))
  426. return 0;
  427. ASN1PERDecAlignment(dec);
  428. if (!ASN1PERDecU16Val(dec, 8, &(val)->t35Extension))
  429. return 0;
  430. if (!ASN1PERDecUnsignedShort(dec, &(val)->manufacturerCode))
  431. return 0;
  432. if (y) {
  433. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  434. return 0;
  435. }
  436. return 1;
  437. }
  438. static int ASN1CALL ASN1Enc_NonStandardIdentifier(ASN1encoding_t enc, NonStandardIdentifier *val)
  439. {
  440. if (!ASN1PEREncSimpleChoiceEx(enc, (val)->choice, 1))
  441. return 0;
  442. switch ((val)->choice) {
  443. case 1:
  444. if (!ASN1PEREncObjectIdentifier(enc, &(val)->u.object))
  445. return 0;
  446. break;
  447. case 2:
  448. if (!ASN1Enc_H221NonStandard(enc, &(val)->u.h221NonStandard))
  449. return 0;
  450. break;
  451. default:
  452. /* impossible */
  453. ASN1EncSetError(enc, ASN1_ERR_CHOICE);
  454. return 0;
  455. }
  456. return 1;
  457. }
  458. static int ASN1CALL ASN1Dec_NonStandardIdentifier(ASN1decoding_t dec, NonStandardIdentifier *val)
  459. {
  460. if (!ASN1PERDecSimpleChoiceEx(dec, &(val)->choice, 1))
  461. return 0;
  462. switch ((val)->choice) {
  463. case 1:
  464. if (!ASN1PERDecObjectIdentifier(dec, &(val)->u.object))
  465. return 0;
  466. break;
  467. case 2:
  468. if (!ASN1Dec_H221NonStandard(dec, &(val)->u.h221NonStandard))
  469. return 0;
  470. break;
  471. case 0:
  472. /* extension case */
  473. if (!ASN1PERDecSkipFragmented(dec, 8))
  474. return 0;
  475. break;
  476. default:
  477. /* impossible */
  478. ASN1DecSetError(dec, ASN1_ERR_CHOICE);
  479. return 0;
  480. }
  481. return 1;
  482. }
  483. static void ASN1CALL ASN1Free_NonStandardIdentifier(NonStandardIdentifier *val)
  484. {
  485. if (val) {
  486. switch ((val)->choice) {
  487. case 1:
  488. ASN1objectidentifier_free(&(val)->u.object);
  489. break;
  490. }
  491. }
  492. }
  493. static int ASN1CALL ASN1Enc_NonStandardParameter(ASN1encoding_t enc, NonStandardParameter *val)
  494. {
  495. if (!ASN1Enc_NonStandardIdentifier(enc, &(val)->nonStandardIdentifier))
  496. return 0;
  497. if (!ASN1PEREncOctetString_NoSize(enc, &(val)->data))
  498. return 0;
  499. return 1;
  500. }
  501. static int ASN1CALL ASN1Dec_NonStandardParameter(ASN1decoding_t dec, NonStandardParameter *val)
  502. {
  503. if (!ASN1Dec_NonStandardIdentifier(dec, &(val)->nonStandardIdentifier))
  504. return 0;
  505. if (!ASN1PERDecOctetString_NoSize(dec, &(val)->data))
  506. return 0;
  507. return 1;
  508. }
  509. static void ASN1CALL ASN1Free_NonStandardParameter(NonStandardParameter *val)
  510. {
  511. if (val) {
  512. ASN1Free_NonStandardIdentifier(&(val)->nonStandardIdentifier);
  513. ASN1octetstring_free(&(val)->data);
  514. }
  515. }
  516. static int ASN1CALL ASN1Enc_CallType(ASN1encoding_t enc, CallType *val)
  517. {
  518. if (!ASN1PEREncSimpleChoiceEx(enc, (val)->choice, 2))
  519. return 0;
  520. return 1;
  521. }
  522. static int ASN1CALL ASN1Dec_CallType(ASN1decoding_t dec, CallType *val)
  523. {
  524. if (!ASN1PERDecSimpleChoiceEx(dec, &(val)->choice, 2))
  525. return 0;
  526. return 1;
  527. }
  528. static int ASN1CALL ASN1Enc_Q954Details(ASN1encoding_t enc, Q954Details *val)
  529. {
  530. if (!ASN1PEREncExtensionBitClear(enc))
  531. return 0;
  532. if (!ASN1PEREncBoolean(enc, (val)->conferenceCalling))
  533. return 0;
  534. if (!ASN1PEREncBoolean(enc, (val)->threePartyService))
  535. return 0;
  536. return 1;
  537. }
  538. static int ASN1CALL ASN1Dec_Q954Details(ASN1decoding_t dec, Q954Details *val)
  539. {
  540. ASN1uint32_t y;
  541. if (!ASN1PERDecExtensionBit(dec, &y))
  542. return 0;
  543. if (!ASN1PERDecBoolean(dec, &(val)->conferenceCalling))
  544. return 0;
  545. if (!ASN1PERDecBoolean(dec, &(val)->threePartyService))
  546. return 0;
  547. if (y) {
  548. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  549. return 0;
  550. }
  551. return 1;
  552. }
  553. static int ASN1CALL ASN1Enc_QseriesOptions(ASN1encoding_t enc, QseriesOptions *val)
  554. {
  555. if (!ASN1PEREncExtensionBitClear(enc))
  556. return 0;
  557. if (!ASN1PEREncBoolean(enc, (val)->q932Full))
  558. return 0;
  559. if (!ASN1PEREncBoolean(enc, (val)->q951Full))
  560. return 0;
  561. if (!ASN1PEREncBoolean(enc, (val)->q952Full))
  562. return 0;
  563. if (!ASN1PEREncBoolean(enc, (val)->q953Full))
  564. return 0;
  565. if (!ASN1PEREncBoolean(enc, (val)->q955Full))
  566. return 0;
  567. if (!ASN1PEREncBoolean(enc, (val)->q956Full))
  568. return 0;
  569. if (!ASN1PEREncBoolean(enc, (val)->q957Full))
  570. return 0;
  571. if (!ASN1Enc_Q954Details(enc, &(val)->q954Info))
  572. return 0;
  573. return 1;
  574. }
  575. static int ASN1CALL ASN1Dec_QseriesOptions(ASN1decoding_t dec, QseriesOptions *val)
  576. {
  577. ASN1uint32_t y;
  578. if (!ASN1PERDecExtensionBit(dec, &y))
  579. return 0;
  580. if (!ASN1PERDecBoolean(dec, &(val)->q932Full))
  581. return 0;
  582. if (!ASN1PERDecBoolean(dec, &(val)->q951Full))
  583. return 0;
  584. if (!ASN1PERDecBoolean(dec, &(val)->q952Full))
  585. return 0;
  586. if (!ASN1PERDecBoolean(dec, &(val)->q953Full))
  587. return 0;
  588. if (!ASN1PERDecBoolean(dec, &(val)->q955Full))
  589. return 0;
  590. if (!ASN1PERDecBoolean(dec, &(val)->q956Full))
  591. return 0;
  592. if (!ASN1PERDecBoolean(dec, &(val)->q957Full))
  593. return 0;
  594. if (!ASN1Dec_Q954Details(dec, &(val)->q954Info))
  595. return 0;
  596. if (y) {
  597. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  598. return 0;
  599. }
  600. return 1;
  601. }
  602. static int ASN1CALL ASN1Enc_H310Caps(ASN1encoding_t enc, H310Caps *val)
  603. {
  604. if (!ASN1PEREncExtensionBitClear(enc))
  605. return 0;
  606. if (!ASN1PEREncBits(enc, 1, (val)->o))
  607. return 0;
  608. if ((val)->o[0] & 0x80) {
  609. if (!ASN1Enc_NonStandardParameter(enc, &(val)->nonStandardData))
  610. return 0;
  611. }
  612. return 1;
  613. }
  614. static int ASN1CALL ASN1Dec_H310Caps(ASN1decoding_t dec, H310Caps *val)
  615. {
  616. ASN1uint32_t y;
  617. if (!ASN1PERDecExtensionBit(dec, &y))
  618. return 0;
  619. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  620. return 0;
  621. if ((val)->o[0] & 0x80) {
  622. if (!ASN1Dec_NonStandardParameter(dec, &(val)->nonStandardData))
  623. return 0;
  624. }
  625. if (y) {
  626. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  627. return 0;
  628. }
  629. return 1;
  630. }
  631. static void ASN1CALL ASN1Free_H310Caps(H310Caps *val)
  632. {
  633. if (val) {
  634. if ((val)->o[0] & 0x80) {
  635. ASN1Free_NonStandardParameter(&(val)->nonStandardData);
  636. }
  637. }
  638. }
  639. static int ASN1CALL ASN1Enc_H320Caps(ASN1encoding_t enc, H320Caps *val)
  640. {
  641. if (!ASN1PEREncExtensionBitClear(enc))
  642. return 0;
  643. if (!ASN1PEREncBits(enc, 1, (val)->o))
  644. return 0;
  645. if ((val)->o[0] & 0x80) {
  646. if (!ASN1Enc_NonStandardParameter(enc, &(val)->nonStandardData))
  647. return 0;
  648. }
  649. return 1;
  650. }
  651. static int ASN1CALL ASN1Dec_H320Caps(ASN1decoding_t dec, H320Caps *val)
  652. {
  653. ASN1uint32_t y;
  654. if (!ASN1PERDecExtensionBit(dec, &y))
  655. return 0;
  656. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  657. return 0;
  658. if ((val)->o[0] & 0x80) {
  659. if (!ASN1Dec_NonStandardParameter(dec, &(val)->nonStandardData))
  660. return 0;
  661. }
  662. if (y) {
  663. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  664. return 0;
  665. }
  666. return 1;
  667. }
  668. static void ASN1CALL ASN1Free_H320Caps(H320Caps *val)
  669. {
  670. if (val) {
  671. if ((val)->o[0] & 0x80) {
  672. ASN1Free_NonStandardParameter(&(val)->nonStandardData);
  673. }
  674. }
  675. }
  676. static int ASN1CALL ASN1Enc_H321Caps(ASN1encoding_t enc, H321Caps *val)
  677. {
  678. if (!ASN1PEREncExtensionBitClear(enc))
  679. return 0;
  680. if (!ASN1PEREncBits(enc, 1, (val)->o))
  681. return 0;
  682. if ((val)->o[0] & 0x80) {
  683. if (!ASN1Enc_NonStandardParameter(enc, &(val)->nonStandardData))
  684. return 0;
  685. }
  686. return 1;
  687. }
  688. static int ASN1CALL ASN1Dec_H321Caps(ASN1decoding_t dec, H321Caps *val)
  689. {
  690. ASN1uint32_t y;
  691. if (!ASN1PERDecExtensionBit(dec, &y))
  692. return 0;
  693. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  694. return 0;
  695. if ((val)->o[0] & 0x80) {
  696. if (!ASN1Dec_NonStandardParameter(dec, &(val)->nonStandardData))
  697. return 0;
  698. }
  699. if (y) {
  700. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  701. return 0;
  702. }
  703. return 1;
  704. }
  705. static void ASN1CALL ASN1Free_H321Caps(H321Caps *val)
  706. {
  707. if (val) {
  708. if ((val)->o[0] & 0x80) {
  709. ASN1Free_NonStandardParameter(&(val)->nonStandardData);
  710. }
  711. }
  712. }
  713. static int ASN1CALL ASN1Enc_H322Caps(ASN1encoding_t enc, H322Caps *val)
  714. {
  715. if (!ASN1PEREncExtensionBitClear(enc))
  716. return 0;
  717. if (!ASN1PEREncBits(enc, 1, (val)->o))
  718. return 0;
  719. if ((val)->o[0] & 0x80) {
  720. if (!ASN1Enc_NonStandardParameter(enc, &(val)->nonStandardData))
  721. return 0;
  722. }
  723. return 1;
  724. }
  725. static int ASN1CALL ASN1Dec_H322Caps(ASN1decoding_t dec, H322Caps *val)
  726. {
  727. ASN1uint32_t y;
  728. if (!ASN1PERDecExtensionBit(dec, &y))
  729. return 0;
  730. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  731. return 0;
  732. if ((val)->o[0] & 0x80) {
  733. if (!ASN1Dec_NonStandardParameter(dec, &(val)->nonStandardData))
  734. return 0;
  735. }
  736. if (y) {
  737. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  738. return 0;
  739. }
  740. return 1;
  741. }
  742. static void ASN1CALL ASN1Free_H322Caps(H322Caps *val)
  743. {
  744. if (val) {
  745. if ((val)->o[0] & 0x80) {
  746. ASN1Free_NonStandardParameter(&(val)->nonStandardData);
  747. }
  748. }
  749. }
  750. static int ASN1CALL ASN1Enc_H323Caps(ASN1encoding_t enc, H323Caps *val)
  751. {
  752. if (!ASN1PEREncExtensionBitClear(enc))
  753. return 0;
  754. if (!ASN1PEREncBits(enc, 1, (val)->o))
  755. return 0;
  756. if ((val)->o[0] & 0x80) {
  757. if (!ASN1Enc_NonStandardParameter(enc, &(val)->nonStandardData))
  758. return 0;
  759. }
  760. return 1;
  761. }
  762. static int ASN1CALL ASN1Dec_H323Caps(ASN1decoding_t dec, H323Caps *val)
  763. {
  764. ASN1uint32_t y;
  765. if (!ASN1PERDecExtensionBit(dec, &y))
  766. return 0;
  767. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  768. return 0;
  769. if ((val)->o[0] & 0x80) {
  770. if (!ASN1Dec_NonStandardParameter(dec, &(val)->nonStandardData))
  771. return 0;
  772. }
  773. if (y) {
  774. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  775. return 0;
  776. }
  777. return 1;
  778. }
  779. static void ASN1CALL ASN1Free_H323Caps(H323Caps *val)
  780. {
  781. if (val) {
  782. if ((val)->o[0] & 0x80) {
  783. ASN1Free_NonStandardParameter(&(val)->nonStandardData);
  784. }
  785. }
  786. }
  787. static int ASN1CALL ASN1Enc_H324Caps(ASN1encoding_t enc, H324Caps *val)
  788. {
  789. if (!ASN1PEREncExtensionBitClear(enc))
  790. return 0;
  791. if (!ASN1PEREncBits(enc, 1, (val)->o))
  792. return 0;
  793. if ((val)->o[0] & 0x80) {
  794. if (!ASN1Enc_NonStandardParameter(enc, &(val)->nonStandardData))
  795. return 0;
  796. }
  797. return 1;
  798. }
  799. static int ASN1CALL ASN1Dec_H324Caps(ASN1decoding_t dec, H324Caps *val)
  800. {
  801. ASN1uint32_t y;
  802. if (!ASN1PERDecExtensionBit(dec, &y))
  803. return 0;
  804. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  805. return 0;
  806. if ((val)->o[0] & 0x80) {
  807. if (!ASN1Dec_NonStandardParameter(dec, &(val)->nonStandardData))
  808. return 0;
  809. }
  810. if (y) {
  811. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  812. return 0;
  813. }
  814. return 1;
  815. }
  816. static void ASN1CALL ASN1Free_H324Caps(H324Caps *val)
  817. {
  818. if (val) {
  819. if ((val)->o[0] & 0x80) {
  820. ASN1Free_NonStandardParameter(&(val)->nonStandardData);
  821. }
  822. }
  823. }
  824. static int ASN1CALL ASN1Enc_VoiceCaps(ASN1encoding_t enc, VoiceCaps *val)
  825. {
  826. if (!ASN1PEREncExtensionBitClear(enc))
  827. return 0;
  828. if (!ASN1PEREncBits(enc, 1, (val)->o))
  829. return 0;
  830. if ((val)->o[0] & 0x80) {
  831. if (!ASN1Enc_NonStandardParameter(enc, &(val)->nonStandardData))
  832. return 0;
  833. }
  834. return 1;
  835. }
  836. static int ASN1CALL ASN1Dec_VoiceCaps(ASN1decoding_t dec, VoiceCaps *val)
  837. {
  838. ASN1uint32_t y;
  839. if (!ASN1PERDecExtensionBit(dec, &y))
  840. return 0;
  841. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  842. return 0;
  843. if ((val)->o[0] & 0x80) {
  844. if (!ASN1Dec_NonStandardParameter(dec, &(val)->nonStandardData))
  845. return 0;
  846. }
  847. if (y) {
  848. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  849. return 0;
  850. }
  851. return 1;
  852. }
  853. static void ASN1CALL ASN1Free_VoiceCaps(VoiceCaps *val)
  854. {
  855. if (val) {
  856. if ((val)->o[0] & 0x80) {
  857. ASN1Free_NonStandardParameter(&(val)->nonStandardData);
  858. }
  859. }
  860. }
  861. static int ASN1CALL ASN1Enc_T120OnlyCaps(ASN1encoding_t enc, T120OnlyCaps *val)
  862. {
  863. if (!ASN1PEREncExtensionBitClear(enc))
  864. return 0;
  865. if (!ASN1PEREncBits(enc, 1, (val)->o))
  866. return 0;
  867. if ((val)->o[0] & 0x80) {
  868. if (!ASN1Enc_NonStandardParameter(enc, &(val)->nonStandardData))
  869. return 0;
  870. }
  871. return 1;
  872. }
  873. static int ASN1CALL ASN1Dec_T120OnlyCaps(ASN1decoding_t dec, T120OnlyCaps *val)
  874. {
  875. ASN1uint32_t y;
  876. if (!ASN1PERDecExtensionBit(dec, &y))
  877. return 0;
  878. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  879. return 0;
  880. if ((val)->o[0] & 0x80) {
  881. if (!ASN1Dec_NonStandardParameter(dec, &(val)->nonStandardData))
  882. return 0;
  883. }
  884. if (y) {
  885. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  886. return 0;
  887. }
  888. return 1;
  889. }
  890. static void ASN1CALL ASN1Free_T120OnlyCaps(T120OnlyCaps *val)
  891. {
  892. if (val) {
  893. if ((val)->o[0] & 0x80) {
  894. ASN1Free_NonStandardParameter(&(val)->nonStandardData);
  895. }
  896. }
  897. }
  898. static int ASN1CALL ASN1Enc_McuInfo(ASN1encoding_t enc, McuInfo *val)
  899. {
  900. if (!ASN1PEREncExtensionBitClear(enc))
  901. return 0;
  902. if (!ASN1PEREncBits(enc, 1, (val)->o))
  903. return 0;
  904. if ((val)->o[0] & 0x80) {
  905. if (!ASN1Enc_NonStandardParameter(enc, &(val)->nonStandardData))
  906. return 0;
  907. }
  908. return 1;
  909. }
  910. static int ASN1CALL ASN1Dec_McuInfo(ASN1decoding_t dec, McuInfo *val)
  911. {
  912. ASN1uint32_t y;
  913. if (!ASN1PERDecExtensionBit(dec, &y))
  914. return 0;
  915. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  916. return 0;
  917. if ((val)->o[0] & 0x80) {
  918. if (!ASN1Dec_NonStandardParameter(dec, &(val)->nonStandardData))
  919. return 0;
  920. }
  921. if (y) {
  922. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  923. return 0;
  924. }
  925. return 1;
  926. }
  927. static void ASN1CALL ASN1Free_McuInfo(McuInfo *val)
  928. {
  929. if (val) {
  930. if ((val)->o[0] & 0x80) {
  931. ASN1Free_NonStandardParameter(&(val)->nonStandardData);
  932. }
  933. }
  934. }
  935. static int ASN1CALL ASN1Enc_TerminalInfo(ASN1encoding_t enc, TerminalInfo *val)
  936. {
  937. if (!ASN1PEREncExtensionBitClear(enc))
  938. return 0;
  939. if (!ASN1PEREncBits(enc, 1, (val)->o))
  940. return 0;
  941. if ((val)->o[0] & 0x80) {
  942. if (!ASN1Enc_NonStandardParameter(enc, &(val)->nonStandardData))
  943. return 0;
  944. }
  945. return 1;
  946. }
  947. static int ASN1CALL ASN1Dec_TerminalInfo(ASN1decoding_t dec, TerminalInfo *val)
  948. {
  949. ASN1uint32_t y;
  950. if (!ASN1PERDecExtensionBit(dec, &y))
  951. return 0;
  952. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  953. return 0;
  954. if ((val)->o[0] & 0x80) {
  955. if (!ASN1Dec_NonStandardParameter(dec, &(val)->nonStandardData))
  956. return 0;
  957. }
  958. if (y) {
  959. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  960. return 0;
  961. }
  962. return 1;
  963. }
  964. static void ASN1CALL ASN1Free_TerminalInfo(TerminalInfo *val)
  965. {
  966. if (val) {
  967. if ((val)->o[0] & 0x80) {
  968. ASN1Free_NonStandardParameter(&(val)->nonStandardData);
  969. }
  970. }
  971. }
  972. static int ASN1CALL ASN1Enc_GatekeeperInfo(ASN1encoding_t enc, GatekeeperInfo *val)
  973. {
  974. if (!ASN1PEREncExtensionBitClear(enc))
  975. return 0;
  976. if (!ASN1PEREncBits(enc, 1, (val)->o))
  977. return 0;
  978. if ((val)->o[0] & 0x80) {
  979. if (!ASN1Enc_NonStandardParameter(enc, &(val)->nonStandardData))
  980. return 0;
  981. }
  982. return 1;
  983. }
  984. static int ASN1CALL ASN1Dec_GatekeeperInfo(ASN1decoding_t dec, GatekeeperInfo *val)
  985. {
  986. ASN1uint32_t y;
  987. if (!ASN1PERDecExtensionBit(dec, &y))
  988. return 0;
  989. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  990. return 0;
  991. if ((val)->o[0] & 0x80) {
  992. if (!ASN1Dec_NonStandardParameter(dec, &(val)->nonStandardData))
  993. return 0;
  994. }
  995. if (y) {
  996. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  997. return 0;
  998. }
  999. return 1;
  1000. }
  1001. static void ASN1CALL ASN1Free_GatekeeperInfo(GatekeeperInfo *val)
  1002. {
  1003. if (val) {
  1004. if ((val)->o[0] & 0x80) {
  1005. ASN1Free_NonStandardParameter(&(val)->nonStandardData);
  1006. }
  1007. }
  1008. }
  1009. static int ASN1CALL ASN1Enc_VendorIdentifier(ASN1encoding_t enc, VendorIdentifier *val)
  1010. {
  1011. if (!ASN1PEREncExtensionBitClear(enc))
  1012. return 0;
  1013. if (!ASN1PEREncBits(enc, 2, (val)->o))
  1014. return 0;
  1015. if (!ASN1Enc_H221NonStandard(enc, &(val)->vendor))
  1016. return 0;
  1017. if ((val)->o[0] & 0x80) {
  1018. if (!ASN1PEREncOctetString_VarSize(enc, (ASN1octetstring2_t *) &(val)->productId, 1, 256, 8))
  1019. return 0;
  1020. }
  1021. if ((val)->o[0] & 0x40) {
  1022. if (!ASN1PEREncOctetString_VarSize(enc, (ASN1octetstring2_t *) &(val)->versionId, 1, 256, 8))
  1023. return 0;
  1024. }
  1025. return 1;
  1026. }
  1027. static int ASN1CALL ASN1Dec_VendorIdentifier(ASN1decoding_t dec, VendorIdentifier *val)
  1028. {
  1029. ASN1uint32_t y;
  1030. if (!ASN1PERDecExtensionBit(dec, &y))
  1031. return 0;
  1032. if (!ASN1PERDecExtension(dec, 2, (val)->o))
  1033. return 0;
  1034. if (!ASN1Dec_H221NonStandard(dec, &(val)->vendor))
  1035. return 0;
  1036. if ((val)->o[0] & 0x80) {
  1037. if (!ASN1PERDecOctetString_VarSize(dec, (ASN1octetstring2_t *) &(val)->productId, 1, 256, 8))
  1038. return 0;
  1039. }
  1040. if ((val)->o[0] & 0x40) {
  1041. if (!ASN1PERDecOctetString_VarSize(dec, (ASN1octetstring2_t *) &(val)->versionId, 1, 256, 8))
  1042. return 0;
  1043. }
  1044. if (y) {
  1045. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  1046. return 0;
  1047. }
  1048. return 1;
  1049. }
  1050. static void ASN1CALL ASN1Free_VendorIdentifier(VendorIdentifier *val)
  1051. {
  1052. if (val) {
  1053. if ((val)->o[0] & 0x80) {
  1054. }
  1055. if ((val)->o[0] & 0x40) {
  1056. }
  1057. }
  1058. }
  1059. static int ASN1CALL ASN1Enc_SupportedProtocols(ASN1encoding_t enc, SupportedProtocols *val)
  1060. {
  1061. if (!ASN1PEREncSimpleChoiceEx(enc, (val)->choice, 4))
  1062. return 0;
  1063. switch ((val)->choice) {
  1064. case 1:
  1065. if (!ASN1Enc_NonStandardParameter(enc, &(val)->u.nonStandardData))
  1066. return 0;
  1067. break;
  1068. case 2:
  1069. if (!ASN1Enc_H310Caps(enc, &(val)->u.h310))
  1070. return 0;
  1071. break;
  1072. case 3:
  1073. if (!ASN1Enc_H320Caps(enc, &(val)->u.h320))
  1074. return 0;
  1075. break;
  1076. case 4:
  1077. if (!ASN1Enc_H321Caps(enc, &(val)->u.h321))
  1078. return 0;
  1079. break;
  1080. case 5:
  1081. if (!ASN1Enc_H322Caps(enc, &(val)->u.h322))
  1082. return 0;
  1083. break;
  1084. case 6:
  1085. if (!ASN1Enc_H323Caps(enc, &(val)->u.h323))
  1086. return 0;
  1087. break;
  1088. case 7:
  1089. if (!ASN1Enc_H324Caps(enc, &(val)->u.h324))
  1090. return 0;
  1091. break;
  1092. case 8:
  1093. if (!ASN1Enc_VoiceCaps(enc, &(val)->u.voice))
  1094. return 0;
  1095. break;
  1096. case 9:
  1097. if (!ASN1Enc_T120OnlyCaps(enc, &(val)->u.t120_only))
  1098. return 0;
  1099. break;
  1100. default:
  1101. /* impossible */
  1102. ASN1EncSetError(enc, ASN1_ERR_CHOICE);
  1103. return 0;
  1104. }
  1105. return 1;
  1106. }
  1107. static int ASN1CALL ASN1Dec_SupportedProtocols(ASN1decoding_t dec, SupportedProtocols *val)
  1108. {
  1109. if (!ASN1PERDecSimpleChoiceEx(dec, &(val)->choice, 4))
  1110. return 0;
  1111. switch ((val)->choice) {
  1112. case 1:
  1113. if (!ASN1Dec_NonStandardParameter(dec, &(val)->u.nonStandardData))
  1114. return 0;
  1115. break;
  1116. case 2:
  1117. if (!ASN1Dec_H310Caps(dec, &(val)->u.h310))
  1118. return 0;
  1119. break;
  1120. case 3:
  1121. if (!ASN1Dec_H320Caps(dec, &(val)->u.h320))
  1122. return 0;
  1123. break;
  1124. case 4:
  1125. if (!ASN1Dec_H321Caps(dec, &(val)->u.h321))
  1126. return 0;
  1127. break;
  1128. case 5:
  1129. if (!ASN1Dec_H322Caps(dec, &(val)->u.h322))
  1130. return 0;
  1131. break;
  1132. case 6:
  1133. if (!ASN1Dec_H323Caps(dec, &(val)->u.h323))
  1134. return 0;
  1135. break;
  1136. case 7:
  1137. if (!ASN1Dec_H324Caps(dec, &(val)->u.h324))
  1138. return 0;
  1139. break;
  1140. case 8:
  1141. if (!ASN1Dec_VoiceCaps(dec, &(val)->u.voice))
  1142. return 0;
  1143. break;
  1144. case 9:
  1145. if (!ASN1Dec_T120OnlyCaps(dec, &(val)->u.t120_only))
  1146. return 0;
  1147. break;
  1148. case 0:
  1149. /* extension case */
  1150. if (!ASN1PERDecSkipFragmented(dec, 8))
  1151. return 0;
  1152. break;
  1153. default:
  1154. /* impossible */
  1155. ASN1DecSetError(dec, ASN1_ERR_CHOICE);
  1156. return 0;
  1157. }
  1158. return 1;
  1159. }
  1160. static void ASN1CALL ASN1Free_SupportedProtocols(SupportedProtocols *val)
  1161. {
  1162. if (val) {
  1163. switch ((val)->choice) {
  1164. case 1:
  1165. ASN1Free_NonStandardParameter(&(val)->u.nonStandardData);
  1166. break;
  1167. case 2:
  1168. ASN1Free_H310Caps(&(val)->u.h310);
  1169. break;
  1170. case 3:
  1171. ASN1Free_H320Caps(&(val)->u.h320);
  1172. break;
  1173. case 4:
  1174. ASN1Free_H321Caps(&(val)->u.h321);
  1175. break;
  1176. case 5:
  1177. ASN1Free_H322Caps(&(val)->u.h322);
  1178. break;
  1179. case 6:
  1180. ASN1Free_H323Caps(&(val)->u.h323);
  1181. break;
  1182. case 7:
  1183. ASN1Free_H324Caps(&(val)->u.h324);
  1184. break;
  1185. case 8:
  1186. ASN1Free_VoiceCaps(&(val)->u.voice);
  1187. break;
  1188. case 9:
  1189. ASN1Free_T120OnlyCaps(&(val)->u.t120_only);
  1190. break;
  1191. }
  1192. }
  1193. }
  1194. static int ASN1CALL ASN1Enc_GatewayInfo(ASN1encoding_t enc, GatewayInfo *val)
  1195. {
  1196. if (!ASN1PEREncExtensionBitClear(enc))
  1197. return 0;
  1198. if (!ASN1PEREncBits(enc, 2, (val)->o))
  1199. return 0;
  1200. if ((val)->o[0] & 0x80) {
  1201. if (!ASN1Enc_GatewayInfo_protocol(enc, &(val)->protocol))
  1202. return 0;
  1203. }
  1204. if ((val)->o[0] & 0x40) {
  1205. if (!ASN1Enc_NonStandardParameter(enc, &(val)->nonStandardData))
  1206. return 0;
  1207. }
  1208. return 1;
  1209. }
  1210. static int ASN1CALL ASN1Dec_GatewayInfo(ASN1decoding_t dec, GatewayInfo *val)
  1211. {
  1212. ASN1uint32_t y;
  1213. if (!ASN1PERDecExtensionBit(dec, &y))
  1214. return 0;
  1215. if (!ASN1PERDecExtension(dec, 2, (val)->o))
  1216. return 0;
  1217. if ((val)->o[0] & 0x80) {
  1218. if (!ASN1Dec_GatewayInfo_protocol(dec, &(val)->protocol))
  1219. return 0;
  1220. }
  1221. if ((val)->o[0] & 0x40) {
  1222. if (!ASN1Dec_NonStandardParameter(dec, &(val)->nonStandardData))
  1223. return 0;
  1224. }
  1225. if (y) {
  1226. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  1227. return 0;
  1228. }
  1229. return 1;
  1230. }
  1231. static void ASN1CALL ASN1Free_GatewayInfo(GatewayInfo *val)
  1232. {
  1233. if (val) {
  1234. if ((val)->o[0] & 0x80) {
  1235. ASN1Free_GatewayInfo_protocol(&(val)->protocol);
  1236. }
  1237. if ((val)->o[0] & 0x40) {
  1238. ASN1Free_NonStandardParameter(&(val)->nonStandardData);
  1239. }
  1240. }
  1241. }
  1242. static int ASN1CALL ASN1Enc_EndpointType(ASN1encoding_t enc, EndpointType *val)
  1243. {
  1244. if (!ASN1PEREncExtensionBitClear(enc))
  1245. return 0;
  1246. if (!ASN1PEREncBits(enc, 6, (val)->o))
  1247. return 0;
  1248. if ((val)->o[0] & 0x80) {
  1249. if (!ASN1Enc_NonStandardParameter(enc, &(val)->nonStandardData))
  1250. return 0;
  1251. }
  1252. if ((val)->o[0] & 0x40) {
  1253. if (!ASN1Enc_VendorIdentifier(enc, &(val)->vendor))
  1254. return 0;
  1255. }
  1256. if ((val)->o[0] & 0x20) {
  1257. if (!ASN1Enc_GatekeeperInfo(enc, &(val)->gatekeeper))
  1258. return 0;
  1259. }
  1260. if ((val)->o[0] & 0x10) {
  1261. if (!ASN1Enc_GatewayInfo(enc, &(val)->gateway))
  1262. return 0;
  1263. }
  1264. if ((val)->o[0] & 0x8) {
  1265. if (!ASN1Enc_McuInfo(enc, &(val)->mcu))
  1266. return 0;
  1267. }
  1268. if ((val)->o[0] & 0x4) {
  1269. if (!ASN1Enc_TerminalInfo(enc, &(val)->terminal))
  1270. return 0;
  1271. }
  1272. if (!ASN1PEREncBoolean(enc, (val)->mc))
  1273. return 0;
  1274. if (!ASN1PEREncBoolean(enc, (val)->undefinedNode))
  1275. return 0;
  1276. return 1;
  1277. }
  1278. static int ASN1CALL ASN1Dec_EndpointType(ASN1decoding_t dec, EndpointType *val)
  1279. {
  1280. ASN1uint32_t y;
  1281. if (!ASN1PERDecExtensionBit(dec, &y))
  1282. return 0;
  1283. if (!ASN1PERDecExtension(dec, 6, (val)->o))
  1284. return 0;
  1285. if ((val)->o[0] & 0x80) {
  1286. if (!ASN1Dec_NonStandardParameter(dec, &(val)->nonStandardData))
  1287. return 0;
  1288. }
  1289. if ((val)->o[0] & 0x40) {
  1290. if (!ASN1Dec_VendorIdentifier(dec, &(val)->vendor))
  1291. return 0;
  1292. }
  1293. if ((val)->o[0] & 0x20) {
  1294. if (!ASN1Dec_GatekeeperInfo(dec, &(val)->gatekeeper))
  1295. return 0;
  1296. }
  1297. if ((val)->o[0] & 0x10) {
  1298. if (!ASN1Dec_GatewayInfo(dec, &(val)->gateway))
  1299. return 0;
  1300. }
  1301. if ((val)->o[0] & 0x8) {
  1302. if (!ASN1Dec_McuInfo(dec, &(val)->mcu))
  1303. return 0;
  1304. }
  1305. if ((val)->o[0] & 0x4) {
  1306. if (!ASN1Dec_TerminalInfo(dec, &(val)->terminal))
  1307. return 0;
  1308. }
  1309. if (!ASN1PERDecBoolean(dec, &(val)->mc))
  1310. return 0;
  1311. if (!ASN1PERDecBoolean(dec, &(val)->undefinedNode))
  1312. return 0;
  1313. if (y) {
  1314. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  1315. return 0;
  1316. }
  1317. return 1;
  1318. }
  1319. static void ASN1CALL ASN1Free_EndpointType(EndpointType *val)
  1320. {
  1321. if (val) {
  1322. if ((val)->o[0] & 0x80) {
  1323. ASN1Free_NonStandardParameter(&(val)->nonStandardData);
  1324. }
  1325. if ((val)->o[0] & 0x40) {
  1326. ASN1Free_VendorIdentifier(&(val)->vendor);
  1327. }
  1328. if ((val)->o[0] & 0x20) {
  1329. ASN1Free_GatekeeperInfo(&(val)->gatekeeper);
  1330. }
  1331. if ((val)->o[0] & 0x10) {
  1332. ASN1Free_GatewayInfo(&(val)->gateway);
  1333. }
  1334. if ((val)->o[0] & 0x8) {
  1335. ASN1Free_McuInfo(&(val)->mcu);
  1336. }
  1337. if ((val)->o[0] & 0x4) {
  1338. ASN1Free_TerminalInfo(&(val)->terminal);
  1339. }
  1340. }
  1341. }
  1342. static int ASN1CALL ASN1Enc_TransportAddress(ASN1encoding_t enc, TransportAddress *val)
  1343. {
  1344. if (!ASN1PEREncSimpleChoiceEx(enc, (val)->choice, 3))
  1345. return 0;
  1346. switch ((val)->choice) {
  1347. case 1:
  1348. if (!ASN1Enc_TransportAddress_ipAddress(enc, &(val)->u.ipAddress))
  1349. return 0;
  1350. break;
  1351. case 2:
  1352. if (!ASN1Enc_TransportAddress_ipSourceRoute(enc, &(val)->u.ipSourceRoute))
  1353. return 0;
  1354. break;
  1355. case 3:
  1356. if (!ASN1Enc_TransportAddress_ipxAddress(enc, &(val)->u.ipxAddress))
  1357. return 0;
  1358. break;
  1359. case 4:
  1360. if (!ASN1Enc_TransportAddress_ip6Address(enc, &(val)->u.ip6Address))
  1361. return 0;
  1362. break;
  1363. case 5:
  1364. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &(val)->u.netBios, 16))
  1365. return 0;
  1366. break;
  1367. case 6:
  1368. if (!ASN1PEREncOctetString_VarSize(enc, (ASN1octetstring2_t *) &(val)->u.nsap, 1, 20, 5))
  1369. return 0;
  1370. break;
  1371. case 7:
  1372. if (!ASN1Enc_NonStandardParameter(enc, &(val)->u.nonStandardAddress))
  1373. return 0;
  1374. break;
  1375. default:
  1376. /* impossible */
  1377. ASN1EncSetError(enc, ASN1_ERR_CHOICE);
  1378. return 0;
  1379. }
  1380. return 1;
  1381. }
  1382. static int ASN1CALL ASN1Dec_TransportAddress(ASN1decoding_t dec, TransportAddress *val)
  1383. {
  1384. if (!ASN1PERDecSimpleChoiceEx(dec, &(val)->choice, 3))
  1385. return 0;
  1386. switch ((val)->choice) {
  1387. case 1:
  1388. if (!ASN1Dec_TransportAddress_ipAddress(dec, &(val)->u.ipAddress))
  1389. return 0;
  1390. break;
  1391. case 2:
  1392. if (!ASN1Dec_TransportAddress_ipSourceRoute(dec, &(val)->u.ipSourceRoute))
  1393. return 0;
  1394. break;
  1395. case 3:
  1396. if (!ASN1Dec_TransportAddress_ipxAddress(dec, &(val)->u.ipxAddress))
  1397. return 0;
  1398. break;
  1399. case 4:
  1400. if (!ASN1Dec_TransportAddress_ip6Address(dec, &(val)->u.ip6Address))
  1401. return 0;
  1402. break;
  1403. case 5:
  1404. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &(val)->u.netBios, 16))
  1405. return 0;
  1406. break;
  1407. case 6:
  1408. if (!ASN1PERDecOctetString_VarSize(dec, (ASN1octetstring2_t *) &(val)->u.nsap, 1, 20, 5))
  1409. return 0;
  1410. break;
  1411. case 7:
  1412. if (!ASN1Dec_NonStandardParameter(dec, &(val)->u.nonStandardAddress))
  1413. return 0;
  1414. break;
  1415. case 0:
  1416. /* extension case */
  1417. if (!ASN1PERDecSkipFragmented(dec, 8))
  1418. return 0;
  1419. break;
  1420. default:
  1421. /* impossible */
  1422. ASN1DecSetError(dec, ASN1_ERR_CHOICE);
  1423. return 0;
  1424. }
  1425. return 1;
  1426. }
  1427. static void ASN1CALL ASN1Free_TransportAddress(TransportAddress *val)
  1428. {
  1429. if (val) {
  1430. switch ((val)->choice) {
  1431. case 1:
  1432. ASN1Free_TransportAddress_ipAddress(&(val)->u.ipAddress);
  1433. break;
  1434. case 2:
  1435. ASN1Free_TransportAddress_ipSourceRoute(&(val)->u.ipSourceRoute);
  1436. break;
  1437. case 3:
  1438. ASN1Free_TransportAddress_ipxAddress(&(val)->u.ipxAddress);
  1439. break;
  1440. case 4:
  1441. ASN1Free_TransportAddress_ip6Address(&(val)->u.ip6Address);
  1442. break;
  1443. case 5:
  1444. break;
  1445. case 6:
  1446. break;
  1447. case 7:
  1448. ASN1Free_NonStandardParameter(&(val)->u.nonStandardAddress);
  1449. break;
  1450. }
  1451. }
  1452. }
  1453. static ASN1stringtableentry_t AliasAddress_e164_StringTableEntries[] = {
  1454. { 35, 35, 0 }, { 42, 42, 1 }, { 44, 44, 2 },
  1455. { 48, 57, 3 },
  1456. };
  1457. static ASN1stringtable_t AliasAddress_e164_StringTable = {
  1458. 4, AliasAddress_e164_StringTableEntries
  1459. };
  1460. static int ASN1CALL ASN1Enc_AliasAddress(ASN1encoding_t enc, AliasAddress *val)
  1461. {
  1462. ASN1uint32_t t;
  1463. if (!ASN1PEREncSimpleChoiceEx(enc, (val)->choice, 1))
  1464. return 0;
  1465. switch ((val)->choice) {
  1466. case 1:
  1467. t = lstrlenA((val)->u.e164);
  1468. if (!ASN1PEREncBitVal(enc, 7, t - 1))
  1469. return 0;
  1470. ASN1PEREncAlignment(enc);
  1471. if (!ASN1PEREncTableCharString(enc, t, (val)->u.e164, 4, &AliasAddress_e164_StringTable))
  1472. return 0;
  1473. break;
  1474. case 2:
  1475. ASN1PEREncAlignment(enc);
  1476. if (!ASN1PEREncBitVal(enc, 8, ((val)->u.h323_ID).length - 1))
  1477. return 0;
  1478. if (!ASN1PEREncChar16String(enc, ((val)->u.h323_ID).length, ((val)->u.h323_ID).value, 16))
  1479. return 0;
  1480. break;
  1481. default:
  1482. /* impossible */
  1483. ASN1EncSetError(enc, ASN1_ERR_CHOICE);
  1484. return 0;
  1485. }
  1486. return 1;
  1487. }
  1488. static int ASN1CALL ASN1Dec_AliasAddress(ASN1decoding_t dec, AliasAddress *val)
  1489. {
  1490. ASN1uint32_t l;
  1491. if (!ASN1PERDecSimpleChoiceEx(dec, &(val)->choice, 1))
  1492. return 0;
  1493. switch ((val)->choice) {
  1494. case 1:
  1495. if (!ASN1PERDecU32Val(dec, 7, &l))
  1496. return 0;
  1497. l += 1;
  1498. ASN1PERDecAlignment(dec);
  1499. if (!ASN1PERDecZeroTableCharStringNoAlloc(dec, l, (val)->u.e164, 4, &AliasAddress_e164_StringTable))
  1500. return 0;
  1501. break;
  1502. case 2:
  1503. ASN1PERDecAlignment(dec);
  1504. if (!ASN1PERDecU32Val(dec, 8, &((val)->u.h323_ID).length))
  1505. return 0;
  1506. ((val)->u.h323_ID).length += 1;
  1507. if (!ASN1PERDecChar16String(dec, ((val)->u.h323_ID).length, &((val)->u.h323_ID).value, 16))
  1508. return 0;
  1509. break;
  1510. case 0:
  1511. /* extension case */
  1512. if (!ASN1PERDecSkipFragmented(dec, 8))
  1513. return 0;
  1514. break;
  1515. default:
  1516. /* impossible */
  1517. ASN1DecSetError(dec, ASN1_ERR_CHOICE);
  1518. return 0;
  1519. }
  1520. return 1;
  1521. }
  1522. static void ASN1CALL ASN1Free_AliasAddress(AliasAddress *val)
  1523. {
  1524. if (val) {
  1525. switch ((val)->choice) {
  1526. case 1:
  1527. break;
  1528. case 2:
  1529. ASN1char16string_free(&(val)->u.h323_ID);
  1530. break;
  1531. }
  1532. }
  1533. }
  1534. static int ASN1CALL ASN1Enc_Setup_UUIE(ASN1encoding_t enc, Setup_UUIE *val)
  1535. {
  1536. ASN1uint32_t y;
  1537. ASN1encoding_t ee;
  1538. y = ASN1PEREncCheckExtensions(2, (val)->o + 1);
  1539. if (!ASN1PEREncBitVal(enc, 1, y))
  1540. return 0;
  1541. if (!ASN1PEREncBits(enc, 7, (val)->o))
  1542. return 0;
  1543. if (!ASN1PEREncObjectIdentifier(enc, &(val)->protocolIdentifier))
  1544. return 0;
  1545. if ((val)->o[0] & 0x80) {
  1546. if (!ASN1Enc_TransportAddress(enc, &(val)->h245Address))
  1547. return 0;
  1548. }
  1549. if ((val)->o[0] & 0x40) {
  1550. if (!ASN1Enc_Setup_UUIE_sourceAddress(enc, &(val)->sourceAddress))
  1551. return 0;
  1552. }
  1553. if (!ASN1Enc_EndpointType(enc, &(val)->sourceInfo))
  1554. return 0;
  1555. if ((val)->o[0] & 0x20) {
  1556. if (!ASN1Enc_Setup_UUIE_destinationAddress(enc, &(val)->destinationAddress))
  1557. return 0;
  1558. }
  1559. if ((val)->o[0] & 0x10) {
  1560. if (!ASN1Enc_TransportAddress(enc, &(val)->destCallSignalAddress))
  1561. return 0;
  1562. }
  1563. if ((val)->o[0] & 0x8) {
  1564. if (!ASN1Enc_Setup_UUIE_destExtraCallInfo(enc, &(val)->destExtraCallInfo))
  1565. return 0;
  1566. }
  1567. if ((val)->o[0] & 0x4) {
  1568. if (!ASN1Enc_Setup_UUIE_destExtraCRV(enc, &(val)->destExtraCRV))
  1569. return 0;
  1570. }
  1571. if (!ASN1PEREncBoolean(enc, (val)->activeMC))
  1572. return 0;
  1573. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &(val)->conferenceID, 16))
  1574. return 0;
  1575. if (!ASN1Enc_Setup_UUIE_conferenceGoal(enc, &(val)->conferenceGoal))
  1576. return 0;
  1577. if ((val)->o[0] & 0x2) {
  1578. if (!ASN1Enc_QseriesOptions(enc, &(val)->callServices))
  1579. return 0;
  1580. }
  1581. if (!ASN1Enc_CallType(enc, &(val)->callType))
  1582. return 0;
  1583. if (y) {
  1584. if (!ASN1PEREncNormallySmallBits(enc, 2, (val)->o + 1))
  1585. return 0;
  1586. if (ASN1_CreateEncoder(enc->module, &ee, NULL, 0, enc) < 0)
  1587. return 0;
  1588. if ((val)->o[1] & 0x80) {
  1589. if (!ASN1Enc_TransportAddress(ee, &(val)->sourceCallSignalAddress))
  1590. return 0;
  1591. if (!ASN1PEREncFlushFragmentedToParent(ee))
  1592. return 0;
  1593. }
  1594. if ((val)->o[1] & 0x40) {
  1595. if (!ASN1Enc_AliasAddress(ee, &(val)->remoteExtensionAddress))
  1596. return 0;
  1597. if (!ASN1PEREncFlushFragmentedToParent(ee))
  1598. return 0;
  1599. }
  1600. ASN1_CloseEncoder2(ee);
  1601. }
  1602. return 1;
  1603. }
  1604. static int ASN1CALL ASN1Dec_Setup_UUIE(ASN1decoding_t dec, Setup_UUIE *val)
  1605. {
  1606. ASN1uint32_t y;
  1607. ASN1decoding_t dd;
  1608. ASN1octet_t *db;
  1609. ASN1uint32_t ds;
  1610. ASN1uint32_t i;
  1611. ASN1uint32_t e;
  1612. if (!ASN1PERDecExtensionBit(dec, &y))
  1613. return 0;
  1614. if (!ASN1PERDecExtension(dec, 7, (val)->o))
  1615. return 0;
  1616. if (!ASN1PERDecObjectIdentifier(dec, &(val)->protocolIdentifier))
  1617. return 0;
  1618. if ((val)->o[0] & 0x80) {
  1619. if (!ASN1Dec_TransportAddress(dec, &(val)->h245Address))
  1620. return 0;
  1621. }
  1622. if ((val)->o[0] & 0x40) {
  1623. if (!ASN1Dec_Setup_UUIE_sourceAddress(dec, &(val)->sourceAddress))
  1624. return 0;
  1625. }
  1626. if (!ASN1Dec_EndpointType(dec, &(val)->sourceInfo))
  1627. return 0;
  1628. if ((val)->o[0] & 0x20) {
  1629. if (!ASN1Dec_Setup_UUIE_destinationAddress(dec, &(val)->destinationAddress))
  1630. return 0;
  1631. }
  1632. if ((val)->o[0] & 0x10) {
  1633. if (!ASN1Dec_TransportAddress(dec, &(val)->destCallSignalAddress))
  1634. return 0;
  1635. }
  1636. if ((val)->o[0] & 0x8) {
  1637. if (!ASN1Dec_Setup_UUIE_destExtraCallInfo(dec, &(val)->destExtraCallInfo))
  1638. return 0;
  1639. }
  1640. if ((val)->o[0] & 0x4) {
  1641. if (!ASN1Dec_Setup_UUIE_destExtraCRV(dec, &(val)->destExtraCRV))
  1642. return 0;
  1643. }
  1644. if (!ASN1PERDecBoolean(dec, &(val)->activeMC))
  1645. return 0;
  1646. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &(val)->conferenceID, 16))
  1647. return 0;
  1648. if (!ASN1Dec_Setup_UUIE_conferenceGoal(dec, &(val)->conferenceGoal))
  1649. return 0;
  1650. if ((val)->o[0] & 0x2) {
  1651. if (!ASN1Dec_QseriesOptions(dec, &(val)->callServices))
  1652. return 0;
  1653. }
  1654. if (!ASN1Dec_CallType(dec, &(val)->callType))
  1655. return 0;
  1656. if (!y) {
  1657. ZeroMemory((val)->o + 1, 1);
  1658. } else {
  1659. if (!ASN1PERDecNormallySmallExtension(dec, &e, 2, (val)->o + 1))
  1660. return 0;
  1661. if ((val)->o[1] & 0x80) {
  1662. if (!ASN1PERDecFragmented(dec, &ds, &db, 8))
  1663. return 0;
  1664. if (ASN1_CreateDecoder(dec->module, &dd, db, ds, dec) < 0)
  1665. return 0;
  1666. if (!ASN1Dec_TransportAddress(dd, &(val)->sourceCallSignalAddress))
  1667. return 0;
  1668. ASN1_CloseDecoder(dd);
  1669. ASN1Free(db);
  1670. }
  1671. if ((val)->o[1] & 0x40) {
  1672. if (!ASN1PERDecFragmented(dec, &ds, &db, 8))
  1673. return 0;
  1674. if (ASN1_CreateDecoder(dec->module, &dd, db, ds, dec) < 0)
  1675. return 0;
  1676. if (!ASN1Dec_AliasAddress(dd, &(val)->remoteExtensionAddress))
  1677. return 0;
  1678. ASN1_CloseDecoder(dd);
  1679. ASN1Free(db);
  1680. }
  1681. for (i = 0; i < e; i++) {
  1682. if (!ASN1PERDecSkipFragmented(dec, 8))
  1683. return 0;
  1684. }
  1685. }
  1686. return 1;
  1687. }
  1688. static void ASN1CALL ASN1Free_Setup_UUIE(Setup_UUIE *val)
  1689. {
  1690. if (val) {
  1691. ASN1objectidentifier_free(&(val)->protocolIdentifier);
  1692. if ((val)->o[0] & 0x80) {
  1693. ASN1Free_TransportAddress(&(val)->h245Address);
  1694. }
  1695. if ((val)->o[0] & 0x40) {
  1696. ASN1Free_Setup_UUIE_sourceAddress(&(val)->sourceAddress);
  1697. }
  1698. ASN1Free_EndpointType(&(val)->sourceInfo);
  1699. if ((val)->o[0] & 0x20) {
  1700. ASN1Free_Setup_UUIE_destinationAddress(&(val)->destinationAddress);
  1701. }
  1702. if ((val)->o[0] & 0x10) {
  1703. ASN1Free_TransportAddress(&(val)->destCallSignalAddress);
  1704. }
  1705. if ((val)->o[0] & 0x8) {
  1706. ASN1Free_Setup_UUIE_destExtraCallInfo(&(val)->destExtraCallInfo);
  1707. }
  1708. if ((val)->o[0] & 0x4) {
  1709. ASN1Free_Setup_UUIE_destExtraCRV(&(val)->destExtraCRV);
  1710. }
  1711. if ((val)->o[1] & 0x80) {
  1712. ASN1Free_TransportAddress(&(val)->sourceCallSignalAddress);
  1713. }
  1714. if ((val)->o[1] & 0x40) {
  1715. ASN1Free_AliasAddress(&(val)->remoteExtensionAddress);
  1716. }
  1717. }
  1718. }
  1719. static int ASN1CALL ASN1Enc_CallProceeding_UUIE(ASN1encoding_t enc, CallProceeding_UUIE *val)
  1720. {
  1721. if (!ASN1PEREncExtensionBitClear(enc))
  1722. return 0;
  1723. if (!ASN1PEREncBits(enc, 1, (val)->o))
  1724. return 0;
  1725. if (!ASN1PEREncObjectIdentifier(enc, &(val)->protocolIdentifier))
  1726. return 0;
  1727. if (!ASN1Enc_EndpointType(enc, &(val)->destinationInfo))
  1728. return 0;
  1729. if ((val)->o[0] & 0x80) {
  1730. if (!ASN1Enc_TransportAddress(enc, &(val)->h245Address))
  1731. return 0;
  1732. }
  1733. return 1;
  1734. }
  1735. static int ASN1CALL ASN1Dec_CallProceeding_UUIE(ASN1decoding_t dec, CallProceeding_UUIE *val)
  1736. {
  1737. ASN1uint32_t y;
  1738. if (!ASN1PERDecExtensionBit(dec, &y))
  1739. return 0;
  1740. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  1741. return 0;
  1742. if (!ASN1PERDecObjectIdentifier(dec, &(val)->protocolIdentifier))
  1743. return 0;
  1744. if (!ASN1Dec_EndpointType(dec, &(val)->destinationInfo))
  1745. return 0;
  1746. if ((val)->o[0] & 0x80) {
  1747. if (!ASN1Dec_TransportAddress(dec, &(val)->h245Address))
  1748. return 0;
  1749. }
  1750. if (y) {
  1751. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  1752. return 0;
  1753. }
  1754. return 1;
  1755. }
  1756. static void ASN1CALL ASN1Free_CallProceeding_UUIE(CallProceeding_UUIE *val)
  1757. {
  1758. if (val) {
  1759. ASN1objectidentifier_free(&(val)->protocolIdentifier);
  1760. ASN1Free_EndpointType(&(val)->destinationInfo);
  1761. if ((val)->o[0] & 0x80) {
  1762. ASN1Free_TransportAddress(&(val)->h245Address);
  1763. }
  1764. }
  1765. }
  1766. static int ASN1CALL ASN1Enc_Connect_UUIE(ASN1encoding_t enc, Connect_UUIE *val)
  1767. {
  1768. if (!ASN1PEREncExtensionBitClear(enc))
  1769. return 0;
  1770. if (!ASN1PEREncBits(enc, 1, (val)->o))
  1771. return 0;
  1772. if (!ASN1PEREncObjectIdentifier(enc, &(val)->protocolIdentifier))
  1773. return 0;
  1774. if ((val)->o[0] & 0x80) {
  1775. if (!ASN1Enc_TransportAddress(enc, &(val)->h245Address))
  1776. return 0;
  1777. }
  1778. if (!ASN1Enc_EndpointType(enc, &(val)->destinationInfo))
  1779. return 0;
  1780. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &(val)->conferenceID, 16))
  1781. return 0;
  1782. return 1;
  1783. }
  1784. static int ASN1CALL ASN1Dec_Connect_UUIE(ASN1decoding_t dec, Connect_UUIE *val)
  1785. {
  1786. ASN1uint32_t y;
  1787. if (!ASN1PERDecExtensionBit(dec, &y))
  1788. return 0;
  1789. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  1790. return 0;
  1791. if (!ASN1PERDecObjectIdentifier(dec, &(val)->protocolIdentifier))
  1792. return 0;
  1793. if ((val)->o[0] & 0x80) {
  1794. if (!ASN1Dec_TransportAddress(dec, &(val)->h245Address))
  1795. return 0;
  1796. }
  1797. if (!ASN1Dec_EndpointType(dec, &(val)->destinationInfo))
  1798. return 0;
  1799. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &(val)->conferenceID, 16))
  1800. return 0;
  1801. if (y) {
  1802. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  1803. return 0;
  1804. }
  1805. return 1;
  1806. }
  1807. static void ASN1CALL ASN1Free_Connect_UUIE(Connect_UUIE *val)
  1808. {
  1809. if (val) {
  1810. ASN1objectidentifier_free(&(val)->protocolIdentifier);
  1811. if ((val)->o[0] & 0x80) {
  1812. ASN1Free_TransportAddress(&(val)->h245Address);
  1813. }
  1814. ASN1Free_EndpointType(&(val)->destinationInfo);
  1815. }
  1816. }
  1817. static int ASN1CALL ASN1Enc_Alerting_UUIE(ASN1encoding_t enc, Alerting_UUIE *val)
  1818. {
  1819. if (!ASN1PEREncExtensionBitClear(enc))
  1820. return 0;
  1821. if (!ASN1PEREncBits(enc, 1, (val)->o))
  1822. return 0;
  1823. if (!ASN1PEREncObjectIdentifier(enc, &(val)->protocolIdentifier))
  1824. return 0;
  1825. if (!ASN1Enc_EndpointType(enc, &(val)->destinationInfo))
  1826. return 0;
  1827. if ((val)->o[0] & 0x80) {
  1828. if (!ASN1Enc_TransportAddress(enc, &(val)->h245Address))
  1829. return 0;
  1830. }
  1831. return 1;
  1832. }
  1833. static int ASN1CALL ASN1Dec_Alerting_UUIE(ASN1decoding_t dec, Alerting_UUIE *val)
  1834. {
  1835. ASN1uint32_t y;
  1836. if (!ASN1PERDecExtensionBit(dec, &y))
  1837. return 0;
  1838. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  1839. return 0;
  1840. if (!ASN1PERDecObjectIdentifier(dec, &(val)->protocolIdentifier))
  1841. return 0;
  1842. if (!ASN1Dec_EndpointType(dec, &(val)->destinationInfo))
  1843. return 0;
  1844. if ((val)->o[0] & 0x80) {
  1845. if (!ASN1Dec_TransportAddress(dec, &(val)->h245Address))
  1846. return 0;
  1847. }
  1848. if (y) {
  1849. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  1850. return 0;
  1851. }
  1852. return 1;
  1853. }
  1854. static void ASN1CALL ASN1Free_Alerting_UUIE(Alerting_UUIE *val)
  1855. {
  1856. if (val) {
  1857. ASN1objectidentifier_free(&(val)->protocolIdentifier);
  1858. ASN1Free_EndpointType(&(val)->destinationInfo);
  1859. if ((val)->o[0] & 0x80) {
  1860. ASN1Free_TransportAddress(&(val)->h245Address);
  1861. }
  1862. }
  1863. }
  1864. static int ASN1CALL ASN1Enc_UI_UUIE(ASN1encoding_t enc, UI_UUIE *val)
  1865. {
  1866. if (!ASN1PEREncExtensionBitClear(enc))
  1867. return 0;
  1868. if (!ASN1PEREncObjectIdentifier(enc, &(val)->protocolIdentifier))
  1869. return 0;
  1870. return 1;
  1871. }
  1872. static int ASN1CALL ASN1Dec_UI_UUIE(ASN1decoding_t dec, UI_UUIE *val)
  1873. {
  1874. ASN1uint32_t y;
  1875. if (!ASN1PERDecExtensionBit(dec, &y))
  1876. return 0;
  1877. if (!ASN1PERDecObjectIdentifier(dec, &(val)->protocolIdentifier))
  1878. return 0;
  1879. if (y) {
  1880. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  1881. return 0;
  1882. }
  1883. return 1;
  1884. }
  1885. static void ASN1CALL ASN1Free_UI_UUIE(UI_UUIE *val)
  1886. {
  1887. if (val) {
  1888. ASN1objectidentifier_free(&(val)->protocolIdentifier);
  1889. }
  1890. }
  1891. static int ASN1CALL ASN1Enc_ReleaseCompleteReason(ASN1encoding_t enc, ReleaseCompleteReason *val)
  1892. {
  1893. if (!ASN1PEREncSimpleChoiceEx(enc, (val)->choice, 4))
  1894. return 0;
  1895. return 1;
  1896. }
  1897. static int ASN1CALL ASN1Dec_ReleaseCompleteReason(ASN1decoding_t dec, ReleaseCompleteReason *val)
  1898. {
  1899. if (!ASN1PERDecSimpleChoiceEx(dec, &(val)->choice, 4))
  1900. return 0;
  1901. return 1;
  1902. }
  1903. static int ASN1CALL ASN1Enc_ReleaseComplete_UUIE(ASN1encoding_t enc, ReleaseComplete_UUIE *val)
  1904. {
  1905. if (!ASN1PEREncExtensionBitClear(enc))
  1906. return 0;
  1907. if (!ASN1PEREncBits(enc, 1, (val)->o))
  1908. return 0;
  1909. if (!ASN1PEREncObjectIdentifier(enc, &(val)->protocolIdentifier))
  1910. return 0;
  1911. if ((val)->o[0] & 0x80) {
  1912. if (!ASN1Enc_ReleaseCompleteReason(enc, &(val)->reason))
  1913. return 0;
  1914. }
  1915. return 1;
  1916. }
  1917. static int ASN1CALL ASN1Dec_ReleaseComplete_UUIE(ASN1decoding_t dec, ReleaseComplete_UUIE *val)
  1918. {
  1919. ASN1uint32_t y;
  1920. if (!ASN1PERDecExtensionBit(dec, &y))
  1921. return 0;
  1922. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  1923. return 0;
  1924. if (!ASN1PERDecObjectIdentifier(dec, &(val)->protocolIdentifier))
  1925. return 0;
  1926. if ((val)->o[0] & 0x80) {
  1927. if (!ASN1Dec_ReleaseCompleteReason(dec, &(val)->reason))
  1928. return 0;
  1929. }
  1930. if (y) {
  1931. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  1932. return 0;
  1933. }
  1934. return 1;
  1935. }
  1936. static void ASN1CALL ASN1Free_ReleaseComplete_UUIE(ReleaseComplete_UUIE *val)
  1937. {
  1938. if (val) {
  1939. ASN1objectidentifier_free(&(val)->protocolIdentifier);
  1940. }
  1941. }
  1942. static int ASN1CALL ASN1Enc_FacilityReason(ASN1encoding_t enc, FacilityReason *val)
  1943. {
  1944. if (!ASN1PEREncSimpleChoiceEx(enc, (val)->choice, 2))
  1945. return 0;
  1946. return 1;
  1947. }
  1948. static int ASN1CALL ASN1Dec_FacilityReason(ASN1decoding_t dec, FacilityReason *val)
  1949. {
  1950. if (!ASN1PERDecSimpleChoiceEx(dec, &(val)->choice, 2))
  1951. return 0;
  1952. return 1;
  1953. }
  1954. static int ASN1CALL ASN1Enc_Facility_UUIE(ASN1encoding_t enc, Facility_UUIE *val)
  1955. {
  1956. if (!ASN1PEREncExtensionBitClear(enc))
  1957. return 0;
  1958. if (!ASN1PEREncBits(enc, 3, (val)->o))
  1959. return 0;
  1960. if (!ASN1PEREncObjectIdentifier(enc, &(val)->protocolIdentifier))
  1961. return 0;
  1962. if ((val)->o[0] & 0x80) {
  1963. if (!ASN1Enc_TransportAddress(enc, &(val)->alternativeAddress))
  1964. return 0;
  1965. }
  1966. if ((val)->o[0] & 0x40) {
  1967. if (!ASN1Enc_Facility_UUIE_alternativeAliasAddress(enc, &(val)->alternativeAliasAddress))
  1968. return 0;
  1969. }
  1970. if ((val)->o[0] & 0x20) {
  1971. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &(val)->conferenceID, 16))
  1972. return 0;
  1973. }
  1974. if (!ASN1Enc_FacilityReason(enc, &(val)->reason))
  1975. return 0;
  1976. return 1;
  1977. }
  1978. static int ASN1CALL ASN1Dec_Facility_UUIE(ASN1decoding_t dec, Facility_UUIE *val)
  1979. {
  1980. ASN1uint32_t y;
  1981. if (!ASN1PERDecExtensionBit(dec, &y))
  1982. return 0;
  1983. if (!ASN1PERDecExtension(dec, 3, (val)->o))
  1984. return 0;
  1985. if (!ASN1PERDecObjectIdentifier(dec, &(val)->protocolIdentifier))
  1986. return 0;
  1987. if ((val)->o[0] & 0x80) {
  1988. if (!ASN1Dec_TransportAddress(dec, &(val)->alternativeAddress))
  1989. return 0;
  1990. }
  1991. if ((val)->o[0] & 0x40) {
  1992. if (!ASN1Dec_Facility_UUIE_alternativeAliasAddress(dec, &(val)->alternativeAliasAddress))
  1993. return 0;
  1994. }
  1995. if ((val)->o[0] & 0x20) {
  1996. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &(val)->conferenceID, 16))
  1997. return 0;
  1998. }
  1999. if (!ASN1Dec_FacilityReason(dec, &(val)->reason))
  2000. return 0;
  2001. if (y) {
  2002. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  2003. return 0;
  2004. }
  2005. return 1;
  2006. }
  2007. static void ASN1CALL ASN1Free_Facility_UUIE(Facility_UUIE *val)
  2008. {
  2009. if (val) {
  2010. ASN1objectidentifier_free(&(val)->protocolIdentifier);
  2011. if ((val)->o[0] & 0x80) {
  2012. ASN1Free_TransportAddress(&(val)->alternativeAddress);
  2013. }
  2014. if ((val)->o[0] & 0x40) {
  2015. ASN1Free_Facility_UUIE_alternativeAliasAddress(&(val)->alternativeAliasAddress);
  2016. }
  2017. if ((val)->o[0] & 0x20) {
  2018. }
  2019. }
  2020. }
  2021. static int ASN1CALL ASN1Enc_H323_UU_PDU_h323_message_body(ASN1encoding_t enc, H323_UU_PDU_h323_message_body *val)
  2022. {
  2023. if (!ASN1PEREncSimpleChoiceEx(enc, (val)->choice, 3))
  2024. return 0;
  2025. switch ((val)->choice) {
  2026. case 1:
  2027. if (!ASN1Enc_Setup_UUIE(enc, &(val)->u.setup))
  2028. return 0;
  2029. break;
  2030. case 2:
  2031. if (!ASN1Enc_CallProceeding_UUIE(enc, &(val)->u.callProceeding))
  2032. return 0;
  2033. break;
  2034. case 3:
  2035. if (!ASN1Enc_Connect_UUIE(enc, &(val)->u.connect))
  2036. return 0;
  2037. break;
  2038. case 4:
  2039. if (!ASN1Enc_Alerting_UUIE(enc, &(val)->u.alerting))
  2040. return 0;
  2041. break;
  2042. case 5:
  2043. if (!ASN1Enc_UI_UUIE(enc, &(val)->u.userInformation))
  2044. return 0;
  2045. break;
  2046. case 6:
  2047. if (!ASN1Enc_ReleaseComplete_UUIE(enc, &(val)->u.releaseComplete))
  2048. return 0;
  2049. break;
  2050. case 7:
  2051. if (!ASN1Enc_Facility_UUIE(enc, &(val)->u.facility))
  2052. return 0;
  2053. break;
  2054. default:
  2055. /* impossible */
  2056. ASN1EncSetError(enc, ASN1_ERR_CHOICE);
  2057. return 0;
  2058. }
  2059. return 1;
  2060. }
  2061. static int ASN1CALL ASN1Dec_H323_UU_PDU_h323_message_body(ASN1decoding_t dec, H323_UU_PDU_h323_message_body *val)
  2062. {
  2063. if (!ASN1PERDecSimpleChoiceEx(dec, &(val)->choice, 3))
  2064. return 0;
  2065. switch ((val)->choice) {
  2066. case 1:
  2067. if (!ASN1Dec_Setup_UUIE(dec, &(val)->u.setup))
  2068. return 0;
  2069. break;
  2070. case 2:
  2071. if (!ASN1Dec_CallProceeding_UUIE(dec, &(val)->u.callProceeding))
  2072. return 0;
  2073. break;
  2074. case 3:
  2075. if (!ASN1Dec_Connect_UUIE(dec, &(val)->u.connect))
  2076. return 0;
  2077. break;
  2078. case 4:
  2079. if (!ASN1Dec_Alerting_UUIE(dec, &(val)->u.alerting))
  2080. return 0;
  2081. break;
  2082. case 5:
  2083. if (!ASN1Dec_UI_UUIE(dec, &(val)->u.userInformation))
  2084. return 0;
  2085. break;
  2086. case 6:
  2087. if (!ASN1Dec_ReleaseComplete_UUIE(dec, &(val)->u.releaseComplete))
  2088. return 0;
  2089. break;
  2090. case 7:
  2091. if (!ASN1Dec_Facility_UUIE(dec, &(val)->u.facility))
  2092. return 0;
  2093. break;
  2094. case 0:
  2095. /* extension case */
  2096. if (!ASN1PERDecSkipFragmented(dec, 8))
  2097. return 0;
  2098. break;
  2099. default:
  2100. /* impossible */
  2101. ASN1DecSetError(dec, ASN1_ERR_CHOICE);
  2102. return 0;
  2103. }
  2104. return 1;
  2105. }
  2106. static void ASN1CALL ASN1Free_H323_UU_PDU_h323_message_body(H323_UU_PDU_h323_message_body *val)
  2107. {
  2108. if (val) {
  2109. switch ((val)->choice) {
  2110. case 1:
  2111. ASN1Free_Setup_UUIE(&(val)->u.setup);
  2112. break;
  2113. case 2:
  2114. ASN1Free_CallProceeding_UUIE(&(val)->u.callProceeding);
  2115. break;
  2116. case 3:
  2117. ASN1Free_Connect_UUIE(&(val)->u.connect);
  2118. break;
  2119. case 4:
  2120. ASN1Free_Alerting_UUIE(&(val)->u.alerting);
  2121. break;
  2122. case 5:
  2123. ASN1Free_UI_UUIE(&(val)->u.userInformation);
  2124. break;
  2125. case 6:
  2126. ASN1Free_ReleaseComplete_UUIE(&(val)->u.releaseComplete);
  2127. break;
  2128. case 7:
  2129. ASN1Free_Facility_UUIE(&(val)->u.facility);
  2130. break;
  2131. }
  2132. }
  2133. }
  2134. static int ASN1CALL ASN1Enc_Facility_UUIE_alternativeAliasAddress(ASN1encoding_t enc, PFacility_UUIE_alternativeAliasAddress *val)
  2135. {
  2136. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_Facility_UUIE_alternativeAliasAddress_ElmFn);
  2137. }
  2138. static int ASN1CALL ASN1Enc_Facility_UUIE_alternativeAliasAddress_ElmFn(ASN1encoding_t enc, PFacility_UUIE_alternativeAliasAddress val)
  2139. {
  2140. if (!ASN1Enc_AliasAddress(enc, &val->value))
  2141. return 0;
  2142. return 1;
  2143. }
  2144. static int ASN1CALL ASN1Dec_Facility_UUIE_alternativeAliasAddress(ASN1decoding_t dec, PFacility_UUIE_alternativeAliasAddress *val)
  2145. {
  2146. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_Facility_UUIE_alternativeAliasAddress_ElmFn, sizeof(**val));
  2147. }
  2148. static int ASN1CALL ASN1Dec_Facility_UUIE_alternativeAliasAddress_ElmFn(ASN1decoding_t dec, PFacility_UUIE_alternativeAliasAddress val)
  2149. {
  2150. if (!ASN1Dec_AliasAddress(dec, &val->value))
  2151. return 0;
  2152. return 1;
  2153. }
  2154. static void ASN1CALL ASN1Free_Facility_UUIE_alternativeAliasAddress(PFacility_UUIE_alternativeAliasAddress *val)
  2155. {
  2156. if (val) {
  2157. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_Facility_UUIE_alternativeAliasAddress_ElmFn);
  2158. }
  2159. }
  2160. static void ASN1CALL ASN1Free_Facility_UUIE_alternativeAliasAddress_ElmFn(PFacility_UUIE_alternativeAliasAddress val)
  2161. {
  2162. if (val) {
  2163. ASN1Free_AliasAddress(&val->value);
  2164. }
  2165. }
  2166. static int ASN1CALL ASN1Enc_Setup_UUIE_destExtraCallInfo(ASN1encoding_t enc, PSetup_UUIE_destExtraCallInfo *val)
  2167. {
  2168. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_Setup_UUIE_destExtraCallInfo_ElmFn);
  2169. }
  2170. static int ASN1CALL ASN1Enc_Setup_UUIE_destExtraCallInfo_ElmFn(ASN1encoding_t enc, PSetup_UUIE_destExtraCallInfo val)
  2171. {
  2172. if (!ASN1Enc_AliasAddress(enc, &val->value))
  2173. return 0;
  2174. return 1;
  2175. }
  2176. static int ASN1CALL ASN1Dec_Setup_UUIE_destExtraCallInfo(ASN1decoding_t dec, PSetup_UUIE_destExtraCallInfo *val)
  2177. {
  2178. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_Setup_UUIE_destExtraCallInfo_ElmFn, sizeof(**val));
  2179. }
  2180. static int ASN1CALL ASN1Dec_Setup_UUIE_destExtraCallInfo_ElmFn(ASN1decoding_t dec, PSetup_UUIE_destExtraCallInfo val)
  2181. {
  2182. if (!ASN1Dec_AliasAddress(dec, &val->value))
  2183. return 0;
  2184. return 1;
  2185. }
  2186. static void ASN1CALL ASN1Free_Setup_UUIE_destExtraCallInfo(PSetup_UUIE_destExtraCallInfo *val)
  2187. {
  2188. if (val) {
  2189. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_Setup_UUIE_destExtraCallInfo_ElmFn);
  2190. }
  2191. }
  2192. static void ASN1CALL ASN1Free_Setup_UUIE_destExtraCallInfo_ElmFn(PSetup_UUIE_destExtraCallInfo val)
  2193. {
  2194. if (val) {
  2195. ASN1Free_AliasAddress(&val->value);
  2196. }
  2197. }
  2198. static int ASN1CALL ASN1Enc_Setup_UUIE_destinationAddress(ASN1encoding_t enc, PSetup_UUIE_destinationAddress *val)
  2199. {
  2200. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_Setup_UUIE_destinationAddress_ElmFn);
  2201. }
  2202. static int ASN1CALL ASN1Enc_Setup_UUIE_destinationAddress_ElmFn(ASN1encoding_t enc, PSetup_UUIE_destinationAddress val)
  2203. {
  2204. if (!ASN1Enc_AliasAddress(enc, &val->value))
  2205. return 0;
  2206. return 1;
  2207. }
  2208. static int ASN1CALL ASN1Dec_Setup_UUIE_destinationAddress(ASN1decoding_t dec, PSetup_UUIE_destinationAddress *val)
  2209. {
  2210. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_Setup_UUIE_destinationAddress_ElmFn, sizeof(**val));
  2211. }
  2212. static int ASN1CALL ASN1Dec_Setup_UUIE_destinationAddress_ElmFn(ASN1decoding_t dec, PSetup_UUIE_destinationAddress val)
  2213. {
  2214. if (!ASN1Dec_AliasAddress(dec, &val->value))
  2215. return 0;
  2216. return 1;
  2217. }
  2218. static void ASN1CALL ASN1Free_Setup_UUIE_destinationAddress(PSetup_UUIE_destinationAddress *val)
  2219. {
  2220. if (val) {
  2221. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_Setup_UUIE_destinationAddress_ElmFn);
  2222. }
  2223. }
  2224. static void ASN1CALL ASN1Free_Setup_UUIE_destinationAddress_ElmFn(PSetup_UUIE_destinationAddress val)
  2225. {
  2226. if (val) {
  2227. ASN1Free_AliasAddress(&val->value);
  2228. }
  2229. }
  2230. static int ASN1CALL ASN1Enc_Setup_UUIE_sourceAddress(ASN1encoding_t enc, PSetup_UUIE_sourceAddress *val)
  2231. {
  2232. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_Setup_UUIE_sourceAddress_ElmFn);
  2233. }
  2234. static int ASN1CALL ASN1Enc_Setup_UUIE_sourceAddress_ElmFn(ASN1encoding_t enc, PSetup_UUIE_sourceAddress val)
  2235. {
  2236. if (!ASN1Enc_AliasAddress(enc, &val->value))
  2237. return 0;
  2238. return 1;
  2239. }
  2240. static int ASN1CALL ASN1Dec_Setup_UUIE_sourceAddress(ASN1decoding_t dec, PSetup_UUIE_sourceAddress *val)
  2241. {
  2242. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_Setup_UUIE_sourceAddress_ElmFn, sizeof(**val));
  2243. }
  2244. static int ASN1CALL ASN1Dec_Setup_UUIE_sourceAddress_ElmFn(ASN1decoding_t dec, PSetup_UUIE_sourceAddress val)
  2245. {
  2246. if (!ASN1Dec_AliasAddress(dec, &val->value))
  2247. return 0;
  2248. return 1;
  2249. }
  2250. static void ASN1CALL ASN1Free_Setup_UUIE_sourceAddress(PSetup_UUIE_sourceAddress *val)
  2251. {
  2252. if (val) {
  2253. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_Setup_UUIE_sourceAddress_ElmFn);
  2254. }
  2255. }
  2256. static void ASN1CALL ASN1Free_Setup_UUIE_sourceAddress_ElmFn(PSetup_UUIE_sourceAddress val)
  2257. {
  2258. if (val) {
  2259. ASN1Free_AliasAddress(&val->value);
  2260. }
  2261. }
  2262. static int ASN1CALL ASN1Enc_GatewayInfo_protocol(ASN1encoding_t enc, PGatewayInfo_protocol *val)
  2263. {
  2264. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_GatewayInfo_protocol_ElmFn);
  2265. }
  2266. static int ASN1CALL ASN1Enc_GatewayInfo_protocol_ElmFn(ASN1encoding_t enc, PGatewayInfo_protocol val)
  2267. {
  2268. if (!ASN1Enc_SupportedProtocols(enc, &val->value))
  2269. return 0;
  2270. return 1;
  2271. }
  2272. static int ASN1CALL ASN1Dec_GatewayInfo_protocol(ASN1decoding_t dec, PGatewayInfo_protocol *val)
  2273. {
  2274. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_GatewayInfo_protocol_ElmFn, sizeof(**val));
  2275. }
  2276. static int ASN1CALL ASN1Dec_GatewayInfo_protocol_ElmFn(ASN1decoding_t dec, PGatewayInfo_protocol val)
  2277. {
  2278. if (!ASN1Dec_SupportedProtocols(dec, &val->value))
  2279. return 0;
  2280. return 1;
  2281. }
  2282. static void ASN1CALL ASN1Free_GatewayInfo_protocol(PGatewayInfo_protocol *val)
  2283. {
  2284. if (val) {
  2285. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_GatewayInfo_protocol_ElmFn);
  2286. }
  2287. }
  2288. static void ASN1CALL ASN1Free_GatewayInfo_protocol_ElmFn(PGatewayInfo_protocol val)
  2289. {
  2290. if (val) {
  2291. ASN1Free_SupportedProtocols(&val->value);
  2292. }
  2293. }
  2294. static int ASN1CALL ASN1Enc_H323_UU_PDU(ASN1encoding_t enc, H323_UU_PDU *val)
  2295. {
  2296. if (!ASN1PEREncExtensionBitClear(enc))
  2297. return 0;
  2298. if (!ASN1PEREncBits(enc, 1, (val)->o))
  2299. return 0;
  2300. if (!ASN1Enc_H323_UU_PDU_h323_message_body(enc, &(val)->h323_message_body))
  2301. return 0;
  2302. if ((val)->o[0] & 0x80) {
  2303. if (!ASN1Enc_NonStandardParameter(enc, &(val)->nonStandardData))
  2304. return 0;
  2305. }
  2306. return 1;
  2307. }
  2308. static int ASN1CALL ASN1Dec_H323_UU_PDU(ASN1decoding_t dec, H323_UU_PDU *val)
  2309. {
  2310. ASN1uint32_t y;
  2311. if (!ASN1PERDecExtensionBit(dec, &y))
  2312. return 0;
  2313. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  2314. return 0;
  2315. if (!ASN1Dec_H323_UU_PDU_h323_message_body(dec, &(val)->h323_message_body))
  2316. return 0;
  2317. if ((val)->o[0] & 0x80) {
  2318. if (!ASN1Dec_NonStandardParameter(dec, &(val)->nonStandardData))
  2319. return 0;
  2320. }
  2321. if (y) {
  2322. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  2323. return 0;
  2324. }
  2325. return 1;
  2326. }
  2327. static void ASN1CALL ASN1Free_H323_UU_PDU(H323_UU_PDU *val)
  2328. {
  2329. if (val) {
  2330. ASN1Free_H323_UU_PDU_h323_message_body(&(val)->h323_message_body);
  2331. if ((val)->o[0] & 0x80) {
  2332. ASN1Free_NonStandardParameter(&(val)->nonStandardData);
  2333. }
  2334. }
  2335. }
  2336. static int ASN1CALL ASN1Enc_H323_UserInformation(ASN1encoding_t enc, H323_UserInformation *val)
  2337. {
  2338. if (!ASN1PEREncExtensionBitClear(enc))
  2339. return 0;
  2340. if (!ASN1PEREncBits(enc, 1, (val)->o))
  2341. return 0;
  2342. if (!ASN1Enc_H323_UU_PDU(enc, &(val)->h323_uu_pdu))
  2343. return 0;
  2344. if ((val)->o[0] & 0x80) {
  2345. if (!ASN1Enc_H323_UserInformation_user_data(enc, &(val)->user_data))
  2346. return 0;
  2347. }
  2348. return 1;
  2349. }
  2350. static int ASN1CALL ASN1Dec_H323_UserInformation(ASN1decoding_t dec, H323_UserInformation *val)
  2351. {
  2352. ASN1uint32_t y;
  2353. if (!ASN1PERDecExtensionBit(dec, &y))
  2354. return 0;
  2355. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  2356. return 0;
  2357. if (!ASN1Dec_H323_UU_PDU(dec, &(val)->h323_uu_pdu))
  2358. return 0;
  2359. if ((val)->o[0] & 0x80) {
  2360. if (!ASN1Dec_H323_UserInformation_user_data(dec, &(val)->user_data))
  2361. return 0;
  2362. }
  2363. if (y) {
  2364. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  2365. return 0;
  2366. }
  2367. return 1;
  2368. }
  2369. static void ASN1CALL ASN1Free_H323_UserInformation(H323_UserInformation *val)
  2370. {
  2371. if (val) {
  2372. ASN1Free_H323_UU_PDU(&(val)->h323_uu_pdu);
  2373. if ((val)->o[0] & 0x80) {
  2374. ASN1Free_H323_UserInformation_user_data(&(val)->user_data);
  2375. }
  2376. }
  2377. }