JwaLpmApi.pas
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:49k
源码类别:

Windows编程

开发平台:

Delphi

  1. {******************************************************************************}
  2. {                                                                       }
  3. { Winsock2 RSVP/LPM API interface Unit for Object Pascal                       }
  4. {                                                                       }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
  6. { Corporation. All Rights Reserved.                                            }
  7. {                 }
  8. { The original file is: lpmapi.h, released June 2000. The original Pascal      }
  9. { code is: LpmApi.pas, released December 2000. The initial developer of the    }
  10. { Pascal code is Marcel van Brakel (brakelm@chello.nl).                        }
  11. {                                                                              }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
  13. { Marcel van Brakel. All Rights Reserved.                                      }
  14. {                 }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
  16. {                }
  17. { You may retrieve the latest version of this file at the Project JEDI home    }
  18. { page, located at http://delphi-jedi.org or my personal homepage located at   }
  19. { http://members.chello.nl/m.vanbrakel2                                        }
  20. {                }
  21. { The contents of this file are used with permission, subject to the Mozilla   }
  22. { Public License Version 1.1 (the "License"); you may not use this file except }
  23. { in compliance with the License. You may obtain a copy of the License at      }
  24. { http://www.mozilla.org/MPL/MPL-1.1.html                                      }
  25. {                                                                              }
  26. { Software distributed under the License is distributed on an "AS IS" basis,   }
  27. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  28. { the specific language governing rights and limitations under the License.    }
  29. {                                                                              }
  30. { Alternatively, the contents of this file may be used under the terms of the  }
  31. { GNU Lesser General Public License (the  "LGPL License"), in which case the   }
  32. { provisions of the LGPL License are applicable instead of those above.        }
  33. { If you wish to allow use of your version of this file only under the terms   }
  34. { of the LGPL License and not to allow others to use your version of this file }
  35. { under the MPL, indicate your decision by deleting  the provisions above and  }
  36. { replace  them with the notice and other provisions required by the LGPL      }
  37. { License.  If you do not delete the provisions above, a recipient may use     }
  38. { your version of this file under either the MPL or the LGPL License.          }
  39. {                 }
  40. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  41. {                 }
  42. {******************************************************************************}
  43. unit JwaLpmApi;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include "lpmapi.h"'}
  47. {$HPPEMIT ''}
  48. {$I WINDEFINES.INC}
  49. interface
  50. uses
  51.   JwaWinSock2, JwaWinType;
  52. type
  53.   FLOAT = Single;
  54.   {$NODEFINE FLOAT}
  55. (****************************************************************************
  56.             RSVPD -- ReSerVation Protocol Daemon
  57.                 USC Information Sciences Institute
  58.                 Marina del Rey, California
  59.         Original Version: Shai Herzog, Nov. 1993.
  60.         Current Version:  Steven Berson & Bob Braden, may 1996.
  61.   Copyright (c) 1996 by the University of Southern California
  62.   All rights reserved.
  63.   Permission to use, copy, modify, and distribute this software and its
  64.   documentation in source and binary forms for any purpose and without
  65.   fee is hereby granted, provided that both the above copyright notice
  66.   and this permission notice appear in all copies, and that any
  67.   documentation, advertising materials, and other materials related to
  68.   such distribution and use acknowledge that the software was developed
  69.   in part by the University of Southern California, Information
  70.   Sciences Institute.  The name of the University may not be used to
  71.   endorse or promote products derived from this software without
  72.   specific prior written permission.
  73.   THE UNIVERSITY OF SOUTHERN CALIFORNIA makes no representations about
  74.   the suitability of this software for any purpose.  THIS SOFTWARE IS
  75.   PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
  76.   INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  77.   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  78.   Other copyrights might apply to parts of this software and are so
  79.   noted when applicable.
  80. ********************************************************************)
  81. (*
  82.  *  Standard format of an RSVP object header
  83.  *)
  84. type
  85.   RsvpObjHdr = record
  86.     obj_length: USHORT; (* Length in bytes *)
  87.     obj_class: UCHAR;   (* Class (values defined below) *)
  88.     obj_ctype: UCHAR;   (* C-Type (values defined below) *)
  89.   end;
  90.   {$EXTERNALSYM RsvpObjHdr}
  91.   TRsvpObjHdr = RsvpObjHdr;
  92.   PRsvpObjHdr = ^RsvpObjHdr;
  93.   PPRsvpObjHdr = ^PRsvpObjHdr;
  94. function ObjLength(const x: TRsvpObjHdr): USHORT;
  95. {$EXTERNALSYM ObjLength}
  96. function ObjCType(const x: TRsvpObjHdr): UCHAR;
  97. {$EXTERNALSYM ObjCType}
  98. function ObjClass(const x: TRsvpObjHdr): UCHAR;
  99. {$EXTERNALSYM ObjClass}
  100. function ObjData(const x: TRsvpObjHdr): Pointer;
  101. {$EXTERNALSYM ObjData}
  102. (*
  103.  *  Define object classes: Class-Num values
  104.  *)
  105. const
  106.   class_NULL            = 0;
  107.   {$EXTERNALSYM class_NULL}
  108.   class_SESSION         = 1;
  109.   {$EXTERNALSYM class_SESSION}
  110.   class_SESSION_GROUP   = 2;
  111.   {$EXTERNALSYM class_SESSION_GROUP}
  112.   class_RSVP_HOP        = 3;
  113.   {$EXTERNALSYM class_RSVP_HOP}
  114.   class_INTEGRITY       = 4;
  115.   {$EXTERNALSYM class_INTEGRITY}
  116.   class_TIME_VALUES     = 5;
  117.   {$EXTERNALSYM class_TIME_VALUES}
  118.   class_ERROR_SPEC      = 6;
  119.   {$EXTERNALSYM class_ERROR_SPEC}
  120.   class_SCOPE           = 7;
  121.   {$EXTERNALSYM class_SCOPE}
  122.   class_STYLE           = 8;
  123.   {$EXTERNALSYM class_STYLE}
  124.   class_FLOWSPEC        = 9; // these two are the same
  125.   {$EXTERNALSYM class_FLOWSPEC}
  126.   class_IS_FLOWSPEC     = 9; // since we added IS in front of the name
  127.   {$EXTERNALSYM class_IS_FLOWSPEC}
  128.   class_FILTER_SPEC     = 10;
  129.   {$EXTERNALSYM class_FILTER_SPEC}
  130.   class_SENDER_TEMPLATE = 11;
  131.   {$EXTERNALSYM class_SENDER_TEMPLATE}
  132.   class_SENDER_TSPEC    = 12;
  133.   {$EXTERNALSYM class_SENDER_TSPEC}
  134.   class_ADSPEC          = 13;
  135.   {$EXTERNALSYM class_ADSPEC}
  136.   class_POLICY_DATA     = 14;
  137.   {$EXTERNALSYM class_POLICY_DATA}
  138.   class_CONFIRM         = 15;
  139.   {$EXTERNALSYM class_CONFIRM}
  140.   class_MAX             = 15;
  141.   {$EXTERNALSYM class_MAX}
  142. (*
  143.  *  RSVP SESSION object
  144.  *)
  145.   ctype_SESSION_ipv4    = 1;
  146.   {$EXTERNALSYM ctype_SESSION_ipv4}
  147.   ctype_SESSION_ipv4GPI = 3   (* IPSEC: Generalized Port Id *);
  148.   {$EXTERNALSYM ctype_SESSION_ipv4GPI}
  149.   SESSFLG_E_Police = $01    (* E_Police: Entry policing flag*);
  150.   {$EXTERNALSYM SESSFLG_E_Police}
  151. type
  152.   Session_IPv4 = record
  153.     sess_destaddr: IN_ADDR;  // DestAddress
  154.     sess_protid: UCHAR;    // Protocol Id
  155.     sess_flags: UCHAR;     // Use the flags defined above
  156.     sess_destport: USHORT;  // DestPort
  157.   end;
  158.   {$EXTERNALSYM Session_IPv4}
  159.   TSessionIPv4 = Session_IPv4;
  160.   PSessionIPv4 = ^Session_IPv4;
  161. (*    GPI versions have virtual dest port instead of dest port; this
  162.  *    changes the interpretation but not the format, so we do not
  163.  *    define new structs for GPI.
  164.  *)
  165.   RSVP_SESSION = record
  166.     sess_header: RsvpObjHdr;
  167.     case Integer of
  168.       0: (sess_ipv4: Session_IPv4);
  169.   end;
  170.   {$EXTERNALSYM RSVP_SESSION}
  171.   TRsvpSession = RSVP_SESSION;
  172.   PRsvpSession = ^RSVP_SESSION;  
  173. // Useful defines to access components of SESSION obect
  174. //#define Sess4Addr       sess_u.sess_ipv4.sess_destaddr
  175. //#define Sess4Port       sess_u.sess_ipv4.sess_destport
  176. //#define Sess4Protocol   sess_u.sess_ipv4.sess_protid
  177. //#define Sess4Flags      sess_u.sess_ipv4.sess_flags
  178. (*
  179.  *  RSVP HOP object
  180.  *)
  181. const
  182.   ctype_RSVP_HOP_ipv4 = 1;
  183.   {$EXTERNALSYM ctype_RSVP_HOP_ipv4}
  184. type
  185.   Rsvp_Hop_IPv4 = record
  186.     hop_ipaddr: IN_ADDR;   // Next/Previous Hop Address
  187.     hop_LIH: ULONG;        // Logical Interface Handle
  188.   end;
  189.   {$EXTERNALSYM Rsvp_Hop_IPv4}
  190.   TRsvpHopIPv4 = Rsvp_Hop_IPv4;
  191.   PRsvpHopIPv4 = ^Rsvp_Hop_IPv4;
  192.   RSVP_HOP = record
  193.     hop_header: RsvpObjHdr;
  194.     case Integer of
  195.       0: (hop_ipv4: Rsvp_Hop_IPv4);
  196.   end;
  197.   {$EXTERNALSYM RSVP_HOP}
  198.   TRsvpHop = RSVP_HOP;
  199.   PRsvpHop = ^RSVP_HOP;
  200. //#define Hop4LIH    hop_u.hop_ipv4.hop_LIH
  201. //#define Hop4Addr   hop_u.hop_ipv4.hop_ipaddr
  202. (*
  203.  *  RSVP STYLE object
  204.  *)
  205. //  Define values for option vector
  206. const
  207.   Opt_Share_mask = $00000018; // 2 bits: Sharing control
  208.   {$EXTERNALSYM Opt_Share_mask}
  209.   Opt_Distinct   = $00000008; // Distinct reservations
  210.   {$EXTERNALSYM Opt_Distinct}
  211.   Opt_Shared     = $00000010; // Shared reservations
  212.   {$EXTERNALSYM Opt_Shared}
  213.   Opt_SndSel_mask = $00000007; // 3 bits: Sender selection
  214.   {$EXTERNALSYM Opt_SndSel_mask}
  215.   Opt_Wildcard    = $00000001; // Wildcard scope
  216.   {$EXTERNALSYM Opt_Wildcard}
  217.   Opt_Explicit    = $00000002; // Explicit scope
  218.   {$EXTERNALSYM Opt_Explicit}
  219. function Style_is_Wildcard(p: DWORD): Boolean;
  220. {$EXTERNALSYM Style_is_Wildcard}
  221. function Style_is_Shared(p: DWORD): Boolean;
  222. {$EXTERNALSYM Style_is_Shared}
  223. //  Define style values
  224. const
  225.   STYLE_WF = Opt_Shared + Opt_Wildcard;
  226.   {$EXTERNALSYM STYLE_WF}
  227.   STYLE_FF = Opt_Distinct + Opt_Explicit;
  228.   {$EXTERNALSYM STYLE_FF}
  229.   STYLE_SE = Opt_Shared + Opt_Explicit;
  230.   {$EXTERNALSYM STYLE_SE}
  231.   ctype_STYLE = 1;
  232.   {$EXTERNALSYM ctype_STYLE}
  233. type
  234.   RESV_STYLE = record
  235.     style_header: RsvpObjHdr;
  236.     style_word: ULONG;
  237.   end;
  238.   {$EXTERNALSYM RESV_STYLE}
  239.   TResvStyle = RESV_STYLE;
  240.   PResvStyle = ^RESV_STYLE;
  241. (*
  242.  *  RSVP FILTER SPEC object
  243.  *)
  244. const
  245.   ctype_FILTER_SPEC_ipv4    = 1; // IPv4 FILTER_SPEC
  246.   {$EXTERNALSYM ctype_FILTER_SPEC_ipv4}
  247.   ctype_FILTER_SPEC_ipv4GPI = 4; // IPv4/GPI FILTER_SPEC
  248.   {$EXTERNALSYM ctype_FILTER_SPEC_ipv4GPI}
  249. type
  250.   Filter_Spec_IPv4 = record
  251.     filt_ipaddr: IN_ADDR;    // IPv4 SrcAddress
  252.     filt_unused: USHORT;
  253.     filt_port: USHORT;       // SrcPort
  254.   end;
  255.   {$EXTERNALSYM Filter_Spec_IPv4}
  256.   TFilterSpecIPv4 = Filter_Spec_IPv4;
  257.   PFilterSpecIPv4 = ^Filter_Spec_IPv4;
  258.   Filter_Spec_IPv4GPI = record
  259.     filt_ipaddr: IN_ADDR;    // IPv4 SrcAddress
  260.     filt_gpi: ULONG;         // Generalized Port Id
  261.   end;
  262.   {$EXTERNALSYM Filter_Spec_IPv4GPI}
  263.   TFilterSpecIPv4GPI = Filter_Spec_IPv4GPI;
  264.   PFilterSpecIPv4GPI = ^Filter_Spec_IPv4GPI;
  265.   FILTER_SPEC = record
  266.     filt_header: RsvpObjHdr;
  267.     case Integer of
  268.       0: (filt_ipv4: Filter_Spec_IPv4);
  269.       1: (filt_ipv4gpi: Filter_Spec_IPv4GPI);
  270.   end;
  271.   {$EXTERNALSYM FILTER_SPEC}
  272.   TFilterSpec = FILTER_SPEC;
  273.   PFilterSpec = ^FILTER_SPEC;  
  274. //#define FilterSrcaddr   filt_u.filt_ipv4.filt_ipaddr
  275. //#define FilterSrcport   filt_u.filt_ipv4.filt_port
  276. (*
  277.  *  RSVP SENDER_TEMPLATE object
  278.  *)
  279. const
  280.   ctype_SENDER_TEMPLATE_ipv4    = 1; // IPv4 SENDER_TEMPLATE
  281.   {$EXTERNALSYM ctype_SENDER_TEMPLATE_ipv4}
  282.   ctype_SENDER_TEMPLATE_ipv4GPI = 4; // IPv4/GPI SENDER_TEMPLATE
  283.   {$EXTERNALSYM ctype_SENDER_TEMPLATE_ipv4GPI}
  284. type
  285.   SENDER_TEMPLATE = FILTER_SPEC;       // Identical to FILTER_SPEC
  286.   {$EXTERNALSYM SENDER_TEMPLATE}
  287.   TSenderTemplate = SENDER_TEMPLATE;
  288.   PSenderTemplate = ^SENDER_TEMPLATE;
  289. (*
  290.  *  RSVP SCOPE object class
  291.  *)
  292. const
  293.   ctype_SCOPE_list_ipv4 = 1;
  294.   {$EXTERNALSYM ctype_SCOPE_list_ipv4}
  295. type
  296.   Scope_list_ipv4 = record
  297.     scopl_ipaddr: array [0..0] of IN_ADDR;        // var-len list of IP sender addrs
  298.   end;
  299.   {$EXTERNALSYM Scope_list_ipv4}
  300.   TScopeListIPv4 = Scope_list_ipv4;
  301.   PScopeListIPv4 = ^Scope_list_ipv4;
  302.   RSVP_SCOPE = record
  303.     scopl_header: RsvpObjHdr;
  304.     case Integer of
  305.       0: (scopl_ipv4: Scope_list_ipv4);
  306.   end;
  307.   {$EXTERNALSYM RSVP_SCOPE}
  308.   TRsvpScope = RSVP_SCOPE;
  309.   PRsvpScope = ^RSVP_SCOPE;
  310. //#define Scope4Addr      scope_u.scopl_ipv4.scopl_ipaddr
  311. //#define ScopeCnt(scp)   ((ObjLength(scp)-sizeof(RsvpObjHdr))/sizeof(struct in_addr))
  312. //#define ScopeLen(cnt)   (cnt*sizeof(struct in_addr)+sizeof(RsvpObjHdr))
  313. (*
  314.  *  ERROR_SPEC object class
  315.  *)
  316. const
  317.   ctype_ERROR_SPEC_ipv4 = 1;
  318.   {$EXTERNALSYM ctype_ERROR_SPEC_ipv4}
  319.   ERROR_SPECF_InPlace = $01;    (*   Left resv in place     *)
  320.   {$EXTERNALSYM ERROR_SPECF_InPlace}
  321.   ERROR_SPECF_NotGuilty = $02;    (*   This rcvr not guilty   *)
  322.   {$EXTERNALSYM ERROR_SPECF_NotGuilty}
  323.   ERR_FORWARD_OK  = $8000;      (* Flag: OK to forward state *)
  324.   {$EXTERNALSYM ERR_FORWARD_OK}
  325. function Error_Usage(x: DWORD): DWORD;
  326. {$EXTERNALSYM Error_Usage}
  327. const
  328.   ERR_Usage_globl = $00;        (* Globally-defined sub-code *)
  329.   {$EXTERNALSYM ERR_Usage_globl}
  330.   ERR_Usage_local = $10;        (* Locally-defined sub-code *)
  331.   {$EXTERNALSYM ERR_Usage_local}
  332.   ERR_Usage_serv  = $11;        (* Service-defined sub-code *)
  333.   {$EXTERNALSYM ERR_Usage_serv}
  334.   ERR_global_mask = $0fff;      (* Sub-code bits in Error Val *)
  335.   {$EXTERNALSYM ERR_global_mask}
  336. type
  337.   Error_Spec_IPv4 = record
  338.     errs_errnode: in_addr;   (* Error Node Address       *)
  339.     errs_flags: u_char;      (* Flags:           *)
  340.     errs_code: UCHAR;        (* Error Code (def'd below) *)
  341.     errs_value: USHORT;      (* Error Value      *)
  342.   end;
  343.   {$EXTERNALSYM Error_Spec_IPv4}
  344.   TErrorSpecIPv4 = Error_Spec_IPv4;
  345.   PErrorSpecIPv4 = ^Error_Spec_IPv4;
  346. type
  347.   ERROR_SPEC = record
  348.     errs_header: RsvpObjHdr;
  349.     case Integer of
  350.       0: (errs_ipv4: Error_Spec_IPv4);
  351.   end;
  352.   {$EXTERNALSYM ERROR_SPEC}
  353.   TErrorSpec = ERROR_SPEC;
  354.   PErrorSpec = ^ERROR_SPEC;
  355. //#define errspec4_enode  errs_u.errs_ipv4.errs_errnode
  356. //#define errspec4_code   errs_u.errs_ipv4.errs_code
  357. //#define errspec4_value  errs_u.errs_ipv4.errs_value
  358. //#define errspec4_flags  errs_u.errs_ipv4.errs_flags
  359. (*
  360.  *  POLICY_DATA object class
  361.  *
  362.  *      Contents are Opaque RSVP/SBM
  363.  *)
  364. const
  365.   ctype_POLICY_DATA = 1;
  366.   {$EXTERNALSYM ctype_POLICY_DATA}
  367. type
  368.   POLICY_DATA = record
  369.     PolicyObjHdr: RsvpObjHdr;
  370.     usPeOffset: USHORT;     // Offset to the start of Policy Elements from the begining of Policy Data
  371.     usReserved: USHORT;
  372.   end;
  373.   {$EXTERNALSYM POLICY_DATA}
  374.   TPolicyData = POLICY_DATA;
  375.   PPolicyData = ^POLICY_DATA;
  376. const
  377.   PD_HDR_LEN  = SizeOf(POLICY_DATA);
  378.   {$EXTERNALSYM PD_HDR_LEN}
  379. type
  380.   POLICY_ELEMENT = record
  381.     usPeLength: USHORT;     // Policy Element length
  382.     usPeType: USHORT;       // Policy Element type
  383.     ucPeData: array [0..3] of UCHAR;    // Just a place holder to the start of Policy Element data
  384.   end;
  385.   {$EXTERNALSYM POLICY_ELEMENT}
  386.   TPolicyElement = POLICY_ELEMENT;
  387.   PPolicyElement = ^POLICY_ELEMENT;
  388. const
  389.   PE_HDR_LEN = 2 * SizeOf(USHORT);
  390.   {$EXTERNALSYM PE_HDR_LEN}
  391. (**************************************************************************
  392.  *
  393.  *  Int-Serv Data Structures
  394.  *
  395.  **************************************************************************)
  396. (*
  397.  *  Service numbers
  398.  *)
  399. const
  400.   GENERAL_INFO          = 1;
  401.   {$EXTERNALSYM GENERAL_INFO}
  402.   GUARANTEED_SERV       = 2;
  403.   {$EXTERNALSYM GUARANTEED_SERV}
  404.   PREDICTIVE_SERV       = 3;
  405.   {$EXTERNALSYM PREDICTIVE_SERV}
  406.   CONTROLLED_DELAY_SERV = 4;
  407.   {$EXTERNALSYM CONTROLLED_DELAY_SERV}
  408.   CONTROLLED_LOAD_SERV  = 5;
  409.   {$EXTERNALSYM CONTROLLED_LOAD_SERV}
  410.   QUALITATIVE_SERV      = 6;
  411.   {$EXTERNALSYM QUALITATIVE_SERV}
  412. (*
  413.  *  Well-known parameter IDs
  414.  *)
  415. const
  416.   IS_WKP_HOP_CNT =        4;
  417.   {$EXTERNALSYM IS_WKP_HOP_CNT}
  418.   IS_WKP_PATH_BW =        6;
  419.   {$EXTERNALSYM IS_WKP_PATH_BW}
  420.   IS_WKP_MIN_LATENCY =    8;
  421.   {$EXTERNALSYM IS_WKP_MIN_LATENCY}
  422.   IS_WKP_COMPOSED_MTU =   10;
  423.   {$EXTERNALSYM IS_WKP_COMPOSED_MTU}
  424.   IS_WKP_TB_TSPEC =       127; (* Token-bucket TSPEC parm *)
  425.   {$EXTERNALSYM IS_WKP_TB_TSPEC}
  426.   IS_WKP_Q_TSPEC =        128;
  427.   {$EXTERNALSYM IS_WKP_Q_TSPEC}
  428. type
  429.   int_serv_wkp = DWORD;
  430.   {$EXTERNALSYM int_serv_wkp}
  431.   TIntServWkp = int_serv_wkp;
  432. (*
  433.  *  Int-serv Main header
  434.  *)
  435.   IntServMainHdr = record
  436.     ismh_version: UCHAR;    // Version
  437.     ismh_unused: UCHAR;
  438.     ismh_len32b: USHORT;    // # 32-bit words excluding this hdr
  439.   end;
  440.   {$EXTERNALSYM IntServMainHdr}
  441.   TIntServMainHdr = IntServMainHdr;
  442.   PIntServMainHdr = ^IntServMainHdr;
  443. const
  444.   INTSERV_VERS_MASK   = $f0;
  445.   {$EXTERNALSYM INTSERV_VERS_MASK}
  446.   INTSERV_VERSION0    = 0;
  447.   {$EXTERNALSYM INTSERV_VERSION0}
  448. function Intserv_Version(x: DWORD): DWORD;
  449. {$EXTERNALSYM Intserv_Version}
  450. function Intserv_Version_OK(const x: TIntServMainHdr): Boolean;
  451. {$EXTERNALSYM Intserv_Version_OK}
  452. // Convert ishm_length to equivalent RSVP object size, for checking
  453. function Intserv_Obj_size(const x: TIntServMainHdr): DWORD;
  454. {$EXTERNALSYM Intserv_Obj_size}
  455. (*
  456.  *  Int-serv Service Element Header
  457.  *)
  458. // Flag: Break bit
  459. const
  460.   ISSH_BREAK_BIT = $80;
  461.   {$EXTERNALSYM ISSH_BREAK_BIT}
  462. type
  463.   IntServServiceHdr = record
  464.     issh_service: UCHAR;   // Service number
  465.     issh_flags: UCHAR;     // Flag byte
  466.     issh_len32b: USHORT;    // #32-bit words excluding this hdr
  467.   end;
  468.   {$EXTERNALSYM IntServServiceHdr}
  469.   TIntServServiceHdr = IntServServiceHdr;
  470.   PIntServServiceHdr = ^IntServServiceHdr;
  471. function Issh_len32b(const p: TIntServServiceHdr): USHORT;
  472. {$EXTERNALSYM Issh_len32b}
  473. (*
  474.  *  Int-serv Parameter Element Header
  475.  *)
  476. const
  477.   ISPH_FLG_INV = $80; // Flag: Invalid
  478.   {$EXTERNALSYM ISPH_FLG_INV}
  479. type
  480.   IntServParmHdr = record
  481.     isph_parm_num: UCHAR;  // Parameter number
  482.     isph_flags: UCHAR;     // Flags
  483.     isph_len32b: USHORT;    // #32-bit words excluding this hdr
  484.   end;
  485.   {$EXTERNALSYM IntServParmHdr}
  486.   TIntServParmHdr = IntServParmHdr;
  487.   PIntServParmHdr = ^IntServParmHdr;
  488. {
  489. function Next_Main_Hdr(const p: TIntServMainHdr): PIntServMainHdr;
  490. begin
  491.    TODO (IntServMainHdr *)((ULONG *)(p)+1+(p)->ismh_len32b)
  492. end;
  493. function Next_Serv_Hdr(const p: TIntServMainHdr): ULONG;
  494. begin
  495.    TODO (IntServServiceHdr *)((ULONG *)(p)+1+(p)->issh_len32b)
  496. end;
  497. function Next_Parm_Hdr(const p: TIntServParmHdr): ULONG;
  498. begin
  499.    TODO (IntServParmHdr *)((ULONG *)(p)+1+(p)->isph_len32b)
  500. end;
  501. }
  502. (*
  503.  *  Generic Tspec Parameters
  504.  *)
  505. type
  506.   GenTspecParms = record
  507.     TB_Tspec_r: FLOAT;     // Token bucket rate (B/sec)
  508.     TB_Tspec_b: FLOAT;     // Token bucket depth (B)
  509.     TB_Tspec_p: FLOAT;     // Peak data rate (B/sec)
  510.     TB_Tspec_m: ULONG;     // Min Policed Unit (B)
  511.     TB_Tspec_M_: ULONG;     // Max pkt size (B)
  512.   end;
  513.   {$EXTERNALSYM GenTspecParms}
  514.   TGenTspecParms = GenTspecParms;
  515.   PGenTspecParms = ^GenTspecParms;
  516. (*
  517.  *  Generic Tspec
  518.  *)
  519.   GenTspec = record
  520.     gen_Tspec_serv_hdr: IntServServiceHdr; // (GENERAL_INFO, length)
  521.     gen_Tspec_parm_hdr: IntServParmHdr; // (IS_WKP_TB_TSPEC)
  522.     gen_Tspec_parms: GenTspecParms;
  523.   end;
  524.   {$EXTERNALSYM GenTspec}
  525.   TGenTspec = GenTspec;
  526.   PGenTspec = ^GenTspec;
  527. //#define gtspec_r        gen_Tspec_parms.TB_Tspec_r
  528. //#define gtspec_b        gen_Tspec_parms.TB_Tspec_b
  529. //#define gtspec_m        gen_Tspec_parms.TB_Tspec_m
  530. //#define gtspec_M        gen_Tspec_parms.TB_Tspec_M
  531. //#define gtspec_p        gen_Tspec_parms.TB_Tspec_p
  532. //#define gtspec_parmno   gen_Tspec_parm_hdr.isph_parm_num
  533. //#define gtspec_flags    gen_Tspec_parm_hdr.isph_flags
  534. //#define gtspec_len      (sizeof(GenTspec) - sizeof(IntServServiceHdr))
  535. (* contents of qualitative tspec *)
  536. type
  537.   QualTspecParms = record
  538.     TB_Tspec_M: ULONG;     // Max pkt size (M)
  539.   end;
  540.   {$EXTERNALSYM QualTspecParms}
  541.   TQualTspecParms = QualTspecParms;
  542.   PQualTspecParms = ^QualTspecParms;
  543.   QualTspec = record
  544.     qual_Tspec_serv_hdr: IntServServiceHdr; // (QUALITATIVE_SERV, length)
  545.     qual_Tspec_parm_hdr: IntServParmHdr; // (IS_WKP_Q_TSPEC)
  546.     qual_Tspec_parms: QualTspecParms;
  547.   end;
  548.   {$EXTERNALSYM QualTspec}
  549.   TQualTspec = QualTspec;
  550.   PQualTspec = ^QualTspec;
  551.   QualAppFlowSpec = record
  552.     Q_spec_serv_hdr: IntServServiceHdr;    // (QUALITATIVE_SERV,0,len)
  553.     Q_spec_parm_hdr: IntServParmHdr;    // (IS_WKP_Q_TSPEC)
  554.     Q_spec_parms: QualTspecParms;       // QUALITATIVE Tspec parameters
  555.   end;
  556.   {$EXTERNALSYM QualAppFlowSpec}
  557.   TQualAppFlowSpec = QualAppFlowSpec;
  558.   PQualAppFlowSpec = ^QualAppFlowSpec;
  559. //#define QAspec_M        Q_spec_parms.TB_Tspec_M
  560. (*
  561.  *  Contents of int-serv Tspec
  562.  *)
  563.   IntServTspecBody = record
  564.     st_mh: IntServMainHdr;
  565.     case Integer of
  566.       0: (gen_stspec: GenTspec); // Generic Tspec
  567.       1: (qual_stspec: QualTspec);
  568.   end;
  569.   {$EXTERNALSYM IntServTspecBody}
  570.   TIntServTspecBody = IntServTspecBody;
  571.   PIntServTspecBody = ^IntServTspecBody;
  572. (*
  573.  *  SENDER_TSPEC class object
  574.  *)
  575. const
  576.   ctype_SENDER_TSPEC = 2;
  577.   {$EXTERNALSYM ctype_SENDER_TSPEC}
  578. type
  579.   SENDER_TSPEC = record
  580.     stspec_header: RsvpObjHdr;
  581.     stspec_body: IntServTspecBody;
  582.   end;
  583.   {$EXTERNALSYM SENDER_TSPEC}
  584.   TSenderTSpec = SENDER_TSPEC;
  585.   PSenderTSpec = ^SENDER_TSPEC;
  586. (*
  587.  *  Controlled-Load Flowspec
  588.  *)
  589.   CtrlLoadFlowspec = record
  590.     CL_spec_serv_hdr: IntServServiceHdr;    // (CONTROLLED_LOAD_SERV,0,len)
  591.     CL_spec_parm_hdr: IntServParmHdr;    // (IS_WKP_TB_TSPEC)
  592.     CL_spec_parms: GenTspecParms;       // GENERIC Tspec parameters
  593.   end;
  594.   {$EXTERNALSYM CtrlLoadFlowspec}
  595.   TCtrlLoadFlowspec = CtrlLoadFlowspec;
  596.   PCtrlLoadFlowspec = ^CtrlLoadFlowspec;
  597. //#define CLspec_r        CL_spec_parms.TB_Tspec_r
  598. //#define CLspec_b        CL_spec_parms.TB_Tspec_b
  599. //#define CLspec_p        CL_spec_parms.TB_Tspec_p
  600. //#define CLspec_m        CL_spec_parms.TB_Tspec_m
  601. //#define CLspec_M        CL_spec_parms.TB_Tspec_M
  602. //#define CLspec_parmno   CL_spec_parm_hdr.isph_parm_num
  603. //#define CLspec_flags    CL_spec_parm_hdr.isph_flags
  604. //#define CLspec_len32b   CL_spec_parm_hdr.isph_len32b
  605. //#define CLspec_len      (sizeof(CtrlLoadFlowspec) - sizeof(IntServServiceHdr))
  606. (*  Service-specific Parameter IDs
  607.  *)
  608. const
  609.   IS_GUAR_RSPEC     = 130;
  610.   {$EXTERNALSYM IS_GUAR_RSPEC}
  611.   GUAR_ADSPARM_C    = 131;
  612.   {$EXTERNALSYM GUAR_ADSPARM_C}
  613.   GUAR_ADSPARM_D    = 132;
  614.   {$EXTERNALSYM GUAR_ADSPARM_D}
  615.   GUAR_ADSPARM_Ctot = 133;
  616.   {$EXTERNALSYM GUAR_ADSPARM_Ctot}
  617.   GUAR_ADSPARM_Dtot = 134;
  618.   {$EXTERNALSYM GUAR_ADSPARM_Dtot}
  619.   GUAR_ADSPARM_Csum = 135;
  620.   {$EXTERNALSYM GUAR_ADSPARM_Csum}
  621.   GUAR_ADSPARM_Dsum = 136;
  622.   {$EXTERNALSYM GUAR_ADSPARM_Dsum}
  623. (*
  624.  *  Guaranteed Rspec parameters
  625.  *)
  626. type
  627.   GuarRspec = record
  628.     Guar_R: FLOAT;         //  Guaranteed Rate B/s
  629.     Guar_S: ULONG;         //  Slack term secs
  630.   end;
  631.   {$EXTERNALSYM GuarRspec}
  632.   TGuarRspec = GuarRspec;
  633.   PGuarRspec = ^GuarRspec;
  634. (*
  635.  *  Guaranteed Flowspec
  636.  *)
  637.   GuarFlowSpec = record
  638.     Guar_serv_hdr: IntServServiceHdr;      // (GUARANTEED, 0, length)
  639.     Guar_Tspec_hdr: IntServParmHdr;     // (IS_WKP_TB_TSPEC,)
  640.     Guar_Tspec_parms: GenTspecParms;   // GENERIC Tspec parms
  641.     Guar_Rspec_hdr: IntServParmHdr;     // (IS_GUAR_RSPEC)
  642.     Guar_Rspec: GuarRspec;         // Guaranteed rate (B/sec)
  643.   end;
  644.   {$EXTERNALSYM GuarFlowSpec}
  645.   TGuarFlowSpec = GuarFlowSpec;
  646.   PGuarFlowSpec = ^GuarFlowSpec;
  647. //#define Gspec_r         Guar_Tspec_parms.TB_Tspec_r
  648. //#define Gspec_b         Guar_Tspec_parms.TB_Tspec_b
  649. //#define Gspec_p         Guar_Tspec_parms.TB_Tspec_p
  650. //#define Gspec_m         Guar_Tspec_parms.TB_Tspec_m
  651. //#define Gspec_M         Guar_Tspec_parms.TB_Tspec_M
  652. //#define Gspec_R         Guar_Rspec.Guar_R
  653. //#define Gspec_S         Guar_Rspec.Guar_S
  654. //#define Gspec_T_parmno  Guar_Tspec_hdr.isph_parm_num
  655. //#define Gspec_T_flags   Guar_Tspec_hdr.isph_flags
  656. //#define Gspec_R_parmno  Guar_Rspec_hdr.isph_parm_num
  657. //#define Gspec_R_flags   Guar_Rspec_hdr.isph_flags
  658. //#define Gspec_len       (sizeof(GuarFlowSpec) - sizeof(IntServServiceHdr))
  659. (*
  660.  *  Contents of int-serv flowspec
  661.  *)
  662. type
  663.   IntServFlowSpec = record
  664.     spec_mh: IntServMainHdr;
  665.     case Integer of
  666.         0: (CL_spec: CtrlLoadFlowspec);   // Controlled-Load service
  667.         1: (G_spec: GuarFlowSpec);    // Guaranteed service
  668.         2: (Q_spec: QualAppFlowSpec);
  669.   end;
  670.   {$EXTERNALSYM IntServFlowSpec}
  671.   TIntServFlowSpec = IntServFlowSpec;
  672.   PIntServFlowSpec = ^IntServFlowSpec;
  673. //#define ISmh_len32b     spec_mh.ismh_len32b
  674. //#define ISmh_version    spec_mh.ismh_version
  675. //#define ISmh_unused     spec_mh.ismh_unused
  676. (*
  677.  *  Int-Serv FLOWSPEC object
  678.  *)
  679. const
  680.   ctype_FLOWSPEC_Intserv0 = 2; // The int-serv flowspec (v.0)
  681.   {$EXTERNALSYM ctype_FLOWSPEC_Intserv0}
  682. type
  683.   IS_FLOWSPEC = record
  684.     flow_header: RsvpObjHdr;
  685.     flow_body: IntServFlowSpec;
  686.   end;
  687.   {$EXTERNALSYM IS_FLOWSPEC}
  688.   TIsFlowSpec = IS_FLOWSPEC;
  689.   PIsFlowSpec = ^IS_FLOWSPEC;
  690. (*
  691.  *  FLOW DESCRIPTOR
  692.  *)
  693.   FLOW_DESC = record
  694.     u1: record
  695.     case Integer of
  696.       0: (stspec: ^SENDER_TSPEC);
  697.       1: (isflow: ^IS_FLOWSPEC);
  698.     end;
  699.     u2: record
  700.     case Integer of
  701.       0: (stemp: ^SENDER_TEMPLATE);
  702.       1: (fspec: ^FILTER_SPEC);
  703.     end;
  704.   end;
  705.   {$EXTERNALSYM FLOW_DESC}
  706.   TFlowDesc = FLOW_DESC;
  707.   PFlowDesc = ^FLOW_DESC;
  708. //#define FdSenderTspec       u1.stspec
  709. //#define FdIsFlowSpec        u1.isflow
  710. //#define FdSenderTemplate    u2.stemp
  711. //#define FdFilterSpec        u2.fspec
  712. (*
  713.  *  ADSPEC class object
  714.  *
  715.  *      Opaque to RSVP -- Contents defined in rapi_lib.h
  716.  *)
  717. const
  718.   ctype_ADSPEC_INTSERV = 2;
  719.   {$EXTERNALSYM ctype_ADSPEC_INTSERV}
  720. (*
  721.  *  Guaranteed service Adspec parameters -- fixed part
  722.  *)
  723. type
  724.   Gads_parms_t = record
  725.     Gads_serv_hdr: IntServServiceHdr;  // GUARANTEED, x, len
  726.     Gads_Ctot_hdr: IntServParmHdr;  // GUAR_ADSPARM_Ctot
  727.     Gads_Ctot: ULONG;
  728.     Gads_Dtot_hdr: IntServParmHdr;  // (GUAR_ADSPARM_Dtot
  729.     Gads_Dtot: ULONG;
  730.     Gads_Csum_hdr: IntServParmHdr;  // GUAR_ADSPARM_Csum
  731.     Gads_Csum: ULONG;
  732.     Gads_Dsum_hdr: IntServParmHdr;  // GUAR_ADSPARM_Dsum
  733.     Gads_Dsum: ULONG;
  734.     (*
  735.      *  May be followed by override general param values
  736.      *)
  737.   end;
  738.   {$EXTERNALSYM Gads_parms_t}
  739.   TGadsParmsT = Gads_parms_t;
  740.   PGadsParmsT = ^Gads_parms_t;
  741. (*
  742.  *  General Path Characterization Parameters
  743.  *)
  744.  
  745.   GenAdspecParams = record
  746.     gen_parm_hdr: IntServServiceHdr;           // GENERAL_INFO, len
  747.     gen_parm_hopcnt_hdr: IntServParmHdr;    // (IS_WKP_HOP_CNT
  748.     gen_parm_hopcnt: ULONG;
  749.     gen_parm_pathbw_hdr: IntServParmHdr;    // IS_WKP_PATH_BW
  750.     gen_parm_path_bw: FLOAT;
  751.     gen_parm_minlat_hdr: IntServParmHdr;    // IS_WKP_MIN_LATENCY
  752.     gen_parm_min_latency: ULONG;
  753.     gen_parm_compmtu_hdr: IntServParmHdr;   // IS_WKP_COMPOSED_MTU
  754.     gen_parm_composed_MTU: ULONG;
  755.   end;
  756.   {$EXTERNALSYM GenAdspecParams}
  757.   TGenAdspecParams = GenAdspecParams;
  758.   PGenAdspecParams = ^GenAdspecParams;
  759. (*
  760.  *  Contents of (minimal) int-serv Adspec
  761.  *)
  762.   IS_ADSPEC_BODY = record
  763.     adspec_mh: IntServMainHdr;      // Main header
  764.     adspec_genparms: GenAdspecParams;// General char parm fragment
  765.     (*
  766.      *  Followed by variable-length fragments for some or all
  767.      *  services.  These can be minimal length fragments.
  768.      *)
  769.   end;
  770.   {$EXTERNALSYM IS_ADSPEC_BODY}
  771.   TIsAdSpecBody = IS_ADSPEC_BODY;
  772.   PIsAdSpecBody = ^IS_ADSPEC_BODY;  
  773. //const TODO Unknown Object_Header
  774. //  GEN_ADSPEC_LEN = SizeOf(Object_header) + SizeOf(IS_adsbody_t);
  775. //  {$EXTERNALSYM GEN_ADSPEC_LEN}
  776. type
  777.   ADSPEC = record
  778.     adspec_header: RsvpObjHdr;
  779.     adspec_body: IS_ADSPEC_BODY;    (* Defined in rapi_lib.h *)
  780.   end;
  781.   {$EXTERNALSYM ADSPEC}
  782.   TAdSpec = ADSPEC;
  783.   PAdSpec = ^ADSPEC;
  784. // RSVP message types
  785. const
  786.   RSVP_PATH      = 1;
  787.   {$EXTERNALSYM RSVP_PATH}
  788.   RSVP_RESV      = 2;
  789.   {$EXTERNALSYM RSVP_RESV}
  790.   RSVP_PATH_ERR  = 3;
  791.   {$EXTERNALSYM RSVP_PATH_ERR}
  792.   RSVP_RESV_ERR  = 4;
  793.   {$EXTERNALSYM RSVP_RESV_ERR}
  794.   RSVP_PATH_TEAR = 5;
  795.   {$EXTERNALSYM RSVP_PATH_TEAR}
  796.   RSVP_RESV_TEAR = 6;
  797.   {$EXTERNALSYM RSVP_RESV_TEAR}
  798. (*  RSVP error codes
  799.  *)
  800.   RSVP_Err_NONE  = 0;   (* No error (CONFIRM)       *)
  801.   {$EXTERNALSYM RSVP_Err_NONE}
  802.   RSVP_Erv_Nonev = 0;   (*    No-error Error Value  *)
  803.   {$EXTERNALSYM RSVP_Erv_Nonev}
  804. (* Admission Control failure    *)
  805.   RSVP_Err_ADMISSION = 1;
  806.   {$EXTERNALSYM RSVP_Err_ADMISSION}
  807. (* Globally-defined sub-codes for : Admission Control failure *)
  808.   RSVP_Erv_Other     = 0;   (* Unspecified cause        *)
  809.   {$EXTERNALSYM RSVP_Erv_Other}
  810.   RSVP_Erv_DelayBnd  = 1;   (* Cannot meet delay bound req  *)
  811.   {$EXTERNALSYM RSVP_Erv_DelayBnd}
  812.   RSVP_Erv_Bandwidth = 2;   (* Insufficient bandwidth   *)
  813.   {$EXTERNALSYM RSVP_Erv_Bandwidth}
  814.   RSVP_Erv_MTU       = 3;   (* MTU in flowspec too large    *)
  815.   {$EXTERNALSYM RSVP_Erv_MTU}
  816. // Microsoft specific error values
  817.   RSVP_Erv_Flow_Rate         = $8001;
  818.   {$EXTERNALSYM RSVP_Erv_Flow_Rate}
  819.   RSVP_Erv_Bucket_szie       = $8002;
  820.   {$EXTERNALSYM RSVP_Erv_Bucket_szie}
  821.   RSVP_Erv_Peak_Rate         = $8003;
  822.   {$EXTERNALSYM RSVP_Erv_Peak_Rate}
  823.   RSVP_Erv_Min_Policied_size = $8004;
  824.   {$EXTERNALSYM RSVP_Erv_Min_Policied_size}
  825. (* Policy control failure   *)
  826.   RSVP_Err_POLICY = 2;
  827.   {$EXTERNALSYM RSVP_Err_POLICY}
  828. // Policy error values from Identity draft
  829.   POLICY_ERRV_NO_MORE_INFO                = 1;
  830.   {$EXTERNALSYM POLICY_ERRV_NO_MORE_INFO}
  831.   POLICY_ERRV_UNSUPPORTED_CREDENTIAL_TYPE = 2;
  832.   {$EXTERNALSYM POLICY_ERRV_UNSUPPORTED_CREDENTIAL_TYPE}
  833.   POLICY_ERRV_INSUFFICIENT_PRIVILEGES     = 3;
  834.   {$EXTERNALSYM POLICY_ERRV_INSUFFICIENT_PRIVILEGES}
  835.   POLICY_ERRV_EXPIRED_CREDENTIALS         = 4;
  836.   {$EXTERNALSYM POLICY_ERRV_EXPIRED_CREDENTIALS}
  837.   POLICY_ERRV_IDENTITY_CHANGED            = 5;
  838.   {$EXTERNALSYM POLICY_ERRV_IDENTITY_CHANGED}
  839. // Microsoft specific policy error values
  840.   POLICY_ERRV_UNKNOWN = 0;
  841.   {$EXTERNALSYM POLICY_ERRV_UNKNOWN}
  842.   POLICY_ERRV_GLOBAL_DEF_FLOW_COUNT         = 1;
  843.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_DEF_FLOW_COUNT}
  844.   POLICY_ERRV_GLOBAL_GRP_FLOW_COUNT         = 2;
  845.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_GRP_FLOW_COUNT}
  846.   POLICY_ERRV_GLOBAL_USER_FLOW_COUNT        = 3;
  847.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_USER_FLOW_COUNT}
  848.   POLICY_ERRV_GLOBAL_UNAUTH_USER_FLOW_COUNT = 4;
  849.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_UNAUTH_USER_FLOW_COUNT}
  850.   POLICY_ERRV_SUBNET_DEF_FLOW_COUNT         = 5;
  851.   {$EXTERNALSYM POLICY_ERRV_SUBNET_DEF_FLOW_COUNT}
  852.   POLICY_ERRV_SUBNET_GRP_FLOW_COUNT         = 6;
  853.   {$EXTERNALSYM POLICY_ERRV_SUBNET_GRP_FLOW_COUNT}
  854.   POLICY_ERRV_SUBNET_USER_FLOW_COUNT        = 7;
  855.   {$EXTERNALSYM POLICY_ERRV_SUBNET_USER_FLOW_COUNT}
  856.   POLICY_ERRV_SUBNET_UNAUTH_USER_FLOW_COUNT = 8;
  857.   {$EXTERNALSYM POLICY_ERRV_SUBNET_UNAUTH_USER_FLOW_COUNT}
  858.   POLICY_ERRV_GLOBAL_DEF_FLOW_DURATION         = 9;
  859.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_DEF_FLOW_DURATION}
  860.   POLICY_ERRV_GLOBAL_GRP_FLOW_DURATION         = 10;
  861.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_GRP_FLOW_DURATION}
  862.   POLICY_ERRV_GLOBAL_USER_FLOW_DURATION        = 11;
  863.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_USER_FLOW_DURATION}
  864.   POLICY_ERRV_GLOBAL_UNAUTH_USER_FLOW_DURATION = 12;
  865.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_UNAUTH_USER_FLOW_DURATION}
  866.   POLICY_ERRV_SUBNET_DEF_FLOW_DURATION         = 13;
  867.   {$EXTERNALSYM POLICY_ERRV_SUBNET_DEF_FLOW_DURATION}
  868.   POLICY_ERRV_SUBNET_GRP_FLOW_DURATION         = 14;
  869.   {$EXTERNALSYM POLICY_ERRV_SUBNET_GRP_FLOW_DURATION}
  870.   POLICY_ERRV_SUBNET_USER_FLOW_DURATION        = 15;
  871.   {$EXTERNALSYM POLICY_ERRV_SUBNET_USER_FLOW_DURATION}
  872.   POLICY_ERRV_SUBNET_UNAUTH_USER_FLOW_DURATION = 16;
  873.   {$EXTERNALSYM POLICY_ERRV_SUBNET_UNAUTH_USER_FLOW_DURATION}
  874.   POLICY_ERRV_GLOBAL_DEF_FLOW_RATE         = 17;
  875.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_DEF_FLOW_RATE}
  876.   POLICY_ERRV_GLOBAL_GRP_FLOW_RATE         = 18;
  877.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_GRP_FLOW_RATE}
  878.   POLICY_ERRV_GLOBAL_USER_FLOW_RATE        = 19;
  879.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_USER_FLOW_RATE}
  880.   POLICY_ERRV_GLOBAL_UNAUTH_USER_FLOW_RATE = 20;
  881.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_UNAUTH_USER_FLOW_RATE}
  882.   POLICY_ERRV_SUBNET_DEF_FLOW_RATE         = 21;
  883.   {$EXTERNALSYM POLICY_ERRV_SUBNET_DEF_FLOW_RATE}
  884.   POLICY_ERRV_SUBNET_GRP_FLOW_RATE         = 22;
  885.   {$EXTERNALSYM POLICY_ERRV_SUBNET_GRP_FLOW_RATE}
  886.   POLICY_ERRV_SUBNET_USER_FLOW_RATE        = 23;
  887.   {$EXTERNALSYM POLICY_ERRV_SUBNET_USER_FLOW_RATE}
  888.   POLICY_ERRV_SUBNET_UNAUTH_USER_FLOW_RATE = 24;
  889.   {$EXTERNALSYM POLICY_ERRV_SUBNET_UNAUTH_USER_FLOW_RATE}
  890.   POLICY_ERRV_GLOBAL_DEF_PEAK_RATE         = 25;
  891.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_DEF_PEAK_RATE}
  892.   POLICY_ERRV_GLOBAL_GRP_PEAK_RATE         = 26;
  893.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_GRP_PEAK_RATE}
  894.   POLICY_ERRV_GLOBAL_USER_PEAK_RATE        = 27;
  895.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_USER_PEAK_RATE}
  896.   POLICY_ERRV_GLOBAL_UNAUTH_USER_PEAK_RATE = 28;
  897.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_UNAUTH_USER_PEAK_RATE}
  898.   POLICY_ERRV_SUBNET_DEF_PEAK_RATE         = 29;
  899.   {$EXTERNALSYM POLICY_ERRV_SUBNET_DEF_PEAK_RATE}
  900.   POLICY_ERRV_SUBNET_GRP_PEAK_RATE         = 30;
  901.   {$EXTERNALSYM POLICY_ERRV_SUBNET_GRP_PEAK_RATE}
  902.   POLICY_ERRV_SUBNET_USER_PEAK_RATE        = 31;
  903.   {$EXTERNALSYM POLICY_ERRV_SUBNET_USER_PEAK_RATE}
  904.   POLICY_ERRV_SUBNET_UNAUTH_USER_PEAK_RATE = 32;
  905.   {$EXTERNALSYM POLICY_ERRV_SUBNET_UNAUTH_USER_PEAK_RATE}
  906.   POLICY_ERRV_GLOBAL_DEF_SUM_FLOW_RATE         = 33;
  907.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_DEF_SUM_FLOW_RATE}
  908.   POLICY_ERRV_GLOBAL_GRP_SUM_FLOW_RATE         = 34;
  909.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_GRP_SUM_FLOW_RATE}
  910.   POLICY_ERRV_GLOBAL_USER_SUM_FLOW_RATE        = 35;
  911.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_USER_SUM_FLOW_RATE}
  912.   POLICY_ERRV_GLOBAL_UNAUTH_USER_SUM_FLOW_RATE = 36;
  913.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_UNAUTH_USER_SUM_FLOW_RATE}
  914.   POLICY_ERRV_SUBNET_DEF_SUM_FLOW_RATE         = 37;
  915.   {$EXTERNALSYM POLICY_ERRV_SUBNET_DEF_SUM_FLOW_RATE}
  916.   POLICY_ERRV_SUBNET_GRP_SUM_FLOW_RATE         = 38;
  917.   {$EXTERNALSYM POLICY_ERRV_SUBNET_GRP_SUM_FLOW_RATE}
  918.   POLICY_ERRV_SUBNET_USER_SUM_FLOW_RATE        = 39;
  919.   {$EXTERNALSYM POLICY_ERRV_SUBNET_USER_SUM_FLOW_RATE}
  920.   POLICY_ERRV_SUBNET_UNAUTH_USER_SUM_FLOW_RATE = 40;
  921.   {$EXTERNALSYM POLICY_ERRV_SUBNET_UNAUTH_USER_SUM_FLOW_RATE}
  922.   POLICY_ERRV_GLOBAL_DEF_SUM_PEAK_RATE         = 41;
  923.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_DEF_SUM_PEAK_RATE}
  924.   POLICY_ERRV_GLOBAL_GRP_SUM_PEAK_RATE         = 42;
  925.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_GRP_SUM_PEAK_RATE}
  926.   POLICY_ERRV_GLOBAL_USER_SUM_PEAK_RATE        = 43;
  927.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_USER_SUM_PEAK_RATE}
  928.   POLICY_ERRV_GLOBAL_UNAUTH_USER_SUM_PEAK_RATE = 44;
  929.   {$EXTERNALSYM POLICY_ERRV_GLOBAL_UNAUTH_USER_SUM_PEAK_RATE}
  930.   POLICY_ERRV_SUBNET_DEF_SUM_PEAK_RATE         = 45;
  931.   {$EXTERNALSYM POLICY_ERRV_SUBNET_DEF_SUM_PEAK_RATE}
  932.   POLICY_ERRV_SUBNET_GRP_SUM_PEAK_RATE         = 46;
  933.   {$EXTERNALSYM POLICY_ERRV_SUBNET_GRP_SUM_PEAK_RATE}
  934.   POLICY_ERRV_SUBNET_USER_SUM_PEAK_RATE        = 47;
  935.   {$EXTERNALSYM POLICY_ERRV_SUBNET_USER_SUM_PEAK_RATE}
  936.   POLICY_ERRV_SUBNET_UNAUTH_USER_SUM_PEAK_RATE = 48;
  937.   {$EXTERNALSYM POLICY_ERRV_SUBNET_UNAUTH_USER_SUM_PEAK_RATE}
  938.   POLICY_ERRV_UNKNOWN_USER       = 49;
  939.   {$EXTERNALSYM POLICY_ERRV_UNKNOWN_USER}
  940.   POLICY_ERRV_NO_PRIVILEGES      = 50;
  941.   {$EXTERNALSYM POLICY_ERRV_NO_PRIVILEGES}
  942.   POLICY_ERRV_EXPIRED_USER_TOKEN = 51;
  943.   {$EXTERNALSYM POLICY_ERRV_EXPIRED_USER_TOKEN}
  944.   POLICY_ERRV_NO_RESOURCES       = 52;
  945.   {$EXTERNALSYM POLICY_ERRV_NO_RESOURCES}
  946.   POLICY_ERRV_PRE_EMPTED         = 53;
  947.   {$EXTERNALSYM POLICY_ERRV_PRE_EMPTED}
  948.   POLICY_ERRV_USER_CHANGED       = 54;
  949.   {$EXTERNALSYM POLICY_ERRV_USER_CHANGED}
  950.   POLICY_ERRV_NO_ACCEPTS         = 55;
  951.   {$EXTERNALSYM POLICY_ERRV_NO_ACCEPTS}
  952.   POLICY_ERRV_NO_MEMORY          = 56;
  953.   {$EXTERNALSYM POLICY_ERRV_NO_MEMORY}
  954.   POLICY_ERRV_CRAZY_FLOWSPEC     = 57;
  955.   {$EXTERNALSYM POLICY_ERRV_CRAZY_FLOWSPEC}
  956. // Other RSVP defined Error codes
  957.   RSVP_Err_NO_PATH       = 3;   (* No path state for Resv   *)
  958.   {$EXTERNALSYM RSVP_Err_NO_PATH}
  959.   RSVP_Err_NO_SENDER     = 4;   (* No sender info for Resv  *)
  960.   {$EXTERNALSYM RSVP_Err_NO_SENDER}
  961.   RSVP_Err_BAD_STYLE     = 5;   (* Conflicting style        *)
  962.   {$EXTERNALSYM RSVP_Err_BAD_STYLE}
  963.   RSVP_Err_UNKNOWN_STYLE = 6;   (* Unknown reservation style    *)
  964.   {$EXTERNALSYM RSVP_Err_UNKNOWN_STYLE}
  965.   RSVP_Err_BAD_DSTPORT   = 7;   (* Conflicting DstPort in Sess  *)
  966.   {$EXTERNALSYM RSVP_Err_BAD_DSTPORT}
  967.   RSVP_Err_BAD_SNDPORT   = 8;   (* Conflicting Sender port  *)
  968.   {$EXTERNALSYM RSVP_Err_BAD_SNDPORT}
  969.   RSVP_Err_AMBIG_FILTER  = 9;   (* Ambiguous Filter spec in Resv*)
  970.   {$EXTERNALSYM RSVP_Err_AMBIG_FILTER}
  971.   RSVP_Err_PREEMPTED     = 12;  (* Service Preempted        *)
  972.   {$EXTERNALSYM RSVP_Err_PREEMPTED}
  973. (* Unknown object Class-Num *)
  974.   RSVP_Err_UNKN_OBJ_CLASS = 13;
  975.   {$EXTERNALSYM RSVP_Err_UNKN_OBJ_CLASS}
  976. (*   ErrVal = Class_num, CType  *)
  977.  (* Unknown object C-Type    *)
  978.   RSVP_Err_UNKNOWN_CTYPE = 14;
  979.   {$EXTERNALSYM RSVP_Err_UNKNOWN_CTYPE}
  980. (*   ErrVal = Class_num, CType  *)
  981.   RSVP_Err_API_ERROR = 20;  (* API client error     *)
  982.   {$EXTERNALSYM RSVP_Err_API_ERROR}
  983. (*   ErrVal = API error code    *)
  984. (* Traffic Control error    *)
  985.   RSVP_Err_TC_ERROR = 21;
  986.   {$EXTERNALSYM RSVP_Err_TC_ERROR}
  987. (* Globally-defined sub-codes for : Traffic Control errors *)
  988.   RSVP_Erv_Conflict_Serv  = 01;  (* Service Conflict     *)
  989.   {$EXTERNALSYM RSVP_Erv_Conflict_Serv}
  990.   RSVP_Erv_No_Serv        = 02;  (* Unknown Service      *)
  991.   {$EXTERNALSYM RSVP_Erv_No_Serv}
  992.   RSVP_Erv_Crazy_Flowspec = 03;  (* Unreasonable Flowspec    *)
  993.   {$EXTERNALSYM RSVP_Erv_Crazy_Flowspec}
  994.   RSVP_Erv_Crazy_Tspec    = 04;  (* Unreasonable Tspec       *)
  995.   {$EXTERNALSYM RSVP_Erv_Crazy_Tspec}
  996.   RSVP_Err_TC_SYS_ERROR = 22;  (* Traffic control system error *)
  997.   {$EXTERNALSYM RSVP_Err_TC_SYS_ERROR}
  998. (* ErrVal = kernel error code   *)
  999. (* RSVP System error      *)
  1000.   RSVP_Err_RSVP_SYS_ERROR = 23;
  1001.   {$EXTERNALSYM RSVP_Err_RSVP_SYS_ERROR}
  1002. (* Globally-defined sub-codes for : RSVP system errors *)
  1003.   RSVP_Erv_MEMORY = 1;   (* Out of memory *)
  1004.   {$EXTERNALSYM RSVP_Erv_MEMORY}
  1005.   RSVP_Erv_API    = 2;   (* API logic error *)
  1006.   {$EXTERNALSYM RSVP_Erv_API}
  1007. // Identity Policy elements related defines
  1008. // Reseved Identity PE types
  1009.   LPM_PE_USER_IDENTITY = 2;
  1010.   {$EXTERNALSYM LPM_PE_USER_IDENTITY}
  1011.   LPM_PE_APP_IDENTITY  = 3;
  1012.   {$EXTERNALSYM LPM_PE_APP_IDENTITY}
  1013. // Defines for Identity error values
  1014.   ERROR_NO_MORE_INFO          = 1;
  1015.   {$EXTERNALSYM ERROR_NO_MORE_INFO}
  1016.   UNSUPPORTED_CREDENTIAL_TYPE = 2;
  1017.   {$EXTERNALSYM UNSUPPORTED_CREDENTIAL_TYPE}
  1018.   INSUFFICIENT_PRIVILEGES     = 3;
  1019.   {$EXTERNALSYM INSUFFICIENT_PRIVILEGES}
  1020.   EXPIRED_CREDENTIAL          = 4;
  1021.   {$EXTERNALSYM EXPIRED_CREDENTIAL}
  1022.   IDENTITY_CHANGED            = 5;
  1023.   {$EXTERNALSYM IDENTITY_CHANGED}
  1024. type
  1025.   ID_ERROR_OBJECT = record
  1026.     usIdErrLength: USHORT;
  1027.     ucAType: UCHAR;
  1028.     ucSubType: UCHAR;
  1029.     usReserved: USHORT;
  1030.     usIdErrorValue: USHORT;
  1031.     ucIdErrData: array [0..3] of UCHAR;
  1032.   end;
  1033.   {$EXTERNALSYM ID_ERROR_OBJECT}
  1034.   TIdErrorObject = ID_ERROR_OBJECT;
  1035.   PIdErrorObject = ^ID_ERROR_OBJECT;
  1036. const
  1037.   ID_ERR_OBJ_HDR_LEN = SizeOf(ID_ERROR_OBJECT) - 4 * SizeOf(UCHAR);
  1038.   {$EXTERNALSYM ID_ERR_OBJ_HDR_LEN}
  1039. (*
  1040.     LPM API specific definitions
  1041. *)
  1042. (**************************************
  1043.     LPM_Initialize
  1044. ***************************************)
  1045. type
  1046.   LPM_HANDLE = HANDLE;
  1047.   {$EXTERNALSYM LPM_HANDLE}
  1048.   RHANDLE = HANDLE;
  1049.   {$EXTERNALSYM RHANDLE}
  1050.   LPV = ULONG;
  1051.   {$EXTERNALSYM LPV}
  1052.   PETYPE = USHORT;
  1053.   {$EXTERNALSYM PETYPE}
  1054. const
  1055.   LPM_OK = 0;
  1056.   {$EXTERNALSYM LPM_OK}
  1057. type
  1058.   MSG_TYPE = Integer;
  1059.   {$EXTERNALSYM MSG_TYPE}
  1060.   TMsgType = MSG_TYPE;
  1061.   rsvpmsgobjs = record
  1062.     RsvpMsgType: TMsgType;
  1063.     pRsvpSession: PRsvpSession;
  1064.     pRsvpFromHop: PRsvpHop;
  1065.     pRsvpToHop: PRsvpHop;
  1066.     pResvStyle: PResvStyle;
  1067.     pRsvpScope: PRsvpScope;
  1068.     FlowDescCount: Integer;
  1069.     pFlowDescs: PFlowDesc;
  1070.     PdObjectCount: Integer;
  1071.     ppPdObjects: ^PPolicyData;
  1072.     pErrorSpec: PErrorSpec;
  1073.     pAdspec: PADSpec;
  1074.   end;
  1075.   {$EXTERNALSYM rsvpmsgobjs}
  1076.   RSVP_MSG_OBJS = rsvpmsgobjs;
  1077.   {$EXTERNALSYM RSVP_MSG_OBJS}
  1078.   TRsvpMsgObjs = RSVP_MSG_OBJS;
  1079.   PRsvpMsgObjs = ^RSVP_MSG_OBJS;
  1080.   
  1081.   PALLOCMEM = function (Size: DWORD): Pointer; stdcall;
  1082.   {$EXTERNALSYM PALLOCMEM}
  1083.   TAllocMem = PALLOCMEM;
  1084.   PFREEMEM = procedure (pv: Pointer); stdcall;
  1085.   {$EXTERNALSYM PFREEMEM}
  1086.   TFreeMem = PFREEMEM;
  1087.   policy_decision = record
  1088.     lpvResult: LPV;        // Use the LPV values from above
  1089.     wPolicyErrCode: WORD;   // RSVP defined error codes
  1090.     wPolicyErrValue: WORD;  // RSVP defined error values
  1091.   end;
  1092.   {$EXTERNALSYM policy_decision}
  1093.   TPolicyDecision = policy_decision;
  1094.   PPolicyDecision = ^policy_decision;
  1095.   CBADMITRESULT = function (LpmHandle: LPM_HANDLE; RequestHandle: RHANDLE;
  1096.     ulPcmActionFlags: ULONG; LpmError: Integer; PolicyDecisionsCount: Integer;
  1097.     pPolicyDecisions: PPolicyDecision): ULONG; stdcall;
  1098.   {$EXTERNALSYM CBADMITRESULT}
  1099.   TCbAdmitResult = CBADMITRESULT;
  1100.   CBGETRSVPOBJECTS = function (LpmHandle: LPM_HANDLE; RequestHandle: RHANDLE;
  1101.     LpmError: Integer; RsvpObjectsCount: Integer; ppRsvpObjects: PPRsvpObjHdr): ULONG; stdcall;
  1102.   {$EXTERNALSYM CBGETRSVPOBJECTS}
  1103.   TCbGetRsvpObjects = CBGETRSVPOBJECTS;
  1104. // The above 2 call backs can return the following errors
  1105. const
  1106.   INV_LPM_HANDLE = 1; // Supplied LpmHandle is invalid
  1107.   {$EXTERNALSYM INV_LPM_HANDLE}
  1108.   LPM_TIME_OUT   = 2; // LPM has returned results after the time limit
  1109.   {$EXTERNALSYM LPM_TIME_OUT}
  1110.   INV_REQ_HANDLE = 3; // Supplied Request handle is invalid
  1111.   {$EXTERNALSYM INV_REQ_HANDLE}
  1112.   DUP_RESULTS    = 4; // LPM has already returned results for this request
  1113.   {$EXTERNALSYM DUP_RESULTS}
  1114.   INV_RESULTS    = 5; // Results supplied are invalid
  1115.   {$EXTERNALSYM INV_RESULTS}
  1116. type
  1117.   lpminitinfo = record
  1118.     PcmVersionNumber: DWORD;
  1119.     ResultTimeLimit: DWORD;
  1120.     ConfiguredLpmCount: Integer;
  1121.     AllocMemory: PALLOCMEM;
  1122.     FreeMemory: PFREEMEM;
  1123.     PcmAdmitResultCallback: CBADMITRESULT;
  1124.     GetRsvpObjectsCallback: CBGETRSVPOBJECTS;
  1125.   end;
  1126.   {$EXTERNALSYM lpminitinfo}
  1127.   LPM_INIT_INFO = lpminitinfo;
  1128.   {$EXTERNALSYM LPM_INIT_INFO}
  1129.   TLpmInitInfo = LPM_INIT_INFO;
  1130.   PLpmInitInfo = ^LPM_INIT_INFO;  
  1131. // Valid PE types
  1132. // XXX ISSUE - Is 0xFFFF a better choice?
  1133. const
  1134.   LPM_PE_ALL_TYPES = 0;
  1135.   {$EXTERNALSYM LPM_PE_ALL_TYPES}
  1136. // Current LPM API version number
  1137.   LPM_API_VERSION_1 = 1;
  1138.   {$EXTERNALSYM LPM_API_VERSION_1}
  1139. // Current PCM version number
  1140.   PCM_VERSION_1 = 1;
  1141.   {$EXTERNALSYM PCM_VERSION_1}
  1142. function LPM_Initialize(LpmHandle: LPM_HANDLE; const pLpmInitInfo: LPM_INIT_INFO;
  1143.   var pLpmVersionNumber: DWORD; var pSupportedPeType: PETYPE; Reserved: Pointer): ULONG; stdcall;
  1144. {$EXTERNALSYM LPM_Initialize}
  1145. (**************************************
  1146.     LPM_Deinitialize
  1147. ***************************************)
  1148. function LPM_Deinitialize(LpmHandle: LPM_HANDLE): ULONG; stdcall;
  1149. {$EXTERNALSYM LPM_Deinitialize}
  1150. (**************************************
  1151.     LPM_AdmitRsvpMsg
  1152. ***************************************)
  1153. // Valid LPV - LPM Priority Values
  1154. const
  1155.   LPV_RESERVED     = 0;
  1156.   {$EXTERNALSYM LPV_RESERVED}
  1157.   LPV_MIN_PRIORITY = 1;
  1158.   {$EXTERNALSYM LPV_MIN_PRIORITY}
  1159.   LPV_MAX_PRIORITY = $FF00;
  1160.   {$EXTERNALSYM LPV_MAX_PRIORITY}
  1161.   LPV_DROP_MSG     = $FFFD;
  1162.   {$EXTERNALSYM LPV_DROP_MSG}
  1163.   LPV_DONT_CARE    = $FFFE;
  1164.   {$EXTERNALSYM LPV_DONT_CARE}
  1165.   LPV_REJECT       = $FFFF;
  1166.   {$EXTERNALSYM LPV_REJECT}
  1167. // Valid values for PcmActionFlags
  1168.   FORCE_IMMEDIATE_REFRESH = 1;
  1169.   {$EXTERNALSYM FORCE_IMMEDIATE_REFRESH}
  1170. // Function return values for LPM_AdmitResvMsg
  1171.   LPM_RESULT_READY = 0;
  1172.   {$EXTERNALSYM LPM_RESULT_READY}
  1173.   LPM_RESULT_DEFER = 1;
  1174.   {$EXTERNALSYM LPM_RESULT_DEFER}
  1175. function LPM_AdmitRsvpMsg(PcmReqHandle: RHANDLE; const pRecvdIntf: RSVP_HOP;
  1176.   const pRsvpMsgObjs: RSVP_MSG_OBJS; RcvdRsvpMsgLength: Integer; RcvdRsvpMsg: PUCHAR;
  1177.   var pulPcmActionFlags: ULONG; pPolicyDecisions: PPolicyDecision; Reserved: Pointer): ULONG; stdcall;
  1178. {$EXTERNALSYM LPM_AdmitRsvpMsg}
  1179. (**************************************
  1180.     LPM_GetRsvpObjects
  1181. ***************************************)
  1182. // Function return values are defined in LPM_AdmitResvMsg section
  1183. function LPM_GetRsvpObjects(PcmReqHandle: RHANDLE; MaxPdSize: ULONG;
  1184.   SendingIntfAddr: PRsvpHop; pRsvpMsgObjs: PRsvpMsgObjs; var pRsvpObjectsCount: Integer;
  1185.   var pppRsvpObjects: PRsvpObjHdr; Reserved: Pointer): ULONG; stdcall;
  1186. {$EXTERNALSYM LPM_GetRsvpObjects}
  1187. (**************************************
  1188.     LPM_DeleteState
  1189. ***************************************)
  1190. // TearDown reasons
  1191. const
  1192.   RCVD_PATH_TEAR  = 1;
  1193.   {$EXTERNALSYM RCVD_PATH_TEAR}
  1194.   RCVD_RESV_TEAR  = 2;
  1195.   {$EXTERNALSYM RCVD_RESV_TEAR}
  1196.   ADM_CTRL_FAILED = 3;
  1197.   {$EXTERNALSYM ADM_CTRL_FAILED}
  1198.   STATE_TIMEOUT   = 4;
  1199.   {$EXTERNALSYM STATE_TIMEOUT}
  1200.   FLOW_DURATION   = 5;
  1201.   {$EXTERNALSYM FLOW_DURATION}
  1202. procedure LPM_DeleteState(pRcvdIfAddr: PRsvpHop; RsvpMsgType: TMsgType;
  1203.   pRsvpSession: PRsvpSession; pRsvpFromHop: PRsvpHop; pResvStyle: PResvStyle;
  1204.   FilterSpecCount: Integer; ppFilterSpecList: PFilterSpec; TearDownReason: Integer); stdcall;
  1205. {$EXTERNALSYM LPM_DeleteState}
  1206. (**************************************
  1207.     LPM_IpAddrTable
  1208. ***************************************)
  1209. type
  1210.   lpmiptable = record
  1211.     ulIfIndex: ULONG;    // SNMP index for this interface
  1212.     MediaType: ULONG;    // As defined in IPIFCONS.H
  1213.     IfIpAddr: IN_ADDR;   // Interface IP address
  1214.     IfNetMask: IN_ADDR;  // Interface subnet mask
  1215.   end;
  1216.   {$EXTERNALSYM lpmiptable}
  1217.   TLpmIpTable = lpmiptable;
  1218.   PLpmIpTable = ^lpmiptable;
  1219. function LPM_IpAddressTable(cIpAddrTable: ULONG; pIpAddrTable: PLpmIpTable): BOOL; stdcall;
  1220. {$EXTERNALSYM LPM_IpAddressTable}
  1221. (**************************************
  1222.     LPM_CommitResv
  1223. ***************************************)
  1224. // CommitDecision values
  1225. const
  1226.   RESOURCES_ALLOCATED = 1;
  1227.   {$EXTERNALSYM RESOURCES_ALLOCATED}
  1228.   RESOURCES_MODIFIED  = 2;
  1229.   {$EXTERNALSYM RESOURCES_MODIFIED}
  1230. procedure LPM_CommitResv(RsvpSession: PRsvpSession; FlowInstalledIntf: PRsvpHop;
  1231.   RsvpStyle: PResvStyle; FilterSpecCount: Integer; ppFilterSpecList: PFilterSpec;
  1232.   pMergedFlowSpec: PIsFlowSpec; CommitDecision: ULONG); stdcall;
  1233. {$EXTERNALSYM LPM_CommitResv}
  1234. implementation
  1235. function ObjLength(const x: TRsvpObjHdr): USHORT;
  1236. begin
  1237.   Result := x.obj_length;
  1238. end;
  1239. function ObjCType(const x: TRsvpObjHdr): UCHAR;
  1240. begin
  1241.   Result := x.obj_ctype;
  1242. end;
  1243. function ObjClass(const x: TRsvpObjHdr): UCHAR;
  1244. begin
  1245.   Result := x.obj_class;
  1246. end;
  1247. function ObjData(const x: TRsvpObjHdr): Pointer;
  1248. begin
  1249.   Result := Pointer(Integer(@x) + SizeOf(x));
  1250. end;
  1251. function Style_is_Wildcard(p: DWORD): Boolean;
  1252. begin
  1253.   Result := (p and Opt_SndSel_mask) = Opt_Wildcard;
  1254. end;
  1255. function Style_is_Shared(p: DWORD): Boolean;
  1256. begin
  1257.   Result := (p and Opt_Share_mask) = Opt_Shared;
  1258. end;
  1259. function Error_Usage(x: DWORD): DWORD;
  1260. begin
  1261.   Result := (x shr 12) and 3;
  1262. end;
  1263. function Intserv_Version(x: DWORD): DWORD;
  1264. begin
  1265.   Result := (x and INTSERV_VERS_MASK) shr 4;
  1266. end;
  1267. function Intserv_Version_OK(const x: TIntServMainHdr): Boolean;
  1268. begin
  1269.   Result := (x.ismh_version and INTSERV_VERS_MASK) = INTSERV_VERSION0;
  1270. end;
  1271. function Intserv_Obj_size(const x: TIntServMainHdr): DWORD;
  1272. begin
  1273.   Result := x.ismh_len32b * 4 + SizeOf(IntServMainHdr) + SizeOf(RsvpObjHdr);
  1274. end;
  1275. function Issh_len32b(const p: TIntServServiceHdr): USHORT;
  1276. begin
  1277.   Result := p.issh_len32b;
  1278. end;
  1279. const
  1280.   lpmlib = 'msidlpm.dll';
  1281. {$IFDEF DYNAMIC_LINK}
  1282. var
  1283.   _LPM_Initialize: Pointer;
  1284. function LPM_Initialize;
  1285. begin
  1286.   GetProcedureAddress(_LPM_Initialize, lpmlib, 'LPM_Initialize');
  1287.   asm
  1288.     mov esp, ebp
  1289.     pop ebp
  1290.     jmp [_LPM_Initialize]
  1291.   end;
  1292. end;
  1293. {$ELSE}
  1294. function LPM_Initialize; external lpmlib name 'LPM_Initialize';
  1295. {$ENDIF DYNAMIC_LINK}
  1296. {$IFDEF DYNAMIC_LINK}
  1297. var
  1298.   _LPM_Deinitialize: Pointer;
  1299. function LPM_Deinitialize;
  1300. begin
  1301.   GetProcedureAddress(_LPM_Deinitialize, lpmlib, 'LPM_Deinitialize');
  1302.   asm
  1303.     mov esp, ebp
  1304.     pop ebp
  1305.     jmp [_LPM_Deinitialize]
  1306.   end;
  1307. end;
  1308. {$ELSE}
  1309. function LPM_Deinitialize; external lpmlib name 'LPM_Deinitialize';
  1310. {$ENDIF DYNAMIC_LINK}
  1311. {$IFDEF DYNAMIC_LINK}
  1312. var
  1313.   _LPM_AdmitRsvpMsg: Pointer;
  1314. function LPM_AdmitRsvpMsg;
  1315. begin
  1316.   GetProcedureAddress(_LPM_AdmitRsvpMsg, lpmlib, 'LPM_AdmitRsvpMsg');
  1317.   asm
  1318.     mov esp, ebp
  1319.     pop ebp
  1320.     jmp [_LPM_AdmitRsvpMsg]
  1321.   end;
  1322. end;
  1323. {$ELSE}
  1324. function LPM_AdmitRsvpMsg; external lpmlib name 'LPM_AdmitRsvpMsg';
  1325. {$ENDIF DYNAMIC_LINK}
  1326. {$IFDEF DYNAMIC_LINK}
  1327. var
  1328.   _LPM_GetRsvpObjects: Pointer;
  1329. function LPM_GetRsvpObjects;
  1330. begin
  1331.   GetProcedureAddress(_LPM_GetRsvpObjects, lpmlib, 'LPM_GetRsvpObjects');
  1332.   asm
  1333.     mov esp, ebp
  1334.     pop ebp
  1335.     jmp [_LPM_GetRsvpObjects]
  1336.   end;
  1337. end;
  1338. {$ELSE}
  1339. function LPM_GetRsvpObjects; external lpmlib name 'LPM_GetRsvpObjects';
  1340. {$ENDIF DYNAMIC_LINK}
  1341. {$IFDEF DYNAMIC_LINK}
  1342. var
  1343.   _LPM_DeleteState: Pointer;
  1344. procedure LPM_DeleteState;
  1345. begin
  1346.   GetProcedureAddress(_LPM_DeleteState, lpmlib, 'LPM_DeleteState');
  1347.   asm
  1348.     mov esp, ebp
  1349.     pop ebp
  1350.     jmp [_LPM_DeleteState]
  1351.   end;
  1352. end;
  1353. {$ELSE}
  1354. procedure LPM_DeleteState; external lpmlib name 'LPM_DeleteState';
  1355. {$ENDIF DYNAMIC_LINK}
  1356. {$IFDEF DYNAMIC_LINK}
  1357. var
  1358.   _LPM_IpAddressTable: Pointer;
  1359. function LPM_IpAddressTable;
  1360. begin
  1361.   GetProcedureAddress(_LPM_IpAddressTable, lpmlib, 'LPM_IpAddressTable');
  1362.   asm
  1363.     mov esp, ebp
  1364.     pop ebp
  1365.     jmp [_LPM_IpAddressTable]
  1366.   end;
  1367. end;
  1368. {$ELSE}
  1369. function LPM_IpAddressTable; external lpmlib name 'LPM_IpAddressTable';
  1370. {$ENDIF DYNAMIC_LINK}
  1371. {$IFDEF DYNAMIC_LINK}
  1372. var
  1373.   _LPM_CommitResv: Pointer;
  1374. procedure LPM_CommitResv;
  1375. begin
  1376.   GetProcedureAddress(_LPM_CommitResv, lpmlib, 'LPM_CommitResv');
  1377.   asm
  1378.     mov esp, ebp
  1379.     pop ebp
  1380.     jmp [_LPM_CommitResv]
  1381.   end;
  1382. end;
  1383. {$ELSE}
  1384. procedure LPM_CommitResv; external lpmlib name 'LPM_CommitResv';
  1385. {$ENDIF DYNAMIC_LINK}
  1386. end.