2 * @file frescan_bwres_messages.h
4 * @brief FRESCAN bandwidth reservation layer: negotiation messages formating
6 * This module contains the data types that define the FRESCAN negotiation
7 * message format and operations to convert them into or from negotiation
14 * @author Daniel Sangorrin <daniel.sangorrin@unican.es>
18 #ifndef _FRESCAN_NEGOTIATION_MESSAGES_H_
19 #define _FRESCAN_NEGOTIATION_MESSAGES_H_
22 #include "frescan_bwres_requests.h"
23 #include "frescan_data.h"
26 * frescan_request_to_message() - converts a request into a network message
28 * this function converts a request with the necessary data into a message
29 * that can be sent through the network.
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)
36 extern int frescan_request_to_message(const frescan_request_data_t *req_data,
40 * frescan_message_to_request() - converts a network message into a request
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
46 * @msg: buffer with the bytes received from the network (in)
47 * @req_data: the request data to fill from the message bytes (out)
51 extern int frescan_message_to_request(const uint8_t *msg,
52 frescan_request_data_t *req_data);
54 #endif // _FRESCAN_NEGOTIATION_MESSAGES_H_