]> rtime.felk.cvut.cz Git - frescor/fwp.git/blob - fwp/lib/fwp/fwp_vres.h
Rename lib/core to lib/fwp. Clean-ups
[frescor/fwp.git] / fwp / lib / fwp / 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 long int fwp_budget_t;
27 typedef struct timespec  fwp_period_t;
28
29 /**
30  * FWP vres parameters 
31  * 
32  */
33 typedef
34 struct fwp_vres_params {
35         /** STA-unique identifier of vres params assigned by manager*/  
36         fwp_vparam_id_t id; 
37         fwp_budget_t    budget;         /**< bytes per period */
38         /** all time units are in microseconds */       
39         fwp_period_t    period; 
40         fwp_ac_t        ac_id;          /**< AC id ~ priority of vres */
41 } fwp_vres_params_t;
42
43 int fwp_vres_table_init(unsigned int max_vres);
44
45 fwp_vres_d_t fwp_vres_alloc();
46 fwp_vres_id_t fwp_vres_get_id(fwp_vres_d_t vresd);
47 int fwp_vres_set_params(fwp_vres_d_t vresd, fwp_vres_params_t *params);
48 int fwp_vres_create(fwp_vres_params_t *params, fwp_vres_d_t *vresdp);
49 int fwp_vres_destroy(fwp_vres_d_t vresd);
50
51 int fwp_vres_send(fwp_vres_d_t vresd, struct fwp_msgb* msgb);
52 /*int _fwp_vres_bind(fwp_vres_d_t vresd, fwp_endpoint_d_t epointd);*/
53 int fwp_vres_bind(fwp_vres_d_t vresd, int sockd);
54 int fwp_vres_unbind(fwp_vres_d_t vresd);
55
56 extern fwp_vres_params_t fwp_vres_params_default;
57
58 #endif /* _FWP_INTERNALS_ */
59 #endif /* _FWP_VRES_H */