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.

82 lines
3.1 KiB

  1. /********************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1990-1993 **/
  4. /********************************************************************/
  5. /* :ts=4 */
  6. //** TCB.H - TCB management definitions.
  7. //
  8. // This file contains the definitons needed for TCB management.
  9. //
  10. extern uint MaxHashTableSize;
  11. #define TCB_TABLE_SIZE MaxHashTableSize
  12. extern uint LogPerPartitionSize;
  13. #define GET_PARTITION(i) (i >> (ulong) LogPerPartitionSize)
  14. #define MAX_REXMIT_CNT 5
  15. #define MAX_CONNECT_REXMIT_CNT 2 //dropped from 3 to 2
  16. #define MAX_CONNECT_RESPONSE_REXMIT_CNT 2
  17. #define ADAPTED_MAX_CONNECT_RESPONSE_REXMIT_CNT 1
  18. extern uint TCPTime;
  19. #define ROR8(x) (ushort)( ( (ushort)(x) >> 1) | (ushort) ( ( (ushort)(x) & 1) << 15) )
  20. #define TCB_HASH(DA,SA,DP,SP) (uint)( ((uint)(ROR8( ROR8 (ROR8( *(ushort*)&(DP)+ \
  21. *(ushort *)&(SP) ) + *(ushort *)&(DA) )+ \
  22. *((ushort *)&(DA)+1) ) ) ) & (TCB_TABLE_SIZE-1))
  23. extern struct TCB *FindTCB(IPAddr Src, IPAddr Dest, ushort DestPort,
  24. ushort SrcPort,CTELockHandle *Handle, BOOLEAN Dpc,uint *index);
  25. extern struct TCB *FindSynTCB(IPAddr Src, IPAddr Dest, ushort DestPort,
  26. ushort SrcPort,CTELockHandle *Handle, BOOLEAN Dpc,uint index, BOOLEAN *reset);
  27. extern uint InsertTCB(struct TCB *NewTCB);
  28. extern struct TCB *AllocTCB(void);
  29. extern struct SYNTCB *AllocSynTCB(void);
  30. extern struct TWTCB *AllocTWTCB(uint index);
  31. extern void FreeTCB(struct TCB *FreedTCB);
  32. extern void FreeSynTCB(struct SYNTCB *FreedTCB);
  33. extern void FreeTWTCB(struct TWTCB *FreedTCB);
  34. extern uint RemoveTCB(struct TCB *RemovedTCB);
  35. extern void RemoveTWTCB(struct TWTCB *RemovedTCB, uint Partition);
  36. extern struct TWTCB *FindTCBTW(IPAddr Src, IPAddr Dest, ushort DestPort,
  37. ushort SrcPort,uint index);
  38. extern uint RemoveAndInsert(struct TCB *RemovedTCB);
  39. extern uint ValidateTCBContext(void *Context, uint *Valid);
  40. extern uint ReadNextTCB(void *Context, void *OutBuf);
  41. extern int InitTCB(void);
  42. extern void UnInitTCB(void);
  43. extern void TCBWalk(uint (*CallRtn)(struct TCB *, void *, void *,
  44. void *), void *Context1, void *Context2,
  45. void *Context3);
  46. extern uint DeleteTCBWithSrc(struct TCB *CheckTCB, void *AddrPtr,
  47. void *Unused1, void *Unused2);
  48. extern uint SetTCBMTU(struct TCB *CheckTCB, void *DestPtr,
  49. void *SrcPtr, void *MTUPtr);
  50. extern void ReetSendNext(struct TCB *SeqTCB, SeqNum DropSeq);
  51. extern uint InsertSynTCB(SYNTCB * NewTCB,CTELockHandle *Handle);
  52. extern ushort FindMSSAndOptions(TCPHeader UNALIGNED * TCPH,
  53. TCB * SynTCB, BOOLEAN syntcb);
  54. extern void SendSYNOnSynTCB(SYNTCB * SYNTcb,CTELockHandle TCBHandle);
  55. extern uint TCBWalkCount;
  56. extern uint NumTcbTablePartions;
  57. extern uint PerPartionSize;
  58. extern uint LogPerPartion;