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.

160 lines
3.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1994 - 1999
  6. //
  7. // File: scudp.h
  8. //
  9. //--------------------------------------------------------------------------
  10. /**********************************************************************/
  11. // This file contains Socket specific routines for Socket I/O
  12. /**********************************************************************/
  13. #define MSIPX (AddrFly == AF_NS)
  14. #define MAXSEQ 8
  15. #define SERV_TCP_PORT 6666
  16. #define SERV_UDP_PORT 6900
  17. #define SERV_HOST_ADDR 11.30.11.20
  18. #define CLINAME 11.30.11.22
  19. #define SRVNAME_LEN 16
  20. #define REQ 0
  21. #define DATA 1
  22. #define ClearSocket(PSOCK) {RtlZeroMemory(PSOCK ,sizeof (SOCKADDR));}
  23. typedef int INTEGER;
  24. typedef struct reqbuf * PREQBUF;
  25. /************************************************************************/
  26. // External variables
  27. /************************************************************************/
  28. extern PCHAR HostName;
  29. extern PCHAR ServerName;
  30. extern int AddrFly;
  31. extern BOOLEAN Connected;
  32. extern struct client Clients[MAXCLIENTS]; // all the client data
  33. extern USHORT NClients;
  34. /************************************************************************/
  35. // External Function prototypes
  36. /************************************************************************/
  37. NTSTATUS
  38. SCUDP_Initialize(
  39. IN USHORT NClients,
  40. IN PCHAR ServerName,
  41. IN USHORT SrvCli
  42. );
  43. NTSTATUS
  44. SCUDP_PerClientInit(
  45. IN USHORT CIndex,
  46. IN USHORT SrvCli
  47. );
  48. NTSTATUS
  49. SCUDP_Allocate_Memory(
  50. IN USHORT CIndex
  51. );
  52. NTSTATUS
  53. SCUDP_Deallocate_Memory(
  54. IN USHORT CIndex
  55. );
  56. NTSTATUS
  57. SCUDP_DoHandshake(
  58. IN USHORT CIndex,
  59. IN USHORT SrvCli
  60. );
  61. NTSTATUS
  62. SCUDP_Cleanup(
  63. VOID
  64. );
  65. NTSTATUS
  66. SCUDP_ReadFromIPC(
  67. IN USHORT CIndex,
  68. IN OUT PULONG pReadDone,
  69. IN USHORT SrvCli
  70. );
  71. NTSTATUS
  72. SCUDP_WriteToIPC(
  73. IN USHORT CIndex,
  74. IN OUT PULONG pWriteDone,
  75. IN USHORT SrvCli
  76. );
  77. NTSTATUS
  78. SCUDP_ThreadCleanUp(
  79. IN USHORT CIndex
  80. );
  81. /************************************************************************/
  82. // External Function prototypes
  83. /************************************************************************/
  84. extern
  85. INTEGER
  86. DGSocket_Recv(
  87. IN USHORT CliIndx,
  88. IN OUT PVOID PReadBuf,
  89. IN OUT PULONG rpdatalen
  90. );
  91. extern
  92. INTEGER
  93. DGSocket_RecvFrom(
  94. IN USHORT CliIndx,
  95. IN OUT PVOID PReadBuf,
  96. IN OUT PULONG rpdatalen,
  97. IN OUT PSOCKADDR pcaddr,
  98. IN OUT PUSHORT pcaddrlen
  99. );
  100. extern
  101. INTEGER
  102. DGSocket_Send(
  103. IN USHORT CliIndx,
  104. IN OUT PVOID PWriteBuf,
  105. IN OUT PULONG spdatalen
  106. );
  107. extern
  108. INTEGER
  109. DGSocket_SendTo(
  110. IN USHORT CliIndx,
  111. IN OUT PVOID PWriteBuf,
  112. IN OUT PULONG spdatalen,
  113. IN OUT PSOCKADDR pcaddr,
  114. IN OUT PUSHORT pcaddrlen
  115. );
  116. extern
  117. INTEGER
  118. DGSocket_Close(
  119. IN USHORT CliIndx
  120. );
  121. extern
  122. INTEGER
  123. DGSocket_Connect(
  124. IN USHORT CIndex,
  125. IN PSOCKADDR pdsockaddr
  126. );