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.

304 lines
11 KiB

  1. /**********************************************************************
  2. * File: gcclog.h
  3. * Abstract: Function heders for protocol logging functions added
  4. * into GCCNC.DLL to read the contents of GCC PDU sent to and
  5. * received from
  6. * Created: 12/21/95, Venkatesh Gopalakrishnan
  7. * Copyright (c) 1995 Microsoft Corpration
  8. ******************************************************************** */
  9. /* Note: the contents of this file are only included IFF PDULOG
  10. * is a defined constant. PDULOG is defined in the DIAGNOSTIC
  11. * build configuration of GCCNC.DLL
  12. */
  13. #ifdef PDULOG
  14. #ifndef _PROTLOG_H
  15. #define _PROTLOG_H
  16. #include <windows.h>
  17. #include <time.h>
  18. #include <stdio.h>
  19. #define MAXIMUM_PRINT_LENGTH 256
  20. #define LOG_FILE_NAME "gcclog.txt"
  21. #define SENT 0
  22. #define RECEIVED 1
  23. #define FORWARDED 2
  24. /* mcs transport type definitions for gcc pdus */
  25. #define MCS_SEND_DATA_REQUEST_PDU 1
  26. #define MCS_SEND_DATA_INDICATION_PDU 2
  27. #define MCS_UNIFORM_SEND_DATA_REQUEST_PDU 3
  28. #define MCS_UNIFORM_SEND_DATA_INDICATION_PDU 4
  29. #define MCS_CONNECT_PROVIDER_REQUEST_PDU 5
  30. #define MCS_CONNECT_PROVIDER_RESPONSE_PDU 6
  31. #define MCS_CONNECT_PROVIDER_CONFIRM_PDU 7
  32. #define MCS_CONNECT_PROVIDER_INDICATION_PDU 8
  33. /* miscellaneous constants used in databeam code */
  34. #define MAX_CONFERENCE_NAME_LENGTH 128
  35. #define MAX_CONFERENCE_MODIFIER_LENGTH 128
  36. #define MAX_CONFERENCE_DESCRIPTOR_LENGTH 128
  37. #define MAX_NUMBER_OF_NETWORK_ADDRESSES 128
  38. #define MAX_PASSWORD_LENGTH 128
  39. #define MAX_ADDRESS_SIZE 128
  40. #define MAX_CALLER_IDENTIFIER_LENGTH 128
  41. #define MAX_TRANSPORT_ADDRESS_LENGTH 40
  42. #define MAX_NUMBER_OF_TRANSPORTS_LISTED 20
  43. #define MAX_OCTET_STRING_LENGTH 128
  44. #define MAX_HEX_STRING_LENGTH 128
  45. #define MAX_NUMBER_OF_USER_DATA_MEMBERS 65535
  46. #define MAX_NUMBER_OF_TRANSPORT_HANDLES 128
  47. #define MAX_NODE_NAME_LENGTH 128
  48. #define MAX_NUMBER_OF_PARTICIPANTS 128
  49. #define MAX_PARTICPANT_NAME_LENGTH 128
  50. #define MAX_ERROR_STRING_LENGTH 40
  51. #define MAX_REASON_STRING_LENGTH 40
  52. #define MAX_RESULT_STRING_LENGTH 40
  53. #define MAX_NUMBER_OF_CONF_IDS 15
  54. #define MAX_NUMBER_OF_NODE_IDS 10
  55. #define MAX_SUB_ADDRESS_STRING_LENGTH 128
  56. #define MAX_NUMBER_OF_ACTIVE_CONFERENCES 100
  57. #define MAX_NUMBER_OF_PENDING_CREATES 15
  58. #define GCCAPP_SAP_NOT_REGISTERED 0
  59. #define GCCAPP_NOT_ENROLLED 1
  60. #define GCCAPP_WAITING_ON_ATTACH_CONFIRM 2
  61. #define GCCAPP_ATTACHED 3
  62. #define GCCAPP_JOINED_CHANNEL_ID 4
  63. #define GCCAPP_ENROLLED_INACTIVELY 5
  64. #define GCCAPP_LISTED_IN_ROSTER_INACTIVE 6
  65. #define GCCAPP_WAITING_ON_JOIN_CONFIRM 7
  66. #define GCCAPP_JOINED_INITIAL_CHANNEL 8
  67. #define GCCAPP_JOINED_REQUIRED_CHANNELS 9
  68. #define GCCAPP_ASSIGNED_REQUIRED_TOKENS 10
  69. #define GCCAPP_ENROLLED_ACTIVELY 11
  70. #define GCCAPP_LISTED_IN_ROSTER_ACTIVE 12
  71. #define ENROLL_MODE_START_MULTICAST 0
  72. #define ENROLL_MODE_JOIN_MULTICAST 1
  73. #define JOIN_DO_NOT_MOVE 0
  74. #define JOIN_INTERMIDIATE_MOVE 1
  75. #define JOIN_TOP_MOVE 2
  76. #define JOIN_INTERMIDIATE_AND_TOP_MOVE 3
  77. /**
  78. ** Service functions for the PDU logging mechanism
  79. **/
  80. int InitializeGCCLog();
  81. /* Description:
  82. * Function that resets the gcc protocol log file and reads any
  83. * ini file parameters
  84. */
  85. char *pszTimeStamp();
  86. /* Desicription:
  87. * This function is an easy interfact to getting the time the
  88. * PDU was encoded or decoded from GCC to MCS or vice versa.
  89. */
  90. void pduLog(FILE *file, char * format_string,...);
  91. /* Description:
  92. * This function is used to place PDU information in a protocol
  93. * log file. There is currently no return value. This may change.
  94. */
  95. void pduFragmentation(FILE *logfile, unsigned int i);
  96. /* Description:
  97. * This function logs weather or not the PDU is complete
  98. * or fragmented.
  99. */
  100. void pduRawOutput(FILE *logfile, unsigned char * data, unsigned long length);
  101. /* Description:
  102. * This function logs a hex dump of the raw encoded GCC PDU that
  103. * is sent over the wire via MCS.
  104. */
  105. void gccLog(PPacket packet, PGCCPDU gcc_pdu, unsigned int direction, int mcs_pdu = 0);
  106. /* Description:
  107. * This function takes care of the log headers and footers to
  108. * attempt at compatibility with a certain third party gcc log
  109. * reader.
  110. */
  111. void gccConnectLog(PPacket packet, PConnectGCCPDU connect_pdu, unsigned int direction, int mcs_pdu = 0);
  112. void pduDirection(FILE *logfile,unsigned int direction);
  113. /* Description:
  114. * This function logs information whether the gcc pdu was sent
  115. * or received.
  116. */
  117. void mcsPduType(FILE *logfile, int mcs_pdu);
  118. /* Description:
  119. * This function prints out the type of MCS pdu that is being used to
  120. * transport the GCC PDU.
  121. */
  122. void pduLogGCCInformation(FILE *file, PGCCPDU gcc_pdu);
  123. /* Description:
  124. * This function takes the gcc pdu structure, and based on
  125. * Which type of GCC PDU that it is, logs internal information
  126. * in the PDU.
  127. */
  128. void pduLogGCCConnectInfo(FILE *file, PConnectGCCPDU connect_pdu);
  129. /* same as above, but for GCC Connect PDUs */
  130. /**
  131. ** Functions for logging the specific contents of individual GCC
  132. ** PDUs. TODO: Only GCC PDUs that are used by MS Conferencing
  133. ** right now -- eventually we'll include all GCC PDUs.
  134. **/
  135. void pduLogUserIDIndication(FILE *file, PGCCPDU gcc_pdu);
  136. /* Description:
  137. * This function takes the gcc_pdu and writes the component parts
  138. * of the gcc userID indication.
  139. */
  140. void pduLogConnectJoinRequest(FILE *logfile, PConnectGCCPDU connect_pdu);
  141. void pduLogConnectJoinResponse(FILE *logfile, PConnectGCCPDU connect_pdu);
  142. void pduLogConferenceCreateRequest(FILE *logfile, PConnectGCCPDU connect_pdu);
  143. void pduLogConferenceCreateResponse(FILE *logfile, PConnectGCCPDU connect_pdu);
  144. void pduLogConferenceInviteRequest(FILE *logfile, PConnectGCCPDU connect_pdu);
  145. void pduLogConferenceInviteResponse(FILE *logfile, PConnectGCCPDU connect_pdu);
  146. void pduLogQueryResponse(FILE *logfile, PConnectGCCPDU connect_pdu);
  147. void pduLogRosterUpdateIndication(FILE *file, PGCCPDU gcc_pdu);
  148. void pduLogTextMessageIndication(FILE *file, PGCCPDU gcc_pdu);
  149. void pduLogConferenceTerminateIndication(FILE *logfile, PGCCPDU gcc_pdu);
  150. void pduLogConferenceEjectUserIndication(FILE *logfile, PGCCPDU gcc_pdu);
  151. void pduLogConferenceTransferIndication(FILE *logfile, PGCCPDU gcc_pdu);
  152. void pduLogApplicationInvokeIndication(FILE *logfile, PGCCPDU gcc_pdu);
  153. void pduLogRegistryMonitorEntryIndication(FILE *logfile, PGCCPDU gcc_pdu);
  154. void pduLogConferenceTimeRemainingIndication(FILE *logfile, PGCCPDU gcc_pdu);
  155. void pduLogConferenceTimeInquireIndication(FILE *logfile, PGCCPDU gcc_pdu);
  156. void pduLogConferenceTimeExtendIndication(FILE *logfile, PGCCPDU gcc_pdu);
  157. /******************************
  158. PDU Printing Functions
  159. *****************************/
  160. Void PrintNonStandardParameter(FILE * logfile,
  161. GCCNonStandardParameter FAR * non_standard_parameter);
  162. Void PrintDomainParameters(FILE * logfile,
  163. Char * print_text,
  164. DomainParameters FAR * domain_parameters);
  165. Void PrintPassword(FILE * logfile,
  166. GCCPassword FAR * password);
  167. //TODO: Change the parameter order here.
  168. Void PrintPrivilegeList(GCCConferencePrivileges FAR * privilege_list,
  169. Char FAR * print_text,
  170. FILE * logfile );
  171. Void PrintConferenceName(FILE * logfile,
  172. ConferenceNameSelector conference_name);
  173. Void PrintPasswordSelector(FILE *logfile,
  174. PasswordSelector password_selector);
  175. Void PrintConferenceAddResult(FILE *logfile,
  176. ConferenceAddResult result);
  177. Void PrintPasswordChallengeRequestResponse(FILE *logfile,
  178. PasswordChallengeRequestResponse chrqrs_password);
  179. Void PrintNetworkAddressList(FILE * logfile,
  180. Char * print_text,
  181. unsigned int number_of_network_addresses,
  182. GCCNetworkAddress ** network_address_list );
  183. Void PrintT120Boolean(FILE * logfile,
  184. Char * print_text,
  185. T120Boolean T120Boolean);
  186. Void PrintOssBoolean(FILE * logfile,
  187. Char * print_text,
  188. ossBoolean OssBoolean);
  189. Void PrintConferenceRoster(FILE * logfile,
  190. NodeInformation node_information);
  191. Void PrintApplicationRoster(FILE *logfile,
  192. SetOfApplicationInformation *application_information);
  193. Void PrintAppProtocolEntityList(FILE * logfile,
  194. UShort number_of_app_protocol_entities,
  195. GCCAppProtocolEntity FAR *
  196. FAR * app_protocol_entity_list );
  197. Void PrintOctetString(FILE * logfile,
  198. Char * print_text,
  199. GCCOctetString FAR * octet_string );
  200. Void PrintHexString( FILE * logfile,
  201. Char * print_text,
  202. GCCHexString hex_string );
  203. Void PrintSessionKey(FILE * logfile,
  204. Char * print_text,
  205. GCCSessionKey session_key );
  206. Void PrintNodeList( FILE * logfile,
  207. Char * print_text,
  208. UShort number_of_nodes,
  209. UserID FAR * node_list );
  210. Void PrintCapabilityList(FILE * logfile,
  211. Char * print_text,
  212. UShort number_of_capabilities,
  213. GCCApplicationCapability FAR *
  214. FAR * capabilities_list );
  215. Void PrintPasswordChallenge(FILE * logfile,
  216. GCCChallengeRequestResponse
  217. FAR * password_challenge );
  218. Void PrintTransferModes(FILE * logfile,
  219. Char * print_text,
  220. GCCTransferModes transfer_modes );
  221. Void PrintHigherLayerCompatibility(FILE * logfile,
  222. Char * print_text,
  223. GCCHighLayerCompatibility
  224. FAR * higher_layer_compatiblity );
  225. Void PrintApplicationRecordList( FILE * logfile,
  226. Char * print_text,
  227. UShort number_of_records,
  228. GCCApplicationRecord FAR *
  229. FAR * application_record_list );
  230. T120Boolean CopyTextToChar ( Char * print_string,
  231. TextString text_string);
  232. T120Boolean CopySimpleTextToChar (Char * print_string,
  233. SimpleTextString text_string);
  234. T120Boolean CompareTextToNULL( LPWSTR unicode_string );
  235. T120Boolean CompareNumericToNULL( GCCNumericString numeric_string );
  236. #endif // <<<<<<<<<<<< _PROTLOG_H
  237. #endif // <<<<<<<<<<<< PDULOG