1 | /**
|
---|
2 | * This file has no copyright assigned and is placed in the Public Domain.
|
---|
3 | * This file is part of the mingw-w64 runtime package.
|
---|
4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
---|
5 | */
|
---|
6 | #ifndef __LPMAPI_H_
|
---|
7 | #define __LPMAPI_H_
|
---|
8 |
|
---|
9 | #ifdef __cplusplus
|
---|
10 | extern "C" {
|
---|
11 | #endif
|
---|
12 |
|
---|
13 | #ifndef CALLBACK
|
---|
14 | #if defined(_ARM_)
|
---|
15 | #define CALLBACK
|
---|
16 | #else
|
---|
17 | #define CALLBACK __stdcall
|
---|
18 | #endif
|
---|
19 | #endif
|
---|
20 |
|
---|
21 | #ifndef WINAPI
|
---|
22 | #if defined(_ARM_)
|
---|
23 | #define WINAPI
|
---|
24 | #else
|
---|
25 | #define WINAPI __stdcall
|
---|
26 | #endif
|
---|
27 | #endif
|
---|
28 |
|
---|
29 | #ifndef APIENTRY
|
---|
30 | #define APIENTRY WINAPI
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | typedef struct {
|
---|
34 | USHORT obj_length;
|
---|
35 | UCHAR obj_class;
|
---|
36 | UCHAR obj_ctype;
|
---|
37 | } RsvpObjHdr;
|
---|
38 |
|
---|
39 | #define ObjLength(x) ((RsvpObjHdr *)x)->obj_length
|
---|
40 | #define ObjCType(x) ((RsvpObjHdr *)x)->obj_ctype
|
---|
41 | #define ObjClass(x) ((RsvpObjHdr *)x)->obj_class
|
---|
42 | #define ObjData(x) ((RsvpObjHdr *)(x)+1)
|
---|
43 |
|
---|
44 | #define class_NULL 0
|
---|
45 | #define class_SESSION 1
|
---|
46 | #define class_SESSION_GROUP 2
|
---|
47 | #define class_RSVP_HOP 3
|
---|
48 | #define class_INTEGRITY 4
|
---|
49 | #define class_TIME_VALUES 5
|
---|
50 | #define class_ERROR_SPEC 6
|
---|
51 | #define class_SCOPE 7
|
---|
52 | #define class_STYLE 8
|
---|
53 | #define class_FLOWSPEC 9
|
---|
54 | #define class_IS_FLOWSPEC 9
|
---|
55 | #define class_FILTER_SPEC 10
|
---|
56 | #define class_SENDER_TEMPLATE 11
|
---|
57 | #define class_SENDER_TSPEC 12
|
---|
58 | #define class_ADSPEC 13
|
---|
59 | #define class_POLICY_DATA 14
|
---|
60 | #define class_CONFIRM 15
|
---|
61 | #define class_MAX 15
|
---|
62 |
|
---|
63 | #define ctype_SESSION_ipv4 1
|
---|
64 | #define ctype_SESSION_ipv4GPI 3
|
---|
65 |
|
---|
66 | #define SESSFLG_E_Police 0x01
|
---|
67 |
|
---|
68 | typedef struct {
|
---|
69 | IN_ADDR sess_destaddr;
|
---|
70 | UCHAR sess_protid;
|
---|
71 | UCHAR sess_flags;
|
---|
72 | USHORT sess_destport;
|
---|
73 | } Session_IPv4;
|
---|
74 |
|
---|
75 | typedef struct {
|
---|
76 | RsvpObjHdr sess_header;
|
---|
77 | union {
|
---|
78 | Session_IPv4 sess_ipv4;
|
---|
79 | } sess_u;
|
---|
80 | } RSVP_SESSION;
|
---|
81 |
|
---|
82 | #define Sess4Addr sess_u.sess_ipv4.sess_destaddr
|
---|
83 | #define Sess4Port sess_u.sess_ipv4.sess_destport
|
---|
84 | #define Sess4Protocol sess_u.sess_ipv4.sess_protid
|
---|
85 | #define Sess4Flags sess_u.sess_ipv4.sess_flags
|
---|
86 |
|
---|
87 | #define ctype_RSVP_HOP_ipv4 1
|
---|
88 |
|
---|
89 | typedef struct {
|
---|
90 | IN_ADDR hop_ipaddr;
|
---|
91 | ULONG hop_LIH;
|
---|
92 | } Rsvp_Hop_IPv4;
|
---|
93 |
|
---|
94 | typedef struct {
|
---|
95 | RsvpObjHdr hop_header;
|
---|
96 | union {
|
---|
97 | Rsvp_Hop_IPv4 hop_ipv4;
|
---|
98 | } hop_u;
|
---|
99 | } RSVP_HOP;
|
---|
100 |
|
---|
101 | #define Hop4LIH hop_u.hop_ipv4.hop_LIH
|
---|
102 | #define Hop4Addr hop_u.hop_ipv4.hop_ipaddr
|
---|
103 |
|
---|
104 | #define Opt_Share_mask 0x00000018
|
---|
105 | #define Opt_Distinct 0x00000008
|
---|
106 | #define Opt_Shared 0x00000010
|
---|
107 |
|
---|
108 | #define Opt_SndSel_mask 0x00000007
|
---|
109 | #define Opt_Wildcard 0x00000001
|
---|
110 | #define Opt_Explicit 0x00000002
|
---|
111 |
|
---|
112 | #define Style_is_Wildcard(p) (((p)&Opt_SndSel_mask)==Opt_Wildcard)
|
---|
113 | #define Style_is_Shared(p) (((p)&Opt_Share_mask)==Opt_Shared)
|
---|
114 |
|
---|
115 | #define STYLE_WF Opt_Shared + Opt_Wildcard
|
---|
116 | #define STYLE_FF Opt_Distinct + Opt_Explicit
|
---|
117 | #define STYLE_SE Opt_Shared + Opt_Explicit
|
---|
118 |
|
---|
119 | #define ctype_STYLE 1
|
---|
120 |
|
---|
121 | typedef struct {
|
---|
122 | RsvpObjHdr style_header;
|
---|
123 | ULONG style_word;
|
---|
124 | } RESV_STYLE;
|
---|
125 |
|
---|
126 | #define ctype_FILTER_SPEC_ipv4 1
|
---|
127 | #define ctype_FILTER_SPEC_ipv4GPI 4
|
---|
128 |
|
---|
129 | typedef struct {
|
---|
130 | IN_ADDR filt_ipaddr;
|
---|
131 | USHORT filt_unused;
|
---|
132 | USHORT filt_port;
|
---|
133 | } Filter_Spec_IPv4;
|
---|
134 |
|
---|
135 | typedef struct {
|
---|
136 | IN_ADDR filt_ipaddr;
|
---|
137 | ULONG filt_gpi;
|
---|
138 | } Filter_Spec_IPv4GPI;
|
---|
139 |
|
---|
140 | typedef struct {
|
---|
141 | RsvpObjHdr filt_header;
|
---|
142 | union {
|
---|
143 | Filter_Spec_IPv4 filt_ipv4;
|
---|
144 | Filter_Spec_IPv4GPI filt_ipv4gpi;
|
---|
145 | } filt_u;
|
---|
146 | } FILTER_SPEC;
|
---|
147 |
|
---|
148 | #define FilterSrcaddr filt_u.filt_ipv4.filt_ipaddr
|
---|
149 | #define FilterSrcport filt_u.filt_ipv4.filt_port
|
---|
150 |
|
---|
151 | #define ctype_SENDER_TEMPLATE_ipv4 1
|
---|
152 | #define ctype_SENDER_TEMPLATE_ipv4GPI 4
|
---|
153 |
|
---|
154 | typedef FILTER_SPEC SENDER_TEMPLATE;
|
---|
155 |
|
---|
156 | #define ctype_SCOPE_list_ipv4 1
|
---|
157 |
|
---|
158 | typedef struct {
|
---|
159 | IN_ADDR scopl_ipaddr[1];
|
---|
160 | } Scope_list_ipv4;
|
---|
161 |
|
---|
162 | typedef struct {
|
---|
163 | RsvpObjHdr scopl_header;
|
---|
164 | union {
|
---|
165 | Scope_list_ipv4 scopl_ipv4;
|
---|
166 | } scope_u;
|
---|
167 | } RSVP_SCOPE;
|
---|
168 |
|
---|
169 | #define Scope4Addr scope_u.scopl_ipv4.scopl_ipaddr
|
---|
170 | #define ScopeCnt(scp) ((ObjLength(scp)-sizeof(RsvpObjHdr))/sizeof(struct in_addr))
|
---|
171 | #define ScopeLen(cnt) (cnt*sizeof(struct in_addr)+sizeof(RsvpObjHdr))
|
---|
172 |
|
---|
173 | #define ctype_ERROR_SPEC_ipv4 1
|
---|
174 |
|
---|
175 | #define ERROR_SPECF_InPlace 0x01
|
---|
176 | #define ERROR_SPECF_NotGuilty 0x02
|
---|
177 |
|
---|
178 | #define ERR_FORWARD_OK 0x8000
|
---|
179 | #define Error_Usage(x) (((x)>>12)&3)
|
---|
180 | #define ERR_Usage_globl 0x00
|
---|
181 | #define ERR_Usage_local 0x10
|
---|
182 | #define ERR_Usage_serv 0x11
|
---|
183 | #define ERR_global_mask 0x0fff
|
---|
184 |
|
---|
185 | typedef struct {
|
---|
186 | struct in_addr errs_errnode;
|
---|
187 | u_char errs_flags;
|
---|
188 | UCHAR errs_code;
|
---|
189 | USHORT errs_value;
|
---|
190 | } Error_Spec_IPv4;
|
---|
191 |
|
---|
192 | typedef struct {
|
---|
193 | RsvpObjHdr errs_header;
|
---|
194 | union {
|
---|
195 | Error_Spec_IPv4 errs_ipv4;
|
---|
196 | } errs_u;
|
---|
197 | } ERROR_SPEC;
|
---|
198 |
|
---|
199 | #define errspec4_enode errs_u.errs_ipv4.errs_errnode
|
---|
200 | #define errspec4_code errs_u.errs_ipv4.errs_code
|
---|
201 | #define errspec4_value errs_u.errs_ipv4.errs_value
|
---|
202 | #define errspec4_flags errs_u.errs_ipv4.errs_flags
|
---|
203 |
|
---|
204 | #define ctype_POLICY_DATA 1
|
---|
205 |
|
---|
206 | typedef struct {
|
---|
207 | RsvpObjHdr PolicyObjHdr;
|
---|
208 | USHORT usPeOffset;
|
---|
209 | USHORT usReserved;
|
---|
210 | } POLICY_DATA;
|
---|
211 |
|
---|
212 | #define PD_HDR_LEN sizeof(POLICY_DATA)
|
---|
213 |
|
---|
214 | typedef struct {
|
---|
215 | USHORT usPeLength;
|
---|
216 | USHORT usPeType;
|
---|
217 | UCHAR ucPeData[4];
|
---|
218 | } POLICY_ELEMENT;
|
---|
219 |
|
---|
220 | #define PE_HDR_LEN (2 *sizeof(USHORT))
|
---|
221 |
|
---|
222 | #define GENERAL_INFO 1
|
---|
223 | #define GUARANTEED_SERV 2
|
---|
224 | #define PREDICTIVE_SERV 3
|
---|
225 | #define CONTROLLED_DELAY_SERV 4
|
---|
226 | #define CONTROLLED_LOAD_SERV 5
|
---|
227 | #define QUALITATIVE_SERV 6
|
---|
228 |
|
---|
229 | enum int_serv_wkp {
|
---|
230 | IS_WKP_HOP_CNT = 4,IS_WKP_PATH_BW = 6,IS_WKP_MIN_LATENCY = 8,IS_WKP_COMPOSED_MTU = 10,IS_WKP_TB_TSPEC = 127,IS_WKP_Q_TSPEC = 128
|
---|
231 | };
|
---|
232 |
|
---|
233 | typedef struct {
|
---|
234 | UCHAR ismh_version;
|
---|
235 | UCHAR ismh_unused;
|
---|
236 | USHORT ismh_len32b;
|
---|
237 | } IntServMainHdr;
|
---|
238 |
|
---|
239 | #define INTSERV_VERS_MASK 0xf0
|
---|
240 | #define INTSERV_VERSION0 0
|
---|
241 | #define Intserv_Version(x) (((x)&INTSERV_VERS_MASK)>>4)
|
---|
242 | #define Intserv_Version_OK(x) (((x)->ismh_version&INTSERV_VERS_MASK)== INTSERV_VERSION0)
|
---|
243 | #define Intserv_Obj_size(x) (((IntServMainHdr *)(x))->ismh_len32b *4 + sizeof(IntServMainHdr) + sizeof(RsvpObjHdr))
|
---|
244 |
|
---|
245 | #define ISSH_BREAK_BIT 0x80
|
---|
246 |
|
---|
247 | typedef struct {
|
---|
248 | UCHAR issh_service;
|
---|
249 | UCHAR issh_flags;
|
---|
250 | USHORT issh_len32b;
|
---|
251 | } IntServServiceHdr;
|
---|
252 |
|
---|
253 | #define Issh_len32b(p) ((p)->issh_len32b)
|
---|
254 |
|
---|
255 | #define ISPH_FLG_INV 0x80
|
---|
256 |
|
---|
257 | typedef struct {
|
---|
258 | UCHAR isph_parm_num;
|
---|
259 | UCHAR isph_flags;
|
---|
260 | USHORT isph_len32b;
|
---|
261 | } IntServParmHdr;
|
---|
262 |
|
---|
263 | #define Next_Main_Hdr(p) (IntServMainHdr *)((ULONG *)(p)+1+(p)->ismh_len32b)
|
---|
264 | #define Next_Serv_Hdr(p) (IntServServiceHdr *)((ULONG *)(p)+1+(p)->issh_len32b)
|
---|
265 | #define Next_Parm_Hdr(p) (IntServParmHdr *)((ULONG *)(p)+1+(p)->isph_len32b)
|
---|
266 |
|
---|
267 | typedef struct {
|
---|
268 | FLOAT TB_Tspec_r;
|
---|
269 | FLOAT TB_Tspec_b;
|
---|
270 | FLOAT TB_Tspec_p;
|
---|
271 | ULONG TB_Tspec_m;
|
---|
272 | ULONG TB_Tspec_M;
|
---|
273 | } GenTspecParms;
|
---|
274 |
|
---|
275 | typedef struct {
|
---|
276 | IntServServiceHdr gen_Tspec_serv_hdr;
|
---|
277 | IntServParmHdr gen_Tspec_parm_hdr;
|
---|
278 | GenTspecParms gen_Tspec_parms;
|
---|
279 | } GenTspec;
|
---|
280 |
|
---|
281 | #define gtspec_r gen_Tspec_parms.TB_Tspec_r
|
---|
282 | #define gtspec_b gen_Tspec_parms.TB_Tspec_b
|
---|
283 | #define gtspec_m gen_Tspec_parms.TB_Tspec_m
|
---|
284 | #define gtspec_M gen_Tspec_parms.TB_Tspec_M
|
---|
285 | #define gtspec_p gen_Tspec_parms.TB_Tspec_p
|
---|
286 | #define gtspec_parmno gen_Tspec_parm_hdr.isph_parm_num
|
---|
287 | #define gtspec_flags gen_Tspec_parm_hdr.isph_flags
|
---|
288 | #define gtspec_len (sizeof(GenTspec) - sizeof(IntServServiceHdr))
|
---|
289 |
|
---|
290 | typedef struct {
|
---|
291 | ULONG TB_Tspec_M;
|
---|
292 | } QualTspecParms;
|
---|
293 |
|
---|
294 | typedef struct {
|
---|
295 | IntServServiceHdr qual_Tspec_serv_hdr;
|
---|
296 | IntServParmHdr qual_Tspec_parm_hdr;
|
---|
297 | QualTspecParms qual_Tspec_parms;
|
---|
298 | } QualTspec;
|
---|
299 |
|
---|
300 | typedef struct {
|
---|
301 | IntServServiceHdr Q_spec_serv_hdr;
|
---|
302 | IntServParmHdr Q_spec_parm_hdr;
|
---|
303 | QualTspecParms Q_spec_parms;
|
---|
304 | } QualAppFlowSpec;
|
---|
305 |
|
---|
306 | #define QAspec_M Q_spec_parms.TB_Tspec_M
|
---|
307 |
|
---|
308 | typedef struct {
|
---|
309 | IntServMainHdr st_mh;
|
---|
310 | union {
|
---|
311 | GenTspec gen_stspec;
|
---|
312 | QualTspec qual_stspec;
|
---|
313 | } tspec_u;
|
---|
314 | } IntServTspecBody;
|
---|
315 |
|
---|
316 | #define ctype_SENDER_TSPEC 2
|
---|
317 |
|
---|
318 | typedef struct {
|
---|
319 | RsvpObjHdr stspec_header;
|
---|
320 | IntServTspecBody stspec_body;
|
---|
321 | } SENDER_TSPEC;
|
---|
322 |
|
---|
323 | typedef struct {
|
---|
324 | IntServServiceHdr CL_spec_serv_hdr;
|
---|
325 | IntServParmHdr CL_spec_parm_hdr;
|
---|
326 | GenTspecParms CL_spec_parms;
|
---|
327 | } CtrlLoadFlowspec;
|
---|
328 |
|
---|
329 | #define CLspec_r CL_spec_parms.TB_Tspec_r
|
---|
330 | #define CLspec_b CL_spec_parms.TB_Tspec_b
|
---|
331 | #define CLspec_p CL_spec_parms.TB_Tspec_p
|
---|
332 | #define CLspec_m CL_spec_parms.TB_Tspec_m
|
---|
333 | #define CLspec_M CL_spec_parms.TB_Tspec_M
|
---|
334 | #define CLspec_parmno CL_spec_parm_hdr.isph_parm_num
|
---|
335 | #define CLspec_flags CL_spec_parm_hdr.isph_flags
|
---|
336 | #define CLspec_len32b CL_spec_parm_hdr.isph_len32b
|
---|
337 | #define CLspec_len (sizeof(CtrlLoadFlowspec) - sizeof(IntServServiceHdr))
|
---|
338 |
|
---|
339 | enum {
|
---|
340 | IS_GUAR_RSPEC = 130,GUAR_ADSPARM_C = 131,GUAR_ADSPARM_D = 132,GUAR_ADSPARM_Ctot = 133,GUAR_ADSPARM_Dtot = 134,GUAR_ADSPARM_Csum = 135,
|
---|
341 | GUAR_ADSPARM_Dsum = 136
|
---|
342 | };
|
---|
343 |
|
---|
344 | typedef struct {
|
---|
345 | FLOAT Guar_R;
|
---|
346 | ULONG Guar_S;
|
---|
347 | } GuarRspec;
|
---|
348 |
|
---|
349 | typedef struct {
|
---|
350 | IntServServiceHdr Guar_serv_hdr;
|
---|
351 | IntServParmHdr Guar_Tspec_hdr;
|
---|
352 | GenTspecParms Guar_Tspec_parms;
|
---|
353 | IntServParmHdr Guar_Rspec_hdr;
|
---|
354 | GuarRspec Guar_Rspec;
|
---|
355 | } GuarFlowSpec;
|
---|
356 |
|
---|
357 | #define Gspec_r Guar_Tspec_parms.TB_Tspec_r
|
---|
358 | #define Gspec_b Guar_Tspec_parms.TB_Tspec_b
|
---|
359 | #define Gspec_p Guar_Tspec_parms.TB_Tspec_p
|
---|
360 | #define Gspec_m Guar_Tspec_parms.TB_Tspec_m
|
---|
361 | #define Gspec_M Guar_Tspec_parms.TB_Tspec_M
|
---|
362 | #define Gspec_R Guar_Rspec.Guar_R
|
---|
363 | #define Gspec_S Guar_Rspec.Guar_S
|
---|
364 | #define Gspec_T_parmno Guar_Tspec_hdr.isph_parm_num
|
---|
365 | #define Gspec_T_flags Guar_Tspec_hdr.isph_flags
|
---|
366 | #define Gspec_R_parmno Guar_Rspec_hdr.isph_parm_num
|
---|
367 | #define Gspec_R_flags Guar_Rspec_hdr.isph_flags
|
---|
368 | #define Gspec_len (sizeof(GuarFlowSpec) - sizeof(IntServServiceHdr))
|
---|
369 |
|
---|
370 | typedef struct {
|
---|
371 | IntServMainHdr spec_mh;
|
---|
372 | union {
|
---|
373 | CtrlLoadFlowspec CL_spec;
|
---|
374 | GuarFlowSpec G_spec;
|
---|
375 | QualAppFlowSpec Q_spec;
|
---|
376 | } spec_u;
|
---|
377 | } IntServFlowSpec;
|
---|
378 |
|
---|
379 | #define ISmh_len32b spec_mh.ismh_len32b
|
---|
380 | #define ISmh_version spec_mh.ismh_version
|
---|
381 | #define ISmh_unused spec_mh.ismh_unused
|
---|
382 |
|
---|
383 | #define ctype_FLOWSPEC_Intserv0 2
|
---|
384 |
|
---|
385 | typedef struct {
|
---|
386 | RsvpObjHdr flow_header;
|
---|
387 | IntServFlowSpec flow_body;
|
---|
388 | } IS_FLOWSPEC;
|
---|
389 |
|
---|
390 | typedef struct flow_desc {
|
---|
391 | union {
|
---|
392 | SENDER_TSPEC *stspec;
|
---|
393 | IS_FLOWSPEC *isflow;
|
---|
394 | } u1;
|
---|
395 | union {
|
---|
396 | SENDER_TEMPLATE *stemp;
|
---|
397 | FILTER_SPEC *fspec;
|
---|
398 | } u2;
|
---|
399 | } FLOW_DESC;
|
---|
400 |
|
---|
401 | #define FdSenderTspec u1.stspec
|
---|
402 | #define FdIsFlowSpec u1.isflow
|
---|
403 |
|
---|
404 | #define FdSenderTemplate u2.stemp
|
---|
405 | #define FdFilterSpec u2.fspec
|
---|
406 |
|
---|
407 | #define ctype_ADSPEC_INTSERV 2
|
---|
408 |
|
---|
409 | typedef struct {
|
---|
410 | IntServServiceHdr Gads_serv_hdr;
|
---|
411 | IntServParmHdr Gads_Ctot_hdr;
|
---|
412 | ULONG Gads_Ctot;
|
---|
413 | IntServParmHdr Gads_Dtot_hdr;
|
---|
414 | ULONG Gads_Dtot;
|
---|
415 | IntServParmHdr Gads_Csum_hdr;
|
---|
416 | ULONG Gads_Csum;
|
---|
417 | IntServParmHdr Gads_Dsum_hdr;
|
---|
418 | ULONG Gads_Dsum;
|
---|
419 | } Gads_parms_t;
|
---|
420 |
|
---|
421 | typedef struct {
|
---|
422 | IntServServiceHdr gen_parm_hdr;
|
---|
423 | IntServParmHdr gen_parm_hopcnt_hdr;
|
---|
424 | ULONG gen_parm_hopcnt;
|
---|
425 | IntServParmHdr gen_parm_pathbw_hdr;
|
---|
426 | FLOAT gen_parm_path_bw;
|
---|
427 | IntServParmHdr gen_parm_minlat_hdr;
|
---|
428 | ULONG gen_parm_min_latency;
|
---|
429 | IntServParmHdr gen_parm_compmtu_hdr;
|
---|
430 | ULONG gen_parm_composed_MTU;
|
---|
431 | } GenAdspecParams;
|
---|
432 |
|
---|
433 | typedef struct {
|
---|
434 | IntServMainHdr adspec_mh;
|
---|
435 | GenAdspecParams adspec_genparms;
|
---|
436 | } IS_ADSPEC_BODY;
|
---|
437 |
|
---|
438 | #define GEN_ADSPEC_LEN (sizeof(Object_header) + sizeof(IS_adsbody_t))
|
---|
439 |
|
---|
440 | typedef struct {
|
---|
441 | RsvpObjHdr adspec_header;
|
---|
442 | IS_ADSPEC_BODY adspec_body;
|
---|
443 | } ADSPEC;
|
---|
444 |
|
---|
445 | #define RSVP_PATH 1
|
---|
446 | #define RSVP_RESV 2
|
---|
447 | #define RSVP_PATH_ERR 3
|
---|
448 | #define RSVP_RESV_ERR 4
|
---|
449 | #define RSVP_PATH_TEAR 5
|
---|
450 | #define RSVP_RESV_TEAR 6
|
---|
451 |
|
---|
452 | #define RSVP_Err_NONE 0
|
---|
453 | #define RSVP_Erv_Nonev 0
|
---|
454 |
|
---|
455 | #define RSVP_Err_ADMISSION 1
|
---|
456 |
|
---|
457 | #define RSVP_Erv_Other 0
|
---|
458 | #define RSVP_Erv_DelayBnd 1
|
---|
459 | #define RSVP_Erv_Bandwidth 2
|
---|
460 | #define RSVP_Erv_MTU 3
|
---|
461 |
|
---|
462 | #define RSVP_Erv_Flow_Rate 0x8001
|
---|
463 | #define RSVP_Erv_Bucket_szie 0x8002
|
---|
464 | #define RSVP_Erv_Peak_Rate 0x8003
|
---|
465 | #define RSVP_Erv_Min_Policied_size 0x8004
|
---|
466 |
|
---|
467 | #define RSVP_Err_POLICY 2
|
---|
468 |
|
---|
469 | #define POLICY_ERRV_NO_MORE_INFO 1
|
---|
470 | #define POLICY_ERRV_UNSUPPORTED_CREDENTIAL_TYPE 2
|
---|
471 | #define POLICY_ERRV_INSUFFICIENT_PRIVILEGES 3
|
---|
472 | #define POLICY_ERRV_EXPIRED_CREDENTIALS 4
|
---|
473 | #define POLICY_ERRV_IDENTITY_CHANGED 5
|
---|
474 |
|
---|
475 | #define POLICY_ERRV_UNKNOWN 0
|
---|
476 |
|
---|
477 | #define POLICY_ERRV_GLOBAL_DEF_FLOW_COUNT 1
|
---|
478 | #define POLICY_ERRV_GLOBAL_GRP_FLOW_COUNT 2
|
---|
479 | #define POLICY_ERRV_GLOBAL_USER_FLOW_COUNT 3
|
---|
480 | #define POLICY_ERRV_GLOBAL_UNAUTH_USER_FLOW_COUNT 4
|
---|
481 | #define POLICY_ERRV_SUBNET_DEF_FLOW_COUNT 5
|
---|
482 | #define POLICY_ERRV_SUBNET_GRP_FLOW_COUNT 6
|
---|
483 | #define POLICY_ERRV_SUBNET_USER_FLOW_COUNT 7
|
---|
484 | #define POLICY_ERRV_SUBNET_UNAUTH_USER_FLOW_COUNT 8
|
---|
485 |
|
---|
486 | #define POLICY_ERRV_GLOBAL_DEF_FLOW_DURATION 9
|
---|
487 | #define POLICY_ERRV_GLOBAL_GRP_FLOW_DURATION 10
|
---|
488 | #define POLICY_ERRV_GLOBAL_USER_FLOW_DURATION 11
|
---|
489 | #define POLICY_ERRV_GLOBAL_UNAUTH_USER_FLOW_DURATION 12
|
---|
490 | #define POLICY_ERRV_SUBNET_DEF_FLOW_DURATION 13
|
---|
491 | #define POLICY_ERRV_SUBNET_GRP_FLOW_DURATION 14
|
---|
492 | #define POLICY_ERRV_SUBNET_USER_FLOW_DURATION 15
|
---|
493 | #define POLICY_ERRV_SUBNET_UNAUTH_USER_FLOW_DURATION 16
|
---|
494 |
|
---|
495 | #define POLICY_ERRV_GLOBAL_DEF_FLOW_RATE 17
|
---|
496 | #define POLICY_ERRV_GLOBAL_GRP_FLOW_RATE 18
|
---|
497 | #define POLICY_ERRV_GLOBAL_USER_FLOW_RATE 19
|
---|
498 | #define POLICY_ERRV_GLOBAL_UNAUTH_USER_FLOW_RATE 20
|
---|
499 | #define POLICY_ERRV_SUBNET_DEF_FLOW_RATE 21
|
---|
500 | #define POLICY_ERRV_SUBNET_GRP_FLOW_RATE 22
|
---|
501 | #define POLICY_ERRV_SUBNET_USER_FLOW_RATE 23
|
---|
502 | #define POLICY_ERRV_SUBNET_UNAUTH_USER_FLOW_RATE 24
|
---|
503 |
|
---|
504 | #define POLICY_ERRV_GLOBAL_DEF_PEAK_RATE 25
|
---|
505 | #define POLICY_ERRV_GLOBAL_GRP_PEAK_RATE 26
|
---|
506 | #define POLICY_ERRV_GLOBAL_USER_PEAK_RATE 27
|
---|
507 | #define POLICY_ERRV_GLOBAL_UNAUTH_USER_PEAK_RATE 28
|
---|
508 | #define POLICY_ERRV_SUBNET_DEF_PEAK_RATE 29
|
---|
509 | #define POLICY_ERRV_SUBNET_GRP_PEAK_RATE 30
|
---|
510 | #define POLICY_ERRV_SUBNET_USER_PEAK_RATE 31
|
---|
511 | #define POLICY_ERRV_SUBNET_UNAUTH_USER_PEAK_RATE 32
|
---|
512 |
|
---|
513 | #define POLICY_ERRV_GLOBAL_DEF_SUM_FLOW_RATE 33
|
---|
514 | #define POLICY_ERRV_GLOBAL_GRP_SUM_FLOW_RATE 34
|
---|
515 | #define POLICY_ERRV_GLOBAL_USER_SUM_FLOW_RATE 35
|
---|
516 | #define POLICY_ERRV_GLOBAL_UNAUTH_USER_SUM_FLOW_RATE 36
|
---|
517 | #define POLICY_ERRV_SUBNET_DEF_SUM_FLOW_RATE 37
|
---|
518 | #define POLICY_ERRV_SUBNET_GRP_SUM_FLOW_RATE 38
|
---|
519 | #define POLICY_ERRV_SUBNET_USER_SUM_FLOW_RATE 39
|
---|
520 | #define POLICY_ERRV_SUBNET_UNAUTH_USER_SUM_FLOW_RATE 40
|
---|
521 |
|
---|
522 | #define POLICY_ERRV_GLOBAL_DEF_SUM_PEAK_RATE 41
|
---|
523 | #define POLICY_ERRV_GLOBAL_GRP_SUM_PEAK_RATE 42
|
---|
524 | #define POLICY_ERRV_GLOBAL_USER_SUM_PEAK_RATE 43
|
---|
525 | #define POLICY_ERRV_GLOBAL_UNAUTH_USER_SUM_PEAK_RATE 44
|
---|
526 | #define POLICY_ERRV_SUBNET_DEF_SUM_PEAK_RATE 45
|
---|
527 | #define POLICY_ERRV_SUBNET_GRP_SUM_PEAK_RATE 46
|
---|
528 | #define POLICY_ERRV_SUBNET_USER_SUM_PEAK_RATE 47
|
---|
529 | #define POLICY_ERRV_SUBNET_UNAUTH_USER_SUM_PEAK_RATE 48
|
---|
530 |
|
---|
531 | #define POLICY_ERRV_UNKNOWN_USER 49
|
---|
532 | #define POLICY_ERRV_NO_PRIVILEGES 50
|
---|
533 | #define POLICY_ERRV_EXPIRED_USER_TOKEN 51
|
---|
534 | #define POLICY_ERRV_NO_RESOURCES 52
|
---|
535 | #define POLICY_ERRV_PRE_EMPTED 53
|
---|
536 | #define POLICY_ERRV_USER_CHANGED 54
|
---|
537 | #define POLICY_ERRV_NO_ACCEPTS 55
|
---|
538 | #define POLICY_ERRV_NO_MEMORY 56
|
---|
539 | #define POLICY_ERRV_CRAZY_FLOWSPEC 57
|
---|
540 |
|
---|
541 | #define RSVP_Err_NO_PATH 3
|
---|
542 | #define RSVP_Err_NO_SENDER 4
|
---|
543 | #define RSVP_Err_BAD_STYLE 5
|
---|
544 | #define RSVP_Err_UNKNOWN_STYLE 6
|
---|
545 | #define RSVP_Err_BAD_DSTPORT 7
|
---|
546 | #define RSVP_Err_BAD_SNDPORT 8
|
---|
547 | #define RSVP_Err_AMBIG_FILTER 9
|
---|
548 | #define RSVP_Err_PREEMPTED 12
|
---|
549 | #define RSVP_Err_UNKN_OBJ_CLASS 13
|
---|
550 | #define RSVP_Err_UNKNOWN_CTYPE 14
|
---|
551 | #define RSVP_Err_API_ERROR 20
|
---|
552 | #define RSVP_Err_TC_ERROR 21
|
---|
553 |
|
---|
554 | #define RSVP_Erv_Conflict_Serv 01
|
---|
555 | #define RSVP_Erv_No_Serv 02
|
---|
556 | #define RSVP_Erv_Crazy_Flowspec 03
|
---|
557 | #define RSVP_Erv_Crazy_Tspec 04
|
---|
558 |
|
---|
559 | #define RSVP_Err_TC_SYS_ERROR 22
|
---|
560 |
|
---|
561 | #define RSVP_Err_RSVP_SYS_ERROR 23
|
---|
562 |
|
---|
563 | #define RSVP_Erv_MEMORY 1
|
---|
564 | #define RSVP_Erv_API 2
|
---|
565 |
|
---|
566 | #define LPM_PE_USER_IDENTITY 2
|
---|
567 | #define LPM_PE_APP_IDENTITY 3
|
---|
568 |
|
---|
569 | #define ERROR_NO_MORE_INFO 1
|
---|
570 | #define UNSUPPORTED_CREDENTIAL_TYPE 2
|
---|
571 | #define INSUFFICIENT_PRIVILEGES 3
|
---|
572 | #define EXPIRED_CREDENTIAL 4
|
---|
573 | #define IDENTITY_CHANGED 5
|
---|
574 |
|
---|
575 | typedef struct {
|
---|
576 | USHORT usIdErrLength;
|
---|
577 | UCHAR ucAType;
|
---|
578 | UCHAR ucSubType;
|
---|
579 | USHORT usReserved;
|
---|
580 | USHORT usIdErrorValue;
|
---|
581 | UCHAR ucIdErrData[4];
|
---|
582 | } ID_ERROR_OBJECT;
|
---|
583 |
|
---|
584 | #define ID_ERR_OBJ_HDR_LEN (sizeof(ID_ERROR_OBJECT) - 4 *sizeof(UCHAR))
|
---|
585 |
|
---|
586 | DECLARE_HANDLE(LPM_HANDLE);
|
---|
587 | DECLARE_HANDLE(RHANDLE);
|
---|
588 |
|
---|
589 | typedef ULONG LPV;
|
---|
590 | typedef USHORT PETYPE;
|
---|
591 |
|
---|
592 | #define LPM_OK 0
|
---|
593 |
|
---|
594 | typedef int MSG_TYPE;
|
---|
595 |
|
---|
596 | typedef struct rsvpmsgobjs {
|
---|
597 | MSG_TYPE RsvpMsgType;
|
---|
598 | RSVP_SESSION *pRsvpSession;
|
---|
599 | RSVP_HOP *pRsvpFromHop;
|
---|
600 | RSVP_HOP *pRsvpToHop;
|
---|
601 | RESV_STYLE *pResvStyle;
|
---|
602 | RSVP_SCOPE *pRsvpScope;
|
---|
603 | int FlowDescCount;
|
---|
604 | FLOW_DESC *pFlowDescs;
|
---|
605 | int PdObjectCount;
|
---|
606 | POLICY_DATA **ppPdObjects;
|
---|
607 | ERROR_SPEC *pErrorSpec;
|
---|
608 | ADSPEC *pAdspec;
|
---|
609 | } RSVP_MSG_OBJS;
|
---|
610 |
|
---|
611 | typedef void *(WINAPI *PALLOCMEM)(DWORD Size);
|
---|
612 | typedef void (WINAPI *PFREEMEM)(void *pv);
|
---|
613 |
|
---|
614 | typedef struct policy_decision {
|
---|
615 | LPV lpvResult;
|
---|
616 | WORD wPolicyErrCode;
|
---|
617 | WORD wPolicyErrValue;
|
---|
618 | } POLICY_DECISION;
|
---|
619 |
|
---|
620 | typedef ULONG *(CALLBACK *CBADMITRESULT)(LPM_HANDLE LpmHandle,RHANDLE RequestHandle,ULONG ulPcmActionFlags,int LpmError,int PolicyDecisionsCount,POLICY_DECISION *pPolicyDecisions);
|
---|
621 | typedef ULONG *(CALLBACK *CBGETRSVPOBJECTS)(LPM_HANDLE LpmHandle,RHANDLE RequestHandle,int LpmError,int RsvpObjectsCount,RsvpObjHdr **ppRsvpObjects);
|
---|
622 |
|
---|
623 | #define INV_LPM_HANDLE 1
|
---|
624 | #define LPM_TIME_OUT 2
|
---|
625 | #define INV_REQ_HANDLE 3
|
---|
626 | #define DUP_RESULTS 4
|
---|
627 | #define INV_RESULTS 5
|
---|
628 |
|
---|
629 | typedef struct lpminitinfo {
|
---|
630 | DWORD PcmVersionNumber;
|
---|
631 | DWORD ResultTimeLimit;
|
---|
632 | int ConfiguredLpmCount;
|
---|
633 | PALLOCMEM AllocMemory;
|
---|
634 | PFREEMEM FreeMemory;
|
---|
635 | CBADMITRESULT PcmAdmitResultCallback;
|
---|
636 | CBGETRSVPOBJECTS GetRsvpObjectsCallback;
|
---|
637 | } LPM_INIT_INFO;
|
---|
638 |
|
---|
639 | #define LPM_PE_ALL_TYPES 0
|
---|
640 | #define LPM_API_VERSION_1 1
|
---|
641 |
|
---|
642 | #define PCM_VERSION_1 1
|
---|
643 |
|
---|
644 | ULONG WINAPI LPM_Initialize(LPM_HANDLE LpmHandle,LPM_INIT_INFO *pLpmInitInfo,DWORD *pLpmVersionNumber,PETYPE *pSupportedPeType,VOID *Reserved);
|
---|
645 | ULONG WINAPI LPM_Deinitialize(LPM_HANDLE LpmHandle);
|
---|
646 |
|
---|
647 | #define LPV_RESERVED 0
|
---|
648 | #define LPV_MIN_PRIORITY 1
|
---|
649 | #define LPV_MAX_PRIORITY 0xFF00
|
---|
650 | #define LPV_DROP_MSG 0xFFFD
|
---|
651 | #define LPV_DONT_CARE 0xFFFE
|
---|
652 | #define LPV_REJECT 0xFFFF
|
---|
653 |
|
---|
654 | #define FORCE_IMMEDIATE_REFRESH 1
|
---|
655 |
|
---|
656 | #define LPM_RESULT_READY 0
|
---|
657 | #define LPM_RESULT_DEFER 1
|
---|
658 |
|
---|
659 | ULONG WINAPI LPM_AdmitRsvpMsg(RHANDLE PcmReqHandle,RSVP_HOP *pRecvdIntf,RSVP_MSG_OBJS *pRsvpMsgObjs,int RcvdRsvpMsgLength,UCHAR *RcvdRsvpMsg,ULONG *pulPcmActionFlags,POLICY_DECISION *pPolicyDecisions,void *Reserved);
|
---|
660 | ULONG WINAPI LPM_GetRsvpObjects(RHANDLE PcmReqHandle,ULONG MaxPdSize,RSVP_HOP *SendingIntfAddr,RSVP_MSG_OBJS *pRsvpMsgObjs,int *pRsvpObjectsCount,RsvpObjHdr ***pppRsvpObjects,void *Reserved);
|
---|
661 |
|
---|
662 | #define RCVD_PATH_TEAR 1
|
---|
663 | #define RCVD_RESV_TEAR 2
|
---|
664 | #define ADM_CTRL_FAILED 3
|
---|
665 | #define STATE_TIMEOUT 4
|
---|
666 | #define FLOW_DURATION 5
|
---|
667 |
|
---|
668 | VOID WINAPI LPM_DeleteState(RSVP_HOP *pRcvdIfAddr,MSG_TYPE RsvpMsgType,RSVP_SESSION *pRsvpSession,RSVP_HOP *pRsvpFromHop,RESV_STYLE *pResvStyle,int FilterSpecCount,FILTER_SPEC **ppFilterSpecList,int TearDownReason);
|
---|
669 |
|
---|
670 | typedef struct lpmiptable {
|
---|
671 | ULONG ulIfIndex;
|
---|
672 | ULONG MediaType;
|
---|
673 | IN_ADDR IfIpAddr;
|
---|
674 | IN_ADDR IfNetMask;
|
---|
675 | } LPMIPTABLE;
|
---|
676 |
|
---|
677 | WINBOOL WINAPI LPM_IpAddressTable (ULONG cIpAddrTable,LPMIPTABLE *pIpAddrTable);
|
---|
678 |
|
---|
679 | #define RESOURCES_ALLOCATED 1
|
---|
680 | #define RESOURCES_MODIFIED 2
|
---|
681 |
|
---|
682 | VOID WINAPI LPM_CommitResv (RSVP_SESSION *RsvpSession,RSVP_HOP *FlowInstalledIntf,RESV_STYLE *RsvpStyle,int FilterSpecCount,FILTER_SPEC **ppFilterSpecList,IS_FLOWSPEC *pMergedFlowSpec,ULONG CommitDecision);
|
---|
683 |
|
---|
684 | #ifdef __cplusplus
|
---|
685 | }
|
---|
686 | #endif
|
---|
687 | #endif
|
---|