Commit 9fc584d1 authored by Xenofon Foukas's avatar Xenofon Foukas

Fixed FlexRAN-related warnings

parent dc8190dc
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "flexran_agent_extern.h" #include "flexran_agent_extern.h"
#include "flexran_agent_common.h" #include "flexran_agent_common.h"
#include "flexran_agent_mac_internal.h" #include "flexran_agent_mac_internal.h"
#include "flexran_agent_net_comm.h"
#include "LAYER2/MAC/proto.h" #include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/flexran_agent_mac_proto.h" #include "LAYER2/MAC/flexran_agent_mac_proto.h"
...@@ -60,14 +61,11 @@ int flexran_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__F ...@@ -60,14 +61,11 @@ int flexran_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__F
// TODO: Must resolve conflicts among stats requests // TODO: Must resolve conflicts among stats requests
int i; int i;
void *buffer;
int size;
err_code_t err_code; err_code_t err_code;
xid_t xid; xid_t xid;
uint32_t usec_interval, sec_interval; uint32_t usec_interval, sec_interval;
//TODO: We do not deal with multiple CCs at the moment and eNB id is 0 //TODO: We do not deal with multiple CCs at the moment and eNB id is 0
int cc_id = 0;
int enb_id = mod_id; int enb_id = mod_id;
//eNB_MAC_INST *eNB = &eNB_mac_inst[enb_id]; //eNB_MAC_INST *eNB = &eNB_mac_inst[enb_id];
...@@ -250,15 +248,15 @@ int flexran_agent_mac_stats_request(mid_t mod_id, ...@@ -250,15 +248,15 @@ int flexran_agent_mac_stats_request(mid_t mod_id,
Protocol__FlexHeader *header; Protocol__FlexHeader *header;
int i; int i;
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REQUEST, &header) != 0)
goto error;
Protocol__FlexStatsRequest *stats_request_msg; Protocol__FlexStatsRequest *stats_request_msg;
stats_request_msg = malloc(sizeof(Protocol__FlexStatsRequest)); stats_request_msg = malloc(sizeof(Protocol__FlexStatsRequest));
if(stats_request_msg == NULL) if(stats_request_msg == NULL)
goto error; goto error;
protocol__flex_stats_request__init(stats_request_msg); protocol__flex_stats_request__init(stats_request_msg);
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REQUEST, &header) != 0)
goto error;
stats_request_msg->header = header; stats_request_msg->header = header;
stats_request_msg->type = report_config->report_type; stats_request_msg->type = report_config->report_type;
...@@ -375,20 +373,19 @@ int flexran_agent_mac_stats_reply(mid_t mod_id, ...@@ -375,20 +373,19 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
Protocol__FlexranMessage **msg) { Protocol__FlexranMessage **msg) {
Protocol__FlexHeader *header; Protocol__FlexHeader *header;
int i, j, k; int i, j, k;
int cc_id = 0;
int enb_id = mod_id; int enb_id = mod_id;
//eNB_MAC_INST *eNB = &eNB_mac_inst[enb_id]; //eNB_MAC_INST *eNB = &eNB_mac_inst[enb_id];
//UE_list_t *eNB_UE_list= &eNB->UE_list; //UE_list_t *eNB_UE_list= &eNB->UE_list;
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0)
goto error;
Protocol__FlexStatsReply *stats_reply_msg; Protocol__FlexStatsReply *stats_reply_msg;
stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply)); stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply));
if (stats_reply_msg == NULL) if (stats_reply_msg == NULL)
goto error; goto error;
protocol__flex_stats_reply__init(stats_reply_msg); protocol__flex_stats_reply__init(stats_reply_msg);
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_STATS_REPLY, &header) != 0)
goto error;
stats_reply_msg->header = header; stats_reply_msg->header = header;
stats_reply_msg->n_ue_report = report_config->nr_ue; stats_reply_msg->n_ue_report = report_config->nr_ue;
...@@ -419,7 +416,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id, ...@@ -419,7 +416,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
elem = (uint32_t *) malloc(sizeof(uint32_t)*ue_report[i]->n_bsr); elem = (uint32_t *) malloc(sizeof(uint32_t)*ue_report[i]->n_bsr);
if (elem == NULL) if (elem == NULL)
goto error; goto error;
for (j = 0; j++; j < ue_report[i]->n_bsr) { for (j = 0; j < ue_report[i]->n_bsr; j++) {
// NN: we need to know the cc_id here, consider the first one // NN: we need to know the cc_id here, consider the first one
elem[j] = flexran_get_ue_bsr (enb_id, i, j); elem[j] = flexran_get_ue_bsr (enb_id, i, j);
} }
...@@ -472,7 +469,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id, ...@@ -472,7 +469,7 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
/* Check flag for creation of MAC CE buffer status report */ /* Check flag for creation of MAC CE buffer status report */
if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_MAC_CE_BS) { if (report_config->ue_report_type[i].ue_report_flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_MAC_CE_BS) {
// TODO: Fill in the actual MAC CE buffer status report // TODO: Fill in the actual MAC CE buffer status report
ue_report[i]->pending_mac_ces = (flexran_get_MAC_CE_bitmap_TA(enb_id,i,0) | (0 << 1) | (0 << 2) | (0 << 3)) & 15; /* Use as bitmap. Set one or more of the; /* Use as bitmap. Set one or more of the ue_report[i]->pending_mac_ces = (flexran_get_MAC_CE_bitmap_TA(enb_id,i,0) | (0 << 1) | (0 << 2) | (0 << 3)) & 15; /* Use as bitmap. Set one or more of the
PROTOCOL__FLEX_CE_TYPE__FLPCET_ values PROTOCOL__FLEX_CE_TYPE__FLPCET_ values
found in stats_common.pb-c.h. See found in stats_common.pb-c.h. See
flex_ce_type in FlexRAN specification */ flex_ce_type in FlexRAN specification */
...@@ -802,6 +799,8 @@ int flexran_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg) { ...@@ -802,6 +799,8 @@ int flexran_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg) {
} }
free(dl_report->csi_report[j]->a31csi->sb_cqi); free(dl_report->csi_report[j]->a31csi->sb_cqi);
break; break;
default:
break;
} }
free(dl_report->csi_report[j]); free(dl_report->csi_report[j]);
...@@ -856,8 +855,6 @@ int flexran_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__Flexra ...@@ -856,8 +855,6 @@ int flexran_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__Flexra
Protocol__FlexHeader *header; Protocol__FlexHeader *header;
int i; int i;
const int xid = *((int *)params); const int xid = *((int *)params);
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_UL_SR_INFO, &header) != 0)
goto error;
Protocol__FlexUlSrInfo *ul_sr_info_msg; Protocol__FlexUlSrInfo *ul_sr_info_msg;
ul_sr_info_msg = malloc(sizeof(Protocol__FlexUlSrInfo)); ul_sr_info_msg = malloc(sizeof(Protocol__FlexUlSrInfo));
...@@ -866,6 +863,9 @@ int flexran_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__Flexra ...@@ -866,6 +863,9 @@ int flexran_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__Flexra
} }
protocol__flex_ul_sr_info__init(ul_sr_info_msg); protocol__flex_ul_sr_info__init(ul_sr_info_msg);
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_UL_SR_INFO, &header) != 0)
goto error;
ul_sr_info_msg->header = header; ul_sr_info_msg->header = header;
ul_sr_info_msg->has_sfn_sf = 1; ul_sr_info_msg->has_sfn_sf = 1;
ul_sr_info_msg->sfn_sf = flexran_get_sfn_sf(mod_id); ul_sr_info_msg->sfn_sf = flexran_get_sfn_sf(mod_id);
...@@ -923,8 +923,6 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle ...@@ -923,8 +923,6 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
Protocol__FlexHeader *header; Protocol__FlexHeader *header;
int i,j; int i,j;
const int xid = *((int *)params); const int xid = *((int *)params);
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_SF_TRIGGER, &header) != 0)
goto error;
Protocol__FlexSfTrigger *sf_trigger_msg; Protocol__FlexSfTrigger *sf_trigger_msg;
sf_trigger_msg = malloc(sizeof(Protocol__FlexSfTrigger)); sf_trigger_msg = malloc(sizeof(Protocol__FlexSfTrigger));
...@@ -933,6 +931,9 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle ...@@ -933,6 +931,9 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
} }
protocol__flex_sf_trigger__init(sf_trigger_msg); protocol__flex_sf_trigger__init(sf_trigger_msg);
if (flexran_create_header(xid, PROTOCOL__FLEX_TYPE__FLPT_SF_TRIGGER, &header) != 0)
goto error;
frame_t frame; frame_t frame;
sub_frame_t subframe; sub_frame_t subframe;
...@@ -975,8 +976,8 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle ...@@ -975,8 +976,8 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
dl_info[i]->rnti = flexran_get_ue_crnti(mod_id, i); dl_info[i]->rnti = flexran_get_ue_crnti(mod_id, i);
dl_info[i]->has_rnti = 1; dl_info[i]->has_rnti = 1;
/*Fill in the right id of this round's HARQ process for this UE*/ /*Fill in the right id of this round's HARQ process for this UE*/
int harq_id; unsigned char harq_id;
int harq_status; unsigned char harq_status;
flexran_get_harq(mod_id, UE_PCCID(mod_id,i), i, frame, subframe, &harq_id, &harq_status); flexran_get_harq(mod_id, UE_PCCID(mod_id,i), i, frame, subframe, &harq_id, &harq_status);
dl_info[i]->harq_process_id = harq_id; dl_info[i]->harq_process_id = harq_id;
dl_info[i]->has_harq_process_id = 1; dl_info[i]->has_harq_process_id = 1;
...@@ -1060,10 +1061,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle ...@@ -1060,10 +1061,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle
for (i = 0; i < sf_trigger_msg->n_dl_info; i++) { for (i = 0; i < sf_trigger_msg->n_dl_info; i++) {
free(sf_trigger_msg->dl_info[i]->harq_status); free(sf_trigger_msg->dl_info[i]->harq_status);
} }
free(sf_trigger_msg->dl_info); free(sf_trigger_msg->dl_info);
for (i = 0; i < sf_trigger_msg->n_ul_info; i++) {
free(sf_trigger_msg->ul_info[i]->reception_status);
}
free(sf_trigger_msg->ul_info); free(sf_trigger_msg->ul_info);
free(sf_trigger_msg); free(sf_trigger_msg);
} }
...@@ -1230,9 +1228,9 @@ int flexran_agent_mac_handle_dl_mac_config(mid_t mod_id, const void *params, Pro ...@@ -1230,9 +1228,9 @@ int flexran_agent_mac_handle_dl_mac_config(mid_t mod_id, const void *params, Pro
*msg = NULL; *msg = NULL;
return 2; return 2;
error: // error:
*msg = NULL; //*msg = NULL;
return -1; //return -1;
} }
void flexran_agent_init_mac_agent(mid_t mod_id) { void flexran_agent_init_mac_agent(mid_t mod_id) {
...@@ -1252,7 +1250,7 @@ void flexran_agent_send_sr_info(mid_t mod_id) { ...@@ -1252,7 +1250,7 @@ void flexran_agent_send_sr_info(mid_t mod_id) {
int size; int size;
Protocol__FlexranMessage *msg; Protocol__FlexranMessage *msg;
void *data; void *data;
int priority; int priority = 0;
err_code_t err_code; err_code_t err_code;
int xid = 0; int xid = 0;
...@@ -1282,7 +1280,7 @@ void flexran_agent_send_sf_trigger(mid_t mod_id) { ...@@ -1282,7 +1280,7 @@ void flexran_agent_send_sf_trigger(mid_t mod_id) {
int size; int size;
Protocol__FlexranMessage *msg; Protocol__FlexranMessage *msg;
void *data; void *data;
int priority; int priority = 0;
err_code_t err_code; err_code_t err_code;
int xid = 0; int xid = 0;
...@@ -1310,13 +1308,11 @@ void flexran_agent_send_sf_trigger(mid_t mod_id) { ...@@ -1310,13 +1308,11 @@ void flexran_agent_send_sf_trigger(mid_t mod_id) {
void flexran_agent_send_update_mac_stats(mid_t mod_id) { void flexran_agent_send_update_mac_stats(mid_t mod_id) {
Protocol__FlexranMessage *current_report = NULL, *msg; Protocol__FlexranMessage *current_report = NULL;
void *data; void *data;
int size; int size;
err_code_t err_code; err_code_t err_code;
int priority; int priority = 0;
mac_stats_updates_context_t stats_context = mac_stats_context[mod_id];
if (pthread_mutex_lock(mac_stats_context[mod_id].mutex)) { if (pthread_mutex_lock(mac_stats_context[mod_id].mutex)) {
goto error; goto error;
...@@ -1437,7 +1433,7 @@ err_code_t flexran_agent_destroy_cont_mac_stats_update(mid_t mod_id) { ...@@ -1437,7 +1433,7 @@ err_code_t flexran_agent_destroy_cont_mac_stats_update(mid_t mod_id) {
flexran_agent_destroy_flexran_message(mac_stats_context[mod_id].prev_stats_reply); flexran_agent_destroy_flexran_message(mac_stats_context[mod_id].prev_stats_reply);
free(mac_stats_context[mod_id].mutex); free(mac_stats_context[mod_id].mutex);
mac_agent_registered[mod_id] = NULL; mac_agent_registered[mod_id] = 0;
return 1; return 1;
} }
......
...@@ -63,8 +63,8 @@ typedef struct { ...@@ -63,8 +63,8 @@ typedef struct {
/// Notify the controller for a state change of a particular UE, by sending the proper /// Notify the controller for a state change of a particular UE, by sending the proper
/// UE state change message (ACTIVATION, DEACTIVATION, HANDOVER) /// UE state change message (ACTIVATION, DEACTIVATION, HANDOVER)
void (*flexran_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti, int (*flexran_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti,
uint32_t state_change); uint8_t state_change);
void *dl_scheduler_loaded_lib; void *dl_scheduler_loaded_lib;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <string.h> #include <string.h>
#include <dlfcn.h> #include <dlfcn.h>
#include "flexran_agent_common_internal.h"
#include "flexran_agent_mac_internal.h" #include "flexran_agent_mac_internal.h"
Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol__FlexranMessage *new_message, Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol__FlexranMessage *new_message,
...@@ -49,11 +50,6 @@ Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol ...@@ -49,11 +50,6 @@ Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol
old_report = old_message->stats_reply_msg; old_report = old_message->stats_reply_msg;
new_report = new_message->stats_reply_msg; new_report = new_message->stats_reply_msg;
/*Flags to designate changes in various levels of the message*/
int stats_had_changes = 0;
int ue_had_change = 0;
int cell_had_change = 0;
/*See how many and which UE reports should be included in the final stats message*/ /*See how many and which UE reports should be included in the final stats message*/
int n_ue_report = 0; int n_ue_report = 0;
int ue_found = 0; int ue_found = 0;
...@@ -101,23 +97,6 @@ Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol ...@@ -101,23 +97,6 @@ Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol
} }
cell_found = 0; cell_found = 0;
} }
/*TODO: create the reply message based on the findings*/
/*Create ue report list*/
if (n_ue_report > 0) {
ue_report = malloc(sizeof(Protocol__FlexUeStatsReport *));
for (i = 0; i<n_ue_report; i++) {
ue_report[i] = tmp_ue_report[i];
}
}
/*Create cell report list*/
if (n_cell_report > 0) {
cell_report = malloc(sizeof(Protocol__FlexCellStatsReport *));
for (i = 0; i<n_cell_report; i++) {
cell_report[i] = tmp_cell_report[i];
}
}
if (n_cell_report > 0 || n_ue_report > 0) { if (n_cell_report > 0 || n_ue_report > 0) {
/*Create header*/ /*Create header*/
...@@ -128,11 +107,30 @@ Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol ...@@ -128,11 +107,30 @@ Protocol__FlexranMessage * flexran_agent_generate_diff_mac_stats_report(Protocol
} }
stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply)); stats_reply_msg = malloc(sizeof(Protocol__FlexStatsReply));
protocol__flex_stats_reply__init(stats_reply_msg); protocol__flex_stats_reply__init(stats_reply_msg);
stats_reply_msg->header = header; stats_reply_msg->header = header;
/*TODO: create the reply message based on the findings*/
/*Create ue report list*/
stats_reply_msg->n_ue_report = n_ue_report; stats_reply_msg->n_ue_report = n_ue_report;
stats_reply_msg->ue_report = ue_report; if (n_ue_report > 0) {
ue_report = malloc(sizeof(Protocol__FlexUeStatsReport *));
for (i = 0; i<n_ue_report; i++) {
ue_report[i] = tmp_ue_report[i];
}
stats_reply_msg->ue_report = ue_report;
}
/*Create cell report list*/
stats_reply_msg->n_cell_report = n_cell_report; stats_reply_msg->n_cell_report = n_cell_report;
stats_reply_msg->cell_report = cell_report; if (n_cell_report > 0) {
cell_report = malloc(sizeof(Protocol__FlexCellStatsReport *));
for (i = 0; i<n_cell_report; i++) {
cell_report[i] = tmp_cell_report[i];
}
stats_reply_msg->cell_report = cell_report;
}
msg = malloc(sizeof(Protocol__FlexranMessage)); msg = malloc(sizeof(Protocol__FlexranMessage));
if(msg == NULL) if(msg == NULL)
goto error; goto error;
...@@ -270,7 +268,7 @@ Protocol__FlexUlCqiReport * copy_ul_cqi_report(Protocol__FlexUlCqiReport * origi ...@@ -270,7 +268,7 @@ Protocol__FlexUlCqiReport * copy_ul_cqi_report(Protocol__FlexUlCqiReport * origi
ul_report = malloc(sizeof(Protocol__FlexUlCqi *) * full_ul_report->n_cqi_meas); ul_report = malloc(sizeof(Protocol__FlexUlCqi *) * full_ul_report->n_cqi_meas);
if(ul_report == NULL) if(ul_report == NULL)
goto error; goto error;
for(i = 0; i++; i < full_ul_report->n_cqi_meas) { for(i = 0; i < full_ul_report->n_cqi_meas; i++) {
ul_report[i] = malloc(sizeof(Protocol__FlexUlCqi)); ul_report[i] = malloc(sizeof(Protocol__FlexUlCqi));
if(ul_report[i] == NULL) if(ul_report[i] == NULL)
goto error; goto error;
...@@ -597,22 +595,22 @@ int parse_mac_config(mid_t mod_id, yaml_parser_t *parser) { ...@@ -597,22 +595,22 @@ int parse_mac_config(mid_t mod_id, yaml_parser_t *parser) {
goto error; goto error;
} }
// Check the types of subsystems offered and handle their values accordingly // Check the types of subsystems offered and handle their values accordingly
if (strcmp(event.data.scalar.value, "dl_scheduler") == 0) { if (strcmp((char *) event.data.scalar.value, "dl_scheduler") == 0) {
LOG_D(ENB_APP, "This is for the dl_scheduler subsystem\n"); LOG_D(ENB_APP, "This is for the dl_scheduler subsystem\n");
// Call the proper handler // Call the proper handler
if (parse_dl_scheduler_config(mod_id, parser) == -1) { if (parse_dl_scheduler_config(mod_id, parser) == -1) {
LOG_D(ENB_APP, "An error occured\n"); LOG_D(ENB_APP, "An error occured\n");
goto error; goto error;
} }
} else if (strcmp(event.data.scalar.value, "ul_scheduler") == 0) { } else if (strcmp((char *) event.data.scalar.value, "ul_scheduler") == 0) {
// Call the proper handler // Call the proper handler
LOG_D(ENB_APP, "This is for the ul_scheduler subsystem\n"); LOG_D(ENB_APP, "This is for the ul_scheduler subsystem\n");
goto error; goto error;
// TODO // TODO
} else if (strcmp(event.data.scalar.value, "ra_scheduler") == 0) { } else if (strcmp((char *) event.data.scalar.value, "ra_scheduler") == 0) {
// Call the proper handler // Call the proper handler
// TODO // TODO
} else if (strcmp(event.data.scalar.value, "page_scheduler") == 0) { } else if (strcmp((char *) event.data.scalar.value, "page_scheduler") == 0) {
// Call the proper handler // Call the proper handler
// TODO // TODO
} else { } else {
...@@ -665,20 +663,20 @@ int parse_dl_scheduler_config(mid_t mod_id, yaml_parser_t *parser) { ...@@ -665,20 +663,20 @@ int parse_dl_scheduler_config(mid_t mod_id, yaml_parser_t *parser) {
goto error; goto error;
} }
// Check what key needs to be set // Check what key needs to be set
if (strcmp(event.data.scalar.value, "behavior") == 0) { if (strcmp((char *) event.data.scalar.value, "behavior") == 0) {
LOG_I(ENB_APP, "Time to set the behavior attribute\n"); LOG_I(ENB_APP, "Time to set the behavior attribute\n");
yaml_event_delete(&event); yaml_event_delete(&event);
if (!yaml_parser_parse(parser, &event)) { if (!yaml_parser_parse(parser, &event)) {
goto error; goto error;
} }
if (event.type == YAML_SCALAR_EVENT) { if (event.type == YAML_SCALAR_EVENT) {
if (load_dl_scheduler_function(mod_id, event.data.scalar.value) == -1) { if (load_dl_scheduler_function(mod_id, (char *) event.data.scalar.value) == -1) {
goto error; goto error;
} }
} else { } else {
goto error; goto error;
} }
} else if (strcmp(event.data.scalar.value, "parameters") == 0) { } else if (strcmp((char *) event.data.scalar.value, "parameters") == 0) {
LOG_D(ENB_APP, "Now it is time to set the parameters for this subsystem\n"); LOG_D(ENB_APP, "Now it is time to set the parameters for this subsystem\n");
if (parse_dl_scheduler_parameters(mod_id, parser) == -1) { if (parse_dl_scheduler_parameters(mod_id, parser) == -1) {
goto error; goto error;
...@@ -731,7 +729,7 @@ int parse_dl_scheduler_parameters(mid_t mod_id, yaml_parser_t *parser) { ...@@ -731,7 +729,7 @@ int parse_dl_scheduler_parameters(mid_t mod_id, yaml_parser_t *parser) {
if (mac_agent_registered[mod_id]) { if (mac_agent_registered[mod_id]) {
LOG_D(ENB_APP, "Setting parameter %s\n", event.data.scalar.value); LOG_D(ENB_APP, "Setting parameter %s\n", event.data.scalar.value);
param = dlsym(agent_mac_xface[mod_id]->dl_scheduler_loaded_lib, param = dlsym(agent_mac_xface[mod_id]->dl_scheduler_loaded_lib,
event.data.scalar.value); (char *) event.data.scalar.value);
if (param == NULL) { if (param == NULL) {
goto error; goto error;
} }
......
...@@ -344,7 +344,7 @@ void enb_config_display(void) ...@@ -344,7 +344,7 @@ void enb_config_display(void)
#if defined(FLEXRAN_AGENT_SB_IF) #if defined(FLEXRAN_AGENT_SB_IF)
printf( "\nFLEXRAN AGENT CONFIG : \n\n"); printf( "\nFLEXRAN AGENT CONFIG : \n\n");
printf( "\tInterface name: \t%s:\n",enb_properties.properties[i]->flexran_agent_interface_name); printf( "\tInterface name: \t%s:\n",enb_properties.properties[i]->flexran_agent_interface_name);
printf( "\tInterface IP Address: \t%s:\n",enb_properties.properties[i]->flexran_agent_ipv4_address); // printf( "\tInterface IP Address: \t%s:\n",enb_properties.properties[i]->flexran_agent_ipv4_address);
printf( "\tInterface PORT: \t%d:\n\n",enb_properties.properties[i]->flexran_agent_port); printf( "\tInterface PORT: \t%d:\n\n",enb_properties.properties[i]->flexran_agent_port);
printf( "\tCache directory: \t%s:\n",enb_properties.properties[i]->flexran_agent_cache); printf( "\tCache directory: \t%s:\n",enb_properties.properties[i]->flexran_agent_cache);
...@@ -2494,10 +2494,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -2494,10 +2494,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
enb_properties.properties[enb_properties_index]->flexran_agent_interface_name = strdup(flexran_agent_interface_name); enb_properties.properties[enb_properties_index]->flexran_agent_interface_name = strdup(flexran_agent_interface_name);
cidr = flexran_agent_ipv4_address; cidr = flexran_agent_ipv4_address;
address = strtok(cidr, "/"); address = strtok(cidr, "/");
enb_properties.properties[enb_properties_index]->flexran_agent_ipv4_address = strdup(address); //enb_properties.properties[enb_properties_index]->flexran_agent_ipv4_address = strdup(address);
/* if (address) { if (address) {
IPV4_STR_ADDR_TO_INT_NWBO (address, enb_properties.properties[enb_properties_index]->flexran_agent_ipv4_address, "BAD IP ADDRESS FORMAT FOR eNB Agent !\n" ); IPV4_STR_ADDR_TO_INT_NWBO (address, enb_properties.properties[enb_properties_index]->flexran_agent_ipv4_address, "BAD IP ADDRESS FORMAT FOR eNB Agent !\n" );
}*/ }
enb_properties.properties[enb_properties_index]->flexran_agent_port = flexran_agent_port; enb_properties.properties[enb_properties_index]->flexran_agent_port = flexran_agent_port;
enb_properties.properties[enb_properties_index]->flexran_agent_cache = strdup(flexran_agent_cache); enb_properties.properties[enb_properties_index]->flexran_agent_cache = strdup(flexran_agent_cache);
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include "log.h" #include "log.h"
#include "flexran_agent.h" #include "flexran_agent.h"
#include "flexran_agent_mac_defs.h" #include "flexran_agent_mac_defs.h"
#include "flexran_agent_mac.h"
#include "flexran_agent_mac_internal.h"
#include "flexran_agent_extern.h" #include "flexran_agent_extern.h"
...@@ -38,6 +40,8 @@ ...@@ -38,6 +40,8 @@
#include "flexran_agent_net_comm.h" #include "flexran_agent_net_comm.h"
#include "flexran_agent_async.h" #include "flexran_agent_async.h"
#include <arpa/inet.h>
//#define TEST_TIMER //#define TEST_TIMER
flexran_agent_instance_t flexran_agent[NUM_MAX_ENB]; flexran_agent_instance_t flexran_agent[NUM_MAX_ENB];
...@@ -64,11 +68,10 @@ void *flexran_agent_task(void *args){ ...@@ -64,11 +68,10 @@ void *flexran_agent_task(void *args){
void *data; void *data;