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.

89 lines
3.5 KiB

  1. /********************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1990-2000 **/
  4. /********************************************************************/
  5. /* :ts=4 */
  6. //** TCPSEND.H - TCP send protocol definitions.
  7. //
  8. // This file contains the definitions of TCP send protocol things.
  9. //
  10. #pragma once
  11. #define NUM_TCP_BUFFERS 150
  12. #ifdef SEND_DEBUG
  13. #define SEND_TICKS 10
  14. EXTERNAL_LOCK(SendUseLock)
  15. extern struct TCPSendReq *SendUseList;
  16. #endif
  17. //* Structure of a TCP send request.
  18. #define tsr_signature 0x20525354 // 'TSR '
  19. typedef struct TCPSendReq {
  20. struct TCPReq tsr_req; // General request structure.
  21. #if DBG
  22. ulong tsr_sig;
  23. #endif
  24. uint tsr_size; // Size in bytes of data in send.
  25. long tsr_refcnt; // Reference count for this send.
  26. ulong tsr_flags; // Flags for this send.
  27. uint tsr_unasize; // Number of bytes unacked.
  28. uint tsr_offset; // Offset into first buffer in chain
  29. // of start of unacked data.
  30. PNDIS_BUFFER tsr_buffer; // Pointer to start of unacked buffer
  31. // chain.
  32. PNDIS_BUFFER tsr_lastbuf; // Pointer to last buffer in chain.
  33. // Valid iff we've sent directly from
  34. // the buffer chain w/o doing an
  35. // NdisCopyBuffer.
  36. uint tsr_time; // TCP time this was received.
  37. #ifdef SEND_DEBUG
  38. struct TCPSendReq *tsr_next; // Debug next field.
  39. uint tsr_timer; // Timer field.
  40. uint tsr_cmplt; // Who completed it.
  41. #endif
  42. } TCPSendReq;
  43. #define TSR_FLAG_URG 0x01 // Urgent data.
  44. #define TSR_FLAG_SEND_AND_DISC 0x02 // Send and disconnect
  45. //* Structure defining the context received during a send completes.
  46. #define scc_signature 0x20434353 // 'SCC '
  47. typedef struct SendCmpltContext {
  48. #if DBG
  49. ulong scc_sig;
  50. #endif
  51. ulong scc_SendSize;
  52. ulong scc_ByteSent;
  53. TCB *scc_LargeSend;
  54. TCPSendReq *scc_firstsend; // First send in this context.
  55. uint scc_count; // Number of sends in count.
  56. ushort scc_ubufcount; // Number of 'user' buffers in send.
  57. ushort scc_tbufcount; // Number of transport buffers in send.
  58. } SendCmpltContext;
  59. extern void InitSendState(struct TCB *NewTCB);
  60. extern void SendSYN(struct TCB *SYNTcb, CTELockHandle);
  61. extern void SendKA(struct TCB *KATCB, CTELockHandle Handle);
  62. extern void SendRSTFromHeader(struct TCPHeader UNALIGNED *TCPH, uint Length,
  63. IPAddr Dest, IPAddr Src, IPOptInfo *OptInfo);
  64. extern void SendACK(struct TCB *ACKTcb);
  65. extern void SendRSTFromTCB(struct TCB *RSTTcb, RouteCacheEntry* RCE);
  66. extern void GoToEstab(struct TCB *EstabTCB);
  67. extern void FreeSendReq(TCPSendReq *FreedReq);
  68. extern void FreeTCPHeader(PNDIS_BUFFER FreedBuffer);
  69. extern int InitTCPSend(void);
  70. extern void UnInitTCPSend(void);
  71. extern void TCPSend(struct TCB *SendTCB, CTELockHandle Handle);
  72. extern TDI_STATUS TdiSend(PTDI_REQUEST Request, ushort Flags, uint SendLength,
  73. PNDIS_BUFFER SendBuffer);
  74. extern uint RcvWin(struct TCB *WinTCB);