#include <fwp.h>
+#include "fwp_mngt.h"
#include "fwp_participant_table.h"
#define FWP_MTU 2346
ssize_t size;
FWP_DEBUG("Waiting for messages\n");
+ /* TODO: consider to replace with fwp_mngt_recv call */
size = fwp_recv(fwp_participant_this->epointd, buffer, BUFFSIZE);
FWP_DEBUG("Creating fwp msgb len=%d\n", size);
fwp_participant_table_insert(participant);
/* Send back hello msg with mngr`s info */
+ /* prepare hello message */
fwp_msgb_reset_data(msgb);
- my_info.id = fwp_participant_this->id;
- my_info.stream_id = fwp_participant_this->stream_id;
- fwp_msg_header_deflate(msgb->tail, FWP_MSG_HELLO,
- fwp_participant_this->id);
- fwp_msgb_put(msgb, sizeof(struct fwp_msg_header));
+ fwp_msgb_reserve(msgb, sizeof(struct fwp_msg_header));
+
+ my_info.id = fwp_participant_this->id;
+ my_info.stream_id = fwp_participant_this->stream_id;
+
fwp_msg_hello_deflate(msgb->tail, &my_info);
fwp_msgb_put(msgb, sizeof(struct fwp_msg_hello));
- fwp_send(participant->epointd, msgb->data, msgb->len);
-
+
+ /* Send hello to manager */
+ fwp_mngt_send(FWP_MSG_HELLO, msgb,
+ fwp_participant_this, participant);
+
FWP_DEBUG("Sent HELLO msg \n");
}