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.

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