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.

215 lines
4.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1994 - 1999
  6. //
  7. // File: nb.h
  8. //
  9. //--------------------------------------------------------------------------
  10. /////////////////////////////////////////////////////////////////////////
  11. //
  12. // Filename: nb.h
  13. //
  14. // Description: This file contains definitions for NetBios routines
  15. // for use with IPC raw network performance tests.
  16. //
  17. // Authors: Scott Holden (Translator from NT API to win32 API)
  18. // Mahesh Keni (Mahesh wrote this application using mostly
  19. // NT native API calls)
  20. //
  21. /////////////////////////////////////////////////////////////////////////
  22. // 1234567890123456
  23. #define PERF_NETBIOS "perftest123456 "
  24. #define CLINAME "perfCli"
  25. #define ALL_CLIENTS "* "
  26. #define SPACES " "
  27. #define ClearNCB( PNCB ) { \
  28. RtlZeroMemory( PNCB , sizeof (NCB) ); \
  29. RtlMoveMemory( (PNCB)->ncb_name, SPACES, sizeof(SPACES)-1 );\
  30. RtlMoveMemory( (PNCB)->ncb_callname, SPACES, sizeof(SPACES)-1 );\
  31. }
  32. /**********************************************************************/
  33. // Local Function prototypes
  34. /**********************************************************************/
  35. UCHAR
  36. NetBIOS_AddName(
  37. IN PCHAR LocalName,
  38. IN UCHAR LanaNumber,
  39. OUT PUCHAR NameNumber
  40. );
  41. UCHAR
  42. NetBIOS_DelName(
  43. IN PCHAR LocalName,
  44. IN UCHAR LanaNumber
  45. );
  46. UCHAR
  47. NetBIOS_Reset(
  48. IN UCHAR LanaNumber
  49. );
  50. UCHAR
  51. NetBIOS_Call(
  52. IN USHORT CIndex, // Client Index
  53. IN PCHAR LocalName,
  54. IN PCHAR RemoteName
  55. );
  56. UCHAR
  57. NetBIOS_Listen(
  58. IN USHORT TIndex, // Client Index
  59. IN PCHAR LocalName,
  60. IN PCHAR RemoteName,
  61. IN UCHAR NameNumber
  62. );
  63. UCHAR
  64. NetBIOS_Receive(
  65. IN USHORT TIndex,
  66. IN PUCHAR RecvBuffer,
  67. IN USHORT RecvLen
  68. );
  69. UCHAR
  70. NetBIOS_Send(
  71. IN USHORT TIndex,
  72. IN PUCHAR SendBuffer,
  73. IN USHORT SendLen
  74. );
  75. UCHAR
  76. NetBIOS_HangUP(
  77. IN USHORT TIndex
  78. );
  79. UCHAR
  80. NetBIOS_RecvSend(
  81. IN USHORT TIndex,
  82. IN PUCHAR SendBuffer,
  83. IN USHORT SendLen,
  84. IN PUCHAR RecvBuffer,
  85. IN USHORT RecvLen
  86. );
  87. UCHAR
  88. NetBIOS_SPReceive(
  89. IN USHORT TIndex,
  90. IN NCB * PRecvNCB,
  91. IN USHORT Global, // global= 1 or local = 0
  92. IN PUCHAR RecvBuffer,
  93. IN USHORT RecvLen
  94. );
  95. NTSTATUS
  96. NB_Initialize(
  97. IN USHORT NClients,
  98. IN PCHAR ServerName,
  99. IN USHORT SrvCli
  100. );
  101. NTSTATUS
  102. NB_PerClientInit(
  103. IN USHORT CIndex, // client index
  104. IN USHORT SrvCli
  105. );
  106. NTSTATUS
  107. NB_Wait_For_Client(
  108. IN USHORT CIndex
  109. );
  110. NTSTATUS
  111. NB_Disconnect_Client(
  112. IN USHORT CIndex
  113. );
  114. NTSTATUS
  115. NB_Connect_To_Server(
  116. IN USHORT CIndex
  117. );
  118. NTSTATUS
  119. NB_Allocate_Memory(
  120. IN USHORT CIndex
  121. );
  122. NTSTATUS
  123. NB_Deallocate_Memory(
  124. IN USHORT CIndex
  125. );
  126. NTSTATUS
  127. NB_Disconnect_From_Server(
  128. IN USHORT CIndex
  129. );
  130. NTSTATUS
  131. NB_DoHandshake(
  132. IN USHORT CIndex, // client index and namedpipe instance number
  133. IN USHORT SrvCli // if it's a server or client
  134. );
  135. NTSTATUS
  136. NB_ReadFromIPC(
  137. IN USHORT CIndex, // client index and namedpipe instance number
  138. IN OUT PULONG pReadDone,
  139. IN USHORT SrvCli // if it's a server or client
  140. );
  141. NTSTATUS
  142. NB_WriteToIPC(
  143. IN USHORT CIndex, // client index and namedpipe instance number
  144. IN OUT PULONG pWriteDone,
  145. IN USHORT SrvCli // if it's a server or client
  146. );
  147. NTSTATUS
  148. NB_XactIO(
  149. IN USHORT CIndex, // client index and namedpipe instance number
  150. IN OUT PULONG pReadDone,
  151. IN OUT PULONG pWriteDone,
  152. IN USHORT SrvCli, // if it's a server or client
  153. IN BOOLEAN FirstIter
  154. );
  155. NTSTATUS
  156. NB_Cleanup(
  157. VOID
  158. );
  159. NTSTATUS
  160. NB_ThreadCleanUp(
  161. IN USHORT CIndex
  162. );
  163. /**********************************************************************/
  164. // External variables
  165. /**********************************************************************/
  166. // For NetBIOS only
  167. extern USHORT LanaCount;
  168. extern USHORT LanaBase;
  169. extern UCHAR NameNumber;
  170. extern CHAR LocalName[NCBNAMSZ];
  171. extern CHAR RemoteName[NCBNAMSZ];
  172. extern struct client Clients[MAXCLIENTS]; // all the client data
  173. extern USHORT NClients;
  174. extern USHORT MachineNumber;
  175.