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.

234 lines
9.0 KiB

  1. /**********************************************************************
  2. * File: mcslog.h
  3. * Abstract: Function headers for protocol logging functions added
  4. * into MCSNC.DLL to read the contents of MCS PDU contents
  5. * sent and received from the T.123 layer.
  6. * Created: 2/18/96, Venkatesh Gopalakrishnan
  7. * Copyright (c) 1996 Microsoft Corpration
  8. ******************************************************************** */
  9. /* NOTE: The contents of this file are only included IFF PDULOG is a
  10. * defined constant. This constant will be defined in the Win32 Diagnostic
  11. * build configuration of MCSNC.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. #include "mpdutype.h"
  20. #include "mcspdu.h"
  21. #define MAXIMUM_PRINT_LENGTH 256
  22. #define LOG_FILE_NAME "mcslog.txt"
  23. #define SENT 0
  24. #define RECEIVED 1
  25. /* Enumerated Data types and corresponding strings used in
  26. * MCS PDUs.
  27. */
  28. #define NOT_IN_USE 0
  29. #define SELF_GRABBED 1
  30. #define OTHER_GRABBED 2
  31. #define SELF_INHIBITED 3
  32. #define OTHER_INHIBITED 4
  33. #define SELF_RECIPIENT 5
  34. #define SELF_GIVING 6
  35. #define OTHER_GIVING 7
  36. #define NOT_IN_USE_STR "NOT_IN_USE"
  37. #define SELF_GRABBED_STR "SELF_GRABBED"
  38. #define OTHER_GRABBED_STR "OTHER_GRABBED"
  39. #define SELF_INHIBITED_STR "SELF_INHIBITED"
  40. #define OTHER_INHIBITED_STR "OTHER_INHIBITED"
  41. #define SELF_RECPIENT_STR "SELF_RECIPIENT"
  42. #define SELF_GIVING_STR "SELF_GIVING"
  43. #define OTHER_GIVING_STR "OTHER_GIVING"
  44. #define TOP_PRI 0
  45. #define HIGH_PRI 1
  46. #define MEDIUM_PRI 2
  47. #define LOW_PRI 3
  48. #define TOP_STR "TOP_PRIORITY\n"
  49. #define HIGH_STR "HIGH_PRIORITY\n"
  50. #define MEDIUM_STR "MEDIUM_PRIORITY\n"
  51. #define LOW_STR "LOW_PRIORITY\n"
  52. #define RT_SUCCESSFUL 0
  53. #define RT_DOMAIN_MERGING 1
  54. #define RT_DOMAIN_NOT_HIERARCHICAL 2
  55. #define RT_NO_SUCH_CHANNEL 3
  56. #define RT_NO_SUCH_DOMAIN 4
  57. #define RT_NO_SUCH_USER 5
  58. #define RT_NOT_ADMITTED 6
  59. #define RT_OTHER_USER 7
  60. #define RT_PARAMETERS_UNACCEPTABLE 8
  61. #define RT_TOKEN_NOT_AVAILABLE 9
  62. #define RT_TOKEN_NOT_POSESSED 10
  63. #define RT_TOO_MANY_CHANNELS 11
  64. #define RT_TOO_MANY_TOKENS 12
  65. #define RT_TOO_MANY_USERS 13
  66. #define RT_UNSPECIFIED_FAILURE 14
  67. #define RT_USER_REJECTED 15
  68. /***
  69. **** The following function headers are for service functions
  70. **** for logging the value(s) of typical data types found in
  71. **** several MCS PDU structures.
  72. ****/
  73. void PrintPDUResult(FILE *logfile, unsigned int result);
  74. void PrintPDUPriority(FILE *logfile, unsigned int priority);
  75. void PrintTokenStatus(FILE *logfile, unsigned int token_status);
  76. void PrintPDUReason(FILE *logfile, unsigned int reason);
  77. void PrintDiagnostic(FILE *logfile, unsigned int diagnostic);
  78. void PrintPDUSegmentation(FILE *logfile, unsigned char segmentation);
  79. void PrintSetOfChannelIDs(FILE *logfile, PSetOfChannelIDs channel_ids);
  80. void PrintSetOfUserIDs(FILE *logfile, PSetOfUserIDs user_ids);
  81. void PrintSetOfTokenIDs(FILE *logfile, PSetOfTokenIDs token_ids);
  82. void PrintSetOfTokenAttributes(FILE *logfile,
  83. PSetOfPDUTokenAttributes token_attribute_obj);
  84. void PrintPDUDomainParameters(FILE *logfile, PDUDomainParameters domain_params);
  85. void PrintT120Boolean(FILE *logfile, char * string, BOOL boolean);
  86. void PrintCharData(FILE *logfile, unsigned char *string, unsigned int length);
  87. void PrintChannelAttributes(FILE *logfile, PDUChannelAttributes channel_attributes);
  88. void PrintTokenAttributes(FILE *logfile, PDUTokenAttributes token_attributes);
  89. int InitializeMCSLog();
  90. /* Description:
  91. * Resets the mcs protocol log file and reads any
  92. * ini file parameters
  93. */
  94. char *pszTimeStamp();
  95. /* Desicription:
  96. * This function is an easy interfact to getting the time the
  97. * PDU was encoded or decoded from MCS to T.123 or vice versa.
  98. */
  99. void pduLog(FILE *file, char * format_string,...);
  100. /* Description:
  101. * This function is used to place PDU information in a protocol
  102. * log file. There is currently no return value. This may change.
  103. */
  104. void pduFragmentation(FILE *logfile, unsigned int i);
  105. /* Description:
  106. * This function logs weather or not the PDU is complete
  107. * or fragmented.
  108. */
  109. void pduRawOutput(FILE *logfile, unsigned char * data, unsigned long length);
  110. /* Description:
  111. * This function logs a hex dump of the raw encoded MCS PDU that
  112. * is sent over the wire via MCS.
  113. */
  114. void mcsLog(PPacket packet, PDomainMCSPDU domain_pdu, unsigned int direction);
  115. /* Description:
  116. * This function takes care of the log headers and footers to
  117. * attempt at compatibility with a certain third party mcs log
  118. * reader.
  119. */
  120. void mcsConnectLog(PPacket packet, PConnectMCSPDU connect_pdu, unsigned int direction);
  121. /* same as above, but for Connect PDUs */
  122. void pduLogMCSDomainInfo(FILE *file, PDomainMCSPDU domain_pdu);
  123. /* Description:
  124. * This function takes the mcs pdu structure, and based on
  125. * Which type of MCSPDU that it is, logs internal information
  126. * in the PDU.
  127. */
  128. void pduLogMCSConnectInfo(FILE *file, PConnectMCSPDU connect_pdu);
  129. /* same as above but for Connect PDUs */
  130. void pduDirection(FILE *logfile,unsigned int direction);
  131. /* Description:
  132. * This function logs information whether the mcs pdu was sent
  133. * or received.
  134. */
  135. /*****
  136. ***** The following headers are for functions that log the output of
  137. ***** each different type of MCS PDU. Every MCS PDU is covered here.
  138. *****/
  139. void pduLogConnectInitial(FILE *file, PConnectMCSPDU connect_pdu);
  140. /* Description:
  141. * This function takes the connect_pdu and writes the component parts
  142. * of the mcs ConnectInitial PDU.
  143. */
  144. void pduLogConnectResponse(FILE *file, PConnectMCSPDU connect_pdu);
  145. void pduLogConnectAdditional(FILE *file, PConnectMCSPDU connect_pdu);
  146. void pduLogConnectResult(FILE *file, PConnectMCSPDU connect_pdu);
  147. void pduLogPlumbDomainIndication(FILE *file, PDomainMCSPDU domain_pdu);
  148. void pduLogErectDomainRequest(FILE *file, PDomainMCSPDU domain_pdu);
  149. void pduLogMergeChannelsRequest(FILE *file, PDomainMCSPDU domain_pdu);
  150. void pduLogMergeChannelsConfirm(FILE *file, PDomainMCSPDU domain_pdu);
  151. void pduLogPurgeChannelIndication(FILE *file, PDomainMCSPDU domain_pdu);
  152. void pduLogMergeTokensRequest(FILE *file, PDomainMCSPDU domain_pdu);
  153. void pduLogMergeTokensConfirm(FILE *file, PDomainMCSPDU domain_pdu);
  154. void pduLogPurgeTokenIndication(FILE *file, PDomainMCSPDU domain_pdu);
  155. void pduLogDisconnectProviderUltimatum(FILE *file, PDomainMCSPDU domain_pdu);
  156. void pduLogRejectUltimatum(FILE *logfile, PDomainMCSPDU domain_pdu);
  157. void pduLogAttachUserRequest(FILE *file, PDomainMCSPDU domain_pdu);
  158. void pduLogAttachUserConfirm(FILE *file, PDomainMCSPDU domain_pdu);
  159. void pduLogDetachUserRequest(FILE *file, PDomainMCSPDU domain_pdu);
  160. void pduLogDetachUserIndication(FILE *file, PDomainMCSPDU domain_pdu);
  161. void pduLogChannelJoinRequest(FILE *file, PDomainMCSPDU domain_pdu);
  162. void pduLogChannelJoinConfirm(FILE *file, PDomainMCSPDU domain_pdu);
  163. void pduLogChannelLeaveRequest(FILE *file, PDomainMCSPDU domain_pdu);
  164. void pduLogChannelConveneRequest(FILE *file, PDomainMCSPDU domain_pdu);
  165. void pduLogChannelConveneConfirm(FILE *file, PDomainMCSPDU domain_pdu);
  166. void pduLogChannelDisbandRequest(FILE *file, PDomainMCSPDU domain_pdu);
  167. void pduLogChannelDisbandIndication(FILE *file, PDomainMCSPDU domain_pdu);
  168. void pduLogChannelAdmitRequest(FILE *file, PDomainMCSPDU domain_pdu);
  169. void pduLogChannelAdmitIndication(FILE *file, PDomainMCSPDU domain_pdu);
  170. void pduLogChannelExpelRequest(FILE *file, PDomainMCSPDU domain_pdu);
  171. void pduLogChannelExpelIndication(FILE *file, PDomainMCSPDU domain_pdu);
  172. void pduLogSendDataRequest(FILE *file, PDomainMCSPDU domain_pdu);
  173. void pduLogSendDataIndication(FILE *file, PDomainMCSPDU domain_pdu);
  174. void pduLogUniformSendDataRequest(FILE *file, PDomainMCSPDU domain_pdu);
  175. void pduLogUniformSendDataIndication(FILE *file, PDomainMCSPDU domain_pdu);
  176. void pduLogTokenGrabRequest(FILE *file, PDomainMCSPDU domain_pdu);
  177. void pduLogTokenGrabConfirm(FILE *file, PDomainMCSPDU domain_pdu);
  178. void pduLogTokenInhibitRequest(FILE *file, PDomainMCSPDU domain_pdu);
  179. void pduLogTokenInhibitConfirm(FILE *file, PDomainMCSPDU domain_pdu);
  180. void pduLogTokenGiveRequest(FILE *file, PDomainMCSPDU domain_pdu);
  181. void pduLogTokenGiveIndication(FILE *file, PDomainMCSPDU domain_pdu);
  182. void pduLogTokenGiveResponse(FILE *file, PDomainMCSPDU domain_pdu);
  183. void pduLogTokenGiveConfirm(FILE *file, PDomainMCSPDU domain_pdu);
  184. void pduLogTokenPleaseRequest(FILE *file, PDomainMCSPDU domain_pdu);
  185. void pduLogTokenPleaseIndication(FILE *file, PDomainMCSPDU domain_pdu);
  186. void pduLogTokenReleaseRequest(FILE *file, PDomainMCSPDU domain_pdu);
  187. void pduLogTokenReleaseConfirm(FILE *file, PDomainMCSPDU domain_pdu);
  188. void pduLogTokenTestRequest(FILE *file, PDomainMCSPDU domain_pdu);
  189. void pduLogTokenTestConfirm(FILE *file, PDomainMCSPDU domain_pdu);
  190. BOOL CopyTextToChar(char * print_string,
  191. unsigned short *text_string_value,
  192. unsigned int text_string_length);
  193. #endif // <<<<<<<<<<<< _PROTLOG_H
  194. #endif // <<<<<<<<<<<< PDULOG