2 * @file frescan_bwres_frsh_fna.h
4 * @brief FRESCAN bandwidth reservation layer: FRSH FNA public functions
6 * This module contains FNA functions that need to be public mainly
7 * for mapping between network types and FNA or FRSH types.
13 * @author Daniel Sangorrin <daniel.sangorrin@unican.es>
17 * -----------------------------------------------------------------------
18 * Copyright (C) 2006 - 2008 FRESCOR consortium partners:
20 * Universidad de Cantabria, SPAIN
21 * University of York, UK
22 * Scuola Superiore Sant'Anna, ITALY
23 * Kaiserslautern University, GERMANY
24 * Univ. Politécnica Valencia, SPAIN
25 * Czech Technical University in Prague, CZECH REPUBLIC
27 * Thales Communication S.A. FRANCE
28 * Visual Tools S.A. SPAIN
29 * Rapita Systems Ltd UK
32 * See http://www.frescor.org for a link to partners' websites
34 * FRESCOR project (FP6/2005/IST/5-034026) is funded
35 * in part by the European Union Sixth Framework Programme
36 * The European Union is not liable of any use that may be
39 * This file is part of FRESCAN
41 * FRESCAN is free software; you can redistribute it and/or modify
42 * it under the terms of the GNU General Public License as published by
43 * the Free Software Foundation; either version 2, or (at your option)
46 * FRESCAN is distributed in the hope that it will be useful, but
47 * WITHOUT ANY WARRANTY; without even the implied warranty of
48 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
49 * General Public License for more details.
51 * You should have received a copy of the GNU General Public License
52 * distributed with FRESCAN; see file COPYING. If not, write to the
53 * Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
56 * As a special exception, including FRESCAN header files in a file,
57 * instantiating FRESCAN generics or templates, or linking other files
58 * with FRESCAN objects to produce an executable application, does not
59 * by itself cause the resulting executable application to be covered
60 * by the GNU General Public License. This exception does not
61 * however invalidate any other reasons why the executable file might be
62 * covered by the GNU Public License.
63 * -----------------------------------------------------------------------
69 #include "frescan_debug.h"
71 //////////////////////////////////////////////////////////////////////
73 //////////////////////////////////////////////////////////////////////
76 * frsh_XXXX_map_network_address()
78 * To map a XXXX protocol network address into a FRSH address.
79 * The protocol must keep this mapping consistent. Instead of using a function
80 * a hardwired mapping could be used.
82 * @param[in] resource_id The network we are referring to (a protocol
83 * could be able to handle several networks at the same time)
84 * @param[in] in_address The network address we want to map to a frsh address
85 * @param[out] out_address The FRSH abstract network address
88 * FNA_NO_ERROR: in this case it also means contract accepted \n
89 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
90 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
91 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
92 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
95 int frsh_frescan_map_network_address
96 (const frsh_resource_id_t resource_id,
97 const frescan_node_t in_address,
98 frsh_network_address_t *out_address)
100 if (out_address == NULL) return -1;
101 *out_address = in_address;
106 * frsh_XXXX_map_stream_id()
108 * To map a XXXX protocol network stream, port, channel... into a FRSH stream.
109 * The protocol must keep this mapping consistent. Instead of using a function
110 * a hardwired mapping could be used.
112 * @param[in] resource_id The network we are referring to (a protocol
113 * could be able to handle several networks at the same time)
114 * @param[in] in_stream The network stream we want to map to a FRSH stream
115 * @param[out] out_stream The FRSH abstract network stream
118 * FNA_NO_ERROR: in this case it also means contract accepted \n
119 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
120 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
121 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
122 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
125 int frsh_frescan_map_stream_id
126 (const frsh_resource_id_t resource_id,
127 const frescan_channel_t in_stream,
128 frsh_stream_id_t *out_stream)
130 if (out_stream == NULL) return -1;
131 *out_stream = in_stream;
135 ///////////////////////////////////////////////////////////////////
136 // NEGOTIATION SERVICE PARAMETERS
137 ///////////////////////////////////////////////////////////////////
140 * frsh_XXXX_negotiation_messages__vres_renegotiate()
142 * This function allows the application to change the minimum period
143 * of the negotiation messages sent through the network. It is similar
144 * to the service thread but for the network messages. We do not provide
145 * budget here because the size of the negotiation messages is fixed.
147 * This change is similar to a renegotiation so a schedulability test
148 * must be done to see if the change can be accepted or not.
150 * @param[in] resource_id The network we are referring to (a protocol
151 * could be able to handle several networks at the same time)
152 * @param[in] period The new period for negotiation messages
153 * @param[out] accepted If the change has been accepted or not
156 * FNA_NO_ERROR: in this case it also means contract accepted \n
157 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
158 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
159 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
160 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
164 int frsh_frescan_negotiation_messages_vres_renegotiate
165 (const frsh_resource_id_t resource_id,
166 const struct timespec *period)
168 FRESCAN_ERROR("not implemented\n");
173 * frsh_XXXX_negotiation_messages_vres_get_period()
175 * This function gets the minimum period of the negotiation messages
176 * sent through the network.
178 * @param[in] resource_id The network we are referring to (a protocol
179 * could be able to handle several networks at the same time)
180 * @param[out] period The period for negotiation messages
183 * FNA_NO_ERROR: in this case it also means contract accepted \n
184 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
185 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
186 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
187 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
190 int frsh_frescan_negotiation_messages_vres_get_period
191 (const frsh_resource_id_t resource_id,
192 struct timespec *period)
194 FRESCAN_ERROR("not implemented\n");
199 * frsh_XXXX_service_thread_vres_renegotiate()
201 * This function allows the application to change the period and
202 * budget of the service thread that makes the negotiations and
203 * schedulability tests in a network.
205 * The service thread starts with a default budget and period that
206 * should be configurable
208 * @param[in] resource_id The network we are referring to (a protocol
209 * could be able to handle several networks at the same time)
210 * @param[in] budget The new budget for the service thread
211 * @param[in] period The new period for the service thread
212 * @param[out] accepted If the negotiation has been accepted or not
215 * FNA_NO_ERROR: in this case it also means contract accepted \n
216 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
217 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
218 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
219 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
222 int frsh_frescan_service_thread_vres_renegotiate
223 (const frsh_resource_id_t resource_id,
224 const struct timespec *budget,
225 const struct timespec *period,
228 FRESCAN_ERROR("not implemented\n");
233 * frsh_XXXX_service_thread_vres_get_budget_and_period()
235 * This function gets the budget and period of a service thread.
237 * @param[in] resource_id The network we are referring to (a protocol
238 * could be able to handle several networks at the same time)
239 * @param[out] budget The budget of the service thread
240 * @param[out] period The period of the service thread
243 * FNA_NO_ERROR: in this case it also means contract accepted \n
244 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
245 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
246 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
247 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
250 int frsh_frescan_service_thread_vres_get_budget_and_period
251 (const frsh_resource_id_t resource_id,
252 struct timespec *budget,
253 struct timespec *period)
255 FRESCAN_ERROR("not implemented\n");