Commit 694a5bb1 authored by Xenofon Foukas's avatar Xenofon Foukas

Changed the function signature for handling the packing of protocol messages

parent a8dabcef
......@@ -38,6 +38,8 @@
#include "log.h"
#include "enb_agent.h"
#include "enb_agent_extern.h"
#include "assertions.h"
//#define TEST_TIMER
......@@ -95,7 +97,7 @@ void *enb_agent_task(void *args){
case TIMER_HAS_EXPIRED:
msg = enb_agent_process_timeout(msg_p->ittiMsg.timer_has_expired.timer_id, msg_p->ittiMsg.timer_has_expired.arg);
if (msg != NULL){
data=enb_agent_send_message(msg,&size);
data=enb_agent_pack_message(msg,&size);
if (message_put(d->tx_mq, data, size, priority)){
err_code = PROTOCOL__PROGRAN_ERR__MSG_ENQUEUING;
goto error;
......@@ -182,7 +184,7 @@ void *receive_thread(void *args) {
// check if there is something to send back to the controller
if (msg != NULL){
data=enb_agent_send_message(msg,&size);
data=enb_agent_pack_message(msg,&size);
if (message_put(d->tx_mq, data, size, priority)){
err_code = PROTOCOL__PROGRAN_ERR__MSG_ENQUEUING;
......
......@@ -67,9 +67,17 @@ typedef int (*enb_agent_message_destruction_callback)(
Protocol__ProgranMessage *msg
);
/**********************************
* progRAN protocol messages helper
* functions and generic handlers
**********************************/
int enb_agent_serialize_message(Protocol__ProgranMessage *msg, void **buf, int *size);
int enb_agent_deserialize_message(void *data, int size, Protocol__ProgranMessage **msg);
void * enb_agent_pack_message(Protocol__ProgranMessage *msg,
uint32_t * size);
err_code_t enb_agent_destroy_progran_message(Protocol__ProgranMessage *msg);
int prp_create_header(xid_t xid, Protocol__PrpType type, Protocol__PrpHeader **header);
......@@ -90,11 +98,6 @@ Protocol__ProgranMessage* enb_agent_handle_message (mid_t mod_id,
Protocol__ProgranMessage *enb_agent_handle_timed_task(void *args);
void * enb_agent_send_message(Protocol__ProgranMessage *msg,
uint32_t * size);
......
......@@ -56,6 +56,7 @@ enb_agent_message_destruction_callback message_destruction_callback[] = {
enb_agent_destroy_echo_reply,
enb_agent_mac_destroy_stats_request,
enb_agent_mac_destroy_stats_reply,
enb_agent_mac_destroy_sr_info,
};
static const char *enb_agent_direction2String[] = {
......@@ -108,7 +109,7 @@ error:
void * enb_agent_send_message(Protocol__ProgranMessage *msg,
void * enb_agent_pack_message(Protocol__ProgranMessage *msg,
uint32_t * size){
void * buffer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment