]> rtime.felk.cvut.cz Git - frescor/fna.git/blobdiff - 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
index c54d2343d20b4a433ece8e5c3b96db5aa78f8ec0..74d3ee2c21f5df7e1444f6b4d4d7b976c603cb60 100644 (file)
 #define _FRESCAN_NEGOTIATION_MESSAGES_H_
 
 #include <stdint.h>
-#include "frescan_requests.h"
+#include "frescan_bwres_requests.h"
 #include "frescan_data.h"
 
-extern int frescan_request_to_message(frescan_request_id_t id, // in
-                                      uint8_t *msg);           // out
+/**
+ * frescan_request_to_message() - converts a request into a network message
+ *
+ * this function converts a request with the necessary data into a message
+ * that can be sent through the network.
+ *
+ * @req_data: the request data to fill the message bytes (in)
+ * @msg: buffer with the bytes that will be sent to the network (out)
+ *
+ */
+
+extern int frescan_request_to_message(const frescan_request_data_t *req_data,
+                                      uint8_t *msg);
+
+/**
+ * frescan_message_to_request() - converts a network message into a request
+ *
+ * this function is the opposite to the previous one. It will be used by
+ * the acceptor threads to transform messages received from the network
+ * into requests.
+ *
+ * @msg: buffer with the bytes received from the network (in)
+ * @req_data: the request data to fill from the message bytes (out)
+ *
+ */
 
-extern int frescan_message_to_request(const uint8_t *msg,       // in
-                                      frescan_request_id_t id); // in out
+extern int frescan_message_to_request(const uint8_t *msg,
+                                      frescan_request_data_t *req_data);
 
 #endif // _FRESCAN_NEGOTIATION_MESSAGES_H_