Commit ef0b5f1d authored by HFJ's avatar HFJ

Segmentation fault

parent b608bda7
......@@ -30,6 +30,20 @@ include_directories(5gaka)
include_directories(common)
include_directories(libngap)
####### for contexts ###########
include_directories(contexts)
include_directories(utils)
include_directories(utils/bstr)
include_directories(contexts)
include_directories(nas/ies)
include_directories(nas/common)
include_directories(nas/msgs)
include_directories(nas/utils)
add_library (CONTEXTS STATIC
${CMAKE_CURRENT_SOURCE_DIR}/contexts/nas_context.cpp
)
################################
################### code frrom amf cmakelists###########################
find_package(PkgConfig REQUIRED)
......
################################################################################
# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The OpenAirInterface Software Alliance licenses this file to You under
# the OAI Public License, Version 1.1 (the "License"); you may not use this file
# except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.openairinterface.org/?page_id=698
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
# For more information about the OpenAirInterface (OAI) Software Alliance:
# contact@openairinterface.org
################################################################################
include_directories(${SRC_TOP_DIR}/../build/ext/spdlog/include)
include_directories(${SRC_TOP_DIR}/itti)
include_directories(${SRC_TOP_DIR}/itti/msgs)
include_directories(${SRC_TOP_DIR}/common)
include_directories(${SRC_TOP_DIR}/common/unicode)
include_directories(${SRC_TOP_DIR}/contexts)
include_directories(${SRC_TOP_DIR}/nas/ies)
include_directories(${SRC_TOP_DIR}/nas/common)
include_directories(${SRC_TOP_DIR}/nas/utils)
include_directories(${SRC_TOP_DIR}/ngap/libngap)
include_directories(${SRC_TOP_DIR}/ngap/ngapIEs)
include_directories(${SRC_TOP_DIR}/sctp)
include_directories(${SRC_TOP_DIR}/secu_algorithms/5gaka)
include_directories(${SRC_TOP_DIR}/secu_algorithms/nas_enc_int)
include_directories(${SRC_TOP_DIR}/utils)
include_directories(${SRC_TOP_DIR}/utils/bstr)
add_library (CONTEXTS STATIC
${CMAKE_CURRENT_SOURCE_DIR}/gNB_context.cpp
${CMAKE_CURRENT_SOURCE_DIR}/nas_context.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pdu_session_context.cpp
)
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file gNB_context.cpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "gNB_context.hpp"
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file gNB_context.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _GNB_CONTEXT_H_
#define _GNB_CONTEXT_H_
#include <stdint.h>
#include <string>
#include <vector>
#include "sctp_server.hpp"
#include "NgapIEsStruct.hpp"
extern "C" {
#include "Ngap_PagingDRX.h"
#include "bstrlib.h"
}
using namespace sctp;
using namespace ngap;
enum amf_ng_gnb_state_s {
NGAP_INIT,
NGAP_RESETING,
NGAP_READY,
NGAP_SHUTDOWN
};
class gnb_context {
public:
enum amf_ng_gnb_state_s ng_state;
std::string gnb_name;
long globalRanNodeId;
e_Ngap_PagingDRX default_paging_drx; //v32, v64, v128, v256
std::vector<SupportedItem_t> s_ta_list;
bstring ue_radio_cap_ind;
sctp_assoc_id_t sctp_assoc_id;
sctp_stream_id_t next_sctp_stream;
sctp_stream_id_t instreams;
sctp_stream_id_t outstreams;
};
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file nas_context.cpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "nas_context.hpp"
//------------------------------------------------------------------------------
nas_context::nas_context() {
security_ctx = NULL;
is_imsi_present = false;
is_stacs_available = false;
is_auth_vectors_present = false;
is_specific_procedure_for_registration_running = false;
is_specific_procedure_for_deregistration_running = false;
is_specific_procedure_for_eCell_inactivity_running = false;
is_common_procedure_for_authentication_running = false;
is_common_procedure_for_identification_running = false;
is_common_procedure_for_security_mode_control_running = false;
is_common_procedure_for_nas_transport_running = false;
auts = NULL;
}
//------------------------------------------------------------------------------
nas_context::~nas_context() {
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file nas_context.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _AMF_NAS_CONTEXT_H_
#define _AMF_NAS_CONTEXT_H_
#include <stdint.h>
#include <string>
#include "struct.hpp"
#include "nas_security_context.hpp"
#include "security_def.hpp"
#include "authentication_algorithms_with_5gaka.hpp"
class nas_context {
public:
nas_context();
~nas_context();
bool ctx_avaliability_ind;
bool is_stacs_available;
long amf_ue_ngap_id;
uint32_t ran_ue_ngap_id;
std::string nas_status;
/************ parameters from Registration request *************/
uint8_t registration_type :3;
bool follow_on_req_pending_ind;
uint8_t ngKsi :4;
//mobility identity: imsi, supi, 5g-guti, etc
std::string imsi;
uint8_t mmCapability;
uint8_t ueSecurityCapEnc;
uint8_t ueSecurityCapInt;
std::vector<nas::SNSSAI_t> requestedNssai;
std::string serving_network;
bstring auts;
/************ NAS EP(s) ****************/
bool is_specific_procedure_for_registration_running;
bool is_specific_procedure_for_deregistration_running;
bool is_specific_procedure_for_eCell_inactivity_running;
bool is_common_procedure_for_authentication_running;
bool is_common_procedure_for_identification_running;
bool is_common_procedure_for_security_mode_control_running;
bool is_common_procedure_for_nas_transport_running;
/************ security related ***********/
#define MAX_5GS_AUTH_VECTORS 1
auc_vector_t _vector[MAX_5GS_AUTH_VECTORS];/* 5GS authentication vector */
_5G_HE_AV_t _5g_he_av[MAX_5GS_AUTH_VECTORS]; //generated by UDM
_5G_AV_t _5g_av[MAX_5GS_AUTH_VECTORS]; //generated by ausf
uint8_t kamf[MAX_5GS_AUTH_VECTORS][32];
security_context_t _security;
nas_secu_ctx *security_ctx;
bool is_current_security_available;
int registration_attempt_counter; //used to limit the subsequently reject registration attempts(clause 5.5.1.2.7/5.5.1.3.7, 3gpp ts24.501)
/**************** parameters present? ****************/
bool is_imsi_present;
bool is_5g_guti_present;
bool is_auth_vectors_present;
bool to_be_register_by_new_suci;
};
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file nas_security_context.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _NAS_SECURITY_CONTEXT_H_
#define _NAS_SECURITY_CONTEXT_H_
#include <stdint.h>
#define AUTH_KNAS_INT_SIZE 16 /* NAS integrity key */
#define AUTH_KNAS_ENC_SIZE 16 /* NAS cyphering key */
#define NGKSI_MAX_VALUE 6
/* Type of security context */
typedef enum {
SECURITY_CTX_TYPE_NOT_AVAILABLE = 0,
SECURITY_CTX_TYPE_PARTIAL_NATIVE,
SECURITY_CTX_TYPE_FULL_NATIVE,
SECURITY_CTX_TYPE_MAPPED
} nas_sc_type_t;
/*
Internal data used for security mode control procedure
*/
typedef struct {
unsigned int ue_id; /* UE identifier */
#define SECURITY_COUNTER_MAX 5
unsigned int retransmission_count; /* Retransmission counter */
int ksi; /* NAS key set identifier */
int nea; /* Replayed EPS encryption algorithms */
int eea; /* Replayed EPS encryption algorithms */
int nia; /* Replayed EPS integrity algorithms */
int eia; /* Replayed EPS integrity algorithms */
int ucs2; /* Replayed Alphabet */
int uea; /* Replayed UMTS encryption algorithms */
int uia; /* Replayed UMTS integrity algorithms */
int gea; /* Replayed G encryption algorithms */
bool umts_present;
bool gprs_present;
int selected_eea; /* Selected EPS encryption algorithms */
int selected_eia; /* Selected EPS integrity algorithms */
int saved_selected_eea; /* Previous selected EPS encryption algorithms */
int saved_selected_nea; /* Previous selected EPS encryption algorithms */
int saved_selected_eia; /* Previous selected EPS integrity algorithms */
int saved_selected_nia; /* Previous selected EPS integrity algorithms */
int saved_ngksi; /* Previous ksi */
uint16_t saved_overflow; /* Previous dl_count overflow */
uint8_t saved_seq_num; /* Previous dl_count seq_num */
nas_sc_type_t saved_sc_type;
bool notify_failure; /* Indicates whether the identification
* procedure failure shall be notified
* to the ongoing EMM procedure */
} security_data_t;
typedef uint8_t ngksi_t;
typedef struct {
uint32_t spare :8;
uint32_t overflow :16;
uint32_t seq_num :8;
} count_t;
typedef struct {
uint8_t _5gs_encryption;
uint8_t _5gs_integrity;
} capability_t;
typedef struct {
uint8_t encryption :4;
uint8_t integrity :4;
} selected_algs;
class nas_secu_ctx {
public:
int vector_pointer;
nas_sc_type_t sc_type;
ngksi_t ngksi;
uint8_t knas_enc[AUTH_KNAS_ENC_SIZE];
uint8_t knas_int[AUTH_KNAS_INT_SIZE];
count_t dl_count;
count_t ul_count;
capability_t ue_algorithms;
selected_algs nas_algs;
};
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file pdu_session_context.cpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "pdu_session_context.hpp"
//------------------------------------------------------------------------------
pdu_session_context::pdu_session_context() {
smf_available = false;
isn2sm_avaliable = false;
isn1sm_avaliable = false;
}
//------------------------------------------------------------------------------
pdu_session_context::~pdu_session_context() {
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file pdu_session_context.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _PDU_SESSION_CONTEXT_H_
#define _PDU_SESSION_CONTEXT_H_
#include <string>
#include "bstrlib.h"
#include "amf.hpp"
class pdu_session_context
{
public:
pdu_session_context();
~pdu_session_context();
uint32_t ran_ue_ngap_id;
long amf_ue_ngap_id;
uint8_t req_type;
uint8_t pdu_session_id;
bstring n2sm;
bool isn2sm_avaliable;
bstring n1sm;
bool isn1sm_avaliable;
std::string dnn;
std::string remote_smf_addr[0]; //"192.168.12.10:8080"
bool smf_available;
std::string location;
snssai_t snssai;
plmn_t plmn;
std::string smf_context_location;
};
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file security_def.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _SECURITY_DEF_H_
#define _SECURITY_DEF_H_
#define AUTH_SQN_INDEX 0
#define AUTH_AMF_INDEX (AUTH_SQN_INDEX + AUTH_SQN_SIZE)
#define AUTH_MAC_INDEX (AUTH_AMF_INDEX + AUTH_AMF_SIZE)
/*
* Size of the authentication challenge parameters in bytes
*/
#define AUTH_SQN_SIZE 6 /* Sequence number: 48 bits */
#define AUTH_AK_SIZE 6 /* Anonymity key: 48 bits */
#define AUTH_AMF_SIZE 2 /* Authentication Management Field: 16 bits */
#define AUTH_MAC_SIZE 8 /* Message Authentication Code: 64 bits */
#define AUTH_AUTN_SIZE 16 /* Authentication token: 128 bits
AUTN = (SQN ⊕ AK) || AMF || MAC */
#define AUTH_MACS_SIZE 8 /* Re-synchronization MAC: 64 bits */
#define AUTH_AUTS_SIZE 16 /* Re-synchronization AUT: 128 bits */
#define AUTH_RAND_SIZE 16 /* Random challenge: 128 bits */
#define AUTH_CK_SIZE 16 /* Ciphering key: 128 bits */
#define AUTH_IK_SIZE 16 /* Integrity key: 128 bits */
#define AUTH_RES_SIZE 16 /* Authentication response: 128 bits */
#define AUTH_SNID_SIZE 3 /* Serving network's identity: 24 bits */
#define AUTH_KASME_SIZE 32 /* KASME security key: 256 bits */
#define AUTH_KNAS_INT_SIZE 16 /* NAS integrity key */
#define AUTH_KNAS_ENC_SIZE 16 /* NAS cyphering key */
#define AUTH_KENB_SIZE AUTH_KASME_SIZE /* eNodeB security key */
/* "Separation bit" of AMF field */
#define AUTH_AMF_SEPARATION_BIT(a) ((a) & 0x80)
/*
* 5GS authentication vector
*/
typedef struct {
/* ASME security key */
uint8_t kasme[AUTH_KASME_SIZE];
/* Random challenge parameter */
uint8_t rand[AUTH_RAND_SIZE];
/* Authentication token parameter */
uint8_t autn[AUTH_AUTN_SIZE];
/* Expected Authentication response parameter */
#define AUTH_XRES_SIZE AUTH_RES_SIZE
uint8_t xres_size;
uint8_t xres[AUTH_XRES_SIZE];
} auth_vector_t;
typedef struct security_context_s {
//emm_sc_type_t sc_type; /* Type of security context */
/* state of security context is implicit due to its storage location (current/non-current)*/
#define EKSI_MAX_VALUE 6
//ksi_t eksi; /* NAS key set identifier for E-UTRAN */
#define EMM_SECURITY_VECTOR_INDEX_INVALID (-1)
int vector_index; /* Pointer on vector */
uint8_t knas_enc[AUTH_KNAS_ENC_SIZE];/* NAS cyphering key */
uint8_t knas_int[AUTH_KNAS_INT_SIZE];/* NAS integrity key */
struct count_s {
uint32_t spare :8;
uint32_t overflow :16;
uint32_t seq_num :8;
} dl_count, ul_count; /* Downlink and uplink count parameters */
struct {
uint8_t eps_encryption; /* algorithm used for ciphering */
uint8_t eps_integrity; /* algorithm used for integrity protection */
uint8_t umts_encryption; /* algorithm used for ciphering */
uint8_t umts_integrity; /* algorithm used for integrity protection */
uint8_t gprs_encryption; /* algorithm used for ciphering */
bool umts_present :1;
bool gprs_present :1;
} capability; /* UE network capability */
struct {
uint8_t encryption :4; /* algorithm used for ciphering */
uint8_t integrity :4; /* algorithm used for integrity protection */
} selected_algorithms; /* MME selected algorithms */
// Requirement MME24.301R10_4.4.4.3_2 (DETACH REQUEST (if sent before security has been activated);)
uint8_t activated;
} security_context_t;
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file ue_context.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _UE_CONTEXT_H_
#define _UE_CONTEXT_H_
#include <stdint.h>
#include <map>
#include <shared_mutex>
#include "NgapIEsStruct.hpp"
extern "C" {
#include "Ngap_RRCEstablishmentCause.h"
}
using namespace ngap;
class ue_context {
public:
uint32_t ran_ue_ngap_id; //32bits
long amf_ue_ngap_id :40; //40bits
e_Ngap_RRCEstablishmentCause rrc_estb_cause;
bool isUeContextRequest;
NrCgi_t cgi;
Tai_t tai;
};
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file ue_ngap_context.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _UE_NGAP_CONTEXT_H_
#define _UE_NGAP_CONTEXT_H_
#include <stdint.h>
#include <map>
#include <shared_mutex>
#include "gNB_context.hpp"
using namespace sctp;
typedef enum {
NGAP_UE_INVALID_STATE,
NGAP_UE_WAITING_CSR, //Context Setup Response(CSR)
NGAP_UE_HANDOVER,
NGAP_UE_CONNECTED,
NGAP_UE_WAITING_CRR
} ng_ue_state_t;
class ue_ngap_context {
public:
uint32_t ran_ue_ngap_id; //32bits
long amf_ue_ngap_id :40; //40bits
sctp_stream_id_t sctp_stream_recv; // used to decide which ue in gNB
sctp_stream_id_t sctp_stream_send; // used to decide which ue in gNB
sctp_assoc_id_t gnb_assoc_id; //to find which gnb this UE belongs to
bool ueContextRequest;
uint32_t s_tmsi_5g;
//state management, ue status over the air
ng_ue_state_t ng_ue_state;
};
#endif
......@@ -19,7 +19,7 @@
#if __cplusplus < 201703L
namespace std {
typedef uint8_t byte;
typedef uint8_t byte;
}
#endif
......
......@@ -24,7 +24,7 @@
std::ostringstream oss; \
oss << str << ": "; \
if (errno == 0) { \
oss << gai_strerror(static_cast<int>(ret)); \
oss << gai_strerror(static_cast<int>(ret)); \
} else { \
oss << strerror(errno); \
} \
......
......@@ -82,8 +82,7 @@ public:
* [1] https://en.wikipedia.org/wiki/BREACH
* [2] https://en.wikipedia.org/wiki/CRIME
*/
void useSSL(const std::string &cert, const std::string &key,
bool use_compression = false);
void useSSL(const std::string &cert, const std::string &key, bool use_compression = false);
/*!
* \brief Use SSL certificate authentication on this endpoint
......
......@@ -9,92 +9,87 @@
#include <pistache/string_logger.h>
#ifndef PISTACHE_LOG_STRING_FATAL
#define PISTACHE_LOG_STRING_FATAL(logger, message) \
do { \
if (logger && logger->isEnabledFor(::Pistache::Log::Level::FATAL)) { \
std::ostringstream oss_; \
oss_ << message; \
logger->log(::Pistache::Log::Level::FATAL, oss_.str()); \
} \
} while (0)
#define PISTACHE_LOG_STRING_FATAL(logger, message) do {\
if (logger && logger->isEnabledFor(::Pistache::Log::Level::FATAL)) { \
std::ostringstream oss_; \
oss_ << message; \
logger->log(::Pistache::Log::Level::FATAL, oss_.str()); \
} \
} while (0)
#endif
#ifndef PISTACHE_LOG_STRING_ERROR
#define PISTACHE_LOG_STRING_ERROR(logger, message) \
do { \
if (logger && logger->isEnabledFor(::Pistache::Log::Level::ERROR)) { \
std::ostringstream oss_; \
oss_ << message; \
logger->log(::Pistache::Log::Level::ERROR, oss_.str()); \
} \
} while (0)
#define PISTACHE_LOG_STRING_ERROR(logger, message) do {\
if (logger && logger->isEnabledFor(::Pistache::Log::Level::ERROR)) { \
std::ostringstream oss_; \
oss_ << message; \
logger->log(::Pistache::Log::Level::ERROR, oss_.str()); \
} \
} while (0)
#endif
#ifndef PISTACHE_LOG_STRING_WARN
#define PISTACHE_LOG_STRING_WARN(logger, message) \
do { \
if (logger && logger->isEnabledFor(::Pistache::Log::Level::WARN)) { \
std::ostringstream oss_; \
oss_ << message; \
logger->log(::Pistache::Log::Level::WARN, oss_.str()); \
} \
} while (0)
#define PISTACHE_LOG_STRING_WARN(logger, message) do {\
if (logger && logger->isEnabledFor(::Pistache::Log::Level::WARN)) { \
std::ostringstream oss_; \
oss_ << message; \
logger->log(::Pistache::Log::Level::WARN, oss_.str()); \
} \
} while (0)
#endif
#ifndef PISTACHE_LOG_STRING_INFO
#define PISTACHE_LOG_STRING_INFO(logger, message) \
do { \
if (logger && logger->isEnabledFor(::Pistache::Log::Level::INFO)) { \
std::ostringstream oss_; \
oss_ << message; \
logger->log(::Pistache::Log::Level::INFO, oss_.str()); \
} \
} while (0)
#define PISTACHE_LOG_STRING_INFO(logger, message) do {\
if (logger && logger->isEnabledFor(::Pistache::Log::Level::INFO)) { \
std::ostringstream oss_; \
oss_ << message; \
logger->log(::Pistache::Log::Level::INFO, oss_.str()); \
} \
} while (0)
#endif
#ifndef PISTACHE_LOG_STRING_DEBUG
#define PISTACHE_LOG_STRING_DEBUG(logger, message) \
do { \
if (logger && logger->isEnabledFor(::Pistache::Log::Level::DEBUG)) { \
std::ostringstream oss_; \
oss_ << message; \
logger->log(::Pistache::Log::Level::DEBUG, oss_.str()); \
} \
} while (0)
#define PISTACHE_LOG_STRING_DEBUG(logger, message) do {\
if (logger && logger->isEnabledFor(::Pistache::Log::Level::DEBUG)) { \
std::ostringstream oss_; \
oss_ << message; \
logger->log(::Pistache::Log::Level::DEBUG, oss_.str()); \
} \
} while (0)
#endif
#ifndef PISTACHE_LOG_STRING_TRACE
#ifndef NDEBUG // Only enable trace logging in debug builds.
#define PISTACHE_LOG_STRING_TRACE(logger, message) \
do { \
if (logger && logger->isEnabledFor(::Pistache::Log::Level::TRACE)) { \
std::ostringstream oss_; \
oss_ << message; \
logger->log(::Pistache::Log::Level::TRACE, oss_.str()); \
} \
} while (0)
#define PISTACHE_LOG_STRING_TRACE(logger, message) do {\
if (logger && logger->isEnabledFor(::Pistache::Log::Level::TRACE)) { \
std::ostringstream oss_; \
oss_ << message; \
logger->log(::Pistache::Log::Level::TRACE, oss_.str()); \
} \
} while (0)
#else
#define PISTACHE_LOG_STRING_TRACE(logger, message) \
do { \
if (0) { \
std::ostringstream oss_; \
oss_ << message; \
logger->log(::Pistache::Log::Level::TRACE, oss_.str()); \
} \
} while (0)
#define PISTACHE_LOG_STRING_TRACE(logger, message) do {\
if (0) { \
std::ostringstream oss_; \
oss_ << message; \
logger->log(::Pistache::Log::Level::TRACE, oss_.str()); \
} \
} while (0)
#endif
#endif
#ifndef PISTACHE_STRING_LOGGER_T
#define PISTACHE_STRING_LOGGER_T std::shared_ptr<::Pistache::Log::StringLogger>
#define PISTACHE_STRING_LOGGER_T \
std::shared_ptr<::Pistache::Log::StringLogger>
#endif
#ifndef PISTACHE_DEFAULT_STRING_LOGGER
#define PISTACHE_DEFAULT_STRING_LOGGER \
std::make_shared<::Pistache::Log::StringToStreamLogger>( \
::Pistache::Log::Level::WARN)
#define PISTACHE_DEFAULT_STRING_LOGGER \
std::make_shared<::Pistache::Log::StringToStreamLogger>(::Pistache::Log::Level::WARN)
#endif
#ifndef PISTACHE_NULL_STRING_LOGGER
#define PISTACHE_NULL_STRING_LOGGER nullptr
#define PISTACHE_NULL_STRING_LOGGER \
nullptr
#endif
......@@ -124,7 +124,8 @@ public:
*this = std::move(other);
}
template <typename U> Optional(types::Some<U> some) : none_flag(NoneMarker) {
template <typename U>
Optional(types::Some<U> some) : none_flag(NoneMarker) {
static_assert(std::is_same<T, U>::value || std::is_convertible<U, T>::value,
"Types mismatch");
from_some_helper(std::move(some), types::is_move_constructible<U>());
......
......@@ -65,8 +65,7 @@ struct Route {
typedef std::function<Result(const Request, Http::ResponseWriter)> Handler;
typedef std::function<bool(Http::Request &req, Http::ResponseWriter &resp)>
Middleware;
typedef std::function<bool(Http::Request& req, Http::ResponseWriter& resp)> Middleware;
typedef std::function<void(const std::shared_ptr<Tcp::Peer> &peer)>
DisconnectHandler;
......@@ -255,6 +254,7 @@ namespace Private {
class RouterHandler : public Http::Handler {
public:
HTTP_PROTOTYPE(RouterHandler)
/**
......@@ -292,7 +292,8 @@ public:
std::vector<TypedParam> splat() const;
private:
explicit Request(Http::Request request, std::vector<TypedParam> &&params,
explicit Request(Http::Request request,
std::vector<TypedParam> &&params,
std::vector<TypedParam> &&splats);
std::vector<TypedParam> params_;
......@@ -315,15 +316,18 @@ void Head(Router &router, const std::string &resource, Route::Handler handler);
void NotFound(Router &router, Route::Handler handler);
namespace details {
template <typename... Args> struct TypeList {
template <size_t N> struct At {
template <typename... Args>
struct TypeList {
template <size_t N>
struct At {
static_assert(N < sizeof...(Args), "Invalid index");
using Type = typename std::tuple_element<N, std::tuple<Args...>>::type;
};
};
template <typename Request, typename Response> struct BindChecks {
template <typename Request, typename Response>
struct BindChecks {
constexpr static bool request_check =
std::is_const<typename std::remove_reference<Request>::type>::value &&
std::is_lvalue_reference<typename std::remove_cv<Request>::type>::value &&
......@@ -341,7 +345,8 @@ template <typename Request, typename Response> struct BindChecks {
"Function should accept (const Rest::Request&, HttpResponseWriter)");
};
template <typename Request, typename Response> struct MiddlewareChecks {
template <typename Request, typename Response>
struct MiddlewareChecks {
constexpr static bool request_check =
!std::is_const<typename std::remove_reference<Request>::type>::value &&
std::is_lvalue_reference<typename std::remove_cv<Request>::type>::value &&
......
......@@ -14,8 +14,7 @@ struct SSLCtxDeleter {
#ifdef PISTACHE_USE_SSL
SSL_CTX_free(reinterpret_cast<SSL_CTX *>(ptr));
// EVP_cleanup call is not related to cleaning SSL_CTX, just global cleanup
// routine.
// EVP_cleanup call is not related to cleaning SSL_CTX, just global cleanup routine.
// TODO: Think about removing EVP_cleanup call at all
// It was deprecated in openssl 1.1.0 version (see
// https://www.openssl.org/news/changelog.txt):
......@@ -41,13 +40,13 @@ using SSLCtxPtr = std::unique_ptr<void, SSLCtxDeleter>;
using SSLBioPtr = std::unique_ptr<void, SSLBioDeleter>;
#ifdef PISTACHE_USE_SSL
inline SSL_CTX *GetSSLContext(ssl::SSLCtxPtr &ctx) {
return reinterpret_cast<SSL_CTX *>(ctx.get());
inline SSL_CTX* GetSSLContext(ssl::SSLCtxPtr &ctx) {
return reinterpret_cast<SSL_CTX *>(ctx.get());
}
inline BIO *GetSSLBio(ssl::SSLBioPtr &ctx) {
return reinterpret_cast<BIO *>(ctx.get());
inline BIO* GetSSLBio(ssl::SSLBioPtr &ctx) {
return reinterpret_cast<BIO *>(ctx.get());
}
#endif
} // namespace ssl
} // namespace Pistache
}
}
......@@ -7,13 +7,20 @@
#pragma once
#include <iostream>
#include <memory>
#include <iostream>
namespace Pistache {
namespace Log {
enum class Level { TRACE, DEBUG, INFO, WARN, ERROR, FATAL };
enum class Level {
TRACE,
DEBUG,
INFO,
WARN,
ERROR,
FATAL
};
class StringLogger {
public:
......@@ -26,15 +33,14 @@ public:
class StringToStreamLogger : public StringLogger {
public:
explicit StringToStreamLogger(Level level, std::ostream *out = &std::cerr)
: level_(level), out_(out) {}
: level_(level), out_(out) {}
~StringToStreamLogger() override {}
void log(Level level, const std::string &message) override;
bool isEnabledFor(Level level) const override;
private:
Level level_;
std::ostream *out_;
std::ostream* out_;
};
} // namespace Log
......
......@@ -1999,29 +1999,29 @@ inline year_month_day_last::year_month_day_last(
}
CONSTCD14
inline year_month_day_last &
year_month_day_last::operator+=(const months &m) NOEXCEPT {
inline year_month_day_last &year_month_day_last::
operator+=(const months &m) NOEXCEPT {
*this = *this + m;
return *this;
}
CONSTCD14
inline year_month_day_last &
year_month_day_last::operator-=(const months &m) NOEXCEPT {
inline year_month_day_last &year_month_day_last::
operator-=(const months &m) NOEXCEPT {
*this = *this - m;
return *this;
}
CONSTCD14
inline year_month_day_last &
year_month_day_last::operator+=(const years &y) NOEXCEPT {
inline year_month_day_last &year_month_day_last::
operator+=(const years &y) NOEXCEPT {
*this = *this + y;
return *this;
}
CONSTCD14
inline year_month_day_last &
year_month_day_last::operator-=(const years &y) NOEXCEPT {
inline year_month_day_last &year_month_day_last::
operator-=(const years &y) NOEXCEPT {
*this = *this - y;
return *this;
}
......@@ -2360,29 +2360,29 @@ inline year_month_weekday::year_month_weekday(const local_days &dp) NOEXCEPT
: year_month_weekday(from_days(dp.time_since_epoch())) {}
CONSTCD14
inline year_month_weekday &
year_month_weekday::operator+=(const months &m) NOEXCEPT {
inline year_month_weekday &year_month_weekday::
operator+=(const months &m) NOEXCEPT {
*this = *this + m;
return *this;
}
CONSTCD14
inline year_month_weekday &
year_month_weekday::operator-=(const months &m) NOEXCEPT {
inline year_month_weekday &year_month_weekday::
operator-=(const months &m) NOEXCEPT {
*this = *this - m;
return *this;
}
CONSTCD14
inline year_month_weekday &
year_month_weekday::operator+=(const years &y) NOEXCEPT {
inline year_month_weekday &year_month_weekday::
operator+=(const years &y) NOEXCEPT {
*this = *this + y;
return *this;
}
CONSTCD14
inline year_month_weekday &
year_month_weekday::operator-=(const years &y) NOEXCEPT {
inline year_month_weekday &year_month_weekday::
operator-=(const years &y) NOEXCEPT {
*this = *this - y;
return *this;
}
......@@ -2511,29 +2511,29 @@ inline year_month_weekday_last::year_month_weekday_last(
wdl_(wdl) {}
CONSTCD14
inline year_month_weekday_last &
year_month_weekday_last::operator+=(const months &m) NOEXCEPT {
inline year_month_weekday_last &year_month_weekday_last::
operator+=(const months &m) NOEXCEPT {
*this = *this + m;
return *this;
}
CONSTCD14
inline year_month_weekday_last &
year_month_weekday_last::operator-=(const months &m) NOEXCEPT {
inline year_month_weekday_last &year_month_weekday_last::
operator-=(const months &m) NOEXCEPT {
*this = *this - m;
return *this;
}
CONSTCD14
inline year_month_weekday_last &
year_month_weekday_last::operator+=(const years &y) NOEXCEPT {
inline year_month_weekday_last &year_month_weekday_last::
operator+=(const years &y) NOEXCEPT {
*this = *this + y;
return *this;
}
CONSTCD14
inline year_month_weekday_last &
year_month_weekday_last::operator-=(const years &y) NOEXCEPT {
inline year_month_weekday_last &year_month_weekday_last::
operator-=(const years &y) NOEXCEPT {
*this = *this - y;
return *this;
}
......
......@@ -9,9 +9,10 @@
namespace Pistache {
namespace Version {
static constexpr int Major = 0;
static constexpr int Minor = 0;
static constexpr int Patch = 002;
static constexpr int Git = 20210107;
static constexpr int Major = 0;
static constexpr int Minor = 0;
static constexpr int Patch = 002;
static constexpr int Git = 20210107;
} // namespace Version
} // namespace Pistache
......@@ -19,8 +19,10 @@
#include "logger.hpp"
#include <iostream>
#include "nas_context.hpp"
#include "sha256.hpp"
using namespace std;
namespace org {
......@@ -93,7 +95,6 @@ void DefaultApiImpl::ue_authentications_post(
uint8_t S[100];
S[0] = 0x6B;
memcpy(&S[1], netName.buf, netName.size);
// cout << "snn length(0x%x)" << netName.size << endl;
printf("snn length(0x%x)\n", (unsigned int)netName.size);
S[1 + netName.size] = (netName.size & 0xff00) >> 8;
S[2 + netName.size] = (netName.size & 0x00ff);
......@@ -114,7 +115,7 @@ void DefaultApiImpl::ue_authentications_post(
Authentication_5gaka::kdf(ckik, 32, S, 31 + netName.size, out, 32);
for (int i = 0; i < 16; i++)
output[i] = out[16 + i];
print_buffer("amf_n1", "XRES*", output, 16);
print_buffer("ausf_server", "XRES*", output, 16);
// cout << "xres* %s" << output << endl;
/*----------------------generating 5G AV from 5G HE AV--------------------------*/
......@@ -126,6 +127,7 @@ void DefaultApiImpl::ue_authentications_post(
Logger::ausf_server().debug("==generating 5g av");
// std::shared_ptr<nas_context> nc;
// Logger::ausf_server().debug("Authentication_vectors_generator_in_ausf");
// uint8_t inputString[MAX_5GS_AUTH_VECTORS][40];
// uint8_t *xresStar[MAX_5GS_AUTH_VECTORS];
......
......@@ -8,8 +8,9 @@
#ifndef ASN_APPLICATION_H
#define ASN_APPLICATION_H
#include "asn_codecs.h" /* for ASN.1 codecs specifics */
#include "asn_system.h" /* for platform-dependent types */
#include "asn_codecs.h" /* for ASN.1 codecs specifics */
#ifdef __cplusplus
extern "C" {
......
......@@ -24,11 +24,23 @@
#include "DefaultApiImpl.h"
#include "logger.hpp"
#include "options.hpp"
#include <iostream>
#include "nas_context.hpp"
#include "sha256.hpp"
// #include "comUt.hpp"
using namespace std;
Sha256 ctx;
void sha256(unsigned char *message, int msg_len, unsigned char *output)
{
memset(output, 0, Sha256::DIGEST_SIZE);
ctx.init();
ctx.update(message, msg_len);
ctx.finalResult(output);
}
#define PISTACHE_SERVER_THREADS 2
#define PISTACHE_SERVER_MAX_REQUEST_SIZE 32768
#define PISTACHE_SERVER_MAX_RESPONSE_SIZE 32768
......@@ -83,6 +95,37 @@ int main(int argc, char **argv) {
opts.maxResponseSize(PISTACHE_SERVER_MAX_RESPONSE_SIZE);
httpEndpoint->init(opts);
std::shared_ptr<nas_context> nc;
Logger::ausf_server().debug("Authentication_vectors_generator_in_ausf");
uint8_t inputString[MAX_5GS_AUTH_VECTORS][40];
uint8_t *xresStar[MAX_5GS_AUTH_VECTORS];
uint8_t *rand[MAX_5GS_AUTH_VECTORS];
for (int i = 0; i < MAX_5GS_AUTH_VECTORS; i++)
{
xresStar[i] = nc.get()->_5g_he_av[i].xresStar;
rand[i] = nc.get()->_5g_he_av[i].rand;
memcpy(&inputString[i][0], rand[i], 16);
memcpy(&inputString[i][16], xresStar[i], 16);
unsigned char sha256Out[Sha256::DIGEST_SIZE];
sha256((unsigned char *)inputString[i], 32, sha256Out);
for (int j = 0; j < 16; j++)
nc.get()->_5g_av[i].hxresStar[j] = (uint8_t)sha256Out[j];
memcpy(nc.get()->_5g_av[i].rand, nc.get()->_5g_he_av[i].rand, 16);
memcpy(nc.get()->_5g_av[i].autn, nc.get()->_5g_he_av[i].autn, 16);
uint8_t kseaf[32];
Authentication_5gaka::derive_kseaf(nc.get()->serving_network, nc.get()->_5g_he_av[i].kausf, kseaf);
memcpy(nc.get()->_5g_av[i].kseaf, kseaf, 32);
cout << "5G AV: rand" << nc.get()->_5g_av[i].rand << endl;
cout << "5G AV: autn" << nc.get()->_5g_av[i].autn << endl;
cout << "5G AV: kseaf" << nc.get()->_5g_av[i].kseaf << endl;
cout << "5G AV: hxres*" << nc.get()->_5g_av[i].hxresStar << endl;
// print_buffer("amf_n1", "5G AV: rand", nc.get()->_5g_av[i].rand, 16);
// print_buffer("amf_n1", "5G AV: autn", nc.get()->_5g_av[i].autn, 16);
// print_buffer("amf_n1", "5G AV: kseaf", nc.get()->_5g_av[i].kseaf, 32);
// print_buffer("amf_n1", "5G AV: hxres*", nc.get()->_5g_av[i].hxresStar, 16);
}
Logger::init( "ausf" , true , true);
Logger::ausf_server().startup("Entering main...");
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file 3gpp_ts24501.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _3GPP_TS_24501_H_
#define _3GPP_TS_24501_H_
/********** epd type **************/
#define EPD_5GS_MM_MSG 0b01111110
#define EPD_5GS_SM_MSG 0b00101110
/********** security header type **************/
#define PLAIN_5GS_MSG 0b0000
#define INTEGRITY_PROTECTED 0b0001
#define INTEGRITY_PROTECTED_AND_CIPHERED 0b0010
#define INTEGRITY_PROTECTED_WITH_NEW_SECU_CTX 0b0011 // only for SECURITY MODE COMMAND
#define INTEGRITY_PROTECTED_AND_CIPHERED_WITH_NEW_SECU_CTX 0b0100 // only for SECURITY MODE COMPLETE
/********** message type ********************/
#define REGISTRATION_REQUEST 0b01000001
#define REGISTRATION_REJECT 0b01000100
#define AUTHENTICATION_REQUEST 0b01010110
#define AUTHENTICATION_RESPONSE 0b01010111
#define AUTHENTICATION_RESULT 0b01011010
#define AUTHENTICATION_FAILURE 0b01011001
#define AUTHENTICATION_REJECT 0b01011000
#define SECURITY_MODE_COMMAND 0b01011101
#define SECURITY_MODE_COMPLETE 0b01011110
#define SECURITY_MODE_REJECT 0b01011111
#define REGISTRATION_COMPLETE 0b01000011
#define REGISTRATION_ACCEPT 0b01000010
#define IDENTITY_REQUEST 0b01011011
#define IDENTITY_RESPONSE 0b01011100
#define UL_NAS_TRANSPORT 0b01100111
#define DL_NAS_TRANSPORT 0b01101000
#define SERVICE_REQUEST 0b01001100
#define SERVICE_REJECT 0b01001101
#define SERVICE_ACCEPT 0b01001110
#define UE_INIT_DEREGISTER 0b01000101
/********* registration type ***************/
#define NO_FOLLOW_ON_REQ_PENDING false
#define FOLLOW_ON_REQ_PENDING true
#define INITIAL_REGISTRATION 0b001
#define MOBILITY_REGISTRATION_UPDATING 0b010
#define PERIODIC_REGISTRATION_UPDATING 0b011
#define EMERGENCY_REGISTRATION 0b100
/********* NAS Key Set identifier **********/
#define NAS_KEY_SET_IDENTIFIER_NATIVE 0b0
#define NAS_KEY_SET_IDENTIFIER_MAPPED 0b1
#define NAS_KEY_SET_IDENTIFIER_NOT_AVAILABLE 0b111
/********* 5GSMobilityIdentity **********/
#define NO_IDENTITY 0b000
#define SUCI 0b001
#define _5G_GUTI 0b010
#define IMEI 0b011
#define _5G_S_TMSI 0b100
#define IMEISVI 0b101
#define MAC_ADDRESS 0b110
#define EVEN_IENTITY 0
#define ODD_IDENTITY 1
#define SUPI_FORMAT_IMSI 0b000
#define SUPI_FORMAT_NETWORK_SPECIFIC_IDENTIFIER 0b001
#define NULL_SCHEME 0b0000
#define ECIES_SCHEME_PROFILE_A 0b0001
#define ECIES_SCHEME_PROFILE_B 0b0010
#define HOME_NETWORK_PKI_0_WHEN_PSI_0 0b00000000
#define HOME_NETWORK_PKI_RESERVED 0b11111111
/************************** security algorithms ***********************************************************/
#define IA0_5G 0b000
#define IA1_128_5G 0b001
#define IA2_128_5G 0b010
#define EA0_5G 0b000
#define EA1_128_5G 0b001
#define EA2_128_5G 0b010
/************************** cause value for 5g mobility management(Annex A) ********************************/
#define _5GMM_CAUSE_ILLEGAL_UE 3
#define _5GMM_CAUSE_SYNCH_FAILURE 0b00010101
#define _5GMM_CAUSE_IMPLICITLY_DE_REGISTERED 10
#define _5GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED 9
// A.5 Causes related to invalid messages
//------------------------------------------------------------------------------
#define _5GMM_CAUSE_SEMANTICALLY_INCORRECT 95
#define _5GMM_CAUSE_INVALID_MANDATORY_INFO 96
#define _5GMM_CAUSE_MESSAGE_TYPE_NOT_IMPLEMENTED 97
#define _5GMM_CAUSE_MESSAGE_TYPE_NOT_COMPATIBLE 98
#define _5GMM_CAUSE_IE_NOT_IMPLEMENTED 99
#define _5GMM_CAUSE_CONDITIONAL_IE_ERROR 100
#define _5GMM_CAUSE_MESSAGE_NOT_COMPATIBLE 101
#define _5GMM_CAUSE_PROTOCOL_ERROR 111
/********************* UL NAS TRANSPORT payload container type **************************/
#define N1_SM_INFORMATION 0x01
#define SMS_CONTAINER 0x02
#define LTE_POSITIONING_PROTOCOL 0x03
#define SOR_TRANSPARENT_CONTAINER 0x04
#define UE_POLICY_CONTAINER 0x05
#define UE_PARAMETERS_UPDATE 0x06
#define MULTIPLE_PAYLOADS 0x0f
#define PDU_SESSION_INITIAL_REQUEST 0b001
#define EXISTING_PDU_SESSION 0b010
#define PDU_SESSION_INITIAL_EMERGENCY_REQUEST 0b011
#define EXISTING_EMERGENCY_PDU_SESSION 0b100
#define PDU_SESSION_MODIFICATION_REQUEST 0b101
#define MA_PDU_REQUEST 0b110
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common_defs.h
\brief
\author Sebastien ROUX, Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_COMMON_DEFS_SEEN
#define FILE_COMMON_DEFS_SEEN
#include <arpa/inet.h>
#include <stdint.h>
#define RETURNclear (int)2
#define RETURNerror (int)1
#define RETURNok (int)0
typedef enum {
/* Fatal errors - received message should not be processed */
TLV_MAC_MISMATCH = -14,
TLV_BUFFER_NULL = -13,
TLV_BUFFER_TOO_SHORT = -12,
TLV_PROTOCOL_NOT_SUPPORTED = -11,
TLV_WRONG_MESSAGE_TYPE = -10,
TLV_OCTET_STRING_TOO_LONG_FOR_IEI = -9,
TLV_VALUE_DOESNT_MATCH = -4,
TLV_MANDATORY_FIELD_NOT_PRESENT = -3,
TLV_UNEXPECTED_IEI = -2,
// RETURNerror = -1,
// RETURNok = 0,
TLV_ERROR_OK = RETURNok,
/* Defines error code limit below which received message should be discarded
* because it cannot be further processed */
TLV_FATAL_ERROR = TLV_VALUE_DOESNT_MATCH
} error_code_e;
//------------------------------------------------------------------------------
#define DECODE_U8(bUFFER, vALUE, sIZE) \
vALUE = *(uint8_t*)(bUFFER); \
sIZE += sizeof(uint8_t)
#define DECODE_U16(bUFFER, vALUE, sIZE) \
vALUE = ntohs(*(uint16_t*)(bUFFER)); \
sIZE += sizeof(uint16_t)
#define DECODE_U24(bUFFER, vALUE, sIZE) \
vALUE = ntohl(*(uint32_t*)(bUFFER)) >> 8; \
sIZE += sizeof(uint8_t) + sizeof(uint16_t)
#define DECODE_U32(bUFFER, vALUE, sIZE) \
vALUE = ntohl(*(uint32_t*)(bUFFER)); \
sIZE += sizeof(uint32_t)
#if (BYTE_ORDER == LITTLE_ENDIAN)
# define DECODE_LENGTH_U16(bUFFER, vALUE, sIZE) \
vALUE = ((*(bUFFER)) << 8) | (*((bUFFER) + 1)); \
sIZE += sizeof(uint16_t)
#else
# define DECODE_LENGTH_U16(bUFFER, vALUE, sIZE) \
vALUE = (*(bUFFER)) | (*((bUFFER) + 1) << 8); \
sIZE += sizeof(uint16_t)
#endif
#define ENCODE_U8(buffer, value, size) \
*(uint8_t*)(buffer) = value; \
size += sizeof(uint8_t)
#define ENCODE_U16(buffer, value, size) \
*(uint16_t*)(buffer) = htons(value); \
size += sizeof(uint16_t)
#define ENCODE_U24(buffer, value, size) \
*(uint32_t*)(buffer) = htonl(value); \
size += sizeof(uint8_t) + sizeof(uint16_t)
#define ENCODE_U32(buffer, value, size) \
*(uint32_t*)(buffer) = htonl(value); \
size += sizeof(uint32_t)
#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\
struct in_addr inp;\
if ( inet_aton(AdDr_StR, &inp ) < 0 ) {\
AssertFatal (0, MeSsAgE);\
} else {\
NwBo = inp.s_addr;\
}\
} while (0)
#define NIPADDR(addr) \
(uint8_t)(addr & 0x000000FF), \
(uint8_t)((addr & 0x0000FF00) >> 8), \
(uint8_t)((addr & 0x00FF0000) >> 16), \
(uint8_t)((addr & 0xFF000000) >> 24)
#define HIPADDR(addr) \
(uint8_t)((addr & 0xFF000000) >> 24),\
(uint8_t)((addr & 0x00FF0000) >> 16),\
(uint8_t)((addr & 0x0000FF00) >> 8), \
(uint8_t)(addr & 0x000000FF)
#define NIP6ADDR(addr) \
ntohs((addr)->s6_addr16[0]), \
ntohs((addr)->s6_addr16[1]), \
ntohs((addr)->s6_addr16[2]), \
ntohs((addr)->s6_addr16[3]), \
ntohs((addr)->s6_addr16[4]), \
ntohs((addr)->s6_addr16[5]), \
ntohs((addr)->s6_addr16[6]), \
ntohs((addr)->s6_addr16[7])
#define IN6_ARE_ADDR_MASKED_EQUAL(a,b,m) \
(((((__const uint32_t *) (a))[0] & (((__const uint32_t *) (m))[0])) == (((__const uint32_t *) (b))[0] & (((__const uint32_t *) (m))[0]))) \
&& ((((__const uint32_t *) (a))[1] & (((__const uint32_t *) (m))[1])) == (((__const uint32_t *) (b))[1] & (((__const uint32_t *) (m))[1]))) \
&& ((((__const uint32_t *) (a))[2] & (((__const uint32_t *) (m))[2])) == (((__const uint32_t *) (b))[2] & (((__const uint32_t *) (m))[2]))) \
&& ((((__const uint32_t *) (a))[3] & (((__const uint32_t *) (m))[3])) == (((__const uint32_t *) (b))[3] & (((__const uint32_t *) (m))[3]))))
////////////
#define IPV4_STR_ADDR_TO_INADDR(AdDr_StR,InAdDr,MeSsAgE ) do {\
if ( inet_aton(AdDr_StR, &InAdDr ) <= 0 ) {\
throw (MeSsAgE);\
}\
} while (0)
#ifndef UNUSED
#define UNUSED(x) (void)(x)
#endif
#endif /* FILE_COMMON_DEFS_SEEN */
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file nas_ie_header.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "nas_mm_plain_header.hpp"
#include "5GSRegistrationType.hpp"
#include "NasKeySetIdentifier.hpp"
#include "5GSMobilityIdentity.hpp"
#include "5GMMCapability.hpp"
#include "UESecurityCapability.hpp"
#include "UENetworkCapability.hpp"
#include "UplinkDataStatus.hpp"
#include "NSSAI.hpp"
#include "_5GS_Tracking_Area_Identity.hpp"
#include "PDU_Session_Status.hpp"
#include "MICO_Indication.hpp"
#include "UE_Status.hpp"
#include "Allowed_PDU_Session_Status.hpp"
#include "UES_Usage_Setting.hpp"
#include "_5GS_DRX_arameters.hpp"
#include "EPS_NAS_Message_Container.hpp"
#include "LADN_Indication.hpp"
#include "Payload_Container_Type.hpp"
#include "Payload_Container.hpp"
#include "Network_Slicing_Indication.hpp"
#include "_5GS_Update_Type.hpp"
#include "NAS_Message_Container.hpp"
#include "EPS_Bearer_Context_Status.hpp"
#include "_5GMM_Cause.hpp"
#include "GPRS_Timer_2.hpp"
#include "EAP_Message.hpp"
#include "Rejected_NSSAI.hpp"
#include "ABBA.hpp"
#include "Authentication_Parameter_RAND.hpp"
#include "Authentication_Parameter_AUTN.hpp"
#include "Authentication_Response_Parameter.hpp"
#include "Authentication_Failure_Parameter.hpp"
#include "NAS_Security_Algorithms.hpp"
#include "IMEISV_Request.hpp"
#include "EPS_NAS_Security_Algorithms.hpp"
#include "Additional_5G_Security_Information.hpp"
#include "S1_UE_Security_Capability.hpp"
#include "SOR_Transparent_Container.hpp"
#include "_5GS_Registration_Result.hpp"
#include "GPRS_Timer_3.hpp"
#include "PLMN_List.hpp"
#include "_5GS_Network_Feature_Support.hpp"
#include "PDU_Session_Reactivation_Result.hpp"
#include "PDU_Session_Reactivation_Result_Error_Cause.hpp"
#include "NSSAI_Inclusion_Mode.hpp"
#include "Non_3GPP_NW_Provided_Policies.hpp"
#include "UE_Radio_Capability_ID.hpp"
#include "_5GS_Identity_Type.hpp"
#include "PDU_Session_Identity_2.hpp"
#include "Request_Type.hpp"
#include "S_NSSAI.hpp"
#include "DNN.hpp"
#include "Additional_Information.hpp"
#include "MA_PDU_Session_Information.hpp"
#include "Release_Assistance_Indication.hpp"
#include "Extended_DRX_Parameters.hpp"
#include "struct.hpp"
#include "ServiceType.hpp"
#include "_5GSTrackingAreaIdList.hpp"
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file 5GMMCapability.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "5GMMCapability.hpp"
#include "logger.hpp"
using namespace nas;
//------------------------------------------------------------------------------
_5GMMCapability::_5GMMCapability(const uint8_t iei, uint8_t value) {
m_iei = iei;
m_value = value;
length = 3;
}
//------------------------------------------------------------------------------
_5GMMCapability::_5GMMCapability() {
}
//------------------------------------------------------------------------------
_5GMMCapability::~_5GMMCapability() {
}
//------------------------------------------------------------------------------
void _5GMMCapability::setValue(uint8_t iei, uint8_t value) {
m_iei = iei;
m_value = value;
}
//------------------------------------------------------------------------------
uint8_t _5GMMCapability::getValue() {
return m_value;
}
//------------------------------------------------------------------------------
int _5GMMCapability::encode2buffer(uint8_t *buf, int len) {
Logger::nas_mm().debug("encoding _5GMMCapability iei(0x%x)", m_iei);
if (len < length) {
Logger::nas_mm().error("len is less than %d", length);
return 0;
}
int encoded_size = 0;
if (m_iei) {
*(buf + encoded_size) = m_iei;
encoded_size++;
*(buf + encoded_size) = length - 2;
encoded_size++;
*(buf + encoded_size) = m_value;
encoded_size++;
} else {
*(buf + encoded_size) = length - 1;
encoded_size++;
*(buf + encoded_size) = m_value;
encoded_size++;
}
Logger::nas_mm().debug("encoded _5GMMCapability len(%d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int _5GMMCapability::decodefrombuffer(uint8_t *buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding _5GMMCapability iei(0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
}
length = *(buf + decoded_size);
decoded_size++;
m_value = *(buf + decoded_size);
decoded_size++;
Logger::nas_mm().debug("decoded _5GMMCapability value(0x%x)", m_value);
Logger::nas_mm().debug("decoded _5GMMCapability len(%d)", decoded_size);
return decoded_size;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file 5GMMCapability.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __5GMMCapability_H_
#define __5GMMCapability_H_
#include <stdint.h>
namespace nas {
class _5GMMCapability {
public:
_5GMMCapability();
_5GMMCapability(const uint8_t iei, uint8_t value);
~_5GMMCapability();
void setValue(uint8_t iei, uint8_t value);
int encode2buffer(uint8_t *buf, int len);
int decodefrombuffer(uint8_t *buf, int len, bool is_option);
uint8_t getValue();
private:
uint8_t m_iei;
uint8_t m_value;
int length;
};
}
#endif
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file 5GSMobilityIdentity.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _5GSMobilityIdentity_H_
#define _5GSMobilityIdentity_H_
#include <iostream>
#include <stdint.h>
#include "struct.hpp"
extern "C" {
#include "bstrlib.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
}
using namespace std;
namespace nas {
typedef struct _5G_GUTI_s {
string mcc;
string mnc;
uint8_t amf_region_id;
uint8_t amf_set_id;
uint16_t amf_pointer;
uint32_t _5g_tmsi;
} _5G_GUTI_t;
typedef struct IMEI_or_IMEISV_s {
uint8_t typeOfIdentity :3;
bool odd_even_indic; // for imei, even means bits 5 to 8 of last octet is "1111", for imeisv, bits 5 to 8 of last octet is "1111"
string identity; // "46011000001"
} IMEI_IMEISV_t;
typedef struct SUCI_imsi_s {
uint8_t supi_format :3;
string mcc;
string mnc;
string routingIndicator; //"1234"
uint8_t protectionSchemeId :4; // 0000
uint8_t homeNetworkPKI; // 00000000
string msin; // two types of coding; BCD & hexadecimal
} SUCI_imsi_t; // SUPI format "IMSI"
//don't define suci and supi format "Network specific identifier"
typedef struct _5G_S_TMSI_s {
uint16_t amf_set_id;
uint8_t amf_pointer;
string _5g_tmsi;
} _5G_S_TMSI_t;
class _5GSMobilityIdentity {
public:
_5GSMobilityIdentity(uint8_t _iei, const uint16_t amfSetId, const uint8_t amfPointer, const string tmsi);
_5GSMobilityIdentity(const string mcc, const string mnc, const string routingInd, uint8_t protection_sch_id, const string msin);
_5GSMobilityIdentity();
~_5GSMobilityIdentity();
void setIEI(uint8_t _iei);
int encode2buffer(uint8_t *buf, int len);
int suci_encode2buffer(uint8_t *buf, int len);
int _5g_guti_encode2buffer(uint8_t *buf, int len);
int encodeMssMnc2buffer(string mcc, string mnc, uint8_t *buf);
int encodeRoutid2buffer(string routid, uint8_t *buf);
int encodeMSIN2buffer(string msinstr, uint8_t *buf);
int _5g_s_tmsi_encode2buffer(uint8_t *buf, int len);
int _5g_s_tmsi_decodefrombuffer(uint8_t *buf, int len);
int decodefrombuffer(uint8_t *buf, int len, bool is_option);
int suci_decodefrombuffer(uint8_t *buf, int len, int length);
int _5g_guti_decodefrombuffer(uint8_t *buf, int len);
void set5GGUTI(const string mcc, const string mnc, uint8_t amf_region_id, uint16_t amf_set_id, uint8_t amf_pointer, const uint32_t _5g_tmsi);
void setSuciWithSupiImsi(const string &mcc, const string &mnc, const string &routingInd, uint8_t protecSchId, uint8_t home_pki, const string &msin_digits);
void setSuciWithSupiImsi(const string &mcc, const string &mnc, const string &routingInd, uint8_t protecSchId, const string &msin_digits);
void getSuciWithSupiImsi(SUCI_imsi_t&);
void get5GGUTI(_5G_GUTI_t&);
uint8_t gettypeOfIdentity() {
return typeOfIdentity;
}
;
bool get5G_S_TMSI(uint16_t &amfSetId, uint8_t &amfPointer, string &tmsi);
void setIMEISV(IMEISV_t imeisv);
void getIMEISV(IMEISV_t &imeisv);
int imeisv_encode2buffer(uint8_t *buf, int len);
int imeisv_decodefrombuffer(uint8_t *buf, int len);
private:
uint8_t iei;
_5G_GUTI_t *_5g_guti;
IMEI_IMEISV_t *imei_imeisv;
SUCI_imsi_t *supi_format_imsi;
_5G_S_TMSI_t *_5g_s_tmsi;
bool is_no_identity;
uint16_t length;
uint8_t typeOfIdentity :3;
IMEISV_t _IMEISV;
};
}
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "5GSRegistrationType.hpp"
#include "3gpp_ts24501.hpp"
#include "logger.hpp"
using namespace nas;
//------------------------------------------------------------------------------
_5GSRegistrationType::_5GSRegistrationType() {
iei = 0;
is_for = false;
reg_type = 0;
}
//------------------------------------------------------------------------------
_5GSRegistrationType::_5GSRegistrationType(bool is_for, uint8_t type) {
this->is_for = is_for;
this->reg_type = 0x07 & type;
this->iei = 0;
}
//------------------------------------------------------------------------------
_5GSRegistrationType::_5GSRegistrationType(uint8_t iei, bool is_for, uint8_t type) {
this->is_for = is_for;
this->reg_type = 0x07 & type;
this->iei = 0x0f & iei;
}
//------------------------------------------------------------------------------
_5GSRegistrationType::~_5GSRegistrationType() {
}
//------------------------------------------------------------------------------
int _5GSRegistrationType::encode2buffer(uint8_t *buf, int len) {
Logger::nas_mm().error("encoding 5gsregistrationtype IE");
if (len < 1) {
Logger::nas_mm().error("encoding 5gsregistrationtype error(len is less than one)");
return -1;
}
uint8_t octet = 0;
if (is_for)
octet = 0x08;
octet |= reg_type;
if (!(iei & 0x0f)) {
*buf = 0x0f & octet;
Logger::nas_mm().debug("encoded 5GSRegistrationType IE(len(1/2 octet))");
return 0;
} else {
*buf = (iei << 4) | octet;
Logger::nas_mm().debug("encoded 5GSRegistrationType IE(len(1 octet))");
return 1;
}
}
//------------------------------------------------------------------------------
int _5GSRegistrationType::decodefrombuffer(uint8_t *buf, int len, bool is_option) {
if (is_option) {
return -1;
}
Logger::nas_mm().debug("Decoding 5GSRegistrationType");
uint8_t octet = *buf;
if (octet & 0x08)
is_for = FOLLOW_ON_REQ_PENDING;
else
is_for = NO_FOLLOW_ON_REQ_PENDING;
reg_type = 0x07 & octet;
Logger::nas_mm().debug("Decoded 5GSRegistrationType len (1/2 octet)");
return 0;
}
//------------------------------------------------------------------------------
void _5GSRegistrationType::setFollowOnReq(const bool is) {
is_for = is;
}
//------------------------------------------------------------------------------
void _5GSRegistrationType::setRegType(const uint8_t type) {
reg_type = 0x07 & type;
}
//------------------------------------------------------------------------------
bool _5GSRegistrationType::isFollowOnReq() {
return is_for;
}
//------------------------------------------------------------------------------
uint8_t _5GSRegistrationType::getRegType() {
return reg_type;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _5GS_REGISTRATION_TYPE_H_
#define _5GS_REGISTRATION_TYPE_H_
#include <stdint.h>
namespace nas {
class _5GSRegistrationType {
public:
_5GSRegistrationType();
_5GSRegistrationType(bool is_for, uint8_t type);
_5GSRegistrationType(uint8_t iei, bool is_for, uint8_t type);
~_5GSRegistrationType();
int decodefrombuffer(uint8_t *buf, int len, bool is_option);
int encode2buffer(uint8_t *buf, int len);
void setFollowOnReq(const bool is);
void setRegType(const uint8_t type);
bool isFollowOnReq();
uint8_t getRegType();
private:
uint8_t iei :4;
bool is_for;
uint8_t reg_type :3;
};
}
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "ABBA.hpp"
#include "logger.hpp"
using namespace nas;
//------------------------------------------------------------------------------
ABBA::ABBA(uint8_t iei) {
_iei = iei;
}
//------------------------------------------------------------------------------
ABBA::ABBA(const uint8_t iei, uint8_t length, uint8_t *value) {
_iei = iei;
for (int i = 0; i < length; i++) {
this->_value[i] = value[i];
}
_length = length;
}
//------------------------------------------------------------------------------
ABBA::ABBA() {
}
ABBA::~ABBA() {
}
//------------------------------------------------------------------------------
uint8_t ABBA::getValue() {
for (int j = 0; j < _length; j++) {
Logger::nas_mm().debug("Decoded ABBA value (0x%2x)", _value[j]);
}
return 1;
}
//------------------------------------------------------------------------------
int ABBA::encode2buffer(uint8_t *buf, int len) {
Logger::nas_mm().debug("Encoding ABBA IEI (0x%x)", _iei);
if (len < _length) {
Logger::nas_mm().error("len is less than %d", _length);
return 0;
}
int encoded_size = 0;
if (_iei) { //option
*(buf + encoded_size) = _iei;
encoded_size++;
*(buf + encoded_size) = _length - 2;
encoded_size++;
int i = 0;
while ((_length - 2) != 0) {
*(buf + encoded_size) = _value[i];
encoded_size++;
_length--;
i++;
}
} else {
Logger::nas_mm().debug("length(%d)", _length);
*(buf + encoded_size) = _length;
encoded_size++;
int i = 0;
while (_length != 0) {
*(buf + encoded_size) = _value[i];
encoded_size++;
_length--;
i++;
}
}
Logger::nas_mm().debug("Encoded ABBA len (%d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int ABBA::decodefrombuffer(uint8_t *buf, int len, bool is_option) {
Logger::nas_mm().debug("Encoding ABBA IEI (0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
}
_length = 0x00;
_value[255] = { };
_length = *(buf + decoded_size);
decoded_size++;
int i = 0;
uint8_t Length = _length;
while (Length != 0) {
_value[i] = *(buf + decoded_size);
decoded_size++;
Length--;
i++;
}
for (int j = 0; j < _length; j++) {
Logger::nas_mm().debug("Decoded ABBA value (0x%4x), length (0x%4x)", _value[j], _length);
}
Logger::nas_mm().debug("Decoded ABBA len (%d)", decoded_size);
return decoded_size;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __ABBA_H_
#define __ABBA_H_
#include <stdint.h>
namespace nas {
class ABBA {
public:
ABBA();
ABBA(uint8_t iei);
ABBA(const uint8_t iei, uint8_t length, uint8_t *value);
~ABBA();
//void setValue(uint8_t iei, uint8_t value);
int encode2buffer(uint8_t *buf, int len);
int decodefrombuffer(uint8_t *buf, int len, bool is_option);
uint8_t getValue();
private:
uint8_t _iei;
uint8_t _length;
uint8_t _value[255];
};
}
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file Additional_5G_Security_Information.hpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "Additional_5G_Security_Information.hpp"
#include "logger.hpp"
using namespace nas;
//------------------------------------------------------------------------------
Additional_5G_Security_Information::Additional_5G_Security_Information(uint8_t iei) {
_iei = iei;
}
//------------------------------------------------------------------------------
Additional_5G_Security_Information::Additional_5G_Security_Information(const uint8_t iei, bool rinmr, bool hdp) {
_iei = iei;
RINMR = rinmr;
HDP = hdp;
}
//------------------------------------------------------------------------------
Additional_5G_Security_Information::Additional_5G_Security_Information() {
}
//------------------------------------------------------------------------------
Additional_5G_Security_Information::~Additional_5G_Security_Information() {
}
//------------------------------------------------------------------------------
void Additional_5G_Security_Information::setRINMR(bool value) {
RINMR = value;
}
//------------------------------------------------------------------------------
void Additional_5G_Security_Information::setHDP(bool value) {
HDP = value;
}
//------------------------------------------------------------------------------
bool Additional_5G_Security_Information::getRINMR() {
return RINMR;
}
//------------------------------------------------------------------------------
bool Additional_5G_Security_Information::getHDP() {
return HDP;
}
//------------------------------------------------------------------------------
int Additional_5G_Security_Information::encode2buffer(uint8_t *buf, int len) {
Logger::nas_mm().debug("encoding Additional_5G_Security_Information iei(0x%x)", _iei);
if (len < 3) {
Logger::nas_mm().error("len is less than 3");
return 0;
}
uint8_t octet = 0;
int encoded_size = 0;
if (RINMR)
octet |= 0x02;
if (HDP)
octet |= 0x01;
*(buf + encoded_size) = _iei;
encoded_size++;
*(buf + encoded_size) = 1;
encoded_size++;
*(buf + encoded_size) = octet;
encoded_size++;
Logger::nas_mm().debug("encoded Additional_5G_Security_Information IE(len(1 octet))");
return encoded_size;
}
//------------------------------------------------------------------------------
int Additional_5G_Security_Information::decodefrombuffer(uint8_t *buf, int len, bool is_option) {
if (len < 3) {
Logger::nas_mm().error("len is less than 3");
return 0;
} else {
int decoded_size = 0;
if (is_option) {
decoded_size++;
}
// length = *(buf + decoded_size);
decoded_size++;
uint8_t octet = *(buf + decoded_size);
decoded_size++;
RINMR = octet & 0x02;
HDP = octet & 0x01;
Logger::nas_mm().debug("decoded Additional_5G_Security_Information RINMR(0x%x) HDP(0x%x)", RINMR, HDP);
return decoded_size;
}
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __Additional_5G_Security_Information_H_
#define __Additional_5G_Security_Information_H_
#include <stdint.h>
namespace nas {
class Additional_5G_Security_Information {
public:
Additional_5G_Security_Information();
Additional_5G_Security_Information(uint8_t iei);
Additional_5G_Security_Information(const uint8_t iei, bool RINMR, bool HDP);
~Additional_5G_Security_Information();
int encode2buffer(uint8_t *buf, int len);
int decodefrombuffer(uint8_t *buf, int len, bool is_option);
void setRINMR(bool value);
void setHDP(bool value);
bool getRINMR();
bool getHDP();
private:
uint8_t _iei;
bool RINMR;
bool HDP;
};
}
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "Additional_Information.hpp"
#include "logger.hpp"
using namespace nas;
//------------------------------------------------------------------------------
Additional_Information::Additional_Information(uint8_t iei) {
_iei = iei;
}
//------------------------------------------------------------------------------
Additional_Information::Additional_Information(const uint8_t iei, uint8_t _length, uint8_t value) {
_iei = iei;
_value = value;
length = _length;
}
//------------------------------------------------------------------------------
Additional_Information::Additional_Information() {
}
//------------------------------------------------------------------------------
Additional_Information::~Additional_Information() {
}
//------------------------------------------------------------------------------
void Additional_Information::setValue(uint8_t iei, uint8_t value) {
_iei = iei;
_value = value;
}
//------------------------------------------------------------------------------
uint8_t Additional_Information::getValue() {
return _value;
}
//------------------------------------------------------------------------------
int Additional_Information::encode2buffer(uint8_t *buf, int len) {
Logger::nas_mm().debug("encoding Additional_Information iei(0x%x)", _iei);
if (len < length) {
Logger::nas_mm().error("len is less than %d", length);
return 0;
}
int encoded_size = 0;
if (_iei) {
*(buf + encoded_size) = _iei;
encoded_size++;
*(buf + encoded_size) = (length - 2);
encoded_size++;
*(buf + encoded_size) = _value;
encoded_size++;
} else {
*(buf + encoded_size) = (length - 1);
encoded_size++;
*(buf + encoded_size) = _value;
encoded_size++;
}
Logger::nas_mm().debug("encoded Additional_Information len(%d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int Additional_Information::decodefrombuffer(uint8_t *buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding Additional_Information iei(0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
}
_value = 0x00;
length = *(buf + decoded_size);
decoded_size++;
_value = *(buf + decoded_size);
decoded_size++;
Logger::nas_mm().debug("decoded Additional_Information value(0x%x)", _value);
Logger::nas_mm().debug("decoded Additional_Information len(%d)", decoded_size);
return decoded_size;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __Additional_Information_H_
#define __Additional_Information_H_
#include <stdint.h>
namespace nas {
class Additional_Information {
public:
Additional_Information();
Additional_Information(uint8_t iei);
Additional_Information(const uint8_t iei, uint8_t _length, uint8_t value);
~Additional_Information();
void setValue(uint8_t iei, uint8_t value);
int encode2buffer(uint8_t *buf, int len);
int decodefrombuffer(uint8_t *buf, int len, bool is_option);
uint8_t getValue();
private:
uint8_t _iei;
uint8_t length;
uint8_t _value;
};
}
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "Allowed_PDU_Session_Status.hpp"
#include "logger.hpp"
using namespace nas;
//------------------------------------------------------------------------------
Allowed_PDU_Session_Status::Allowed_PDU_Session_Status(uint8_t iei) {
_iei = iei;
}
//------------------------------------------------------------------------------
Allowed_PDU_Session_Status::Allowed_PDU_Session_Status(const uint8_t iei, uint16_t value) {
_iei = iei;
_value = value;
length = 4;
}
//------------------------------------------------------------------------------
Allowed_PDU_Session_Status::Allowed_PDU_Session_Status() {
}
//------------------------------------------------------------------------------
Allowed_PDU_Session_Status::~Allowed_PDU_Session_Status() {
}
//------------------------------------------------------------------------------
void Allowed_PDU_Session_Status::setValue(uint8_t iei, uint16_t value) {
_iei = iei;
_value = value;
}
uint16_t Allowed_PDU_Session_Status::getValue() {
return _value;
}
//------------------------------------------------------------------------------
int Allowed_PDU_Session_Status::encode2buffer(uint8_t *buf, int len) {
Logger::nas_mm().debug("encoding Allowed_PDU_Session_Status iei(0x%x)", _iei);
if (len < length) {
Logger::nas_mm().error("len is less than %d", length);
return 0;
}
int encoded_size = 0;
if (_iei) {
*(buf + encoded_size) = _iei;
encoded_size++;
*(buf + encoded_size) = length - 2;
encoded_size++;
*(buf + encoded_size) = (_value & 0x00ff);
encoded_size++;
*(buf + encoded_size) = (_value & 0xff00) >> 8;
encoded_size++;
} else {
// *(buf + encoded_size) = length - 1; encoded_size++;
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
}
Logger::nas_mm().debug("encoded Allowed_PDU_Session_Status len(%d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int Allowed_PDU_Session_Status::decodefrombuffer(uint8_t *buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding Allowed_PDU_Session_Status iei(0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
}
_value = 0x0000;
length = *(buf + decoded_size);
decoded_size++;
_value |= *(buf + decoded_size);
decoded_size++;
_value |= (*(buf + decoded_size)) << 8;
decoded_size++;
Logger::nas_mm().debug("decoded Allowed_PDU_Session_Status value(0x%4x)", _value);
Logger::nas_mm().debug("decoded Allowed_PDU_Session_Status len(%d)", decoded_size);
return decoded_size;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __Allowed_PDU_Session_Status_H_
#define __Allowed_PDU_Session_Status_H_
#include <stdint.h>
namespace nas {
class Allowed_PDU_Session_Status {
public:
Allowed_PDU_Session_Status();
Allowed_PDU_Session_Status(uint8_t iei);
Allowed_PDU_Session_Status(const uint8_t iei, uint16_t value);
~Allowed_PDU_Session_Status();
void setValue(uint8_t iei, uint16_t value);
int encode2buffer(uint8_t *buf, int len);
int decodefrombuffer(uint8_t *buf, int len, bool is_option);
uint16_t getValue();
private:
uint8_t _iei;
uint8_t length;
uint16_t _value;
};
}
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "Authentication_Failure_Parameter.hpp"
#include "logger.hpp"
using namespace nas;
//------------------------------------------------------------------------------
Authentication_Failure_Parameter::Authentication_Failure_Parameter(uint8_t iei) {
_iei = iei;
}
//------------------------------------------------------------------------------
Authentication_Failure_Parameter::Authentication_Failure_Parameter(const uint8_t iei, bstring auts) {
_iei = iei;
value = bstrcpy(auts);
length = blength(auts) + 2;
}
//------------------------------------------------------------------------------
Authentication_Failure_Parameter::Authentication_Failure_Parameter() {
}
//------------------------------------------------------------------------------
Authentication_Failure_Parameter::~Authentication_Failure_Parameter() {
}
//------------------------------------------------------------------------------
void Authentication_Failure_Parameter::getValue(bstring &auts) {
auts = bstrcpy(value);
}
//------------------------------------------------------------------------------
int Authentication_Failure_Parameter::encode2buffer(uint8_t *buf, int len) {
Logger::nas_mm().debug("encoding Authentication_Failure_Parameter iei(0x%x)", _iei);
if (len < length) {
Logger::nas_mm().error("len is less than %x", length);
return 0;
}
int encoded_size = 0;
if (_iei) {
*(buf + encoded_size) = _iei;
encoded_size++;
*(buf + encoded_size) = length - 2;
encoded_size++;
int size = encode_bstring(value, (buf + encoded_size), len - encoded_size);
encoded_size += size;
return encoded_size;
} else {
// *(buf + encoded_size) = length - 1; encoded_size++;
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
}
Logger::nas_mm().debug("encoded Authentication_Failure_Parameter len(%d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int Authentication_Failure_Parameter::decodefrombuffer(uint8_t *buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding Authentication_Failure_Parameter iei(0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
}
length = *(buf + decoded_size);
decoded_size++;
Logger::nas_mm().debug("decoded IE Authentication_Failure_Parameter length(%d)", length);
decode_bstring(&value, length, (buf + decoded_size), len - decoded_size);
decoded_size += length;
for (int i = 0; i < length; i++) {
Logger::nas_mm().debug("decoded Authentication_Failure_Parameter value(0x%x)", (uint8_t*) value->data[i]);
}
Logger::nas_mm().debug("decoded Authentication_Failure_Parameter len(%d)", decoded_size);
return decoded_size;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __Authentication_Failure_Parameter_H_
#define __Authentication_Failure_Parameter_H_
#include <iostream>
#include <stdint.h>
extern "C" {
#include "bstrlib.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
}
namespace nas {
class Authentication_Failure_Parameter {
public:
Authentication_Failure_Parameter();
Authentication_Failure_Parameter(uint8_t iei);
Authentication_Failure_Parameter(const uint8_t iei, bstring auts);
~Authentication_Failure_Parameter();
//void setValue(uint8_t iei, uint8_t value);
int encode2buffer(uint8_t *buf, int len);
int decodefrombuffer(uint8_t *buf, int len, bool is_option);
void getValue(bstring &auts);
private:
uint8_t _iei;
uint8_t length;
bstring value;
};
}
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "Authentication_Parameter_AUTN.hpp"
#include "logger.hpp"
using namespace nas;
//------------------------------------------------------------------------------
Authentication_Parameter_AUTN::Authentication_Parameter_AUTN(uint8_t iei) {
_iei = iei;
}
//------------------------------------------------------------------------------
Authentication_Parameter_AUTN::Authentication_Parameter_AUTN(const uint8_t iei, uint8_t *value) {
_iei = iei;
for (int i = 0; i < 16; i++) {
this->_value[i] = value[i];
}
}
//------------------------------------------------------------------------------
Authentication_Parameter_AUTN::Authentication_Parameter_AUTN() {
}
//------------------------------------------------------------------------------
Authentication_Parameter_AUTN::~Authentication_Parameter_AUTN() {
}
//------------------------------------------------------------------------------
uint8_t* Authentication_Parameter_AUTN::getValue() {
//for (int j = 0; j < 16; j++) {
// Logger::nas_mm().debug("decoded Authentication_Response_Parameter value(0x%2x)", _value[j]);
//}
return _value;
}
//------------------------------------------------------------------------------
int Authentication_Parameter_AUTN::encode2buffer(uint8_t *buf, int len) {
Logger::nas_mm().debug("Encoding Authentication_Parameter_AUTN IEI (0x%x)", _iei);
if (len < 18) {
Logger::nas_mm().error("len is less than 18");
return 0;
}
int encoded_size = 0;
if (_iei) {
*(buf + encoded_size) = _iei;
encoded_size++;
*(buf + encoded_size) = 16;
encoded_size++;
for (int i = 0; i < 16; i++) {
*(buf + encoded_size) = _value[i];
encoded_size++;
}
return encoded_size;
} else {
// *(buf + encoded_size) = length - 1; encoded_size++;
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
}
Logger::nas_mm().debug("Encoded Authentication_Parameter_AUTN len (%d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int Authentication_Parameter_AUTN::decodefrombuffer(uint8_t *buf, int len, bool is_option) {
Logger::nas_mm().debug("Decoding Authentication_Parameter_AUTN IEI (0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
}
decoded_size++;
for (int i = 0; i < 16; i++) {
_value[i] = *(buf + decoded_size);
decoded_size++;
}
for (int j = 0; j < 16; j++) {
Logger::nas_mm().debug("Decoded Authentication_Parameter_AUTN value (0x%2x)", _value[j]);
}
Logger::nas_mm().debug("Decoded Authentication_Parameter_AUTN len (%d)", decoded_size);
return decoded_size;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __Authentication_Parameter_AUTN_H_
#define __Authentication_Parameter_AUTN_H_
#include <stdint.h>
namespace nas {
class Authentication_Parameter_AUTN {
public:
Authentication_Parameter_AUTN();
Authentication_Parameter_AUTN(uint8_t iei);
Authentication_Parameter_AUTN(const uint8_t iei, uint8_t *value);
~Authentication_Parameter_AUTN();
//void setValue(uint8_t iei, uint8_t value);
int encode2buffer(uint8_t *buf, int len);
int decodefrombuffer(uint8_t *buf, int len, bool is_option);
uint8_t* getValue();
private:
uint8_t _iei;
uint8_t _value[16];
};
}
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "Authentication_Parameter_RAND.hpp"
#include "logger.hpp"
using namespace nas;
//------------------------------------------------------------------------------
Authentication_Parameter_RAND::Authentication_Parameter_RAND(uint8_t iei) {
_iei = iei;
}
//------------------------------------------------------------------------------
Authentication_Parameter_RAND::Authentication_Parameter_RAND(const uint8_t iei, uint8_t *value) {
_iei = iei;
for (int i = 0; i < 16; i++) {
this->_value[i] = value[i];
}
}
//------------------------------------------------------------------------------
Authentication_Parameter_RAND::Authentication_Parameter_RAND() {
}
//------------------------------------------------------------------------------
Authentication_Parameter_RAND::~Authentication_Parameter_RAND() {
}
//------------------------------------------------------------------------------
uint8_t* Authentication_Parameter_RAND::getValue() {
return _value;
}
//------------------------------------------------------------------------------
int Authentication_Parameter_RAND::encode2buffer(uint8_t *buf, int len) {
Logger::nas_mm().debug("Encoding Authentication_Parameter_RAND IEI (0x%x)", _iei);
if (len < 17) {
Logger::nas_mm().error("len is less than 17");
return 0;
}
int encoded_size = 0;
if (_iei) {
*(buf + encoded_size) = _iei;
encoded_size++;
memcpy((void*) (buf + encoded_size), (void*) _value, 16);
encoded_size += 16;
//int i = 0;
//for (int i = 0; i < 16; i++) {
// *(buf + encoded_size) = _value[i]; encoded_size++;
//}
return encoded_size;
} else {
// *(buf + encoded_size) = length - 1; encoded_size++;
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
}
Logger::nas_mm().debug("Encoded Authentication_Parameter_RAND len (%d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int Authentication_Parameter_RAND::decodefrombuffer(uint8_t *buf, int len, bool is_option) {
Logger::nas_mm().debug("Decoding Authentication_Parameter_RAND IEI (0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
}
for (int i = 0; i < 16; i++) {
_value[i] = *(buf + decoded_size);
decoded_size++;
}
for (int j = 0; j < 16; j++) {
Logger::nas_mm().debug("Decoded Authentication_Parameter_RAND value (0x%2x)", _value[j]);
}
Logger::nas_mm().debug("Decoded Authentication_Parameter_RAND len (%d)", decoded_size);
return decoded_size;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __Authentication_Parameter_RAND_H_
#define __Authentication_Parameter_RAND_H_
#include <stdint.h>
namespace nas {
class Authentication_Parameter_RAND {
public:
Authentication_Parameter_RAND();
Authentication_Parameter_RAND(uint8_t iei);
Authentication_Parameter_RAND(const uint8_t iei, uint8_t *value);
~Authentication_Parameter_RAND();
//void setValue(uint8_t iei, uint8_t value);
int encode2buffer(uint8_t *buf, int len);
int decodefrombuffer(uint8_t *buf, int len, bool is_option);
uint8_t* getValue();
private:
uint8_t _iei;
uint8_t _value[16];
};
}
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "Authentication_Response_Parameter.hpp"
#include "logger.hpp"
using namespace nas;
//------------------------------------------------------------------------------
Authentication_Response_Parameter::Authentication_Response_Parameter(uint8_t iei) {
_iei = iei;
}
//------------------------------------------------------------------------------
Authentication_Response_Parameter::Authentication_Response_Parameter(const uint8_t iei, bstring para) {
_iei = iei;
PARA = bstrcpy(para);
}
//------------------------------------------------------------------------------
Authentication_Response_Parameter::Authentication_Response_Parameter() {
}
//------------------------------------------------------------------------------
Authentication_Response_Parameter::~Authentication_Response_Parameter() {
}
//------------------------------------------------------------------------------
void Authentication_Response_Parameter::getValue(bstring &para) {
para = bstrcpy(PARA);
}
//------------------------------------------------------------------------------
int Authentication_Response_Parameter::encode2buffer(uint8_t *buf, int len) {
Logger::nas_mm().debug("Encoding Authentication_Response_Parameter IEI 0x%x", _iei);
if (len < 18) {
Logger::nas_mm().error("len is less than 18");
return 0;
}
int encoded_size = 0;
if (_iei) {
*(buf + encoded_size) = _iei;
encoded_size++;
*(buf + encoded_size) = 16;
encoded_size++;
int size = encode_bstring(PARA, (buf + encoded_size), len - encoded_size);
encoded_size += size;
return encoded_size;
} else {
// *(buf + encoded_size) = length - 1; encoded_size++;
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
}
Logger::nas_mm().debug("Encoded Authentication_Response_Parameter (len %d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int Authentication_Response_Parameter::decodefrombuffer(uint8_t *buf, int len, bool is_option) {
Logger::nas_mm().debug("Decoding Authentication_Response_Parameter IEI 0x%x", *buf);
int decoded_size = 0;
uint8_t length = 0;
if (is_option) {
decoded_size++;
}
length = *(buf + decoded_size);
decoded_size++;
decode_bstring(&PARA, length, (buf + decoded_size), len - decoded_size);
decoded_size += length;
for (int i = 0; i < length; i++) {
Logger::nas_mm().debug("Decoded NAS_Message_Container value 0x%x", (uint8_t*) PARA->data[i]);
}
Logger::nas_mm().debug("Decoded Authentication_Response_Parameter (len %d)", decoded_size);
return decoded_size;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __Authentication_Response_Parameter_H_
#define __Authentication_Response_Parameter_H_
#include <iostream>
#include <stdint.h>
extern "C" {
#include "bstrlib.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
}
namespace nas {
class Authentication_Response_Parameter {
public:
Authentication_Response_Parameter();
Authentication_Response_Parameter(uint8_t iei);
Authentication_Response_Parameter(const uint8_t iei, bstring para);
~Authentication_Response_Parameter();
//void setValue(uint8_t iei, uint8_t value);
int encode2buffer(uint8_t *buf, int len);
int decodefrombuffer(uint8_t *buf, int len, bool is_option);
void getValue(bstring &para);
private:
uint8_t _iei;
bstring PARA;
};
}
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "DNN.hpp"
#include "logger.hpp"
using namespace nas;
//------------------------------------------------------------------------------
DNN::DNN(uint8_t iei) {
_iei = iei;
}
//------------------------------------------------------------------------------
DNN::DNN(const uint8_t iei, bstring dnn) {
_iei = iei;
_DNN = bstrcpy(dnn);
length = blength(dnn) + 2;
}
//------------------------------------------------------------------------------
DNN::DNN() {
}
//------------------------------------------------------------------------------
DNN::~DNN() {
}
//------------------------------------------------------------------------------
/*void DNN::setValue(uint8_t iei, uint8_t value) {
_iei = iei;
_value = value;
}*/
//------------------------------------------------------------------------------
void DNN::getValue(bstring &dnn) {
//dnn = _DNN;
//dnn = bstrcpy(_DNN);
dnn = blk2bstr((uint8_t*) bdata(_DNN) + 1, blength(_DNN) - 1);
}
//------------------------------------------------------------------------------
int DNN::encode2buffer(uint8_t *buf, int len) {
Logger::nas_mm().debug("Encoding DNN IEI (0x%x)", _iei);
if (len < length) {
Logger::nas_mm().error("len is less than %d", length);
return 0;
}
int encoded_size = 0;
if (_iei) {
*(buf + encoded_size) = _iei;
encoded_size++;
*(buf + encoded_size) = (length - 2);
encoded_size++;
int size = encode_bstring(_DNN, (buf + encoded_size), len - encoded_size);
encoded_size += size;
} else {
*(buf + encoded_size) = (length - 1);
encoded_size++;
int size = encode_bstring(_DNN, (buf + encoded_size), len - encoded_size);
encoded_size += size;
}
Logger::nas_mm().debug("encoded DNN len: %d", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int DNN::decodefrombuffer(uint8_t *buf, int len, bool is_option) {
Logger::nas_mm().debug("Decoding DNN IEI (0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
}
length = *(buf + decoded_size);
decoded_size++;
decode_bstring(&_DNN, length, (buf + decoded_size), len - decoded_size);
decoded_size += length;
for (int i = 0; i < blength(_DNN); i++) {
Logger::nas_mm().debug("Decoded DNN value: 0x%x", (uint8_t*) bdata(_DNN)[i]);
}
Logger::nas_mm().debug("Decoded DNN len: %d", decoded_size);
return decoded_size;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __DNN_H_
#define __DNN_H_
#include <iostream>
#include <stdint.h>
extern "C" {
#include "bstrlib.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
}
namespace nas {
class DNN {
public:
DNN();
DNN(uint8_t iei);
DNN(const uint8_t iei, bstring dnn);
~DNN();
//void setValue(uint8_t iei, uint8_t value);
int encode2buffer(uint8_t *buf, int len);
int decodefrombuffer(uint8_t *buf, int len, bool is_option);
void getValue(bstring &dnn);
private:
uint8_t _iei;
uint8_t length;
bstring _DNN;
};
}
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "EAP_Message.hpp"
#include "logger.hpp"
using namespace nas;
//------------------------------------------------------------------------------
EAP_Message::EAP_Message(uint8_t iei) {
_iei = iei;
}
//------------------------------------------------------------------------------
EAP_Message::EAP_Message(const uint8_t iei, bstring eap) {
_iei = iei;
EAP = bstrcpy(eap);
length = blength(eap) + 3;
}
//------------------------------------------------------------------------------
EAP_Message::EAP_Message() {
}
//------------------------------------------------------------------------------
EAP_Message::~EAP_Message() {
}
//------------------------------------------------------------------------------
void EAP_Message::getValue(bstring &eap) {
eap = bstrcpy(EAP);
}
//------------------------------------------------------------------------------
int EAP_Message::encode2buffer(uint8_t *buf, int len) {
Logger::nas_mm().debug("encoding EAP_Message iei(0x%x)", _iei);
if (len < length) {
Logger::nas_mm().error("len is less than %d", length);
return 0;
}
int encoded_size = 0;
*(buf + encoded_size) = _iei;
encoded_size++;
*(buf + encoded_size) = (length - 3) & 0x00ff;
encoded_size++;
*(buf + encoded_size) = ((length - 3) & 0xff00) >> 8;
encoded_size++;
int size = encode_bstring(EAP, (buf + encoded_size), len - encoded_size);
encoded_size += size;
Logger::nas_mm().debug("encoded EAP_Message len(%d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int EAP_Message::decodefrombuffer(uint8_t *buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding EAP_Message iei(0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
}
length = 0;
length |= *(buf + decoded_size);
decoded_size++;
length |= (*(buf + decoded_size)) << 8;
decoded_size++;
decode_bstring(&EAP, length, (buf + decoded_size), len - decoded_size);
decoded_size += length;
for (int i = 0; i < length; i++) {
Logger::nas_mm().debug("decoded EAP_Message value(0x%x)", (uint8_t*) EAP->data[i]);
}
Logger::nas_mm().debug("decoded EAP_Message len(%d)", decoded_size);
return decoded_size;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __EAP_Message_H_
#define __EAP_Message_H_
#include <iostream>
#include <stdint.h>
extern "C" {
#include "bstrlib.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
}
namespace nas {
class EAP_Message {
public:
EAP_Message();
EAP_Message(uint8_t iei);
EAP_Message(const uint8_t iei, bstring eap);
~EAP_Message();
//void setValue(uint8_t iei, uint8_t value);
int encode2buffer(uint8_t *buf, int len);
int decodefrombuffer(uint8_t *buf, int len, bool is_option);
void getValue(bstring &eap);
private:
uint8_t _iei;
uint16_t length;
bstring EAP;
};
}
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "EPS_Bearer_Context_Status.hpp"
#include "logger.hpp"
using namespace nas;
//------------------------------------------------------------------------------
EPS_Bearer_Context_Status::EPS_Bearer_Context_Status(uint8_t iei) {
_iei = iei;
}
//------------------------------------------------------------------------------
EPS_Bearer_Context_Status::EPS_Bearer_Context_Status(const uint8_t iei, uint16_t value) {
_iei = iei;
_value = value;
length = 4;
}
//------------------------------------------------------------------------------
EPS_Bearer_Context_Status::EPS_Bearer_Context_Status() {
}
//------------------------------------------------------------------------------
EPS_Bearer_Context_Status::~EPS_Bearer_Context_Status() {
}
//------------------------------------------------------------------------------
void EPS_Bearer_Context_Status::setValue(uint8_t iei, uint16_t value) {
_iei = iei;
_value = value;
}
//------------------------------------------------------------------------------
uint16_t EPS_Bearer_Context_Status::getValue() {
return _value;
}
//------------------------------------------------------------------------------
int EPS_Bearer_Context_Status::encode2buffer(uint8_t *buf, int len) {
Logger::nas_mm().debug("encoding EPS_Bearer_Context_Status iei(0x%x)", _iei);
if (len < length) {
Logger::nas_mm().error("len is less than %d", length);
return 0;
}
int encoded_size = 0;
if (_iei) {
*(buf + encoded_size) = _iei;
encoded_size++;
*(buf + encoded_size) = length - 2;
encoded_size++;
*(buf + encoded_size) = (_value & 0x00ff);
encoded_size++;
*(buf + encoded_size) = (_value & 0xff00) >> 8;
encoded_size++;
} else {
//*(buf + encoded_size) = length - 1; encoded_size++;
//*(buf + encoded_size) = _value; encoded_size++; encoded_size++;
}
Logger::nas_mm().debug("encoded EPS_Bearer_Context_Status len(%d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int EPS_Bearer_Context_Status::decodefrombuffer(uint8_t *buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding EPS_Bearer_Context_Status iei(0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
}
_value = 0x0000;
length = *(buf + decoded_size);
decoded_size++;
_value |= *(buf + decoded_size);
decoded_size++;
_value |= (*(buf + decoded_size)) << 8;
decoded_size++;
Logger::nas_mm().debug("decoded EPS_Bearer_Context_Status value(0x%4x)", _value);
Logger::nas_mm().debug("decoded EPS_Bearer_Context_Status len(%d)", decoded_size);
return decoded_size;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __EPS_Bearer_Context_Status_H_
#define __EPS_Bearer_Context_Status_H_
#include <stdint.h>
namespace nas {
class EPS_Bearer_Context_Status {
public:
EPS_Bearer_Context_Status();
EPS_Bearer_Context_Status(uint8_t iei);
EPS_Bearer_Context_Status(const uint8_t iei, uint16_t value);
~EPS_Bearer_Context_Status();
void setValue(uint8_t iei, uint16_t value);
int encode2buffer(uint8_t *buf, int len);
int decodefrombuffer(uint8_t *buf, int len, bool is_option);
uint16_t getValue();
private:
uint8_t _iei;
uint8_t length;
uint16_t _value;
};
}
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "EPS_NAS_Message_Container.hpp"
#include "logger.hpp"
using namespace nas;
//------------------------------------------------------------------------------
EPS_NAS_Message_Container::EPS_NAS_Message_Container(uint8_t iei) {
_iei = iei;
}
//------------------------------------------------------------------------------
EPS_NAS_Message_Container::EPS_NAS_Message_Container(const uint8_t iei, bstring value) {
_iei = iei;
_value = bstrcpy(value);
length = blength(value) + 3;
}
//------------------------------------------------------------------------------
EPS_NAS_Message_Container::EPS_NAS_Message_Container() {
}
//------------------------------------------------------------------------------
EPS_NAS_Message_Container::~EPS_NAS_Message_Container() {
}
//------------------------------------------------------------------------------
void EPS_NAS_Message_Container::setValue(uint8_t iei, uint8_t value) {
_iei = iei;
//_value = value;
}
//------------------------------------------------------------------------------
void EPS_NAS_Message_Container::getValue(bstring &value) {
value = bstrcpy(_value);
}
//------------------------------------------------------------------------------
int EPS_NAS_Message_Container::encode2buffer(uint8_t *buf, int len) {
Logger::nas_mm().debug("encoding EPS_NAS_Message_Container iei(0x%x)", _iei);
if (len < length) {
Logger::nas_mm().error("len is less than %d", length);
return 0;
}
int encoded_size = 0;
if (_iei) {
*(buf + encoded_size) = _iei;
encoded_size++;
*(buf + encoded_size) = (length - 3) & 0x00ff;
encoded_size++;
*(buf + encoded_size) = ((length - 3) & 0xff000) >> 8;
encoded_size++;
int size = encode_bstring(_value, (buf + encoded_size), len - encoded_size);
encoded_size += size;
} else {
// *(buf + encoded_size) = length - 1; encoded_size++;
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
}
Logger::nas_mm().debug("encoded EPS_NAS_Message_Container len(%d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int EPS_NAS_Message_Container::decodefrombuffer(uint8_t *buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding EPS_NAS_Message_Container iei(0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
}
length = 0;
length |= *(buf + decoded_size);
decoded_size++;
length |= (*(buf + decoded_size)) << 8;
decoded_size++;
decode_bstring(&_value, length, (buf + decoded_size), len - decoded_size);
decoded_size += length;
for (int i = 0; i < length; i++) {
Logger::nas_mm().debug("decoded EPS_NAS_Message_Container value(0x%x)", (uint8_t*) _value->data[i]);
}
Logger::nas_mm().debug("decoded EPS_NAS_Message_Container len(%d)", decoded_size);
return decoded_size;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __EPS_NAS_Message_Container_H_
#define __EPS_NAS_Message_Container_H_
#include <iostream>
#include <stdint.h>
extern "C" {
#include "bstrlib.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
}
namespace nas {
class EPS_NAS_Message_Container {
public:
EPS_NAS_Message_Container();
EPS_NAS_Message_Container(uint8_t iei);
EPS_NAS_Message_Container(const uint8_t iei, bstring value);
~EPS_NAS_Message_Container();
void setValue(uint8_t iei, uint8_t value);
int encode2buffer(uint8_t *buf, int len);
int decodefrombuffer(uint8_t *buf, int len, bool is_option);
void getValue(bstring &value);
private:
uint8_t _iei;
uint16_t length;
bstring _value;
};
}
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "EPS_NAS_Security_Algorithms.hpp"
#include "logger.hpp"
#include <iostream>
using namespace nas;
using namespace std;
//------------------------------------------------------------------------------
EPS_NAS_Security_Algorithms::EPS_NAS_Security_Algorithms() {
}
//------------------------------------------------------------------------------
EPS_NAS_Security_Algorithms::~EPS_NAS_Security_Algorithms() {
}
//------------------------------------------------------------------------------
EPS_NAS_Security_Algorithms::EPS_NAS_Security_Algorithms(uint8_t iei, uint8_t ciphering, uint8_t integrity_protection) {
_iei = iei;
CIPHERING = ciphering;
INTEGRITY_PROTECTION = integrity_protection;
}
//------------------------------------------------------------------------------
void EPS_NAS_Security_Algorithms::setCIPHERING(uint8_t value) {
CIPHERING = value;
}
//------------------------------------------------------------------------------
void EPS_NAS_Security_Algorithms::setINTEGRITY_PROTECTION(uint8_t value) {
INTEGRITY_PROTECTION = value;
}
//------------------------------------------------------------------------------
uint8_t EPS_NAS_Security_Algorithms::getCIPHERING() {
return CIPHERING;
}
//------------------------------------------------------------------------------
uint8_t EPS_NAS_Security_Algorithms::getINTEGRITY_PROTECTION() {
return INTEGRITY_PROTECTION;
}
//------------------------------------------------------------------------------
int EPS_NAS_Security_Algorithms::encode2buffer(uint8_t *buf, int len) {
Logger::nas_mm().debug("encoding EPS_NAS_Security_Algorithms iei(0x%x)", _iei);
int encoded_size = 0;
if (len < 2) {
Logger::nas_mm().error("len is less than 2");
return -1;
}
else {
*(buf + encoded_size) = _iei;
encoded_size++;
*(buf + encoded_size) = ((CIPHERING & 0x07) << 4) | (INTEGRITY_PROTECTION & 0x07);
encoded_size++;
Logger::nas_mm().debug("encoded EPS_NAS_Security_Algorithms IE 0x%x", *buf);
}
return encoded_size;
}
//------------------------------------------------------------------------------
int EPS_NAS_Security_Algorithms::decodefrombuffer(uint8_t *buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding EPS_NAS_Security_Algorithms IE");
if (len < 2) {
Logger::nas_mm().error("len is less than 2");
return 0;
} else {
int decoded_size = 0;
decoded_size++;
CIPHERING = (*(buf + decoded_size) & 0x70) >> 4;
INTEGRITY_PROTECTION = *(buf + decoded_size) & 0x07;
decoded_size++;
Logger::nas_mm().debug("decoded NAS_Security_Algorithms len 1 octet,CIPHERING=0x%x,INTEGRITY_PROTECTION=0x%x", CIPHERING, INTEGRITY_PROTECTION);
return decoded_size;
}
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef __EPS_NAS_Security_Algorithms_H
#define __EPS_NAS_Security_Algorithms_H
#include <stdint.h>
namespace nas {
class EPS_NAS_Security_Algorithms {
public:
EPS_NAS_Security_Algorithms();
~EPS_NAS_Security_Algorithms();
EPS_NAS_Security_Algorithms(uint8_t iei, uint8_t ciphering, uint8_t integrity_protection);
void setCIPHERING(uint8_t value);
void setINTEGRITY_PROTECTION(uint8_t value);
uint8_t getCIPHERING();
uint8_t getINTEGRITY_PROTECTION();
int encode2buffer(uint8_t *buf, int len);
int decodefrombuffer(uint8_t *buf, int len, bool is_option);
private:
uint8_t _iei;
uint8_t CIPHERING;
uint8_t INTEGRITY_PROTECTION;
};
}
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include "ExtendedProtocolDiscriminator.hpp"
using namespace nas;
//------------------------------------------------------------------------------
void ExtendedProtocolDiscriminator::setValue(const uint8_t epd) {
m_epd = epd;
}
//------------------------------------------------------------------------------
uint8_t ExtendedProtocolDiscriminator::getValue() {
return m_epd;
}
//------------------------------------------------------------------------------
void ExtendedProtocolDiscriminator::encode2buffer(uint8_t *buf, int len) {
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _EPD_H_
#define _EPD_H_
#include<stdint.h>
namespace nas {
class ExtendedProtocolDiscriminator {
public:
void encode2buffer(uint8_t *buf, int len);
void setValue(const uint8_t epd);
uint8_t getValue();
private:
uint8_t m_epd;
};
}
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment