#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
+#include "frescan_types.h"
-/**
- * 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 (accepted or not)
- * @final_values: the values for the ss after the negotiation
- * @net: the network instance where this request belongs to
- * @robj: a reply object to wait until a negotiation is completed
- *
- */
-
-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_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_sa_final_values_t final_values;
- frescan_network_t net;
- frescan_robj_id_t robj;
-} frescan_request_data_t;
+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_init() - initializes the requests
- *
- * This function must be called at initialization time, before the rest of
- * functions of this module.
- *
- * @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);
-
-/**
- * frescan_requests_free() - frees a request
- */
-
-extern int frescan_requests_free(frescan_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_