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 * -----------------------------------------------------------------------
71 #include "frescan_debug.h"
73 //////////////////////////////////////////////////////////////////////
75 //////////////////////////////////////////////////////////////////////
78 * frsh_XXXX_map_network_address()
80 * To map a XXXX protocol network address into a FRSH address.
81 * The protocol must keep this mapping consistent. Instead of using a function
82 * a hardwired mapping could be used.
84 * @param[in] resource_id The network we are referring to (a protocol
85 * could be able to handle several networks at the same time)
86 * @param[in] in_address The network address we want to map to a frsh address
87 * @param[out] out_address The FRSH abstract network address
90 * FNA_NO_ERROR: in this case it also means contract accepted \n
91 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
92 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
93 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
94 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
97 int frsh_frescan_map_network_address
98 (const frsh_resource_id_t resource_id,
99 const frescan_node_t in_address,
100 frsh_network_address_t *out_address)
102 if (out_address == NULL) return -1;
103 *out_address = in_address;
108 * frsh_XXXX_map_stream_id()
110 * To map a XXXX protocol network stream, port, channel... into a FRSH stream.
111 * The protocol must keep this mapping consistent. Instead of using a function
112 * a hardwired mapping could be used.
114 * @param[in] resource_id The network we are referring to (a protocol
115 * could be able to handle several networks at the same time)
116 * @param[in] in_stream The network stream we want to map to a FRSH stream
117 * @param[out] out_stream The FRSH abstract network stream
120 * FNA_NO_ERROR: in this case it also means contract accepted \n
121 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
122 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
123 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
124 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
127 int frsh_frescan_map_stream_id
128 (const frsh_resource_id_t resource_id,
129 const frescan_channel_t in_stream,
130 frsh_stream_id_t *out_stream)
132 if (out_stream == NULL) return -1;
133 *out_stream = in_stream;
137 ///////////////////////////////////////////////////////////////////
138 // NEGOTIATION SERVICE PARAMETERS
139 ///////////////////////////////////////////////////////////////////
142 * frsh_XXXX_negotiation_messages__vres_renegotiate()
144 * This function allows the application to change the minimum period
145 * of the negotiation messages sent through the network. It is similar
146 * to the service thread but for the network messages. We do not provide
147 * budget here because the size of the negotiation messages is fixed.
149 * This change is similar to a renegotiation so a schedulability test
150 * must be done to see if the change can be accepted or not.
152 * @param[in] resource_id The network we are referring to (a protocol
153 * could be able to handle several networks at the same time)
154 * @param[in] period The new period for negotiation messages
155 * @param[out] accepted If the change has been accepted or not
158 * FNA_NO_ERROR: in this case it also means contract accepted \n
159 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
160 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
161 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
162 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
166 int frsh_frescan_negotiation_messages_vres_renegotiate
167 (const frsh_resource_id_t resource_id,
168 const struct timespec *period)
170 ERROR("not implemented\n");
175 * frsh_XXXX_negotiation_messages_vres_get_period()
177 * This function gets the minimum period of the negotiation messages
178 * sent through the network.
180 * @param[in] resource_id The network we are referring to (a protocol
181 * could be able to handle several networks at the same time)
182 * @param[out] period The period for negotiation messages
185 * FNA_NO_ERROR: in this case it also means contract accepted \n
186 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
187 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
188 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
189 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
192 int frsh_frescan_negotiation_messages_vres_get_period
193 (const frsh_resource_id_t resource_id,
194 struct timespec *period)
196 ERROR("not implemented\n");
201 * frsh_XXXX_service_thread_vres_renegotiate()
203 * This function allows the application to change the period and
204 * budget of the service thread that makes the negotiations and
205 * schedulability tests in a network.
207 * The service thread starts with a default budget and period that
208 * should be configurable
210 * @param[in] resource_id The network we are referring to (a protocol
211 * could be able to handle several networks at the same time)
212 * @param[in] budget The new budget for the service thread
213 * @param[in] period The new period for the service thread
214 * @param[out] accepted If the negotiation has been accepted or not
217 * FNA_NO_ERROR: in this case it also means contract accepted \n
218 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
219 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
220 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
221 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
224 int frsh_frescan_service_thread_vres_renegotiate
225 (const frsh_resource_id_t resource_id,
226 const struct timespec *budget,
227 const struct timespec *period,
230 ERROR("not implemented\n");
235 * frsh_XXXX_service_thread_vres_get_budget_and_period()
237 * This function gets the budget and period of a service thread.
239 * @param[in] resource_id The network we are referring to (a protocol
240 * could be able to handle several networks at the same time)
241 * @param[out] budget The budget of the service thread
242 * @param[out] period The period of the service thread
245 * FNA_NO_ERROR: in this case it also means contract accepted \n
246 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
247 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
248 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
249 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
252 int frsh_frescan_service_thread_vres_get_budget_and_period
253 (const frsh_resource_id_t resource_id,
254 struct timespec *budget,
255 struct timespec *period)
257 ERROR("not implemented\n");