From 38411a84175e905def84402f68ed9409e1e67ad6 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Tue, 25 Feb 2020 14:27:37 +0000 Subject: [PATCH] Clang-formated the EPC in preperation for PR. --- srsepc/hdr/hss/hss.h | 9 +++++---- srsepc/src/hss/hss.cc | 32 ++++++++++++++++++-------------- srsepc/src/mme/nas.cc | 6 +++--- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/srsepc/hdr/hss/hss.h b/srsepc/hdr/hss/hss.h index e04878d9e..73b1e4806 100644 --- a/srsepc/hdr/hss/hss.h +++ b/srsepc/hdr/hss/hss.h @@ -98,7 +98,8 @@ private: void gen_rand(uint8_t rand_[16]); bool get_k_amf_opc_sqn(uint64_t imsi, uint8_t* k, uint8_t* amf, uint8_t* opc, uint8_t* sqn); - void gen_auth_info_answer_milenage(hss_ue_ctx_t* ue_ctx, uint8_t* k_asme, uint8_t* autn, uint8_t* rand, uint8_t* xres); + void + gen_auth_info_answer_milenage(hss_ue_ctx_t* ue_ctx, uint8_t* k_asme, uint8_t* autn, uint8_t* rand, uint8_t* xres); void gen_auth_info_answer_xor(hss_ue_ctx_t* ue_ctx, uint8_t* k_asme, uint8_t* autn, uint8_t* rand, uint8_t* xres); void resync_sqn_milenage(hss_ue_ctx_t* ue_ctx, uint8_t* auts); @@ -111,9 +112,9 @@ private: void increment_seq_after_resync(hss_ue_ctx_t* ue_ctx); void increment_sqn(uint8_t* sqn, uint8_t* next_sqn); - bool set_auth_algo(std::string auth_algo); - bool read_db_file(std::string db_file); - bool write_db_file(std::string db_file); + bool set_auth_algo(std::string auth_algo); + bool read_db_file(std::string db_file); + bool write_db_file(std::string db_file); hss_ue_ctx_t* get_ue_ctx(uint64_t imsi); std::string hex_string(uint8_t* hex, int size); diff --git a/srsepc/src/hss/hss.cc b/srsepc/src/hss/hss.cc index ad4535143..bd6c281bc 100644 --- a/srsepc/src/hss/hss.cc +++ b/srsepc/src/hss/hss.cc @@ -277,13 +277,17 @@ bool hss::gen_auth_info_answer(uint64_t imsi, uint8_t* k_asme, uint8_t* autn, ui return true; } -void hss::gen_auth_info_answer_milenage(hss_ue_ctx_t* ue_ctx, uint8_t* k_asme, uint8_t* autn, uint8_t* rand, uint8_t* xres) +void hss::gen_auth_info_answer_milenage(hss_ue_ctx_t* ue_ctx, + uint8_t* k_asme, + uint8_t* autn, + uint8_t* rand, + uint8_t* xres) { // Get K, AMF, OPC and SQN - uint8_t *k = ue_ctx->key; - uint8_t *amf = ue_ctx->amf; - uint8_t *opc = ue_ctx->opc; - uint8_t *sqn = ue_ctx->sqn; + uint8_t* k = ue_ctx->key; + uint8_t* amf = ue_ctx->amf; + uint8_t* opc = ue_ctx->opc; + uint8_t* sqn = ue_ctx->sqn; // Temp variables uint8_t xdout[16]; @@ -335,10 +339,10 @@ void hss::gen_auth_info_answer_milenage(hss_ue_ctx_t* ue_ctx, uint8_t* k_asme, u void hss::gen_auth_info_answer_xor(hss_ue_ctx_t* ue_ctx, uint8_t* k_asme, uint8_t* autn, uint8_t* rand, uint8_t* xres) { // Get K, AMF, OPC and SQN - uint8_t *k = ue_ctx->key; - uint8_t *amf = ue_ctx->amf; - uint8_t *opc = ue_ctx->opc; - uint8_t *sqn = ue_ctx->sqn; + uint8_t* k = ue_ctx->key; + uint8_t* amf = ue_ctx->amf; + uint8_t* opc = ue_ctx->opc; + uint8_t* sqn = ue_ctx->sqn; // Temp variables uint8_t xdout[16]; @@ -491,11 +495,11 @@ void hss::resync_sqn_xor(hss_ue_ctx_t* ue_ctx, uint8_t* auts) void hss::resync_sqn_milenage(hss_ue_ctx_t* ue_ctx, uint8_t* auts) { // Get K, AMF, OPC and SQN - uint8_t *k = ue_ctx->key; - uint8_t *amf = ue_ctx->amf; - uint8_t *opc = ue_ctx->opc; - uint8_t *sqn = ue_ctx->sqn; - + uint8_t* k = ue_ctx->key; + uint8_t* amf = ue_ctx->amf; + uint8_t* opc = ue_ctx->opc; + uint8_t* sqn = ue_ctx->sqn; + // Temp variables uint8_t last_rand[16]; uint8_t ak[6]; diff --git a/srsepc/src/mme/nas.cc b/srsepc/src/mme/nas.cc index fed81c0ee..f62827868 100644 --- a/srsepc/src/mme/nas.cc +++ b/srsepc/src/mme/nas.cc @@ -798,7 +798,7 @@ bool nas::handle_tracking_area_update_request(uint32_t m_tmsi, nas_tmp.m_ecm_ctx.enb_ue_s1ap_id = enb_ue_s1ap_id; nas_tmp.m_ecm_ctx.mme_ue_s1ap_id = s1ap->get_next_mme_ue_s1ap_id(); - srslte::byte_buffer_t* nas_tx = pool->allocate(); + srslte::byte_buffer_t* nas_tx = pool->allocate(); nas_tmp.pack_tracking_area_update_reject(nas_tx, LIBLTE_MME_EMM_CAUSE_IMPLICITLY_DETACHED); s1ap->send_downlink_nas_transport(enb_ue_s1ap_id, nas_tmp.m_ecm_ctx.mme_ue_s1ap_id, nas_tx, *enb_sri); pool->deallocate(nas_tx); @@ -1584,8 +1584,8 @@ bool nas::pack_tracking_area_update_reject(srslte::byte_buffer_t* nas_buffer, ui m_nas_log->error("Tracking Area Update Reject EMM Cause set to \"CONGESTION\", but back-off timer not set.\n"); } - LIBLTE_ERROR_ENUM err = liblte_mme_pack_tracking_area_update_reject_msg(&tau_rej, LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS, 0, - (LIBLTE_BYTE_MSG_STRUCT*)nas_buffer); + LIBLTE_ERROR_ENUM err = liblte_mme_pack_tracking_area_update_reject_msg( + &tau_rej, LIBLTE_MME_SECURITY_HDR_TYPE_PLAIN_NAS, 0, (LIBLTE_BYTE_MSG_STRUCT*)nas_buffer); if (err != LIBLTE_SUCCESS) { m_nas_log->error("Error packing Tracking Area Update Reject\n"); m_nas_log->console("Error packing Tracking Area Update Reject\n");