]> rtime.felk.cvut.cz Git - frescor/fna.git/blob - src_frescan/frescan_bwres_messages.h
bc3ec29805b8529e4d4bc6eeccd4aa70ddfbba23
[frescor/fna.git] / src_frescan / frescan_bwres_messages.h
1 /*!
2  * @file frescan_bwres_messages.h
3  *
4  * @brief FRESCAN bandwidth reservation layer: negotiation messages formating
5  *
6  * This module contains the data types that define the FRESCAN negotiation
7  * message format and operations to convert them into or from negotiation
8  * requests
9  *
10  * @version 0.01
11  *
12  * @date 2-Apr-2008
13  *
14  * @author Daniel Sangorrin <daniel.sangorrin@unican.es>
15  *
16  */
17
18 #ifndef _FRESCAN_BWRES_MESSAGES_H_
19 #define _FRESCAN_BWRES_MESSAGES_H_
20
21 #include <stdint.h>
22 #include "frescan_bwres_requests.h"
23 #include "frescan_data.h"
24
25 /**
26  * frescan_messages_init() - initialization function for the module
27  */
28
29 extern int frescan_messages_init(frescan_network_t net);
30
31 /**
32  * frescan_messages_send_request()
33  *
34  * this function converts a request with the necessary data into a message
35  * and sends it.
36  *
37  * @req_data: the request to be sent (NOTE: the network is in req_data)
38  *
39  */
40
41 extern int frescan_messages_send_request(const frescan_request_data_t *req_data);
42
43 /**
44  * frescan_messages_recv_request()
45  *
46  * this function BLOCKS the calling thread until receives a message
47  * and transforms it into a request.
48  *
49  * @net: network from where we want to wait messages
50  * @req: the request received (it must be freed)
51  *
52  */
53
54 extern int frescan_messages_recv_request(frescan_network_t    net,
55                                          frescan_request_id_t *req);
56
57 #endif // _FRESCAN_BWRES_MESSAGES_H_