]> rtime.felk.cvut.cz Git - frescor/fna.git/blob - src_frescan/frescan_bwres_messages.h
renamings... redo the request and messages part... also now there will be two threads...
[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_NEGOTIATION_MESSAGES_H_
19 #define _FRESCAN_NEGOTIATION_MESSAGES_H_
20
21 #include <stdint.h>
22 #include "frescan_bwres_requests.h"
23 #include "frescan_data.h"
24
25 /**
26  * frescan_request_to_message() - converts a request into a network message
27  *
28  * this function converts a request with the necessary data into a message
29  * that can be sent through the network.
30  *
31  * @req_data: the request data to fill the message bytes (in)
32  * @msg: buffer with the bytes that will be sent to the network (out)
33  *
34  */
35
36 extern int frescan_request_to_message(const frescan_request_data_t *req_data,
37                                       uint8_t *msg);
38
39 /**
40  * frescan_message_to_request() - converts a network message into a request
41  *
42  * this function is the opposite to the previous one. It will be used by
43  * the acceptor threads to transform messages received from the network
44  * into requests.
45  *
46  * @msg: buffer with the bytes received from the network (in)
47  * @req_data: the request data to fill from the message bytes (out)
48  *
49  */
50
51 extern int frescan_message_to_request(const uint8_t *msg,
52                                       frescan_request_data_t *req_data);
53
54 #endif // _FRESCAN_NEGOTIATION_MESSAGES_H_