#include "frsh.h" /* frsh_resource_id_t, .. */
#include "frescan.h" /* frescan_init, ... */
-#include "frescan_data.h" /* frescan_contract_t, ... */
#include "frescan_bwres.h" /* frescan_bwres_init, ... */
#include "fna.h" /* fna_vres_id_t, fna_endpoint_data_t */
-
-#undef ERROR
-#include "frescan_debug.h" /* DEBUG, ERROR */
+#include "frescan_debug.h" /* DEBUG, FRESCAN_ERROR */
//////////////////////////////////////////////////////////////////////
// INITIALIZATION
DEBUG(FRESCAN_FNA_ENABLE_DEBUG, "Initializing FRESCAN\n");
ret = frescan_init(&init_params);
- if (ret != 0) ERROR ("could not init FRESCAN");
+ if (ret != 0) FRESCAN_ERROR ("could not init FRESCAN");
DEBUG(FRESCAN_FNA_ENABLE_DEBUG, "Initializing BWRES\n");
ret = frescan_bwres_init(init_params.net);
- if (ret != 0) ERROR ("could not init BWRES");
+ if (ret != 0) FRESCAN_ERROR ("could not init BWRES");
return 0;
}
int ret;
bool accepted;
frescan_ss_t ss;
- frescan_contract_t frescan_contract;
-
- DEBUG(FRESCAN_FNA_ENABLE_DEBUG,
- "frsh contract->frescan contract\n");
-
- // NOTE: budget is stored as number of can frames in tv_sec
- frescan_contract.min_values.budget = contract->budget_min.tv_sec;
- frescan_contract.min_values.period = contract->period_max;
-
- frescan_contract.max_values.budget = contract->budget_max.tv_sec;
- frescan_contract.max_values.period = contract->period_min;
-
- // TODO: put 0 if we want the sa module to assign the prios
- frescan_contract.prio = contract->preemption_level;
DEBUG(FRESCAN_FNA_ENABLE_DEBUG, "calling frescan_bwres_negotiate\n");
ret = frescan_bwres_negotiate((frescan_network_t)resource_id,
- &frescan_contract,
+ contract,
&ss,
&accepted);
if (ret != 0) return -1;
const fna_vres_id_t vres,
const frsh_contract_t *new_contract)
{
- ERROR("not implemented\n");
+ FRESCAN_ERROR("not implemented\n");
return -1;
}
frsh_signal_t signal_to_notify,
frsh_signal_info_t signal_info)
{
- ERROR("not implemented\n");
+ FRESCAN_ERROR("not implemented\n");
return -1;
}
const fna_vres_id_t vres,
frsh_renegotiation_status_t *renegotiation_status)
{
- ERROR("not implemented\n");
+ FRESCAN_ERROR("not implemented\n");
return -1;
}
(const frsh_resource_id_t resource_id,
const fna_vres_id_t vres)
{
- ERROR("not implemented\n");
+ FRESCAN_ERROR("not implemented\n");
return -1;
}
const fna_vres_id_t vres,
frsh_contract_t *contract)
{
- ERROR("not implemented\n");
+ FRESCAN_ERROR("not implemented\n");
return -1;
}
const fna_vres_id_t vres,
struct timespec *usage)
{
- ERROR("not implemented\n");
+ FRESCAN_ERROR("not implemented\n");
return -1;
}
const fna_vres_id_t vres,
struct timespec *remaining_budget)
{
- ERROR("not implemented\n");
+ FRESCAN_ERROR("not implemented\n");
return -1;
}
struct timespec *budget,
struct timespec *period)
{
- ERROR("not implemented\n");
+ FRESCAN_ERROR("not implemented\n");
return -1;
}
const int importance,
uint32_t *capacity)
{
- ERROR("not implemented\n");
+ FRESCAN_ERROR("not implemented\n");
return -1;
}
const int importance,
int *total_weight)
{
- ERROR("not implemented\n");
+ FRESCAN_ERROR("not implemented\n");
return -1;
}
const struct timespec new_budget,
const struct timespec new_period)
{
- ERROR("not implemented\n");
+ FRESCAN_ERROR("not implemented\n");
return -1;
}
const void *msg,
const size_t size)
{
- ERROR("not implemented\n");
+ FRESCAN_ERROR("not implemented\n");
return -1;
}
ret = frescan_send(¶ms, (uint8_t *)msg, size);
if (ret != 0) {
- ERROR ("could not send message\n");
+ FRESCAN_ERROR ("could not send message\n");
return -1;
}
received_bytes, &frescan_from, &prio);
if (ret != 0) {
- ERROR ("error while receiving message");
+ FRESCAN_ERROR ("error while receiving message");
return -1;
}
size_t *received_bytes,
frsh_network_address_t *from)
{
- ERROR("not implemented\n");
+ FRESCAN_ERROR("not implemented\n");
return -1;
}
frsh_endpoint_network_status_t *network_status,
frsh_protocol_status_t *protocol_status)
{
- ERROR("not implemented\n");
+ FRESCAN_ERROR("not implemented\n");
return -1;
}
frsh_endpoint_network_status_t *network_status,
frsh_protocol_status_t *protocol_status)
{
- ERROR("not implemented\n");
+ FRESCAN_ERROR("not implemented\n");
return -1;
}
const frsh_network_address_t destination,
size_t *max_size)
{
- ERROR("not implemented\n");
+ FRESCAN_ERROR("not implemented\n");
return -1;
}