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.

151 lines
5.7 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. //==============================================================
  47. //
  48. // Definitions
  49. //
  50. #define SENDER_DEFAULT_RATE_KBITS_PER_SEC 56 // 56 Kbits/Sec
  51. #define SENDER_DEFAULT_WINDOW_SIZE_BYTES 10 *1000*1000 // 10 Megs
  52. #define SENDER_DEFAULT_WINDOW_ADV_PERCENTAGE 15 // 15%
  53. #define MAX_WINDOW_INCREMENT_PERCENTAGE 25 // 25%
  54. #define SENDER_DEFAULT_LATE_JOINER_PERCENTAGE 0 // 0%
  55. #define SENDER_MAX_LATE_JOINER_PERCENTAGE 75 // 75%
  56. #define INTERNAL_RATE_CALCULATION_FREQUENCY 8192 // ~8 secs
  57. #define LOG2_INTERNAL_RATE_CALCULATION_FREQUENCY 13
  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. } RM_SENDER_STATS;
  90. typedef struct _RM_RECEIVER_STATS
  91. {
  92. ULONGLONG NumODataPacketsReceived;// # OData sequences received
  93. ULONGLONG NumRDataPacketsReceived;// # RData sequences received
  94. ULONGLONG NumDuplicateDataPackets;// # RData sequences received
  95. ULONGLONG DataBytesReceived; // # client data bytes received out so far
  96. ULONGLONG TotalBytesReceived; // SPM, OData and RData bytes
  97. ULONGLONG RateKBitsPerSecOverall; // Internally calculated Receive-rate from the beginning
  98. ULONGLONG RateKBitsPerSecLast; // Receive-rate calculated every INTERNAL_RATE_CALCULATION_FREQUENCY
  99. ULONGLONG TrailingEdgeSeqId; // smallest (oldest) Sequence Id in the window
  100. ULONGLONG LeadingEdgeSeqId; // largest (newest) Sequence Id in the window
  101. ULONGLONG AverageSequencesInWindow;
  102. ULONGLONG MinSequencesInWindow;
  103. ULONGLONG MaxSequencesInWindow;
  104. ULONGLONG FirstNakSequenceNumber; // # First Outstanding Nak
  105. ULONGLONG NumPendingNaks; // # Sequences waiting for Ncfs
  106. ULONGLONG NumOutstandingNaks; // # Sequences for which Ncfs have been received, but no data
  107. ULONGLONG NumDataPacketsBuffered; // # Data packets currently buffered by transport
  108. ULONGLONG TotalSelectiveNaksSent; // # Selective NAKs sent so far
  109. ULONGLONG TotalParityNaksSent; // # Parity NAKs sent so far
  110. } RM_RECEIVER_STATS;
  111. typedef struct _RM_FEC_INFO
  112. {
  113. USHORT FECBlockSize;
  114. USHORT FECProActivePackets;
  115. UCHAR FECGroupSize;
  116. BOOLEAN fFECOnDemandParityEnabled;
  117. } RM_FEC_INFO;
  118. #endif /* _WSRM_H_ */