Commit fffd7cbd authored by sagar arora's avatar sagar arora

Merge remote-tracking branch 'origin/develop' into dockerfile

parents c7852a88 52a4d518
......@@ -39,7 +39,7 @@ case "$OS_DISTRO" in
ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
esac
IS_CONTAINER=`egrep -c "docker|kubepods|podman" /proc/self/cgroup`
IS_CONTAINER=`egrep -c "docker|kubepods|podman|runc-buildah|libpod" /proc/self/cgroup`
if [ $IS_CONTAINER -eq 0 ]
then
......
......@@ -317,7 +317,7 @@ pipeline {
if (fileExists('test_results_oai_amf.html')) {
archiveArtifacts artifacts: 'test_results_oai_amf.html'
}
if (fileExists('deploy_results_oai_cn5g.html')) {
if (fileExists('test_results_oai_cn5g.html')) {
sh "sed -i -e 's#TEMPLATE_TIME#${JOB_TIMESTAMP}#' *_results_oai_cn5g.html"
archiveArtifacts artifacts: '*_results_oai_cn5g.html'
}
......
......@@ -35,6 +35,10 @@ ARG NEEDED_GIT_PROXY
COPY tmp/ca/redhat-uep.pem /etc/rhsm/ca
COPY tmp/entitlement/*.pem /etc/pki/entitlement
#ENV DEBIAN_FRONTEND=noninteractive
#ENV TZ=Europe
#RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN rm -f /etc/rhsm-host && \
yum repolist --disablerepo=* && \
subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms && \
......@@ -49,7 +53,10 @@ RUN rm -f /etc/rhsm-host && \
ninja-build \
boost-devel \
openssl-devel \
openssl
openssl \
libasan && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
# Some GIT configuration command quite useful
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
......@@ -58,7 +65,12 @@ RUN git config --global http.sslverify false
# cpprest package install
RUN git clone https://github.com/Microsoft/cpprestsdk.git
RUN cd cpprestsdk && git submodule update --init && mkdir build && cd build && cmake3 -G Ninja .. -DCMAKE_BUILD_TYPE=Release && ninja install && ldconfig -v
RUN cd cpprestsdk && \
git submodule update --init && \
mkdir build && cd build && \
cmake3 -G Ninja .. -DCMAKE_BUILD_TYPE=Release && \
ninja install && \
ldconfig -v
# Copying source code
WORKDIR /openair-amf/
......@@ -71,16 +83,17 @@ RUN ./build_amf --install-deps --force
# Building AMF
WORKDIR /openair-amf/build/scripts
RUN ./build_amf --clean --Verbose --build-type Release --jobs
#RUN ./build_amf --clean --Verbose --build-type Debug --jobs
#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-amf
ENV TZ=Europe/Paris
ENV TZ=Europe/Paris
# We install some debug tools for the moment in addition of mandatory libraries
RUN yum update -y && \
yum install -y --enablerepo="ubi-8-codeready-builder" \
tzdata \
psmisc \
net-tools \
libevent && \
......@@ -107,6 +120,8 @@ COPY --from=oai-amf-builder /usr/lib64/libboost_regex.so.1.66.0 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libicudata.so.60 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libicui18n.so.60 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libicuuc.so.60 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libasan.so.5.0.0 /usr/lib64/
COPY --from=oai-amf-builder /usr/lib64/libasan.so.5 /usr/lib64/
COPY --from=oai-amf-builder /openair-amf/scripts/entrypoint.sh entrypoint.sh
......@@ -117,7 +132,6 @@ COPY --from=oai-amf-builder /openair-amf/scripts/entrypoint.sh entrypoint.sh
# Copying template configuration files
WORKDIR /openair-amf/etc
COPY --from=oai-amf-builder /openair-amf/etc/amf.conf .
#COPY --from=oai-amf-builder /openair-amf/etc/modules.conf .
WORKDIR /openair-amf
......@@ -126,4 +140,6 @@ EXPOSE 80/tcp 9090/tcp 38412/sctp
ENTRYPOINT ["/openair-amf/bin/entrypoint.sh"]
CMD ["/openair-amf/bin/oai_amf", "-c", "/openair-amf/etc/amf.conf", "-o"]
\ No newline at end of file
CMD ["/openair-amf/bin/oai_amf", "-c", "/openair-amf/etc/amf.conf", "-o"]
#CMD ["sleep", "infinity"]
......@@ -33,6 +33,8 @@ FROM ubuntu:bionic as oai-amf-builder
ARG NEEDED_GIT_PROXY
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DEBIAN_FRONTEND=noninteractive apt-get install --yes \
psmisc \
git \
......@@ -61,12 +63,13 @@ RUN ./build_amf --clean --Verbose --build-type Release --jobs
FROM ubuntu:bionic as oai-amf
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# We install some debug tools for the moment in addition of mandatory libraries
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DEBIAN_FRONTEND=noninteractive apt-get install --yes \
tzdata \
psmisc \
net-tools \
bc \
tzdata \
tshark \
libconfig++9v5 \
libsctp1 \
......@@ -99,6 +102,7 @@ COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/libroken.so.18 .
COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/libwind.so.0 .
COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/libhx509.so.5 .
COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 .
COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/libasan.so.4 .
WORKDIR /usr/local/lib
COPY --from=oai-amf-builder /usr/local/lib/libpistache.so .
......@@ -116,4 +120,4 @@ EXPOSE 80/tcp 9090/tcp 38412/sctp
ENTRYPOINT ["/bin/bash","/openair-amf/bin/entrypoint.sh"]
CMD ["/openair-amf/bin/oai_amf", "-c", "/openair-amf/etc/amf.conf", "-o"]
\ No newline at end of file
CMD ["/openair-amf/bin/oai_amf", "-c", "/openair-amf/etc/amf.conf", "-o"]
......@@ -83,17 +83,17 @@ AMF =
NRF :
{
IPV4_ADDRESS = "@NRF_IPV4_ADDRESS@"; # YOUR NRF CONFIG HERE
PORT = @NRF_PORT@; # YOUR NRF CONFIG HERE (default: 80)
API_VERSION = "@NRF_API_VERSION@"; # YOUR NRF API VERSION FOR SBI CONFIG HERE
IPV4_ADDRESS = "192.168.66.9"; # "@NRF_IPV4_ADDRESS@"; # YOUR NRF CONFIG HERE
PORT = 80; # @NRF_PORT@; # YOUR NRF CONFIG HERE (default: 80)
API_VERSION = "v1"; # "@NRF_API_VERSION@"; # YOUR NRF API VERSION FOR SBI CONFIG HERE
};
AUSF :
{
IPV4_ADDRESS = "@AUSF_IPV4_ADDRESS@"; # YOUR AUSF CONFIG HERE
PORT = @AUSF_PORT@; # YOUR AUSF CONFIG HERE (default: 80)
API_VERSION = "@AUSF_API_VERSION@"; # YOUR AUSF API VERSION FOR SBI CONFIG HERE
};
IPV4_ADDRESS = "192.168.66.10"; # "@AUSF_IPV4_ADDRESS@"; # YOUR AUSF CONFIG HERE
PORT = 80; # @AUSF_PORT@; # YOUR AUSF CONFIG HERE (default: 80)
API_VERSION = "v1"; # "@AUSF_API_VERSION@"; # YOUR AUSF API VERSION FOR SBI CONFIG HERE
};
};
......
......@@ -13,7 +13,7 @@ for c in ${CONFIG_DIR}/*.conf; do
# with the value of the environment variable "VAR"
EXPRESSIONS=""
for v in ${VARS}; do
NEW_VAR=`echo $v | sed -e "s#@##g"`
NEW_VAR=`echo $v | sed -e "s#@##g"`
if [[ -z ${!NEW_VAR+x} ]]; then
echo "Error: Environment variable '${NEW_VAR}' is not set." \
"Config file '$(basename $c)' requires all of $VARS."
......@@ -27,4 +27,4 @@ for c in ${CONFIG_DIR}/*.conf; do
sed -i "${EXPRESSIONS}" ${c}
done
echo "Done setting the configuration"
exec "$@"
\ No newline at end of file
exec "$@"
......@@ -86,7 +86,7 @@ amf_app::amf_app(const amf_config& amf_cfg) {
timer_id_t tid = itti_inst->timer_setup(
amf_cfg.statistics_interval, 0, TASK_AMF_APP,
TASK_AMF_APP_PERIODIC_STATISTICS, 0);
Logger::amf_app().startup("Started timer(%d)", tid);
Logger::amf_app().startup("Started timer (%d)", tid);
}
//------------------------------------------------------------------------------
......
......@@ -64,6 +64,34 @@ amf_config::amf_config() {
enable_smf_selection = false;
enable_external_ausf = false;
enable_external_udm = false;
instance = 0;
n2 = {};
n11 = {};
statistics_interval = 0;
guami = {};
guami_list = {};
relativeAMFCapacity = 0;
plmn_list = {};
auth_conf auth_para = {};
nas_cfg = {};
smf_pool = {};
enable_nf_registration = false;
enable_smf_selection = false;
enable_external_ausf = false;
enable_external_udm = false;
struct {
struct in_addr ipv4_addr;
unsigned int port;
std::string api_version;
} nrf_addr;
struct {
struct in_addr ipv4_addr;
unsigned int port;
std::string api_version;
} ausf_addr;
// TODO:
}
......@@ -377,6 +405,7 @@ int amf_config::load(const std::string& config_file) {
"%s : %s, using defaults", nfex.what(), nfex.getPath());
return -1;
}
return 1;
}
//------------------------------------------------------------------------------
......@@ -384,66 +413,50 @@ void amf_config::display() {
Logger::config().info(
"====================== AMF =====================");
Logger::config().info("Configuration AMF:");
Logger::config().info(
"- Instance ...........................................: %d", instance);
Logger::config().info(
"- PID dir ............................................: %s",
pid_dir.c_str());
Logger::config().info(
"- AMF NAME............................................: %s",
AMF_Name.c_str());
Logger::config().info("- Instance ................: %d", instance);
Logger::config().info("- PID dir .................: %s", pid_dir.c_str());
Logger::config().info("- AMF NAME.................: %s", AMF_Name.c_str());
Logger::config().info(
"- GUAMI (MCC, MNC, Region ID, AMF Set ID, AMF pointer): ");
Logger::config().info(
" (%s, %s, %s, %s, %s )", guami.mcc.c_str(), guami.mnc.c_str(),
guami.regionID.c_str(), guami.AmfSetID.c_str(), guami.AmfPointer.c_str());
Logger::config().info(
"- SERVED_GUAMI_LIST...................................: ");
Logger::config().info("- Served_Guami_List .......: ");
for (int i = 0; i < guami_list.size(); i++) {
Logger::config().info(
" (%s, %s, %s , %s, %s)", guami_list[i].mcc.c_str(),
guami_list[i].mnc.c_str(), guami_list[i].regionID.c_str(),
guami_list[i].AmfSetID.c_str(), guami_list[i].AmfPointer.c_str());
}
Logger::config().info(
"- RELATIVE_CAPACITY...................................: %d",
relativeAMFCapacity);
Logger::config().info(
"- PLMN_SUPPORT_LIST...................................: ");
Logger::config().info("- Relative Capacity .......: %d", relativeAMFCapacity);
Logger::config().info("- PLMN Support ............: ");
for (int i = 0; i < plmn_list.size(); i++) {
Logger::config().info(
" (MCC %s, MNC %s) ", plmn_list[i].mcc.c_str(),
" MCC, MNC ...........: %s, %s", plmn_list[i].mcc.c_str(),
plmn_list[i].mnc.c_str());
Logger::config().info(" TAC: %d", plmn_list[i].tac);
Logger::config().info(
" SLICE_SUPPORT_LIST (SST, SD) ....................: ");
Logger::config().info(" TAC ................: %d", plmn_list[i].tac);
Logger::config().info(" Slice Support ......:");
for (int j = 0; j < plmn_list[i].slice_list.size(); j++) {
Logger::config().info(
" (%s, %s) ", plmn_list[i].slice_list[j].sST.c_str(),
" SST, SD ........: %s, %s",
plmn_list[i].slice_list[j].sST.c_str(),
plmn_list[i].slice_list[j].sD.c_str());
}
}
Logger::config().info(
"- Emergency Support................... ...............: %s",
is_emergency_support.c_str());
"- Emergency Support .......: %s", is_emergency_support.c_str());
Logger::config().info(
"- MYSQL Server Addr...................................: %s",
auth_para.mysql_server.c_str());
"- MySQL Server Addr .......: %s", auth_para.mysql_server.c_str());
Logger::config().info(
"- MYSQL user .........................................: %s",
auth_para.mysql_user.c_str());
"- MySQL user ..............: %s", auth_para.mysql_user.c_str());
Logger::config().info(
"- MYSQL pass .........................................: %s",
auth_para.mysql_pass.c_str());
"- MySQL pass ..............: %s", auth_para.mysql_pass.c_str());
Logger::config().info(
"- MYSQL db ...........................................: %s",
auth_para.mysql_db.c_str());
"- MySQL DB ................: %s", auth_para.mysql_db.c_str());
Logger::config().info(
"- operator key .......................................: %s",
auth_para.operator_key.c_str());
"- operator key ............: %s", auth_para.operator_key.c_str());
Logger::config().info(
"- random .............................................: %s",
auth_para.random.c_str());
"- random ..................: %s", auth_para.random.c_str());
Logger::config().info("- N2 Networking:");
Logger::config().info(" iface .................: %s", n2.if_name.c_str());
......@@ -455,24 +468,25 @@ void amf_config::display() {
Logger::config().info(
" ip ....................: %s", inet_ntoa(n11.addr4));
Logger::config().info(" port ..................: %d", n11.port);
Logger::config().info(" API version............: %s", sbi_api_version.c_str());
Logger::config().info(
" API version............: %s", sbi_api_version.c_str());
if (enable_nf_registration or enable_smf_selection) {
Logger::config().info("- NRF:");
Logger::config().info(
" IP addr ..............: %s", inet_ntoa(nrf_addr.ipv4_addr));
Logger::config().info(" Port .................: %d", nrf_addr.port);
" IP addr ...............: %s", inet_ntoa(nrf_addr.ipv4_addr));
Logger::config().info(" Port ..................: %d", nrf_addr.port);
Logger::config().info(
" Api version ..........: %s", nrf_addr.api_version.c_str());
" Api version ...........: %s", nrf_addr.api_version.c_str());
}
if (enable_external_ausf) {
Logger::config().info("- AUSF:");
Logger::config().info(
" IP addr ..............: %s", inet_ntoa(ausf_addr.ipv4_addr));
Logger::config().info(" Port .................: %d", ausf_addr.port);
" IP addr ...............: %s", inet_ntoa(ausf_addr.ipv4_addr));
Logger::config().info(" Port ..................: %d", ausf_addr.port);
Logger::config().info(
" Api version ..........: %s", ausf_addr.api_version.c_str());
" Api version ...........: %s", ausf_addr.api_version.c_str());
}
Logger::config().info("- Remote SMF Pool.........: ");
......@@ -490,13 +504,13 @@ void amf_config::display() {
Logger::config().info("- Supported Features:");
Logger::config().info(
" NF Registration........: %s", enable_nf_registration ? "Yes" : "No");
" NF Registration .......: %s", enable_nf_registration ? "Yes" : "No");
Logger::config().info(
" SMF Selection..........: %s", enable_smf_selection ? "Yes" : "No");
" SMF Selection .........: %s", enable_smf_selection ? "Yes" : "No");
Logger::config().info(
" External AUSF..........: %s", enable_external_ausf ? "Yes" : "No");
" External AUSF .........: %s", enable_external_ausf ? "Yes" : "No");
Logger::config().info(
" External UDM..........: %s", enable_external_udm ? "Yes" : "No");
" External UDM ..........: %s", enable_external_udm ? "Yes" : "No");
}
//------------------------------------------------------------------------------
......
......@@ -45,7 +45,6 @@
#define AMF_CONFIG_STRING_STATISTICS_TIMER_INTERVAL "STATISTICS_TIMER_INTERVAL"
#define AMF_CONFIG_STRING_INTERFACES "INTERFACES"
#define AMF_CONFIG_STRING_INTERFACE_NGAP_AMF "NGAP_AMF"
#define AMF_CONFIG_STRING_INTERFACE_NAUSF "NAUSF"
#define AMF_CONFIG_STRING_INTERFACE_NAME "INTERFACE_NAME"
#define AMF_CONFIG_STRING_IPV4_ADDRESS "IPV4_ADDRESS"
......@@ -180,7 +179,6 @@ class amf_config {
std::string pid_dir;
interface_cfg_t n2;
interface_cfg_t n11;
interface_cfg_t nausf;
itti_cfg_t itti;
std::string sbi_api_version;
unsigned int statistics_interval;
......
......@@ -86,11 +86,12 @@ int amf_modules::load(const std::string& config_file) {
Logger::config().error("wrong NGAP message configuration");
}
}
return 1;
}
//------------------------------------------------------------------------------
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(),
......
......@@ -596,7 +596,7 @@ void amf_n1::service_request_handle(
"Cannot get pdu_session_context with SUPI %s", supi.c_str());
}
//TODO: is_supi_to_pdu_ctx should be removed
// TODO: is_supi_to_pdu_ctx should be removed
if (!amf_n11_inst->is_supi_to_pdu_ctx(supi) || !psc.get()->isn2sm_avaliable) {
Logger::amf_n1().error(
"Cannot get pdu session information with supi (%s)", supi.c_str());
......@@ -943,7 +943,9 @@ void amf_n1::registration_request_handle(
//------------------------------------------------------------------------------
// authentication vector handlers
bool amf_n1::generate_authentication_vector() {}
bool amf_n1::generate_authentication_vector() {
return true;
}
// context management functions
//------------------------------------------------------------------------------
......@@ -1070,7 +1072,7 @@ void amf_n1::run_registration_procedure(std::shared_ptr<nas_context>& nc) {
}
} else if (nc.get()->is_5g_guti_present) {
Logger::amf_n1().debug("Start to run UE Identification Request procedure");
nc.get()->is_auth_vectors_present = false;
nc.get()->is_auth_vectors_present = false;
std::unique_ptr<IdentityRequest> ir = std::make_unique<IdentityRequest>();
ir->setHeader(PLAIN_5GS_MSG);
ir->set_5GS_Identity_Type(SUCI);
......@@ -1307,6 +1309,7 @@ bool amf_n1::authentication_vectors_generator_in_udm(
Logger::amf_n1().error("Failed to fetch user data from MySQL");
return false;
}
return true;
}
//------------------------------------------------------------------------------
......@@ -1730,7 +1733,9 @@ bool amf_n1::start_security_mode_control_procedure(
nc.get()->is_current_security_available = true;
}
SecurityModeCommand* smc = new SecurityModeCommand();
// SecurityModeCommand* smc = new SecurityModeCommand();
std::unique_ptr<SecurityModeCommand> smc =
std::make_unique<SecurityModeCommand>();
smc->setHeader(PLAIN_5GS_MSG);
smc->setNAS_Security_Algorithms(amf_nea, amf_nia);
Logger::amf_n1().debug("Encoded ngKSI 0x%x", nc.get()->ngKsi);
......@@ -1753,6 +1758,7 @@ bool amf_n1::start_security_mode_control_procedure(
itti_send_dl_nas_buffer_to_task_n2(
intProtctedNas, nc.get()->ran_ue_ngap_id, nc.get()->amf_ue_ngap_id);
// secu_ctx->dl_count.seq_num ++;
free_wrapper((void**) &data);
return true;
}
......@@ -1954,8 +1960,9 @@ void amf_n1::encode_nas_message_protected(
} break;
case INTEGRITY_PROTECTED_WITH_NEW_SECU_CTX: {
if (!nsc || !is_secu_ctx_new) {
if ((nsc == nullptr) || !is_secu_ctx_new) {
Logger::amf_n1().error("Security context is too old");
return;
}
protected_nas_buf[0] = EPD_5GS_MM_MSG;
protected_nas_buf[1] = INTEGRITY_PROTECTED_WITH_NEW_SECU_CTX;
......@@ -1976,7 +1983,6 @@ void amf_n1::encode_nas_message_protected(
case INTEGRITY_PROTECTED_AND_CIPHERED_WITH_NEW_SECU_CTX: {
} break;
}
protected_nas = blk2bstr(protected_nas_buf, encoded_size);
nsc->dl_count.seq_num++;
......@@ -1986,7 +1992,7 @@ void amf_n1::encode_nas_message_protected(
bool amf_n1::nas_message_integrity_protected(
nas_secu_ctx* nsc, uint8_t direction, uint8_t* input_nas, int input_nas_len,
uint32_t& mac32) {
if (nsc == nullptr) return false;
uint32_t count = 0x00000000;
if (direction)
count = 0x00000000 | ((nsc->dl_count.overflow & 0x0000ffff) << 8) |
......@@ -2041,8 +2047,8 @@ bool amf_n1::nas_message_integrity_protected(
Logger::amf_n1().debug("Result for NIA2, mac32: 0x%x", mac32);
return true;
} break;
}
return true;
}
//------------------------------------------------------------------------------
......@@ -2086,8 +2092,8 @@ bool amf_n1::nas_message_cipher_protected(
nas_algorithms::nas_stream_encrypt_nea2(
&stream_cipher, (uint8_t*) bdata(output_nas));
} break;
}
return true;
}
//------------------------------------------------------------------------------
......
......@@ -1111,7 +1111,7 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
std::shared_ptr<nas_context> nc =
amf_n1_inst->amf_ue_id_2_nas_context(amf_ue_ngap_id);
//setPduSessionResourceHandoverList_PDYSessionID_handovercommandtransfer
// setPduSessionResourceHandoverList_PDYSessionID_handovercommandtransfer
std::vector<PDUSessionResourceHandoverItem_t> handover_list;
PDUSessionResourceHandoverItem_t item;
// set pdu id
......@@ -1145,7 +1145,7 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
handover_list.push_back(item);
handovercommand->setPduSessionResourceHandoverList(handover_list);
handovercommand->setTargetToSource_TransparentContainer(targetTosource);
//setPduSessionResourceHandoverList_PDYSessionID_handovercommandtransfer-end
// setPduSessionResourceHandoverList_PDYSessionID_handovercommandtransfer-end
uint8_t buffer[10240];
int encoded_size = handovercommand->encode2buffer(buffer, 10240);
bstring b = blk2bstr(buffer, encoded_size);
......
......@@ -81,6 +81,7 @@ class nf_profile : public std::enable_shared_from_this<nf_profile> {
nf_type = s.nf_type;
nf_instance_name = s.nf_instance_name;
nf_status = s.nf_status;
return *this;
}
// nf_profile(nf_profile &b) = delete;
......@@ -318,6 +319,7 @@ class amf_profile : public nf_profile {
custom_info = s.custom_info;
amf_info = s.amf_info;
nf_services = s.nf_services;
return *this;
}
// amf_profile(amf_profile &b) = delete;
......
......@@ -192,6 +192,7 @@ typedef struct subscription_condition_s {
}
}
// TODO:
return *this;
}
virtual ~subscription_condition_s(){};
......@@ -258,6 +259,7 @@ typedef struct nf_service_version_s {
nf_service_version_s& operator=(const nf_service_version_s& s) {
api_version_in_uri = s.api_version_in_uri;
api_full_version = s.api_full_version;
return *this;
}
std::string to_string() const {
......
......@@ -107,16 +107,6 @@ void _Logger::trace(const char* format, ...) {
#endif
}
//------------------------------------------------------------------------------
void _Logger::trace(const std::string& format, ...) {
#if TRACE_IS_ON
va_list args;
va_start(args, format);
log(_ltTrace, format.c_str(), args);
va_end(args);
#endif
}
//------------------------------------------------------------------------------
void _Logger::debug(const char* format, ...) {
#if DEBUG_IS_ON
......@@ -127,16 +117,6 @@ void _Logger::debug(const char* format, ...) {
#endif
}
//------------------------------------------------------------------------------
void _Logger::debug(const std::string& format, ...) {
#if DEBUG_IS_ON
va_list args;
va_start(args, format);
log(_ltDebug, format.c_str(), args);
va_end(args);
#endif
}
//------------------------------------------------------------------------------
void _Logger::info(const char* format, ...) {
#if INFO_IS_ON
......@@ -147,16 +127,6 @@ void _Logger::info(const char* format, ...) {
#endif
}
//------------------------------------------------------------------------------
void _Logger::info(const std::string& format, ...) {
#if INFO_IS_ON
va_list args;
va_start(args, format);
log(_ltInfo, format.c_str(), args);
va_end(args);
#endif
}
//------------------------------------------------------------------------------
void _Logger::startup(const char* format, ...) {
va_list args;
......@@ -165,14 +135,6 @@ void _Logger::startup(const char* format, ...) {
va_end(args);
}
//------------------------------------------------------------------------------
void _Logger::startup(const std::string& format, ...) {
va_list args;
va_start(args, format);
log(_ltStartup, format.c_str(), args);
va_end(args);
}
//------------------------------------------------------------------------------
void _Logger::warn(const char* format, ...) {
va_list args;
......@@ -181,14 +143,6 @@ void _Logger::warn(const char* format, ...) {
va_end(args);
}
//------------------------------------------------------------------------------
void _Logger::warn(const std::string& format, ...) {
va_list args;
va_start(args, format);
log(_ltWarn, format.c_str(), args);
va_end(args);
}
//------------------------------------------------------------------------------
void _Logger::error(const char* format, ...) {
va_list args;
......@@ -197,14 +151,6 @@ void _Logger::error(const char* format, ...) {
va_end(args);
}
//------------------------------------------------------------------------------
void _Logger::error(const std::string& format, ...) {
va_list args;
va_start(args, format);
log(_ltError, format.c_str(), args);
va_end(args);
}
//------------------------------------------------------------------------------
void _Logger::log(_LogType lt, const char* format, va_list& args) {
char buffer[2048];
......
......@@ -29,11 +29,21 @@
#include "nas_context.hpp"
//------------------------------------------------------------------------------
nas_context::nas_context() {
security_ctx = NULL;
is_imsi_present = false;
nas_context::nas_context() : _vector(), _5g_he_av(), _5g_av(), kamf() {
security_ctx = nullptr;
is_stacs_available = false;
is_auth_vectors_present = false;
auts = nullptr;
ctx_avaliability_ind = false;
amf_ue_ngap_id = 0;
ran_ue_ngap_id = 0;
_5gmm_state = {};
registration_type = 0;
follow_on_req_pending_ind = false;
ngKsi = 0;
mmCapability = 0;
ueSecurityCapEnc = 0;
ueSecurityCapInt = 0;
requestedNssai = {};
is_specific_procedure_for_registration_running = false;
is_specific_procedure_for_deregistration_running = false;
is_specific_procedure_for_eCell_inactivity_running = false;
......@@ -41,7 +51,14 @@ nas_context::nas_context() {
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;
_security = {};
security_ctx = nullptr;
is_current_security_available = false;
registration_attempt_counter = 0;
is_imsi_present = false;
is_5g_guti_present = false;
is_auth_vectors_present = false;
to_be_register_by_new_suci = false;
}
//------------------------------------------------------------------------------
......
......@@ -33,6 +33,17 @@ pdu_session_context::pdu_session_context() {
smf_available = false;
isn2sm_avaliable = false;
isn1sm_avaliable = false;
ran_ue_ngap_id = 0;
amf_ue_ngap_id = 0;
req_type = 0;
pdu_session_id = 0;
// bstring n2sm;
isn2sm_avaliable = false;
// bstring n1sm;
isn1sm_avaliable = false;
smf_available = false;
snssai = {};
plmn = {};
}
//------------------------------------------------------------------------------
......
......@@ -47,7 +47,7 @@ class pdu_session_context {
bstring n1sm;
bool isn1sm_avaliable;
std::string dnn;
std::string smf_addr; //"192.168.12.10:8080"
std::string smf_addr;
std::string smf_api_version;
bool smf_available;
std::string location;
......
......@@ -22,7 +22,15 @@
#include "ue_context.hpp"
//------------------------------------------------------------------------------
ue_context::ue_context() {}
ue_context::ue_context() {
ran_ue_ngap_id = 0;
amf_ue_ngap_id = 0;
rrc_estb_cause = {};
isUeContextRequest = false;
cgi = {};
tai = {};
pdu_sessions = {};
}
//------------------------------------------------------------------------------
bool ue_context::find_pdu_session_context(
......
......@@ -35,8 +35,16 @@
using namespace nas;
//------------------------------------------------------------------------------
void _5GSMobilityIdentity::setIEI(uint8_t _iei) {
iei = _iei;
_5GSMobilityIdentity::_5GSMobilityIdentity() {
iei = 0;
_5g_guti = nullptr;
imei_imeisv = nullptr;
supi_format_imsi = nullptr;
_5g_s_tmsi = nullptr;
_IMEISV = {};
is_no_identity = false;
length = 0;
typeOfIdentity = 0;
}
//------------------------------------------------------------------------------
......@@ -49,6 +57,45 @@ _5GSMobilityIdentity::_5GSMobilityIdentity(
_5g_s_tmsi->amf_set_id = amfSetId;
_5g_s_tmsi->amf_pointer = amfPointer;
_5g_s_tmsi->_5g_tmsi = tmsi;
is_no_identity = false;
length = 0;
_5g_guti = nullptr;
imei_imeisv = nullptr;
supi_format_imsi = nullptr;
_IMEISV = {};
}
//------------------------------------------------------------------------------
_5GSMobilityIdentity::_5GSMobilityIdentity(
const string mcc, const string mnc, const string routingInd,
uint8_t protection_sch_id, const string msin) {
iei = 0;
typeOfIdentity = SUCI;
supi_format_imsi = (SUCI_imsi_t*) calloc(1, sizeof(SUCI_imsi_t));
supi_format_imsi->supi_format = SUPI_FORMAT_IMSI;
supi_format_imsi->mcc = mcc;
supi_format_imsi->mnc = mnc;
supi_format_imsi->routingIndicator = routingInd;
supi_format_imsi->protectionSchemeId = protection_sch_id;
supi_format_imsi->homeNetworkPKI = HOME_NETWORK_PKI_0_WHEN_PSI_0;
supi_format_imsi->msin = msin;
length = 10 + ceil(msin.length() / 2);
is_no_identity = false;
_5g_s_tmsi = nullptr;
_5g_guti = nullptr;
imei_imeisv = nullptr;
_IMEISV = {};
}
//------------------------------------------------------------------------------
_5GSMobilityIdentity::~_5GSMobilityIdentity() {}
//------------------------------------------------------------------------------
void _5GSMobilityIdentity::setIEI(uint8_t _iei) {
iei = _iei;
}
//------------------------------------------------------------------------------
......@@ -128,42 +175,13 @@ bool _5GSMobilityIdentity::get5G_S_TMSI(
return true;
}
//------------------------------------------------------------------------------
_5GSMobilityIdentity::_5GSMobilityIdentity(
const string mcc, const string mnc, const string routingInd,
uint8_t protection_sch_id, const string msin) {
iei = 0;
typeOfIdentity = SUCI;
supi_format_imsi = (SUCI_imsi_t*) calloc(1, sizeof(SUCI_imsi_t));
supi_format_imsi->supi_format = SUPI_FORMAT_IMSI;
supi_format_imsi->mcc = mcc;
supi_format_imsi->mnc = mnc;
supi_format_imsi->routingIndicator = routingInd;
supi_format_imsi->protectionSchemeId = protection_sch_id;
supi_format_imsi->homeNetworkPKI = HOME_NETWORK_PKI_0_WHEN_PSI_0;
supi_format_imsi->msin = msin;
length = 10 + ceil(msin.length() / 2);
}
//------------------------------------------------------------------------------
_5GSMobilityIdentity::_5GSMobilityIdentity() {
iei = 0;
_5g_guti = NULL;
imei_imeisv = NULL;
supi_format_imsi = NULL;
_5g_s_tmsi = NULL;
_IMEISV = {};
}
//------------------------------------------------------------------------------
_5GSMobilityIdentity::~_5GSMobilityIdentity() {}
//------------------------------------------------------------------------------
void _5GSMobilityIdentity::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) {
typeOfIdentity = _5G_GUTI;
_5g_guti = (_5G_GUTI_t*) calloc(1, sizeof(_5G_GUTI_t));
typeOfIdentity = _5G_GUTI;
if (_5g_guti == nullptr)
_5g_guti = (_5G_GUTI_t*) calloc(1, sizeof(_5G_GUTI_t));
_5g_guti->mcc = mcc;
_5g_guti->mnc = mnc;
_5g_guti->amf_region_id = amf_region_id;
......@@ -177,10 +195,11 @@ void _5GSMobilityIdentity::set5GGUTI(
void _5GSMobilityIdentity::setSuciWithSupiImsi(
const string& mcc, const string& mnc, const string& routingInd,
uint8_t protecSchId, const string& msin_digits) {
supi_format_imsi = (SUCI_imsi_t*) calloc(1, sizeof(SUCI_imsi_t));
supi_format_imsi->supi_format = SUPI_FORMAT_IMSI;
supi_format_imsi->mcc = mcc;
supi_format_imsi->mnc = mnc;
if (supi_format_imsi == nullptr)
supi_format_imsi = (SUCI_imsi_t*) calloc(1, sizeof(SUCI_imsi_t));
supi_format_imsi->supi_format = SUPI_FORMAT_IMSI;
supi_format_imsi->mcc = mcc;
supi_format_imsi->mnc = mnc;
supi_format_imsi->routingIndicator = routingInd;
supi_format_imsi->protectionSchemeId = protecSchId;
supi_format_imsi->homeNetworkPKI = HOME_NETWORK_PKI_0_WHEN_PSI_0;
......@@ -191,7 +210,8 @@ void _5GSMobilityIdentity::setSuciWithSupiImsi(
void _5GSMobilityIdentity::setSuciWithSupiImsi(
const string& mcc, const string& mnc, const string& routingInd,
uint8_t protecSchId, uint8_t home_pki, const string& msin_digits) {
supi_format_imsi = (SUCI_imsi_t*) calloc(1, sizeof(SUCI_imsi_t));
if (supi_format_imsi == nullptr)
supi_format_imsi = (SUCI_imsi_t*) calloc(1, sizeof(SUCI_imsi_t));
supi_format_imsi->supi_format = SUPI_FORMAT_IMSI;
supi_format_imsi->mcc = mcc;
supi_format_imsi->mnc = mnc;
......@@ -428,7 +448,9 @@ int _5GSMobilityIdentity::encodeRoutid2buffer(string routidstr, uint8_t* buf) {
}
//------------------------------------------------------------------------------
int _5GSMobilityIdentity::encodeMSIN2buffer(string msinstr, uint8_t* buf) {}
int _5GSMobilityIdentity::encodeMSIN2buffer(string msinstr, uint8_t* buf) {
return 1;
}
//------------------------------------------------------------------------------
int _5GSMobilityIdentity::imeisv_encode2buffer(uint8_t* buf, int len) {
......@@ -676,7 +698,7 @@ int _5GSMobilityIdentity::imeisv_decodefrombuffer(uint8_t* buf, int len) {
for (int i = 0; i < length; i++) {
Logger::nas_mm().debug(
"decoded 5GSMobilityIdentity IMEISV value(0x%x)",
(uint8_t*) _IMEISV.identity->data[i]);
(uint8_t) _IMEISV.identity->data[i]);
}
Logger::nas_mm().debug(
"decoded 5GSMobilityIdentity IMEISV len(%d)", decoded_size);
......
......@@ -31,8 +31,9 @@
using namespace nas;
//------------------------------------------------------------------------------
ABBA::ABBA(uint8_t iei) {
_iei = iei;
ABBA::ABBA(uint8_t iei) : _value() {
_iei = iei;
_length = 0;
}
//------------------------------------------------------------------------------
......@@ -45,7 +46,9 @@ ABBA::ABBA(const uint8_t iei, uint8_t length, uint8_t* value) {
}
//------------------------------------------------------------------------------
ABBA::ABBA() {}
ABBA::ABBA() : _value(), _length(), _iei() {}
//------------------------------------------------------------------------------
ABBA::~ABBA() {}
//------------------------------------------------------------------------------
......@@ -99,9 +102,8 @@ int ABBA::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
if (is_option) {
decoded_size++;
}
_length = 0x00;
_value[255] = {};
_length = *(buf + decoded_size);
_length = 0x00;
_length = *(buf + decoded_size);
decoded_size++;
int i = 0;
uint8_t Length = _length;
......
......@@ -33,7 +33,9 @@ using namespace nas;
//------------------------------------------------------------------------------
Additional_5G_Security_Information::Additional_5G_Security_Information(
uint8_t iei) {
_iei = iei;
_iei = iei;
RINMR = false;
HDP = false;
}
//------------------------------------------------------------------------------
......@@ -45,7 +47,11 @@ Additional_5G_Security_Information::Additional_5G_Security_Information(
}
//------------------------------------------------------------------------------
Additional_5G_Security_Information::Additional_5G_Security_Information() {}
Additional_5G_Security_Information::Additional_5G_Security_Information()
: _iei() {
RINMR = false;
HDP = false;
}
//------------------------------------------------------------------------------
Additional_5G_Security_Information::~Additional_5G_Security_Information() {}
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
Additional_Information::Additional_Information(uint8_t iei) {
_iei = iei;
_iei = iei;
length = 0;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -44,7 +46,7 @@ Additional_Information::Additional_Information(
}
//------------------------------------------------------------------------------
Additional_Information::Additional_Information() {}
Additional_Information::Additional_Information() : _iei(), length(), _value() {}
//------------------------------------------------------------------------------
Additional_Information::~Additional_Information() {}
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
Allowed_PDU_Session_Status::Allowed_PDU_Session_Status(uint8_t iei) {
_iei = iei;
_iei = iei;
length = 0;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -44,7 +46,8 @@ Allowed_PDU_Session_Status::Allowed_PDU_Session_Status(
}
//------------------------------------------------------------------------------
Allowed_PDU_Session_Status::Allowed_PDU_Session_Status() {}
Allowed_PDU_Session_Status::Allowed_PDU_Session_Status()
: _iei(), length(), _value() {}
//------------------------------------------------------------------------------
Allowed_PDU_Session_Status::~Allowed_PDU_Session_Status() {}
......
......@@ -33,7 +33,9 @@ using namespace nas;
//------------------------------------------------------------------------------
Authentication_Failure_Parameter::Authentication_Failure_Parameter(
uint8_t iei) {
_iei = iei;
_iei = iei;
length = 0;
value = 0;
}
//------------------------------------------------------------------------------
......@@ -45,7 +47,8 @@ Authentication_Failure_Parameter::Authentication_Failure_Parameter(
}
//------------------------------------------------------------------------------
Authentication_Failure_Parameter::Authentication_Failure_Parameter() {}
Authentication_Failure_Parameter::Authentication_Failure_Parameter()
: _iei(), length(), value() {}
//------------------------------------------------------------------------------
Authentication_Failure_Parameter::~Authentication_Failure_Parameter() {}
......@@ -77,7 +80,7 @@ int Authentication_Failure_Parameter::encode2buffer(uint8_t* buf, int len) {
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
}
Logger::nas_mm().debug(
"encoded Authentication_Failure_Parameter len(%d)", encoded_size);
"Encoded Authentication_Failure_Parameter len (%d)", encoded_size);
return encoded_size;
}
......@@ -85,7 +88,7 @@ int Authentication_Failure_Parameter::encode2buffer(uint8_t* buf, int len) {
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);
"Decoding Authentication_Failure_Parameter iei (0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
......@@ -93,15 +96,15 @@ int Authentication_Failure_Parameter::decodefrombuffer(
length = *(buf + decoded_size);
decoded_size++;
Logger::nas_mm().debug(
"decoded IE Authentication_Failure_Parameter length(%d)", length);
"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]);
"Decoded Authentication_Failure_Parameter value (0x%x)",
(uint8_t) value->data[i]);
}
Logger::nas_mm().debug(
"decoded Authentication_Failure_Parameter len(%d)", decoded_size);
"Decoded Authentication_Failure_Parameter len (%d)", decoded_size);
return decoded_size;
}
......@@ -31,7 +31,8 @@
using namespace nas;
//------------------------------------------------------------------------------
Authentication_Parameter_AUTN::Authentication_Parameter_AUTN(uint8_t iei) {
Authentication_Parameter_AUTN::Authentication_Parameter_AUTN(uint8_t iei)
: _value() {
_iei = iei;
}
......@@ -45,7 +46,8 @@ Authentication_Parameter_AUTN::Authentication_Parameter_AUTN(
}
//------------------------------------------------------------------------------
Authentication_Parameter_AUTN::Authentication_Parameter_AUTN() {}
Authentication_Parameter_AUTN::Authentication_Parameter_AUTN()
: _iei(), _value() {}
//------------------------------------------------------------------------------
Authentication_Parameter_AUTN::~Authentication_Parameter_AUTN() {}
......@@ -54,7 +56,7 @@ 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]);
// value(0x%2x)", _value[j]);
//}
return _value;
}
......
......@@ -31,7 +31,8 @@
using namespace nas;
//------------------------------------------------------------------------------
Authentication_Parameter_RAND::Authentication_Parameter_RAND(uint8_t iei) {
Authentication_Parameter_RAND::Authentication_Parameter_RAND(uint8_t iei)
: _value() {
_iei = iei;
}
......@@ -45,7 +46,8 @@ Authentication_Parameter_RAND::Authentication_Parameter_RAND(
}
//------------------------------------------------------------------------------
Authentication_Parameter_RAND::Authentication_Parameter_RAND() {}
Authentication_Parameter_RAND::Authentication_Parameter_RAND()
: _iei(), _value() {}
//------------------------------------------------------------------------------
Authentication_Parameter_RAND::~Authentication_Parameter_RAND() {}
......
......@@ -96,7 +96,7 @@ int Authentication_Response_Parameter::decodefrombuffer(
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]);
"Decoded NAS_Message_Container value 0x%x", (uint8_t) PARA->data[i]);
}
Logger::nas_mm().debug(
"Decoded Authentication_Response_Parameter (len %d)", decoded_size);
......
......@@ -31,8 +31,9 @@
using namespace nas;
//------------------------------------------------------------------------------
DNN::DNN(uint8_t iei) {
_iei = iei;
DNN::DNN(uint8_t iei) : _DNN() {
_iei = iei;
length = 0;
}
//------------------------------------------------------------------------------
......@@ -43,17 +44,11 @@ DNN::DNN(const uint8_t iei, bstring dnn) {
}
//------------------------------------------------------------------------------
DNN::DNN() {}
DNN::DNN() : _iei(), _DNN(), length() {}
//------------------------------------------------------------------------------
DNN::~DNN() {}
//------------------------------------------------------------------------------
/*void DNN::setValue(uint8_t iei, uint8_t value) {
_iei = iei;
_value = value;
}*/
//------------------------------------------------------------------------------
void DNN::getValue(bstring& dnn) {
// dnn = _DNN;
......@@ -99,8 +94,7 @@ int DNN::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
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 value: 0x%x", (uint8_t) bdata(_DNN)[i]);
}
Logger::nas_mm().debug("Decoded DNN len: %d", decoded_size);
return decoded_size;
......
......@@ -31,8 +31,9 @@
using namespace nas;
//------------------------------------------------------------------------------
EAP_Message::EAP_Message(uint8_t iei) {
_iei = iei;
EAP_Message::EAP_Message(uint8_t iei) : EAP() {
_iei = iei;
length = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,7 @@ EAP_Message::EAP_Message(const uint8_t iei, bstring eap) {
}
//------------------------------------------------------------------------------
EAP_Message::EAP_Message() {}
EAP_Message::EAP_Message() : _iei(), EAP(), length() {}
//------------------------------------------------------------------------------
EAP_Message::~EAP_Message() {}
......@@ -70,13 +71,13 @@ int EAP_Message::encode2buffer(uint8_t* buf, int len) {
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);
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);
Logger::nas_mm().debug("decoding EAP_Message iei (0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
......@@ -90,8 +91,8 @@ int EAP_Message::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
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]);
"decoded EAP_Message value (0x%x)", (uint8_t) EAP->data[i]);
}
Logger::nas_mm().debug("decoded EAP_Message len(%d)", decoded_size);
Logger::nas_mm().debug("decoded EAP_Message len (%d)", decoded_size);
return decoded_size;
}
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
EPS_Bearer_Context_Status::EPS_Bearer_Context_Status(uint8_t iei) {
_iei = iei;
_iei = iei;
length = 0;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -44,7 +46,8 @@ EPS_Bearer_Context_Status::EPS_Bearer_Context_Status(
}
//------------------------------------------------------------------------------
EPS_Bearer_Context_Status::EPS_Bearer_Context_Status() {}
EPS_Bearer_Context_Status::EPS_Bearer_Context_Status()
: _iei(), length(), _value() {}
//------------------------------------------------------------------------------
EPS_Bearer_Context_Status::~EPS_Bearer_Context_Status() {}
......
......@@ -30,8 +30,9 @@
using namespace nas;
//------------------------------------------------------------------------------
EPS_NAS_Message_Container::EPS_NAS_Message_Container(uint8_t iei) {
_iei = iei;
EPS_NAS_Message_Container::EPS_NAS_Message_Container(uint8_t iei) : _value() {
_iei = iei;
length = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,8 @@ EPS_NAS_Message_Container::EPS_NAS_Message_Container(
}
//------------------------------------------------------------------------------
EPS_NAS_Message_Container::EPS_NAS_Message_Container() {}
EPS_NAS_Message_Container::EPS_NAS_Message_Container()
: _iei(), length(), _value() {}
//------------------------------------------------------------------------------
EPS_NAS_Message_Container::~EPS_NAS_Message_Container() {}
......@@ -61,9 +63,9 @@ void EPS_NAS_Message_Container::getValue(bstring& 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);
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);
Logger::nas_mm().error("Len is less than %d", length);
return 0;
}
int encoded_size = 0;
......@@ -82,14 +84,14 @@ int EPS_NAS_Message_Container::encode2buffer(uint8_t* buf, int len) {
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
}
Logger::nas_mm().debug(
"encoded EPS_NAS_Message_Container len(%d)", encoded_size);
"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);
Logger::nas_mm().debug("Decoding EPS_NAS_Message_Container iei (0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
......@@ -103,10 +105,10 @@ int EPS_NAS_Message_Container::decodefrombuffer(
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]);
"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);
"Decoded EPS_NAS_Message_Container len (%d)", decoded_size);
return decoded_size;
}
......@@ -31,7 +31,9 @@ using namespace nas;
//------------------------------------------------------------------------------
Extended_DRX_Parameters::Extended_DRX_Parameters(uint8_t iei) {
_iei = iei;
_iei = iei;
_paging_time = 0;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +45,8 @@ Extended_DRX_Parameters::Extended_DRX_Parameters(
}
//------------------------------------------------------------------------------
Extended_DRX_Parameters::Extended_DRX_Parameters() {}
Extended_DRX_Parameters::Extended_DRX_Parameters()
: _iei(), _paging_time(), _value() {}
//------------------------------------------------------------------------------
Extended_DRX_Parameters::~Extended_DRX_Parameters() {}
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
GPRS_Timer_2::GPRS_Timer_2(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -42,7 +43,7 @@ GPRS_Timer_2::GPRS_Timer_2(const uint8_t iei, uint8_t value) {
}
//------------------------------------------------------------------------------
GPRS_Timer_2::GPRS_Timer_2() {}
GPRS_Timer_2::GPRS_Timer_2() : _iei(), _value() {}
//------------------------------------------------------------------------------
GPRS_Timer_2::~GPRS_Timer_2() {}
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
GPRS_Timer_3::GPRS_Timer_3(uint8_t iei) {
_iei = iei;
_iei = iei;
UNIT = 0;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +45,7 @@ GPRS_Timer_3::GPRS_Timer_3(const uint8_t iei, uint8_t unit, uint8_t value) {
}
//------------------------------------------------------------------------------
GPRS_Timer_3::GPRS_Timer_3() {}
GPRS_Timer_3::GPRS_Timer_3() : _iei(), UNIT(), _value() {}
//------------------------------------------------------------------------------
GPRS_Timer_3::~GPRS_Timer_3() {}
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
IMEISV_Request::IMEISV_Request(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -42,7 +43,7 @@ IMEISV_Request::IMEISV_Request(const uint8_t iei, uint8_t value) {
}
//------------------------------------------------------------------------------
IMEISV_Request::IMEISV_Request() {}
IMEISV_Request::IMEISV_Request() : _iei(), _value() {}
//------------------------------------------------------------------------------
IMEISV_Request::~IMEISV_Request() {}
......@@ -59,9 +60,9 @@ uint8_t IMEISV_Request::getValue() {
//------------------------------------------------------------------------------
int IMEISV_Request::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("encoding IMEISV_Request iei(0x%x)", _iei);
Logger::nas_mm().debug("Encoding IMEISV_Request iei (0x%x)", _iei);
if (len < 1) {
Logger::nas_mm().error("len is less than 1");
Logger::nas_mm().error("Len is less than 1");
return 0;
}
uint8_t octet = 0;
......@@ -73,15 +74,16 @@ int IMEISV_Request::encode2buffer(uint8_t* buf, int len) {
} else {
octet = (_iei << 4) | (_value & 0x07);
*buf = octet;
Logger::nas_mm().debug("encoded IMEISV_Request IE(len(1 octet))");
Logger::nas_mm().debug("Encoded IMEISV_Request IE (len - 1 octet)");
return 1;
}
return 1;
}
//------------------------------------------------------------------------------
int IMEISV_Request::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
if (len < 1) {
Logger::nas_mm().error("len is less than one");
Logger::nas_mm().error("Len is less than one");
return 0;
} else {
uint8_t octet = (*buf);
......@@ -91,7 +93,7 @@ int IMEISV_Request::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
_iei = 0;
}
_value = octet & 0x07;
Logger::nas_mm().debug("decoded IMEISV_Request value(0x%x)", _value);
Logger::nas_mm().debug("Decoded IMEISV_Request value (0x%x)", _value);
return 1;
}
}
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
LADN_Indication::LADN_Indication(uint8_t iei) {
_iei = iei;
_iei = iei;
length = 0;
LADN = {};
}
//------------------------------------------------------------------------------
......@@ -46,7 +48,7 @@ LADN_Indication::LADN_Indication(const uint8_t iei, std::vector<bstring> ladn) {
}
//------------------------------------------------------------------------------
LADN_Indication::LADN_Indication() {}
LADN_Indication::LADN_Indication() : _iei(), length(), LADN() {}
//------------------------------------------------------------------------------
LADN_Indication::~LADN_Indication() {}
......@@ -65,9 +67,9 @@ bool LADN_Indication::getValue(std::vector<bstring>& ladn) {
//------------------------------------------------------------------------------
int LADN_Indication::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("encoding LADN_Indication iei(0x%x)", _iei);
Logger::nas_mm().debug("Encoding LADN_Indication iei (0x%x)", _iei);
if (len < length) {
Logger::nas_mm().error("len is less than %d", length);
Logger::nas_mm().error("Len is less than %d", length);
return 0;
}
int encoded_size = 0;
......@@ -88,13 +90,13 @@ int LADN_Indication::encode2buffer(uint8_t* buf, int len) {
// *(buf + encoded_size) = length - 1; encoded_size++;
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
}
Logger::nas_mm().debug("encoded LADN_Indication len(%d)", encoded_size);
Logger::nas_mm().debug("Encoded LADN_Indication len (%d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int LADN_Indication::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding LADN_Indication iei(0x%x)", *buf);
Logger::nas_mm().debug("Decoding LADN_Indication iei (0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
......@@ -104,7 +106,7 @@ int LADN_Indication::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
decoded_size++;
length |= (*(buf + decoded_size)) << 8;
decoded_size++;
Logger::nas_mm().debug("decoded LADN_Indication len(%d)", length);
Logger::nas_mm().debug("Decoded LADN_Indication len (%d)", length);
int LEAGTH = length;
uint8_t len_dnn;
bstring dnn;
......@@ -120,10 +122,10 @@ int LADN_Indication::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
for (int i = 0; i < LADN.size(); i++) {
for (int j = 0; j < blength(LADN.at(i)); j++) {
Logger::nas_mm().debug(
"decoded LADN_Indication value(0x%x)",
(uint8_t*) LADN.at(i)->data[j]);
"Decoded LADN_Indication value (0x%x)",
(uint8_t) LADN.at(i)->data[j]);
}
}
Logger::nas_mm().debug("decoded LADN_Indication len(%d)", decoded_size);
Logger::nas_mm().debug("Decoded LADN_Indication len (%d)", decoded_size);
return decoded_size;
}
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
MA_PDU_Session_Information::MA_PDU_Session_Information(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,10 @@ MA_PDU_Session_Information::MA_PDU_Session_Information(
}
//------------------------------------------------------------------------------
MA_PDU_Session_Information::MA_PDU_Session_Information() {}
MA_PDU_Session_Information::MA_PDU_Session_Information() {
_iei = 0;
_value = 0;
}
//------------------------------------------------------------------------------
MA_PDU_Session_Information::~MA_PDU_Session_Information() {}
......
......@@ -52,9 +52,9 @@ MICO_Indication::~MICO_Indication(){};
//------------------------------------------------------------------------------
int MICO_Indication::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("encoding MICO_Indication IE iei(0x%x)", iei);
Logger::nas_mm().debug("Encoding MICO_Indication IE iei (0x%x)", iei);
if (len < 1) {
Logger::nas_mm().error("len is less than one");
Logger::nas_mm().error("Len is less than one");
return -1;
} else {
uint8_t octet = 0;
......@@ -66,17 +66,18 @@ int MICO_Indication::encode2buffer(uint8_t* buf, int len) {
} else {
octet = (iei << 4) | (SPRTI << 1) | RAAI;
*buf = octet;
Logger::nas_mm().debug("encoded MICO_Indication IE(len(1 octet))");
Logger::nas_mm().debug("Encoded MICO_Indication IE (len: 1 octet)");
return 1;
}
}
return 1;
}
//------------------------------------------------------------------------------
int MICO_Indication::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding MICO_Indication IE");
Logger::nas_mm().debug("Decoding MICO_Indication IE");
if (len < 1) {
Logger::nas_mm().error("len is less than one");
Logger::nas_mm().error("Len is less than one");
return 0;
} else {
uint8_t octet = (*buf);
......@@ -88,8 +89,8 @@ int MICO_Indication::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
SPRTI = octet & 0x02;
RAAI = octet & 0x01;
Logger::nas_mm().debug(
"decoded MICO_Indication iei(0x%x) sprti(0x%x) raai(0x%x)", iei, SPRTI,
RAAI);
"decoded MICO_Indication iei (0x%x) sprti (0x%x) raai (0x%x)", iei,
SPRTI, RAAI);
return 1;
}
}
......
......@@ -31,8 +31,9 @@
using namespace nas;
//------------------------------------------------------------------------------
NAS_Message_Container::NAS_Message_Container(uint8_t iei) {
_iei = iei;
NAS_Message_Container::NAS_Message_Container(uint8_t iei) : _value() {
_iei = iei;
length = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,7 @@ NAS_Message_Container::NAS_Message_Container(const uint8_t iei, bstring value) {
}
//------------------------------------------------------------------------------
NAS_Message_Container::NAS_Message_Container() {}
NAS_Message_Container::NAS_Message_Container() : _iei(), length(), _value() {}
//------------------------------------------------------------------------------
NAS_Message_Container::~NAS_Message_Container() {}
......@@ -63,7 +64,7 @@ void NAS_Message_Container::getValue(bstring& value) {
int NAS_Message_Container::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("Encoding NAS_Message_Container IEI 0x%x", _iei);
if (len < length) {
Logger::nas_mm().error("len is less than %d", length);
Logger::nas_mm().error("Len is less than %d", length);
return 0;
}
int encoded_size = 0;
......@@ -89,7 +90,7 @@ int NAS_Message_Container::encode2buffer(uint8_t* buf, int len) {
//------------------------------------------------------------------------------
int NAS_Message_Container::decodefrombuffer(
uint8_t* buf, int len, bool is_option) {
Logger::nas_mm().debug("Decoding NAS_Message_Container iei(0x%x)", *buf);
Logger::nas_mm().debug("Decoding NAS_Message_Container iei (0x%x)", *buf);
int decoded_size = 0;
if (is_option) {
decoded_size++;
......@@ -103,7 +104,7 @@ int NAS_Message_Container::decodefrombuffer(
decoded_size += length;
for (int i = 0; i < length; i++) {
Logger::nas_mm().debug(
"Decoded NAS_Message_Container value 0x%x", (uint8_t*) _value->data[i]);
"Decoded NAS_Message_Container value 0x%x", (uint8_t) _value->data[i]);
}
Logger::nas_mm().debug(
"Decoded NAS_Message_Container (len %d)", decoded_size);
......
......@@ -34,7 +34,9 @@ using namespace std;
//------------------------------------------------------------------------------
NSSAI::NSSAI(uint8_t iei) {
_iei = iei;
_iei = iei;
length = 0;
S_NSSAI = {};
}
//------------------------------------------------------------------------------
......@@ -51,7 +53,7 @@ NSSAI::NSSAI(const uint8_t iei, std::vector<struct SNSSAI_s> nssai) {
}
//------------------------------------------------------------------------------
NSSAI::NSSAI() {}
NSSAI::NSSAI() : _iei(), length(), S_NSSAI() {}
//------------------------------------------------------------------------------
NSSAI::~NSSAI() {}
......@@ -60,7 +62,7 @@ NSSAI::~NSSAI() {}
void NSSAI::setS_NAASI(uint8_t SST) {}
//------------------------------------------------------------------------------
bool NSSAI::getValue(std::vector<struct SNSSAI_s>& nssai) {
void NSSAI::getValue(std::vector<struct SNSSAI_s>& nssai) {
nssai.assign(S_NSSAI.begin(), S_NSSAI.end());
}
......
......@@ -42,7 +42,7 @@ class NSSAI {
void setS_NAASI(uint8_t SST);
int encode2buffer(uint8_t* buf, int len);
int decodefrombuffer(uint8_t* buf, int len, bool is_option);
bool getValue(std::vector<struct SNSSAI_s>& nssai);
void getValue(std::vector<struct SNSSAI_s>& nssai);
private:
uint8_t _iei;
......
......@@ -54,9 +54,9 @@ uint8_t NSSAI_Inclusion_Mode::getValue() {
//------------------------------------------------------------------------------
int NSSAI_Inclusion_Mode::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("encoding NSSAI_Inclusion_Mode IE iei(0x%x)", _iei);
Logger::nas_mm().debug("Encoding NSSAI_Inclusion_Mode IE iei (0x%x)", _iei);
if (len < 1) {
Logger::nas_mm().error("len is less than one");
Logger::nas_mm().error("Len is less than one");
return -1;
} else {
uint8_t octet = 0;
......@@ -68,18 +68,19 @@ int NSSAI_Inclusion_Mode::encode2buffer(uint8_t* buf, int len) {
} else {
octet = (_iei << 4) | (_value & 0x0f);
*buf = octet;
Logger::nas_mm().debug("encoded NSSAI_Inclusion_Mode IE(len(1 octet))");
Logger::nas_mm().debug("Encoded NSSAI_Inclusion_Mode IE(len, 1 octet)");
return 1;
}
}
return 1;
}
//------------------------------------------------------------------------------
int NSSAI_Inclusion_Mode::decodefrombuffer(
uint8_t* buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding NSSAI_Inclusion_Mode IE");
Logger::nas_mm().debug("Decoding NSSAI_Inclusion_Mode IE");
if (len < 1) {
Logger::nas_mm().error("len is less than one");
Logger::nas_mm().error("Len is less than one");
return 0;
} else {
uint8_t octet = (*buf);
......@@ -90,7 +91,7 @@ int NSSAI_Inclusion_Mode::decodefrombuffer(
}
_value = octet & 0x0f;
Logger::nas_mm().debug(
"decoded NSSAI_Inclusion_Mode iei(0x%x) value(0x%x)", _iei, _value);
"Decoded NSSAI_Inclusion_Mode iei (0x%x) value (0x%x)", _iei, _value);
return 1;
}
}
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
Network_Slicing_Indication::Network_Slicing_Indication(uint8_t iei) {
_iei = iei;
_iei = iei;
DCNI = false;
NSSCI = false;
}
//------------------------------------------------------------------------------
......@@ -44,7 +46,8 @@ Network_Slicing_Indication::Network_Slicing_Indication(
}
//------------------------------------------------------------------------------
Network_Slicing_Indication::Network_Slicing_Indication() {}
Network_Slicing_Indication::Network_Slicing_Indication()
: _iei(), DCNI(), NSSCI() {}
//------------------------------------------------------------------------------
Network_Slicing_Indication::~Network_Slicing_Indication() {}
......@@ -71,7 +74,8 @@ bool Network_Slicing_Indication::getNSSCI() {
//------------------------------------------------------------------------------
int Network_Slicing_Indication::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("encoding Network_Slicing_Indication iei(0x%x)", _iei);
Logger::nas_mm().debug(
"Encoding Network_Slicing_Indication iei (0x%x)", _iei);
if (len < 1) {
// Logger::nas_mm().error("len is less than %d", length);
return 0;
......@@ -85,20 +89,21 @@ int Network_Slicing_Indication::encode2buffer(uint8_t* buf, int len) {
} else {
octet = (_iei << 4) | (DCNI << 1) | NSSCI;
Logger::nas_mm().debug(
"decoded Network_Slicing_Indication DCNI(0x%x) NSSCI(0x%x)", octet,
"Decoded Network_Slicing_Indication DCNI (0x%x) NSSCI (0x%x)", octet,
NSSCI);
*buf = octet;
Logger::nas_mm().debug(
"encoded Network_Slicing_Indication IE(len(1 octet))");
"Encoded Network_Slicing_Indication IE (len, 1 octet)");
return 1;
}
return 1;
}
//------------------------------------------------------------------------------
int Network_Slicing_Indication::decodefrombuffer(
uint8_t* buf, int len, bool is_option) {
if (len < 1) {
Logger::nas_mm().error("len is less than one");
Logger::nas_mm().error("Len is less than one");
return 0;
} else {
uint8_t octet = (*buf);
......@@ -112,7 +117,7 @@ int Network_Slicing_Indication::decodefrombuffer(
DCNI = octet & 0x02;
NSSCI = octet & 0x01;
Logger::nas_mm().debug(
"decoded Network_Slicing_Indication DCNI(0x%x) NSSCI(0x%x)", DCNI,
"Decoded Network_Slicing_Indication DCNI (0x%x) NSSCI (0x%x)", DCNI,
NSSCI);
return 1;
}
......
......@@ -56,9 +56,9 @@ uint8_t Non_3GPP_NW_Provided_Policies::getValue() {
//------------------------------------------------------------------------------
int Non_3GPP_NW_Provided_Policies::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug(
"encoding Non_3GPP_NW_Provided_Policies IE iei(0x%x)", _iei);
"Encoding Non_3GPP_NW_Provided_Policies IE iei(0x%x)", _iei);
if (len < 1) {
Logger::nas_mm().error("len is less than one");
Logger::nas_mm().error("Len is less than one");
return -1;
} else {
uint8_t octet = 0;
......@@ -71,18 +71,19 @@ int Non_3GPP_NW_Provided_Policies::encode2buffer(uint8_t* buf, int len) {
octet = (_iei << 4) | (_value & 0x0f);
*buf = octet;
Logger::nas_mm().debug(
"encoded Non_3GPP_NW_Provided_Policies IE(len(1 octet))");
"Encoded Non_3GPP_NW_Provided_Policies IE (len, 1 octet)");
return 1;
}
}
return 1;
}
//------------------------------------------------------------------------------
int Non_3GPP_NW_Provided_Policies::decodefrombuffer(
uint8_t* buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding Non_3GPP_NW_Provided_Policies IE");
Logger::nas_mm().debug("Decoding Non_3GPP_NW_Provided_Policies IE");
if (len < 1) {
Logger::nas_mm().error("len is less than one");
Logger::nas_mm().error("Len is less than one");
return 0;
} else {
uint8_t octet = (*buf);
......@@ -93,7 +94,7 @@ int Non_3GPP_NW_Provided_Policies::decodefrombuffer(
}
_value = octet & 0x0f;
Logger::nas_mm().debug(
"decoded Non_3GPP_NW_Provided_Policies iei(0x%x) value(0x%x)", _iei,
"Decoded Non_3GPP_NW_Provided_Policies iei (0x%x) value (0x%x)", _iei,
_value);
return 1;
}
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
PDU_Session_Identity_2::PDU_Session_Identity_2(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,10 @@ PDU_Session_Identity_2::PDU_Session_Identity_2(
}
//------------------------------------------------------------------------------
PDU_Session_Identity_2::PDU_Session_Identity_2() {}
PDU_Session_Identity_2::PDU_Session_Identity_2() {
_iei = 0;
_value = 0;
}
//------------------------------------------------------------------------------
PDU_Session_Identity_2::~PDU_Session_Identity_2() {}
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
PDU_Session_Reactivation_Result::PDU_Session_Reactivation_Result(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
length = 0;
}
//------------------------------------------------------------------------------
......@@ -44,7 +46,11 @@ PDU_Session_Reactivation_Result::PDU_Session_Reactivation_Result(
}
//------------------------------------------------------------------------------
PDU_Session_Reactivation_Result::PDU_Session_Reactivation_Result() {}
PDU_Session_Reactivation_Result::PDU_Session_Reactivation_Result() {
_iei = 0;
_value = 0;
length = 0;
}
//------------------------------------------------------------------------------
PDU_Session_Reactivation_Result::~PDU_Session_Reactivation_Result() {}
......
......@@ -33,7 +33,10 @@ using namespace nas;
//------------------------------------------------------------------------------
PDU_Session_Reactivation_Result_Error_Cause::
PDU_Session_Reactivation_Result_Error_Cause(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
SESSION_ID = 0;
length = 0;
}
//------------------------------------------------------------------------------
......@@ -48,7 +51,12 @@ PDU_Session_Reactivation_Result_Error_Cause::
//------------------------------------------------------------------------------
PDU_Session_Reactivation_Result_Error_Cause::
PDU_Session_Reactivation_Result_Error_Cause() {}
PDU_Session_Reactivation_Result_Error_Cause() {
_iei = 0;
_value = 0;
SESSION_ID = 0;
length = 0;
}
//------------------------------------------------------------------------------
PDU_Session_Reactivation_Result_Error_Cause::
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
PDU_Session_Status::PDU_Session_Status(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
length = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +45,11 @@ PDU_Session_Status::PDU_Session_Status(const uint8_t iei, uint16_t value) {
}
//------------------------------------------------------------------------------
PDU_Session_Status::PDU_Session_Status() {}
PDU_Session_Status::PDU_Session_Status() {
_iei = 0;
_value = 0;
length = 0;
}
//------------------------------------------------------------------------------
PDU_Session_Status::~PDU_Session_Status() {}
......
......@@ -32,7 +32,10 @@ using namespace nas;
//------------------------------------------------------------------------------
PLMN_List::PLMN_List(uint8_t iei) {
_iei = iei;
_iei = iei;
_MNC_MCC1 = 0;
_MNC_MCC2 = 0;
_MNC_MCC3 = 0;
}
//------------------------------------------------------------------------------
......@@ -45,7 +48,12 @@ PLMN_List::PLMN_List(
}
//------------------------------------------------------------------------------
PLMN_List::PLMN_List() {}
PLMN_List::PLMN_List() {
_iei = 0;
_MNC_MCC1 = 0;
_MNC_MCC2 = 0;
_MNC_MCC3 = 0;
}
//------------------------------------------------------------------------------
PLMN_List::~PLMN_List() {}
......
......@@ -31,14 +31,17 @@
using namespace nas;
//------------------------------------------------------------------------------
Payload_Container::Payload_Container(uint8_t iei) {
_iei = iei;
Payload_Container::Payload_Container(uint8_t iei) : content() {
_iei = iei;
length = 0;
CONTENT = {};
}
//------------------------------------------------------------------------------
Payload_Container::Payload_Container(uint8_t iei, bstring b) {
_iei = iei;
content = b;
CONTENT = {};
}
//------------------------------------------------------------------------------
......@@ -60,7 +63,10 @@ Payload_Container::Payload_Container(
}
//------------------------------------------------------------------------------
Payload_Container::Payload_Container() {}
Payload_Container::Payload_Container() : content() {
_iei = 0;
CONTENT = {};
}
//------------------------------------------------------------------------------
Payload_Container::~Payload_Container() {}
......@@ -83,7 +89,7 @@ void Payload_Container::getValue(bstring& cnt) {
//------------------------------------------------------------------------------
int Payload_Container::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("encoding Payload_Container iei(0x%x)", _iei);
Logger::nas_mm().debug("Encoding Payload_Container iei(0x%x)", _iei);
if (len < length) {
// Logger::nas_mm().error("len is less than %d", length);
// return 0;
......@@ -147,19 +153,20 @@ int Payload_Container::encode2buffer(uint8_t* buf, int len) {
}
}
#endif
Logger::nas_mm().debug("encoded Payload_Container len(%d)", encoded_size);
Logger::nas_mm().debug("Encoded Payload_Container len(%d)", encoded_size);
return encoded_size;
}
//------------------------------------------------------------------------------
int Payload_Container::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
return 0;
}
//------------------------------------------------------------------------------
int Payload_Container::decodefrombuffer(
uint8_t* buf, int len, bool is_option, uint8_t type) {
Logger::nas_mm().debug("decoding Payload_Container iei(0x%x)", _iei);
Logger::nas_mm().debug("Decoding Payload_Container iei (0x%x)", _iei);
int decoded_size = 0;
if (is_option) {
decoded_size++;
......@@ -211,7 +218,6 @@ int Payload_Container::decodefrombuffer(
CONTENT.insert(CONTENT.end(), payloadcontainerentry);
num_entries--;
}
// Logger::nas_mm().debug("decoded Payload_Container value(0x%x)", _value);
Logger::nas_mm().debug("decoded Payload_Container len(%d)", decoded_size);
Logger::nas_mm().debug("Decoded Payload_Container len (%d)", decoded_size);
return decoded_size;
}
......@@ -32,7 +32,11 @@ using namespace nas;
//------------------------------------------------------------------------------
Rejected_NSSAI::Rejected_NSSAI(uint8_t iei) {
_iei = iei;
_iei = iei;
length = 0;
_s_nssai_SST = 0;
_s_nssai_length = 0;
_cause = 0;
}
//------------------------------------------------------------------------------
......@@ -45,7 +49,13 @@ Rejected_NSSAI::Rejected_NSSAI(const uint8_t iei, uint8_t cause, uint8_t SST) {
}
//------------------------------------------------------------------------------
Rejected_NSSAI::Rejected_NSSAI() {}
Rejected_NSSAI::Rejected_NSSAI() {
_iei = 0;
length = 0;
_s_nssai_SST = 0;
_s_nssai_length = 0;
_cause = 0;
}
//------------------------------------------------------------------------------
Rejected_NSSAI::~Rejected_NSSAI() {}
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
Release_Assistance_Indication::Release_Assistance_Indication(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,10 @@ Release_Assistance_Indication::Release_Assistance_Indication(
}
//------------------------------------------------------------------------------
Release_Assistance_Indication::Release_Assistance_Indication() {}
Release_Assistance_Indication::Release_Assistance_Indication() {
_iei = 0;
_value = 0;
}
//------------------------------------------------------------------------------
Release_Assistance_Indication::~Release_Assistance_Indication() {}
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
Request_Type::Request_Type(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -42,7 +43,10 @@ Request_Type::Request_Type(const uint8_t iei, uint8_t value) {
}
//------------------------------------------------------------------------------
Request_Type::Request_Type() {}
Request_Type::Request_Type() {
_iei = 0;
_value = 0;
}
//------------------------------------------------------------------------------
Request_Type::~Request_Type() {}
......
......@@ -34,11 +34,19 @@ using namespace std;
//------------------------------------------------------------------------------
S1_UE_Security_Capability::S1_UE_Security_Capability(uint8_t iei) {
_iei = iei;
_iei = iei;
_5g_EEASel = 0;
_5g_EIASel = 0;
length = 0;
}
//------------------------------------------------------------------------------
S1_UE_Security_Capability::S1_UE_Security_Capability() {}
S1_UE_Security_Capability::S1_UE_Security_Capability() {
_iei = 0;
_5g_EEASel = 0;
_5g_EIASel = 0;
length = 0;
}
//------------------------------------------------------------------------------
S1_UE_Security_Capability::~S1_UE_Security_Capability() {}
......
......@@ -31,8 +31,9 @@
using namespace nas;
//------------------------------------------------------------------------------
SOR_Transparent_Container::SOR_Transparent_Container(uint8_t iei) {
_iei = iei;
SOR_Transparent_Container::SOR_Transparent_Container(uint8_t iei) : _value() {
_iei = iei;
HEADER = 0;
}
//------------------------------------------------------------------------------
......@@ -46,7 +47,8 @@ SOR_Transparent_Container::SOR_Transparent_Container(
}
//------------------------------------------------------------------------------
SOR_Transparent_Container::SOR_Transparent_Container() {}
SOR_Transparent_Container::SOR_Transparent_Container()
: _iei(), HEADER(), _value() {}
//------------------------------------------------------------------------------
SOR_Transparent_Container::~SOR_Transparent_Container() {}
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
S_NSSAI::S_NSSAI(uint8_t iei) {
_iei = iei;
_iei = iei;
length = 0;
SNSSAI = {};
}
//------------------------------------------------------------------------------
......@@ -52,7 +54,11 @@ S_NSSAI::S_NSSAI(const uint8_t iei, SNSSAI_s snssai) {
}
//------------------------------------------------------------------------------
S_NSSAI::S_NSSAI() {}
S_NSSAI::S_NSSAI() {
_iei = 0;
length = 0;
SNSSAI = {};
}
//------------------------------------------------------------------------------
S_NSSAI::~S_NSSAI() {}
......
......@@ -70,6 +70,7 @@ int ServiceType::decodefrombuffer(
value = (*buf) & 0x0f;
return 0;
}
return 0;
}
//------------------------------------------------------------------------------
......
......@@ -34,11 +34,19 @@ using namespace std;
//------------------------------------------------------------------------------
UENetworkCapability::UENetworkCapability(uint8_t iei) {
_iei = iei;
_iei = iei;
_5g_EEASel = 0;
_5g_EIASel = 0;
length = 0;
}
//------------------------------------------------------------------------------
UENetworkCapability::UENetworkCapability() {}
UENetworkCapability::UENetworkCapability() {
_iei = 0;
_5g_EEASel = 0;
_5g_EIASel = 0;
length = 0;
}
//------------------------------------------------------------------------------
UENetworkCapability::~UENetworkCapability() {}
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
UES_Usage_Setting::UES_Usage_Setting(uint8_t iei) {
_iei = iei;
_iei = iei;
_ues_usage_setting = false;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,10 @@ UES_Usage_Setting::UES_Usage_Setting(
}
//------------------------------------------------------------------------------
UES_Usage_Setting::UES_Usage_Setting() {}
UES_Usage_Setting::UES_Usage_Setting() {
_iei = 0;
_ues_usage_setting = false;
}
//------------------------------------------------------------------------------
UES_Usage_Setting::~UES_Usage_Setting() {}
......
......@@ -32,11 +32,19 @@ using namespace nas;
//------------------------------------------------------------------------------
UESecurityCapability::UESecurityCapability(uint8_t iei) {
_iei = iei;
_iei = iei;
_5g_EASel = 0;
_5g_IASel = 0;
length = 0;
}
//------------------------------------------------------------------------------
UESecurityCapability::UESecurityCapability() {}
UESecurityCapability::UESecurityCapability() {
_iei = 0;
_5g_EASel = 0;
_5g_IASel = 0;
length = 0;
}
//------------------------------------------------------------------------------
UESecurityCapability::~UESecurityCapability() {}
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
UE_Radio_Capability_ID::UE_Radio_Capability_ID(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +44,10 @@ UE_Radio_Capability_ID::UE_Radio_Capability_ID(
}
//------------------------------------------------------------------------------
UE_Radio_Capability_ID::UE_Radio_Capability_ID() {}
UE_Radio_Capability_ID::UE_Radio_Capability_ID() {
_iei = 0;
_value = 0;
}
//------------------------------------------------------------------------------
UE_Radio_Capability_ID::~UE_Radio_Capability_ID() {}
......
......@@ -33,6 +33,8 @@ using namespace nas;
//------------------------------------------------------------------------------
UE_Status::UE_Status(uint8_t iei) {
_iei = iei;
S1 = false;
N1 = false;
}
//------------------------------------------------------------------------------
......@@ -43,7 +45,11 @@ UE_Status::UE_Status(const uint8_t iei, bool n1, bool s1) {
}
//------------------------------------------------------------------------------
UE_Status::UE_Status() {}
UE_Status::UE_Status() {
_iei = 0;
S1 = false;
N1 = false;
}
//------------------------------------------------------------------------------
UE_Status::~UE_Status() {}
......
......@@ -32,7 +32,9 @@ using namespace nas;
//------------------------------------------------------------------------------
UplinkDataStatus::UplinkDataStatus(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
length = 0;
}
//------------------------------------------------------------------------------
......@@ -43,7 +45,11 @@ UplinkDataStatus::UplinkDataStatus(const uint8_t iei, uint16_t value) {
}
//------------------------------------------------------------------------------
UplinkDataStatus::UplinkDataStatus() {}
UplinkDataStatus::UplinkDataStatus() {
_iei = 0;
_value = 0;
length = 0;
}
//-----------------------------------------------------------------------------
UplinkDataStatus::~UplinkDataStatus() {}
......
......@@ -86,10 +86,11 @@ int _5GSDeregistrationType::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().error("Encoding 5GSDeregistrationType IE");
if (len < 1) {
Logger::nas_mm().error(
"encoding 5GSDeregistrationType error(len is less than one)");
"Encoding 5GSDeregistrationType error (len is less than one)");
return -1;
}
*buf = u1.b;
return 0;
}
//------------------------------------------------------------------------------
......
......@@ -94,11 +94,15 @@ int _5GSTrackingAreaIdList::encode_00_type(
//------------------------------------------------------------------------------
int _5GSTrackingAreaIdList::encode_01_type(
p_tai_t item, uint8_t* buf, int len) {}
p_tai_t item, uint8_t* buf, int len) {
return 1;
}
//------------------------------------------------------------------------------
int _5GSTrackingAreaIdList::encode_10_type(
p_tai_t item, uint8_t* buf, int len) {}
p_tai_t item, uint8_t* buf, int len) {
return 1;
}
//------------------------------------------------------------------------------
int _5GSTrackingAreaIdList::encode_mcc_mnc(
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
_5GS_DRX_arameters::_5GS_DRX_arameters(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -42,7 +43,10 @@ _5GS_DRX_arameters::_5GS_DRX_arameters(const uint8_t iei, uint8_t value) {
}
//------------------------------------------------------------------------------
_5GS_DRX_arameters::_5GS_DRX_arameters() {}
_5GS_DRX_arameters::_5GS_DRX_arameters() {
_iei = 0;
_value = 0;
}
_5GS_DRX_arameters::~_5GS_DRX_arameters() {}
//------------------------------------------------------------------------------
......
......@@ -32,7 +32,8 @@ using namespace nas;
//------------------------------------------------------------------------------
_5GS_Identity_Type::_5GS_Identity_Type(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -42,7 +43,10 @@ _5GS_Identity_Type::_5GS_Identity_Type(const uint8_t iei, uint8_t value) {
}
//------------------------------------------------------------------------------
_5GS_Identity_Type::_5GS_Identity_Type() {}
_5GS_Identity_Type::_5GS_Identity_Type() {
_iei = 0;
_value = 0;
}
//------------------------------------------------------------------------------
_5GS_Identity_Type::~_5GS_Identity_Type() {}
......
......@@ -32,11 +32,21 @@ using namespace nas;
//------------------------------------------------------------------------------
_5GS_Network_Feature_Support::_5GS_Network_Feature_Support(uint8_t iei) {
_iei = iei;
_iei = iei;
_value = 0;
_value2 = 0;
length = 0;
}
//------------------------------------------------------------------------------
_5GS_Network_Feature_Support::_5GS_Network_Feature_Support() {
_iei = 0;
_value = 0;
_value2 = 0;
length = 0;
}
//------------------------------------------------------------------------------
_5GS_Network_Feature_Support::_5GS_Network_Feature_Support() {}
_5GS_Network_Feature_Support::~_5GS_Network_Feature_Support() {}
//------------------------------------------------------------------------------
......
......@@ -32,7 +32,11 @@ using namespace nas;
//------------------------------------------------------------------------------
_5GS_Registration_Result::_5GS_Registration_Result(uint8_t iei) {
_iei = iei;
_iei = iei;
Emergency = false;
NSSAA = false;
SMS = false;
_value = 0;
}
//------------------------------------------------------------------------------
......@@ -46,7 +50,13 @@ _5GS_Registration_Result::_5GS_Registration_Result(
}
//------------------------------------------------------------------------------
_5GS_Registration_Result::_5GS_Registration_Result() {}
_5GS_Registration_Result::_5GS_Registration_Result() {
_iei = 0;
Emergency = false;
NSSAA = false;
SMS = false;
_value = 0;
}
_5GS_Registration_Result::~_5GS_Registration_Result() {}
//------------------------------------------------------------------------------
......
......@@ -32,7 +32,13 @@ using namespace nas;
//------------------------------------------------------------------------------
_5GS_Tracking_Area_Identity::_5GS_Tracking_Area_Identity(uint8_t iei) {
_iei = iei;
_iei = iei;
_MNC_MCC1 = 0;
_MNC_MCC2 = 0;
_MNC_MCC3 = 0;
_TAC1 = 0;
_TAC2 = 0;
_TAC3 = 0;
}
//------------------------------------------------------------------------------
......@@ -55,7 +61,15 @@ _5GS_Tracking_Area_Identity::_5GS_Tracking_Area_Identity(
}
//------------------------------------------------------------------------------
_5GS_Tracking_Area_Identity::_5GS_Tracking_Area_Identity() {}
_5GS_Tracking_Area_Identity::_5GS_Tracking_Area_Identity() {
_iei = 0;
_MNC_MCC1 = 0;
_MNC_MCC2 = 0;
_MNC_MCC3 = 0;
_TAC1 = 0;
_TAC2 = 0;
_TAC3 = 0;
}
_5GS_Tracking_Area_Identity::~_5GS_Tracking_Area_Identity() {}
//------------------------------------------------------------------------------
......
......@@ -34,11 +34,23 @@ using namespace std;
//------------------------------------------------------------------------------
_5GS_Update_Type::_5GS_Update_Type(uint8_t iei) {
_iei = iei;
_iei = iei;
EPS_PNB_CIoT = 0;
_5GS_PNB_CIoT = 0;
NG_RAN = false;
SMS = false;
length = 0;
}
//------------------------------------------------------------------------------
_5GS_Update_Type::_5GS_Update_Type() {}
_5GS_Update_Type::_5GS_Update_Type() {
_iei = 0;
EPS_PNB_CIoT = 0;
_5GS_PNB_CIoT = 0;
NG_RAN = false;
SMS = false;
length = 0;
}
//------------------------------------------------------------------------------
_5GS_Update_Type::~_5GS_Update_Type() {}
......
......@@ -143,4 +143,5 @@ int AuthenticationFailure::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded AuthenticationFailure message len (%d)", decoded_size);
return 1;
}
......@@ -102,4 +102,5 @@ int AuthenticationReject::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded AuthenticationReject message len (%d)", decoded_size);
return 1;
}
......@@ -203,4 +203,5 @@ int AuthenticationRequest::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded AuthenticationRequest message (len %d)", decoded_size);
return 1;
}
......@@ -152,4 +152,5 @@ int AuthenticationResponse::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded AuthenticationResponse message len (%d)", decoded_size);
return 1;
}
......@@ -143,4 +143,5 @@ int AuthenticationResult::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded AuthenticationResult message len (%d)", decoded_size);
return 1;
}
......@@ -71,4 +71,5 @@ int DeregistrationAccept::decodefrombuffer(
plain_header = header;
Logger::nas_mm().debug(
"decoded De-registrationReject message len (%d)", decoded_size);
return 1;
}
......@@ -92,4 +92,5 @@ int IdentityRequest::decodefrombuffer(
Logger::nas_mm().debug("decoded_size(%d)", decoded_size);
Logger::nas_mm().debug(
"decoded IdentityRequest message len(%d)", decoded_size);
return 1;
}
......@@ -35,34 +35,35 @@ using namespace nas;
//------------------------------------------------------------------------------
RegistrationAccept::RegistrationAccept() {
plain_header = NULL;
ie_5gs_registration_result = NULL;
ie_5g_guti = NULL;
ie_equivalent_plmns = NULL;
ie_allowed_nssai = NULL;
ie_rejected_nssai = NULL;
ie_configured_nssai = NULL;
ie_5gs_network_feature_support = NULL;
ie_PDU_session_status = NULL;
ie_pdu_session_reactivation_result = NULL;
ie_pdu_session_reactivation_result_error_cause = NULL;
ie_MICO_indicationl = NULL;
ie_network_slicing_indication = NULL;
ie_T3512_value = NULL;
ie_Non_3GPP_de_registration_timer_value = NULL;
ie_T3502_value = NULL;
ie_sor_transparent_container = NULL;
ie_eap_message = NULL;
ie_nssai_inclusion_mode = NULL;
ie_negotiated_drx_parameters = NULL;
ie_non_3gpp_nw_policies = NULL;
ie_eps_bearer_context_status = NULL;
ie_extended_drx_parameters = NULL;
ie_T3447_value = NULL;
ie_T3448_value = NULL;
ie_T3324_value = NULL;
ie_ue_radio_capability_id = NULL;
ie_pending_nssai = NULL;
plain_header = nullptr;
ie_5gs_registration_result = nullptr;
ie_5g_guti = nullptr;
ie_equivalent_plmns = nullptr;
ie_allowed_nssai = nullptr;
ie_rejected_nssai = nullptr;
ie_configured_nssai = nullptr;
ie_5gs_network_feature_support = nullptr;
ie_PDU_session_status = nullptr;
ie_pdu_session_reactivation_result = nullptr;
ie_pdu_session_reactivation_result_error_cause = nullptr;
ie_MICO_indicationl = nullptr;
ie_network_slicing_indication = nullptr;
ie_T3512_value = nullptr;
ie_Non_3GPP_de_registration_timer_value = nullptr;
ie_T3502_value = nullptr;
ie_sor_transparent_container = nullptr;
ie_eap_message = nullptr;
ie_nssai_inclusion_mode = nullptr;
ie_negotiated_drx_parameters = nullptr;
ie_non_3gpp_nw_policies = nullptr;
ie_eps_bearer_context_status = nullptr;
ie_extended_drx_parameters = nullptr;
ie_T3447_value = nullptr;
ie_T3448_value = nullptr;
ie_T3324_value = nullptr;
ie_ue_radio_capability_id = nullptr;
ie_pending_nssai = nullptr;
ie_tai_list = nullptr;
}
//------------------------------------------------------------------------------
......@@ -842,4 +843,5 @@ int RegistrationAccept::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded RegistrationAccept message len (%d)", decoded_size);
return 1;
}
......@@ -105,4 +105,5 @@ int RegistrationComplete::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded RegistrationComplete message len (%d)", decoded_size);
return 1;
}
......@@ -233,6 +233,7 @@ bool RegistrationRequest::getUeSecurityCapability(uint8_t& ea, uint8_t& ia) {
} else {
return -1;
}
return true;
}
//------------------------------------------------------------------------------
......@@ -249,6 +250,7 @@ bool RegistrationRequest::getRequestedNssai(
} else {
return -1;
}
return true;
}
//------------------------------------------------------------------------------
......@@ -273,6 +275,7 @@ bool RegistrationRequest::getS1UeNetworkCapability(uint8_t& eea, uint8_t& eia) {
} else {
return -1;
}
return true;
}
//------------------------------------------------------------------------------
......@@ -803,7 +806,7 @@ int RegistrationRequest::encode2buffer(uint8_t* buf, int len) {
//------------------------------------------------------------------------------
int RegistrationRequest::decodefrombuffer(
NasMmPlainHeader* header, uint8_t* buf, int len) {
Logger::nas_mm().debug("****Decoding RegistrationRequest message****");
Logger::nas_mm().debug("Decoding RegistrationRequest message");
int decoded_size = 3;
plain_header = header;
ie_5gsregistrationtype = new _5GSRegistrationType();
......@@ -1005,5 +1008,6 @@ int RegistrationRequest::decodefrombuffer(
}
}
Logger::nas_mm().debug(
"****Decoded RegistrationRequest message (len %d)****", decoded_size);
"Decoded RegistrationRequest message (len %d)", decoded_size);
return 1;
}
......@@ -303,4 +303,5 @@ int SecurityModeCommand::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded SecurityModeCommand message len (%d)", decoded_size);
return 1;
}
......@@ -187,4 +187,5 @@ int SecurityModeComplete::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded SecurityModeComplete message len (%d)", decoded_size);
return 1;
}
......@@ -93,4 +93,5 @@ int SecurityModeReject::decodefrombuffer(
Logger::nas_mm().debug("first option iei(0x%x)", octet);
Logger::nas_mm().debug(
"decoded SecurityModeReject message len(%d)", decoded_size);
return 1;
}
......@@ -33,7 +33,16 @@
using namespace nas;
//------------------------------------------------------------------------------
ServiceRequest::ServiceRequest() {}
ServiceRequest::ServiceRequest() {
plain_header = nullptr;
ie_ngKSI = nullptr;
ie_service_type = nullptr;
ie_5g_s_tmsi = nullptr;
ie_uplink_data_status = nullptr;
ie_PDU_session_status = nullptr;
ie_allowed_PDU_session_status = nullptr;
ie_nas_message_container = nullptr;
}
//------------------------------------------------------------------------------
ServiceRequest::~ServiceRequest() {}
......@@ -232,6 +241,7 @@ int ServiceRequest::decodefrombuffer(
}
Logger::nas_mm().debug(
"Decoded ServiceRequest message len (%d)", decoded_size);
return 1;
}
//------------------------------------------------------------------------------
......
......@@ -397,4 +397,5 @@ int ULNASTransport::decodefrombuffer(
}
Logger::nas_mm().debug(
"decoded ULNASTransport message len(%d)", decoded_size);
return 1;
}
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
AMF_UE_NGAP_ID::AMF_UE_NGAP_ID() {}
AMF_UE_NGAP_ID::AMF_UE_NGAP_ID() {
amfUeNgapId = 0;
}
//------------------------------------------------------------------------------
AMF_UE_NGAP_ID::~AMF_UE_NGAP_ID() {}
......
......@@ -35,7 +35,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
AMFPointer::AMFPointer() {}
AMFPointer::AMFPointer() {
pointer = 0;
}
//------------------------------------------------------------------------------
AMFPointer::~AMFPointer() {}
......
......@@ -35,7 +35,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
AMFRegionID::AMFRegionID() {}
AMFRegionID::AMFRegionID() {
regionid = 0;
}
//------------------------------------------------------------------------------
AMFRegionID::~AMFRegionID() {}
......
......@@ -35,7 +35,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
AMFSetID::AMFSetID() {}
AMFSetID::AMFSetID() {
setid = 0;
}
//------------------------------------------------------------------------------
AMFSetID::~AMFSetID() {}
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
AdditionalQosFlowInformation::AdditionalQosFlowInformation() {}
AdditionalQosFlowInformation::AdditionalQosFlowInformation() {
additional = 0;
}
//------------------------------------------------------------------------------
AdditionalQosFlowInformation::~AdditionalQosFlowInformation() {}
......
......@@ -35,9 +35,9 @@ namespace ngap {
//------------------------------------------------------------------------------
AllocationAndRetentionPriority::AllocationAndRetentionPriority() {
priorityLevelARP = NULL;
pre_emptionCapability = NULL;
pre_emptionVulnerability = NULL;
priorityLevelARP = nullptr;
pre_emptionCapability = nullptr;
pre_emptionVulnerability = nullptr;
}
//------------------------------------------------------------------------------
......@@ -87,9 +87,11 @@ bool AllocationAndRetentionPriority::encode2AllocationAndRetentionPriority(
//------------------------------------------------------------------------------
bool AllocationAndRetentionPriority::decodefromAllocationAndRetentionPriority(
Ngap_AllocationAndRetentionPriority_t* allocationAndRetentionPriority) {
priorityLevelARP = new PriorityLevelARP();
pre_emptionCapability = new Pre_emptionCapability();
pre_emptionVulnerability = new Pre_emptionVulnerability();
if (priorityLevelARP == nullptr) priorityLevelARP = new PriorityLevelARP();
if (pre_emptionCapability == nullptr)
pre_emptionCapability = new Pre_emptionCapability();
if (pre_emptionVulnerability == nullptr)
pre_emptionVulnerability = new Pre_emptionVulnerability();
if (!priorityLevelARP->decodefromPriorityLevelARP(
&allocationAndRetentionPriority->priorityLevelARP))
return false;
......
......@@ -84,7 +84,7 @@ bool AssociatedQosFlowItem::encode2AssociatedQosFlowItem(
//------------------------------------------------------------------------------
bool AssociatedQosFlowItem::decodefromAssociatedQosFlowItem(
Ngap_AssociatedQosFlowItem_t* associatedQosFlowItem) {
qosFlowIdentifier = new QosFlowIdentifier();
if (qosFlowIdentifier == nullptr) qosFlowIdentifier = new QosFlowIdentifier();
if (!qosFlowIdentifier->decodefromQosFlowIdentifier(
&associatedQosFlowItem->qosFlowIdentifier))
return false;
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
AveragingWindow::AveragingWindow() {}
AveragingWindow::AveragingWindow() {
averagingwindow = 0;
}
//------------------------------------------------------------------------------
AveragingWindow::~AveragingWindow() {}
......
......@@ -85,7 +85,7 @@ bool BroadcastPLMNItem::encode2BroadcastPLMNItem(
//------------------------------------------------------------------------------
bool BroadcastPLMNItem::decodefromBroadcastPLMNItem(
Ngap_BroadcastPLMNItem_t* pdu) {
plmn = new PlmnId();
if (plmn == nullptr) plmn = new PlmnId();
if (!plmn->decodefromoctetstring(pdu->pLMNIdentity)) return false;
numOfSnssai = pdu->tAISliceSupportList.list.count;
snssai = new S_NSSAI[numOfSnssai]();
......
......@@ -34,7 +34,9 @@ using namespace std;
namespace ngap {
//------------------------------------------------------------------------------
ConfidentialityProtectionIndication::ConfidentialityProtectionIndication() {}
ConfidentialityProtectionIndication::ConfidentialityProtectionIndication() {
indication = 0;
}
//------------------------------------------------------------------------------
ConfidentialityProtectionIndication::~ConfidentialityProtectionIndication() {}
......
......@@ -39,11 +39,11 @@ namespace ngap {
//------------------------------------------------------------------------------
CoreNetworkAssistanceInfo::CoreNetworkAssistanceInfo() {
ueIdentityIndexValue = NULL;
pagingDRX = NULL;
periodicRegUpdateTimer = NULL;
micoModeInd = NULL;
tai = NULL;
ueIdentityIndexValue = nullptr;
pagingDRX = nullptr;
periodicRegUpdateTimer = nullptr;
micoModeInd = nullptr;
tai = nullptr;
numoftai = 0;
}
......@@ -118,8 +118,10 @@ bool CoreNetworkAssistanceInfo::encode2CoreNetworkAssistanceInfo(
//------------------------------------------------------------------------------
bool CoreNetworkAssistanceInfo::decodefromCoreNetworkAssistanceInfo(
Ngap_CoreNetworkAssistanceInformation_t* coreNetworkAssistanceInformation) {
ueIdentityIndexValue = new UEIdentityIndexValue();
periodicRegUpdateTimer = new PeriodicRegistrationUpdateTimer();
if (ueIdentityIndexValue == nullptr)
ueIdentityIndexValue = new UEIdentityIndexValue();
if (periodicRegUpdateTimer == nullptr)
periodicRegUpdateTimer = new PeriodicRegistrationUpdateTimer();
if (!ueIdentityIndexValue->decodefromUEIdentityIndexValue(
&coreNetworkAssistanceInformation->uEIdentityIndexValue))
return false;
......
......@@ -39,6 +39,7 @@ CriticalityDiagnostics::CriticalityDiagnostics() {
triggeringMessageIsSet = false;
procedureCriticalityIsSet = false;
numberOfIEsCriticalityDiagnostics = 0;
iEsCriticalityDiagnostics = nullptr;
}
//------------------------------------------------------------------------------
......
......@@ -76,8 +76,10 @@ bool DLQoSFlowPerTNLInformation::encode2DLQoSFlowPerTNLInformation(
//------------------------------------------------------------------------------
bool DLQoSFlowPerTNLInformation::decodefromDLQoSFlowPerTNLInformation(
Ngap_QosFlowPerTNLInformation_t* qosFlowPerTNLInformation) {
uPTransportLayerInformation = new UpTransportLayerInformation();
associatedQosFlowList = new AssociatedQosFlowList();
if (uPTransportLayerInformation == nullptr)
uPTransportLayerInformation = new UpTransportLayerInformation();
if (associatedQosFlowList == nullptr)
associatedQosFlowList = new AssociatedQosFlowList();
if (!uPTransportLayerInformation->decodefromUpTransportLayerInformation(
qosFlowPerTNLInformation->uPTransportLayerInformation))
return false;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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