Commit f9d72699 authored by Navid Nikaein's avatar Navid Nikaein

* add RRC and PDCP message print to lte-softmodem (option -R)



git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5309 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent c19de0db
......@@ -524,7 +524,7 @@ void SR_indication(module_id_t enb_mod_idP, frame_t frameP, rnti_t rntiP, sub_fr
eNB_mac_inst[enb_mod_idP].UE_template[ue_mod_id].ul_active = TRUE;
} else {
// AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP);
AssertError(0, 0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP);
AssertError(0, 0, "find_UE_id(%u,rnti %d) not found\n", enb_mod_idP, rntiP);
}
}
......
......@@ -295,11 +295,7 @@ boolean_t pdcp_data_req(
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].apply_security);
}
LOG_D(PDCP,"MAC_I is %02x.%02x.%02x.%02x\n",
pdcp_pdu_p->data[pdcp_header_len + sdu_buffer_sizeP ],
pdcp_pdu_p->data[pdcp_header_len + sdu_buffer_sizeP +1],
pdcp_pdu_p->data[pdcp_header_len + sdu_buffer_sizeP +2],
pdcp_pdu_p->data[pdcp_header_len + sdu_buffer_sizeP +3]);
#endif
/* Print octets of outgoing data in hexadecimal form */
......@@ -327,7 +323,15 @@ boolean_t pdcp_data_req(
* Ask sublayer to transmit data and check return value
* to see if RLC succeeded
*/
#ifdef PDCP_MSG_PRINT
int i=0;
LOG_F(PDCP,"[MSG] PDCP DL %s PDU on rb_id %d\n", (srb_flagP)? "CONTROL" : "DATA", rb_idP);
for (i = 0; i < pdcp_pdu_size; i++)
LOG_F(PDCP,"%02x ", ((uint8_t*)pdcp_pdu_p->data)[i]);
LOG_F(PDCP,"\n");
#endif
rlc_status = rlc_data_req(enb_mod_idP, ue_mod_idP, frameP, enb_flagP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p);
}
switch (rlc_status) {
case RLC_OP_STATUS_OK:
......@@ -428,6 +432,14 @@ boolean_t pdcp_data_ind(
oai_emulation.info.first_ue_local);
}
#endif
#ifdef PDCP_MSG_PRINT
int i=0;
LOG_F(PDCP,"[MSG] PDCP UL %s PDU on rb_id %d\n", (srb_flagP)? "CONTROL" : "DATA", rb_idP);
for (i = 0; i < sdu_buffer_sizeP; i++)
LOG_F(PDCP,"%02x ", ((uint8_t*)sdu_buffer_pP->data)[i]);
LOG_F(PDCP,"\n");
#endif
if (MBMS_flagP) {
AssertError (rb_idP < NB_RB_MBMS_MAX, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, NB_RB_MBMS_MAX, ue_mod_idP, enb_mod_idP);
if (enb_flagP == ENB_FLAG_NO) {
......
......@@ -563,7 +563,8 @@ void rrc_eNB_generate_SecurityModeCommand(
eNB_rrc_inst[enb_mod_idP].integrity_algorithm[ue_mod_idP]);
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"RRC Security Mode Command\n");
uint16_t i=0;
LOG_F(RRC,"[MSG] RRC Security Mode Command\n");
for (i = 0; i < size; i++)
LOG_F(RRC,"%02x ", ((uint8_t*)buffer)[i]);
LOG_F(RRC,"\n");
......@@ -1144,7 +1145,7 @@ static void rrc_eNB_generate_defaultRRCConnectionReconfiguration(
mac_MainConfig, NULL, NULL, Sparams, rsrp, cba_RNTI, dedicatedInfoNASList);
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"RRC Connection Reconfiguration\n");
LOG_F(RRC,"[MSG] RRC Connection Reconfiguration\n");
for (i = 0; i < size; i++)
LOG_F(RRC,"%02x ", ((uint8_t*)buffer)[i]);
LOG_F(RRC,"\n");
......@@ -2459,9 +2460,9 @@ void rrc_eNB_generate_RRCConnectionSetup(
SRB_configList, &eNB_rrc_inst[enb_mod_idP].physicalConfigDedicated[ue_mod_idP]);
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"RRC Connection Setup\n");
for (cnt = 0; cnt < eNB_rrc_inst[Mod_id].Srb0.Tx_buffer.payload_size; cnt++)
LOG_F(RRC,"%02x ", ((uint8_t*)eNB_rrc_inst[Mod_id].Srb0.Tx_buffer.Payload)[cnt]);
LOG_F(RRC,"[MSG] RRC Connection Setup\n");
for (cnt = 0; cnt < eNB_rrc_inst[enb_mod_idP].Srb0.Tx_buffer.payload_size; cnt++)
LOG_F(RRC,"%02x ", ((uint8_t*)eNB_rrc_inst[enb_mod_idP].Srb0.Tx_buffer.Payload)[cnt]);
LOG_F(RRC,"\n");
//////////////////////////////////
#endif
......@@ -2702,7 +2703,7 @@ int rrc_eNB_decode_ccch(
case UL_CCCH_MessageType__c1_PR_rrcConnectionReestablishmentRequest:
#ifdef RRC_MSG_PRINT
LOG_F(RRC, "RRC Connection Reestablishement Request\n");
LOG_F(RRC,"[MSG] RRC Connection Reestablishement Request\n");
for (i = 0; i < Srb_info->Rx_buffer.payload_size; i++)
LOG_F(RRC,"%02x ", ((uint8_t*)Srb_info->Rx_buffer.Payload)[i]);
LOG_F(RRC,"\n");
......@@ -2737,7 +2738,7 @@ int rrc_eNB_decode_ccch(
*/
case UL_CCCH_MessageType__c1_PR_rrcConnectionRequest:
#ifdef RRC_MSG_PRINT
LOG_F(RRC, "RRC Connection Request\n");
LOG_F(RRC,"[MSG] RRC Connection Request\n");
for (i = 0; i < Srb_info->Rx_buffer.payload_size; i++)
LOG_F(RRC,"%02x ", ((uint8_t*)Srb_info->Rx_buffer.Payload)[i]);
LOG_F(RRC,"\n");
......@@ -2879,7 +2880,8 @@ int rrc_eNB_decode_dcch(
//UL_DCCH_Message_t uldcchmsg;
UL_DCCH_Message_t *ul_dcch_msg = NULL; //&uldcchmsg;
UE_EUTRA_Capability_t *UE_EUTRA_Capability = NULL;
int i;
if ((Srb_id != 1) && (Srb_id != 2)) {
LOG_E(RRC, "[eNB %d] Frame %d: Received message on SRB%d, should not have ...\n", enb_mod_idP, frameP, Srb_id);
}
......@@ -2917,9 +2919,7 @@ int rrc_eNB_decode_dcch(
# endif
#endif
{
int i;
{
for (i = 0; i < sdu_sizeP; i++)
LOG_T(RRC, "%x.", Rx_sdu[i]);
LOG_T(RRC, "\n");
......@@ -2951,9 +2951,9 @@ int rrc_eNB_decode_dcch(
case UL_DCCH_MessageType__c1_PR_rrcConnectionReconfigurationComplete:
#ifdef RRC_MSG_PRINT
LOG_F(RRC," RRC Connection Reconfiguration Complete\n");
for (i = 0; i < sdu_size; i++)
LOF_F(RRC,"%02x ", ((uint8_t*)Rx_sdu)[i]);
LOG_F(RRC,"[MSG] RRC Connection Reconfiguration Complete\n");
for (i = 0; i < sdu_sizeP; i++)
LOG_F(RRC,"%02x ", ((uint8_t*)Rx_sdu)[i]);
LOG_F(RRC,"\n");
#endif
LOG_D(RRC,
......@@ -2984,8 +2984,8 @@ int rrc_eNB_decode_dcch(
case UL_DCCH_MessageType__c1_PR_rrcConnectionReestablishmentComplete:
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"RRC Connection Reestablishment Complete\n");
for (i = 0; i < sdu_size; i++)
LOG_F(RRC,"[MSG] RRC Connection Reestablishment Complete\n");
for (i = 0; i < sdu_sizeP; i++)
LOG_F(RRC,"%02x ", ((uint8_t*)Rx_sdu)[i]);
LOG_F(RRC,"\n");
#endif
......@@ -2997,8 +2997,8 @@ int rrc_eNB_decode_dcch(
case UL_DCCH_MessageType__c1_PR_rrcConnectionSetupComplete:
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"RRC Connection SetupComplete\n");
for (i = 0; i < sdu_size; i++)
LOG_F(RRC,"[MSG] RRC Connection SetupComplete\n");
for (i = 0; i < sdu_sizeP; i++)
LOG_F(RRC,"%02x ", ((uint8_t*)Rx_sdu)[i]);
LOG_F(RRC,"\n");
#endif
......@@ -3027,8 +3027,8 @@ int rrc_eNB_decode_dcch(
case UL_DCCH_MessageType__c1_PR_securityModeComplete:
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"RRC Security Mode Complete\n");
for (i = 0; i < sdu_size; i++)
LOG_F(RRC,"[MSG] RRC Security Mode Complete\n");
for (i = 0; i < sdu_sizeP; i++)
LOG_F(RRC,"%02x ", ((uint8_t*)Rx_sdu)[i]);
LOG_F(RRC,"\n");
#endif
......@@ -3049,8 +3049,8 @@ int rrc_eNB_decode_dcch(
case UL_DCCH_MessageType__c1_PR_securityModeFailure:
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"RRC Security Mode Failure\n");
for (i = 0; i < sdu_size; i++)
LOG_F(RRC,"[MSG] RRC Security Mode Failure\n");
for (i = 0; i < sdu_sizeP; i++)
LOG_F(RRC,"%02x ", ((uint8_t*)Rx_sdu)[i]);
LOG_F(RRC,"\n");
#endif
......@@ -3068,8 +3068,8 @@ int rrc_eNB_decode_dcch(
case UL_DCCH_MessageType__c1_PR_ueCapabilityInformation:
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"RRC UECapablility Information \n");
for (i = 0; i < sdu_size; i++)
LOG_F(RRC,"[MSG] RRC UECapablility Information \n");
for (i = 0; i < sdu_sizeP; i++)
LOG_F(RRC,"%02x ", ((uint8_t*)Rx_sdu)[i]);
LOG_F(RRC,"\n");
#endif
......@@ -3110,8 +3110,8 @@ int rrc_eNB_decode_dcch(
case UL_DCCH_MessageType__c1_PR_ulInformationTransfer:
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"RRC UL Information Transfer \n");
for (i = 0; i < sdu_size; i++)
LOG_F(RRC,"[MSG] RRC UL Information Transfer \n");
for (i = 0; i < sdu_sizeP; i++)
LOG_F(RRC,"%02x ", ((uint8_t*)Rx_sdu)[i]);
LOG_F(RRC,"\n");
#endif
......
......@@ -594,7 +594,8 @@ int rrc_eNB_process_S1AP_DOWNLINK_NAS(MessageDef *msg_p, const char *msg_name, i
S1AP_DOWNLINK_NAS (msg_p).nas_pdu.buffer);
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"RRC DL Information Transfer\n");
int i=0;
LOG_F(RRC,"[MSG] RRC DL Information Transfer\n");
for (i = 0; i < length; i++)
LOG_F(RRC,"%02x ", ((uint8_t*)buffer)[i]);
LOG_F(RRC,"\n");
......
......@@ -153,7 +153,7 @@ int logInit (void)
g_log->log_component[RRC].flag = LOG_MED;
g_log->log_component[RRC].interval = 1;
g_log->log_component[RRC].fd = 0;
g_log->log_component[RRC].filelog = 1;
g_log->log_component[RRC].filelog = 0;
g_log->log_component[RRC].filelog_name = "/tmp/rrc.log";
g_log->log_component[NAS].name = "NAS";
......@@ -694,14 +694,14 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
// OAI printf compatibility
if ((g_log->onlinelog == 1) && (level != LOG_FILE))
#ifdef RTAI
if (len > MAX_LOG_TOTAL) {
rt_printk ("[OPENAIR] FIFO_PRINTF WROTE OUTSIDE ITS MEMORY BOUNDARY : ERRORS WILL OCCUR\n");
}
if (len > MAX_LOG_TOTAL) {
rt_printk ("[OPENAIR] FIFO_PRINTF WROTE OUTSIDE ITS MEMORY BOUNDARY : ERRORS WILL OCCUR\n");
}
if (len > 0) {
rtf_put (FIFO_PRINTF_NO, c->log_buffer, len);
rtf_put (FIFO_PRINTF_NO, c->log_buffer, len);
}
#else
fwrite(c->log_buffer, len, 1, stdout);
fwrite(c->log_buffer, len, 1, stdout);
#endif
#ifndef RTAI
......@@ -718,6 +718,11 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
// TODO assert ?
}
}
#else
// online print messges
if ((g_log->log_component[comp].filelog) && (level == LOG_FILE)) {
printf(c->log_buffer);
}
#endif
#if defined(ENABLE_ITTI)
......@@ -934,14 +939,19 @@ void set_glog_filelog(int enable)
void set_component_filelog(int comp)
{
if (g_log->log_component[comp].filelog == 0) {
g_log->log_component[comp].filelog = 1;
if (g_log->log_component[comp].fd == 0) {
g_log->log_component[comp].fd = open(g_log->log_component[comp].filelog_name,
O_WRONLY | O_CREAT | O_TRUNC, 0666);
}
if (g_log->log_component[comp].filelog == 0) {
g_log->log_component[comp].filelog = 1;
#ifndef RTAI
if (g_log->log_component[comp].fd == 0) {
g_log->log_component[comp].fd = open(g_log->log_component[comp].filelog_name,
O_WRONLY | O_CREAT | O_TRUNC, 0666);
}
#else
#endif
}
}
/*
......
......@@ -123,8 +123,9 @@ ifdef ENABLE_ITTI
CFLAGS += -DEXMIMO_IOT
endif
ifdef RRC_MSG_PRINT
CFLAG += -DRRC_MSG_PRINT
ifdef MSG_PRINT
CFLAGS += -DRRC_MSG_PRINT
CFLAGS += -DPDCP_MSG_PRINT
endif
CFLAGS += $(L2_incl) $(ENB_APP_incl) $(UTIL_incl) $(UTILS_incl)
......
......@@ -238,7 +238,7 @@ static uint32_t txgain[4] = {20,20,20,20};
static runmode_t mode;
static int rx_input_level_dBm;
static int log_messages=0;
static int online_log_messages=0;
#ifdef XFORMS
extern int otg_enabled;
static char do_forms=0;
......@@ -1260,7 +1260,7 @@ static void get_options (int argc, char **argv)
opp_enabled = 1;
break;
case 'R' :
log_messages =1;
online_log_messages =1;
break;
default:
break;
......@@ -1386,8 +1386,10 @@ int main(int argc, char **argv) {
#endif
#endif
set_comp_log(ENB_APP, LOG_INFO, LOG_HIGH, 1);
if (log_messages == 1)
if (online_log_messages == 1) {
set_component_filelog(RRC);
set_component_filelog(PDCP);
}
}
if (ouput_vcd) {
......
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