Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-AMF
Commits
4c543016
Commit
4c543016
authored
Jan 23, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into nas_refactor_v2
parents
8dd8e5b8
113144f6
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
278 additions
and
253 deletions
+278
-253
CHANGELOG.md
CHANGELOG.md
+22
-0
build/scripts/generate_amf_conf.sh
build/scripts/generate_amf_conf.sh
+73
-91
ci-scripts/docker/Dockerfile.ci.ubuntu
ci-scripts/docker/Dockerfile.ci.ubuntu
+4
-2
ci-scripts/flatten_image.py
ci-scripts/flatten_image.py
+1
-1
docker/Dockerfile.amf.rhel8
docker/Dockerfile.amf.rhel8
+4
-2
docker/Dockerfile.amf.ubuntu
docker/Dockerfile.amf.ubuntu
+4
-2
etc/amf.conf
etc/amf.conf
+82
-79
scripts/entrypoint.py
scripts/entrypoint.py
+58
-0
scripts/entrypoint.sh
scripts/entrypoint.sh
+0
-70
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+22
-5
src/contexts/nas_context.hpp
src/contexts/nas_context.hpp
+1
-0
src/nas/ies/Rejected_SNSSAI.cpp
src/nas/ies/Rejected_SNSSAI.cpp
+7
-1
No files found.
CHANGELOG.md
View file @
4c543016
# RELEASE NOTES: #
## v1.5.0 -- January 2023 ##
*
Minimal fix for Decoding RegistrationRequest from COTS UE
*
Fix small issue for NGAP lib
*
NGAP IES code refactoring
*
Fix PDU session release
*
Refactor NGAP message callback
*
Fix nake ptr
*
feat(fqdn): giving some time for FQDN resolution
*
Fix UL NAS transport
*
Fix typo for Rejected NSSAI
*
PDU session release supported
*
Update SST type (int instead of string) in conf file
*
Events exposure: location report with empty supi fixed
*
small fix for event exposure loss of connectivity
*
Minor fix for encoding no SD in PduSessionResourceSetupRequest
*
Fix SST/SD on cots ue
*
Docker images improvements
*
Fixed docker exit by catching SIGTERM
*
release mode does not use libasan anymore --> allocation of 20T virtual memory is no longer done
*
Ubuntu22 and cgroup2 support
## v1.4.0 -- July 2022 ##
*
Fix SCTP NG Shutdown issue
...
...
build/scripts/generate_amf_conf.sh
View file @
4c543016
# prompt has been removed for easier Ctrl+C Ctrl+V
# please update the following information according to your configuration
INSTANCE
=
1
PREFIX
=
'/usr/local/etc/oai'
sudo mkdir
-m
0777
-p
$PREFIX
cp
../../etc/amf.conf
$PREFIX
declare
-A
AMF_CONF
AMF_CONF[@INSTANCE@]
=
$INSTANCE
AMF_CONF[@PREFIX@]
=
$PREFIX
AMF_CONF[@PID_DIRECTORY@]
=
'/var/run'
AMF_CONF[@MCC@]
=
'208'
AMF_CONF[@MNC@]
=
'95'
AMF_CONF[@REGION_ID@]
=
'128'
AMF_CONF[@AMF_SET_ID@]
=
'1'
AMF_CONF[@SERVED_GUAMI_MCC_0@]
=
'208'
AMF_CONF[@SERVED_GUAMI_MNC_0@]
=
'95'
AMF_CONF[@SERVED_GUAMI_REGION_ID_0@]
=
'128'
AMF_CONF[@SERVED_GUAMI_AMF_SET_ID_0@]
=
'1'
AMF_CONF[@SERVED_GUAMI_MCC_1@]
=
'460'
AMF_CONF[@SERVED_GUAMI_MNC_1@]
=
'11'
AMF_CONF[@SERVED_GUAMI_REGION_ID_1@]
=
'10'
AMF_CONF[@SERVED_GUAMI_AMF_SET_ID_1@]
=
'1'
AMF_CONF[@PLMN_SUPPORT_MCC@]
=
'208'
AMF_CONF[@PLMN_SUPPORT_MNC@]
=
'95'
AMF_CONF[@PLMN_SUPPORT_TAC@]
=
'0xa000'
AMF_CONF[@SST_0@]
=
'128'
AMF_CONF[@SD_0@]
=
'128'
AMF_CONF[@SST_1@]
=
'1'
AMF_CONF[@SD_1@]
=
'1'
AMF_CONF[@AMF_INTERFACE_NAME_FOR_NGAP@]
=
'eth0'
AMF_CONF[@AMF_INTERFACE_NAME_FOR_N11@]
=
'eth0'
AMF_CONF[@EXTERNAL_AUSF@]
=
'no'
AMF_CONF[@EXTERNAL_UDM@]
=
'no'
AMF_CONF[@EXTERNAL_NRF@]
=
'no'
AMF_CONF[@EXTERNAL_NSSF@]
=
'no'
AMF_CONF[@USE_FQDN_DNS@]
=
'no'
AMF_CONF[@USE_HTTP2@]
=
'no'
AMF_CONF[@NF_REGISTRATION@]
=
'no'
AMF_CONF[@SMF_SELECTION@]
=
'no'
AMF_CONF[@SMF_INSTANCE_ID_0@]
=
'1'
AMF_CONF[@SMF_IPV4_ADDR_0@]
=
'192.168.22.208'
AMF_CONF[@SMF_HTTP_VERSION_0@]
=
'v1'
AMF_CONF[@SMF_FQDN_0@]
=
'oai-smf'
AMF_CONF[@SMF_INSTANCE_ID_1@]
=
'2'
AMF_CONF[@SMF_IPV4_ADDR_1@]
=
'192.168.22.207'
AMF_CONF[@SMF_HTTP_VERSION_1@]
=
'v1'
AMF_CONF[@SMF_FQDN_1@]
=
'oai-smf2'
AMF_CONF[@NRF_IPV4_ADDRESS@]
=
'192.168.22.195'
AMF_CONF[@NRF_PORT@]
=
'80'
AMF_CONF[@NRF_API_VERSION@]
=
'v1'
AMF_CONF[@NRF_FQDN@]
=
'oai-nrf'
AMF_CONF[@AUSF_IPV4_ADDRESS@]
=
'192.168.22.199'
AMF_CONF[@AUSF_PORT@]
=
'80'
AMF_CONF[@AUSF_API_VERSION@]
=
'v1'
AMF_CONF[@AUSF_FQDN@]
=
'oai-ausf'
AMF_CONF[@NSSF_IPV4_ADDRESS@]
=
'192.168.22.214'
AMF_CONF[@NSSF_PORT@]
=
'80'
AMF_CONF[@NSSF_API_VERSION@]
=
'v1'
AMF_CONF[@NSSF_FQDN@]
=
'oai-nssf'
AMF_CONF[@UDM_IPV4_ADDRESS@]
=
'192.168.22.209'
AMF_CONF[@UDM_PORT@]
=
'80'
AMF_CONF[@UDM_API_VERSION@]
=
'v1'
AMF_CONF[@UDM_FQDN@]
=
'oai-udm'
AMF_CONF[@NRF_SELECTION@]
=
'no'
AMF_CONF[@INT_ALGO_LIST@]
=
'[ "NIA0" , "NIA1" , "NIA2" ]'
AMF_CONF[@CIPH_ALGO_LIST@]
=
'[ "NEA0" , "NEA1" , "NEA2" ]'
AMF_CONF[@MYSQL_SERVER@]
=
'127.0.0.1'
AMF_CONF[@MYSQL_USER@]
=
'root'
AMF_CONF[@MYSQL_PASS@]
=
'linux'
AMF_CONF[@MYSQL_DB@]
=
'oai_db'
for
K
in
"
${
!AMF_CONF[@]
}
"
;
do
egrep
-lRZ
"
$K
"
$PREFIX
| xargs
-0
-l
sed
-i
-e
"s|
$K
|
${
AMF_CONF
[
$K
]
}
|g"
ret
=
$?
;
[[
ret
-ne
0
]]
&&
echo
"Tried to replace
$K
with
${
AMF_CONF
[
$K
]
}
"
done
#!/bin/sh
################################################################################
# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The OpenAirInterface Software Alliance licenses this file to You under
# the OAI Public License, Version 1.1 (the "License"); you may not use this file
# except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.openairinterface.org/?page_id=698
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
# For more information about the OpenAirInterface (OAI) Software Alliance:
# contact@openairinterface.org
################################################################################
## Sample values for configuration
export
INSTANCE
=
0
export
PID_DIRECTORY
=
/var/run
export
MCC
=
208
export
MNC
=
95
export
REGION_ID
=
128
export
AMF_SET_ID
=
1
export
SERVED_GUAMI_MCC_0
=
208
export
SERVED_GUAMI_MNC_0
=
95
export
SERVED_GUAMI_REGION_ID_0
=
128
export
SERVED_GUAMI_AMF_SET_ID_0
=
1
export
PLMN_SUPPORT_MCC
=
208
export
PLMN_SUPPORT_MNC
=
95
export
PLMN_SUPPORT_TAC
=
0xa000
export
SST_0
=
1
export
SD_0
=
0xFFFFFF
export
SST_1
=
1
export
SD_1
=
1
export
AMF_INTERFACE_NAME_FOR_NGAP
=
eth0
export
AMF_INTERFACE_NAME_FOR_N11
=
eth0
export
SMF_INSTANCE_ID_0
=
1
export
SMF_FQDN_0
=
localhost
export
SMF_IPV4_ADDR_0
=
127.0.0.1
export
SMF_HTTP_VERSION_0
=
v1
export
SELECTED_0
=
true
export
MYSQL_SERVER
=
127.0.0.1
export
MYSQL_USER
=
root
export
MYSQL_PASS
=
linux
export
MYSQL_DB
=
oai_db
export
NRF_IPV4_ADDRESS
=
127.0.0.1
export
NRF_PORT
=
80
export
EXTERNAL_NRF
=
no
export
NF_REGISTRATION
=
yes
export
SMF_SELECTION
=
yes
export
USE_FQDN_DNS
=
yes
export
EXTERNAL_AUSF
=
yes
export
EXTERNAL_UDM
=
no
export
EXTERNAL_NSSF
=
no
export
USE_HTTP2
=
no
export
NRF_API_VERSION
=
v1
export
NRF_FQDN
=
localhost
export
AUSF_IPV4_ADDRESS
=
127.0.0.1
export
AUSF_PORT
=
80
export
AUSF_API_VERSION
=
v1
export
AUSF_FQDN
=
localhost
export
UDM_IPV4_ADDRESS
=
127.0.0.1
export
UDM_PORT
=
80
export
UDM_API_VERSION
=
v2
export
UDM_FQDN
=
localhost
../../scripts/entrypoint.py
\ No newline at end of file
ci-scripts/docker/Dockerfile.ci.ubuntu
View file @
4c543016
...
...
@@ -64,6 +64,8 @@ RUN apt-get update && \
openssl \
libbrotli1 \
netbase \
python3\
python3-jinja2\
# Ubuntu 18 --> libasan4
# Ubuntu 20 --> libasan5
# Ubuntu 22 --> libasan6
...
...
@@ -94,7 +96,7 @@ RUN apt-get update && \
WORKDIR /openair-amf/bin
COPY --from=oai-amf-builder \
/openair-amf/build/amf/build/oai_amf \
/openair-amf/scripts/entrypoint.
sh
\
/openair-amf/scripts/entrypoint.
py
\
/openair-amf/scripts/healthcheck.sh \
./
...
...
@@ -127,5 +129,5 @@ HEALTHCHECK --interval=10s \
--retries=6 \
CMD /openair-amf/bin/healthcheck.sh
ENTRYPOINT ["
/bin/bash","/openair-amf/bin/entrypoint.sh
"]
ENTRYPOINT ["
python3", "/openair-amf/bin/entrypoint.py
"]
CMD ["/openair-amf/bin/oai_amf", "-c", "/openair-amf/etc/amf.conf", "-o"]
ci-scripts/flatten_image.py
View file @
4c543016
...
...
@@ -81,7 +81,7 @@ def perform_flattening(tag):
cmd
+=
' --change "EXPOSE 38412/sctp" '
cmd
+=
' --change "HEALTHCHECK --interval=10s --timeout=15s --retries=6 CMD /openair-amf/bin/healthcheck.sh" '
cmd
+=
' --change "CMD [
\\
"/openair-amf/bin/oai_amf
\\
",
\\
"-c
\\
",
\\
"/openair-amf/etc/amf.conf
\\
",
\\
"-o
\\
"]" '
cmd
+=
' --change "ENTRYPOINT [
\\
"
/bin/bash
\\
",
\\
"/openair-amf/bin/entrypoint.sh
\\
"]" '
cmd
+=
' --change "ENTRYPOINT [
\\
"
python3
\\
",
\\
"/openair-amf/bin/entrypoint.py
\\
"]" '
cmd
+=
' - '
+
image_prefix
+
tag
print
(
cmd
)
subprocess
.
check_output
(
cmd
,
shell
=
True
,
universal_newlines
=
True
)
...
...
docker/Dockerfile.amf.rhel8
View file @
4c543016
...
...
@@ -107,6 +107,8 @@ RUN rm -f /etc/rhsm-host && \
boost \
libevent \
findutils \
python3\
python3-jinja2\
mysql-libs \
libconfig && \
microdnf clean all -y && \
...
...
@@ -119,7 +121,7 @@ RUN rm -f /etc/rhsm-host && \
WORKDIR /openair-amf/bin
COPY --from=oai-amf-builder \
/openair-amf/build/amf/build/oai_amf \
/openair-amf/scripts/entrypoint.
sh
\
/openair-amf/scripts/entrypoint.
py
\
/openair-amf/scripts/healthcheck.sh \
./
...
...
@@ -146,5 +148,5 @@ HEALTHCHECK --interval=10s \
--retries=6 \
CMD /openair-amf/bin/healthcheck.sh
ENTRYPOINT ["
/openair-amf/bin/entrypoint.sh
"]
ENTRYPOINT ["
python3", "/openair-amf/bin/entrypoint.py
"]
CMD ["/openair-amf/bin/oai_amf", "-c", "/openair-amf/etc/amf.conf", "-o"]
docker/Dockerfile.amf.ubuntu
View file @
4c543016
...
...
@@ -85,6 +85,8 @@ RUN apt-get update && \
openssl \
libbrotli1 \
netbase \
python3\
python3-jinja2\
# Ubuntu 18 --> libasan4
# Ubuntu 20 --> libasan5
# Ubuntu 22 --> libasan6
...
...
@@ -115,7 +117,7 @@ RUN apt-get update && \
WORKDIR /openair-amf/bin
COPY --from=oai-amf-builder \
/openair-amf/build/amf/build/oai_amf \
/openair-amf/scripts/entrypoint.
sh
\
/openair-amf/scripts/entrypoint.
py
\
/openair-amf/scripts/healthcheck.sh \
./
...
...
@@ -148,5 +150,5 @@ HEALTHCHECK --interval=10s \
--retries=6 \
CMD /openair-amf/bin/healthcheck.sh
ENTRYPOINT ["
/bin/bash","/openair-amf/bin/entrypoint.sh
"]
ENTRYPOINT ["
python3", "/openair-amf/bin/entrypoint.py
"]
CMD ["/openair-amf/bin/oai_amf", "-c", "/openair-amf/etc/amf.conf", "-o"]
etc/amf.conf
View file @
4c543016
This diff is collapsed.
Click to expand it.
scripts/entrypoint.py
0 → 100755
View file @
4c543016
#!/usr/bin/env python3
################################################################################
# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The OpenAirInterface Software Alliance licenses this file to You under
# the OAI Public License, Version 1.1 (the "License"); you may not use this file
# except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.openairinterface.org/?page_id=698
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
# For more information about the OpenAirInterface (OAI) Software Alliance:
# contact@openairinterface.org
################################################################################
from
jinja2
import
Environment
,
FileSystemLoader
import
socket
import
os
import
sys
CONFIG_FILE
=
str
(
os
.
getenv
(
'CONFIG_FILE'
,
'/openair-amf/etc/amf.conf'
))
MOUNT_CONFIG
=
str
(
os
.
getenv
(
'MOUNT_CONFIG'
,
'no'
)).
lower
()
def
resolve
(
hostname
):
try
:
return
socket
.
gethostbyname
(
hostname
)
except
socket
.
error
:
print
(
f"Not able to resolve
{
hostname
}
"
)
def
render
(
filepath
,
funcs
,
values
):
env
=
Environment
(
loader
=
FileSystemLoader
(
os
.
path
.
dirname
(
filepath
)))
jinja_template
=
env
.
get_template
(
os
.
path
.
basename
(
filepath
))
jinja_template
.
globals
.
update
(
funcs
)
template_string
=
jinja_template
.
render
(
env
=
values
)
return
template_string
env_variables
=
dict
()
#list of all the environment variables
for
name
,
value
in
os
.
environ
.
items
():
env_variables
.
update
({
name
:
value
})
if
MOUNT_CONFIG
!=
"yes"
:
output
=
render
(
CONFIG_FILE
,{
"resolve"
:
resolve
},
env_variables
)
with
open
(
CONFIG_FILE
,
"w"
)
as
fh
:
fh
.
write
(
output
)
print
(
f"Configuration file
{
CONFIG_FILE
}
is ready"
)
if
len
(
sys
.
argv
)
==
1
:
sys
.
exit
(
0
)
os
.
execvp
(
sys
.
argv
[
1
],
sys
.
argv
[
1
:])
#important for running the network function it works like exec $@
else
:
print
(
"Configuration file is mounted to the network function"
)
\ No newline at end of file
scripts/entrypoint.sh
deleted
100755 → 0
View file @
8dd8e5b8
#!/bin/bash
set
-euo
pipefail
CONFIG_DIR
=
"/openair-amf/etc"
# Default values
EXTERNAL_NRF
=
${
EXTERNAL_NRF
:-
no
}
EXTERNAL_NSSF
=
${
EXTERNAL_NSSF
:-
no
}
EXTERNAL_AUSF
=
${
EXTERNAL_AUSF
:-
no
}
EXTERNAL_UDM
=
${
EXTERNAL_UDM
:-
no
}
UDM_IPV4_ADDRESS
=
${
UDM_IPV4_ADDRESS
:-
0
.0.0.0
}
UDM_PORT
=
${
UDM_PORT
:-
80
}
UDM_API_VERSION
=
${
UDM_API_VERSION
:-
v2
}
UDM_FQDN
=
${
UDM_FQDN
:-
oai
-udm
}
EXTERNAL_NRF
=
${
EXTERNAL_NRF
:-
no
}
NRF_SELECTION
=
${
NRF_SELECTION
:-
no
}
EXTERNAL_NSSF
=
${
EXTERNAL_NSSF
:-
no
}
NSSF_IPV4_ADDRESS
=
${
NSSF_IPV4_ADDRESS
:-
0
.0.0.0
}
NSSF_PORT
=
${
NSSF_PORT
:-
80
}
NSSF_API_VERSION
=
${
NSSF_API_VERSION
:-
v2
}
NSSF_FQDN
=
${
NSSF_FQDN
:-
oai
-nssf
}
INT_ALGO_LIST
=
${
INT_ALGO_LIST
:-
'[ "NIA0" , "NIA1" , "NIA2" ]'
}
CIPH_ALGO_LIST
=
${
CIPH_ALGO_LIST
:-
'[ "NEA0" , "NEA1" , "NEA2" ]'
}
USE_HTTP2
=
${
USE_HTTP2
:-
no
}
SST_0
=
${
SST_0
:-
128
}
SD_0
=
${
SD_0
:-
128
}
SST_1
=
${
SST_1
:-
1
}
SD_1
=
${
SD_1
:-
0xFFFFFF
}
SST_2
=
${
SST_2
:-
130
}
SD_2
=
${
SD_2
:-
130
}
OPERATOR_KEY
=
${
OPERATOR_KEY
:-
'63bfa50ee6523365ff14c1f45f88737d'
}
if
[[
${
USE_FQDN_DNS
}
==
"yes"
]]
;
then
NSSF_IPV4_ADDR
=
${
NSSF_IPV4_ADDR_0
:-
0
.0.0.0
}
SMF_IPV4_ADDR_0
=
${
SMF_IPV4_ADDR_0
:-
0
.0.0.0
}
SMF_IPV4_ADDR_1
=
${
SMF_IPV4_ADDR_1
:-
0
.0.0.0
}
NRF_IPV4_ADDRESS
=
${
NRF_IPV4_ADDRESS
:-
0
.0.0.0
}
AUSF_IPV4_ADDRESS
=
${
AUSF_IPV4_ADDRESS
:-
0
.0.0.0
}
UDM_IPV4_ADDRESS
=
${
UDM_IPV4_ADDRESS
:-
0
.0.0.0
}
fi
for
c
in
${
CONFIG_DIR
}
/
*
.conf
;
do
# grep variable names (format: ${VAR}) from template to be rendered
if
!
grep
-oP
'@[a-zA-Z0-9_]+@'
${
c
}
;
then
echo
"Configuration is already set"
exec
"
$@
"
fi
VARS
=
$(
grep
-oP
'@[a-zA-Z0-9_]+@'
${
c
}
|
sort
|
uniq
| xargs
)
echo
"Now setting these variables '
${
VARS
}
'"
# create sed expressions for substituting each occurrence of ${VAR}
# with the value of the environment variable "VAR"
EXPRESSIONS
=
""
for
v
in
${
VARS
}
;
do
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
."
exit
1
fi
EXPRESSIONS
=
"
${
EXPRESSIONS
}
;s|
${
v
}
|
${
!NEW_VAR
}
|g"
done
EXPRESSIONS
=
"
${
EXPRESSIONS
#
';'
}
"
# render template and inline replace config file
sed
-i
"
${
EXPRESSIONS
}
"
${
c
}
done
echo
"Done setting the configuration"
exec
"
$@
"
src/amf-app/amf_n1.cpp
View file @
4c543016
...
...
@@ -3264,8 +3264,8 @@ void amf_n1::ul_nas_transport_handle(
// TODO: Only use the first one for now if there's multiple requested
// NSSAI since we don't know which slice associated with this PDU session
if
(
nc
->
requestedN
ssai
.
size
()
>
0
)
{
snssai
=
nc
->
requestedN
ssai
[
0
];
if
(
nc
->
allowed_n
ssai
.
size
()
>
0
)
{
snssai
=
nc
->
allowed_n
ssai
[
0
];
Logger
::
amf_n1
().
debug
(
"Use first Requested S-NSSAI %s"
,
snssai
.
ToString
().
c_str
());
}
else
{
...
...
@@ -4132,6 +4132,23 @@ void amf_n1::initialize_registration_accept(
requested_nssai
.
push_back
(
ss
.
second
);
}
// Allowed NSSAI
for
(
auto
s
:
common_nssais
)
{
SNSSAI_t
snssai
=
{};
snssai
.
sst
=
s
.
sst
;
snssai
.
sd
=
s
.
sd
;
if
(
s
.
sd
==
SD_NO_VALUE
)
{
snssai
.
length
=
SST_LENGTH
;
}
else
{
snssai
.
length
=
SST_LENGTH
+
SD_LENGTH
;
}
Logger
::
amf_n1
().
debug
(
"Allowed S-NSSAI (SST 0x%x, SD 0x%x)"
,
s
.
sst
,
s
.
sd
);
allowed_nssais
.
push_back
(
snssai
);
// Store in the NAS context
nc
->
allowed_nssai
.
push_back
(
snssai
);
// TODO: refactor NAS_Context
}
// Rejected NSSAIs
for
(
auto
rn
:
requested_nssai
)
{
bool
found
=
false
;
...
...
@@ -4146,9 +4163,9 @@ void amf_n1::initialize_registration_accept(
}
else
{
snssai
.
length
=
SST_LENGTH
+
SD_LENGTH
;
}
Logger
::
amf_n1
().
debug
(
"Allowed S-NSSAI (SST 0x%x, SD 0x%x)"
,
s
.
sst
,
s
.
sd
);
allowed_nssais
.
push_back
(
snssai
);
//
Logger::amf_n1().debug(
//
"Allowed S-NSSAI (SST 0x%x, SD 0x%x)", s.sst, s.sd);
//
allowed_nssais.push_back(snssai);
found
=
true
;
break
;
}
else
{
...
...
src/contexts/nas_context.hpp
View file @
4c543016
...
...
@@ -98,6 +98,7 @@ class nas_context {
// Set to true if marked as default
std
::
vector
<
std
::
pair
<
bool
,
nas
::
SNSSAI_t
>>
subscribed_snssai
;
std
::
vector
<
nas
::
SNSSAI_t
>
configured_nssai
;
// TODO: rejected_nssai;
// std::vector<nas::SNSSAI_t> default_configured_nssai;
// std::vector<nas::SNSSAI_t> s_nssai; //for Network Slice selection
...
...
src/nas/ies/Rejected_SNSSAI.cpp
View file @
4c543016
...
...
@@ -133,6 +133,12 @@ int Rejected_SNSSAI::Encode(uint8_t* buf, int len) {
// SD
if
(
sd_
.
has_value
())
{
ENCODE_U24
(
buf
+
encoded_size
,
sd_
.
value
(),
encoded_size
);
/*ENCODE_U8(
buf + encoded_size, (sd_.value() & 0x00ff0000) >> 16, encoded_size);
ENCODE_U8(
buf + encoded_size, (sd_.value() & 0x0000ff00) >> 8, encoded_size);
ENCODE_U8(buf + encoded_size, (sd_.value() & 0x000000ff), encoded_size);
*/
Logger
::
nas_mm
().
debug
(
"SD 0x%x"
,
sd_
.
value
());
}
...
...
@@ -163,7 +169,7 @@ int Rejected_SNSSAI::Decode(uint8_t* buf, int len) {
DECODE_U24
(
buf
+
decoded_size
,
sd
,
decoded_size
);
sd_
=
std
::
optional
<
uint32_t
>
(
sd
);
Logger
::
nas_mm
().
debug
(
"Decoded Rejected_SNSSAI length 0x%x,cause 0x%x, SST 0x%x, SD 0x%x"
,
"Decoded Rejected_SNSSAI length 0x%x,
cause 0x%x, SST 0x%x, SD 0x%x"
,
length_
,
cause_
,
sst_
,
sd
);
}
else
{
return
KEncodeDecodeError
;
// invalid value
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment