add NAS metrics struct and move NAS states into common header

This commit is contained in:
Andre Puschmann 2019-05-24 14:33:34 +02:00
parent 647282180b
commit 1ec5a4d4ed
3 changed files with 98 additions and 34 deletions

View File

@ -22,47 +22,20 @@
#ifndef SRSUE_NAS_H
#define SRSUE_NAS_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/buffer_pool.h"
#include "srslte/common/common.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,

View File

@ -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

View File

@ -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