Compare commits

..

27 Commits

Author SHA1 Message Date
Sukchan Lee
f61a796058 Release v2.4.14 2023-01-23 10:51:24 +09:00
Sukchan Lee
8f24cedf41 [PROTO] Increase SDU buffer 8k->16k (#2008) 2023-01-21 16:25:36 +09:00
Sukchan Lee
dd8f043448 [AMF] Fixed MEMORY LEAK (#1925) 2023-01-21 16:17:00 +09:00
Sukchan Lee
9032865688 [UPF] Fixed bug when 2 PDRs with same TEID (#2003) 2023-01-20 10:04:12 +09:00
Sukchan Lee
f27fce9f6d Update document for v2.4.13 2023-01-14 12:09:42 +09:00
Sukchan Lee
c79e0efef4 Release v2.4.13 2023-01-14 12:08:33 +09:00
ridzafauzi
016a1447d0 changed error tagged log to info tagged log for handling 5g guti information during Configuration Update procedure 2023-01-11 23:13:10 +09:00
Sukchan Lee
3a468b0a89 [PCRF] More fixes for crashes (#1981) 2023-01-10 16:15:49 +09:00
Sukchan Lee
9ed56b5a7d [PCRF] Fixed a crash (#1981)
An assertion was fired when switching between video and audio.
2023-01-07 15:23:44 +09:00
Sukchan Lee
019dc91d5d [MME] Clear UE Context for Attach Reject (#1848)
Attach Reject + PDN Connectivity Reject need to clear UE Context
2022-12-27 21:06:44 +09:00
Sukchan Lee
4f6986e2f4 [SBI] Case-Insensitive inside MIME message (#1939) 2022-12-05 21:32:12 +09:00
Lester
2c5733ae51 free replybuf after sent replay message 2022-12-05 14:52:23 +09:00
Miguel Borges de Freitas
9fe51ba0ee amf: fix regression for smf selection 2022-12-04 15:22:42 +09:00
Sukchan Lee
dd063a1d5f [AMF] Fixed a crash while NGReset (#1928) 2022-12-04 15:19:04 +09:00
Sukchan Lee
869cfdd403 [AMF] Wrongly sending PDU Session Release (#1925) 2022-12-04 15:19:04 +09:00
Sukchan Lee
9563788c41 [UPF] Fixed an infinte loop when ext_len is 0 2022-12-02 08:00:50 +09:00
Sukchan Lee
3b601cff9c [AMF/MME] forget UE Radio Capability (#1917)
forgetting the UE Radio Capabilities
when UE is sending NAS "De-Registration Request" with "type = Switch-off
2022-11-27 09:06:00 +09:00
Sukchan Lee
a1a0192f8a Continue to fix alpine stack overflow (#1911) 2022-11-27 00:13:37 +09:00
Sukchan Lee
9c628b02bd Fixed alpine stack overflow (#1911) 2022-11-27 00:13:37 +09:00
Sukchan Lee
ab40e8919f [AMF/MME] Refactor SM to prevent crash (#1912) 2022-11-26 21:45:45 +09:00
Sukchan Lee
35fab037c1 [NAS] Discard message if Integrity failed (#1848) 2022-11-26 19:54:35 +09:00
Sukchan Lee
c61359f6ac Fixed MacOSX Test code 2022-11-26 18:44:27 +09:00
Sukchan Lee
cd983a0884 Fixed test code for MacOSX Ventura 2022-11-26 18:44:27 +09:00
Lester
615414f95a get amf_ue from sess
amf_ue will be null and cause a coredump when type is OGS_SBI_OBJ_SESS_TYPE.
2022-11-26 18:36:42 +09:00
Sukchan Lee
6c1f2c4caf Release v2.4.12 2022-11-18 17:21:07 +09:00
Sukchan Lee
0b3ac149af Release v2.4.12 2022-11-18 17:17:03 +09:00
Sukchan Lee
f32ccfbb31 Fixed crash after 48 hours of running (#1893) 2022-11-18 16:44:07 +09:00
225 changed files with 5256 additions and 10409 deletions

View File

@@ -2,7 +2,7 @@
## Getting Started
Please follow the [documentation](https://open5gs.org/open5gs/docs/) at [open5gs.org](https://open5gs.org/)!
If you don't understand something about Open5GS, the [https://open5gs.org/open5gs/docs/](https://open5gs.org/open5gs/docs/) is a great place to look for answers.
## Sponsors

View File

@@ -221,7 +221,7 @@ nssf:
- addr: 127.0.0.14
port: 7777
nsi:
- addr: 127.0.0.10
- addr: ::1
port: 7777
s_nssai:
sst: 1

View File

@@ -250,7 +250,7 @@ nssf:
- addr: 127.0.0.14
port: 7777
nsi:
- addr: 127.0.0.10
- addr: ::1
port: 7777
s_nssai:
sst: 1

View File

@@ -7,7 +7,7 @@
create 640 open5gs open5gs
postrotate
for i in nrfd scpd pcrfd hssd ausfd udmd udrd upfd sgwcd sgwud smfd mmed amfd; do
for i in nrfd pcrfd hssd ausfd udmd udrd upfd sgwcd sgwud smfd mmed amfd; do
systemctl reload open5gs-$i
done
endscript

View File

@@ -2,7 +2,6 @@
#
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
@localstatedir@/log/open5gs/nrf.log 644 14 * $D0 GZ @localstatedir@/run/open5gs-nrfd/pid`
@localstatedir@/log/open5gs/scp.log 644 14 * $D0 GZ @localstatedir@/run/open5gs-scpd/pid`
@localstatedir@/log/open5gs/pcrf.log 644 14 * $D0 GZ @localstatedir@/run/open5gs-pcrfd/pid`
@localstatedir@/log/open5gs/hss.log 644 14 * $D0 GZ @localstatedir@/run/open5gs-hssd/pid`
@localstatedir@/log/open5gs/ausf.log 644 14 * $D0 GZ @localstatedir@/run/open5gs-ausfd/pid`

View File

@@ -220,7 +220,7 @@ nssf:
- addr: 127.0.0.14
port: 7777
nsi:
- addr: 127.0.0.10
- addr: ::1
port: 7777
s_nssai:
sst: 1

View File

@@ -20,7 +20,6 @@
#
logger:
file: @localstatedir@/log/open5gs/amf.log
#
# amf:
#
@@ -119,29 +118,6 @@ logger:
# 'service-names' is always included in the URI query parameter.
# * That is, 'no_service_names' has no effect.
#
# <For Indirect Communication with Delegated Discovery>
#
# o (Default) If you do not set Delegated Discovery as shown below,
#
# sbi:
# - addr: 127.0.0.5
# port: 7777
#
# - Use SCP if SCP avaiable. Otherwise NRF is used.
# => App fails if both NRF and SCP are unavailable.
#
# sbi:
# - addr: 127.0.0.5
# port: 7777
# discovery:
# delegated: auto
#
# o To use SCP always => App fails if no SCP available.
# delegated: yes
#
# o Don't use SCP server => App fails if no NRF available.
# delegated: no
#
# <NGAP Server>>
#
# o NGAP Server(all address available)
@@ -322,50 +298,6 @@ amf:
full: Open5GS
amf_name: open5gs-amf0
#
# scp:
#
# <SBI Client>>
#
# o SBI Client(http://127.0.1.10:7777)
# sbi:
# addr: 127.0.1.10
# port: 7777
#
# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
# sbi:
# - addr: 127.0.1.10
# tls:
# key: scp.key
# pem: scp.pem
# - name: scp.open5gs.org
#
# o SBI Client(http://[fd69:f21d:873c:fb::1]:80)
# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
#
# sbi:
# addr:
# - 127.0.1.10
# - fd69:f21d:873c:fb::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.1.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
#
scp:
sbi:
- addr: 127.0.1.10
port: 7777
#
# nrf:
#
@@ -404,12 +336,12 @@ scp:
# l_onoff: true
# l_linger: 10
#
#nrf:
# sbi:
# - addr:
# - 127.0.0.10
# - ::1
# port: 7777
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
#
# parameter:

View File

@@ -20,7 +20,6 @@
#
logger:
file: @localstatedir@/log/open5gs/ausf.log
#
# ausf:
#
@@ -119,78 +118,11 @@ logger:
# 'service-names' is always included in the URI query parameter.
# * That is, 'no_service_names' has no effect.
#
# <For Indirect Communication with Delegated Discovery>
#
# o (Default) If you do not set Delegated Discovery as shown below,
#
# sbi:
# - addr: 127.0.0.11
# port: 7777
#
# - Use SCP if SCP avaiable. Otherwise NRF is used.
# => App fails if both NRF and SCP are unavailable.
#
# sbi:
# - addr: 127.0.0.11
# port: 7777
# discovery:
# delegated: auto
#
# o To use SCP always => App fails if no SCP available.
# delegated: yes
#
# o Don't use SCP server => App fails if no NRF available.
# delegated: no
#
ausf:
sbi:
- addr: 127.0.0.11
port: 7777
#
# scp:
#
# <SBI Client>>
#
# o SBI Client(http://127.0.1.10:7777)
# sbi:
# addr: 127.0.1.10
# port: 7777
#
# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
# sbi:
# - addr: 127.0.1.10
# tls:
# key: scp.key
# pem: scp.pem
# - name: scp.open5gs.org
#
# o SBI Client(http://[fd69:f21d:873c:fb::1]:80)
# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
#
# sbi:
# addr:
# - 127.0.1.10
# - fd69:f21d:873c:fb::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.1.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
#
scp:
sbi:
- addr: 127.0.1.10
port: 7777
#
# nrf:
#
@@ -229,12 +161,12 @@ scp:
# l_onoff: true
# l_linger: 10
#
#nrf:
# sbi:
# - addr:
# - 127.0.0.10
# - ::1
# port: 7777
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
#
# parameter:

View File

@@ -22,7 +22,6 @@ db_uri: mongodb://localhost/open5gs
#
logger:
file: @localstatedir@/log/open5gs/bsf.log
#
# bsf:
#
@@ -121,78 +120,11 @@ logger:
# 'service-names' is always included in the URI query parameter.
# * That is, 'no_service_names' has no effect.
#
# <For Indirect Communication with Delegated Discovery>
#
# o (Default) If you do not set Delegated Discovery as shown below,
#
# sbi:
# - addr: 127.0.0.15
# port: 7777
#
# - Use SCP if SCP avaiable. Otherwise NRF is used.
# => App fails if both NRF and SCP are unavailable.
#
# sbi:
# - addr: 127.0.0.15
# port: 7777
# discovery:
# delegated: auto
#
# o To use SCP always => App fails if no SCP available.
# delegated: yes
#
# o Don't use SCP server => App fails if no NRF available.
# delegated: no
#
bsf:
sbi:
- addr: 127.0.0.15
port: 7777
#
# scp:
#
# <SBI Client>>
#
# o SBI Client(http://127.0.1.10:7777)
# sbi:
# addr: 127.0.1.10
# port: 7777
#
# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
# sbi:
# - addr: 127.0.1.10
# tls:
# key: scp.key
# pem: scp.pem
# - name: scp.open5gs.org
#
# o SBI Client(http://[fd69:f21d:873c:fb::1]:80)
# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
#
# sbi:
# addr:
# - 127.0.1.10
# - fd69:f21d:873c:fb::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.1.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
#
scp:
sbi:
- addr: 127.0.1.10
port: 7777
#
# nrf:
#
@@ -231,12 +163,12 @@ scp:
# l_onoff: true
# l_linger: 10
#
#nrf:
# sbi:
# - addr:
# - 127.0.0.10
# - ::1
# port: 7777
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
#
# parameter:

View File

@@ -92,50 +92,6 @@ nrf:
- ::1
port: 7777
#
# scp:
#
# <SBI Client>>
#
# o SBI Client(http://127.0.1.10:7777)
# sbi:
# addr: 127.0.1.10
# port: 7777
#
# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
# sbi:
# - addr: 127.0.1.10
# tls:
# key: scp.key
# pem: scp.pem
# - name: scp.open5gs.org
#
# o SBI Client(http://[fd69:f21d:873c:fb::1]:80)
# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
#
# sbi:
# addr:
# - 127.0.1.10
# - fd69:f21d:873c:fb::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.1.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
#
scp:
sbi:
- addr: 127.0.1.10
port: 7777
#
# parameter:
#

View File

@@ -20,7 +20,6 @@
#
logger:
file: @localstatedir@/log/open5gs/nssf.log
#
# nssf:
#
@@ -169,83 +168,16 @@ logger:
# 'service-names' is always included in the URI query parameter.
# * That is, 'no_service_names' has no effect.
#
# <For Indirect Communication with Delegated Discovery>
#
# o (Default) If you do not set Delegated Discovery as shown below,
#
# sbi:
# - addr: 127.0.0.14
# port: 7777
#
# - Use SCP if SCP avaiable. Otherwise NRF is used.
# => App fails if both NRF and SCP are unavailable.
#
# sbi:
# - addr: 127.0.0.14
# port: 7777
# discovery:
# delegated: auto
#
# o To use SCP always => App fails if no SCP available.
# delegated: yes
#
# o Don't use SCP server => App fails if no NRF available.
# delegated: no
#
nssf:
sbi:
- addr: 127.0.0.14
port: 7777
nsi:
- addr: 127.0.0.10
- addr: ::1
port: 7777
s_nssai:
sst: 1
#
# scp:
#
# <SBI Client>>
#
# o SBI Client(http://127.0.1.10:7777)
# sbi:
# addr: 127.0.1.10
# port: 7777
#
# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
# sbi:
# - addr: 127.0.1.10
# tls:
# key: scp.key
# pem: scp.pem
# - name: scp.open5gs.org
#
# o SBI Client(http://[fd69:f21d:873c:fb::1]:80)
# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
#
# sbi:
# addr:
# - 127.0.1.10
# - fd69:f21d:873c:fb::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.1.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
#
scp:
sbi:
- addr: 127.0.1.10
port: 7777
#
# nrf:
#
@@ -272,12 +204,12 @@ scp:
# - 127.0.0.10
# - fd69:f21d:873c:fa::1
#
#nrf:
# sbi:
# - addr:
# - 127.0.0.10
# - ::1
# port: 7777
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
#
# parameter:

View File

@@ -22,7 +22,6 @@ db_uri: mongodb://localhost/open5gs
#
logger:
file: @localstatedir@/log/open5gs/pcf.log
#
# pcf:
#
@@ -128,78 +127,11 @@ logger:
# 'service-names' is always included in the URI query parameter.
# * That is, 'no_service_names' has no effect.
#
# <For Indirect Communication with Delegated Discovery>
#
# o (Default) If you do not set Delegated Discovery as shown below,
#
# sbi:
# - addr: 127.0.0.13
# port: 7777
#
# - Use SCP if SCP avaiable. Otherwise NRF is used.
# => App fails if both NRF and SCP are unavailable.
#
# sbi:
# - addr: 127.0.0.13
# port: 7777
# discovery:
# delegated: auto
#
# o To use SCP always => App fails if no SCP available.
# delegated: yes
#
# o Don't use SCP server => App fails if no NRF available.
# delegated: no
#
pcf:
sbi:
- addr: 127.0.0.13
port: 7777
#
# scp:
#
# <SBI Client>>
#
# o SBI Client(http://127.0.1.10:7777)
# sbi:
# addr: 127.0.1.10
# port: 7777
#
# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
# sbi:
# - addr: 127.0.1.10
# tls:
# key: scp.key
# pem: scp.pem
# - name: scp.open5gs.org
#
# o SBI Client(http://[fd69:f21d:873c:fb::1]:80)
# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
#
# sbi:
# addr:
# - 127.0.1.10
# - fd69:f21d:873c:fb::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.1.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
#
scp:
sbi:
- addr: 127.0.1.10
port: 7777
#
# nrf:
#
@@ -238,12 +170,12 @@ scp:
# l_onoff: true
# l_linger: 10
#
#nrf:
# sbi:
# - addr:
# - 127.0.0.10
# - ::1
# port: 7777
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
#
# parameter:

View File

@@ -88,10 +88,19 @@ logger:
# l_onoff: true
# l_linger: 10
#
# <Next hop SCP>
#
# o Next hop SCP Server(https://127.0.1.11:7777)
# next_scp:
# sbi:
# - addr: 127.0.1.11
# port: 7777
#
# <For Indirect Communication with Delegated Discovery>
#
# o (Default) If you do not set Delegated Discovery as shown below,
#
# next_scp:
# sbi:
# - addr: 127.0.1.10
# port: 7777
@@ -99,6 +108,7 @@ logger:
# - Use SCP if SCP avaiable. Otherwise NRF is used.
# => App fails if both NRF and SCP are unavailable.
#
# next_scp:
# sbi:
# - addr: 127.0.1.10
# port: 7777
@@ -116,45 +126,6 @@ scp:
- addr: 127.0.1.10
port: 7777
#
# next_scp:
#
# <Next hop SCP>
#
# o SBI Client(http://127.0.1.11:7777)
# sbi:
# addr: 127.0.1.11
# port: 7777
#
# o SBI Client(https://127.0.1.11:443, http://next-scp.open5gs.org:80)
# sbi:
# - addr: 127.0.1.11
# tls:
# key: next-scp.key
# pem: next-scp.pem
# - name: next-scp.open5gs.org
#
# o SBI Client(http://[fd69:f21d:873c:fb::1]:80)
# If prefer_ipv4 is true, http://127.0.1.11:80 is selected.
#
# sbi:
# addr:
# - 127.0.1.11
# - fd69:f21d:873c:fb::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.1.11
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
#
# nrf:
#

View File

@@ -20,7 +20,6 @@
#
logger:
file: @localstatedir@/log/open5gs/smf.log
#
# smf:
#
@@ -119,29 +118,6 @@ logger:
# 'service-names' is always included in the URI query parameter.
# * That is, 'no_service_names' has no effect.
#
# <For Indirect Communication with Delegated Discovery>
#
# o (Default) If you do not set Delegated Discovery as shown below,
#
# sbi:
# - addr: 127.0.0.4
# port: 7777
#
# - Use SCP if SCP avaiable. Otherwise NRF is used.
# => App fails if both NRF and SCP are unavailable.
#
# sbi:
# - addr: 127.0.0.4
# port: 7777
# discovery:
# delegated: auto
#
# o To use SCP always => App fails if no SCP available.
# delegated: yes
#
# o Don't use SCP server => App fails if no NRF available.
# delegated: no
#
#
# <PFCP Server>
#
@@ -440,20 +416,7 @@ logger:
# mnc: 70
# tac: 99
#
# <Security Indication - 5G Core only>
#
# According to 3GPP TS38.413 Section 9.3.1.27,
# Security Indication IE may be instructed to 5G gNB.
#
# If you set the security_indication in smf.yaml,
# this information is delivered using PDU Session Resource Request Transfer IE
#
# security_indication:
# integrity_protection_indication: required|preferred|not-needed
# confidentiality_protection_indication: required|preferred|not-needed
# maximum_integrity_protected_data_rate_uplink: bitrate64kbs|maximum-UE-rate
# maximum_integrity_protected_data_rate_downlink: bitrate64kbs|maximum-UE-rate
#
smf:
sbi:
- addr: 127.0.0.4
@@ -483,50 +446,6 @@ smf:
enabled: auto
freeDiameter: @sysconfdir@/freeDiameter/smf.conf
#
# scp:
#
# <SBI Client>>
#
# o SBI Client(http://127.0.1.10:7777)
# sbi:
# addr: 127.0.1.10
# port: 7777
#
# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
# sbi:
# - addr: 127.0.1.10
# tls:
# key: scp.key
# pem: scp.pem
# - name: scp.open5gs.org
#
# o SBI Client(http://[fd69:f21d:873c:fb::1]:80)
# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
#
# sbi:
# addr:
# - 127.0.1.10
# - fd69:f21d:873c:fb::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.1.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
#
scp:
sbi:
- addr: 127.0.1.10
port: 7777
#
# nrf:
#
@@ -565,12 +484,12 @@ scp:
# l_onoff: true
# l_linger: 10
#
#nrf:
# sbi:
# - addr:
# - 127.0.0.10
# - ::1
# port: 7777
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
#
# upf:

View File

@@ -20,7 +20,6 @@
#
logger:
file: @localstatedir@/log/open5gs/udm.log
#
# udm:
#
@@ -121,78 +120,11 @@ logger:
# 'service-names' is always included in the URI query parameter.
# * That is, 'no_service_names' has no effect.
#
# <For Indirect Communication with Delegated Discovery>
#
# o (Default) If you do not set Delegated Discovery as shown below,
#
# sbi:
# - addr: 127.0.0.12
# port: 7777
#
# - Use SCP if SCP avaiable. Otherwise NRF is used.
# => App fails if both NRF and SCP are unavailable.
#
# sbi:
# - addr: 127.0.0.12
# port: 7777
# discovery:
# delegated: auto
#
# o To use SCP always => App fails if no SCP available.
# delegated: yes
#
# o Don't use SCP server => App fails if no NRF available.
# delegated: no
#
udm:
sbi:
- addr: 127.0.0.12
port: 7777
#
# scp:
#
# <SBI Client>>
#
# o SBI Client(http://127.0.1.10:7777)
# sbi:
# addr: 127.0.1.10
# port: 7777
#
# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
# sbi:
# - addr: 127.0.1.10
# tls:
# key: scp.key
# pem: scp.pem
# - name: scp.open5gs.org
#
# o SBI Client(http://[fd69:f21d:873c:fb::1]:80)
# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
#
# sbi:
# addr:
# - 127.0.1.10
# - fd69:f21d:873c:fb::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.1.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
#
scp:
sbi:
- addr: 127.0.1.10
port: 7777
#
# nrf:
#
@@ -231,12 +163,12 @@ scp:
# l_onoff: true
# l_linger: 10
#
#nrf:
# sbi:
# - addr:
# - 127.0.0.10
# - ::1
# port: 7777
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
#
# parameter:

View File

@@ -22,7 +22,6 @@ db_uri: mongodb://localhost/open5gs
#
logger:
file: @localstatedir@/log/open5gs/udr.log
#
# udr:
#
@@ -121,78 +120,11 @@ logger:
# 'service-names' is always included in the URI query parameter.
# * That is, 'no_service_names' has no effect.
#
# <For Indirect Communication with Delegated Discovery>
#
# o (Default) If you do not set Delegated Discovery as shown below,
#
# sbi:
# - addr: 127.0.0.20
# port: 7777
#
# - Use SCP if SCP avaiable. Otherwise NRF is used.
# => App fails if both NRF and SCP are unavailable.
#
# sbi:
# - addr: 127.0.0.20
# port: 7777
# discovery:
# delegated: auto
#
# o To use SCP always => App fails if no SCP available.
# delegated: yes
#
# o Don't use SCP server => App fails if no NRF available.
# delegated: no
#
udr:
sbi:
- addr: 127.0.0.20
port: 7777
#
# scp:
#
# <SBI Client>>
#
# o SBI Client(http://127.0.1.10:7777)
# sbi:
# addr: 127.0.1.10
# port: 7777
#
# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
# sbi:
# - addr: 127.0.1.10
# tls:
# key: scp.key
# pem: scp.pem
# - name: scp.open5gs.org
#
# o SBI Client(http://[fd69:f21d:873c:fb::1]:80)
# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
#
# sbi:
# addr:
# - 127.0.1.10
# - fd69:f21d:873c:fb::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.1.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
#
scp:
sbi:
- addr: 127.0.1.10
port: 7777
#
# nrf:
#
@@ -231,12 +163,12 @@ scp:
# l_onoff: true
# l_linger: 10
#
#nrf:
# sbi:
# - addr:
# - 127.0.0.10
# - ::1
# port: 7777
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
#
# parameter:

View File

@@ -285,7 +285,7 @@ nssf:
- addr: 127.0.0.14
port: 7777
nsi:
- addr: 127.0.0.10
- addr: ::1
port: 7777
s_nssai:
sst: 1

View File

@@ -216,7 +216,7 @@ nssf:
- addr: 127.0.0.14
port: 7777
nsi:
- addr: 127.0.0.10
- addr: ::1
port: 7777
s_nssai:
sst: 1

View File

@@ -25,7 +25,6 @@ systemd_conf_in = '''
open5gs-hssd.service
open5gs-pcrfd.service
open5gs-nrfd.service
open5gs-scpd.service
open5gs-ausfd.service
open5gs-udmd.service
open5gs-pcfd.service

View File

@@ -1,18 +0,0 @@
[Unit]
Description=Open5GS NRF Daemon
Wants=mongodb.service mongod.service
[Service]
Type=simple
User=open5gs
Group=open5gs
Restart=always
ExecStart=@bindir@/open5gs-scpd -c @sysconfdir@/open5gs/scp.yaml
RestartSec=2
RestartPreventExitStatus=1
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target

View File

@@ -223,7 +223,7 @@ nssf:
- addr: 127.0.0.14
port: 7777
nsi:
- addr: 127.0.0.10
- addr: ::1
port: 7777
s_nssai:
sst: 1

View File

@@ -226,7 +226,7 @@ nssf:
- addr: 127.0.0.14
port: 7777
nsi:
- addr: 127.0.0.10
- addr: ::1
port: 7777
s_nssai:
sst: 1

90
debian/changelog vendored
View File

@@ -1,93 +1,3 @@
open5gs (2.5.8) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Mon, 23 Jan 2023 10:58:46 +0900
open5gs (2.5.8~kinetic) kinetic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Mon, 23 Jan 2023 10:57:23 +0900
open5gs (2.5.8~jammy) jammy; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Mon, 23 Jan 2023 10:55:19 +0900
open5gs (2.5.8~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Mon, 23 Jan 2023 10:53:56 +0900
open5gs (2.5.8~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Mon, 23 Jan 2023 10:52:22 +0900
open5gs (2.5.7) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 14 Jan 2023 11:18:40 +0900
open5gs (2.5.7~kinetic) kinetic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 14 Jan 2023 11:17:17 +0900
open5gs (2.5.7~jammy) jammy; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 14 Jan 2023 11:15:53 +0900
open5gs (2.5.7~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 14 Jan 2023 11:14:32 +0900
open5gs (2.5.7~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 14 Jan 2023 11:12:57 +0900
open5gs (2.5.6) unstable; urgency=medium
* New NF - SCP(Service Communication Proxy)
-- Sukchan Lee <acetcom@gmail.com> Fri, 18 Nov 2022 23:24:32 +0900
open5gs (2.5.6~jammy5) jammy; urgency=medium
* New NF - SCP(Service Communication Proxy)
-- Sukchan Lee <acetcom@gmail.com> Fri, 18 Nov 2022 23:23:07 +0900
open5gs (2.5.6~kinetic3) kinetic; urgency=medium
* New NF - SCP(Service Communication Proxy)
-- Sukchan Lee <acetcom@gmail.com> Fri, 18 Nov 2022 23:21:16 +0900
open5gs (2.5.6~bionic3) bionic; urgency=medium
* New NF - SCP(Service Communication Proxy)
-- Sukchan Lee <acetcom@gmail.com> Fri, 18 Nov 2022 23:18:33 +0900
open5gs (2.5.6~focal3) focal; urgency=medium
* New NF - SCP(Service Communication Proxy)
-- Sukchan Lee <acetcom@gmail.com> Fri, 18 Nov 2022 23:17:05 +0900
open5gs (2.4.11) unstable; urgency=medium
* Bug Fixed

13
debian/control vendored
View File

@@ -165,18 +165,6 @@ Description: NRF (Network Repository Function)
.
This package provides the NRF (Network Repository Function)
Package: open5gs-scp
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends},
${misc:Depends},
open5gs-common (= ${binary:Version})
Description: SCP (Network Repository Function)
Open5GS is a C-language implementation of 5G Core and EPC
Packet Core, i.e. the core network of an NR/LTE network (Release-16)
.
This package provides the SCP (Service Communication Proxy)
Package: open5gs-ausf
Architecture: any
Multi-Arch: same
@@ -263,7 +251,6 @@ Depends: ${misc:Depends},
open5gs-hss (= ${binary:Version}),
open5gs-pcrf (= ${binary:Version}),
open5gs-nrf (= ${binary:Version}),
open5gs-scp (= ${binary:Version}),
open5gs-ausf (= ${binary:Version}),
open5gs-udm (= ${binary:Version}),
open5gs-pcf (= ${binary:Version}),

View File

@@ -3,3 +3,4 @@ usr/lib/*/libfd*.so*
usr/lib/*/freeDiameter/*.fdx
configs/freeDiameter/cacert.pem /etc/freeDiameter
configs/logrotate/open5gs /etc/logrotate.d
misc/db/open5gs-dbctl /usr/bin

View File

@@ -1,3 +0,0 @@
usr/bin/open5gs-scpd
configs/open5gs/scp.yaml etc/open5gs
configs/systemd/open5gs-scpd.service lib/systemd/system

View File

@@ -1,32 +1,52 @@
Docker running example
===========================================
* Development
* Build Image
`$ docker compose run dev`
`$ docker-compose build`
* Run WebUI
* Development
`$ docker-compose up webui`
`$ docker-compose run dev`
* Runtime
```
$ docker-compose \
-f docker-compose.yml -f docker-compose.run.yml run run
```
* Test
```
$ docker-compose \
-f docker-compose.yml -f docker-compose.test.yml run test
```
`$ docker compose run test`
* Test(ubuntu:focal)
`$ TAG=focal docker compose run test`
* Test(ubuntu:artful)
```
$ TAG=eoan docker-compose build
$ TAG=eoan docker-compose \
-f docker-compose.yml -f docker-compose.test.yml run test
```
* Development(fedora:latest)
```
$ DIST=fedora docker-compose build
$ DIST=fedora docker-compose run dev
```
`$ DIST=fedora docker compose run dev`
* Runtime(debian:jessie)
```
$ DIST=debian TAG=stretch docker-compose build
$ DIST=debian TAG=stretch docker-compose
-f docker-compose.yml -f docker-compose.run.yml run run
```
* All Test with All Environment
`$ ./check.sh`
* Runtime
`$ docker compose run run`
* Run WebUI
`$ docker-compose up -d`
For OpenSUSE Build Service Release
===========================================
@@ -80,18 +100,8 @@ export DEBEMAIL='acetcom@gmail.com'
* Version Change
```
$ cat ./meson.build
$ cat ./webui/package.json
$ cat ./webui/package-lock.json
$ cat ./docs/assets/webui/install
```
* New NF
```
$ cat debian/control
$ cat configs/systemd/open5gs-scpd.service.in
$ cat configs/logrotate/open5gs.in
$ cat configs/newsyslog/open5gs.conf.in
$ vi meson.build
$ ./misc/git-version-gen . > .tarball-version 2>/dev/null
```
* Upload OpenBuildService

View File

@@ -9,7 +9,4 @@ WORKDIR /open5gs
COPY docker/build/setup.sh /root
COPY ./ /open5gs
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /wait
RUN chmod +x /wait
RUN meson build && ninja -C build install

View File

@@ -1,9 +1,15 @@
#!/bin/sh
docker compose run --rm test
TAG=focal docker compose run --rm test
DIST=fedora docker compose run --rm test
DIST=debian docker compose run --rm test
#DIST=alpine docker compose run --rm test
docker-compose build
docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
TAG=bionic docker-compose build
TAG=bionic docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
DIST=fedora TAG=32 docker-compose build
DIST=fedora TAG=32 docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
DIST=debian docker-compose build
DIST=debian docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
docker rm $(docker ps -qa --no-trunc --filter "status=exited")

View File

@@ -0,0 +1,22 @@
version: '3'
services:
run:
network_mode: "host"
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-open5gs-build
depends_on:
- mongodb
- build
cap_add:
- NET_ADMIN
devices:
- "/dev/net/tun:/dev/net/tun"
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
volumes:
- config:/etc/open5gs
hostname: open5gs-run
command: /bin/bash -c "/root/setup.sh; /usr/bin/open5gs-pcrfd -D; /usr/bin/open5gs-pgwd -D; /usr/bin/open5gs-sgwd -D; /usr/bin/open5gs-hssd -D; /usr/bin/open5gs-mmed"
volumes:
config: {}

View File

@@ -0,0 +1,18 @@
version: '3'
services:
test:
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-open5gs-build
depends_on:
- mongodb
- build
environment:
DB_URI: mongodb://mongodb/open5gs
cap_add:
- NET_ADMIN
devices:
- "/dev/net/tun:/dev/net/tun"
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
hostname: open5gs-test
command: /bin/bash -c "/root/setup.sh; cd /open5gs/build && meson test -v"

View File

@@ -6,24 +6,21 @@ services:
container_name: open5gs-mongodb
ports:
- "27017:27017"
restart: unless-stopped
volumes:
- mongodb:/data/db
- ../docs/assets/webui/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
webui:
build:
context: ../
dockerfile: docker/webui/Dockerfile
build: webui
image: ${USER}/open5gs-webui
container_name: open5gs-webui
depends_on:
- mongodb
ports:
- "3000:3000"
depends_on:
- mongodb
environment:
- DB_URI=mongodb://mongodb/open5gs
- WAIT_HOSTS=mongodb:27017
DB_URI: mongodb://mongodb/open5gs
base:
build:
@@ -47,40 +44,6 @@ services:
- base
command: /bin/bash -c "echo 'build' services"
run:
# network_mode: "host"
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-open5gs-build
depends_on:
- mongodb
- build
cap_add:
- NET_ADMIN
devices:
- "/dev/net/tun:/dev/net/tun"
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
volumes:
- config:/etc/open5gs
hostname: open5gs-run
# command: /bin/bash -c "/root/setup.sh; /usr/bin/open5gs-pcrfd -D; /usr/bin/open5gs-pgwd -D; /usr/bin/open5gs-sgwd -D; /usr/bin/open5gs-hssd -D; /usr/bin/open5gs-mmed"
test:
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-open5gs-build
depends_on:
- mongodb
- build
environment:
- DB_URI=mongodb://mongodb/open5gs
- WAIT_HOSTS=mongodb:27017
cap_add:
- NET_ADMIN
devices:
- "/dev/net/tun:/dev/net/tun"
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
hostname: open5gs-test
command: /bin/bash -c "/root/setup.sh; cd /open5gs/build && /wait && meson test -v"
dev:
build:
context: ./${DIST-ubuntu}/${TAG-latest}/dev
@@ -120,4 +83,3 @@ services:
volumes:
mongodb: {}
home: {}
config: {}

View File

@@ -1,16 +1,21 @@
FROM node:19
FROM node:carbon
MAINTAINER Sukchan Lee <acetcom@gmail.com>
COPY webui /usr/src/open5gs/webui
ARG PACKAGE=open5gs
ARG VERSION=2.2.6
RUN set -e; \
cd /usr/src; \
rm -rf ./$PACKAGE; \
curl -SLO "https://github.com/open5gs/$PACKAGE/archive/v$VERSION.tar.gz"; \
tar -xvf v$VERSION.tar.gz; \
mv ./$PACKAGE-$VERSION/ ./$PACKAGE;
WORKDIR /usr/src/open5gs/webui
RUN npm clean-install && \
RUN npm install && \
npm run build
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /wait
RUN chmod +x /wait
CMD /wait && npm run start
CMD npm run start
EXPOSE 3000

View File

@@ -44,19 +44,18 @@ All of these Open5GS components have config files. Each config file contains the
#### 5G SA Core
The Open5GS 5G SA Core contains the following functions:
* NRF - NF Repository Function
* SCP - Service Communication Proxy
* AMF - Access and Mobility Management Function
* SMF - Session Management Function
* UPF - User Plane Function
* AUSF - Authentication Server Function
* NRF - NF Repository Function
* UDM - Unified Data Management
* UDR - Unified Data Repository
* PCF - Policy and Charging Function
* NSSF - Network Slice Selection Function
* BSF - Binding Support Function
The 5G SA core works in a different way to the 4G core - it uses a **Service Based Architecture** (SBI). **Control plane** functions are configured to register with the NRF, and the NRF then helps them discover the other core functions. Running through the other functions: The AMF handles connection and mobility management; a subset of what the 4G MME is tasked with. gNBs (5G basestations) connect to the AMF. The UDM, AUSF and UDR carry out similar operations as the 4G HSS, generating SIM authentication vectors and holding the subscriber profile. Session management is all handled by the SMF (previously the responsibility of the 4G MME/ SGWC/ PGWC). The NSSF provides a way to select the network slice, and PCF is used for charging and enforcing subscriber policies. Finally there is the SCP that enable indirect communication.
The 5G SA core works in a different way to the 4G core - it uses a **Service Based Architecture** (SBI). **Control plane** functions are configured to register with the NRF, and the NRF then helps them discover the other core functions. Running through the other functions: The AMF handles connection and mobility management; a subset of what the 4G MME is tasked with. gNBs (5G basestations) connect to the AMF. The UDM, AUSF and UDR carry out similar operations as the 4G HSS, generating SIM authentication vectors and holding the subscriber profile. Session management is all handled by the SMF (previously the responsibility of the 4G MME/ SGWC/ PGWC). The NSSF provides a way to select the network slice. Finally there is the PCF, used for charging and enforcing subscriber policies.
The 5G SA core **user plane** is much simpler, as it only contains a single function. The UPF carries user data packets between the gNB and the external WAN. It connects back to the SMF too.
@@ -71,36 +70,14 @@ With the exception of the SMF and UPF, all config files for the 5G SA core funct
**Note:** Nighly builds are offered by [Osmocom](https://osmocom.org) on [OBS](https://build.opensuse.org/package/show/network:osmocom:nightly/open5gs). Scroll down to use a nightly build package.
{: .notice--warning}
#### Getting MongoDB
---
Import the public key used by the package management system.
```bash
$ sudo apt update
$ sudo apt install wget gnupg
$ wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
```
Create the list file /etc/apt/sources.list.d/mongodb-org-6.0.list for your version of Ubuntu.
```bash
$ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
```
Install the MongoDB packages.
```bash
$ sudo apt update
$ sudo apt-get install -y mongodb-org
$ sudo systemctl start mongod (if '/usr/bin/mongod' is not running)
$ sudo systemctl enable mongod (ensure to automatically start it on system boot)
```
#### Ubuntu
*Ubuntu* makes it easy to install Open5GS as shown below.
```bash
$ sudo apt update
$ sudo apt install software-properties-common
$ sudo add-apt-repository ppa:open5gs/latest
$ sudo apt update
$ sudo apt install open5gs
@@ -113,9 +90,13 @@ The Open5GS packages for Debian are available on [OBS](https://build.opensuse.or
```bash
$ sudo apt update
$ sudo apt install wget gnupg
$ wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
$ echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org.list
$ wget -qO - https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_10/Release.key | sudo apt-key add -
$ sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_10/ ./' > /etc/apt/sources.list.d/open5gs.list"
$ sudo apt update
$ sudo apt install mongodb-org
$ sudo apt install open5gs
```
@@ -134,6 +115,16 @@ https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbunt
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_22.04/
```
#### openSUSE
[Martin Hauke](https://build.opensuse.org/user/show/mnhauke) packaged Open5GS for *openSUSE* on [OBS](https://build.opensuse.org/package/show/home:mnhauke:open5gs/open5gs).
```bash
$ sudo zypper addrepo -f obs://home:mnhauke:open5gs home:mnhauke:open5gs
$ sudo zypper install mongodb-server mongodb-shell
$ sudo zypper install open5gs
```
#### Nightly Builds
Nightly bulit package are provided by [Osmocom](https://osmocom.org) on [OBS](https://build.opensuse.org/package/show/network:osmocom:nightly/open5gs). On *Ubuntu 20.04* you can install it like this:
@@ -162,15 +153,6 @@ https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_21.
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_22.04/
```
#### openSUSE
[Martin Hauke](https://build.opensuse.org/user/show/mnhauke) packaged Open5GS for *openSUSE* on [OBS](https://build.opensuse.org/package/show/home:mnhauke:open5gs/open5gs).
```bash
$ sudo zypper addrepo -f obs://home:mnhauke:open5gs home:mnhauke:open5gs
$ sudo zypper install mongodb-server mongodb-shell
$ sudo zypper install open5gs
```
## 3. Install the WebUI of Open5GS
---
@@ -185,7 +167,7 @@ The WebUI allows you to interactively edit subscriber data. While it is not esse
```bash
$ sudo apt update
$ sudo apt install curl
$ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
$ curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
$ sudo apt install nodejs
```
@@ -238,7 +220,6 @@ HSS-frDi = 127.0.0.8 :3868 for S6a, Cx
PCRF-frDi = 127.0.0.9 :3868 for Gx
NRF-sbi = 127.0.0.10:7777 for 5G SBI
SCP-sbi = 127.0.1.10:7777 for 5G SBI
AUSF-sbi = 127.0.0.11:7777 for 5G SBI
UDM-sbi = 127.0.0.12:7777 for 5G SBI
PCF-sbi = 127.0.0.13:7777 for 5G SBI
@@ -258,49 +239,45 @@ Modify [/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/ope
```diff
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
--- mme.yaml 2020-09-05 20:52:28.648235143 -0400
+++ mme.yaml.new 2020-09-05 20:56:05.434484208 -0400
@@ -253,20 +253,20 @@ mme:
mme:
freeDiameter: /etc/freeDiameter/mme.conf
s1ap:
- - addr: 127.0.0.2
+ - addr: 10.10.0.2
- addr: 127.0.0.2
+ addr: 10.10.0.2 # for external eNB - a local address that can be reached by the eNB
gtpc:
- addr: 127.0.0.2
metrics:
addr: 127.0.0.2
port: 9090
gummei:
plmn_id:
- mcc: 999
- mnc: 70
+ mcc: 001
+ mnc: 01
+ mcc: 001 # set your PLMN-MCC
+ mnc: 01 # set your PLMN-MNC
mme_gid: 2
mme_code: 1
tai:
plmn_id:
- mcc: 999
- mnc: 70
+ mcc: 001
+ mnc: 01
tac: 1
- tac: 1
+ mcc: 001 # set your PLMN-MCC
+ mnc: 01 # set your PLMN-MNC
+ tac: 2 # should match the TAC used by your eNB
security:
integrity_order : [ EIA2, EIA1, EIA0 ]
```
Modify [/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
```diff
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
--- sgwu.yaml 2020-09-05 20:50:39.393022566 -0400
+++ sgwu.yaml.new 2020-09-05 20:51:06.667838823 -0400
@@ -98,7 +98,7 @@ logger:
#
sgwu:
pfcp:
- - addr: 127.0.0.6
+ - addr: 10.11.0.6
gtpu:
- addr: 127.0.0.6
- addr: 127.0.0.6
+ addr: 10.11.0.6 # for external eNB - a local address that can be reached by the eNB
pfcp:
addr: 127.0.0.6
```
After changing config files, please restart Open5GS daemons.
@@ -321,23 +298,20 @@ Modify [/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/ope
```diff
$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
--- amf.yaml 2020-09-05 20:52:28.652234967 -0400
+++ amf.yaml.new 2020-09-05 20:55:07.453114885 -0400
@@ -293,26 +293,26 @@ amf:
- addr: 127.0.0.5
port: 7777
amf:
sbi:
- addr: 127.0.0.5
port: 7777
ngap:
- - addr: 127.0.0.5
+ - addr: 10.10.0.5
metrics:
addr: 127.0.0.5
port: 9090
+ - addr: 10.10.0.5 # for external gNB - a local address that can be reached by the gNB
guami:
- plmn_id:
- mcc: 999
- mnc: 70
+ mcc: 001
+ mnc: 01
+ mcc: 001 # set your PLMN-MCC
+ mnc: 01 # set your PLMN-MNC
amf_id:
region: 2
set: 1
@@ -345,34 +319,36 @@ $ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
- plmn_id:
- mcc: 999
- mnc: 70
+ mcc: 001
+ mnc: 01
tac: 1
- tac: 1
+ mcc: 001 # set your PLMN-MCC
+ mnc: 01 # set your PLMN-MNC
+ tac: 2 # should match the TAC used by your gNB
plmn_support:
- plmn_id:
- mcc: 999
- mnc: 70
+ mcc: 001
+ mnc: 01
+ mcc: 001 # set your PLMN-MCC
+ mnc: 01 # set your PLMN-MNC
s_nssai:
- sst: 1
security:
```
Modify [/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/upf.yaml.in) to set the GTP-U address.
```diff
$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
--- upf.yaml 2020-09-05 20:52:28.652234967 -0400
+++ upf.yaml.new 2020-09-05 20:52:55.279052142 -0400
@@ -168,7 +168,7 @@ upf:
upf:
pfcp:
- addr: 127.0.0.7
gtpu:
- - addr: 127.0.0.7
+ - addr: 10.11.0.7
+ - addr: 10.11.0.7 # for external gNB - a local address that can be reached by the gNB
subnet:
- addr: 10.45.0.1/16
- addr: 2001:db8:cafe::1/48
```
After changing config files, please restart Open5GS daemons.
@@ -506,7 +482,6 @@ $ sudo systemctl stop open5gs-upfd
$ sudo systemctl stop open5gs-hssd
$ sudo systemctl stop open5gs-pcrfd
$ sudo systemctl stop open5gs-nrfd
$ sudo systemctl stop open5gs-scpd
$ sudo systemctl stop open5gs-ausfd
$ sudo systemctl stop open5gs-udmd
$ sudo systemctl stop open5gs-pcfd
@@ -526,7 +501,6 @@ $ sudo systemctl restart open5gs-upfd
$ sudo systemctl restart open5gs-hssd
$ sudo systemctl restart open5gs-pcrfd
$ sudo systemctl restart open5gs-nrfd
$ sudo systemctl restart open5gs-scpd
$ sudo systemctl restart open5gs-ausfd
$ sudo systemctl restart open5gs-udmd
$ sudo systemctl restart open5gs-pcfd
@@ -565,3 +539,4 @@ The WebUI of Open5GS can be removed as follows:
```bash
curl -fsSL {{ site.url }}{{ site.baseurl }}/assets/webui/uninstall | sudo -E bash -
```

View File

@@ -13,29 +13,15 @@ This post explains how to compile and install the source code on **Debian/Ubuntu
### Getting MongoDB
---
Import the public key used by the package management system.
Install MongoDB with package manager. It is used as database for NRF/PCF/UDR and PCRF/HSS.
```bash
$ wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
```
Create the list file /etc/apt/sources.list.d/mongodb-org-6.0.list for your version of Ubuntu.
```bash
$ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
```
Install the MongoDB packages.
```bash
$ sudo apt update
$ sudo apt-get install -y mongodb-org
$ sudo systemctl start mongod (if '/usr/bin/mongod' is not running)
$ sudo systemctl enable mongod (ensure to automatically start it on system boot)
$ sudo apt install mongodb
$ sudo systemctl start mongodb (if '/usr/bin/mongod' is not running)
$ sudo systemctl enable mongodb (ensure to automatically start it on system boot)
```
**Tip:** MongoDB is used as database for NRF/PCF/UDR and PCRF/HSS.
{: .notice--info}
### Setting up TUN device (not persistent after rebooting)
---
@@ -113,15 +99,12 @@ Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username
$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
--- amf.yaml 2020-09-05 20:52:28.652234967 -0400
+++ amf.yaml.new 2020-09-05 20:55:07.453114885 -0400
@@ -293,26 +293,26 @@ amf:
@@ -165,23 +165,23 @@
- addr: 127.0.0.5
port: 7777
ngap:
- - addr: 127.0.0.5
+ - addr: 10.10.0.5
metrics:
addr: 127.0.0.5
port: 9090
guami:
- plmn_id:
- mcc: 999
@@ -135,9 +118,10 @@ $ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
- plmn_id:
- mcc: 999
- mnc: 70
- tac: 1
+ mcc: 001
+ mnc: 01
tac: 1
+ tac: 2
plmn_support:
- plmn_id:
- mcc: 999
@@ -154,11 +138,13 @@ Modify [install/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username
$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
--- upf.yaml 2020-09-05 20:52:28.652234967 -0400
+++ upf.yaml.new 2020-09-05 20:52:55.279052142 -0400
@@ -168,7 +168,7 @@ upf:
@@ -137,9 +137,7 @@
pfcp:
- addr: 127.0.0.7
gtpu:
- - addr: 127.0.0.7
- - addr:
- - 127.0.0.7
- - ::1
+ - addr: 10.11.0.7
subnet:
- addr: 10.45.0.1/16
@@ -172,15 +158,14 @@ Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
--- mme.yaml 2020-09-05 20:52:28.648235143 -0400
+++ mme.yaml.new 2020-09-05 20:56:05.434484208 -0400
@@ -253,20 +253,20 @@ mme:
@@ -204,20 +204,20 @@
mme:
freeDiameter: /home/acetcom/Documents/git/open5gs/install/etc/freeDiameter/mme.conf
s1ap:
- - addr: 127.0.0.2
+ - addr: 10.10.0.2
- addr: 127.0.0.2
+ addr: 10.10.0.2
gtpc:
- addr: 127.0.0.2
metrics:
addr: 127.0.0.2
port: 9090
gummei:
plmn_id:
- mcc: 999
@@ -193,11 +178,13 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
plmn_id:
- mcc: 999
- mnc: 70
- tac: 1
+ mcc: 001
+ mnc: 01
tac: 1
+ tac: 2
security:
integrity_order : [ EIA2, EIA1, EIA0 ]
integrity_order : [ EIA1, EIA2, EIA0 ]
ciphering_order : [ EEA0, EEA1, EEA2 ]
```
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
@@ -205,14 +192,15 @@ Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_usernam
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
--- sgwu.yaml 2020-09-05 20:50:39.393022566 -0400
+++ sgwu.yaml.new 2020-09-05 20:51:06.667838823 -0400
@@ -98,7 +98,7 @@ logger:
@@ -51,7 +51,7 @@
#
sgwu:
pfcp:
- - addr: 127.0.0.6
+ - addr: 10.11.0.6
gtpu:
- addr: 127.0.0.6
- addr: 127.0.0.6
+ addr: 10.11.0.6
pfcp:
addr: 127.0.0.6
```
If you modify the config files while Open5GS daemons are running, please restart them
@@ -222,164 +210,140 @@ If you modify the config files while Open5GS daemons are running, please restart
---
```bash
$ ./install/bin/open5gs-nrfd
Open5GS daemon v2.4.11-100-gbea24d7
10/22 10:43:43.669: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/nrf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:43:43.669: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/nrf.log' (../lib/app/ogs-init.c:129)
10/22 10:43:43.670: [sbi] INFO: nghttp2_server() [127.0.0.10]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:43:43.670: [sbi] INFO: nghttp2_server() [::1]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:43:43.671: [app] INFO: NRF initialize...done (../src/nrf/app.c:31)
$ ./install/bin/open5gs-scpd
Open5GS daemon v2.4.11-100-gbea24d7
10/22 10:43:45.709: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/scp.yaml' (../lib/app/ogs-init.c:126)
10/22 10:43:45.709: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/scp.log' (../lib/app/ogs-init.c:129)
10/22 10:43:45.711: [sbi] INFO: nghttp2_server() [127.0.1.10]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:43:45.712: [app] INFO: SCP initialize...done (../src/scp/app.c:31)
$ ./install/bin/open5gs-amfd
Open5GS daemon v2.4.11-100-gbea24d7
10/22 10:44:01.416: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/amf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:01.416: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/amf.log' (../lib/app/ogs-init.c:129)
10/22 10:44:01.419: [sbi] INFO: NF Service [namf-comm] (../lib/sbi/context.c:1401)
10/22 10:44:01.420: [sbi] INFO: nghttp2_server() [127.0.0.5]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:44:01.420: [amf] INFO: ngap_server() [127.0.0.5]:38412 (../src/amf/ngap-sctp.c:61)
10/22 10:44:01.420: [sctp] INFO: AMF initialize...done (../src/amf/app.c:33)
$ ./install/bin/open5gs-smfd
Open5GS daemon v2.4.11-100-gbea24d7
10/22 10:44:03.217: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/smf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:03.217: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/smf.log' (../lib/app/ogs-init.c:129)
10/22 10:44:03.269: [gtp] INFO: gtp_server() [127.0.0.4]:2123 (../lib/gtp/path.c:30)
10/22 10:44:03.269: [gtp] INFO: gtp_server() [::1]:2123 (../lib/gtp/path.c:30)
10/22 10:44:03.269: [gtp] INFO: gtp_server() [127.0.0.4]:2152 (../lib/gtp/path.c:30)
10/22 10:44:03.269: [gtp] INFO: gtp_server() [::1]:2152 (../lib/gtp/path.c:30)
10/22 10:44:03.269: [pfcp] INFO: pfcp_server() [127.0.0.4]:8805 (../lib/pfcp/path.c:30)
10/22 10:44:03.269: [pfcp] INFO: pfcp_server() [::1]:8805 (../lib/pfcp/path.c:30)
10/22 10:44:03.269: [pfcp] INFO: ogs_pfcp_connect() [127.0.0.7]:8805 (../lib/pfcp/path.c:61)
10/22 10:44:03.269: [sbi] INFO: NF Service [nsmf-pdusession] (../lib/sbi/context.c:1401)
10/22 10:44:03.270: [sbi] INFO: nghttp2_server() [127.0.0.4]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:44:03.270: [app] INFO: SMF initialize...done (../src/smf/app.c:31)
$ ./install/bin/open5gs-upfd
Open5GS daemon v2.4.11-100-gbea24d7
10/22 10:44:06.884: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/upf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:06.884: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/upf.log' (../lib/app/ogs-init.c:129)
10/22 10:44:06.892: [pfcp] INFO: pfcp_server() [127.0.0.7]:8805 (../lib/pfcp/path.c:30)
10/22 10:44:06.892: [gtp] INFO: gtp_server() [127.0.0.7]:2152 (../lib/gtp/path.c:30)
10/22 10:44:06.892: [app] INFO: UPF initialize...done (../src/upf/app.c:31)
$./install/bin/open5gs-ausfd
Open5GS daemon v2.4.11-100-gbea24d7
10/22 10:44:08.747: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/ausf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:08.747: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/ausf.log' (../lib/app/ogs-init.c:129)
10/22 10:44:08.748: [sbi] INFO: NF Service [nausf-auth] (../lib/sbi/context.c:1401)
10/22 10:44:08.749: [sbi] INFO: nghttp2_server() [127.0.0.11]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:44:08.749: [app] INFO: AUSF initialize...done (../src/ausf/app.c:31)
$ ./install/bin/open5gs-udmd
Open5GS daemon v2.4.11-100-gbea24d7
10/22 10:44:10.724: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udm.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:10.724: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/udm.log' (../lib/app/ogs-init.c:129)
10/22 10:44:10.726: [sbi] INFO: NF Service [nudm-ueau] (../lib/sbi/context.c:1401)
10/22 10:44:10.726: [sbi] INFO: NF Service [nudm-uecm] (../lib/sbi/context.c:1401)
10/22 10:44:10.726: [sbi] INFO: NF Service [nudm-sdm] (../lib/sbi/context.c:1401)
10/22 10:44:10.727: [sbi] INFO: nghttp2_server() [127.0.0.12]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:44:10.727: [app] INFO: UDM initialize...done (../src/udm/app.c:31)
$./install/bin/open5gs-pcfd
Open5GS daemon v2.4.11-100-gbea24d7
10/22 10:44:14.265: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:14.265: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcf.log' (../lib/app/ogs-init.c:129)
10/22 10:44:14.269: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:130)
10/22 10:44:14.269: [sbi] INFO: NF Service [npcf-am-policy-control] (../lib/sbi/context.c:1401)
10/22 10:44:14.269: [sbi] INFO: NF Service [npcf-smpolicycontrol] (../lib/sbi/context.c:1401)
10/22 10:44:14.269: [sbi] INFO: NF Service [npcf-policyauthorization] (../lib/sbi/context.c:1401)
10/22 10:44:14.269: [sbi] INFO: nghttp2_server() [127.0.0.13]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:44:14.269: [app] INFO: PCF initialize...done (../src/pcf/app.c:31)
$ ./install/bin/open5gs-nssfd
Open5GS daemon v2.4.11-100-gbea24d7
10/22 10:44:16.250: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/nssf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:16.250: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/nssf.log' (../lib/app/ogs-init.c:129)
10/22 10:44:16.252: [sbi] INFO: NF Service [nnssf-nsselection] (../lib/sbi/context.c:1401)
10/22 10:44:16.252: [sbi] INFO: nghttp2_server() [127.0.0.14]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:44:16.252: [app] INFO: NSSF initialize...done (../src/nssf/app.c:31)
$ ./install/bin/open5gs-bsfd
Open5GS daemon v2.4.11-100-gbea24d7
10/22 10:44:18.836: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/bsf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:18.836: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/bsf.log' (../lib/app/ogs-init.c:129)
10/22 10:44:18.837: [sbi] INFO: NF Service [nbsf-management] (../lib/sbi/context.c:1401)
10/22 10:44:18.837: [sbi] INFO: nghttp2_server() [127.0.0.15]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:44:18.837: [app] INFO: BSF initialize...done (../src/bsf/app.c:31)
$ ./install/bin/open5gs-udrd
Open5GS daemon v2.4.11-100-gbea24d7
10/22 10:44:24.018: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udr.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:24.018: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/udr.log' (../lib/app/ogs-init.c:129)
10/22 10:44:24.021: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:130)
10/22 10:44:24.021: [sbi] INFO: NF Service [nudr-dr] (../lib/sbi/context.c:1401)
10/22 10:44:24.021: [sbi] INFO: nghttp2_server() [127.0.0.20]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:44:24.021: [app] INFO: UDR initialize...done (../src/udr/app.c:31)
$ ./install/bin/open5gs-mmed
Open5GS daemon v2.4.11-100-gbea24d7
Open5GS daemon v2.1.0
10/22 10:44:26.011: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/mme.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:26.011: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/mme.log' (../lib/app/ogs-init.c:129)
10/22 10:44:26.062: [gtp] INFO: gtp_server() [127.0.0.2]:2123 (../lib/gtp/path.c:30)
10/22 10:44:26.063: [gtp] INFO: gtp_connect() [127.0.0.3]:2123 (../lib/gtp/path.c:60)
10/22 10:44:26.063: [mme] INFO: s1ap_server() [127.0.0.2]:36412 (../src/mme/s1ap-sctp.c:62)
10/22 10:44:26.063: [sctp] INFO: MME initialize...done (../src/mme/app-init.c:33)
08/21 22:53:47.328: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/mme.yaml' (../src/main.c:54)
08/21 22:53:47.328: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/mme.log' (../src/main.c:57)
08/21 22:53:47.365: [app] INFO: MME initialize...done (../src/mme/app-init.c:33)
08/21 22:53:47.365: [gtp] INFO: gtp_server() [127.0.0.2]:2123 (../lib/gtp/path.c:32)
08/21 22:53:47.365: [gtp] INFO: gtp_connect() [127.0.0.3]:2123 (../lib/gtp/path.c:59)
08/21 22:53:47.366: [mme] INFO: s1ap_server() [127.0.0.2]:36412 (../src/mme/s1ap-sctp.c:57)
$ ./install/bin/open5gs-sgwcd
Open5GS daemon v2.4.11-100-gbea24d7
Open5GS daemon v2.1.0
10/22 10:44:29.050: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwc.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:29.050: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sgwc.log' (../lib/app/ogs-init.c:129)
10/22 10:44:29.058: [gtp] INFO: gtp_server() [127.0.0.3]:2123 (../lib/gtp/path.c:30)
10/22 10:44:29.058: [pfcp] INFO: pfcp_server() [127.0.0.3]:8805 (../lib/pfcp/path.c:30)
10/22 10:44:29.058: [pfcp] INFO: ogs_pfcp_connect() [127.0.0.6]:8805 (../lib/pfcp/path.c:61)
10/22 10:44:29.058: [app] INFO: SGW-C initialize...done (../src/sgwc/app.c:31)
08/21 22:54:43.059: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwc.yaml' (../src/main.c:54)
08/21 22:54:43.059: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sgwc.log' (../src/main.c:57)
08/21 22:54:43.065: [app] INFO: SGW-C initialize...done (../src/sgwc/app.c:31)
08/21 22:54:43.066: [gtp] INFO: gtp_server() [127.0.0.3]:2123 (../lib/gtp/path.c:32)
08/21 22:54:43.066: [pfcp] INFO: pfcp_server() [127.0.0.3]:8805 (../lib/pfcp/path.c:32)
08/21 22:54:43.066: [pfcp] INFO: ogs_pfcp_connect() [127.0.0.6]:8805 (../lib/pfcp/path.c:60)
$ ./install/bin/open5gs-smfd
Open5GS daemon v2.1.0
08/21 22:54:56.000: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/smf.yaml' (../src/main.c:54)
08/21 22:54:56.000: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/smf.log' (../src/main.c:57)
08/21 22:54:56.050: [gtp] INFO: gtp_server() [127.0.0.4]:2123 (../lib/gtp/path.c:32)
08/21 22:54:56.050: [app] INFO: SMF initialize...done (../src/smf/app.c:31)
08/21 22:54:56.050: [gtp] INFO: gtp_server() [::1]:2123 (../lib/gtp/path.c:32)
08/21 22:54:56.050: [pfcp] INFO: pfcp_server() [127.0.0.4]:8805 (../lib/pfcp/path.c:32)
08/21 22:54:56.050: [pfcp] INFO: pfcp_server() [::1]:8805 (../lib/pfcp/path.c:32)
08/21 22:54:56.050: [pfcp] INFO: ogs_pfcp_connect() [127.0.0.7]:8805 (../lib/pfcp/path.c:60)
08/21 22:54:56.051: [sbi] INFO: sbi_server() [127.0.0.4]:7777 (../lib/sbi/server.c:298)
$ ./install/bin/open5gs-amfd
Open5GS daemon v2.1.0
08/21 22:55:14.015: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/amf.yaml' (../src/main.c:54)
08/21 22:55:14.015: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/amf.log' (../src/main.c:57)
08/21 22:55:14.039: [app] INFO: AMF initialize...done (../src/amf/app.c:33)
08/21 22:55:14.040: [sbi] INFO: sbi_server() [127.0.0.5]:7777 (../lib/sbi/server.c:298)
08/21 22:55:14.040: [amf] INFO: ngap_server() [127.0.0.5]:38412 (../src/amf/ngap-sctp.c:56)
$ ./install/bin/open5gs-sgwud
Open5GS daemon v2.4.11-100-gbea24d7
Open5GS daemon v2.1.0
10/22 10:44:36.178: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwu.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:36.178: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sgwu.log' (../lib/app/ogs-init.c:129)
10/22 10:44:36.185: [pfcp] INFO: pfcp_server() [127.0.0.6]:8805 (../lib/pfcp/path.c:30)
10/22 10:44:36.185: [gtp] INFO: gtp_server() [127.0.0.6]:2152 (../lib/gtp/path.c:30)
10/22 10:44:36.185: [app] INFO: SGW-U initialize...done (../src/sgwu/app.c:31)
08/21 22:54:10.357: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwu.yaml' (../src/main.c:54)
08/21 22:54:10.357: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sgwu.log' (../src/main.c:57)
08/21 22:54:10.360: [pfcp] INFO: pfcp_server() [127.0.0.6]:8805 (../lib/pfcp/path.c:32)
08/21 22:54:10.360: [app] INFO: SGW-U initialize...done (../src/sgwu/app.c:31)
08/21 22:54:10.361: [gtp] INFO: gtp_server() [127.0.0.6]:2152 (../lib/gtp/path.c:32)
$ ./install/bin/open5gs-upfd
Open5GS daemon v2.1.0
08/21 22:54:21.596: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/upf.yaml' (../src/main.c:54)
08/21 22:54:21.596: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/upf.log' (../src/main.c:57)
08/21 22:54:21.601: [pfcp] INFO: pfcp_server() [127.0.0.7]:8805 (../lib/pfcp/path.c:32)
08/21 22:54:21.601: [app] INFO: UPF initialize...done (../src/upf/app.c:31)
08/21 22:54:21.601: [gtp] INFO: gtp_server() [127.0.0.7]:2152 (../lib/gtp/path.c:32)
08/21 22:54:21.601: [gtp] INFO: gtp_server() [::1]:2152 (../lib/gtp/path.c:32)
$ ./install/bin/open5gs-hssd
Open5GS daemon v2.4.11-100-gbea24d7
Open5GS daemon v2.1.0
10/22 10:49:22.963: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/hss.yaml' (../lib/app/ogs-init.c:126)
10/22 10:49:22.963: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/hss.log' (../lib/app/ogs-init.c:129)
10/22 10:49:22.965: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:130)
10/22 10:49:22.996: [app] INFO: HSS initialize...done (../src/hss/app-init.c:31)
10/22 10:49:22.997: [diam] INFO: CONNECTED TO 'mme.localdomain' (SCTP,soc#15): (../lib/diameter/common/logger.c:108)
08/21 22:57:17.450: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/hss.yaml' (../src/main.c:54)
08/21 22:57:17.450: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/hss.log' (../src/main.c:57)
08/21 22:57:17.451: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:99)
08/21 22:57:17.519: [app] INFO: HSS initialize...done (../src/hss/app-init.c:31)
$ ./install/bin/open5gs-pcrfd
Open5GS daemon v2.4.11-100-gbea24d7
Open5GS daemon v2.1.0
10/22 10:49:26.089: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcrf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:49:26.089: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcrf.log' (../lib/app/ogs-init.c:129)
10/22 10:49:26.091: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:130)
10/22 10:49:26.124: [app] INFO: PCRF initialize...done (../src/pcrf/app-init.c:31)
10/22 10:49:26.125: [diam] INFO: CONNECTED TO 'smf.localdomain' (SCTP,soc#15): (../lib/diameter/common/logger.c:108)
08/21 22:57:45.894: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcrf.yaml' (../src/main.c:54)
08/21 22:57:45.894: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcrf.log' (../src/main.c:57)
08/21 22:57:45.896: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:99)
08/21 22:57:45.997: [app] INFO: PCRF initialize...done (../src/pcrf/app-init.c:31)
$ ./install/bin/open5gs-nrfd
Open5GS daemon v2.1.0
08/21 22:56:35.472: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/nrf.yaml' (../src/main.c:54)
08/21 22:56:35.472: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/nrf.log' (../src/main.c:57)
08/21 22:56:35.472: [app] INFO: NRF initialize...done (../src/nrf/app.c:31)
08/21 22:56:35.473: [sbi] INFO: sbi_server() [127.0.0.10]:7777 (../lib/sbi/server.c:298)
08/21 22:56:35.473: [sbi] INFO: sbi_server() [::1]:7777 (../lib/sbi/server.c:298
$ ./install/bin/open5gs-ausfd
Open5GS daemon v2.1.0
08/21 22:55:41.899: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/ausf.yaml' (../src/main.c:54)
08/21 22:55:41.899: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/ausf.log' (../src/main.c:57)
08/21 22:55:41.900: [app] INFO: AUSF initialize...done (../src/ausf/app.c:31)
08/21 22:55:41.900: [sbi] INFO: sbi_server() [127.0.0.11]:7777 (../lib/sbi/server.c:298)
$ ./install/bin/open5gs-udmd
Open5GS daemon v2.1.0
08/21 22:56:02.154: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udm.yaml' (../src/main.c:54)
08/21 22:56:02.154: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/udm.log' (../src/main.c:57)
08/21 22:56:02.155: [app] INFO: UDM initialize...done (../src/udm/app.c:31)
08/21 22:56:02.155: [sbi] INFO: sbi_server() [127.0.0.12]:7777 (../lib/sbi/server.c:298)
$ ./install/bin/open5gs-pcfd
Open5GS daemon v2.1.0
08/21 22:56:02.154: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcf.yaml' (../src/main.c:54)
08/21 22:56:02.154: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcf.log' (../src/main.c:57)
08/21 22:56:02.155: [app] INFO: PCF initialize...done (../src/pcf/app.c:31)
08/21 22:56:02.155: [sbi] INFO: sbi_server() [127.0.0.12]:7777 (../lib/sbi/server.c:298)
$ ./install/bin/open5gs-nssfd
Open5GS daemon v2.1.0
08/21 22:56:02.154: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/nssfd.yaml' (../src/main.c:54)
08/21 22:56:02.154: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/nssfd.log' (../src/main.c:57)
08/21 22:56:02.155: [app] INFO: NSSF initialize...done (../src/nssfd/app.c:31)
08/21 22:56:02.155: [sbi] INFO: sbi_server() [127.0.0.12]:7777 (../lib/sbi/server.c:298)
$ ./install/bin/open5gs-bsfd
Open5GS daemon v2.1.0
08/21 22:56:02.154: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/bsf.yaml' (../src/main.c:54)
08/21 22:56:02.154: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/bsf.log' (../src/main.c:57)
08/21 22:56:02.155: [app] INFO: BSF initialize...done (../src/bsf/app.c:31)
08/21 22:56:02.155: [sbi] INFO: sbi_server() [127.0.0.12]:7777 (../lib/sbi/server.c:298)
$ ./install/bin/open5gs-udrd
Open5GS daemon v2.1.0
08/21 22:56:15.810: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udr.yaml' (../src/main.c:54)
08/21 22:56:15.810: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/udr.log' (../src/main.c:57)
08/21 22:56:15.813: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:99)
08/21 22:56:15.813: [app] INFO: UDR initialize...done (../src/udr/app.c:31)
08/21 22:56:15.813: [sbi] INFO: sbi_server() [127.0.0.13]:7777 (../lib/sbi/server.c:298)
```
Several command line options are provided.
@@ -418,7 +382,7 @@ $ ./build/tests/app/app ## Both 5G Core and EPC with ./build/configs/sample.yaml
```bash
$ sudo apt install curl
$ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
$ curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
$ sudo apt install nodejs
```
@@ -426,7 +390,7 @@ Install the dependencies to run WebUI
```bash
$ cd webui
$ npm ci
$ npm ci --no-optional
```
The WebUI runs as an [npm](https://www.npmjs.com/) script.
@@ -583,37 +547,32 @@ You can use the command line option[`-d`] to record more logs.
```bash
$ ./tests/app/app -d
Open5GS daemon v2.4.11-100-gbea24d7
Open5GS daemon v1.3.0-213-gd190548+
10/22 10:59:03.813: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/build/configs/sample.yaml' (../lib/app/ogs-init.c:126)
10/22 10:59:03.813: [thread] DEBUG: [0x55fab86aff40] worker signal (../lib/core/ogs-thread.c:66)
10/22 10:59:03.813: [thread] DEBUG: [0x55fab86aff40] thread started (../lib/core/ogs-thread.c:101)
Open5GS daemon v2.4.11-100-gbea24d7
08/21 23:01:54.246: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/build/configs/sample.yaml' (../src/main.c:54)
08/21 23:01:54.246: [thread] DEBUG: [0x7f8de4d25018] worker signal (../lib/core/ogs-thread.c:66)
08/21 23:01:54.246: [thread] DEBUG: [0x7f8de4d25018] thread started (../lib/core/ogs-thread.c:101)
Open5GS daemon v1.3.0-213-gd190548+
08/21 23:01:54.254: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/build/configs/sample.yaml' (../src/main.c:54)
08/21 23:01:54.254: [thread] DEBUG: [0x7ff8d13be818] worker signal (../lib/core/ogs-thread.c:66)
08/21 23:01:54.254: [nrf] DEBUG: nrf_state_initial(): INIT (../src/nrf/nrf-sm.c:25)
08/21 23:01:54.254: [nrf] DEBUG: nrf_state_operational(): ENTRY (../src/nrf/nrf-sm.c:50)
08/21 23:01:54.254: [thread] DEBUG: [0x7ff8d13be818] thread started (../lib/core/ogs-thread.c:101)
08/21 23:01:54.254: [app] INFO: NRF initialize...done (../src/nrf/app.c:31)
08/21 23:01:54.255: [sbi] INFO: sbi_server() [127.0.0.10]:7777 (../lib/sbi/server.c:298)
08/21 23:01:54.255: [sbi] INFO: sbi_server() [::1]:7777 (../lib/sbi/server.c:298)
08/21 23:01:54.296: [thread] DEBUG: [0x7f8de4d25098] worker signal (../lib/core/ogs-thread.c:66)
08/21 23:01:54.296: [thread] DEBUG: [0x7f8de4d25098] thread started (../lib/core/ogs-thread.c:101)
Open5GS daemon v1.3.0-213-gd190548+
08/21 23:01:54.315: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/build/configs/sample.yaml' (../src/main.c:54)
08/21 23:01:54.319: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:99)
08/21 23:01:54.332: [app] INFO: PCRF initialize...done (../src/pcrf/app-init.c:31)
08/21 23:01:54.347: [thread] DEBUG: [0x7f8de4d25118] worker signal (../lib/core/ogs-thread.c:66)
08/21 23:01:54.347: [thread] DEBUG: [0x7f8de4d25118] thread started (../lib/core/ogs-thread.c:101)
Open5GS daemon v1.3.0-213-gd190548+
10/22 10:59:03.818: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/build/configs/sample.yaml' (../lib/app/ogs-init.c:126)
10/22 10:59:03.819: [sock] DEBUG: addr:127.0.0.10, port:7777 (../lib/core/ogs-sockaddr.c:140)
10/22 10:59:03.819: [sock] DEBUG: addr:::1, port:7777 (../lib/core/ogs-sockaddr.c:140)
10/22 10:59:03.819: [sock] DEBUG: addr:127.0.1.10, port:7777 (../lib/core/ogs-sockaddr.c:140)
10/22 10:59:03.819: [sock] DEBUG: socket create(2:1:6) (../lib/core/ogs-socket.c:92)
10/22 10:59:03.819: [sock] DEBUG: Turn on TCP_NODELAY (../lib/core/ogs-sockopt.c:139)
10/22 10:59:03.819: [sock] DEBUG: Turn on SO_REUSEADDR (../lib/core/ogs-sockopt.c:120)
10/22 10:59:03.819: [sock] DEBUG: socket bind 127.0.0.10:7777 (../lib/core/ogs-socket.c:117)
10/22 10:59:03.819: [sock] DEBUG: tcp_server() [127.0.0.10]:7777 (../lib/core/ogs-tcp.c:60)
10/22 10:59:03.819: [sbi] INFO: nghttp2_server() [127.0.0.10]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:59:03.819: [sock] DEBUG: socket create(10:1:6) (../lib/core/ogs-socket.c:92)
10/22 10:59:03.819: [sock] DEBUG: Turn on TCP_NODELAY (../lib/core/ogs-sockopt.c:139)
10/22 10:59:03.819: [sock] DEBUG: Turn on SO_REUSEADDR (../lib/core/ogs-sockopt.c:120)
10/22 10:59:03.819: [sock] DEBUG: socket bind ::1:7777 (../lib/core/ogs-socket.c:117)
10/22 10:59:03.819: [sock] DEBUG: tcp_server() [::1]:7777 (../lib/core/ogs-tcp.c:60)
10/22 10:59:03.819: [sbi] INFO: nghttp2_server() [::1]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:59:03.819: [thread] DEBUG: [0x5601b141e520] worker signal (../lib/core/ogs-thread.c:66)
10/22 10:59:03.819: [nrf] DEBUG: nrf_state_initial(): INIT (../src/nrf/nrf-sm.c:25)
10/22 10:59:03.819: [nrf] DEBUG: nrf_state_operational(): ENTRY (../src/nrf/nrf-sm.c:50)
10/22 10:59:03.819: [thread] DEBUG: [0x5601b141e520] thread started (../lib/core/ogs-thread.c:101)
10/22 10:59:03.819: [app] INFO: NRF initialize...done (../src/nrf/app.c:31)
10/22 10:59:03.864: [thread] DEBUG: [0x55fab86d2100] worker signal (../lib/core/ogs-thread.c:66)
10/22 10:59:03.864: [thread] DEBUG: [0x55fab86d2100] thread started (../lib/core/ogs-thread.c:101)
Open5GS daemon v2.4.11-100-gbea24d7
...
```

View File

@@ -0,0 +1,372 @@
---
title: Open5GS Splitting Network Functions
head_inline: "<style> .blue { color: blue; } </style>"
---
In a production network, NFs are usually not on the same machine as the default example that comes with Open5GS.
Open5GS is designed to comply with standards, so in theory you can connect core network functions from Open5GS or other vendors to form a functioning network. However, this is only possible if it complies with 3GPP.
To demonstrate this, we will cover how to isolate each network function and connect each network function to another. For some interfaces, you can specify multiple interfaces to connect to multiple interfaces.
In this example, we are connecting the Open5GS NF together, but instead of the Open5GS network function, you can easily connect them like other vendors' NFs.
## 1. Configuring Open5GS (Without other vendors' NFs)
_Cloud Authentication and Session Management Server_
```
MongoDB = 127.0.0.1 (subscriber data) - http://localhost:3000
MME-s1ap = 10.10.0.2 :36412 (authVPN) for S1-MME
MME-gtpc = 127.0.0.2 :2123 for S11
MME-frDi = 127.0.0.2 :3868 for S6a auth
SGWC-gtpc = 127.0.0.3 :2123 for S11
SGWC-pfcp = 10.10.0.3 :8805 (authVPN) for Sxa
SMF-gtpc = 127.0.0.4 :2123 for S5/8c, N11
SMF-pfcp = 10.10.0.4 :8805 (authVPN) for N4
SMF-frDi = 127.0.0.4 :3868 for Gx auth
SMF-sbi = 127.0.0.4 :7777 for 5G SBI (N7,N10,N11)
AMF-ngap = 10.10.0.5 :38412 (authVPN) for N2
AMF-sbi = 127.0.0.5 :7777 for 5G SBI (N8,N12,N11)
HSS-frDi = 127.0.0.8 :3868 for S6a auth
PCRF-frDi = 127.0.0.9 :3868 for Gx auth
NRF-sbi = 127.0.0.10:7777 for 5G SBI
AUSF-sbi = 127.0.0.11:7777 for 5G SBI
UDM-sbi = 127.0.0.12:7777 for 5G SBI
PCF-sbi = 127.0.0.13:7777 for 5G SBI
NSSF-sbi = 127.0.0.14:7777 for 5G SBI
BSF-sbi = 127.0.0.15:7777 for 5G SBI
UDR-sbi = 127.0.0.20:7777 for 5G SBI
```
_Cloud Userplane Server (to host IMS etc)_
```
SGWU-pfcp = 10.10.0.6 :8805 (authVPN) for Sxa
SGWU-gtpu = 10.11.0.6 :2152 (userplaneVPN) for S1-U, S5/8u
UPF-pfcp = 10.10.0.7 :8805 (authVPN) for N4
UPF-gtpu = 10.11.0.7 :2152 (userplaneVPN) for S5/8u, N3
```
You can refer to the network settings at
[{{ site.url }}{{ site.baseurl }}/assets/Open5GS-Diagram.pdf]({{ site.url }}{{ site.baseurl }}/assets/Open5GS-Diagram.pdf) provided by [@kbarlee](https://github.com/kbarlee) in issue [#528](https://github.com/{{ site.github_username }}/open5gs/issues/528)
{: .notice--danger}
Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
```diff
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
--- mme.yaml.old 2020-08-22 11:36:40.512418765 -0400
+++ mme.yaml 2020-08-22 11:36:27.081466682 -0400
@@ -204,20 +204,20 @@
mme:
freeDiameter: /home/acetcom/Documents/git/open5gs/install/etc/freeDiameter/mme.conf
s1ap:
- addr: 127.0.0.2
+ addr: 10.10.0.2
gtpc:
addr: 127.0.0.2
gummei:
plmn_id:
- mcc: 001
- mnc: 01
+ mcc: 999
+ mnc: 70
mme_gid: 2
mme_code: 1
tai:
plmn_id:
- mcc: 001
- mnc: 01
- tac: 7
+ mcc: 999
+ mnc: 70
+ tac: 1
security:
integrity_order : [ EIA1, EIA2, EIA0 ]
ciphering_order : [ EEA0, EEA1, EEA2 ]
```
Modify [install/etc/open5gs/sgwc.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwc.yaml.in) to set the PFCP IP address.
```diff
$ diff -u /etc/open5gs/sgwc.yaml.old /etc/open5gs/sgwc.yaml
@@ -49,7 +49,7 @@
gtpc:
addr: 127.0.0.3
pfcp:
- addr: 127.0.0.3
+ addr: 10.10.0.3
#
# sgwu:
@@ -100,7 +100,7 @@
#
sgwu:
pfcp:
- addr: 127.0.0.6
+ addr: 10.10.0.6
#
# parameter:
```
Modify [install/etc/open5gs/smf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/smf.yaml.in) to set the PFCP IP address.
```diff
$ diff -u /etc/open5gs/smf.yaml.old /etc/open5gs/smf.yaml
--- smf.yaml.old 2020-08-22 11:37:39.990816411 -0400
+++ smf.yaml 2020-08-22 11:38:18.647999952 -0400
@@ -187,8 +187,7 @@
- addr: 127.0.0.4
- addr: ::1
pfcp:
- - addr: 127.0.0.4
- - addr: ::1
+ - addr: 10.10.0.4
subnet:
- addr: 10.45.0.1/16
- addr: 2001:db8:cafe::1/48
@@ -282,7 +281,7 @@
#
upf:
pfcp:
- - addr: 127.0.0.7
+ - addr: 10.10.0.7
#
# parameter:
```
Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/amf.yaml.in) to set the NGAP IP address, PLMN ID, TAC and NSSAI.
```diff
diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
--- amf.yaml.old 2020-06-21 23:34:14.643114779 -0400
+++ amf.yaml 2020-06-21 23:34:28.718482095 -0400
@@ -67,25 +67,25 @@
- addr: 127.0.0.5
port: 7777
ngap:
- - addr: 127.0.0.5
+ - addr: 10.10.0.5
guami:
- plmn_id:
- mcc: 001
- mnc: 01
+ mcc: 999
+ mnc: 70
amf_id:
region: 2
set: 1
tai:
- plmn_id:
- mcc: 001
- mnc: 01
- tac: 7
+ mcc: 999
+ mnc: 70
+ tac: 1
plmn_support:
- plmn_id:
- mcc: 001
- mnc: 01
+ mcc: 999
+ mnc: 70
s_nssai:
- sst: 1
- - sd: 2
security:
integrity_order : [ NIA1, NIA2, NIA0 ]
ciphering_order : [ NEA0, NEA1, NEA2 ]
```
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U and PFCP IP address.
```diff
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
--- sgwu.yaml.old 2020-08-22 11:41:09.214670723 -0400
+++ sgwu.yaml 2020-08-22 11:41:27.433937124 -0400
@@ -51,9 +51,9 @@
#
sgwu:
gtpu:
- addr: 127.0.0.6
+ addr: 10.11.0.6
pfcp:
- addr: 127.0.0.6
+ addr: 10.10.0.6
#
# sgwc:
```
Modify [install/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/upf.yaml.in) to set the GTP-U and PFCP IP address.
```diff
$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
--- upf.yaml.old 2020-08-22 11:42:57.781750067 -0400
+++ upf.yaml 2020-08-22 11:43:13.268901616 -0400
@@ -59,11 +59,9 @@
#
upf:
pfcp:
- - addr: 127.0.0.7
+ - addr: 10.10.0.7
gtpu:
- - addr:
- - 127.0.0.7
- - ::1
+ - addr: 10.11.0.7
subnet:
- addr: 10.45.0.1/16
- addr: 2001:db8:cafe::1/48
```
After changing conf files, please restart Open5GS daemons.
```bash
$ sudo systemctl restart open5gs-mmed.service
$ sudo systemctl restart open5gs-sgwcd.service
$ sudo systemctl restart open5gs-smfd.service
$ sudo systemctl restart open5gs-amfd.service
$ sudo systemctl restart open5gs-upfd.service
$ sudo systemctl restart open5gs-sgwud.service
```
## 2. External SMF
In it's simplest form the SMF has 4 interfaces:
* S5 - Connection to home network SGW-C (GTP-C)
* Gx - Connection to PCRF (Diameter)
* SBI - Service-based interface(HTTP2)
* Sgi - Connection to external network (Generally the Internet via standard TCP/IP)
#### S5 Interface Configuration
Edit ```/etc/open5gs/smf.yaml``` and change the address to IP of the server running the SMF for the listener on GTP-C interfaces.
```
smf:
freeDiameter: /etc/freeDiameter/smf.conf
gtpc:
addr:
- 10.0.1.121
```
#### Gx Interface Configuration
Edit ```/etc/freeDiameter/smf.conf```
Update ```ListenOn``` address to IP of the server running the SMF:
``` ListenOn = "10.0.1.121"; ```
Update ConnectPeer to connect to the PCRF on it's IP.
```ConnectPeer = "pcrf.localdomain" { ConnectTo = "10.0.1.123"; No_TLS; };```
#### Restart Services
Restart Open5GS SMF Daemon:
``` $ sudo systemctl restart open5gs-smfd.service ```
## 3. External SGW-C
In it's simplest form the SGW-C has 2 interfaces:
* S11 - Connection to MME (GTP-C)
* S5 - Connection to the home network SMF (GTP-C)
#### S5 Interface Configuration
Edit ```/etc/open5gs/sgwc.yaml``` and change the address to IP of the server running the SGW-C for the listener on GTP-C interface.
```
sgwc:
gtpc:
addr:
- 10.0.1.122
```
Restart Open5GS SGW-C Daemon:
``` $ sudo systemctl restart open5gs-sgwcd.service ```
## 4. External PCRF
In it's simplest from the PCRF has 1 network interface:
* Gx - Connection to SMF (Diameter)
#### Gx Interface Configuration
Edit ```/etc/freeDiameter/pcrf.conf```
Update ```ListenOn``` address to IP of the server running the HSS on it's IP:
``` ListenOn = "10.0.1.123"; ```
Update ConnectPeer to connect to the MME.
```ConnectPeer = "smf.localdomain" { ConnectTo = "10.0.1.121"; No_TLS; };```
#### MongoDB Interface Configuration
Edit the ```db_uri:``` to point at the Open5GS: ```db_uri: mongodb://10.0.1.118/open5gs```
Restart Open5GS PCRF Daemon:
``` $ sudo systemctl restart open5gs-pcrfd.service ```
## 5. External HSS
In it's simplest form the HSS has 1 network interface:
* S6a - Connection to MME (Diameter)
#### S6a Interface Configuration
Edit ```/etc/freeDiameter/hss.conf```
Update ```ListenOn``` address to IP of the server running the HSS on it's IP:
``` ListenOn = "10.0.1.118"; ```
Update ConnectPeer to connect to the MME.
```ConnectPeer = "mme.localdomain" { ConnectTo = "10.0.1.124"; No_TLS; };```
Restart Open5GS HSS Daemon:
``` $ sudo systemctl restart open5gs-hssd.service ```
#### MongoDB Interface Configuration (Open5GS specific)
If you are using Open5GS's HSS you may need to enable MongoDB access from the PCRF. This is done by editing ''/etc/mongodb.conf'' and changing the bind IP to:
``` bind_ip = 0.0.0.0 ```
Restart MongoDB for changes to take effect.
``` $ /etc/init.d/mongodb restart ```
## 6. External MME
In it's simplest form the MME has 3 interfaces:
* S1AP - Connections from eNodeBs
* S6a - Connection to HSS (Diameter)
* S11 - Connection to SGW-C (GTP-C)
#### S11 Interface Configuration
Edit ```/etc/open5gs/mme.yaml``` and filling the IP address of the SGW-C and SMF servers.
```
sgwc:
gtpc:
addr: 10.0.1.122
smf:
gtpc:
addr:
- 10.0.1.121
```
#### S6a Interface Configuration
Edit ```/etc/freeDiameter/mme.conf```
Update ```ListenOn``` address to IP of the server running the MME:
``` ListenOn = "10.0.1.124"; ```
Update ConnectPeer to connect to the PCRF on it's IP.
```ConnectPeer = "hss.localdomain" { ConnectTo = "10.0.1.118"; No_TLS; };```
#### Restart Services
Restart Open5GS MME Daemon:
``` $ sudo systemctl restart open5gs-mmed.service ```

View File

@@ -328,10 +328,9 @@ $ cd build
$ ninja install
$ cd ../
$ ls install/bin
open5gs-amfd open5gs-mmed open5gs-pcrfd open5gs-smfd
open5gs-ausfd open5gs-nrfd open5gs-scpd open5gs-udmd
open5gs-bsfd open5gs-nssfd open5gs-sgwcd open5gs-udrd
open5gs-hssd open5gs-pcfd open5gs-sgwud open5gs-upfd
open5gs-amfd open5gs-hssd open5gs-nrfd open5gs-sgwcd open5gs-smfd open5gs-udrd
open5gs-ausfd open5gs-mmed open5gs-pcrfd open5gs-sgwud open5gs-udmd open5gs-pcfd
open5gs-upfd open5gs-nssfd open5gs-bsfd
```
## Building WebUI of Open5GS
@@ -348,7 +347,7 @@ Install the dependencies to run WebUI
```bash
$ cd ~/open5gs
$ cd webui
$ npm ci
$ npm ci --no-optional
```
The WebUI runs as an [npm](https://www.npmjs.com/) script.

View File

@@ -127,7 +127,7 @@ Install the dependencies to run WebUI
```bash
$ cd webui
$ npm ci
$ npm ci --no-optional
```
The WebUI runs as an [npm](https://www.npmjs.com/) script.

View File

@@ -164,7 +164,7 @@ Install the dependencies to run WebUI
```bash
$ cd webui
$ npm ci
$ npm ci --no-optional
```
The WebUI runs as an [npm](https://www.npmjs.com/) script.

View File

@@ -162,7 +162,7 @@ Install the dependencies to run WebUI
```bash
$ cd webui
$ npm ci
$ npm ci --no-optional
```
The WebUI runs as an [npm](https://www.npmjs.com/) script.

View File

@@ -207,7 +207,7 @@ Install the dependencies to run WebUI
```bash
$ cd webui
$ npm ci
$ npm ci --no-optional
```
The WebUI runs as an [npm](https://www.npmjs.com/) script.

View File

@@ -105,7 +105,7 @@ Install the dependencies to run WebUI
```bash
$ cd webui
$ npm ci
$ npm ci --no-optional
```
The WebUI runs as an [npm](https://www.npmjs.com/) script.

View File

@@ -21,7 +21,6 @@ open5gs 26934 0.0 0.0 707472 12732 ? Ssl 12:13 0:00 /usr/bin/open5g
open5gs 27244 0.2 0.0 2861424 13584 ? Ssl 12:13 0:00 /usr/bin/open5gs-hssd -c /etc/open5gs/hss.yaml
open5gs 27366 0.0 0.0 2890772 14380 ? Ssl 12:13 0:00 /usr/bin/open5gs-pcrfd -c /etc/open5gs/pcrf.yaml
open5gs 27485 0.0 0.0 243816 15064 ? Ssl 12:13 0:00 /usr/bin/open5gs-nrfd -c /etc/open5gs/nrf.yaml
open5gs 27485 0.0 0.0 243916 13064 ? Ssl 12:13 0:00 /usr/bin/open5gs-scpd -c /etc/open5gs/scp.yaml
open5gs 27543 0.0 0.0 222416 9672 ? Ssl 12:13 0:00 /usr/bin/open5gs-ausfd -c /etc/open5gs/ausf.yaml
open5gs 27600 0.0 0.0 222328 9668 ? Ssl 12:13 0:00 /usr/bin/open5gs-udmd -c /etc/open5gs/udm.yaml
open5gs 27600 0.0 0.0 222329 9669 ? Ssl 12:13 0:00 /usr/bin/open5gs-pcfd -c /etc/open5gs/pcf.yaml
@@ -30,7 +29,7 @@ open5gs 27600 0.0 0.0 222329 9669 ? Ssl 12:13 0:00 /usr/bin/open5g
open5gs 27697 0.0 0.0 243976 13716 ? Ssl 12:13 0:00 /usr/bin/open5gs-udrd -c /etc/open5gs/udr.yaml
```
You should see each of the above services, MME, SGW-C, SMF, AMF, SGW-U, UPF, HSS, PCRF, NRF, SCP, AUSF, UDM, PCF, NSSF, BSF & UDR are all running.
You should see each of the above services, MME, SGW-C, SMF, AMF, SGW-U, UPF, HSS, PCRF, NRF, AUSF, UDM, PCF, NSSF, BSF & UDR are all running.
If your instance doesn't show this make sure you're started each service:
```bash
@@ -43,7 +42,6 @@ $ systemctl start open5gs-upfd.service
$ systemctl start open5gs-hssd.service
$ systemctl start open5gs-pcrfd.service
$ systemctl start open5gs-nrfd.service
$ systemctl start open5gs-scpd.service
$ systemctl start open5gs-ausfd.service
$ systemctl start open5gs-udmd.service
$ systemctl start open5gs-pcfd.service
@@ -57,15 +55,14 @@ $ systemctl start open5gs-udrd.service
If a service isn't running check the log for that service - logs for each service live in */var/log/open5gs/* where each service logs to it's own file - MME logs in mme.log, AMF logs in amf.log, and so on.
```bash
$ cat a.log
Open5GS daemon v2.4.11-100-gbea24d7
$ cat /var/log/open5gs/mme.log
Open5GS daemon v1.0.0
10/22 11:05:40.032: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/mme.yaml' (../lib/app/ogs-init.c:126)
10/22 11:05:40.032: [app] INFO: File Logging: 'a.log' (../lib/app/ogs-init.c:129)
10/22 11:05:40.094: [gtp] INFO: gtp_server() [127.0.0.2]:2123 (../lib/gtp/path.c:30)
10/22 11:05:40.094: [gtp] INFO: gtp_connect() [127.0.0.3]:2123 (../lib/gtp/path.c:60)
10/22 11:05:40.094: [mme] INFO: s1ap_server() [127.0.0.2]:36412 (../src/mme/s1ap-sctp.c:62)
10/22 11:05:40.094: [sctp] INFO: MME initialize...done (../src/mme/app-init.c:33)
[app] INFO: Configuration: '/etc/open5gs/mme.yaml' (../src/main.c:54)
[app] INFO: File Logging: '/var/log/open5gs/mme.log' (../src/main.c:57)
[mme] ERROR: No sgwc.gtpc in '/etc/open5gs/mme.yaml' (../src/mme/mme-context.c:192)
[app] ERROR: Failed to intialize MME (../src/mme/app-init.c:30)
[app] FATAL: Open5GS initialization failed. Aborted (../src/main.c:222)
```
Or, you can use `journalctl` like below to view live log.
@@ -184,11 +181,11 @@ $ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
@@ -20,6 +20,7 @@
#
logger:
file: @localstatedir@/log/open5gs/amf.log
file: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/amf.log
+ level: debug
#
# amf:
#
```
After changing conf files, please restart Open5GS daemons.

View File

@@ -92,7 +92,7 @@ home/open5gs/install/lib/x86_64-linux-gnu/libfdcore.so.7(+0x67c3c) [0x7f3b715f9c
At this time, you need to check the DB schema is in the form below by using the command the below.
```
$ mongosh
$ mongo
> use open5gs
> db.subscribers.find().pretty()
{
@@ -159,7 +159,7 @@ $ mongosh
If you see below, you are using the old format DB schema.
```
$ mongosh
$ mongo
> use open5gs
> db.subscribers.find().pretty()
{
@@ -207,7 +207,7 @@ If you are using old format DB schema, please perform the following step.
1. First of all, it is recommended to use the following command to remove all existing subscription DB.
```
$ mongosh
$ mongo
> use open5gs
switched to db open5gs
> db.subscribers.drop()
@@ -221,7 +221,7 @@ $ curl -fsSL https://open5gs.org/open5gs/assets/webui/install | sudo -E bash -
4. Log in to the new WebUI and add new subscriber information using your web browser.
5. Make sure it is a new DB schema as below:
```
$ mongosh
$ mongo
> use open5gs
> db.subscribers.find().pretty()
{
@@ -256,7 +256,7 @@ This is a test program bug and has not yet been resolved.
To restart the test program, first remove all subscriber information using MongoDB Client
```
$ mongosh
$ mongo
> use open5gs
switched to db open5gs
> db.subscribers.find() ### Check the test subscriber
@@ -276,7 +276,6 @@ $ sudo pkill -9 open5gs-upfd
$ sudo pkill -9 open5gs-hssd
$ sudo pkill -9 open5gs-pcrfd
$ sudo pkill -9 open5gs-nrfd
$ sudo pkill -9 open5gs-scpd
$ sudo pkill -9 open5gs-ausfd
$ sudo pkill -9 open5gs-udmd
$ sudo pkill -9 open5gs-pcfd
@@ -313,7 +312,7 @@ $ diff --git a/configs/open5gs/amf.yaml.in b/configs/open5gs/amf.yaml.in
index 7e939e81..dfe4456d 100644
--- a/configs/open5gs/amf.yaml.in
+++ b/configs/open5gs/amf.yaml.in
@@ -315,6 +315,12 @@ amf:
@@ -199,6 +199,12 @@ amf:
mnc: 70
s_nssai:
- sst: 1
@@ -333,9 +332,9 @@ $ diff --git a/configs/open5gs/smf.yaml.in b/configs/open5gs/smf.yaml.in
index d45aa60f..701ee533 100644
--- a/configs/open5gs/smf.yaml.in
+++ b/configs/open5gs/smf.yaml.in
@@ -442,6 +442,11 @@ logger:
#
@@ -317,6 +317,11 @@ logger:
#
smf:
+ info:
+ - s_nssai:
@@ -352,7 +351,7 @@ $ diff --git a/configs/open5gs/smf.yaml.in b/configs/open5gs/smf.yaml.in
index d45aa60f..949da220 100644
--- a/configs/open5gs/smf.yaml.in
+++ b/configs/open5gs/smf.yaml.in
@@ -442,6 +442,12 @@ logger:
@@ -317,6 +317,12 @@ logger:
#
smf:
@@ -371,7 +370,7 @@ $ diff --git a/configs/open5gs/nssf.yaml.in b/configs/open5gs/nssf.yaml.in
index ecd4f7e2..04d9c4ba 100644
--- a/configs/open5gs/nssf.yaml.in
+++ b/configs/open5gs/nssf.yaml.in
@@ -201,6 +201,12 @@ nssf:
@@ -119,6 +119,11 @@ nssf:
port: 7777
s_nssai:
sst: 1
@@ -380,10 +379,9 @@ index ecd4f7e2..04d9c4ba 100644
+ s_nssai:
+ sst: 1
+ sd: 000080
+
#
# scp:
# nrf:
```
Then add a slice to MongoDB's subscriber info.
@@ -411,7 +409,6 @@ And the process below is only used in 5G, so there is no need to run it.
```bash
$ open5gs-nrfd
$ open5gs-scpd
$ open5gs-amfd
$ open5gs-ausfd
$ open5gs-udmd
@@ -506,9 +503,9 @@ Now, you need to modify the configuration file of Open5GS to adjust the UE IP Po
$ diff -u smf.yaml smf.yaml.new
--- smf.yaml 2020-09-17 09:31:16.547882093 -0400
+++ smf.yaml.new 2020-09-17 09:32:18.267726844 -0400
@@ -458,7 +458,7 @@ smf:
addr: 127.0.0.4
port: 9090
@@ -190,7 +190,7 @@
- addr: 127.0.0.4
- addr: ::1
subnet:
- - addr: 10.45.0.1/16
+ - addr: 10.46.0.1/16
@@ -521,7 +518,7 @@ $ diff -u smf.yaml smf.yaml.new
$ diff -u upf.yaml upf.yaml.new
--- upf.yaml 2020-09-17 09:31:16.547882093 -0400
+++ upf.yaml.new 2020-09-17 09:32:25.199619989 -0400
@@ -170,7 +170,7 @@ upf:
@@ -139,7 +139,7 @@
gtpu:
- addr: 127.0.0.7
subnet:
@@ -599,7 +596,7 @@ Please make sure that MongoDB server daemon is running.
Then, remove all subscriber information using MongoDB Client
```
$ mongosh
$ mongo
> use open5gs
switched to db open5gs
> db.subscribers.find() ### Check the test subscriber
@@ -619,7 +616,6 @@ $ sudo pkill -9 open5gs-upfd
$ sudo pkill -9 open5gs-hssd
$ sudo pkill -9 open5gs-pcrfd
$ sudo pkill -9 open5gs-nrfd
$ sudo pkill -9 open5gs-scpd
$ sudo pkill -9 open5gs-ausfd
$ sudo pkill -9 open5gs-udmd
$ sudo pkill -9 open5gs-pcfd
@@ -1002,7 +998,7 @@ attach_test : -Line 134: Condition is false, but expected true
Remove all subscriber information using MongoDB Client
```
$ mongosh
$ mongo
> db.subscribers.find() ### Check the test subscriber
> db.subscribers.drop() ### Remove all subscriber
> db.subscribers.find() ### Check that all subscribers are empty
@@ -1081,7 +1077,6 @@ Currently, the number of UE is limited to `128*128`.
* HSS : 127.0.0.8
* PCRF : 127.0.0.9
* NRF : 127.0.0.10
* SCP : 127.0.1.10
* AUSF : 127.0.0.11
* UDM : 127.0.0.12
* PCF : 127.0.0.13

View File

@@ -156,20 +156,9 @@ $ make test
#### 3. Open5GS
Install the MongoDB packages.
```bash
```
The Open5GS package is available on the recent versions of *Ubuntu*.
```bash
# Install the MongoDB Packages
$ wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
$ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
$ sudo apt update
$ sudo apt install mongodb-org
# Getting the authentication key
$ sudo apt install wget
$ wget https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_20.04/Release.key
@@ -184,7 +173,7 @@ $ sudo apt install open5gs
The following shows how to install the Web UI of Open5GS.
```bash
$ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
$ curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
$ sudo apt install nodejs
$ curl -fsSL https://open5gs.org/open5gs/assets/webui/install | sudo -E bash -
```
@@ -240,17 +229,16 @@ Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username
```diff
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
--- mme.yaml 2020-09-05 20:52:28.648235143 -0400
+++ mme.yaml.new 2020-09-05 20:56:05.434484208 -0400
@@ -253,20 +253,20 @@ mme:
--- mme.yaml.old 2020-08-22 12:07:32.755250028 -0400
+++ mme.yaml 2020-08-22 12:08:17.309320211 -0400
@@ -208,20 +208,20 @@
mme:
freeDiameter: /home/acetcom/Documents/git/open5gs/install/etc/freeDiameter/mme.conf
s1ap:
- - addr: 127.0.0.2
+ - addr: 10.10.0.2
- addr: 127.0.0.2
+ addr: 127.0.1.2
gtpc:
- addr: 127.0.0.2
metrics:
addr: 127.0.0.2
port: 9090
gummei:
plmn_id:
- mcc: 999
@@ -263,26 +251,28 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
plmn_id:
- mcc: 999
- mnc: 70
- tac: 1
+ mcc: 310
+ mnc: 789
tac: 1
+ tac: 2
security:
integrity_order : [ EIA2, EIA1, EIA0 ]
integrity_order : [ EIA1, EIA2, EIA0 ]
ciphering_order : [ EEA0, EEA1, EEA2 ]
```
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
```diff
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
--- sgwu.yaml 2020-09-05 20:50:39.393022566 -0400
+++ sgwu.yaml.new 2020-09-05 20:51:06.667838823 -0400
@@ -98,7 +98,7 @@ logger:
--- sgwu.yaml.old 2020-08-22 12:08:44.782880778 -0400
+++ sgwu.yaml 2020-08-22 12:06:49.809299514 -0400
@@ -82,7 +82,7 @@
#
sgwu:
pfcp:
- - addr: 10.11.0.6
+ - addr: 127.0.0.6
gtpu:
- addr: 127.0.0.6
- addr: 10.11.0.6
+ addr: 127.0.0.6
pfcp:
addr: 127.0.0.6
```

View File

@@ -15,11 +15,6 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
- [Dockerized VoLTE Setup](tutorial/03-VoLTE-dockerized)
- [Metrics with Prometheus](tutorial/04-metrics-prometheus)
- Inside Source Code
- [Detailed Architecture of Open5GS](https://chowdera.com/2022/151/202205312246348316.html)
- [UPF Code Explanation](https://medium.com/@aditya.koranga/open5gs-upf-code-explanation-with-flow-c-79c50f253dd1)
- [SMF Code Explanation](https://medium.com/@aditya.koranga/open5gs-smf-code-explanation-with-flow-charts-a3b3cd38c991)
- Troubleshooting
- [Simple Issues](troubleshoot/01-simple-issues)
- [Now in Github Issues](troubleshoot/02-now-in-github-issues)

View File

@@ -52,7 +52,7 @@ true
$ git checkout v2.1.7
$ cd webui
$ rm -Rf ./node_modules
$ npm ci
$ npm ci --no-optional
$ npm run dev
## You should log out
@@ -60,7 +60,7 @@ $ npm run dev
$ git checkout main
$ cd webui
$ rm -Rf ./node_modules
$ npm ci
$ npm ci --no-optional
$ npm run dev
## You can log back in

View File

@@ -46,7 +46,7 @@ true
$ git checkout v2.1.7
$ cd webui
$ rm -Rf ./node_modules
$ npm ci
$ npm ci --no-optional
$ npm run dev
## You should log out
@@ -54,7 +54,7 @@ $ npm run dev
$ git checkout main
$ cd webui
$ rm -Rf ./node_modules
$ npm ci
$ npm ci --no-optional
$ npm run dev
## You can log back in

View File

@@ -42,7 +42,7 @@ true
$ git checkout v2.1.7
$ cd webui
$ rm -Rf ./node_modules
$ npm ci
$ npm ci --no-optional
$ npm run dev
## You should log out
@@ -50,7 +50,7 @@ $ npm run dev
$ git checkout main
$ cd webui
$ rm -Rf ./node_modules
$ npm ci
$ npm ci --no-optional
$ npm run dev
## You can log back in

View File

@@ -36,7 +36,7 @@ true
$ git checkout v2.1.7
$ cd webui
$ rm -Rf ./node_modules
$ npm ci
$ npm ci --no-optional
$ npm run dev
## You should log out
@@ -44,7 +44,7 @@ $ npm run dev
$ git checkout main
$ cd webui
$ rm -Rf ./node_modules
$ npm ci
$ npm ci --no-optional
$ npm run dev
## You can log back in

View File

@@ -1,99 +0,0 @@
---
title: "v2.5.6 - SCP for Indirect Communication"
date: 2022-11-18 22:59:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
---
#### New Feature
SCP(Service Communication Proxy) is added to support Indirect Communication based on TS29.500. The default Open5GS configuration is provided as an indirect communication using SCP.
- [amf.yaml] If NFs are configured to use Delegated Discovery through the SCP, you do not need to set up NRF.
```
amf:
sbi:
- addr: 127.0.0.5
port: 7777
scp:
sbi:
- addr: 127.0.1.10
port: 7777
#nrf:
# sbi:
# - addr:
# - 127.0.0.10
# - ::1
# port: 7777
```
- [scp.yaml] NRF is needed for Delegated Discovery in SCP configuration.
```
scp:
sbi:
- addr: 127.0.1.10
port: 7777
#
# next_scp:
# sbi:
# addr: 127.0.1.11
# port: 7777
#
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
```
- [nrf.yaml] If there is an SCP in the NRF configuration, a notification(nnrf-nfm/nf-status-notify) is sent through an indirect communication.
```
nrf:
sbi:
addr:
- 127.0.0.10
- ::1
port: 7777
scp:
sbi:
- addr: 127.0.1.10
port: 7777
```
#### Enhancements
- [WebUI/DB] Fixed the WebUI to Support MongoDB 6.0 ([#1824](https://github.com/open5gs/open5gs/issues/1824)) -- [bmeglicit](https://github.com/bmeglicit)
- [NAS] Discard NAS message if integrity is failed ([#1848](https://github.com/open5gs/open5gs/pull/1848)) -- [jmasterfunk84](https://github.com/jmasterfunk84)
- [AMF] Support REREGISTRATION_REQUIRED in dereg notify ([#1858](https://github.com/open5gs/open5gs/pull/1858)) -- [mitmitmitm](https://github.com/mitmitmitm)
- [SMF] Support Security Indication IE for 5G-SA UP integrity and confidentiality([#1851](https://github.com/open5gs/open5gs/discussions/1851)) -- [irazairspan](https://github.com/irazairspan)
- [DBI] Disable Changes Streams with mongo Version ([#1833](https://github.com/open5gs/open5gs/pull/1833)) -- [jmasterfunk84](https://github.com/jmasterfunk84)
- [SBI] Added 3gpp-Sbi-Sender-Timestamp and 3gpp-Sbi-Max-Rsp-Time -- [7c8722d](https://github.com/open5gs/open5gs/commit/7c8722d9d4d2db13d889be1e5e37bc062f069396)
- [MME] Cancel Location while Idle ([#1797](https://github.com/open5gs/open5gs/pull/1797)) -- [jmasterfunk84](https://github.com/jmasterfunk84)
- [MME] Support for Insert Subscriber Data ([#1794](https://github.com/open5gs/open5gs/pull/1794)) -- [jmasterfunk84](https://github.com/jmasterfunk84)
#### Bug Fixes
- [AMD] Added implicit_unsubscribe field to SDMSubscription ([#1884](https://github.com/open5gs/open5gs/pull/1884)) -- [bmeglicit](https://github.com/bmeglicit)
- [SMF] Fixed PTI when PDU Session Reject -- [ddf09f2](https://github.com/open5gs/open5gs/commit/ddf09f270aaaaae67ac9ec1c157b4b28f1c90d10)
- [SBI] Do not send empty arrays in NRF/PCF ([#1876](https://github.com/open5gs/open5gs/pull/1876)) -- [bmeglicit](https://github.com/bmeglicit)
- [SGW-C] Fixed the bug of SGW-C session deletion ([#1825](https://github.com/open5gs/open5gs/pull/1825)) -- [dai9000](https://github.com/dai9000), [cmmacneill53](https://github.com/cmmacneill53)
- [AMF] Reject registration requests when pool for UE context is empty ([#1828](https://github.com/open5gs/open5gs/pull/1828)) -- [bmeglicit](https://github.com/bmeglicit)
- [AMF] Increase size of TMSI pool ([#1827](https://github.com/open5gs/open5gs/pull/1827)) -- [bmeglicit](https://github.com/bmeglicit)
- [AMF/UDM] Added support to subscribe to SDM changes ([#1820](https://github.com/open5gs/open5gs/pull/1820)) -- [bmeglicit](https://github.com/bmeglicit)
- [PFCP] Do not check qos_flow in PFCP Report message ([#1819](https://github.com/open5gs/open5gs/pull/1819)) -- [ssafaorhan](https://github.com/ssafaorhan)
- [PFCP] Fixed invalid message of Dropped DL Traffic threshold ([#1817](https://github.com/open5gs/open5gs/pull/1817)) -- [ssafaorhan](https://github.com/ssafaorhan)
Download -- [v2.5.6.tar.gz](https://github.com/open5gs/open5gs/archive/v2.5.6.tar.gz)
{: .notice--info}

View File

@@ -1,5 +1,5 @@
---
title: "v2.5.7 - Bug Fixes"
title: "v2.4.13 - Bug Fixes"
date: 2023-01-14 11:21:00 +0900
categories:
- Release
@@ -25,5 +25,5 @@ head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>
- [UPF] Packet buffer must be freed after sending replay message -- ([#1936](https://github.com/open5gs/open5gs/pull/1936)) -- [lester-001](https://github.com/lester-001)
- [AMF] Added safety code to prevent crash while getting amf_ue from sess -- ([#1913](https://github.com/open5gs/open5gs/pull/1913)) -- [lester-001](https://github.com/lester-001)
Download -- [v2.5.7.tar.gz](https://github.com/open5gs/open5gs/archive/v2.5.7.tar.gz)
Download -- [v2.4.13.tar.gz](https://github.com/open5gs/open5gs/archive/v2.4.13.tar.gz)
{: .notice--info}

View File

@@ -10,7 +10,7 @@
#
PACKAGE="open5gs"
VERSION="2.5.6"
VERSION="2.4.12"
print_status() {
echo
@@ -93,23 +93,18 @@ preinstall() {
PRE_INSTALL_PKGS=""
# Check that HTTPS transport is available to APT
# (Check snaked from: https://get.docker.io/ubuntu/)
if [ ! -e /usr/lib/apt/methods/https ]; then
PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} apt-transport-https"
fi
if [ ! -x /usr/bin/lsb_release ]; then
PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} lsb-release"
fi
if [ ! -x /usr/bin/node ] && [ ! -x /usr/bin/wget ]; then
PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} nodejs"
fi
if [ ! -x /usr/bin/curl ] && [ ! -x /usr/bin/wget ]; then
PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} curl"
fi
# Used by apt-key to add new keys
if [ ! -x /usr/bin/gpg ]; then
PRE_INSTALL_PKGS="${PRE_INSTALL_PKGS} gnupg"
fi
@@ -119,17 +114,9 @@ exec_cmd 'apt-get update'
if [ "X${PRE_INSTALL_PKGS}" != "X" ]; then
print_status "Installing packages required for setup:${PRE_INSTALL_PKGS}..."
# This next command needs to be redirected to /dev/null or the script will bork
# in some environments
exec_cmd "apt-get install -y${PRE_INSTALL_PKGS} > /dev/null 2>&1"
fi
IS_PRERELEASE=$(lsb_release -d | grep 'Ubuntu .*development' >& /dev/null; echo $?)
if [[ $IS_PRERELEASE -eq 0 ]]; then
print_status "Your distribution, identified as \"$(lsb_release -d -s)\", is a pre-release version of Ubuntu. NodeSource does not maintain official support for Ubuntu versions until they are formally released. You can try using the manual installation instructions available at https://github.com/nodesource/distributions and use the latest supported Ubuntu version name as the distribution identifier, although this is not guaranteed to work."
exit 1
fi
DISTRO=$(lsb_release -c -s)
check_alt() {
@@ -141,76 +128,54 @@ check_alt() {
fi
}
check_alt "Astra Linux" "orel" "Debian" "stretch"
check_alt "BOSS" "anokha" "Debian" "wheezy"
check_alt "BOSS" "anoop" "Debian" "jessie"
check_alt "BOSS" "drishti" "Debian" "stretch"
check_alt "BOSS" "unnati" "Debian" "buster"
check_alt "BOSS" "urja" "Debian" "bullseye"
check_alt "bunsenlabs" "bunsen-hydrogen" "Debian" "jessie"
check_alt "bunsenlabs" "helium" "Debian" "stretch"
check_alt "bunsenlabs" "lithium" "Debian" "buster"
check_alt "Devuan" "jessie" "Debian" "jessie"
check_alt "Devuan" "ascii" "Debian" "stretch"
check_alt "Devuan" "beowulf" "Debian" "buster"
check_alt "Devuan" "chimaera" "Debian" "bullseye"
check_alt "Devuan" "ceres" "Debian" "sid"
check_alt "Deepin" "panda" "Debian" "sid"
check_alt "Deepin" "unstable" "Debian" "sid"
check_alt "Deepin" "stable" "Debian" "buster"
check_alt "Deepin" "apricot" "Debian" "buster"
check_alt "elementaryOS" "luna" "Ubuntu" "precise"
check_alt "elementaryOS" "freya" "Ubuntu" "trusty"
check_alt "elementaryOS" "loki" "Ubuntu" "xenial"
check_alt "elementaryOS" "juno" "Ubuntu" "bionic"
check_alt "elementaryOS" "hera" "Ubuntu" "bionic"
check_alt "elementaryOS" "odin" "Ubuntu" "focal"
check_alt "elementaryOS" "jolnir" "Ubuntu" "focal"
check_alt "Kali" "sana" "Debian" "jessie"
check_alt "Kali" "kali-rolling" "Debian" "bullseye"
check_alt "Linux Mint" "maya" "Ubuntu" "precise"
check_alt "Linux Mint" "qiana" "Ubuntu" "trusty"
check_alt "Linux Mint" "rafaela" "Ubuntu" "trusty"
check_alt "Linux Mint" "rebecca" "Ubuntu" "trusty"
check_alt "Linux Mint" "rosa" "Ubuntu" "trusty"
check_alt "Linux Mint" "sarah" "Ubuntu" "xenial"
check_alt "Linux Mint" "serena" "Ubuntu" "xenial"
check_alt "Linux Mint" "sonya" "Ubuntu" "xenial"
check_alt "Linux Mint" "sylvia" "Ubuntu" "xenial"
check_alt "Linux Mint" "tara" "Ubuntu" "bionic"
check_alt "Linux Mint" "tessa" "Ubuntu" "bionic"
check_alt "Linux Mint" "tina" "Ubuntu" "bionic"
check_alt "Linux Mint" "tricia" "Ubuntu" "bionic"
check_alt "Linux Mint" "ulyana" "Ubuntu" "focal"
check_alt "Linux Mint" "ulyssa" "Ubuntu" "focal"
check_alt "Linux Mint" "uma" "Ubuntu" "focal"
check_alt "Linux Mint" "una" "Ubuntu" "focal"
check_alt "Linux Mint" "vanessa" "Ubuntu" "jammy"
check_alt "Liquid Lemur" "lemur-3" "Debian" "stretch"
check_alt "LMDE" "betsy" "Debian" "jessie"
check_alt "LMDE" "cindy" "Debian" "stretch"
check_alt "LMDE" "debbie" "Debian" "buster"
check_alt "LMDE" "elsie" "Debian" "bullseye"
check_alt "MX Linux 17" "Horizon" "Debian" "stretch"
check_alt "MX Linux 18" "Continuum" "Debian" "stretch"
check_alt "MX Linux 19" "patito feo" "Debian" "buster"
check_alt "MX Linux 21" "wildflower" "Debian" "bullseye"
check_alt "Pardus" "onyedi" "Debian" "stretch"
check_alt "Parrot" "ara" "Debian" "bullseye"
check_alt "PureOS" "green" "Debian" "sid"
check_alt "PureOS" "amber" "Debian" "buster"
check_alt "PureOS" "byzantium" "Debian" "bullseye"
check_alt "SolydXK" "solydxk-9" "Debian" "stretch"
check_alt "Sparky Linux" "Tyche" "Debian" "stretch"
check_alt "Sparky Linux" "Nibiru" "Debian" "buster"
check_alt "Sparky Linux" "Po-Tolo" "Debian" "bullseye"
check_alt "Tanglu" "chromodoris" "Debian" "jessie"
check_alt "Trisquel" "toutatis" "Ubuntu" "precise"
check_alt "Trisquel" "belenos" "Ubuntu" "trusty"
check_alt "Trisquel" "flidas" "Ubuntu" "xenial"
check_alt "Trisquel" "etiona" "Ubuntu" "bionic"
check_alt "Ubilinux" "dolcetto" "Debian" "stretch"
check_alt "Uruk GNU/Linux" "lugalbanda" "Ubuntu" "xenial"
check_alt "SolydXK" "solydxk-9" "Debian" "stretch"
check_alt "Kali" "sana" "Debian" "jessie"
check_alt "Kali" "kali-rolling" "Debian" "jessie"
check_alt "Sparky Linux" "Tyche" "Debian" "stretch"
check_alt "Sparky Linux" "Nibiru" "Debian" "buster"
check_alt "MX Linux 17" "Horizon" "Debian" "stretch"
check_alt "MX Linux 18" "Continuum" "Debian" "stretch"
check_alt "MX Linux 19" "patito feo" "Debian" "buster"
check_alt "Linux Mint" "maya" "Ubuntu" "precise"
check_alt "Linux Mint" "qiana" "Ubuntu" "trusty"
check_alt "Linux Mint" "rafaela" "Ubuntu" "trusty"
check_alt "Linux Mint" "rebecca" "Ubuntu" "trusty"
check_alt "Linux Mint" "rosa" "Ubuntu" "trusty"
check_alt "Linux Mint" "sarah" "Ubuntu" "xenial"
check_alt "Linux Mint" "serena" "Ubuntu" "xenial"
check_alt "Linux Mint" "sonya" "Ubuntu" "xenial"
check_alt "Linux Mint" "sylvia" "Ubuntu" "xenial"
check_alt "Linux Mint" "tara" "Ubuntu" "bionic"
check_alt "Linux Mint" "tessa" "Ubuntu" "bionic"
check_alt "Linux Mint" "tina" "Ubuntu" "bionic"
check_alt "Linux Mint" "tricia" "Ubuntu" "bionic"
check_alt "LMDE" "betsy" "Debian" "jessie"
check_alt "LMDE" "cindy" "Debian" "stretch"
check_alt "elementaryOS" "luna" "Ubuntu" "precise"
check_alt "elementaryOS" "freya" "Ubuntu" "trusty"
check_alt "elementaryOS" "loki" "Ubuntu" "xenial"
check_alt "elementaryOS" "juno" "Ubuntu" "bionic"
check_alt "elementaryOS" "hera" "Ubuntu" "bionic"
check_alt "Trisquel" "toutatis" "Ubuntu" "precise"
check_alt "Trisquel" "belenos" "Ubuntu" "trusty"
check_alt "Trisquel" "flidas" "Ubuntu" "xenial"
check_alt "Uruk GNU/Linux" "lugalbanda" "Ubuntu" "xenial"
check_alt "BOSS" "anokha" "Debian" "wheezy"
check_alt "BOSS" "anoop" "Debian" "jessie"
check_alt "BOSS" "drishti" "Debian" "stretch"
check_alt "bunsenlabs" "bunsen-hydrogen" "Debian" "jessie"
check_alt "bunsenlabs" "helium" "Debian" "stretch"
check_alt "Tanglu" "chromodoris" "Debian" "jessie"
check_alt "PureOS" "green" "Debian" "sid"
check_alt "Devuan" "jessie" "Debian" "jessie"
check_alt "Devuan" "ascii" "Debian" "stretch"
check_alt "Devuan" "beowulf" "Debian" "buster"
check_alt "Devuan" "ceres" "Debian" "sid"
check_alt "Deepin" "panda" "Debian" "sid"
check_alt "Deepin" "unstable" "Debian" "sid"
check_alt "Deepin" "stable" "Debian" "buster"
check_alt "Pardus" "onyedi" "Debian" "stretch"
check_alt "Liquid Lemur" "lemur-3" "Debian" "stretch"
if [ "X${DISTRO}" == "Xdebian" ]; then
print_status "Unknown Debian-based distribution, checking /etc/debian_version..."
@@ -223,25 +188,31 @@ if [ "X${DISTRO}" == "Xdebian" ]; then
fi
fi
print_status 'Removing Launchpad PPA Repository for MongoDB...'
for i in /etc/apt/sources.list.d/mongodb-org*; do
exec_cmd "rm -f $i"
done
if [ "X${DISTRO}" == "Xbuster" ]; then
if [ -f "/etc/apt/sources.list.d/mongodb-org.list" ]; then
print_status 'Removing Launchpad PPA Repository for MongoDB...'
exec_cmd "rm -f /etc/apt/sources.list.d/mongodb-org.list"
fi
print_status 'Adding the MongoDB signing key to your keyring...'
print_status 'Adding the MongoDB signing key to your keyring...'
if [ -x /usr/bin/curl ]; then
exec_cmd_nobail "curl -sLf 'https://www.mongodb.org/static/pgp/server-6.0.asc' | apt-key add -"
if [ -x /usr/bin/curl ]; then
exec_cmd 'curl -s https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add -'
else
exec_cmd 'wget -qO- https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add -'
fi
print_status "Creating apt sources list file for the MongoDB repo..."
exec_cmd "echo 'deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main' > /etc/apt/sources.list.d/mongodb-org.list"
if [ ! -x /usr/bin/mongod ]; then
MONGODB_INSTALL_PKGS="${MONGODB_INSTALL_PKGS} mongodb-org"
fi
else
exec_cmd_nobail "wget -qO - 'https://www.mongodb.org/static/pgp/server-6.0.asc' | apt-key add -"
fi
print_status "Creating apt sources list file for the MongoDB repo..."
exec_cmd "echo 'deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse' > /etc/apt/sources.list.d/mongodb-org-6.0.list"
if [ ! -x /usr/bin/mongod ]; then
MONGODB_INSTALL_PKGS="${MONGODB_INSTALL_PKGS} mongodb-org"
if [ ! -x /usr/bin/mongod ]; then
MONGODB_INSTALL_PKGS="${MONGODB_INSTALL_PKGS} mongodb"
fi
fi
if [ "X${MONGODB_INSTALL_PKGS}" != "X" ]; then
@@ -259,7 +230,7 @@ if [ -x /usr/bin/curl ]; then
exec_cmd "curl -sLf 'https://github.com/open5gs/${PACKAGE}/archive/v${VERSION}.tar.gz' | tar zxf -"
RC=$?
else
exec_cmd "wget -qO - 'https://github.com/open5gs/${PACKAGE}/archive/v${VERSION}.tar.gz' | tar zxf -"
exec_cmd "wget -qO- /dev/null 'https://github.com/open5gs/${PACKAGE}/archive/v${VERSION}.tar.gz' | tar zxf -"
RC=$?
fi
@@ -269,7 +240,7 @@ if [[ $RC != 0 ]]; then
fi
print_status "Build the Open5GS WebUI..."
exec_cmd "cd ./${PACKAGE}-${VERSION}/webui && npm clean-install && npm run build"
exec_cmd "cd ./${PACKAGE}-${VERSION}/webui && npm ci --no-optional && npm run build"
print_status "Install the Open5GS WebUI..."
exec_cmd "mv ./${PACKAGE}-${VERSION}/webui /usr/lib/node_modules/${PACKAGE}"
@@ -296,14 +267,23 @@ EOF"
exec_cmd_nobail "systemctl daemon-reload"
exec_cmd "systemctl enable open5gs-webui"
exec_cmd "deb-systemd-invoke start open5gs-webui"
exec_cmd "rm -rf ./${PACKAGE}-${VERSION}"
}
postinstall() {
print_status "Default Administrator Account [Username:admin, Password:1423]..."
exec_cmd "mongosh open5gs ./${PACKAGE}-${VERSION}/docs/assets/webui/mongo-init.js"
exec_cmd "rm -rf ./${PACKAGE}-${VERSION}"
exec_cmd "cat << EOF > ./account.js
db = db.getSiblingDB('open5gs')
cursor = db.accounts.find()
if ( cursor.count() == 0 ) {
db.accounts.insert({ salt: 'f5c15fa72622d62b6b790aa8569b9339729801ab8bda5d13997b5db6bfc1d997', hash: '402223057db5194899d2e082aeb0802f6794622e1cbc47529c419e5a603f2cc592074b4f3323b239ffa594c8b756d5c70a4e1f6ecd3f9f0d2d7328c4cf8b1b766514effff0350a90b89e21eac54cd4497a169c0c7554a0e2cd9b672e5414c323f76b8559bc768cba11cad2ea3ae704fb36abc8abc2619231ff84ded60063c6e1554a9777a4a464ef9cfdfa90ecfdacc9844e0e3b2f91b59d9ff024aec4ea1f51b703a31cda9afb1cc2c719a09cee4f9852ba3cf9f07159b1ccf8133924f74df770b1a391c19e8d67ffdcbbef4084a3277e93f55ac60d80338172b2a7b3f29cfe8a36738681794f7ccbe9bc98f8cdeded02f8a4cd0d4b54e1d6ba3d11792ee0ae8801213691848e9c5338e39485816bb0f734b775ac89f454ef90992003511aa8cceed58a3ac2c3814f14afaaed39cbaf4e2719d7213f81665564eec02f60ede838212555873ef742f6666cc66883dcb8281715d5c762fb236d72b770257e7e8d86c122bb69028a34cf1ed93bb973b440fa89a23604cd3fefe85fbd7f55c9b71acf6ad167228c79513f5cfe899a2e2cc498feb6d2d2f07354a17ba74cecfbda3e87d57b147e17dcc7f4c52b802a8e77f28d255a6712dcdc1519e6ac9ec593270bfcf4c395e2531a271a841b1adefb8516a07136b0de47c7fd534601b16f0f7a98f1dbd31795feb97da59e1d23c08461cf37d6f2877d0f2e437f07e25015960f63', username: 'admin', roles: [ 'admin' ], "__v" : 0})
}
EOF"
exec_cmd "mongo open5gs ./account.js"
exec_cmd "rm -f ./account.js"
}
## Defer setup until we have the complete script

View File

@@ -1,5 +0,0 @@
db = db.getSiblingDB('open5gs')
cursor = db.accounts.find()
if ( cursor.count() == 0 ) {
db.accounts.insertOne({ salt: 'f5c15fa72622d62b6b790aa8569b9339729801ab8bda5d13997b5db6bfc1d997', hash: '402223057db5194899d2e082aeb0802f6794622e1cbc47529c419e5a603f2cc592074b4f3323b239ffa594c8b756d5c70a4e1f6ecd3f9f0d2d7328c4cf8b1b766514effff0350a90b89e21eac54cd4497a169c0c7554a0e2cd9b672e5414c323f76b8559bc768cba11cad2ea3ae704fb36abc8abc2619231ff84ded60063c6e1554a9777a4a464ef9cfdfa90ecfdacc9844e0e3b2f91b59d9ff024aec4ea1f51b703a31cda9afb1cc2c719a09cee4f9852ba3cf9f07159b1ccf8133924f74df770b1a391c19e8d67ffdcbbef4084a3277e93f55ac60d80338172b2a7b3f29cfe8a36738681794f7ccbe9bc98f8cdeded02f8a4cd0d4b54e1d6ba3d11792ee0ae8801213691848e9c5338e39485816bb0f734b775ac89f454ef90992003511aa8cceed58a3ac2c3814f14afaaed39cbaf4e2719d7213f81665564eec02f60ede838212555873ef742f6666cc66883dcb8281715d5c762fb236d72b770257e7e8d86c122bb69028a34cf1ed93bb973b440fa89a23604cd3fefe85fbd7f55c9b71acf6ad167228c79513f5cfe899a2e2cc498feb6d2d2f07354a17ba74cecfbda3e87d57b147e17dcc7f4c52b802a8e77f28d255a6712dcdc1519e6ac9ec593270bfcf4c395e2531a271a841b1adefb8516a07136b0de47c7fd534601b16f0f7a98f1dbd31795feb97da59e1d23c08461cf37d6f2877d0f2e437f07e25015960f63', username: 'admin', roles: [ 'admin' ], "__v" : 0})
}

View File

@@ -352,12 +352,8 @@ int ogs_app_context_parse_config(void)
ogs_yaml_iter_bool(&parameter_iter);
} else if (!strcmp(parameter_key,
"use_mongodb_change_stream")) {
#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 9
self.use_mongodb_change_stream =
ogs_yaml_iter_bool(&parameter_iter);
#else
self.use_mongodb_change_stream = false;
#endif
} else
ogs_warn("unknown key `%s`", parameter_key);
}

View File

@@ -182,18 +182,15 @@ void ogs_dbi_final()
mongoc_collection_destroy(self.collection.subscriber);
}
#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 9
if (self.stream) {
mongoc_change_stream_destroy(self.stream);
}
#endif
ogs_mongoc_final();
}
int ogs_dbi_collection_watch_init(void)
{
#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 9
bson_t empty = BSON_INITIALIZER;
const bson_t *err_doc;
bson_error_t error;
@@ -216,14 +213,10 @@ int ogs_dbi_collection_watch_init(void)
}
return OGS_OK;
# else
return OGS_ERROR;
#endif
}
int ogs_dbi_poll_change_stream(void)
{
#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 9
int rv;
const bson_t *document;
@@ -247,7 +240,4 @@ int ogs_dbi_poll_change_stream(void)
}
return OGS_OK;
# else
return OGS_ERROR;
#endif
}

View File

@@ -37,9 +37,7 @@ typedef struct ogs_mongoc_s {
void *client;
void *database;
#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 9
mongoc_change_stream_t *stream;
#endif
char *masked_db_uri;

View File

@@ -31,7 +31,7 @@ int ogs_dbi_process_change_stream(const bson_t *document)
rv = ogs_queue_push(ogs_app()->queue, e);
if (rv != OGS_OK) {
ogs_error("ogs_queue_push() failed:%d", (int)rv);
bson_destroy(e->dbi.document);
bson_destroy((bson_t*)e->dbi.document);
ogs_event_free(e);
} else {
ogs_pollset_notify(ogs_app()->pollset);

View File

@@ -77,19 +77,6 @@ extern "C" {
#define OGS_DIAM_S6A_CT_UPDATE_PROCEDURE_IWF (3)
#define OGS_DIAM_S6A_CT_INITIAL_ATTACH_PROCEDURE (4)
#define OGS_DIAM_S6A_SUBDATA_NO_UPDATE (0)
#define OGS_DIAM_S6A_SUBDATA_SUB_STATUS (1)
#define OGS_DIAM_S6A_SUBDATA_MSISDN (1 << 1)
#define OGS_DIAM_S6A_SUBDATA_A_MSISDN (1 << 2)
#define OGS_DIAM_S6A_SUBDATA_NAM (1 << 3)
#define OGS_DIAM_S6A_SUBDATA_ODB (1 << 4)
#define OGS_DIAM_S6A_SUBDATA_ARD (1 << 5)
#define OGS_DIAM_S6A_SUBDATA_CC (1 << 6)
#define OGS_DIAM_S6A_SUBDATA_UEAMBR (1 << 7)
#define OGS_DIAM_S6A_SUBDATA_APN_CONFIG (1 << 8)
#define OGS_DIAM_S6A_SUBDATA_RAU_TAU_TIMER (1 << 9)
#define OGS_DIAM_S6A_SUBDATA_ALL 0xFFFFFFFF
extern struct dict_object *ogs_diam_s6a_application;
extern struct dict_object *ogs_diam_s6a_cmd_air;
@@ -179,7 +166,6 @@ typedef struct ogs_diam_s6a_clr_message_s {
#define OGS_DIAM_S6A_CLR_FLAGS_S6A_S6D_INDICATOR (1)
#define OGS_DIAM_S6A_CLR_FLAGS_REATTACH_REQUIRED (1 << 1)
uint32_t clr_flags;
uint32_t cancellation_type;
} ogs_diam_s6a_clr_message_t;
typedef struct ogs_diam_s6a_idr_message_s {
@@ -193,7 +179,6 @@ typedef struct ogs_diam_s6a_idr_message_s {
#define OGS_DIAM_S6A_IDR_FLAGS_RAT_TYPE (1 << 7)
#define OGS_DIAM_S6A_IDR_FLAGS_PCSCF_Restoration (1 << 8)
uint32_t idr_flags;
uint32_t subdatamask;
ogs_subscription_data_t subscription_data;
} ogs_diam_s6a_idr_message_t;

View File

@@ -96,16 +96,15 @@ typedef struct ogs_gtp_xact_s {
#define OGS_GTP_MODIFY_QOS_UPDATE ((uint64_t)1<<1)
uint64_t update_flags;
#define OGS_GTP_DELETE_NO_ACTION 1
#define OGS_GTP_DELETE_SEND_AUTHENTICATION_REQUEST 2
#define OGS_GTP_DELETE_SEND_DETACH_ACCEPT 3
#define OGS_GTP_DELETE_SEND_DEACTIVATE_BEARER_CONTEXT_REQUEST 4
#define OGS_GTP_DELETE_SEND_RELEASE_WITH_UE_CONTEXT_REMOVE 5
#define OGS_GTP_DELETE_SEND_RELEASE_WITH_S1_REMOVE_AND_UNLINK 6
#define OGS_GTP_DELETE_HANDLE_PDN_CONNECTIVITY_REQUEST 7
#define OGS_GTP_DELETE_UE_CONTEXT_REMOVE_PARTIAL 8
#define OGS_GTP_DELETE_IN_PATH_SWITCH_REQUEST 9
#define OGS_GTP_DELETE_NO_ACTION 1
#define OGS_GTP_DELETE_SEND_AUTHENTICATION_REQUEST 2
#define OGS_GTP_DELETE_SEND_DETACH_ACCEPT 3
#define OGS_GTP_DELETE_SEND_DEACTIVATE_BEARER_CONTEXT_REQUEST 4
#define OGS_GTP_DELETE_SEND_UE_CONTEXT_RELEASE_COMMAND 5
#define OGS_GTP_DELETE_SEND_S1_REMOVE_AND_UNLINK 6
#define OGS_GTP_DELETE_HANDLE_PDN_CONNECTIVITY_REQUEST 7
#define OGS_GTP_DELETE_UE_CONTEXT_REMOVE 8
#define OGS_GTP_DELETE_IN_PATH_SWITCH_REQUEST 9
int delete_action;
#define OGS_GTP_RELEASE_SEND_UE_CONTEXT_RELEASE_COMMAND 1

View File

@@ -1191,8 +1191,8 @@ typedef struct ogs_pfcp_dropped_dl_traffic_threshold_s {
union {
struct {
ED3(uint8_t spare:6;,
uint8_t dlby:1;,
uint8_t dlpa:1;)
uint8_t dlpa:1;,
uint8_t dlby:1;)
};
uint8_t flags;
};

View File

@@ -37,7 +37,7 @@ void *ogs_event_size(int id, size_t size)
ogs_event_t *ogs_event_new(int id)
{
return ogs_event_size(id, OGS_EVENT_SIZE);
return ogs_event_size(id, sizeof(ogs_event_t));
}
void ogs_event_free(void *e)

View File

@@ -50,6 +50,8 @@ typedef struct ogs_sbi_request_s ogs_sbi_request_t;
typedef struct ogs_sbi_response_s ogs_sbi_response_t;
typedef struct ogs_sbi_message_s ogs_sbi_message_t;
typedef struct _bson_t bson_t;
typedef struct ogs_event_s {
int id;
int timer_id;
@@ -64,12 +66,10 @@ typedef struct ogs_event_s {
} sbi;
struct {
void *document;
const bson_t *document;
} dbi;
} ogs_event_t;
#define OGS_EVENT_SIZE 256
void *ogs_event_size(int id, size_t size);
ogs_event_t *ogs_event_new(int id);
void ogs_event_free(void *e);

View File

@@ -652,10 +652,6 @@ typedef struct ogs_slice_data_s {
uint32_t context_identifier; /* EPC for checking default APN */
#define OGS_ALL_APN_CONFIGURATIONS_INCLUDED 0
#define OGS_MODIFIED_ADDED_APN_CONFIGURATIONS_INCLUDED 1
uint32_t all_apn_config_inc;
int num_of_session;
ogs_session_t session[OGS_MAX_NUM_OF_SESS];
} ogs_slice_data_t;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
@@ -47,7 +47,6 @@ typedef struct connection_s {
bool memory_overflow;
char *location;
char *producer_id;
ogs_timer_t *timer;
CURL *easy;
@@ -67,14 +66,8 @@ static size_t header_cb(void *ptr, size_t size, size_t nmemb, void *data);
static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp);
static int multi_timer_cb(CURLM *multi, long timeout_ms, void *cbp);
static void multi_timer_expired(void *data);
static connection_t *connection_add(
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
ogs_sbi_request_t *request, void *data);
static void connection_remove(connection_t *conn);
static void connection_free(connection_t *conn);
static void connection_remove_all(ogs_sbi_client_t *client);
static void connection_timer_expired(void *data);
static void connection_remove_all(ogs_sbi_client_t *client);
void ogs_sbi_client_init(int num_of_sockinfo_pool, int num_of_connection_pool)
{
@@ -287,6 +280,8 @@ static char *add_params_to_uri(CURL *easy, char *uri, ogs_hash_t *params)
return uri;
}
static void _connection_remove(connection_t *conn);
static connection_t *connection_add(
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
ogs_sbi_request_t *request, void *data)
@@ -312,7 +307,7 @@ static connection_t *connection_add(
conn->method = ogs_strdup(request->h.method);
if (!conn->method) {
ogs_error("conn->method is NULL");
connection_free(conn);
_connection_remove(conn);
return NULL;
}
@@ -321,7 +316,7 @@ static connection_t *connection_add(
conn->headers = ogs_calloc(conn->num_of_header, sizeof(char *));
if (!conn->headers) {
ogs_error("conn->headers is NULL");
connection_free(conn);
_connection_remove(conn);
return NULL;
}
for (hi = ogs_hash_first(request->http.headers), i = 0;
@@ -332,7 +327,7 @@ static connection_t *connection_add(
conn->headers[i] = ogs_msprintf("%s: %s", key, val);
if (!conn->headers[i]) {
ogs_error("conn->headers[i=%d] is NULL", i);
connection_free(conn);
_connection_remove(conn);
return NULL;
}
conn->header_list = curl_slist_append(
@@ -344,7 +339,7 @@ static connection_t *connection_add(
ogs_app()->timer_mgr, connection_timer_expired, conn);
if (!conn->timer) {
ogs_error("conn->timer is NULL");
connection_free(conn);
_connection_remove(conn);
return NULL;
}
@@ -356,7 +351,7 @@ static connection_t *connection_add(
conn->easy = curl_easy_init();
if (!conn->easy) {
ogs_error("conn->easy is NULL");
connection_free(conn);
_connection_remove(conn);
return NULL;
}
@@ -365,7 +360,7 @@ static connection_t *connection_add(
request->h.uri, request->http.params);
if (!uri) {
ogs_error("add_params_to_uri() failed");
connection_free(conn);
_connection_remove(conn);
return NULL;
}
@@ -387,7 +382,7 @@ static connection_t *connection_add(
request->http.content, request->http.content_length);
if (!conn->content) {
ogs_error("conn->content is NULL");
connection_free(conn);
_connection_remove(conn);
return NULL;
}
curl_easy_setopt(conn->easy,
@@ -431,23 +426,7 @@ static connection_t *connection_add(
return conn;
}
static void connection_remove(connection_t *conn)
{
ogs_sbi_client_t *client = NULL;
ogs_assert(conn);
client = conn->client;
ogs_assert(client);
ogs_list_remove(&client->connection_list, conn);
ogs_assert(client->multi);
curl_multi_remove_handle(client->multi, conn->easy);
connection_free(conn);
}
static void connection_free(connection_t *conn)
static void _connection_remove(connection_t *conn)
{
int i;
@@ -458,8 +437,6 @@ static void connection_free(connection_t *conn)
if (conn->location)
ogs_free(conn->location);
if (conn->producer_id)
ogs_free(conn->producer_id);
if (conn->memory)
ogs_free(conn->memory);
@@ -484,6 +461,22 @@ static void connection_free(connection_t *conn)
ogs_pool_free(&connection_pool, conn);
}
static void connection_remove(connection_t *conn)
{
ogs_sbi_client_t *client = NULL;
ogs_assert(conn);
client = conn->client;
ogs_assert(client);
ogs_list_remove(&client->connection_list, conn);
ogs_assert(client->multi);
curl_multi_remove_handle(client->multi, conn->easy);
_connection_remove(conn);
}
static void connection_remove_all(ogs_sbi_client_t *client)
{
connection_t *conn = NULL, *next_conn = NULL;
@@ -564,9 +557,6 @@ static void check_multi_info(ogs_sbi_client_t *client)
if (conn->location)
ogs_sbi_header_set(response->http.headers,
OGS_SBI_LOCATION, conn->location);
if (conn->producer_id)
ogs_sbi_header_set(response->http.headers,
OGS_SBI_CUSTOM_PRODUCER_ID, conn->producer_id);
if (conn->memory_overflow == true)
level = OGS_LOG_ERROR;
@@ -597,11 +587,8 @@ static void check_multi_info(ogs_sbi_client_t *client)
ogs_warn("[%d] %s", res, conn->error);
ogs_assert(conn->client_cb);
if (res == CURLE_OK)
conn->client_cb(OGS_OK, response, conn->data);
else
conn->client_cb(OGS_ERROR, NULL, conn->data);
conn->client_cb(res == CURLE_OK ? OGS_OK : OGS_ERROR,
response, conn->data);
connection_remove(conn);
break;
default:
@@ -611,7 +598,7 @@ static void check_multi_info(ogs_sbi_client_t *client)
}
}
bool ogs_sbi_client_send_request(
bool ogs_sbi_client_send_reqmem_persistent(
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
ogs_sbi_request_t *request, void *data)
{
@@ -619,10 +606,10 @@ bool ogs_sbi_client_send_request(
ogs_assert(client);
ogs_assert(request);
if (request->h.uri == NULL) {
request->h.uri = ogs_sbi_client_uri(client, &request->h);
ogs_assert(request->h.method);
ogs_assert(request->h.uri);
ogs_expect_or_return_val(request->h.uri, false);
}
ogs_debug("[%s] %s", request->h.method, request->h.uri);
@@ -632,14 +619,67 @@ bool ogs_sbi_client_send_request(
return true;
}
bool ogs_sbi_client_send_via_scp(
bool ogs_sbi_client_send_request(
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
ogs_sbi_request_t *request, void *data)
{
ogs_assert(request);
ogs_assert(client);
bool rc;
if (request->h.uri) {
ogs_assert(client);
ogs_assert(request);
rc = ogs_sbi_client_send_reqmem_persistent(
client, client_cb, request, data);
ogs_expect(rc == true);
ogs_sbi_request_free(request);
return rc;
}
bool ogs_sbi_scp_send_reqmem_persistent(
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
ogs_sbi_request_t *request, void *data)
{
ogs_sbi_nf_instance_t *scp_instance = NULL;
connection_t *conn = NULL;
char *apiroot = NULL;
ogs_assert(client);
ogs_assert(request);
scp_instance = ogs_sbi_self()->scp_instance;
if (scp_instance) {
/*
* In case of indirect communication using SCP,
* add 3gpp-Sbi-Target-apiRoot to HTTP header and
* change CLIENT instance to SCP.
*/
apiroot = ogs_sbi_client_apiroot(client);
ogs_assert(apiroot);
ogs_sbi_header_set(request->http.headers,
OGS_SBI_CUSTOM_TARGET_APIROOT, apiroot);
ogs_free(apiroot);
client = scp_instance->client;
ogs_assert(client);
}
if (request->h.uri == NULL) {
/*
* Regardless of direct or indirect communication,
* if there is no URI, we automatically creates a URI
* with Client Address and request->h
*/
request->h.uri = ogs_sbi_client_uri(client, &request->h);
ogs_assert(request->h.uri);
ogs_debug("[%s] %s", request->h.method, request->h.uri);
} else if (scp_instance) {
/*
* In case of indirect communication using SCP,
* If the full URI is already defined, change full URI to SCP as below.
@@ -647,7 +687,6 @@ bool ogs_sbi_client_send_via_scp(
* OLD: http://127.0.0.5:7777/nnrf-nfm/v1/nf-status-notify
* NEW: https://scp.open5gs.org/nnrf-nfm/v1/nf-status-notify
*/
char *apiroot = NULL;
char *path = NULL;
char *old = NULL;
@@ -660,21 +699,38 @@ bool ogs_sbi_client_send_via_scp(
ogs_assert(path);
request->h.uri = ogs_msprintf("%s/%s", apiroot, path);
ogs_assert(request->h.method);
ogs_assert(request->h.uri);
ogs_debug("[%s] %s", request->h.method, request->h.uri);
ogs_free(apiroot);
ogs_free(path);
ogs_free(old);
ogs_debug("[%s] %s", request->h.method, request->h.uri);
}
ogs_expect_or_return_val(true ==
ogs_sbi_client_send_request(client, client_cb, request, data), false);
conn = connection_add(client, client_cb, request, data);
ogs_expect_or_return_val(conn, false);
return true;
}
bool ogs_sbi_scp_send_request(
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
ogs_sbi_request_t *request, void *data)
{
bool rc;
ogs_assert(client);
ogs_assert(request);
rc = ogs_sbi_scp_send_reqmem_persistent(client, client_cb, request, data);
ogs_expect(rc == true);
ogs_sbi_request_free(request);
return rc;
}
static size_t write_cb(void *contents, size_t size, size_t nmemb, void *data)
{
size_t realsize = 0;
@@ -712,32 +768,16 @@ static size_t header_cb(void *ptr, size_t size, size_t nmemb, void *data)
ogs_assert(conn);
if (ogs_strncasecmp(ptr, OGS_SBI_LOCATION, strlen(OGS_SBI_LOCATION)) == 0) {
/* ptr : "Location: http://xxx/xxx/xxx\r\n"
We need to truncate "Location" + ": " + "\r\n" in 'ptr' string */
/* ptr : "Location: http://xxx/xxx/xxx\r\n"
We need to truncate "Location" + ": " + "\r\n" in 'ptr' string */
int len = strlen(ptr) - strlen(OGS_SBI_LOCATION) - 2 - 2;
if (len) {
/* Only copy http://xxx/xxx/xxx" from 'ptr' string */
conn->location = ogs_memdup(
(char *)ptr + strlen(OGS_SBI_LOCATION) + 2,
len+1);
(char *)ptr + strlen(OGS_SBI_LOCATION) + 2, len+1);
ogs_assert(conn->location);
conn->location[len] = 0;
}
} else if (ogs_strncasecmp(ptr,
OGS_SBI_CUSTOM_PRODUCER_ID,
strlen(OGS_SBI_CUSTOM_PRODUCER_ID)) == 0) {
/* ptr : "3gpp-Sbi-Producer-Id: 0cb58eca-4e84-41ed-aa10-9f892634b770\r\n"
We need to truncate "3gpp-Sbi-Producer-Id" + ": " + "\r\n"
in 'ptr' string */
int len = strlen(ptr) - strlen(OGS_SBI_CUSTOM_PRODUCER_ID) - 2 - 2;
if (len) {
/* Only copy 0cb58eca-4e84-41ed-aa10-9f892634b770from 'ptr' string */
conn->producer_id = ogs_memdup(
(char *)ptr + strlen(OGS_SBI_CUSTOM_PRODUCER_ID) + 2,
len+1);
ogs_assert(conn->producer_id);
conn->producer_id[len] = 0;
}
}
return (nmemb*size);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
@@ -62,6 +62,8 @@ typedef struct ogs_sbi_client_s {
const char *pem;
} tls;
ogs_sbi_client_cb_f cb; /* Only used when NF send to NRF */
ogs_timer_t *t_curl; /* timer for CURL */
ogs_list_t connection_list; /* CURL connection list */
@@ -84,10 +86,17 @@ ogs_sbi_client_t *ogs_sbi_client_find(ogs_sockaddr_t *addr);
void ogs_sbi_client_stop(ogs_sbi_client_t *client);
void ogs_sbi_client_stop_all(void);
bool ogs_sbi_client_send_reqmem_persistent(
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
ogs_sbi_request_t *request, void *data);
bool ogs_sbi_client_send_request(
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
ogs_sbi_request_t *request, void *data);
bool ogs_sbi_client_send_via_scp(
bool ogs_sbi_scp_send_reqmem_persistent(
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
ogs_sbi_request_t *request, void *data);
bool ogs_sbi_scp_send_request(
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
ogs_sbi_request_t *request, void *data);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
@@ -62,24 +62,15 @@ void ogs_sbi_context_init(void)
ogs_pool_init(&nf_info_pool, ogs_app()->pool.nf * OGS_MAX_NUM_OF_NF_INFO);
/* Add AELF NF-Instance */
/* Add SELF NF instance */
self.nf_instance = ogs_sbi_nf_instance_add();
ogs_assert(self.nf_instance);
ogs_uuid_get(&self.uuid);
ogs_uuid_format(nf_instance_id, &self.uuid);
ogs_sbi_nf_instance_set_id(self.nf_instance, nf_instance_id);
/* Add NRF NF-Instance */
self.nrf_instance = ogs_sbi_nf_instance_add();
ogs_assert(self.nrf_instance);
ogs_sbi_nf_instance_set_type(self.nrf_instance, OpenAPI_nf_type_NRF);
/* Add SCP NF-Instance */
self.scp_instance = ogs_sbi_nf_instance_add();
ogs_assert(self.scp_instance);
ogs_sbi_nf_instance_set_type(self.scp_instance, OpenAPI_nf_type_SCP);
context_initialized = 1;
}
@@ -139,31 +130,24 @@ static int ogs_sbi_context_validation(
ogs_assert(context_initialized == 1);
switch (self.discovery_config.delegated) {
case OGS_SBI_DISCOVERY_DELEGATED_AUTO:
if (strcmp(local, "nrf") == 0) {
/* Skip NRF */
} else if (strcmp(local, "scp") == 0) {
/* Skip SCP */
} else if (strcmp(local, "smf") == 0) {
/* Skip SMF since SMF can run 4G */
} else {
if (NF_INSTANCE_CLIENT(self.nrf_instance) ||
NF_INSTANCE_CLIENT(self.scp_instance)) {
} else {
ogs_error("DELEGATED_AUTO - Both NRF and %s are unavailable",
strcmp(scp, "next_scp") == 0 ? "Next-hop SCP" : "SCP");
return OGS_ERROR;
}
if (strcmp(local, "nrf") != 0 && /* Skip NRF */
strcmp(local, "smf") != 0 && /* Skip SMF since SMF can run 4G */
ogs_sbi_self()->nrf_instance == NULL &&
ogs_sbi_self()->scp_instance == NULL) {
ogs_error("DELEGATED_AUTO - Both NRF and %s are unavailable",
strcmp(scp, "next_scp") == 0 ? "Next-hop SCP" : "SCP");
return OGS_ERROR;
}
break;
case OGS_SBI_DISCOVERY_DELEGATED_YES:
if (NF_INSTANCE_CLIENT(self.scp_instance) == NULL) {
if (ogs_sbi_self()->scp_instance == NULL) {
ogs_error("DELEGATED_YES - no %s available",
strcmp(scp, "next_scp") == 0 ? "Next-hop SCP" : "SCP");
return OGS_ERROR;
}
break;
case OGS_SBI_DISCOVERY_DELEGATED_NO:
if (NF_INSTANCE_CLIENT(self.nrf_instance) == NULL) {
if (ogs_sbi_self()->nrf_instance == NULL) {
ogs_error("DELEGATED_NO - no NRF available");
return OGS_ERROR;
}
@@ -177,6 +161,11 @@ static int ogs_sbi_context_validation(
return OGS_OK;
}
ogs_sbi_nf_instance_t *ogs_sbi_scp_instance(void)
{
return NULL;
}
int ogs_sbi_context_parse_config(
const char *local, const char *nrf, const char *scp)
{
@@ -496,6 +485,7 @@ int ogs_sbi_context_parse_config(
ogs_yaml_iter_t sbi_array, sbi_iter;
ogs_yaml_iter_recurse(&nrf_iter, &sbi_array);
do {
ogs_sbi_nf_instance_t *nrf_instance = NULL;
ogs_sbi_client_t *client = NULL;
ogs_sockaddr_t *addr = NULL;
int family = AF_UNSPEC;
@@ -597,7 +587,14 @@ int ogs_sbi_context_parse_config(
client = ogs_sbi_client_add(addr);
ogs_assert(client);
OGS_SBI_SETUP_CLIENT(self.nrf_instance, client);
ogs_sbi_self()->nrf_instance =
nrf_instance = ogs_sbi_nf_instance_add();
ogs_assert(nrf_instance);
ogs_sbi_nf_instance_set_type(
nrf_instance, OpenAPI_nf_type_NRF);
OGS_SBI_SETUP_CLIENT(nrf_instance, client);
if (key) client->tls.key = key;
if (pem) client->tls.pem = pem;
@@ -608,8 +605,7 @@ int ogs_sbi_context_parse_config(
YAML_SEQUENCE_NODE);
}
}
} else if (ogs_app()->parameter.no_scp == false &&
scp && !strcmp(root_key, scp)) {
} else if (scp && !strcmp(root_key, scp)) {
ogs_yaml_iter_t scp_iter;
ogs_yaml_iter_recurse(&root_iter, &scp_iter);
while (ogs_yaml_iter_next(&scp_iter)) {
@@ -619,6 +615,7 @@ int ogs_sbi_context_parse_config(
ogs_yaml_iter_t sbi_array, sbi_iter;
ogs_yaml_iter_recurse(&scp_iter, &sbi_array);
do {
ogs_sbi_nf_instance_t *scp_instance = NULL;
ogs_sbi_client_t *client = NULL;
ogs_sockaddr_t *addr = NULL;
int family = AF_UNSPEC;
@@ -720,7 +717,14 @@ int ogs_sbi_context_parse_config(
client = ogs_sbi_client_add(addr);
ogs_assert(client);
OGS_SBI_SETUP_CLIENT(self.scp_instance, client);
ogs_sbi_self()->scp_instance =
scp_instance = ogs_sbi_nf_instance_add();
ogs_assert(scp_instance);
ogs_sbi_nf_instance_set_type(
scp_instance, OpenAPI_nf_type_SCP);
OGS_SBI_SETUP_CLIENT(scp_instance, client);
if (key) client->tls.key = key;
if (pem) client->tls.pem = pem;
@@ -925,18 +929,15 @@ ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find(char *id)
ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find_by_discovery_param(
OpenAPI_nf_type_e target_nf_type,
OpenAPI_nf_type_e requester_nf_type,
ogs_sbi_discovery_option_t *discovery_option)
{
ogs_sbi_nf_instance_t *nf_instance = NULL;
ogs_assert(target_nf_type);
ogs_assert(requester_nf_type);
ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) {
if (ogs_sbi_discovery_param_is_matched(
nf_instance, target_nf_type, requester_nf_type,
discovery_option) == false)
nf_instance, target_nf_type, discovery_option) == false)
continue;
return nf_instance;
@@ -946,8 +947,7 @@ ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find_by_discovery_param(
}
ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find_by_service_type(
ogs_sbi_service_type_e service_type,
OpenAPI_nf_type_e requester_nf_type)
ogs_sbi_service_type_e service_type)
{
ogs_sbi_nf_instance_t *nf_instance = NULL;
ogs_sbi_discovery_option_t *discovery_option = NULL;
@@ -955,7 +955,6 @@ ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find_by_service_type(
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
char *service_name = NULL;
ogs_assert(requester_nf_type);
ogs_assert(service_type);
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
ogs_assert(target_nf_type);
@@ -967,7 +966,7 @@ ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find_by_service_type(
ogs_sbi_discovery_option_add_service_names(discovery_option, service_name);
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
target_nf_type, requester_nf_type, discovery_option);
target_nf_type, discovery_option);
ogs_sbi_discovery_option_free(discovery_option);
@@ -1544,11 +1543,14 @@ bool ogs_sbi_discovery_option_is_matched(
bool ogs_sbi_discovery_param_is_matched(
ogs_sbi_nf_instance_t *nf_instance,
OpenAPI_nf_type_e target_nf_type,
OpenAPI_nf_type_e requester_nf_type,
ogs_sbi_discovery_option_t *discovery_option)
{
OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
ogs_assert(nf_instance);
ogs_assert(target_nf_type);
ogs_assert(ogs_sbi_self()->nf_instance);
requester_nf_type = ogs_sbi_self()->nf_instance->nf_type;
ogs_assert(requester_nf_type);
if (!OGS_FSM_CHECK(&nf_instance->sm, ogs_sbi_nf_state_registered))
@@ -1605,24 +1607,7 @@ ogs_sbi_client_t *ogs_sbi_client_find_by_service_name(
}
}
return nf_instance->client;
}
ogs_sbi_client_t *ogs_sbi_client_find_by_service_type(
ogs_sbi_nf_instance_t *nf_instance,
ogs_sbi_service_type_e service_type)
{
ogs_sbi_nf_service_t *nf_service = NULL;
ogs_assert(nf_instance);
ogs_assert(service_type);
ogs_list_for_each(&nf_instance->nf_service_list, nf_service) {
ogs_assert(nf_service->name);
if (ogs_sbi_service_type_from_name(nf_service->name) == service_type)
return nf_service->client;
}
ogs_error("[Fallback] Cannot find NF service[%s:%s]", name, version);
return nf_instance->client;
}
@@ -1665,15 +1650,8 @@ ogs_sbi_xact_t *ogs_sbi_xact_add(
xact->sbi_object = sbi_object;
xact->service_type = service_type;
xact->requester_nf_type = NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance);
ogs_assert(xact->requester_nf_type);
/*
* Insert one service-name in the discovery option in the function below.
*
* - ogs_sbi_xact_add()
* - ogs_sbi_send_notification_request()
*/
/* Always insert one service-name in the discovery option */
if (!discovery_option) {
discovery_option = ogs_sbi_discovery_option_new();
ogs_assert(discovery_option);
@@ -1690,11 +1668,7 @@ ogs_sbi_xact_t *ogs_sbi_xact_add(
ogs_app()->timer_mgr, ogs_timer_sbi_client_wait_expire, xact);
if (!xact->t_response) {
ogs_error("ogs_timer_add() failed");
if (xact->discovery_option)
ogs_sbi_discovery_option_free(xact->discovery_option);
ogs_pool_free(&xact_pool, xact);
return NULL;
}
@@ -1705,13 +1679,8 @@ ogs_sbi_xact_t *ogs_sbi_xact_add(
xact->request = (*build)(context, data);
if (!xact->request) {
ogs_error("SBI build failed");
if (xact->discovery_option)
ogs_sbi_discovery_option_free(xact->discovery_option);
ogs_timer_delete(xact->t_response);
ogs_pool_free(&xact_pool, xact);
return NULL;
}
if (!xact->request->h.uri) {

View File

@@ -85,20 +85,18 @@ typedef struct ogs_sbi_nf_instance_s {
ogs_timer_t *t_no_heartbeat; /* check heartbeat */
ogs_timer_t *t_validity; /* check validation */
#define NF_INSTANCE_ID(__nFInstance) \
((__nFInstance) ? ((__nFInstance)->id) : NULL)
#define NF_INSTANCE_ID_IS_SELF(_iD) \
(_iD) && ogs_sbi_self()->nf_instance && \
strcmp((_iD), ogs_sbi_self()->nf_instance->id) == 0
#define NF_INSTANCE_ID_IS_OTHERS(_iD) \
(_iD) && ogs_sbi_self()->nf_instance && \
strcmp((_iD), ogs_sbi_self()->nf_instance->id) != 0
char *id;
#define NF_INSTANCE_TYPE(__nFInstance) \
((__nFInstance) ? ((__nFInstance)->nf_type) : OpenAPI_nf_type_NULL)
#define NF_INSTANCE_TYPE_IS_NRF(__nFInstance) \
(NF_INSTANCE_TYPE(__nFInstance) == OpenAPI_nf_type_NRF)
((__nFInstance->nf_type) == OpenAPI_nf_type_NRF)
char *id; /* NFInstanceId */
OpenAPI_nf_type_e nf_type;
OpenAPI_nf_status_e nf_status;
@@ -124,8 +122,6 @@ typedef struct ogs_sbi_nf_instance_s {
ogs_list_t nf_service_list;
ogs_list_t nf_info_list;
#define NF_INSTANCE_CLIENT(__nFInstance) \
((__nFInstance) ? ((__nFInstance)->client) : NULL)
void *client; /* only used in CLIENT */
unsigned int reference_count; /* reference count for memory free */
} ogs_sbi_nf_instance_t;
@@ -160,7 +156,6 @@ typedef struct ogs_sbi_xact_s {
ogs_lnode_t lnode;
ogs_sbi_service_type_e service_type;
OpenAPI_nf_type_e requester_nf_type;
ogs_sbi_discovery_option_t *discovery_option;
ogs_sbi_request_t *request;
@@ -313,6 +308,8 @@ int ogs_sbi_context_parse_config(
bool ogs_sbi_nf_service_is_available(const char *name);
ogs_sbi_nf_instance_t *ogs_sbi_scp_instance(void);
ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_add(void);
void ogs_sbi_nf_instance_set_id(ogs_sbi_nf_instance_t *nf_instance, char *id);
void ogs_sbi_nf_instance_set_type(
@@ -329,11 +326,9 @@ void ogs_sbi_nf_instance_remove_all(void);
ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find(char *id);
ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find_by_discovery_param(
OpenAPI_nf_type_e nf_type,
OpenAPI_nf_type_e requester_nf_type,
ogs_sbi_discovery_option_t *discovery_option);
ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find_by_service_type(
ogs_sbi_service_type_e service_type,
OpenAPI_nf_type_e requester_nf_type);
ogs_sbi_service_type_e service_type);
bool ogs_sbi_nf_instance_maximum_number_is_reached(void);
ogs_sbi_nf_service_t *ogs_sbi_nf_service_add(
@@ -368,9 +363,6 @@ ogs_sbi_nf_service_t *ogs_sbi_nf_service_build_default(
ogs_sbi_client_t *ogs_sbi_client_find_by_service_name(
ogs_sbi_nf_instance_t *nf_instance, char *name, char *version);
ogs_sbi_client_t *ogs_sbi_client_find_by_service_type(
ogs_sbi_nf_instance_t *nf_instance,
ogs_sbi_service_type_e service_type);
void ogs_sbi_client_associate(ogs_sbi_nf_instance_t *nf_instance);
@@ -392,7 +384,6 @@ OpenAPI_uri_scheme_e ogs_sbi_default_uri_scheme(void);
bool ogs_sbi_discovery_param_is_matched(
ogs_sbi_nf_instance_t *nf_instance,
OpenAPI_nf_type_e target_nf_type,
OpenAPI_nf_type_e requester_nf_type,
ogs_sbi_discovery_option_t *discovery_option);
bool ogs_sbi_discovery_option_is_matched(

View File

@@ -451,72 +451,6 @@ bool ogs_sbi_time_from_string(ogs_time_t *timestamp, char *str)
return true;
}
int ogs_sbi_rfc7231_string(char *date_str, ogs_time_t time)
{
const char ogs_month_snames[12][4] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
"Aug", "Sep", "Oct", "Nov", "Dec"
};
const char ogs_day_snames[7][4] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
struct tm gmt;
const char *s;
int real_year;
ogs_time_t sec = ogs_time_sec(time);
ogs_time_t msec = ogs_time_msec(time);
ogs_assert(date_str);
ogs_gmtime(sec, &gmt);
/* example: "Sun, 04 Aug 2019 08:49:37.845 GMT" */
/* 123456789012345678901234567890123 */
s = &ogs_day_snames[gmt.tm_wday][0];
*date_str++ = *s++;
*date_str++ = *s++;
*date_str++ = *s++;
*date_str++ = ',';
*date_str++ = ' ';
*date_str++ = gmt.tm_mday / 10 + '0';
*date_str++ = gmt.tm_mday % 10 + '0';
*date_str++ = ' ';
s = &ogs_month_snames[gmt.tm_mon][0];
*date_str++ = *s++;
*date_str++ = *s++;
*date_str++ = *s++;
*date_str++ = ' ';
real_year = 1900 + gmt.tm_year;
/* This routine isn't y10k ready. */
*date_str++ = real_year / 1000 + '0';
*date_str++ = real_year % 1000 / 100 + '0';
*date_str++ = real_year % 100 / 10 + '0';
*date_str++ = real_year % 10 + '0';
*date_str++ = ' ';
*date_str++ = gmt.tm_hour / 10 + '0';
*date_str++ = gmt.tm_hour % 10 + '0';
*date_str++ = ':';
*date_str++ = gmt.tm_min / 10 + '0';
*date_str++ = gmt.tm_min % 10 + '0';
*date_str++ = ':';
*date_str++ = gmt.tm_sec / 10 + '0';
*date_str++ = gmt.tm_sec % 10 + '0';
*date_str++ = '.';
*date_str++ = msec / 100 + '0';
*date_str++ = msec % 100 / 10 + '0';
*date_str++ = msec % 10 + '0';
*date_str++ = ' ';
*date_str++ = 'G';
*date_str++ = 'M';
*date_str++ = 'T';
*date_str++ = 0;
return OGS_OK;
}
char *ogs_sbi_s_nssai_to_string(ogs_s_nssai_t *s_nssai)
{
cJSON *item = NULL;

View File

@@ -56,9 +56,6 @@ char *ogs_sbi_gmtime_string(ogs_time_t time);
char *ogs_sbi_timezone_string(int tm_gmtoff);
bool ogs_sbi_time_from_string(ogs_time_t *time, char *str);
#define OGS_SBI_RFC7231_DATE_LEN (34)
int ogs_sbi_rfc7231_string(char *date_str, ogs_time_t time);
char *ogs_sbi_s_nssai_to_string(ogs_s_nssai_t *s_nssai);
bool ogs_sbi_s_nssai_from_string(ogs_s_nssai_t *s_nssai, char *str);

View File

@@ -41,7 +41,6 @@ libsbi_sources = files('''
nnrf-build.c
nnrf-handler.c
nnrf-path.c
path.c
nf-sm.c

View File

@@ -179,10 +179,6 @@ void ogs_sbi_message_free(ogs_sbi_message_t *message)
OpenAPI_termination_notification_free(message->TerminationNotification);
if (message->DeregistrationData)
OpenAPI_deregistration_data_free(message->DeregistrationData);
if (message->SDMSubscription)
OpenAPI_sdm_subscription_free(message->SDMSubscription);
if (message->ModificationNotification)
OpenAPI_modification_notification_free(message->ModificationNotification);
/* HTTP Part */
for (i = 0; i < message->num_of_part; i++) {
@@ -253,9 +249,6 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message)
{
int i;
ogs_sbi_request_t *request = NULL;
OpenAPI_nf_type_e nf_type = OpenAPI_nf_type_NULL;
char sender_timestamp[OGS_SBI_RFC7231_DATE_LEN];
char *max_rsp_time = NULL;
ogs_assert(message);
@@ -314,17 +307,21 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message)
discovery_option->num_of_service_names) {
/* send array items separated by a comma */
char *v = ogs_sbi_discovery_option_build_service_names(
discovery_option);
if (v) {
ogs_sbi_header_set(request->http.params,
OGS_SBI_PARAM_SERVICE_NAMES, v);
ogs_free(v);
} else {
ogs_warn("invalid service names failed[%d:%s]",
discovery_option->num_of_service_names,
discovery_option->service_names[0]);
char *v = NULL;
v = ogs_strdup(discovery_option->service_names[0]);
ogs_expect_or_return_val(v, NULL);
if (discovery_option->num_of_service_names > 1)
{
int i;
for (i = 1; i < discovery_option->num_of_service_names; i++)
v = ogs_mstrcatf(v, ",%s", discovery_option->service_names[i]);
}
ogs_sbi_header_set(
request->http.params, OGS_SBI_PARAM_SERVICE_NAMES, v);
ogs_free(v);
}
}
@@ -446,38 +443,10 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message)
END
}
nf_type = NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance);
if (nf_type) {
char *user_agent = OpenAPI_nf_type_ToString(nf_type);
if (user_agent)
ogs_sbi_header_set(request->http.headers,
OGS_SBI_USER_AGENT, user_agent);
}
ogs_assert(OGS_OK ==
ogs_sbi_rfc7231_string(sender_timestamp, ogs_time_now()));
ogs_sbi_header_set(request->http.headers,
OGS_SBI_OPTIONAL_CUSTOM_SENDER_TIMESTAMP, sender_timestamp);
ogs_assert(ogs_time_to_msec(ogs_app()->time.message.duration));
max_rsp_time = ogs_msprintf("%d",
(int)ogs_time_to_msec(ogs_app()->time.message.duration));
ogs_sbi_header_set(request->http.headers,
OGS_SBI_OPTIONAL_CUSTOM_MAX_RSP_TIME, max_rsp_time);
ogs_free(max_rsp_time);
if (message->http.content_encoding)
ogs_sbi_header_set(request->http.headers,
OGS_SBI_ACCEPT_ENCODING, message->http.content_encoding);
if (message->http.custom.callback)
ogs_sbi_header_set(request->http.headers,
OGS_SBI_CUSTOM_CALLBACK, message->http.custom.callback);
if (message->http.custom.nrf_uri)
ogs_sbi_header_set(request->http.headers,
OGS_SBI_CUSTOM_NRF_URI, message->http.custom.nrf_uri);
return request;
}
@@ -545,33 +514,37 @@ int ogs_sbi_parse_request(
/* Discovery Option Parameter */
} else if (!strcmp(ogs_hash_this_key(hi),
OGS_SBI_PARAM_TARGET_NF_INSTANCE_ID)) {
char *v = NULL;
v = ogs_hash_this_val(hi);
if (v) {
ogs_sbi_discovery_option_set_target_nf_instance_id(
discovery_option, v);
discovery_option_presence = true;
}
discovery_option_presence = true;
ogs_sbi_discovery_option_set_target_nf_instance_id(
discovery_option, ogs_hash_this_val(hi));
} else if (!strcmp(ogs_hash_this_key(hi),
OGS_SBI_PARAM_REQUESTER_NF_INSTANCE_ID)) {
char *v = NULL;
v = ogs_hash_this_val(hi);
if (v) {
ogs_sbi_discovery_option_set_requester_nf_instance_id(
discovery_option, v);
discovery_option_presence = true;
}
discovery_option_presence = true;
ogs_sbi_discovery_option_set_requester_nf_instance_id(
discovery_option, ogs_hash_this_val(hi));
} else if (!strcmp(ogs_hash_this_key(hi),
OGS_SBI_PARAM_SERVICE_NAMES)) {
char *v = NULL;
char *service_names;
char *token;
char *saveptr;
v = ogs_hash_this_val(hi);
if (v) {
ogs_sbi_discovery_option_parse_service_names(
discovery_option, v);
discovery_option_presence = true;
service_names = ogs_strdup(v);
ogs_assert(service_names);
token = ogs_strtok_r(service_names, ",", &saveptr);
while (token != NULL)
{
discovery_option_presence = true;
ogs_sbi_discovery_option_add_service_names(
discovery_option, token);
token = ogs_strtok_r(NULL, ",", &saveptr);
}
ogs_free(service_names);
}
/* URL Query Parameter */
@@ -680,26 +653,11 @@ int ogs_sbi_parse_request(
message->http.content_type = ogs_hash_this_val(hi);
} else if (!ogs_strcasecmp(ogs_hash_this_key(hi), OGS_SBI_ACCEPT)) {
message->http.accept = ogs_hash_this_val(hi);
} else if (!ogs_strcasecmp(ogs_hash_this_key(hi), OGS_SBI_USER_AGENT)) {
char *v = ogs_hash_this_val(hi);
if (v)
message->http.requester_nf_type =
OpenAPI_nf_type_FromString(v);
} else if (!ogs_strcasecmp(ogs_hash_this_key(hi),
OGS_SBI_CUSTOM_CALLBACK)) {
message->http.custom.callback = ogs_hash_this_val(hi);
}
}
if (!message->http.requester_nf_type) {
ogs_error("No User-Agent in HTTP2 Header");
ogs_sbi_message_free(message);
return OGS_ERROR;
}
if (parse_content(message, &request->http) != OGS_OK) {
ogs_error("parse_content() failed");
ogs_sbi_message_free(message);
return OGS_ERROR;
}
@@ -1050,15 +1008,6 @@ static char *build_json(ogs_sbi_message_t *message)
item = OpenAPI_deregistration_data_convertToJSON(
message->DeregistrationData);
ogs_assert(item);
} else if (message->SDMSubscription) {
item = OpenAPI_sdm_subscription_convertToJSON(
message->SDMSubscription);
ogs_assert(item);
}
else if (message->ModificationNotification) {
item = OpenAPI_modification_notification_convertToJSON(
message->ModificationNotification);
ogs_assert(item);
}
if (item) {
@@ -1363,15 +1312,6 @@ static int parse_json(ogs_sbi_message_t *message,
}
break;
CASE(OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS)
message->SDMSubscription =
OpenAPI_sdm_subscription_parseFromJSON(item);
if (!message->SDMSubscription) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
@@ -1915,15 +1855,6 @@ static int parse_json(ogs_sbi_message_t *message,
}
break;
CASE(OGS_SBI_RESOURCE_NAME_SDMSUBSCRIPTION_NOTIFY)
message->ModificationNotification =
OpenAPI_modification_notification_parseFromJSON(item);
if (!message->ModificationNotification) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",
@@ -2416,46 +2347,3 @@ void ogs_sbi_discovery_option_add_service_names(
[discovery_option->num_of_service_names]);
discovery_option->num_of_service_names++;
}
char *ogs_sbi_discovery_option_build_service_names(
ogs_sbi_discovery_option_t *discovery_option)
{
int i;
char *service_names = NULL;
ogs_assert(discovery_option);
service_names = ogs_strdup(discovery_option->service_names[0]);
ogs_expect_or_return_val(service_names, NULL);
if (discovery_option->num_of_service_names > 1) {
for (i = 1; i < discovery_option->num_of_service_names; i++)
service_names = ogs_mstrcatf(
service_names, ",%s", discovery_option->service_names[i]);
}
return service_names;
}
void ogs_sbi_discovery_option_parse_service_names(
ogs_sbi_discovery_option_t *discovery_option,
char *service_names)
{
char *v = NULL;
char *token = NULL;
char *saveptr = NULL;
ogs_assert(discovery_option);
ogs_assert(service_names);
v = ogs_strdup(service_names);
ogs_assert(v);
token = ogs_strtok_r(v, ",", &saveptr);
while (token != NULL) {
ogs_sbi_discovery_option_add_service_names(discovery_option, token);
token = ogs_strtok_r(NULL, ",", &saveptr);
}
ogs_free(v);
}

View File

@@ -95,7 +95,6 @@ extern "C" {
#define OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA "ue-context-in-smf-data"
#define OGS_SBI_RESOURCE_NAME_SMF_SELECTION_SUBSCRIPTION_DATA \
"smf-selection-subscription-data"
#define OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS "sdm-subscriptions"
#define OGS_SBI_RESOURCE_NAME_SECURITY_INFORMATION "security-information"
#define OGS_SBI_RESOURCE_NAME_GENERATE_AUTH_DATA "generate-auth-data"
@@ -127,8 +126,6 @@ extern "C" {
#define OGS_SBI_RESOURCE_NAME_SM_CONTEXT_STATUS "sm-context-status"
#define OGS_SBI_RESOURCE_NAME_AM_POLICY_NOTIFY "am-policy-notify"
#define OGS_SBI_RESOURCE_NAME_DEREG_NOTIFY "dereg-notify"
#define OGS_SBI_RESOURCE_NAME_SDMSUBSCRIPTION_NOTIFY \
"sdmsubscription-notify"
#define OGS_SBI_RESOURCE_NAME_POLICIES "policies"
#define OGS_SBI_RESOURCE_NAME_SM_POLICIES "sm-policies"
@@ -233,11 +230,8 @@ extern "C" {
#define OGS_SBI_NBSF_MANAGEMENT_ES3XX 4
#define OGS_SBI_NBSF_MANAGEMENT_EXTENDED_SAME_PCF 5
#define OGS_SBI_SCHEME ":scheme"
#define OGS_SBI_AUTHORITY ":authority"
#define OGS_SBI_ACCEPT "Accept"
#define OGS_SBI_ACCEPT_ENCODING "Accept-Encoding"
#define OGS_SBI_USER_AGENT "User-Agent"
#define OGS_SBI_CONTENT_TYPE "Content-Type"
#define OGS_SBI_LOCATION "Location"
#define OGS_SBI_EXPECT "Expect"
@@ -286,10 +280,6 @@ extern "C" {
OGS_SBI_CUSTOM_3GPP_COMMON "Access-Scope"
#define OGS_SBI_CUSTOM_ACCESS_TOKEN \
OGS_SBI_CUSTOM_3GPP_COMMON "Access-Token"
#define OGS_SBI_OPTIONAL_CUSTOM_SENDER_TIMESTAMP \
OGS_SBI_CUSTOM_3GPP_COMMON "Sender-Timestamp"
#define OGS_SBI_OPTIONAL_CUSTOM_MAX_RSP_TIME \
OGS_SBI_CUSTOM_3GPP_COMMON "Max-Rsp-Time"
#define OGS_SBI_PARAM_TARGET_NF_TYPE "target-nf-type"
#define OGS_SBI_PARAM_REQUESTER_NF_TYPE "requester-nf-type"
@@ -331,39 +321,6 @@ extern "C" {
#define OGS_SBI_CONTENT_5GNAS_SM_ID "5gnas-sm"
#define OGS_SBI_CONTENT_NGAP_SM_ID "ngap-sm"
#define OGS_SBI_CALLBACK_NSMF_PDUSESSION_UPDATE \
"Nsmf_PDUSession_Update"
#define OGS_SBI_CALLBACK_NSMF_PDUSESSION_STATUS_NOTIFY \
"Nsmf_PDUSession_StatusNotify"
#define OGS_SBI_CALLBACK_NUDM_SDM_NOTIFICATION \
"Nudm_SDM_Notification"
#define OGS_SBI_CALLBACK_NUDM_UECM_DEREGISTRATION_NOTIFICATION \
"Nudm_UECM_DeregistrationNotification"
#define OGS_SBI_CALLBACK_NUDM_UECM_PCSCF_RESTORATION_NOTIFICATION \
"Nudm_UECM_PCSCFRestorationNotification"
#define OGS_SBI_CALLBACK_NNRF_NFMANAGEMENT_NF_STATUS_NOTIFY \
"Nnrf_NFManagement_NFStatusNotify"
#define OGS_SBI_CALLBACK_NAMF_EVENTEXPOSURE_NOTIFY \
"Namf_EventExposure_Notify"
#define OGS_SBI_CALLBACK_NPCF_UEPOLICYCONTROL_UPDATE_NOTIFY \
"Npcf_UEPolicyControl_UpdateNotify"
#define OGS_SBI_CALLBACK_NNSSF_NSSAIAVAILABILITY_NOTIFICATION \
"Nnssf_NSSAIAvailability_Notification"
#define OGS_SBI_CALLBACK_NAMF_COMMUNICATION_AMF_STATUS_CHANGE_NOTIFY \
"Namf_Communication_AMFStatusChangeNotify"
#define OGS_SBI_CALLBACK_NGMLC_LOCATION_EVENT_NOTIFY \
"Ngmlc_Location_EventNotify"
#define OGS_SBI_CALLBACK_NCHF_CONVERGEDCHARGING_NOTIFY \
"Nchf_ConvergedCharging_Notify"
#define OGS_SBI_CALLBACK_NNSSAAF_NSSAA_RE_AUTHENTICATION \
"Nnssaaf_NSSAA_ReAuthentication"
#define OGS_SBI_CALLBACK_NNSSAAF_NSSAA_REVOCATION \
"Nnssaaf_NSSAA_Revocation"
#define OGS_SBI_CALLBACK_N5G_DDNMF_DISCOVERY_MONITOR_UPDATE_RESULT \
"N5g-ddnmf_Discovery_MonitorUpdateResult"
#define OGS_SBI_CALLBACK_N5G_DDNMF_DISCOVERY_MATCH_INFORMATION \
"N5g-ddnmf_Discovery_MatchInformation"
typedef struct ogs_sbi_header_s {
char *method;
char *uri;
@@ -402,18 +359,11 @@ typedef struct ogs_sbi_message_s {
ogs_sbi_header_t h;
struct {
OpenAPI_nf_type_e requester_nf_type;
char *accept;
char *content_encoding;
char *content_type;
char *location;
char *cache_control;
struct {
char *callback;
char *nrf_uri;
} custom;
} http;
struct {
@@ -498,8 +448,6 @@ typedef struct ogs_sbi_message_s {
OpenAPI_sm_policy_notification_t *SmPolicyNotification;
OpenAPI_termination_notification_t *TerminationNotification;
OpenAPI_deregistration_data_t *DeregistrationData;
OpenAPI_sdm_subscription_t *SDMSubscription;
OpenAPI_modification_notification_t *ModificationNotification;
ogs_sbi_links_t *links;
@@ -580,15 +528,9 @@ void ogs_sbi_discovery_option_set_target_nf_instance_id(
void ogs_sbi_discovery_option_set_requester_nf_instance_id(
ogs_sbi_discovery_option_t *discovery_option,
char *requester_nf_instance_id);
void ogs_sbi_discovery_option_add_service_names(
ogs_sbi_discovery_option_t *discovery_option,
char *service_name);
char *ogs_sbi_discovery_option_build_service_names(
ogs_sbi_discovery_option_t *discovery_option);
void ogs_sbi_discovery_option_parse_service_names(
ogs_sbi_discovery_option_t *discovery_option,
char *service_names);
#ifdef __cplusplus
}

View File

@@ -110,7 +110,9 @@ void ogs_sbi_nf_state_final(ogs_fsm_t *s, ogs_event_t *e)
void ogs_sbi_nf_state_will_register(ogs_fsm_t *s, ogs_event_t *e)
{
ogs_sbi_nf_instance_t *nf_instance = NULL;
ogs_sbi_client_t *client = NULL;
ogs_sbi_message_t *message = NULL;
ogs_sockaddr_t *addr = NULL;
ogs_assert(s);
ogs_assert(e);
@@ -119,6 +121,7 @@ void ogs_sbi_nf_state_will_register(ogs_fsm_t *s, ogs_event_t *e)
nf_instance = e->sbi.data;
ogs_assert(nf_instance);
ogs_assert(ogs_sbi_self()->nf_instance);
ogs_assert(NF_INSTANCE_TYPE_IS_NRF(nf_instance));
switch (e->id) {
@@ -145,11 +148,11 @@ void ogs_sbi_nf_state_will_register(ogs_fsm_t *s, ogs_event_t *e)
if (message->res_status == OGS_SBI_HTTP_STATUS_OK ||
message->res_status == OGS_SBI_HTTP_STATUS_CREATED) {
ogs_nnrf_nfm_handle_nf_register(nf_instance, message);
ogs_sbi_nnrf_handle_nf_register(nf_instance, message);
OGS_FSM_TRAN(s, &ogs_sbi_nf_state_registered);
} else {
ogs_error("[%s] HTTP Response Status Code [%d]",
NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
ogs_sbi_self()->nf_instance->id,
message->res_status);
OGS_FSM_TRAN(s, &ogs_sbi_nf_state_exception);
}
@@ -157,23 +160,27 @@ void ogs_sbi_nf_state_will_register(ogs_fsm_t *s, ogs_event_t *e)
DEFAULT
ogs_error("[%s] Invalid resource name [%s]",
NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
ogs_sbi_self()->nf_instance->id,
message->h.resource.component[0]);
END
break;
DEFAULT
ogs_error("[%s] Invalid API name [%s]",
NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
message->h.service.name);
ogs_sbi_self()->nf_instance->id, message->h.service.name);
END
break;
case OGS_EVENT_SBI_TIMER:
switch(e->timer_id) {
case OGS_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL:
client = nf_instance->client;
ogs_assert(client);
addr = client->node.addr;
ogs_assert(addr);
ogs_warn("[%s] Retry to registration with NRF",
NF_INSTANCE_ID(ogs_sbi_self()->nf_instance));
ogs_sbi_self()->nf_instance->id);
ogs_timer_start(nf_instance->t_registration_interval,
ogs_app()->time.message.sbi.nf_register_interval);
@@ -183,7 +190,7 @@ void ogs_sbi_nf_state_will_register(ogs_fsm_t *s, ogs_event_t *e)
default:
ogs_error("[%s] Unknown timer[%s:%d]",
NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
ogs_sbi_self()->nf_instance->id,
ogs_timer_get_name(e->timer_id), e->timer_id);
}
break;
@@ -197,6 +204,7 @@ void ogs_sbi_nf_state_will_register(ogs_fsm_t *s, ogs_event_t *e)
void ogs_sbi_nf_state_registered(ogs_fsm_t *s, ogs_event_t *e)
{
ogs_sbi_nf_instance_t *nf_instance = NULL;
ogs_sbi_client_t *client = NULL;
ogs_sbi_message_t *message = NULL;
ogs_assert(s);
ogs_assert(e);
@@ -205,14 +213,18 @@ void ogs_sbi_nf_state_registered(ogs_fsm_t *s, ogs_event_t *e)
nf_instance = e->sbi.data;
ogs_assert(nf_instance);
ogs_assert(ogs_sbi_self()->nf_instance);
switch (e->id) {
case OGS_FSM_ENTRY_SIG:
if (NF_INSTANCE_TYPE_IS_NRF(nf_instance)) {
ogs_sbi_subscription_spec_t *subscription_spec = NULL;
client = nf_instance->client;
ogs_assert(client);
ogs_info("[%s] NF registered [Heartbeat:%ds]",
NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
ogs_sbi_self()->nf_instance->id,
nf_instance->time.heartbeat_interval);
if (nf_instance->time.heartbeat_interval) {
@@ -227,6 +239,7 @@ void ogs_sbi_nf_state_registered(ogs_fsm_t *s, ogs_event_t *e)
ogs_list_for_each(
&ogs_sbi_self()->subscription_spec_list, subscription_spec) {
ogs_nnrf_nfm_send_nf_status_subscribe(
client,
ogs_sbi_self()->nf_instance->nf_type,
ogs_sbi_self()->nf_instance->id,
subscription_spec->subscr_cond.nf_type,
@@ -237,8 +250,7 @@ void ogs_sbi_nf_state_registered(ogs_fsm_t *s, ogs_event_t *e)
case OGS_FSM_EXIT_SIG:
if (NF_INSTANCE_TYPE_IS_NRF(nf_instance)) {
ogs_info("[%s] NF de-registered",
NF_INSTANCE_ID(ogs_sbi_self()->nf_instance));
ogs_info("[%s] NF de-registered", ogs_sbi_self()->nf_instance->id);
if (nf_instance->time.heartbeat_interval) {
ogs_timer_stop(nf_instance->t_heartbeat_interval);
@@ -272,7 +284,7 @@ void ogs_sbi_nf_state_registered(ogs_fsm_t *s, ogs_event_t *e)
no_heartbeat_margin));
} else {
ogs_warn("[%s] HTTP response error [%d]",
NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
ogs_sbi_self()->nf_instance->id,
message->res_status);
OGS_FSM_TRAN(s, &ogs_sbi_nf_state_exception);
}
@@ -281,15 +293,14 @@ void ogs_sbi_nf_state_registered(ogs_fsm_t *s, ogs_event_t *e)
DEFAULT
ogs_error("[%s] Invalid resource name [%s]",
NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
ogs_sbi_self()->nf_instance->id,
message->h.resource.component[0]);
END
break;
DEFAULT
ogs_error("[%s] Invalid API name [%s]",
NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
message->h.service.name);
ogs_sbi_self()->nf_instance->id, message->h.service.name);
END
break;
@@ -304,10 +315,7 @@ void ogs_sbi_nf_state_registered(ogs_fsm_t *s, ogs_event_t *e)
break;
case OGS_TIMER_NF_INSTANCE_NO_HEARTBEAT:
ogs_error("[%s:%s] No heartbeat",
NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
OpenAPI_nf_type_ToString(
NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance)));
ogs_error("[%s] No heartbeat", ogs_sbi_self()->nf_instance->id);
OGS_FSM_TRAN(s, &ogs_sbi_nf_state_will_register);
break;
@@ -351,8 +359,7 @@ void ogs_sbi_nf_state_de_registered(ogs_fsm_t *s, ogs_event_t *e)
switch (e->id) {
case OGS_FSM_ENTRY_SIG:
if (NF_INSTANCE_TYPE_IS_NRF(nf_instance)) {
ogs_info("[%s] NF de-registered",
NF_INSTANCE_ID(ogs_sbi_self()->nf_instance));
ogs_info("[%s] NF de-registered", ogs_sbi_self()->nf_instance->id);
}
break;
@@ -371,7 +378,9 @@ void ogs_sbi_nf_state_de_registered(ogs_fsm_t *s, ogs_event_t *e)
void ogs_sbi_nf_state_exception(ogs_fsm_t *s, ogs_event_t *e)
{
ogs_sbi_nf_instance_t *nf_instance = NULL;
ogs_sbi_client_t *client = NULL;
ogs_sbi_message_t *message = NULL;
ogs_sockaddr_t *addr = NULL;
ogs_assert(s);
ogs_assert(e);
@@ -399,8 +408,13 @@ void ogs_sbi_nf_state_exception(ogs_fsm_t *s, ogs_event_t *e)
case OGS_EVENT_SBI_TIMER:
switch(e->timer_id) {
case OGS_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL:
client = nf_instance->client;
ogs_assert(client);
addr = client->node.addr;
ogs_assert(addr);
ogs_warn("[%s] Retry to registration with NRF",
NF_INSTANCE_ID(ogs_sbi_self()->nf_instance));
ogs_sbi_self()->nf_instance->id);
OGS_FSM_TRAN(s, &ogs_sbi_nf_state_will_register);
break;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*

View File

@@ -55,20 +55,13 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_register(void)
NFProfile = ogs_nnrf_nfm_build_nf_profile(
ogs_sbi_self()->nf_instance,
NULL, NULL, supported_features);
if (!NFProfile) {
ogs_error("No NFProfile");
goto end;
}
ogs_expect_or_return_val(NFProfile, NULL);
message.NFProfile = NFProfile;
request = ogs_sbi_build_request(&message);
ogs_expect(request);
end:
if (NFProfile)
ogs_nnrf_nfm_free_nf_profile(NFProfile);
ogs_nnrf_nfm_free_nf_profile(NFProfile);
return request;
}
@@ -104,10 +97,7 @@ OpenAPI_nf_profile_t *ogs_nnrf_nfm_build_nf_profile(
ogs_assert(nf_instance->id);
NFProfile = ogs_calloc(1, sizeof(*NFProfile));
if (!NFProfile) {
ogs_error("No NFProfile");
return NULL;
}
ogs_expect_or_return_val(NFProfile, NULL);
NFProfile->nf_instance_id = nf_instance->id;
NFProfile->nf_type = nf_instance->nf_type;
@@ -138,11 +128,9 @@ OpenAPI_nf_profile_t *ogs_nnrf_nfm_build_nf_profile(
NFProfile->load = nf_instance->load;
Ipv4AddrList = OpenAPI_list_create();
if (!Ipv4AddrList) {
ogs_error("No Ipv4AddrList");
ogs_nnrf_nfm_free_nf_profile(NFProfile);
return NULL;
}
ogs_assert(Ipv4AddrList);
Ipv6AddrList = OpenAPI_list_create();
ogs_assert(Ipv6AddrList);
for (i = 0; i < nf_instance->num_of_ipv4; i++) {
if (nf_instance->ipv4[i]) {
@@ -152,28 +140,10 @@ OpenAPI_nf_profile_t *ogs_nnrf_nfm_build_nf_profile(
nf_instance->ipv4[i]->ogs_sin_port);
ogs_assert(nf_instance->ipv4[i]->ogs_sa_family == AF_INET);
ipstr = ogs_ipstrdup(nf_instance->ipv4[i]);
if (!ipstr) {
ogs_error("No ipstr");
ogs_nnrf_nfm_free_nf_profile(NFProfile);
OpenAPI_list_free(Ipv4AddrList);
return NULL;
}
ogs_expect_or_return_val(ipstr, NULL);
OpenAPI_list_add(Ipv4AddrList, ipstr);
}
}
if (Ipv4AddrList->count)
NFProfile->ipv4_addresses = Ipv4AddrList;
else
OpenAPI_list_free(Ipv4AddrList);
Ipv6AddrList = OpenAPI_list_create();
if (!Ipv6AddrList) {
ogs_error("No IPv6AddrList");
ogs_nnrf_nfm_free_nf_profile(NFProfile);
return NULL;
}
for (i = 0; i < nf_instance->num_of_ipv6; i++) {
if (nf_instance->ipv6[i]) {
ogs_trace("IPv6 [family:%d, port:%d]",
@@ -181,27 +151,22 @@ OpenAPI_nf_profile_t *ogs_nnrf_nfm_build_nf_profile(
nf_instance->ipv6[i]->ogs_sin_port);
ogs_assert(nf_instance->ipv6[i]->ogs_sa_family == AF_INET6);
ipstr = ogs_ipstrdup(nf_instance->ipv6[i]);
if (!ipstr) {
ogs_error("No ipstr");
ogs_nnrf_nfm_free_nf_profile(NFProfile);
OpenAPI_list_free(Ipv6AddrList);
return NULL;
}
ogs_expect_or_return_val(ipstr, NULL);
OpenAPI_list_add(Ipv6AddrList, ipstr);
}
}
if (Ipv4AddrList->count)
NFProfile->ipv4_addresses = Ipv4AddrList;
else
OpenAPI_list_free(Ipv4AddrList);
if (Ipv6AddrList->count)
NFProfile->ipv6_addresses = Ipv6AddrList;
else
OpenAPI_list_free(Ipv6AddrList);
AllowedNfTypeList = OpenAPI_list_create();
if (!AllowedNfTypeList) {
ogs_error("No AllowedNfTypeList");
ogs_nnrf_nfm_free_nf_profile(NFProfile);
return NULL;
}
ogs_assert(AllowedNfTypeList);
for (i = 0; i < nf_instance->num_of_allowed_nf_type; i++) {
OpenAPI_list_add(AllowedNfTypeList,
@@ -214,18 +179,7 @@ OpenAPI_nf_profile_t *ogs_nnrf_nfm_build_nf_profile(
OpenAPI_list_free(AllowedNfTypeList);
NFServiceList = OpenAPI_list_create();
if (!NFServiceList) {
ogs_error("No nf_service_list");
ogs_nnrf_nfm_free_nf_profile(NFProfile);
return NULL;
}
if (OGS_SBI_FEATURES_IS_SET(
supported_features, OGS_SBI_NNRF_NFM_SERVICE_MAP)) {
NFProfile->nf_service_list = NFServiceList;
} else {
NFProfile->nf_services = NFServiceList;
}
ogs_assert(NFServiceList);
ogs_list_for_each(&nf_instance->nf_service_list, nf_service) {
OpenAPI_nf_service_t *NFService = NULL;
@@ -249,20 +203,12 @@ OpenAPI_nf_profile_t *ogs_nnrf_nfm_build_nf_profile(
}
NFService = build_nf_service(nf_service);
if (!NFService) {
ogs_error("No NFService");
ogs_nnrf_nfm_free_nf_profile(NFProfile);
return NULL;
}
ogs_expect_or_return_val(NFService, NULL);
if (OGS_SBI_FEATURES_IS_SET(
supported_features, OGS_SBI_NNRF_NFM_SERVICE_MAP)) {
NFServiceMap = OpenAPI_map_create(nf_service->id, NFService);
if (!NFServiceMap) {
ogs_error("No NFServiceMap");
ogs_nnrf_nfm_free_nf_profile(NFProfile);
return NULL;
}
ogs_assert(NFServiceMap);
OpenAPI_list_add(NFServiceList, NFServiceMap);
} else {
@@ -270,6 +216,16 @@ OpenAPI_nf_profile_t *ogs_nnrf_nfm_build_nf_profile(
}
}
if (NFServiceList->count) {
if (OGS_SBI_FEATURES_IS_SET(
supported_features, OGS_SBI_NNRF_NFM_SERVICE_MAP)) {
NFProfile->nf_service_list = NFServiceList;
} else {
NFProfile->nf_services = NFServiceList;
}
} else
OpenAPI_list_free(NFServiceList);
InfoList = OpenAPI_list_create();
ogs_assert(InfoList);
@@ -284,7 +240,7 @@ OpenAPI_nf_profile_t *ogs_nnrf_nfm_build_nf_profile(
}
SmfInfo = build_smf_info(nf_info);
ogs_assert(SmfInfo);
ogs_expect_or_return_val(SmfInfo, NULL);
InfoMap = OpenAPI_map_create(
ogs_msprintf("%d", ++InfoMapKey), SmfInfo);
@@ -294,7 +250,7 @@ OpenAPI_nf_profile_t *ogs_nnrf_nfm_build_nf_profile(
} else if (nf_info->nf_type == OpenAPI_nf_type_AMF) {
AmfInfo = build_amf_info(nf_info);
ogs_assert(AmfInfo);
ogs_expect_or_return_val(AmfInfo, NULL);
InfoMap = OpenAPI_map_create(
ogs_msprintf("%d", ++InfoMapKey), AmfInfo);
@@ -434,83 +390,37 @@ static OpenAPI_nf_service_t *build_nf_service(
ogs_assert(nf_service->name);
NFService = ogs_calloc(1, sizeof(*NFService));
if (!NFService) {
ogs_error("No NFService");
return NULL;
}
ogs_expect_or_return_val(NFService, NULL);
NFService->service_instance_id = ogs_strdup(nf_service->id);
if (!NFService->service_instance_id) {
ogs_error("No service_instance_id");
free_nf_service(NFService);
return NULL;
}
ogs_expect_or_return_val(NFService->service_instance_id, NULL);
NFService->service_name = ogs_strdup(nf_service->name);
if (!NFService->service_name) {
ogs_error("No service_name");
free_nf_service(NFService);
return NULL;
}
ogs_expect_or_return_val(NFService->service_name, NULL);
VersionList = OpenAPI_list_create();
if (!VersionList) {
ogs_error("No VersionList");
free_nf_service(NFService);
return NULL;
}
ogs_assert(VersionList);
for (i = 0; i < nf_service->num_of_version; i++) {
OpenAPI_nf_service_version_t *NFServiceVersion = NULL;
NFServiceVersion = ogs_calloc(1, sizeof(*NFServiceVersion));
if (!NFServiceVersion) {
ogs_error("No NFServiceVersion");
free_nf_service(NFService);
OpenAPI_list_free(VersionList);
return NULL;
}
ogs_expect_or_return_val(NFServiceVersion, NULL);
if (nf_service->version[i].in_uri) {
NFServiceVersion->api_version_in_uri =
ogs_strdup(nf_service->version[i].in_uri);
if (!NFServiceVersion->api_version_in_uri) {
ogs_error("No api_version_in_uri");
if (NFServiceVersion)
ogs_free(NFServiceVersion);
free_nf_service(NFService);
OpenAPI_list_free(VersionList);
return NULL;
}
ogs_expect_or_return_val(
NFServiceVersion->api_version_in_uri, NULL);
}
if (nf_service->version[i].full) {
NFServiceVersion->api_full_version =
ogs_strdup(nf_service->version[i].full);
if (!NFServiceVersion->api_full_version) {
ogs_error("No api_full_version");
if (NFServiceVersion) {
if (NFServiceVersion->api_version_in_uri)
ogs_free(NFServiceVersion->api_version_in_uri);
ogs_free(NFServiceVersion);
}
free_nf_service(NFService);
OpenAPI_list_free(VersionList);
return NULL;
}
ogs_expect_or_return_val(
NFServiceVersion->api_full_version, NULL);
}
if (nf_service->version[i].expiry) {
NFServiceVersion->expiry =
ogs_strdup(nf_service->version[i].expiry);
if (!NFServiceVersion->expiry) {
ogs_error("No expiry");
if (NFServiceVersion) {
if (NFServiceVersion->api_version_in_uri)
ogs_free(NFServiceVersion->api_version_in_uri);
if (NFServiceVersion->api_full_version)
ogs_free(NFServiceVersion->api_full_version);
ogs_free(NFServiceVersion);
}
free_nf_service(NFService);
OpenAPI_list_free(VersionList);
return NULL;
}
ogs_expect_or_return_val(
NFServiceVersion->expiry, NULL);
}
OpenAPI_list_add(VersionList, NFServiceVersion);
@@ -526,11 +436,7 @@ static OpenAPI_nf_service_t *build_nf_service(
NFService->fqdn = ogs_strdup(nf_service->fqdn);
IpEndPointList = OpenAPI_list_create();
if (!IpEndPointList) {
ogs_error("No IpEndPointList");
free_nf_service(NFService);
return NULL;
}
ogs_assert(IpEndPointList);
for (i = 0; i < nf_service->num_of_addr; i++) {
ogs_sockaddr_t *ipv4 = NULL;
@@ -543,36 +449,14 @@ static OpenAPI_nf_service_t *build_nf_service(
if (ipv4 || ipv6) {
IpEndPoint = ogs_calloc(1, sizeof(*IpEndPoint));
if (!IpEndPoint) {
ogs_error("No IpEndPoint");
free_nf_service(NFService);
OpenAPI_list_free(IpEndPointList);
return NULL;
}
ogs_expect_or_return_val(IpEndPoint, NULL);
if (ipv4) {
IpEndPoint->ipv4_address = ogs_ipstrdup(ipv4);
if (!IpEndPoint->ipv4_address) {
ogs_error("No ipv4_address");
if (IpEndPoint)
ogs_free(IpEndPoint);
free_nf_service(NFService);
OpenAPI_list_free(IpEndPointList);
return NULL;
}
ogs_expect_or_return_val(IpEndPoint->ipv4_address, NULL);
}
if (ipv6) {
IpEndPoint->ipv6_address = ogs_ipstrdup(ipv6);
if (!IpEndPoint->ipv6_address) {
ogs_error("No ipv6_address");
if (IpEndPoint) {
if (IpEndPoint->ipv4_address)
ogs_free(IpEndPoint->ipv4_address);
ogs_free(IpEndPoint);
}
free_nf_service(NFService);
OpenAPI_list_free(IpEndPointList);
return NULL;
}
ogs_expect_or_return_val(IpEndPoint->ipv6_address, NULL);
}
IpEndPoint->is_port = true;
IpEndPoint->port = nf_service->addr[i].port;
@@ -586,11 +470,7 @@ static OpenAPI_nf_service_t *build_nf_service(
OpenAPI_list_free(IpEndPointList);
AllowedNfTypeList = OpenAPI_list_create();
if (!AllowedNfTypeList) {
ogs_error("No AllowedNfTypeList");
free_nf_service(NFService);
return NULL;
}
ogs_assert(AllowedNfTypeList);
for (i = 0; i < nf_service->num_of_allowed_nf_type; i++) {
OpenAPI_list_add(AllowedNfTypeList,
@@ -672,52 +552,38 @@ static OpenAPI_smf_info_t *build_smf_info(ogs_sbi_nf_info_t *nf_info)
ogs_assert(nf_info);
SmfInfo = ogs_calloc(1, sizeof(*SmfInfo));
if (!SmfInfo) {
ogs_error("No SmfInfo");
return NULL;
}
ogs_expect_or_return_val(SmfInfo, NULL);
sNssaiSmfInfoList = OpenAPI_list_create();
if (!sNssaiSmfInfoList) {
ogs_error("No sNssaiSmfInfoList");
free_smf_info(SmfInfo);
return NULL;
}
ogs_assert(sNssaiSmfInfoList);
for (i = 0; i < nf_info->smf.num_of_slice; i++) {
DnnSmfInfoList = OpenAPI_list_create();
if (!DnnSmfInfoList) {
ogs_error("No DnnSmfInfoList");
free_smf_info(SmfInfo);
OpenAPI_list_free(sNssaiSmfInfoList);
return NULL;
}
ogs_assert(DnnSmfInfoList);
for (j = 0; j < nf_info->smf.slice[i].num_of_dnn; j++) {
DnnSmfInfoItem = ogs_calloc(1, sizeof(*DnnSmfInfoItem));
ogs_assert(DnnSmfInfoItem);
ogs_expect_or_return_val(DnnSmfInfoItem, NULL);
DnnSmfInfoItem->dnn = nf_info->smf.slice[i].dnn[j];
OpenAPI_list_add(DnnSmfInfoList, DnnSmfInfoItem);
}
if (!DnnSmfInfoList->count) {
ogs_error("CHECK CONFIGURATION: No DNN");
OpenAPI_list_free(DnnSmfInfoList);
free_smf_info(SmfInfo);
OpenAPI_list_free(sNssaiSmfInfoList);
return NULL;
ogs_error("CHECK CONFIGURATION: No DNN");
ogs_expect_or_return_val(0, NULL);
}
sNssaiSmfInfoItem = ogs_calloc(1, sizeof(*sNssaiSmfInfoItem));
ogs_assert(sNssaiSmfInfoItem);
ogs_expect_or_return_val(sNssaiSmfInfoItem, NULL);
sNssaiSmfInfoItem->dnn_smf_info_list = DnnSmfInfoList;
sNssaiSmfInfoItem->s_nssai = sNssai = ogs_calloc(1, sizeof(*sNssai));
ogs_assert(sNssai);
sNssaiSmfInfoItem->s_nssai = sNssai =
ogs_calloc(1, sizeof(*sNssai));
ogs_expect_or_return_val(sNssai, NULL);
sNssai->sst = nf_info->smf.slice[i].s_nssai.sst;
sNssai->sd =
ogs_s_nssai_sd_to_string(nf_info->smf.slice[i].s_nssai.sd);
@@ -731,43 +597,17 @@ static OpenAPI_smf_info_t *build_smf_info(ogs_sbi_nf_info_t *nf_info)
OpenAPI_list_free(sNssaiSmfInfoList);
TaiList = OpenAPI_list_create();
if (!TaiList) {
ogs_error("No TaiList");
free_smf_info(SmfInfo);
return NULL;
}
ogs_assert(TaiList);
for (i = 0; i < nf_info->smf.num_of_nr_tai; i++) {
TaiItem = ogs_calloc(1, sizeof(*TaiItem));
if (!TaiItem) {
ogs_error("No TaiItem");
free_smf_info(SmfInfo);
OpenAPI_list_free(TaiList);
return NULL;
}
ogs_expect_or_return_val(TaiItem, NULL);
TaiItem->plmn_id = ogs_sbi_build_plmn_id(
&nf_info->smf.nr_tai[i].plmn_id);
if (!TaiItem->plmn_id) {
ogs_error("No TaiItem->plmn_id");
if (TaiItem)
ogs_free(TaiItem);
free_smf_info(SmfInfo);
OpenAPI_list_free(TaiList);
return NULL;
}
ogs_expect_or_return_val(TaiItem->plmn_id, NULL);
TaiItem->tac =
ogs_uint24_to_0string(nf_info->smf.nr_tai[i].tac);
if (!TaiItem->tac) {
ogs_error("No TaiItem->tac");
if (TaiItem) {
if (TaiItem->plmn_id)
ogs_free(TaiItem->plmn_id);
ogs_free(TaiItem);
}
free_smf_info(SmfInfo);
OpenAPI_list_free(TaiList);
return NULL;
}
ogs_expect_or_return_val(TaiItem->tac, NULL);
OpenAPI_list_add(TaiList, TaiItem);
}
@@ -778,54 +618,42 @@ static OpenAPI_smf_info_t *build_smf_info(ogs_sbi_nf_info_t *nf_info)
OpenAPI_list_free(TaiList);
TaiRangeList = OpenAPI_list_create();
if (!TaiRangeList) {
ogs_error("No TaiRangeList");
free_smf_info(SmfInfo);
return NULL;
}
ogs_assert(TaiRangeList);
for (i = 0; i < nf_info->smf.num_of_nr_tai_range; i++) {
TacRangeList = OpenAPI_list_create();
if (!TacRangeList) {
ogs_error("No TacRangeList");
free_smf_info(SmfInfo);
OpenAPI_list_free(TaiRangeList);
return NULL;
}
ogs_assert(TacRangeList);
for (j = 0;
j < nf_info->smf.nr_tai_range[i].num_of_tac_range;
j++) {
TacRangeItem = ogs_calloc(1, sizeof(*TacRangeItem));
ogs_assert(TacRangeItem);
ogs_expect_or_return_val(TacRangeItem, NULL);
TacRangeItem->start = ogs_uint24_to_0string(
nf_info->smf.nr_tai_range[i].start[j]);
ogs_assert(TacRangeItem->start);
ogs_expect_or_return_val(TacRangeItem->start, NULL);
TacRangeItem->end =
ogs_uint24_to_0string(
nf_info->smf.nr_tai_range[i].end[j]);
ogs_assert(TacRangeItem->end);
ogs_expect_or_return_val(TacRangeItem->end, NULL);
OpenAPI_list_add(TacRangeList, TacRangeItem);
}
if (!TacRangeList->count) {
ogs_error("CHECK CONFIGURATION: No Start/End in TacRange");
OpenAPI_list_free(TacRangeList);
free_smf_info(SmfInfo);
OpenAPI_list_free(TaiRangeList);
return NULL;
ogs_error("CHECK CONFIGURATION: No Start/End in TacRange");
ogs_expect_or_return_val(0, NULL);
}
TaiRangeItem = ogs_calloc(1, sizeof(*TaiRangeItem));
ogs_assert(TaiRangeItem);
ogs_expect_or_return_val(TaiRangeItem, NULL);
TaiRangeItem->plmn_id = ogs_sbi_build_plmn_id(
&nf_info->smf.nr_tai_range[i].plmn_id);
ogs_assert(TaiRangeItem->plmn_id);
ogs_expect_or_return_val(TaiRangeItem->plmn_id, NULL);
TaiRangeItem->tac_range_list = TacRangeList;
@@ -858,64 +686,25 @@ static OpenAPI_amf_info_t *build_amf_info(ogs_sbi_nf_info_t *nf_info)
ogs_assert(nf_info);
AmfInfo = ogs_calloc(1, sizeof(*AmfInfo));
if (!AmfInfo) {
ogs_error("No AmfInfo");
return NULL;
}
ogs_expect_or_return_val(AmfInfo, NULL);
AmfInfo->amf_set_id = ogs_msprintf("%03x", nf_info->amf.amf_set_id);
if (!AmfInfo->amf_set_id) {
ogs_error("No amf_set_id");
free_amf_info(AmfInfo);
return NULL;
}
AmfInfo->amf_region_id = ogs_msprintf("%02x", nf_info->amf.amf_region_id);
if (!AmfInfo->amf_region_id) {
ogs_error("No amf_region_id");
free_amf_info(AmfInfo);
return NULL;
}
guamiAmfInfoList = OpenAPI_list_create();
if (!guamiAmfInfoList) {
ogs_error("No guamiAmfInfoList");
free_amf_info(AmfInfo);
return NULL;
}
ogs_assert(guamiAmfInfoList);
for (i = 0; i < nf_info->amf.num_of_guami; i++) {
guamiAmfInfoItem = ogs_calloc(1, sizeof(*guamiAmfInfoItem));
if (!guamiAmfInfoItem) {
ogs_error("guamiAmfInfoItem");
free_amf_info(AmfInfo);
OpenAPI_list_free(guamiAmfInfoList);
return NULL;
}
ogs_expect_or_return_val(guamiAmfInfoItem, NULL);
guamiAmfInfoItem->plmn_id =
ogs_sbi_build_plmn_id_nid(&nf_info->amf.guami[i].plmn_id);
if (!guamiAmfInfoItem->plmn_id) {
ogs_error("guamiAmfInfoItem->plmn_id");
if (guamiAmfInfoItem)
ogs_free(guamiAmfInfoItem);
free_amf_info(AmfInfo);
OpenAPI_list_free(guamiAmfInfoList);
return NULL;
}
ogs_expect_or_return_val(guamiAmfInfoItem->plmn_id, NULL);
guamiAmfInfoItem->amf_id =
ogs_amf_id_to_string(&nf_info->amf.guami[i].amf_id);
if (!guamiAmfInfoItem->amf_id) {
ogs_error("guamiAmfInfoItem->amf_id");
if (guamiAmfInfoItem) {
if (guamiAmfInfoItem->plmn_id)
ogs_free(guamiAmfInfoItem->plmn_id);
ogs_free(guamiAmfInfoItem);
}
free_amf_info(AmfInfo);
OpenAPI_list_free(guamiAmfInfoList);
return NULL;
}
ogs_expect_or_return_val(guamiAmfInfoItem->amf_id, NULL);
OpenAPI_list_add(guamiAmfInfoList, guamiAmfInfoItem);
}
@@ -926,43 +715,17 @@ static OpenAPI_amf_info_t *build_amf_info(ogs_sbi_nf_info_t *nf_info)
OpenAPI_list_free(guamiAmfInfoList);
TaiList = OpenAPI_list_create();
if (!TaiList) {
ogs_error("No TaiList");
free_amf_info(AmfInfo);
return NULL;
}
ogs_assert(TaiList);
for (i = 0; i < nf_info->amf.num_of_nr_tai; i++) {
TaiItem = ogs_calloc(1, sizeof(*TaiItem));
if (!TaiList) {
ogs_error("No TaiItem");
free_amf_info(AmfInfo);
OpenAPI_list_free(TaiList);
return NULL;
}
ogs_expect_or_return_val(TaiItem, NULL);
TaiItem->plmn_id = ogs_sbi_build_plmn_id(
&nf_info->amf.nr_tai[i].plmn_id);
if (!TaiItem->plmn_id) {
ogs_error("No TaiItem->plmn_id");
if (TaiItem)
ogs_free(TaiItem);
free_amf_info(AmfInfo);
OpenAPI_list_free(TaiList);
return NULL;
}
ogs_expect_or_return_val(TaiItem->plmn_id, NULL);
TaiItem->tac =
ogs_uint24_to_0string(nf_info->amf.nr_tai[i].tac);
if (!TaiItem->tac) {
ogs_error("No TaiItem->tac");
if (TaiItem) {
if (TaiItem->plmn_id)
ogs_free(TaiItem->plmn_id);
ogs_free(TaiItem);
}
free_amf_info(AmfInfo);
OpenAPI_list_free(TaiList);
return NULL;
}
ogs_expect_or_return_val(TaiItem->tac, NULL);
OpenAPI_list_add(TaiList, TaiItem);
}
@@ -973,65 +736,42 @@ static OpenAPI_amf_info_t *build_amf_info(ogs_sbi_nf_info_t *nf_info)
OpenAPI_list_free(TaiList);
TaiRangeList = OpenAPI_list_create();
if (!TaiRangeList) {
ogs_error("No TaiRangeList");
free_amf_info(AmfInfo);
return NULL;
}
ogs_assert(TaiRangeList);
for (i = 0; i < nf_info->amf.num_of_nr_tai_range; i++) {
TacRangeList = OpenAPI_list_create();
if (!TacRangeList) {
ogs_error("No TacRangeList");
free_amf_info(AmfInfo);
OpenAPI_list_free(TaiRangeList);
return NULL;
}
ogs_assert(TacRangeList);
for (j = 0;
j < nf_info->amf.nr_tai_range[i].num_of_tac_range;
j++) {
TacRangeItem = ogs_calloc(1, sizeof(*TacRangeItem));
ogs_assert(TacRangeItem);
ogs_expect_or_return_val(TacRangeItem, NULL);
TacRangeItem->start = ogs_uint24_to_0string(
nf_info->amf.nr_tai_range[i].start[j]);
ogs_assert(TacRangeItem->start);
ogs_expect_or_return_val(TacRangeItem->start, NULL);
TacRangeItem->end =
ogs_uint24_to_0string(
nf_info->amf.nr_tai_range[i].end[j]);
ogs_assert(TacRangeItem->end);
ogs_expect_or_return_val(TacRangeItem->end, NULL);
OpenAPI_list_add(TacRangeList, TacRangeItem);
}
if (!TacRangeList->count) {
ogs_error("CHECK CONFIGURATION: No Start/End in TacRange");
OpenAPI_list_free(TacRangeList);
free_amf_info(AmfInfo);
OpenAPI_list_free(TaiRangeList);
return NULL;
ogs_error("CHECK CONFIGURATION: No Start/End in TacRange");
ogs_expect_or_return_val(0, NULL);
}
TaiRangeItem = ogs_calloc(1, sizeof(*TaiRangeItem));
if (!TaiRangeItem) {
ogs_error("No TaiRangeItem");
free_amf_info(AmfInfo);
OpenAPI_list_free(TaiRangeList);
return NULL;
}
ogs_expect_or_return_val(TaiRangeItem, NULL);
TaiRangeItem->plmn_id = ogs_sbi_build_plmn_id(
&nf_info->amf.nr_tai_range[i].plmn_id);
if (!TaiRangeItem->plmn_id) {
ogs_error("No TaiRangeItem->plmn_id");
ogs_free(TaiRangeItem);
free_amf_info(AmfInfo);
OpenAPI_list_free(TaiRangeList);
return NULL;
}
ogs_expect_or_return_val(TaiRangeItem->plmn_id, NULL);
TaiRangeItem->tac_range_list = TacRangeList;
@@ -1145,10 +885,8 @@ static void free_amf_info(OpenAPI_amf_info_t *AmfInfo)
ogs_assert(AmfInfo);
if (AmfInfo->amf_set_id)
ogs_free(AmfInfo->amf_set_id);
if (AmfInfo->amf_region_id)
ogs_free(AmfInfo->amf_region_id);
ogs_free(AmfInfo->amf_set_id);
ogs_free(AmfInfo->amf_region_id);
guamiAmfInfoList = AmfInfo->guami_list;
OpenAPI_list_for_each(guamiAmfInfoList, node) {
@@ -1234,29 +972,21 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_update(void)
message.http.content_type = (char *)OGS_SBI_CONTENT_PATCH_TYPE;
PatchItemList = OpenAPI_list_create();
if (!PatchItemList) {
ogs_error("No PatchItemList");
goto end;
}
ogs_assert(PatchItemList);
memset(&item, 0, sizeof(item));
item.op = OpenAPI_patch_operation_replace;
item.path = (char *)"/nfStatus";
item.value = OpenAPI_any_type_create_string(
OpenAPI_nf_status_ToString(OpenAPI_nf_status_REGISTERED));
if (!item.value) {
ogs_error("No item.value");
goto end;
}
ogs_assert(item.value);
OpenAPI_list_add(PatchItemList, &item);
message.PatchItemList = PatchItemList;
request = ogs_sbi_build_request(&message);
ogs_expect(request);
end:
OpenAPI_list_free(PatchItemList);
OpenAPI_any_type_free(item.value);
@@ -1283,7 +1013,6 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_de_register(void)
message.h.resource.component[1] = nf_instance->id;
request = ogs_sbi_build_request(&message);
ogs_expect(request);
return request;
}
@@ -1310,16 +1039,10 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_status_subscribe(
(char *)OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS;
SubscriptionData = ogs_calloc(1, sizeof(*SubscriptionData));
if (!SubscriptionData) {
ogs_error("No SubscriptionData");
goto end;
}
ogs_expect_or_return_val(SubscriptionData, NULL);
server = ogs_list_first(&ogs_sbi_self()->server_list);
if (!server) {
ogs_error("No server");
goto end;
}
ogs_expect_or_return_val(server, NULL);
memset(&header, 0, sizeof(header));
header.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM;
@@ -1328,10 +1051,8 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_status_subscribe(
(char *)OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY;
SubscriptionData->nf_status_notification_uri =
ogs_sbi_server_uri(server, &header);
if (!SubscriptionData->nf_status_notification_uri) {
ogs_error("No nf_status_notification_uri");
goto end;
}
ogs_expect_or_return_val(
SubscriptionData->nf_status_notification_uri, NULL);
SubscriptionData->req_nf_type = subscription_data->req_nf_type;
SubscriptionData->req_nf_instance_id =
@@ -1341,10 +1062,7 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_status_subscribe(
OGS_SBI_NNRF_NFM_SERVICE_MAP);
SubscriptionData->requester_features =
ogs_uint64_to_string(subscription_data->requester_features);
if (!SubscriptionData->requester_features) {
ogs_error("No requester_features");
goto end;
}
ogs_expect_or_return_val(SubscriptionData->requester_features, NULL);
memset(&SubscrCond, 0, sizeof(SubscrCond));
if (subscription_data->subscr_cond.nf_type) {
@@ -1358,20 +1076,11 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_status_subscribe(
message.SubscriptionData = SubscriptionData;
message.http.custom.callback =
(char *)OGS_SBI_CALLBACK_NNRF_NFMANAGEMENT_NF_STATUS_NOTIFY;
request = ogs_sbi_build_request(&message);
ogs_expect(request);
end:
if (SubscriptionData) {
if (SubscriptionData->nf_status_notification_uri)
ogs_free(SubscriptionData->nf_status_notification_uri);
if (SubscriptionData->requester_features)
ogs_free(SubscriptionData->requester_features);
ogs_free(SubscriptionData);
}
ogs_free(SubscriptionData->nf_status_notification_uri);
ogs_free(SubscriptionData->requester_features);
ogs_free(SubscriptionData);
return request;
}
@@ -1393,11 +1102,7 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_status_unsubscribe(
(char *)OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS;
message.h.resource.component[1] = subscription_data->id;
message.http.custom.callback =
(char *)OGS_SBI_CALLBACK_NNRF_NFMANAGEMENT_NF_STATUS_NOTIFY;
request = ogs_sbi_build_request(&message);
ogs_expect(request);
return request;
}
@@ -1418,20 +1123,23 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_profile_retrieve(char *nf_instance_id)
message.h.resource.component[1] = nf_instance_id;
request = ogs_sbi_build_request(&message);
ogs_expect(request);
return request;
}
ogs_sbi_request_t *ogs_nnrf_disc_build_discover(
OpenAPI_nf_type_e target_nf_type,
OpenAPI_nf_type_e requester_nf_type,
ogs_sbi_discovery_option_t *discovery_option)
{
ogs_sbi_message_t message;
ogs_sbi_request_t *request = NULL;
OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
ogs_assert(target_nf_type);
ogs_assert(ogs_sbi_self()->nf_instance);
requester_nf_type = ogs_sbi_self()->nf_instance->nf_type;
ogs_assert(requester_nf_type);
memset(&message, 0, sizeof(message));
@@ -1447,7 +1155,6 @@ ogs_sbi_request_t *ogs_nnrf_disc_build_discover(
message.param.discovery_option = discovery_option;
request = ogs_sbi_build_request(&message);
ogs_expect(request);
return request;
}

View File

@@ -43,7 +43,6 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_profile_retrieve(char *nf_instance_id);
ogs_sbi_request_t *ogs_nnrf_disc_build_discover(
OpenAPI_nf_type_e target_nf_type,
OpenAPI_nf_type_e requester_nf_type,
ogs_sbi_discovery_option_t *discovery_option);
#ifdef __cplusplus

View File

@@ -24,13 +24,16 @@ static void handle_nf_service(
static void handle_smf_info(
ogs_sbi_nf_instance_t *nf_instance, OpenAPI_smf_info_t *SmfInfo);
void ogs_nnrf_nfm_handle_nf_register(
void ogs_sbi_nnrf_handle_nf_register(
ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_message_t *recvmsg)
{
OpenAPI_nf_profile_t *NFProfile = NULL;
ogs_sbi_client_t *client = NULL;
ogs_assert(recvmsg);
ogs_assert(nf_instance);
client = nf_instance->client;
ogs_assert(client);
NFProfile = recvmsg->NFProfile;
if (!NFProfile) {
@@ -43,7 +46,7 @@ void ogs_nnrf_nfm_handle_nf_register(
nf_instance->time.heartbeat_interval = NFProfile->heart_beat_timer;
}
void ogs_nnrf_nfm_handle_nf_profile(
void ogs_sbi_nnrf_handle_nf_profile(
ogs_sbi_nf_instance_t *nf_instance, OpenAPI_nf_profile_t *NFProfile)
{
int rv;
@@ -448,14 +451,17 @@ static void handle_smf_info(
}
}
void ogs_nnrf_nfm_handle_nf_status_subscribe(
void ogs_nnrf_handle_nf_status_subscribe(
ogs_sbi_subscription_data_t *subscription_data,
ogs_sbi_message_t *recvmsg)
{
OpenAPI_subscription_data_t *SubscriptionData = NULL;
ogs_sbi_client_t *client = NULL;
ogs_assert(recvmsg);
ogs_assert(subscription_data);
client = subscription_data->client;
ogs_assert(client);
SubscriptionData = recvmsg->SubscriptionData;
if (!SubscriptionData) {
@@ -500,7 +506,7 @@ void ogs_nnrf_nfm_handle_nf_status_subscribe(
}
}
bool ogs_nnrf_nfm_handle_nf_status_notify(
bool ogs_nnrf_handle_nf_status_notify(
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg)
{
int rv;
@@ -627,7 +633,7 @@ bool ogs_nnrf_nfm_handle_nf_status_notify(
message.h.resource.component[1]);
}
ogs_nnrf_nfm_handle_nf_profile(nf_instance, NFProfile);
ogs_sbi_nnrf_handle_nf_profile(nf_instance, NFProfile);
ogs_info("[%s] (NRF-notify) NF Profile updated", nf_instance->id);
@@ -679,7 +685,7 @@ bool ogs_nnrf_nfm_handle_nf_status_notify(
return true;
}
void ogs_nnrf_disc_handle_nf_discover_search_result(
void ogs_nnrf_handle_nf_discover_search_result(
OpenAPI_search_result_t *SearchResult)
{
OpenAPI_lnode_t *node = NULL;
@@ -731,7 +737,7 @@ void ogs_nnrf_disc_handle_nf_discover_search_result(
}
if (NF_INSTANCE_ID_IS_OTHERS(nf_instance->id)) {
ogs_nnrf_nfm_handle_nf_profile(nf_instance, NFProfile);
ogs_sbi_nnrf_handle_nf_profile(nf_instance, NFProfile);
ogs_sbi_client_associate(nf_instance);

View File

@@ -24,18 +24,18 @@
extern "C" {
#endif
void ogs_nnrf_nfm_handle_nf_register(
void ogs_sbi_nnrf_handle_nf_register(
ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_message_t *recvmsg);
void ogs_nnrf_nfm_handle_nf_profile(
void ogs_sbi_nnrf_handle_nf_profile(
ogs_sbi_nf_instance_t *nf_instance, OpenAPI_nf_profile_t *NFProfile);
void ogs_nnrf_nfm_handle_nf_status_subscribe(
void ogs_nnrf_handle_nf_status_subscribe(
ogs_sbi_subscription_data_t *subscription_data,
ogs_sbi_message_t *recvmsg);
bool ogs_nnrf_nfm_handle_nf_status_notify(
bool ogs_nnrf_handle_nf_status_notify(
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg);
void ogs_nnrf_disc_handle_nf_discover_search_result(
void ogs_nnrf_handle_nf_discover_search_result(
OpenAPI_search_result_t *SearchResult);
#ifdef __cplusplus

View File

@@ -1,144 +0,0 @@
/*
* Copyright (C) 2022 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ogs-sbi.h"
bool ogs_nnrf_nfm_send_nf_register(ogs_sbi_nf_instance_t *nf_instance)
{
bool rc;
ogs_sbi_request_t *request = NULL;
ogs_assert(nf_instance);
request = ogs_nnrf_nfm_build_register();
if (!request) {
ogs_error("No Request");
return false;
}
rc = ogs_sbi_send_notification_request(
OGS_SBI_SERVICE_TYPE_NNRF_NFM, NULL, request, nf_instance);
ogs_expect(rc == true);
ogs_sbi_request_free(request);
return rc;
}
bool ogs_nnrf_nfm_send_nf_update(ogs_sbi_nf_instance_t *nf_instance)
{
bool rc;
ogs_sbi_request_t *request = NULL;
ogs_assert(nf_instance);
request = ogs_nnrf_nfm_build_update();
if (!request) {
ogs_error("No Request");
return false;
}
rc = ogs_sbi_send_notification_request(
OGS_SBI_SERVICE_TYPE_NNRF_NFM, NULL, request, nf_instance);
ogs_expect(rc == true);
ogs_sbi_request_free(request);
return rc;
}
bool ogs_nnrf_nfm_send_nf_de_register(ogs_sbi_nf_instance_t *nf_instance)
{
bool rc;
ogs_sbi_request_t *request = NULL;
ogs_assert(nf_instance);
request = ogs_nnrf_nfm_build_de_register();
if (!request) {
ogs_error("No Request");
return false;
}
rc = ogs_sbi_send_notification_request(
OGS_SBI_SERVICE_TYPE_NNRF_NFM, NULL, request, nf_instance);
ogs_expect(rc == true);
ogs_sbi_request_free(request);
return rc;
}
bool ogs_nnrf_nfm_send_nf_status_subscribe(
OpenAPI_nf_type_e req_nf_type, char *req_nf_instance_id,
OpenAPI_nf_type_e subscr_cond_nf_type,
char *subscr_cond_service_name)
{
bool rc;
ogs_sbi_request_t *request = NULL;
ogs_sbi_subscription_data_t *subscription_data = NULL;
subscription_data = ogs_sbi_subscription_data_add();
ogs_assert(subscription_data);
subscription_data->req_nf_type = req_nf_type;
if (req_nf_instance_id)
subscription_data->req_nf_instance_id = ogs_strdup(req_nf_instance_id);
subscription_data->subscr_cond.nf_type = subscr_cond_nf_type;
if (subscr_cond_service_name)
subscription_data->subscr_cond.service_name =
ogs_strdup(subscr_cond_service_name);
request = ogs_nnrf_nfm_build_status_subscribe(subscription_data);
if (!request) {
ogs_error("No Request");
return false;
}
rc = ogs_sbi_send_notification_request(
OGS_SBI_SERVICE_TYPE_NNRF_NFM, NULL, request, subscription_data);
ogs_expect(rc == true);
ogs_sbi_request_free(request);
return rc;
}
bool ogs_nnrf_nfm_send_nf_status_unsubscribe(
ogs_sbi_subscription_data_t *subscription_data)
{
bool rc;
ogs_sbi_request_t *request = NULL;
ogs_assert(subscription_data);
request = ogs_nnrf_nfm_build_status_unsubscribe(subscription_data);
if (!request) {
ogs_error("No Request");
return false;
}
rc = ogs_sbi_send_notification_request(
OGS_SBI_SERVICE_TYPE_NNRF_NFM, NULL, request, subscription_data);
ogs_expect(rc == true);
ogs_sbi_request_free(request);
return rc;
}

View File

@@ -1,47 +0,0 @@
/*
* Copyright (C) 2022 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef OGS_NNRF_PATH_H
#define OGS_NNRF_PATH_H
#include "nnrf-build.h"
#ifdef __cplusplus
extern "C" {
#endif
bool ogs_nnrf_nfm_send_nf_register(ogs_sbi_nf_instance_t *nf_instance);
bool ogs_nnrf_nfm_send_nf_update(ogs_sbi_nf_instance_t *nf_instance);
bool ogs_nnrf_nfm_send_nf_de_register(ogs_sbi_nf_instance_t *nf_instance);
bool ogs_nnrf_nfm_send_nf_status_subscribe(
OpenAPI_nf_type_e req_nf_type, char *req_nf_instance_id,
OpenAPI_nf_type_e subscr_cond_nf_type,
char *subscr_cond_service_name);
bool ogs_nnrf_nfm_send_nf_status_unsubscribe(
ogs_sbi_subscription_data_t *subscription_data);
bool ogs_nnrf_nfm_send_to_nrf(
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
ogs_sbi_request_t *request, void *data);
#ifdef __cplusplus
}
#endif
#endif /* OGS_NNRF_PATH_H */

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
@@ -75,8 +75,6 @@
#include "model/sm_policy_notification.h"
#include "model/termination_notification.h"
#include "model/deregistration_data.h"
#include "model/sdm_subscription.h"
#include "model/modification_notification.h"
#include "custom/links.h"
#include "custom/ue_authentication_ctx.h"
@@ -101,7 +99,6 @@
#include "sbi/nnrf-build.h"
#include "sbi/nnrf-handler.h"
#include "sbi/nnrf-path.h"
#include "sbi/path.h"

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
@@ -19,351 +19,11 @@
#include "ogs-sbi.h"
static void build_default_discovery_parameter(
ogs_sbi_request_t *request,
ogs_sbi_service_type_e service_type,
ogs_sbi_discovery_option_t *discovery_option);
int ogs_sbi_server_handler(ogs_sbi_request_t *request, void *data)
{
ogs_event_t *e = NULL;
int rv;
ogs_assert(request);
ogs_assert(data);
e = ogs_event_new(OGS_EVENT_SBI_SERVER);
ogs_assert(e);
e->sbi.request = request;
e->sbi.data = data;
rv = ogs_queue_push(ogs_app()->queue, e);
if (rv != OGS_OK) {
ogs_error("ogs_queue_push() failed:%d", (int)rv);
ogs_sbi_request_free(request);
ogs_event_free(e);
return OGS_ERROR;
}
return OGS_OK;
}
int ogs_sbi_client_handler(
int status, ogs_sbi_response_t *response, void *data)
{
ogs_event_t *e = NULL;
int rv;
if (status != OGS_OK) {
ogs_log_message(
status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0,
"ogs_sbi_client_handler() failed [%d]", status);
return OGS_ERROR;
}
ogs_assert(response);
e = ogs_event_new(OGS_EVENT_SBI_CLIENT);
ogs_assert(e);
e->sbi.response = response;
e->sbi.data = data;
rv = ogs_queue_push(ogs_app()->queue, e);
if (rv != OGS_OK) {
ogs_error("ogs_queue_push() failed:%d", (int)rv);
ogs_sbi_response_free(response);
ogs_event_free(e);
return OGS_ERROR;
}
return OGS_OK;
}
static int client_discover_cb(
int status, ogs_sbi_response_t *response, void *data)
{
int rv;
ogs_event_t *e = NULL;
ogs_sbi_xact_t *xact = NULL;
ogs_sbi_object_t *sbi_object = NULL;
ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL;
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
ogs_hash_index_t *hi = NULL;
char *producer_id = NULL;
xact = data;
ogs_assert(xact);
xact = ogs_sbi_xact_cycle(xact);
if (!xact) {
ogs_error("SBI transaction has already been removed");
if (response)
ogs_sbi_response_free(response);
return OGS_ERROR;
}
sbi_object = xact->sbi_object;
ogs_assert(sbi_object);
service_type = xact->service_type;
ogs_assert(service_type);
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
requester_nf_type = xact->requester_nf_type;
ogs_assert(requester_nf_type);
if (status != OGS_OK) {
ogs_log_message(
status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0,
"ogs_sbi_client_handler() failed [%d]", status);
ogs_sbi_xact_remove(xact);
return OGS_ERROR;
}
ogs_assert(response);
/* Check if 3gpp-Sbi-Producer-Id in HTTP2 Header */
for (hi = ogs_hash_first(response->http.headers);
hi; hi = ogs_hash_next(hi)) {
if (!ogs_strcasecmp(ogs_hash_this_key(hi), OGS_SBI_CUSTOM_PRODUCER_ID)) {
producer_id = ogs_hash_this_val(hi);
break;
}
}
/* Added newly discovered NF Instance */
if (producer_id) {
ogs_sbi_nf_instance_t *nf_instance =
ogs_sbi_nf_instance_find(producer_id);
if (!nf_instance) {
nf_instance = ogs_sbi_nf_instance_add();
ogs_assert(nf_instance);
ogs_sbi_nf_instance_set_id(nf_instance, producer_id);
ogs_sbi_nf_instance_set_type(nf_instance, target_nf_type);
}
OGS_SBI_SETUP_NF_INSTANCE(
sbi_object->service_type_array[service_type], nf_instance);
}
e = ogs_event_new(OGS_EVENT_SBI_CLIENT);
ogs_assert(e);
e->sbi.response = response;
e->sbi.data = data;
rv = ogs_queue_push(ogs_app()->queue, e);
if (rv != OGS_OK) {
ogs_error("ogs_queue_push() failed:%d", (int)rv);
ogs_sbi_response_free(response);
ogs_event_free(e);
return OGS_ERROR;
}
return OGS_OK;
}
bool ogs_sbi_discover_and_send(ogs_sbi_xact_t *xact)
{
ogs_sbi_client_t *client = NULL, *scp_client = NULL;
ogs_sbi_nf_instance_t *nf_instance = NULL;
ogs_sbi_object_t *sbi_object = NULL;
ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL;
ogs_sbi_discovery_option_t *discovery_option = NULL;
ogs_sbi_request_t *request = NULL;
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
char *apiroot = NULL;
sbi_object = xact->sbi_object;
ogs_assert(sbi_object);
service_type = xact->service_type;
ogs_assert(service_type);
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
ogs_assert(target_nf_type);
requester_nf_type = xact->requester_nf_type;
ogs_assert(requester_nf_type);
request = xact->request;
ogs_assert(request);
discovery_option = xact->discovery_option;
/* SCP Availability */
if (ogs_sbi_self()->discovery_config.delegated ==
OGS_SBI_DISCOVERY_DELEGATED_AUTO) {
scp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance);
} else if (ogs_sbi_self()->discovery_config.delegated ==
OGS_SBI_DISCOVERY_DELEGATED_YES) {
scp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance);
ogs_assert(scp_client);
}
/* Target NF-Instance */
nf_instance = sbi_object->service_type_array[service_type].nf_instance;
if (!nf_instance) {
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
target_nf_type, requester_nf_type, discovery_option);
if (nf_instance)
OGS_SBI_SETUP_NF_INSTANCE(
sbi_object->service_type_array[service_type], nf_instance);
}
/* Target Client */
if (request->h.uri == NULL) {
if (nf_instance) {
client = ogs_sbi_client_find_by_service_name(nf_instance,
request->h.service.name, request->h.api.version);
}
} else {
ogs_sockaddr_t *addr = NULL;
addr = ogs_sbi_getaddr_from_uri(request->h.uri);
if (!addr) {
ogs_error("Invalid URL [%s]", request->h.uri);
return false;
}
client = ogs_sbi_client_find(addr);
ogs_freeaddrinfo(addr);
}
if (scp_client) {
/*************************
* INDIRECT COMMUNICATION
*************************/
build_default_discovery_parameter(
request, service_type, discovery_option);
if (client) {
/*
* If `client` instance is avaiable,
* 3gpp-Sbi-Target-apiRoot is added to HTTP header.
*/
apiroot = ogs_sbi_client_apiroot(client);
ogs_assert(apiroot);
ogs_sbi_header_set(request->http.headers,
OGS_SBI_CUSTOM_TARGET_APIROOT, apiroot);
ogs_free(apiroot);
ogs_expect_or_return_val(true ==
ogs_sbi_client_send_via_scp(
scp_client, ogs_sbi_client_handler, request, xact), false);
} else {
/*
* If no `client` instance,
*
* Discovery-*** is added to HTTP header.
*/
if (discovery_option &&
discovery_option->target_nf_instance_id) {
ogs_sbi_header_set(request->http.headers,
OGS_SBI_CUSTOM_DISCOVERY_TARGET_NF_INSTANCE_ID,
discovery_option->target_nf_instance_id);
} else if (nf_instance && nf_instance->id) {
ogs_sbi_header_set(request->http.headers,
OGS_SBI_CUSTOM_DISCOVERY_TARGET_NF_INSTANCE_ID,
nf_instance->id);
}
ogs_expect_or_return_val(true ==
ogs_sbi_client_send_via_scp(
scp_client, client_discover_cb, request, xact), false);
}
} else if (client) {
/***********************
* DIRECT COMMUNICATION
***********************/
/* If `client` instance is available, use direct communication */
ogs_expect_or_return_val(true ==
ogs_sbi_client_send_request(
client, ogs_sbi_client_handler, request, xact), false);
} else {
/**********************************************
* No SCP and Client, Use NRF for NF-Discovery
**********************************************/
return ogs_sbi_discover_only(xact);
}
return true;
}
bool ogs_sbi_discover_only(ogs_sbi_xact_t *xact)
{
ogs_sbi_nf_instance_t *nf_instance = NULL;
ogs_sbi_object_t *sbi_object = NULL;
ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL;
ogs_sbi_discovery_option_t *discovery_option = NULL;
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
sbi_object = xact->sbi_object;
ogs_assert(sbi_object);
service_type = xact->service_type;
ogs_assert(service_type);
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
ogs_assert(target_nf_type);
requester_nf_type = xact->requester_nf_type;
ogs_assert(requester_nf_type);
discovery_option = xact->discovery_option;
/* NRF NF-Instance */
nf_instance = sbi_object->nf_type_array[OpenAPI_nf_type_NRF].nf_instance;
if (!nf_instance) {
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
OpenAPI_nf_type_NRF, requester_nf_type, NULL);
if (nf_instance)
OGS_SBI_SETUP_NF_INSTANCE(
sbi_object->nf_type_array[OpenAPI_nf_type_NRF], nf_instance);
}
if (nf_instance) {
bool rc;
ogs_sbi_client_t *client = NULL;
ogs_sbi_request_t *request = NULL;
ogs_warn("Try to discover [%s]",
ogs_sbi_service_type_to_name(service_type));
client = NF_INSTANCE_CLIENT(nf_instance);
ogs_expect_or_return_val(client, false);
request = ogs_nnrf_disc_build_discover(
target_nf_type, requester_nf_type, discovery_option);
ogs_expect_or_return_val(request, false);
rc = ogs_sbi_client_send_request(
client, ogs_sbi_client_handler, request, xact);
ogs_expect(rc == true);
ogs_sbi_request_free(request);
return rc;
}
ogs_error("Cannot discover [%s]",
ogs_sbi_service_type_to_name(service_type));
return false;
}
bool ogs_sbi_send_request_to_nf_instance(
ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact)
bool ogs_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance,
ogs_sbi_client_cb_f client_cb, ogs_sbi_xact_t *xact)
{
ogs_sbi_request_t *request = NULL;
ogs_sbi_client_t *client = NULL;
ogs_sbi_object_t *sbi_object = NULL;
ogs_assert(xact);
@@ -407,119 +67,240 @@ bool ogs_sbi_send_request_to_nf_instance(
ogs_freeaddrinfo(addr);
}
/* ogs_sbi_xact_remove() will call ogs_sbi_request_free()
* As such, we'll use ogs_sbi_client_send_reqmem_persistent() */
ogs_expect_or_return_val(true ==
ogs_sbi_send_request_to_client(
client, ogs_sbi_client_handler, request, xact), false);
ogs_sbi_scp_send_reqmem_persistent(
client, client_cb, request, xact), false);
return true;
}
bool ogs_sbi_send_request_to_client(
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
ogs_sbi_request_t *request, void *data)
bool ogs_sbi_discover_only(
ogs_sbi_xact_t *xact, ogs_sbi_client_cb_f client_cb)
{
ogs_sbi_client_t *scp_client = NULL;
char *apiroot = NULL;
ogs_sbi_nf_instance_t *nf_instance = NULL;
/*
* If the HTTP2 Server's EndPoint is known,
* 3gpp-Sbi-Target-apiRoot should always be included in the HTTP2 Request.
*/
ogs_assert(client);
ogs_assert(request);
ogs_sbi_object_t *sbi_object = NULL;
ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL;
ogs_sbi_discovery_option_t *discovery_option = NULL;
scp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance);
if (scp_client && scp_client != client) {
/*************************
* INDIRECT COMMUNICATION
*************************/
/* Added 3gpp-Sbi-Target-apiRoot to HTTP header */
apiroot = ogs_sbi_client_apiroot(client);
ogs_assert(apiroot);
ogs_sbi_header_set(request->http.headers,
OGS_SBI_CUSTOM_TARGET_APIROOT, apiroot);
ogs_free(apiroot);
ogs_expect_or_return_val(true ==
ogs_sbi_client_send_via_scp(
scp_client, client_cb, request, data), false);
} else {
/***********************
* DIRECT COMMUNICATION
***********************/
/* Direct communication since `client' instance is always avaiable */
ogs_expect_or_return_val(true ==
ogs_sbi_client_send_request(
client, client_cb, request, data), false);
}
return true;
}
bool ogs_sbi_send_notification_request(
ogs_sbi_service_type_e service_type,
ogs_sbi_discovery_option_t *discovery_option,
ogs_sbi_request_t *request, void *data)
{
ogs_sbi_client_t *client = NULL, *scp_client = NULL;
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
sbi_object = xact->sbi_object;
ogs_assert(sbi_object);
service_type = xact->service_type;
ogs_assert(service_type);
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
ogs_assert(target_nf_type);
ogs_assert(request);
ogs_assert(client_cb);
scp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance);
if (target_nf_type == OpenAPI_nf_type_NRF)
client = NF_INSTANCE_CLIENT(ogs_sbi_self()->nrf_instance);
else {
ogs_fatal("Not implemented[%s]",
discovery_option = xact->discovery_option;
/* NRF NF-Instance */
nf_instance = sbi_object->nf_type_array[OpenAPI_nf_type_NRF].nf_instance;
if (!nf_instance) {
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
OpenAPI_nf_type_NRF, NULL);
if (nf_instance)
OGS_SBI_SETUP_NF_INSTANCE(
sbi_object->nf_type_array[OpenAPI_nf_type_NRF], nf_instance);
}
if (nf_instance) {
ogs_sbi_client_t *client = NULL;
ogs_sbi_request_t *request = NULL;
ogs_warn("Try to discover [%s]",
ogs_sbi_service_type_to_name(service_type));
request = ogs_nnrf_disc_build_discover(
target_nf_type, discovery_option);
ogs_expect_or_return_val(request, false);
client = nf_instance->client;
ogs_assert(client);
return ogs_sbi_client_send_request(client, client_cb, request, xact);
}
ogs_error("Cannot discover [%s]",
ogs_sbi_service_type_to_name(service_type));
ogs_assert_if_reached();
return false;
}
bool ogs_sbi_discover_and_send(
ogs_sbi_xact_t *xact, ogs_sbi_client_cb_f client_cb)
{
ogs_sbi_nf_instance_t *nf_instance = NULL;
ogs_sbi_object_t *sbi_object = NULL;
ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL;
ogs_sbi_discovery_option_t *discovery_option = NULL;
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
sbi_object = xact->sbi_object;
ogs_assert(sbi_object);
service_type = xact->service_type;
ogs_assert(service_type);
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
ogs_assert(target_nf_type);
ogs_assert(client_cb);
discovery_option = xact->discovery_option;
/* Target NF-Instance */
nf_instance = sbi_object->service_type_array[service_type].nf_instance;
if (!nf_instance) {
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
target_nf_type, discovery_option);
if (nf_instance)
OGS_SBI_SETUP_NF_INSTANCE(
sbi_object->service_type_array[service_type], nf_instance);
}
if (scp_client) {
/*************************
* INDIRECT COMMUNICATION
*************************/
build_default_discovery_parameter(
request, service_type, discovery_option);
ogs_expect_or_return_val(true ==
ogs_sbi_client_send_via_scp(
scp_client, ogs_sbi_client_handler, request, data), false);
} else if (client) {
/***********************
* DIRECT COMMUNICATION
***********************/
/* NRF is avaiable */
ogs_expect_or_return_val(true ==
ogs_sbi_client_send_request(
client, ogs_sbi_client_handler, request, data), false);
} else {
ogs_fatal("[%s:%s] Cannot send request [%s:%s:%s]",
client ? "CLIENT" : "No-CLIENT",
scp_client ? "SCP" : "No-SCP",
ogs_sbi_service_type_to_name(service_type),
request->h.service.name, request->h.api.version);
ogs_assert_if_reached();
if (nf_instance) {
return ogs_sbi_send_request(nf_instance, client_cb, xact);
}
return true;
return ogs_sbi_discover_only(xact, client_cb);
}
bool ogs_nnrf_nfm_send_nf_register(ogs_sbi_nf_instance_t *nf_instance)
{
ogs_sbi_request_t *request = NULL;
ogs_sbi_client_t *client = NULL;
ogs_assert(nf_instance);
client = nf_instance->client;
ogs_assert(client);
request = ogs_nnrf_nfm_build_register();
ogs_expect_or_return_val(request, false);
return ogs_sbi_scp_send_request(client, client->cb, request, nf_instance);
}
bool ogs_nnrf_nfm_send_nf_update(ogs_sbi_nf_instance_t *nf_instance)
{
ogs_sbi_request_t *request = NULL;
ogs_sbi_client_t *client = NULL;
ogs_assert(nf_instance);
client = nf_instance->client;
ogs_assert(client);
request = ogs_nnrf_nfm_build_update();
ogs_expect_or_return_val(request, false);
return ogs_sbi_scp_send_request(client, client->cb, request, nf_instance);
}
bool ogs_nnrf_nfm_send_nf_de_register(ogs_sbi_nf_instance_t *nf_instance)
{
ogs_sbi_request_t *request = NULL;
ogs_sbi_client_t *client = NULL;
ogs_assert(nf_instance);
client = nf_instance->client;
ogs_assert(client);
request = ogs_nnrf_nfm_build_de_register();
ogs_expect_or_return_val(request, false);
return ogs_sbi_scp_send_request(client, client->cb, request, nf_instance);
}
bool ogs_nnrf_nfm_send_nf_profile_retrieve(ogs_sbi_nf_instance_t *nf_instance,
char *nf_instance_id, void *data)
{
ogs_sbi_request_t *request = NULL;
ogs_sbi_client_t *client = NULL;
ogs_assert(nf_instance);
client = nf_instance->client;
ogs_assert(client);
ogs_assert(nf_instance_id);
request = ogs_nnrf_nfm_build_profile_retrieve(nf_instance_id);
ogs_expect_or_return_val(request, false);
return ogs_sbi_client_send_request(
client, client->cb, request, data);
}
bool ogs_nnrf_nfm_send_nf_status_subscribe(
ogs_sbi_client_t *client,
OpenAPI_nf_type_e req_nf_type, char *req_nf_instance_id,
OpenAPI_nf_type_e subscr_cond_nf_type,
char *subscr_cond_service_name)
{
ogs_sbi_request_t *request = NULL;
ogs_sbi_subscription_data_t *subscription_data = NULL;
ogs_assert(client);
subscription_data = ogs_sbi_subscription_data_add();
ogs_assert(subscription_data);
OGS_SBI_SETUP_CLIENT(subscription_data, client);
subscription_data->req_nf_type = req_nf_type;
if (req_nf_instance_id)
subscription_data->req_nf_instance_id = ogs_strdup(req_nf_instance_id);
subscription_data->subscr_cond.nf_type = subscr_cond_nf_type;
if (subscr_cond_service_name)
subscription_data->subscr_cond.service_name =
ogs_strdup(subscr_cond_service_name);
request = ogs_nnrf_nfm_build_status_subscribe(subscription_data);
if (!request) {
ogs_error("No request");
return false;
}
return ogs_sbi_scp_send_request(
client, client->cb, request, subscription_data);
}
bool ogs_nnrf_nfm_send_nf_status_unsubscribe(
ogs_sbi_subscription_data_t *subscription_data)
{
ogs_sbi_request_t *request = NULL;
ogs_sbi_client_t *client = NULL;
ogs_assert(subscription_data);
request = ogs_nnrf_nfm_build_status_unsubscribe(subscription_data);
ogs_expect_or_return_val(request, false);
client = subscription_data->client;
ogs_assert(client);
return ogs_sbi_scp_send_request(
client, client->cb, request, subscription_data);
}
bool ogs_nnrf_disc_send_nf_discover(
ogs_sbi_nf_instance_t *nf_instance,
OpenAPI_nf_type_e target_nf_type,
ogs_sbi_discovery_option_t *discovery_option,
void *data)
{
ogs_sbi_client_t *client = NULL;
ogs_sbi_request_t *request = NULL;
ogs_assert(nf_instance);
ogs_assert(target_nf_type);
request = ogs_nnrf_disc_build_discover(target_nf_type, discovery_option);
ogs_expect_or_return_val(request, false);
client = nf_instance->client;
ogs_assert(client);
return ogs_sbi_client_send_request(client, client->cb, request, data);
}
bool ogs_sbi_send_response(ogs_sbi_stream_t *stream, int status)
@@ -533,77 +314,5 @@ bool ogs_sbi_send_response(ogs_sbi_stream_t *stream, int status)
response = ogs_sbi_build_response(&sendmsg, status);
ogs_expect_or_return_val(response, false);
return ogs_sbi_server_send_response(stream, response);
}
static void build_default_discovery_parameter(
ogs_sbi_request_t *request,
ogs_sbi_service_type_e service_type,
ogs_sbi_discovery_option_t *discovery_option)
{
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
ogs_sbi_discovery_option_t *local_discovery_option = NULL;
ogs_assert(service_type);
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
ogs_assert(target_nf_type);
requester_nf_type = NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance);
ogs_assert(requester_nf_type);
/*
* Insert one service-name in the discovery option
* in the function below.
*
* - ogs_sbi_xact_add()
* - ogs_sbi_send_notification_request()
*/
if (!discovery_option) {
local_discovery_option = ogs_sbi_discovery_option_new();
ogs_assert(local_discovery_option);
discovery_option = local_discovery_option;
}
if (!discovery_option->num_of_service_names) {
ogs_sbi_discovery_option_add_service_names(
discovery_option,
(char *)ogs_sbi_service_type_to_name(service_type));
}
ogs_sbi_header_set(request->http.headers,
OGS_SBI_CUSTOM_DISCOVERY_TARGET_NF_TYPE,
OpenAPI_nf_type_ToString(target_nf_type));
/* Instead of Discovery-requester-nf-type,
* Open5GS uses User-Agent for requester-nf-type */
if (discovery_option) {
if (discovery_option->requester_nf_instance_id) {
ogs_sbi_header_set(request->http.headers,
OGS_SBI_CUSTOM_DISCOVERY_REQUESTER_NF_INSTANCE_ID,
discovery_option->requester_nf_instance_id);
}
if (ogs_sbi_self()->discovery_config.
no_service_names == false &&
discovery_option->num_of_service_names) {
/* send array items separated by a comma */
char *v = ogs_sbi_discovery_option_build_service_names(
discovery_option);
if (v) {
ogs_sbi_header_set(request->http.headers,
OGS_SBI_CUSTOM_DISCOVERY_SERVICE_NAMES, v);
ogs_free(v);
} else {
ogs_warn("invalid service names failed[%d:%s]",
discovery_option->num_of_service_names,
discovery_option->service_names[0]);
}
}
}
if (local_discovery_option)
ogs_sbi_discovery_option_free(local_discovery_option);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
@@ -26,22 +26,33 @@
extern "C" {
#endif
int ogs_sbi_server_handler(ogs_sbi_request_t *request, void *data);
int ogs_sbi_client_handler(
int status, ogs_sbi_response_t *response, void *data);
bool ogs_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance,
ogs_sbi_client_cb_f client_cb, ogs_sbi_xact_t *xact);
bool ogs_sbi_discover_only(
ogs_sbi_xact_t *xact, ogs_sbi_client_cb_f client_cb);
bool ogs_sbi_discover_and_send(
ogs_sbi_xact_t *xact, ogs_sbi_client_cb_f client_cb);
bool ogs_sbi_discover_and_send(ogs_sbi_xact_t *xact);
bool ogs_sbi_discover_only(ogs_sbi_xact_t *xact);
bool ogs_nnrf_nfm_send_nf_register(ogs_sbi_nf_instance_t *nf_instance);
bool ogs_nnrf_nfm_send_nf_update(ogs_sbi_nf_instance_t *nf_instance);
bool ogs_nnrf_nfm_send_nf_de_register(ogs_sbi_nf_instance_t *nf_instance);
bool ogs_nnrf_nfm_send_nf_profile_retrieve(ogs_sbi_nf_instance_t *nf_instance,
char *nf_instance_id, void *data);
bool ogs_sbi_send_request_to_nf_instance(
ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact);
bool ogs_sbi_send_request_to_client(
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
ogs_sbi_request_t *request, void *data);
bool ogs_sbi_send_notification_request(
ogs_sbi_service_type_e service_type,
bool ogs_nnrf_nfm_send_nf_status_subscribe(
ogs_sbi_client_t *client,
OpenAPI_nf_type_e req_nf_type, char *req_nf_instance_id,
OpenAPI_nf_type_e subscr_cond_nf_type,
char *subscr_cond_service_name);
bool ogs_nnrf_nfm_send_nf_status_unsubscribe(
ogs_sbi_subscription_data_t *subscription_data);
bool ogs_nnrf_disc_send_nf_discover(
ogs_sbi_nf_instance_t *nf_instance,
OpenAPI_nf_type_e target_nf_type,
ogs_sbi_discovery_option_t *discovery_option,
ogs_sbi_request_t *request, void *data);
void *data);
#define ogs_sbi_send_http_status_no_content(__sTREAM) \
ogs_sbi_send_response(__sTREAM, OGS_SBI_HTTP_STATUS_NO_CONTENT)

View File

@@ -16,7 +16,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
project('open5gs', 'c', 'cpp',
version : '2.5.8',
version : '2.4.14',
license : 'AGPL-3.0-or-later',
meson_version : '>= 0.43.0',
default_options : [
@@ -24,7 +24,7 @@ project('open5gs', 'c', 'cpp',
],
)
libogslib_version = '2.5.8'
libogslib_version = '2.4.14'
prefix = get_option('prefix')
bindir = join_paths(prefix, get_option('bindir'))

View File

@@ -38,8 +38,6 @@ else
ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255
ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255
ifconfig lo0 alias 127.0.1.10 netmask 255.255.255.255
ifconfig lo0 alias 127.0.1.11 netmask 255.255.255.255
ifconfig lo0 alias 127.0.1.12 netmask 255.255.255.255
if [ "$SYSTEM" = "Darwin" ]; then
if ! test -f /etc/pf.anchors/org.open5gs; then
sudo sh -c "echo 'nat on {en0} from 10.45.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs"

View File

@@ -129,7 +129,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e)
CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY)
SWITCH(sbi_message.h.method)
CASE(OGS_SBI_HTTP_METHOD_POST)
ogs_nnrf_nfm_handle_nf_status_notify(stream, &sbi_message);
ogs_nnrf_handle_nf_status_notify(stream, &sbi_message);
break;
DEFAULT
@@ -213,11 +213,6 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e)
amf_namf_callback_handle_dereg_notify(stream, &sbi_message);
break;
CASE(OGS_SBI_RESOURCE_NAME_SDMSUBSCRIPTION_NOTIFY)
amf_namf_callback_handle_sdm_data_change_notify(
stream, &sbi_message);
break;
CASE(OGS_SBI_RESOURCE_NAME_AM_POLICY_NOTIFY)
ogs_assert(true == ogs_sbi_send_http_status_no_content(stream));
break;
@@ -296,7 +291,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e)
CASE(OGS_SBI_HTTP_METHOD_POST)
if (sbi_message.res_status == OGS_SBI_HTTP_STATUS_CREATED ||
sbi_message.res_status == OGS_SBI_HTTP_STATUS_OK) {
ogs_nnrf_nfm_handle_nf_status_subscribe(
ogs_nnrf_handle_nf_status_subscribe(
subscription_data, &sbi_message);
} else {
ogs_error("[%s] HTTP response error [%d]",
@@ -580,6 +575,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e)
ogs_assert(true ==
ogs_nnrf_nfm_send_nf_status_subscribe(
subscription_data->client,
ogs_sbi_self()->nf_instance->nf_type,
subscription_data->req_nf_instance_id,
subscription_data->subscr_cond.nf_type,
@@ -804,15 +800,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e)
amf_ue = amf_ue_find_by_message(&nas_message);
if (!amf_ue) {
amf_ue = amf_ue_add(ran_ue);
if (amf_ue == NULL) {
ogs_expect(OGS_OK ==
ngap_send_ran_ue_context_release_command(ran_ue,
NGAP_Cause_PR_misc,
NGAP_CauseMisc_control_processing_overload,
NGAP_UE_CTX_REL_NG_CONTEXT_REMOVE, 0));
ogs_pkbuf_free(pkbuf);
return;
}
ogs_assert(amf_ue);
} else {
/* Here, if the AMF_UE Context is found,
* the integrity check is not performed

View File

@@ -60,7 +60,7 @@ void amf_context_init(void)
ogs_pool_init(&amf_ue_pool, ogs_app()->max.ue);
ogs_pool_init(&ran_ue_pool, ogs_app()->max.ue);
ogs_pool_init(&amf_sess_pool, ogs_app()->pool.sess);
ogs_pool_init(&self.m_tmsi, ogs_app()->max.ue*2);
ogs_pool_init(&self.m_tmsi, ogs_app()->max.ue);
ogs_list_init(&self.gnb_list);
ogs_list_init(&self.amf_ue_list);
@@ -1063,11 +1063,7 @@ ran_ue_t *ran_ue_add(amf_gnb_t *gnb, uint32_t ran_ue_ngap_id)
ogs_assert(gnb);
ogs_pool_alloc(&ran_ue_pool, &ran_ue);
if (ran_ue == NULL) {
ogs_error("Could not allocate ran_ue context from pool");
return NULL;
}
ogs_assert(ran_ue);
memset(ran_ue, 0, sizeof *ran_ue);
ran_ue->t_ng_holding = ogs_timer_add(
@@ -1261,11 +1257,7 @@ amf_ue_t *amf_ue_add(ran_ue_t *ran_ue)
ogs_assert(gnb);
ogs_pool_alloc(&amf_ue_pool, &amf_ue);
if (amf_ue == NULL) {
ogs_error("Could not allocate amf_ue context from pool");
return NULL;
}
ogs_assert(amf_ue);
memset(amf_ue, 0, sizeof *amf_ue);
/* Add All Timers */
@@ -1395,8 +1387,6 @@ void amf_ue_remove(amf_ue_t *amf_ue)
if (amf_ue->policy_association_id)
ogs_free(amf_ue->policy_association_id);
if (amf_ue->data_change_subscription_id)
ogs_free(amf_ue->data_change_subscription_id);
if (amf_ue->confirmation_url_for_5g_aka)
ogs_free(amf_ue->confirmation_url_for_5g_aka);
@@ -1922,7 +1912,6 @@ static bool check_smf_info(ogs_sbi_nf_info_t *nf_info, void *context);
void amf_sbi_select_nf(
ogs_sbi_object_t *sbi_object,
ogs_sbi_service_type_e service_type,
OpenAPI_nf_type_e requester_nf_type,
ogs_sbi_discovery_option_t *discovery_option)
{
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
@@ -1934,12 +1923,11 @@ void amf_sbi_select_nf(
ogs_assert(service_type);
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
ogs_assert(target_nf_type);
ogs_assert(requester_nf_type);
switch(sbi_object->type) {
case OGS_SBI_OBJ_UE_TYPE:
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
target_nf_type, requester_nf_type, discovery_option);
target_nf_type, discovery_option);
if (nf_instance)
OGS_SBI_SETUP_NF_INSTANCE(
sbi_object->service_type_array[service_type], nf_instance);
@@ -1950,9 +1938,7 @@ void amf_sbi_select_nf(
ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) {
if (ogs_sbi_discovery_param_is_matched(
nf_instance,
target_nf_type, requester_nf_type, discovery_option) ==
false)
nf_instance, target_nf_type, discovery_option) == false)
continue;
nf_info = ogs_sbi_nf_info_find(
@@ -2132,7 +2118,7 @@ int amf_m_tmsi_pool_generate()
int index = 0;
ogs_trace("M-TMSI Pool try to generate...");
for (i = 0; index < ogs_app()->max.ue*2; i++) {
for (i = 0; index < ogs_app()->max.ue; i++) {
amf_m_tmsi_t *m_tmsi = NULL;
int conflict = 0;

View File

@@ -397,9 +397,6 @@ struct amf_ue_s {
/* Network Initiated De-Registration */
bool network_initiated_de_reg;
/* SubscriptionId of Subscription to Data Change Notification to UDM */
char *data_change_subscription_id;
ogs_list_t sess_list;
};
@@ -745,7 +742,6 @@ amf_sess_t *amf_sess_cycle(amf_sess_t *sess);
void amf_sbi_select_nf(
ogs_sbi_object_t *sbi_object,
ogs_sbi_service_type_e service_type,
OpenAPI_nf_type_e requester_nf_type,
ogs_sbi_discovery_option_t *discovery_option);
#define AMF_SESSION_SYNC_DONE(__aMF, __sTATE) \

View File

@@ -83,8 +83,6 @@ typedef struct amf_event_s {
ogs_timer_t *timer;
} amf_event_t;
OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(amf_event_t));
amf_event_t *amf_event_new(int id);
const char *amf_event_get_name(amf_event_t *e);

View File

@@ -276,8 +276,7 @@ ogs_pkbuf_t *gmm_build_de_registration_accept(amf_ue_t *amf_ue)
return nas_5gs_security_encode(amf_ue, &message);
}
ogs_pkbuf_t *gmm_build_de_registration_request(amf_ue_t *amf_ue,
OpenAPI_deregistration_reason_e dereg_reason)
ogs_pkbuf_t *gmm_build_de_registration_request(amf_ue_t *amf_ue)
{
ogs_nas_5gs_message_t message;
ogs_nas_5gs_deregistration_request_to_ue_t *dereg_req =
@@ -296,16 +295,12 @@ ogs_pkbuf_t *gmm_build_de_registration_request(amf_ue_t *amf_ue,
message.gmm.h.message_type = OGS_NAS_5GS_DEREGISTRATION_REQUEST_TO_UE;
dereg_req->de_registration_type.switch_off = 1;
dereg_req->de_registration_type.re_registration_required =
dereg_reason == OpenAPI_deregistration_reason_REREGISTRATION_REQUIRED;
dereg_req->de_registration_type.re_registration_required = 0;
dereg_req->de_registration_type.access_type = OGS_ACCESS_TYPE_3GPP;
dereg_req->presencemask |=
OGS_NAS_5GS_DEREGISTRATION_REQUEST_TO_UE_5GMM_CAUSE_PRESENT;
dereg_req->gmm_cause =
(dereg_reason == OpenAPI_deregistration_reason_REREGISTRATION_REQUIRED
? OGS_5GMM_CAUSE_IMPLICITLY_DE_REGISTERED
: OGS_5GMM_CAUSE_5GS_SERVICES_NOT_ALLOWED);
dereg_req->gmm_cause = OGS_5GMM_CAUSE_5GS_SERVICES_NOT_ALLOWED;
return nas_5gs_security_encode(amf_ue, &message);
}

View File

@@ -34,8 +34,7 @@ ogs_pkbuf_t *gmm_build_service_reject(
amf_ue_t *amf_ue, ogs_nas_5gmm_cause_t gmm_cause);
ogs_pkbuf_t *gmm_build_de_registration_accept(amf_ue_t *amf_ue);
ogs_pkbuf_t *gmm_build_de_registration_request(amf_ue_t *amf_ue,
OpenAPI_deregistration_reason_e dereg_reason);
ogs_pkbuf_t *gmm_build_de_registration_request(amf_ue_t *amf_ue);
ogs_pkbuf_t *gmm_build_identity_request(amf_ue_t *amf_ue);
ogs_pkbuf_t *gmm_build_security_mode_command(amf_ue_t *amf_ue);

View File

@@ -1083,14 +1083,9 @@ int gmm_handle_ul_nas_transport(amf_ue_t *amf_ue,
nf_instance = sess->sbi.
service_type_array[service_type].nf_instance;
if (!nf_instance) {
OpenAPI_nf_type_e requester_nf_type =
NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance);
ogs_assert(requester_nf_type);
amf_sbi_select_nf(
&sess->sbi,
OGS_SBI_SERVICE_TYPE_NSMF_PDUSESSION,
requester_nf_type,
NULL);
nf_instance = sess->sbi.
service_type_array[service_type].nf_instance;

View File

@@ -109,8 +109,7 @@ void gmm_state_de_registered(ogs_fsm_t *s, amf_event_t *e)
} else {
amf_ue->t3522.retry_count++;
ogs_assert(OGS_OK ==
nas_5gs_send_de_registration_request(amf_ue,
OpenAPI_deregistration_reason_NULL));
nas_5gs_send_de_registration_request(amf_ue));
}
break;
@@ -200,7 +199,6 @@ void gmm_state_de_registered(ogs_fsm_t *s, amf_event_t *e)
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
CASE(OGS_SBI_RESOURCE_NAME_SMF_SELECT_DATA)
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)
CASE(OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS)
if ((sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) &&
(sbi_message->res_status != OGS_SBI_HTTP_STATUS_CREATED)) {
ogs_error("[%s] HTTP response error [%d]",
@@ -1139,7 +1137,6 @@ void gmm_state_initial_context_setup(ogs_fsm_t *s, amf_event_t *e)
SWITCH(sbi_message->h.resource.component[1])
CASE(OGS_SBI_RESOURCE_NAME_REGISTRATIONS)
if (sbi_message->res_status != OGS_SBI_HTTP_STATUS_CREATED &&
sbi_message->res_status != OGS_SBI_HTTP_STATUS_NO_CONTENT &&
sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) {
ogs_error("[%s] HTTP response error [%d]",
amf_ue->supi, sbi_message->res_status);
@@ -1179,9 +1176,7 @@ void gmm_state_initial_context_setup(ogs_fsm_t *s, amf_event_t *e)
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
CASE(OGS_SBI_RESOURCE_NAME_SMF_SELECT_DATA)
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)
CASE(OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS)
if ((sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) &&
(sbi_message->res_status != OGS_SBI_HTTP_STATUS_CREATED)) {
if (sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) {
ogs_error("[%s] HTTP response error [%d]",
amf_ue->supi, sbi_message->res_status);
ogs_assert(OGS_OK ==

View File

@@ -560,8 +560,7 @@ int amf_namf_callback_handle_dereg_notify(
amf_ue->network_initiated_de_reg = true;
ogs_assert(OGS_OK ==
nas_5gs_send_de_registration_request(amf_ue,
DeregistrationData->dereg_reason));
nas_5gs_send_de_registration_request(amf_ue));
amf_sbi_send_release_all_sessions(
amf_ue, AMF_RELEASE_SM_CONTEXT_NO_STATE);
@@ -596,114 +595,3 @@ cleanup:
return OGS_OK;
}
int amf_namf_callback_handle_sdm_data_change_notify(
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg)
{
int status = OGS_SBI_HTTP_STATUS_NO_CONTENT;
amf_ue_t *amf_ue = NULL;
ogs_sbi_message_t sendmsg;
ogs_sbi_response_t *response = NULL;
OpenAPI_modification_notification_t *ModificationNotification;
OpenAPI_lnode_t *node;
char *ueid = NULL;
char *res_name = NULL;
ogs_assert(stream);
ogs_assert(recvmsg);
ModificationNotification = recvmsg->ModificationNotification;
if (!ModificationNotification) {
status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
ogs_error("[%s] No ModificationNotification", amf_ue->supi);
goto cleanup;
}
OpenAPI_list_for_each(ModificationNotification->notify_items, node)
{
OpenAPI_notify_item_t *item = node->data;
char *saveptr = NULL;
ueid = ogs_sbi_parse_uri(item->resource_id, "/", &saveptr);
if (!ueid) {
status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
ogs_error("[%s] No UeId", item->resource_id);
goto cleanup;
}
amf_ue = amf_ue_find_by_supi(ueid);
if (!amf_ue) {
status = OGS_SBI_HTTP_STATUS_NOT_FOUND;
ogs_error("Cannot find SUPI [%s]", ueid);
goto cleanup;
}
res_name = ogs_sbi_parse_uri(NULL, "/", &saveptr);
if (!res_name) {
status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
ogs_error("[%s] No Resource Name", item->resource_id);
goto cleanup;
}
SWITCH(res_name)
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
OpenAPI_lnode_t *node_ci;
OpenAPI_list_for_each(item->changes, node_ci)
{
/*
OpenAPI_change_item_t *item_change = node_ci->data;
item_change->path;
item_change->from;
item_change->new_value;
item_change->orig_value;
*/
/*
switch (item_change->op) {
case OpenAPI_change_type_ADD:
break;
case OpenAPI_change_type_MOVE:
break;
case OpenAPI_change_type__REMOVE:
break;
case OpenAPI_change_type_REPLACE:
break;
default:
break;
}
*/
}
break;
DEFAULT
status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
ogs_error("Unknown Resource Name: [%s]", res_name);
goto cleanup;
END
ogs_free(ueid);
ogs_free(res_name);
ueid = NULL;
res_name = NULL;
}
cleanup:
if (ueid)
ogs_free(ueid);
if (res_name)
ogs_free(res_name);
memset(&sendmsg, 0, sizeof(sendmsg));
response = ogs_sbi_build_response(&sendmsg, status);
ogs_assert(response);
ogs_assert(true == ogs_sbi_server_send_response(stream, response));
return OGS_OK;
}

View File

@@ -32,8 +32,6 @@ int amf_namf_callback_handle_sm_context_status(
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg);
int amf_namf_callback_handle_dereg_notify(
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg);
int amf_namf_callback_handle_sdm_data_change_notify(
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg);
#ifdef __cplusplus
}

View File

@@ -285,8 +285,7 @@ int nas_5gs_send_de_registration_accept(amf_ue_t *amf_ue)
return rv;
}
int nas_5gs_send_de_registration_request(amf_ue_t *amf_ue,
OpenAPI_deregistration_reason_e dereg_reason)
int nas_5gs_send_de_registration_request(amf_ue_t *amf_ue)
{
int rv;
@@ -303,7 +302,7 @@ int nas_5gs_send_de_registration_request(amf_ue_t *amf_ue,
gmmbuf = amf_ue->t3522.pkbuf;
ogs_expect_or_return_val(gmmbuf, OGS_ERROR);
} else {
gmmbuf = gmm_build_de_registration_request(amf_ue, dereg_reason);
gmmbuf = gmm_build_de_registration_request(amf_ue);
ogs_expect_or_return_val(gmmbuf, OGS_ERROR);
}

View File

@@ -41,8 +41,7 @@ int nas_5gs_send_service_reject(
amf_ue_t *amf_ue, ogs_nas_5gmm_cause_t gmm_cause);
int nas_5gs_send_de_registration_accept(amf_ue_t *amf_ue);
int nas_5gs_send_de_registration_request(amf_ue_t *amf_ue,
OpenAPI_deregistration_reason_e dereg_reason);
int nas_5gs_send_de_registration_request(amf_ue_t *amf_ue);
int nas_5gs_send_identity_request(amf_ue_t *amf_ue);

View File

@@ -50,10 +50,7 @@ ogs_sbi_request_t *amf_nausf_auth_build_authenticate(
AuthenticationInfo.supi_or_suci = amf_ue->suci;
AuthenticationInfo.serving_network_name =
ogs_serving_network_name_from_plmn_id(&amf_ue->nr_tai.plmn_id);
if (!AuthenticationInfo.serving_network_name) {
ogs_error("No serving_network_name");
goto end;
}
ogs_expect_or_return_val(AuthenticationInfo.serving_network_name, NULL);
if (auts) {
memset(&ResynchronizationInfo, 0, sizeof(ResynchronizationInfo));
@@ -73,9 +70,7 @@ ogs_sbi_request_t *amf_nausf_auth_build_authenticate(
request = ogs_sbi_build_request(&message);
ogs_expect(request);
end:
if (AuthenticationInfo.serving_network_name)
ogs_free(AuthenticationInfo.serving_network_name);
ogs_free(AuthenticationInfo.serving_network_name);
return request;
}
@@ -98,10 +93,7 @@ ogs_sbi_request_t *amf_nausf_auth_build_authenticate_confirmation(
message.h.uri = amf_ue->confirmation_url_for_5g_aka;
ConfirmationData = ogs_calloc(1, sizeof(*ConfirmationData));
if (!ConfirmationData) {
ogs_error("No ConfirmationData");
goto end;
}
ogs_expect_or_return_val(ConfirmationData, NULL);
ogs_hex_to_ascii(amf_ue->xres_star, sizeof(amf_ue->xres_star),
xres_star_string, sizeof(xres_star_string));
@@ -113,9 +105,7 @@ ogs_sbi_request_t *amf_nausf_auth_build_authenticate_confirmation(
request = ogs_sbi_build_request(&message);
ogs_expect(request);
end:
if (ConfirmationData)
ogs_free(ConfirmationData);
ogs_free(ConfirmationData);
return request;
}

View File

@@ -398,13 +398,7 @@ void ngap_handle_initial_ue_message(amf_gnb_t *gnb, ogs_ngap_message_t *message)
ran_ue = ran_ue_find_by_ran_ue_ngap_id(gnb, *RAN_UE_NGAP_ID);
if (!ran_ue) {
ran_ue = ran_ue_add(gnb, *RAN_UE_NGAP_ID);
if (ran_ue == NULL) {
ogs_assert(OGS_OK ==
ngap_send_error_indication(gnb, NULL, NULL,
NGAP_Cause_PR_misc,
NGAP_CauseMisc_control_processing_overload));
return;
}
ogs_assert(ran_ue);
/* Find AMF_UE if 5G-S_TMSI included */
if (FiveG_S_TMSI) {
@@ -2775,12 +2769,7 @@ void ngap_handle_handover_required(
/* Target UE */
target_ue = ran_ue_add(target_gnb, INVALID_UE_NGAP_ID);
if (target_ue == NULL) {
ogs_assert(OGS_OK ==
ngap_send_error_indication2(amf_ue, NGAP_Cause_PR_misc,
NGAP_CauseMisc_control_processing_overload));
return;
}
ogs_assert(target_ue);
/* Source UE - Target UE associated */
source_ue_associate_target_ue(source_ue, target_ue);

Some files were not shown because too many files have changed in this diff Show More