#include "rtep.h" // for rtep_adainit, rtep_valid_multicast_id, ..
#include "rtep_bandwith_reservation.h" // for rtep_bwres_*
#include "rtep_fna.h" // function prototypes
-
-#include "frsh_freelist.h"
+#include "fadt_freelist.h"
#if 0
#include <stdio.h>
// TODO: add a mutex for concurrent access if necessary
static rtep_bwres_vres_t rtep_vres_list[MAX_N_RTEP_BWRES_VRES];
-static frsh_freelist_t rtep_vres_freelist;
+static fadt_freelist_t rtep_vres_freelist;
//////////////////////////////////////////////////////////////////////
// INITIALIZATION
DEBUG("calling freelist_init\n");
// initialize the freelist to handle the rtep_vres
- err = frsh_freelist_init(&rtep_vres_freelist, MAX_N_RTEP_BWRES_VRES);
+ err = fadt_freelist_init(&rtep_vres_freelist, NULL, MAX_N_RTEP_BWRES_VRES);
if (err != 0) return -1;
DEBUG("calling rtep_bwres_init\n");
rtep_contract.budget_min = contract->budget_min.tv_sec;
// allocate a free internal vres.
- pos = frsh_freelist_alloc(&rtep_vres_freelist);
+ pos = fadt_freelist_alloc(&rtep_vres_freelist);
if (pos < 0) {
DEBUG("not enough resources\n");
*vres = (fna_vres_id_t)pos;
} else {
DEBUG("contract not accepted\n");
- frsh_freelist_free(&rtep_vres_freelist, pos);
+ fadt_freelist_free(&rtep_vres_freelist, pos);
}
return accepted;
if (err != 0) return -1;
// free the element in the rtep_vres list
- err = frsh_freelist_free(&rtep_vres_freelist, pos);
+ err = fadt_freelist_free(&rtep_vres_freelist, pos);
if (err != 0) return -1;
return 0;
return -1;
}
- // we measure the budget in number of RTEP packets of maximum size
+ // we measure the budget in number of RTEP packets of maximum size
number_of_packets = nbytes / MAX_RTEP_MTU + 1;
- // we store the budget in number of packets instead of in time. We
- // use a field in the timespec structure.
+ // we store the budget in number of packets instead of in time. We
+ // use a field in the timespec structure.
budget->tv_sec = number_of_packets;
DEBUG("bytes: %d -> budget: %d\n", nbytes, budget->tv_sec);
return 0;
// GLOBAL variable to install the network protocol in FRESCOR
fna_operations_t rtep_fna_operations = {
+#ifdef CONFIG_FNA_RTEP_CONNECTED
.fna_init = rtep_fna_init,
.fna_contract_negotiate = rtep_fna_contract_negotiate,
.fna_contract_renegotiate_sync = rtep_fna_contract_renegotiate_sync,
.fna_send_endpoint_get_status = rtep_fna_send_endpoint_get_status,
.fna_receive_endpoint_created = rtep_fna_receive_endpoint_created,
.fna_receive_endpoint_get_status = rtep_fna_receive_endpoint_get_status,
+#endif
.fna_network_get_max_message_size = rtep_fna_network_get_max_message_size,
.fna_network_bytes_to_budget = rtep_fna_network_bytes_to_budget,
.fna_network_budget_to_bytes = rtep_fna_network_budget_to_bytes,