]> rtime.felk.cvut.cz Git - frescor/fwp.git/blob - fwp/lib/mngt/fwp_contract.h
Spliting lib into core and mngt
[frescor/fwp.git] / fwp / lib / mngt / fwp_contract.h
1 #ifndef _FWP_CONTRACT_H
2 #define _FWP_CONTRACT_H
3
4 #include "fwp_vres.h"
5
6 /**< Contract negotiation status */
7 enum fwp_contnegt_status {
8         FWP_CONTNEGT_ACCEPTED  = 0,
9         FWP_CONTNEGT_REJECTED  = 1,
10         FWP_CONTNEGT_RUNNING   = 3, /**< for asynchronous negotiations*/  
11 } fwp_contnegt_status_t;
12
13 /**< Contract Status */ 
14 typedef enum {
15         FWP_CONT_INVALID =      0,
16         FWP_CONT_REQUESTED =    1,
17         FWP_CONT_REJECTED =     2,
18         FWP_CONT_NEGOTIATED =   3,
19         FWP_CONT_ACCEPTED =     4
20 } fwp_contract_status_t;
21
22 /**
23  * FWP contract.
24  * It is an external representation of contract intented for application 
25  * programmer.
26  * 
27  */
28 typedef 
29 struct fwp_contract {
30         int budget;             /**< bytes per period */
31         int period_usec;        /**< all time units are in microseconds */
32 } fwp_contract_t;
33
34 int fwp_contract_negotiate(struct fwp_contract *contract, fwp_vres_d_t *vresdp);
35
36 #endif /*_FWP_CONTRACT_H */