~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcsrc/packages/base/winunits/jwatraffic.pas

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{******************************************************************************}
 
2
{                                                                              }
 
3
{ Traffic Control 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: traffic.h, released June 2000. The original Pascal     }
 
9
{ code is: Traffic.pas, released December 2000. The initial developer of the   }
 
10
{ Pascal code is Marcel van Brakel (brakelm att chello dott 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         }
 
18
{ APILIB home page, located at http://jedi-apilib.sourceforge.net              }
 
19
{                                                                              }
 
20
{ The contents of this file are used with permission, subject to the Mozilla   }
 
21
{ Public License Version 1.1 (the "License"); you may not use this file except }
 
22
{ in compliance with the License. You may obtain a copy of the License at      }
 
23
{ http://www.mozilla.org/MPL/MPL-1.1.html                                      }
 
24
{                                                                              }
 
25
{ Software distributed under the License is distributed on an "AS IS" basis,   }
 
26
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
 
27
{ the specific language governing rights and limitations under the License.    }
 
28
{                                                                              }
 
29
{ Alternatively, the contents of this file may be used under the terms of the  }
 
30
{ GNU Lesser General Public License (the  "LGPL License"), in which case the   }
 
31
{ provisions of the LGPL License are applicable instead of those above.        }
 
32
{ If you wish to allow use of your version of this file only under the terms   }
 
33
{ of the LGPL License and not to allow others to use your version of this file }
 
34
{ under the MPL, indicate your decision by deleting  the provisions above and  }
 
35
{ replace  them with the notice and other provisions required by the LGPL      }
 
36
{ License.  If you do not delete the provisions above, a recipient may use     }
 
37
{ your version of this file under either the MPL or the LGPL License.          }
 
38
{                                                                              }
 
39
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
 
40
{                                                                              }
 
41
{******************************************************************************}
 
42
 
 
43
// $Id: JwaTraffic.pas,v 1.9 2005/09/06 16:36:50 marquardt Exp $
 
44
 
 
45
unit JwaTraffic;
 
46
 
 
47
{$WEAKPACKAGEUNIT}
 
48
 
 
49
{$HPPEMIT ''}
 
50
{$HPPEMIT '#include "traffic.h"'}
 
51
{$HPPEMIT ''}
 
52
 
 
53
{$I jediapilib.inc}
 
54
 
 
55
interface
 
56
 
 
57
uses
 
58
  JwaWindows, JwaQos;
 
59
 
 
60
//---------------------------------------------------------------------------
 
61
//
 
62
// Define's
 
63
//
 
64
 
 
65
const
 
66
  CURRENT_TCI_VERSION = $0002;
 
67
  {$EXTERNALSYM CURRENT_TCI_VERSION}
 
68
 
 
69
//
 
70
// Definitions of notification events. These may be passed
 
71
// to the client's notification handler, to identify the
 
72
// notification type
 
73
//
 
74
 
 
75
//
 
76
// A TC interface has come up
 
77
//
 
78
 
 
79
  TC_NOTIFY_IFC_UP = 1;
 
80
  {$EXTERNALSYM TC_NOTIFY_IFC_UP}
 
81
 
 
82
//
 
83
// A TC interface has come down
 
84
//
 
85
 
 
86
  TC_NOTIFY_IFC_CLOSE = 2;
 
87
  {$EXTERNALSYM TC_NOTIFY_IFC_CLOSE}
 
88
 
 
89
//
 
90
// A change on a TC interface, typically a change in the
 
91
// list of supported network addresses
 
92
//
 
93
 
 
94
  TC_NOTIFY_IFC_CHANGE = 3;
 
95
  {$EXTERNALSYM TC_NOTIFY_IFC_CHANGE}
 
96
 
 
97
//
 
98
// A TC parameter has changed
 
99
//
 
100
 
 
101
  TC_NOTIFY_PARAM_CHANGED = 4;
 
102
  {$EXTERNALSYM TC_NOTIFY_PARAM_CHANGED}
 
103
 
 
104
//
 
105
// A flow has been closed by the TC interface
 
106
// for example: after a remote call close, or the whole interface
 
107
// is going down
 
108
//
 
109
 
 
110
  TC_NOTIFY_FLOW_CLOSE = 5;
 
111
  {$EXTERNALSYM TC_NOTIFY_FLOW_CLOSE}
 
112
 
 
113
  TC_INVALID_HANDLE = HANDLE(0);
 
114
  {$EXTERNALSYM TC_INVALID_HANDLE}
 
115
 
 
116
  MAX_STRING_LENGTH = 256;
 
117
  {$EXTERNALSYM MAX_STRING_LENGTH}
 
118
 
 
119
//---------------------------------------------------------------------------
 
120
//
 
121
// Typedef's and structures
 
122
//
 
123
 
 
124
//
 
125
// Handlers registered by the TCI client
 
126
//
 
127
 
 
128
type
 
129
  TCI_NOTIFY_HANDLER = procedure(ClRegCtx, ClIfcCtx: HANDLE; Event: ULONG;
 
130
    SubCode: HANDLE; BufSize: ULONG; Buffer: PVOID); stdcall;
 
131
  {$EXTERNALSYM TCI_NOTIFY_HANDLER}
 
132
  TTciNotifyHandler = TCI_NOTIFY_HANDLER;
 
133
 
 
134
  TCI_ADD_FLOW_COMPLETE_HANDLER = procedure(ClFlowCtx: HANDLE; Status: ULONG); stdcall;
 
135
  {$EXTERNALSYM TCI_ADD_FLOW_COMPLETE_HANDLER}
 
136
  TTciAddFlowCompleteHandler = TCI_ADD_FLOW_COMPLETE_HANDLER;
 
137
 
 
138
  TCI_MOD_FLOW_COMPLETE_HANDLER = procedure(ClFlowCtx: HANDLE; Status: ULONG); stdcall;
 
139
  {$EXTERNALSYM TCI_MOD_FLOW_COMPLETE_HANDLER}
 
140
  TTciModFlowCompleteHandler = TCI_MOD_FLOW_COMPLETE_HANDLER;
 
141
 
 
142
  TCI_DEL_FLOW_COMPLETE_HANDLER = procedure(ClFlowCtx: HANDLE; Status: ULONG); stdcall;
 
143
  {$EXTERNALSYM TCI_DEL_FLOW_COMPLETE_HANDLER}
 
144
  TTciDelFlowComlpeteHandler = TCI_DEL_FLOW_COMPLETE_HANDLER;
 
145
 
 
146
type
 
147
  PTCI_CLIENT_FUNC_LIST = ^TCI_CLIENT_FUNC_LIST;
 
148
  {$EXTERNALSYM PTCI_CLIENT_FUNC_LIST}
 
149
  _TCI_CLIENT_FUNC_LIST = record
 
150
    ClNotifyHandler: TCI_NOTIFY_HANDLER;
 
151
    ClAddFlowCompleteHandler: TCI_ADD_FLOW_COMPLETE_HANDLER;
 
152
    ClModifyFlowCompleteHandler: TCI_MOD_FLOW_COMPLETE_HANDLER;
 
153
    ClDeleteFlowCompleteHandler: TCI_DEL_FLOW_COMPLETE_HANDLER;
 
154
  end;
 
155
  {$EXTERNALSYM _TCI_CLIENT_FUNC_LIST}
 
156
  TCI_CLIENT_FUNC_LIST = _TCI_CLIENT_FUNC_LIST;
 
157
  {$EXTERNALSYM TCI_CLIENT_FUNC_LIST}
 
158
  TTciClientFuncList = TCI_CLIENT_FUNC_LIST;
 
159
  PTciClientFuncList = PTCI_CLIENT_FUNC_LIST;
 
160
 
 
161
  // TODO NETWORD_ADDRESS and NETWORK_ADDRESS_LIST are from NtDDNdis.h
 
162
 
 
163
  _NETWORK_ADDRESS = record
 
164
    AddressLength: USHORT;              // length in bytes of Address[] in this
 
165
    AddressType: USHORT;                // type of this address (NDIS_PROTOCOL_ID_XXX above)
 
166
    Address: array [0..0] of UCHAR;     // actually AddressLength bytes long
 
167
  end;
 
168
  NETWORK_ADDRESS = _NETWORK_ADDRESS;
 
169
  PNETWORK_ADDRESS = ^NETWORK_ADDRESS;
 
170
 
 
171
  _NETWORK_ADDRESS_LIST = record
 
172
    AddressCount: LONG;                 // number of addresses following
 
173
    AddressType: USHORT;                // type of this address (NDIS_PROTOCOL_ID_XXX above)
 
174
    Address: array [0..0] of NETWORK_ADDRESS; // actually AddressCount elements long
 
175
  end;
 
176
  NETWORK_ADDRESS_LIST = _NETWORK_ADDRESS_LIST;
 
177
  PNETWORK_ADDRESS_LIST = ^NETWORK_ADDRESS_LIST;
 
178
 
 
179
//
 
180
// Network address descriptor
 
181
//
 
182
 
 
183
  PADDRESS_LIST_DESCRIPTOR = ^ADDRESS_LIST_DESCRIPTOR;
 
184
  {$EXTERNALSYM PADDRESS_LIST_DESCRIPTOR}
 
185
  _ADDRESS_LIST_DESCRIPTOR = record
 
186
    MediaType: ULONG;
 
187
    AddressList: NETWORK_ADDRESS_LIST;
 
188
  end;
 
189
  {$EXTERNALSYM _ADDRESS_LIST_DESCRIPTOR}
 
190
  ADDRESS_LIST_DESCRIPTOR = _ADDRESS_LIST_DESCRIPTOR;
 
191
  {$EXTERNALSYM ADDRESS_LIST_DESCRIPTOR}
 
192
  TAddressListDescriptor = ADDRESS_LIST_DESCRIPTOR;
 
193
  PAddressListDescriptor = PADDRESS_LIST_DESCRIPTOR;
 
194
 
 
195
//
 
196
// An interface ID that is returned by the enumerator
 
197
//
 
198
 
 
199
  PTC_IFC_DESCRIPTOR = ^TC_IFC_DESCRIPTOR;
 
200
  {$EXTERNALSYM PTC_IFC_DESCRIPTOR}
 
201
  _TC_IFC_DESCRIPTOR = record
 
202
    Length: ULONG;
 
203
    pInterfaceName: LPWSTR;
 
204
    pInterfaceID: LPWSTR;
 
205
    AddressListDesc: ADDRESS_LIST_DESCRIPTOR;
 
206
  end;
 
207
  {$EXTERNALSYM _TC_IFC_DESCRIPTOR}
 
208
  TC_IFC_DESCRIPTOR = _TC_IFC_DESCRIPTOR;
 
209
  {$EXTERNALSYM TC_IFC_DESCRIPTOR}
 
210
  TTcIfcDescriptor = TC_IFC_DESCRIPTOR;
 
211
  PTcIfcDescriptor = PTC_IFC_DESCRIPTOR;
 
212
 
 
213
//
 
214
// This structure is returned by a QoS data provider in reply to
 
215
// GUID_QOS_SUPPORTED query or with an interface UP notification
 
216
//
 
217
 
 
218
  PTC_SUPPORTED_INFO_BUFFER = ^TC_SUPPORTED_INFO_BUFFER;
 
219
  {$EXTERNALSYM PTC_SUPPORTED_INFO_BUFFER}
 
220
  _TC_SUPPORTED_INFO_BUFFER = record
 
221
    InstanceIDLength: USHORT;
 
222
    // device or interface ID
 
223
    InstanceID: array [0..MAX_STRING_LENGTH - 1] of WCHAR;
 
224
    // address list
 
225
    AddrListDesc: ADDRESS_LIST_DESCRIPTOR;
 
226
  end;
 
227
  {$EXTERNALSYM _TC_SUPPORTED_INFO_BUFFER}
 
228
  TC_SUPPORTED_INFO_BUFFER = _TC_SUPPORTED_INFO_BUFFER;
 
229
  {$EXTERNALSYM TC_SUPPORTED_INFO_BUFFER}
 
230
  TTcSupportedInfoBuffer = TC_SUPPORTED_INFO_BUFFER;
 
231
  PTcSupportedInfoBuffer = PTC_SUPPORTED_INFO_BUFFER;
 
232
 
 
233
//
 
234
// Filters are used to match packets. The Pattern field
 
235
// indicates the values to which bits in corresponding
 
236
// positions in candidate packets should be compared. The
 
237
// Mask field indicates which bits are to be compared and
 
238
// which bits are don't cares.
 
239
//
 
240
// Different filters can be submitted on the TCI interface.
 
241
// The generic filter structure is defined to include an
 
242
// AddressType, which indicates the specific type of filter to
 
243
// follow.
 
244
//
 
245
 
 
246
  PTC_GEN_FILTER = ^TC_GEN_FILTER;
 
247
  {$EXTERNALSYM PTC_GEN_FILTER}
 
248
  _TC_GEN_FILTER = record
 
249
    AddressType: USHORT; // IP, IPX, etc.
 
250
    PatternSize: ULONG; // byte count of the pattern
 
251
    Pattern: PVOID; // specific format, e.g. IP_PATTERN
 
252
    Mask: PVOID; // same type as Pattern
 
253
  end;
 
254
  {$EXTERNALSYM _TC_GEN_FILTER}
 
255
  TC_GEN_FILTER = _TC_GEN_FILTER;
 
256
  {$EXTERNALSYM TC_GEN_FILTER}
 
257
  TTcGenFilter = TC_GEN_FILTER;
 
258
  PTcGenFilter = PTC_GEN_FILTER;
 
259
 
 
260
//
 
261
// A generic flow includes two flowspecs and a freeform
 
262
// buffer which contains flow specific TC objects.
 
263
//
 
264
 
 
265
  PTC_GEN_FLOW = ^TC_GEN_FLOW;
 
266
  {$EXTERNALSYM PTC_GEN_FLOW}
 
267
  _TC_GEN_FLOW = record
 
268
    SendingFlowspec: FLOWSPEC;
 
269
    ReceivingFlowspec: FLOWSPEC;
 
270
    TcObjectsLength: ULONG; // number of optional bytes
 
271
    TcObjects: array [0..0] of QOS_OBJECT_HDR;
 
272
  end;
 
273
  {$EXTERNALSYM _TC_GEN_FLOW}
 
274
  TC_GEN_FLOW = _TC_GEN_FLOW;
 
275
  {$EXTERNALSYM TC_GEN_FLOW}
 
276
  TTcGenFlow = TC_GEN_FLOW;
 
277
  PTcGenFlow = PTC_GEN_FLOW;
 
278
 
 
279
//
 
280
// Format of specific pattern or mask used by GPC for the IP protocol
 
281
//
 
282
 
 
283
  PIP_PATTERN = ^IP_PATTERN;
 
284
  {$EXTERNALSYM PIP_PATTERN}
 
285
  _IP_PATTERN = record
 
286
    Reserved1: ULONG;
 
287
    Reserved2: ULONG;
 
288
    SrcAddr: ULONG;
 
289
    DstAddr: ULONG;
 
290
    S_un: record
 
291
    case Integer of
 
292
      0: (
 
293
        s_srcport: USHORT;
 
294
        s_dstport: USHORT);
 
295
      1: (
 
296
        s_type: UCHAR;
 
297
        s_code: UCHAR;
 
298
        filler: USHORT);
 
299
      2: (
 
300
        S_Spi: ULONG);
 
301
    end;
 
302
    ProtocolId: UCHAR;
 
303
    Reserved3: array [0..3 - 1] of UCHAR;
 
304
  end;
 
305
  {$EXTERNALSYM _IP_PATTERN}
 
306
  IP_PATTERN = _IP_PATTERN;
 
307
  {$EXTERNALSYM IP_PATTERN}
 
308
  TIpPattern = IP_PATTERN;
 
309
  PIpPattern = PIP_PATTERN;
 
310
 
 
311
//
 
312
// Format of specific pattern or mask used by GPC for the IPX protocol
 
313
//
 
314
 
 
315
  TIpxPatternAddress = record
 
316
    NetworkAddress: ULONG;
 
317
    NodeAddress: array [0..5] of UCHAR;
 
318
    Socket: USHORT;
 
319
  end;
 
320
 
 
321
  PIPX_PATTERN = ^IPX_PATTERN;
 
322
  {$EXTERNALSYM PIPX_PATTERN}
 
323
  _IPX_PATTERN = record
 
324
    Src: TIpxPatternAddress;
 
325
    Dest: TIpxPatternAddress;
 
326
  end;
 
327
  {$EXTERNALSYM _IPX_PATTERN}
 
328
  IPX_PATTERN = _IPX_PATTERN;
 
329
  {$EXTERNALSYM IPX_PATTERN}
 
330
  TIpxPattern = IPX_PATTERN;
 
331
  PIpxPattern = PIPX_PATTERN;
 
332
 
 
333
//
 
334
// The enumeration buffer is the flow parameters + a list of filters
 
335
//
 
336
 
 
337
  PENUMERATION_BUFFER = ^ENUMERATION_BUFFER;
 
338
  {$EXTERNALSYM PENUMERATION_BUFFER}
 
339
  _ENUMERATION_BUFFER = record
 
340
    Length: ULONG;
 
341
    OwnerProcessId: ULONG;
 
342
    FlowNameLength: USHORT;
 
343
    FlowName: array [0..MAX_STRING_LENGTH - 1] of WCHAR;
 
344
    pFlow: PTC_GEN_FLOW;
 
345
    NumberOfFilters: ULONG;
 
346
    GenericFilter: array [0..0] of TC_GEN_FILTER; // one for each filter
 
347
  end;
 
348
  {$EXTERNALSYM _ENUMERATION_BUFFER}
 
349
  ENUMERATION_BUFFER = _ENUMERATION_BUFFER;
 
350
  {$EXTERNALSYM ENUMERATION_BUFFER}
 
351
  TEnumerationBuffer = ENUMERATION_BUFFER;
 
352
  PEnumerationBuffer = PENUMERATION_BUFFER;
 
353
 
 
354
//
 
355
// QoS objects supported by traffic
 
356
//
 
357
 
 
358
const
 
359
  QOS_TRAFFIC_GENERAL_ID_BASE = 4000;
 
360
  {$EXTERNALSYM QOS_TRAFFIC_GENERAL_ID_BASE}
 
361
 
 
362
  QOS_OBJECT_DS_CLASS      = $00000001 + QOS_TRAFFIC_GENERAL_ID_BASE;
 
363
  {$EXTERNALSYM QOS_OBJECT_DS_CLASS}
 
364
  QOS_OBJECT_TRAFFIC_CLASS = $00000002 + QOS_TRAFFIC_GENERAL_ID_BASE;
 
365
  {$EXTERNALSYM QOS_OBJECT_TRAFFIC_CLASS}
 
366
  QOS_OBJECT_DIFFSERV      = $00000003 + QOS_TRAFFIC_GENERAL_ID_BASE;
 
367
  {$EXTERNALSYM QOS_OBJECT_DIFFSERV}
 
368
  QOS_OBJECT_TCP_TRAFFIC   = $00000004 + QOS_TRAFFIC_GENERAL_ID_BASE;
 
369
  {$EXTERNALSYM QOS_OBJECT_TCP_TRAFFIC}
 
370
  QOS_OBJECT_FRIENDLY_NAME = $00000005 + QOS_TRAFFIC_GENERAL_ID_BASE;
 
371
  {$EXTERNALSYM QOS_OBJECT_FRIENDLY_NAME}
 
372
 
 
373
//
 
374
// This structure is used to associate a friendly name with the flow
 
375
// 
 
376
 
 
377
type
 
378
  LPQOS_FRIENDLY_NAME = ^QOS_FRIENDLY_NAME;
 
379
  {$EXTERNALSYM LPQOS_FRIENDLY_NAME}
 
380
  _QOS_FRIENDLY_NAME = record
 
381
    ObjectHdr: QOS_OBJECT_HDR;
 
382
    FriendlyName: array [0..MAX_STRING_LENGTH - 1] of WCHAR;
 
383
  end;
 
384
  {$EXTERNALSYM _QOS_FRIENDLY_NAME}
 
385
  QOS_FRIENDLY_NAME = _QOS_FRIENDLY_NAME;
 
386
  {$EXTERNALSYM QOS_FRIENDLY_NAME}
 
387
  TQosFriendlyName = QOS_FRIENDLY_NAME;
 
388
  PQosFriendlyName = LPQOS_FRIENDLY_NAME;
 
389
 
 
390
//
 
391
// This structure may carry an 802.1 TrafficClass parameter which 
 
392
// has been provided to the host by a layer 2 network, for example, 
 
393
// in an 802.1 extended RSVP RESV message. If this object is obtained
 
394
// from the network, hosts will stamp the MAC headers of corresponding
 
395
// transmitted packets, with the value in the object. Otherwise, hosts
 
396
// may select a value based on the standard Intserv mapping of 
 
397
// ServiceType to 802.1 TrafficClass.
 
398
//
 
399
//
 
400
 
 
401
  LPQOS_TRAFFIC_CLASS = ^QOS_TRAFFIC_CLASS;
 
402
  {$EXTERNALSYM LPQOS_TRAFFIC_CLASS}
 
403
  _QOS_TRAFFIC_CLASS = record
 
404
    ObjectHdr: QOS_OBJECT_HDR;
 
405
    TrafficClass: ULONG;
 
406
  end;
 
407
  {$EXTERNALSYM _QOS_TRAFFIC_CLASS}
 
408
  QOS_TRAFFIC_CLASS = _QOS_TRAFFIC_CLASS;
 
409
  {$EXTERNALSYM QOS_TRAFFIC_CLASS}
 
410
  TQosTrafficClass = QOS_TRAFFIC_CLASS;
 
411
  PQosTrafficClass = LPQOS_TRAFFIC_CLASS;
 
412
 
 
413
//
 
414
// This structure may carry an DSField parameter which  has been provided to 
 
415
// the host by a layer 3 network, for example, in an extended RSVP RESV message. 
 
416
// If this object is obtained from the network, hosts will stamp the DS Field on the
 
417
// IP header of transmitted packets, with the value in the object. Otherwise, hosts
 
418
// may select a value based on the standard Intserv mapping of ServiceType to DS Field 
 
419
//
 
420
 
 
421
  LPQOS_DS_CLASS = ^QOS_DS_CLASS;
 
422
  {$EXTERNALSYM LPQOS_DS_CLASS}
 
423
  _QOS_DS_CLASS = record
 
424
    ObjectHdr: QOS_OBJECT_HDR;
 
425
    DSField: ULONG;
 
426
  end;
 
427
  {$EXTERNALSYM _QOS_DS_CLASS}
 
428
  QOS_DS_CLASS = _QOS_DS_CLASS;
 
429
  {$EXTERNALSYM QOS_DS_CLASS}
 
430
  TQosDsClass = QOS_DS_CLASS;
 
431
  PQosDsClass = LPQOS_DS_CLASS;
 
432
 
 
433
//
 
434
// This structure is used to create DiffServ Flows. This creates flows in the packet scheduler
 
435
// and allows it to classify to packets based on a particular DS field. This structure takes
 
436
// a variable length array of QOS_DIFFSERV_RULE, where each DS field is specified by a 
 
437
// QOS_DIFFSERV_RULE
 
438
//
 
439
  LPQOS_DIFFSERV = ^QOS_DIFFSERV;
 
440
  {$EXTERNALSYM LPQOS_DIFFSERV}
 
441
  _QOS_DIFFSERV = record
 
442
    ObjectHdr: QOS_OBJECT_HDR;
 
443
    DSFieldCount: ULONG;
 
444
    DiffservRule: array [0..0] of UCHAR;
 
445
  end;
 
446
  {$EXTERNALSYM _QOS_DIFFSERV}
 
447
  QOS_DIFFSERV = _QOS_DIFFSERV;
 
448
  {$EXTERNALSYM QOS_DIFFSERV}
 
449
  TQosDiffserv = QOS_DIFFSERV;
 
450
  PQosDiffserv = LPQOS_DIFFSERV;
 
451
 
 
452
//
 
453
// The rule for a Diffserv DS codepoint. 
 
454
//
 
455
 
 
456
  LPQOS_DIFFSERV_RULE = ^QOS_DIFFSERV_RULE;
 
457
  {$EXTERNALSYM LPQOS_DIFFSERV_RULE}
 
458
  _QOS_DIFFSERV_RULE = record
 
459
    InboundDSField: UCHAR;
 
460
    ConformingOutboundDSField: UCHAR;
 
461
    NonConformingOutboundDSField: UCHAR;
 
462
    ConformingUserPriority: UCHAR;
 
463
    NonConformingUserPriority: UCHAR;
 
464
  end;
 
465
  {$EXTERNALSYM _QOS_DIFFSERV_RULE}
 
466
  QOS_DIFFSERV_RULE = _QOS_DIFFSERV_RULE;
 
467
  {$EXTERNALSYM QOS_DIFFSERV_RULE}
 
468
  TQosDiffservRule = QOS_DIFFSERV_RULE;
 
469
  PQosDiffservRule = LPQOS_DIFFSERV_RULE;
 
470
 
 
471
// 
 
472
// This structure is passed to indicate that the IP Precedence and UserPriority mappings for the flow
 
473
// have to be set to the system defaults for TCP traffic. If this object is passed, 
 
474
// the ServiceType ==> DSField mapping, ServiceType ==> UserPriorityMapping, QOS_OBJECT_DS_CLASS
 
475
// and QOS_OBJECT_TRAFFIC_CLASS will be ignored.
 
476
//
 
477
 
 
478
  LPQOS_TCP_TRAFFIC = ^QOS_TCP_TRAFFIC;
 
479
  {$EXTERNALSYM LPQOS_TCP_TRAFFIC}
 
480
  _QOS_TCP_TRAFFIC = record
 
481
    ObjectHdr: QOS_OBJECT_HDR;
 
482
  end;
 
483
  {$EXTERNALSYM _QOS_TCP_TRAFFIC}
 
484
  QOS_TCP_TRAFFIC = _QOS_TCP_TRAFFIC;
 
485
  {$EXTERNALSYM QOS_TCP_TRAFFIC}
 
486
  TQosTcpTraffic = QOS_TCP_TRAFFIC;
 
487
  PQosTcpTraffic = LPQOS_TCP_TRAFFIC;
 
488
 
 
489
//---------------------------------------------------------------------------
 
490
//
 
491
// Interface Function Definitions
 
492
//
 
493
 
 
494
function TcRegisterClient(TciVersion: ULONG; ClRegCtx: HANDLE; const ClientHandlerList: TCI_CLIENT_FUNC_LIST; var pClientHandle: HANDLE): ULONG; stdcall;
 
495
{$EXTERNALSYM TcRegisterClient}
 
496
function TcEnumerateInterfaces(ClientHandle: HANDLE; var pBufferSize: ULONG; var InterfaceBuffer: TC_IFC_DESCRIPTOR): ULONG; stdcall;
 
497
{$EXTERNALSYM TcEnumerateInterfaces}
 
498
function TcOpenInterfaceA(pInterfaceName: LPSTR; ClientHandle, ClIfcCtx: HANDLE; var pIfcHandle: HANDLE): ULONG; stdcall;
 
499
{$EXTERNALSYM TcOpenInterfaceA}
 
500
function TcOpenInterfaceW(pInterfaceName: LPWSTR; ClientHandle, ClIfcCtx: HANDLE; var pIfcHandle: HANDLE): ULONG; stdcall;
 
501
{$EXTERNALSYM TcOpenInterfaceW}
 
502
function TcCloseInterface(IfcHandle: HANDLE): ULONG; stdcall;
 
503
{$EXTERNALSYM TcCloseInterface}
 
504
function TcQueryInterface(IfcHandle: HANDLE; const pGuidParam: GUID; NotifyChange: Longbool; var pBufferSize: ULONG; Buffer: PVOID): ULONG; stdcall;
 
505
{$EXTERNALSYM TcQueryInterface}
 
506
function TcSetInterface(IfcHandle: HANDLE; const pGuidParam: GUID; BufferSize: ULONG; Buffer: PVOID): ULONG; stdcall;
 
507
{$EXTERNALSYM TcSetInterface}
 
508
function TcQueryFlowA(pFlowName: LPSTR; const pGuidParam: GUID; var pBufferSize: ULONG; Buffer: PVOID): ULONG; stdcall;
 
509
{$EXTERNALSYM TcQueryFlowA}
 
510
function TcQueryFlowW(pFlowName: LPWSTR; const pGuidParam: GUID; var pBufferSize: ULONG; Buffer: PVOID): ULONG; stdcall;
 
511
{$EXTERNALSYM TcQueryFlowW}
 
512
function TcSetFlowA(pFlowName: LPSTR; const pGuidParam: GUID; BufferSize: GUID; Buffer: PVOID): ULONG; stdcall;
 
513
{$EXTERNALSYM TcSetFlowA}
 
514
function TcSetFlowW(pFlowName: LPWSTR; const pGuidParam: GUID; BufferSize: GUID; Buffer: PVOID): ULONG; stdcall;
 
515
{$EXTERNALSYM TcSetFlowW}
 
516
function TcAddFlow(IfcHandle, ClFlowCtx: HANDLE; Flags: ULONG; const pGenericFlow: TC_GEN_FLOW; var pFlowHandle: HANDLE): ULONG; stdcall;
 
517
{$EXTERNALSYM TcAddFlow}
 
518
function TcGetFlowNameA(FlowHandle: HANDLE; StrSize: ULONG; pFlowName: LPSTR): ULONG; stdcall;
 
519
{$EXTERNALSYM TcGetFlowNameA}
 
520
function TcGetFlowNameW(FlowHandle: HANDLE; StrSize: ULONG; pFlowName: LPWSTR): ULONG; stdcall;
 
521
{$EXTERNALSYM TcGetFlowNameW}
 
522
function TcModifyFlow(FlowHandle: HANDLE; const pGenericFlow: TC_GEN_FLOW): ULONG; stdcall;
 
523
{$EXTERNALSYM TcModifyFlow}
 
524
function TcAddFilter(FlowHandle: HANDLE; const pGenericFilter: TC_GEN_FILTER; var pFilterHandle: HANDLE): ULONG; stdcall;
 
525
{$EXTERNALSYM TcAddFilter}
 
526
function TcDeregisterClient(ClientHandle: HANDLE): ULONG; stdcall;
 
527
{$EXTERNALSYM TcDeregisterClient}
 
528
function TcDeleteFlow(FlowHandle: HANDLE): ULONG; stdcall;
 
529
{$EXTERNALSYM TcDeleteFlow}
 
530
function TcDeleteFilter(FilterHandle: HANDLE): ULONG; stdcall;
 
531
{$EXTERNALSYM TcDeleteFilter}
 
532
function TcEnumerateFlows(IfcHandle: HANDLE; var pEnumHandle: HANDLE; var pFlowCount, pBufSize: ULONG; var Buffer: ENUMERATION_BUFFER): ULONG; stdcall;
 
533
{$EXTERNALSYM TcEnumerateFlows}
 
534
 
 
535
function TcOpenInterface(pInterfaceName: LPTSTR; ClientHandle, ClIfcCtx: HANDLE; var pIfcHandle: HANDLE): ULONG; stdcall;
 
536
{$EXTERNALSYM TcOpenInterface}
 
537
function TcQueryFlow(pFlowName: LPTSTR; const pGuidParam: GUID; var pBufferSize: ULONG; Buffer: PVOID): ULONG; stdcall;
 
538
{$EXTERNALSYM TcQueryFlow}
 
539
function TcSetFlow(pFlowName: LPTSTR; const pGuidParam: GUID; BufferSize: GUID; Buffer: PVOID): ULONG; stdcall;
 
540
{$EXTERNALSYM TcSetFlow}
 
541
function TcGetFlowName(FlowHandle: HANDLE; StrSize: ULONG; pFlowName: LPTSTR): ULONG; stdcall;
 
542
{$EXTERNALSYM TcGetFlowName}
 
543
 
 
544
implementation
 
545
 
 
546
uses
 
547
  JwaWinDLLNames;
 
548
 
 
549
{$IFDEF DYNAMIC_LINK}
 
550
 
 
551
var
 
552
  _TcRegisterClient: Pointer;
 
553
 
 
554
function TcRegisterClient;
 
555
begin
 
556
  GetProcedureAddress(_TcRegisterClient, trafficlib, 'TcRegisterClient');
 
557
  asm
 
558
        MOV     ESP, EBP
 
559
        POP     EBP
 
560
        JMP     [_TcRegisterClient]
 
561
  end;
 
562
end;
 
563
 
 
564
var
 
565
  _TcEnumerateInterfaces: Pointer;
 
566
 
 
567
function TcEnumerateInterfaces;
 
568
begin
 
569
  GetProcedureAddress(_TcEnumerateInterfaces, trafficlib, 'TcEnumerateInterfaces');
 
570
  asm
 
571
        MOV     ESP, EBP
 
572
        POP     EBP
 
573
        JMP     [_TcEnumerateInterfaces]
 
574
  end;
 
575
end;
 
576
 
 
577
var
 
578
  _TcOpenInterfaceA: Pointer;
 
579
 
 
580
function TcOpenInterfaceA;
 
581
begin
 
582
  GetProcedureAddress(_TcOpenInterfaceA, trafficlib, 'TcOpenInterfaceA');
 
583
  asm
 
584
        MOV     ESP, EBP
 
585
        POP     EBP
 
586
        JMP     [_TcOpenInterfaceA]
 
587
  end;
 
588
end;
 
589
 
 
590
var
 
591
  _TcOpenInterfaceW: Pointer;
 
592
 
 
593
function TcOpenInterfaceW;
 
594
begin
 
595
  GetProcedureAddress(_TcOpenInterfaceW, trafficlib, 'TcOpenInterfaceW');
 
596
  asm
 
597
        MOV     ESP, EBP
 
598
        POP     EBP
 
599
        JMP     [_TcOpenInterfaceW]
 
600
  end;
 
601
end;
 
602
 
 
603
var
 
604
  _TcCloseInterface: Pointer;
 
605
 
 
606
function TcCloseInterface;
 
607
begin
 
608
  GetProcedureAddress(_TcCloseInterface, trafficlib, 'TcCloseInterface');
 
609
  asm
 
610
        MOV     ESP, EBP
 
611
        POP     EBP
 
612
        JMP     [_TcCloseInterface]
 
613
  end;
 
614
end;
 
615
 
 
616
var
 
617
  _TcQueryInterface: Pointer;
 
618
 
 
619
function TcQueryInterface;
 
620
begin
 
621
  GetProcedureAddress(_TcQueryInterface, trafficlib, 'TcQueryInterface');
 
622
  asm
 
623
        MOV     ESP, EBP
 
624
        POP     EBP
 
625
        JMP     [_TcQueryInterface]
 
626
  end;
 
627
end;
 
628
 
 
629
var
 
630
  _TcSetInterface: Pointer;
 
631
 
 
632
function TcSetInterface;
 
633
begin
 
634
  GetProcedureAddress(_TcSetInterface, trafficlib, 'TcSetInterface');
 
635
  asm
 
636
        MOV     ESP, EBP
 
637
        POP     EBP
 
638
        JMP     [_TcSetInterface]
 
639
  end;
 
640
end;
 
641
 
 
642
var
 
643
  _TcQueryFlowA: Pointer;
 
644
 
 
645
function TcQueryFlowA;
 
646
begin
 
647
  GetProcedureAddress(_TcQueryFlowA, trafficlib, 'TcQueryFlowA');
 
648
  asm
 
649
        MOV     ESP, EBP
 
650
        POP     EBP
 
651
        JMP     [_TcQueryFlowA]
 
652
  end;
 
653
end;
 
654
 
 
655
var
 
656
  _TcQueryFlowW: Pointer;
 
657
 
 
658
function TcQueryFlowW;
 
659
begin
 
660
  GetProcedureAddress(_TcQueryFlowW, trafficlib, 'TcQueryFlowW');
 
661
  asm
 
662
        MOV     ESP, EBP
 
663
        POP     EBP
 
664
        JMP     [_TcQueryFlowW]
 
665
  end;
 
666
end;
 
667
 
 
668
var
 
669
  _TcSetFlowA: Pointer;
 
670
 
 
671
function TcSetFlowA;
 
672
begin
 
673
  GetProcedureAddress(_TcSetFlowA, trafficlib, 'TcSetFlowA');
 
674
  asm
 
675
        MOV     ESP, EBP
 
676
        POP     EBP
 
677
        JMP     [_TcSetFlowA]
 
678
  end;
 
679
end;
 
680
 
 
681
var
 
682
  _TcSetFlowW: Pointer;
 
683
 
 
684
function TcSetFlowW;
 
685
begin
 
686
  GetProcedureAddress(_TcSetFlowW, trafficlib, 'TcSetFlowW');
 
687
  asm
 
688
        MOV     ESP, EBP
 
689
        POP     EBP
 
690
        JMP     [_TcSetFlowW]
 
691
  end;
 
692
end;
 
693
 
 
694
var
 
695
  _TcAddFlow: Pointer;
 
696
 
 
697
function TcAddFlow;
 
698
begin
 
699
  GetProcedureAddress(_TcAddFlow, trafficlib, 'TcAddFlow');
 
700
  asm
 
701
        MOV     ESP, EBP
 
702
        POP     EBP
 
703
        JMP     [_TcAddFlow]
 
704
  end;
 
705
end;
 
706
 
 
707
var
 
708
  _TcGetFlowNameA: Pointer;
 
709
 
 
710
function TcGetFlowNameA;
 
711
begin
 
712
  GetProcedureAddress(_TcGetFlowNameA, trafficlib, 'TcGetFlowNameA');
 
713
  asm
 
714
        MOV     ESP, EBP
 
715
        POP     EBP
 
716
        JMP     [_TcGetFlowNameA]
 
717
  end;
 
718
end;
 
719
 
 
720
var
 
721
  _TcGetFlowNameW: Pointer;
 
722
 
 
723
function TcGetFlowNameW;
 
724
begin
 
725
  GetProcedureAddress(_TcGetFlowNameW, trafficlib, 'TcGetFlowNameW');
 
726
  asm
 
727
        MOV     ESP, EBP
 
728
        POP     EBP
 
729
        JMP     [_TcGetFlowNameW]
 
730
  end;
 
731
end;
 
732
 
 
733
var
 
734
  _TcModifyFlow: Pointer;
 
735
 
 
736
function TcModifyFlow;
 
737
begin
 
738
  GetProcedureAddress(_TcModifyFlow, trafficlib, 'TcModifyFlow');
 
739
  asm
 
740
        MOV     ESP, EBP
 
741
        POP     EBP
 
742
        JMP     [_TcModifyFlow]
 
743
  end;
 
744
end;
 
745
 
 
746
var
 
747
  _TcAddFilter: Pointer;
 
748
 
 
749
function TcAddFilter;
 
750
begin
 
751
  GetProcedureAddress(_TcAddFilter, trafficlib, 'TcAddFilter');
 
752
  asm
 
753
        MOV     ESP, EBP
 
754
        POP     EBP
 
755
        JMP     [_TcAddFilter]
 
756
  end;
 
757
end;
 
758
 
 
759
var
 
760
  _TcDeregisterClient: Pointer;
 
761
 
 
762
function TcDeregisterClient;
 
763
begin
 
764
  GetProcedureAddress(_TcDeregisterClient, trafficlib, 'TcDeregisterClient');
 
765
  asm
 
766
        MOV     ESP, EBP
 
767
        POP     EBP
 
768
        JMP     [_TcDeregisterClient]
 
769
  end;
 
770
end;
 
771
 
 
772
var
 
773
  _TcDeleteFlow: Pointer;
 
774
 
 
775
function TcDeleteFlow;
 
776
begin
 
777
  GetProcedureAddress(_TcDeleteFlow, trafficlib, 'TcDeleteFlow');
 
778
  asm
 
779
        MOV     ESP, EBP
 
780
        POP     EBP
 
781
        JMP     [_TcDeleteFlow]
 
782
  end;
 
783
end;
 
784
 
 
785
var
 
786
  _TcDeleteFilter: Pointer;
 
787
 
 
788
function TcDeleteFilter;
 
789
begin
 
790
  GetProcedureAddress(_TcDeleteFilter, trafficlib, 'TcDeleteFilter');
 
791
  asm
 
792
        MOV     ESP, EBP
 
793
        POP     EBP
 
794
        JMP     [_TcDeleteFilter]
 
795
  end;
 
796
end;
 
797
 
 
798
var
 
799
  _TcEnumerateFlows: Pointer;
 
800
 
 
801
function TcEnumerateFlows;
 
802
begin
 
803
  GetProcedureAddress(_TcEnumerateFlows, trafficlib, 'TcEnumerateFlows');
 
804
  asm
 
805
        MOV     ESP, EBP
 
806
        POP     EBP
 
807
        JMP     [_TcEnumerateFlows]
 
808
  end;
 
809
end;
 
810
 
 
811
var
 
812
  _TcOpenInterface: Pointer;
 
813
 
 
814
function TcOpenInterface;
 
815
begin
 
816
  GetProcedureAddress(_TcOpenInterface, trafficlib, 'TcOpenInterface' + AWSuffix);
 
817
  asm
 
818
        MOV     ESP, EBP
 
819
        POP     EBP
 
820
        JMP     [_TcOpenInterface]
 
821
  end;
 
822
end;
 
823
 
 
824
var
 
825
  _TcQueryFlow: Pointer;
 
826
 
 
827
function TcQueryFlow;
 
828
begin
 
829
  GetProcedureAddress(_TcQueryFlow, trafficlib, 'TcQueryFlow' + AWSuffix);
 
830
  asm
 
831
        MOV     ESP, EBP
 
832
        POP     EBP
 
833
        JMP     [_TcQueryFlow]
 
834
  end;
 
835
end;
 
836
 
 
837
var
 
838
  _TcSetFlow: Pointer;
 
839
 
 
840
function TcSetFlow;
 
841
begin
 
842
  GetProcedureAddress(_TcSetFlow, trafficlib, 'TcSetFlow' + AWSuffix);
 
843
  asm
 
844
        MOV     ESP, EBP
 
845
        POP     EBP
 
846
        JMP     [_TcSetFlow]
 
847
  end;
 
848
end;
 
849
 
 
850
var
 
851
  _TcGetFlowName: Pointer;
 
852
 
 
853
function TcGetFlowName;
 
854
begin
 
855
  GetProcedureAddress(_TcGetFlowName, trafficlib, 'TcGetFlowName' + AWSuffix);
 
856
  asm
 
857
        MOV     ESP, EBP
 
858
        POP     EBP
 
859
        JMP     [_TcGetFlowName]
 
860
  end;
 
861
end;
 
862
 
 
863
{$ELSE}
 
864
 
 
865
function TcRegisterClient; external trafficlib name 'TcRegisterClient';
 
866
function TcEnumerateInterfaces; external trafficlib name 'TcEnumerateInterfaces';
 
867
function TcOpenInterfaceA; external trafficlib name 'TcOpenInterfaceA';
 
868
function TcOpenInterfaceW; external trafficlib name 'TcOpenInterfaceW';
 
869
function TcCloseInterface; external trafficlib name 'TcCloseInterface';
 
870
function TcQueryInterface; external trafficlib name 'TcQueryInterface';
 
871
function TcSetInterface; external trafficlib name 'TcSetInterface';
 
872
function TcQueryFlowA; external trafficlib name 'TcQueryFlowA';
 
873
function TcQueryFlowW; external trafficlib name 'TcQueryFlowW';
 
874
function TcSetFlowA; external trafficlib name 'TcSetFlowA';
 
875
function TcSetFlowW; external trafficlib name 'TcSetFlowW';
 
876
function TcAddFlow; external trafficlib name 'TcAddFlow';
 
877
function TcGetFlowNameA; external trafficlib name 'TcGetFlowNameA';
 
878
function TcGetFlowNameW; external trafficlib name 'TcGetFlowNameW';
 
879
function TcModifyFlow; external trafficlib name 'TcModifyFlow';
 
880
function TcAddFilter; external trafficlib name 'TcAddFilter';
 
881
function TcDeregisterClient; external trafficlib name 'TcDeregisterClient';
 
882
function TcDeleteFlow; external trafficlib name 'TcDeleteFlow';
 
883
function TcDeleteFilter; external trafficlib name 'TcDeleteFilter';
 
884
function TcEnumerateFlows; external trafficlib name 'TcEnumerateFlows';
 
885
function TcOpenInterface; external trafficlib name 'TcOpenInterface' + AWSuffix;
 
886
function TcQueryFlow; external trafficlib name 'TcQueryFlow' + AWSuffix;
 
887
function TcSetFlow; external trafficlib name 'TcSetFlow' + AWSuffix;
 
888
function TcGetFlowName; external trafficlib name 'TcGetFlowName' + AWSuffix;
 
889
 
 
890
{$ENDIF DYNAMIC_LINK}
 
891
 
 
892
end.