Rev 689 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
680 | trimarchi | 1 | /* |
2 | * Project: S.Ha.R.K. |
||
3 | * |
||
4 | * Coordinators: |
||
5 | * Giorgio Buttazzo <giorgio@sssup.it> |
||
6 | * Paolo Gai <pj@gandalf.sssup.it> |
||
7 | * |
||
8 | * Authors : |
||
9 | * Giacomo Guidi <giacomo@gandalf.sssup.it> |
||
10 | * Michael Trimarchi <trimarchi@gandalf.sssup.it> |
||
11 | * (see the web pages for full authors list) |
||
12 | * |
||
13 | * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
||
14 | * |
||
15 | * http://www.sssup.it |
||
16 | * http://retis.sssup.it |
||
17 | * http://shark.sssup.it |
||
18 | */ |
||
19 | |||
20 | /* |
||
21 | * Copyright (C) 2002 Paolo Gai |
||
22 | * |
||
23 | * This program is free software; you can redistribute it and/or modify |
||
24 | * it under the terms of the GNU General Public License as published by |
||
25 | * the Free Software Foundation; either version 2 of the License, or |
||
26 | * (at your option) any later version. |
||
27 | * |
||
28 | * This program is distributed in the hope that it will be useful, |
||
29 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
30 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
31 | * GNU General Public License for more details. |
||
32 | * |
||
33 | * You should have received a copy of the GNU General Public License |
||
34 | * along with this program; if not, write to the Free Software |
||
35 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
36 | * |
||
37 | */ |
||
38 | |||
39 | |||
40 | #ifndef __FSF_SERVICE_TASK_H__ |
||
41 | #define __FSF_SERVICE_TASK_H__ |
||
42 | |||
866 | trimarchi | 43 | |
44 | typedef struct { |
||
45 | fsf_server_id_t server; |
||
46 | TIME actual_period; |
||
47 | TIME actual_budget; |
||
48 | int Qs; // quality of service |
||
49 | int Is; // importance of service |
||
50 | bandwidth_t U; // actual bandwidth |
||
51 | bandwidth_t Umin; // min bandwidth |
||
52 | bandwidth_t Umax; // max bandwidth |
||
53 | TIME Cmin; |
||
54 | TIME Tmin; |
||
55 | TIME Tmax; |
||
56 | TIME deadline; |
||
57 | bool d_equals_t; |
||
58 | } server_elem; |
||
59 | |||
60 | |||
680 | trimarchi | 61 | extern server_elem server_list[FSF_MAX_N_SERVERS]; |
62 | extern int current_server; |
||
63 | extern bandwidth_t fsf_max_bw; |
||
64 | |||
866 | trimarchi | 65 | TASK service_task(void); |
680 | trimarchi | 66 | |
67 | int negotiate_contract |
||
68 | (const fsf_contract_parameters_t *contract, |
||
69 | fsf_server_id_t *server); |
||
70 | |||
71 | int renegotiate_contract |
||
72 | (const fsf_contract_parameters_t *contract, |
||
73 | fsf_server_id_t server); |
||
74 | |||
689 | trimarchi | 75 | int adjust_SERVER_budget |
76 | (int budget, const TIME budget_actual, |
||
77 | const TIME period_actual, const TIME dline_actual); |
||
680 | trimarchi | 78 | |
689 | trimarchi | 79 | int set_SERVER_budget_from_contract |
80 | (const fsf_contract_parameters_t *contract, |
||
81 | int *budget); |
||
82 | |||
83 | int relink_contract_to_server(const fsf_contract_parameters_t *contract, |
||
84 | fsf_server_id_t server); |
||
85 | |||
86 | int link_contract_to_server(const fsf_contract_parameters_t *contract, |
||
87 | fsf_server_id_t server); |
||
88 | |||
89 | int add_contract(const fsf_contract_parameters_t *contract); |
||
90 | |||
680 | trimarchi | 91 | #endif |