]> rtime.felk.cvut.cz Git - frescor/fwp.git/blob - fwp/lib/core/fwp_vres.h
Added option FWP_CONTNEGT. If not defined, fwp can be tested without contract negotia...
[frescor/fwp.git] / fwp / lib / core / fwp_vres.h
1 #ifndef _FWP_VRES_H
2 #define _FWP_VRES_H
3
4 struct fwp_vres;
5 typedef struct fwp_vres* fwp_vres_d_t;
6
7 /** WMM defines 4 queues */
8 typedef enum  {
9         FWP_AC_VO = 0,
10         FWP_AC_VI = 1,
11         FWP_AC_BE = 2,
12         FWP_AC_BK = 3
13 } fwp_ac_t;
14
15 fwp_ac_t fwp_vres_get_ac(fwp_vres_d_t vresd);
16
17
18 #ifdef _FWP_INTERNALS_
19
20 #include "fwp_msgb.h"
21
22 typedef struct fwp_vres  fwp_vres_t;
23
24 typedef unsigned int fwp_vres_id_t;
25 typedef unsigned int fwp_vparam_id_t;
26 typedef unsigned int fwp_budget_t;
27
28 /**
29  * FWP vres parameters 
30  * 
31  */
32 typedef
33 struct fwp_vres_params {
34         /** STA-unique identifier of vres params assigned by manager*/  
35         fwp_vparam_id_t id; 
36         fwp_budget_t    budget;         /**< bytes per period */
37         /** all time units are in microseconds */       
38         int             period_usec; 
39         fwp_ac_t        ac_id;          /**< AC id ~ priority of vres */
40 } fwp_vres_params_t;
41
42 int fwp_vres_table_init(unsigned int max_vres);
43
44 fwp_vres_d_t fwp_vres_alloc();
45 fwp_vres_id_t fwp_vres_get_id(fwp_vres_d_t vresd);
46 int fwp_vres_set_params(fwp_vres_d_t vresd, fwp_vres_params_t *params);
47 int fwp_vres_create(fwp_vres_params_t *params, fwp_vres_d_t *vresdp);
48 int fwp_vres_destroy(fwp_vres_d_t vresd);
49
50 int fwp_vres_send(fwp_vres_d_t vresd, struct fwp_msgb* msgb);
51 /*int _fwp_vres_bind(fwp_vres_d_t vresd, fwp_endpoint_d_t epointd);*/
52 int fwp_vres_bind(fwp_vres_d_t vresd, int sockd);
53 int fwp_vres_unbind(fwp_vres_d_t vresd);
54
55 extern fwp_vres_params_t fwp_vres_params_default;
56
57 #endif /* _FWP_INTERNALS_ */
58 #endif /* _FWP_VRES_H */