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.

226 lines
5.1 KiB

  1. /*
  2. * ogcccode.h
  3. *
  4. * Copyright (c) 1994 by DataBeam Corporation, Lexington, KY
  5. *
  6. * Abstract:
  7. * This is the interface file for the CGCCCoder class. This
  8. * class is used to encode and decode GCC Protocol Data Units (PDU's)
  9. * to and from ASN.1 compliant byte streams using the ASN.1 toolkit.
  10. *
  11. * Caveats:
  12. * None.
  13. *
  14. * Author:
  15. * John B. O'Nan
  16. *
  17. */
  18. #ifndef _CGCCCODER_
  19. #define _CGCCCODER_
  20. #include "pktcoder.h"
  21. #include "pdutypes.h"
  22. #include "gccpdu.h"
  23. /*
  24. * Macros
  25. */
  26. #define MAXIMUM_PDU_SIZE 512
  27. #define DECODED_ROSTER_PDU_SIZE 1024
  28. #define USER_ID_INDICATION 0x61
  29. #define CONFERENCE_CREATE_REQUEST 0x62
  30. #define CONFERENCE_CREATE_RESPONSE 0x63
  31. #define CONFERENCE_QUERY_REQUEST 0x64
  32. #define CONFERENCE_QUERY_RESPONSE 0x65
  33. #define CONFERENCE_JOIN_REQUEST 0x66
  34. #define CONFERENCE_JOIN_RESPONSE 0x67
  35. #define CONFERENCE_INVITE_REQUEST 0x68
  36. #define CONFERENCE_INVITE_RESPONSE 0x69
  37. #define ROSTER_UPDATE_INDICATION 0x7e
  38. #define MULTIPLE_OCTET_ID 0x7f
  39. #define REGISTER_CHANNEL_REQUEST 0xa0
  40. #define ASSIGN_TOKEN_REQUEST 0xa1
  41. #define RETRIEVE_ENTRY_REQUEST 0xa3
  42. #define DELETE_ENTRY_REQUEST 0xa4
  43. #define REGISTRY_RESPONSE 0xa9
  44. /*
  45. * This is the class definition for class CGCCCoder
  46. */
  47. class CGCCCoder : public PacketCoder
  48. {
  49. public:
  50. CGCCCoder ();
  51. BOOL Init ( void );
  52. virtual ~CGCCCoder ();
  53. virtual BOOL Encode (LPVOID pdu_structure,
  54. int pdu_type,
  55. UINT rules_type,
  56. LPBYTE *encoding_buffer,
  57. UINT *encoding_buffer_length);
  58. virtual BOOL Decode (LPBYTE encoded_buffer,
  59. UINT encoded_buffer_length,
  60. int pdu_type,
  61. UINT rules_type,
  62. LPVOID *decoding_buffer,
  63. UINT *decoding_buffer_length);
  64. virtual void FreeEncoded (LPBYTE encoded_buffer);
  65. virtual void FreeDecoded (int pdu_type, LPVOID decoded_buffer);
  66. virtual BOOL IsMCSDataPacket ( LPBYTE, UINT )
  67. { return FALSE; };
  68. private:
  69. BOOL IsObjectIDCompliant (PKey t124_identifier);
  70. ASN1encoding_t m_pEncInfo; // ptr to encoder info
  71. ASN1decoding_t m_pDecInfo; // ptr to decoder info
  72. };
  73. typedef CGCCCoder * PCGCCCoder;
  74. /*
  75. * CGCCCoder ()
  76. *
  77. * Functional Description:
  78. * This is the constructor for the CGCCCoder class.
  79. *
  80. * Formal Parameters:
  81. * None.
  82. *
  83. * Return Value:
  84. * None.
  85. *
  86. * Side Effects:
  87. * None.
  88. *
  89. * Caveats:
  90. * None.
  91. */
  92. /*
  93. * ~CGCCCoder ()
  94. *
  95. * Functional Description:
  96. * This is a virtual destructor.
  97. *
  98. * Formal Parameters:
  99. * None.
  100. *
  101. * Return Value:
  102. * None.
  103. *
  104. * Side Effects:
  105. * None.
  106. *
  107. * Caveats:
  108. * None.
  109. */
  110. /*
  111. * void Encode ( LPVOID pdu_structure,
  112. * int pdu_type,
  113. * UINT rules_type,
  114. * LPBYTE *encoding_buffer,
  115. * UINT *encoding_buffer_length);
  116. *
  117. * Functional Description:
  118. * This function encodes Protocol data units (PDU's) into ASN.1 compliant
  119. * byte streams. The Encode happens into an encoder-allocated buffer.
  120. *
  121. * Formal Parameters:
  122. * pdu_structure (i) Pointer to structure holding PDU data.
  123. * pdu_type (i) Define indicating type of GCC PDU.
  124. * rules_type (i) Type (PER or BER) of encoding rules to use.
  125. * encoding_buffer (o) Indirect pointer to buffer to hold encoded data.
  126. * encoding_buffer_length(o) Pointer that receives the Length of buffer for encoded data.
  127. *
  128. * Return Value:
  129. * None.
  130. *
  131. * Side Effects:
  132. * None.
  133. *
  134. * Caveats:
  135. * None.
  136. */
  137. /*
  138. * void Decode ( LPBYTE encoded_buffer,
  139. * UINT encoded_buffer_length,
  140. * int pdu_type,
  141. * UINT rules_type,
  142. * LPVOID decoding_buffer,
  143. * UINT decoding_buffer_length,
  144. * PULong);
  145. *
  146. * Functional Description:
  147. * This function decodes ASN.1 compliant byte streams into the
  148. * appropriate GCC PDU structures.
  149. *
  150. * Formal Parameters:
  151. * encoded_buffer (i) Pointer to buffer holding data to decode.
  152. * encoded_buffer_length (i) Length of buffer holding data to decode.
  153. * pdu_type (i) Define indicating type of GCC PDU.
  154. * rules_type (i) Type (PER or BER) of encoding rules to use.
  155. * decoding_buffer (o) Pointer to buffer to hold the decoded data.
  156. * decoding_buffer_length(i) Length of buffer to hold decoded data.
  157. *
  158. * Return Value:
  159. * None.
  160. *
  161. * Side Effects:
  162. * None.
  163. *
  164. * Caveats:
  165. * None.
  166. */
  167. /*
  168. * void CopyDecodedData ( LPVOID pdu_source_structure,
  169. * LPVOID pdu_destination_structure,
  170. * UShort pdu_type)
  171. *
  172. * Functional Description:
  173. * This function makes a complete copy of a decoded PDU structure.
  174. *
  175. * Formal Parameters:
  176. * pdu_source_structure (i) Pointer to buffer holding decoded structure.
  177. * pdu_destination_structure (i) Pointer to copy buffer.
  178. * pdu_type (i) Define indicating type of GCC PDU.
  179. *
  180. * Return Value:
  181. * None.
  182. *
  183. * Side Effects:
  184. * None.
  185. *
  186. * Caveats:
  187. * None.
  188. */
  189. /*
  190. * BOOL IsMCSDataPacket ()
  191. *
  192. * Functional Description:
  193. * This function determines whether the encoded packet is an MCS Data packet
  194. * or not.
  195. *
  196. * Formal Parameters:
  197. * encoded_buffer (i) Pointer to buffer holding the encoded PDU.
  198. * rules_type (i) The used encoding rules.
  199. *
  200. * Return value:
  201. * Always returns FALSE.
  202. *
  203. * Side Effects:
  204. * None.
  205. *
  206. * Caveats:
  207. * None.
  208. */
  209. #endif