*
* @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.
- * -----------------------------------------------------------------------
+//----------------------------------------------------------------------
+// Copyright (C) 2006 - 2009 by the FRESCOR consortium:
+//
+// Universidad de Cantabria, SPAIN
+// University of York, UK
+// Scuola Superiore Sant'Anna, ITALY
+// Kaiserslautern University, GERMANY
+// Univ. Politecnica 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
+//
+// The 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.
+//
+//
+// based on previous work (FSF) done in the FIRST project
+//
+// Copyright (C) 2005 Mälardalen University, SWEDEN
+// Scuola Superiore S.Anna, ITALY
+// Universidad de Cantabria, SPAIN
+// University of York, UK
+//
+// This file is part of FNA (Frescor Network Adaptation)
+//
+// FNA is free software; you can redistribute it and/or modify it
+// under terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option) any
+// later version. FNA 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 along with FNA; see file
+// COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,
+// Cambridge, MA 02139, USA.
+//
+// As a special exception, including FNA header files in a file,
+// instantiating FNA generics or templates, or linking other files
+// with FNA 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.
+// -----------------------------------------------------------------------
*
*/
**/
struct request_t {
- frescan_request_data_t request_data;
+ frescan_bwres_request_data_t request_data;
struct list_head request_list;
int pool_pos;
};
static fosa_mutex_t requests_mutex;
static fosa_cond_t requests_cond;
-static struct request_t the_requests_pool[FRESCAN_MX_REQUESTS];
+static struct request_t the_requests_pool[FRESCAN_BWRES_MX_REQUESTS];
static freelist_t freelist;
static struct request_t the_requests_list;
/**
- * frescan_requests_init()
+ * frescan_bwres_requests_init()
*
* Init the freelist, requests list, cond var and mutex.
*
**/
-int frescan_requests_init(int max_ceiling)
+int frescan_bwres_requests_init(int max_ceiling)
{
int err;
err = fosa_cond_init(&requests_cond);
if (err != 0) return err;
- err = freelist_init(&freelist, FRESCAN_MX_REQUESTS);
+ err = freelist_init(&freelist, FRESCAN_BWRES_MX_REQUESTS);
if (err != 0) return err;
INIT_LIST_HEAD(&the_requests_list.request_list);
}
/**
- * frescan_requests_alloc()
+ * frescan_bwres_requests_alloc()
*
* Allocate a request with the mutex locked
*
**/
-int frescan_requests_alloc(frescan_request_id_t *req)
+int frescan_bwres_requests_alloc(frescan_bwres_request_id_t *req)
{
int err, pos;
- DEBUG(FRESCAN_REQUESTS_ENABLE_DEBUG, "alloc\n");
+ DEBUG(FRESCAN_BWRES_REQUESTS_ENABLE_DEBUG, "alloc\n");
if (is_initialized == false) return -1;
}
/**
- * frescan_requests_free()
+ * frescan_bwres_requests_free()
*
* free the request from the pool
*
**/
-int frescan_requests_free(frescan_request_id_t req)
+int frescan_bwres_requests_free(frescan_bwres_request_id_t req)
{
int err;
- DEBUG(FRESCAN_REQUESTS_ENABLE_DEBUG, "free\n");
+ DEBUG(FRESCAN_BWRES_REQUESTS_ENABLE_DEBUG, "free\n");
if (is_initialized == false) return -1;
}
/**
- * frescan_requests_get_data() - gets the data of the request
+ * frescan_bwres_requests_get_data() - gets the data of the request
*
*/
-int frescan_requests_get_data(frescan_request_id_t req,
- frescan_request_data_t **data)
+int frescan_bwres_requests_get_data(frescan_bwres_request_id_t req,
+ frescan_bwres_request_data_t **data)
{
- DEBUG(FRESCAN_REQUESTS_ENABLE_DEBUG, "request id:%d\n", req);
+ DEBUG(FRESCAN_BWRES_REQUESTS_ENABLE_DEBUG, "request id:%d\n", req);
*data = &the_requests_pool[req].request_data;
return 0;
}
/**
- * frescan_requests_enqueue()
+ * frescan_bwres_requests_enqueue()
*
**/
-int frescan_requests_enqueue(frescan_request_id_t req)
+int frescan_bwres_requests_enqueue(frescan_bwres_request_id_t req)
{
int err;
err = fosa_mutex_lock(&requests_mutex);
if (err != 0) return err;
- DEBUG(FRESCAN_REQUESTS_ENABLE_DEBUG,
+ DEBUG(FRESCAN_BWRES_REQUESTS_ENABLE_DEBUG,
"is list empty A? %d\n",
list_empty(&the_requests_list.request_list));
list_add_tail(&the_requests_pool[req].request_list,
&the_requests_list.request_list);
- DEBUG(FRESCAN_REQUESTS_ENABLE_DEBUG,
+ DEBUG(FRESCAN_BWRES_REQUESTS_ENABLE_DEBUG,
"is list empty B? %d\n",
list_empty(&the_requests_list.request_list));
}
/**
- * frescan_requestqueue_dequeue()
+ * frescan_bwres_requestqueue_dequeue()
*
**/
-int frescan_requests_dequeue(frescan_request_id_t *req)
+int frescan_bwres_requests_dequeue(frescan_bwres_request_id_t *req)
{
int err;
struct list_head *pos;
err = fosa_mutex_lock(&requests_mutex);
if (err != 0) return err;
- DEBUG(FRESCAN_REQUESTS_ENABLE_DEBUG, "entering\n");
+ DEBUG(FRESCAN_BWRES_REQUESTS_ENABLE_DEBUG, "entering\n");
while (list_empty(&the_requests_list.request_list)) {
err = fosa_cond_wait(&requests_cond, &requests_mutex);
if (err != 0) goto locked_error;
- DEBUG(FRESCAN_REQUESTS_ENABLE_DEBUG, "received signal\n");
+ DEBUG(FRESCAN_BWRES_REQUESTS_ENABLE_DEBUG, "received signal\n");
}
- DEBUG(FRESCAN_REQUESTS_ENABLE_DEBUG, "dequeueing a request\n");
+ DEBUG(FRESCAN_BWRES_REQUESTS_ENABLE_DEBUG, "dequeueing a request\n");
list_for_each(pos, &the_requests_list.request_list) {
request = list_entry(pos, struct request_t, request_list);
*req = request->pool_pos;
- DEBUG(FRESCAN_REQUESTS_ENABLE_DEBUG,
+ DEBUG(FRESCAN_BWRES_REQUESTS_ENABLE_DEBUG,
"is list empty now? %d\n",
list_empty(&the_requests_list.request_list));