Commit 48ddbc68 authored by Navid Nikaein's avatar Navid Nikaein

Merge branch 'feature-68-enb-agent' of...

Merge branch 'feature-68-enb-agent' of https://gitlab.eurecom.fr/oai/openairinterface5g into feature-68-enb-agent
parents e42dd369 e5e58ec2
...@@ -134,7 +134,7 @@ int enb_agent_hello(uint32_t xid, const void *params, Protocol__ProgranMessage * ...@@ -134,7 +134,7 @@ int enb_agent_hello(uint32_t xid, const void *params, Protocol__ProgranMessage *
} }
int enb_agent_destroy_hello_message(Protocol__ProgranMessage *msg) { int enb_agent_destroy_hello(Protocol__ProgranMessage *msg) {
if(msg->msg_case != PROTOCOL__PROGRAN_MESSAGE__MSG_HELLO_MSG) if(msg->msg_case != PROTOCOL__PROGRAN_MESSAGE__MSG_HELLO_MSG)
goto error; goto error;
......
...@@ -53,6 +53,10 @@ typedef int (*enb_agent_message_decoded_callback)( ...@@ -53,6 +53,10 @@ typedef int (*enb_agent_message_decoded_callback)(
Protocol__ProgranMessage **msg Protocol__ProgranMessage **msg
); );
typedef int (*enb_agent_message_destruction_callback)(
Protocol__ProgranMessage *msg
);
typedef int32_t err_code_t; typedef int32_t err_code_t;
int enb_agent_serialize_message(Protocol__ProgranMessage *msg, void **buf, int *size); int enb_agent_serialize_message(Protocol__ProgranMessage *msg, void **buf, int *size);
......
...@@ -50,6 +50,15 @@ enb_agent_message_decoded_callback messages_callback[][3] = { ...@@ -50,6 +50,15 @@ enb_agent_message_decoded_callback messages_callback[][3] = {
}; };
enb_agent_message_destruction_callback message_destruction_callback[] = {
enb_agent_destroy_hello,
enb_agent_destroy_echo_request,
enb_agent_destroy_echo_reply,
0, /*No stats request message is created in the agent. No need for a callback*/
enb_agent_mac_destroy_stats_reply,
};
static const char *enb_agent_direction2String[] = { static const char *enb_agent_direction2String[] = {
"", /* not_set */ "", /* not_set */
"originating message", /* originating message */ "originating message", /* originating message */
...@@ -114,7 +123,7 @@ void * enb_agent_send_message(uint32_t xid, ...@@ -114,7 +123,7 @@ void * enb_agent_send_message(uint32_t xid,
// free the msg --> later keep this in the data struct and just update the values // free the msg --> later keep this in the data struct and just update the values
//TODO call proper destroy function //TODO call proper destroy function
// enb_agent_mac_destroy_stats_reply(msg); err_code = ((*message_destruction_callback[msg->msg_case-1])(msg));
DevAssert(buffer !=NULL); DevAssert(buffer !=NULL);
......
...@@ -73,12 +73,16 @@ int enb_agent_mac_handle_stats(uint32_t xid, const void *params, Protocol__Progr ...@@ -73,12 +73,16 @@ int enb_agent_mac_handle_stats(uint32_t xid, const void *params, Protocol__Progr
if (comp_req->report_frequency == PROTOCOL__PRP_STATS_REPORT_FREQ__PRSRF_PERIODICAL) { if (comp_req->report_frequency == PROTOCOL__PRP_STATS_REPORT_FREQ__PRSRF_PERIODICAL) {
//TODO: Must create a periodic report. Implement once the //TODO: Must create a periodic report. Implement once the
// timer functionality is supported // timer functionality is supported
return -1; *msg = NULL;
return 0;
} else if (comp_req->report_frequency == PROTOCOL__PRP_STATS_REPORT_FREQ__PRSRF_CONTINUOUS) { } else if (comp_req->report_frequency == PROTOCOL__PRP_STATS_REPORT_FREQ__PRSRF_CONTINUOUS) {
//TODO: Must create an event based report mechanism //TODO: Must create an event based report mechanism
return -1; *msg = NULL;
return 0;
} else if (comp_req->report_frequency == PROTOCOL__PRP_STATS_REPORT_FREQ__PRSRF_OFF) { } else if (comp_req->report_frequency == PROTOCOL__PRP_STATS_REPORT_FREQ__PRSRF_OFF) {
//TODO: Must implement to deactivate the event based reporting //TODO: Must implement to deactivate the event based reporting
*msg = NULL;
return 0;
} else { //One-off reporting } else { //One-off reporting
//Set the proper flags //Set the proper flags
ue_flags = comp_req->ue_report_flags; ue_flags = comp_req->ue_report_flags;
......
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