* applying patch 11 contributed from S. Held
* add protocol configuration to OCG XML file git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6629 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -487,6 +487,7 @@ void logRecord(const char *file, const char *func, int line, int comp,
|
||||
log_list_nb_elements++;
|
||||
}
|
||||
if(pthread_cond_signal(&log_notify) != 0) {
|
||||
pthread_mutex_unlock(&log_lock);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,43 +82,43 @@ pool_buffer_init ()
|
||||
//memory->mem_blocks[mb_index + index].next = NULL; -> done in memset 0
|
||||
switch (pool_index) {
|
||||
case 0:
|
||||
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool0[index][0]);
|
||||
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool0[index][0]);
|
||||
break;
|
||||
case 1:
|
||||
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool1[index][0]);
|
||||
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool1[index][0]);
|
||||
break;
|
||||
case 2:
|
||||
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool2[index][0]);
|
||||
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool2[index][0]);
|
||||
break;
|
||||
case 3:
|
||||
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool3[index][0]);
|
||||
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool3[index][0]);
|
||||
break;
|
||||
case 4:
|
||||
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool4[index][0]);
|
||||
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool4[index][0]);
|
||||
break;
|
||||
case 5:
|
||||
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool5[index][0]);
|
||||
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool5[index][0]);
|
||||
break;
|
||||
case 6:
|
||||
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool6[index][0]);
|
||||
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool6[index][0]);
|
||||
break;
|
||||
case 7:
|
||||
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool7[index][0]);
|
||||
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool7[index][0]);
|
||||
break;
|
||||
case 8:
|
||||
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool8[index][0]);
|
||||
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool8[index][0]);
|
||||
break;
|
||||
case 9:
|
||||
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool9[index][0]);
|
||||
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool9[index][0]);
|
||||
break;
|
||||
case 10:
|
||||
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool10[index][0]);
|
||||
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool10[index][0]);
|
||||
break;
|
||||
case 11:
|
||||
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool11[index][0]);
|
||||
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool11[index][0]);
|
||||
break;
|
||||
case 12:
|
||||
memory->mem_blocks[mb_index + index].data = &(memory->mem_pool12[index][0]);
|
||||
memory->mem_blocks[mb_index + index].data = (unsigned char*)&(memory->mem_pool12[index][0]);
|
||||
break;
|
||||
default:;
|
||||
memory->mem_blocks[mb_index + index].data = NULL; // pool copy
|
||||
@@ -300,79 +300,79 @@ check_mem_area (void)
|
||||
mem_pool *memory = (mem_pool *) &mem_block_var;
|
||||
|
||||
for (index = 0; index < MEM_MNGT_MB0_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[index].data != &(memory->mem_pool0[index][0])) && (memory->mem_blocks[index].pool_id != MEM_MNGT_POOL_ID0)) {
|
||||
if ((memory->mem_blocks[index].data != (unsigned char*)&(memory->mem_pool0[index][0])) && (memory->mem_blocks[index].pool_id != MEM_MNGT_POOL_ID0)) {
|
||||
msg ("[MEM] ERROR POOL0 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
mb_index = MEM_MNGT_MB0_NB_BLOCKS;
|
||||
for (index = 0; index < MEM_MNGT_MB1_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool1[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID1)) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool1[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID1)) {
|
||||
msg ("[MEM] ERROR POOL1 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
mb_index += MEM_MNGT_MB1_NB_BLOCKS;
|
||||
for (index = 0; index < MEM_MNGT_MB2_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool2[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID2)) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool2[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID2)) {
|
||||
msg ("[MEM] ERROR POOL2 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
mb_index += MEM_MNGT_MB2_NB_BLOCKS;
|
||||
for (index = 0; index < MEM_MNGT_MB3_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool3[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID3)) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool3[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID3)) {
|
||||
msg ("[MEM] ERROR POOL3 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
mb_index += MEM_MNGT_MB3_NB_BLOCKS;
|
||||
for (index = 0; index < MEM_MNGT_MB4_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool4[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID4)) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool4[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID4)) {
|
||||
msg ("[MEM] ERROR POOL4 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
mb_index += MEM_MNGT_MB4_NB_BLOCKS;
|
||||
for (index = 0; index < MEM_MNGT_MB5_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool5[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID5)) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool5[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID5)) {
|
||||
msg ("[MEM] ERROR POOL5 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
mb_index += MEM_MNGT_MB5_NB_BLOCKS;
|
||||
for (index = 0; index < MEM_MNGT_MB6_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool6[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID6)) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool6[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID6)) {
|
||||
msg ("[MEM] ERROR POOL6 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
mb_index += MEM_MNGT_MB6_NB_BLOCKS;
|
||||
for (index = 0; index < MEM_MNGT_MB7_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool7[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID7)) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool7[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID7)) {
|
||||
msg ("[MEM] ERROR POOL7 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
mb_index += MEM_MNGT_MB7_NB_BLOCKS;
|
||||
for (index = 0; index < MEM_MNGT_MB8_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool8[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID8)) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool8[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID8)) {
|
||||
msg ("[MEM] ERROR POOL8 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
mb_index += MEM_MNGT_MB8_NB_BLOCKS;
|
||||
for (index = 0; index < MEM_MNGT_MB9_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool9[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID9)) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool9[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID9)) {
|
||||
msg ("[MEM] ERROR POOL9 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
mb_index += MEM_MNGT_MB9_NB_BLOCKS;
|
||||
for (index = mb_index; index < MEM_MNGT_MB10_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool10[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID10)) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool10[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID10)) {
|
||||
msg ("[MEM] ERROR POOL10 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
mb_index += MEM_MNGT_MB10_NB_BLOCKS;
|
||||
for (index = mb_index; index < MEM_MNGT_MB11_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool11[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID11)) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool11[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID11)) {
|
||||
msg ("[MEM] ERROR POOL11 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
mb_index += MEM_MNGT_MB11_NB_BLOCKS;
|
||||
for (index = mb_index; index < MEM_MNGT_MB12_NB_BLOCKS; index++) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != &(memory->mem_pool12[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID12)) {
|
||||
if ((memory->mem_blocks[mb_index + index].data != (unsigned char*)&(memory->mem_pool12[index][0])) && (memory->mem_blocks[mb_index + index].pool_id != MEM_MNGT_POOL_ID12)) {
|
||||
msg ("[MEM] ERROR POOL12 block index %d\n", index);
|
||||
}
|
||||
}
|
||||
|
||||
+47
-23
@@ -467,28 +467,33 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t priority[11];//pas possible d'acceder au MAX_NUM_LCID
|
||||
//
|
||||
uint8_t DCI_aggregation_min;
|
||||
uint8_t DLSCH_dci_size_bits;
|
||||
//UL transmission bandwidth in RBs
|
||||
uint8_t ul_bandwidth[11];
|
||||
//DL transmission bandwidth in RBs
|
||||
uint8_t dl_bandwidth[11];
|
||||
//UL transmission bandwidth in RBs
|
||||
uint8_t min_ul_bandwidth[11];
|
||||
//DL transmission bandwidth in RBs
|
||||
uint8_t min_dl_bandwidth[11];
|
||||
//aggregated bit rate of non-gbr bearer per UE
|
||||
uint64_t ue_AggregatedMaximumBitrateDL;
|
||||
//aggregated bit rate of non-gbr bearer per UE
|
||||
uint64_t ue_AggregatedMaximumBitrateUL;
|
||||
//CQI scheduling interval in subframes.
|
||||
uint16_t cqiSchedInterval;
|
||||
//Contention resolution timer used during random access
|
||||
uint8_t mac_ContentionResolutionTimer;
|
||||
uint16_t max_allowed_rbs[11];
|
||||
uint8_t max_mcs[11];
|
||||
uint16_t priority[11];//pas possible d'acceder au MAX_NUM_LCID
|
||||
//
|
||||
uint8_t DCI_aggregation_min;
|
||||
uint8_t DLSCH_dci_size_bits;
|
||||
//UL transmission bandwidth in RBs
|
||||
uint8_t ul_bandwidth[11];
|
||||
//DL transmission bandwidth in RBs
|
||||
uint8_t dl_bandwidth[11];
|
||||
//UL transmission bandwidth in RBs
|
||||
uint8_t min_ul_bandwidth[11];
|
||||
//DL transmission bandwidth in RBs
|
||||
uint8_t min_dl_bandwidth[11];
|
||||
//aggregated bit rate of non-gbr bearer per UE
|
||||
uint64_t ue_AggregatedMaximumBitrateDL;
|
||||
//aggregated bit rate of non-gbr bearer per UE
|
||||
uint64_t ue_AggregatedMaximumBitrateUL;
|
||||
//CQI scheduling interval in subframes.
|
||||
uint16_t cqiSchedInterval;
|
||||
//Contention resolution timer used during random access
|
||||
uint8_t mac_ContentionResolutionTimer;
|
||||
uint16_t max_allowed_rbs[11];
|
||||
uint8_t max_mcs[11];
|
||||
|
||||
|
||||
uint8_t num_groups;
|
||||
|
||||
|
||||
} Mac_config;
|
||||
|
||||
/** @defgroup _Predefined_traffic Configuration
|
||||
@@ -653,6 +658,24 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
|
||||
} Emulation_Config;
|
||||
/* @}*/
|
||||
|
||||
/** @defgroup _OSD_basic OAI protocol config
|
||||
* @ingroup _OCG
|
||||
* @brief OAI Emulation struct for protocol configuration
|
||||
* @{*/
|
||||
|
||||
typedef struct{
|
||||
uint8_t num_groups;
|
||||
} eNB_MAC_Config;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
eNB_MAC_Config eNB_mac_config; /*!< \brief eNB MAC configuration parameters */
|
||||
|
||||
} Protocol_Config;
|
||||
|
||||
|
||||
/* @}*/
|
||||
|
||||
/** @defgroup _OSD_basic Basic OpenAirInterface Scenario Descriptor
|
||||
* @ingroup _OCG
|
||||
* @brief OAI Emulation struct for OSD_basic
|
||||
@@ -762,11 +785,12 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
|
||||
* @{*/
|
||||
typedef struct
|
||||
{
|
||||
Mac_config mac_config[NUMBER_OF_UE_MAX];
|
||||
Mac_config mac_config[NUMBER_OF_UE_MAX];
|
||||
Environment_System_Config environment_system_config; /*!< \brief Evironment configuration */
|
||||
Topology_Config topology_config; /*!< \brief Topology configuration */
|
||||
Application_Config application_config; /*!< \brief Applications configuration */
|
||||
Emulation_Config emulation_config; /*!< \brief Emulation configuration */
|
||||
Protocol_Config protocol_config; /* specific protocol configuration*/
|
||||
Info info; /*!< \brief Some important information which should be able to be reached by OAISIM */
|
||||
char *profile;
|
||||
} OAI_Emulation;
|
||||
|
||||
@@ -199,6 +199,11 @@ static int emu_;
|
||||
static int omg_;
|
||||
static int otg_;
|
||||
|
||||
/* MAC*/
|
||||
static int protocol_;
|
||||
static int mac_;
|
||||
static int num_groups_;
|
||||
|
||||
static int log_;
|
||||
static int level_;
|
||||
static int verbosity_;
|
||||
@@ -572,7 +577,14 @@ void start_element(void *user_data, const xmlChar *name, const xmlChar **attrs)
|
||||
} else if (!xmlStrcmp(name,(unsigned char*) "START_UE")) {
|
||||
cli_start_ue_ = 1;
|
||||
|
||||
} else if (!xmlStrcmp(name,(unsigned char*) "PROFILE")) {
|
||||
} else if (!xmlStrcmp(name,(unsigned char*) "PROTOCOL")) {
|
||||
protocol_ = 1;
|
||||
} else if (!xmlStrcmp(name,(unsigned char*) "MAC")) {
|
||||
mac_ = 1;
|
||||
} else if (!xmlStrcmp(name,(unsigned char*) "NUM_GROUPS")) {
|
||||
num_groups_ = 1;
|
||||
}
|
||||
else if (!xmlStrcmp(name,(unsigned char*) "PROFILE")) {
|
||||
profile_ = 1;
|
||||
} else {
|
||||
LOG_W(OCG, "One element could not be parsed : unknown element name '%s'\n", name);
|
||||
@@ -905,6 +917,12 @@ void end_element(void *user_data, const xmlChar *name) { // called once at the e
|
||||
cli_start_enb_ = 0;
|
||||
} else if (!xmlStrcmp(name,(unsigned char*) "START_UE")) {
|
||||
cli_start_ue_ = 0;
|
||||
} else if (!xmlStrcmp(name,(unsigned char*) "PROTOCOL")) {
|
||||
protocol_ = 0;
|
||||
} else if (!xmlStrcmp(name,(unsigned char*) "MAC")) {
|
||||
mac_ = 0;
|
||||
} else if (!xmlStrcmp(name,(unsigned char*) "NUM_GROUPS")) {
|
||||
num_groups_ = 0;
|
||||
} else if (!xmlStrcmp(name,(unsigned char*) "PROFILE")) {
|
||||
profile_ = 0;
|
||||
}
|
||||
@@ -1312,7 +1330,15 @@ void characters(void *user_data, const xmlChar *xmlch, int xmllen) { // called o
|
||||
oai_emulation.info.cli_start_ue[i] = atoi(ch);
|
||||
}
|
||||
}
|
||||
} else if (profile_) {
|
||||
}
|
||||
else if (protocol_) {
|
||||
if (mac_){
|
||||
if (num_groups_){
|
||||
oai_emulation.protocol_config.eNB_mac_config.num_groups=atoi(ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (profile_) {
|
||||
oai_emulation.profile = strndup(ch, len);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -498,13 +498,14 @@ int init_opt(char *path, char *ip, char *port, radio_type_t radio_type_p)
|
||||
subframesSinceCaptureStart = 0;
|
||||
|
||||
if (path != NULL) {
|
||||
strncpy( in_path, sizeof(in_path), path );
|
||||
strncpy( in_path, path, sizeof(in_path) );
|
||||
in_path[sizeof(in_path) - 1] = 0; // terminate string
|
||||
} else {
|
||||
strcpy( in_path, "oai_opt.pcap" );
|
||||
}
|
||||
if (ip != NULL) {
|
||||
strncpy( in_ip, sizeof(in_ip), ip );
|
||||
strncpy( in_ip, ip, sizeof(in_ip) );
|
||||
in_ip[sizeof(in_ip) - 1] = 0; // terminate string
|
||||
} else {
|
||||
strcpy( in_ip, "127.0.0.1" );
|
||||
}
|
||||
|
||||
@@ -390,11 +390,10 @@ fc=fopen("/tmp/otg.log","w");;
|
||||
else
|
||||
strcpy(traffic_type,"APPLICATION");
|
||||
|
||||
if (map_int_to_str(otg_app_type_names,g_otg->application_type[i][j][k]) == -1){
|
||||
if (map_int_to_str(otg_app_type_names,g_otg->application_type[i][j][k]) == 0){
|
||||
LOG_E(OTG,"(src=%d, dst=%d, appli %d) : Unknown traffic \n ", i, j,k);
|
||||
strcpy(traffic,"UKNOWN TRAFFIC");
|
||||
} else {
|
||||
//strcpy (traffic, map_int_to_str(otg_app_type_names,g_otg->application_type[i][j][k]));
|
||||
strncpy (traffic, map_int_to_str(otg_app_type_names,g_otg->application_type[i][j][k]), sizeof(traffic));
|
||||
traffic[sizeof(traffic) - 1] = 0; // terminate string
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ void tarmaPrintVideoInit(tarmaVideo_t *video){
|
||||
input:
|
||||
output: - random realization of R_s (B/s)
|
||||
*/
|
||||
double backgroundRateRnd(){
|
||||
double backgroundRateRnd(void){
|
||||
double rate;
|
||||
rate=pow(10,lognormal_dist(1.3525, 0.1954))/8; /*Byte/s*/;
|
||||
if(rate>BACKGROUND_RATE_MAX){
|
||||
@@ -447,7 +447,7 @@ double backgroundRateRnd(){
|
||||
input:
|
||||
output: - random realization of D_s (ms)
|
||||
*/
|
||||
int backgroundSessionDurationRnd(){
|
||||
int backgroundSessionDurationRnd(void){
|
||||
int duration;
|
||||
duration = ceil(pow(10,exponential_dist(1/0.3591))*1000); /*ms*/
|
||||
if(duration<0){
|
||||
|
||||
Reference in New Issue
Block a user