]> rtime.felk.cvut.cz Git - frescor/fna.git/blob - src_frescan/frescan_bwres_analysis.h
changes to use the FRSH FSA module to do the analysis and spare capacity. TODO: finis...
[frescor/fna.git] / src_frescan / frescan_bwres_analysis.h
1 /*!
2  * @file frescan_bwres_analysis.h
3  *
4  * @brief FRESCAN bandwith reservation layer: sched analysis
5  *
6  * @version 0.02
7  *
8  * @date 3-Jul-2008
9  *
10  * @author Daniel Sangorrin <daniel.sangorrin@unican.es>
11  *
12  * @comments
13  *
14  * This module contains the scheduling analysis functions for the
15  * admission tests and spare capacity distribution of the bandwith
16  * reservation (bwres) layer.
17  *
18  * The module "frescan_bwres_mode_change" must be used to apply finally this
19  * new parameters to the sporadic servers following an appropriate mode
20  * change protocol.
21  *
22  * @license
23  *
24  * -----------------------------------------------------------------------
25  *  Copyright (C) 2006 - 2008 FRESCOR consortium partners:
26  *
27  *    Universidad de Cantabria,              SPAIN
28  *    University of York,                    UK
29  *    Scuola Superiore Sant'Anna,            ITALY
30  *    Kaiserslautern University,             GERMANY
31  *    Univ. Politécnica  Valencia,           SPAIN
32  *    Czech Technical University in Prague,  CZECH REPUBLIC
33  *    ENEA                                   SWEDEN
34  *    Thales Communication S.A.              FRANCE
35  *    Visual Tools S.A.                      SPAIN
36  *    Rapita Systems Ltd                     UK
37  *    Evidence                               ITALY
38  *
39  *    See http://www.frescor.org for a link to partners' websites
40  *
41  *           FRESCOR project (FP6/2005/IST/5-034026) is funded
42  *        in part by the European Union Sixth Framework Programme
43  *        The European Union is not liable of any use that may be
44  *        made of this code.
45  *
46  *  This file is part of FRESCAN
47  *
48  *  FRESCAN is free software; you can  redistribute it and/or  modify
49  *  it under the terms of  the GNU General Public License as published by
50  *  the Free Software Foundation;  either  version 2, or (at  your option)
51  *  any later version.
52  *
53  *  FRESCAN  is distributed  in  the hope  that  it  will  be useful,  but
54  *  WITHOUT  ANY  WARRANTY;     without  even the   implied   warranty  of
55  *  MERCHANTABILITY  or  FITNESS FOR  A  PARTICULAR PURPOSE. See  the  GNU
56  *  General Public License for more details.
57  *
58  *  You should have  received a  copy of  the  GNU  General Public License
59  *  distributed  with  FRESCAN;  see file COPYING.   If not,  write to the
60  *  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
61  *  02111-1307, USA.
62  *
63  * As a special exception, including FRESCAN header files in a file,
64  * instantiating FRESCAN generics or templates, or linking other files
65  * with FRESCAN objects to produce an executable application, does not
66  * by itself cause the resulting executable application to be covered
67  * by the GNU General Public License. This exception does not
68  * however invalidate any other reasons why the executable file might be
69  * covered by the GNU Public License.
70  * -----------------------------------------------------------------------
71  *
72  */
73
74 #ifndef _FRESCAN_BWRES_ANALYSIS_H_
75 #define _FRESCAN_BWRES_ANALYSIS_H_
76
77 #include "frescan.h"
78 #include "frescan_data.h"
79
80 /**
81  * frescan_sa_init() - init the scenario
82  *
83  * @scenario: the scenario (in out)
84  * @params: init params (in)
85  */
86
87 extern int frescan_sa_init(frescan_sa_scenario_t *scenario,
88                            const frescan_sa_init_params_t *params);
89
90 /**
91  * frescan_sa_add_contract() - add a contract to the scenario
92  *
93  * @scenario: the scenario (in out)
94  * @ss: the preallocated ss identificator (in)
95  * @node: the node this contract belongs to (in)
96  * @contract: the new contract (in)
97  */
98
99 extern int frescan_sa_add_contract(frescan_sa_scenario_t *scenario,
100                                    frescan_ss_t          ss,
101                                    frescan_node_t        node,
102                                    const frsh_contract_t *contract);
103
104 /**
105  * frescan_sa_update_contract() - update a contract in the scenario
106  *
107  * @scenario: the scenario (in out)
108  * @ss: the ss identificator (in)
109  * @node: the node this contract belongs to (in)
110  * @contract: the values to update the contract (in)
111  * @old_contract: the values of the previous contract. if NULL
112  *                no contract is returned (out)
113  */
114
115 extern int frescan_sa_update_contract(frescan_sa_scenario_t  *scenario,
116                                       frescan_ss_t           ss,
117                                       frescan_node_t         node,
118                                       const frsh_contract_t  *contract,
119                                       frsh_contract_t        *old_contract);
120
121 /**
122  * frescan_sa_remove_contract() - remove a contract from the scenario
123  *
124  * @scenario: the scenario (in out)
125  * @ss: the ss to remove (in)
126  * @node: the node this contract belongs to (in)
127  */
128
129 extern int frescan_sa_remove_contract(frescan_sa_scenario_t *scenario,
130                                       frescan_ss_t          ss,
131                                       frescan_node_t        node);
132
133 /**
134  * frescan_sa_sched_test() - perform a scheduling test on the scenario
135  *
136  * @scenario: the scenario (in out)
137  * @is_schedulable: if the scenario is schedulable or not (out)
138  */
139
140 extern int frescan_sa_sched_test(frescan_sa_scenario_t *scenario,
141                                  bool *is_schedulable);
142
143 /**
144  * frescan_sa_spare_capacity() - distribute the spare capacity
145  *
146  * @scenario: the scenario (in out)
147  */
148
149 extern int frescan_sa_spare_capacity(frescan_sa_scenario_t *scenario);
150
151 #endif // _FRESCAN_BWRES_ANALYSIS_H_