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>
21 #include "frescan_debug.h"
23 //////////////////////////////////////////////////////////////////////
25 //////////////////////////////////////////////////////////////////////
28 * frsh_XXXX_map_network_address()
30 * To map a XXXX protocol network address into a FRSH address.
31 * The protocol must keep this mapping consistent. Instead of using a function
32 * a hardwired mapping could be used.
34 * @param[in] resource_id The network we are referring to (a protocol
35 * could be able to handle several networks at the same time)
36 * @param[in] in_address The network address we want to map to a frsh address
37 * @param[out] out_address The FRSH abstract network address
40 * FNA_NO_ERROR: in this case it also means contract accepted \n
41 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
42 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
43 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
44 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
47 int frsh_frescan_map_network_address
48 (const frsh_resource_id_t resource_id,
49 const frescan_node_t in_address,
50 frsh_network_address_t *out_address)
52 if (out_address == NULL) return -1;
53 *out_address = in_address;
58 * frsh_XXXX_map_stream_id()
60 * To map a XXXX protocol network stream, port, channel... into a FRSH stream.
61 * The protocol must keep this mapping consistent. Instead of using a function
62 * a hardwired mapping could be used.
64 * @param[in] resource_id The network we are referring to (a protocol
65 * could be able to handle several networks at the same time)
66 * @param[in] in_stream The network stream we want to map to a FRSH stream
67 * @param[out] out_stream The FRSH abstract network stream
70 * FNA_NO_ERROR: in this case it also means contract accepted \n
71 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
72 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
73 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
74 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
77 int frsh_frescan_map_stream_id
78 (const frsh_resource_id_t resource_id,
79 const frescan_channel_t in_stream,
80 frsh_stream_id_t *out_stream)
82 if (out_stream == NULL) return -1;
83 *out_stream = in_stream;
87 ///////////////////////////////////////////////////////////////////
88 // NEGOTIATION SERVICE PARAMETERS
89 ///////////////////////////////////////////////////////////////////
92 * frsh_XXXX_negotiation_messages__vres_renegotiate()
94 * This function allows the application to change the minimum period
95 * of the negotiation messages sent through the network. It is similar
96 * to the service thread but for the network messages. We do not provide
97 * budget here because the size of the negotiation messages is fixed.
99 * This change is similar to a renegotiation so a schedulability test
100 * must be done to see if the change can be accepted or not.
102 * @param[in] resource_id The network we are referring to (a protocol
103 * could be able to handle several networks at the same time)
104 * @param[in] period The new period for negotiation messages
105 * @param[out] accepted If the change has been accepted or not
108 * FNA_NO_ERROR: in this case it also means contract accepted \n
109 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
110 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
111 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
112 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
116 int frsh_frescan_negotiation_messages_vres_renegotiate
117 (const frsh_resource_id_t resource_id,
118 const struct timespec *period)
120 ERROR("not implemented\n");
125 * frsh_XXXX_negotiation_messages_vres_get_period()
127 * This function gets the minimum period of the negotiation messages
128 * sent through the network.
130 * @param[in] resource_id The network we are referring to (a protocol
131 * could be able to handle several networks at the same time)
132 * @param[out] period The period for negotiation messages
135 * FNA_NO_ERROR: in this case it also means contract accepted \n
136 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
137 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
138 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
139 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
142 int frsh_frescan_negotiation_messages_vres_get_period
143 (const frsh_resource_id_t resource_id,
144 struct timespec *period)
146 ERROR("not implemented\n");
151 * frsh_XXXX_service_thread_vres_renegotiate()
153 * This function allows the application to change the period and
154 * budget of the service thread that makes the negotiations and
155 * schedulability tests in a network.
157 * The service thread starts with a default budget and period that
158 * should be configurable
160 * @param[in] resource_id The network we are referring to (a protocol
161 * could be able to handle several networks at the same time)
162 * @param[in] budget The new budget for the service thread
163 * @param[in] period The new period for the service thread
164 * @param[out] accepted If the negotiation has been accepted or not
167 * FNA_NO_ERROR: in this case it also means contract accepted \n
168 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
169 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
170 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
171 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
174 int frsh_frescan_service_thread_vres_renegotiate
175 (const frsh_resource_id_t resource_id,
176 const struct timespec *budget,
177 const struct timespec *period,
180 ERROR("not implemented\n");
185 * frsh_XXXX_service_thread_vres_get_budget_and_period()
187 * This function gets the budget and period of a service thread.
189 * @param[in] resource_id The network we are referring to (a protocol
190 * could be able to handle several networks at the same time)
191 * @param[out] budget The budget of the service thread
192 * @param[out] period The period of the service thread
195 * FNA_NO_ERROR: in this case it also means contract accepted \n
196 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
197 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
198 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
199 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
202 int frsh_frescan_service_thread_vres_get_budget_and_period
203 (const frsh_resource_id_t resource_id,
204 struct timespec *budget,
205 struct timespec *period)
207 ERROR("not implemented\n");