]> rtime.felk.cvut.cz Git - frescor/fwp.git/blob - frsh/frsh_resource.h
My frsh: resmngr_calls change to resmngt_calls
[frescor/fwp.git] / frsh / frsh_resource.h
1 /**
2  * \file frsh_resource.h
3  *
4  * Contains definition of resource and functions to 
5  * register/unregister resource
6  *
7  */
8
9 #ifndef FRSH_RESOURCE_H
10 #define FRSH_RESOURCE_H
11
12 #define FRSH_RESOURCE_NUM 5
13
14 #include "frsh_err.h"
15 #include "frsh_contract.h"
16
17 typedef enum {
18         FRSH_DUMMY      = 0,
19         FRSH_CPU        = 1,
20         FRSH_MEMORY     = 2,
21         FRSH_DISK       = 3,
22         FRSH_CAN        = 4,
23         FRSH_WIFI       = 5,
24 } frsh_resource_type_t;
25
26 typedef 
27 struct frsh_resmngt_calls {
28         int (*reserve)(void* contract_params, 
29                                 frsh_contract_d_t* contractdp);
30         int (*commit)(frsh_contract_d_t contractd);
31         int (*get_vres)(frsh_contract_d_t contractd, frsh_vres_d_t* vresdp);
32         /*int (*connect)();
33         int (*disconnect)();*/
34 } frsh_resmngt_calls_t;
35
36 typedef struct frsh_resource {
37         frsh_resmngt_calls_t    *mngtcalls;
38         //int (*init)();
39 } frsh_resource_t;
40
41 int frsh_resource_register(frsh_resource_type_t type, frsh_resource_t* resource);
42 int frsh_resource_unregister(frsh_resource_type_t type);
43
44 #endif /* FRSH_RESOURCE_H */