Leaked source code of windows server 2003
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.

81 lines
3.1 KiB

  1. /********************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1990-2000 **/
  4. /********************************************************************/
  5. /* :ts=4 */
  6. //** TCPRCV.H - TCP receive protocol definitions.
  7. //
  8. // This file contains the definitions for structures used by the receive code.
  9. //
  10. #pragma once
  11. #define CONN_REQUEST_COMPLETE 0x01
  12. #define SEND_REQUEST_COMPLETE 0x02
  13. #define IN_RCV_COMPLETE 0x10
  14. #define ANY_REQUEST_COMPLETE (CONN_REQUEST_COMPLETE | SEND_REQUEST_COMPLETE)
  15. #define trh_signature 0x20485254 // 'TRH '
  16. typedef struct TCPRAHdr {
  17. #if DBG
  18. ulong trh_sig; // Signature.
  19. #endif
  20. struct TCPRAHdr *trh_next; // Next pointer.
  21. SeqNum trh_start; // First sequence number.
  22. uint trh_size; // Size in bytes of data in this TRH.
  23. uint trh_flags; // Flags for this segment.
  24. uint trh_urg; // Urgent pointer from this seg.
  25. IPRcvBuf *trh_buffer; // Head of buffer list for this TRH.
  26. IPRcvBuf *trh_end; // End of buffer list for this TRH.
  27. } TCPRAHdr;
  28. //* Structure of a TCP receive request.
  29. #define trr_signature 0x20525254 // 'TRR '
  30. typedef struct TCPRcvReq {
  31. #if DBG
  32. ulong trr_sig; // Signature.
  33. #endif
  34. struct TCPRcvReq *trr_next; // Next in chain.
  35. CTEReqCmpltRtn trr_rtn; // Completion routine.
  36. PVOID trr_context; // User context.
  37. uint trr_amt; // Number of bytes currently in buffer.
  38. uint trr_offset; // Offset into first buffer on chain
  39. // at which to start copying.
  40. uint trr_flags; // Flags for this recv.
  41. uint trr_size; // Total size of buffer chain.
  42. ushort *trr_uflags; // Pointer to user specifed flags.
  43. PNDIS_BUFFER trr_buffer; // Pointer to useable NDIS buffer chain.
  44. int trr_status; // Final completion status.
  45. } TCPRcvReq;
  46. #define TRR_PUSHED 0x80000000 // This buffer has been pushed.
  47. extern void FreeRBChain(IPRcvBuf *RBChain);
  48. extern void AdjustRcvWin(struct TCB *WinTCB);
  49. //* Delay Queue and related receive handling definitions and functions.
  50. extern BOOLEAN PartitionedDelayQ;
  51. extern void TCPRcvComplete(void);
  52. extern void DelayAction(struct TCB *DelayTCB, uint Action);
  53. extern void ProcessTCBDelayQ(KIRQL OrigIrql, BOOLEAN ProcessAllQueues);
  54. extern LOGICAL ProcessPerCpuTCBDelayQ(int Proc, KIRQL OrigIrql,
  55. const LARGE_INTEGER* StopTicks,
  56. ulong *ItemsProcessed);
  57. extern void CompleteRcvs(struct TCB *CmpltTCB);
  58. __inline void PartitionDelayQProcessing(BOOLEAN NewState) {
  59. if (NewState != PartitionedDelayQ) {
  60. InterlockedExchange(((PLONG)&(PartitionedDelayQ)), NewState);
  61. }
  62. }