2 #include "rtep_bandwith_reservation.h"
4 //////////////////////////////////////////////////////////////////////
6 //////////////////////////////////////////////////////////////////////
9 * frsh_XXXX_map_network_address()
11 * To map a XXXX protocol network address into a FRSH address.
12 * The protocol must keep this mapping consistent. Instead of using a function
13 * a hardwired mapping could be used.
15 * @param[in] resource_id The network we are referring to (a protocol
16 * could be able to handle several networks at the same time)
17 * @param[in] in_address The network address we want to map to a frsh address
18 * @param[out] out_address The FRSH abstract network address
21 * FNA_NO_ERROR: in this case it also means contract accepted \n
22 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
23 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
24 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
25 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
28 int frsh_rtep_map_network_address
29 (const frsh_resource_id_t resource_id,
30 const rtep_station_id_t in_address,
31 frsh_network_address_t *out_address)
33 if (out_address == NULL) return -1;
34 *out_address = in_address;
39 * frsh_XXXX_map_stream_id()
41 * To map a XXXX protocol network stream, port, channel... into a FRSH stream.
42 * The protocol must keep this mapping consistent. Instead of using a function
43 * a hardwired mapping could be used.
45 * @param[in] resource_id The network we are referring to (a protocol
46 * could be able to handle several networks at the same time)
47 * @param[in] in_stream The network stream we want to map to a FRSH stream
48 * @param[out] out_stream The FRSH abstract network stream
51 * FNA_NO_ERROR: in this case it also means contract accepted \n
52 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
53 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
54 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
55 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
58 int frsh_rtep_map_stream_id
59 (const frsh_resource_id_t resource_id,
60 const rtep_channel_t in_stream,
61 frsh_stream_id_t *out_stream)
63 if (out_stream == NULL) return -1;
64 *out_stream = in_stream;
68 ///////////////////////////////////////////////////////////////////
69 // NEGOTIATION SERVICE PARAMETERS
70 ///////////////////////////////////////////////////////////////////
73 * frsh_XXXX_negotiation_messages__vres_renegotiate()
75 * This function allows the application to change the minimum period
76 * of the negotiation messages sent through the network. It is similar
77 * to the service thread but for the network messages. We do not provide
78 * budget here because the size of the negotiation messages is fixed.
80 * This change is similar to a renegotiation so a schedulability test
81 * must be done to see if the change can be accepted or not.
83 * @param[in] resource_id The network we are referring to (a protocol
84 * could be able to handle several networks at the same time)
85 * @param[in] period The new period for negotiation messages
86 * @param[out] accepted If the change has been accepted or not
89 * FNA_NO_ERROR: in this case it also means contract accepted \n
90 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
91 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
92 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
93 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
97 int frsh_rtep_negotiation_messages_vres_renegotiate
98 (const frsh_resource_id_t resource_id,
99 const struct timespec *period)
101 return rtep_bwres_renegotiate_negotiation_period(period);
105 * frsh_XXXX_negotiation_messages_vres_get_period()
107 * This function gets the minimum period of the negotiation messages
108 * sent through the network.
110 * @param[in] resource_id The network we are referring to (a protocol
111 * could be able to handle several networks at the same time)
112 * @param[out] period The period for negotiation messages
115 * FNA_NO_ERROR: in this case it also means contract accepted \n
116 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
117 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
118 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
119 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
122 int frsh_rtep_negotiation_messages_vres_get_period
123 (const frsh_resource_id_t resource_id,
124 struct timespec *period)
126 return rtep_bwres_get_negotiation_period (period);
130 * frsh_XXXX_service_thread_vres_renegotiate()
132 * This function allows the application to change the period and
133 * budget of the service thread that makes the negotiations and
134 * schedulability tests in a network.
136 * The service thread starts with a default budget and period that
137 * should be configurable
139 * @param[in] resource_id The network we are referring to (a protocol
140 * could be able to handle several networks at the same time)
141 * @param[in] budget The new budget for the service thread
142 * @param[in] period The new period for the service thread
143 * @param[out] accepted If the negotiation has been accepted or not
146 * FNA_NO_ERROR: in this case it also means contract accepted \n
147 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
148 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
149 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
150 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
153 int frsh_rtep_service_thread_vres_renegotiate
154 (const frsh_resource_id_t resource_id,
155 const struct timespec *budget,
156 const struct timespec *period,
163 * frsh_XXXX_service_thread_vres_get_budget_and_period()
165 * This function gets the budget and period of a service thread.
167 * @param[in] resource_id The network we are referring to (a protocol
168 * could be able to handle several networks at the same time)
169 * @param[out] budget The budget of the service thread
170 * @param[out] period The period of the service thread
173 * FNA_NO_ERROR: in this case it also means contract accepted \n
174 * FNA_ERR_INTERNAL_ERROR: protocol dependent internal errors \n
175 * FNA_ERR_NOT_INITIALIZED: if the protocol is not initialized \n
176 * FNA_ERR_RESOURCE_ID_INVALID: if we are not in charge of resource_id \n
177 * FNA_ERR_BAD_ARGUMENT: if pointers are NULL \n
180 int frsh_rtep_service_thread_vres_get_budget_and_period
181 (const frsh_resource_id_t resource_id,
182 struct timespec *budget,
183 struct timespec *period)