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.

177 lines
3.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1994 - 1999
  6. //
  7. // File: scx.h
  8. //
  9. //--------------------------------------------------------------------------
  10. /////////////////////////////////////////////////////////////////////////
  11. //
  12. // Filename: scx.h
  13. //
  14. // Description: This file contains routines for Socket I/O
  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. #define MSIPX (AddrFly == AF_NS)
  23. #define MAXSEQ 8
  24. #define SERV_TCP_PORT 6666
  25. #define SERV_SPX_PORT 6666
  26. #define SERV_UDP_PORT 6900
  27. #define SERV_HOST_ADDR 11.30.11.20
  28. #define SRVNAME_LEN 16
  29. #define REQ 0
  30. #define DATA 1
  31. #define ClearSocket(PSOCK) {RtlZeroMemory(PSOCK ,sizeof (SOCKADDR));}
  32. typedef int INTEGER;
  33. typedef struct reqbuf * PREQBUF;
  34. /************************************************************************/
  35. // External variables
  36. /************************************************************************/
  37. extern PCHAR HostName;
  38. extern PCHAR ServerName;
  39. extern int AddrFly;
  40. extern struct client Clients[MAXCLIENTS]; // all the client data
  41. extern USHORT NClients;
  42. /************************************************************************/
  43. // Local Function prototypes
  44. /************************************************************************/
  45. INTEGER
  46. SPXSocket_Connect(
  47. IN int AddrFly,
  48. IN USHORT CIndex,
  49. IN PCHAR srvaddr
  50. );
  51. NTSTATUS
  52. SCXNS_Initialize(
  53. IN USHORT NClients,
  54. IN PCHAR ServerName,
  55. IN USHORT SrvCli
  56. );
  57. NTSTATUS
  58. SCXNS_PerClientInit(
  59. IN USHORT CIndex,
  60. IN USHORT SrvCli
  61. );
  62. NTSTATUS
  63. SCXNS_Allocate_Memory(
  64. IN USHORT CIndex
  65. );
  66. NTSTATUS
  67. SCXNS_Deallocate_Memory(
  68. IN USHORT CIndex
  69. );
  70. NTSTATUS
  71. SCXNS_DoHandshake(
  72. IN USHORT CIndex,
  73. IN USHORT SrvCli
  74. );
  75. NTSTATUS
  76. SCXNS_Cleanup(
  77. VOID
  78. );
  79. NTSTATUS
  80. SCXNS_Wait_For_Client(
  81. IN USHORT CIndex
  82. );
  83. NTSTATUS
  84. SCXNS_Disconnect_Client(
  85. IN USHORT CIndex
  86. );
  87. NTSTATUS
  88. SCXNS_ReadFromIPC(
  89. IN USHORT CIndex,
  90. IN OUT PULONG pReadDone,
  91. IN USHORT SrvCli
  92. );
  93. NTSTATUS
  94. SCXNS_WriteToIPC(
  95. IN USHORT CIndex,
  96. IN OUT PULONG pWriteDone,
  97. IN USHORT SrvCli
  98. );
  99. NTSTATUS
  100. SCXNS_XactIO(
  101. IN USHORT CIndex,
  102. IN OUT PULONG pReadDone,
  103. IN OUT PULONG pWriteDone,
  104. IN USHORT SrvCli,
  105. IN BOOLEAN FirstIter
  106. );
  107. NTSTATUS
  108. SCXNS_ThreadCleanUp(
  109. IN USHORT CIndex
  110. );
  111. /************************************************************************/
  112. // External Function prototypes
  113. /************************************************************************/
  114. extern
  115. INTEGER
  116. Socket_Listen(
  117. IN USHORT CliIndx
  118. );
  119. extern
  120. INTEGER
  121. Socket_Accept(
  122. IN USHORT CliIndx
  123. );
  124. extern
  125. INTEGER
  126. Socket_Recv(
  127. IN USHORT CliIndx,
  128. IN OUT PVOID PReadBuf,
  129. IN OUT PULONG rpdatalen
  130. );
  131. extern
  132. INTEGER
  133. Socket_Send(
  134. IN USHORT CliIndx,
  135. IN OUT PVOID PWriteBuf,
  136. IN OUT PULONG spdatalen
  137. );
  138. extern
  139. INTEGER
  140. Socket_Close(
  141. IN USHORT CliIndx
  142. );
  143. /************************************************************************/
  144.