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.

170 lines
3.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1994 - 1999
  6. //
  7. // File: scipx.h
  8. //
  9. //--------------------------------------------------------------------------
  10. /////////////////////////////////////////////////////////////////////////
  11. //
  12. // Filename: scipx.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. #include "msipx.h"
  23. #define MSIPX (AddrFly == AF_NS)
  24. #define MAXSEQ 8
  25. #define SERV_TCP_PORT 6666
  26. #define SERV_IPX_PORT 6900
  27. #define SERV_HOST_ADDR 11.30.11.20
  28. #define CLINAME 11.30.11.22
  29. #define SRVNAME_LEN 16
  30. #define REQ 0
  31. #define DATA 1
  32. #define ClearSocket(PSOCK) {RtlZeroMemory(PSOCK ,sizeof (SOCKADDR));}
  33. typedef int INTEGER;
  34. typedef struct reqbuf * PREQBUF;
  35. /************************************************************************/
  36. // External variables
  37. /************************************************************************/
  38. extern PCHAR HostName;
  39. extern PCHAR ServerName;
  40. extern int AddrFly;
  41. extern BOOLEAN Connected;
  42. extern struct client Clients[MAXCLIENTS]; // all the client data
  43. extern USHORT NClients;
  44. /************************************************************************/
  45. // External Function prototypes
  46. /************************************************************************/
  47. NTSTATUS
  48. SCIPX_Initialize(
  49. IN USHORT NClients,
  50. IN PCHAR ServerName,
  51. IN USHORT SrvCli
  52. );
  53. NTSTATUS
  54. SCIPX_PerClientInit(
  55. IN USHORT CIndex,
  56. IN USHORT SrvCli
  57. );
  58. NTSTATUS
  59. SCIPX_Allocate_Memory(
  60. IN USHORT CIndex
  61. );
  62. NTSTATUS
  63. SCIPX_Deallocate_Memory(
  64. IN USHORT CIndex
  65. );
  66. NTSTATUS
  67. SCIPX_DoHandshake(
  68. IN USHORT CIndex,
  69. IN USHORT SrvCli
  70. );
  71. NTSTATUS
  72. SCIPX_Cleanup(
  73. VOID
  74. );
  75. NTSTATUS
  76. SCIPX_ReadFromIPC(
  77. IN USHORT CIndex,
  78. IN OUT PULONG pReadDone,
  79. IN USHORT SrvCli
  80. );
  81. NTSTATUS
  82. SCIPX_WriteToIPC(
  83. IN USHORT CIndex,
  84. IN OUT PULONG pWriteDone,
  85. IN USHORT SrvCli
  86. );
  87. NTSTATUS
  88. SCIPX_ThreadCleanUp(
  89. IN USHORT CIndex
  90. );
  91. /************************************************************************/
  92. // External Function prototypes
  93. /************************************************************************/
  94. extern
  95. INTEGER
  96. DGSocket_Recv(
  97. IN USHORT CliIndx,
  98. IN OUT PVOID PReadBuf,
  99. IN OUT PULONG rpdatalen
  100. );
  101. extern
  102. INTEGER
  103. DGSocket_RecvFrom(
  104. IN USHORT CliIndx,
  105. IN OUT PVOID PReadBuf,
  106. IN OUT PULONG rpdatalen,
  107. IN OUT PSOCKADDR pcaddr,
  108. IN OUT PUSHORT pcaddrlen
  109. );
  110. extern
  111. INTEGER
  112. DGSocket_Send(
  113. IN USHORT CliIndx,
  114. IN OUT PVOID PWriteBuf,
  115. IN OUT PULONG spdatalen
  116. );
  117. extern
  118. INTEGER
  119. DGSocket_SendTo(
  120. IN USHORT CliIndx,
  121. IN OUT PVOID PWriteBuf,
  122. IN OUT PULONG spdatalen,
  123. IN OUT PSOCKADDR pcaddr,
  124. IN OUT PUSHORT pcaddrlen
  125. );
  126. extern
  127. INTEGER
  128. DGSocket_Close(
  129. IN USHORT CliIndx
  130. );
  131. extern
  132. INTEGER
  133. DGSocket_Connect(
  134. IN USHORT CIndex,
  135. IN PSOCKADDR pdsockaddr
  136. );
  137.