namespace Vanara.PInvoke; /// Items from Qwave.dll. public static partial class Qwave { /// Flags associated with the parameters. [Flags] public enum AD_FLAG : uint { /// /// Indicates the existence of a network element in the data path that does not support QOS control services. When set in a specific /// service override, indicates QOS service was not supported on at least one hop. /// AD_FLAG_BREAK_BIT = 0x00000001, } /// The FilterType enumeration specifies the type of filter used for an RSVP FILTERSPEC. // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ne-qossp-filtertype typedef enum { FILTERSPECV4 = 1, FILTERSPECV6, // FILTERSPECV6_FLOW, FILTERSPECV4_GPI, FILTERSPECV6_GPI, FILTERSPEC_END } FilterType; [PInvokeData("qossp.h", MSDNShortId = "NE:qossp.__unnamed_enum_0")] public enum FilterType { /// /// Value: /// 1 /// Indicates an IPv4 FILTERSPEC. /// FILTERSPECV4 = 1, /// Indicates an IPv6 FILTERSPEC. FILTERSPECV6, /// Indicates IPv6 FILTERSPEC flow information. FILTERSPECV6_FLOW, /// Indicates IPv4 FILTERSPEC general port identifier information. FILTERSPECV4_GPI, /// Indicates IPv6 FILTERSPEC general port identifier information. FILTERSPECV6_GPI, /// Indicates the end of the FILTERSPEC information. FILTERSPEC_END, } /// Specifies the RSVP reservation style for a given flow. [PInvokeData("qossp.h")] public enum RSVP { /// Implements the default reservation style for the computer. RSVP_DEFAULT_STYLE = 0x00000000, /// /// Implements the WF RSVP reservation style. RSVP_WILDCARD_STYLE is the default value for multicast receivers and UDP unicast /// receivers. Specifying RSVP_WILDCARD_STYLE through RSVP_RESERVE_INFO is useful for overriding the default value /// (RSVP_FIXED_FILTER_STYLE) applied to connected unicast receivers. /// RSVP_WILDCARD_STYLE = 0x00000001, /// /// Implements the Fixed Filter (FF) RSVP reservation style. RSVP_FIXED_FILTER_STYLE is useful for overriding the default style for /// multicast receivers or unconnected UDP unicast receivers (RSVP_WILDCARD_STYLE). It may also be used to generate multiple /// RSVP_FIXED_FILTER_STLYE reservations in instances where only a single RSVP_FIXED_FILTER_STYLE reservation will be generated by /// default, such as with connected unicast receivers. /// RSVP_FIXED_FILTER_STYLE = 0x00000002, /// Implements the Shared Explicit (SE) RSVP reservation style. RSVP_SHARED_EXPLICIT_STYLE = 0x00000003, } /// /// The AD_GENERAL_PARAMS structure contains the General Characterization Parameters contained in the RSVP Adspec object. /// // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ns-qossp-ad_general_params typedef struct _AD_GENERAL_PARAMS { ULONG // IntServAwareHopCount; ULONG PathBandwidthEstimate; ULONG MinimumLatency; ULONG PathMTU; ULONG Flags; } AD_GENERAL_PARAMS, *LPAD_GENERAL_PARAMS; [PInvokeData("qossp.h", MSDNShortId = "NS:qossp._AD_GENERAL_PARAMS")] [StructLayout(LayoutKind.Sequential)] public struct AD_GENERAL_PARAMS { /// Number of hops that conform to Integrated Services (INTSERV) requirements. public uint IntServAwareHopCount; /// Minimum bandwidth available from sender to receiver. public uint PathBandwidthEstimate; /// Sum of the minimum latency of the packet forwarding process in routers, in milliseconds. Can be set to INDETERMINATE_LATENCY. public uint MinimumLatency; /// Maximum Transmission Unit (MTU) for the end-to-end path between sender and receiver that will not incur packet fragmentation. public uint PathMTU; /// /// Flags associated with the parameters. The following flag is supported: /// /// /// Value /// Meaning /// /// /// AD_FLAG_BREAK_BIT /// /// Indicates the existence of a network element in the data path that does not support QOS control services. When set in a specific /// service override, indicates QOS service was not supported on at least one hop. /// /// /// /// public AD_FLAG Flags; } /// Specifies guaranteed service, and provides service parameters. [PInvokeData("qossp.h")] [StructLayout(LayoutKind.Sequential)] public struct AD_GUARANTEED { /// public uint CTotal; /// public uint DTotal; /// public uint CSum; /// public uint DSum; } /// The CONTROL_SERVICE structure contains supported RSVP service types. /// /// The Length value can be added to the pointer to the structure to obtain the pointer to the next CONTROL_SERVICE /// structure in the list, until the NumberOfServices member of the RSVP_ADSPEC structure is exhausted. /// // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ns-qossp-control_service typedef struct _CONTROL_SERVICE { ULONG Length; // SERVICETYPE Service; AD_GENERAL_PARAMS Overrides; union { AD_GUARANTEED Guaranteed; PARAM_BUFFER ParamBuffer[1]; }; } CONTROL_SERVICE, *LPCONTROL_SERVICE; [PInvokeData("qossp.h", MSDNShortId = "NS:qossp._CONTROL_SERVICE")] [StructLayout(LayoutKind.Sequential)] public struct CONTROL_SERVICE : IVanaraMarshaler { /// /// The supported service type. Must be one of the following: /// /// /// Value /// Meaning /// /// /// SERVICETYPE_NOTRAFFIC /// No data is being sent in this direction. /// /// /// SERVICETYPE_BESTEFFORT /// Best Effort service. /// /// /// SERVICETYPE_CONTROLLEDLOAD /// Controlled Load service. /// /// /// SERVICETYPE_GUARANTEED /// Guaranteed service. /// /// /// SERVICETYPE_NETWORK_UNAVAILABLE /// This service type is used to notify the user that the network is unavailable. /// /// /// SERVICETYPE_GENERAL_INFORMATION /// /// This service type corresponds to General Parameters, as defined by IntServ (the Integrated Services Working Group in the IETF). /// /// /// /// SERVICETYPE_NOCHANGE /// This specifies that the flow specification contains no changes from the previous specification. /// /// /// SERVICETYPE_NONCONFORMING /// Specifies non-conforming traffic. /// /// /// SERVICETYPE_NETWORK_CONTROL /// Specifies network control traffic. /// /// /// SERVICETYPE_QUALITATIVE /// Qualitative service. /// /// /// public SERVICETYPE Service; /// Specifies overrides to service specifications, expressed in the form of an AD_GENERAL_PARAMS structure. public AD_GENERAL_PARAMS Overrides; /// Specifies guaranteed service, and provides service parameters in the form of an AD_GUARANTEED structure. public AD_GUARANTEED? Guaranteed; /// Describes the buffer used, in the form of a PARAM_BUFFER structure. public PARAM_BUFFER? ParamBuffer; SizeT IVanaraMarshaler.GetNativeSize() => Marshal.SizeOf(typeof(ACTUAL)); SafeAllocatedMemoryHandle IVanaraMarshaler.MarshalManagedToNative(object managedObject) { if (managedObject is not CONTROL_SERVICE cs) { throw new InvalidCastException("Only instances of CONTROL_SERVICE can be marshaled."); } if (!(cs.Guaranteed.HasValue ^ cs.ParamBuffer.HasValue)) { throw new InvalidCastException("Either Guaranteed OR ParamBuffer values must be set, but not both."); } int bufLen = ParamBuffer.HasValue && ParamBuffer.Value.Buffer is not null ? ParamBuffer.Value.Buffer.Length : 0; int len = Marshal.SizeOf(typeof(ACTUAL)) + (ParamBuffer.HasValue ? 8 + bufLen - Marshal.SizeOf(typeof(AD_GUARANTEED)) : 0); SafeCoTaskMemHandle ret = new(len); ACTUAL native = new() { Length = len, Service = cs.Service, Overrides = Overrides }; if (Guaranteed.HasValue) { native.union.Guaranteed = Guaranteed.Value; } else { native.union.ParamBuffer = new() { ParameterId = ParamBuffer.Value.ParameterId, Length = 8U + (uint)bufLen }; } ret.Write(native); if (bufLen > 0) { ret.Write(ParamBuffer.Value.Buffer, false, bufOffset); } return ret; } private static readonly int bufOffset = Marshal.OffsetOf(typeof(ACTUAL), "union").ToInt32() + Marshal.OffsetOf(typeof(UNION.DUMMYBUF), "Buffer").ToInt32(); object IVanaraMarshaler.MarshalNativeToManaged(IntPtr pNativeData, SizeT allocatedBytes) { if (pNativeData == IntPtr.Zero || allocatedBytes == 0) { return null; } ACTUAL actual = (ACTUAL)Marshal.PtrToStructure(pNativeData, typeof(ACTUAL)); CONTROL_SERVICE ret = new() { Service = actual.Service, Overrides = actual.Overrides }; if (actual.Service == SERVICETYPE.SERVICETYPE_GUARANTEED) { ret.Guaranteed = actual.union.Guaranteed; } else { PARAM_BUFFER pb = new() { ParameterId = actual.union.ParamBuffer.ParameterId, Length = actual.union.ParamBuffer.Length }; pb.Buffer = pNativeData.ToArray((int)pb.Length - 8, bufOffset, allocatedBytes); ret.ParamBuffer = pb; } return ret; } [StructLayout(LayoutKind.Sequential)] private struct ACTUAL { public int Length; public SERVICETYPE Service; public AD_GENERAL_PARAMS Overrides; public UNION union; } [StructLayout(LayoutKind.Explicit)] private struct UNION { [FieldOffset(0)] public AD_GUARANTEED Guaranteed; [FieldOffset(0)] public DUMMYBUF ParamBuffer; [StructLayout(LayoutKind.Sequential)] public struct DUMMYBUF { /// Parameter ID, as defined by INTSERV. public uint ParameterId; /// Length of the entire PARAM_BUFFER structure. public uint Length; /// Buffer containing the parameter. public byte Buffer; } } } /// The FLOWDESCRIPTOR structure specifies one or more filters for a given FLOWSPEC. // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ns-qossp-flowdescriptor typedef struct _FLOWDESCRIPTOR { FLOWSPEC FlowSpec; // ULONG NumFilters; LPRSVP_FILTERSPEC FilterList; } FLOWDESCRIPTOR, *LPFLOWDESCRIPTOR; [PInvokeData("qossp.h", MSDNShortId = "NS:qossp._FLOWDESCRIPTOR")] [StructLayout(LayoutKind.Sequential)] public struct FLOWDESCRIPTOR { /// Flow specification (FLOWSPEC), provided as a FLOWSPEC structure. public FLOWSPEC FlowSpec; /// Number of filters provided in FilterList. public uint NumFilters; /// Pointer to a structure containing FILTERSPEC information. public IntPtr FilterList; } /// /// The PARAM_BUFFER structure describes the format of the parameter buffer that can be included in the CONTROL_SERVICE structure. /// // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ns-qossp-param_buffer typedef struct _PARAM_BUFFER { ULONG ParameterId; // ULONG Length; UCHAR Buffer[1]; } PARAM_BUFFER, *LPPARAM_BUFFER; [PInvokeData("qossp.h", MSDNShortId = "NS:qossp._PARAM_BUFFER")] [VanaraMarshaler(typeof(SafeAnysizeStructMarshaler), nameof(Length))] [StructLayout(LayoutKind.Sequential)] public struct PARAM_BUFFER { /// Parameter ID, as defined by INTSERV. public uint ParameterId; /// Length of the entire PARAM_BUFFER structure. public uint Length; /// Buffer containing the parameter. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] Buffer; } /// /// The QOS object QOS_DESTADDR is used during a call to the WSAIoctl (SIO_SET_QOS) function in order to avoid issuing a /// connect function call for a sending socket. /// // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ns-qossp-qos_destaddr typedef struct _QOS_DESTADDR { QOS_OBJECT_HDR // ObjectHdr; const sockaddr *SocketAddress; struct sockaddr; ULONG SocketAddressLength; } QOS_DESTADDR, *LPQOS_DESTADDR; [PInvokeData("qossp.h", MSDNShortId = "NS:qossp._QOS_DESTADDR")] [StructLayout(LayoutKind.Sequential)] public struct QOS_DESTADDR { /// The QOS object QOS_OBJECT_HDR. The object type for this QOS object should be QOS_DESTADDR. public QOS_OBJECT_HDR ObjectHdr; /// Address of the destination socket . public IntPtr SocketAddress; /// Length of the SocketAddress structure. public uint SocketAddressLength; } /// /// The QOS object RSVP_ADSPEC provides a means by which information describing network devices along the data path between sender /// and receiver, pertaining to RSVP functionality and available services, is provided or retrieved. /// // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ns-qossp-rsvp_adspec typedef struct _RSVP_ADSPEC { QOS_OBJECT_HDR ObjectHdr; // AD_GENERAL_PARAMS GeneralParams; ULONG NumberOfServices; CONTROL_SERVICE Services[1]; } RSVP_ADSPEC, *LPRSVP_ADSPEC; [PInvokeData("qossp.h", MSDNShortId = "NS:qossp._RSVP_ADSPEC")] [VanaraMarshaler(typeof(SafeAnysizeStructMarshaler), nameof(NumberOfServices))] [StructLayout(LayoutKind.Sequential)] public struct RSVP_ADSPEC : IQoSObjectHdr { /// The QOS object QOS_OBJECT_HDR. public QOS_OBJECT_HDR ObjectHdr; /// /// An AD_GENERAL_PARAMS structure that provides general characterization parameters for the flow. Information includes RSVP-enabled /// hop count, bandwidth and latency estimates, and the path's MTU. /// public AD_GENERAL_PARAMS GeneralParams; /// Provides a count of the number of services available. public uint NumberOfServices; /// /// A CONTROL_SERVICE array, its element count based on NumberOfServices, which provides information about the services /// available along the data path between the sender and receiver of a given flow. /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public CONTROL_SERVICE[] Services; } /// The RSVP_FILTERSPEC structure provides RSVP FILTERSPEC information. // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ns-qossp-rsvp_filterspec typedef struct _RSVP_FILTERSPEC { FilterType Type; // union { RSVP_FILTERSPEC_V4 FilterSpecV4; RSVP_FILTERSPEC_V6 FilterSpecV6; RSVP_FILTERSPEC_V6_FLOW FilterSpecV6Flow; // RSVP_FILTERSPEC_V4_GPI FilterSpecV4Gpi; RSVP_FILTERSPEC_V6_GPI FilterSpecV6Gpi; }; } RSVP_FILTERSPEC, *LPRSVP_FILTERSPEC; [PInvokeData("qossp.h", MSDNShortId = "NS:qossp._RSVP_FILTERSPEC")] [StructLayout(LayoutKind.Sequential)] public struct RSVP_FILTERSPEC { /// Specifies the type of FILTERSPEC using the FilterSpec enumeration. public FilterType Type; /// The union of filters. public UNION Union; /// The union of filters. [StructLayout(LayoutKind.Explicit)] public struct UNION { /// IPv4 FILTERSPEC information, provided in the form of a RSVP_FILTERSPEC_V4 structure. [FieldOffset(0)] public RSVP_FILTERSPEC_V4 FilterSpecV4; /// IPv6 FILTERSPEC information, provided in the form of a RSVP_FILTERSPEC_V6 structure. [FieldOffset(0)] public RSVP_FILTERSPEC_V6 FilterSpecV6; /// IPv6 FILTERSPEC flow information, provided in the form of a RSVP_FILTERSPEC_V6_FLOW structure. [FieldOffset(0)] public RSVP_FILTERSPEC_V6_FLOW FilterSpecV6Flow; /// IPv4 FILTERSPEC general port ID information, provided in the form of a RSVP_FILTERSPEC_V4_GPI structure. [FieldOffset(0)] public RSVP_FILTERSPEC_V4_GPI FilterSpecV4Gpi; /// IPv6 FILTERSPEC general port ID information, provided in the form of a RSVP_FILTERSPEC_V6_GPI structure. [FieldOffset(0)] public RSVP_FILTERSPEC_V6_GPI FilterSpecV6Gpi; } } /// The RSVP_FILTERSPEC_V4 structure stores information for a FILTERSPEC on an IPv4 address. /// When working with IPv6 addresses, use RSVP_FILTERSPEC_V6. // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ns-qossp-rsvp_filterspec_v4 typedef struct _RSVP_FILTERSPEC_V4 { // IN_ADDR_IPV4 Address; USHORT Unused; USHORT Port; } RSVP_FILTERSPEC_V4, *LPRSVP_FILTERSPEC_V4; [PInvokeData("qossp.h", MSDNShortId = "NS:qossp._RSVP_FILTERSPEC_V4")] [StructLayout(LayoutKind.Sequential)] public struct RSVP_FILTERSPEC_V4 { /// IPv4 address for which the FILTERSPEC applies, expressed as an IN_ADDR_IPV4 union. public IN_ADDR_IPV4 Address; /// Reserved. Set to zero. public ushort Unused; /// TCP port of the socket on which the FILTERSPEC applies. public ushort Port; } /// The RSVP_FILTERSPEC_V4_GPI structure provides general port identifier information for a given FILTERSPEC. /// When working with IPv6 addresses, use RSVP_FILTERSPEC_V6_GPI. // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ns-qossp-rsvp_filterspec_v4_gpi typedef struct _RSVP_FILTERSPEC_V4_GPI { // IN_ADDR_IPV4 Address; ULONG GeneralPortId; } RSVP_FILTERSPEC_V4_GPI, *LPRSVP_FILTERSPEC_V4_GPI; [PInvokeData("qossp.h", MSDNShortId = "NS:qossp._RSVP_FILTERSPEC_V4_GPI")] [StructLayout(LayoutKind.Sequential)] public struct RSVP_FILTERSPEC_V4_GPI { /// IPv4 address for which the FILTERSPEC general port identifier applies, expressed as an IN_ADDR_IPV4 union. public IN_ADDR_IPV4 Address; /// General Port Identifier for the FILTERSPEC. public uint GeneralPortId; } /// The RSVP_FILTERSPEC_V6 structure stores information for a FILTERSPEC on an IPv6 address. /// When working with IPv4 addresses, use RSVP_FILTERSPEC_V4. // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ns-qossp-rsvp_filterspec_v6 typedef struct _RSVP_FILTERSPEC_V6 { // IN_ADDR_IPV6 Address; USHORT UnUsed; USHORT Port; } RSVP_FILTERSPEC_V6, *LPRSVP_FILTERSPEC_V6; [PInvokeData("qossp.h", MSDNShortId = "NS:qossp._RSVP_FILTERSPEC_V6")] [StructLayout(LayoutKind.Sequential)] public struct RSVP_FILTERSPEC_V6 { /// IPv4 address for which the FILTERSPEC applies, expressed as an IN_ADDR_IPV6 structure. public IN_ADDR_IPV6 Address; /// public ushort UnUsed; /// TCP port of the socket on which the FILTERSPEC applies. public ushort Port; } /// The RSVP_FILTERSPEC_V6_FLOW structure provides flow label information for an IPv6 FILTERSPEC. // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ns-qossp-rsvp_filterspec_v6_flow typedef struct _RSVP_FILTERSPEC_V6_FLOW { // IN_ADDR_IPV6 Address; UCHAR UnUsed; UCHAR FlowLabel[3]; } RSVP_FILTERSPEC_V6_FLOW, *LPRSVP_FILTERSPEC_V6_FLOW; [PInvokeData("qossp.h", MSDNShortId = "NS:qossp._RSVP_FILTERSPEC_V6_FLOW")] [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct RSVP_FILTERSPEC_V6_FLOW { /// IPv4 address for which the FILTERSPEC flow label applies, expressed as an IN_ADDR_IPV6 structure. public IN_ADDR_IPV6 Address; private uint field; /// public byte UnUsed { get => BitConverter.GetBytes(field)[0]; set { byte[] bytes = BitConverter.GetBytes(field); bytes[0] = value; field = BitConverter.ToUInt32(bytes, 0); } } /// Label for the flow. public byte[] FlowLabel { get => BitConverter.GetBytes(field).AsSpan().Slice(1, 3).ToArray(); set { if (value is null || value.Length != 3) { throw new ArgumentException("FlowLabel must be a three byte array.", nameof(value)); } byte[] bytes = BitConverter.GetBytes(field); Array.Copy(value, 0, bytes, 1, 3); field = BitConverter.ToUInt32(bytes, 0); } } } /// /// The RSVP_FILTERSPEC_V6_GPI structure provides general port identifier information for a given FILTERSPEC on an IPv6 address. /// /// When working with IPv4 addresses, use RSVP_FILTERSPEC_V4_GPI. // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ns-qossp-rsvp_filterspec_v6_gpi typedef struct _RSVP_FILTERSPEC_V6_GPI { // IN_ADDR_IPV6 Address; ULONG GeneralPortId; } RSVP_FILTERSPEC_V6_GPI, *LPRSVP_FILTERSPEC_V6_GPI; [PInvokeData("qossp.h", MSDNShortId = "NS:qossp._RSVP_FILTERSPEC_V6_GPI")] [StructLayout(LayoutKind.Sequential)] public struct RSVP_FILTERSPEC_V6_GPI { /// IPv4 address for which the FILTERSPEC general port identifier applies, expressed as an IN_ADDR_IPV6 structure. public IN_ADDR_IPV6 Address; /// General Port Identifier for the FILTERSPEC. public uint GeneralPortId; } /// The RSVP_POLICY structure stores one or more undefined policy elements. /// RSVP transports the data contained in an RSVP_POLICY structure on behalf of the Policy Control component. // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ns-qossp-rsvp_policy typedef struct _RSVP_POLICY { USHORT Len; USHORT Type; // UCHAR Info[4]; } RSVP_POLICY, *LPRSVP_POLICY; [PInvokeData("qossp.h", MSDNShortId = "NS:qossp._RSVP_POLICY")] [StructLayout(LayoutKind.Sequential)] public struct RSVP_POLICY { /// Size of the entire element object, in bytes. public ushort Len; /// Type of RSVP policy element in Info. public ushort Type; private uint field; /// Policy data, expressed in UCHARs. public byte[] Info { get => BitConverter.GetBytes(field); set { if (value is null || value.Length != 4) { throw new ArgumentException("Info must be a four byte array.", nameof(value)); } byte[] bytes = BitConverter.GetBytes(field); Array.Copy(value, 0, bytes, 0, 4); field = BitConverter.ToUInt32(bytes, 0); } } } /// The RSVP_POLICY_INFO structure stores undefined policy elements retrieved from RSVP. // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ns-qossp-rsvp_policy_info typedef struct _RSVP_POLICY_INFO { QOS_OBJECT_HDR // ObjectHdr; ULONG NumPolicyElement; RSVP_POLICY PolicyElement[1]; } RSVP_POLICY_INFO, *LPRSVP_POLICY_INFO; [PInvokeData("qossp.h", MSDNShortId = "NS:qossp._RSVP_POLICY_INFO")] [VanaraMarshaler(typeof(SafeAnysizeStructMarshaler), nameof(NumPolicyElement))] [StructLayout(LayoutKind.Sequential)] public struct RSVP_POLICY_INFO : IQoSObjectHdr { /// QOS object header that specifies the size and length of the QOS object. public QOS_OBJECT_HDR ObjectHdr; /// Number of policy elements in PolicyElement. public uint NumPolicyElement; /// List of policy elements received, in the form of a RSVP_POLICY structure. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public RSVP_POLICY[] PolicyElement; } /// /// /// The QOS object RSVP_RESERVE_INFO, through the ProviderSpecific buffer, enables RSVP behavior for a given flow to be specified /// or modified at a granular level, and enables default RSVP style settings for a flow to be overridden. Although /// RSVP_RESERVE_INFO is technically a structure, its use within Windows 2000 QOS technology—and especially its required inclusion /// of the QOS_OBJECT_HDR as its first member—define it as a QOS object. /// /// Note The RSVP_RESERVE_INFO QOS object is not supported except on Windows 2000. /// // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ns-qossp-rsvp_reserve_info typedef struct _RSVP_RESERVE_INFO { // QOS_OBJECT_HDR ObjectHdr; ULONG Style; ULONG ConfirmRequest; LPRSVP_POLICY_INFO PolicyElementList; ULONG NumFlowDesc; LPFLOWDESCRIPTOR // FlowDescList; } RSVP_RESERVE_INFO, *LPRSVP_RESERVE_INFO; [PInvokeData("qossp.h", MSDNShortId = "NS:qossp._RSVP_RESERVE_INFO")] [StructLayout(LayoutKind.Sequential)] public struct RSVP_RESERVE_INFO : IQoSObjectHdr { /// The QOS object QOS_OBJECT_HDR. public QOS_OBJECT_HDR ObjectHdr; /// /// /// Specifies the RSVP reservation style for a given flow, and can be used to replace default reservation styles placed on a /// particular type of flow. More information about RSVP reservation styles, and the default settings for certain QOS-enabled socket /// sessions, can be found under Network-Driven QOS Components. This member can be one of the following values. /// /// /// /// Value /// Meaning /// /// /// RSVP_WILDCARD_SYLE /// /// Implements the WF RSVP reservation style. RSVP_WILDCARD_STYLE is the default value for multicast receivers and UDP unicast /// receivers. Specifying RSVP_WILDCARD_STYLE through RSVP_RESERVE_INFO is useful for overriding the default value /// (RSVP_FIXED_FILTER_STYLE) applied to connected unicast receivers. /// /// /// /// RSVP_FIXED_FILTER_STYLE /// /// Implements the Fixed Filter (FF) RSVP reservation style. RSVP_FIXED_FILTER_STYLE is useful for overriding the default style for /// multicast receivers or unconnected UDP unicast receivers (RSVP_WILDCARD_STYLE). It may also be used to generate multiple /// RSVP_FIXED_FILTER_STLYE reservations in instances where only a single RSVP_FIXED_FILTER_STYLE reservation will be generated by /// default, such as with connected unicast receivers. /// /// /// /// RSVP_SHARED_EXPLICIT_STYLE /// Implements the Shared Explicit (SE) RSVP reservation style. /// /// /// RSVP_DEFAULT_STYLE /// Implements the default reservation style for the computer. /// /// /// /// Note It is important to note that the number of senders included in any individual RSVP_SHARED_EXPLICIT_STYLE reservation /// must be less than one hundred senders. If more than one hundred senders attempt to connect to an RSVP_SHARED_EXPLICIT_STYLE /// reservation, the one-hundredth (and above) attempt fails without notice. /// /// public RSVP Style; /// /// Can be used by a receiving application to request notification of its reservation request by setting ConfirmRequest to a /// nonzero value. Such notification is achieved when RSVP-aware devices in the data path between sender and receiver (or vice-versa) /// transmit an RESV CONFIRMATION message toward the requesting node. Note that an RSVP node is not required to automatically /// generate RESV CONFIRMATION messages. /// public uint ConfirmRequest; /// /// Pointer to the set of policy elements. Optional policy information, as provided in an structure. /// public IntPtr PolicyElementList; /// Specifies the FLOWDESCRIPTOR count. public uint NumFlowDesc; /// Pointer to the list of s. public IntPtr FlowDescList; } /// /// The QOS object RSVP_STATUS_INFO provides information regarding the status of RSVP for a given flow, including event /// notifications associated with monitoring FD_QOS events, as well as error information. RSVP_STATUS_INFO is useful for storing /// RSVP-specific status and error information. /// /// /// When applications register their interest in FD_QOS events (see QOS Events), event and error information is associated with the event /// in the form of the QOS structure that is associated with the event. For more detailed information associated with that event, /// applications can investigate the RSVP_STATUS_INFO object that is provided in the ProviderSpecific buffer of the /// event-associated QOS structure. /// // https://learn.microsoft.com/en-us/windows/win32/api/qossp/ns-qossp-rsvp_status_info typedef struct _RSVP_STATUS_INFO { QOS_OBJECT_HDR // ObjectHdr; ULONG StatusCode; ULONG ExtendedStatus1; ULONG ExtendedStatus2; } RSVP_STATUS_INFO, *LPRSVP_STATUS_INFO; [PInvokeData("qossp.h", MSDNShortId = "NS:qossp._RSVP_STATUS_INFO")] [StructLayout(LayoutKind.Sequential)] public struct RSVP_STATUS_INFO : IQoSObjectHdr { /// The QOS object QOS_OBJECT_HDR. public QOS_OBJECT_HDR ObjectHdr; /// Status information. See Winsock2.h for more information. public uint StatusCode; /// /// Mechanism for storing or returning provider-specific status information. The ExtendedStatus1 parameter is used for storing /// a higher-level, or generalized error code, and is augmented by finer-grained error information provided in ExtendedStatus2. /// public uint ExtendedStatus1; /// /// Additional mechanism for storing or returning provider-specific status information. Provides finer-grained error information /// compared to the generalized error information provided in ExtendedStatus1. /// public uint ExtendedStatus2; } }