Commit a8079223 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Manually merge the code from Bupt to OAI code base

parent 82ca64fe
......@@ -30,11 +30,9 @@
#include <boost/uuid/random_generator.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <cstdlib>
#include <iostream>
#include <stdexcept>
#include "itti.hpp"
#include "DLNASTransport.hpp"
#include "amf_config.hpp"
......@@ -42,6 +40,7 @@
#include "amf_n11.hpp"
#include "amf_n2.hpp"
#include "amf_statistics.hpp"
#include "itti.hpp"
#include "ngap_app.hpp"
using namespace ngap;
......
......@@ -32,12 +32,13 @@
#include <map>
#include <shared_mutex>
#include <string>
#include "amf_config.hpp"
#include "amf_module_from_config.hpp"
#include "amf_profile.hpp"
#include "itti.hpp"
#include "itti_msg_amf_app.hpp"
#include "ue_context.hpp"
#include "itti.hpp"
using namespace config;
......
......@@ -28,25 +28,25 @@
#include "amf_config.hpp"
#include <iostream>
#include <libconfig.h++>
#include "string.hpp"
#include "thread_sched.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <iostream>
#include <libconfig.h++>
#include "3gpp_ts24501.hpp"
#include "amf_app.hpp"
#include "if.hpp"
#include "logger.hpp"
#include "string.hpp"
#include "thread_sched.hpp"
extern "C" {
#include <arpa/inet.h>
#include <stdbool.h>
#include <string.h>
#include <sys/types.h>
#include "common_defs.h"
}
......
......@@ -29,14 +29,15 @@
#ifndef _AMF_CONFIG_H_
#define _AMF_CONFIG_H_
#include "amf_config.hpp"
#include <arpa/inet.h>
#include <libconfig.h++>
#include <netinet/in.h>
#include <sys/socket.h>
#include <vector>
#include <libconfig.h++>
#include <string>
#include <vector>
#include "amf_config.hpp"
#include "thread_sched.hpp"
#define AMF_CONFIG_STRING_AMF_CONFIG "AMF"
......
......@@ -91,7 +91,8 @@ int amf_modules::load(const std::string& config_file) {
//------------------------------------------------------------------------------
void amf_modules::display() {
Logger::config().info("============ AMF Registered Modules ============");
Logger::config().info(
"============ AMF Registered Modules ============");
Logger::config().info("NGAP Message Modules:");
Logger::config().info(
"- %s(Procedure code %d, Type of Msg %d)\n", msgName.c_str(),
......
This diff is collapsed.
......@@ -32,6 +32,7 @@
#include <mysql/mysql.h>
#include <stdlib.h>
#include <string.h>
#include <map>
#include <shared_mutex>
......@@ -68,8 +69,8 @@ class amf_n1 {
SecurityHeaderType type, std::shared_ptr<nas_context> nc,
uint32_t ran_ue_ngap_id, long amf_ue_ngap_id, bstring plain_msg,
std::string snn, uint8_t ulCount);
// void uplink_nas_msg_handle(uint32_t ran_ue_ngap_id, long amf_ue_ngap_id,
// bstring plain_msg);
void uplink_nas_msg_handle(
uint32_t ran_ue_ngap_id, long amf_ue_ngap_id, bstring plain_msg);
void uplink_nas_msg_handle(
uint32_t ran_ue_ngap_id, long amf_ue_ngap_id, bstring plain_msg,
plmn_t plmn);
......@@ -111,7 +112,7 @@ class amf_n1 {
bool get_authentication_vectors_from_ausf(std::shared_ptr<nas_context>& nc);
bool _5g_aka_confirmation_from_ausf(
std::shared_ptr<nas_context>& nc, std::string& resStar);
std::shared_ptr<nas_context>& nc, bstring resStar);
bool authentication_vectors_generator_in_ausf(
std::shared_ptr<nas_context>& nc);
......@@ -176,6 +177,8 @@ class amf_n1 {
uint32_t ran_ue_ngap_id, long amf_ue_ngap_id, bstring nas);
void ul_nas_transport_handle(
uint32_t ran_ue_ngap_id, long amf_ue_ngap_id, bstring nas, plmn_t plmn);
void registration_complete_handle(
uint32_t ran_ue_ngap_id, long amf_ue_ngap_id, bstring nas_msg);
void sha256(unsigned char* message, int msg_len, unsigned char* output);
void service_request_handle(
bool isNasSig, std::shared_ptr<nas_context> nc, uint32_t ran_ue_ngap_id,
......
......@@ -29,6 +29,7 @@
#include "amf_n11.hpp"
#include <curl/curl.h>
#include <nlohmann/json.hpp>
#include "3gpp_ts24501.hpp"
......@@ -293,6 +294,10 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer& smf) {
uint8_t pti = sm_msg[2];
Logger::amf_n11().debug(
"Decoded PTI for PDUSessionEstablishmentRequest(0x%x)", pti);
psc.get()->isn2sm_avaliable = false;
handle_pdu_session_initial_request(
supi, psc, smf_addr, smf_api_version, smf.sm_msg, dnn);
/*
if (psc.get()->isn1sm_avaliable && psc.get()->isn2sm_avaliable) {
// TODO: should be removed
itti_n1n2_message_transfer_request* itti_msg =
......@@ -322,6 +327,7 @@ void amf_n11::handle_itti_message(itti_smf_services_consumer& smf) {
handle_pdu_session_initial_request(
supi, psc, smf_addr, smf_api_version, smf.sm_msg, dnn);
}
*/
} break;
case EXISTING_PDU_SESSION: {
// TODO:
......@@ -582,6 +588,14 @@ void amf_n11::curl_http_client(
// free curl before returning
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
// TODO: To be verified
psc.get()->smf_context_location =
"/nsmf-pdusession/v2/sm-contexts/1"; // try to fix bugs for
// no-response from SMF when
// requesting
// /nsmf-pdusession/v2/sm-contexts
// (first pdu session
// establishment request)
return;
}
......@@ -875,7 +889,7 @@ bool amf_n11::send_ue_authentication_request(
} else {
Logger::amf_n11().warn(
"UE Authentication, could not get response from NRF");
"UE Authentication, could not get response from AUSF");
return false;
}
......
......@@ -33,10 +33,10 @@
#include <shared_mutex>
#include <string>
#include "itti_msg_n11.hpp"
#include "pdu_session_context.hpp"
#include "AuthenticationInfo.h"
#include "UEAuthenticationCtx.h"
#include "itti_msg_n11.hpp"
#include "pdu_session_context.hpp"
namespace amf_application {
......
......@@ -316,7 +316,7 @@ void amf_n2::handle_itti_message(itti_ng_setup_request& itti_msg) {
NGSetupResponseMsg ngSetupResp;
ngSetupResp.setMessageType();
ngSetupResp.setAMFName(amf_cfg.AMF_Name);
ngSetupResp.setRelativeAmfCapacity(amf_cfg.relativeAMFCapacity);
// ngSetupResp.setRelativeAmfCapacity(amf_cfg.relativeAMFCapacity);
std::vector<struct GuamiItem_s> guami_list;
for (int i = 0; i < amf_cfg.guami_list.size(); i++) {
struct GuamiItem_s tmp;
......@@ -329,6 +329,7 @@ void amf_n2::handle_itti_message(itti_ng_setup_request& itti_msg) {
guami_list.push_back(tmp);
}
ngSetupResp.setGUAMIList(guami_list);
ngSetupResp.setRelativeAmfCapacity(amf_cfg.relativeAMFCapacity);
std::vector<PlmnSliceSupport_t> plmn_list;
for (int i = 0; i < amf_cfg.plmn_list.size(); i++) {
PlmnSliceSupport_t tmp;
......@@ -725,7 +726,7 @@ void amf_n2::handle_itti_message(itti_initial_context_setup_request& itti_msg) {
PDUSessionResourceSetupRequestItem_t item;
item.pduSessionId = itti_msg.pdu_session_id;
item.s_nssai.sst = "01";
item.s_nssai.sd = "";
item.s_nssai.sd = "None";
item.pduSessionNAS_PDU = NULL;
if (itti_msg.isn2sm_avaliable) {
bstring n2sm = itti_msg.n2sm;
......@@ -745,7 +746,7 @@ void amf_n2::handle_itti_message(itti_initial_context_setup_request& itti_msg) {
}
}
uint8_t buffer[10000];
uint8_t buffer[20000];
int encoded_size = msg->encode2buffer(buffer, 10000);
bstring b = blk2bstr(buffer, encoded_size);
sctp_s_38412.sctp_send_msg(
......@@ -783,8 +784,8 @@ void amf_n2::handle_itti_message(
nas_pdu[blength(itti_msg.nas)] = '\0';
item.pduSessionNAS_PDU = nas_pdu;
item.sizeofpduSessionNAS_PDU = blength(itti_msg.nas);
item.s_nssai.sst = "01"; // TODO: get from N1N2msgTranferMsg
item.s_nssai.sd = ""; // TODO: get from N1N2msgTranferMsg
item.s_nssai.sst = "01"; // TODO: get from N1N2msgTranferMsg
item.s_nssai.sd = "none"; // TODO: get from N1N2msgTranferMsg
// Get NSSAI from PDU Session Context
std::shared_ptr<nas_context> nc;
......@@ -814,7 +815,7 @@ void amf_n2::handle_itti_message(
item.pduSessionResourceSetupRequestTransfer.size = blength(itti_msg.n2sm);
list.push_back(item);
psrsr->setPduSessionResourceSetupRequestList(list);
psrsr->setUEAggregateMaxBitRate(0x08a7d8c0, 0x20989680);
size_t buffer_size = BUFFER_SIZE_512;
char* buffer = (char*) calloc(1, buffer_size);
int encoded_size = 0;
......
......@@ -33,12 +33,11 @@
#include "HandoverCommandMsg.hpp"
#include "HandoverRequest.hpp"
#include "PduSessionResourceReleaseCommand.hpp"
#include "amf.hpp"
#include "itti_msg_n2.hpp"
#include "ngap_app.hpp"
#include "ue_ngap_context.hpp"
#include "amf.hpp"
namespace amf_application {
class amf_n2 : public ngap::ngap_app {
......
......@@ -27,11 +27,12 @@
\email: Tien-Thinh.Nguyen@eurecom.fr
*/
#include "amf_profile.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include "logger.hpp"
#include "amf_profile.hpp"
#include "string.hpp"
using namespace std;
......
......@@ -32,6 +32,7 @@
#include <arpa/inet.h>
#include <netinet/in.h>
#include <map>
#include <memory>
#include <nlohmann/json.hpp>
......@@ -39,9 +40,9 @@
#include <utility>
#include <vector>
#include "logger.hpp"
#include "amf.hpp"
#include "3gpp_29.510.h"
#include "amf.hpp"
#include "logger.hpp"
namespace amf_application {
......
......@@ -31,6 +31,7 @@
#include <mysql/mysql.h>
#include <pthread.h>
#include <string>
#define KEY_LENGTH (16)
......
......@@ -3,9 +3,9 @@
* 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
* 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
*
......@@ -29,30 +29,19 @@
#define FILE_3GPP_23_003_SEEN
#include <stdint.h>
#include <string>
typedef struct s_nssai // section 28.4, TS23.003
{
uint8_t sST;
//uint32_t sD:24;
// uint32_t sD:24;
std::string sD;
//s_nssai(const uint8_t& sst, const uint32_t sd) : sST(sst), sD(sd) {}
s_nssai(const uint8_t &sst, const std::string sd)
:
sST(sst),
sD(sd) {
}
s_nssai()
:
sST(),
sD() {
}
s_nssai(const s_nssai &p)
:
sST(p.sST),
sD(p.sD) {
}
bool operator==(const struct s_nssai &s) const {
// s_nssai(const uint8_t& sst, const uint32_t sd) : sST(sst), sD(sd) {}
s_nssai(const uint8_t& sst, const std::string sd) : sST(sst), sD(sd) {}
s_nssai() : sST(), sD() {}
s_nssai(const s_nssai& p) : sST(p.sST), sD(p.sD) {}
bool operator==(const struct s_nssai& s) const {
if ((s.sST == this->sST) && (s.sD.compare(this->sD) == 0)) {
return true;
} else {
......@@ -63,45 +52,47 @@ typedef struct s_nssai // section 28.4, TS23.003
} snssai_t;
typedef struct plmn_s {
std::string mcc;
std::string mnc;
std::string mcc;
std::string mnc;
} plmn_t;
#define INVALID_TAC_0000 (uint16_t) 0x0000
#define INVALID_TAC_FFFE (uint16_t) 0xFFFE
#define INVALID_TAC (uint32_t) 0x00000000
#define INVALID_TAC_0000 (uint16_t)0x0000
#define INVALID_TAC_FFFE (uint16_t)0xFFFE
#define INVALID_TAC (uint32_t)0x00000000
#define INVALID_TMSI UINT32_MAX /*!< \brief The network shall not allocate a TMSI with all 32 bits equal to 1
(this is because the TMSI must be stored in the SIM, and the SIM uses 4 octets with all bits
equal to 1 to indicate that no valid TMSI is available). */
#define INVALID_TMSI \
UINT32_MAX /*!< \brief The network shall not allocate a TMSI with all 32 \
bits equal to 1 (this is because the TMSI must be stored in \
the SIM, and the SIM uses 4 octets with all bits \
equal to 1 to indicate that no valid TMSI is \
available). */
typedef uint16_t tac_t;
typedef struct tai_s {
plmn_t plmn; /*!< \brief <MCC> + <MNC> */
tac_t tac; /*!< \brief Tracking Area Code */
tac_t tac; /*!< \brief Tracking Area Code */
} tai_t;
typedef struct eci_s {
uint32_t gnb_id :20;
uint32_t cell_id :8;
uint32_t empty :4;
uint32_t gnb_id : 20;
uint32_t cell_id : 8;
uint32_t empty : 4;
} ci_t;
typedef struct cgi_s {
plmn_t plmn;
ci_t cell_identity; //28 bits
ci_t cell_identity; // 28 bits
} cgi_t;
typedef struct nr_tai_s /*5G ADD it*/
{
plmn_t plmn;
uint32_t tac :24;
uint32_t tac : 24;
} nr_tai_t;
typedef struct nr_cell_identity_s /*5G ADD it */
{
uint32_t gnb_id;
uint8_t cell_id :4;
uint8_t cell_id : 4;
} nr_cell_identity_t;
typedef struct nr_cgi_s /*5G ADD it */
......@@ -112,34 +103,34 @@ typedef struct nr_cgi_s /*5G ADD it */
typedef struct fiveG_s_tmsi_s /*5G ADD it */
{
uint16_t amf_set_id :10;
uint8_t amf_pointer :6;
uint32_t fiveG_s_tmsi; //32
uint16_t amf_set_id : 10;
uint8_t amf_pointer : 6;
uint32_t fiveG_s_tmsi; // 32
} fiveG_s_tmsi_t;
typedef struct fiveG_s_gua_s /*5G ADD it */
{
plmn_t plmn;
uint8_t region_id;
uint16_t amf_set_id :10;
uint8_t amf_pointer :6;
uint16_t amf_set_id : 10;
uint8_t amf_pointer : 6;
} fiveG_s_gua_t;
typedef struct amf_set_id_s /*5G ADD it*/
{
uint16_t amf_set_id :10;
uint16_t amf_set_id : 10;
} amf_set_id_t;
typedef struct allowed_nssai /*5G ADD it*/
{
uint8_t sST;
uint32_t sD :24;
uint32_t sD : 24;
} allowed_nssai;
typedef struct allowed_nssai_s /*5G ADD it*/
{
allowed_nssai *s_nssai;
allowed_nssai* s_nssai;
uint32_t count;
} allowed_nssai_t;
......@@ -148,5 +139,4 @@ typedef struct guami_5g_s {
std::string amf_id;
} guami_5g_t;
#endif
This diff is collapsed.
......@@ -23,6 +23,7 @@
#define FILE_3GPP_29_510_NRF_SEEN
#include <vector>
#include "3gpp_23.003.h"
enum class nf_status_e { REGISTERED = 0, SUSPENDED = 1, UNDISCOVERABLE = 2 };
......
......@@ -29,9 +29,10 @@
#ifndef _PRINT_BUFFER_H
#define _PRINT_BUFFER_H
#include "logger.hpp"
#include <string>
#include "logger.hpp"
//------------------------------------------------------------------------------
void print_buffer(
const std::string app, const std::string commit, uint8_t* buf, int len) {
......
......@@ -26,12 +26,12 @@
*/
#include "conversions.hpp"
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <arpa/inet.h>
#include <ctype.h>
#include <inttypes.h>
#include <arpa/inet.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
static const char hex_to_ascii_table[16] = {
'0', '1', '2', '3', '4', '5', '6', '7',
......
......@@ -28,9 +28,10 @@
#ifndef FILE_CONVERSIONS_HPP_SEEN
#define FILE_CONVERSIONS_HPP_SEEN
#include <netinet/in.h>
#include <stdint.h>
#include <string>
#include <netinet/in.h>
/* Used to format an uint32_t containing an ipv4 address */
#define IN_ADDR_FMT "%u.%u.%u.%u"
......
......@@ -29,12 +29,12 @@
#ifndef FILE_ENDPOINT_HPP_SEEN
#define FILE_ENDPOINT_HPP_SEEN
#include "conversions.hpp"
#include <arpa/inet.h>
#include <inttypes.h>
#include <sys/socket.h>
#include <string.h>
#include <sys/socket.h>
#include "conversions.hpp"
class endpoint {
public:
......
......@@ -26,12 +26,13 @@
*/
#include "logger.hpp"
#include "spdlog/sinks/syslog_sink.h"
#include <iostream>
#include <memory>
#include <sstream>
#include <string>
#include <memory>
#include "spdlog/sinks/syslog_sink.h"
Logger* Logger::m_singleton = NULL;
......
......@@ -30,11 +30,12 @@
#define _GNB_CONTEXT_H_
#include <stdint.h>
#include <string>
#include <vector>
#include "sctp_server.hpp"
#include "NgapIEsStruct.hpp"
#include "sctp_server.hpp"
extern "C" {
#include "Ngap_PagingDRX.h"
......
......@@ -31,7 +31,9 @@
//------------------------------------------------------------------------------
nas_context::nas_context() : _vector(), _5g_he_av(), _5g_av(), kamf() {
security_ctx = nullptr;
is_imsi_present = false;
is_stacs_available = false;
is_auth_vectors_present = false;
auts = nullptr;
ctx_avaliability_ind = false;
amf_ue_ngap_id = 0;
......@@ -59,6 +61,7 @@ nas_context::nas_context() : _vector(), _5g_he_av(), _5g_av(), kamf() {
is_5g_guti_present = false;
is_auth_vectors_present = false;
to_be_register_by_new_suci = false;
ueSecurityCaplen = 0;
}
//------------------------------------------------------------------------------
......
......@@ -30,12 +30,13 @@
#define _AMF_NAS_CONTEXT_H_
#include <stdint.h>
#include <string>
#include "struct.hpp"
#include "authentication_algorithms_with_5gaka.hpp"
#include "nas_security_context.hpp"
#include "security_def.hpp"
#include "authentication_algorithms_with_5gaka.hpp"
#include "struct.hpp"
typedef enum {
_5GMM_STATE_MIN = 0,
......@@ -73,6 +74,7 @@ class nas_context {
// mobility identity: imsi, supi, 5g-guti, etc
std::string imsi;
uint8_t mmCapability;
uint8_t ueSecurityCaplen;
uint8_t ueSecurityCapEnc;
uint8_t ueSecurityCapInt;
std::vector<nas::SNSSAI_t> requestedNssai;
......
......@@ -30,8 +30,9 @@
#define _PDU_SESSION_CONTEXT_H_
#include <string>
#include "bstrlib.h"
#include "amf.hpp"
#include "bstrlib.h"
class pdu_session_context {
public:
......
......@@ -30,6 +30,7 @@
#define _UE_CONTEXT_H_
#include <stdint.h>
#include <map>
#include <memory>
#include <mutex>
......
......@@ -30,6 +30,7 @@
#define _UE_NGAP_CONTEXT_H_
#include <stdint.h>
#include <map>
#include "gNB_context.hpp"
......
......@@ -24,16 +24,19 @@
\date 2018
\email: lionel.gauthier@eurecom.fr
*/
#include "logger.hpp"
#include "itti.hpp"
#include "common_defs.h"
#include <signal.h>
#include <sys/epoll.h>
#include <sys/eventfd.h>
#include <signal.h>
#include <time.h>
#include <algorithm>
#include <csignal>
#include "common_defs.h"
#include "logger.hpp"
extern itti_mw* itti_inst;
static itti_timer null_timer(
......
......@@ -30,13 +30,15 @@
#include <chrono>
#include <condition_variable>
//#include <iomanip>
#include <stdint.h>
#include <iostream>
#include <memory>
#include <mutex>
#include <queue>
#include <set>
#include <stdint.h>
#include <thread>
#include "itti_msg.hpp"
#include "thread_sched.hpp"
......
......@@ -26,6 +26,7 @@
\email: lionel.gauthier@eurecom.fr
*/
#include "itti_msg.hpp"
#include "itti.hpp"
extern itti_mw* itti_inst;
......
......@@ -28,6 +28,7 @@
#define SRC_ITTI_ITTI_MSG_HPP_INCLUDED_
#include <stdint.h>
#include <utility>
typedef enum {
......
......@@ -22,9 +22,10 @@
#ifndef _AMF_APP_ITTI_H_
#define _AMF_APP_ITTI_H_
#include "itti_msg.hpp"
#include "NgapIEsStruct.hpp"
#include <string>
#include "NgapIEsStruct.hpp"
#include "itti_msg.hpp"
using namespace ngap;
#include "bstrlib.h"
......
......@@ -22,11 +22,12 @@
#ifndef _ITTI_N11_MSG_H_
#define _ITTI_N11_MSG_H_
#include "bstrlib.h"
#include "itti_msg.hpp"
#include <string>
#include "amf.hpp"
#include "amf_profile.hpp"
#include "bstrlib.h"
#include "itti_msg.hpp"
class itti_msg_n11 : public itti_msg {
public:
......
......@@ -18,4 +18,3 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
......@@ -22,18 +22,18 @@
#ifndef _ITTI_MSG_N2_H_
#define _ITTI_MSG_N2_H_
#include "itti_msg.hpp"
#include "NGSetupRequest.hpp"
#include "NGReset.hpp"
#include "HandoverNotifyMsg.hpp"
#include "HandoverRequestAck.hpp"
#include "HandoverRequiredMsg.hpp"
#include "InitialUEMessage.hpp"
#include "UplinkNASTransport.hpp"
#include "NGReset.hpp"
#include "NGSetupRequest.hpp"
#include "UEContextReleaseRequest.hpp"
#include "UERadioCapabilityInfoIndication.hpp"
#include "sctp_server.hpp"
#include "HandoverRequestAck.hpp"
#include "HandoverRequiredMsg.hpp"
#include "HandoverNotifyMsg.hpp"
#include "UplinkNASTransport.hpp"
#include "UplinkRANStatusTransfer.hpp"
#include "itti_msg.hpp"
#include "sctp_server.hpp"
using namespace ngap;
using namespace sctp;
......
......@@ -26,64 +26,64 @@
\email: contact@openairinterface.org
*/
#include "nas_mm_plain_header.hpp"
#include "5GSRegistrationType.hpp"
#include "_5GSDeregistrationType.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 "5GSMobilityIdentity.hpp"
#include "5GSRegistrationType.hpp"
#include "ABBA.hpp"
#include "Authentication_Parameter_RAND.hpp"
#include "Additional_5G_Security_Information.hpp"
#include "Additional_Information.hpp"
#include "Allowed_PDU_Session_Status.hpp"
#include "Authentication_Failure_Parameter.hpp"
#include "Authentication_Parameter_AUTN.hpp"
#include "Authentication_Parameter_RAND.hpp"
#include "Authentication_Response_Parameter.hpp"
#include "Authentication_Failure_Parameter.hpp"
#include "NAS_Security_Algorithms.hpp"
#include "IMEISV_Request.hpp"
#include "DNN.hpp"
#include "EAP_Message.hpp"
#include "EPS_Bearer_Context_Status.hpp"
#include "EPS_NAS_Message_Container.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 "Extended_DRX_Parameters.hpp"
#include "GPRS_Timer_2.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 "IMEISV_Request.hpp"
#include "LADN_Indication.hpp"
#include "MA_PDU_Session_Information.hpp"
#include "MICO_Indication.hpp"
#include "NAS_Message_Container.hpp"
#include "NAS_Security_Algorithms.hpp"
#include "NSSAI.hpp"
#include "NSSAI_Inclusion_Mode.hpp"
#include "NasKeySetIdentifier.hpp"
#include "Network_Slicing_Indication.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 "PDU_Session_Reactivation_Result.hpp"
#include "PDU_Session_Reactivation_Result_Error_Cause.hpp"
#include "PDU_Session_Status.hpp"
#include "PLMN_List.hpp"
#include "Payload_Container.hpp"
#include "Payload_Container_Type.hpp"
#include "Rejected_NSSAI.hpp"
#include "Release_Assistance_Indication.hpp"
#include "Request_Type.hpp"
#include "S1_UE_Security_Capability.hpp"
#include "SOR_Transparent_Container.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 "UENetworkCapability.hpp"
#include "UES_Usage_Setting.hpp"
#include "UESecurityCapability.hpp"
#include "UE_Radio_Capability_ID.hpp"
#include "UE_Status.hpp"
#include "UplinkDataStatus.hpp"
#include "_5GMM_Cause.hpp"
#include "_5GSDeregistrationType.hpp"
#include "_5GSTrackingAreaIdList.hpp"
#include "_5GS_DRX_arameters.hpp"
#include "_5GS_Identity_Type.hpp"
#include "_5GS_Network_Feature_Support.hpp"
#include "_5GS_Registration_Result.hpp"
#include "_5GS_Tracking_Area_Identity.hpp"
#include "_5GS_Update_Type.hpp"
#include "nas_mm_plain_header.hpp"
#include "struct.hpp"
......@@ -27,6 +27,7 @@
*/
#include "5GMMCapability.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,9 +27,11 @@
*/
#include "5GSMobilityIdentity.hpp"
#include <math.h>
#include "3gpp_ts24501.hpp"
#include "String2Value.hpp"
#include <math.h>
#include "logger.hpp"
using namespace nas;
......
......@@ -28,13 +28,15 @@
#ifndef _5GSMobilityIdentity_H_
#define _5GSMobilityIdentity_H_
#include <iostream>
#include <stdint.h>
#include <iostream>
#include "struct.hpp"
extern "C" {
#include "bstrlib.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
#include "TLVEncoder.h"
#include "bstrlib.h"
}
using namespace std;
......
......@@ -27,6 +27,7 @@
*/
#include "5GSRegistrationType.hpp"
#include "3gpp_ts24501.hpp"
#include "logger.hpp"
......
......@@ -27,6 +27,7 @@
*/
#include "ABBA.hpp"
#include "logger.hpp"
using namespace nas;
......@@ -102,8 +103,9 @@ int ABBA::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
if (is_option) {
decoded_size++;
}
_length = 0x00;
_length = *(buf + decoded_size);
_length = 0x00;
_value[255] = {};
_length = *(buf + decoded_size);
decoded_size++;
int i = 0;
uint8_t Length = _length;
......
......@@ -27,6 +27,7 @@
*/
#include "Additional_5G_Security_Information.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "Additional_Information.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "Allowed_PDU_Session_Status.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "Authentication_Failure_Parameter.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -28,12 +28,13 @@
#ifndef __Authentication_Failure_Parameter_H_
#define __Authentication_Failure_Parameter_H_
#include <iostream>
#include <stdint.h>
#include <iostream>
extern "C" {
#include "bstrlib.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
#include "TLVEncoder.h"
#include "bstrlib.h"
}
namespace nas {
......
......@@ -27,6 +27,7 @@
*/
#include "Authentication_Parameter_AUTN.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "Authentication_Parameter_RAND.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "Authentication_Response_Parameter.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -28,12 +28,13 @@
#ifndef __Authentication_Response_Parameter_H_
#define __Authentication_Response_Parameter_H_
#include <iostream>
#include <stdint.h>
#include <iostream>
extern "C" {
#include "bstrlib.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
#include "TLVEncoder.h"
#include "bstrlib.h"
}
namespace nas {
......
......@@ -27,6 +27,7 @@
*/
#include "DNN.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -28,12 +28,13 @@
#ifndef __DNN_H_
#define __DNN_H_
#include <iostream>
#include <stdint.h>
#include <iostream>
extern "C" {
#include "bstrlib.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
#include "TLVEncoder.h"
#include "bstrlib.h"
}
namespace nas {
......
......@@ -27,6 +27,7 @@
*/
#include "EAP_Message.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -29,12 +29,13 @@
#ifndef __EAP_Message_H_
#define __EAP_Message_H_
#include <iostream>
#include <stdint.h>
#include <iostream>
extern "C" {
#include "bstrlib.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
#include "TLVEncoder.h"
#include "bstrlib.h"
}
namespace nas {
......
......@@ -27,6 +27,7 @@
*/
#include "EPS_Bearer_Context_Status.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -26,6 +26,7 @@
\email: contact@openairinterface.org
*/
#include "EPS_NAS_Message_Container.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,12 +27,13 @@
*/
#ifndef __EPS_NAS_Message_Container_H_
#define __EPS_NAS_Message_Container_H_
#include <iostream>
#include <stdint.h>
#include <iostream>
extern "C" {
#include "bstrlib.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
#include "TLVEncoder.h"
#include "bstrlib.h"
}
namespace nas {
......
......@@ -26,8 +26,10 @@
\email: contact@openairinterface.org
*/
#include "EPS_NAS_Security_Algorithms.hpp"
#include "logger.hpp"
#include <iostream>
#include "logger.hpp"
using namespace nas;
using namespace std;
......
......@@ -26,6 +26,7 @@
\email: contact@openairinterface.org
*/
#include "Extended_DRX_Parameters.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "GPRS_Timer_2.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "GPRS_Timer_3.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "IMEISV_Request.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "LADN_Indication.hpp"
#include "logger.hpp"
using namespace nas;
......
/*
/*
* 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.
......@@ -28,13 +28,14 @@
#ifndef __LADN_Indication_H_
#define __LADN_Indication_H_
#include <stdint.h>
#include <iostream>
#include <vector>
#include <stdint.h>
extern "C" {
#include "bstrlib.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
#include "TLVEncoder.h"
#include "bstrlib.h"
}
using namespace std;
namespace nas {
......
......@@ -27,6 +27,7 @@
*/
#include "MA_PDU_Session_Information.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "MICO_Indication.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "NAS_Message_Container.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -28,12 +28,13 @@
#ifndef __NAS_Message_Container_H_
#define __NAS_Message_Container_H_
#include <iostream>
#include <stdint.h>
#include <iostream>
extern "C" {
#include "bstrlib.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
#include "TLVEncoder.h"
#include "bstrlib.h"
}
namespace nas {
......
......@@ -27,8 +27,10 @@
*/
#include "NAS_Security_Algorithms.hpp"
#include "logger.hpp"
#include <iostream>
#include "logger.hpp"
using namespace nas;
using namespace std;
......
......@@ -27,7 +27,9 @@
*/
#include "NSSAI.hpp"
#include <vector>
#include "logger.hpp"
using namespace nas;
using namespace std;
......
......@@ -28,9 +28,11 @@
#ifndef __NSSAI_H_
#define __NSSAI_H_
#include <stdint.h>
#include <vector>
#include "nas_ie_header.hpp"
#include <stdint.h>
namespace nas {
class NSSAI {
......
......@@ -27,6 +27,7 @@
*/
#include "NSSAI_Inclusion_Mode.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "NasKeySetIdentifier.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "Network_Slicing_Indication.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "Non_3GPP_NW_Provided_Policies.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "PDU_Session_Identity_2.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "PDU_Session_Reactivation_Result.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "PDU_Session_Reactivation_Result_Error_Cause.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,8 +27,9 @@
*/
#include "PDU_Session_Status.hpp"
#include "logger.hpp"
#include "common_defs.h"
#include "logger.hpp"
using namespace nas;
//------------------------------------------------------------------------------
......@@ -79,10 +80,10 @@ int PDU_Session_Status::encode2buffer(uint8_t* buf, int len) {
encoded_size++;
*(buf + encoded_size) = length - 2;
encoded_size++;
*(buf + encoded_size) = (_value & 0xff00) >> 8;
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++;
......
......@@ -27,6 +27,7 @@
*/
#include "PLMN_List.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "Payload_Container.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -28,14 +28,16 @@
#ifndef __Payload_Container_H_
#define __Payload_Container_H_
#include <iostream>
#include <stdint.h>
#include <iostream>
#include <vector>
#include "nas_ie_header.hpp"
extern "C" {
#include "bstrlib.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
#include "TLVEncoder.h"
#include "bstrlib.h"
}
namespace nas {
class Payload_Container {
......
......@@ -27,6 +27,7 @@
*/
#include "Payload_Container_Type.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "Rejected_NSSAI.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "Release_Assistance_Indication.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "Request_Type.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,8 +27,10 @@
*/
#include "S1_UE_Security_Capability.hpp"
#include "logger.hpp"
#include <iostream>
#include "logger.hpp"
using namespace nas;
using namespace std;
......
......@@ -27,6 +27,7 @@
*/
#include "SOR_Transparent_Container.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "S_NSSAI.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -30,6 +30,7 @@
#define __S_NSSAI_H_
#include <stdint.h>
#include "nas_ie_header.hpp"
namespace nas {
......
......@@ -27,8 +27,10 @@
*/
#include "UENetworkCapability.hpp"
#include "logger.hpp"
#include <iostream>
#include "logger.hpp"
using namespace nas;
using namespace std;
......
......@@ -27,6 +27,7 @@
*/
#include "UES_Usage_Setting.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "UESecurityCapability.hpp"
#include "logger.hpp"
using namespace nas;
......@@ -55,7 +56,7 @@ UESecurityCapability::UESecurityCapability(
_iei = iei;
_5g_EASel = _5gg_EASel;
_5g_IASel = _5gg_IASel;
length = 4;
length = 2;
}
//------------------------------------------------------------------------------
......@@ -78,6 +79,22 @@ uint8_t UESecurityCapability::getIASel() {
return _5g_IASel;
}
//------------------------------------------------------------------------------
void UESecurityCapability::setLenght(uint8_t len) {
if ((len > 0) && (len <= 4)) {
length = len;
} else {
Logger::nas_mm().debug("Set UESecurityCapability Lenght faile %d", len);
Logger::nas_mm().debug(
"UESecurityCapability Lenght is set to the default value %d", length);
}
}
//------------------------------------------------------------------------------
uint8_t UESecurityCapability::getLenght() {
return length;
}
//------------------------------------------------------------------------------
int UESecurityCapability::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("Encoding UESecurityCapability IEI 0x%x", _iei);
......@@ -89,19 +106,32 @@ int UESecurityCapability::encode2buffer(uint8_t* buf, int len) {
if (_iei) {
*(buf + encoded_size) = _iei;
encoded_size++;
*(buf + encoded_size) = length - 2;
*(buf + encoded_size) = length;
encoded_size++;
*(buf + encoded_size) = _5g_EASel;
encoded_size++;
*(buf + encoded_size) = _5g_IASel;
encoded_size++;
if (length == 4) {
*(buf + encoded_size) = 0xf0;
encoded_size++;
*(buf + encoded_size) = 0xf0;
encoded_size++;
}
} else {
*(buf + encoded_size) = length - 2;
*(buf + encoded_size) = length;
encoded_size++;
*(buf + encoded_size) = _5g_EASel;
encoded_size++;
*(buf + encoded_size) = _5g_IASel;
encoded_size++;
if (length == 4) {
*(buf + encoded_size) = 0xf0;
encoded_size++;
*(buf + encoded_size) = 0xf0;
encoded_size++;
}
}
Logger::nas_mm().debug("encoded UESecurityCapability (len %d)", encoded_size);
return encoded_size;
......@@ -121,6 +151,7 @@ int UESecurityCapability::decodefrombuffer(
decoded_size++;
_5g_IASel = *(buf + decoded_size);
decoded_size++;
if (length == 4) decoded_size += 2; // to do: decoding EEA EIA
Logger::nas_mm().debug(
"UESecurityCapability EA 0x%d,IA 0x%d", _5g_EASel, _5g_IASel);
return decoded_size;
......
......@@ -44,6 +44,8 @@ class UESecurityCapability {
void setIASel(uint8_t sel);
uint8_t getEASel();
uint8_t getIASel();
void setLenght(uint8_t len);
uint8_t getLenght();
int encode2buffer(uint8_t* buf, int len);
int decodefrombuffer(uint8_t* buf, int len, bool is_option);
......
......@@ -27,6 +27,7 @@
*/
#include "UE_Radio_Capability_ID.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "UE_Status.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "UplinkDataStatus.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "_5GMM_Cause.hpp"
#include "logger.hpp"
using namespace nas;
......
......@@ -27,6 +27,7 @@
*/
#include "_5GSDeregistrationType.hpp"
#include "3gpp_ts24501.hpp"
#include "logger.hpp"
......
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