⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jwaqossp.pas

📁 比较全面的win32api开发包
💻 PAS
📖 第 1 页 / 共 3 页
字号:
{******************************************************************************}
{                                                       	               }
{ Winsock2 QOS Service Provider API interface Unit for Object Pascal           }
{                                                       	               }
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
{ Corporation. All Rights Reserved.                                            }
{ 								               }
{ The original file is: qossp.h, released August 2001. The original Pascal     }
{ code is: QosSp.pas, released December 2000. The initial developer of the     }
{ Pascal code is Marcel van Brakel (brakelm@chello.nl).                        }
{                                                                              }
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
{ Marcel van Brakel. All Rights Reserved.                                      }
{ 								               }
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
{								               }
{ You may retrieve the latest version of this file at the Project JEDI home    }
{ page, located at http://delphi-jedi.org or my personal homepage located at   }
{ http://members.chello.nl/m.vanbrakel2                                        }
{								               }
{ The contents of this file are used with permission, subject to the Mozilla   }
{ Public License Version 1.1 (the "License"); you may not use this file except }
{ in compliance with the License. You may obtain a copy of the License at      }
{ http://www.mozilla.org/MPL/MPL-1.1.html                                      }
{                                                                              }
{ Software distributed under the License is distributed on an "AS IS" basis,   }
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
{ the specific language governing rights and limitations under the License.    }
{                                                                              }
{ Alternatively, the contents of this file may be used under the terms of the  }
{ GNU Lesser General Public License (the  "LGPL License"), in which case the   }
{ provisions of the LGPL License are applicable instead of those above.        }
{ If you wish to allow use of your version of this file only under the terms   }
{ of the LGPL License and not to allow others to use your version of this file }
{ under the MPL, indicate your decision by deleting  the provisions above and  }
{ replace  them with the notice and other provisions required by the LGPL      }
{ License.  If you do not delete the provisions above, a recipient may use     }
{ your version of this file under either the MPL or the LGPL License.          }
{ 								               }
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
{ 								               }
{******************************************************************************}

unit JwaQosSp;

{$WEAKPACKAGEUNIT}

{$HPPEMIT ''}
{$HPPEMIT '#include "qossp.h"'}
{$HPPEMIT ''}

{$I WINDEFINES.INC}

interface

uses
{$IFDEF STANDALONE}
  JwaWinTypes,
{$ELSE}
  Windows,
{$ENDIF}
  JwaWinSock2, JwaQos;

(*
 * Definition of object Types
 *
 *
 * define the values for ObjectType above - RSVP Objects ids start at an
 * offset from zero to allow for ATM objects that might be defined in the
 * lower number range.
 *)

const
  RSVP_OBJECT_ID_BASE     = 1000;
  {$EXTERNALSYM RSVP_OBJECT_ID_BASE}
  RSVP_OBJECT_STATUS_INFO = ($00000000 + RSVP_OBJECT_ID_BASE);
  {$EXTERNALSYM RSVP_OBJECT_STATUS_INFO}
  (* RSVP_STATUS_INFO structure passed *)
  RSVP_OBJECT_RESERVE_INFO = ($00000001 + RSVP_OBJECT_ID_BASE);
  {$EXTERNALSYM RSVP_OBJECT_RESERVE_INFO}
  (* RSVP_RESERVE_INFO structure passed *)
  RSVP_OBJECT_ADSPEC = ($00000002 + RSVP_OBJECT_ID_BASE);
  {$EXTERNALSYM RSVP_OBJECT_ADSPEC}
  (* RSVP_ADSPEC structure passed *)
  RSVP_OBJECT_POLICY_INFO = ($00000003 + RSVP_OBJECT_ID_BASE);
  {$EXTERNALSYM RSVP_OBJECT_POLICY_INFO}
  (* RSVP POLICY ELEMENT(S) retrieved *)
  RSVP_OBJECT_FILTERSPEC_LIST = ($00000004 + RSVP_OBJECT_ID_BASE);
  {$EXTERNALSYM RSVP_OBJECT_FILTERSPEC_LIST}
  (* RSVP SENDER LIST returned *)


(*
 * IPV4 addressing for RSVP FILTERSPECS
 *)

type
  _IN_ADDR_IPV4 = record
    Addr: ULONG;
    AddrBytes: array [0..3] of UCHAR;
  end;
  {$EXTERNALSYM _IN_ADDR_IPV4}
  IN_ADDR_IPV4 = _IN_ADDR_IPV4;
  {$EXTERNALSYM IN_ADDR_IPV4}
  LPIN_ADDR_IPV4 = ^IN_ADDR_IPV4;
  {$EXTERNALSYM LPIN_ADDR_IPV4}
  TInAddrIPV4 = IN_ADDR_IPV4;
  PInAddrIPV4 = LPIN_ADDR_IPV4;

(*
 * IPV6 addressing for RSVP FILTERSPECS
 *)

  _IN_ADDR_IPV6 = record
    Addr: array [0..15] of UCHAR;               //IPV6 address
  end;
  {$EXTERNALSYM _IN_ADDR_IPV6}
  IN_ADDR_IPV6 = _IN_ADDR_IPV6;
  {$EXTERNALSYM IN_ADDR_IPV6}
  LPIN_ADDR_IPV6 = ^IN_ADDR_IPV6;
  {$EXTERNALSYM LPIN_ADDR_IPV6}
  TInAddrIPV6 = IN_ADDR_IPV6;
  PInAddrIPV6 = LPIN_ADDR_IPV6;

  LPCIN_ADDR_IPV6 = ^IN_ADDR_IPV6;
  {$EXTERNALSYM LPCIN_ADDR_IPV6}

(*
 * IPV4 addressing for RSVP FILTERSPECS
 *)

  LPRSVP_FILTERSPEC_V4 = ^RSVP_FILTERSPEC_V4;
  {$EXTERNALSYM LPRSVP_FILTERSPEC_V4}
  _RSVP_FILTERSPEC_V4 = record
    Address: IN_ADDR_IPV4;
    Unused: USHORT;
    Port: USHORT;
  end;
  {$EXTERNALSYM _RSVP_FILTERSPEC_V4}
  RSVP_FILTERSPEC_V4 = _RSVP_FILTERSPEC_V4;
  {$EXTERNALSYM RSVP_FILTERSPEC_V4}
  TRsvpFilterSpecV4 = RSVP_FILTERSPEC_V4;
  PRsvpFilterSpecV4 = LPRSVP_FILTERSPEC_V4;

  LPRSVP_FILTERSPEC_V6 = ^RSVP_FILTERSPEC_V6;
  {$EXTERNALSYM LPRSVP_FILTERSPEC_V6}
  _RSVP_FILTERSPEC_V6 = record
    Address: IN_ADDR_IPV6;
    UnUsed: USHORT;
    Port: USHORT;
  end;
  {$EXTERNALSYM _RSVP_FILTERSPEC_V6}
  RSVP_FILTERSPEC_V6 = _RSVP_FILTERSPEC_V6;
  {$EXTERNALSYM RSVP_FILTERSPEC_V6}
  TRsvpFilterSpecV6 = RSVP_FILTERSPEC_V6;
  PRsvpFilterSpecV6 = LPRSVP_FILTERSPEC_V6;

  LPRSVP_FILTERSPEC_V6_FLOW = ^RSVP_FILTERSPEC_V6_FLOW;
  {$EXTERNALSYM LPRSVP_FILTERSPEC_V6_FLOW}
  _RSVP_FILTERSPEC_V6_FLOW = record
    Address: IN_ADDR_IPV6;
    UnUsed: UCHAR;
    FlowLabel: array [0..2] of UCHAR;
  end;
  {$EXTERNALSYM _RSVP_FILTERSPEC_V6_FLOW}
  RSVP_FILTERSPEC_V6_FLOW = _RSVP_FILTERSPEC_V6_FLOW;
  {$EXTERNALSYM RSVP_FILTERSPEC_V6_FLOW}
  TRsvpFilterSpecV6Flow = RSVP_FILTERSPEC_V6_FLOW;
  PRsvpFilterSpecV6Flow = LPRSVP_FILTERSPEC_V6_FLOW;

  LPRSVP_FILTERSPEC_V4_GPI = ^RSVP_FILTERSPEC_V4_GPI;
  {$EXTERNALSYM LPRSVP_FILTERSPEC_V4_GPI}
  _RSVP_FILTERSPEC_V4_GPI = record
    Address: IN_ADDR_IPV4;
    GeneralPortId: ULONG;
  end;
  {$EXTERNALSYM _RSVP_FILTERSPEC_V4_GPI}
  RSVP_FILTERSPEC_V4_GPI = _RSVP_FILTERSPEC_V4_GPI;
  {$EXTERNALSYM RSVP_FILTERSPEC_V4_GPI}
  TRsvpFilterSpecV4Gpi = RSVP_FILTERSPEC_V4_GPI;
  PRsvpFilterSpecV4Gpi = LPRSVP_FILTERSPEC_V4_GPI;

  LPRSVP_FILTERSPEC_V6_GPI = ^RSVP_FILTERSPEC_V6_GPI;
  {$EXTERNALSYM LPRSVP_FILTERSPEC_V6_GPI}
  _RSVP_FILTERSPEC_V6_GPI = record
    Address: IN_ADDR_IPV6;
    GeneralPortId: ULONG;
  end;
  {$EXTERNALSYM _RSVP_FILTERSPEC_V6_GPI}
  RSVP_FILTERSPEC_V6_GPI = _RSVP_FILTERSPEC_V6_GPI;
  {$EXTERNALSYM RSVP_FILTERSPEC_V6_GPI}
  TRsvpFilterSpecV6Gpi = RSVP_FILTERSPEC_V6_GPI;
  PRsvpFilterSpecV6Gpi = LPRSVP_FILTERSPEC_V6_GPI;

(*
 * FILTERSPEC TYPES used in making reservations.
 *)

const
  FILTERSPECV4 = 1;
  {$EXTERNALSYM FILTERSPECV4}
  FILTERSPECV6 = 2;
  {$EXTERNALSYM FILTERSPECV6}
  FILTERSPECV6_FLOW = 3;
  {$EXTERNALSYM FILTERSPECV6_FLOW}
  FILTERSPECV4_GPI = 4;
  {$EXTERNALSYM FILTERSPECV4_GPI}
  FILTERSPECV6_GPI = 5;
  {$EXTERNALSYM FILTERSPECV6_GPI}
  FILTERSPEC_END = 6;
  {$EXTERNALSYM FILTERSPEC_END}

type
  FilterType = DWORD;
  {$EXTERNALSYM FilterType}

type
  LPRSVP_FILTERSPEC = ^RSVP_FILTERSPEC;
  {$EXTERNALSYM LPRSVP_FILTERSPEC}
  _RSVP_FILTERSPEC = record
    Type_: FilterType;
    case Integer of
      0: (FilterSpecV4: RSVP_FILTERSPEC_V4);
      1: (FilterSpecV6: RSVP_FILTERSPEC_V6);
      2: (FilterSpecV6Flow: RSVP_FILTERSPEC_V6_FLOW);
      3: (FilterSpecV4Gpi: RSVP_FILTERSPEC_V4_GPI);
      4: (FilterSpecV6Gpi: RSVP_FILTERSPEC_V6_GPI);
  end;
  {$EXTERNALSYM _RSVP_FILTERSPEC}
  RSVP_FILTERSPEC = _RSVP_FILTERSPEC;
  {$EXTERNALSYM RSVP_FILTERSPEC}
  TRsvpFilterSpec = RSVP_FILTERSPEC;
  PRsvpFilterSpec = LPRSVP_FILTERSPEC;

(*
 * FLOWDESCRIPTOR Structure used for specifying one or more
 * Filters per Flowspec.
 *)

  LPFLOWDESCRIPTOR = ^FLOWDESCRIPTOR;
  {$EXTERNALSYM LPFLOWDESCRIPTOR}
  _FLOWDESCRIPTOR = record
    FlowSpec: FLOWSPEC;
    NumFilters: ULONG;
    FilterList: LPRSVP_FILTERSPEC;
  end;
  {$EXTERNALSYM _FLOWDESCRIPTOR}
  FLOWDESCRIPTOR = _FLOWDESCRIPTOR;
  {$EXTERNALSYM FLOWDESCRIPTOR}
  TFlowDescriptor = FLOWDESCRIPTOR;
  PFlowDescriptor = LPFLOWDESCRIPTOR;

(*
 * RSVP_POLICY contains undefined policy data.  RSVP transports this
 * data on behalf of the Policy Control component.
 *)

  LPRSVP_POLICY = ^RSVP_POLICY;
  {$EXTERNALSYM LPRSVP_POLICY}
  _RSVP_POLICY = record
    Len: USHORT;
    Type_: USHORT;
    Info: array [0..4 - 1] of UCHAR;
  end;
  {$EXTERNALSYM _RSVP_POLICY}
  RSVP_POLICY = _RSVP_POLICY;
  {$EXTERNALSYM RSVP_POLICY}
  TRsvpPolicy = RSVP_POLICY;
  PRsvpPolicy = LPRSVP_POLICY;

  LPCRSVP_POLICY = ^RSVP_POLICY;
  {$EXTERNALSYM LPCRSVP_POLICY}

const
  RSVP_POLICY_HDR_LEN = SizeOf(USHORT) + SizeOf(USHORT);
  {$EXTERNALSYM RSVP_POLICY_HDR_LEN}

(*
 * RSVP_POLICY_INFO contains undefined policy element(s) retrieved from RSVP.  
 *)

type
  LPRSVP_POLICY_INFO = ^RSVP_POLICY_INFO;
  {$EXTERNALSYM LPRSVP_POLICY_INFO}
  _RSVP_POLICY_INFO = record
    ObjectHdr: QOS_OBJECT_HDR;
    NumPolicyElement: ULONG; // count of the number of policy elements
    PolicyElement: array [0..0] of RSVP_POLICY; // a list of the policy elements retrieved
  end;
  {$EXTERNALSYM _RSVP_POLICY_INFO}
  RSVP_POLICY_INFO = _RSVP_POLICY_INFO;
  {$EXTERNALSYM RSVP_POLICY_INFO}
  TRsvpPolicyInfo = RSVP_POLICY_INFO;
  PRsvpPolicyInfo = LPRSVP_POLICY_INFO;


(*
 * RSVP_RESERVE_INFO Structure used for storing RSVP specific
 * information for fine tuning interaction via the Winsock2
 * Generic QoS API via the provider specific buffer. This structure
 * includes the QOS_OBJECT_HDR structure directly
 *)

  LPRSVP_RESERVE_INFO = ^RSVP_RESERVE_INFO;
  {$EXTERNALSYM LPRSVP_RESERVE_INFO}
  _RSVP_RESERVE_INFO = record
    ObjectHdr: QOS_OBJECT_HDR; // type and length of this object
    Style: ULONG; // RSVP Style (FF,WF,SE)
    ConfirmRequest: ULONG; // Non Zero for Confirm Request (receive only)
    PolicyElementList: LPRSVP_POLICY_INFO; // Points to the set of policy elements
    NumFlowDesc: ULONG; // Number of FlowDesc
    FlowDescList: LPFLOWDESCRIPTOR; // Points to the FlowDesc list
  end;
  {$EXTERNALSYM _RSVP_RESERVE_INFO}
  RSVP_RESERVE_INFO = _RSVP_RESERVE_INFO;
  {$EXTERNALSYM RSVP_RESERVE_INFO}
  TRsvpReserveInfo = RSVP_RESERVE_INFO;
  PRsvpReserveInfo = LPRSVP_RESERVE_INFO;

  LPCRSVP_RESERVE_INFO = ^RSVP_RESERVE_INFO;
  {$EXTERNALSYM LPCRSVP_RESERVE_INFO}

(*
 * definitions for the ulStyle in the previous structure
 *)

const
  RSVP_DEFAULT_STYLE         = $00000000;
  {$EXTERNALSYM RSVP_DEFAULT_STYLE}
  RSVP_WILDCARD_STYLE        = $00000001;
  {$EXTERNALSYM RSVP_WILDCARD_STYLE}
  RSVP_FIXED_FILTER_STYLE    = $00000002;
  {$EXTERNALSYM RSVP_FIXED_FILTER_STYLE}
  RSVP_SHARED_EXPLICIT_STYLE = $00000003;
  {$EXTERNALSYM RSVP_SHARED_EXPLICIT_STYLE}

(*
 * RSVP_STATUS_INFO Structure used for storing RSVP specific
 * error of status indications.  This also serves as a header
 * for additional objects in the provider specific buffer when
 * interacting via Winsock2 Generic QoS API. This structure includes
 * the QOS_OBJECT_COUNT and QOS_OBJECT_HDR structures directly It is
 * expected to be the first structure in the provider specific structure
 * since it includes the QOS_OBJECT_COUNT
 *)


type
  LPRSVP_STATUS_INFO = ^RSVP_STATUS_INFO;
  {$EXTERNALSYM LPRSVP_STATUS_INFO}
  _RSVP_STATUS_INFO = record

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -