*
* @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
-
-/**
- * frescan_request_data_t
+ * @license
*
- * This are the data contained in a request to perform the negotiation of
- * contracts.
+ * -----------------------------------------------------------------------
+ * Copyright (C) 2006 - 2008 FRESCOR consortium partners:
*
- * @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
- * @net: the network instance where this request belongs to
- * @robj: a reply object to wait until a negotiation is completed
+ * 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
*
- */
-
-typedef uint16_t frescan_request_id_t; /* 0 .. MX_REQUESTS */
-
-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_network_t net;
- frescan_robj_id_t robj;
-} frescan_request_data_t;
-
-/**
- * frescan_requests_init() - initializes the requests
+ * See http://www.frescor.org for a link to partners' websites
*
- * This function must be called at initialization time, before the rest of
- * functions of this module.
+ * 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.
+ * -----------------------------------------------------------------------
*
- * @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_