Leaked source code of windows server 2003
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.

1949 lines
75 KiB

  1. /* Copyright (C) Microsoft Corporation, 1999. All rights reserved. */
  2. /* ASN.1 definitions for Connection Negotiation Protocol (GNP) */
  3. #include <windows.h>
  4. #include "cnppdu.h"
  5. ASN1module_t CNPPDU_Module = NULL;
  6. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipSourceRoute_route(ASN1encoding_t enc, PCNP_TransportAddress_ipSourceRoute_route *val);
  7. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ip6Address(ASN1encoding_t enc, CNP_TransportAddress_ip6Address *val);
  8. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipxAddress(ASN1encoding_t enc, CNP_TransportAddress_ipxAddress *val);
  9. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipAddress(ASN1encoding_t enc, CNP_TransportAddress_ipAddress *val);
  10. static int ASN1CALL ASN1Enc_H221NonStandard(ASN1encoding_t enc, H221NonStandard *val);
  11. static int ASN1CALL ASN1Enc_NonStandardIdentifier(ASN1encoding_t enc, NonStandardIdentifier *val);
  12. static int ASN1CALL ASN1Enc_CNP_NonStandardParameter(ASN1encoding_t enc, CNP_NonStandardParameter *val);
  13. #define ASN1Enc_PublicTypeOfNumber(x,y) 0
  14. #define ASN1Enc_PublicPartyNumber(x,y) 0
  15. #define ASN1Enc_PrivateTypeOfNumber(x,y) 0
  16. #define ASN1Enc_PrivatePartyNumber(x,y) 0
  17. #define ASN1Enc_PartyNumber(x,y) 0
  18. #define ASN1Enc_ReliableTransportProtocolType(x,y) 0
  19. #define ASN1Enc_ReliableTransportProtocol(x,y) 0
  20. #define ASN1Enc_UnreliableTransportProtocolType(x,y) 0
  21. #define ASN1Enc_UnreliableSecurityProtocol(x,y) 0
  22. static int ASN1CALL ASN1Enc_X274WithSAIDInfo(ASN1encoding_t enc, X274WithSAIDInfo *val);
  23. static int ASN1CALL ASN1Enc_ConnectRequestPDU(ASN1encoding_t enc, ConnectRequestPDU *val);
  24. static int ASN1CALL ASN1Enc_DisconnectReason(ASN1encoding_t enc, DisconnectReason *val);
  25. #define ASN1Enc_RejectCause(x,y) 0
  26. #define ASN1Enc_ErrorPDU(x,y) 0
  27. #define ASN1Enc_CNP_NonStandardPDU(x,y) 0
  28. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipAddress_nonStandardParameters(ASN1encoding_t enc, PCNP_TransportAddress_ipAddress_nonStandardParameters *val);
  29. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipSourceRoute_nonStandardParameters(ASN1encoding_t enc, PCNP_TransportAddress_ipSourceRoute_nonStandardParameters *val);
  30. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipSourceRoute_routing(ASN1encoding_t enc, CNP_TransportAddress_ipSourceRoute_routing *val);
  31. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipxAddress_nonStandardParameters(ASN1encoding_t enc, PCNP_TransportAddress_ipxAddress_nonStandardParameters *val);
  32. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ip6Address_nonStandardParameters(ASN1encoding_t enc, PCNP_TransportAddress_ip6Address_nonStandardParameters *val);
  33. static int ASN1CALL ASN1Enc_CNP_NonStandardPDU_nonStandardParameters(ASN1encoding_t enc, PCNP_NonStandardPDU_nonStandardParameters *val);
  34. static int ASN1CALL ASN1Enc_ErrorPDU_nonStandardParameters(ASN1encoding_t enc, PErrorPDU_nonStandardParameters *val);
  35. static int ASN1CALL ASN1Enc_DisconnectRequestPDU_nonStandardParameters(ASN1encoding_t enc, PDisconnectRequestPDU_nonStandardParameters *val);
  36. static int ASN1CALL ASN1Enc_ConnectConfirmPDU_nonStandardParameters(ASN1encoding_t enc, PConnectConfirmPDU_nonStandardParameters *val);
  37. static int ASN1CALL ASN1Enc_ConnectRequestPDU_nonStandardParameters(ASN1encoding_t enc, PConnectRequestPDU_nonStandardParameters *val);
  38. static int ASN1CALL ASN1Enc_ConnectRequestPDU_unreliableSecurityProtocols(ASN1encoding_t enc, PConnectRequestPDU_unreliableSecurityProtocols *val);
  39. static int ASN1CALL ASN1Enc_ConnectRequestPDU_reliableTransportProtocols(ASN1encoding_t enc, PConnectRequestPDU_reliableTransportProtocols *val);
  40. static int ASN1CALL ASN1Enc_UnreliableTransportProtocol_nonStandardParameters(ASN1encoding_t enc, PUnreliableTransportProtocol_nonStandardParameters *val);
  41. static int ASN1CALL ASN1Enc_ReliableTransportProtocol_nonStandardParameters(ASN1encoding_t enc, PReliableTransportProtocol_nonStandardParameters *val);
  42. static int ASN1CALL ASN1Enc_PrivatePartyNumber_nonStandardParameters(ASN1encoding_t enc, PPrivatePartyNumber_nonStandardParameters *val);
  43. static int ASN1CALL ASN1Enc_PublicPartyNumber_nonStandardParameters(ASN1encoding_t enc, PPublicPartyNumber_nonStandardParameters *val);
  44. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipSourceRoute(ASN1encoding_t enc, CNP_TransportAddress_ipSourceRoute *val);
  45. #define ASN1Enc_CNP_TransportAddress(x,y) 0
  46. #define ASN1Enc_AliasAddress(x,y) 0
  47. static int ASN1CALL ASN1Enc_ReliableSecurityProtocol(ASN1encoding_t enc, ReliableSecurityProtocol *val);
  48. #define ASN1Enc_UnreliableTransportProtocol(x,y) 0
  49. static int ASN1CALL ASN1Enc_ConnectConfirmPDU(ASN1encoding_t enc, ConnectConfirmPDU *val);
  50. static int ASN1CALL ASN1Enc_DisconnectRequestPDU(ASN1encoding_t enc, DisconnectRequestPDU *val);
  51. static int ASN1CALL ASN1Enc_CNPPDU(ASN1encoding_t enc, CNPPDU *val);
  52. static int ASN1CALL ASN1Enc_DisconnectRequestPDU_destinationAddress(ASN1encoding_t enc, PDisconnectRequestPDU_destinationAddress *val);
  53. static int ASN1CALL ASN1Enc_ConnectRequestPDU_destinationAddress(ASN1encoding_t enc, PConnectRequestPDU_destinationAddress *val);
  54. static int ASN1CALL ASN1Enc_ConnectRequestPDU_unreliableTransportProtocols(ASN1encoding_t enc, PConnectRequestPDU_unreliableTransportProtocols *val);
  55. static int ASN1CALL ASN1Enc_ConnectRequestPDU_reliableSecurityProtocols(ASN1encoding_t enc, PConnectRequestPDU_reliableSecurityProtocols *val);
  56. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipSourceRoute_route(ASN1decoding_t dec, PCNP_TransportAddress_ipSourceRoute_route *val);
  57. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ip6Address(ASN1decoding_t dec, CNP_TransportAddress_ip6Address *val);
  58. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipxAddress(ASN1decoding_t dec, CNP_TransportAddress_ipxAddress *val);
  59. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipAddress(ASN1decoding_t dec, CNP_TransportAddress_ipAddress *val);
  60. static int ASN1CALL ASN1Dec_H221NonStandard(ASN1decoding_t dec, H221NonStandard *val);
  61. static int ASN1CALL ASN1Dec_NonStandardIdentifier(ASN1decoding_t dec, NonStandardIdentifier *val);
  62. static int ASN1CALL ASN1Dec_CNP_NonStandardParameter(ASN1decoding_t dec, CNP_NonStandardParameter *val);
  63. #define ASN1Dec_PublicTypeOfNumber(x,y) 0
  64. #define ASN1Dec_PublicPartyNumber(x,y) 0
  65. #define ASN1Dec_PrivateTypeOfNumber(x,y) 0
  66. #define ASN1Dec_PrivatePartyNumber(x,y) 0
  67. #define ASN1Dec_PartyNumber(x,y) 0
  68. #define ASN1Dec_ReliableTransportProtocolType(x,y) 0
  69. #define ASN1Dec_ReliableTransportProtocol(x,y) 0
  70. #define ASN1Dec_UnreliableTransportProtocolType(x,y) 0
  71. #define ASN1Dec_UnreliableSecurityProtocol(x,y) 0
  72. static int ASN1CALL ASN1Dec_X274WithSAIDInfo(ASN1decoding_t dec, X274WithSAIDInfo *val);
  73. static int ASN1CALL ASN1Dec_ConnectRequestPDU(ASN1decoding_t dec, ConnectRequestPDU *val);
  74. static int ASN1CALL ASN1Dec_DisconnectReason(ASN1decoding_t dec, DisconnectReason *val);
  75. #define ASN1Dec_RejectCause(x,y) 0
  76. #define ASN1Dec_ErrorPDU(x,y) 0
  77. #define ASN1Dec_CNP_NonStandardPDU(x,y) 0
  78. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipAddress_nonStandardParameters(ASN1decoding_t dec, PCNP_TransportAddress_ipAddress_nonStandardParameters *val);
  79. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipSourceRoute_nonStandardParameters(ASN1decoding_t dec, PCNP_TransportAddress_ipSourceRoute_nonStandardParameters *val);
  80. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipSourceRoute_routing(ASN1decoding_t dec, CNP_TransportAddress_ipSourceRoute_routing *val);
  81. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipxAddress_nonStandardParameters(ASN1decoding_t dec, PCNP_TransportAddress_ipxAddress_nonStandardParameters *val);
  82. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ip6Address_nonStandardParameters(ASN1decoding_t dec, PCNP_TransportAddress_ip6Address_nonStandardParameters *val);
  83. static int ASN1CALL ASN1Dec_CNP_NonStandardPDU_nonStandardParameters(ASN1decoding_t dec, PCNP_NonStandardPDU_nonStandardParameters *val);
  84. static int ASN1CALL ASN1Dec_ErrorPDU_nonStandardParameters(ASN1decoding_t dec, PErrorPDU_nonStandardParameters *val);
  85. static int ASN1CALL ASN1Dec_DisconnectRequestPDU_nonStandardParameters(ASN1decoding_t dec, PDisconnectRequestPDU_nonStandardParameters *val);
  86. static int ASN1CALL ASN1Dec_ConnectConfirmPDU_nonStandardParameters(ASN1decoding_t dec, PConnectConfirmPDU_nonStandardParameters *val);
  87. static int ASN1CALL ASN1Dec_ConnectRequestPDU_nonStandardParameters(ASN1decoding_t dec, PConnectRequestPDU_nonStandardParameters *val);
  88. static int ASN1CALL ASN1Dec_ConnectRequestPDU_unreliableSecurityProtocols(ASN1decoding_t dec, PConnectRequestPDU_unreliableSecurityProtocols *val);
  89. static int ASN1CALL ASN1Dec_ConnectRequestPDU_reliableTransportProtocols(ASN1decoding_t dec, PConnectRequestPDU_reliableTransportProtocols *val);
  90. static int ASN1CALL ASN1Dec_UnreliableTransportProtocol_nonStandardParameters(ASN1decoding_t dec, PUnreliableTransportProtocol_nonStandardParameters *val);
  91. static int ASN1CALL ASN1Dec_ReliableTransportProtocol_nonStandardParameters(ASN1decoding_t dec, PReliableTransportProtocol_nonStandardParameters *val);
  92. static int ASN1CALL ASN1Dec_PrivatePartyNumber_nonStandardParameters(ASN1decoding_t dec, PPrivatePartyNumber_nonStandardParameters *val);
  93. static int ASN1CALL ASN1Dec_PublicPartyNumber_nonStandardParameters(ASN1decoding_t dec, PPublicPartyNumber_nonStandardParameters *val);
  94. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipSourceRoute(ASN1decoding_t dec, CNP_TransportAddress_ipSourceRoute *val);
  95. #define ASN1Dec_CNP_TransportAddress(x,y) 0
  96. #define ASN1Dec_AliasAddress(x,y) 0
  97. static int ASN1CALL ASN1Dec_ReliableSecurityProtocol(ASN1decoding_t dec, ReliableSecurityProtocol *val);
  98. #define ASN1Dec_UnreliableTransportProtocol(x,y) 0
  99. static int ASN1CALL ASN1Dec_ConnectConfirmPDU(ASN1decoding_t dec, ConnectConfirmPDU *val);
  100. static int ASN1CALL ASN1Dec_DisconnectRequestPDU(ASN1decoding_t dec, DisconnectRequestPDU *val);
  101. static int ASN1CALL ASN1Dec_CNPPDU(ASN1decoding_t dec, CNPPDU *val);
  102. static int ASN1CALL ASN1Dec_DisconnectRequestPDU_destinationAddress(ASN1decoding_t dec, PDisconnectRequestPDU_destinationAddress *val);
  103. static int ASN1CALL ASN1Dec_ConnectRequestPDU_destinationAddress(ASN1decoding_t dec, PConnectRequestPDU_destinationAddress *val);
  104. static int ASN1CALL ASN1Dec_ConnectRequestPDU_unreliableTransportProtocols(ASN1decoding_t dec, PConnectRequestPDU_unreliableTransportProtocols *val);
  105. static int ASN1CALL ASN1Dec_ConnectRequestPDU_reliableSecurityProtocols(ASN1decoding_t dec, PConnectRequestPDU_reliableSecurityProtocols *val);
  106. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipSourceRoute_route(PCNP_TransportAddress_ipSourceRoute_route *val);
  107. static void ASN1CALL ASN1Free_CNP_TransportAddress_ip6Address(CNP_TransportAddress_ip6Address *val);
  108. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipxAddress(CNP_TransportAddress_ipxAddress *val);
  109. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipAddress(CNP_TransportAddress_ipAddress *val);
  110. static void ASN1CALL ASN1Free_NonStandardIdentifier(NonStandardIdentifier *val);
  111. static void ASN1CALL ASN1Free_CNP_NonStandardParameter(CNP_NonStandardParameter *val);
  112. #define ASN1Free_PublicTypeOfNumber(x)
  113. #define ASN1Free_PublicPartyNumber(x)
  114. #define ASN1Free_PrivateTypeOfNumber(x)
  115. #define ASN1Free_PrivatePartyNumber(x)
  116. #define ASN1Free_PartyNumber(x)
  117. #define ASN1Free_ReliableTransportProtocolType(x)
  118. #define ASN1Free_ReliableTransportProtocol(x)
  119. #define ASN1Free_UnreliableTransportProtocolType(x)
  120. #define ASN1Free_UnreliableSecurityProtocol(x)
  121. static void ASN1CALL ASN1Free_X274WithSAIDInfo(X274WithSAIDInfo *val);
  122. static void ASN1CALL ASN1Free_ConnectRequestPDU(ConnectRequestPDU *val);
  123. static void ASN1CALL ASN1Free_DisconnectReason(DisconnectReason *val);
  124. #define ASN1Free_RejectCause(x)
  125. #define ASN1Free_ErrorPDU(x)
  126. #define ASN1Free_CNP_NonStandardPDU(x)
  127. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipAddress_nonStandardParameters(PCNP_TransportAddress_ipAddress_nonStandardParameters *val);
  128. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipSourceRoute_nonStandardParameters(PCNP_TransportAddress_ipSourceRoute_nonStandardParameters *val);
  129. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipSourceRoute_routing(CNP_TransportAddress_ipSourceRoute_routing *val);
  130. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipxAddress_nonStandardParameters(PCNP_TransportAddress_ipxAddress_nonStandardParameters *val);
  131. static void ASN1CALL ASN1Free_CNP_TransportAddress_ip6Address_nonStandardParameters(PCNP_TransportAddress_ip6Address_nonStandardParameters *val);
  132. static void ASN1CALL ASN1Free_CNP_NonStandardPDU_nonStandardParameters(PCNP_NonStandardPDU_nonStandardParameters *val);
  133. static void ASN1CALL ASN1Free_ErrorPDU_nonStandardParameters(PErrorPDU_nonStandardParameters *val);
  134. static void ASN1CALL ASN1Free_DisconnectRequestPDU_nonStandardParameters(PDisconnectRequestPDU_nonStandardParameters *val);
  135. static void ASN1CALL ASN1Free_ConnectConfirmPDU_nonStandardParameters(PConnectConfirmPDU_nonStandardParameters *val);
  136. static void ASN1CALL ASN1Free_ConnectRequestPDU_nonStandardParameters(PConnectRequestPDU_nonStandardParameters *val);
  137. static void ASN1CALL ASN1Free_ConnectRequestPDU_unreliableSecurityProtocols(PConnectRequestPDU_unreliableSecurityProtocols *val);
  138. static void ASN1CALL ASN1Free_ConnectRequestPDU_reliableTransportProtocols(PConnectRequestPDU_reliableTransportProtocols *val);
  139. static void ASN1CALL ASN1Free_UnreliableTransportProtocol_nonStandardParameters(PUnreliableTransportProtocol_nonStandardParameters *val);
  140. static void ASN1CALL ASN1Free_ReliableTransportProtocol_nonStandardParameters(PReliableTransportProtocol_nonStandardParameters *val);
  141. static void ASN1CALL ASN1Free_PrivatePartyNumber_nonStandardParameters(PPrivatePartyNumber_nonStandardParameters *val);
  142. static void ASN1CALL ASN1Free_PublicPartyNumber_nonStandardParameters(PPublicPartyNumber_nonStandardParameters *val);
  143. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipSourceRoute(CNP_TransportAddress_ipSourceRoute *val);
  144. #define ASN1Free_CNP_TransportAddress(x)
  145. #define ASN1Free_AliasAddress(x)
  146. static void ASN1CALL ASN1Free_ReliableSecurityProtocol(ReliableSecurityProtocol *val);
  147. #define ASN1Free_UnreliableTransportProtocol(x)
  148. static void ASN1CALL ASN1Free_ConnectConfirmPDU(ConnectConfirmPDU *val);
  149. static void ASN1CALL ASN1Free_DisconnectRequestPDU(DisconnectRequestPDU *val);
  150. static void ASN1CALL ASN1Free_CNPPDU(CNPPDU *val);
  151. static void ASN1CALL ASN1Free_DisconnectRequestPDU_destinationAddress(PDisconnectRequestPDU_destinationAddress *val);
  152. static void ASN1CALL ASN1Free_ConnectRequestPDU_destinationAddress(PConnectRequestPDU_destinationAddress *val);
  153. static void ASN1CALL ASN1Free_ConnectRequestPDU_unreliableTransportProtocols(PConnectRequestPDU_unreliableTransportProtocols *val);
  154. static void ASN1CALL ASN1Free_ConnectRequestPDU_reliableSecurityProtocols(PConnectRequestPDU_reliableSecurityProtocols *val);
  155. typedef ASN1PerEncFun_t ASN1EncFun_t;
  156. static const ASN1EncFun_t encfntab[1] = {
  157. (ASN1EncFun_t) ASN1Enc_CNPPDU,
  158. };
  159. typedef ASN1PerDecFun_t ASN1DecFun_t;
  160. static const ASN1DecFun_t decfntab[1] = {
  161. (ASN1DecFun_t) ASN1Dec_CNPPDU,
  162. };
  163. static const ASN1FreeFun_t freefntab[1] = {
  164. (ASN1FreeFun_t) ASN1Free_CNPPDU,
  165. };
  166. static const ULONG sizetab[1] = {
  167. SIZE_CNPPDU_Module_PDU_0,
  168. };
  169. /* forward declarations of values: */
  170. extern ASN1uint32_t t123AnnexBProtocolId_elems[6];
  171. /* definitions of value components: */
  172. static const struct ASN1objectidentifier_s t123AnnexBProtocolId_list[6] = {
  173. { (ASN1objectidentifier_t) &(t123AnnexBProtocolId_list[1]), 0 },
  174. { (ASN1objectidentifier_t) &(t123AnnexBProtocolId_list[2]), 0 },
  175. { (ASN1objectidentifier_t) &(t123AnnexBProtocolId_list[3]), 20 },
  176. { (ASN1objectidentifier_t) &(t123AnnexBProtocolId_list[4]), 123 },
  177. { (ASN1objectidentifier_t) &(t123AnnexBProtocolId_list[5]), 2 },
  178. { NULL, 1 }
  179. };
  180. /* definitions of values: */
  181. ASN1objectidentifier_t t123AnnexBProtocolId = (ASN1objectidentifier_t) t123AnnexBProtocolId_list;
  182. void ASN1CALL CNPPDU_Module_Startup(void)
  183. {
  184. CNPPDU_Module = ASN1_CreateModule(0x10000, ASN1_PER_RULE_ALIGNED, ASN1FLAGS_NONE, 1, (const ASN1GenericFun_t *) encfntab, (const ASN1GenericFun_t *) decfntab, freefntab, sizetab, 0x706e63);
  185. }
  186. void ASN1CALL CNPPDU_Module_Cleanup(void)
  187. {
  188. ASN1_CloseModule(CNPPDU_Module);
  189. CNPPDU_Module = NULL;
  190. }
  191. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipSourceRoute_route(ASN1encoding_t enc, PCNP_TransportAddress_ipSourceRoute_route *val)
  192. {
  193. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_CNP_TransportAddress_ipSourceRoute_route_ElmFn);
  194. }
  195. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipSourceRoute_route_ElmFn(ASN1encoding_t enc, PCNP_TransportAddress_ipSourceRoute_route val)
  196. {
  197. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &val->value, 4))
  198. return 0;
  199. return 1;
  200. }
  201. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipSourceRoute_route(ASN1decoding_t dec, PCNP_TransportAddress_ipSourceRoute_route *val)
  202. {
  203. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_CNP_TransportAddress_ipSourceRoute_route_ElmFn, sizeof(**val));
  204. }
  205. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipSourceRoute_route_ElmFn(ASN1decoding_t dec, PCNP_TransportAddress_ipSourceRoute_route val)
  206. {
  207. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &val->value, 4))
  208. return 0;
  209. return 1;
  210. }
  211. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipSourceRoute_route(PCNP_TransportAddress_ipSourceRoute_route *val)
  212. {
  213. if (val) {
  214. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_CNP_TransportAddress_ipSourceRoute_route_ElmFn);
  215. }
  216. }
  217. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipSourceRoute_route_ElmFn(PCNP_TransportAddress_ipSourceRoute_route val)
  218. {
  219. if (val) {
  220. }
  221. }
  222. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ip6Address(ASN1encoding_t enc, CNP_TransportAddress_ip6Address *val)
  223. {
  224. if (!ASN1PEREncExtensionBitClear(enc))
  225. return 0;
  226. if (!ASN1PEREncBits(enc, 1, (val)->o))
  227. return 0;
  228. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &(val)->ip, 16))
  229. return 0;
  230. if (!ASN1PEREncUnsignedShort(enc, (val)->port))
  231. return 0;
  232. if ((val)->o[0] & 0x80) {
  233. if (!ASN1Enc_CNP_TransportAddress_ip6Address_nonStandardParameters(enc, &(val)->nonStandardParameters))
  234. return 0;
  235. }
  236. return 1;
  237. }
  238. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ip6Address(ASN1decoding_t dec, CNP_TransportAddress_ip6Address *val)
  239. {
  240. ASN1uint32_t y;
  241. if (!ASN1PERDecExtensionBit(dec, &y))
  242. return 0;
  243. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  244. return 0;
  245. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &(val)->ip, 16))
  246. return 0;
  247. if (!ASN1PERDecUnsignedShort(dec, &(val)->port))
  248. return 0;
  249. if ((val)->o[0] & 0x80) {
  250. if (!ASN1Dec_CNP_TransportAddress_ip6Address_nonStandardParameters(dec, &(val)->nonStandardParameters))
  251. return 0;
  252. }
  253. if (y) {
  254. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  255. return 0;
  256. }
  257. return 1;
  258. }
  259. static void ASN1CALL ASN1Free_CNP_TransportAddress_ip6Address(CNP_TransportAddress_ip6Address *val)
  260. {
  261. if (val) {
  262. if ((val)->o[0] & 0x80) {
  263. ASN1Free_CNP_TransportAddress_ip6Address_nonStandardParameters(&(val)->nonStandardParameters);
  264. }
  265. }
  266. }
  267. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipxAddress(ASN1encoding_t enc, CNP_TransportAddress_ipxAddress *val)
  268. {
  269. if (!ASN1PEREncExtensionBitClear(enc))
  270. return 0;
  271. if (!ASN1PEREncBits(enc, 1, (val)->o))
  272. return 0;
  273. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &(val)->node, 6))
  274. return 0;
  275. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &(val)->netnum, 4))
  276. return 0;
  277. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &(val)->port, 2))
  278. return 0;
  279. if ((val)->o[0] & 0x80) {
  280. if (!ASN1Enc_CNP_TransportAddress_ipxAddress_nonStandardParameters(enc, &(val)->nonStandardParameters))
  281. return 0;
  282. }
  283. return 1;
  284. }
  285. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipxAddress(ASN1decoding_t dec, CNP_TransportAddress_ipxAddress *val)
  286. {
  287. ASN1uint32_t y;
  288. if (!ASN1PERDecExtensionBit(dec, &y))
  289. return 0;
  290. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  291. return 0;
  292. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &(val)->node, 6))
  293. return 0;
  294. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &(val)->netnum, 4))
  295. return 0;
  296. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &(val)->port, 2))
  297. return 0;
  298. if ((val)->o[0] & 0x80) {
  299. if (!ASN1Dec_CNP_TransportAddress_ipxAddress_nonStandardParameters(dec, &(val)->nonStandardParameters))
  300. return 0;
  301. }
  302. if (y) {
  303. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  304. return 0;
  305. }
  306. return 1;
  307. }
  308. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipxAddress(CNP_TransportAddress_ipxAddress *val)
  309. {
  310. if (val) {
  311. if ((val)->o[0] & 0x80) {
  312. ASN1Free_CNP_TransportAddress_ipxAddress_nonStandardParameters(&(val)->nonStandardParameters);
  313. }
  314. }
  315. }
  316. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipAddress(ASN1encoding_t enc, CNP_TransportAddress_ipAddress *val)
  317. {
  318. if (!ASN1PEREncExtensionBitClear(enc))
  319. return 0;
  320. if (!ASN1PEREncBits(enc, 1, (val)->o))
  321. return 0;
  322. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &(val)->ip, 4))
  323. return 0;
  324. if (!ASN1PEREncUnsignedShort(enc, (val)->port))
  325. return 0;
  326. if ((val)->o[0] & 0x80) {
  327. if (!ASN1Enc_CNP_TransportAddress_ipAddress_nonStandardParameters(enc, &(val)->nonStandardParameters))
  328. return 0;
  329. }
  330. return 1;
  331. }
  332. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipAddress(ASN1decoding_t dec, CNP_TransportAddress_ipAddress *val)
  333. {
  334. ASN1uint32_t y;
  335. if (!ASN1PERDecExtensionBit(dec, &y))
  336. return 0;
  337. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  338. return 0;
  339. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &(val)->ip, 4))
  340. return 0;
  341. if (!ASN1PERDecUnsignedShort(dec, &(val)->port))
  342. return 0;
  343. if ((val)->o[0] & 0x80) {
  344. if (!ASN1Dec_CNP_TransportAddress_ipAddress_nonStandardParameters(dec, &(val)->nonStandardParameters))
  345. return 0;
  346. }
  347. if (y) {
  348. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  349. return 0;
  350. }
  351. return 1;
  352. }
  353. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipAddress(CNP_TransportAddress_ipAddress *val)
  354. {
  355. if (val) {
  356. if ((val)->o[0] & 0x80) {
  357. ASN1Free_CNP_TransportAddress_ipAddress_nonStandardParameters(&(val)->nonStandardParameters);
  358. }
  359. }
  360. }
  361. static int ASN1CALL ASN1Enc_H221NonStandard(ASN1encoding_t enc, H221NonStandard *val)
  362. {
  363. if (!ASN1PEREncExtensionBitClear(enc))
  364. return 0;
  365. ASN1PEREncAlignment(enc);
  366. if (!ASN1PEREncBitVal(enc, 8, (val)->t35CountryCode))
  367. return 0;
  368. ASN1PEREncAlignment(enc);
  369. if (!ASN1PEREncBitVal(enc, 8, (val)->t35Extension))
  370. return 0;
  371. if (!ASN1PEREncUnsignedShort(enc, (val)->manufacturerCode))
  372. return 0;
  373. return 1;
  374. }
  375. static int ASN1CALL ASN1Dec_H221NonStandard(ASN1decoding_t dec, H221NonStandard *val)
  376. {
  377. ASN1uint32_t y;
  378. if (!ASN1PERDecExtensionBit(dec, &y))
  379. return 0;
  380. ASN1PERDecAlignment(dec);
  381. if (!ASN1PERDecU16Val(dec, 8, &(val)->t35CountryCode))
  382. return 0;
  383. ASN1PERDecAlignment(dec);
  384. if (!ASN1PERDecU16Val(dec, 8, &(val)->t35Extension))
  385. return 0;
  386. if (!ASN1PERDecUnsignedShort(dec, &(val)->manufacturerCode))
  387. return 0;
  388. if (y) {
  389. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  390. return 0;
  391. }
  392. return 1;
  393. }
  394. static int ASN1CALL ASN1Enc_NonStandardIdentifier(ASN1encoding_t enc, NonStandardIdentifier *val)
  395. {
  396. if (!ASN1PEREncSimpleChoiceEx(enc, (val)->choice, 1))
  397. return 0;
  398. switch ((val)->choice) {
  399. case 1:
  400. if (!ASN1PEREncObjectIdentifier(enc, &(val)->u.object))
  401. return 0;
  402. break;
  403. case 2:
  404. if (!ASN1Enc_H221NonStandard(enc, &(val)->u.h221NonStandard))
  405. return 0;
  406. break;
  407. default:
  408. /* impossible */
  409. ASN1EncSetError(enc, ASN1_ERR_CHOICE);
  410. return 0;
  411. }
  412. return 1;
  413. }
  414. static int ASN1CALL ASN1Dec_NonStandardIdentifier(ASN1decoding_t dec, NonStandardIdentifier *val)
  415. {
  416. if (!ASN1PERDecSimpleChoiceEx(dec, &(val)->choice, 1))
  417. return 0;
  418. switch ((val)->choice) {
  419. case 1:
  420. if (!ASN1PERDecObjectIdentifier(dec, &(val)->u.object))
  421. return 0;
  422. break;
  423. case 2:
  424. if (!ASN1Dec_H221NonStandard(dec, &(val)->u.h221NonStandard))
  425. return 0;
  426. break;
  427. case 0:
  428. /* extension case */
  429. if (!ASN1PERDecSkipFragmented(dec, 8))
  430. return 0;
  431. break;
  432. default:
  433. /* impossible */
  434. ASN1DecSetError(dec, ASN1_ERR_CHOICE);
  435. return 0;
  436. }
  437. return 1;
  438. }
  439. static void ASN1CALL ASN1Free_NonStandardIdentifier(NonStandardIdentifier *val)
  440. {
  441. if (val) {
  442. switch ((val)->choice) {
  443. case 1:
  444. ASN1objectidentifier_free(&(val)->u.object);
  445. break;
  446. }
  447. }
  448. }
  449. static int ASN1CALL ASN1Enc_CNP_NonStandardParameter(ASN1encoding_t enc, CNP_NonStandardParameter *val)
  450. {
  451. if (!ASN1Enc_NonStandardIdentifier(enc, &(val)->nonStandardIdentifier))
  452. return 0;
  453. if (!ASN1PEREncOctetString_NoSize(enc, &(val)->data))
  454. return 0;
  455. return 1;
  456. }
  457. static int ASN1CALL ASN1Dec_CNP_NonStandardParameter(ASN1decoding_t dec, CNP_NonStandardParameter *val)
  458. {
  459. if (!ASN1Dec_NonStandardIdentifier(dec, &(val)->nonStandardIdentifier))
  460. return 0;
  461. if (!ASN1PERDecOctetString_NoSize(dec, &(val)->data))
  462. return 0;
  463. return 1;
  464. }
  465. static void ASN1CALL ASN1Free_CNP_NonStandardParameter(CNP_NonStandardParameter *val)
  466. {
  467. if (val) {
  468. ASN1Free_NonStandardIdentifier(&(val)->nonStandardIdentifier);
  469. ASN1octetstring_free(&(val)->data);
  470. }
  471. }
  472. static int ASN1CALL ASN1Enc_X274WithSAIDInfo(ASN1encoding_t enc, X274WithSAIDInfo *val)
  473. {
  474. if (!ASN1PEREncExtensionBitClear(enc))
  475. return 0;
  476. if (!ASN1PEREncOctetString_NoSize(enc, &(val)->localSAID))
  477. return 0;
  478. if (!ASN1PEREncOctetString_NoSize(enc, &(val)->peerSAID))
  479. return 0;
  480. return 1;
  481. }
  482. static int ASN1CALL ASN1Dec_X274WithSAIDInfo(ASN1decoding_t dec, X274WithSAIDInfo *val)
  483. {
  484. ASN1uint32_t y;
  485. if (!ASN1PERDecExtensionBit(dec, &y))
  486. return 0;
  487. if (!ASN1PERDecOctetString_NoSize(dec, &(val)->localSAID))
  488. return 0;
  489. if (!ASN1PERDecOctetString_NoSize(dec, &(val)->peerSAID))
  490. return 0;
  491. if (y) {
  492. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  493. return 0;
  494. }
  495. return 1;
  496. }
  497. static void ASN1CALL ASN1Free_X274WithSAIDInfo(X274WithSAIDInfo *val)
  498. {
  499. if (val) {
  500. ASN1octetstring_free(&(val)->localSAID);
  501. ASN1octetstring_free(&(val)->peerSAID);
  502. }
  503. }
  504. static int ASN1CALL ASN1Enc_ConnectRequestPDU(ASN1encoding_t enc, ConnectRequestPDU *val)
  505. {
  506. if (!ASN1PEREncExtensionBitClear(enc))
  507. return 0;
  508. if (!ASN1PEREncBits(enc, 7, (val)->o))
  509. return 0;
  510. if (!ASN1PEREncObjectIdentifier(enc, &(val)->protocolIdentifier))
  511. return 0;
  512. if (!ASN1PEREncBoolean(enc, (val)->reconnectRequested))
  513. return 0;
  514. if ((val)->o[0] & 0x80) {
  515. if (!ASN1PEREncBitVal(enc, 4, (val)->priority))
  516. return 0;
  517. }
  518. if ((val)->o[0] & 0x40) {
  519. if (!ASN1Enc_ConnectRequestPDU_reliableTransportProtocols(enc, &(val)->reliableTransportProtocols))
  520. return 0;
  521. }
  522. if ((val)->o[0] & 0x20) {
  523. if (!ASN1Enc_ConnectRequestPDU_reliableSecurityProtocols(enc, &(val)->reliableSecurityProtocols))
  524. return 0;
  525. }
  526. if ((val)->o[0] & 0x10) {
  527. if (!ASN1Enc_ConnectRequestPDU_unreliableTransportProtocols(enc, &(val)->unreliableTransportProtocols))
  528. return 0;
  529. }
  530. if ((val)->o[0] & 0x8) {
  531. if (!ASN1Enc_ConnectRequestPDU_unreliableSecurityProtocols(enc, &(val)->unreliableSecurityProtocols))
  532. return 0;
  533. }
  534. if ((val)->o[0] & 0x4) {
  535. if (!ASN1Enc_ConnectRequestPDU_destinationAddress(enc, &(val)->destinationAddress))
  536. return 0;
  537. }
  538. if ((val)->o[0] & 0x2) {
  539. if (!ASN1Enc_ConnectRequestPDU_nonStandardParameters(enc, &(val)->nonStandardParameters))
  540. return 0;
  541. }
  542. return 1;
  543. }
  544. static int ASN1CALL ASN1Dec_ConnectRequestPDU(ASN1decoding_t dec, ConnectRequestPDU *val)
  545. {
  546. ASN1uint32_t y;
  547. if (!ASN1PERDecExtensionBit(dec, &y))
  548. return 0;
  549. if (!ASN1PERDecExtension(dec, 7, (val)->o))
  550. return 0;
  551. if (!ASN1PERDecObjectIdentifier(dec, &(val)->protocolIdentifier))
  552. return 0;
  553. if (!ASN1PERDecBoolean(dec, &(val)->reconnectRequested))
  554. return 0;
  555. if ((val)->o[0] & 0x80) {
  556. if (!ASN1PERDecU16Val(dec, 4, &(val)->priority))
  557. return 0;
  558. }
  559. if ((val)->o[0] & 0x40) {
  560. if (!ASN1Dec_ConnectRequestPDU_reliableTransportProtocols(dec, &(val)->reliableTransportProtocols))
  561. return 0;
  562. }
  563. if ((val)->o[0] & 0x20) {
  564. if (!ASN1Dec_ConnectRequestPDU_reliableSecurityProtocols(dec, &(val)->reliableSecurityProtocols))
  565. return 0;
  566. }
  567. if ((val)->o[0] & 0x10) {
  568. if (!ASN1Dec_ConnectRequestPDU_unreliableTransportProtocols(dec, &(val)->unreliableTransportProtocols))
  569. return 0;
  570. }
  571. if ((val)->o[0] & 0x8) {
  572. if (!ASN1Dec_ConnectRequestPDU_unreliableSecurityProtocols(dec, &(val)->unreliableSecurityProtocols))
  573. return 0;
  574. }
  575. if ((val)->o[0] & 0x4) {
  576. if (!ASN1Dec_ConnectRequestPDU_destinationAddress(dec, &(val)->destinationAddress))
  577. return 0;
  578. }
  579. if ((val)->o[0] & 0x2) {
  580. if (!ASN1Dec_ConnectRequestPDU_nonStandardParameters(dec, &(val)->nonStandardParameters))
  581. return 0;
  582. }
  583. if (y) {
  584. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  585. return 0;
  586. }
  587. return 1;
  588. }
  589. static void ASN1CALL ASN1Free_ConnectRequestPDU(ConnectRequestPDU *val)
  590. {
  591. if (val) {
  592. ASN1objectidentifier_free(&(val)->protocolIdentifier);
  593. if ((val)->o[0] & 0x40) {
  594. ASN1Free_ConnectRequestPDU_reliableTransportProtocols(&(val)->reliableTransportProtocols);
  595. }
  596. if ((val)->o[0] & 0x20) {
  597. ASN1Free_ConnectRequestPDU_reliableSecurityProtocols(&(val)->reliableSecurityProtocols);
  598. }
  599. if ((val)->o[0] & 0x10) {
  600. ASN1Free_ConnectRequestPDU_unreliableTransportProtocols(&(val)->unreliableTransportProtocols);
  601. }
  602. if ((val)->o[0] & 0x8) {
  603. ASN1Free_ConnectRequestPDU_unreliableSecurityProtocols(&(val)->unreliableSecurityProtocols);
  604. }
  605. if ((val)->o[0] & 0x4) {
  606. ASN1Free_ConnectRequestPDU_destinationAddress(&(val)->destinationAddress);
  607. }
  608. if ((val)->o[0] & 0x2) {
  609. ASN1Free_ConnectRequestPDU_nonStandardParameters(&(val)->nonStandardParameters);
  610. }
  611. }
  612. }
  613. static int ASN1CALL ASN1Enc_DisconnectReason(ASN1encoding_t enc, DisconnectReason *val)
  614. {
  615. if (!ASN1PEREncSimpleChoiceEx(enc, (val)->choice, 4))
  616. return 0;
  617. switch ((val)->choice) {
  618. case 1:
  619. break;
  620. case 2:
  621. break;
  622. case 3:
  623. break;
  624. case 4:
  625. break;
  626. case 5:
  627. break;
  628. case 6:
  629. break;
  630. case 7:
  631. break;
  632. case 8:
  633. break;
  634. case 9:
  635. break;
  636. case 10:
  637. if (!ASN1Enc_CNP_NonStandardParameter(enc, &(val)->u.nonStandardDisconnectReason))
  638. return 0;
  639. break;
  640. default:
  641. /* impossible */
  642. ASN1EncSetError(enc, ASN1_ERR_CHOICE);
  643. return 0;
  644. }
  645. return 1;
  646. }
  647. static int ASN1CALL ASN1Dec_DisconnectReason(ASN1decoding_t dec, DisconnectReason *val)
  648. {
  649. if (!ASN1PERDecSimpleChoiceEx(dec, &(val)->choice, 4))
  650. return 0;
  651. switch ((val)->choice) {
  652. case 1:
  653. break;
  654. case 2:
  655. break;
  656. case 3:
  657. break;
  658. case 4:
  659. break;
  660. case 5:
  661. break;
  662. case 6:
  663. break;
  664. case 7:
  665. break;
  666. case 8:
  667. break;
  668. case 9:
  669. break;
  670. case 10:
  671. if (!ASN1Dec_CNP_NonStandardParameter(dec, &(val)->u.nonStandardDisconnectReason))
  672. return 0;
  673. break;
  674. case 0:
  675. /* extension case */
  676. if (!ASN1PERDecSkipFragmented(dec, 8))
  677. return 0;
  678. break;
  679. default:
  680. /* impossible */
  681. ASN1DecSetError(dec, ASN1_ERR_CHOICE);
  682. return 0;
  683. }
  684. return 1;
  685. }
  686. static void ASN1CALL ASN1Free_DisconnectReason(DisconnectReason *val)
  687. {
  688. if (val) {
  689. switch ((val)->choice) {
  690. case 10:
  691. ASN1Free_CNP_NonStandardParameter(&(val)->u.nonStandardDisconnectReason);
  692. break;
  693. }
  694. }
  695. }
  696. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipAddress_nonStandardParameters(ASN1encoding_t enc, PCNP_TransportAddress_ipAddress_nonStandardParameters *val)
  697. {
  698. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_CNP_TransportAddress_ipAddress_nonStandardParameters_ElmFn);
  699. }
  700. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipAddress_nonStandardParameters_ElmFn(ASN1encoding_t enc, PCNP_TransportAddress_ipAddress_nonStandardParameters val)
  701. {
  702. if (!ASN1Enc_CNP_NonStandardParameter(enc, &val->value))
  703. return 0;
  704. return 1;
  705. }
  706. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipAddress_nonStandardParameters(ASN1decoding_t dec, PCNP_TransportAddress_ipAddress_nonStandardParameters *val)
  707. {
  708. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_CNP_TransportAddress_ipAddress_nonStandardParameters_ElmFn, sizeof(**val));
  709. }
  710. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipAddress_nonStandardParameters_ElmFn(ASN1decoding_t dec, PCNP_TransportAddress_ipAddress_nonStandardParameters val)
  711. {
  712. if (!ASN1Dec_CNP_NonStandardParameter(dec, &val->value))
  713. return 0;
  714. return 1;
  715. }
  716. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipAddress_nonStandardParameters(PCNP_TransportAddress_ipAddress_nonStandardParameters *val)
  717. {
  718. if (val) {
  719. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_CNP_TransportAddress_ipAddress_nonStandardParameters_ElmFn);
  720. }
  721. }
  722. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipAddress_nonStandardParameters_ElmFn(PCNP_TransportAddress_ipAddress_nonStandardParameters val)
  723. {
  724. if (val) {
  725. ASN1Free_CNP_NonStandardParameter(&val->value);
  726. }
  727. }
  728. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipSourceRoute_nonStandardParameters(ASN1encoding_t enc, PCNP_TransportAddress_ipSourceRoute_nonStandardParameters *val)
  729. {
  730. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_CNP_TransportAddress_ipSourceRoute_nonStandardParameters_ElmFn);
  731. }
  732. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipSourceRoute_nonStandardParameters_ElmFn(ASN1encoding_t enc, PCNP_TransportAddress_ipSourceRoute_nonStandardParameters val)
  733. {
  734. if (!ASN1Enc_CNP_NonStandardParameter(enc, &val->value))
  735. return 0;
  736. return 1;
  737. }
  738. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipSourceRoute_nonStandardParameters(ASN1decoding_t dec, PCNP_TransportAddress_ipSourceRoute_nonStandardParameters *val)
  739. {
  740. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_CNP_TransportAddress_ipSourceRoute_nonStandardParameters_ElmFn, sizeof(**val));
  741. }
  742. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipSourceRoute_nonStandardParameters_ElmFn(ASN1decoding_t dec, PCNP_TransportAddress_ipSourceRoute_nonStandardParameters val)
  743. {
  744. if (!ASN1Dec_CNP_NonStandardParameter(dec, &val->value))
  745. return 0;
  746. return 1;
  747. }
  748. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipSourceRoute_nonStandardParameters(PCNP_TransportAddress_ipSourceRoute_nonStandardParameters *val)
  749. {
  750. if (val) {
  751. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_CNP_TransportAddress_ipSourceRoute_nonStandardParameters_ElmFn);
  752. }
  753. }
  754. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipSourceRoute_nonStandardParameters_ElmFn(PCNP_TransportAddress_ipSourceRoute_nonStandardParameters val)
  755. {
  756. if (val) {
  757. ASN1Free_CNP_NonStandardParameter(&val->value);
  758. }
  759. }
  760. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipSourceRoute_routing(ASN1encoding_t enc, CNP_TransportAddress_ipSourceRoute_routing *val)
  761. {
  762. if (!ASN1PEREncSimpleChoiceEx(enc, (val)->choice, 2))
  763. return 0;
  764. switch ((val)->choice) {
  765. case 1:
  766. break;
  767. case 2:
  768. break;
  769. case 3:
  770. if (!ASN1Enc_CNP_NonStandardParameter(enc, &(val)->u.nonStandardRouting))
  771. return 0;
  772. break;
  773. default:
  774. /* impossible */
  775. ASN1EncSetError(enc, ASN1_ERR_CHOICE);
  776. return 0;
  777. }
  778. return 1;
  779. }
  780. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipSourceRoute_routing(ASN1decoding_t dec, CNP_TransportAddress_ipSourceRoute_routing *val)
  781. {
  782. if (!ASN1PERDecSimpleChoiceEx(dec, &(val)->choice, 2))
  783. return 0;
  784. switch ((val)->choice) {
  785. case 1:
  786. break;
  787. case 2:
  788. break;
  789. case 3:
  790. if (!ASN1Dec_CNP_NonStandardParameter(dec, &(val)->u.nonStandardRouting))
  791. return 0;
  792. break;
  793. case 0:
  794. /* extension case */
  795. if (!ASN1PERDecSkipFragmented(dec, 8))
  796. return 0;
  797. break;
  798. default:
  799. /* impossible */
  800. ASN1DecSetError(dec, ASN1_ERR_CHOICE);
  801. return 0;
  802. }
  803. return 1;
  804. }
  805. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipSourceRoute_routing(CNP_TransportAddress_ipSourceRoute_routing *val)
  806. {
  807. if (val) {
  808. switch ((val)->choice) {
  809. case 3:
  810. ASN1Free_CNP_NonStandardParameter(&(val)->u.nonStandardRouting);
  811. break;
  812. }
  813. }
  814. }
  815. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipxAddress_nonStandardParameters(ASN1encoding_t enc, PCNP_TransportAddress_ipxAddress_nonStandardParameters *val)
  816. {
  817. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_CNP_TransportAddress_ipxAddress_nonStandardParameters_ElmFn);
  818. }
  819. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipxAddress_nonStandardParameters_ElmFn(ASN1encoding_t enc, PCNP_TransportAddress_ipxAddress_nonStandardParameters val)
  820. {
  821. if (!ASN1Enc_CNP_NonStandardParameter(enc, &val->value))
  822. return 0;
  823. return 1;
  824. }
  825. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipxAddress_nonStandardParameters(ASN1decoding_t dec, PCNP_TransportAddress_ipxAddress_nonStandardParameters *val)
  826. {
  827. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_CNP_TransportAddress_ipxAddress_nonStandardParameters_ElmFn, sizeof(**val));
  828. }
  829. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipxAddress_nonStandardParameters_ElmFn(ASN1decoding_t dec, PCNP_TransportAddress_ipxAddress_nonStandardParameters val)
  830. {
  831. if (!ASN1Dec_CNP_NonStandardParameter(dec, &val->value))
  832. return 0;
  833. return 1;
  834. }
  835. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipxAddress_nonStandardParameters(PCNP_TransportAddress_ipxAddress_nonStandardParameters *val)
  836. {
  837. if (val) {
  838. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_CNP_TransportAddress_ipxAddress_nonStandardParameters_ElmFn);
  839. }
  840. }
  841. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipxAddress_nonStandardParameters_ElmFn(PCNP_TransportAddress_ipxAddress_nonStandardParameters val)
  842. {
  843. if (val) {
  844. ASN1Free_CNP_NonStandardParameter(&val->value);
  845. }
  846. }
  847. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ip6Address_nonStandardParameters(ASN1encoding_t enc, PCNP_TransportAddress_ip6Address_nonStandardParameters *val)
  848. {
  849. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_CNP_TransportAddress_ip6Address_nonStandardParameters_ElmFn);
  850. }
  851. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ip6Address_nonStandardParameters_ElmFn(ASN1encoding_t enc, PCNP_TransportAddress_ip6Address_nonStandardParameters val)
  852. {
  853. if (!ASN1Enc_CNP_NonStandardParameter(enc, &val->value))
  854. return 0;
  855. return 1;
  856. }
  857. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ip6Address_nonStandardParameters(ASN1decoding_t dec, PCNP_TransportAddress_ip6Address_nonStandardParameters *val)
  858. {
  859. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_CNP_TransportAddress_ip6Address_nonStandardParameters_ElmFn, sizeof(**val));
  860. }
  861. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ip6Address_nonStandardParameters_ElmFn(ASN1decoding_t dec, PCNP_TransportAddress_ip6Address_nonStandardParameters val)
  862. {
  863. if (!ASN1Dec_CNP_NonStandardParameter(dec, &val->value))
  864. return 0;
  865. return 1;
  866. }
  867. static void ASN1CALL ASN1Free_CNP_TransportAddress_ip6Address_nonStandardParameters(PCNP_TransportAddress_ip6Address_nonStandardParameters *val)
  868. {
  869. if (val) {
  870. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_CNP_TransportAddress_ip6Address_nonStandardParameters_ElmFn);
  871. }
  872. }
  873. static void ASN1CALL ASN1Free_CNP_TransportAddress_ip6Address_nonStandardParameters_ElmFn(PCNP_TransportAddress_ip6Address_nonStandardParameters val)
  874. {
  875. if (val) {
  876. ASN1Free_CNP_NonStandardParameter(&val->value);
  877. }
  878. }
  879. static int ASN1CALL ASN1Enc_CNP_NonStandardPDU_nonStandardParameters(ASN1encoding_t enc, PCNP_NonStandardPDU_nonStandardParameters *val)
  880. {
  881. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_CNP_NonStandardPDU_nonStandardParameters_ElmFn);
  882. }
  883. static int ASN1CALL ASN1Enc_CNP_NonStandardPDU_nonStandardParameters_ElmFn(ASN1encoding_t enc, PCNP_NonStandardPDU_nonStandardParameters val)
  884. {
  885. if (!ASN1Enc_CNP_NonStandardParameter(enc, &val->value))
  886. return 0;
  887. return 1;
  888. }
  889. static int ASN1CALL ASN1Dec_CNP_NonStandardPDU_nonStandardParameters(ASN1decoding_t dec, PCNP_NonStandardPDU_nonStandardParameters *val)
  890. {
  891. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_CNP_NonStandardPDU_nonStandardParameters_ElmFn, sizeof(**val));
  892. }
  893. static int ASN1CALL ASN1Dec_CNP_NonStandardPDU_nonStandardParameters_ElmFn(ASN1decoding_t dec, PCNP_NonStandardPDU_nonStandardParameters val)
  894. {
  895. if (!ASN1Dec_CNP_NonStandardParameter(dec, &val->value))
  896. return 0;
  897. return 1;
  898. }
  899. static void ASN1CALL ASN1Free_CNP_NonStandardPDU_nonStandardParameters(PCNP_NonStandardPDU_nonStandardParameters *val)
  900. {
  901. if (val) {
  902. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_CNP_NonStandardPDU_nonStandardParameters_ElmFn);
  903. }
  904. }
  905. static void ASN1CALL ASN1Free_CNP_NonStandardPDU_nonStandardParameters_ElmFn(PCNP_NonStandardPDU_nonStandardParameters val)
  906. {
  907. if (val) {
  908. ASN1Free_CNP_NonStandardParameter(&val->value);
  909. }
  910. }
  911. static int ASN1CALL ASN1Enc_ErrorPDU_nonStandardParameters(ASN1encoding_t enc, PErrorPDU_nonStandardParameters *val)
  912. {
  913. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_ErrorPDU_nonStandardParameters_ElmFn);
  914. }
  915. static int ASN1CALL ASN1Enc_ErrorPDU_nonStandardParameters_ElmFn(ASN1encoding_t enc, PErrorPDU_nonStandardParameters val)
  916. {
  917. if (!ASN1Enc_CNP_NonStandardParameter(enc, &val->value))
  918. return 0;
  919. return 1;
  920. }
  921. static int ASN1CALL ASN1Dec_ErrorPDU_nonStandardParameters(ASN1decoding_t dec, PErrorPDU_nonStandardParameters *val)
  922. {
  923. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_ErrorPDU_nonStandardParameters_ElmFn, sizeof(**val));
  924. }
  925. static int ASN1CALL ASN1Dec_ErrorPDU_nonStandardParameters_ElmFn(ASN1decoding_t dec, PErrorPDU_nonStandardParameters val)
  926. {
  927. if (!ASN1Dec_CNP_NonStandardParameter(dec, &val->value))
  928. return 0;
  929. return 1;
  930. }
  931. static void ASN1CALL ASN1Free_ErrorPDU_nonStandardParameters(PErrorPDU_nonStandardParameters *val)
  932. {
  933. if (val) {
  934. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_ErrorPDU_nonStandardParameters_ElmFn);
  935. }
  936. }
  937. static void ASN1CALL ASN1Free_ErrorPDU_nonStandardParameters_ElmFn(PErrorPDU_nonStandardParameters val)
  938. {
  939. if (val) {
  940. ASN1Free_CNP_NonStandardParameter(&val->value);
  941. }
  942. }
  943. static int ASN1CALL ASN1Enc_DisconnectRequestPDU_nonStandardParameters(ASN1encoding_t enc, PDisconnectRequestPDU_nonStandardParameters *val)
  944. {
  945. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_DisconnectRequestPDU_nonStandardParameters_ElmFn);
  946. }
  947. static int ASN1CALL ASN1Enc_DisconnectRequestPDU_nonStandardParameters_ElmFn(ASN1encoding_t enc, PDisconnectRequestPDU_nonStandardParameters val)
  948. {
  949. if (!ASN1Enc_CNP_NonStandardParameter(enc, &val->value))
  950. return 0;
  951. return 1;
  952. }
  953. static int ASN1CALL ASN1Dec_DisconnectRequestPDU_nonStandardParameters(ASN1decoding_t dec, PDisconnectRequestPDU_nonStandardParameters *val)
  954. {
  955. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_DisconnectRequestPDU_nonStandardParameters_ElmFn, sizeof(**val));
  956. }
  957. static int ASN1CALL ASN1Dec_DisconnectRequestPDU_nonStandardParameters_ElmFn(ASN1decoding_t dec, PDisconnectRequestPDU_nonStandardParameters val)
  958. {
  959. if (!ASN1Dec_CNP_NonStandardParameter(dec, &val->value))
  960. return 0;
  961. return 1;
  962. }
  963. static void ASN1CALL ASN1Free_DisconnectRequestPDU_nonStandardParameters(PDisconnectRequestPDU_nonStandardParameters *val)
  964. {
  965. if (val) {
  966. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_DisconnectRequestPDU_nonStandardParameters_ElmFn);
  967. }
  968. }
  969. static void ASN1CALL ASN1Free_DisconnectRequestPDU_nonStandardParameters_ElmFn(PDisconnectRequestPDU_nonStandardParameters val)
  970. {
  971. if (val) {
  972. ASN1Free_CNP_NonStandardParameter(&val->value);
  973. }
  974. }
  975. static int ASN1CALL ASN1Enc_ConnectConfirmPDU_nonStandardParameters(ASN1encoding_t enc, PConnectConfirmPDU_nonStandardParameters *val)
  976. {
  977. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_ConnectConfirmPDU_nonStandardParameters_ElmFn);
  978. }
  979. static int ASN1CALL ASN1Enc_ConnectConfirmPDU_nonStandardParameters_ElmFn(ASN1encoding_t enc, PConnectConfirmPDU_nonStandardParameters val)
  980. {
  981. if (!ASN1Enc_CNP_NonStandardParameter(enc, &val->value))
  982. return 0;
  983. return 1;
  984. }
  985. static int ASN1CALL ASN1Dec_ConnectConfirmPDU_nonStandardParameters(ASN1decoding_t dec, PConnectConfirmPDU_nonStandardParameters *val)
  986. {
  987. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_ConnectConfirmPDU_nonStandardParameters_ElmFn, sizeof(**val));
  988. }
  989. static int ASN1CALL ASN1Dec_ConnectConfirmPDU_nonStandardParameters_ElmFn(ASN1decoding_t dec, PConnectConfirmPDU_nonStandardParameters val)
  990. {
  991. if (!ASN1Dec_CNP_NonStandardParameter(dec, &val->value))
  992. return 0;
  993. return 1;
  994. }
  995. static void ASN1CALL ASN1Free_ConnectConfirmPDU_nonStandardParameters(PConnectConfirmPDU_nonStandardParameters *val)
  996. {
  997. if (val) {
  998. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_ConnectConfirmPDU_nonStandardParameters_ElmFn);
  999. }
  1000. }
  1001. static void ASN1CALL ASN1Free_ConnectConfirmPDU_nonStandardParameters_ElmFn(PConnectConfirmPDU_nonStandardParameters val)
  1002. {
  1003. if (val) {
  1004. ASN1Free_CNP_NonStandardParameter(&val->value);
  1005. }
  1006. }
  1007. static int ASN1CALL ASN1Enc_ConnectRequestPDU_nonStandardParameters(ASN1encoding_t enc, PConnectRequestPDU_nonStandardParameters *val)
  1008. {
  1009. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_ConnectRequestPDU_nonStandardParameters_ElmFn);
  1010. }
  1011. static int ASN1CALL ASN1Enc_ConnectRequestPDU_nonStandardParameters_ElmFn(ASN1encoding_t enc, PConnectRequestPDU_nonStandardParameters val)
  1012. {
  1013. if (!ASN1Enc_CNP_NonStandardParameter(enc, &val->value))
  1014. return 0;
  1015. return 1;
  1016. }
  1017. static int ASN1CALL ASN1Dec_ConnectRequestPDU_nonStandardParameters(ASN1decoding_t dec, PConnectRequestPDU_nonStandardParameters *val)
  1018. {
  1019. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_ConnectRequestPDU_nonStandardParameters_ElmFn, sizeof(**val));
  1020. }
  1021. static int ASN1CALL ASN1Dec_ConnectRequestPDU_nonStandardParameters_ElmFn(ASN1decoding_t dec, PConnectRequestPDU_nonStandardParameters val)
  1022. {
  1023. if (!ASN1Dec_CNP_NonStandardParameter(dec, &val->value))
  1024. return 0;
  1025. return 1;
  1026. }
  1027. static void ASN1CALL ASN1Free_ConnectRequestPDU_nonStandardParameters(PConnectRequestPDU_nonStandardParameters *val)
  1028. {
  1029. if (val) {
  1030. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_ConnectRequestPDU_nonStandardParameters_ElmFn);
  1031. }
  1032. }
  1033. static void ASN1CALL ASN1Free_ConnectRequestPDU_nonStandardParameters_ElmFn(PConnectRequestPDU_nonStandardParameters val)
  1034. {
  1035. if (val) {
  1036. ASN1Free_CNP_NonStandardParameter(&val->value);
  1037. }
  1038. }
  1039. static int ASN1CALL ASN1Enc_ConnectRequestPDU_unreliableSecurityProtocols(ASN1encoding_t enc, PConnectRequestPDU_unreliableSecurityProtocols *val)
  1040. {
  1041. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_ConnectRequestPDU_unreliableSecurityProtocols_ElmFn);
  1042. }
  1043. static int ASN1CALL ASN1Enc_ConnectRequestPDU_unreliableSecurityProtocols_ElmFn(ASN1encoding_t enc, PConnectRequestPDU_unreliableSecurityProtocols val)
  1044. {
  1045. if (!ASN1Enc_UnreliableSecurityProtocol(enc, &val->value))
  1046. return 0;
  1047. return 1;
  1048. }
  1049. static int ASN1CALL ASN1Dec_ConnectRequestPDU_unreliableSecurityProtocols(ASN1decoding_t dec, PConnectRequestPDU_unreliableSecurityProtocols *val)
  1050. {
  1051. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_ConnectRequestPDU_unreliableSecurityProtocols_ElmFn, sizeof(**val));
  1052. }
  1053. static int ASN1CALL ASN1Dec_ConnectRequestPDU_unreliableSecurityProtocols_ElmFn(ASN1decoding_t dec, PConnectRequestPDU_unreliableSecurityProtocols val)
  1054. {
  1055. if (!ASN1Dec_UnreliableSecurityProtocol(dec, &val->value))
  1056. return 0;
  1057. return 1;
  1058. }
  1059. static void ASN1CALL ASN1Free_ConnectRequestPDU_unreliableSecurityProtocols(PConnectRequestPDU_unreliableSecurityProtocols *val)
  1060. {
  1061. if (val) {
  1062. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_ConnectRequestPDU_unreliableSecurityProtocols_ElmFn);
  1063. }
  1064. }
  1065. static void ASN1CALL ASN1Free_ConnectRequestPDU_unreliableSecurityProtocols_ElmFn(PConnectRequestPDU_unreliableSecurityProtocols val)
  1066. {
  1067. if (val) {
  1068. ASN1Free_UnreliableSecurityProtocol(&val->value);
  1069. }
  1070. }
  1071. static int ASN1CALL ASN1Enc_ConnectRequestPDU_reliableTransportProtocols(ASN1encoding_t enc, PConnectRequestPDU_reliableTransportProtocols *val)
  1072. {
  1073. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_ConnectRequestPDU_reliableTransportProtocols_ElmFn);
  1074. }
  1075. static int ASN1CALL ASN1Enc_ConnectRequestPDU_reliableTransportProtocols_ElmFn(ASN1encoding_t enc, PConnectRequestPDU_reliableTransportProtocols val)
  1076. {
  1077. if (!ASN1Enc_ReliableTransportProtocol(enc, &val->value))
  1078. return 0;
  1079. return 1;
  1080. }
  1081. static int ASN1CALL ASN1Dec_ConnectRequestPDU_reliableTransportProtocols(ASN1decoding_t dec, PConnectRequestPDU_reliableTransportProtocols *val)
  1082. {
  1083. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_ConnectRequestPDU_reliableTransportProtocols_ElmFn, sizeof(**val));
  1084. }
  1085. static int ASN1CALL ASN1Dec_ConnectRequestPDU_reliableTransportProtocols_ElmFn(ASN1decoding_t dec, PConnectRequestPDU_reliableTransportProtocols val)
  1086. {
  1087. if (!ASN1Dec_ReliableTransportProtocol(dec, &val->value))
  1088. return 0;
  1089. return 1;
  1090. }
  1091. static void ASN1CALL ASN1Free_ConnectRequestPDU_reliableTransportProtocols(PConnectRequestPDU_reliableTransportProtocols *val)
  1092. {
  1093. if (val) {
  1094. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_ConnectRequestPDU_reliableTransportProtocols_ElmFn);
  1095. }
  1096. }
  1097. static void ASN1CALL ASN1Free_ConnectRequestPDU_reliableTransportProtocols_ElmFn(PConnectRequestPDU_reliableTransportProtocols val)
  1098. {
  1099. if (val) {
  1100. ASN1Free_ReliableTransportProtocol(&val->value);
  1101. }
  1102. }
  1103. static int ASN1CALL ASN1Enc_UnreliableTransportProtocol_nonStandardParameters(ASN1encoding_t enc, PUnreliableTransportProtocol_nonStandardParameters *val)
  1104. {
  1105. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_UnreliableTransportProtocol_nonStandardParameters_ElmFn);
  1106. }
  1107. static int ASN1CALL ASN1Enc_UnreliableTransportProtocol_nonStandardParameters_ElmFn(ASN1encoding_t enc, PUnreliableTransportProtocol_nonStandardParameters val)
  1108. {
  1109. if (!ASN1Enc_CNP_NonStandardParameter(enc, &val->value))
  1110. return 0;
  1111. return 1;
  1112. }
  1113. static int ASN1CALL ASN1Dec_UnreliableTransportProtocol_nonStandardParameters(ASN1decoding_t dec, PUnreliableTransportProtocol_nonStandardParameters *val)
  1114. {
  1115. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_UnreliableTransportProtocol_nonStandardParameters_ElmFn, sizeof(**val));
  1116. }
  1117. static int ASN1CALL ASN1Dec_UnreliableTransportProtocol_nonStandardParameters_ElmFn(ASN1decoding_t dec, PUnreliableTransportProtocol_nonStandardParameters val)
  1118. {
  1119. if (!ASN1Dec_CNP_NonStandardParameter(dec, &val->value))
  1120. return 0;
  1121. return 1;
  1122. }
  1123. static void ASN1CALL ASN1Free_UnreliableTransportProtocol_nonStandardParameters(PUnreliableTransportProtocol_nonStandardParameters *val)
  1124. {
  1125. if (val) {
  1126. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_UnreliableTransportProtocol_nonStandardParameters_ElmFn);
  1127. }
  1128. }
  1129. static void ASN1CALL ASN1Free_UnreliableTransportProtocol_nonStandardParameters_ElmFn(PUnreliableTransportProtocol_nonStandardParameters val)
  1130. {
  1131. if (val) {
  1132. ASN1Free_CNP_NonStandardParameter(&val->value);
  1133. }
  1134. }
  1135. static int ASN1CALL ASN1Enc_ReliableTransportProtocol_nonStandardParameters(ASN1encoding_t enc, PReliableTransportProtocol_nonStandardParameters *val)
  1136. {
  1137. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_ReliableTransportProtocol_nonStandardParameters_ElmFn);
  1138. }
  1139. static int ASN1CALL ASN1Enc_ReliableTransportProtocol_nonStandardParameters_ElmFn(ASN1encoding_t enc, PReliableTransportProtocol_nonStandardParameters val)
  1140. {
  1141. if (!ASN1Enc_CNP_NonStandardParameter(enc, &val->value))
  1142. return 0;
  1143. return 1;
  1144. }
  1145. static int ASN1CALL ASN1Dec_ReliableTransportProtocol_nonStandardParameters(ASN1decoding_t dec, PReliableTransportProtocol_nonStandardParameters *val)
  1146. {
  1147. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_ReliableTransportProtocol_nonStandardParameters_ElmFn, sizeof(**val));
  1148. }
  1149. static int ASN1CALL ASN1Dec_ReliableTransportProtocol_nonStandardParameters_ElmFn(ASN1decoding_t dec, PReliableTransportProtocol_nonStandardParameters val)
  1150. {
  1151. if (!ASN1Dec_CNP_NonStandardParameter(dec, &val->value))
  1152. return 0;
  1153. return 1;
  1154. }
  1155. static void ASN1CALL ASN1Free_ReliableTransportProtocol_nonStandardParameters(PReliableTransportProtocol_nonStandardParameters *val)
  1156. {
  1157. if (val) {
  1158. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_ReliableTransportProtocol_nonStandardParameters_ElmFn);
  1159. }
  1160. }
  1161. static void ASN1CALL ASN1Free_ReliableTransportProtocol_nonStandardParameters_ElmFn(PReliableTransportProtocol_nonStandardParameters val)
  1162. {
  1163. if (val) {
  1164. ASN1Free_CNP_NonStandardParameter(&val->value);
  1165. }
  1166. }
  1167. static int ASN1CALL ASN1Enc_PrivatePartyNumber_nonStandardParameters(ASN1encoding_t enc, PPrivatePartyNumber_nonStandardParameters *val)
  1168. {
  1169. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_PrivatePartyNumber_nonStandardParameters_ElmFn);
  1170. }
  1171. static int ASN1CALL ASN1Enc_PrivatePartyNumber_nonStandardParameters_ElmFn(ASN1encoding_t enc, PPrivatePartyNumber_nonStandardParameters val)
  1172. {
  1173. if (!ASN1Enc_CNP_NonStandardParameter(enc, &val->value))
  1174. return 0;
  1175. return 1;
  1176. }
  1177. static int ASN1CALL ASN1Dec_PrivatePartyNumber_nonStandardParameters(ASN1decoding_t dec, PPrivatePartyNumber_nonStandardParameters *val)
  1178. {
  1179. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_PrivatePartyNumber_nonStandardParameters_ElmFn, sizeof(**val));
  1180. }
  1181. static int ASN1CALL ASN1Dec_PrivatePartyNumber_nonStandardParameters_ElmFn(ASN1decoding_t dec, PPrivatePartyNumber_nonStandardParameters val)
  1182. {
  1183. if (!ASN1Dec_CNP_NonStandardParameter(dec, &val->value))
  1184. return 0;
  1185. return 1;
  1186. }
  1187. static void ASN1CALL ASN1Free_PrivatePartyNumber_nonStandardParameters(PPrivatePartyNumber_nonStandardParameters *val)
  1188. {
  1189. if (val) {
  1190. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_PrivatePartyNumber_nonStandardParameters_ElmFn);
  1191. }
  1192. }
  1193. static void ASN1CALL ASN1Free_PrivatePartyNumber_nonStandardParameters_ElmFn(PPrivatePartyNumber_nonStandardParameters val)
  1194. {
  1195. if (val) {
  1196. ASN1Free_CNP_NonStandardParameter(&val->value);
  1197. }
  1198. }
  1199. static int ASN1CALL ASN1Enc_PublicPartyNumber_nonStandardParameters(ASN1encoding_t enc, PPublicPartyNumber_nonStandardParameters *val)
  1200. {
  1201. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_PublicPartyNumber_nonStandardParameters_ElmFn);
  1202. }
  1203. static int ASN1CALL ASN1Enc_PublicPartyNumber_nonStandardParameters_ElmFn(ASN1encoding_t enc, PPublicPartyNumber_nonStandardParameters val)
  1204. {
  1205. if (!ASN1Enc_CNP_NonStandardParameter(enc, &val->value))
  1206. return 0;
  1207. return 1;
  1208. }
  1209. static int ASN1CALL ASN1Dec_PublicPartyNumber_nonStandardParameters(ASN1decoding_t dec, PPublicPartyNumber_nonStandardParameters *val)
  1210. {
  1211. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_PublicPartyNumber_nonStandardParameters_ElmFn, sizeof(**val));
  1212. }
  1213. static int ASN1CALL ASN1Dec_PublicPartyNumber_nonStandardParameters_ElmFn(ASN1decoding_t dec, PPublicPartyNumber_nonStandardParameters val)
  1214. {
  1215. if (!ASN1Dec_CNP_NonStandardParameter(dec, &val->value))
  1216. return 0;
  1217. return 1;
  1218. }
  1219. static void ASN1CALL ASN1Free_PublicPartyNumber_nonStandardParameters(PPublicPartyNumber_nonStandardParameters *val)
  1220. {
  1221. if (val) {
  1222. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_PublicPartyNumber_nonStandardParameters_ElmFn);
  1223. }
  1224. }
  1225. static void ASN1CALL ASN1Free_PublicPartyNumber_nonStandardParameters_ElmFn(PPublicPartyNumber_nonStandardParameters val)
  1226. {
  1227. if (val) {
  1228. ASN1Free_CNP_NonStandardParameter(&val->value);
  1229. }
  1230. }
  1231. static int ASN1CALL ASN1Enc_CNP_TransportAddress_ipSourceRoute(ASN1encoding_t enc, CNP_TransportAddress_ipSourceRoute *val)
  1232. {
  1233. if (!ASN1PEREncExtensionBitClear(enc))
  1234. return 0;
  1235. if (!ASN1PEREncBits(enc, 1, (val)->o))
  1236. return 0;
  1237. if (!ASN1PEREncOctetString_FixedSize(enc, (ASN1octetstring2_t *) &(val)->ip, 4))
  1238. return 0;
  1239. if (!ASN1PEREncUnsignedShort(enc, (val)->port))
  1240. return 0;
  1241. if (!ASN1Enc_CNP_TransportAddress_ipSourceRoute_route(enc, &(val)->route))
  1242. return 0;
  1243. if (!ASN1Enc_CNP_TransportAddress_ipSourceRoute_routing(enc, &(val)->routing))
  1244. return 0;
  1245. if ((val)->o[0] & 0x80) {
  1246. if (!ASN1Enc_CNP_TransportAddress_ipSourceRoute_nonStandardParameters(enc, &(val)->nonStandardParameters))
  1247. return 0;
  1248. }
  1249. return 1;
  1250. }
  1251. static int ASN1CALL ASN1Dec_CNP_TransportAddress_ipSourceRoute(ASN1decoding_t dec, CNP_TransportAddress_ipSourceRoute *val)
  1252. {
  1253. ASN1uint32_t y;
  1254. if (!ASN1PERDecExtensionBit(dec, &y))
  1255. return 0;
  1256. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  1257. return 0;
  1258. if (!ASN1PERDecOctetString_FixedSize(dec, (ASN1octetstring2_t *) &(val)->ip, 4))
  1259. return 0;
  1260. if (!ASN1PERDecUnsignedShort(dec, &(val)->port))
  1261. return 0;
  1262. if (!ASN1Dec_CNP_TransportAddress_ipSourceRoute_route(dec, &(val)->route))
  1263. return 0;
  1264. if (!ASN1Dec_CNP_TransportAddress_ipSourceRoute_routing(dec, &(val)->routing))
  1265. return 0;
  1266. if ((val)->o[0] & 0x80) {
  1267. if (!ASN1Dec_CNP_TransportAddress_ipSourceRoute_nonStandardParameters(dec, &(val)->nonStandardParameters))
  1268. return 0;
  1269. }
  1270. if (y) {
  1271. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  1272. return 0;
  1273. }
  1274. return 1;
  1275. }
  1276. static void ASN1CALL ASN1Free_CNP_TransportAddress_ipSourceRoute(CNP_TransportAddress_ipSourceRoute *val)
  1277. {
  1278. if (val) {
  1279. ASN1Free_CNP_TransportAddress_ipSourceRoute_route(&(val)->route);
  1280. ASN1Free_CNP_TransportAddress_ipSourceRoute_routing(&(val)->routing);
  1281. if ((val)->o[0] & 0x80) {
  1282. ASN1Free_CNP_TransportAddress_ipSourceRoute_nonStandardParameters(&(val)->nonStandardParameters);
  1283. }
  1284. }
  1285. }
  1286. static int ASN1CALL ASN1Enc_ReliableSecurityProtocol(ASN1encoding_t enc, ReliableSecurityProtocol *val)
  1287. {
  1288. if (!ASN1PEREncSimpleChoiceEx(enc, (val)->choice, 4))
  1289. return 0;
  1290. switch ((val)->choice) {
  1291. case 1:
  1292. break;
  1293. case 2:
  1294. break;
  1295. case 3:
  1296. break;
  1297. case 4:
  1298. break;
  1299. case 5:
  1300. break;
  1301. case 6:
  1302. break;
  1303. case 7:
  1304. if (!ASN1Enc_X274WithSAIDInfo(enc, &(val)->u.x274WithSAID))
  1305. return 0;
  1306. break;
  1307. case 8:
  1308. break;
  1309. case 9:
  1310. break;
  1311. case 10:
  1312. if (!ASN1Enc_CNP_NonStandardParameter(enc, &(val)->u.nonStandardSecurityProtocol))
  1313. return 0;
  1314. break;
  1315. default:
  1316. /* impossible */
  1317. ASN1EncSetError(enc, ASN1_ERR_CHOICE);
  1318. return 0;
  1319. }
  1320. return 1;
  1321. }
  1322. static int ASN1CALL ASN1Dec_ReliableSecurityProtocol(ASN1decoding_t dec, ReliableSecurityProtocol *val)
  1323. {
  1324. if (!ASN1PERDecSimpleChoiceEx(dec, &(val)->choice, 4))
  1325. return 0;
  1326. switch ((val)->choice) {
  1327. case 1:
  1328. break;
  1329. case 2:
  1330. break;
  1331. case 3:
  1332. break;
  1333. case 4:
  1334. break;
  1335. case 5:
  1336. break;
  1337. case 6:
  1338. break;
  1339. case 7:
  1340. if (!ASN1Dec_X274WithSAIDInfo(dec, &(val)->u.x274WithSAID))
  1341. return 0;
  1342. break;
  1343. case 8:
  1344. break;
  1345. case 9:
  1346. break;
  1347. case 10:
  1348. if (!ASN1Dec_CNP_NonStandardParameter(dec, &(val)->u.nonStandardSecurityProtocol))
  1349. return 0;
  1350. break;
  1351. case 0:
  1352. /* extension case */
  1353. if (!ASN1PERDecSkipFragmented(dec, 8))
  1354. return 0;
  1355. break;
  1356. default:
  1357. /* impossible */
  1358. ASN1DecSetError(dec, ASN1_ERR_CHOICE);
  1359. return 0;
  1360. }
  1361. return 1;
  1362. }
  1363. static void ASN1CALL ASN1Free_ReliableSecurityProtocol(ReliableSecurityProtocol *val)
  1364. {
  1365. if (val) {
  1366. switch ((val)->choice) {
  1367. case 7:
  1368. ASN1Free_X274WithSAIDInfo(&(val)->u.x274WithSAID);
  1369. break;
  1370. case 10:
  1371. ASN1Free_CNP_NonStandardParameter(&(val)->u.nonStandardSecurityProtocol);
  1372. break;
  1373. }
  1374. }
  1375. }
  1376. static int ASN1CALL ASN1Enc_ConnectConfirmPDU(ASN1encoding_t enc, ConnectConfirmPDU *val)
  1377. {
  1378. if (!ASN1PEREncExtensionBitClear(enc))
  1379. return 0;
  1380. if (!ASN1PEREncBits(enc, 5, (val)->o))
  1381. return 0;
  1382. if (!ASN1PEREncObjectIdentifier(enc, &(val)->protocolIdentifier))
  1383. return 0;
  1384. if ((val)->o[0] & 0x80) {
  1385. if (!ASN1Enc_ReliableTransportProtocol(enc, &(val)->reliableTransportProtocol))
  1386. return 0;
  1387. }
  1388. if ((val)->o[0] & 0x40) {
  1389. if (!ASN1Enc_ReliableSecurityProtocol(enc, &(val)->reliableSecurityProtocol))
  1390. return 0;
  1391. }
  1392. if ((val)->o[0] & 0x20) {
  1393. if (!ASN1Enc_UnreliableTransportProtocol(enc, &(val)->unreliableTransportProtocol))
  1394. return 0;
  1395. }
  1396. if ((val)->o[0] & 0x10) {
  1397. if (!ASN1Enc_UnreliableSecurityProtocol(enc, &(val)->unreliableSecurityProtocol))
  1398. return 0;
  1399. }
  1400. if ((val)->o[0] & 0x8) {
  1401. if (!ASN1Enc_ConnectConfirmPDU_nonStandardParameters(enc, &(val)->nonStandardParameters))
  1402. return 0;
  1403. }
  1404. return 1;
  1405. }
  1406. static int ASN1CALL ASN1Dec_ConnectConfirmPDU(ASN1decoding_t dec, ConnectConfirmPDU *val)
  1407. {
  1408. ASN1uint32_t y;
  1409. if (!ASN1PERDecExtensionBit(dec, &y))
  1410. return 0;
  1411. if (!ASN1PERDecExtension(dec, 5, (val)->o))
  1412. return 0;
  1413. if (!ASN1PERDecObjectIdentifier(dec, &(val)->protocolIdentifier))
  1414. return 0;
  1415. if ((val)->o[0] & 0x80) {
  1416. if (!ASN1Dec_ReliableTransportProtocol(dec, &(val)->reliableTransportProtocol))
  1417. return 0;
  1418. }
  1419. if ((val)->o[0] & 0x40) {
  1420. if (!ASN1Dec_ReliableSecurityProtocol(dec, &(val)->reliableSecurityProtocol))
  1421. return 0;
  1422. }
  1423. if ((val)->o[0] & 0x20) {
  1424. if (!ASN1Dec_UnreliableTransportProtocol(dec, &(val)->unreliableTransportProtocol))
  1425. return 0;
  1426. }
  1427. if ((val)->o[0] & 0x10) {
  1428. if (!ASN1Dec_UnreliableSecurityProtocol(dec, &(val)->unreliableSecurityProtocol))
  1429. return 0;
  1430. }
  1431. if ((val)->o[0] & 0x8) {
  1432. if (!ASN1Dec_ConnectConfirmPDU_nonStandardParameters(dec, &(val)->nonStandardParameters))
  1433. return 0;
  1434. }
  1435. if (y) {
  1436. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  1437. return 0;
  1438. }
  1439. return 1;
  1440. }
  1441. static void ASN1CALL ASN1Free_ConnectConfirmPDU(ConnectConfirmPDU *val)
  1442. {
  1443. if (val) {
  1444. ASN1objectidentifier_free(&(val)->protocolIdentifier);
  1445. if ((val)->o[0] & 0x80) {
  1446. ASN1Free_ReliableTransportProtocol(&(val)->reliableTransportProtocol);
  1447. }
  1448. if ((val)->o[0] & 0x40) {
  1449. ASN1Free_ReliableSecurityProtocol(&(val)->reliableSecurityProtocol);
  1450. }
  1451. if ((val)->o[0] & 0x20) {
  1452. ASN1Free_UnreliableTransportProtocol(&(val)->unreliableTransportProtocol);
  1453. }
  1454. if ((val)->o[0] & 0x10) {
  1455. ASN1Free_UnreliableSecurityProtocol(&(val)->unreliableSecurityProtocol);
  1456. }
  1457. if ((val)->o[0] & 0x8) {
  1458. ASN1Free_ConnectConfirmPDU_nonStandardParameters(&(val)->nonStandardParameters);
  1459. }
  1460. }
  1461. }
  1462. static int ASN1CALL ASN1Enc_DisconnectRequestPDU(ASN1encoding_t enc, DisconnectRequestPDU *val)
  1463. {
  1464. if (!ASN1PEREncExtensionBitClear(enc))
  1465. return 0;
  1466. if (!ASN1PEREncBits(enc, 6, (val)->o))
  1467. return 0;
  1468. if (!ASN1Enc_DisconnectReason(enc, &(val)->disconnectReason))
  1469. return 0;
  1470. if ((val)->o[0] & 0x80) {
  1471. if (!ASN1Enc_ReliableTransportProtocol(enc, &(val)->reliableTransportProtocol))
  1472. return 0;
  1473. }
  1474. if ((val)->o[0] & 0x40) {
  1475. if (!ASN1Enc_ReliableSecurityProtocol(enc, &(val)->reliableSecurityProtocol))
  1476. return 0;
  1477. }
  1478. if ((val)->o[0] & 0x20) {
  1479. if (!ASN1Enc_UnreliableTransportProtocol(enc, &(val)->unreliableTransportProtocol))
  1480. return 0;
  1481. }
  1482. if ((val)->o[0] & 0x10) {
  1483. if (!ASN1Enc_UnreliableSecurityProtocol(enc, &(val)->unreliableSecurityProtocol))
  1484. return 0;
  1485. }
  1486. if ((val)->o[0] & 0x8) {
  1487. if (!ASN1Enc_DisconnectRequestPDU_destinationAddress(enc, &(val)->destinationAddress))
  1488. return 0;
  1489. }
  1490. if ((val)->o[0] & 0x4) {
  1491. if (!ASN1Enc_DisconnectRequestPDU_nonStandardParameters(enc, &(val)->nonStandardParameters))
  1492. return 0;
  1493. }
  1494. return 1;
  1495. }
  1496. static int ASN1CALL ASN1Dec_DisconnectRequestPDU(ASN1decoding_t dec, DisconnectRequestPDU *val)
  1497. {
  1498. ASN1uint32_t y;
  1499. if (!ASN1PERDecExtensionBit(dec, &y))
  1500. return 0;
  1501. if (!ASN1PERDecExtension(dec, 6, (val)->o))
  1502. return 0;
  1503. if (!ASN1Dec_DisconnectReason(dec, &(val)->disconnectReason))
  1504. return 0;
  1505. if ((val)->o[0] & 0x80) {
  1506. if (!ASN1Dec_ReliableTransportProtocol(dec, &(val)->reliableTransportProtocol))
  1507. return 0;
  1508. }
  1509. if ((val)->o[0] & 0x40) {
  1510. if (!ASN1Dec_ReliableSecurityProtocol(dec, &(val)->reliableSecurityProtocol))
  1511. return 0;
  1512. }
  1513. if ((val)->o[0] & 0x20) {
  1514. if (!ASN1Dec_UnreliableTransportProtocol(dec, &(val)->unreliableTransportProtocol))
  1515. return 0;
  1516. }
  1517. if ((val)->o[0] & 0x10) {
  1518. if (!ASN1Dec_UnreliableSecurityProtocol(dec, &(val)->unreliableSecurityProtocol))
  1519. return 0;
  1520. }
  1521. if ((val)->o[0] & 0x8) {
  1522. if (!ASN1Dec_DisconnectRequestPDU_destinationAddress(dec, &(val)->destinationAddress))
  1523. return 0;
  1524. }
  1525. if ((val)->o[0] & 0x4) {
  1526. if (!ASN1Dec_DisconnectRequestPDU_nonStandardParameters(dec, &(val)->nonStandardParameters))
  1527. return 0;
  1528. }
  1529. if (y) {
  1530. if (!ASN1PERDecSkipNormallySmallExtensionFragmented(dec))
  1531. return 0;
  1532. }
  1533. return 1;
  1534. }
  1535. static void ASN1CALL ASN1Free_DisconnectRequestPDU(DisconnectRequestPDU *val)
  1536. {
  1537. if (val) {
  1538. ASN1Free_DisconnectReason(&(val)->disconnectReason);
  1539. if ((val)->o[0] & 0x80) {
  1540. ASN1Free_ReliableTransportProtocol(&(val)->reliableTransportProtocol);
  1541. }
  1542. if ((val)->o[0] & 0x40) {
  1543. ASN1Free_ReliableSecurityProtocol(&(val)->reliableSecurityProtocol);
  1544. }
  1545. if ((val)->o[0] & 0x20) {
  1546. ASN1Free_UnreliableTransportProtocol(&(val)->unreliableTransportProtocol);
  1547. }
  1548. if ((val)->o[0] & 0x10) {
  1549. ASN1Free_UnreliableSecurityProtocol(&(val)->unreliableSecurityProtocol);
  1550. }
  1551. if ((val)->o[0] & 0x8) {
  1552. ASN1Free_DisconnectRequestPDU_destinationAddress(&(val)->destinationAddress);
  1553. }
  1554. if ((val)->o[0] & 0x4) {
  1555. ASN1Free_DisconnectRequestPDU_nonStandardParameters(&(val)->nonStandardParameters);
  1556. }
  1557. }
  1558. }
  1559. static int ASN1CALL ASN1Enc_CNPPDU(ASN1encoding_t enc, CNPPDU *val)
  1560. {
  1561. if (!ASN1PEREncSimpleChoiceEx(enc, (val)->choice, 3))
  1562. return 0;
  1563. switch ((val)->choice) {
  1564. case 1:
  1565. if (!ASN1Enc_ConnectRequestPDU(enc, &(val)->u.connectRequest))
  1566. return 0;
  1567. break;
  1568. case 2:
  1569. if (!ASN1Enc_ConnectConfirmPDU(enc, &(val)->u.connectConfirm))
  1570. return 0;
  1571. break;
  1572. case 3:
  1573. if (!ASN1Enc_DisconnectRequestPDU(enc, &(val)->u.disconnectRequest))
  1574. return 0;
  1575. break;
  1576. case 4:
  1577. if (!ASN1Enc_ErrorPDU(enc, &(val)->u.error))
  1578. return 0;
  1579. break;
  1580. case 5:
  1581. if (!ASN1Enc_CNP_NonStandardPDU(enc, &(val)->u.nonStandardCNPPDU))
  1582. return 0;
  1583. break;
  1584. default:
  1585. /* impossible */
  1586. ASN1EncSetError(enc, ASN1_ERR_CHOICE);
  1587. return 0;
  1588. }
  1589. return 1;
  1590. }
  1591. static int ASN1CALL ASN1Dec_CNPPDU(ASN1decoding_t dec, CNPPDU *val)
  1592. {
  1593. if (!ASN1PERDecSimpleChoiceEx(dec, &(val)->choice, 3))
  1594. return 0;
  1595. switch ((val)->choice) {
  1596. case 1:
  1597. if (!ASN1Dec_ConnectRequestPDU(dec, &(val)->u.connectRequest))
  1598. return 0;
  1599. break;
  1600. case 2:
  1601. if (!ASN1Dec_ConnectConfirmPDU(dec, &(val)->u.connectConfirm))
  1602. return 0;
  1603. break;
  1604. case 3:
  1605. if (!ASN1Dec_DisconnectRequestPDU(dec, &(val)->u.disconnectRequest))
  1606. return 0;
  1607. break;
  1608. case 4:
  1609. if (!ASN1Dec_ErrorPDU(dec, &(val)->u.error))
  1610. return 0;
  1611. break;
  1612. case 5:
  1613. if (!ASN1Dec_CNP_NonStandardPDU(dec, &(val)->u.nonStandardCNPPDU))
  1614. return 0;
  1615. break;
  1616. case 0:
  1617. /* extension case */
  1618. if (!ASN1PERDecSkipFragmented(dec, 8))
  1619. return 0;
  1620. break;
  1621. default:
  1622. /* impossible */
  1623. ASN1DecSetError(dec, ASN1_ERR_CHOICE);
  1624. return 0;
  1625. }
  1626. return 1;
  1627. }
  1628. static void ASN1CALL ASN1Free_CNPPDU(CNPPDU *val)
  1629. {
  1630. if (val) {
  1631. switch ((val)->choice) {
  1632. case 1:
  1633. ASN1Free_ConnectRequestPDU(&(val)->u.connectRequest);
  1634. break;
  1635. case 2:
  1636. ASN1Free_ConnectConfirmPDU(&(val)->u.connectConfirm);
  1637. break;
  1638. case 3:
  1639. ASN1Free_DisconnectRequestPDU(&(val)->u.disconnectRequest);
  1640. break;
  1641. case 4:
  1642. ASN1Free_ErrorPDU(&(val)->u.error);
  1643. break;
  1644. case 5:
  1645. ASN1Free_CNP_NonStandardPDU(&(val)->u.nonStandardCNPPDU);
  1646. break;
  1647. }
  1648. }
  1649. }
  1650. static int ASN1CALL ASN1Enc_DisconnectRequestPDU_destinationAddress(ASN1encoding_t enc, PDisconnectRequestPDU_destinationAddress *val)
  1651. {
  1652. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_DisconnectRequestPDU_destinationAddress_ElmFn);
  1653. }
  1654. static int ASN1CALL ASN1Enc_DisconnectRequestPDU_destinationAddress_ElmFn(ASN1encoding_t enc, PDisconnectRequestPDU_destinationAddress val)
  1655. {
  1656. if (!ASN1Enc_AliasAddress(enc, &val->value))
  1657. return 0;
  1658. return 1;
  1659. }
  1660. static int ASN1CALL ASN1Dec_DisconnectRequestPDU_destinationAddress(ASN1decoding_t dec, PDisconnectRequestPDU_destinationAddress *val)
  1661. {
  1662. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_DisconnectRequestPDU_destinationAddress_ElmFn, sizeof(**val));
  1663. }
  1664. static int ASN1CALL ASN1Dec_DisconnectRequestPDU_destinationAddress_ElmFn(ASN1decoding_t dec, PDisconnectRequestPDU_destinationAddress val)
  1665. {
  1666. if (!ASN1Dec_AliasAddress(dec, &val->value))
  1667. return 0;
  1668. return 1;
  1669. }
  1670. static void ASN1CALL ASN1Free_DisconnectRequestPDU_destinationAddress(PDisconnectRequestPDU_destinationAddress *val)
  1671. {
  1672. if (val) {
  1673. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_DisconnectRequestPDU_destinationAddress_ElmFn);
  1674. }
  1675. }
  1676. static void ASN1CALL ASN1Free_DisconnectRequestPDU_destinationAddress_ElmFn(PDisconnectRequestPDU_destinationAddress val)
  1677. {
  1678. if (val) {
  1679. ASN1Free_AliasAddress(&val->value);
  1680. }
  1681. }
  1682. static int ASN1CALL ASN1Enc_ConnectRequestPDU_destinationAddress(ASN1encoding_t enc, PConnectRequestPDU_destinationAddress *val)
  1683. {
  1684. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_ConnectRequestPDU_destinationAddress_ElmFn);
  1685. }
  1686. static int ASN1CALL ASN1Enc_ConnectRequestPDU_destinationAddress_ElmFn(ASN1encoding_t enc, PConnectRequestPDU_destinationAddress val)
  1687. {
  1688. if (!ASN1Enc_AliasAddress(enc, &val->value))
  1689. return 0;
  1690. return 1;
  1691. }
  1692. static int ASN1CALL ASN1Dec_ConnectRequestPDU_destinationAddress(ASN1decoding_t dec, PConnectRequestPDU_destinationAddress *val)
  1693. {
  1694. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_ConnectRequestPDU_destinationAddress_ElmFn, sizeof(**val));
  1695. }
  1696. static int ASN1CALL ASN1Dec_ConnectRequestPDU_destinationAddress_ElmFn(ASN1decoding_t dec, PConnectRequestPDU_destinationAddress val)
  1697. {
  1698. if (!ASN1Dec_AliasAddress(dec, &val->value))
  1699. return 0;
  1700. return 1;
  1701. }
  1702. static void ASN1CALL ASN1Free_ConnectRequestPDU_destinationAddress(PConnectRequestPDU_destinationAddress *val)
  1703. {
  1704. if (val) {
  1705. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_ConnectRequestPDU_destinationAddress_ElmFn);
  1706. }
  1707. }
  1708. static void ASN1CALL ASN1Free_ConnectRequestPDU_destinationAddress_ElmFn(PConnectRequestPDU_destinationAddress val)
  1709. {
  1710. if (val) {
  1711. ASN1Free_AliasAddress(&val->value);
  1712. }
  1713. }
  1714. static int ASN1CALL ASN1Enc_ConnectRequestPDU_unreliableTransportProtocols(ASN1encoding_t enc, PConnectRequestPDU_unreliableTransportProtocols *val)
  1715. {
  1716. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_ConnectRequestPDU_unreliableTransportProtocols_ElmFn);
  1717. }
  1718. static int ASN1CALL ASN1Enc_ConnectRequestPDU_unreliableTransportProtocols_ElmFn(ASN1encoding_t enc, PConnectRequestPDU_unreliableTransportProtocols val)
  1719. {
  1720. if (!ASN1Enc_UnreliableTransportProtocol(enc, &val->value))
  1721. return 0;
  1722. return 1;
  1723. }
  1724. static int ASN1CALL ASN1Dec_ConnectRequestPDU_unreliableTransportProtocols(ASN1decoding_t dec, PConnectRequestPDU_unreliableTransportProtocols *val)
  1725. {
  1726. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_ConnectRequestPDU_unreliableTransportProtocols_ElmFn, sizeof(**val));
  1727. }
  1728. static int ASN1CALL ASN1Dec_ConnectRequestPDU_unreliableTransportProtocols_ElmFn(ASN1decoding_t dec, PConnectRequestPDU_unreliableTransportProtocols val)
  1729. {
  1730. if (!ASN1Dec_UnreliableTransportProtocol(dec, &val->value))
  1731. return 0;
  1732. return 1;
  1733. }
  1734. static void ASN1CALL ASN1Free_ConnectRequestPDU_unreliableTransportProtocols(PConnectRequestPDU_unreliableTransportProtocols *val)
  1735. {
  1736. if (val) {
  1737. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_ConnectRequestPDU_unreliableTransportProtocols_ElmFn);
  1738. }
  1739. }
  1740. static void ASN1CALL ASN1Free_ConnectRequestPDU_unreliableTransportProtocols_ElmFn(PConnectRequestPDU_unreliableTransportProtocols val)
  1741. {
  1742. if (val) {
  1743. ASN1Free_UnreliableTransportProtocol(&val->value);
  1744. }
  1745. }
  1746. static int ASN1CALL ASN1Enc_ConnectRequestPDU_reliableSecurityProtocols(ASN1encoding_t enc, PConnectRequestPDU_reliableSecurityProtocols *val)
  1747. {
  1748. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_ConnectRequestPDU_reliableSecurityProtocols_ElmFn);
  1749. }
  1750. static int ASN1CALL ASN1Enc_ConnectRequestPDU_reliableSecurityProtocols_ElmFn(ASN1encoding_t enc, PConnectRequestPDU_reliableSecurityProtocols val)
  1751. {
  1752. if (!ASN1Enc_ReliableSecurityProtocol(enc, &val->value))
  1753. return 0;
  1754. return 1;
  1755. }
  1756. static int ASN1CALL ASN1Dec_ConnectRequestPDU_reliableSecurityProtocols(ASN1decoding_t dec, PConnectRequestPDU_reliableSecurityProtocols *val)
  1757. {
  1758. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_ConnectRequestPDU_reliableSecurityProtocols_ElmFn, sizeof(**val));
  1759. }
  1760. static int ASN1CALL ASN1Dec_ConnectRequestPDU_reliableSecurityProtocols_ElmFn(ASN1decoding_t dec, PConnectRequestPDU_reliableSecurityProtocols val)
  1761. {
  1762. if (!ASN1Dec_ReliableSecurityProtocol(dec, &val->value))
  1763. return 0;
  1764. return 1;
  1765. }
  1766. static void ASN1CALL ASN1Free_ConnectRequestPDU_reliableSecurityProtocols(PConnectRequestPDU_reliableSecurityProtocols *val)
  1767. {
  1768. if (val) {
  1769. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_ConnectRequestPDU_reliableSecurityProtocols_ElmFn);
  1770. }
  1771. }
  1772. static void ASN1CALL ASN1Free_ConnectRequestPDU_reliableSecurityProtocols_ElmFn(PConnectRequestPDU_reliableSecurityProtocols val)
  1773. {
  1774. if (val) {
  1775. ASN1Free_ReliableSecurityProtocol(&val->value);
  1776. }
  1777. }