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

Merge branch 'develop' into 'n1_message_notify_api'

# Conflicts:
#   src/amf-app/amf_n11.cpp
#   src/amf-app/amf_n11.hpp
parents d4884676 03612dde
# RELEASE NOTES: # # RELEASE NOTES: #
## v1.3.0 -- January 2022 ##
* Periodic Registration Update
* Support for Event Exposure (Registration State Report)
* Implicit Deregistration Timer
* Mobile Reachable Timer
* Mobility Registration Update
* NRF Selection (via NSSF)
* Fix for validation of SMF Info
* Fix RAN UE NGAP Id
* Fix SMF Selection SD
* Fix NSSAI mismatch
* Fix Service Request
* Fix HTTP2
* Fix MCC such as 001
* Docker optimization
## v1.2.1 -- October 2021 ## ## v1.2.1 -- October 2021 ##
* Fix build issue * Fix build issue
......
...@@ -243,9 +243,10 @@ pipeline { ...@@ -243,9 +243,10 @@ pipeline {
} }
myShCmd('sudo podman image prune --force', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) myShCmd('sudo podman image prune --force', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
// Copy the RHEL Host certificates for building // Copy the RHEL Host certificates for building
myShCmd('mkdir -p tmp/ca tmp/entitlement', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) myShCmd('mkdir -p ./etc-pki-entitlement ./rhsm-conf ./rhsm-ca', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
myShCmd('cp /etc/pki/entitlement/*pem tmp/entitlement', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) myShCmd('cp /etc/pki/entitlement/*pem ./etc-pki-entitlement', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
myShCmd('sudo cp /etc/rhsm/ca/redhat-uep.pem tmp/ca', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) myShCmd('sudo cp /etc/rhsm/rhsm.conf ./rhsm-conf', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
myShCmd('sudo cp /etc/rhsm/ca/*.pem ./rhsm-ca', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
myShCmd('sudo podman build --no-cache --target oai-amf --tag oai-amf:' + amf_tag + ' --file docker/Dockerfile.amf.rhel8 --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . > archives/amf_podman_image_build.log 2>&1', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) myShCmd('sudo podman build --no-cache --target oai-amf --tag oai-amf:' + amf_tag + ' --file docker/Dockerfile.amf.rhel8 --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . > archives/amf_podman_image_build.log 2>&1', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
myShCmd('sudo podman image ls >> archives/amf_podman_image_build.log', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) myShCmd('sudo podman image ls >> archives/amf_podman_image_build.log', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
if ("MERGE".equals(env.gitlabActionType)) { if ("MERGE".equals(env.gitlabActionType)) {
...@@ -439,6 +440,36 @@ pipeline { ...@@ -439,6 +440,36 @@ pipeline {
} }
} }
} }
stage ('Testing the tutorials') {
steps {
script {
gitlabCommitStatus(name: "Test tutorials") {
localStatus = build job: 'OAI-CN5G-Tutorials-Check',
parameters: [
string(name: 'AMF_TAG', value: String.valueOf(amf_tag)),
string(name: 'AMF_BRANCH', value: String.valueOf(amf_branch))
], propagate: false
localResult = localStatus.getResult()
if (localStatus.resultIsBetterOrEqualTo('SUCCESS')) {
echo "Tutorials Test Job is OK"
} else {
echo "Tutorials Test Job is KO"
sh "ci-scripts/fail.sh"
}
}
}
}
post {
always {
script {
copyArtifacts(projectName: 'OAI-CN5G-Tutorials-Check',
filter: '*_results_oai_cn5g*.html',
selector: lastCompleted())
}
}
}
}
} }
} }
// For the moment it is Docker-Hub, but we might have a new one internally. // For the moment it is Docker-Hub, but we might have a new one internally.
......
...@@ -32,8 +32,12 @@ FROM registry.access.redhat.com/ubi8/ubi:latest AS oai-amf-builder ...@@ -32,8 +32,12 @@ FROM registry.access.redhat.com/ubi8/ubi:latest AS oai-amf-builder
ARG NEEDED_GIT_PROXY ARG NEEDED_GIT_PROXY
COPY tmp/ca/redhat-uep.pem /etc/rhsm/ca # Copy the entitlements
COPY tmp/entitlement/*.pem /etc/pki/entitlement COPY ./etc-pki-entitlement /etc/pki/entitlement
# Copy the subscription manager configurations
COPY ./rhsm-conf /etc/rhsm
COPY ./rhsm-ca /etc/rhsm/ca
RUN rm -f /etc/rhsm-host && \ RUN rm -f /etc/rhsm-host && \
yum repolist --disablerepo=* && \ yum repolist --disablerepo=* && \
......
...@@ -126,7 +126,7 @@ AMF = ...@@ -126,7 +126,7 @@ AMF =
EXTERNAL_UDM = "@EXTERNAL_UDM@"; # Set to yes if AMF works with an external UDM EXTERNAL_UDM = "@EXTERNAL_UDM@"; # Set to yes if AMF works with an external UDM
EXTERNAL_NSSF = "@EXTERNAL_NSSF"; # Set to yes if AMF works with an external NSSF EXTERNAL_NSSF = "@EXTERNAL_NSSF"; # Set to yes if AMF works with an external NSSF
USE_FQDN_DNS = "@USE_FQDN_DNS@"; # Set to yes if AMF relies on a DNS to resolve NRF/SMF/UDM/AUSF's FQDN USE_FQDN_DNS = "@USE_FQDN_DNS@"; # Set to yes if AMF relies on a DNS to resolve NRF/SMF/UDM/AUSF's FQDN
USE_HTTP2 = "no"; # Set to yes to enable HTTP2 for AMF server USE_HTTP2 = "@USE_HTTP2@"; # Set to yes to enable HTTP2 for AMF server
} }
AUTHENTICATION: AUTHENTICATION:
......
...@@ -16,6 +16,7 @@ NSSF_API_VERSION=${NSSF_API_VERSION:-v2} ...@@ -16,6 +16,7 @@ NSSF_API_VERSION=${NSSF_API_VERSION:-v2}
NSSF_FQDN=${NSSF_FQDN:-oai-nssf} NSSF_FQDN=${NSSF_FQDN:-oai-nssf}
INT_ALGO_LIST=${INT_ALGO_LIST:-'[ "NIA0" , "NIA1" , "NIA2" ]'} INT_ALGO_LIST=${INT_ALGO_LIST:-'[ "NIA0" , "NIA1" , "NIA2" ]'}
CIPH_ALGO_LIST=${CIPH_ALGO_LIST:-'[ "NEA0" , "NEA1" , "NEA2" ]'} CIPH_ALGO_LIST=${CIPH_ALGO_LIST:-'[ "NEA0" , "NEA1" , "NEA2" ]'}
USE_HTTP2=${USE_HTTP2:-no}
if [[ ${USE_FQDN_DNS} == "yes" ]];then if [[ ${USE_FQDN_DNS} == "yes" ]];then
NSSF_IPV4_ADDR=${NSSF_IPV4_ADDR_0:-0.0.0.0} NSSF_IPV4_ADDR=${NSSF_IPV4_ADDR_0:-0.0.0.0}
......
...@@ -491,6 +491,11 @@ int amf_config::load(const std::string& config_file) { ...@@ -491,6 +491,11 @@ int amf_config::load(const std::string& config_file) {
util::trim(address).c_str(), ausf_ipv4_addr, util::trim(address).c_str(), ausf_ipv4_addr,
"BAD IPv4 ADDRESS FORMAT FOR AUSF !"); "BAD IPv4 ADDRESS FORMAT FOR AUSF !");
ausf_addr.ipv4_addr = ausf_ipv4_addr; ausf_addr.ipv4_addr = ausf_ipv4_addr;
// We hardcode nrf port from config for the moment
if (!(ausf_cfg.lookupValue(AMF_CONFIG_STRING_PORT, ausf_port))) {
Logger::amf_app().error(AMF_CONFIG_STRING_PORT "failed");
throw(AMF_CONFIG_STRING_PORT "failed");
}
ausf_addr.port = ausf_port; ausf_addr.port = ausf_port;
ausf_addr.api_version = "v1"; // TODO: get API version ausf_addr.api_version = "v1"; // TODO: get API version
} }
......
This diff is collapsed.
...@@ -53,8 +53,8 @@ class amf_n11 { ...@@ -53,8 +53,8 @@ class amf_n11 {
void handle_itti_message(itti_nsmf_pdusession_create_sm_context&); void handle_itti_message(itti_nsmf_pdusession_create_sm_context&);
void handle_pdu_session_initial_request( void handle_pdu_session_initial_request(
std::string supi, std::shared_ptr<pdu_session_context> psc, std::string supi, std::shared_ptr<pdu_session_context> psc,
std::string smf_addr, std::string smf_api_version, bstring sm_msg, std::string smf_addr, std::string smf_api_version, std::string smf_port,
std::string dnn); bstring sm_msg, std::string dnn);
void handle_itti_message(itti_nsmf_pdusession_update_sm_context& itti_msg); void handle_itti_message(itti_nsmf_pdusession_update_sm_context& itti_msg);
void handle_itti_message(itti_nsmf_pdusession_release_sm_context& itti_msg); void handle_itti_message(itti_nsmf_pdusession_release_sm_context& itti_msg);
void handle_itti_message(itti_pdu_session_resource_setup_response& itti_msg); void handle_itti_message(itti_pdu_session_resource_setup_response& itti_msg);
...@@ -93,7 +93,8 @@ class amf_n11 { ...@@ -93,7 +93,8 @@ class amf_n11 {
bool discover_smf_from_nsi_info( bool discover_smf_from_nsi_info(
std::string& smf_addr, std::string& smf_api_version, std::string& smf_addr, std::string& smf_api_version,
const snssai_t snssai, const plmn_t plmn, const std::string dnn); std::string& smf_port, const snssai_t snssai, const plmn_t plmn,
const std::string dnn);
bool discover_smf( bool discover_smf(
std::string& smf_addr, std::string& smf_api_version, std::string& smf_addr, std::string& smf_api_version,
......
...@@ -49,6 +49,7 @@ class pdu_session_context { ...@@ -49,6 +49,7 @@ class pdu_session_context {
bool isn1sm_avaliable; bool isn1sm_avaliable;
std::string dnn; std::string dnn;
std::string smf_addr; std::string smf_addr;
std::string smf_port;
std::string smf_api_version; std::string smf_api_version;
bool smf_available; bool smf_available;
std::string location; std::string location;
......
...@@ -57,7 +57,6 @@ LADN_Indication::~LADN_Indication() {} ...@@ -57,7 +57,6 @@ LADN_Indication::~LADN_Indication() {}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void LADN_Indication::setValue(uint8_t iei, uint8_t value) { void LADN_Indication::setValue(uint8_t iei, uint8_t value) {
_iei = iei; _iei = iei;
//_value = value;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -68,19 +67,15 @@ bool LADN_Indication::getValue(std::vector<bstring>& ladn) { ...@@ -68,19 +67,15 @@ bool LADN_Indication::getValue(std::vector<bstring>& ladn) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int LADN_Indication::encode2buffer(uint8_t* buf, int len) { 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) { 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; return 0;
} }
int encoded_size = 0; int encoded_size = 0;
if (_iei) { if (_iei) {
*(buf + encoded_size) = _iei; ENCODE_U8(buf + encoded_size, _iei, encoded_size);
encoded_size++; ENCODE_U16(buf + encoded_size, length - 3, encoded_size);
*(buf + encoded_size) = (length - 3) & 0x00ff;
encoded_size++;
*(buf + encoded_size) = ((length - 3) & 0xff00) >> 8;
encoded_size++;
for (int i = 0; i < LADN.size(); i++) { for (int i = 0; i < LADN.size(); i++) {
*(buf + encoded_size) = blength(LADN.at(i)); *(buf + encoded_size) = blength(LADN.at(i));
encoded_size++; encoded_size++;
...@@ -88,6 +83,7 @@ int LADN_Indication::encode2buffer(uint8_t* buf, int len) { ...@@ -88,6 +83,7 @@ int LADN_Indication::encode2buffer(uint8_t* buf, int len) {
encode_bstring(LADN.at(i), (buf + encoded_size), len - encoded_size); encode_bstring(LADN.at(i), (buf + encoded_size), len - encoded_size);
} }
} else { } else {
// TODO:
// *(buf + encoded_size) = length - 1; encoded_size++; // *(buf + encoded_size) = length - 1; encoded_size++;
// *(buf + encoded_size) = _value; encoded_size++; encoded_size++; // *(buf + encoded_size) = _value; encoded_size++; encoded_size++;
} }
...@@ -97,29 +93,26 @@ int LADN_Indication::encode2buffer(uint8_t* buf, int len) { ...@@ -97,29 +93,26 @@ int LADN_Indication::encode2buffer(uint8_t* buf, int len) {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int LADN_Indication::decodefrombuffer(uint8_t* buf, int len, bool is_option) { 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; int decoded_size = 0;
if (is_option) { if (is_option) {
decoded_size++; decoded_size++;
} }
length = 0; length = 0;
length |= *(buf + decoded_size); DECODE_U16(buf + decoded_size, length, decoded_size);
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; int len_ie = length;
uint8_t len_dnn; uint8_t len_dnn = 0;
bstring dnn; bstring dnn;
while (LEAGTH) { while (len_ie) {
len_dnn = *(buf + decoded_size); DECODE_U8(buf + decoded_size, len_dnn, decoded_size);
decoded_size++; len_ie--;
LEAGTH--;
decode_bstring(&dnn, len_dnn, (buf + decoded_size), len - decoded_size); decode_bstring(&dnn, len_dnn, (buf + decoded_size), len - decoded_size);
decoded_size += len_dnn; decoded_size += len_dnn;
LEAGTH -= len_dnn; len_ie -= len_dnn;
LADN.insert(LADN.end(), dnn); LADN.insert(LADN.end(), dnn);
} }
for (int i = 0; i < LADN.size(); i++) { for (int i = 0; i < LADN.size(); i++) {
for (int j = 0; j < blength(LADN.at(i)); j++) { for (int j = 0; j < blength(LADN.at(i)); j++) {
Logger::nas_mm().debug( Logger::nas_mm().debug(
...@@ -127,6 +120,7 @@ int LADN_Indication::decodefrombuffer(uint8_t* buf, int len, bool is_option) { ...@@ -127,6 +120,7 @@ int LADN_Indication::decodefrombuffer(uint8_t* buf, int len, bool is_option) {
(uint8_t) LADN.at(i)->data[j]); (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; return decoded_size;
} }
...@@ -59,7 +59,7 @@ UENetworkCapability::UENetworkCapability( ...@@ -59,7 +59,7 @@ UENetworkCapability::UENetworkCapability(
_iei = iei; _iei = iei;
_5g_EEASel = _5gg_EEASel; _5g_EEASel = _5gg_EEASel;
_5g_EIASel = _5gg_EIASel; _5g_EIASel = _5gg_EIASel;
length = 4; length = 4; // Minimum length
Logger::nas_mm().debug( Logger::nas_mm().debug(
"decoded UENetworkCapability EA(0x%d),IA(0x%d)", _5g_EEASel, _5g_EIASel); "decoded UENetworkCapability EA(0x%d),IA(0x%d)", _5g_EEASel, _5g_EIASel);
} }
...@@ -86,9 +86,9 @@ uint8_t UENetworkCapability::getEIASel() { ...@@ -86,9 +86,9 @@ uint8_t UENetworkCapability::getEIASel() {
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int UENetworkCapability::encode2buffer(uint8_t* buf, int len) { int UENetworkCapability::encode2buffer(uint8_t* buf, int len) {
Logger::nas_mm().debug("encoding UENetworkCapability iei(0x%x)", _iei); Logger::nas_mm().debug("encoding UENetworkCapability IEI (0x%x)", _iei);
if (len < length) { 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; return 0;
} }
int encoded_size = 0; int encoded_size = 0;
...@@ -102,29 +102,41 @@ int UENetworkCapability::encode2buffer(uint8_t* buf, int len) { ...@@ -102,29 +102,41 @@ int UENetworkCapability::encode2buffer(uint8_t* buf, int len) {
*(buf + encoded_size) = _5g_EIASel; *(buf + encoded_size) = _5g_EIASel;
encoded_size++; encoded_size++;
} else { } else {
//*(buf + encoded_size) = length - 1; encoded_size++; *(buf + encoded_size) = length - 1;
//*(buf + encoded_size) = _value; encoded_size++; encoded_size++; encoded_size++;
*(buf + encoded_size) = _5g_EEASel;
encoded_size++;
*(buf + encoded_size) = _5g_EIASel;
encoded_size++;
} }
Logger::nas_mm().debug("encoded UENetworkCapability len(%d)", encoded_size); Logger::nas_mm().debug("Encoded UENetworkCapability len (%d)", encoded_size);
return encoded_size; return encoded_size;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int UENetworkCapability::decodefrombuffer( int UENetworkCapability::decodefrombuffer(
uint8_t* buf, int len, bool is_option) { uint8_t* buf, int len, bool is_option) {
Logger::nas_mm().debug("decoding UENetworkCapability iei(0x%x)", *buf); Logger::nas_mm().debug("Decoding UENetworkCapability IEI");
int decoded_size = 0; int decoded_size = 0;
int ie_length = 0;
if (is_option) { if (is_option) {
_iei = *(buf + decoded_size);
decoded_size++; decoded_size++;
} }
length = *(buf + decoded_size); length = *(buf + decoded_size);
decoded_size++; decoded_size++;
ie_length = length + decoded_size;
_5g_EEASel = *(buf + decoded_size); _5g_EEASel = *(buf + decoded_size);
decoded_size++; decoded_size++;
_5g_EIASel = *(buf + decoded_size); _5g_EIASel = *(buf + decoded_size);
decoded_size++; decoded_size++;
Logger::nas_mm().debug( Logger::nas_mm().debug(
"decoded UENetworkCapability EA(0x%d),IA(0x%d)", _5g_EEASel, _5g_EIASel); "Decoded UENetworkCapability EA (0x%d), IA (0x%d)", _5g_EEASel,
Logger::nas_mm().debug("decoded UENetworkCapability len(%d)", decoded_size); _5g_EIASel);
return decoded_size; Logger::nas_mm().debug(
"Decoded UENetworkCapability len 0x%d, actual length 0x%d", decoded_size,
ie_length);
return ie_length;
} }
...@@ -52,6 +52,11 @@ class UENetworkCapability { ...@@ -52,6 +52,11 @@ class UENetworkCapability {
uint8_t length; uint8_t length;
uint8_t _5g_EEASel; uint8_t _5g_EEASel;
uint8_t _5g_EIASel; uint8_t _5g_EIASel;
// TODO: uint8_t uEASel;
// TODO: uint8_t uIASel;
// TODO: uint8_t octet_7;
// TODO: uint8_t octet_8;
// TODO: uint8_t octet_9;
}; };
} // namespace nas } // namespace nas
......
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