]> rtime.felk.cvut.cz Git - frescor/fna.git/blob - src_frescan/frescan_bwres_analysis.h
Unified header for FNA
[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 - 2009 by the FRESCOR consortium:
26 //
27 //    Universidad de Cantabria,              SPAIN
28 //    University of York,                    UK
29 //    Scuola Superiore Sant'Anna,            ITALY
30 //    Kaiserslautern University,             GERMANY
31 //    Univ. Politecnica  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
40 //
41 //        The 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 //
47 //  based on previous work (FSF) done in the FIRST project
48 //
49 //   Copyright (C) 2005  Mälardalen University, SWEDEN
50 //                       Scuola Superiore S.Anna, ITALY
51 //                       Universidad de Cantabria, SPAIN
52 //                       University of York, UK
53 //
54 // This file is part of FNA (Frescor Network Adaptation)
55 //
56 // FNA is free software; you can redistribute it and/or modify it
57 // under terms of the GNU General Public License as published by the
58 // Free Software Foundation; either version 2, or (at your option) any
59 // later version.  FNA is distributed in the hope that it will be
60 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
61 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
62 // General Public License for more details. You should have received a
63 // copy of the GNU General Public License along with FNA; see file
64 // COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,
65 // Cambridge, MA 02139, USA.
66 //
67 // As a special exception, including FNA header files in a file,
68 // instantiating FNA generics or templates, or linking other files
69 // with FNA objects to produce an executable application, does not
70 // by itself cause the resulting executable application to be covered
71 // by the GNU General Public License. This exception does not
72 // however invalidate any other reasons why the executable file might be
73 // covered by the GNU Public License.
74 // -----------------------------------------------------------------------
75  *
76  */
77
78 #ifndef _FRESCAN_BWRES_ANALYSIS_H_
79 #define _FRESCAN_BWRES_ANALYSIS_H_
80
81 #include "frescan_types.h"
82
83 /**
84  * frescan_bwres_sa_init() - init the scenario
85  *
86  * @scenario: the scenario (in out)
87  * @params: init params (in)
88  */
89
90 extern int frescan_bwres_sa_init
91                           (frescan_bwres_sa_scenario_t *scenario,
92                            const frescan_bwres_sa_init_params_t *params);
93
94 /**
95  * frescan_bwres_sa_add_contract() - add a contract to the scenario
96  *
97  * @scenario: the scenario (in out)
98  * @ss: the preallocated ss identificator (in)
99  * @node: the node this contract belongs to (in)
100  * @contract: the new contract (in)
101  */
102
103 extern int frescan_bwres_sa_add_contract
104                                   (frescan_bwres_sa_scenario_t *scenario,
105                                    frescan_ss_t          ss,
106                                    frescan_node_t        node,
107                                    const frsh_contract_t *contract);
108
109 /**
110  * frescan_bwres_sa_update_contract() - update a contract in the scenario
111  *
112  * @scenario: the scenario (in out)
113  * @ss: the ss identificator (in)
114  * @node: the node this contract belongs to (in)
115  * @contract: the values to update the contract (in)
116  * @old_contract: the values of the previous contract. if NULL
117  *                no contract is returned (out)
118  */
119
120 extern int frescan_bwres_sa_update_contract
121                                      (frescan_bwres_sa_scenario_t  *scenario,
122                                       frescan_ss_t           ss,
123                                       frescan_node_t         node,
124                                       const frsh_contract_t  *contract,
125                                       frsh_contract_t        *old_contract);
126
127 /**
128  * frescan_bwres_sa_remove_contract() - remove a contract from the scenario
129  *
130  * @scenario: the scenario (in out)
131  * @ss: the ss to remove (in)
132  * @node: the node this contract belongs to (in)
133  * @contract: if not null, returns a copy of the contract (out)
134  */
135
136 extern int frescan_bwres_sa_remove_contract
137                                      (frescan_bwres_sa_scenario_t *scenario,
138                                       frescan_ss_t                ss,
139                                       frescan_node_t              node,
140                                       frsh_contract_t             *contract);
141
142 /**
143  * frescan_bwres_sa_sched_test() - perform a scheduling test on the scenario
144  *
145  * @scenario: the scenario (in out)
146  * @is_schedulable: if the scenario is schedulable or not (out)
147  */
148
149 extern int frescan_bwres_sa_sched_test(frescan_bwres_sa_scenario_t *scenario,
150                                        bool *is_schedulable);
151
152 /**
153  * frescan_bwres_sa_spare_capacity() - distribute the spare capacity
154  *
155  * @scenario: the scenario (in out)
156  */
157
158 extern int frescan_bwres_sa_spare_capacity
159                 (frescan_bwres_sa_scenario_t *scenario);
160
161 #endif // _FRESCAN_BWRES_ANALYSIS_H_