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.

152 lines
5.9 KiB

  1. /*
  2. ** wsrm.h - winsock extension for Reliable Multicast (RMCast) Transport
  3. **
  4. ** This file contains PGM specific information for use by WinSock2 compatible
  5. ** applications that need Reliable Multicast Transport.
  6. **
  7. ** Copyright (c) Microsoft Corporation. All rights reserved.
  8. **
  9. ** Created: Mar 12, 2000
  10. **
  11. */
  12. #ifndef _WSRM_H_
  13. #define _WSRM_H_
  14. #define IPPROTO_RM 113
  15. #define MAX_MCAST_TTL 255
  16. //
  17. // options for setsockopt, getsockopt
  18. //
  19. #define RM_OPTIONSBASE 1000
  20. // Set/Query rate (Kb/Sec) + window size (Kb and/or MSec) -- described by RM_SEND_WINDOW below
  21. #define RM_RATE_WINDOW_SIZE (RM_OPTIONSBASE + 1)
  22. // Set the size of the next message -- (ULONG)
  23. #define RM_SET_MESSAGE_BOUNDARY (RM_OPTIONSBASE + 2)
  24. // flush the entire data (window) right now -- not implemented
  25. #define RM_FLUSHCACHE (RM_OPTIONSBASE + 3)
  26. // Set or Query the window advance method on the sender -- methods enumerated in eWINDOW_ADVANCE_METHOD
  27. #define RM_SENDER_WINDOW_ADVANCE_METHOD (RM_OPTIONSBASE + 4)
  28. // get sender statistics
  29. #define RM_SENDER_STATISTICS (RM_OPTIONSBASE + 5)
  30. // allow a late-joiner to NAK any packet upto the lowest sequence Id
  31. #define RM_LATEJOIN (RM_OPTIONSBASE + 6)
  32. // set IP multicast outgoing interface
  33. #define RM_SET_SEND_IF (RM_OPTIONSBASE + 7)
  34. // add IP multicast incoming interface
  35. #define RM_ADD_RECEIVE_IF (RM_OPTIONSBASE + 8)
  36. // delete IP multicast incoming interface
  37. #define RM_DEL_RECEIVE_IF (RM_OPTIONSBASE + 9)
  38. // Set/Query the Window's Advance rate (has to be less that MAX_WINDOW_INCREMENT_PERCENTAGE)
  39. #define RM_SEND_WINDOW_ADV_RATE (RM_OPTIONSBASE + 10)
  40. // Instruct to use parity-based forward error correction schemes
  41. #define RM_USE_FEC (RM_OPTIONSBASE + 11)
  42. // Set the Ttl of the MCast packets -- (ULONG)
  43. #define RM_SET_MCAST_TTL (RM_OPTIONSBASE + 12)
  44. // get receiver statistics
  45. #define RM_RECEIVER_STATISTICS (RM_OPTIONSBASE + 13)
  46. // get receiver statistics
  47. #define RM_HIGH_SPEED_INTRANET_OPT (RM_OPTIONSBASE + 14)
  48. //==============================================================
  49. //
  50. // Definitions
  51. //
  52. #define SENDER_DEFAULT_RATE_KBITS_PER_SEC 56 // 56 Kbits/Sec
  53. #define SENDER_DEFAULT_WINDOW_SIZE_BYTES 10 *1000*1000 // 10 Megs
  54. #define SENDER_DEFAULT_WINDOW_ADV_PERCENTAGE 15 // 15%
  55. #define MAX_WINDOW_INCREMENT_PERCENTAGE 25 // 25%
  56. #define SENDER_DEFAULT_LATE_JOINER_PERCENTAGE 0 // 0%
  57. #define SENDER_MAX_LATE_JOINER_PERCENTAGE 75 // 75%
  58. #define BITS_PER_BYTE 8
  59. #define LOG2_BITS_PER_BYTE 3
  60. enum eWINDOW_ADVANCE_METHOD
  61. {
  62. E_WINDOW_ADVANCE_BY_TIME = 1, // Default mode
  63. E_WINDOW_USE_AS_DATA_CACHE
  64. };
  65. //==============================================================
  66. //
  67. // Structures
  68. //
  69. typedef struct _RM_SEND_WINDOW
  70. {
  71. ULONG RateKbitsPerSec; // Send rate
  72. ULONG WindowSizeInMSecs;
  73. ULONG WindowSizeInBytes;
  74. } RM_SEND_WINDOW;
  75. typedef struct _RM_SENDER_STATS
  76. {
  77. ULONGLONG DataBytesSent; // # client data bytes sent out so far
  78. ULONGLONG TotalBytesSent; // SPM, OData and RData bytes
  79. ULONGLONG NaksReceived; // # NAKs received so far
  80. ULONGLONG NaksReceivedTooLate; // # NAKs recvd after window advanced
  81. ULONGLONG NumOutstandingNaks; // # NAKs yet to be responded to
  82. ULONGLONG NumNaksAfterRData; // # NAKs yet to be responded to
  83. ULONGLONG RepairPacketsSent; // # Repairs (RDATA) sent so far
  84. ULONGLONG BufferSpaceAvailable; // # partial messages dropped
  85. ULONGLONG TrailingEdgeSeqId; // smallest (oldest) Sequence Id in the window
  86. ULONGLONG LeadingEdgeSeqId; // largest (newest) Sequence Id in the window
  87. ULONGLONG RateKBitsPerSecOverall; // Internally calculated send-rate from the beginning
  88. ULONGLONG RateKBitsPerSecLast; // Send-rate calculated every INTERNAL_RATE_CALCULATION_FREQUENCY
  89. ULONGLONG TotalODataPacketsSent; // # ODATA packets sent so far
  90. } RM_SENDER_STATS;
  91. typedef struct _RM_RECEIVER_STATS
  92. {
  93. ULONGLONG NumODataPacketsReceived;// # OData sequences received
  94. ULONGLONG NumRDataPacketsReceived;// # RData sequences received
  95. ULONGLONG NumDuplicateDataPackets;// # RData sequences received
  96. ULONGLONG DataBytesReceived; // # client data bytes received out so far
  97. ULONGLONG TotalBytesReceived; // SPM, OData and RData bytes
  98. ULONGLONG RateKBitsPerSecOverall; // Internally calculated Receive-rate from the beginning
  99. ULONGLONG RateKBitsPerSecLast; // Receive-rate calculated every INTERNAL_RATE_CALCULATION_FREQUENCY
  100. ULONGLONG TrailingEdgeSeqId; // smallest (oldest) Sequence Id in the window
  101. ULONGLONG LeadingEdgeSeqId; // largest (newest) Sequence Id in the window
  102. ULONGLONG AverageSequencesInWindow;
  103. ULONGLONG MinSequencesInWindow;
  104. ULONGLONG MaxSequencesInWindow;
  105. ULONGLONG FirstNakSequenceNumber; // # First Outstanding Nak
  106. ULONGLONG NumPendingNaks; // # Sequences waiting for Ncfs
  107. ULONGLONG NumOutstandingNaks; // # Sequences for which Ncfs have been received, but no data
  108. ULONGLONG NumDataPacketsBuffered; // # Data packets currently buffered by transport
  109. ULONGLONG TotalSelectiveNaksSent; // # Selective NAKs sent so far
  110. ULONGLONG TotalParityNaksSent; // # Parity NAKs sent so far
  111. } RM_RECEIVER_STATS;
  112. typedef struct _RM_FEC_INFO
  113. {
  114. USHORT FECBlockSize;
  115. USHORT FECProActivePackets;
  116. UCHAR FECGroupSize;
  117. BOOLEAN fFECOnDemandParityEnabled;
  118. } RM_FEC_INFO;
  119. #endif /* _WSRM_H_ */