*
* @author Daniel Sangorrin <daniel.sangorrin@unican.es>
*
+ * @license
+ *
+ * -----------------------------------------------------------------------
+ * Copyright (C) 2006 - 2008 FRESCOR consortium partners:
+ *
+ * Universidad de Cantabria, SPAIN
+ * University of York, UK
+ * Scuola Superiore Sant'Anna, ITALY
+ * Kaiserslautern University, GERMANY
+ * Univ. Politécnica Valencia, SPAIN
+ * Czech Technical University in Prague, CZECH REPUBLIC
+ * ENEA SWEDEN
+ * Thales Communication S.A. FRANCE
+ * Visual Tools S.A. SPAIN
+ * Rapita Systems Ltd UK
+ * Evidence ITALY
+ *
+ * See http://www.frescor.org for a link to partners' websites
+ *
+ * FRESCOR project (FP6/2005/IST/5-034026) is funded
+ * in part by the European Union Sixth Framework Programme
+ * The European Union is not liable of any use that may be
+ * made of this code.
+ *
+ * This file is part of FRESCAN
+ *
+ * FRESCAN is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * FRESCAN is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * distributed with FRESCAN; see file COPYING. If not, write to the
+ * Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * As a special exception, including FRESCAN header files in a file,
+ * instantiating FRESCAN generics or templates, or linking other files
+ * with FRESCAN objects to produce an executable application, does not
+ * by itself cause the resulting executable application to be covered
+ * by the GNU General Public License. This exception does not
+ * however invalidate any other reasons why the executable file might be
+ * covered by the GNU Public License.
+ * -----------------------------------------------------------------------
+ *
*/
#include <math.h> /* ceil */
#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;
}