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.

2055 lines
66 KiB

  1. #include <windows.h>
  2. #include "mcspdu.h"
  3. ASN1module_t MCSPDU_Module = NULL;
  4. static int ASN1CALL ASN1Enc_Given(ASN1encoding_t enc, Given *val);
  5. static int ASN1CALL ASN1Enc_Ungivable(ASN1encoding_t enc, Ungivable *val);
  6. static int ASN1CALL ASN1Enc_Giving(ASN1encoding_t enc, Giving *val);
  7. static int ASN1CALL ASN1Enc_Inhibited(ASN1encoding_t enc, Inhibited *val);
  8. static int ASN1CALL ASN1Enc_Grabbed(ASN1encoding_t enc, Grabbed *val);
  9. static int ASN1CALL ASN1Enc_ChannelAttributesAssigned(ASN1encoding_t enc, ChannelAttributesAssigned *val);
  10. static int ASN1CALL ASN1Enc_ChannelAttributesPrivate(ASN1encoding_t enc, ChannelAttributesPrivate *val);
  11. static int ASN1CALL ASN1Enc_ChannelAttributesUserID(ASN1encoding_t enc, ChannelAttributesUserID *val);
  12. static int ASN1CALL ASN1Enc_ChannelAttributesStatic(ASN1encoding_t enc, ChannelAttributesStatic *val);
  13. extern int ASN1CALL ASN1Enc_PDUDomainParameters(ASN1encoding_t enc, PDUDomainParameters *val);
  14. extern int ASN1CALL ASN1Enc_ConnectInitialPDU(ASN1encoding_t enc, ConnectInitialPDU *val);
  15. extern int ASN1CALL ASN1Enc_ConnectResponsePDU(ASN1encoding_t enc, ConnectResponsePDU *val);
  16. extern int ASN1CALL ASN1Enc_ConnectAdditionalPDU(ASN1encoding_t enc, ConnectAdditionalPDU *val);
  17. extern int ASN1CALL ASN1Enc_ConnectResultPDU(ASN1encoding_t enc, ConnectResultPDU *val);
  18. static int ASN1CALL ASN1Enc_PlumbDomainIndicationPDU(ASN1encoding_t enc, PlumbDomainIndicationPDU *val);
  19. static int ASN1CALL ASN1Enc_ErectDomainRequestPDU(ASN1encoding_t enc, ErectDomainRequestPDU *val);
  20. static int ASN1CALL ASN1Enc_PDUChannelAttributes(ASN1encoding_t enc, PDUChannelAttributes *val);
  21. static int ASN1CALL ASN1Enc_MergeChannelsRequestPDU(ASN1encoding_t enc, MergeChannelsRequestPDU *val);
  22. static int ASN1CALL ASN1Enc_MergeChannelsConfirmPDU(ASN1encoding_t enc, MergeChannelsConfirmPDU *val);
  23. static int ASN1CALL ASN1Enc_PurgeChannelIndicationPDU(ASN1encoding_t enc, PurgeChannelIndicationPDU *val);
  24. static int ASN1CALL ASN1Enc_PDUTokenAttributes(ASN1encoding_t enc, PDUTokenAttributes *val);
  25. static int ASN1CALL ASN1Enc_SetOfUserIDs(ASN1encoding_t enc, PSetOfUserIDs *val);
  26. static int ASN1CALL ASN1Enc_SetOfPDUChannelAttributes(ASN1encoding_t enc, PSetOfPDUChannelAttributes *val);
  27. static int ASN1CALL ASN1Enc_SetOfChannelIDs(ASN1encoding_t enc, PSetOfChannelIDs *val);
  28. static int ASN1CALL ASN1Enc_SetOfPDUTokenAttributes(ASN1encoding_t enc, PSetOfPDUTokenAttributes *val);
  29. static int ASN1CALL ASN1Enc_SetOfTokenIDs(ASN1encoding_t enc, PSetOfTokenIDs *val);
  30. static int ASN1CALL ASN1Enc_MergeTokensRequestPDU(ASN1encoding_t enc, MergeTokensRequestPDU *val);
  31. static int ASN1CALL ASN1Enc_MergeTokensConfirmPDU(ASN1encoding_t enc, MergeTokensConfirmPDU *val);
  32. static int ASN1CALL ASN1Enc_PurgeTokenIndicationPDU(ASN1encoding_t enc, PurgeTokenIndicationPDU *val);
  33. static int ASN1CALL ASN1Enc_DisconnectProviderUltimatumPDU(ASN1encoding_t enc, DisconnectProviderUltimatumPDU *val);
  34. static int ASN1CALL ASN1Enc_RejectUltimatumPDU(ASN1encoding_t enc, RejectUltimatumPDU *val);
  35. static int ASN1CALL ASN1Enc_AttachUserConfirmPDU(ASN1encoding_t enc, AttachUserConfirmPDU *val);
  36. static int ASN1CALL ASN1Enc_DetachUserRequestPDU(ASN1encoding_t enc, DetachUserRequestPDU *val);
  37. static int ASN1CALL ASN1Enc_DetachUserIndicationPDU(ASN1encoding_t enc, DetachUserIndicationPDU *val);
  38. static int ASN1CALL ASN1Enc_ChannelJoinRequestPDU(ASN1encoding_t enc, ChannelJoinRequestPDU *val);
  39. static int ASN1CALL ASN1Enc_ChannelJoinConfirmPDU(ASN1encoding_t enc, ChannelJoinConfirmPDU *val);
  40. static int ASN1CALL ASN1Enc_ChannelLeaveRequestPDU(ASN1encoding_t enc, ChannelLeaveRequestPDU *val);
  41. static int ASN1CALL ASN1Enc_ChannelConveneRequestPDU(ASN1encoding_t enc, ChannelConveneRequestPDU *val);
  42. static int ASN1CALL ASN1Enc_ChannelConveneConfirmPDU(ASN1encoding_t enc, ChannelConveneConfirmPDU *val);
  43. static int ASN1CALL ASN1Enc_ChannelDisbandRequestPDU(ASN1encoding_t enc, ChannelDisbandRequestPDU *val);
  44. static int ASN1CALL ASN1Enc_ChannelDisbandIndicationPDU(ASN1encoding_t enc, ChannelDisbandIndicationPDU *val);
  45. static int ASN1CALL ASN1Enc_ChannelAdmitRequestPDU(ASN1encoding_t enc, ChannelAdmitRequestPDU *val);
  46. static int ASN1CALL ASN1Enc_ChannelAdmitIndicationPDU(ASN1encoding_t enc, ChannelAdmitIndicationPDU *val);
  47. static int ASN1CALL ASN1Enc_ChannelExpelRequestPDU(ASN1encoding_t enc, ChannelExpelRequestPDU *val);
  48. static int ASN1CALL ASN1Enc_ChannelExpelIndicationPDU(ASN1encoding_t enc, ChannelExpelIndicationPDU *val);
  49. static int ASN1CALL ASN1Enc_TokenGrabRequestPDU(ASN1encoding_t enc, TokenGrabRequestPDU *val);
  50. static int ASN1CALL ASN1Enc_TokenGrabConfirmPDU(ASN1encoding_t enc, TokenGrabConfirmPDU *val);
  51. static int ASN1CALL ASN1Enc_TokenInhibitRequestPDU(ASN1encoding_t enc, TokenInhibitRequestPDU *val);
  52. static int ASN1CALL ASN1Enc_TokenInhibitConfirmPDU(ASN1encoding_t enc, TokenInhibitConfirmPDU *val);
  53. static int ASN1CALL ASN1Enc_TokenGiveRequestPDU(ASN1encoding_t enc, TokenGiveRequestPDU *val);
  54. static int ASN1CALL ASN1Enc_TokenGiveIndicationPDU(ASN1encoding_t enc, TokenGiveIndicationPDU *val);
  55. static int ASN1CALL ASN1Enc_TokenGiveResponsePDU(ASN1encoding_t enc, TokenGiveResponsePDU *val);
  56. static int ASN1CALL ASN1Enc_TokenGiveConfirmPDU(ASN1encoding_t enc, TokenGiveConfirmPDU *val);
  57. static int ASN1CALL ASN1Enc_TokenPleaseRequestPDU(ASN1encoding_t enc, TokenPleaseRequestPDU *val);
  58. static int ASN1CALL ASN1Enc_TokenPleaseIndicationPDU(ASN1encoding_t enc, TokenPleaseIndicationPDU *val);
  59. static int ASN1CALL ASN1Enc_TokenReleaseRequestPDU(ASN1encoding_t enc, TokenReleaseRequestPDU *val);
  60. static int ASN1CALL ASN1Enc_TokenReleaseConfirmPDU(ASN1encoding_t enc, TokenReleaseConfirmPDU *val);
  61. static int ASN1CALL ASN1Enc_TokenTestRequestPDU(ASN1encoding_t enc, TokenTestRequestPDU *val);
  62. static int ASN1CALL ASN1Enc_TokenTestConfirmPDU(ASN1encoding_t enc, TokenTestConfirmPDU *val);
  63. extern int ASN1CALL ASN1Enc_ConnectMCSPDU(ASN1encoding_t enc, ConnectMCSPDU *val);
  64. static int ASN1CALL ASN1Enc_DomainMCSPDU(ASN1encoding_t enc, DomainMCSPDU *val);
  65. static int ASN1CALL ASN1Dec_Given(ASN1decoding_t dec, Given *val);
  66. static int ASN1CALL ASN1Dec_Ungivable(ASN1decoding_t dec, Ungivable *val);
  67. static int ASN1CALL ASN1Dec_Giving(ASN1decoding_t dec, Giving *val);
  68. static int ASN1CALL ASN1Dec_Inhibited(ASN1decoding_t dec, Inhibited *val);
  69. static int ASN1CALL ASN1Dec_Grabbed(ASN1decoding_t dec, Grabbed *val);
  70. static int ASN1CALL ASN1Dec_ChannelAttributesAssigned(ASN1decoding_t dec, ChannelAttributesAssigned *val);
  71. static int ASN1CALL ASN1Dec_ChannelAttributesPrivate(ASN1decoding_t dec, ChannelAttributesPrivate *val);
  72. static int ASN1CALL ASN1Dec_ChannelAttributesUserID(ASN1decoding_t dec, ChannelAttributesUserID *val);
  73. static int ASN1CALL ASN1Dec_ChannelAttributesStatic(ASN1decoding_t dec, ChannelAttributesStatic *val);
  74. extern int ASN1CALL ASN1Dec_PDUDomainParameters(ASN1decoding_t dec, PDUDomainParameters *val);
  75. extern int ASN1CALL ASN1Dec_ConnectInitialPDU(ASN1decoding_t dec, ConnectInitialPDU *val);
  76. extern int ASN1CALL ASN1Dec_ConnectResponsePDU(ASN1decoding_t dec, ConnectResponsePDU *val);
  77. extern int ASN1CALL ASN1Dec_ConnectAdditionalPDU(ASN1decoding_t dec, ConnectAdditionalPDU *val);
  78. extern int ASN1CALL ASN1Dec_ConnectResultPDU(ASN1decoding_t dec, ConnectResultPDU *val);
  79. static int ASN1CALL ASN1Dec_PlumbDomainIndicationPDU(ASN1decoding_t dec, PlumbDomainIndicationPDU *val);
  80. static int ASN1CALL ASN1Dec_ErectDomainRequestPDU(ASN1decoding_t dec, ErectDomainRequestPDU *val);
  81. static int ASN1CALL ASN1Dec_PDUChannelAttributes(ASN1decoding_t dec, PDUChannelAttributes *val);
  82. static int ASN1CALL ASN1Dec_MergeChannelsRequestPDU(ASN1decoding_t dec, MergeChannelsRequestPDU *val);
  83. static int ASN1CALL ASN1Dec_MergeChannelsConfirmPDU(ASN1decoding_t dec, MergeChannelsConfirmPDU *val);
  84. static int ASN1CALL ASN1Dec_PurgeChannelIndicationPDU(ASN1decoding_t dec, PurgeChannelIndicationPDU *val);
  85. static int ASN1CALL ASN1Dec_PDUTokenAttributes(ASN1decoding_t dec, PDUTokenAttributes *val);
  86. static int ASN1CALL ASN1Dec_SetOfUserIDs(ASN1decoding_t dec, PSetOfUserIDs *val);
  87. static int ASN1CALL ASN1Dec_SetOfPDUChannelAttributes(ASN1decoding_t dec, PSetOfPDUChannelAttributes *val);
  88. static int ASN1CALL ASN1Dec_SetOfChannelIDs(ASN1decoding_t dec, PSetOfChannelIDs *val);
  89. static int ASN1CALL ASN1Dec_SetOfPDUTokenAttributes(ASN1decoding_t dec, PSetOfPDUTokenAttributes *val);
  90. static int ASN1CALL ASN1Dec_SetOfTokenIDs(ASN1decoding_t dec, PSetOfTokenIDs *val);
  91. static int ASN1CALL ASN1Dec_MergeTokensRequestPDU(ASN1decoding_t dec, MergeTokensRequestPDU *val);
  92. static int ASN1CALL ASN1Dec_MergeTokensConfirmPDU(ASN1decoding_t dec, MergeTokensConfirmPDU *val);
  93. static int ASN1CALL ASN1Dec_PurgeTokenIndicationPDU(ASN1decoding_t dec, PurgeTokenIndicationPDU *val);
  94. static int ASN1CALL ASN1Dec_DisconnectProviderUltimatumPDU(ASN1decoding_t dec, DisconnectProviderUltimatumPDU *val);
  95. static int ASN1CALL ASN1Dec_RejectUltimatumPDU(ASN1decoding_t dec, RejectUltimatumPDU *val);
  96. static int ASN1CALL ASN1Dec_AttachUserConfirmPDU(ASN1decoding_t dec, AttachUserConfirmPDU *val);
  97. static int ASN1CALL ASN1Dec_DetachUserRequestPDU(ASN1decoding_t dec, DetachUserRequestPDU *val);
  98. static int ASN1CALL ASN1Dec_DetachUserIndicationPDU(ASN1decoding_t dec, DetachUserIndicationPDU *val);
  99. static int ASN1CALL ASN1Dec_ChannelJoinRequestPDU(ASN1decoding_t dec, ChannelJoinRequestPDU *val);
  100. static int ASN1CALL ASN1Dec_ChannelJoinConfirmPDU(ASN1decoding_t dec, ChannelJoinConfirmPDU *val);
  101. static int ASN1CALL ASN1Dec_ChannelLeaveRequestPDU(ASN1decoding_t dec, ChannelLeaveRequestPDU *val);
  102. static int ASN1CALL ASN1Dec_ChannelConveneRequestPDU(ASN1decoding_t dec, ChannelConveneRequestPDU *val);
  103. static int ASN1CALL ASN1Dec_ChannelConveneConfirmPDU(ASN1decoding_t dec, ChannelConveneConfirmPDU *val);
  104. static int ASN1CALL ASN1Dec_ChannelDisbandRequestPDU(ASN1decoding_t dec, ChannelDisbandRequestPDU *val);
  105. static int ASN1CALL ASN1Dec_ChannelDisbandIndicationPDU(ASN1decoding_t dec, ChannelDisbandIndicationPDU *val);
  106. static int ASN1CALL ASN1Dec_ChannelAdmitRequestPDU(ASN1decoding_t dec, ChannelAdmitRequestPDU *val);
  107. static int ASN1CALL ASN1Dec_ChannelAdmitIndicationPDU(ASN1decoding_t dec, ChannelAdmitIndicationPDU *val);
  108. static int ASN1CALL ASN1Dec_ChannelExpelRequestPDU(ASN1decoding_t dec, ChannelExpelRequestPDU *val);
  109. static int ASN1CALL ASN1Dec_ChannelExpelIndicationPDU(ASN1decoding_t dec, ChannelExpelIndicationPDU *val);
  110. static int ASN1CALL ASN1Dec_TokenGrabRequestPDU(ASN1decoding_t dec, TokenGrabRequestPDU *val);
  111. static int ASN1CALL ASN1Dec_TokenGrabConfirmPDU(ASN1decoding_t dec, TokenGrabConfirmPDU *val);
  112. static int ASN1CALL ASN1Dec_TokenInhibitRequestPDU(ASN1decoding_t dec, TokenInhibitRequestPDU *val);
  113. static int ASN1CALL ASN1Dec_TokenInhibitConfirmPDU(ASN1decoding_t dec, TokenInhibitConfirmPDU *val);
  114. static int ASN1CALL ASN1Dec_TokenGiveRequestPDU(ASN1decoding_t dec, TokenGiveRequestPDU *val);
  115. static int ASN1CALL ASN1Dec_TokenGiveIndicationPDU(ASN1decoding_t dec, TokenGiveIndicationPDU *val);
  116. static int ASN1CALL ASN1Dec_TokenGiveResponsePDU(ASN1decoding_t dec, TokenGiveResponsePDU *val);
  117. static int ASN1CALL ASN1Dec_TokenGiveConfirmPDU(ASN1decoding_t dec, TokenGiveConfirmPDU *val);
  118. static int ASN1CALL ASN1Dec_TokenPleaseRequestPDU(ASN1decoding_t dec, TokenPleaseRequestPDU *val);
  119. static int ASN1CALL ASN1Dec_TokenPleaseIndicationPDU(ASN1decoding_t dec, TokenPleaseIndicationPDU *val);
  120. static int ASN1CALL ASN1Dec_TokenReleaseRequestPDU(ASN1decoding_t dec, TokenReleaseRequestPDU *val);
  121. static int ASN1CALL ASN1Dec_TokenReleaseConfirmPDU(ASN1decoding_t dec, TokenReleaseConfirmPDU *val);
  122. static int ASN1CALL ASN1Dec_TokenTestRequestPDU(ASN1decoding_t dec, TokenTestRequestPDU *val);
  123. static int ASN1CALL ASN1Dec_TokenTestConfirmPDU(ASN1decoding_t dec, TokenTestConfirmPDU *val);
  124. extern int ASN1CALL ASN1Dec_ConnectMCSPDU(ASN1decoding_t dec, ConnectMCSPDU *val);
  125. static int ASN1CALL ASN1Dec_DomainMCSPDU(ASN1decoding_t dec, DomainMCSPDU *val);
  126. static void ASN1CALL ASN1Free_Inhibited(Inhibited *val);
  127. static void ASN1CALL ASN1Free_ChannelAttributesPrivate(ChannelAttributesPrivate *val);
  128. static void ASN1CALL ASN1Free_ConnectInitialPDU(ConnectInitialPDU *val);
  129. static void ASN1CALL ASN1Free_ConnectResponsePDU(ConnectResponsePDU *val);
  130. static void ASN1CALL ASN1Free_PDUChannelAttributes(PDUChannelAttributes *val);
  131. static void ASN1CALL ASN1Free_MergeChannelsRequestPDU(MergeChannelsRequestPDU *val);
  132. static void ASN1CALL ASN1Free_MergeChannelsConfirmPDU(MergeChannelsConfirmPDU *val);
  133. static void ASN1CALL ASN1Free_PurgeChannelIndicationPDU(PurgeChannelIndicationPDU *val);
  134. static void ASN1CALL ASN1Free_PDUTokenAttributes(PDUTokenAttributes *val);
  135. static void ASN1CALL ASN1Free_SetOfUserIDs(PSetOfUserIDs *val);
  136. static void ASN1CALL ASN1Free_SetOfPDUChannelAttributes(PSetOfPDUChannelAttributes *val);
  137. static void ASN1CALL ASN1Free_SetOfChannelIDs(PSetOfChannelIDs *val);
  138. static void ASN1CALL ASN1Free_SetOfPDUTokenAttributes(PSetOfPDUTokenAttributes *val);
  139. static void ASN1CALL ASN1Free_SetOfTokenIDs(PSetOfTokenIDs *val);
  140. static void ASN1CALL ASN1Free_MergeTokensRequestPDU(MergeTokensRequestPDU *val);
  141. static void ASN1CALL ASN1Free_MergeTokensConfirmPDU(MergeTokensConfirmPDU *val);
  142. static void ASN1CALL ASN1Free_PurgeTokenIndicationPDU(PurgeTokenIndicationPDU *val);
  143. static void ASN1CALL ASN1Free_RejectUltimatumPDU(RejectUltimatumPDU *val);
  144. static void ASN1CALL ASN1Free_DetachUserRequestPDU(DetachUserRequestPDU *val);
  145. static void ASN1CALL ASN1Free_DetachUserIndicationPDU(DetachUserIndicationPDU *val);
  146. static void ASN1CALL ASN1Free_ChannelLeaveRequestPDU(ChannelLeaveRequestPDU *val);
  147. static void ASN1CALL ASN1Free_ChannelAdmitRequestPDU(ChannelAdmitRequestPDU *val);
  148. static void ASN1CALL ASN1Free_ChannelAdmitIndicationPDU(ChannelAdmitIndicationPDU *val);
  149. static void ASN1CALL ASN1Free_ChannelExpelRequestPDU(ChannelExpelRequestPDU *val);
  150. static void ASN1CALL ASN1Free_ChannelExpelIndicationPDU(ChannelExpelIndicationPDU *val);
  151. static void ASN1CALL ASN1Free_ConnectMCSPDU(ConnectMCSPDU *val);
  152. static void ASN1CALL ASN1Free_DomainMCSPDU(DomainMCSPDU *val);
  153. typedef ASN1PerEncFun_t ASN1EncFun_t;
  154. static const ASN1EncFun_t encfntab[2] = {
  155. (ASN1EncFun_t) ASN1Enc_ConnectMCSPDU,
  156. (ASN1EncFun_t) ASN1Enc_DomainMCSPDU,
  157. };
  158. typedef ASN1PerDecFun_t ASN1DecFun_t;
  159. static const ASN1DecFun_t decfntab[2] = {
  160. (ASN1DecFun_t) ASN1Dec_ConnectMCSPDU,
  161. (ASN1DecFun_t) ASN1Dec_DomainMCSPDU,
  162. };
  163. static const ASN1FreeFun_t freefntab[2] = {
  164. (ASN1FreeFun_t) ASN1Free_ConnectMCSPDU,
  165. (ASN1FreeFun_t) ASN1Free_DomainMCSPDU,
  166. };
  167. static const ULONG sizetab[2] = {
  168. SIZE_MCSPDU_Module_PDU_0,
  169. SIZE_MCSPDU_Module_PDU_1,
  170. };
  171. /* forward declarations of values: */
  172. /* definitions of value components: */
  173. /* definitions of values: */
  174. void ASN1CALL MCSPDU_Module_Startup(void)
  175. {
  176. MCSPDU_Module = ASN1_CreateModule(0x10000, ASN1_PER_RULE_ALIGNED, ASN1FLAGS_NONE, 2, (const ASN1GenericFun_t *) encfntab, (const ASN1GenericFun_t *) decfntab, freefntab, sizetab, 0x73636d);
  177. }
  178. void ASN1CALL MCSPDU_Module_Cleanup(void)
  179. {
  180. ASN1_CloseModule(MCSPDU_Module);
  181. MCSPDU_Module = NULL;
  182. }
  183. static int ASN1CALL ASN1Enc_Given(ASN1encoding_t enc, Given *val)
  184. {
  185. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  186. return 0;
  187. if (!ASN1PEREncUnsignedShort(enc, (val)->recipient - 1001))
  188. return 0;
  189. return 1;
  190. }
  191. static int ASN1CALL ASN1Dec_Given(ASN1decoding_t dec, Given *val)
  192. {
  193. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  194. return 0;
  195. (val)->token_id += 1;
  196. if (!ASN1PERDecUnsignedShort(dec, &(val)->recipient))
  197. return 0;
  198. (val)->recipient += 1001;
  199. return 1;
  200. }
  201. static int ASN1CALL ASN1Enc_Ungivable(ASN1encoding_t enc, Ungivable *val)
  202. {
  203. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  204. return 0;
  205. if (!ASN1PEREncUnsignedShort(enc, (val)->grabber - 1001))
  206. return 0;
  207. return 1;
  208. }
  209. static int ASN1CALL ASN1Dec_Ungivable(ASN1decoding_t dec, Ungivable *val)
  210. {
  211. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  212. return 0;
  213. (val)->token_id += 1;
  214. if (!ASN1PERDecUnsignedShort(dec, &(val)->grabber))
  215. return 0;
  216. (val)->grabber += 1001;
  217. return 1;
  218. }
  219. static int ASN1CALL ASN1Enc_Giving(ASN1encoding_t enc, Giving *val)
  220. {
  221. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  222. return 0;
  223. if (!ASN1PEREncUnsignedShort(enc, (val)->grabber - 1001))
  224. return 0;
  225. if (!ASN1PEREncUnsignedShort(enc, (val)->recipient - 1001))
  226. return 0;
  227. return 1;
  228. }
  229. static int ASN1CALL ASN1Dec_Giving(ASN1decoding_t dec, Giving *val)
  230. {
  231. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  232. return 0;
  233. (val)->token_id += 1;
  234. if (!ASN1PERDecUnsignedShort(dec, &(val)->grabber))
  235. return 0;
  236. (val)->grabber += 1001;
  237. if (!ASN1PERDecUnsignedShort(dec, &(val)->recipient))
  238. return 0;
  239. (val)->recipient += 1001;
  240. return 1;
  241. }
  242. static int ASN1CALL ASN1Enc_Inhibited(ASN1encoding_t enc, Inhibited *val)
  243. {
  244. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  245. return 0;
  246. if (!ASN1Enc_SetOfUserIDs(enc, &(val)->inhibitors))
  247. return 0;
  248. return 1;
  249. }
  250. static int ASN1CALL ASN1Dec_Inhibited(ASN1decoding_t dec, Inhibited *val)
  251. {
  252. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  253. return 0;
  254. (val)->token_id += 1;
  255. if (!ASN1Dec_SetOfUserIDs(dec, &(val)->inhibitors))
  256. return 0;
  257. return 1;
  258. }
  259. static void ASN1CALL ASN1Free_Inhibited(Inhibited *val)
  260. {
  261. if (val) {
  262. ASN1Free_SetOfUserIDs(&(val)->inhibitors);
  263. }
  264. }
  265. static int ASN1CALL ASN1Enc_Grabbed(ASN1encoding_t enc, Grabbed *val)
  266. {
  267. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  268. return 0;
  269. if (!ASN1PEREncUnsignedShort(enc, (val)->grabber - 1001))
  270. return 0;
  271. return 1;
  272. }
  273. static int ASN1CALL ASN1Dec_Grabbed(ASN1decoding_t dec, Grabbed *val)
  274. {
  275. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  276. return 0;
  277. (val)->token_id += 1;
  278. if (!ASN1PERDecUnsignedShort(dec, &(val)->grabber))
  279. return 0;
  280. (val)->grabber += 1001;
  281. return 1;
  282. }
  283. static int ASN1CALL ASN1Enc_ChannelAttributesAssigned(ASN1encoding_t enc, ChannelAttributesAssigned *val)
  284. {
  285. if (!ASN1PEREncUnsignedShort(enc, (val)->channel_id - 1001))
  286. return 0;
  287. return 1;
  288. }
  289. static int ASN1CALL ASN1Dec_ChannelAttributesAssigned(ASN1decoding_t dec, ChannelAttributesAssigned *val)
  290. {
  291. if (!ASN1PERDecUnsignedShort(dec, &(val)->channel_id))
  292. return 0;
  293. (val)->channel_id += 1001;
  294. return 1;
  295. }
  296. static int ASN1CALL ASN1Enc_ChannelAttributesPrivate(ASN1encoding_t enc, ChannelAttributesPrivate *val)
  297. {
  298. if (!ASN1PEREncBoolean(enc, (val)->joined))
  299. return 0;
  300. if (!ASN1PEREncUnsignedShort(enc, (val)->channel_id - 1001))
  301. return 0;
  302. if (!ASN1PEREncUnsignedShort(enc, (val)->manager - 1001))
  303. return 0;
  304. if (!ASN1Enc_SetOfUserIDs(enc, &(val)->admitted))
  305. return 0;
  306. return 1;
  307. }
  308. static int ASN1CALL ASN1Dec_ChannelAttributesPrivate(ASN1decoding_t dec, ChannelAttributesPrivate *val)
  309. {
  310. if (!ASN1PERDecBoolean(dec, &(val)->joined))
  311. return 0;
  312. if (!ASN1PERDecUnsignedShort(dec, &(val)->channel_id))
  313. return 0;
  314. (val)->channel_id += 1001;
  315. if (!ASN1PERDecUnsignedShort(dec, &(val)->manager))
  316. return 0;
  317. (val)->manager += 1001;
  318. if (!ASN1Dec_SetOfUserIDs(dec, &(val)->admitted))
  319. return 0;
  320. return 1;
  321. }
  322. static void ASN1CALL ASN1Free_ChannelAttributesPrivate(ChannelAttributesPrivate *val)
  323. {
  324. if (val) {
  325. ASN1Free_SetOfUserIDs(&(val)->admitted);
  326. }
  327. }
  328. static int ASN1CALL ASN1Enc_ChannelAttributesUserID(ASN1encoding_t enc, ChannelAttributesUserID *val)
  329. {
  330. if (!ASN1PEREncBoolean(enc, (val)->joined))
  331. return 0;
  332. if (!ASN1PEREncUnsignedShort(enc, (val)->user_id - 1001))
  333. return 0;
  334. return 1;
  335. }
  336. static int ASN1CALL ASN1Dec_ChannelAttributesUserID(ASN1decoding_t dec, ChannelAttributesUserID *val)
  337. {
  338. if (!ASN1PERDecBoolean(dec, &(val)->joined))
  339. return 0;
  340. if (!ASN1PERDecUnsignedShort(dec, &(val)->user_id))
  341. return 0;
  342. (val)->user_id += 1001;
  343. return 1;
  344. }
  345. static int ASN1CALL ASN1Enc_ChannelAttributesStatic(ASN1encoding_t enc, ChannelAttributesStatic *val)
  346. {
  347. if (!ASN1PEREncUnsignedShort(enc, (val)->channel_id - 1))
  348. return 0;
  349. return 1;
  350. }
  351. static int ASN1CALL ASN1Dec_ChannelAttributesStatic(ASN1decoding_t dec, ChannelAttributesStatic *val)
  352. {
  353. if (!ASN1PERDecUnsignedShort(dec, &(val)->channel_id))
  354. return 0;
  355. (val)->channel_id += 1;
  356. return 1;
  357. }
  358. static void ASN1CALL ASN1Free_ConnectInitialPDU(ConnectInitialPDU *val)
  359. {
  360. if (val) {
  361. ASN1octetstring_free(&(val)->calling_domain_selector);
  362. ASN1octetstring_free(&(val)->called_domain_selector);
  363. ASN1octetstring_free(&(val)->user_data);
  364. }
  365. }
  366. static void ASN1CALL ASN1Free_ConnectResponsePDU(ConnectResponsePDU *val)
  367. {
  368. if (val) {
  369. ASN1octetstring_free(&(val)->user_data);
  370. }
  371. }
  372. static int ASN1CALL ASN1Enc_PlumbDomainIndicationPDU(ASN1encoding_t enc, PlumbDomainIndicationPDU *val)
  373. {
  374. if (!ASN1PEREncUnsignedInteger(enc, (val)->height_limit))
  375. return 0;
  376. return 1;
  377. }
  378. static int ASN1CALL ASN1Dec_PlumbDomainIndicationPDU(ASN1decoding_t dec, PlumbDomainIndicationPDU *val)
  379. {
  380. if (!ASN1PERDecUnsignedInteger(dec, &(val)->height_limit))
  381. return 0;
  382. return 1;
  383. }
  384. static int ASN1CALL ASN1Enc_ErectDomainRequestPDU(ASN1encoding_t enc, ErectDomainRequestPDU *val)
  385. {
  386. #ifndef _WIN64
  387. if (!ASN1PEREncUnsignedInteger(enc, (val)->sub_height))
  388. #endif
  389. return 0;
  390. if (!ASN1PEREncUnsignedInteger(enc, (val)->sub_interval))
  391. return 0;
  392. return 1;
  393. }
  394. static int ASN1CALL ASN1Dec_ErectDomainRequestPDU(ASN1decoding_t dec, ErectDomainRequestPDU *val)
  395. {
  396. #ifndef _WIN64
  397. if (!ASN1PERDecUnsignedInteger(dec, &(val)->sub_height))
  398. #endif
  399. return 0;
  400. if (!ASN1PERDecUnsignedInteger(dec, &(val)->sub_interval))
  401. return 0;
  402. return 1;
  403. }
  404. static int ASN1CALL ASN1Enc_PDUChannelAttributes(ASN1encoding_t enc, PDUChannelAttributes *val)
  405. {
  406. if (!ASN1PEREncSimpleChoice(enc, (val)->choice, 2))
  407. return 0;
  408. switch ((val)->choice) {
  409. case 1:
  410. if (!ASN1Enc_ChannelAttributesStatic(enc, &(val)->u.channel_attributes_static))
  411. return 0;
  412. break;
  413. case 2:
  414. if (!ASN1Enc_ChannelAttributesUserID(enc, &(val)->u.channel_attributes_user_id))
  415. return 0;
  416. break;
  417. case 3:
  418. if (!ASN1Enc_ChannelAttributesPrivate(enc, &(val)->u.channel_attributes_private))
  419. return 0;
  420. break;
  421. case 4:
  422. if (!ASN1Enc_ChannelAttributesAssigned(enc, &(val)->u.channel_attributes_assigned))
  423. return 0;
  424. break;
  425. default:
  426. /* impossible */
  427. ASN1EncSetError(enc, ASN1_ERR_CHOICE);
  428. return 0;
  429. }
  430. return 1;
  431. }
  432. static int ASN1CALL ASN1Dec_PDUChannelAttributes(ASN1decoding_t dec, PDUChannelAttributes *val)
  433. {
  434. if (!ASN1PERDecSimpleChoice(dec, &(val)->choice, 2))
  435. return 0;
  436. switch ((val)->choice) {
  437. case 1:
  438. if (!ASN1Dec_ChannelAttributesStatic(dec, &(val)->u.channel_attributes_static))
  439. return 0;
  440. break;
  441. case 2:
  442. if (!ASN1Dec_ChannelAttributesUserID(dec, &(val)->u.channel_attributes_user_id))
  443. return 0;
  444. break;
  445. case 3:
  446. if (!ASN1Dec_ChannelAttributesPrivate(dec, &(val)->u.channel_attributes_private))
  447. return 0;
  448. break;
  449. case 4:
  450. if (!ASN1Dec_ChannelAttributesAssigned(dec, &(val)->u.channel_attributes_assigned))
  451. return 0;
  452. break;
  453. default:
  454. /* impossible */
  455. ASN1DecSetError(dec, ASN1_ERR_CHOICE);
  456. return 0;
  457. }
  458. return 1;
  459. }
  460. static void ASN1CALL ASN1Free_PDUChannelAttributes(PDUChannelAttributes *val)
  461. {
  462. if (val) {
  463. switch ((val)->choice) {
  464. case 3:
  465. ASN1Free_ChannelAttributesPrivate(&(val)->u.channel_attributes_private);
  466. break;
  467. }
  468. }
  469. }
  470. static int ASN1CALL ASN1Enc_MergeChannelsRequestPDU(ASN1encoding_t enc, MergeChannelsRequestPDU *val)
  471. {
  472. if (!ASN1Enc_SetOfPDUChannelAttributes(enc, &(val)->merge_channels))
  473. return 0;
  474. if (!ASN1Enc_SetOfChannelIDs(enc, &(val)->purge_channel_ids))
  475. return 0;
  476. return 1;
  477. }
  478. static int ASN1CALL ASN1Dec_MergeChannelsRequestPDU(ASN1decoding_t dec, MergeChannelsRequestPDU *val)
  479. {
  480. if (!ASN1Dec_SetOfPDUChannelAttributes(dec, &(val)->merge_channels))
  481. return 0;
  482. if (!ASN1Dec_SetOfChannelIDs(dec, &(val)->purge_channel_ids))
  483. return 0;
  484. return 1;
  485. }
  486. static void ASN1CALL ASN1Free_MergeChannelsRequestPDU(MergeChannelsRequestPDU *val)
  487. {
  488. if (val) {
  489. ASN1Free_SetOfPDUChannelAttributes(&(val)->merge_channels);
  490. ASN1Free_SetOfChannelIDs(&(val)->purge_channel_ids);
  491. }
  492. }
  493. static int ASN1CALL ASN1Enc_MergeChannelsConfirmPDU(ASN1encoding_t enc, MergeChannelsConfirmPDU *val)
  494. {
  495. if (!ASN1Enc_SetOfPDUChannelAttributes(enc, &(val)->merge_channels))
  496. return 0;
  497. if (!ASN1Enc_SetOfChannelIDs(enc, &(val)->purge_channel_ids))
  498. return 0;
  499. return 1;
  500. }
  501. static int ASN1CALL ASN1Dec_MergeChannelsConfirmPDU(ASN1decoding_t dec, MergeChannelsConfirmPDU *val)
  502. {
  503. if (!ASN1Dec_SetOfPDUChannelAttributes(dec, &(val)->merge_channels))
  504. return 0;
  505. if (!ASN1Dec_SetOfChannelIDs(dec, &(val)->purge_channel_ids))
  506. return 0;
  507. return 1;
  508. }
  509. static void ASN1CALL ASN1Free_MergeChannelsConfirmPDU(MergeChannelsConfirmPDU *val)
  510. {
  511. if (val) {
  512. ASN1Free_SetOfPDUChannelAttributes(&(val)->merge_channels);
  513. ASN1Free_SetOfChannelIDs(&(val)->purge_channel_ids);
  514. }
  515. }
  516. static int ASN1CALL ASN1Enc_PurgeChannelIndicationPDU(ASN1encoding_t enc, PurgeChannelIndicationPDU *val)
  517. {
  518. if (!ASN1Enc_SetOfUserIDs(enc, &(val)->detach_user_ids))
  519. return 0;
  520. if (!ASN1Enc_SetOfChannelIDs(enc, &(val)->purge_channel_ids))
  521. return 0;
  522. return 1;
  523. }
  524. static int ASN1CALL ASN1Dec_PurgeChannelIndicationPDU(ASN1decoding_t dec, PurgeChannelIndicationPDU *val)
  525. {
  526. if (!ASN1Dec_SetOfUserIDs(dec, &(val)->detach_user_ids))
  527. return 0;
  528. if (!ASN1Dec_SetOfChannelIDs(dec, &(val)->purge_channel_ids))
  529. return 0;
  530. return 1;
  531. }
  532. static void ASN1CALL ASN1Free_PurgeChannelIndicationPDU(PurgeChannelIndicationPDU *val)
  533. {
  534. if (val) {
  535. ASN1Free_SetOfUserIDs(&(val)->detach_user_ids);
  536. ASN1Free_SetOfChannelIDs(&(val)->purge_channel_ids);
  537. }
  538. }
  539. static int ASN1CALL ASN1Enc_PDUTokenAttributes(ASN1encoding_t enc, PDUTokenAttributes *val)
  540. {
  541. if (!ASN1PEREncSimpleChoice(enc, (val)->choice, 3))
  542. return 0;
  543. switch ((val)->choice) {
  544. case 1:
  545. if (!ASN1Enc_Grabbed(enc, &(val)->u.grabbed))
  546. return 0;
  547. break;
  548. case 2:
  549. if (!ASN1Enc_Inhibited(enc, &(val)->u.inhibited))
  550. return 0;
  551. break;
  552. case 3:
  553. if (!ASN1Enc_Giving(enc, &(val)->u.giving))
  554. return 0;
  555. break;
  556. case 4:
  557. if (!ASN1Enc_Ungivable(enc, &(val)->u.ungivable))
  558. return 0;
  559. break;
  560. case 5:
  561. if (!ASN1Enc_Given(enc, &(val)->u.given))
  562. return 0;
  563. break;
  564. default:
  565. /* impossible */
  566. ASN1EncSetError(enc, ASN1_ERR_CHOICE);
  567. return 0;
  568. }
  569. return 1;
  570. }
  571. static int ASN1CALL ASN1Dec_PDUTokenAttributes(ASN1decoding_t dec, PDUTokenAttributes *val)
  572. {
  573. if (!ASN1PERDecSimpleChoice(dec, &(val)->choice, 3))
  574. return 0;
  575. switch ((val)->choice) {
  576. case 1:
  577. if (!ASN1Dec_Grabbed(dec, &(val)->u.grabbed))
  578. return 0;
  579. break;
  580. case 2:
  581. if (!ASN1Dec_Inhibited(dec, &(val)->u.inhibited))
  582. return 0;
  583. break;
  584. case 3:
  585. if (!ASN1Dec_Giving(dec, &(val)->u.giving))
  586. return 0;
  587. break;
  588. case 4:
  589. if (!ASN1Dec_Ungivable(dec, &(val)->u.ungivable))
  590. return 0;
  591. break;
  592. case 5:
  593. if (!ASN1Dec_Given(dec, &(val)->u.given))
  594. return 0;
  595. break;
  596. default:
  597. /* impossible */
  598. ASN1DecSetError(dec, ASN1_ERR_CHOICE);
  599. return 0;
  600. }
  601. return 1;
  602. }
  603. static void ASN1CALL ASN1Free_PDUTokenAttributes(PDUTokenAttributes *val)
  604. {
  605. if (val) {
  606. switch ((val)->choice) {
  607. case 2:
  608. ASN1Free_Inhibited(&(val)->u.inhibited);
  609. break;
  610. }
  611. }
  612. }
  613. static int ASN1CALL ASN1Enc_SetOfUserIDs(ASN1encoding_t enc, PSetOfUserIDs *val)
  614. {
  615. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_SetOfUserIDs_ElmFn);
  616. }
  617. static int ASN1CALL ASN1Enc_SetOfUserIDs_ElmFn(ASN1encoding_t enc, PSetOfUserIDs val)
  618. {
  619. if (!ASN1PEREncUnsignedShort(enc, val->value - 1001))
  620. return 0;
  621. return 1;
  622. }
  623. static int ASN1CALL ASN1Dec_SetOfUserIDs(ASN1decoding_t dec, PSetOfUserIDs *val)
  624. {
  625. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_SetOfUserIDs_ElmFn, sizeof(**val));
  626. }
  627. static int ASN1CALL ASN1Dec_SetOfUserIDs_ElmFn(ASN1decoding_t dec, PSetOfUserIDs val)
  628. {
  629. if (!ASN1PERDecUnsignedShort(dec, &val->value))
  630. return 0;
  631. val->value += 1001;
  632. return 1;
  633. }
  634. static void ASN1CALL ASN1Free_SetOfUserIDs(PSetOfUserIDs *val)
  635. {
  636. if (val) {
  637. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_SetOfUserIDs_ElmFn);
  638. }
  639. }
  640. static void ASN1CALL ASN1Free_SetOfUserIDs_ElmFn(PSetOfUserIDs val)
  641. {
  642. if (val) {
  643. }
  644. }
  645. static int ASN1CALL ASN1Enc_SetOfPDUChannelAttributes(ASN1encoding_t enc, PSetOfPDUChannelAttributes *val)
  646. {
  647. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_SetOfPDUChannelAttributes_ElmFn);
  648. }
  649. static int ASN1CALL ASN1Enc_SetOfPDUChannelAttributes_ElmFn(ASN1encoding_t enc, PSetOfPDUChannelAttributes val)
  650. {
  651. if (!ASN1Enc_PDUChannelAttributes(enc, &val->value))
  652. return 0;
  653. return 1;
  654. }
  655. static int ASN1CALL ASN1Dec_SetOfPDUChannelAttributes(ASN1decoding_t dec, PSetOfPDUChannelAttributes *val)
  656. {
  657. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_SetOfPDUChannelAttributes_ElmFn, sizeof(**val));
  658. }
  659. static int ASN1CALL ASN1Dec_SetOfPDUChannelAttributes_ElmFn(ASN1decoding_t dec, PSetOfPDUChannelAttributes val)
  660. {
  661. if (!ASN1Dec_PDUChannelAttributes(dec, &val->value))
  662. return 0;
  663. return 1;
  664. }
  665. static void ASN1CALL ASN1Free_SetOfPDUChannelAttributes(PSetOfPDUChannelAttributes *val)
  666. {
  667. if (val) {
  668. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_SetOfPDUChannelAttributes_ElmFn);
  669. }
  670. }
  671. static void ASN1CALL ASN1Free_SetOfPDUChannelAttributes_ElmFn(PSetOfPDUChannelAttributes val)
  672. {
  673. if (val) {
  674. ASN1Free_PDUChannelAttributes(&val->value);
  675. }
  676. }
  677. static int ASN1CALL ASN1Enc_SetOfChannelIDs(ASN1encoding_t enc, PSetOfChannelIDs *val)
  678. {
  679. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_SetOfChannelIDs_ElmFn);
  680. }
  681. static int ASN1CALL ASN1Enc_SetOfChannelIDs_ElmFn(ASN1encoding_t enc, PSetOfChannelIDs val)
  682. {
  683. if (!ASN1PEREncUnsignedShort(enc, val->value))
  684. return 0;
  685. return 1;
  686. }
  687. static int ASN1CALL ASN1Dec_SetOfChannelIDs(ASN1decoding_t dec, PSetOfChannelIDs *val)
  688. {
  689. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_SetOfChannelIDs_ElmFn, sizeof(**val));
  690. }
  691. static int ASN1CALL ASN1Dec_SetOfChannelIDs_ElmFn(ASN1decoding_t dec, PSetOfChannelIDs val)
  692. {
  693. if (!ASN1PERDecUnsignedShort(dec, &val->value))
  694. return 0;
  695. return 1;
  696. }
  697. static void ASN1CALL ASN1Free_SetOfChannelIDs(PSetOfChannelIDs *val)
  698. {
  699. if (val) {
  700. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_SetOfChannelIDs_ElmFn);
  701. }
  702. }
  703. static void ASN1CALL ASN1Free_SetOfChannelIDs_ElmFn(PSetOfChannelIDs val)
  704. {
  705. if (val) {
  706. }
  707. }
  708. static int ASN1CALL ASN1Enc_SetOfPDUTokenAttributes(ASN1encoding_t enc, PSetOfPDUTokenAttributes *val)
  709. {
  710. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_SetOfPDUTokenAttributes_ElmFn);
  711. }
  712. static int ASN1CALL ASN1Enc_SetOfPDUTokenAttributes_ElmFn(ASN1encoding_t enc, PSetOfPDUTokenAttributes val)
  713. {
  714. if (!ASN1Enc_PDUTokenAttributes(enc, &val->value))
  715. return 0;
  716. return 1;
  717. }
  718. static int ASN1CALL ASN1Dec_SetOfPDUTokenAttributes(ASN1decoding_t dec, PSetOfPDUTokenAttributes *val)
  719. {
  720. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_SetOfPDUTokenAttributes_ElmFn, sizeof(**val));
  721. }
  722. static int ASN1CALL ASN1Dec_SetOfPDUTokenAttributes_ElmFn(ASN1decoding_t dec, PSetOfPDUTokenAttributes val)
  723. {
  724. if (!ASN1Dec_PDUTokenAttributes(dec, &val->value))
  725. return 0;
  726. return 1;
  727. }
  728. static void ASN1CALL ASN1Free_SetOfPDUTokenAttributes(PSetOfPDUTokenAttributes *val)
  729. {
  730. if (val) {
  731. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_SetOfPDUTokenAttributes_ElmFn);
  732. }
  733. }
  734. static void ASN1CALL ASN1Free_SetOfPDUTokenAttributes_ElmFn(PSetOfPDUTokenAttributes val)
  735. {
  736. if (val) {
  737. ASN1Free_PDUTokenAttributes(&val->value);
  738. }
  739. }
  740. static int ASN1CALL ASN1Enc_SetOfTokenIDs(ASN1encoding_t enc, PSetOfTokenIDs *val)
  741. {
  742. return ASN1PEREncSeqOf_NoSize(enc, (ASN1iterator_t **) val, (ASN1iterator_encfn) ASN1Enc_SetOfTokenIDs_ElmFn);
  743. }
  744. static int ASN1CALL ASN1Enc_SetOfTokenIDs_ElmFn(ASN1encoding_t enc, PSetOfTokenIDs val)
  745. {
  746. if (!ASN1PEREncUnsignedShort(enc, val->value - 1))
  747. return 0;
  748. return 1;
  749. }
  750. static int ASN1CALL ASN1Dec_SetOfTokenIDs(ASN1decoding_t dec, PSetOfTokenIDs *val)
  751. {
  752. return ASN1PERDecSeqOf_NoSize(dec, (ASN1iterator_t **) val, (ASN1iterator_decfn) ASN1Dec_SetOfTokenIDs_ElmFn, sizeof(**val));
  753. }
  754. static int ASN1CALL ASN1Dec_SetOfTokenIDs_ElmFn(ASN1decoding_t dec, PSetOfTokenIDs val)
  755. {
  756. if (!ASN1PERDecUnsignedShort(dec, &val->value))
  757. return 0;
  758. val->value += 1;
  759. return 1;
  760. }
  761. static void ASN1CALL ASN1Free_SetOfTokenIDs(PSetOfTokenIDs *val)
  762. {
  763. if (val) {
  764. ASN1PERFreeSeqOf((ASN1iterator_t **) val, (ASN1iterator_freefn) ASN1Free_SetOfTokenIDs_ElmFn);
  765. }
  766. }
  767. static void ASN1CALL ASN1Free_SetOfTokenIDs_ElmFn(PSetOfTokenIDs val)
  768. {
  769. if (val) {
  770. }
  771. }
  772. static int ASN1CALL ASN1Enc_MergeTokensRequestPDU(ASN1encoding_t enc, MergeTokensRequestPDU *val)
  773. {
  774. if (!ASN1Enc_SetOfPDUTokenAttributes(enc, &(val)->merge_tokens))
  775. return 0;
  776. if (!ASN1Enc_SetOfTokenIDs(enc, &(val)->purge_token_ids))
  777. return 0;
  778. return 1;
  779. }
  780. static int ASN1CALL ASN1Dec_MergeTokensRequestPDU(ASN1decoding_t dec, MergeTokensRequestPDU *val)
  781. {
  782. if (!ASN1Dec_SetOfPDUTokenAttributes(dec, &(val)->merge_tokens))
  783. return 0;
  784. if (!ASN1Dec_SetOfTokenIDs(dec, &(val)->purge_token_ids))
  785. return 0;
  786. return 1;
  787. }
  788. static void ASN1CALL ASN1Free_MergeTokensRequestPDU(MergeTokensRequestPDU *val)
  789. {
  790. if (val) {
  791. ASN1Free_SetOfPDUTokenAttributes(&(val)->merge_tokens);
  792. ASN1Free_SetOfTokenIDs(&(val)->purge_token_ids);
  793. }
  794. }
  795. static int ASN1CALL ASN1Enc_MergeTokensConfirmPDU(ASN1encoding_t enc, MergeTokensConfirmPDU *val)
  796. {
  797. if (!ASN1Enc_SetOfPDUTokenAttributes(enc, &(val)->merge_tokens))
  798. return 0;
  799. if (!ASN1Enc_SetOfTokenIDs(enc, &(val)->purge_token_ids))
  800. return 0;
  801. return 1;
  802. }
  803. static int ASN1CALL ASN1Dec_MergeTokensConfirmPDU(ASN1decoding_t dec, MergeTokensConfirmPDU *val)
  804. {
  805. if (!ASN1Dec_SetOfPDUTokenAttributes(dec, &(val)->merge_tokens))
  806. return 0;
  807. if (!ASN1Dec_SetOfTokenIDs(dec, &(val)->purge_token_ids))
  808. return 0;
  809. return 1;
  810. }
  811. static void ASN1CALL ASN1Free_MergeTokensConfirmPDU(MergeTokensConfirmPDU *val)
  812. {
  813. if (val) {
  814. ASN1Free_SetOfPDUTokenAttributes(&(val)->merge_tokens);
  815. ASN1Free_SetOfTokenIDs(&(val)->purge_token_ids);
  816. }
  817. }
  818. static int ASN1CALL ASN1Enc_PurgeTokenIndicationPDU(ASN1encoding_t enc, PurgeTokenIndicationPDU *val)
  819. {
  820. if (!ASN1Enc_SetOfTokenIDs(enc, &(val)->purge_token_ids))
  821. return 0;
  822. return 1;
  823. }
  824. static int ASN1CALL ASN1Dec_PurgeTokenIndicationPDU(ASN1decoding_t dec, PurgeTokenIndicationPDU *val)
  825. {
  826. if (!ASN1Dec_SetOfTokenIDs(dec, &(val)->purge_token_ids))
  827. return 0;
  828. return 1;
  829. }
  830. static void ASN1CALL ASN1Free_PurgeTokenIndicationPDU(PurgeTokenIndicationPDU *val)
  831. {
  832. if (val) {
  833. ASN1Free_SetOfTokenIDs(&(val)->purge_token_ids);
  834. }
  835. }
  836. static int ASN1CALL ASN1Enc_DisconnectProviderUltimatumPDU(ASN1encoding_t enc, DisconnectProviderUltimatumPDU *val)
  837. {
  838. if (!ASN1PEREncBitVal(enc, 3, (val)->reason))
  839. return 0;
  840. return 1;
  841. }
  842. static int ASN1CALL ASN1Dec_DisconnectProviderUltimatumPDU(ASN1decoding_t dec, DisconnectProviderUltimatumPDU *val)
  843. {
  844. if (!ASN1PERDecU32Val(dec, 3, (ASN1uint32_t *) &(val)->reason))
  845. return 0;
  846. return 1;
  847. }
  848. static int ASN1CALL ASN1Enc_RejectUltimatumPDU(ASN1encoding_t enc, RejectUltimatumPDU *val)
  849. {
  850. if (!ASN1PEREncBitVal(enc, 4, (val)->diagnostic))
  851. return 0;
  852. if (!ASN1PEREncOctetString_NoSize(enc, &(val)->initial_octets))
  853. return 0;
  854. return 1;
  855. }
  856. static int ASN1CALL ASN1Dec_RejectUltimatumPDU(ASN1decoding_t dec, RejectUltimatumPDU *val)
  857. {
  858. if (!ASN1PERDecU32Val(dec, 4, (ASN1uint32_t *) &(val)->diagnostic))
  859. return 0;
  860. if (!ASN1PERDecOctetString_NoSize(dec, &(val)->initial_octets))
  861. return 0;
  862. return 1;
  863. }
  864. static void ASN1CALL ASN1Free_RejectUltimatumPDU(RejectUltimatumPDU *val)
  865. {
  866. if (val) {
  867. ASN1octetstring_free(&(val)->initial_octets);
  868. }
  869. }
  870. static int ASN1CALL ASN1Enc_AttachUserConfirmPDU(ASN1encoding_t enc, AttachUserConfirmPDU *val)
  871. {
  872. if (!ASN1PEREncBits(enc, 1, (val)->o))
  873. return 0;
  874. if (!ASN1PEREncBitVal(enc, 4, (val)->result))
  875. return 0;
  876. if ((val)->o[0] & 0x80) {
  877. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  878. return 0;
  879. }
  880. return 1;
  881. }
  882. static int ASN1CALL ASN1Dec_AttachUserConfirmPDU(ASN1decoding_t dec, AttachUserConfirmPDU *val)
  883. {
  884. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  885. return 0;
  886. if (!ASN1PERDecU32Val(dec, 4, (ASN1uint32_t *) &(val)->result))
  887. return 0;
  888. if ((val)->o[0] & 0x80) {
  889. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  890. return 0;
  891. (val)->initiator += 1001;
  892. }
  893. return 1;
  894. }
  895. static int ASN1CALL ASN1Enc_DetachUserRequestPDU(ASN1encoding_t enc, DetachUserRequestPDU *val)
  896. {
  897. if (!ASN1PEREncBitVal(enc, 3, (val)->reason))
  898. return 0;
  899. if (!ASN1Enc_SetOfUserIDs(enc, &(val)->user_ids))
  900. return 0;
  901. return 1;
  902. }
  903. static int ASN1CALL ASN1Dec_DetachUserRequestPDU(ASN1decoding_t dec, DetachUserRequestPDU *val)
  904. {
  905. if (!ASN1PERDecU32Val(dec, 3, (ASN1uint32_t *) &(val)->reason))
  906. return 0;
  907. if (!ASN1Dec_SetOfUserIDs(dec, &(val)->user_ids))
  908. return 0;
  909. return 1;
  910. }
  911. static void ASN1CALL ASN1Free_DetachUserRequestPDU(DetachUserRequestPDU *val)
  912. {
  913. if (val) {
  914. ASN1Free_SetOfUserIDs(&(val)->user_ids);
  915. }
  916. }
  917. static int ASN1CALL ASN1Enc_DetachUserIndicationPDU(ASN1encoding_t enc, DetachUserIndicationPDU *val)
  918. {
  919. if (!ASN1PEREncBitVal(enc, 3, (val)->reason))
  920. return 0;
  921. if (!ASN1Enc_SetOfUserIDs(enc, &(val)->user_ids))
  922. return 0;
  923. return 1;
  924. }
  925. static int ASN1CALL ASN1Dec_DetachUserIndicationPDU(ASN1decoding_t dec, DetachUserIndicationPDU *val)
  926. {
  927. if (!ASN1PERDecU32Val(dec, 3, (ASN1uint32_t *) &(val)->reason))
  928. return 0;
  929. if (!ASN1Dec_SetOfUserIDs(dec, &(val)->user_ids))
  930. return 0;
  931. return 1;
  932. }
  933. static void ASN1CALL ASN1Free_DetachUserIndicationPDU(DetachUserIndicationPDU *val)
  934. {
  935. if (val) {
  936. ASN1Free_SetOfUserIDs(&(val)->user_ids);
  937. }
  938. }
  939. static int ASN1CALL ASN1Enc_ChannelJoinRequestPDU(ASN1encoding_t enc, ChannelJoinRequestPDU *val)
  940. {
  941. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  942. return 0;
  943. if (!ASN1PEREncUnsignedShort(enc, (val)->channel_id))
  944. return 0;
  945. return 1;
  946. }
  947. static int ASN1CALL ASN1Dec_ChannelJoinRequestPDU(ASN1decoding_t dec, ChannelJoinRequestPDU *val)
  948. {
  949. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  950. return 0;
  951. (val)->initiator += 1001;
  952. if (!ASN1PERDecUnsignedShort(dec, &(val)->channel_id))
  953. return 0;
  954. return 1;
  955. }
  956. static int ASN1CALL ASN1Enc_ChannelJoinConfirmPDU(ASN1encoding_t enc, ChannelJoinConfirmPDU *val)
  957. {
  958. if (!ASN1PEREncBits(enc, 1, (val)->o))
  959. return 0;
  960. if (!ASN1PEREncBitVal(enc, 4, (val)->result))
  961. return 0;
  962. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  963. return 0;
  964. if (!ASN1PEREncUnsignedShort(enc, (val)->requested))
  965. return 0;
  966. if ((val)->o[0] & 0x80) {
  967. if (!ASN1PEREncUnsignedShort(enc, (val)->join_channel_id))
  968. return 0;
  969. }
  970. return 1;
  971. }
  972. static int ASN1CALL ASN1Dec_ChannelJoinConfirmPDU(ASN1decoding_t dec, ChannelJoinConfirmPDU *val)
  973. {
  974. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  975. return 0;
  976. if (!ASN1PERDecU32Val(dec, 4, (ASN1uint32_t *) &(val)->result))
  977. return 0;
  978. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  979. return 0;
  980. (val)->initiator += 1001;
  981. if (!ASN1PERDecUnsignedShort(dec, &(val)->requested))
  982. return 0;
  983. if ((val)->o[0] & 0x80) {
  984. if (!ASN1PERDecUnsignedShort(dec, &(val)->join_channel_id))
  985. return 0;
  986. }
  987. return 1;
  988. }
  989. static int ASN1CALL ASN1Enc_ChannelLeaveRequestPDU(ASN1encoding_t enc, ChannelLeaveRequestPDU *val)
  990. {
  991. if (!ASN1Enc_SetOfChannelIDs(enc, &(val)->channel_ids))
  992. return 0;
  993. return 1;
  994. }
  995. static int ASN1CALL ASN1Dec_ChannelLeaveRequestPDU(ASN1decoding_t dec, ChannelLeaveRequestPDU *val)
  996. {
  997. if (!ASN1Dec_SetOfChannelIDs(dec, &(val)->channel_ids))
  998. return 0;
  999. return 1;
  1000. }
  1001. static void ASN1CALL ASN1Free_ChannelLeaveRequestPDU(ChannelLeaveRequestPDU *val)
  1002. {
  1003. if (val) {
  1004. ASN1Free_SetOfChannelIDs(&(val)->channel_ids);
  1005. }
  1006. }
  1007. static int ASN1CALL ASN1Enc_ChannelConveneRequestPDU(ASN1encoding_t enc, ChannelConveneRequestPDU *val)
  1008. {
  1009. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1010. return 0;
  1011. return 1;
  1012. }
  1013. static int ASN1CALL ASN1Dec_ChannelConveneRequestPDU(ASN1decoding_t dec, ChannelConveneRequestPDU *val)
  1014. {
  1015. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1016. return 0;
  1017. (val)->initiator += 1001;
  1018. return 1;
  1019. }
  1020. static int ASN1CALL ASN1Enc_ChannelConveneConfirmPDU(ASN1encoding_t enc, ChannelConveneConfirmPDU *val)
  1021. {
  1022. if (!ASN1PEREncBits(enc, 1, (val)->o))
  1023. return 0;
  1024. if (!ASN1PEREncBitVal(enc, 4, (val)->result))
  1025. return 0;
  1026. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1027. return 0;
  1028. if ((val)->o[0] & 0x80) {
  1029. if (!ASN1PEREncUnsignedShort(enc, (val)->convene_channel_id - 1001))
  1030. return 0;
  1031. }
  1032. return 1;
  1033. }
  1034. static int ASN1CALL ASN1Dec_ChannelConveneConfirmPDU(ASN1decoding_t dec, ChannelConveneConfirmPDU *val)
  1035. {
  1036. if (!ASN1PERDecExtension(dec, 1, (val)->o))
  1037. return 0;
  1038. if (!ASN1PERDecU32Val(dec, 4, (ASN1uint32_t *) &(val)->result))
  1039. return 0;
  1040. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1041. return 0;
  1042. (val)->initiator += 1001;
  1043. if ((val)->o[0] & 0x80) {
  1044. if (!ASN1PERDecUnsignedShort(dec, &(val)->convene_channel_id))
  1045. return 0;
  1046. (val)->convene_channel_id += 1001;
  1047. }
  1048. return 1;
  1049. }
  1050. static int ASN1CALL ASN1Enc_ChannelDisbandRequestPDU(ASN1encoding_t enc, ChannelDisbandRequestPDU *val)
  1051. {
  1052. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1053. return 0;
  1054. if (!ASN1PEREncUnsignedShort(enc, (val)->channel_id - 1001))
  1055. return 0;
  1056. return 1;
  1057. }
  1058. static int ASN1CALL ASN1Dec_ChannelDisbandRequestPDU(ASN1decoding_t dec, ChannelDisbandRequestPDU *val)
  1059. {
  1060. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1061. return 0;
  1062. (val)->initiator += 1001;
  1063. if (!ASN1PERDecUnsignedShort(dec, &(val)->channel_id))
  1064. return 0;
  1065. (val)->channel_id += 1001;
  1066. return 1;
  1067. }
  1068. static int ASN1CALL ASN1Enc_ChannelDisbandIndicationPDU(ASN1encoding_t enc, ChannelDisbandIndicationPDU *val)
  1069. {
  1070. if (!ASN1PEREncUnsignedShort(enc, (val)->channel_id - 1001))
  1071. return 0;
  1072. return 1;
  1073. }
  1074. static int ASN1CALL ASN1Dec_ChannelDisbandIndicationPDU(ASN1decoding_t dec, ChannelDisbandIndicationPDU *val)
  1075. {
  1076. if (!ASN1PERDecUnsignedShort(dec, &(val)->channel_id))
  1077. return 0;
  1078. (val)->channel_id += 1001;
  1079. return 1;
  1080. }
  1081. static int ASN1CALL ASN1Enc_ChannelAdmitRequestPDU(ASN1encoding_t enc, ChannelAdmitRequestPDU *val)
  1082. {
  1083. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1084. return 0;
  1085. if (!ASN1PEREncUnsignedShort(enc, (val)->channel_id - 1001))
  1086. return 0;
  1087. if (!ASN1Enc_SetOfUserIDs(enc, &(val)->user_ids))
  1088. return 0;
  1089. return 1;
  1090. }
  1091. static int ASN1CALL ASN1Dec_ChannelAdmitRequestPDU(ASN1decoding_t dec, ChannelAdmitRequestPDU *val)
  1092. {
  1093. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1094. return 0;
  1095. (val)->initiator += 1001;
  1096. if (!ASN1PERDecUnsignedShort(dec, &(val)->channel_id))
  1097. return 0;
  1098. (val)->channel_id += 1001;
  1099. if (!ASN1Dec_SetOfUserIDs(dec, &(val)->user_ids))
  1100. return 0;
  1101. return 1;
  1102. }
  1103. static void ASN1CALL ASN1Free_ChannelAdmitRequestPDU(ChannelAdmitRequestPDU *val)
  1104. {
  1105. if (val) {
  1106. ASN1Free_SetOfUserIDs(&(val)->user_ids);
  1107. }
  1108. }
  1109. static int ASN1CALL ASN1Enc_ChannelAdmitIndicationPDU(ASN1encoding_t enc, ChannelAdmitIndicationPDU *val)
  1110. {
  1111. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1112. return 0;
  1113. if (!ASN1PEREncUnsignedShort(enc, (val)->channel_id - 1001))
  1114. return 0;
  1115. if (!ASN1Enc_SetOfUserIDs(enc, &(val)->user_ids))
  1116. return 0;
  1117. return 1;
  1118. }
  1119. static int ASN1CALL ASN1Dec_ChannelAdmitIndicationPDU(ASN1decoding_t dec, ChannelAdmitIndicationPDU *val)
  1120. {
  1121. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1122. return 0;
  1123. (val)->initiator += 1001;
  1124. if (!ASN1PERDecUnsignedShort(dec, &(val)->channel_id))
  1125. return 0;
  1126. (val)->channel_id += 1001;
  1127. if (!ASN1Dec_SetOfUserIDs(dec, &(val)->user_ids))
  1128. return 0;
  1129. return 1;
  1130. }
  1131. static void ASN1CALL ASN1Free_ChannelAdmitIndicationPDU(ChannelAdmitIndicationPDU *val)
  1132. {
  1133. if (val) {
  1134. ASN1Free_SetOfUserIDs(&(val)->user_ids);
  1135. }
  1136. }
  1137. static int ASN1CALL ASN1Enc_ChannelExpelRequestPDU(ASN1encoding_t enc, ChannelExpelRequestPDU *val)
  1138. {
  1139. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1140. return 0;
  1141. if (!ASN1PEREncUnsignedShort(enc, (val)->channel_id - 1001))
  1142. return 0;
  1143. if (!ASN1Enc_SetOfUserIDs(enc, &(val)->user_ids))
  1144. return 0;
  1145. return 1;
  1146. }
  1147. static int ASN1CALL ASN1Dec_ChannelExpelRequestPDU(ASN1decoding_t dec, ChannelExpelRequestPDU *val)
  1148. {
  1149. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1150. return 0;
  1151. (val)->initiator += 1001;
  1152. if (!ASN1PERDecUnsignedShort(dec, &(val)->channel_id))
  1153. return 0;
  1154. (val)->channel_id += 1001;
  1155. if (!ASN1Dec_SetOfUserIDs(dec, &(val)->user_ids))
  1156. return 0;
  1157. return 1;
  1158. }
  1159. static void ASN1CALL ASN1Free_ChannelExpelRequestPDU(ChannelExpelRequestPDU *val)
  1160. {
  1161. if (val) {
  1162. ASN1Free_SetOfUserIDs(&(val)->user_ids);
  1163. }
  1164. }
  1165. static int ASN1CALL ASN1Enc_ChannelExpelIndicationPDU(ASN1encoding_t enc, ChannelExpelIndicationPDU *val)
  1166. {
  1167. if (!ASN1PEREncUnsignedShort(enc, (val)->channel_id - 1001))
  1168. return 0;
  1169. if (!ASN1Enc_SetOfUserIDs(enc, &(val)->user_ids))
  1170. return 0;
  1171. return 1;
  1172. }
  1173. static int ASN1CALL ASN1Dec_ChannelExpelIndicationPDU(ASN1decoding_t dec, ChannelExpelIndicationPDU *val)
  1174. {
  1175. if (!ASN1PERDecUnsignedShort(dec, &(val)->channel_id))
  1176. return 0;
  1177. (val)->channel_id += 1001;
  1178. if (!ASN1Dec_SetOfUserIDs(dec, &(val)->user_ids))
  1179. return 0;
  1180. return 1;
  1181. }
  1182. static void ASN1CALL ASN1Free_ChannelExpelIndicationPDU(ChannelExpelIndicationPDU *val)
  1183. {
  1184. if (val) {
  1185. ASN1Free_SetOfUserIDs(&(val)->user_ids);
  1186. }
  1187. }
  1188. static int ASN1CALL ASN1Enc_TokenGrabRequestPDU(ASN1encoding_t enc, TokenGrabRequestPDU *val)
  1189. {
  1190. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1191. return 0;
  1192. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  1193. return 0;
  1194. return 1;
  1195. }
  1196. static int ASN1CALL ASN1Dec_TokenGrabRequestPDU(ASN1decoding_t dec, TokenGrabRequestPDU *val)
  1197. {
  1198. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1199. return 0;
  1200. (val)->initiator += 1001;
  1201. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  1202. return 0;
  1203. (val)->token_id += 1;
  1204. return 1;
  1205. }
  1206. static int ASN1CALL ASN1Enc_TokenGrabConfirmPDU(ASN1encoding_t enc, TokenGrabConfirmPDU *val)
  1207. {
  1208. if (!ASN1PEREncBitVal(enc, 4, (val)->result))
  1209. return 0;
  1210. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1211. return 0;
  1212. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  1213. return 0;
  1214. if (!ASN1PEREncBitVal(enc, 3, (val)->token_status))
  1215. return 0;
  1216. return 1;
  1217. }
  1218. static int ASN1CALL ASN1Dec_TokenGrabConfirmPDU(ASN1decoding_t dec, TokenGrabConfirmPDU *val)
  1219. {
  1220. if (!ASN1PERDecU32Val(dec, 4, (ASN1uint32_t *) &(val)->result))
  1221. return 0;
  1222. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1223. return 0;
  1224. (val)->initiator += 1001;
  1225. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  1226. return 0;
  1227. (val)->token_id += 1;
  1228. if (!ASN1PERDecU32Val(dec, 3, (ASN1uint32_t *) &(val)->token_status))
  1229. return 0;
  1230. return 1;
  1231. }
  1232. static int ASN1CALL ASN1Enc_TokenInhibitRequestPDU(ASN1encoding_t enc, TokenInhibitRequestPDU *val)
  1233. {
  1234. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1235. return 0;
  1236. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  1237. return 0;
  1238. return 1;
  1239. }
  1240. static int ASN1CALL ASN1Dec_TokenInhibitRequestPDU(ASN1decoding_t dec, TokenInhibitRequestPDU *val)
  1241. {
  1242. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1243. return 0;
  1244. (val)->initiator += 1001;
  1245. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  1246. return 0;
  1247. (val)->token_id += 1;
  1248. return 1;
  1249. }
  1250. static int ASN1CALL ASN1Enc_TokenInhibitConfirmPDU(ASN1encoding_t enc, TokenInhibitConfirmPDU *val)
  1251. {
  1252. if (!ASN1PEREncBitVal(enc, 4, (val)->result))
  1253. return 0;
  1254. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1255. return 0;
  1256. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  1257. return 0;
  1258. if (!ASN1PEREncBitVal(enc, 3, (val)->token_status))
  1259. return 0;
  1260. return 1;
  1261. }
  1262. static int ASN1CALL ASN1Dec_TokenInhibitConfirmPDU(ASN1decoding_t dec, TokenInhibitConfirmPDU *val)
  1263. {
  1264. if (!ASN1PERDecU32Val(dec, 4, (ASN1uint32_t *) &(val)->result))
  1265. return 0;
  1266. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1267. return 0;
  1268. (val)->initiator += 1001;
  1269. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  1270. return 0;
  1271. (val)->token_id += 1;
  1272. if (!ASN1PERDecU32Val(dec, 3, (ASN1uint32_t *) &(val)->token_status))
  1273. return 0;
  1274. return 1;
  1275. }
  1276. static int ASN1CALL ASN1Enc_TokenGiveRequestPDU(ASN1encoding_t enc, TokenGiveRequestPDU *val)
  1277. {
  1278. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1279. return 0;
  1280. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  1281. return 0;
  1282. if (!ASN1PEREncUnsignedShort(enc, (val)->recipient - 1001))
  1283. return 0;
  1284. return 1;
  1285. }
  1286. static int ASN1CALL ASN1Dec_TokenGiveRequestPDU(ASN1decoding_t dec, TokenGiveRequestPDU *val)
  1287. {
  1288. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1289. return 0;
  1290. (val)->initiator += 1001;
  1291. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  1292. return 0;
  1293. (val)->token_id += 1;
  1294. if (!ASN1PERDecUnsignedShort(dec, &(val)->recipient))
  1295. return 0;
  1296. (val)->recipient += 1001;
  1297. return 1;
  1298. }
  1299. static int ASN1CALL ASN1Enc_TokenGiveIndicationPDU(ASN1encoding_t enc, TokenGiveIndicationPDU *val)
  1300. {
  1301. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1302. return 0;
  1303. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  1304. return 0;
  1305. if (!ASN1PEREncUnsignedShort(enc, (val)->recipient - 1001))
  1306. return 0;
  1307. return 1;
  1308. }
  1309. static int ASN1CALL ASN1Dec_TokenGiveIndicationPDU(ASN1decoding_t dec, TokenGiveIndicationPDU *val)
  1310. {
  1311. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1312. return 0;
  1313. (val)->initiator += 1001;
  1314. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  1315. return 0;
  1316. (val)->token_id += 1;
  1317. if (!ASN1PERDecUnsignedShort(dec, &(val)->recipient))
  1318. return 0;
  1319. (val)->recipient += 1001;
  1320. return 1;
  1321. }
  1322. static int ASN1CALL ASN1Enc_TokenGiveResponsePDU(ASN1encoding_t enc, TokenGiveResponsePDU *val)
  1323. {
  1324. if (!ASN1PEREncBitVal(enc, 4, (val)->result))
  1325. return 0;
  1326. if (!ASN1PEREncUnsignedShort(enc, (val)->recipient - 1001))
  1327. return 0;
  1328. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  1329. return 0;
  1330. return 1;
  1331. }
  1332. static int ASN1CALL ASN1Dec_TokenGiveResponsePDU(ASN1decoding_t dec, TokenGiveResponsePDU *val)
  1333. {
  1334. if (!ASN1PERDecU32Val(dec, 4, (ASN1uint32_t *) &(val)->result))
  1335. return 0;
  1336. if (!ASN1PERDecUnsignedShort(dec, &(val)->recipient))
  1337. return 0;
  1338. (val)->recipient += 1001;
  1339. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  1340. return 0;
  1341. (val)->token_id += 1;
  1342. return 1;
  1343. }
  1344. static int ASN1CALL ASN1Enc_TokenGiveConfirmPDU(ASN1encoding_t enc, TokenGiveConfirmPDU *val)
  1345. {
  1346. if (!ASN1PEREncBitVal(enc, 4, (val)->result))
  1347. return 0;
  1348. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1349. return 0;
  1350. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  1351. return 0;
  1352. if (!ASN1PEREncBitVal(enc, 3, (val)->token_status))
  1353. return 0;
  1354. return 1;
  1355. }
  1356. static int ASN1CALL ASN1Dec_TokenGiveConfirmPDU(ASN1decoding_t dec, TokenGiveConfirmPDU *val)
  1357. {
  1358. if (!ASN1PERDecU32Val(dec, 4, (ASN1uint32_t *) &(val)->result))
  1359. return 0;
  1360. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1361. return 0;
  1362. (val)->initiator += 1001;
  1363. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  1364. return 0;
  1365. (val)->token_id += 1;
  1366. if (!ASN1PERDecU32Val(dec, 3, (ASN1uint32_t *) &(val)->token_status))
  1367. return 0;
  1368. return 1;
  1369. }
  1370. static int ASN1CALL ASN1Enc_TokenPleaseRequestPDU(ASN1encoding_t enc, TokenPleaseRequestPDU *val)
  1371. {
  1372. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1373. return 0;
  1374. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  1375. return 0;
  1376. return 1;
  1377. }
  1378. static int ASN1CALL ASN1Dec_TokenPleaseRequestPDU(ASN1decoding_t dec, TokenPleaseRequestPDU *val)
  1379. {
  1380. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1381. return 0;
  1382. (val)->initiator += 1001;
  1383. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  1384. return 0;
  1385. (val)->token_id += 1;
  1386. return 1;
  1387. }
  1388. static int ASN1CALL ASN1Enc_TokenPleaseIndicationPDU(ASN1encoding_t enc, TokenPleaseIndicationPDU *val)
  1389. {
  1390. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1391. return 0;
  1392. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  1393. return 0;
  1394. return 1;
  1395. }
  1396. static int ASN1CALL ASN1Dec_TokenPleaseIndicationPDU(ASN1decoding_t dec, TokenPleaseIndicationPDU *val)
  1397. {
  1398. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1399. return 0;
  1400. (val)->initiator += 1001;
  1401. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  1402. return 0;
  1403. (val)->token_id += 1;
  1404. return 1;
  1405. }
  1406. static int ASN1CALL ASN1Enc_TokenReleaseRequestPDU(ASN1encoding_t enc, TokenReleaseRequestPDU *val)
  1407. {
  1408. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1409. return 0;
  1410. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  1411. return 0;
  1412. return 1;
  1413. }
  1414. static int ASN1CALL ASN1Dec_TokenReleaseRequestPDU(ASN1decoding_t dec, TokenReleaseRequestPDU *val)
  1415. {
  1416. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1417. return 0;
  1418. (val)->initiator += 1001;
  1419. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  1420. return 0;
  1421. (val)->token_id += 1;
  1422. return 1;
  1423. }
  1424. static int ASN1CALL ASN1Enc_TokenReleaseConfirmPDU(ASN1encoding_t enc, TokenReleaseConfirmPDU *val)
  1425. {
  1426. if (!ASN1PEREncBitVal(enc, 4, (val)->result))
  1427. return 0;
  1428. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1429. return 0;
  1430. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  1431. return 0;
  1432. if (!ASN1PEREncBitVal(enc, 3, (val)->token_status))
  1433. return 0;
  1434. return 1;
  1435. }
  1436. static int ASN1CALL ASN1Dec_TokenReleaseConfirmPDU(ASN1decoding_t dec, TokenReleaseConfirmPDU *val)
  1437. {
  1438. if (!ASN1PERDecU32Val(dec, 4, (ASN1uint32_t *) &(val)->result))
  1439. return 0;
  1440. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1441. return 0;
  1442. (val)->initiator += 1001;
  1443. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  1444. return 0;
  1445. (val)->token_id += 1;
  1446. if (!ASN1PERDecU32Val(dec, 3, (ASN1uint32_t *) &(val)->token_status))
  1447. return 0;
  1448. return 1;
  1449. }
  1450. static int ASN1CALL ASN1Enc_TokenTestRequestPDU(ASN1encoding_t enc, TokenTestRequestPDU *val)
  1451. {
  1452. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1453. return 0;
  1454. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  1455. return 0;
  1456. return 1;
  1457. }
  1458. static int ASN1CALL ASN1Dec_TokenTestRequestPDU(ASN1decoding_t dec, TokenTestRequestPDU *val)
  1459. {
  1460. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1461. return 0;
  1462. (val)->initiator += 1001;
  1463. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  1464. return 0;
  1465. (val)->token_id += 1;
  1466. return 1;
  1467. }
  1468. static int ASN1CALL ASN1Enc_TokenTestConfirmPDU(ASN1encoding_t enc, TokenTestConfirmPDU *val)
  1469. {
  1470. if (!ASN1PEREncUnsignedShort(enc, (val)->initiator - 1001))
  1471. return 0;
  1472. if (!ASN1PEREncUnsignedShort(enc, (val)->token_id - 1))
  1473. return 0;
  1474. if (!ASN1PEREncBitVal(enc, 3, (val)->token_status))
  1475. return 0;
  1476. return 1;
  1477. }
  1478. static int ASN1CALL ASN1Dec_TokenTestConfirmPDU(ASN1decoding_t dec, TokenTestConfirmPDU *val)
  1479. {
  1480. if (!ASN1PERDecUnsignedShort(dec, &(val)->initiator))
  1481. return 0;
  1482. (val)->initiator += 1001;
  1483. if (!ASN1PERDecUnsignedShort(dec, &(val)->token_id))
  1484. return 0;
  1485. (val)->token_id += 1;
  1486. if (!ASN1PERDecU32Val(dec, 3, (ASN1uint32_t *) &(val)->token_status))
  1487. return 0;
  1488. return 1;
  1489. }
  1490. static void ASN1CALL ASN1Free_ConnectMCSPDU(ConnectMCSPDU *val)
  1491. {
  1492. if (val) {
  1493. switch ((val)->choice) {
  1494. case 1:
  1495. ASN1Free_ConnectInitialPDU(&(val)->u.connect_initial);
  1496. break;
  1497. case 2:
  1498. ASN1Free_ConnectResponsePDU(&(val)->u.connect_response);
  1499. break;
  1500. }
  1501. }
  1502. }
  1503. static int ASN1CALL ASN1Enc_DomainMCSPDU(ASN1encoding_t enc, DomainMCSPDU *val)
  1504. {
  1505. if (!ASN1PEREncSimpleChoice(enc, (val)->choice, 6))
  1506. return 0;
  1507. switch ((val)->choice) {
  1508. case 1:
  1509. if (!ASN1Enc_PlumbDomainIndicationPDU(enc, &(val)->u.plumb_domain_indication))
  1510. return 0;
  1511. break;
  1512. case 2:
  1513. if (!ASN1Enc_ErectDomainRequestPDU(enc, &(val)->u.erect_domain_request))
  1514. return 0;
  1515. break;
  1516. case 3:
  1517. if (!ASN1Enc_MergeChannelsRequestPDU(enc, &(val)->u.merge_channels_request))
  1518. return 0;
  1519. break;
  1520. case 4:
  1521. if (!ASN1Enc_MergeChannelsConfirmPDU(enc, &(val)->u.merge_channels_confirm))
  1522. return 0;
  1523. break;
  1524. case 5:
  1525. if (!ASN1Enc_PurgeChannelIndicationPDU(enc, &(val)->u.purge_channel_indication))
  1526. return 0;
  1527. break;
  1528. case 6:
  1529. if (!ASN1Enc_MergeTokensRequestPDU(enc, &(val)->u.merge_tokens_request))
  1530. return 0;
  1531. break;
  1532. case 7:
  1533. if (!ASN1Enc_MergeTokensConfirmPDU(enc, &(val)->u.merge_tokens_confirm))
  1534. return 0;
  1535. break;
  1536. case 8:
  1537. if (!ASN1Enc_PurgeTokenIndicationPDU(enc, &(val)->u.purge_token_indication))
  1538. return 0;
  1539. break;
  1540. case 9:
  1541. if (!ASN1Enc_DisconnectProviderUltimatumPDU(enc, &(val)->u.disconnect_provider_ultimatum))
  1542. return 0;
  1543. break;
  1544. case 10:
  1545. if (!ASN1Enc_RejectUltimatumPDU(enc, &(val)->u.reject_user_ultimatum))
  1546. return 0;
  1547. break;
  1548. case 11:
  1549. break;
  1550. case 12:
  1551. if (!ASN1Enc_AttachUserConfirmPDU(enc, &(val)->u.attach_user_confirm))
  1552. return 0;
  1553. break;
  1554. case 13:
  1555. if (!ASN1Enc_DetachUserRequestPDU(enc, &(val)->u.detach_user_request))
  1556. return 0;
  1557. break;
  1558. case 14:
  1559. if (!ASN1Enc_DetachUserIndicationPDU(enc, &(val)->u.detach_user_indication))
  1560. return 0;
  1561. break;
  1562. case 15:
  1563. if (!ASN1Enc_ChannelJoinRequestPDU(enc, &(val)->u.channel_join_request))
  1564. return 0;
  1565. break;
  1566. case 16:
  1567. if (!ASN1Enc_ChannelJoinConfirmPDU(enc, &(val)->u.channel_join_confirm))
  1568. return 0;
  1569. break;
  1570. case 17:
  1571. if (!ASN1Enc_ChannelLeaveRequestPDU(enc, &(val)->u.channel_leave_request))
  1572. return 0;
  1573. break;
  1574. case 18:
  1575. if (!ASN1Enc_ChannelConveneRequestPDU(enc, &(val)->u.channel_convene_request))
  1576. return 0;
  1577. break;
  1578. case 19:
  1579. if (!ASN1Enc_ChannelConveneConfirmPDU(enc, &(val)->u.channel_convene_confirm))
  1580. return 0;
  1581. break;
  1582. case 20:
  1583. if (!ASN1Enc_ChannelDisbandRequestPDU(enc, &(val)->u.channel_disband_request))
  1584. return 0;
  1585. break;
  1586. case 21:
  1587. if (!ASN1Enc_ChannelDisbandIndicationPDU(enc, &(val)->u.channel_disband_indication))
  1588. return 0;
  1589. break;
  1590. case 22:
  1591. if (!ASN1Enc_ChannelAdmitRequestPDU(enc, &(val)->u.channel_admit_request))
  1592. return 0;
  1593. break;
  1594. case 23:
  1595. if (!ASN1Enc_ChannelAdmitIndicationPDU(enc, &(val)->u.channel_admit_indication))
  1596. return 0;
  1597. break;
  1598. case 24:
  1599. if (!ASN1Enc_ChannelExpelRequestPDU(enc, &(val)->u.channel_expel_request))
  1600. return 0;
  1601. break;
  1602. case 25:
  1603. if (!ASN1Enc_ChannelExpelIndicationPDU(enc, &(val)->u.channel_expel_indication))
  1604. return 0;
  1605. break;
  1606. case 26:
  1607. case 27:
  1608. case 28:
  1609. case 29:
  1610. return 0;
  1611. case 30:
  1612. if (!ASN1Enc_TokenGrabRequestPDU(enc, &(val)->u.token_grab_request))
  1613. return 0;
  1614. break;
  1615. case 31:
  1616. if (!ASN1Enc_TokenGrabConfirmPDU(enc, &(val)->u.token_grab_confirm))
  1617. return 0;
  1618. break;
  1619. case 32:
  1620. if (!ASN1Enc_TokenInhibitRequestPDU(enc, &(val)->u.token_inhibit_request))
  1621. return 0;
  1622. break;
  1623. case 33:
  1624. if (!ASN1Enc_TokenInhibitConfirmPDU(enc, &(val)->u.token_inhibit_confirm))
  1625. return 0;
  1626. break;
  1627. case 34:
  1628. if (!ASN1Enc_TokenGiveRequestPDU(enc, &(val)->u.token_give_request))
  1629. return 0;
  1630. break;
  1631. case 35:
  1632. if (!ASN1Enc_TokenGiveIndicationPDU(enc, &(val)->u.token_give_indication))
  1633. return 0;
  1634. break;
  1635. case 36:
  1636. if (!ASN1Enc_TokenGiveResponsePDU(enc, &(val)->u.token_give_response))
  1637. return 0;
  1638. break;
  1639. case 37:
  1640. if (!ASN1Enc_TokenGiveConfirmPDU(enc, &(val)->u.token_give_confirm))
  1641. return 0;
  1642. break;
  1643. case 38:
  1644. if (!ASN1Enc_TokenPleaseRequestPDU(enc, &(val)->u.token_please_request))
  1645. return 0;
  1646. break;
  1647. case 39:
  1648. if (!ASN1Enc_TokenPleaseIndicationPDU(enc, &(val)->u.token_please_indication))
  1649. return 0;
  1650. break;
  1651. case 40:
  1652. if (!ASN1Enc_TokenReleaseRequestPDU(enc, &(val)->u.token_release_request))
  1653. return 0;
  1654. break;
  1655. case 41:
  1656. if (!ASN1Enc_TokenReleaseConfirmPDU(enc, &(val)->u.token_release_confirm))
  1657. return 0;
  1658. break;
  1659. case 42:
  1660. if (!ASN1Enc_TokenTestRequestPDU(enc, &(val)->u.token_test_request))
  1661. return 0;
  1662. break;
  1663. case 43:
  1664. if (!ASN1Enc_TokenTestConfirmPDU(enc, &(val)->u.token_test_confirm))
  1665. return 0;
  1666. break;
  1667. default:
  1668. /* impossible */
  1669. ASN1EncSetError(enc, ASN1_ERR_CHOICE);
  1670. return 0;
  1671. }
  1672. return 1;
  1673. }
  1674. static int ASN1CALL ASN1Dec_DomainMCSPDU(ASN1decoding_t dec, DomainMCSPDU *val)
  1675. {
  1676. if (!ASN1PERDecSimpleChoice(dec, &(val)->choice, 6))
  1677. return 0;
  1678. switch ((val)->choice) {
  1679. case 1:
  1680. if (!ASN1Dec_PlumbDomainIndicationPDU(dec, &(val)->u.plumb_domain_indication))
  1681. return 0;
  1682. break;
  1683. case 2:
  1684. if (!ASN1Dec_ErectDomainRequestPDU(dec, &(val)->u.erect_domain_request))
  1685. return 0;
  1686. break;
  1687. case 3:
  1688. if (!ASN1Dec_MergeChannelsRequestPDU(dec, &(val)->u.merge_channels_request))
  1689. return 0;
  1690. break;
  1691. case 4:
  1692. if (!ASN1Dec_MergeChannelsConfirmPDU(dec, &(val)->u.merge_channels_confirm))
  1693. return 0;
  1694. break;
  1695. case 5:
  1696. if (!ASN1Dec_PurgeChannelIndicationPDU(dec, &(val)->u.purge_channel_indication))
  1697. return 0;
  1698. break;
  1699. case 6:
  1700. if (!ASN1Dec_MergeTokensRequestPDU(dec, &(val)->u.merge_tokens_request))
  1701. return 0;
  1702. break;
  1703. case 7:
  1704. if (!ASN1Dec_MergeTokensConfirmPDU(dec, &(val)->u.merge_tokens_confirm))
  1705. return 0;
  1706. break;
  1707. case 8:
  1708. if (!ASN1Dec_PurgeTokenIndicationPDU(dec, &(val)->u.purge_token_indication))
  1709. return 0;
  1710. break;
  1711. case 9:
  1712. if (!ASN1Dec_DisconnectProviderUltimatumPDU(dec, &(val)->u.disconnect_provider_ultimatum))
  1713. return 0;
  1714. break;
  1715. case 10:
  1716. if (!ASN1Dec_RejectUltimatumPDU(dec, &(val)->u.reject_user_ultimatum))
  1717. return 0;
  1718. break;
  1719. case 11:
  1720. break;
  1721. case 12:
  1722. if (!ASN1Dec_AttachUserConfirmPDU(dec, &(val)->u.attach_user_confirm))
  1723. return 0;
  1724. break;
  1725. case 13:
  1726. if (!ASN1Dec_DetachUserRequestPDU(dec, &(val)->u.detach_user_request))
  1727. return 0;
  1728. break;
  1729. case 14:
  1730. if (!ASN1Dec_DetachUserIndicationPDU(dec, &(val)->u.detach_user_indication))
  1731. return 0;
  1732. break;
  1733. case 15:
  1734. if (!ASN1Dec_ChannelJoinRequestPDU(dec, &(val)->u.channel_join_request))
  1735. return 0;
  1736. break;
  1737. case 16:
  1738. if (!ASN1Dec_ChannelJoinConfirmPDU(dec, &(val)->u.channel_join_confirm))
  1739. return 0;
  1740. break;
  1741. case 17:
  1742. if (!ASN1Dec_ChannelLeaveRequestPDU(dec, &(val)->u.channel_leave_request))
  1743. return 0;
  1744. break;
  1745. case 18:
  1746. if (!ASN1Dec_ChannelConveneRequestPDU(dec, &(val)->u.channel_convene_request))
  1747. return 0;
  1748. break;
  1749. case 19:
  1750. if (!ASN1Dec_ChannelConveneConfirmPDU(dec, &(val)->u.channel_convene_confirm))
  1751. return 0;
  1752. break;
  1753. case 20:
  1754. if (!ASN1Dec_ChannelDisbandRequestPDU(dec, &(val)->u.channel_disband_request))
  1755. return 0;
  1756. break;
  1757. case 21:
  1758. if (!ASN1Dec_ChannelDisbandIndicationPDU(dec, &(val)->u.channel_disband_indication))
  1759. return 0;
  1760. break;
  1761. case 22:
  1762. if (!ASN1Dec_ChannelAdmitRequestPDU(dec, &(val)->u.channel_admit_request))
  1763. return 0;
  1764. break;
  1765. case 23:
  1766. if (!ASN1Dec_ChannelAdmitIndicationPDU(dec, &(val)->u.channel_admit_indication))
  1767. return 0;
  1768. break;
  1769. case 24:
  1770. if (!ASN1Dec_ChannelExpelRequestPDU(dec, &(val)->u.channel_expel_request))
  1771. return 0;
  1772. break;
  1773. case 25:
  1774. if (!ASN1Dec_ChannelExpelIndicationPDU(dec, &(val)->u.channel_expel_indication))
  1775. return 0;
  1776. break;
  1777. case 26:
  1778. case 27:
  1779. case 28:
  1780. case 29:
  1781. return 0;
  1782. case 30:
  1783. if (!ASN1Dec_TokenGrabRequestPDU(dec, &(val)->u.token_grab_request))
  1784. return 0;
  1785. break;
  1786. case 31:
  1787. if (!ASN1Dec_TokenGrabConfirmPDU(dec, &(val)->u.token_grab_confirm))
  1788. return 0;
  1789. break;
  1790. case 32:
  1791. if (!ASN1Dec_TokenInhibitRequestPDU(dec, &(val)->u.token_inhibit_request))
  1792. return 0;
  1793. break;
  1794. case 33:
  1795. if (!ASN1Dec_TokenInhibitConfirmPDU(dec, &(val)->u.token_inhibit_confirm))
  1796. return 0;
  1797. break;
  1798. case 34:
  1799. if (!ASN1Dec_TokenGiveRequestPDU(dec, &(val)->u.token_give_request))
  1800. return 0;
  1801. break;
  1802. case 35:
  1803. if (!ASN1Dec_TokenGiveIndicationPDU(dec, &(val)->u.token_give_indication))
  1804. return 0;
  1805. break;
  1806. case 36:
  1807. if (!ASN1Dec_TokenGiveResponsePDU(dec, &(val)->u.token_give_response))
  1808. return 0;
  1809. break;
  1810. case 37:
  1811. if (!ASN1Dec_TokenGiveConfirmPDU(dec, &(val)->u.token_give_confirm))
  1812. return 0;
  1813. break;
  1814. case 38:
  1815. if (!ASN1Dec_TokenPleaseRequestPDU(dec, &(val)->u.token_please_request))
  1816. return 0;
  1817. break;
  1818. case 39:
  1819. if (!ASN1Dec_TokenPleaseIndicationPDU(dec, &(val)->u.token_please_indication))
  1820. return 0;
  1821. break;
  1822. case 40:
  1823. if (!ASN1Dec_TokenReleaseRequestPDU(dec, &(val)->u.token_release_request))
  1824. return 0;
  1825. break;
  1826. case 41:
  1827. if (!ASN1Dec_TokenReleaseConfirmPDU(dec, &(val)->u.token_release_confirm))
  1828. return 0;
  1829. break;
  1830. case 42:
  1831. if (!ASN1Dec_TokenTestRequestPDU(dec, &(val)->u.token_test_request))
  1832. return 0;
  1833. break;
  1834. case 43:
  1835. if (!ASN1Dec_TokenTestConfirmPDU(dec, &(val)->u.token_test_confirm))
  1836. return 0;
  1837. break;
  1838. default:
  1839. /* impossible */
  1840. ASN1DecSetError(dec, ASN1_ERR_CHOICE);
  1841. return 0;
  1842. }
  1843. return 1;
  1844. }
  1845. static void ASN1CALL ASN1Free_DomainMCSPDU(DomainMCSPDU *val)
  1846. {
  1847. if (val) {
  1848. switch ((val)->choice) {
  1849. case 3:
  1850. ASN1Free_MergeChannelsRequestPDU(&(val)->u.merge_channels_request);
  1851. break;
  1852. case 4:
  1853. ASN1Free_MergeChannelsConfirmPDU(&(val)->u.merge_channels_confirm);
  1854. break;
  1855. case 5:
  1856. ASN1Free_PurgeChannelIndicationPDU(&(val)->u.purge_channel_indication);
  1857. break;
  1858. case 6:
  1859. ASN1Free_MergeTokensRequestPDU(&(val)->u.merge_tokens_request);
  1860. break;
  1861. case 7:
  1862. ASN1Free_MergeTokensConfirmPDU(&(val)->u.merge_tokens_confirm);
  1863. break;
  1864. case 8:
  1865. ASN1Free_PurgeTokenIndicationPDU(&(val)->u.purge_token_indication);
  1866. break;
  1867. case 10:
  1868. ASN1Free_RejectUltimatumPDU(&(val)->u.reject_user_ultimatum);
  1869. break;
  1870. case 13:
  1871. ASN1Free_DetachUserRequestPDU(&(val)->u.detach_user_request);
  1872. break;
  1873. case 14:
  1874. ASN1Free_DetachUserIndicationPDU(&(val)->u.detach_user_indication);
  1875. break;
  1876. case 17:
  1877. ASN1Free_ChannelLeaveRequestPDU(&(val)->u.channel_leave_request);
  1878. break;
  1879. case 22:
  1880. ASN1Free_ChannelAdmitRequestPDU(&(val)->u.channel_admit_request);
  1881. break;
  1882. case 23:
  1883. ASN1Free_ChannelAdmitIndicationPDU(&(val)->u.channel_admit_indication);
  1884. break;
  1885. case 24:
  1886. ASN1Free_ChannelExpelRequestPDU(&(val)->u.channel_expel_request);
  1887. break;
  1888. case 25:
  1889. ASN1Free_ChannelExpelIndicationPDU(&(val)->u.channel_expel_indication);
  1890. break;
  1891. case 26:
  1892. case 27:
  1893. case 28:
  1894. case 29:
  1895. break;
  1896. }
  1897. }
  1898. }