*
* @author Daniel Sangorrin <daniel.sangorrin@unican.es>
*
- */
-
-#ifndef _FRESCAN_BWRES_REQUESTS_H_
-#define _FRESCAN_BWRES_REQUESTS_H_
-
-#include <stdint.h>
-#include "frescan_data.h" // frescan_contract_t
-#include "frescan_bwres_robjs.h" // frescan_robj_id_t
-
-typedef uint16_t frescan_request_id_t; /* 0 .. MX_REQUESTS */
-
-/**
- * frescan_request_data_t
- *
- * This are the data contained in a request to perform the negotiation of
- * contracts.
- *
- * @type: indicates the type of the request
- * @contract: a pointer to the contract to (re)negotiate
- * @ss: the local sporadic server ID
- * @request_node: the node that performed the request
- * @req: the request id of the SLAVE to identify the request in the reply
- * @return_value: the value returned in a Reply
- * @robj: a reply object to wait until a negotiation is completed
- *
- */
-
-typedef enum {
- FRESCAN_REQ_NEG = 0, // Negotiate a contract
- FRESCAN_REQ_RENEG = 1, // Renegotiate a contract
- FRESCAN_REQ_CANCEL = 2, // Cancel a contract
- FRESCAN_REP_NEG = 3, // Reply to (Re)Negotiate a contract
-} frescan_request_type_t;
-
-typedef enum {
- FRESCAN_REQ_ACCEPTED = 0, // the (re)negotiation is accepted
- FRESCAN_REQ_NOT_ACCEPTED = 1, // the (re)negotiation is not accepted
- FRESCAN_REQ_ERROR = 2, // error during the (re)negotiation
-} frescan_request_retval_t;
-
-typedef struct {
- frescan_request_type_t type;
- frescan_contract_t *contract;
- frescan_ss_t ss;
- frescan_node_t request_node;
- frescan_request_id_t req;
- frescan_request_retval_t return_value;
- frescan_robj_id_t robj;
-} frescan_request_data_t;
-
-/**
- * frescan_requests_init() - initializes the requests
+ * @license
*
- * This function must be called at initialization time, before the rest of
- * functions of this module.
+//----------------------------------------------------------------------
+// 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.
+// -----------------------------------------------------------------------
*
- * @max_ceiling: the max priority of the threads using this module
*/
-extern int frescan_requests_init(int max_ceiling);
-
-/**
- * frescan_requests_alloc() - allocates a request
- */
-
-extern int frescan_requests_alloc(frescan_request_id_t *req);
+#ifndef _FRESCAN_BWRES_REQUESTS_H_
+#define _FRESCAN_BWRES_REQUESTS_H_
-/**
- * frescan_requests_free() - frees a request
- */
+#include "frescan_types.h"
-extern int frescan_requests_free(frescan_request_id_t req);
+extern int frescan_bwres_requests_init(int max_ceiling);
+extern int frescan_bwres_requests_alloc(frescan_bwres_request_id_t *req);
+extern int frescan_bwres_requests_free(frescan_bwres_request_id_t req);
+extern int frescan_bwres_requests_enqueue(frescan_bwres_request_id_t req);
+extern int frescan_bwres_requests_dequeue(frescan_bwres_request_id_t *req);
/**
- * frescan_requests_get_data() - gets the data of the request
+ * frescan_bwres_requests_get_data() - gets the data of the request
*
* @data: the data is obtained as a pointer an manipulated directly
* accesing to the members of the structure. Note that this is
* will just access to the members of the struc directly
*/
-extern int frescan_requests_get_data(frescan_request_id_t req,
- frescan_request_data_t **data);
-
-/**
- * frescan_requests_enqueue() - enqueue a request
- */
-
-extern int frescan_requests_enqueue(frescan_request_id_t req);
-
-/**
- * frescan_requests_dequeue() - dequeue a request
- */
-
-extern int frescan_requests_dequeue(frescan_request_id_t *req);
+extern int frescan_bwres_requests_get_data(frescan_bwres_request_id_t req,
+ frescan_bwres_request_data_t **data);
#endif // _FRESCAN_BWRES_REQUESTS_H_