fix remaining printf warnings

master
Andre Puschmann 7 years ago
parent b298d3d3f9
commit 319f473363

@ -296,7 +296,7 @@ void enb::handle_rf_msg(srslte_rf_error_t error)
str.erase(std::remove(str.begin(), str.end(), '\n'), str.end()); str.erase(std::remove(str.begin(), str.end(), '\n'), str.end());
str.erase(std::remove(str.begin(), str.end(), '\r'), str.end()); str.erase(std::remove(str.begin(), str.end(), '\r'), str.end());
str.push_back('\n'); str.push_back('\n');
rf_log.info(str.c_str()); rf_log.info("%s\n", str.c_str());
} }
} }

@ -28,6 +28,7 @@
#include <string> #include <string>
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include <inttypes.h> // for printing uint64_t
#include "srsepc/hdr/hss/hss.h" #include "srsepc/hdr/hss/hss.h"
#include "srslte/common/security.h" #include "srslte/common/security.h"
@ -564,7 +565,7 @@ hss::increment_sqn(uint64_t imsi)
sqn++; sqn++;
m_hss_log->debug("Incremented SQN (IMSI: %015lu) SQN: %d\n", imsi, sqn); m_hss_log->debug("Incremented SQN (IMSI: %" PRIu64 ") SQN: %" PRIu64 "\n", imsi, sqn);
for(int i = 0; i < 6; i++){ for(int i = 0; i < 6; i++){
ue_ctx->sqn[i] = p[5-i]; ue_ctx->sqn[i] = p[5-i];

@ -25,6 +25,7 @@
*/ */
#include <iostream> #include <iostream>
#include <inttypes.h> // for printing uint64_t
#include "srslte/asn1/gtpc.h" #include "srslte/asn1/gtpc.h"
#include "srsepc/hdr/mme/mme_gtpc.h" #include "srsepc/hdr/mme/mme_gtpc.h"
#include "srsepc/hdr/mme/s1ap.h" #include "srsepc/hdr/mme/s1ap.h"
@ -115,10 +116,10 @@ mme_gtpc::send_create_session_request(uint64_t imsi)
cs_req->sender_f_teid.teid = get_new_ctrl_teid(); cs_req->sender_f_teid.teid = get_new_ctrl_teid();
cs_req->sender_f_teid.ipv4 = m_mme_gtpc_ip; cs_req->sender_f_teid.ipv4 = m_mme_gtpc_ip;
m_mme_gtpc_log->info("Next MME control TEID: %lu \n", m_next_ctrl_teid); m_mme_gtpc_log->info("Next MME control TEID: %d\n", m_next_ctrl_teid);
m_mme_gtpc_log->info("Allocated MME control TEID: %lu \n", cs_req->sender_f_teid.teid); m_mme_gtpc_log->info("Allocated MME control TEID: %d\n", cs_req->sender_f_teid.teid);
m_mme_gtpc_log->console("Creating Session Response -- IMSI: %015lu \n", imsi); m_mme_gtpc_log->console("Creating Session Response -- IMSI: %" PRIu64 "\n", imsi);
m_mme_gtpc_log->console("Creating Session Response -- MME control TEID: %lu \n", cs_req->sender_f_teid.teid); m_mme_gtpc_log->console("Creating Session Response -- MME control TEID: %d\n", cs_req->sender_f_teid.teid);
// APN // APN
strncpy(cs_req->apn, m_s1ap->m_s1ap_args.mme_apn.c_str(), sizeof(cs_req->apn)-1); strncpy(cs_req->apn, m_s1ap->m_s1ap_args.mme_apn.c_str(), sizeof(cs_req->apn)-1);
@ -185,7 +186,7 @@ mme_gtpc::handle_create_session_response(srslte::gtpc_pdu *cs_resp_pdu)
} }
uint64_t imsi = id_it->second; uint64_t imsi = id_it->second;
m_mme_gtpc_log->info("MME GTPC Ctrl TEID %d, IMSI %d\n", cs_resp_pdu->header.teid, imsi); m_mme_gtpc_log->info("MME GTPC Ctrl TEID %" PRIu64 ", IMSI %" PRIu64 "\n", cs_resp_pdu->header.teid, imsi);
//Get S-GW Control F-TEID //Get S-GW Control F-TEID
srslte::gtp_fteid_t sgw_ctr_fteid; srslte::gtp_fteid_t sgw_ctr_fteid;
@ -309,7 +310,7 @@ mme_gtpc::handle_modify_bearer_response(srslte::gtpc_pdu *mb_resp_pdu)
void void
mme_gtpc::send_delete_session_request(uint64_t imsi) mme_gtpc::send_delete_session_request(uint64_t imsi)
{ {
m_mme_gtpc_log->info("Sending GTP-C Delete Session Request request. IMSI %d\n",imsi); m_mme_gtpc_log->info("Sending GTP-C Delete Session Request request. IMSI %" PRIu64 "\n",imsi);
srslte::gtpc_pdu del_req_pdu; srslte::gtpc_pdu del_req_pdu;
srslte::gtp_fteid_t sgw_ctr_fteid; srslte::gtp_fteid_t sgw_ctr_fteid;
srslte::gtp_fteid_t mme_ctr_fteid; srslte::gtp_fteid_t mme_ctr_fteid;

@ -26,6 +26,7 @@
#include <iostream> #include <iostream>
#include <cmath> #include <cmath>
#include <inttypes.h> // for printing uint64_t
#include "srslte/common/bcd_helpers.h" #include "srslte/common/bcd_helpers.h"
#include "srsepc/hdr/mme/s1ap.h" #include "srsepc/hdr/mme/s1ap.h"
#include "srslte/asn1/gtpc.h" #include "srslte/asn1/gtpc.h"
@ -486,7 +487,7 @@ s1ap::delete_ue_ctx(uint64_t imsi)
ue_ctx_t *ue_ctx = find_ue_ctx_from_imsi(imsi); ue_ctx_t *ue_ctx = find_ue_ctx_from_imsi(imsi);
if(ue_ctx == NULL) if(ue_ctx == NULL)
{ {
m_s1ap_log->info("Cannot delete UE context, UE not found. IMSI: %d\n", imsi); m_s1ap_log->info("Cannot delete UE context, UE not found. IMSI: %" PRIu64 "\n", imsi);
return false; return false;
} }
@ -529,7 +530,7 @@ s1ap::activate_eps_bearer(uint64_t imsi, uint8_t ebi)
if (ecm_ctx->erabs_ctx[ebi].state != ERAB_CTX_SETUP) if (ecm_ctx->erabs_ctx[ebi].state != ERAB_CTX_SETUP)
{ {
m_s1ap_log->error("Could not be activate EPS Bearer, bearer in wrong state: MME S1AP Id %d, EPS Bearer id %d, state %d\n", mme_ue_s1ap_id, ebi, ecm_ctx->erabs_ctx[ebi].state); m_s1ap_log->error("Could not be activate EPS Bearer, bearer in wrong state: MME S1AP Id %d, EPS Bearer id %d, state %d\n", mme_ue_s1ap_id, ebi, ecm_ctx->erabs_ctx[ebi].state);
m_s1ap_log->console("Could not be activate EPS Bearer, bearer in wrong state: MME S1AP Id %d, EPS Bearer id %d\n",mme_ue_s1ap_id,ebi,ecm_ctx->erabs_ctx[ebi].state); m_s1ap_log->console("Could not be activate EPS Bearer, bearer in wrong state: MME S1AP Id %d, EPS Bearer id %d, state %d\n", mme_ue_s1ap_id, ebi, ecm_ctx->erabs_ctx[ebi].state);
return; return;
} }

@ -33,6 +33,7 @@
#include <linux/if.h> #include <linux/if.h>
#include <linux/if_tun.h> #include <linux/if_tun.h>
#include <linux/ip.h> #include <linux/ip.h>
#include <inttypes.h> // for printing uint64_t
#include "srsepc/hdr/spgw/spgw.h" #include "srsepc/hdr/spgw/spgw.h"
#include "srsepc/hdr/mme/mme_gtpc.h" #include "srsepc/hdr/mme/mme_gtpc.h"
#include "srslte/upper/gtpu.h" #include "srslte/upper/gtpu.h"
@ -401,7 +402,7 @@ spgw::handle_s1u_pdu(srslte::byte_buffer_t *msg)
int n = write(m_sgi_if, msg->msg, msg->N_bytes); int n = write(m_sgi_if, msg->msg, msg->N_bytes);
if(n<0) if(n<0)
{ {
m_spgw_log->error("Could not write to TUN interface.\n",n); m_spgw_log->error("Could not write to TUN interface.\n");
} }
else else
{ {
@ -444,8 +445,8 @@ spgw::create_gtp_ctx(struct srslte::gtpc_create_session_request *cs_req)
//in_addr_t ue_ip = inet_addr("172.16.0.2"); //in_addr_t ue_ip = inet_addr("172.16.0.2");
uint8_t default_bearer_id = 5; uint8_t default_bearer_id = 5;
m_spgw_log->console("SPGW: Allocated Ctrl TEID %d\n", spgw_uplink_ctrl_teid); m_spgw_log->console("SPGW: Allocated Ctrl TEID %" PRIu64 "\n", spgw_uplink_ctrl_teid);
m_spgw_log->console("SPGW: Allocated User TEID %d\n", spgw_uplink_user_teid); m_spgw_log->console("SPGW: Allocated User TEID %" PRIu64 "\n", spgw_uplink_user_teid);
struct in_addr ue_ip_; struct in_addr ue_ip_;
ue_ip_.s_addr=ue_ip; ue_ip_.s_addr=ue_ip;
m_spgw_log->console("SPGW: Allocate UE IP %s\n", inet_ntoa(ue_ip_)); m_spgw_log->console("SPGW: Allocate UE IP %s\n", inet_ntoa(ue_ip_));

@ -104,7 +104,7 @@ void ue_base::handle_rf_msg(srslte_rf_error_t error)
str.erase(std::remove(str.begin(), str.end(), '\n'), str.end()); str.erase(std::remove(str.begin(), str.end(), '\n'), str.end());
str.erase(std::remove(str.begin(), str.end(), '\r'), str.end()); str.erase(std::remove(str.begin(), str.end(), '\r'), str.end());
str.push_back('\n'); str.push_back('\n');
rf_log.info(str.c_str()); rf_log.info("%s\n", str.c_str());
} }
} }

Loading…
Cancel
Save