Commit dec41a2a authored by Cedric Roux's avatar Cedric Roux
Browse files

Merge branch 'develop_integration_w02' into 'develop'

Develop integration w02

See merge request !82
parents 8d3368b7 0af4c170
......@@ -484,7 +484,8 @@ rrc_rx_tx(
if (UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T304_cnt == 0) {
UE_rrc_inst[ctxt_pP->module_id].Info[enb_indexP].T304_active = 0;
UE_rrc_inst[ctxt_pP->module_id].HandoverInfoUe.measFlag = 1;
LOG_E(RRC,"[UE %d] Handover failure..initiating connection re-establishment procedure... \n");
LOG_E(RRC,"[UE %d] Handover failure..initiating connection re-establishment procedure... \n",
ctxt_pP->module_id);
//Implement 36.331, section 5.3.5.6 here
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT);
return(RRC_Handover_failed);
......
......@@ -304,14 +304,14 @@ init_SI(
// SIB13
for (i = 0; i < eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sib13->mbsfn_AreaInfoList_r9.list.count; i++) {
LOG_D(RRC, PROTOCOL_RRC_CTXT_FMT" SIB13 contents for MBSFN sync area %d/2 (partial)\n",
LOG_D(RRC, PROTOCOL_RRC_CTXT_FMT" SIB13 contents for MBSFN sync area %d/%d (partial)\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP),
i,
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sib13->mbsfn_AreaInfoList_r9.list.count);
LOG_D(RRC, PROTOCOL_RRC_CTXT_FMT" MCCH Repetition Period: %d (just index number, not real value)\n",
LOG_D(RRC, PROTOCOL_RRC_CTXT_FMT" MCCH Repetition Period: %ld (just index number, not real value)\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP),
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sib13->mbsfn_AreaInfoList_r9.list.array[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
LOG_D(RRC, PROTOCOL_RRC_CTXT_FMT" MCCH Offset: %d\n",
LOG_D(RRC, PROTOCOL_RRC_CTXT_FMT" MCCH Offset: %ld\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP),
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].sib13->mbsfn_AreaInfoList_r9.list.array[i]->mcch_Config_r9.mcch_Offset_r9);
}
......@@ -394,7 +394,7 @@ init_MCCH(
eNB_rrc_inst[enb_mod_idP].carrier[CC_id].MCCH_MESSAGE[sync_area],
sync_area);
LOG_D(RRC, "[eNB %d] MCCH_MESSAGE contents for Sync Area %d (partial)\n", enb_mod_idP, sync_area);
LOG_D(RRC, "[eNB %d] CommonSF_AllocPeriod_r9 %d\n", enb_mod_idP,
LOG_D(RRC, "[eNB %d] CommonSF_AllocPeriod_r9 %ld\n", enb_mod_idP,
eNB_rrc_inst[enb_mod_idP].carrier[CC_id].mcch_message->commonSF_AllocPeriod_r9);
LOG_D(RRC,
"[eNB %d] CommonSF_Alloc_r9.list.count (number of MBSFN Subframe Pattern) %d\n",
......@@ -598,7 +598,7 @@ rrc_eNB_get_next_free_ue_context(
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head)) {
if (ue_context_p->ue_context.random_ue_identity == ue_identityP) {
LOG_D(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" Cannot create new UE context, already exist rand UE id 0x%x, uid %u\n",
PROTOCOL_RRC_CTXT_UE_FMT" Cannot create new UE context, already exist rand UE id 0x%"PRIx64", uid %u\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
ue_identityP,
ue_context_p->local_uid);
......@@ -690,7 +690,7 @@ rrc_eNB_free_mem_UE_context(
{
int i;
LOG_T(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" Clearing UE context 0x%x (free internal structs)\n",
PROTOCOL_RRC_CTXT_UE_FMT" Clearing UE context 0x%p (free internal structs)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
ue_context_pP);
#ifdef Rel10
......@@ -1310,7 +1310,7 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* co
ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config);
//ue_context_pP->ue_context.DRB_configList2[drb_identity_index] = &(*DRB_configList);
LOG_I(RRC,"EPS ID %d, DRB ID %d (index %d), QCI %d, priority %d, LCID %d LCGID %d \n",
LOG_I(RRC,"EPS ID %ld, DRB ID %ld (index %d), QCI %d, priority %ld, LCID %ld LCGID %ld \n",
*DRB_config->eps_BearerIdentity,
DRB_config->drb_Identity, i,
ue_context_pP->ue_context.e_rab[i].param.qos.qci,
......@@ -1703,7 +1703,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* cons
if (*physicalConfigDedicated) {
if ((*physicalConfigDedicated)->antennaInfo) {
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.transmissionMode = rrc_inst->configuration.ue_TransmissionMode[0];
LOG_D(RRC,"Setting transmission mode to %d+1\n",rrc_inst->configuration.ue_TransmissionMode[0]);
LOG_D(RRC,"Setting transmission mode to %ld+1\n",rrc_inst->configuration.ue_TransmissionMode[0]);
if (rrc_inst->configuration.ue_TransmissionMode[0]==AntennaInfoDedicated__transmissionMode_tm3) {
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction=
CALLOC(1,sizeof(AntennaInfoDedicated__codebookSubsetRestriction_PR));
......@@ -2265,8 +2265,8 @@ rrc_eNB_process_MeasurementReport(
}
#ifdef Rel10
LOG_I(RRC, "RSRP of Source %d\n", measResults2->measResultPCell.rsrpResult);
LOG_I(RRC, "RSRQ of Source %d\n", measResults2->measResultPCell.rsrqResult);
LOG_I(RRC, "RSRP of Source %ld\n", measResults2->measResultPCell.rsrpResult);
LOG_I(RRC, "RSRQ of Source %ld\n", measResults2->measResultPCell.rsrqResult);
#else
LOG_I(RRC, "RSRP of Source %d\n", measResults2->measResultServCell.rsrpResult);
LOG_I(RRC, "RSRQ of Source %d\n", measResults2->measResultServCell.rsrqResult);
......@@ -2368,7 +2368,7 @@ rrc_eNB_generate_HandoverPreparationInformation(
ue_context_target_p->ue_id_rnti = ue_context_pP->ue_context.rnti; // LG: should not be the same
ue_context_target_p->ue_context.rnti = ue_context_target_p->ue_id_rnti; // idem
LOG_N(RRC,
"[eNB %d] Frame %d : Emulate sending HandoverPreparationInformation msg from eNB source %d to eNB target %d: source UE_id %x target UE_id %x source_modId: %d target_modId: %d\n",
"[eNB %d] Frame %d : Emulate sending HandoverPreparationInformation msg from eNB source %d to eNB target %ld: source UE_id %x target UE_id %x source_modId: %d target_modId: %d\n",
ctxt_pP->module_id,
ctxt_pP->frame,
eNB_rrc_inst[ctxt_pP->module_id].carrier[0] /* CROUX TBC */.physCellId,
......@@ -2395,7 +2395,7 @@ rrc_eNB_generate_HandoverPreparationInformation(
ue_context_target_p->ue_context.handover_info->ueid_t = ue_context_target_p->ue_context.rnti;
} else {
LOG_E(RRC, "\nError in obtaining free UE id in target eNB %l for handover \n", targetPhyId);
LOG_E(RRC, "\nError in obtaining free UE id in target eNB %ld for handover \n", targetPhyId);
}
} else {
......@@ -3160,7 +3160,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
memset((void *)mobilityInfo, 0, sizeof(*mobilityInfo));
mobilityInfo->targetPhysCellId =
(PhysCellId_t) two_tier_hexagonal_cellIds[ue_context_pP->ue_context.handover_info->modid_t];
LOG_D(RRC, "[eNB %d] Frame %d: handover preparation: targetPhysCellId: %d mod_id: %d ue: %x \n",
LOG_D(RRC, "[eNB %d] Frame %d: handover preparation: targetPhysCellId: %ld mod_id: %d ue: %x \n",
ctxt_pP->module_id,
ctxt_pP->frame,
mobilityInfo->targetPhysCellId,
......@@ -3254,7 +3254,8 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
(void *)rrc_inst->sps_Config[ue_mod_idP],
sizeof(SPS_Config_t));
*/
LOG_I(RRC, "[eNB %d] Frame %d: adding new UE\n");
LOG_I(RRC, "[eNB %d] Frame %d: adding new UE\n",
ctxt_pP->module_id, ctxt_pP->frame);
//Idx = (ue_mod_idP * NB_RB_MAX) + DCCH;
Idx = DCCH;
// SRB1
......@@ -3549,9 +3550,10 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
ctxt_pP->frame,
ue_context_pP->ue_context.primaryCC_id);
} else {
LOG_W(RRC,"[eNB %d] Frame %d CC %d : invalide SRB identity %d\n",
LOG_W(RRC,"[eNB %d] Frame %d CC %d : invalide SRB identity %ld\n",
ctxt_pP->module_id,
ctxt_pP->frame,
ue_context_pP->ue_context.primaryCC_id,
SRB_configList->list.array[i]->srb_Identity);
}
}
......@@ -4219,7 +4221,7 @@ rrc_eNB_decode_ccch(
// AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)");
// ue_context_p = NULL;
} else {
LOG_I(RRC," S-TMSI doesn't exist, setting Initialue_identity_s_TMSI.m_tmsi to %x => %x\n",ue_context_p,m_tmsi);
LOG_I(RRC," S-TMSI doesn't exist, setting Initialue_identity_s_TMSI.m_tmsi to %p => %x\n",ue_context_p,m_tmsi);
ue_context_p = rrc_eNB_get_next_free_ue_context(ctxt_pP, NOT_A_RANDOM_UE_IDENTITY);
if (ue_context_p == NULL)
LOG_E(RRC, "%s:%d:%s: rrc_eNB_get_next_free_ue_context returned NULL\n", __FILE__, __LINE__, __FUNCTION__);
......@@ -4256,7 +4258,7 @@ rrc_eNB_decode_ccch(
}
LOG_D(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" UE context: %X\n",
PROTOCOL_RRC_CTXT_UE_FMT" UE context: %p\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
ue_context_p);
......@@ -4266,14 +4268,14 @@ rrc_eNB_decode_ccch(
#if defined(ENABLE_ITTI)
ue_context_p->ue_context.establishment_cause = rrcConnectionRequest->establishmentCause;
if (stmsi_received==0)
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE random UE identity (0x%" PRIx64 ") MME code %u TMSI %u cause %u\n",
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE random UE identity (0x%" PRIx64 ") MME code %u TMSI %u cause %ld\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
ue_context_p->ue_context.random_ue_identity,
ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code,
ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi,
ue_context_p->ue_context.establishment_cause);
else
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE MME code %u TMSI %u cause %u\n",
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE MME code %u TMSI %u cause %ld\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code,
ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi,
......@@ -4463,7 +4465,7 @@ rrc_eNB_decode_dcch(
}
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Failed to decode UL-DCCH (%d bytes)\n",
LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Failed to decode UL-DCCH (%zu bytes)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
dec_rval.consumed);
return -1;
......@@ -4530,13 +4532,13 @@ rrc_eNB_decode_dcch(
if (ue_context_p->ue_context.Status == RRC_RECONFIGURED){
dedicated_DRB = 1;
LOG_I(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (dedicated DRB, xid %d)\n",
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (dedicated DRB, xid %ld)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
}else {
dedicated_DRB = 0;
ue_context_p->ue_context.Status = RRC_RECONFIGURED;
LOG_I(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (default DRB, xid %d)\n",
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (default DRB, xid %ld)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
}
rrc_eNB_process_RRCConnectionReconfigurationComplete(
......
......@@ -115,7 +115,7 @@ rrc_eNB_S1AP_get_ue_ids(
(hash_key_t)eNB_ue_s1ap_id,
result2);
if (h_rc != HASH_TABLE_OK) {
LOG_E(S1AP, "[eNB %u] Error while hashtable_insert in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %u\n",
LOG_E(S1AP, "[eNB %ld] Error while hashtable_insert in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %"PRIu32"\n",
rrc_instance_pP - eNB_rrc_inst, eNB_ue_s1ap_id);
}
}
......@@ -308,7 +308,7 @@ rrc_eNB_process_security(
changed = TRUE;
}
LOG_I (RRC, "[eNB %d][UE %x] Selected security algorithms (%x): %x, %x, %s\n",
LOG_I (RRC, "[eNB %d][UE %x] Selected security algorithms (%p): %x, %x, %s\n",
ctxt_pP->module_id,
ue_context_pP->ue_context.rnti,
security_capabilities_pP,
......@@ -1008,7 +1008,7 @@ int rrc_eNB_process_S1AP_UE_CTXT_MODIFICATION_REQ(MessageDef *msg_p, const char
/* Can not associate this message to an UE index, send a failure to S1AP and discard it! */
MessageDef *msg_fail_p;
LOG_W(RRC, "[eNB %d] In S1AP_UE_CTXT_MODIFICATION_REQ: unknown UE from eNB_ue_s1ap_id (%d) for eNB %d\n", instance, eNB_ue_s1ap_id);
LOG_W(RRC, "[eNB %d] In S1AP_UE_CTXT_MODIFICATION_REQ: unknown UE from eNB_ue_s1ap_id (%d)\n", instance, eNB_ue_s1ap_id);
msg_fail_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_UE_CTXT_MODIFICATION_FAIL);
S1AP_UE_CTXT_MODIFICATION_FAIL (msg_fail_p).eNB_ue_s1ap_id = eNB_ue_s1ap_id;
......
......@@ -60,8 +60,8 @@ extern "C" {
//public_log_if( log_t *g_log;)
public_log_if( int logInit (void);)
public_log_if( void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...);)
public_log_if( void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...);)
public_log_if( void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));)
public_log_if( void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));)
public_log_if( int set_comp_log(int component, int level, int verbosity, int interval);)
public_log_if( int set_log(int component, int level, int interval);)
public_log_if( void set_glog(int level, int verbosity);)
......
......@@ -199,7 +199,11 @@ display_node_list (node_list * node_vector)
//use a python script to postprocess the positions, check the
// support: view node mobility of one node during the entire simulation OR only one snapshot
LOG_F(OMG,"%d; %.3f; %.3f; %.3f\n",
/* TODO: this LOG_F generates a warning, below is a fix that removes a %.3f, maybe it's not the correct fix */
/*LOG_F(OMG,"%d; %.3f; %.3f; %.3f\n",
tmp->node->id,
tmp->node->x_pos, tmp->node->y_pos);*/
LOG_F(OMG,"%d; %.3f; %.3f\n",
tmp->node->id,
tmp->node->x_pos, tmp->node->y_pos);
......
......@@ -159,7 +159,7 @@ static void *opt_listener_thread(void *arg)
pthread_exit(NULL);
} else {
/* Normal read -> discard PDU */
LOG_D(OPT, "Incoming data received from: %s:%u with length %d\n",
LOG_D(OPT, "Incoming data received from: %s:%u with length %zd\n",
inet_ntoa(opt_listener.address.sin_addr),
ntohs(opt_listener.address.sin_port), ret);
}
......@@ -198,7 +198,9 @@ int opt_create_listener_socket(char *ip_address, uint16_t port)
ret = bind(opt_listener.sd, (struct sockaddr*) &opt_listener.address, sizeof(opt_listener.address));
if (ret != 0) {
LOG_E(OPT, "Failed to bind socket to (%s:%u): %s\n", strerror(errno));
LOG_E(OPT, "Failed to bind socket to (%s:%u): %s\n",
inet_ntoa(opt_listener.address.sin_addr),
ntohs(opt_listener.address.sin_port), strerror(errno));
opt_type = OPT_NONE;
close(opt_listener.sd);
opt_listener.sd = -1;
......@@ -358,7 +360,7 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
(const struct sockaddr *)&g_serv_addr, sizeof(g_serv_addr));
if (bytesSent != frameOffset) {
LOG_W(OPT, "sendto() failed (not a thread-safe func)- expected %d bytes, got %d (errno=%d)\n",
LOG_W(OPT, "sendto() failed (not a thread-safe func)- expected %d bytes, got %ld (errno=%d)\n",
frameOffset, bytesSent, errno);
//exit(1);
}
......
......@@ -216,7 +216,7 @@ void average_total_jitter(void)
}
}
LOG_I(OTG,"average_jitter_dl %d average_jitter_ul %lf \n",otg_info->average_jitter_dl,otg_info->average_jitter_ul );
LOG_I(OTG,"average_jitter_dl %lf average_jitter_ul %lf \n",otg_info->average_jitter_dl,otg_info->average_jitter_ul );
// otg_info->average_jitter_dl/= (float)NB_UE_INST;
// otg_info->average_jitter_ul/= (float)NB_UE_INST;
}
......
......@@ -106,8 +106,10 @@ int otg_rx_pkt(const int dst_instanceP, const int ctime, const char * const buff
if (dst_instance != dst_instanceP) {
//#warning "LG: TODO think about multicast traffic"
LOG_W(OTG,"[SRC %d][DST %d] [FLOW_idx %d][APP TYPE %d] RX INFO pkt at time %d: flag 0x %x, seq number %d, tx time %d, size (hdr %d, pdcp %d) not for dest instance %u\n",
dst_instanceP);
/* TODO: fix this LOG, a lot of missing parameters, replaced by a simple basic version */
/*LOG_W(OTG,"[SRC %d][DST %d] [FLOW_idx %d][APP TYPE %d] RX INFO pkt at time %d: flag 0x %x, seq number %d, tx time %d, size (hdr %d, pdcp %d) not for dest instance %u\n",
dst_instanceP);*/
LOG_W(OTG,"dst_instance != dst_instanceP\n");
}
if(otg_hdr_rx->traffic_type > MAX_NUM_APPLICATION) {
......@@ -246,7 +248,7 @@ int otg_rx_pkt(const int dst_instanceP, const int ctime, const char * const buff
ctime - otg_hdr_rx->time,
nb_loss_pkts);
LOG_I(OTG,"INFO LATENCY :: [SRC %d][DST %d] radio access %.2f (tx time %d, ctime %d), OWD:%.2f (ms):\n",
LOG_I(OTG,"INFO LATENCY :: [SRC %d][DST %d] radio access %.2f (tx time %d, ctime %d), OWD:%d (ms):\n",
src_instance,
dst_instance,
otg_multicast_info->radio_access_delay[src_instance][dst_instance],
......
......@@ -305,10 +305,10 @@ unsigned char *packet_gen(
otg_info->tx_num_pkt[src_instance][dst_instance][otg_info->traffic_type[src_instance][dst_instance]]+=1;
if (size!=strlen(payload))
LOG_E(OTG,"[%d][%d] [0x %x] The expected packet size does not match the payload size : size %d, strlen %d, seq_num %d packet: |%s|%s| \n",
LOG_E(OTG,"[%d][%d] [0x %x] The expected packet size does not match the payload size : size %d, strlen %zu, seq_num %d packet: |%s|%s| \n",
src_instance, dst_instance, flag, size, strlen(payload), seq_num, header, payload);
else
LOG_D(OTG,"[%d][%d] 0x %x][m2m Aggre %d][Flow %d][Type %d/%s] TX INFO pkt at time %d Size= [payload %d] [Total %d] with seq num %d, state=%d : |%s|%s| \n",
LOG_D(OTG,"[%d][%d] 0x %x][m2m Aggre %d][Flow %d][Type %d/%s] TX INFO pkt at time %d Size= [payload %d] [Total %zu] with seq num %d, state=%d : |%s|%s| \n",
src_instance, dst_instance, flag,
otg_info->m2m_aggregation[src_instance][dst_instance],
otg_info->flow_id[src_instance][dst_instance],
......@@ -335,7 +335,7 @@ unsigned char *packet_gen(
otg_info->seq_num_background[src_instance][dst_instance]+=1;
if (otg_info->size_background[src_instance][dst_instance]!=strlen(payload))
LOG_E(OTG,"[%d][%d] [0x %x] The expected packet size does not match the payload size : size %d, strlen %d, seq num %d, packet |%s|%s| \n",
LOG_E(OTG,"[%d][%d] [0x %x] The expected packet size does not match the payload size : size %d, strlen %zu, seq num %d, packet |%s|%s| \n",
src_instance,
dst_instance,
flag,
......@@ -345,7 +345,7 @@ unsigned char *packet_gen(
header,
payload);
else
LOG_D(OTG,"[%d][%d][%s][0x %x] TX INFO pkt at time %d size is %d with seq num %d, state=%d : |%s|%s| \n",
LOG_D(OTG,"[%d][%d][0x %x][%d] TX INFO pkt at time %s size is %d with seq num %d, state=%d : |%s|%s| \n",
src_instance,
dst_instance,
flag,
......@@ -459,10 +459,10 @@ unsigned char *packet_gen_multicast(
otg_multicast_info->tx_num_bytes[src_instance][dst_instance][app]);
if (size!=strlen(payload))
LOG_E(OTG,"[src %d][dst %d] The expected packet size does not match the payload size : size %d, strlen %d \n",
LOG_E(OTG,"[src %d][dst %d] The expected packet size does not match the payload size : size %d, strlen %zu \n",
src_instance, dst_instance, size, strlen(payload));
else {
LOG_I(OTG,"[src %d][dst %d]TX INFO pkt at time %d Size= [payload %d] [Total %d] with seq num %d: |%s|%s| \n",
LOG_I(OTG,"[src %d][dst %d]TX INFO pkt at time %d Size= [payload %d] [Total %zu] with seq num %d: |%s|%s| \n",
src_instance,
dst_instance,
ctime,
......@@ -838,7 +838,7 @@ unsigned int header_size(const int hdr_size)
if (hdr_size>(sizeof(otg_hdr_info_t) + sizeof(otg_hdr_t)))
size-=(sizeof(otg_hdr_info_t) + sizeof(otg_hdr_t));
else
LOG_W(OTG,"OTG Header not included inside packet header (OTG header:%d, Header%d)\n", hdr_size, sizeof(otg_hdr_info_t) + sizeof(otg_hdr_t) );
LOG_W(OTG,"OTG Header not included inside packet header (OTG header:%d, Header%zu)\n", hdr_size, sizeof(otg_hdr_info_t) + sizeof(otg_hdr_t) );
return(size);
......@@ -1211,7 +1211,7 @@ void init_predef_traffic(
break;
case M2M_TRAFFIC : /* example of M2M traffic */
LOG_I(OTG," M2M_TRAFFIC, src = %d, dst = %d \n", i, j, g_otg->application_type[i][j][k]);
LOG_I(OTG," M2M_TRAFFIC, src = %d, dst = %d, application type = %d\n", i, j, g_otg->application_type[i][j][k]);
g_otg->trans_proto[i][j][k] = TCP;
g_otg->ip_v[i][j][k] = IPV4;
g_otg->pu_size_pkts[i][j][k]=50;
......@@ -2015,7 +2015,7 @@ void state_management(
&& (otg_info->state_transition_prob[src_instance][dst_instance][application]<=1))
&& (otg_info->c_holding_time_off[src_instance][dst_instance]>=g_otg->holding_time_off_pe[src_instance][dst_instance])) {
otg_info->state[src_instance][dst_instance][application]=PE_STATE;
LOG_I(OTG,"[%d][%d][Appli id %d][Agg Level=%d] NEW STATE:: OFF-->PE \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance]);
LOG_I(OTG,"[%d][%d][Appli id %d][Agg Level=%d] NEW STATE:: OFF-->PE \n", src_instance, dst_instance,application, g_otg->aggregation_level[src_instance][dst_instance][application]);
otg_info->state_transition_prob[src_instance][dst_instance][application]=uniform_dist(0,1);
} else {
......
......@@ -410,7 +410,7 @@ nwGtpv1uDestroyTunnelEndPoint( NwGtpv1uStackT *thiz,
NwGtpv1uTunnelEndPointT *pRemovedTeid;
if(pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle) {
GTPU_DEBUG( "Destroying Tunnel end-point '%x'",
GTPU_DEBUG( "Destroying Tunnel end-point '%lx'",
pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle);
pRemovedTeid = RB_REMOVE(NwGtpv1uTunnelEndPointIdentifierMap, &(thiz->teidMap),
(NwGtpv1uTunnelEndPointT *)(
......@@ -423,7 +423,7 @@ nwGtpv1uDestroyTunnelEndPoint( NwGtpv1uStackT *thiz,
(NwGtpv1uTunnelEndPointT *)
pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle);
} else {
GTPU_WARNING("Non-existent Tunnel end-point handle '%x'",
GTPU_WARNING("Non-existent Tunnel end-point handle '%lx'",
pUlpReq->apiInfo.destroyTunnelEndPointInfo.hStackSessionHandle);
}
......
../common/utils/itti
\ No newline at end of file
......@@ -523,7 +523,7 @@ int nas_message_encode(
/* Compute the NAS message authentication code */
LOG_TRACE(DEBUG,
"offset %d = %d - %d, hdr encode = %d, length = %d bytes = %d",
offset, size, sizeof(uint8_t),
offset, size, (int)sizeof(uint8_t),
size, length, bytes);
uint32_t mac = _nas_message_get_mac(
buffer + offset,
......@@ -992,12 +992,12 @@ static int _nas_message_decrypt(
case NAS_SECURITY_ALGORITHMS_EEA1: {
if (direction == SECU_DIRECTION_UPLINK) {
count = 0x00000000 ||
((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) ||
count = 0x00000000 |
((emm_security_context->ul_count.overflow & 0x0000FFFF) << 8) |
(emm_security_context->ul_count.seq_num & 0x000000FF);
} else {
count = 0x00000000 ||
((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) ||
count = 0x00000000 |
((emm_security_context->dl_count.overflow & 0x0000FFFF) << 8) |
(emm_security_context->dl_count.seq_num & 0x000000FF);
}
......@@ -1026,12 +1026,12 @@ static int _nas_message_decrypt(
case NAS_SECURITY_ALGORITHMS_EEA2: {
if (direction == SECU_DIRECTION_UPLINK) {
count = 0x00000000 ||
((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) ||
count = 0x00000000 |
((emm_security_context->ul_count.overflow & 0x0000FFFF) << 8) |
(emm_security_context->ul_count.seq_num & 0x000000FF);
} else {
count = 0x00000000 ||
((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) ||
count = 0x00000000 |
((emm_security_context->dl_count.overflow & 0x0000FFFF) << 8) |
(emm_security_context->dl_count.seq_num & 0x000000FF);
}
......@@ -1154,12 +1154,12 @@ static int _nas_message_encrypt(
case NAS_SECURITY_ALGORITHMS_EEA1: {
if (direction == SECU_DIRECTION_UPLINK) {
count = 0x00000000 ||
((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) ||
count = 0x00000000 |
((emm_security_context->ul_count.overflow & 0x0000FFFF) << 8) |
(emm_security_context->ul_count.seq_num & 0x000000FF);
} else {
count = 0x00000000 ||
((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) ||
count = 0x00000000 |
((emm_security_context->dl_count.overflow & 0x0000FFFF) << 8) |
(emm_security_context->dl_count.seq_num & 0x000000FF);
}
......@@ -1185,12 +1185,12 @@ static int _nas_message_encrypt(
case NAS_SECURITY_ALGORITHMS_EEA2: {
if (direction == SECU_DIRECTION_UPLINK) {
count = 0x00000000 ||
((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) ||
count = 0x00000000 |
((emm_security_context->ul_count.overflow & 0x0000FFFF) << 8) |
(emm_security_context->ul_count.seq_num & 0x000000FF);
} else {
count = 0x00000000 ||
((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) ||
count = 0x00000000 |
((emm_security_context->dl_count.overflow & 0x0000FFFF) << 8) |
(emm_security_context->dl_count.seq_num & 0x000000FF);
}
......@@ -1296,15 +1296,17 @@ static uint32_t _nas_message_get_mac(
uint32_t count;
uint32_t *mac32;
#ifdef DEBUG_NAS_MESSAGE
int i,bytes = 0;
#endif
if (direction == SECU_DIRECTION_UPLINK) {
count = 0x00000000 ||
((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) ||
count = 0x00000000 |
((emm_security_context->ul_count.overflow & 0x0000FFFF) << 8) |
(emm_security_context->ul_count.seq_num & 0x000000FF);
} else {
count = 0x00000000 ||
((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) ||
count = 0x00000000 |
((emm_security_context->dl_count.overflow & 0x0000FFFF) << 8) |
(emm_security_context->dl_count.seq_num & 0x000000FF);
}
......@@ -1367,12 +1369,12 @@ static uint32_t _nas_message_get_mac(
uint32_t *mac32;
if (direction == SECU_DIRECTION_UPLINK) {
count = 0x00000000 ||
((emm_security_context->ul_count.overflow && 0x0000FFFF) << 8) ||
count = 0x00000000 |
((emm_security_context->ul_count.overflow & 0x0000FFFF) << 8) |
(emm_security_context->ul_count.seq_num & 0x000000FF);
} else {
count = 0x00000000 ||
((emm_security_context->dl_count.overflow && 0x0000FFFF) << 8) ||
count = 0x00000000 |
((emm_security_context->dl_count.overflow & 0x0000FFFF) << 8) |
(emm_security_context->dl_count.seq_num & 0x000000FF);
}
......
......@@ -131,7 +131,7 @@ do {
do { \
nas_log_func_indent -= 2; \
LOG_D(NAS, " %s:%d %*sLeaving %s(rc = %ld)\n", __FILE__, __LINE__, nas_log_func_indent, "", \
__FUNCTION__, (long) rETURNcODE); \
__FUNCTION__, (long) (rETURNcODE)); \
return (rETURNcODE); \
} while (0)
......@@ -146,7 +146,7 @@ extern int nas_log_func_indent;
# define LOG_FUNC_RETURN(rETURNcODE) \
do { \
LOG_TRACE(FUNC_OUT, "Leaving %s(rc = %ld)", __FUNCTION__, \
(long) rETURNcODE); \
(long) (rETURNcODE)); \
return (rETURNcODE); \
} while(0)
......
......@@ -807,8 +807,7 @@ int emm_proc_plmn_selection_end(int found, tac_t tac, ci_t ci, AcT_t rat)
if (is_forbidden) {
/* The selected cell is known not to be able to provide normal
* service */
LOG_TRACE(INFO, "EMM-IDLE - UE may camp on this acceptable cell ",
"for limited services");
LOG_TRACE(INFO, "EMM-IDLE - UE may camp on this acceptable cell for limited services");
/* Save the index of the first forbidden PLMN */
if (_emm_plmn_list.fplmn < 0) {
......@@ -819,8 +818,7 @@ int emm_proc_plmn_selection_end(int found, tac_t tac, ci_t ci, AcT_t rat)
} else {
/* A suitable cell has been found and the PLMN or tracking area
* is not in the forbidden list */
LOG_TRACE(INFO, "EMM-IDLE - UE may camp on this suitable cell ",
"for normal services");
LOG_TRACE(INFO, "EMM-IDLE - UE may camp on this suitable cell for normal services");
_emm_plmn_list.fplmn = -1;
_emm_plmn_list.param[index].stat = NET_OPER_CURRENT;
emm_sap.primitive = EMMREG_REGISTER_CNF;
......@@ -905,7 +903,10 @@ int emm_proc_plmn_selection_end(int found, tac_t tac, ci_t ci, AcT_t rat)
* Or terminate the PLMN selection procedure
*/
if (!select_next_plmn) {
if (!(_emm_plmn_list.fplmn) < 0) { // FIXME this comparison makes no sense (bool < 0)
/* TODO: be sure of this fix */
LOG_TRACE(WARNING, "%s:%d:%s: be sure!!\n", __FILE__, __LINE__, __FUNCTION__);
//if (!(_emm_plmn_list.fplmn) < 0) { // FIXME this comparison makes no sense (bool < 0)
if (!(_emm_plmn_list.fplmn < 0)) { // FIXME this comparison makes no sense (bool < 0)
/* There were one or more PLMNs which were available and allowable,
* but an LR failure made registration on those PLMNs unsuccessful
* or an entry in any of the forbidden area lists prevented a
......
......@@ -205,7 +205,7 @@ int s1ap_eNB_handle_message(uint32_t assoc_id, int32_t stream,
if (message.procedureCode > sizeof(messages_callback) / (3 * sizeof(
s1ap_message_decoded_callback))
|| (message.direction > S1AP_PDU_PR_unsuccessfulOutcome)) {
S1AP_ERROR("[SCTP %d] Either procedureCode %d or direction %d exceed expected\n",
S1AP_ERROR("[SCTP %d] Either procedureCode %ld or direction %d exceed expected\n",
assoc_id, message.procedureCode, message.direction);
return -1;
}
......@@ -214,7 +214,7 @@ int s1ap_eNB_handle_message(uint32_t assoc_id, int32_t stream,
* This can mean not implemented or no procedure for eNB (wrong direction).
*/
if (messages_callback[message.procedureCode][message.direction-1] == NULL) {
S1AP_ERROR("[SCTP %d] No handler for procedureCode %d in %s\n",
S1AP_ERROR("[SCTP %d] No handler for procedureCode %ld in %s\n",
assoc_id, message.procedureCode,
s1ap_direction2String[message.direction]);
return -1;
......@@ -452,10 +452,10 @@ int s1ap_eNB_handle_error_indication(uint32_t assoc_id,
return -1;
}
if ( s1_error_indication_p->presenceMask & S1AP_ERRORINDICATIONIES_MME_UE_S1AP_ID_PRESENT) {
S1AP_WARN("Received S1 Error indication MME UE S1AP ID 0x%x\n", s1_error_indication_p->mme_ue_s1ap_id);
S1AP_WARN("Received S1 Error indication MME UE S1AP ID 0x%lx\n", s1_error_indication_p->mme_ue_s1ap_id);
}
if ( s1_error_indication_p->presenceMask & S1AP_ERRORINDICATIONIES_ENB_UE_S1AP_ID_PRESENT) {
S1AP_WARN("Received S1 Error indication eNB UE S1AP ID 0x%x\n", s1_error_indication_p->eNB_UE_S1AP_ID);
S1AP_WARN("Received S1 Error indication eNB UE S1AP ID 0x%lx\n", s1_error_indication_p->eNB_UE_S1AP_ID);
}
if ( s1_error_indication_p->presenceMask & S1AP_ERRORINDICATIONIES_CAUSE_PRESENT) {
......@@ -710,7 +710,7 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
if ((ue_desc_p = s1ap_eNB_get_ue_context(mme_desc_p->s1ap_eNB_instance,
initialContextSetupRequest_p->eNB_UE_S1AP_ID)) == NULL) {
S1AP_ERROR("[SCTP %d] Received initial context setup request for non "
"existing UE context 0x%06x\n", assoc_id,
"existing UE context 0x%06lx\n", assoc_id,
initialContextSetupRequest_p->eNB_UE_S1AP_ID);
return -1;
}
......@@ -835,7 +835,7 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
if ((ue_desc_p = s1ap_eNB_get_ue_context(mme_desc_p->s1ap_eNB_instance,
enb_ue_s1ap_id)) == NULL) {