From 1ec5a4d4ed52deb2f54224b622fbd434afc915ed Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 24 May 2019 14:33:34 +0200 Subject: [PATCH] add NAS metrics struct and move NAS states into common header --- srsue/hdr/stack/upper/nas.h | 39 ++++---------------- srsue/hdr/stack/upper/nas_common.h | 55 +++++++++++++++++++++++++++++ srsue/hdr/stack/upper/nas_metrics.h | 36 +++++++++++++++++++ 3 files changed, 97 insertions(+), 33 deletions(-) create mode 100644 srsue/hdr/stack/upper/nas_common.h create mode 100644 srsue/hdr/stack/upper/nas_metrics.h diff --git a/srsue/hdr/stack/upper/nas.h b/srsue/hdr/stack/upper/nas.h index cf80bd49f..386e89a19 100644 --- a/srsue/hdr/stack/upper/nas.h +++ b/srsue/hdr/stack/upper/nas.h @@ -22,47 +22,20 @@ #ifndef SRSUE_NAS_H #define SRSUE_NAS_H +#include "srslte/asn1/liblte_mme.h" #include "srslte/common/buffer_pool.h" -#include "srslte/common/log.h" #include "srslte/common/common.h" -#include "srslte/interfaces/ue_interfaces.h" -#include "srslte/common/security.h" -#include "srslte/asn1/liblte_mme.h" +#include "srslte/common/log.h" #include "srslte/common/nas_pcap.h" +#include "srslte/common/security.h" +#include "srslte/interfaces/ue_interfaces.h" +#include "srsue/hdr/stack/upper/nas_common.h" +#include "srsue/hdr/stack/upper/nas_metrics.h" using srslte::byte_buffer_t; namespace srsue { -class nas_args_t -{ -public: - nas_args_t() : force_imsi_attach(false) {} - - std::string apn_name; - std::string apn_protocol; - std::string apn_user; - std::string apn_pass; - bool force_imsi_attach; - std::string eia; - std::string eea; -}; - -// EMM states (3GPP 24.302 v10.0.0) -typedef enum { - EMM_STATE_NULL = 0, - EMM_STATE_DEREGISTERED, - EMM_STATE_REGISTERED, - EMM_STATE_DEREGISTERED_INITIATED, - EMM_STATE_TAU_INITIATED, - EMM_STATE_N_ITEMS, -} emm_state_t; -static const char emm_state_text[EMM_STATE_N_ITEMS][100] = {"NULL", - "DEREGISTERED", - "REGISTERED", - "DEREGISTERED INITIATED", - "TRACKING AREA UPDATE INITIATED"}; - class nas : public nas_interface_rrc, public nas_interface_ue, diff --git a/srsue/hdr/stack/upper/nas_common.h b/srsue/hdr/stack/upper/nas_common.h new file mode 100644 index 000000000..60df32020 --- /dev/null +++ b/srsue/hdr/stack/upper/nas_common.h @@ -0,0 +1,55 @@ +/* + * Copyright 2013-2019 Software Radio Systems Limited + * + * This file is part of srsLTE. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#ifndef SRSUE_NAS_COMMON_H +#define SRSUE_NAS_COMMON_H + +namespace srsue { + +class nas_args_t +{ +public: + nas_args_t() : force_imsi_attach(false) {} + + std::string apn_name; + std::string apn_protocol; + std::string apn_user; + std::string apn_pass; + bool force_imsi_attach; + std::string eia; + std::string eea; +}; + +// EMM states (3GPP 24.302 v10.0.0) +typedef enum { + EMM_STATE_NULL = 0, + EMM_STATE_DEREGISTERED, + EMM_STATE_REGISTERED, + EMM_STATE_DEREGISTERED_INITIATED, + EMM_STATE_TAU_INITIATED, + EMM_STATE_N_ITEMS, +} emm_state_t; +static const char emm_state_text[EMM_STATE_N_ITEMS][100] = { + "NULL", "DEREGISTERED", "REGISTERED", "DEREGISTERED INITIATED", "TRACKING AREA UPDATE INITIATED"}; + +} // namespace srsue + +#endif // SRSUE_NAS_COMMON_H diff --git a/srsue/hdr/stack/upper/nas_metrics.h b/srsue/hdr/stack/upper/nas_metrics.h new file mode 100644 index 000000000..d1ef0cdf8 --- /dev/null +++ b/srsue/hdr/stack/upper/nas_metrics.h @@ -0,0 +1,36 @@ +/* + * Copyright 2013-2019 Software Radio Systems Limited + * + * This file is part of srsLTE. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * A copy of the GNU Affero General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#ifndef SRSUE_NAS_METRICS_H +#define SRSUE_NAS_METRICS_H + +#include "nas_common.h" + +namespace srsue { + +struct nas_metrics_t { + uint32_t nof_active_eps_bearer; + emm_state_t state; +}; + +} // namespace srsue + +#endif // SRSUE_NAS_METRICS_H