Merge branch 'next' into rlc_updates

master
Andre Puschmann 7 years ago
commit 4ea5fe6509

@ -1,6 +1,9 @@
Change Log for Releases Change Log for Releases
============================== ==============================
## 18.03
* Many bug-fixes and improved stability and performance in all parts
## 17.12 ## 17.12
* Added support for MIMO 2x2 in srsENB (i.e. TM3/TM4) * Added support for MIMO 2x2 in srsENB (i.e. TM3/TM4)
* Added srsEPC, a light-weight core network implementation * Added srsEPC, a light-weight core network implementation

@ -41,8 +41,6 @@ include(SRSLTEVersion) #sets version information
include(SRSLTEPackage) #setup cpack include(SRSLTEPackage) #setup cpack
include(CTest) include(CTest)
set(CTEST_MEMORYCHECK_COMMAND valgrind)
set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full" )
configure_file( configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in" "${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in"
@ -171,7 +169,6 @@ if(ENABLE_SRSUE OR ENABLE_SRSENB OR ENABLE_SRSEPC)
set(BOOST_REQUIRED_COMPONENTS set(BOOST_REQUIRED_COMPONENTS
program_options program_options
system
) )
if(UNIX AND EXISTS "/usr/lib64") if(UNIX AND EXISTS "/usr/lib64")
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
@ -229,7 +226,7 @@ macro(ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have)
endmacro(ADD_CXX_COMPILER_FLAG_IF_AVAILABLE) endmacro(ADD_CXX_COMPILER_FLAG_IF_AVAILABLE)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${GCC_ARCH} -Wall -Wno-comment -Wno-reorder -Wno-unused-but-set-variable -Wno-unused-variable -std=c++03") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${GCC_ARCH} -Wall -Wno-comment -Wno-reorder -Wno-unused-but-set-variable -Wno-unused-variable -Wformat -std=c++03")
find_package(SSE) find_package(SSE)
if (HAVE_AVX2) if (HAVE_AVX2)

@ -11,3 +11,4 @@ set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "my.cdash.org") set(CTEST_DROP_SITE "my.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=srsLTE") set(CTEST_DROP_LOCATION "/submit.php?project=srsLTE")
set(CTEST_DROP_SITE_CDASH TRUE) set(CTEST_DROP_SITE_CDASH TRUE)
set(VALGRIND_COMMAND_OPTIONS "--trace-children=yes --leak-check=full --show-reachable=yes --vex-guest-max-insns=25")

@ -102,7 +102,7 @@ Build Instructions
For example, on Ubuntu 17.04, one can install the required libraries with: For example, on Ubuntu 17.04, one can install the required libraries with:
``` ```
sudo apt-get install cmake libfftw3-dev libmbedtls-dev libboost-program-options-dev libboost-thread-dev libconfig++-dev libsctp-dev sudo apt-get install cmake libfftw3-dev libmbedtls-dev libboost-program-options-dev libconfig++-dev libsctp-dev
``` ```
Note that depending on your flavor and version of Linux, the actual package names may be different. Note that depending on your flavor and version of Linux, the actual package names may be different.

@ -18,7 +18,7 @@
# and at http://www.gnu.org/licenses/. # and at http://www.gnu.org/licenses/.
# #
SET(SRSLTE_VERSION_MAJOR 17) SET(SRSLTE_VERSION_MAJOR 18)
SET(SRSLTE_VERSION_MINOR 12) SET(SRSLTE_VERSION_MINOR 3)
SET(SRSLTE_VERSION_PATCH 0) SET(SRSLTE_VERSION_PATCH 0)
SET(SRSLTE_VERSION_STRING "${SRSLTE_VERSION_MAJOR}.${SRSLTE_VERSION_MINOR}.${SRSLTE_VERSION_PATCH}") SET(SRSLTE_VERSION_STRING "${SRSLTE_VERSION_MAJOR}.${SRSLTE_VERSION_MINOR}.${SRSLTE_VERSION_PATCH}")

@ -122,11 +122,11 @@ public:
} }
// Pure virtual methods for logging // Pure virtual methods for logging
virtual void console(std::string message, ...) = 0; virtual void console(const char * message, ...) __attribute__ ((format (printf, 2, 3))) = 0;
virtual void error(std::string message, ...) = 0; virtual void error(const char * message, ...) __attribute__ ((format (printf, 2, 3))) = 0;
virtual void warning(std::string message, ...) = 0; virtual void warning(const char * message, ...) __attribute__ ((format (printf, 2, 3))) = 0;
virtual void info(std::string message, ...) = 0; virtual void info(const char * message, ...) __attribute__ ((format (printf, 2, 3))) = 0;
virtual void debug(std::string message, ...) = 0; virtual void debug(const char * message, ...) __attribute__ ((format (printf, 2, 3))) = 0;
// Same with hex dump // Same with hex dump
virtual void error_hex(uint8_t *hex, int size, std::string message, ...){error("error_hex not implemented.\n");} virtual void error_hex(uint8_t *hex, int size, std::string message, ...){error("error_hex not implemented.\n");}

@ -57,11 +57,11 @@ public:
void init(std::string layer, logger *logger_, bool tti=false); void init(std::string layer, logger *logger_, bool tti=false);
void console(std::string message, ...); void console(const char * message, ...);
void error(std::string message, ...); void error(const char * message, ...);
void warning(std::string message, ...); void warning(const char * message, ...);
void info(std::string message, ...); void info(const char * message, ...);
void debug(std::string message, ...); void debug(const char * message, ...);
void error_hex(uint8_t *hex, int size, std::string message, ...); void error_hex(uint8_t *hex, int size, std::string message, ...);
void warning_hex(uint8_t *hex, int size, std::string message, ...); void warning_hex(uint8_t *hex, int size, std::string message, ...);

@ -135,55 +135,55 @@ void log_filter::all_log(srslte::LOG_LEVEL_ENUM level,
} }
} }
void log_filter::console(std::string message, ...) { void log_filter::console(const char * message, ...) {
char *args_msg; char *args_msg;
va_list args; va_list args;
va_start(args, message); va_start(args, message);
if(vasprintf(&args_msg, message.c_str(), args) > 0) if(vasprintf(&args_msg, message, args) > 0)
printf("%s",args_msg); // Print directly to stdout printf("%s",args_msg); // Print directly to stdout
va_end(args); va_end(args);
free(args_msg); free(args_msg);
} }
void log_filter::error(std::string message, ...) { void log_filter::error(const char * message, ...) {
if (level >= LOG_LEVEL_ERROR) { if (level >= LOG_LEVEL_ERROR) {
char *args_msg; char *args_msg;
va_list args; va_list args;
va_start(args, message); va_start(args, message);
if(vasprintf(&args_msg, message.c_str(), args) > 0) if(vasprintf(&args_msg, message, args) > 0)
all_log(LOG_LEVEL_ERROR, tti, args_msg); all_log(LOG_LEVEL_ERROR, tti, args_msg);
va_end(args); va_end(args);
free(args_msg); free(args_msg);
} }
} }
void log_filter::warning(std::string message, ...) { void log_filter::warning(const char * message, ...) {
if (level >= LOG_LEVEL_WARNING) { if (level >= LOG_LEVEL_WARNING) {
char *args_msg; char *args_msg;
va_list args; va_list args;
va_start(args, message); va_start(args, message);
if(vasprintf(&args_msg, message.c_str(), args) > 0) if(vasprintf(&args_msg, message, args) > 0)
all_log(LOG_LEVEL_WARNING, tti, args_msg); all_log(LOG_LEVEL_WARNING, tti, args_msg);
va_end(args); va_end(args);
free(args_msg); free(args_msg);
} }
} }
void log_filter::info(std::string message, ...) { void log_filter::info(const char * message, ...) {
if (level >= LOG_LEVEL_INFO) { if (level >= LOG_LEVEL_INFO) {
char *args_msg; char *args_msg;
va_list args; va_list args;
va_start(args, message); va_start(args, message);
if(vasprintf(&args_msg, message.c_str(), args) > 0) if(vasprintf(&args_msg, message, args) > 0)
all_log(LOG_LEVEL_INFO, tti, args_msg); all_log(LOG_LEVEL_INFO, tti, args_msg);
va_end(args); va_end(args);
free(args_msg); free(args_msg);
} }
} }
void log_filter::debug(std::string message, ...) { void log_filter::debug(const char * message, ...) {
if (level >= LOG_LEVEL_DEBUG) { if (level >= LOG_LEVEL_DEBUG) {
char *args_msg; char *args_msg;
va_list args; va_list args;
va_start(args, message); va_start(args, message);
if(vasprintf(&args_msg, message.c_str(), args) > 0) if(vasprintf(&args_msg, message, args) > 0)
all_log(LOG_LEVEL_DEBUG, tti, args_msg); all_log(LOG_LEVEL_DEBUG, tti, args_msg);
va_end(args); va_end(args);
free(args_msg); free(args_msg);

@ -124,7 +124,6 @@ uint8_t* sch_pdu::write_packet(srslte::log *log_h)
if (nof_subheaders <= 0 && nof_subheaders < (int)max_subheaders) { if (nof_subheaders <= 0 && nof_subheaders < (int)max_subheaders) {
log_h->error("Trying to write packet with invalid number of subheaders (nof_subheaders=%d).\n", nof_subheaders); log_h->error("Trying to write packet with invalid number of subheaders (nof_subheaders=%d).\n", nof_subheaders);
log_h->console("Trying to write packet with invalid number of subheaders (nof_subheaders=%d).\n", nof_subheaders);
return NULL; return NULL;
} }

@ -35,6 +35,8 @@
#include "srslte/phy/rf/rf.h" #include "srslte/phy/rf/rf.h"
#include "uhd_c_api.h" #include "uhd_c_api.h"
#define HAVE_ASYNC_THREAD 0
typedef struct { typedef struct {
char *devname; char *devname;
uhd_usrp_handle usrp; uhd_usrp_handle usrp;
@ -87,6 +89,7 @@ static void log_late(rf_uhd_handler_t *h, bool is_rx) {
} }
} }
#if HAVE_ASYNC_THREAD
static void log_underflow(rf_uhd_handler_t *h) { static void log_underflow(rf_uhd_handler_t *h) {
if (h->uhd_error_handler) { if (h->uhd_error_handler) {
srslte_rf_error_t error; srslte_rf_error_t error;
@ -95,6 +98,7 @@ static void log_underflow(rf_uhd_handler_t *h) {
h->uhd_error_handler(error); h->uhd_error_handler(error);
} }
} }
#endif
static void log_rx_error(rf_uhd_handler_t *h) { static void log_rx_error(rf_uhd_handler_t *h) {
if (h->uhd_error_handler) { if (h->uhd_error_handler) {
@ -109,6 +113,7 @@ static void log_rx_error(rf_uhd_handler_t *h) {
} }
} }
#if HAVE_ASYNC_THREAD
static void* async_thread(void *h) { static void* async_thread(void *h) {
rf_uhd_handler_t *handler = (rf_uhd_handler_t*) h; rf_uhd_handler_t *handler = (rf_uhd_handler_t*) h;
uhd_async_metadata_handle md; uhd_async_metadata_handle md;
@ -135,6 +140,7 @@ static void* async_thread(void *h) {
uhd_async_metadata_free(&md); uhd_async_metadata_free(&md);
return NULL; return NULL;
} }
#endif
void rf_uhd_suppress_stdout(void *h) { void rf_uhd_suppress_stdout(void *h) {
rf_uhd_register_msg_handler_c(suppress_handler); rf_uhd_register_msg_handler_c(suppress_handler);
@ -570,13 +576,14 @@ int rf_uhd_open_multi(char *args, void **h, uint32_t nof_channels)
rf_uhd_set_rx_gain(handler, max_gain*0.7); rf_uhd_set_rx_gain(handler, max_gain*0.7);
uhd_meta_range_free(&gain_range); uhd_meta_range_free(&gain_range);
#if HAVE_ASYNC_THREAD
// Start low priority thread to receive async commands // Start low priority thread to receive async commands
/*
handler->async_thread_running = true; handler->async_thread_running = true;
if (pthread_create(&handler->async_thread, NULL, async_thread, handler)) { if (pthread_create(&handler->async_thread, NULL, async_thread, handler)) {
perror("pthread_create"); perror("pthread_create");
return -1; return -1;
}*/ }
#endif
/* Restore priorities */ /* Restore priorities */
uhd_set_thread_priority(0, false); uhd_set_thread_priority(0, false);

@ -342,7 +342,7 @@ int rlc_am::read_pdu(uint8_t *payload, uint32_t nof_bytes)
pthread_mutex_lock(&mutex); pthread_mutex_lock(&mutex);
log->debug("MAC opportunity - %d bytes\n", nof_bytes); log->debug("MAC opportunity - %d bytes\n", nof_bytes);
log->debug("tx_window size - %d PDUs\n", tx_window.size()); log->debug("tx_window size - %zu PDUs\n", tx_window.size());
// Tx STATUS if requested // Tx STATUS if requested
if(do_status && !status_prohibited()) { if(do_status && !status_prohibited()) {
@ -698,7 +698,7 @@ int rlc_am::build_segment(uint8_t *payload, uint32_t nof_bytes, rlc_amd_retx_t r
if(pdu_len > (int)nof_bytes) { if(pdu_len > (int)nof_bytes) {
log->error("%s Retx PDU segment length error. Available: %d, Used: %d\n", log->error("%s Retx PDU segment length error. Available: %d, Used: %d\n",
rrc->get_rb_name(lcid).c_str(), nof_bytes, pdu_len); rrc->get_rb_name(lcid).c_str(), nof_bytes, pdu_len);
log->debug("%s Retx PDU segment length error. Header len: %d, Payload len: %d, N_li: %d\n", log->debug("%s Retx PDU segment length error. Header len: %ld, Payload len: %d, N_li: %d\n",
rrc->get_rb_name(lcid).c_str(), (ptr-payload), len, new_header.N_li); rrc->get_rb_name(lcid).c_str(), (ptr-payload), len, new_header.N_li);
} }
return pdu_len; return pdu_len;

@ -25,7 +25,6 @@
*/ */
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/thread/mutex.hpp>
#include <enb.h> #include <enb.h>
#include "enb.h" #include "enb.h"
@ -298,7 +297,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); rf_log.info(str.c_str());
} }
} }

@ -227,7 +227,7 @@ void phch_worker::set_conf_dedicated_ack(uint16_t rnti, bool ack){
if (ue_db.count(rnti)) { if (ue_db.count(rnti)) {
ue_db[rnti].dedicated_ack = ack; ue_db[rnti].dedicated_ack = ack;
} else { } else {
Error("Setting dedicated ack: rnti=0x%x does not exist\n"); Error("Setting dedicated ack: rnti=0x%x does not exist\n", rnti);
} }
pthread_mutex_unlock(&mutex); pthread_mutex_unlock(&mutex);
} }
@ -309,7 +309,7 @@ void phch_worker::set_config_dedicated(uint16_t rnti,
ue_db[rnti].dedicated.pdsch_cnfg_ded = dedicated->pdsch_cnfg_ded; ue_db[rnti].dedicated.pdsch_cnfg_ded = dedicated->pdsch_cnfg_ded;
} }
} else { } else {
Error("Setting config dedicated: rnti=0x%x does not exist\n"); Error("Setting config dedicated: rnti=0x%x does not exist\n", rnti);
} }
pthread_mutex_unlock(&mutex); pthread_mutex_unlock(&mutex);
} }

@ -125,7 +125,7 @@ void txrx::run_thread()
srslte_timestamp_copy(&tx_time, &rx_time); srslte_timestamp_copy(&tx_time, &rx_time);
srslte_timestamp_add(&tx_time, 0, HARQ_DELAY_MS*1e-3); srslte_timestamp_add(&tx_time, 0, HARQ_DELAY_MS*1e-3);
Debug("Settting TTI=%d, tx_mutex=%d, tx_time=%d:%f to worker %d\n", Debug("Settting TTI=%d, tx_mutex=%d, tx_time=%ld:%f to worker %d\n",
tti, tx_mutex_cnt, tti, tx_mutex_cnt,
tx_time.full_secs, tx_time.frac_secs, tx_time.full_secs, tx_time.frac_secs,
worker->get_id()); worker->get_id());

@ -225,7 +225,7 @@ void rrc::add_user(uint16_t rnti)
pdcp->add_user(rnti); pdcp->add_user(rnti);
rrc_log->info("Added new user rnti=0x%x\n", rnti); rrc_log->info("Added new user rnti=0x%x\n", rnti);
} else { } else {
rrc_log->error("Adding user rnti=0x%x (already exists)\n"); rrc_log->error("Adding user rnti=0x%x (already exists)\n", rnti);
} }
pthread_mutex_unlock(&user_mutex); pthread_mutex_unlock(&user_mutex);
} }
@ -584,7 +584,7 @@ void rrc::parse_ul_ccch(uint16_t rnti, byte_buffer_t *pdu)
if (users[rnti].is_idle()) { if (users[rnti].is_idle()) {
old_rnti = ul_ccch_msg.msg.rrc_con_reest_req.ue_id.c_rnti; old_rnti = ul_ccch_msg.msg.rrc_con_reest_req.ue_id.c_rnti;
if (users.count(old_rnti)) { if (users.count(old_rnti)) {
rrc_log->error("Not supported: ConnectionReestablishment. Sending Connection Reject\n", old_rnti); rrc_log->error("Not supported: ConnectionReestablishment for rnti=0x%x. Sending Connection Reject\n", old_rnti);
users[rnti].send_connection_reest_rej(); users[rnti].send_connection_reest_rej();
rem_user_thread(old_rnti); rem_user_thread(old_rnti);
} else { } else {
@ -649,7 +649,7 @@ void rrc::run_thread()
pthread_mutex_lock(&user_mutex); pthread_mutex_lock(&user_mutex);
break; break;
default: default:
rrc_log->error("Rx PDU with invalid bearer id: %s", p.lcid); rrc_log->error("Rx PDU with invalid bearer id: %d", p.lcid);
break; break;
} }
} else { } else {
@ -799,7 +799,7 @@ bool rrc::ue::is_timeout()
int64_t deadline = deadline_s*1e6 + deadline_us; int64_t deadline = deadline_s*1e6 + deadline_us;
int64_t elapsed = t[0].tv_sec*1e6 + t[0].tv_usec; int64_t elapsed = t[0].tv_sec*1e6 + t[0].tv_usec;
if (elapsed > deadline && elapsed > 0) { if (elapsed > deadline && elapsed > 0) {
parent->rrc_log->warning("User rnti=0x%x expired %s deadline: %d:%d>%d:%d us\n", parent->rrc_log->warning("User rnti=0x%x expired %s deadline: %ld:%ld>%d:%d us\n",
rnti, deadline_str, rnti, deadline_str,
t[0].tv_sec, t[0].tv_usec, t[0].tv_sec, t[0].tv_usec,
deadline_s, deadline_us); deadline_s, deadline_us);
@ -1069,6 +1069,9 @@ void rrc::ue::notify_s1ap_ue_ctxt_setup_complete()
{ {
LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT res; LIBLTE_S1AP_MESSAGE_INITIALCONTEXTSETUPRESPONSE_STRUCT res;
res.ext = false; res.ext = false;
res.E_RABFailedToSetupListCtxtSURes_present = false;
res.CriticalityDiagnostics_present = false;
res.E_RABSetupListCtxtSURes.len = 0; res.E_RABSetupListCtxtSURes.len = 0;
res.E_RABFailedToSetupListCtxtSURes.len = 0; res.E_RABFailedToSetupListCtxtSURes.len = 0;

@ -29,7 +29,6 @@
#include "srslte/common/log.h" #include "srslte/common/log.h"
#include "srslte/common/log_filter.h" #include "srslte/common/log_filter.h"
#include "srslte/common/buffer_pool.h" #include "srslte/common/buffer_pool.h"
#include <boost/thread/mutex.hpp>
#include "srslte/asn1/gtpc.h" #include "srslte/asn1/gtpc.h"
#include "mme/s1ap_common.h" #include "mme/s1ap_common.h"
namespace srsepc namespace srsepc

@ -81,6 +81,13 @@ public:
bool* reply_flag, bool* reply_flag,
struct sctp_sndrcvinfo *enb_sri); struct sctp_sndrcvinfo *enb_sri);
bool handle_nas_tracking_area_update_request( uint32_t m_tmsi,
uint32_t enb_ue_s1ap_id,
srslte::byte_buffer_t *nas_msg,
srslte::byte_buffer_t *reply_buffer,
bool* reply_flag,
struct sctp_sndrcvinfo *enb_sri);
bool handle_nas_authentication_response(srslte::byte_buffer_t *nas_msg, ue_ctx_t *ue_ctx, srslte::byte_buffer_t *reply_buffer, bool* reply_flag); bool handle_nas_authentication_response(srslte::byte_buffer_t *nas_msg, ue_ctx_t *ue_ctx, srslte::byte_buffer_t *reply_buffer, bool* reply_flag);
bool handle_nas_security_mode_complete(srslte::byte_buffer_t *nas_msg, ue_ctx_t *ue_ctx, srslte::byte_buffer_t *reply_buffer, bool *reply_flag); bool handle_nas_security_mode_complete(srslte::byte_buffer_t *nas_msg, ue_ctx_t *ue_ctx, srslte::byte_buffer_t *reply_buffer, bool *reply_flag);
bool handle_nas_attach_complete(srslte::byte_buffer_t *nas_msg, ue_ctx_t *ue_ctx, srslte::byte_buffer_t *reply_buffer, bool *reply_flag); bool handle_nas_attach_complete(srslte::byte_buffer_t *nas_msg, ue_ctx_t *ue_ctx, srslte::byte_buffer_t *reply_buffer, bool *reply_flag);

@ -28,7 +28,6 @@
#include <string> #include <string>
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include <boost/thread/mutex.hpp>
#include "hss/hss.h" #include "hss/hss.h"
#include "srslte/common/security.h" #include "srslte/common/security.h"

@ -78,7 +78,7 @@ s1ap::init(s1ap_args_t s1ap_args, srslte::log_filter *s1ap_log, hss_interface_s1
m_s1ap_args = s1ap_args; m_s1ap_args = s1ap_args;
srslte::s1ap_mccmnc_to_plmn(s1ap_args.mcc, s1ap_args.mnc, &m_plmn); srslte::s1ap_mccmnc_to_plmn(s1ap_args.mcc, s1ap_args.mnc, &m_plmn);
m_next_m_tmsi = 0xF000; m_next_m_tmsi = rand();
//Init log //Init log
m_s1ap_log = s1ap_log; m_s1ap_log = s1ap_log;
@ -542,8 +542,9 @@ s1ap::activate_eps_bearer(uint64_t imsi, uint8_t ebi)
uint32_t uint32_t
s1ap::allocate_m_tmsi(uint64_t imsi) s1ap::allocate_m_tmsi(uint64_t imsi)
{ {
// uint32_t m_tmsi = m_next_m_tmsi++;
uint32_t m_tmsi = m_next_m_tmsi; uint32_t m_tmsi = m_next_m_tmsi;
m_next_m_tmsi = (m_next_m_tmsi + 1) % UINT32_MAX;
m_tmsi_to_imsi.insert(std::pair<uint32_t,uint64_t>(m_tmsi,imsi)); m_tmsi_to_imsi.insert(std::pair<uint32_t,uint64_t>(m_tmsi,imsi));
m_s1ap_log->debug("Allocated M-TMSI 0x%x to IMSI %015lu,\n",m_tmsi,imsi); m_s1ap_log->debug("Allocated M-TMSI 0x%x to IMSI %015lu,\n",m_tmsi,imsi);
return m_tmsi; return m_tmsi;

@ -25,6 +25,8 @@
*/ */
#include <iostream> #include <iostream>
#include <cmath>
#include <inttypes.h> // for printing uint64_t
#include "mme/s1ap.h" #include "mme/s1ap.h"
#include "mme/s1ap_nas_transport.h" #include "mme/s1ap_nas_transport.h"
#include "srslte/common/security.h" #include "srslte/common/security.h"
@ -128,8 +130,8 @@ s1ap_nas_transport::handle_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSA
m_s1ap_log->info("Received Initial UE message -- Detach Request\n"); m_s1ap_log->info("Received Initial UE message -- Detach Request\n");
if(!init_ue->S_TMSI_present) if(!init_ue->S_TMSI_present)
{ {
m_s1ap_log->error("Service request -- S-TMSI not present\n"); m_s1ap_log->error("Detach request -- S-TMSI not present\n");
m_s1ap_log->console("Service request -- S-TMSI not present\n" ); m_s1ap_log->console("Detach request -- S-TMSI not present\n" );
return false; return false;
} }
uint32_t *m_tmsi = (uint32_t*) &init_ue->S_TMSI.m_TMSI.buffer; uint32_t *m_tmsi = (uint32_t*) &init_ue->S_TMSI.m_TMSI.buffer;
@ -142,6 +144,26 @@ s1ap_nas_transport::handle_initial_ue_message(LIBLTE_S1AP_MESSAGE_INITIALUEMESSA
handle_nas_detach_request(ntohl(*m_tmsi), enb_ue_s1ap_id, nas_msg, reply_buffer,reply_flag, enb_sri); handle_nas_detach_request(ntohl(*m_tmsi), enb_ue_s1ap_id, nas_msg, reply_buffer,reply_flag, enb_sri);
return true; return true;
} }
else if(msg_type == LIBLTE_MME_MSG_TYPE_TRACKING_AREA_UPDATE_REQUEST)
{
m_s1ap_log->console("Received Initial UE message -- Tracking Area Update Request\n");
m_s1ap_log->info("Received Initial UE message -- Tracking Area Update Request\n");
if(!init_ue->S_TMSI_present)
{
m_s1ap_log->error("Tracking Area Update Request -- S-TMSI not present\n");
m_s1ap_log->console("Tracking Area Update Request -- S-TMSI not present\n" );
return false;
}
uint32_t *m_tmsi = (uint32_t*) &init_ue->S_TMSI.m_TMSI.buffer;
uint32_t enb_ue_s1ap_id = init_ue->eNB_UE_S1AP_ID.ENB_UE_S1AP_ID;
m_s1ap_log->info("Tracking Area Update Request -- S-TMSI 0x%x\n", ntohl(*m_tmsi));
m_s1ap_log->console("Tracking Area Update Request -- S-TMSI 0x%x\n", ntohl(*m_tmsi) );
m_s1ap_log->info("Tracking Area Update Request -- eNB UE S1AP Id %d\n", enb_ue_s1ap_id);
m_s1ap_log->console("Tracking Area Update Request -- eNB UE S1AP Id %d\n", enb_ue_s1ap_id);
handle_nas_tracking_area_update_request(ntohl(*m_tmsi), enb_ue_s1ap_id, nas_msg, reply_buffer,reply_flag, enb_sri);
return true;
}
else else
{ {
m_s1ap_log->info("Unhandled Initial UE Message 0x%x\n",msg_type); m_s1ap_log->info("Unhandled Initial UE Message 0x%x\n",msg_type);
@ -164,11 +186,11 @@ s1ap_nas_transport::handle_uplink_nas_transport(LIBLTE_S1AP_MESSAGE_UPLINKNASTRA
ue_ctx_t *ue_ctx = m_s1ap->find_ue_ctx_from_mme_ue_s1ap_id(mme_ue_s1ap_id); ue_ctx_t *ue_ctx = m_s1ap->find_ue_ctx_from_mme_ue_s1ap_id(mme_ue_s1ap_id);
if(ue_ctx == NULL) if(ue_ctx == NULL)
{ {
m_s1ap_log->warning("Received uplink NAS, but could not find UE ECM context. MME-UE S1AP id: %lu\n",mme_ue_s1ap_id); m_s1ap_log->warning("Received uplink NAS, but could not find UE ECM context. MME-UE S1AP id: %d\n",mme_ue_s1ap_id);
return false; return false;
} }
m_s1ap_log->debug("Received uplink NAS and found UE ECM context. MME-UE S1AP id: %lu\n",mme_ue_s1ap_id); m_s1ap_log->debug("Received uplink NAS and found UE ECM context. MME-UE S1AP id: %d\n",mme_ue_s1ap_id);
ue_emm_ctx_t *emm_ctx = &ue_ctx->emm_ctx; ue_emm_ctx_t *emm_ctx = &ue_ctx->emm_ctx;
ue_ecm_ctx_t *ecm_ctx = &ue_ctx->ecm_ctx; ue_ecm_ctx_t *ecm_ctx = &ue_ctx->ecm_ctx;
@ -192,7 +214,7 @@ s1ap_nas_transport::handle_uplink_nas_transport(LIBLTE_S1AP_MESSAGE_UPLINKNASTRA
//This can happen with integrity protected identity reponse messages //This can happen with integrity protected identity reponse messages
if( !(msg_type == LIBLTE_MME_MSG_TYPE_IDENTITY_RESPONSE && sec_hdr_type == LIBLTE_MME_SECURITY_HDR_TYPE_INTEGRITY)) if( !(msg_type == LIBLTE_MME_MSG_TYPE_IDENTITY_RESPONSE && sec_hdr_type == LIBLTE_MME_SECURITY_HDR_TYPE_INTEGRITY))
{ {
m_s1ap_log->warning("Uplink NAS: could not find security context for integrity protected message. MME-UE S1AP id: %lu\n",mme_ue_s1ap_id); m_s1ap_log->warning("Uplink NAS: could not find security context for integrity protected message. MME-UE S1AP id: %d\n",mme_ue_s1ap_id);
m_pool->deallocate(nas_msg); m_pool->deallocate(nas_msg);
return false; return false;
} }
@ -922,6 +944,31 @@ s1ap_nas_transport::handle_nas_detach_request(srslte::byte_buffer_t *nas_msg, ue
return true; return true;
} }
bool
s1ap_nas_transport::handle_nas_tracking_area_update_request(uint32_t m_tmsi,
uint32_t enb_ue_s1ap_id,
srslte::byte_buffer_t *nas_msg,
srslte::byte_buffer_t *reply_buffer,
bool* reply_flag,
struct sctp_sndrcvinfo *enb_sri)
{
m_s1ap_log->console("Warning: Tracking area update requests are not handled yet.\n");
m_s1ap_log->warning("Tracking area update requests are not handled yet.\n");
std::map<uint32_t,uint64_t>::iterator it = m_s1ap->m_tmsi_to_imsi.find(m_tmsi);
if(it == m_s1ap->m_tmsi_to_imsi.end())
{
m_s1ap_log->console("Could not find IMSI from M-TMSI. M-TMSI 0x%x\n", m_tmsi);
m_s1ap_log->error("Could not find IMSI from M-TMSI. M-TMSI 0x%x\n", m_tmsi);
return true;
}
ue_ctx_t *ue_ctx = m_s1ap->find_ue_ctx_from_imsi(it->second);
ue_emm_ctx_t *emm_ctx = &ue_ctx->emm_ctx;
ue_ecm_ctx_t *ecm_ctx = &ue_ctx->ecm_ctx;
emm_ctx->security_ctxt.ul_nas_count++;//Increment the NAS count, not to break the security ctx
return true;
}
bool bool
s1ap_nas_transport::handle_nas_authentication_response(srslte::byte_buffer_t *nas_msg, ue_ctx_t *ue_ctx, srslte::byte_buffer_t *reply_buffer, bool* reply_flag) s1ap_nas_transport::handle_nas_authentication_response(srslte::byte_buffer_t *nas_msg, ue_ctx_t *ue_ctx, srslte::byte_buffer_t *reply_buffer, bool* reply_flag)
{ {
@ -1046,7 +1093,7 @@ s1ap_nas_transport::handle_nas_attach_complete(srslte::byte_buffer_t *nas_msg, u
ue_emm_ctx_t *emm_ctx = &ue_ctx->emm_ctx; ue_emm_ctx_t *emm_ctx = &ue_ctx->emm_ctx;
ue_ecm_ctx_t *ecm_ctx = &ue_ctx->ecm_ctx; ue_ecm_ctx_t *ecm_ctx = &ue_ctx->ecm_ctx;
m_s1ap_log->console("Unpacked Attached Complete Message. IMSI %d\n", emm_ctx->imsi); m_s1ap_log->console("Unpacked Attached Complete Message. IMSI %" PRIu64 "\n", emm_ctx->imsi);
m_s1ap_log->console("Unpacked Activate Default EPS Bearer message. EPS Bearer id %d\n",act_bearer.eps_bearer_id); m_s1ap_log->console("Unpacked Activate Default EPS Bearer message. EPS Bearer id %d\n",act_bearer.eps_bearer_id);
//ue_ctx->erabs_ctx[act_bearer->eps_bearer_id].enb_fteid; //ue_ctx->erabs_ctx[act_bearer->eps_bearer_id].enb_fteid;
if(act_bearer.eps_bearer_id < 5 || act_bearer.eps_bearer_id > 15) if(act_bearer.eps_bearer_id < 5 || act_bearer.eps_bearer_id > 15)
@ -1082,13 +1129,13 @@ s1ap_nas_transport::handle_esm_information_response(srslte::byte_buffer_t *nas_m
m_s1ap_log->info("ESM Info: EPS bearer id %d\n",esm_info_resp.eps_bearer_id); m_s1ap_log->info("ESM Info: EPS bearer id %d\n",esm_info_resp.eps_bearer_id);
if(esm_info_resp.apn_present) if(esm_info_resp.apn_present)
{ {
m_s1ap_log->info("ESM Info: APN %s\n",esm_info_resp.eps_bearer_id); m_s1ap_log->info("ESM Info: APN %d\n",esm_info_resp.eps_bearer_id);
m_s1ap_log->console("ESM Info: APN %s\n",esm_info_resp.eps_bearer_id); m_s1ap_log->console("ESM Info: APN %d\n",esm_info_resp.eps_bearer_id);
} }
if(esm_info_resp.protocol_cnfg_opts_present) if(esm_info_resp.protocol_cnfg_opts_present)
{ {
m_s1ap_log->info("ESM Info: %d Protocol Configuration Options %s\n",esm_info_resp.protocol_cnfg_opts.N_opts); m_s1ap_log->info("ESM Info: %d Protocol Configuration Options\n",esm_info_resp.protocol_cnfg_opts.N_opts);
m_s1ap_log->console("ESM Info: %d Protocol Configuration Options %s\n",esm_info_resp.protocol_cnfg_opts.N_opts); m_s1ap_log->console("ESM Info: %d Protocol Configuration Options\n",esm_info_resp.protocol_cnfg_opts.N_opts);
} }
//FIXME The packging of GTP-C messages is not ready. //FIXME The packging of GTP-C messages is not ready.

@ -26,7 +26,6 @@
#include <iostream> #include <iostream>
#include <algorithm> #include <algorithm>
#include <boost/thread/mutex.hpp>
#include <fcntl.h> #include <fcntl.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <netinet/in.h> #include <netinet/in.h>

@ -91,7 +91,7 @@ void phr_proc::timer_expired(uint32_t timer_id) {
} else if (timer_id == timer_prohibit_id) { } else if (timer_id == timer_prohibit_id) {
int pathloss_db = liblte_rrc_dl_pathloss_change_num[mac_cfg->main.phr_cnfg.dl_pathloss_change]; int pathloss_db = liblte_rrc_dl_pathloss_change_num[mac_cfg->main.phr_cnfg.dl_pathloss_change];
if (pathloss_changed()) { if (pathloss_changed()) {
Info("PHR: Triggered by pathloss difference. cur_pathloss_db=%f (timer expired)\n", last_pathloss_db); Info("PHR: Triggered by pathloss difference. cur_pathloss_db=%d (timer expired)\n", last_pathloss_db);
phr_is_triggered = true; phr_is_triggered = true;
} }
} else { } else {
@ -132,7 +132,7 @@ void phr_proc::step(uint32_t tti)
} }
if (pathloss_changed() && timers_db->get(timer_prohibit_id)->is_expired()) if (pathloss_changed() && timers_db->get(timer_prohibit_id)->is_expired())
{ {
Info("PHR: Triggered by pathloss difference. cur_pathloss_db=%f\n", last_pathloss_db); Info("PHR: Triggered by pathloss difference. cur_pathloss_db=%d\n", last_pathloss_db);
phr_is_triggered = true; phr_is_triggered = true;
} }
} }

@ -484,8 +484,7 @@ int main(int argc, char *argv[])
plot_started = true; plot_started = true;
} }
} }
ue->print_pool(); sleep(1);
sleep(10);
} }
pthread_cancel(input); pthread_cancel(input);
metricshub.stop(); metricshub.stop();

@ -275,7 +275,7 @@ void phch_recv::cell_search_inc()
phy_state = IDLE; phy_state = IDLE;
rrc->earfcn_end(); rrc->earfcn_end();
} else { } else {
Info("SYNC: Cell Search idx %d/%d\n", cur_earfcn_index, earfcn.size()); Info("SYNC: Cell Search idx %d/%zu\n", cur_earfcn_index, earfcn.size());
if (current_earfcn != earfcn[cur_earfcn_index]) { if (current_earfcn != earfcn[cur_earfcn_index]) {
current_earfcn = earfcn[cur_earfcn_index]; current_earfcn = earfcn[cur_earfcn_index];
set_frequency(); set_frequency();
@ -297,7 +297,7 @@ void phch_recv::cell_search_start() {
Warning("SYNC: Can't start cell search procedure while camping on cell\n"); Warning("SYNC: Can't start cell search procedure while camping on cell\n");
} else { } else {
if (earfcn.size() > 0) { if (earfcn.size() > 0) {
Info("SYNC: Starting Cell Search procedure in %d EARFCNs...\n", earfcn.size()); Info("SYNC: Starting Cell Search procedure in %zu EARFCNs...\n", earfcn.size());
cell_search_next(true); cell_search_next(true);
} else { } else {
Info("SYNC: Empty EARFCN list. Stopping cell search...\n"); Info("SYNC: Empty EARFCN list. Stopping cell search...\n");
@ -1198,7 +1198,7 @@ phch_recv::measure::ret_code phch_recv::measure::run_subframe(uint32_t sf_idx)
} }
cnt++; cnt++;
log_h->debug("SYNC: Measuring RSRP %d/%d, sf_idx=%d, RSRP=%.1f dBm, corr-RSRP=%.1f dBm, SNR=%.1f dB\n", log_h->debug("SYNC: Measuring RSRP %d/%d, sf_idx=%d, RSRP=%.1f dBm, SNR=%.1f dB\n",
cnt, nof_subframes, sf_idx, rsrp, snr); cnt, nof_subframes, sf_idx, rsrp, snr);
if (cnt >= nof_subframes) { if (cnt >= nof_subframes) {
@ -1502,7 +1502,7 @@ void phch_recv::intra_measure::rem_cell(int pci) {
if (active_pci.size() == 0) { if (active_pci.size() == 0) {
receive_enabled = false; receive_enabled = false;
} }
Info("INTRA: Stopping intra-frequency measurement for pci=%d. Number of cells: %d\n", pci, active_pci.size()); Info("INTRA: Stopping intra-frequency measurement for pci=%d. Number of cells: %zu\n", pci, active_pci.size());
} else { } else {
Warning("INTRA: Requested to stop non-existing intra-frequency measurement for PCI=%d\n", pci); Warning("INTRA: Requested to stop non-existing intra-frequency measurement for PCI=%d\n", pci);
} }

@ -201,7 +201,7 @@ void prach::send(srslte::radio *radio_handler, float cfo, float pathloss, srslte
float scale = sqrtf(pow(10,tx_power/10)/digital_power); float scale = sqrtf(pow(10,tx_power/10)/digital_power);
srslte_vec_sc_prod_cfc(signal_buffer, scale, signal_buffer, len); srslte_vec_sc_prod_cfc(signal_buffer, scale, signal_buffer, len);
log_h->console("PRACH: Pathloss=%.2f dB, Target power %.2f dBm, TX_power %.2f dBm, TX_gain %.1f dB\n", log_h->console("PRACH: Pathloss=%.2f dB, Target power %.2f dBm, TX_power %.2f dBm, TX_gain %.1f dB, scale %.2f\n",
pathloss, target_power_dbm, tx_power, radio_handler->get_tx_gain(), scale); pathloss, target_power_dbm, tx_power, radio_handler->get_tx_gain(), scale);
} else { } else {

@ -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); rf_log.info(str.c_str());
} }
} }

@ -682,7 +682,7 @@ void nas::parse_identity_request(uint32_t lcid, byte_buffer_t *pdu) {
usim->get_imei_vec(id_resp.mobile_id.imei, 15); usim->get_imei_vec(id_resp.mobile_id.imei, 15);
break; break;
default: default:
nas_log->error("Unhandled ID type: %d\n"); nas_log->error("Unhandled ID type: %d\n", id_req.id_type);
pool->deallocate(pdu); pool->deallocate(pdu);
return; return;
} }

@ -30,6 +30,7 @@
#include <sstream> #include <sstream>
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include <inttypes.h> // for printing uint64_t
#include <srslte/asn1/liblte_rrc.h> #include <srslte/asn1/liblte_rrc.h>
#include "upper/rrc.h" #include "upper/rrc.h"
#include "srslte/asn1/liblte_rrc.h" #include "srslte/asn1/liblte_rrc.h"
@ -528,7 +529,7 @@ void rrc::set_serving_cell(uint32_t cell_idx) {
// Set new serving cell // Set new serving cell
serving_cell = new_serving_cell; serving_cell = new_serving_cell;
rrc_log->info("Setting serving cell idx=%d, earfcn=%d, PCI=%d, nof_neighbours=%d\n", rrc_log->info("Setting serving cell idx=%d, earfcn=%d, PCI=%d, nof_neighbours=%zd\n",
cell_idx, serving_cell->get_earfcn(), serving_cell->phy_cell.id, neighbour_cells.size()); cell_idx, serving_cell->get_earfcn(), serving_cell->phy_cell.id, neighbour_cells.size());
} else { } else {
@ -751,7 +752,7 @@ bool rrc::add_neighbour_cell(cell_t *new_cell) {
if (ret) { if (ret) {
neighbour_cells.push_back(new_cell); neighbour_cells.push_back(new_cell);
} }
rrc_log->info("Added neighbour cell EARFCN=%d, PCI=%d, nof_neighbours=%d\n", rrc_log->info("Added neighbour cell EARFCN=%d, PCI=%d, nof_neighbours=%zd\n",
new_cell->get_earfcn(), new_cell->get_pci(), neighbour_cells.size()); new_cell->get_earfcn(), new_cell->get_pci(), neighbour_cells.size());
sort_neighbour_cells(); sort_neighbour_cells();
return ret; return ret;
@ -1634,7 +1635,7 @@ void rrc::send_ul_ccch_msg()
ue_cri_ptr[nbytes - i - 1] = pdu->msg[i]; ue_cri_ptr[nbytes - i - 1] = pdu->msg[i];
} }
rrc_log->debug("Setting UE contention resolution ID: %d\n", uecri); rrc_log->debug("Setting UE contention resolution ID: %" PRIu64 "\n", uecri);
mac->set_contention_id(uecri); mac->set_contention_id(uecri);
rrc_log->info("Sending %s\n", liblte_rrc_ul_ccch_msg_type_text[ul_ccch_msg.msg_type]); rrc_log->info("Sending %s\n", liblte_rrc_ul_ccch_msg_type_text[ul_ccch_msg.msg_type]);
@ -1680,7 +1681,7 @@ void rrc::write_pdu(uint32_t lcid, byte_buffer_t *pdu) {
parse_dl_dcch(lcid, pdu); parse_dl_dcch(lcid, pdu);
break; break;
default: default:
rrc_log->error("RX PDU with invalid bearer id: %s", lcid); rrc_log->error("RX PDU with invalid bearer id: %d", lcid);
break; break;
} }
} }
@ -2891,8 +2892,8 @@ void rrc::rrc_meas::parse_meas_config(LIBLTE_RRC_MEAS_CONFIG_STRUCT *cfg)
log_h->info("MEAS: Added measObjectId=%d, earfcn=%d, q_offset=%f, pci=%d, offset_cell=%f\n", log_h->info("MEAS: Added measObjectId=%d, earfcn=%d, q_offset=%f, pci=%d, offset_cell=%f\n",
cfg->meas_obj_to_add_mod_list.meas_obj_list[i].meas_obj_id, dst_obj->earfcn, dst_obj->q_offset, cfg->meas_obj_to_add_mod_list.meas_obj_list[i].meas_obj_id, dst_obj->earfcn, dst_obj->q_offset,
dst_obj->cells[src_obj->cells_to_add_mod_list[j].cell_idx].q_offset, dst_obj->cells[src_obj->cells_to_add_mod_list[j].cell_idx].pci,
dst_obj->cells[src_obj->cells_to_add_mod_list[j].cell_idx].pci); dst_obj->cells[src_obj->cells_to_add_mod_list[j].cell_idx].q_offset);
} }
@ -2973,7 +2974,7 @@ void rrc::rrc_meas::parse_meas_config(LIBLTE_RRC_MEAS_CONFIG_STRUCT *cfg)
remove_meas_id(cfg->meas_id_to_remove_list[i]); remove_meas_id(cfg->meas_id_to_remove_list[i]);
} }
log_h->info("nof active measId=%d\n", active.size()); log_h->info("nof active measId=%zd\n", active.size());
// Measurement identity addition/modification 5.5.2.3 // Measurement identity addition/modification 5.5.2.3
if (cfg->meas_id_to_add_mod_list_present) { if (cfg->meas_id_to_add_mod_list_present) {
@ -2992,7 +2993,7 @@ void rrc::rrc_meas::parse_meas_config(LIBLTE_RRC_MEAS_CONFIG_STRUCT *cfg)
} }
active[measId->meas_id].object_id = measId->meas_obj_id; active[measId->meas_id].object_id = measId->meas_obj_id;
active[measId->meas_id].report_id = measId->rep_cnfg_id; active[measId->meas_id].report_id = measId->rep_cnfg_id;
log_h->info("MEAS: %s measId=%d, measObjectId=%d, reportConfigId=%d, timer_id=%d, nof_values=%d\n", log_h->info("MEAS: %s measId=%d, measObjectId=%d, reportConfigId=%d, timer_id=%d, nof_values=%zd\n",
is_new?"Added":"Updated", measId->meas_id, measId->meas_obj_id, measId->rep_cnfg_id, is_new?"Added":"Updated", measId->meas_id, measId->meas_obj_id, measId->rep_cnfg_id,
active[measId->meas_id].periodic_timer, active[measId->meas_id].cell_values.size()); active[measId->meas_id].periodic_timer, active[measId->meas_id].cell_values.size());
} }

@ -49,8 +49,8 @@ void usim::init(usim_args_t *args, srslte::log *usim_log_)
if(32 == args->op.length()) { if(32 == args->op.length()) {
str_to_hex(args->op, op); str_to_hex(args->op, op);
} else { } else {
usim_log->error("Invalid length for OP: %d should be %d", args->op.length(), 32); usim_log->error("Invalid length for OP: %zu should be %d", args->op.length(), 32);
usim_log->console("Invalid length for OP: %d should be %d", args->op.length(), 32); usim_log->console("Invalid length for OP: %zu should be %d", args->op.length(), 32);
} }
if(15 == args->imsi.length()) { if(15 == args->imsi.length()) {
@ -61,8 +61,8 @@ void usim::init(usim_args_t *args, srslte::log *usim_log_)
imsi += imsi_c[i] - '0'; imsi += imsi_c[i] - '0';
} }
} else { } else {
usim_log->error("Invalid length for ISMI: %d should be %d", args->imsi.length(), 15); usim_log->error("Invalid length for ISMI: %zu should be %d", args->imsi.length(), 15);
usim_log->console("Invalid length for IMSI: %d should be %d", args->imsi.length(), 15); usim_log->console("Invalid length for IMSI: %zu should be %d", args->imsi.length(), 15);
} }
if(15 == args->imei.length()) { if(15 == args->imei.length()) {
@ -73,15 +73,15 @@ void usim::init(usim_args_t *args, srslte::log *usim_log_)
imei += imei_c[i] - '0'; imei += imei_c[i] - '0';
} }
} else { } else {
usim_log->error("Invalid length for IMEI: %d should be %d", args->imei.length(), 15); usim_log->error("Invalid length for IMEI: %zu should be %d", args->imei.length(), 15);
usim_log->console("Invalid length for IMEI: %d should be %d", args->imei.length(), 15); usim_log->console("Invalid length for IMEI: %zu should be %d", args->imei.length(), 15);
} }
if(32 == args->k.length()) { if(32 == args->k.length()) {
str_to_hex(args->k, k); str_to_hex(args->k, k);
} else { } else {
usim_log->error("Invalid length for K: %d should be %d", args->k.length(), 32); usim_log->error("Invalid length for K: %zu should be %d", args->k.length(), 32);
usim_log->console("Invalid length for K: %d should be %d", args->k.length(), 32); usim_log->console("Invalid length for K: %zu should be %d", args->k.length(), 32);
} }
auth_algo = auth_algo_milenage; auth_algo = auth_algo_milenage;

Loading…
Cancel
Save