]> rtime.felk.cvut.cz Git - frescor/frsh.git/blob - contract-idl.idl
Added skeleton files for contract handling
[frescor/frsh.git] / contract-idl.idl
1 /**
2  * @file   contract-idl.idl
3  * @author Michal Sojka <sojkam1@fel.cvut.cz>
4  * @date   Sun Sep  7 17:24:37 2008
5  * 
6  * @brief Definitions of data types and constants for FRESCOR contracts.
7  * 
8  */
9
10 module frsh {
11         struct timespec {
12                 long tv_sec;
13                 long tv_nsec;
14         };
15
16         // TODO: Try to use native types
17         typedef timespec fosa_rel_time_t;
18         typedef timespec fosa_abs_time_t;
19
20         enum frsh_contract_type_t {
21                 FRSH_CT_REGULAR,
22                 FRSH_CT_BACKGROUND,
23                 FRSH_CT_DUMMY
24         };
25
26
27         native contract_t;
28         native contract_handle_t;
29
30
31         module contract {
32
33                 /// Contains parameters of contracts grouped by
34                 /// modules. Any other module can add their own
35                 /// parameters.
36                 module params {
37
38                         /// IDs of all (even externally defined) parameters
39                         enum id {
40                                 BASIC_PARAMS,
41                                 SPARE_CAPACITY_PARAMS
42                         };
43                         struct basic {
44                                 fosa_rel_time_t budget;
45                                 fosa_rel_time_t period;
46                                 frsh_contract_type_t contract_type;
47                         };
48                         
49                         enum granularity_t { DISCRETE, CONTINUOUS };
50                         struct spare_capacity {
51                                 fosa_rel_time_t stability_time;
52                                 granularity_t granularity;
53                         };
54                 };
55         };
56 };