Projects
osmocom:latest
open5gs
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 5
View file
open5gs_2.4.11.tar.xz/docs/_docs/guide/03-splitting-network-functions.md
Deleted
@@ -1,372 +0,0 @@ ---- -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:
View file
open5gs_2.4.11.tar.xz/src/scp/nnrf-handler.c
Deleted
@@ -1,65 +0,0 @@ -/* - * Copyright (C) 2019-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 "sbi-path.h" -#include "nnrf-handler.h" - -void scp_nnrf_handle_nf_discover( - ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg) -{ - 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_search_result_t *SearchResult = NULL; - - ogs_assert(recvmsg); - ogs_assert(xact); - 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); - - discovery_option = xact->discovery_option; - - SearchResult = recvmsg->SearchResult; - if (!SearchResult) { - ogs_error("No SearchResult"); - return; - } - - ogs_nnrf_handle_nf_discover_search_result(SearchResult); - - nf_instance = ogs_sbi_nf_instance_find_by_discovery_param( - target_nf_type, discovery_option); - if (!nf_instance) { - ogs_error("(NF discover) No %s", - ogs_sbi_service_type_to_name(service_type)); - return; - } - - OGS_SBI_SETUP_NF_INSTANCE( - sbi_object->service_type_arrayservice_type, nf_instance); - - ogs_expect(true == scp_sbi_send_request(nf_instance, xact)); -}
View file
open5gs_2.4.11.tar.xz/src/scp/nnrf-handler.h
Deleted
@@ -1,36 +0,0 @@ -/* - * Copyright (C) 2019-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 SCP_NNRF_HANDLER_H -#define SCP_NNRF_HANDLER_H - -#include "context.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void scp_nnrf_handle_nf_discover( - ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg); - -#ifdef __cplusplus -} -#endif - -#endif /* SCP_NNRF_HANDLER_H */
View file
open5gs_2.4.11.tar.xz/src/scp/nscp-handler.c
Deleted
@@ -1,27 +0,0 @@ -/* - * Copyright (C) 2019-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 "sbi-path.h" -#include "nscp-handler.h" - -bool scp_nscp_management_handle_pcf_binding( - scp_conn_t *conn, ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg) -{ - return true; -}
View file
open5gs_2.4.11.tar.xz/src/scp/nscp-handler.h
Deleted
@@ -1,36 +0,0 @@ -/* - * Copyright (C) 2019-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 SCP_NSCP_HANDLER_H -#define SCP_NSCP_HANDLER_H - -#include "context.h" - -#ifdef __cplusplus -extern "C" { -#endif - -bool scp_nscp_management_handle_pcf_binding( - scp_conn_t *conn, ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg); - -#ifdef __cplusplus -} -#endif - -#endif /* SCP_NSCP_HANDLER_H */
View file
open5gs_2.4.11.dsc -> open5gs_2.5.0.dsc
Changed
@@ -1,8 +1,8 @@ Format: 3.0 (native) Source: open5gs -Binary: open5gs-common, open5gs-mme, open5gs-sgwc, open5gs-smf, open5gs-amf, open5gs-sgwu, open5gs-upf, open5gs-hss, open5gs-pcrf, open5gs-nrf, open5gs-ausf, open5gs-udm, open5gs-pcf, open5gs-nssf, open5gs-bsf, open5gs-udr, open5gs, open5gs-dbg +Binary: open5gs-common, open5gs-mme, open5gs-sgwc, open5gs-smf, open5gs-amf, open5gs-sgwu, open5gs-upf, open5gs-hss, open5gs-pcrf, open5gs-nrf, open5gs-scp, open5gs-ausf, open5gs-udm, open5gs-pcf, open5gs-nssf, open5gs-bsf, open5gs-udr, open5gs, open5gs-dbg Architecture: any -Version: 2.4.11 +Version: 2.5.0 Maintainer: Harald Welte <laforge@gnumonks.org> Uploaders: Sukchan Lee <acetcom@gmail.com> Homepage: https://open5gs.org @@ -23,6 +23,7 @@ open5gs-nssf deb net optional arch=any open5gs-pcf deb net optional arch=any open5gs-pcrf deb net optional arch=any + open5gs-scp deb net optional arch=any open5gs-sgwc deb net optional arch=any open5gs-sgwu deb net optional arch=any open5gs-smf deb net optional arch=any @@ -30,8 +31,8 @@ open5gs-udr deb net optional arch=any open5gs-upf deb net optional arch=any Checksums-Sha1: - 025adfa9aa77acd9427c62d403010c22ba7564bf 11467980 open5gs_2.4.11.tar.xz + 353601ab80fdfaa7ba7be678b3ad2f488e17d183 11505588 open5gs_2.5.0.tar.xz Checksums-Sha256: - f882f44b40969661e0d37b273104da6beac564990a2402d0fd742f806611d649 11467980 open5gs_2.4.11.tar.xz + 9ac45f2ea81ec312aded1e2965a2c82f48b80cd171d9b28f4e34def8bf989c42 11505588 open5gs_2.5.0.tar.xz Files: - d1e47814afea5b780b3825c5efadf83b 11467980 open5gs_2.4.11.tar.xz + 2b75dbf387ceb7be5b709adde0f19d09 11505588 open5gs_2.5.0.tar.xz
View file
open5gs_2.4.11.tar.xz/.tarball-version -> open5gs_2.5.0.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -2.4.11 +2.5.0
View file
open5gs_2.4.11.tar.xz/README.md -> open5gs_2.5.0.tar.xz/README.md
Changed
@@ -2,7 +2,7 @@ ## Getting Started -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. +Please follow the documentation(https://open5gs.org/open5gs/docs/) at open5gs.org(https://open5gs.org/)! ## Sponsors
View file
open5gs_2.4.11.tar.xz/configs/310014.yaml.in -> open5gs_2.5.0.tar.xz/configs/310014.yaml.in
Changed
@@ -221,7 +221,7 @@ - addr: 127.0.0.14 port: 7777 nsi: - - addr: ::1 + - addr: 127.0.0.10 port: 7777 s_nssai: sst: 1
View file
open5gs_2.4.11.tar.xz/configs/csfb.yaml.in -> open5gs_2.5.0.tar.xz/configs/csfb.yaml.in
Changed
@@ -250,7 +250,7 @@ - addr: 127.0.0.14 port: 7777 nsi: - - addr: ::1 + - addr: 127.0.0.10 port: 7777 s_nssai: sst: 1
View file
open5gs_2.4.11.tar.xz/configs/non3gpp.yaml.in -> open5gs_2.5.0.tar.xz/configs/non3gpp.yaml.in
Changed
@@ -220,7 +220,7 @@ - addr: 127.0.0.14 port: 7777 nsi: - - addr: ::1 + - addr: 127.0.0.10 port: 7777 s_nssai: sst: 1
View file
open5gs_2.4.11.tar.xz/configs/open5gs/amf.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/amf.yaml.in
Changed
@@ -20,6 +20,7 @@ # logger: file: @localstatedir@/log/open5gs/amf.log + # # amf: # @@ -118,6 +119,29 @@ # '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) @@ -299,6 +323,50 @@ 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: # # <SBI Client>> @@ -336,12 +404,12 @@ # 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
open5gs_2.4.11.tar.xz/configs/open5gs/ausf.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/ausf.yaml.in
Changed
@@ -20,6 +20,7 @@ # logger: file: @localstatedir@/log/open5gs/ausf.log + # # ausf: # @@ -118,12 +119,79 @@ # '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: # # <SBI Client>> @@ -161,12 +229,12 @@ # 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
open5gs_2.4.11.tar.xz/configs/open5gs/bsf.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/bsf.yaml.in
Changed
@@ -22,6 +22,7 @@ # logger: file: @localstatedir@/log/open5gs/bsf.log + # # bsf: # @@ -120,12 +121,79 @@ # '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: # # <SBI Client>> @@ -163,12 +231,12 @@ # 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
open5gs_2.4.11.tar.xz/configs/open5gs/nrf.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/nrf.yaml.in
Changed
@@ -93,6 +93,50 @@ 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: # # o Disable use of IPv4 addresses (only IPv6)
View file
open5gs_2.4.11.tar.xz/configs/open5gs/nssf.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/nssf.yaml.in
Changed
@@ -20,6 +20,7 @@ # logger: file: @localstatedir@/log/open5gs/nssf.log + # # nssf: # @@ -168,17 +169,84 @@ # '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: ::1 + - addr: 127.0.0.10 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: # # <SBI Client>> @@ -204,12 +272,12 @@ # - 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
open5gs_2.4.11.tar.xz/configs/open5gs/pcf.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/pcf.yaml.in
Changed
@@ -22,6 +22,7 @@ # logger: file: @localstatedir@/log/open5gs/pcf.log + # # pcf: # @@ -127,12 +128,79 @@ # '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: # # <SBI Client>> @@ -170,12 +238,12 @@ # 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
open5gs_2.4.11.tar.xz/configs/open5gs/scp.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/scp.yaml.in
Changed
@@ -88,19 +88,10 @@ # 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 @@ -108,7 +99,6 @@ # - 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 @@ -127,6 +117,45 @@ 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: # # <SBI Client>>
View file
open5gs_2.4.11.tar.xz/configs/open5gs/smf.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/smf.yaml.in
Changed
@@ -20,6 +20,7 @@ # logger: file: @localstatedir@/log/open5gs/smf.log + # # smf: # @@ -118,6 +119,29 @@ # '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> # @@ -447,6 +471,50 @@ 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: # # <SBI Client>> @@ -484,12 +552,12 @@ # 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
open5gs_2.4.11.tar.xz/configs/open5gs/udm.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/udm.yaml.in
Changed
@@ -20,6 +20,7 @@ # logger: file: @localstatedir@/log/open5gs/udm.log + # # udm: # @@ -120,12 +121,79 @@ # '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: # # <SBI Client>> @@ -163,12 +231,12 @@ # 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
open5gs_2.4.11.tar.xz/configs/open5gs/udr.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/udr.yaml.in
Changed
@@ -22,6 +22,7 @@ # logger: file: @localstatedir@/log/open5gs/udr.log + # # udr: # @@ -120,12 +121,79 @@ # '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: # # <SBI Client>> @@ -163,12 +231,12 @@ # 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
open5gs_2.4.11.tar.xz/configs/sample.yaml.in -> open5gs_2.5.0.tar.xz/configs/sample.yaml.in
Changed
@@ -285,7 +285,7 @@ - addr: 127.0.0.14 port: 7777 nsi: - - addr: ::1 + - addr: 127.0.0.10 port: 7777 s_nssai: sst: 1
View file
open5gs_2.4.11.tar.xz/configs/srslte.yaml.in -> open5gs_2.5.0.tar.xz/configs/srslte.yaml.in
Changed
@@ -216,7 +216,7 @@ - addr: 127.0.0.14 port: 7777 nsi: - - addr: ::1 + - addr: 127.0.0.10 port: 7777 s_nssai: sst: 1
View file
open5gs_2.4.11.tar.xz/configs/systemd/meson.build -> open5gs_2.5.0.tar.xz/configs/systemd/meson.build
Changed
@@ -25,6 +25,7 @@ open5gs-hssd.service open5gs-pcrfd.service open5gs-nrfd.service + open5gs-scpd.service open5gs-ausfd.service open5gs-udmd.service open5gs-pcfd.service
View file
open5gs_2.5.0.tar.xz/configs/systemd/open5gs-scpd.service.in
Added
@@ -0,0 +1,18 @@ +Unit +Description=Open5GS NRF Daemon +Wants=mongodb.service mongod.service + +Service +Type=simple + +User=open5gs +Group=open5gs + +Restart=always +ExecStart=@bindir@/open5gs-nrfd -c @sysconfdir@/open5gs/nrf.yaml +RestartSec=2 +RestartPreventExitStatus=1 +ExecReload=/bin/kill -HUP $MAINPID + +Install +WantedBy=multi-user.target
View file
open5gs_2.4.11.tar.xz/configs/volte.yaml.in -> open5gs_2.5.0.tar.xz/configs/volte.yaml.in
Changed
@@ -223,7 +223,7 @@ - addr: 127.0.0.14 port: 7777 nsi: - - addr: ::1 + - addr: 127.0.0.10 port: 7777 s_nssai: sst: 1
View file
open5gs_2.4.11.tar.xz/configs/vonr.yaml.in -> open5gs_2.5.0.tar.xz/configs/vonr.yaml.in
Changed
@@ -226,7 +226,7 @@ - addr: 127.0.0.14 port: 7777 nsi: - - addr: ::1 + - addr: 127.0.0.10 port: 7777 s_nssai: sst: 1
View file
open5gs_2.4.11.tar.xz/debian/changelog -> open5gs_2.5.0.tar.xz/debian/changelog
Changed
@@ -1,3 +1,33 @@ +open5gs (2.5.0) unstable; urgency=medium + + * New NF - SCP(Service Communication Proxy) + + -- Sukchan Lee <acetcom@gmail.com> Tue, 25 Oct 2022 22:46:32 +0900 + +open5gs (2.5.0~kinetic2) kinetic; urgency=medium + + * New NF - SCP(Service Communication Proxy) + + -- Sukchan Lee <acetcom@gmail.com> Tue, 25 Oct 2022 22:45:05 +0900 + +open5gs (2.5.0~jammy2) jammy; urgency=medium + + * New NF - SCP(Service Communication Proxy) + + -- Sukchan Lee <acetcom@gmail.com> Tue, 25 Oct 2022 22:43:33 +0900 + +open5gs (2.5.0~focal2) focal; urgency=medium + + * New NF - SCP(Service Communication Proxy) + + -- Sukchan Lee <acetcom@gmail.com> Tue, 25 Oct 2022 22:41:49 +0900 + +open5gs (2.5.0~bionic2) bionic; urgency=medium + + * New NF - SCP(Service Communication Proxy) + + -- Sukchan Lee <acetcom@gmail.com> Tue, 25 Oct 2022 22:40:16 +0900 + open5gs (2.4.11) unstable; urgency=medium * Bug Fixed
View file
open5gs_2.4.11.tar.xz/debian/control -> open5gs_2.5.0.tar.xz/debian/control
Changed
@@ -165,6 +165,18 @@ . 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
View file
open5gs_2.4.11.tar.xz/debian/open5gs-common.install -> open5gs_2.5.0.tar.xz/debian/open5gs-common.install
Changed
@@ -3,4 +3,3 @@ usr/lib/*/freeDiameter/*.fdx configs/freeDiameter/cacert.pem /etc/freeDiameter configs/logrotate/open5gs /etc/logrotate.d -misc/db/open5gs-dbctl /usr/bin
View file
open5gs_2.5.0.tar.xz/debian/open5gs-scp.install
Added
@@ -0,0 +1,3 @@ +usr/bin/open5gs-scpd +configs/open5gs/scp.yaml etc/open5gs +configs/systemd/open5gs-scpd.service lib/systemd/system
View file
open5gs_2.4.11.tar.xz/docker/README.md -> open5gs_2.5.0.tar.xz/docker/README.md
Changed
@@ -104,6 +104,15 @@ $ ./misc/git-version-gen . > .tarball-version 2>/dev/null ``` +* WebUI Version Change + + ``` + $ cat ./docker/webui/Dockerfile + $ cat ./webui/package.json + $ cat ./webui/package-lock.json + $ cat ./docs/assets/webui/install + ``` + * Upload OpenBuildService ```
View file
open5gs_2.4.11.tar.xz/docker/webui/Dockerfile -> open5gs_2.5.0.tar.xz/docker/webui/Dockerfile
Changed
@@ -3,7 +3,7 @@ MAINTAINER Sukchan Lee <acetcom@gmail.com> ARG PACKAGE=open5gs -ARG VERSION=2.2.6 +ARG VERSION=2.5.0 RUN set -e; \ cd /usr/src; \
View file
open5gs_2.4.11.tar.xz/docs/_docs/guide/01-quickstart.md -> open5gs_2.5.0.tar.xz/docs/_docs/guide/01-quickstart.md
Changed
@@ -44,18 +44,19 @@ #### 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. Finally there is the PCF, used for charging and enforcing subscriber policies. +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 **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. @@ -70,14 +71,36 @@ **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 @@ -90,13 +113,9 @@ ```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 ``` @@ -115,16 +134,6 @@ 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: @@ -153,6 +162,15 @@ 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 --- @@ -167,7 +185,7 @@ ```bash $ sudo apt update $ sudo apt install curl - $ curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - + $ curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - $ sudo apt install nodejs ``` @@ -220,6 +238,7 @@ 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 @@ -239,45 +258,49 @@ ```diff $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml - - mme: - freeDiameter: /etc/freeDiameter/mme.conf +--- 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: s1ap: -- addr: 127.0.0.2 -+ addr: 10.10.0.2 # for external eNB - a local address that can be reached by the eNB + - addr: 127.0.0.2 gtpc: +- - addr: 127.0.0.2 ++ - addr: 10.10.0.2 + metrics: addr: 127.0.0.2 + port: 9090 gummei: plmn_id: - mcc: 999 - mnc: 70 -+ mcc: 001 # set your PLMN-MCC -+ mnc: 01 # set your PLMN-MNC ++ mcc: 001 ++ mnc: 01 mme_gid: 2 mme_code: 1 tai: plmn_id: - mcc: 999 - mnc: 70 -- tac: 1 -+ mcc: 001 # set your PLMN-MCC -+ mnc: 01 # set your PLMN-MNC -+ tac: 2 # should match the TAC used by your eNB ++ mcc: 001 ++ mnc: 01 + tac: 1 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: - gtpu: -- 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 - +- - addr: 127.0.0.6 ++ - addr: 10.11.0.6 + gtpu: + - addr: 127.0.0.6 ``` After changing config files, please restart Open5GS daemons. @@ -298,20 +321,23 @@ ```diff $ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml - -amf: - sbi:
View file
open5gs_2.4.11.tar.xz/docs/_docs/guide/02-building-open5gs-from-sources.md -> open5gs_2.5.0.tar.xz/docs/_docs/guide/02-building-open5gs-from-sources.md
Changed
@@ -13,15 +13,29 @@ ### Getting MongoDB --- -Install MongoDB with package manager. It is used as database for NRF/PCF/UDR and PCRF/HSS. +Import the public key used by the package management system. ```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 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) +$ 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) ``` +**Tip:** MongoDB is used as database for NRF/PCF/UDR and PCRF/HSS. +{: .notice--info} + ### Setting up TUN device (not persistent after rebooting) --- @@ -99,12 +113,15 @@ $ 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 -@@ -165,23 +165,23 @@ +@@ -293,26 +293,26 @@ amf: - 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 @@ -118,10 +135,9 @@ - plmn_id: - mcc: 999 - mnc: 70 -- tac: 1 + mcc: 001 + mnc: 01 -+ tac: 2 + tac: 1 plmn_support: - plmn_id: - mcc: 999 @@ -138,13 +154,11 @@ $ 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 -@@ -137,9 +137,7 @@ +@@ -168,7 +168,7 @@ upf: pfcp: - addr: 127.0.0.7 gtpu: -- - addr: -- - 127.0.0.7 -- - ::1 +- - addr: 127.0.0.7 + - addr: 10.11.0.7 subnet: - addr: 10.45.0.1/16 @@ -158,14 +172,15 @@ $ 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 -@@ -204,20 +204,20 @@ - mme: - freeDiameter: /home/acetcom/Documents/git/open5gs/install/etc/freeDiameter/mme.conf +@@ -253,20 +253,20 @@ mme: s1ap: -- addr: 127.0.0.2 -+ addr: 10.10.0.2 + - addr: 127.0.0.2 gtpc: +- - addr: 127.0.0.2 ++ - addr: 10.10.0.2 + metrics: addr: 127.0.0.2 + port: 9090 gummei: plmn_id: - mcc: 999 @@ -178,13 +193,11 @@ plmn_id: - mcc: 999 - mnc: 70 -- tac: 1 + mcc: 001 + mnc: 01 -+ tac: 2 + tac: 1 security: - integrity_order : EIA1, EIA2, EIA0 - ciphering_order : EEA0, EEA1, EEA2 + integrity_order : EIA2, EIA1, EIA0 ``` 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. @@ -192,15 +205,14 @@ $ 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 -@@ -51,7 +51,7 @@ +@@ -98,7 +98,7 @@ logger: # sgwu: - gtpu: -- addr: 127.0.0.6 -+ addr: 10.11.0.6 pfcp: - addr: 127.0.0.6 - +- - addr: 127.0.0.6 ++ - addr: 10.11.0.6 + gtpu: + - addr: 127.0.0.6 ``` If you modify the config files while Open5GS daemons are running, please restart them @@ -210,140 +222,164 @@ --- ```bash -$ ./install/bin/open5gs-mmed -Open5GS daemon v2.1.0 +$ ./install/bin/open5gs-nrfd +Open5GS daemon v2.4.11-100-gbea24d7 -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) +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-sgwcd -Open5GS daemon v2.1.0 +$ ./install/bin/open5gs-amfd +Open5GS daemon v2.4.11-100-gbea24d7 -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) +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.1.0 +Open5GS daemon v2.4.11-100-gbea24d7 -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) +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)
View file
open5gs_2.4.11.tar.xz/docs/_docs/platform/02-centos.md -> open5gs_2.5.0.tar.xz/docs/_docs/platform/02-centos.md
Changed
@@ -328,9 +328,10 @@ $ ninja install $ cd ../ $ ls install/bin -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 +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 ``` ## Building WebUI of Open5GS @@ -347,7 +348,7 @@ ```bash $ cd ~/open5gs $ cd webui -$ npm ci --no-optional +$ npm ci ``` The WebUI runs as an npm(https://www.npmjs.com/) script.
View file
open5gs_2.4.11.tar.xz/docs/_docs/platform/03-fedora.md -> open5gs_2.5.0.tar.xz/docs/_docs/platform/03-fedora.md
Changed
@@ -127,7 +127,7 @@ ```bash $ cd webui -$ npm ci --no-optional +$ npm ci ``` The WebUI runs as an npm(https://www.npmjs.com/) script.
View file
open5gs_2.4.11.tar.xz/docs/_docs/platform/05-macosx-apple-silicon.md -> open5gs_2.5.0.tar.xz/docs/_docs/platform/05-macosx-apple-silicon.md
Changed
@@ -164,7 +164,7 @@ ```bash $ cd webui -$ npm ci --no-optional +$ npm ci ``` The WebUI runs as an npm(https://www.npmjs.com/) script.
View file
open5gs_2.4.11.tar.xz/docs/_docs/platform/06-macosx-intel.md -> open5gs_2.5.0.tar.xz/docs/_docs/platform/06-macosx-intel.md
Changed
@@ -162,7 +162,7 @@ ```bash $ cd webui -$ npm ci --no-optional +$ npm ci ``` The WebUI runs as an npm(https://www.npmjs.com/) script.
View file
open5gs_2.4.11.tar.xz/docs/_docs/platform/07-freebsd.md -> open5gs_2.5.0.tar.xz/docs/_docs/platform/07-freebsd.md
Changed
@@ -207,7 +207,7 @@ ```bash $ cd webui -$ npm ci --no-optional +$ npm ci ``` The WebUI runs as an npm(https://www.npmjs.com/) script.
View file
open5gs_2.4.11.tar.xz/docs/_docs/platform/08-alpine.md -> open5gs_2.5.0.tar.xz/docs/_docs/platform/08-alpine.md
Changed
@@ -105,7 +105,7 @@ ```bash $ cd webui -$ npm ci --no-optional +$ npm ci ``` The WebUI runs as an npm(https://www.npmjs.com/) script.
View file
open5gs_2.4.11.tar.xz/docs/_docs/troubleshoot/01-simple-issues.md -> open5gs_2.5.0.tar.xz/docs/_docs/troubleshoot/01-simple-issues.md
Changed
@@ -21,6 +21,7 @@ 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 @@ -29,7 +30,7 @@ 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, 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, SCP, AUSF, UDM, PCF, NSSF, BSF & UDR are all running. If your instance doesn't show this make sure you're started each service: ```bash @@ -42,6 +43,7 @@ $ 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 @@ -55,14 +57,15 @@ 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 /var/log/open5gs/mme.log -Open5GS daemon v1.0.0 +$ cat a.log +Open5GS daemon v2.4.11-100-gbea24d7 -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) +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) ``` Or, you can use `journalctl` like below to view live log. @@ -181,11 +184,11 @@ @@ -20,6 +20,7 @@ # logger: - file: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/amf.log + file: @localstatedir@/log/open5gs/amf.log + level: debug + # # amf: - # ``` After changing conf files, please restart Open5GS daemons.
View file
open5gs_2.4.11.tar.xz/docs/_docs/troubleshoot/02-now-in-github-issues.md -> open5gs_2.5.0.tar.xz/docs/_docs/troubleshoot/02-now-in-github-issues.md
Changed
@@ -92,7 +92,7 @@ At this time, you need to check the DB schema is in the form below by using the command the below. ``` -$ mongo +$ mongosh > use open5gs > db.subscribers.find().pretty() { @@ -159,7 +159,7 @@ If you see below, you are using the old format DB schema. ``` -$ mongo +$ mongosh > use open5gs > db.subscribers.find().pretty() { @@ -207,7 +207,7 @@ 1. First of all, it is recommended to use the following command to remove all existing subscription DB. ``` -$ mongo +$ mongosh > use open5gs switched to db open5gs > db.subscribers.drop() @@ -221,7 +221,7 @@ 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: ``` -$ mongo +$ mongosh > use open5gs > db.subscribers.find().pretty() { @@ -256,7 +256,7 @@ To restart the test program, first remove all subscriber information using MongoDB Client ``` -$ mongo +$ mongosh > use open5gs switched to db open5gs > db.subscribers.find() ### Check the test subscriber @@ -276,6 +276,7 @@ $ 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 @@ -312,7 +313,7 @@ index 7e939e81..dfe4456d 100644 --- a/configs/open5gs/amf.yaml.in +++ b/configs/open5gs/amf.yaml.in -@@ -199,6 +199,12 @@ amf: +@@ -315,6 +315,12 @@ amf: mnc: 70 s_nssai: - sst: 1 @@ -332,9 +333,9 @@ index d45aa60f..701ee533 100644 --- a/configs/open5gs/smf.yaml.in +++ b/configs/open5gs/smf.yaml.in -@@ -317,6 +317,11 @@ logger: - # - +@@ -442,6 +442,11 @@ logger: + # + smf: + info: + - s_nssai: @@ -351,7 +352,7 @@ index d45aa60f..949da220 100644 --- a/configs/open5gs/smf.yaml.in +++ b/configs/open5gs/smf.yaml.in -@@ -317,6 +317,12 @@ logger: +@@ -442,6 +442,12 @@ logger: # smf: @@ -370,7 +371,7 @@ index ecd4f7e2..04d9c4ba 100644 --- a/configs/open5gs/nssf.yaml.in +++ b/configs/open5gs/nssf.yaml.in -@@ -119,6 +119,11 @@ nssf: +@@ -201,6 +201,12 @@ nssf: port: 7777 s_nssai: sst: 1 @@ -379,9 +380,10 @@ + s_nssai: + sst: 1 + sd: 000080 - ++ + # - # nrf: + # scp: ``` Then add a slice to MongoDB's subscriber info. @@ -409,6 +411,7 @@ ```bash $ open5gs-nrfd +$ open5gs-scpd $ open5gs-amfd $ open5gs-ausfd $ open5gs-udmd @@ -503,9 +506,9 @@ $ 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 -@@ -190,7 +190,7 @@ - - addr: 127.0.0.4 - - addr: ::1 +@@ -458,7 +458,7 @@ smf: + addr: 127.0.0.4 + port: 9090 subnet: - - addr: 10.45.0.1/16 + - addr: 10.46.0.1/16 @@ -518,7 +521,7 @@ $ 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 -@@ -139,7 +139,7 @@ +@@ -170,7 +170,7 @@ upf: gtpu: - addr: 127.0.0.7 subnet: @@ -596,7 +599,7 @@ Then, remove all subscriber information using MongoDB Client ``` -$ mongo +$ mongosh > use open5gs switched to db open5gs > db.subscribers.find() ### Check the test subscriber @@ -616,6 +619,7 @@ $ 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 @@ -998,7 +1002,7 @@ Remove all subscriber information using MongoDB Client ``` -$ mongo +$ mongosh > db.subscribers.find() ### Check the test subscriber > db.subscribers.drop() ### Remove all subscriber > db.subscribers.find() ### Check that all subscribers are empty @@ -1077,6 +1081,7 @@ * 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
open5gs_2.4.11.tar.xz/docs/_docs/tutorial/01-your-first-lte.md -> open5gs_2.5.0.tar.xz/docs/_docs/tutorial/01-your-first-lte.md
Changed
@@ -156,9 +156,20 @@ #### 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 @@ -173,7 +184,7 @@ The following shows how to install the Web UI of Open5GS. ```bash -$ curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - +$ curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - $ sudo apt install nodejs $ curl -fsSL https://open5gs.org/open5gs/assets/webui/install | sudo -E bash - ``` @@ -229,16 +240,17 @@ ```diff $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml ---- 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 +--- 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: s1ap: -- addr: 127.0.0.2 -+ addr: 127.0.1.2 + - addr: 127.0.0.2 gtpc: +- - addr: 10.11.0.2 ++ - addr: 127.0.0.2 + metrics: addr: 127.0.0.2 + port: 9090 gummei: plmn_id: - mcc: 999 @@ -251,28 +263,26 @@ plmn_id: - mcc: 999 - mnc: 70 -- tac: 1 + mcc: 310 + mnc: 789 -+ tac: 2 + tac: 1 security: - integrity_order : EIA1, EIA2, EIA0 - ciphering_order : EEA0, EEA1, EEA2 + integrity_order : EIA2, EIA1, EIA0 ``` 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.old 2020-08-22 12:08:44.782880778 -0400 -+++ sgwu.yaml 2020-08-22 12:06:49.809299514 -0400 -@@ -82,7 +82,7 @@ +--- 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: - gtpu: -- addr: 10.11.0.6 -+ addr: 127.0.0.6 pfcp: - addr: 127.0.0.6 +- - addr: 10.11.0.6 ++ - addr: 127.0.0.6 + gtpu: + - addr: 127.0.0.6 ```
View file
open5gs_2.4.11.tar.xz/docs/_pages/docs.md -> open5gs_2.5.0.tar.xz/docs/_pages/docs.md
Changed
@@ -15,6 +15,11 @@ - 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
open5gs_2.4.11.tar.xz/docs/_posts/2021-04-09-release-v2.2.6.md -> open5gs_2.5.0.tar.xz/docs/_posts/2021-04-09-release-v2.2.6.md
Changed
@@ -52,7 +52,7 @@ $ git checkout v2.1.7 $ cd webui $ rm -Rf ./node_modules -$ npm ci --no-optional +$ npm ci $ npm run dev ## You should log out @@ -60,7 +60,7 @@ $ git checkout main $ cd webui $ rm -Rf ./node_modules -$ npm ci --no-optional +$ npm ci $ npm run dev ## You can log back in
View file
open5gs_2.4.11.tar.xz/docs/_posts/2021-04-30-release-v2.2.7.md -> open5gs_2.5.0.tar.xz/docs/_posts/2021-04-30-release-v2.2.7.md
Changed
@@ -46,7 +46,7 @@ $ git checkout v2.1.7 $ cd webui $ rm -Rf ./node_modules -$ npm ci --no-optional +$ npm ci $ npm run dev ## You should log out @@ -54,7 +54,7 @@ $ git checkout main $ cd webui $ rm -Rf ./node_modules -$ npm ci --no-optional +$ npm ci $ npm run dev ## You can log back in
View file
open5gs_2.4.11.tar.xz/docs/_posts/2021-05-09-release-v2.2.8.md -> open5gs_2.5.0.tar.xz/docs/_posts/2021-05-09-release-v2.2.8.md
Changed
@@ -42,7 +42,7 @@ $ git checkout v2.1.7 $ cd webui $ rm -Rf ./node_modules -$ npm ci --no-optional +$ npm ci $ npm run dev ## You should log out @@ -50,7 +50,7 @@ $ git checkout main $ cd webui $ rm -Rf ./node_modules -$ npm ci --no-optional +$ npm ci $ npm run dev ## You can log back in
View file
open5gs_2.4.11.tar.xz/docs/_posts/2021-05-19-release-v2.2.9.md -> open5gs_2.5.0.tar.xz/docs/_posts/2021-05-19-release-v2.2.9.md
Changed
@@ -36,7 +36,7 @@ $ git checkout v2.1.7 $ cd webui $ rm -Rf ./node_modules -$ npm ci --no-optional +$ npm ci $ npm run dev ## You should log out @@ -44,7 +44,7 @@ $ git checkout main $ cd webui $ rm -Rf ./node_modules -$ npm ci --no-optional +$ npm ci $ npm run dev ## You can log back in
View file
open5gs_2.5.0.tar.xz/docs/_posts/2022-10-01-release-v2.4.11.md
Added
@@ -0,0 +1,33 @@ +--- +title: "v2.4.11 - Bug Fixes (critical: session deletion)" +date: 2022-10-01 09:43:00 +0900 +categories: + - Release +tags: + - News + - Release +head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>" +--- + +#### Bug Fixes +- 5GC Session deletion was not properly worked in BSF(#1725(https://github.com/open5gs/open5gs/issues/1725)) -- prasenjitpdas(https://github.com/prasenjitpdas) +- AMF In deregistration state, we use an invalid state-machine pointer. (#1805(https://github.com/open5gs/open5gs/pull/1805)) -- bmeglicit(https://github.com/bmeglicit) +- SGWC Fixed crash because session context could be deleted before response message is not received from SMF (#1765(https://github.com/open5gs/open5gs/issues/1765)) -- dai9000(https://github.com/dai9000) +- SMF Wait for both N1&N2 release signals before releasing session (#1753(https://github.com/open5gs/open5gs/pull/1753)) -- bmeglicit(https://github.com/bmeglicit) +- UPF UL and DL URR usage Report was swapped (#1793(https://github.com/open5gs/open5gs/issues/1793)) -- dibasdas02(https://github.com/dibasdas02) +- CORE Fixed timer overflow on 32bit systems (#1770(https://github.com/open5gs/open5gs/pull/1770)) -- spencersevilla(https://github.com/spencersevilla) + +#### Enhancements +- MME Added protection code if no PDN-Type (#1756(https://github.com/open5gs/open5gs/pull/1756)) -- yar-or81(https://github.com/yar-or81) +- Metric Move metrics configuration section under respective (#1754(https://github.com/open5gs/open5gs/pull/1754)) -- bmeglicit(https://github.com/bmeglicit) +- Diameter Enable Change Streams (#1758(https://github.com/open5gs/open5gs/pull/1758)) -- jmasterfunk84(https://github.com/jmasterfunk84) +- AMF Added amfInfoList to NFProfile (#1757(https://github.com/open5gs/open5gs/pull/1757)) -- gstaa(https://github.com/gstaa) +- TLV Acceptable even if the TLV length is smaller than expected (#1780(https://github.com/open5gs/open5gs/discussions/1780)) -- infinitydon(https://github.com/infinitydon) +- Diameter Introduce Cancel Location and Insert Subscription Data (#1744(https://github.com/open5gs/open5gs/pull/1744)) -- jmasterfunk84(https://github.com/jmasterfunk84) + +#### Security Issues +- SBI Fixed HTTP2 crash from random JSON data (#1679(https://github.com/open5gs/open5gs/issues/1679)) -- Popvlvs(https://github.com/Popvlvs) +- TLV UPF crashes after UDP port scan (#1767(https://github.com/open5gs/open5gs/issues/1767)) -- Popvlvs(https://github.com/Popvlvs) + +Download -- v2.4.11.tar.gz(https://github.com/open5gs/open5gs/archive/v2.4.11.tar.gz) +{: .notice--info}
View file
open5gs_2.4.11.tar.xz/docs/assets/webui/install -> open5gs_2.5.0.tar.xz/docs/assets/webui/install
Changed
@@ -10,7 +10,7 @@ # PACKAGE="open5gs" -VERSION="2.4.11" +VERSION="2.5.0" print_status() { echo @@ -240,7 +240,7 @@ fi print_status "Build the Open5GS WebUI..." -exec_cmd "cd ./${PACKAGE}-${VERSION}/webui && npm ci --no-optional && npm run build" +exec_cmd "cd ./${PACKAGE}-${VERSION}/webui && npm ci && npm run build" print_status "Install the Open5GS WebUI..." exec_cmd "mv ./${PACKAGE}-${VERSION}/webui /usr/lib/node_modules/${PACKAGE}"
View file
open5gs_2.4.11.tar.xz/lib/app/ogs-context.c -> open5gs_2.5.0.tar.xz/lib/app/ogs-context.c
Changed
@@ -352,8 +352,12 @@ ogs_yaml_iter_bool(¶meter_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(¶meter_iter); +#else + self.use_mongodb_change_stream = false; +#endif } else ogs_warn("unknown key `%s`", parameter_key); }
View file
open5gs_2.4.11.tar.xz/lib/dbi/ogs-mongoc.c -> open5gs_2.5.0.tar.xz/lib/dbi/ogs-mongoc.c
Changed
@@ -182,15 +182,18 @@ 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; @@ -213,10 +216,14 @@ } 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; @@ -240,4 +247,7 @@ } return OGS_OK; +# else + return OGS_ERROR; +#endif }
View file
open5gs_2.4.11.tar.xz/lib/dbi/ogs-mongoc.h -> open5gs_2.5.0.tar.xz/lib/dbi/ogs-mongoc.h
Changed
@@ -37,7 +37,9 @@ 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
open5gs_2.4.11.tar.xz/lib/dbi/path.c -> open5gs_2.5.0.tar.xz/lib/dbi/path.c
Changed
@@ -31,7 +31,7 @@ rv = ogs_queue_push(ogs_app()->queue, e); if (rv != OGS_OK) { ogs_error("ogs_queue_push() failed:%d", (int)rv); - bson_destroy((bson_t*)e->dbi.document); + bson_destroy(e->dbi.document); ogs_event_free(e); } else { ogs_pollset_notify(ogs_app()->pollset);
View file
open5gs_2.4.11.tar.xz/lib/diameter/s6a/message.h -> open5gs_2.5.0.tar.xz/lib/diameter/s6a/message.h
Changed
@@ -77,6 +77,19 @@ #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; @@ -166,6 +179,7 @@ #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 { @@ -179,6 +193,7 @@ #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
open5gs_2.4.11.tar.xz/lib/gtp/xact.h -> open5gs_2.5.0.tar.xz/lib/gtp/xact.h
Changed
@@ -96,15 +96,16 @@ #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_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 +#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 + int delete_action; #define OGS_GTP_RELEASE_SEND_UE_CONTEXT_RELEASE_COMMAND 1
View file
open5gs_2.4.11.tar.xz/lib/pfcp/types.h -> open5gs_2.5.0.tar.xz/lib/pfcp/types.h
Changed
@@ -1191,8 +1191,8 @@ union { struct { ED3(uint8_t spare:6;, - uint8_t dlpa:1;, - uint8_t dlby:1;) + uint8_t dlby:1;, + uint8_t dlpa:1;) }; uint8_t flags; };
View file
open5gs_2.4.11.tar.xz/lib/proto/event.c -> open5gs_2.5.0.tar.xz/lib/proto/event.c
Changed
@@ -37,7 +37,7 @@ ogs_event_t *ogs_event_new(int id) { - return ogs_event_size(id, sizeof(ogs_event_t)); + return ogs_event_size(id, OGS_EVENT_SIZE); } void ogs_event_free(void *e)
View file
open5gs_2.4.11.tar.xz/lib/proto/event.h -> open5gs_2.5.0.tar.xz/lib/proto/event.h
Changed
@@ -50,8 +50,6 @@ 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; @@ -66,10 +64,12 @@ } sbi; struct { - const bson_t *document; + void *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
open5gs_2.4.11.tar.xz/lib/proto/types.h -> open5gs_2.5.0.tar.xz/lib/proto/types.h
Changed
@@ -652,6 +652,10 @@ 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 sessionOGS_MAX_NUM_OF_SESS; } ogs_slice_data_t;
View file
open5gs_2.4.11.tar.xz/lib/sbi/client.c -> open5gs_2.5.0.tar.xz/lib/sbi/client.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -47,6 +47,7 @@ bool memory_overflow; char *location; + char *producer_id; ogs_timer_t *timer; CURL *easy; @@ -66,8 +67,14 @@ 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 void connection_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); void ogs_sbi_client_init(int num_of_sockinfo_pool, int num_of_connection_pool) { @@ -280,8 +287,6 @@ 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) @@ -307,7 +312,7 @@ conn->method = ogs_strdup(request->h.method); if (!conn->method) { ogs_error("conn->method is NULL"); - _connection_remove(conn); + connection_free(conn); return NULL; } @@ -316,7 +321,7 @@ conn->headers = ogs_calloc(conn->num_of_header, sizeof(char *)); if (!conn->headers) { ogs_error("conn->headers is NULL"); - _connection_remove(conn); + connection_free(conn); return NULL; } for (hi = ogs_hash_first(request->http.headers), i = 0; @@ -327,7 +332,7 @@ conn->headersi = ogs_msprintf("%s: %s", key, val); if (!conn->headersi) { ogs_error("conn->headersi=%d is NULL", i); - _connection_remove(conn); + connection_free(conn); return NULL; } conn->header_list = curl_slist_append( @@ -339,7 +344,7 @@ ogs_app()->timer_mgr, connection_timer_expired, conn); if (!conn->timer) { ogs_error("conn->timer is NULL"); - _connection_remove(conn); + connection_free(conn); return NULL; } @@ -351,7 +356,7 @@ conn->easy = curl_easy_init(); if (!conn->easy) { ogs_error("conn->easy is NULL"); - _connection_remove(conn); + connection_free(conn); return NULL; } @@ -360,7 +365,7 @@ request->h.uri, request->http.params); if (!uri) { ogs_error("add_params_to_uri() failed"); - _connection_remove(conn); + connection_free(conn); return NULL; } @@ -380,7 +385,7 @@ request->http.content, request->http.content_length); if (!conn->content) { ogs_error("conn->content is NULL"); - _connection_remove(conn); + connection_free(conn); return NULL; } curl_easy_setopt(conn->easy, @@ -424,7 +429,23 @@ return conn; } -static void _connection_remove(connection_t *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) { int i; @@ -435,6 +456,8 @@ if (conn->location) ogs_free(conn->location); + if (conn->producer_id) + ogs_free(conn->producer_id); if (conn->memory) ogs_free(conn->memory); @@ -459,22 +482,6 @@ 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; @@ -555,6 +562,9 @@ 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; @@ -585,8 +595,11 @@ ogs_warn("%d %s", res, conn->error); ogs_assert(conn->client_cb); - conn->client_cb(res == CURLE_OK ? OGS_OK : OGS_ERROR, - response, conn->data); + if (res == CURLE_OK) + conn->client_cb(OGS_OK, response, conn->data); + else + conn->client_cb(OGS_ERROR, NULL, conn->data); + connection_remove(conn); break; default: @@ -596,7 +609,7 @@ } } -bool ogs_sbi_client_send_reqmem_persistent( +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) { @@ -604,10 +617,10 @@ ogs_assert(client); ogs_assert(request); - if (request->h.uri == NULL) { request->h.uri = ogs_sbi_client_uri(client, &request->h);
View file
open5gs_2.4.11.tar.xz/lib/sbi/client.h -> open5gs_2.5.0.tar.xz/lib/sbi/client.h
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -62,8 +62,6 @@ 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 */ @@ -86,17 +84,10 @@ 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_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( +bool ogs_sbi_client_send_via_scp( ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb, ogs_sbi_request_t *request, void *data);
View file
open5gs_2.4.11.tar.xz/lib/sbi/context.c -> open5gs_2.5.0.tar.xz/lib/sbi/context.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -58,15 +58,24 @@ ogs_pool_init(&nf_info_pool, ogs_app()->pool.nf * OGS_MAX_NUM_OF_NF_INFO); - /* Add SELF NF instance */ + /* Add AELF 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; } @@ -123,24 +132,31 @@ ogs_assert(context_initialized == 1); switch (self.discovery_config.delegated) { case OGS_SBI_DISCOVERY_DELEGATED_AUTO: - 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; + 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; + } } break; case OGS_SBI_DISCOVERY_DELEGATED_YES: - if (ogs_sbi_self()->scp_instance == NULL) { + if (NF_INSTANCE_CLIENT(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 (ogs_sbi_self()->nrf_instance == NULL) { + if (NF_INSTANCE_CLIENT(self.nrf_instance) == NULL) { ogs_error("DELEGATED_NO - no NRF available"); return OGS_ERROR; } @@ -154,11 +170,6 @@ 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) { @@ -478,7 +489,6 @@ 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; @@ -580,14 +590,7 @@ client = ogs_sbi_client_add(addr); ogs_assert(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); + OGS_SBI_SETUP_CLIENT(self.nrf_instance, client); if (key) client->tls.key = key; if (pem) client->tls.pem = pem; @@ -598,7 +601,8 @@ YAML_SEQUENCE_NODE); } } - } else if (scp && !strcmp(root_key, scp)) { + } else if (ogs_app()->parameter.no_scp == false && + 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)) { @@ -608,7 +612,6 @@ 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; @@ -710,14 +713,7 @@ client = ogs_sbi_client_add(addr); ogs_assert(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); + OGS_SBI_SETUP_CLIENT(self.scp_instance, client); if (key) client->tls.key = key; if (pem) client->tls.pem = pem; @@ -922,15 +918,18 @@ 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, discovery_option) == false) + nf_instance, target_nf_type, requester_nf_type, + discovery_option) == false) continue; return nf_instance; @@ -940,7 +939,8 @@ } ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find_by_service_type( - ogs_sbi_service_type_e service_type) + ogs_sbi_service_type_e service_type, + OpenAPI_nf_type_e requester_nf_type) { ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_discovery_option_t *discovery_option = NULL; @@ -948,6 +948,7 @@ 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); @@ -959,7 +960,7 @@ ogs_sbi_discovery_option_add_service_names(discovery_option, service_name); nf_instance = ogs_sbi_nf_instance_find_by_discovery_param( - target_nf_type, discovery_option); + target_nf_type, requester_nf_type, discovery_option); ogs_sbi_discovery_option_free(discovery_option); @@ -1536,14 +1537,11 @@ 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;
View file
open5gs_2.4.11.tar.xz/lib/sbi/context.h -> open5gs_2.5.0.tar.xz/lib/sbi/context.h
Changed
@@ -84,18 +84,20 @@ 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) \ - ((__nFInstance->nf_type) == OpenAPI_nf_type_NRF) - - char *id; /* NFInstanceId */ - + (NF_INSTANCE_TYPE(__nFInstance) == OpenAPI_nf_type_NRF) OpenAPI_nf_type_e nf_type; OpenAPI_nf_status_e nf_status; @@ -121,6 +123,8 @@ 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; @@ -155,6 +159,7 @@ 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; @@ -220,7 +225,7 @@ struct { OpenAPI_nf_type_e nf_type; /* nfType */ - char *service_name; /* ServiceName */ + char *service_name; /* ServiceName */ } subscr_cond; uint64_t requester_features; @@ -297,8 +302,6 @@ 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( @@ -315,9 +318,11 @@ 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); + ogs_sbi_service_type_e service_type, + OpenAPI_nf_type_e requester_nf_type); bool ogs_sbi_nf_instance_maximum_number_is_reached(void); ogs_sbi_nf_service_t *ogs_sbi_nf_service_add( @@ -352,6 +357,9 @@ 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); @@ -373,6 +381,7 @@ 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
open5gs_2.4.11.tar.xz/lib/sbi/conv.c -> open5gs_2.5.0.tar.xz/lib/sbi/conv.c
Changed
@@ -451,6 +451,72 @@ return true; } +int ogs_sbi_rfc7231_string(char *date_str, ogs_time_t time) +{ + const char ogs_month_snames124 = { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", + "Aug", "Sep", "Oct", "Nov", "Dec" + }; + const char ogs_day_snames74 = { + "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_snamesgmt.tm_wday0; + *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_snamesgmt.tm_mon0; + *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
open5gs_2.4.11.tar.xz/lib/sbi/conv.h -> open5gs_2.5.0.tar.xz/lib/sbi/conv.h
Changed
@@ -56,6 +56,9 @@ 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
open5gs_2.4.11.tar.xz/lib/sbi/meson.build -> open5gs_2.5.0.tar.xz/lib/sbi/meson.build
Changed
@@ -41,6 +41,7 @@ nnrf-build.c nnrf-handler.c + nnrf-path.c path.c nf-sm.c
View file
open5gs_2.4.11.tar.xz/lib/sbi/message.c -> open5gs_2.5.0.tar.xz/lib/sbi/message.c
Changed
@@ -179,6 +179,10 @@ 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++) { @@ -249,6 +253,9 @@ { int i; ogs_sbi_request_t *request = NULL; + OpenAPI_nf_type_e nf_type = OpenAPI_nf_type_NULL; + char sender_timestampOGS_SBI_RFC7231_DATE_LEN; + char *max_rsp_time = NULL; ogs_assert(message); @@ -307,21 +314,17 @@ discovery_option->num_of_service_names) { /* send array items separated by a comma */ - char *v = NULL; - - v = ogs_strdup(discovery_option->service_names0); - 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_namesi); + 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_names0); } - - ogs_sbi_header_set( - request->http.params, OGS_SBI_PARAM_SERVICE_NAMES, v); - ogs_free(v); } } @@ -443,10 +446,38 @@ 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; } @@ -514,37 +545,33 @@ /* Discovery Option Parameter */ } else if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_PARAM_TARGET_NF_INSTANCE_ID)) { - discovery_option_presence = true; - ogs_sbi_discovery_option_set_target_nf_instance_id( - discovery_option, ogs_hash_this_val(hi)); + 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; + } } else if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_PARAM_REQUESTER_NF_INSTANCE_ID)) { - discovery_option_presence = true; - ogs_sbi_discovery_option_set_requester_nf_instance_id( - discovery_option, ogs_hash_this_val(hi)); + 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; + } } 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) { - 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); + ogs_sbi_discovery_option_parse_service_names( + discovery_option, v); + discovery_option_presence = true; } /* URL Query Parameter */ @@ -653,11 +680,26 @@ 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; } @@ -1008,6 +1050,15 @@ 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) { @@ -1312,6 +1363,15 @@ } break; + CASE(OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS) + message->SDMSubscription = + OpenAPI_sdm_subscription_parseFromJSON(item); + if (!message->SDMSubscription) {
View file
open5gs_2.4.11.tar.xz/lib/sbi/message.h -> open5gs_2.5.0.tar.xz/lib/sbi/message.h
Changed
@@ -95,6 +95,7 @@ #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" @@ -126,6 +127,8 @@ #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" @@ -230,8 +233,11 @@ #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" @@ -280,6 +286,10 @@ 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" @@ -321,6 +331,39 @@ #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; @@ -359,11 +402,18 @@ 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 { @@ -448,6 +498,8 @@ 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; @@ -528,9 +580,15 @@ 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
open5gs_2.4.11.tar.xz/lib/sbi/nf-sm.c -> open5gs_2.5.0.tar.xz/lib/sbi/nf-sm.c
Changed
@@ -110,9 +110,7 @@ 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); @@ -121,7 +119,6 @@ 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) { @@ -148,11 +145,11 @@ if (message->res_status == OGS_SBI_HTTP_STATUS_OK || message->res_status == OGS_SBI_HTTP_STATUS_CREATED) { - ogs_sbi_nnrf_handle_nf_register(nf_instance, message); + ogs_nnrf_nfm_handle_nf_register(nf_instance, message); OGS_FSM_TRAN(s, &ogs_sbi_nf_state_registered); } else { ogs_error("%s HTTP Response Status Code %d", - ogs_sbi_self()->nf_instance->id, + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance), message->res_status); OGS_FSM_TRAN(s, &ogs_sbi_nf_state_exception); } @@ -160,27 +157,23 @@ DEFAULT ogs_error("%s Invalid resource name %s", - ogs_sbi_self()->nf_instance->id, + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance), message->h.resource.component0); END break; DEFAULT ogs_error("%s Invalid API name %s", - ogs_sbi_self()->nf_instance->id, message->h.service.name); + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance), + 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", - ogs_sbi_self()->nf_instance->id); + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance)); ogs_timer_start(nf_instance->t_registration_interval, ogs_app()->time.message.sbi.nf_register_interval); @@ -190,7 +183,7 @@ default: ogs_error("%s Unknown timer%s:%d", - ogs_sbi_self()->nf_instance->id, + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance), ogs_timer_get_name(e->timer_id), e->timer_id); } break; @@ -212,7 +205,6 @@ nf_instance = e->sbi.data; ogs_assert(nf_instance); - ogs_assert(ogs_sbi_self()->nf_instance); switch (e->id) { case OGS_FSM_ENTRY_SIG: @@ -220,7 +212,7 @@ ogs_sbi_subscription_data_t *subscription_data = NULL; ogs_info("%s NF registered Heartbeat:%ds", - ogs_sbi_self()->nf_instance->id, + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance), nf_instance->time.heartbeat_interval); if (nf_instance->time.heartbeat_interval) { @@ -242,7 +234,8 @@ case OGS_FSM_EXIT_SIG: if (NF_INSTANCE_TYPE_IS_NRF(nf_instance)) { - ogs_info("%s NF de-registered", ogs_sbi_self()->nf_instance->id); + ogs_info("%s NF de-registered", + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance)); if (nf_instance->time.heartbeat_interval) { ogs_timer_stop(nf_instance->t_heartbeat_interval); @@ -276,7 +269,7 @@ no_heartbeat_margin)); } else { ogs_warn("%s HTTP response error %d", - ogs_sbi_self()->nf_instance->id, + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance), message->res_status); OGS_FSM_TRAN(s, &ogs_sbi_nf_state_exception); } @@ -285,14 +278,15 @@ DEFAULT ogs_error("%s Invalid resource name %s", - ogs_sbi_self()->nf_instance->id, + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance), message->h.resource.component0); END break; DEFAULT ogs_error("%s Invalid API name %s", - ogs_sbi_self()->nf_instance->id, message->h.service.name); + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance), + message->h.service.name); END break; @@ -307,7 +301,8 @@ break; case OGS_TIMER_NF_INSTANCE_NO_HEARTBEAT: - ogs_error("%s No heartbeat", ogs_sbi_self()->nf_instance->id); + ogs_error("%s No heartbeat", + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance)); OGS_FSM_TRAN(s, &ogs_sbi_nf_state_will_register); break; @@ -351,7 +346,8 @@ switch (e->id) { case OGS_FSM_ENTRY_SIG: if (NF_INSTANCE_TYPE_IS_NRF(nf_instance)) { - ogs_info("%s NF de-registered", ogs_sbi_self()->nf_instance->id); + ogs_info("%s NF de-registered", + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance)); } break; @@ -370,9 +366,7 @@ 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); @@ -400,13 +394,8 @@ 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", - ogs_sbi_self()->nf_instance->id); + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance)); OGS_FSM_TRAN(s, &ogs_sbi_nf_state_will_register); break;
View file
open5gs_2.4.11.tar.xz/lib/sbi/nf-sm.h -> open5gs_2.5.0.tar.xz/lib/sbi/nf-sm.h
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. *
View file
open5gs_2.4.11.tar.xz/lib/sbi/nnrf-build.c -> open5gs_2.5.0.tar.xz/lib/sbi/nnrf-build.c
Changed
@@ -55,13 +55,20 @@ NFProfile = ogs_nnrf_nfm_build_nf_profile( ogs_sbi_self()->nf_instance, NULL, NULL, supported_features); - ogs_expect_or_return_val(NFProfile, NULL); + if (!NFProfile) { + ogs_error("No NFProfile"); + goto end; + } message.NFProfile = NFProfile; request = ogs_sbi_build_request(&message); + ogs_expect(request); + +end: - ogs_nnrf_nfm_free_nf_profile(NFProfile); + if (NFProfile) + ogs_nnrf_nfm_free_nf_profile(NFProfile); return request; } @@ -97,7 +104,10 @@ ogs_assert(nf_instance->id); NFProfile = ogs_calloc(1, sizeof(*NFProfile)); - ogs_expect_or_return_val(NFProfile, NULL); + if (!NFProfile) { + ogs_error("No NFProfile"); + return NULL; + } NFProfile->nf_instance_id = nf_instance->id; NFProfile->nf_type = nf_instance->nf_type; @@ -127,10 +137,12 @@ NFProfile->is_load = true; NFProfile->load = nf_instance->load; - Ipv4AddrList = OpenAPI_list_create(); - ogs_assert(Ipv4AddrList); - Ipv6AddrList = OpenAPI_list_create(); - ogs_assert(Ipv6AddrList); + NFProfile->ipv4_addresses = Ipv4AddrList = OpenAPI_list_create(); + if (!Ipv4AddrList) { + ogs_error("No Ipv4AddrList"); + ogs_nnrf_nfm_free_nf_profile(NFProfile); + return NULL; + } for (i = 0; i < nf_instance->num_of_ipv4; i++) { if (nf_instance->ipv4i) { @@ -140,10 +152,22 @@ nf_instance->ipv4i->ogs_sin_port); ogs_assert(nf_instance->ipv4i->ogs_sa_family == AF_INET); ipstr = ogs_ipstrdup(nf_instance->ipv4i); - ogs_expect_or_return_val(ipstr, NULL); + if (!ipstr) { + ogs_error("No ipstr"); + ogs_nnrf_nfm_free_nf_profile(NFProfile); + return NULL; + } OpenAPI_list_add(Ipv4AddrList, ipstr); } } + + NFProfile->ipv6_addresses = 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->ipv6i) { ogs_trace("IPv6 family:%d, port:%d", @@ -151,35 +175,40 @@ nf_instance->ipv6i->ogs_sin_port); ogs_assert(nf_instance->ipv6i->ogs_sa_family == AF_INET6); ipstr = ogs_ipstrdup(nf_instance->ipv6i); - ogs_expect_or_return_val(ipstr, NULL); + if (!ipstr) { + ogs_error("No ipstr"); + ogs_nnrf_nfm_free_nf_profile(NFProfile); + return 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(); - ogs_assert(AllowedNfTypeList); + NFProfile->allowed_nf_types = AllowedNfTypeList = OpenAPI_list_create(); + if (!AllowedNfTypeList) { + ogs_error("No AllowedNfTypeList"); + ogs_nnrf_nfm_free_nf_profile(NFProfile); + return NULL; + } for (i = 0; i < nf_instance->num_of_allowed_nf_type; i++) { OpenAPI_list_add(AllowedNfTypeList, (void *)(uintptr_t)nf_instance->allowed_nf_typei); } - if (AllowedNfTypeList->count) - NFProfile->allowed_nf_types = AllowedNfTypeList; - else - OpenAPI_list_free(AllowedNfTypeList); - NFServiceList = OpenAPI_list_create(); - ogs_assert(NFServiceList); + 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_list_for_each(&nf_instance->nf_service_list, nf_service) { OpenAPI_nf_service_t *NFService = NULL; @@ -203,12 +232,20 @@ } NFService = build_nf_service(nf_service); - ogs_expect_or_return_val(NFService, NULL); + if (!NFService) { + ogs_error("No NFService"); + ogs_nnrf_nfm_free_nf_profile(NFProfile); + return NULL; + } if (OGS_SBI_FEATURES_IS_SET( supported_features, OGS_SBI_NNRF_NFM_SERVICE_MAP)) { NFServiceMap = OpenAPI_map_create(nf_service->id, NFService); - ogs_assert(NFServiceMap); + if (!NFServiceMap) { + ogs_error("No NFServiceMap"); + ogs_nnrf_nfm_free_nf_profile(NFProfile); + return NULL; + } OpenAPI_list_add(NFServiceList, NFServiceMap); } else { @@ -216,16 +253,6 @@ } } - 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); @@ -240,7 +267,7 @@ } SmfInfo = build_smf_info(nf_info); - ogs_expect_or_return_val(SmfInfo, NULL); + ogs_assert(SmfInfo); InfoMap = OpenAPI_map_create( ogs_msprintf("%d", ++InfoMapKey), SmfInfo); @@ -250,7 +277,7 @@ } else if (nf_info->nf_type == OpenAPI_nf_type_AMF) { AmfInfo = build_amf_info(nf_info); - ogs_expect_or_return_val(AmfInfo, NULL); + ogs_assert(AmfInfo); InfoMap = OpenAPI_map_create( ogs_msprintf("%d", ++InfoMapKey), AmfInfo); @@ -390,53 +417,96 @@ ogs_assert(nf_service->name); NFService = ogs_calloc(1, sizeof(*NFService)); - ogs_expect_or_return_val(NFService, NULL); + if (!NFService) { + ogs_error("No NFService");
View file
open5gs_2.4.11.tar.xz/lib/sbi/nnrf-build.h -> open5gs_2.5.0.tar.xz/lib/sbi/nnrf-build.h
Changed
@@ -43,6 +43,7 @@ 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
open5gs_2.4.11.tar.xz/lib/sbi/nnrf-handler.c -> open5gs_2.5.0.tar.xz/lib/sbi/nnrf-handler.c
Changed
@@ -24,16 +24,13 @@ static void handle_smf_info( ogs_sbi_nf_instance_t *nf_instance, OpenAPI_smf_info_t *SmfInfo); -void ogs_sbi_nnrf_handle_nf_register( +void ogs_nnrf_nfm_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) { @@ -46,7 +43,7 @@ nf_instance->time.heartbeat_interval = NFProfile->heart_beat_timer; } -void ogs_sbi_nnrf_handle_nf_profile( +void ogs_nnrf_nfm_handle_nf_profile( ogs_sbi_nf_instance_t *nf_instance, OpenAPI_nf_profile_t *NFProfile) { int rv; @@ -451,17 +448,14 @@ } } -void ogs_nnrf_handle_nf_status_subscribe( +void ogs_nnrf_nfm_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) { @@ -506,7 +500,7 @@ } } -bool ogs_nnrf_handle_nf_status_notify( +bool ogs_nnrf_nfm_handle_nf_status_notify( ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg) { int rv; @@ -633,7 +627,7 @@ message.h.resource.component1); } - ogs_sbi_nnrf_handle_nf_profile(nf_instance, NFProfile); + ogs_nnrf_nfm_handle_nf_profile(nf_instance, NFProfile); ogs_info("%s (NRF-notify) NF Profile updated", nf_instance->id); @@ -685,7 +679,7 @@ return true; } -void ogs_nnrf_handle_nf_discover_search_result( +void ogs_nnrf_disc_handle_nf_discover_search_result( OpenAPI_search_result_t *SearchResult) { OpenAPI_lnode_t *node = NULL; @@ -737,7 +731,7 @@ } if (NF_INSTANCE_ID_IS_OTHERS(nf_instance->id)) { - ogs_sbi_nnrf_handle_nf_profile(nf_instance, NFProfile); + ogs_nnrf_nfm_handle_nf_profile(nf_instance, NFProfile); ogs_sbi_client_associate(nf_instance);
View file
open5gs_2.4.11.tar.xz/lib/sbi/nnrf-handler.h -> open5gs_2.5.0.tar.xz/lib/sbi/nnrf-handler.h
Changed
@@ -24,18 +24,18 @@ extern "C" { #endif -void ogs_sbi_nnrf_handle_nf_register( +void ogs_nnrf_nfm_handle_nf_register( ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_message_t *recvmsg); -void ogs_sbi_nnrf_handle_nf_profile( +void ogs_nnrf_nfm_handle_nf_profile( ogs_sbi_nf_instance_t *nf_instance, OpenAPI_nf_profile_t *NFProfile); -void ogs_nnrf_handle_nf_status_subscribe( +void ogs_nnrf_nfm_handle_nf_status_subscribe( ogs_sbi_subscription_data_t *subscription_data, ogs_sbi_message_t *recvmsg); -bool ogs_nnrf_handle_nf_status_notify( +bool ogs_nnrf_nfm_handle_nf_status_notify( ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg); -void ogs_nnrf_handle_nf_discover_search_result( +void ogs_nnrf_disc_handle_nf_discover_search_result( OpenAPI_search_result_t *SearchResult); #ifdef __cplusplus
View file
open5gs_2.5.0.tar.xz/lib/sbi/nnrf-path.c
Added
@@ -0,0 +1,132 @@ +/* + * 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( + 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_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
open5gs_2.5.0.tar.xz/lib/sbi/nnrf-path.h
Added
@@ -0,0 +1,45 @@ +/* + * 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( + ogs_sbi_subscription_data_t *subscription_data); +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
open5gs_2.4.11.tar.xz/lib/sbi/ogs-sbi.h -> open5gs_2.5.0.tar.xz/lib/sbi/ogs-sbi.h
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -75,6 +75,8 @@ #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" @@ -99,6 +101,7 @@ #include "sbi/nnrf-build.h" #include "sbi/nnrf-handler.h" +#include "sbi/nnrf-path.h" #include "sbi/path.h"
View file
open5gs_2.4.11.tar.xz/lib/sbi/path.c -> open5gs_2.5.0.tar.xz/lib/sbi/path.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -19,73 +19,165 @@ #include "ogs-sbi.h" -bool ogs_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, - ogs_sbi_client_cb_f client_cb, ogs_sbi_xact_t *xact) +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_sbi_request_t *request = NULL; - ogs_sbi_client_t *client = NULL; + 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); - request = xact->request; - ogs_assert(request); + 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); - ogs_assert(nf_instance); + 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; + } - if (request->h.uri == NULL) { - client = ogs_sbi_client_find_by_service_name(nf_instance, - request->h.service.name, request->h.api.version); - if (!client) { - ogs_error("%s:%s Cannot find client %s:%s", - OpenAPI_nf_type_ToString(nf_instance->nf_type), - nf_instance->id, - request->h.service.name, request->h.api.version); - return false; - } - } else { - ogs_sockaddr_t *addr = NULL; - char bufOGS_ADDRSTRLEN; + ogs_assert(response); - addr = ogs_sbi_getaddr_from_uri(request->h.uri); - if (!addr) { - ogs_error("%s:%s Invalid URL %s", - OpenAPI_nf_type_ToString(nf_instance->nf_type), - nf_instance->id, request->h.uri); - return false; + /* 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; } - client = ogs_sbi_client_find(addr); - if (!client) { - ogs_error("%s:%s Cannot find client %s:%d", - OpenAPI_nf_type_ToString(nf_instance->nf_type), - nf_instance->id, - OGS_ADDR(addr, buf), OGS_PORT(addr)); - ogs_freeaddrinfo(addr); - return false; + } + + /* 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_freeaddrinfo(addr); + + OGS_SBI_SETUP_NF_INSTANCE( + sbi_object->service_type_arrayservice_type, nf_instance); } - /* 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_scp_send_reqmem_persistent( - client, client_cb, request, xact), false); + 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 true; + return OGS_OK; } -bool ogs_sbi_discover_only( - ogs_sbi_xact_t *xact, ogs_sbi_client_cb_f client_cb)
View file
open5gs_2.4.11.tar.xz/lib/sbi/path.h -> open5gs_2.5.0.tar.xz/lib/sbi/path.h
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -26,30 +26,22 @@ extern "C" { #endif -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_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_nnrf_nfm_send_nf_status_subscribe( - ogs_sbi_subscription_data_t *subscription_data); -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, +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_discover_and_send(ogs_sbi_xact_t *xact); +bool ogs_sbi_discover_only(ogs_sbi_xact_t *xact); + +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, ogs_sbi_discovery_option_t *discovery_option, - void *data); - + ogs_sbi_request_t *request, void *data); #define ogs_sbi_send_http_status_no_content(__sTREAM) \ ogs_sbi_send_response(__sTREAM, OGS_SBI_HTTP_STATUS_NO_CONTENT)
View file
open5gs_2.4.11.tar.xz/meson.build -> open5gs_2.5.0.tar.xz/meson.build
Changed
@@ -16,7 +16,7 @@ # along with this program. If not, see <https://www.gnu.org/licenses/>. project('open5gs', 'c', 'cpp', - version : '2.4.11', + version : '2.5.0', license : 'AGPL-3.0-or-later', meson_version : '>= 0.43.0', default_options : @@ -24,7 +24,7 @@ , ) -libogslib_version = '2.4.11' +libogslib_version = '2.5.0' prefix = get_option('prefix') bindir = join_paths(prefix, get_option('bindir'))
View file
open5gs_2.4.11.tar.xz/misc/netconf.sh -> open5gs_2.5.0.tar.xz/misc/netconf.sh
Changed
@@ -38,6 +38,8 @@ 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
open5gs_2.4.11.tar.xz/src/amf/amf-sm.c -> open5gs_2.5.0.tar.xz/src/amf/amf-sm.c
Changed
@@ -129,7 +129,7 @@ CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY) SWITCH(sbi_message.h.method) CASE(OGS_SBI_HTTP_METHOD_POST) - ogs_nnrf_handle_nf_status_notify(stream, &sbi_message); + ogs_nnrf_nfm_handle_nf_status_notify(stream, &sbi_message); break; DEFAULT @@ -213,6 +213,11 @@ 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; @@ -291,7 +296,7 @@ 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_handle_nf_status_subscribe( + ogs_nnrf_nfm_handle_nf_status_subscribe( subscription_data, &sbi_message); } else { ogs_error("%s HTTP response error %d", @@ -795,7 +800,15 @@ amf_ue = amf_ue_find_by_message(&nas_message); if (!amf_ue) { amf_ue = amf_ue_add(ran_ue); - ogs_assert(amf_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; + } } else { /* Here, if the AMF_UE Context is found, * the integrity check is not performed
View file
open5gs_2.4.11.tar.xz/src/amf/context.c -> open5gs_2.5.0.tar.xz/src/amf/context.c
Changed
@@ -60,7 +60,7 @@ 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); + ogs_pool_init(&self.m_tmsi, ogs_app()->max.ue*2); ogs_list_init(&self.gnb_list); ogs_list_init(&self.amf_ue_list); @@ -1063,7 +1063,11 @@ ogs_assert(gnb); ogs_pool_alloc(&ran_ue_pool, &ran_ue); - ogs_assert(ran_ue); + if (ran_ue == NULL) { + ogs_error("Could not allocate ran_ue context from pool"); + return NULL; + } + memset(ran_ue, 0, sizeof *ran_ue); ran_ue->t_ng_holding = ogs_timer_add( @@ -1257,7 +1261,11 @@ ogs_assert(gnb); ogs_pool_alloc(&amf_ue_pool, &amf_ue); - ogs_assert(amf_ue); + if (amf_ue == NULL) { + ogs_error("Could not allocate amf_ue context from pool"); + return NULL; + } + memset(amf_ue, 0, sizeof *amf_ue); /* Add All Timers */ @@ -1387,6 +1395,8 @@ 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); @@ -1912,6 +1922,7 @@ 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; @@ -1923,11 +1934,12 @@ 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, discovery_option); + target_nf_type, requester_nf_type, discovery_option); if (nf_instance) OGS_SBI_SETUP_NF_INSTANCE( sbi_object->service_type_arrayservice_type, nf_instance); @@ -1938,7 +1950,9 @@ ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) { if (ogs_sbi_discovery_param_is_matched( - nf_instance, target_nf_type, discovery_option) == false) + nf_instance, + target_nf_type, requester_nf_type, discovery_option) == + false) continue; nf_info = ogs_sbi_nf_info_find( @@ -2118,7 +2132,7 @@ int index = 0; ogs_trace("M-TMSI Pool try to generate..."); - for (i = 0; index < ogs_app()->max.ue; i++) { + for (i = 0; index < ogs_app()->max.ue*2; i++) { amf_m_tmsi_t *m_tmsi = NULL; int conflict = 0;
View file
open5gs_2.4.11.tar.xz/src/amf/context.h -> open5gs_2.5.0.tar.xz/src/amf/context.h
Changed
@@ -393,6 +393,9 @@ /* 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; }; @@ -738,6 +741,7 @@ 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
open5gs_2.4.11.tar.xz/src/amf/event.h -> open5gs_2.5.0.tar.xz/src/amf/event.h
Changed
@@ -83,6 +83,8 @@ 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
open5gs_2.4.11.tar.xz/src/amf/gmm-handler.c -> open5gs_2.5.0.tar.xz/src/amf/gmm-handler.c
Changed
@@ -1070,8 +1070,12 @@ nf_instance = sess->sbi. service_type_arrayservice_type.nf_instance; if (!nf_instance) { - nf_instance = - ogs_sbi_nf_instance_find_by_service_type(service_type); + OpenAPI_nf_type_e requester_nf_type = + NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance); + ogs_assert(requester_nf_type); + + nf_instance = ogs_sbi_nf_instance_find_by_service_type( + service_type, requester_nf_type); if (nf_instance) OGS_SBI_SETUP_NF_INSTANCE( sess->sbi.service_type_arrayservice_type,
View file
open5gs_2.4.11.tar.xz/src/amf/gmm-sm.c -> open5gs_2.5.0.tar.xz/src/amf/gmm-sm.c
Changed
@@ -988,6 +988,7 @@ SWITCH(sbi_message->h.resource.component1) 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); @@ -1027,7 +1028,9 @@ 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) - if (sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) { + 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", amf_ue->supi, sbi_message->res_status); ogs_assert(OGS_OK ==
View file
open5gs_2.4.11.tar.xz/src/amf/namf-handler.c -> open5gs_2.5.0.tar.xz/src/amf/namf-handler.c
Changed
@@ -606,3 +606,114 @@ 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
open5gs_2.4.11.tar.xz/src/amf/namf-handler.h -> open5gs_2.5.0.tar.xz/src/amf/namf-handler.h
Changed
@@ -32,6 +32,8 @@ 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
open5gs_2.4.11.tar.xz/src/amf/nausf-build.c -> open5gs_2.5.0.tar.xz/src/amf/nausf-build.c
Changed
@@ -50,7 +50,10 @@ AuthenticationInfo.supi_or_suci = amf_ue->suci; AuthenticationInfo.serving_network_name = ogs_serving_network_name_from_plmn_id(&amf_ue->nr_tai.plmn_id); - ogs_expect_or_return_val(AuthenticationInfo.serving_network_name, NULL); + if (!AuthenticationInfo.serving_network_name) { + ogs_error("No serving_network_name"); + goto end; + } if (auts) { memset(&ResynchronizationInfo, 0, sizeof(ResynchronizationInfo)); @@ -70,7 +73,9 @@ request = ogs_sbi_build_request(&message); ogs_expect(request); - ogs_free(AuthenticationInfo.serving_network_name); +end: + if (AuthenticationInfo.serving_network_name) + ogs_free(AuthenticationInfo.serving_network_name); return request; } @@ -93,7 +98,10 @@ message.h.uri = amf_ue->confirmation_url_for_5g_aka; ConfirmationData = ogs_calloc(1, sizeof(*ConfirmationData)); - ogs_expect_or_return_val(ConfirmationData, NULL); + if (!ConfirmationData) { + ogs_error("No ConfirmationData"); + goto end; + } ogs_hex_to_ascii(amf_ue->xres_star, sizeof(amf_ue->xres_star), xres_star_string, sizeof(xres_star_string)); @@ -105,7 +113,9 @@ request = ogs_sbi_build_request(&message); ogs_expect(request); - ogs_free(ConfirmationData); +end: + if (ConfirmationData) + ogs_free(ConfirmationData); return request; }
View file
open5gs_2.4.11.tar.xz/src/amf/ngap-handler.c -> open5gs_2.5.0.tar.xz/src/amf/ngap-handler.c
Changed
@@ -398,7 +398,13 @@ 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); - ogs_assert(ran_ue); + 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; + } /* Find AMF_UE if 5G-S_TMSI included */ if (FiveG_S_TMSI) { @@ -2771,7 +2777,12 @@ /* Target UE */ target_ue = ran_ue_add(target_gnb, INVALID_UE_NGAP_ID); - ogs_assert(target_ue); + if (target_ue == NULL) { + ogs_assert(OGS_OK == + ngap_send_error_indication2(amf_ue, NGAP_Cause_PR_misc, + NGAP_CauseMisc_control_processing_overload)); + return; + } /* Source UE - Target UE associated */ source_ue_associate_target_ue(source_ue, target_ue);
View file
open5gs_2.4.11.tar.xz/src/amf/nnrf-build.c -> open5gs_2.5.0.tar.xz/src/amf/nnrf-build.c
Changed
@@ -50,6 +50,7 @@ message.param.discovery_option = discovery_option; request = ogs_sbi_build_request(&message); + ogs_expect(request); return request; }
View file
open5gs_2.4.11.tar.xz/src/amf/nnrf-handler.c -> open5gs_2.5.0.tar.xz/src/amf/nnrf-handler.c
Changed
@@ -28,6 +28,7 @@ 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; + OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL; ogs_sbi_discovery_option_t *discovery_option = NULL; OpenAPI_search_result_t *SearchResult = NULL; @@ -38,6 +39,8 @@ ogs_assert(sbi_object); service_type = xact->service_type; ogs_assert(service_type); + requester_nf_type = xact->requester_nf_type; + ogs_assert(requester_nf_type); discovery_option = xact->discovery_option; @@ -47,9 +50,10 @@ return; } - ogs_nnrf_handle_nf_discover_search_result(SearchResult); + ogs_nnrf_disc_handle_nf_discover_search_result(SearchResult); - amf_sbi_select_nf(sbi_object, service_type, discovery_option); + amf_sbi_select_nf(sbi_object, + service_type, requester_nf_type, discovery_option); nf_instance = sbi_object->service_type_arrayservice_type.nf_instance; if (!nf_instance) {
View file
open5gs_2.4.11.tar.xz/src/amf/nnssf-build.c -> open5gs_2.5.0.tar.xz/src/amf/nnssf-build.c
Changed
@@ -34,9 +34,16 @@ message.h.resource.component0 = (char *)OGS_SBI_RESOURCE_NAME_NETWORK_SLICE_INFORMATION; - ogs_assert(ogs_sbi_self()->nf_instance); - message.param.nf_id = ogs_sbi_self()->nf_instance->id; - message.param.nf_type = ogs_sbi_self()->nf_instance->nf_type; + message.param.nf_id = NF_INSTANCE_ID(ogs_sbi_self()->nf_instance); + if (!message.param.nf_id) { + ogs_error("No nf_id"); + goto end; + } + message.param.nf_type = NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance); + if (!message.param.nf_type) { + ogs_error("No nf_type"); + goto end; + } message.param.slice_info_request_for_pdu_session_presence = true; message.param.roaming_indication = OpenAPI_roaming_indication_NON_ROAMING; @@ -44,7 +51,9 @@ sizeof(message.param.s_nssai)); request = ogs_sbi_build_request(&message); - ogs_assert(request); + ogs_expect(request); + +end: return request; }
View file
open5gs_2.4.11.tar.xz/src/amf/nnssf-handler.c -> open5gs_2.5.0.tar.xz/src/amf/nnssf-handler.c
Changed
@@ -26,7 +26,7 @@ { amf_ue_t *amf_ue = NULL; - ogs_sbi_client_t *client = NULL; + ogs_sbi_client_t *client = NULL, *scp_client = NULL; ogs_sockaddr_t *addr = NULL; OpenAPI_authorized_network_slice_info_t *AuthorizedNetworkSliceInfo = NULL; @@ -78,28 +78,42 @@ sess->nssf.nrf.id = ogs_strdup(NsiInformation->nrf_id); ogs_assert(sess->nssf.nrf.id); - addr = ogs_sbi_getaddr_from_uri(NsiInformation->nrf_id); - if (!addr) { - ogs_error("%s:%d Invalid URI %s", - amf_ue->supi, sess->psi, NsiInformation->nrf_id); - ogs_assert(OGS_OK == - nas_5gs_send_gmm_reject_from_sbi( - amf_ue, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR)); - return OGS_ERROR;; - } + scp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance); - client = ogs_sbi_client_find(addr); - if (!client) { - client = ogs_sbi_client_add(addr); - ogs_assert(client); - } + if (scp_client) { + amf_nsmf_pdusession_sm_context_param_t param; + + memset(¶m, 0, sizeof(param)); + param.nrf_uri.nrf.id = sess->nssf.nrf.id; - OGS_SBI_SETUP_CLIENT(&sess->nssf.nrf, client); + amf_sess_sbi_discover_and_send( + OGS_SBI_SERVICE_TYPE_NSMF_PDUSESSION, NULL, + amf_nsmf_pdusession_build_create_sm_context, + sess, AMF_CREATE_SM_CONTEXT_NO_STATE, ¶m); + } else { + addr = ogs_sbi_getaddr_from_uri(NsiInformation->nrf_id); + if (!addr) { + ogs_error("%s:%d Invalid URI %s", + amf_ue->supi, sess->psi, NsiInformation->nrf_id); + ogs_assert(OGS_OK == + nas_5gs_send_gmm_reject_from_sbi( + amf_ue, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR)); + return OGS_ERROR;; + } + + client = ogs_sbi_client_find(addr); + if (!client) { + client = ogs_sbi_client_add(addr); + ogs_assert(client); + } - ogs_freeaddrinfo(addr); + OGS_SBI_SETUP_CLIENT(&sess->nssf.nrf, client); - ogs_assert(true == amf_sess_sbi_discover_by_nsi( - sess, OGS_SBI_SERVICE_TYPE_NSMF_PDUSESSION, NULL)); + ogs_freeaddrinfo(addr); + + ogs_assert(true == amf_sess_sbi_discover_by_nsi( + sess, OGS_SBI_SERVICE_TYPE_NSMF_PDUSESSION, NULL)); + } return OGS_OK; }
View file
open5gs_2.4.11.tar.xz/src/amf/npcf-build.c -> open5gs_2.5.0.tar.xz/src/amf/npcf-build.c
Changed
@@ -49,7 +49,10 @@ memset(&PolicyAssociationRequest, 0, sizeof(PolicyAssociationRequest)); server = ogs_list_first(&ogs_sbi_self()->server_list); - ogs_expect_or_return_val(server, NULL); + if (!server) { + ogs_error("No server"); + goto end; + } memset(&header, 0, sizeof(header)); header.service.name = (char *)OGS_SBI_SERVICE_NAME_NAMF_CALLBACK; @@ -59,7 +62,10 @@ (char *)OGS_SBI_RESOURCE_NAME_AM_POLICY_NOTIFY; PolicyAssociationRequest.notification_uri = ogs_sbi_server_uri(server, &header); - ogs_expect_or_return_val(PolicyAssociationRequest.notification_uri, NULL); + if (!PolicyAssociationRequest.notification_uri) { + ogs_error("No notifiation_uri"); + goto end; + } PolicyAssociationRequest.supi = amf_ue->supi; @@ -67,7 +73,10 @@ if (amf_ue->msisdn0) { PolicyAssociationRequest.gpsi = ogs_msprintf("%s-%s", OGS_ID_GPSI_TYPE_MSISDN, amf_ue->msisdn0); - ogs_assert(PolicyAssociationRequest.gpsi); + if (!PolicyAssociationRequest.gpsi) { + ogs_error("No gpsi"); + goto end; + } } } @@ -77,20 +86,31 @@ memset(&ueLocation, 0, sizeof(ueLocation)); ueLocation.nr_location = ogs_sbi_build_nr_location( &amf_ue->nr_tai, &amf_ue->nr_cgi); - ogs_expect_or_return_val(ueLocation.nr_location, NULL); + if (!ueLocation.nr_location) { + ogs_error("No ueLocation.nr_location"); + goto end; + } ueLocation.nr_location->ue_location_timestamp = ogs_sbi_gmtime_string(amf_ue->ue_location_timestamp); - ogs_expect_or_return_val( - ueLocation.nr_location->ue_location_timestamp, NULL); + if (!ueLocation.nr_location->ue_location_timestamp) { + ogs_error("No ueLocation.nr_location->ue_location_timestamp"); + goto end; + } PolicyAssociationRequest.user_loc = &ueLocation; PolicyAssociationRequest.time_zone = ogs_sbi_timezone_string(ogs_timezone()); - ogs_expect_or_return_val(PolicyAssociationRequest.time_zone, NULL); + if (!PolicyAssociationRequest.time_zone) { + ogs_error("No time_zone"); + goto end; + } PolicyAssociationRequest.serving_plmn = ogs_sbi_build_plmn_id_nid(&amf_ue->nr_tai.plmn_id); - ogs_expect_or_return_val(PolicyAssociationRequest.serving_plmn, NULL); + if (!PolicyAssociationRequest.serving_plmn) { + ogs_error("No serving_plmn"); + goto end; + } PolicyAssociationRequest.rat_type = amf_ue_rat_type(amf_ue); @@ -115,7 +135,10 @@ for (i = 0; i < amf_ue->allowed_nssai.num_of_s_nssai; i++) { struct OpenAPI_snssai_s *Snssai = ogs_calloc(1, sizeof(*Snssai)); - ogs_expect_or_return_val(Snssai, NULL); + if (!Snssai) { + ogs_error("No Snssai"); + goto end; + } Snssai->sst = amf_ue->allowed_nssai.s_nssaii.sst; Snssai->sd = ogs_s_nssai_sd_to_string( @@ -130,22 +153,31 @@ OpenAPI_list_free(AllowedSnssais); PolicyAssociationRequest.guami = ogs_sbi_build_guami(amf_ue->guami); - ogs_expect_or_return_val(PolicyAssociationRequest.guami, NULL); + if (!PolicyAssociationRequest.guami) { + ogs_error("No guami"); + goto end; + } PolicyAssociationRequest.service_name = (char *)OGS_SBI_SERVICE_NAME_NAMF_CALLBACK; PolicyAssociationRequest.supp_feat = ogs_uint64_to_string(amf_ue->am_policy_control_features); - ogs_expect_or_return_val(PolicyAssociationRequest.supp_feat, NULL); + if (!PolicyAssociationRequest.supp_feat) { + ogs_error("No supp_feat"); + goto end; + } message.PolicyAssociationRequest = &PolicyAssociationRequest; request = ogs_sbi_build_request(&message); ogs_expect(request); - ogs_free(PolicyAssociationRequest.notification_uri); - ogs_free(PolicyAssociationRequest.supp_feat); +end: + if (PolicyAssociationRequest.notification_uri) + ogs_free(PolicyAssociationRequest.notification_uri); + if (PolicyAssociationRequest.supp_feat) + ogs_free(PolicyAssociationRequest.supp_feat); if (PolicyAssociationRequest.gpsi) ogs_free(PolicyAssociationRequest.gpsi);
View file
open5gs_2.4.11.tar.xz/src/amf/nsmf-build.c -> open5gs_2.5.0.tar.xz/src/amf/nsmf-build.c
Changed
@@ -22,6 +22,7 @@ ogs_sbi_request_t *amf_nsmf_pdusession_build_create_sm_context( amf_sess_t *sess, void *data) { + amf_nsmf_pdusession_sm_context_param_t *param = data; ogs_sbi_message_t message; ogs_sbi_request_t *request = NULL; @@ -51,12 +52,19 @@ memset(&SmContextCreateData, 0, sizeof(SmContextCreateData)); - ogs_assert(ogs_sbi_self()->nf_instance); - SmContextCreateData.serving_nf_id = ogs_sbi_self()->nf_instance->id; + SmContextCreateData.serving_nf_id = + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance); + if (!SmContextCreateData.serving_nf_id) { + ogs_error("No serving_nf_id"); + goto end; + } SmContextCreateData.serving_network = ogs_sbi_build_plmn_id_nid(&amf_ue->nr_tai.plmn_id); - ogs_expect_or_return_val(SmContextCreateData.serving_network, NULL); + if (!SmContextCreateData.serving_nf_id) { + ogs_error("No serving_network"); + goto end; + } SmContextCreateData.supi = amf_ue->supi; SmContextCreateData.pei = amf_ue->pei; @@ -64,12 +72,18 @@ if (amf_ue->msisdn0) { SmContextCreateData.gpsi = ogs_msprintf("%s-%s", OGS_ID_GPSI_TYPE_MSISDN, amf_ue->msisdn0); - ogs_expect_or_return_val(SmContextCreateData.gpsi, NULL); + if (!SmContextCreateData.gpsi) { + ogs_error("No gpsi"); + goto end; + } } } SmContextCreateData.is_pdu_session_id = true; SmContextCreateData.pdu_session_id = sess->psi; - ogs_expect_or_return_val(sess->dnn, NULL); + if (!SmContextCreateData.pdu_session_id) { + ogs_error("No pdu_session_id"); + goto end; + } SmContextCreateData.dnn = sess->dnn; memset(&sNssai, 0, sizeof(sNssai)); @@ -85,7 +99,10 @@ } SmContextCreateData.guami = ogs_sbi_build_guami(amf_ue->guami); - ogs_expect_or_return_val(SmContextCreateData.guami, NULL); + if (!SmContextCreateData.guami) { + ogs_error("No guami"); + goto end; + } SmContextCreateData.an_type = amf_ue->nas.access_type; memset(&header, 0, sizeof(header)); @@ -95,10 +112,16 @@ header.resource.component1 = (char *)OGS_SBI_RESOURCE_NAME_SM_CONTEXT_STATUS; header.resource.component2 = ogs_msprintf("%d", sess->psi); - ogs_expect_or_return_val(header.resource.component2, NULL); + if (!header.resource.component2) { + ogs_error("No header.resource.component2"); + goto end; + } server = ogs_list_first(&ogs_sbi_self()->server_list); - ogs_expect_or_return_val(server, NULL); + if (!server) { + ogs_error("No server"); + goto end; + } SmContextCreateData.sm_context_status_uri = ogs_sbi_server_uri(server, &header); @@ -110,19 +133,30 @@ memset(&ueLocation, 0, sizeof(ueLocation)); ueLocation.nr_location = ogs_sbi_build_nr_location( &amf_ue->nr_tai, &amf_ue->nr_cgi); - ogs_expect_or_return_val(ueLocation.nr_location, NULL); + if (!ueLocation.nr_location) { + ogs_error("No ueLocation.nr_location"); + goto end; + } ueLocation.nr_location->ue_location_timestamp = ogs_sbi_gmtime_string(amf_ue->ue_location_timestamp); - ogs_expect_or_return_val( - ueLocation.nr_location->ue_location_timestamp, NULL); + if (!ueLocation.nr_location->ue_location_timestamp) { + ogs_error("No ue_location_timestamp"); + goto end; + } SmContextCreateData.ue_location = &ueLocation; SmContextCreateData.ue_time_zone = ogs_sbi_timezone_string(ogs_timezone()); - ogs_expect_or_return_val(SmContextCreateData.ue_time_zone, NULL); + if (!SmContextCreateData.ue_time_zone) { + ogs_error("No ue_time_zone"); + goto end; + } pcf_nf_instance = amf_ue->sbi.service_type_array OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL.nf_instance; - ogs_expect_or_return_val(pcf_nf_instance, NULL); + if (!pcf_nf_instance) { + ogs_error("No pcf_nf_instance"); + goto end; + } SmContextCreateData.pcf_id = pcf_nf_instance->id; message.SmContextCreateData = &SmContextCreateData; @@ -139,13 +173,26 @@ message.http.accept = (char *)(OGS_SBI_CONTENT_JSON_TYPE "," OGS_SBI_CONTENT_NGAP_TYPE "," OGS_SBI_CONTENT_PROBLEM_TYPE); + message.http.custom.callback = + (char *)OGS_SBI_CALLBACK_NSMF_PDUSESSION_STATUS_NOTIFY; + + if (param && param->nrf_uri.nrf.id) { + message.http.custom.nrf_uri = + ogs_msprintf("%s: \"%s\"", + OGS_SBI_SERVICE_NAME_NNRF_DISC, param->nrf_uri.nrf.id); + } + request = ogs_sbi_build_request(&message); ogs_expect(request); +end: + if (SmContextCreateData.serving_network) ogs_sbi_free_plmn_id_nid(SmContextCreateData.serving_network); - ogs_free(SmContextCreateData.sm_context_status_uri); - ogs_free(header.resource.component2); + if (SmContextCreateData.sm_context_status_uri) + ogs_free(SmContextCreateData.sm_context_status_uri); + if (header.resource.component2) + ogs_free(header.resource.component2); if (sNssai.sd) ogs_free(sNssai.sd); if (hplmnSnssai.sd) @@ -162,6 +209,9 @@ if (SmContextCreateData.ue_time_zone) ogs_free(SmContextCreateData.ue_time_zone); + if (message.http.custom.nrf_uri) + ogs_free(message.http.custom.nrf_uri); + return request; } @@ -213,7 +263,10 @@ } if (param->n2smbuf) { - ogs_expect_or_return_val(param->n2SmInfoType, NULL); + if (!param->n2SmInfoType) { + ogs_error("No n2SmInfoType"); + goto end; + } SmContextUpdateData.n2_sm_info_type = param->n2SmInfoType; SmContextUpdateData.n2_sm_info = &n2SmInfo; @@ -235,7 +288,10 @@ if (param->TargetID) { SmContextUpdateData.target_id = amf_nsmf_pdusession_build_target_id(param->TargetID); - ogs_expect_or_return_val(SmContextUpdateData.target_id, NULL); + if (!SmContextUpdateData.target_id) { + ogs_error("No target_id"); + goto end; + } } if (param->ngApCause.group) { @@ -249,18 +305,26 @@ if (param->ue_location) { ueLocation.nr_location = ogs_sbi_build_nr_location( &amf_ue->nr_tai, &amf_ue->nr_cgi); - ogs_expect_or_return_val(ueLocation.nr_location, NULL); + if (!ueLocation.nr_location) { + ogs_error("No ueLocation.nr_location"); + goto end; + } ueLocation.nr_location->ue_location_timestamp = ogs_sbi_gmtime_string(amf_ue->ue_location_timestamp); - ogs_expect_or_return_val( - ueLocation.nr_location->ue_location_timestamp, NULL); + if (!ueLocation.nr_location->ue_location_timestamp) { + ogs_error("No ueLocation.nr_location->ue_location_timestamp"); + goto end; + }
View file
open5gs_2.4.11.tar.xz/src/amf/nsmf-build.h -> open5gs_2.5.0.tar.xz/src/amf/nsmf-build.h
Changed
@@ -51,6 +51,12 @@ OpenAPI_ho_state_e hoState; OpenAPI_ng_ran_target_id_t *targetId; NGAP_TargetID_t *TargetID; + + struct { + struct { + char *id; + } nrf; + } nrf_uri; } amf_nsmf_pdusession_sm_context_param_t; ogs_sbi_request_t *amf_nsmf_pdusession_build_create_sm_context(
View file
open5gs_2.4.11.tar.xz/src/amf/nudm-build.c -> open5gs_2.5.0.tar.xz/src/amf/nudm-build.c
Changed
@@ -44,11 +44,18 @@ memset(&Amf3GppAccessRegistration, 0, sizeof(Amf3GppAccessRegistration)); - ogs_assert(ogs_sbi_self()->nf_instance); - Amf3GppAccessRegistration.amf_instance_id = ogs_sbi_self()->nf_instance->id; + Amf3GppAccessRegistration.amf_instance_id = + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance); + if (!Amf3GppAccessRegistration.amf_instance_id) { + ogs_error("No amf_instance_id"); + goto end; + } server = ogs_list_first(&ogs_sbi_self()->server_list); - ogs_assert(server); + if (!server) { + ogs_error("No server"); + goto end; + } memset(&header, 0, sizeof(header)); header.service.name = (char *)OGS_SBI_SERVICE_NAME_NAMF_CALLBACK; @@ -57,20 +64,32 @@ header.resource.component1 = (char *)OGS_SBI_RESOURCE_NAME_DEREG_NOTIFY; Amf3GppAccessRegistration.dereg_callback_uri = ogs_sbi_server_uri(server, &header); - ogs_assert(Amf3GppAccessRegistration.dereg_callback_uri); + if (!Amf3GppAccessRegistration.dereg_callback_uri) { + ogs_error("No dereg_callback_uri"); + goto end; + } Amf3GppAccessRegistration.guami = ogs_sbi_build_guami(amf_ue->guami); Amf3GppAccessRegistration.rat_type = amf_ue_rat_type(amf_ue); - ogs_assert(Amf3GppAccessRegistration.rat_type != OpenAPI_rat_type_NULL); + if (Amf3GppAccessRegistration.rat_type == OpenAPI_rat_type_NULL) { + ogs_error("No rat_type"); + goto end; + } message.Amf3GppAccessRegistration = &Amf3GppAccessRegistration; + message.http.custom.callback = + (char *)OGS_SBI_CALLBACK_NUDM_UECM_DEREGISTRATION_NOTIFICATION; + request = ogs_sbi_build_request(&message); - ogs_assert(request); + ogs_expect(request); + +end: if (Amf3GppAccessRegistration.guami) ogs_sbi_free_guami(Amf3GppAccessRegistration.guami); - ogs_free(Amf3GppAccessRegistration.dereg_callback_uri); + if (Amf3GppAccessRegistration.dereg_callback_uri) + ogs_free(Amf3GppAccessRegistration.dereg_callback_uri); return request; } @@ -102,6 +121,10 @@ Amf3GppAccessRegistrationModification.guami = ogs_sbi_build_guami(amf_ue->guami); + if (!Amf3GppAccessRegistrationModification.guami) { + ogs_error("No guami"); + goto end; + } Amf3GppAccessRegistrationModification.is_purge_flag = true; Amf3GppAccessRegistrationModification.purge_flag = 1; @@ -109,7 +132,9 @@ &Amf3GppAccessRegistrationModification; request = ogs_sbi_build_request(&message); - ogs_assert(request); + ogs_expect(request); + +end: if (Amf3GppAccessRegistrationModification.guami) ogs_sbi_free_guami(Amf3GppAccessRegistrationModification.guami); @@ -133,7 +158,83 @@ message.h.resource.component1 = data; request = ogs_sbi_build_request(&message); - ogs_assert(request); + ogs_expect(request); + + return request; +} + +ogs_sbi_request_t *amf_nudm_sdm_build_subscription(amf_ue_t *amf_ue, void *data) +{ + ogs_sbi_message_t message; + ogs_sbi_header_t header; + ogs_sbi_request_t *request = NULL; + ogs_sbi_server_t *server = NULL; + + OpenAPI_sdm_subscription_t SDMSubscription; + + char *monres = NULL; + + ogs_assert(amf_ue); + ogs_assert(amf_ue->supi); + ogs_assert(data); + + memset(&message, 0, sizeof(message)); + message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST; + message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NUDM_SDM; + message.h.api.version = (char *)OGS_SBI_API_V2; + message.h.resource.component0 = amf_ue->supi; + message.h.resource.component1 = + (char *)OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS; + + memset(&SDMSubscription, 0, sizeof(SDMSubscription)); + + SDMSubscription.nf_instance_id = + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance); + + server = ogs_list_first(&ogs_sbi_self()->server_list); + if (!server) { + ogs_error("No server"); + goto end; + } + + memset(&header, 0, sizeof(header)); + header.service.name = (char *)OGS_SBI_SERVICE_NAME_NAMF_CALLBACK; + header.api.version = (char *)OGS_SBI_API_V1; + header.resource.component0 = amf_ue->supi; + header.resource.component1 = + (char *)OGS_SBI_RESOURCE_NAME_SDMSUBSCRIPTION_NOTIFY; + SDMSubscription.callback_reference = ogs_sbi_server_uri(server, &header); + if (!SDMSubscription.callback_reference) { + ogs_error("No callback_reference"); + goto end; + } + + SDMSubscription.monitored_resource_uris = OpenAPI_list_create(); + + monres = ogs_msprintf("%s/%s", amf_ue->supi, (char *)data); + if (!monres) { + ogs_error("No monres"); + goto end; + } + + OpenAPI_list_add(SDMSubscription.monitored_resource_uris, monres); + SDMSubscription.implicit_unsubscribe = 1; + + message.SDMSubscription = &SDMSubscription; + + message.http.custom.callback = + (char *)OGS_SBI_CALLBACK_NUDM_SDM_NOTIFICATION; + + request = ogs_sbi_build_request(&message); + ogs_expect(request); + +end: + + if (monres) + ogs_free(monres); + OpenAPI_list_free(SDMSubscription.monitored_resource_uris); + if (SDMSubscription.callback_reference) + ogs_free(SDMSubscription.callback_reference); return request; }
View file
open5gs_2.4.11.tar.xz/src/amf/nudm-build.h -> open5gs_2.5.0.tar.xz/src/amf/nudm-build.h
Changed
@@ -31,6 +31,8 @@ ogs_sbi_request_t *amf_nudm_uecm_build_registration_delete( amf_ue_t *amf_ue, void *data); ogs_sbi_request_t *amf_nudm_sdm_build_get(amf_ue_t *amf_ue, void *data); +ogs_sbi_request_t *amf_nudm_sdm_build_subscription( + amf_ue_t *amf_ue, void *data); #ifdef __cplusplus }
View file
open5gs_2.4.11.tar.xz/src/amf/nudm-handler.c -> open5gs_2.5.0.tar.xz/src/amf/nudm-handler.c
Changed
@@ -220,6 +220,69 @@ break; CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA) + + if (amf_ue->data_change_subscription_id) { + /* we already have a SDM subscription to UDM; continue without + * subscribing again */ + ogs_assert(true == + amf_ue_sbi_discover_and_send( + OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL, NULL, + amf_npcf_am_policy_control_build_create, amf_ue, NULL)); + } + else { + ogs_assert(true == + amf_ue_sbi_discover_and_send( + OGS_SBI_SERVICE_TYPE_NUDM_SDM, NULL, + amf_nudm_sdm_build_subscription, amf_ue, + (char *)OGS_SBI_RESOURCE_NAME_AM_DATA)); + } + break; + + CASE(OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS) + + int rv; + ogs_sbi_message_t message; + ogs_sbi_header_t header; + + if (!recvmsg->http.location) { + ogs_error("%s No http.location", amf_ue->supi); + ogs_assert(OGS_OK == + nas_5gs_send_gmm_reject_from_sbi( + amf_ue, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR)); + return OGS_ERROR; + } + + memset(&header, 0, sizeof(header)); + header.uri = recvmsg->http.location; + + rv = ogs_sbi_parse_header(&message, &header); + if (rv != OGS_OK) { + ogs_error("%s Cannot parse http.location %s", + amf_ue->supi, recvmsg->http.location); + ogs_assert(OGS_OK == + nas_5gs_send_gmm_reject_from_sbi( + amf_ue, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR)); + return OGS_ERROR; + } + + if (!message.h.resource.component2) { + ogs_error("%s No Subscription ID %s", + amf_ue->supi, recvmsg->http.location); + + ogs_sbi_header_free(&header); + ogs_assert(OGS_OK == + nas_5gs_send_gmm_reject_from_sbi( + amf_ue, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR)); + return OGS_ERROR; + } + + if (amf_ue->data_change_subscription_id) + ogs_free(amf_ue->data_change_subscription_id); + amf_ue->data_change_subscription_id = + ogs_strdup(message.h.resource.component2); + + ogs_sbi_header_free(&header); + ogs_assert(true == amf_ue_sbi_discover_and_send( OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL, NULL,
View file
open5gs_2.4.11.tar.xz/src/amf/sbi-path.c -> open5gs_2.5.0.tar.xz/src/amf/sbi-path.c
Changed
@@ -22,67 +22,12 @@ #include "ngap-path.h" #include "nnrf-handler.h" -static int server_cb(ogs_sbi_request_t *request, void *data) -{ - amf_event_t *e = NULL; - int rv; - - ogs_assert(request); - ogs_assert(data); - - e = amf_event_new(OGS_EVENT_SBI_SERVER); - ogs_assert(e); - - e->h.sbi.request = request; - e->h.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; -} - -static int client_cb(int status, ogs_sbi_response_t *response, void *data) -{ - amf_event_t *e = NULL; - int rv; - - if (status != OGS_OK) { - ogs_log_message( - status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0, - "client_cb() failed %d", status); - return OGS_ERROR; - } - - ogs_assert(response); - - e = amf_event_new(OGS_EVENT_SBI_CLIENT); - ogs_assert(e); - e->h.sbi.response = response; - e->h.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; -} - int amf_sbi_open(void) { ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_nf_service_t *service = NULL; - /* Add SELF NF instance */ + /* Initialize SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); ogs_sbi_nf_fsm_init(nf_instance); @@ -104,18 +49,8 @@ /* Initialize NRF NF Instance */ nf_instance = ogs_sbi_self()->nrf_instance; - if (nf_instance) { - ogs_sbi_client_t *client = NULL; - - /* Client callback is only used when NF sends to NRF */ - client = nf_instance->client; - ogs_assert(client); - client->cb = client_cb; - - /* NFRegister is sent and the response is received - * by the above client callback. */ + if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); - } /* Build Subscription-Data */ ogs_sbi_subscription_data_build_default( @@ -131,7 +66,7 @@ ogs_sbi_subscription_data_build_default( OpenAPI_nf_type_NSSF, OGS_SBI_SERVICE_NAME_NNSSF_NSSELECTION); - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) return OGS_ERROR; return OGS_OK; @@ -143,12 +78,12 @@ ogs_sbi_server_stop_all(); } -bool amf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data) +bool amf_sbi_send_request( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact) { ogs_assert(nf_instance); - ogs_assert(data); - - return ogs_sbi_send_request(nf_instance, client_cb, data); + ogs_assert(xact); + return ogs_sbi_send_request_to_nf_instance(nf_instance, xact); } bool amf_ue_sbi_discover_and_send( @@ -174,7 +109,7 @@ return false; } - if (ogs_sbi_discover_and_send(xact, client_cb) != true) { + if (ogs_sbi_discover_and_send(xact) != true) { ogs_error("amf_ue_sbi_discover_and_send() failed"); ogs_sbi_xact_remove(xact); ogs_assert(OGS_OK == @@ -210,7 +145,7 @@ xact->state = state; - if (ogs_sbi_discover_and_send(xact, client_cb) != true) { + if (ogs_sbi_discover_and_send(xact) != true) { ogs_error("amf_sess_sbi_discover_and_send() failed"); ogs_sbi_xact_remove(xact); ogs_assert(OGS_OK == nas_5gs_send_back_gsm_message(sess, @@ -228,18 +163,19 @@ ogs_sbi_xact_t *xact = NULL; ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL; + OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL; ogs_sbi_discovery_option_t *discovery_option = NULL; amf_ue_t *amf_ue = NULL; amf_sess_t *sess = NULL; - ogs_assert(response); - 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; } @@ -247,12 +183,17 @@ ogs_assert(sess); service_type = xact->service_type; + ogs_assert(service_type); + requester_nf_type = xact->requester_nf_type; + ogs_assert(requester_nf_type); discovery_option = xact->discovery_option; sess = amf_sess_cycle(sess); if (!sess) { ogs_error("Session has already been removed"); ogs_sbi_xact_remove(xact); + if (response) + ogs_sbi_response_free(response); return OGS_ERROR; } @@ -268,6 +209,8 @@ return OGS_ERROR; } + ogs_assert(response); + rv = ogs_sbi_parse_response(&message, response); if (rv != OGS_OK) { ogs_error("cannot parse HTTP response"); @@ -293,9 +236,10 @@ goto cleanup; } - ogs_nnrf_handle_nf_discover_search_result(message.SearchResult); + ogs_nnrf_disc_handle_nf_discover_search_result(message.SearchResult); - amf_sbi_select_nf(&sess->sbi, service_type, discovery_option); + amf_sbi_select_nf(&sess->sbi, + service_type, requester_nf_type, discovery_option); if (!sess->sbi.service_type_arrayservice_type.nf_instance) { ogs_error("%s:%d (NF discover) No %s", @@ -314,6 +258,13 @@ amf_nsmf_pdusession_build_create_sm_context, sess, AMF_CREATE_SM_CONTEXT_NO_STATE, NULL); + ogs_sbi_xact_remove(xact);
View file
open5gs_2.4.11.tar.xz/src/amf/sbi-path.h -> open5gs_2.5.0.tar.xz/src/amf/sbi-path.h
Changed
@@ -34,7 +34,8 @@ int amf_sbi_open(void); void amf_sbi_close(void); -bool amf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data); +bool amf_sbi_send_request( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact); bool amf_ue_sbi_discover_and_send( ogs_sbi_service_type_e service_type, ogs_sbi_discovery_option_t *discovery_option,
View file
open5gs_2.4.11.tar.xz/src/ausf/ausf-sm.c -> open5gs_2.5.0.tar.xz/src/ausf/ausf-sm.c
Changed
@@ -94,7 +94,7 @@ CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY) SWITCH(message.h.method) CASE(OGS_SBI_HTTP_METHOD_POST) - ogs_nnrf_handle_nf_status_notify(stream, &message); + ogs_nnrf_nfm_handle_nf_status_notify(stream, &message); break; DEFAULT @@ -215,7 +215,7 @@ CASE(OGS_SBI_HTTP_METHOD_POST) if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED || message.res_status == OGS_SBI_HTTP_STATUS_OK) { - ogs_nnrf_handle_nf_status_subscribe( + ogs_nnrf_nfm_handle_nf_status_subscribe( subscription_data, &message); } else { ogs_error("%s HTTP response error %d",
View file
open5gs_2.4.11.tar.xz/src/ausf/event.h -> open5gs_2.5.0.tar.xz/src/ausf/event.h
Changed
@@ -34,6 +34,8 @@ ausf_ue_t *ausf_ue; } ausf_event_t; +OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(ausf_event_t)); + ausf_event_t *ausf_event_new(int id); const char *ausf_event_get_name(ausf_event_t *e);
View file
open5gs_2.4.11.tar.xz/src/ausf/nnrf-handler.c -> open5gs_2.5.0.tar.xz/src/ausf/nnrf-handler.c
Changed
@@ -29,6 +29,7 @@ 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; OpenAPI_search_result_t *SearchResult = NULL; ogs_assert(recvmsg); @@ -39,6 +40,8 @@ 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; @@ -48,13 +51,14 @@ return; } - ogs_nnrf_handle_nf_discover_search_result(SearchResult); + ogs_nnrf_disc_handle_nf_discover_search_result(SearchResult); nf_instance = ogs_sbi_nf_instance_find_by_discovery_param( - target_nf_type, discovery_option); + target_nf_type, requester_nf_type, discovery_option); if (!nf_instance) { - ogs_error("(NF discover) No %s", - ogs_sbi_service_type_to_name(service_type)); + ogs_error("(NF discover) No %s:%s", + ogs_sbi_service_type_to_name(service_type), + OpenAPI_nf_type_ToString(requester_nf_type)); return; }
View file
open5gs_2.4.11.tar.xz/src/ausf/nudm-build.c -> open5gs_2.5.0.tar.xz/src/ausf/nudm-build.c
Changed
@@ -43,9 +43,8 @@ AuthenticationInfoRequest.serving_network_name = ausf_ue->serving_network_name; - ogs_assert(ogs_sbi_self()->nf_instance); AuthenticationInfoRequest.ausf_instance_id = - ogs_sbi_self()->nf_instance->id; + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance); if (data) { OpenAPI_resynchronization_info_t *recvinfo = data; @@ -61,7 +60,7 @@ message.AuthenticationInfoRequest = &AuthenticationInfoRequest; request = ogs_sbi_build_request(&message); - ogs_expect_or_return_val(request, NULL); + ogs_expect(request); return request; } @@ -84,13 +83,18 @@ message.h.resource.component1 = (char *)OGS_SBI_RESOURCE_NAME_AUTH_EVENTS; AuthEvent = ogs_calloc(1, sizeof(*AuthEvent)); - ogs_expect_or_return_val(AuthEvent, NULL); + if (!AuthEvent) { + ogs_error("No AuthEvent"); + goto end; + } AuthEvent->time_stamp = ogs_sbi_localtime_string(ogs_time_now()); - ogs_expect_or_return_val(AuthEvent->time_stamp, NULL); + if (!AuthEvent->time_stamp) { + ogs_error("No time_stamp"); + goto end; + } - ogs_assert(ogs_sbi_self()->nf_instance); - AuthEvent->nf_instance_id = ogs_sbi_self()->nf_instance->id; + AuthEvent->nf_instance_id = NF_INSTANCE_ID(ogs_sbi_self()->nf_instance); if (ausf_ue->auth_result == OpenAPI_auth_result_AUTHENTICATION_SUCCESS) AuthEvent->success = true; else @@ -101,11 +105,15 @@ message.AuthEvent = AuthEvent; request = ogs_sbi_build_request(&message); - ogs_expect_or_return_val(request, NULL); + ogs_expect(request); - if (AuthEvent->time_stamp) - ogs_free(AuthEvent->time_stamp); - ogs_free(AuthEvent); +end: + + if (AuthEvent) { + if (AuthEvent->time_stamp) + ogs_free(AuthEvent->time_stamp); + ogs_free(AuthEvent); + } return request; }
View file
open5gs_2.4.11.tar.xz/src/ausf/sbi-path.c -> open5gs_2.5.0.tar.xz/src/ausf/sbi-path.c
Changed
@@ -19,67 +19,12 @@ #include "sbi-path.h" -static int server_cb(ogs_sbi_request_t *request, void *data) -{ - ausf_event_t *e = NULL; - int rv; - - ogs_assert(request); - ogs_assert(data); - - e = ausf_event_new(OGS_EVENT_SBI_SERVER); - ogs_assert(e); - - e->h.sbi.request = request; - e->h.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; -} - -static int client_cb(int status, ogs_sbi_response_t *response, void *data) -{ - ausf_event_t *e = NULL; - int rv; - - if (status != OGS_OK) { - ogs_log_message( - status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0, - "client_cb() failed %d", status); - return OGS_ERROR; - } - - ogs_assert(response); - - e = ausf_event_new(OGS_EVENT_SBI_CLIENT); - ogs_assert(e); - e->h.sbi.response = response; - e->h.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; -} - int ausf_sbi_open(void) { ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_nf_service_t *service = NULL; - /* Add SELF NF instance */ + /* Initialize SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); ogs_sbi_nf_fsm_init(nf_instance); @@ -101,24 +46,14 @@ /* Initialize NRF NF Instance */ nf_instance = ogs_sbi_self()->nrf_instance; - if (nf_instance) { - ogs_sbi_client_t *client = NULL; - - /* Client callback is only used when NF sends to NRF */ - client = nf_instance->client; - ogs_assert(client); - client->cb = client_cb; - - /* NFRegister is sent and the response is received - * by the above client callback. */ + if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); - } /* Build Subscription-Data */ ogs_sbi_subscription_data_build_default( OpenAPI_nf_type_UDM, OGS_SBI_SERVICE_NAME_NUDM_UEAU); - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) return OGS_ERROR; return OGS_OK; @@ -130,11 +65,12 @@ ogs_sbi_server_stop_all(); } -bool ausf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data) +bool ausf_sbi_send_request( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact) { ogs_assert(nf_instance); - - return ogs_sbi_send_request(nf_instance, client_cb, data); + ogs_assert(xact); + return ogs_sbi_send_request_to_nf_instance(nf_instance, xact); } bool ausf_sbi_discover_and_send( @@ -164,7 +100,7 @@ xact->assoc_stream = stream; - if (ogs_sbi_discover_and_send(xact, client_cb) != true) { + if (ogs_sbi_discover_and_send(xact) != true) { ogs_error("ausf_sbi_discover_and_send() failed"); ogs_sbi_xact_remove(xact); ogs_assert(true ==
View file
open5gs_2.4.11.tar.xz/src/ausf/sbi-path.h -> open5gs_2.5.0.tar.xz/src/ausf/sbi-path.h
Changed
@@ -29,7 +29,8 @@ int ausf_sbi_open(void); void ausf_sbi_close(void); -bool ausf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data); +bool ausf_sbi_send_request( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact); bool ausf_sbi_discover_and_send( ogs_sbi_service_type_e service_type, ogs_sbi_discovery_option_t *discovery_option,
View file
open5gs_2.4.11.tar.xz/src/bsf/bsf-sm.c -> open5gs_2.5.0.tar.xz/src/bsf/bsf-sm.c
Changed
@@ -97,7 +97,7 @@ CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY) SWITCH(message.h.method) CASE(OGS_SBI_HTTP_METHOD_POST) - ogs_nnrf_handle_nf_status_notify(stream, &message); + ogs_nnrf_nfm_handle_nf_status_notify(stream, &message); break; DEFAULT @@ -237,7 +237,7 @@ CASE(OGS_SBI_HTTP_METHOD_POST) if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED || message.res_status == OGS_SBI_HTTP_STATUS_OK) { - ogs_nnrf_handle_nf_status_subscribe( + ogs_nnrf_nfm_handle_nf_status_subscribe( subscription_data, &message); } else { ogs_error("HTTP response error : %d",
View file
open5gs_2.4.11.tar.xz/src/bsf/event.h -> open5gs_2.5.0.tar.xz/src/bsf/event.h
Changed
@@ -33,6 +33,8 @@ bsf_sess_t *sess; } bsf_event_t; +OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(bsf_event_t)); + bsf_event_t *bsf_event_new(int id); const char *bsf_event_get_name(bsf_event_t *e);
View file
open5gs_2.4.11.tar.xz/src/bsf/nnrf-handler.c -> open5gs_2.5.0.tar.xz/src/bsf/nnrf-handler.c
Changed
@@ -29,6 +29,7 @@ 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; OpenAPI_search_result_t *SearchResult = NULL; ogs_assert(recvmsg); @@ -39,6 +40,8 @@ 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; @@ -48,13 +51,14 @@ return; } - ogs_nnrf_handle_nf_discover_search_result(SearchResult); + ogs_nnrf_disc_handle_nf_discover_search_result(SearchResult); nf_instance = ogs_sbi_nf_instance_find_by_discovery_param( - target_nf_type, discovery_option); + target_nf_type, requester_nf_type, discovery_option); if (!nf_instance) { - ogs_error("(NF discover) No %s", - ogs_sbi_service_type_to_name(service_type)); + ogs_error("(NF discover) No %s:%s", + ogs_sbi_service_type_to_name(service_type), + OpenAPI_nf_type_ToString(requester_nf_type)); return; }
View file
open5gs_2.4.11.tar.xz/src/bsf/sbi-path.c -> open5gs_2.5.0.tar.xz/src/bsf/sbi-path.c
Changed
@@ -19,67 +19,12 @@ #include "sbi-path.h" -static int server_cb(ogs_sbi_request_t *request, void *data) -{ - bsf_event_t *e = NULL; - int rv; - - ogs_assert(request); - ogs_assert(data); - - e = bsf_event_new(OGS_EVENT_SBI_SERVER); - ogs_assert(e); - - e->h.sbi.request = request; - e->h.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; -} - -static int client_cb(int status, ogs_sbi_response_t *response, void *data) -{ - bsf_event_t *e = NULL; - int rv; - - if (status != OGS_OK) { - ogs_log_message( - status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0, - "client_cb() failed %d", status); - return OGS_ERROR; - } - - ogs_assert(response); - - e = bsf_event_new(OGS_EVENT_SBI_CLIENT); - ogs_assert(e); - e->h.sbi.response = response; - e->h.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; -} - int bsf_sbi_open(void) { ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_nf_service_t *service = NULL; - /* Add SELF NF instance */ + /* Initialize SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); ogs_sbi_nf_fsm_init(nf_instance); @@ -103,20 +48,10 @@ /* Initialize NRF NF Instance */ nf_instance = ogs_sbi_self()->nrf_instance; - if (nf_instance) { - ogs_sbi_client_t *client = NULL; - - /* Client callback is only used when NF sends to NRF */ - client = nf_instance->client; - ogs_assert(client); - client->cb = client_cb; - - /* NFRegister is sent and the response is received - * by the above client callback. */ + if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); - } - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) return OGS_ERROR; return OGS_OK; @@ -128,11 +63,12 @@ ogs_sbi_server_stop_all(); } -bool bsf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data) +bool bsf_sbi_send_request( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact) { ogs_assert(nf_instance); - - return ogs_sbi_send_request(nf_instance, client_cb, data); + ogs_assert(xact); + return ogs_sbi_send_request_to_nf_instance(nf_instance, xact); } bool bsf_sbi_discover_and_send( @@ -162,7 +98,7 @@ xact->assoc_stream = stream; - if (ogs_sbi_discover_and_send(xact, client_cb) != true) { + if (ogs_sbi_discover_and_send(xact) != true) { ogs_error("bsf_sbi_discover_and_send() failed"); ogs_sbi_xact_remove(xact); ogs_assert(true ==
View file
open5gs_2.4.11.tar.xz/src/bsf/sbi-path.h -> open5gs_2.5.0.tar.xz/src/bsf/sbi-path.h
Changed
@@ -29,7 +29,8 @@ int bsf_sbi_open(void); void bsf_sbi_close(void); -bool bsf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data); +bool bsf_sbi_send_request( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact); bool bsf_sbi_discover_and_send( ogs_sbi_service_type_e service_type, ogs_sbi_discovery_option_t *discovery_option,
View file
open5gs_2.4.11.tar.xz/src/hss/hss-context.c -> open5gs_2.5.0.tar.xz/src/hss/hss-context.c
Changed
@@ -1190,7 +1190,7 @@ int hss_handle_change_event(const bson_t *document) { - bson_iter_t iter, child1_iter, child2_iter, child3_iter; + bson_iter_t iter, child1_iter, child2_iter; char *utf8 = NULL; uint32_t length = 0; @@ -1201,8 +1201,13 @@ char *imsi_bcd; +#if BSON_MAJOR_VERSION >= 1 && BSON_MINOR_VERSION >= 7 char *as_json = bson_as_relaxed_extended_json(document, NULL); - ogs_debug("Got document: %s\n", as_json); + ogs_debug("Received change stream document: %s\n", as_json); + bson_free (as_json); +# else + ogs_debug("Received change stream document."); +#endif if (!bson_iter_init_find(&iter, document, "fullDocument")) { ogs_error("No 'imsi' field in this document."); return OGS_ERROR; @@ -1238,50 +1243,36 @@ "request_cancel_location") && BSON_ITER_HOLDS_BOOL(&child2_iter)) { send_clr_flag = (char *)bson_iter_bool(&child2_iter); - } else if (!strncmp(child2_key, "msisdn", - strlen("msisdn"))) { - int msisdn_count = 0; - bson_iter_recurse(&child2_iter, &child3_iter); - while (bson_iter_next(&child3_iter)) { - if (BSON_ITER_HOLDS_UTF8(&child3_iter)) { - msisdn_count++; - } - } - if (msisdn_count) { - send_idr_flag = true; - subdatamask = (subdatamask | - OGS_HSS_SUBDATA_MSISDN); - } else { - send_clr_flag = true; - } } else if (!strncmp(child2_key, "access_restriction_data", strlen("access_restriction_data"))) { send_idr_flag = true; - subdatamask = (subdatamask | OGS_HSS_SUBDATA_ARD); + subdatamask = (subdatamask | OGS_DIAM_S6A_SUBDATA_ARD); } else if (!strncmp(child2_key, "subscriber_status", strlen("subscriber_status"))) { send_idr_flag = true; subdatamask = (subdatamask | - OGS_HSS_SUBDATA_SUB_STATUS); + OGS_DIAM_S6A_SUBDATA_SUB_STATUS); } else if (!strncmp(child2_key, "network_access_mode", strlen("network_access_mode"))) { send_idr_flag = true; - subdatamask = (subdatamask | OGS_HSS_SUBDATA_NAM); + subdatamask = (subdatamask | OGS_DIAM_S6A_SUBDATA_NAM); } else if (!strncmp(child2_key, "ambr", strlen("ambr"))) { send_idr_flag = true; - subdatamask = (subdatamask | OGS_HSS_SUBDATA_UEAMBR); + subdatamask = (subdatamask | + OGS_DIAM_S6A_SUBDATA_UEAMBR); } else if (!strncmp(child2_key, "subscribed_rau_tau_timer", strlen("subscribed_rau_tau_timer"))) { send_idr_flag = true; subdatamask = (subdatamask | - OGS_HSS_SUBDATA_RAU_TAU_TIMER); + OGS_DIAM_S6A_SUBDATA_RAU_TAU_TIMER); } else if (!strncmp(child2_key, "slice", strlen("slice"))) { send_idr_flag = true; - subdatamask = (subdatamask | OGS_HSS_SUBDATA_SLICE); + subdatamask = (subdatamask | + OGS_DIAM_S6A_SUBDATA_APN_CONFIG); } } } @@ -1290,8 +1281,6 @@ ogs_debug("No 'updateDescription' field in this document"); } - bson_free (as_json); - if (send_clr_flag) { ogs_info("%s Cancel Location Requested", imsi_bcd); hss_s6a_send_clr(imsi_bcd, NULL, NULL,
View file
open5gs_2.4.11.tar.xz/src/hss/hss-s6a-path.c -> open5gs_2.5.0.tar.xz/src/hss/hss-s6a-path.c
Changed
@@ -314,7 +314,7 @@ int i; - if (subdatamask & OGS_HSS_SUBDATA_MSISDN) { + if (subdatamask & OGS_DIAM_S6A_SUBDATA_MSISDN) { /* * TS29.328 * 6.3.2 MSISDN AVP @@ -350,7 +350,7 @@ } } - if (subdatamask & OGS_HSS_SUBDATA_ARD) { + if (subdatamask & OGS_DIAM_S6A_SUBDATA_ARD) { if (subscription_data->access_restriction_data) { ret = fd_msg_avp_new(ogs_diam_s6a_access_restriction_data, 0, &avp_access_restriction_data); @@ -364,7 +364,7 @@ } } - if (subdatamask & OGS_HSS_SUBDATA_SUB_STATUS) { + if (subdatamask & OGS_DIAM_S6A_SUBDATA_SUB_STATUS) { ret = fd_msg_avp_new( ogs_diam_s6a_subscriber_status, 0, &avp_subscriber_status); ogs_assert(ret == 0); @@ -375,7 +375,7 @@ ogs_assert(ret == 0); } - if (subdatamask & OGS_HSS_SUBDATA_NAM) { + if (subdatamask & OGS_DIAM_S6A_SUBDATA_NAM) { ret = fd_msg_avp_new(ogs_diam_s6a_network_access_mode, 0, &avp_network_access_mode); ogs_assert(ret == 0); @@ -386,7 +386,7 @@ ogs_assert(ret == 0); } - if (subdatamask & OGS_HSS_SUBDATA_UEAMBR) { + if (subdatamask & OGS_DIAM_S6A_SUBDATA_UEAMBR) { /* Set the AMBR */ ret = fd_msg_avp_new(ogs_diam_s6a_ambr, 0, &avp_ambr); ogs_assert(ret == 0); @@ -412,7 +412,7 @@ ogs_assert(ret == 0); } - if (subdatamask & OGS_HSS_SUBDATA_RAU_TAU_TIMER) { + if (subdatamask & OGS_DIAM_S6A_SUBDATA_RAU_TAU_TIMER) { /* Set the Subscribed RAU TAU Timer */ ret = fd_msg_avp_new( ogs_diam_s6a_subscribed_rau_tau_timer, 0, &avp_rau_tau_timer); @@ -425,7 +425,7 @@ ogs_assert(ret == 0); } - if (subdatamask & OGS_HSS_SUBDATA_SLICE) { + if (subdatamask & OGS_DIAM_S6A_SUBDATA_APN_CONFIG) { /* For EPC, we'll use first Slice in Subscription */ if (subscription_data->num_of_slice) slice_data = &subscription_data->slice0; @@ -458,7 +458,7 @@ ogs_diam_s6a_all_apn_configuration_included_indicator, 0, &all_apn_configuration_included_indicator); ogs_assert(ret == 0); - val.i32 = 0; + val.i32 = OGS_ALL_APN_CONFIGURATIONS_INCLUDED; ret = fd_msg_avp_setvalue( all_apn_configuration_included_indicator, &val); ogs_assert(ret == 0); @@ -910,7 +910,7 @@ ret = fd_msg_avp_new(ogs_diam_s6a_subscription_data, 0, &avp); ogs_assert(ret == 0); rv = hss_s6a_avp_add_subscription_data(&subscription_data, - avp, OGS_HSS_SUBDATA_ALL); + avp, OGS_DIAM_S6A_SUBDATA_ALL); if (rv != OGS_OK) { result_code = OGS_DIAM_S6A_ERROR_UNKNOWN_EPS_SUBSCRIPTION; goto out;
View file
open5gs_2.4.11.tar.xz/src/hss/hss-s6a-path.h -> open5gs_2.5.0.tar.xz/src/hss/hss-s6a-path.h
Changed
@@ -26,16 +26,6 @@ extern "C" { #endif -#define OGS_HSS_SUBDATA_NO_UPDATE (0) -#define OGS_HSS_SUBDATA_MSISDN (1) -#define OGS_HSS_SUBDATA_ARD (1 << 1) -#define OGS_HSS_SUBDATA_SUB_STATUS (1 << 2) -#define OGS_HSS_SUBDATA_NAM (1 << 3) -#define OGS_HSS_SUBDATA_UEAMBR (1 << 4) -#define OGS_HSS_SUBDATA_RAU_TAU_TIMER (1 << 5) -#define OGS_HSS_SUBDATA_SLICE (1 << 6) -#define OGS_HSS_SUBDATA_ALL 0xFFFFFFFF - /* HSS Sends Cancel Location Request to MME */ void hss_s6a_send_clr(char *imsi_bcd, char *mme_host, char *mme_realm, uint32_t cancellation_type);
View file
open5gs_2.4.11.tar.xz/src/hss/hss-sm.c -> open5gs_2.5.0.tar.xz/src/hss/hss-sm.c
Changed
@@ -90,7 +90,7 @@ ogs_assert(e->dbi.document); hss_handle_change_event(e->dbi.document); - bson_destroy((bson_t*)e->dbi.document); + bson_destroy(e->dbi.document); break; default:
View file
open5gs_2.4.11.tar.xz/src/mme/emm-handler.c -> open5gs_2.5.0.tar.xz/src/mme/emm-handler.c
Changed
@@ -389,10 +389,10 @@ * * So, we will lose the MME_EPS_TYPE_DETACH_REQUEST_TO_UE. * - * We need more variable(nas_eps.detach_type) + * We need more variable(detach_type) * to keep Detach-Type whether UE-initiated or MME-initiaed. */ - mme_ue->nas_eps.type = mme_ue->nas_eps.detach_type = - MME_EPS_TYPE_DETACH_REQUEST_FROM_UE; + mme_ue->nas_eps.type = MME_EPS_TYPE_DETACH_REQUEST_FROM_UE; + mme_ue->detach_type = MME_DETACH_TYPE_REQUEST_FROM_UE; mme_ue->nas_eps.ksi = detach_type->nas_key_set_identifier; ogs_debug(" OGS_NAS_EPS TYPE%d KSI%d",
View file
open5gs_2.4.11.tar.xz/src/mme/mme-context.c -> open5gs_2.5.0.tar.xz/src/mme/mme-context.c
Changed
@@ -104,7 +104,7 @@ ogs_pool_init(&sgw_ue_pool, ogs_app()->max.ue); ogs_pool_init(&mme_sess_pool, ogs_app()->pool.sess); ogs_pool_init(&mme_bearer_pool, ogs_app()->pool.bearer); - ogs_pool_init(&self.m_tmsi, ogs_app()->max.ue); + ogs_pool_init(&self.m_tmsi, ogs_app()->max.ue*2); self.enb_addr_hash = ogs_hash_make(); ogs_assert(self.enb_addr_hash); @@ -1942,7 +1942,11 @@ ogs_assert(enb); ogs_pool_alloc(&enb_ue_pool, &enb_ue); - ogs_assert(enb_ue); + if (enb_ue == NULL) { + ogs_error("Could not allocate enb_ue context from pool"); + return NULL; + } + memset(enb_ue, 0, sizeof *enb_ue); enb_ue->t_s1_holding = ogs_timer_add( @@ -2266,7 +2270,11 @@ ogs_assert(enb); ogs_pool_alloc(&mme_ue_pool, &mme_ue); - ogs_assert(mme_ue); + if (mme_ue == NULL) { + ogs_error("Could not allocate mme_ue context from pool"); + return NULL; + } + memset(mme_ue, 0, sizeof *mme_ue); /* Add All Timers */ @@ -2698,7 +2706,7 @@ if (SESSION_CONTEXT_IS_AVAILABLE(old_mme_ue)) { ogs_warn("%s Trigger OLD Session Remove", mme_ue->imsi_bcd); mme_gtp_send_delete_all_sessions(old_mme_ue, - OGS_GTP_DELETE_UE_CONTEXT_REMOVE); + OGS_GTP_DELETE_UE_CONTEXT_REMOVE_PARTIAL); } } } @@ -3416,7 +3424,7 @@ int index = 0; ogs_trace("M-TMSI Pool try to generate..."); - for (i = 0; index < ogs_app()->max.ue; i++) { + for (i = 0; index < ogs_app()->max.ue*2; i++) { mme_m_tmsi_t *m_tmsi = NULL; int conflict = 0;
View file
open5gs_2.4.11.tar.xz/src/mme/mme-context.h -> open5gs_2.5.0.tar.xz/src/mme/mme-context.h
Changed
@@ -316,20 +316,25 @@ ogs_nas_eps_update_type_t update; ogs_nas_service_type_t service; ogs_nas_detach_type_t detach; - - /* 1. MME initiated detach request to the UE. - * (nas_eps.type = MME_EPS_TYPE_DETACH_REQUEST_TO_UE) - * 2. If UE is IDLE, Paging sent to the UE - * 3. If UE is wake-up, UE will send Server Request. - * (nas_eps.type = MME_EPS_TYPE_SERVICE_REQUEST) - * - * So, we will lose the MME_EPS_TYPE_DETACH_REQUEST_TO_UE. - * - * We need more variable(nas_eps.detach_type) - * to keep Detach-Type whether UE-initiated or MME-initiaed. */ - uint8_t detach_type; } nas_eps; + /* 1. MME initiated detach request to the UE. + * (nas_eps.type = MME_EPS_TYPE_DETACH_REQUEST_TO_UE) + * 2. If UE is IDLE, Paging sent to the UE + * 3. If UE is wake-up, UE will send Server Request. + * (nas_eps.type = MME_EPS_TYPE_SERVICE_REQUEST) + * + * So, we will lose the MME_EPS_TYPE_DETACH_REQUEST_TO_UE. + * + * We need more variable(detach_type) + * to keep Detach-Type whether UE-initiated or MME-initiaed. */ +#define MME_DETACH_TYPE_REQUEST_FROM_UE 1 +#define MME_DETACH_TYPE_MME_EXPLICIT 2 +#define MME_DETACH_TYPE_HSS_EXPLICIT 3 +#define MME_DETACH_TYPE_MME_IMPLICIT 4 +#define MME_DETACH_TYPE_HSS_IMPLICIT 5 + uint8_t detach_type; + /* UE identity */ #define MME_UE_HAVE_IMSI(__mME) \ ((__mME) && ((__mME)->imsi_len))
View file
open5gs_2.4.11.tar.xz/src/mme/mme-event.h -> open5gs_2.5.0.tar.xz/src/mme/mme-event.h
Changed
@@ -101,6 +101,8 @@ ogs_timer_t *timer; } mme_event_t; +OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(mme_event_t)); + void mme_event_term(void); mme_event_t *mme_event_new(mme_event_e id);
View file
open5gs_2.4.11.tar.xz/src/mme/mme-fd-path.c -> open5gs_2.5.0.tar.xz/src/mme/mme-fd-path.c
Changed
@@ -28,6 +28,11 @@ static struct session_handler *mme_s6a_reg = NULL; +/* s6a process Subscription-Data from avp */ +static int mme_s6a_subscription_data_from_avp(struct avp *avp, + ogs_subscription_data_t *subscription_data, + mme_ue_t *mme_ue, uint32_t *subdatamask); + struct sess_state { mme_ue_t *mme_ue; struct timespec ts; /* Time of sending the message */ @@ -41,6 +46,622 @@ ogs_free(sess_data); } +/* s6a process Subscription-Data from avp */ +static int mme_s6a_subscription_data_from_avp(struct avp *avp, + ogs_subscription_data_t *subscription_data, + mme_ue_t *mme_ue, uint32_t *subdatamask) +{ + int ret; + int error = 0; + char bufOGS_CHRGCHARS_LEN; + struct avp *avpch1, *avpch2, *avpch3, *avpch4, *avpch5; + struct avp_hdr *hdr; + ogs_sockaddr_t addr; + + ogs_assert(avp); + ogs_assert(subscription_data); + ogs_assert(mme_ue); + ogs_assert(subdatamask); + + /* AVP: 'MSISDN'( 701 ) + * The MSISDN AVP is of type OctetString. This AVP contains an MSISDN, + * in international number format as described in ITU-T Rec E.164 8, + * encoded as a TBCD-string, i.e. digits from 0 through 9 are encoded + * 0000 to 1001; 1111 is used as a filler when there is an odd number + * of digits; bits 8 to 5 of octet n encode digit 2n; bits 4 to 1 of + * octet n encode digit 2(n-1)+1. + * Reference: 3GPP TS 29.329 + */ + ret = fd_avp_search_avp(avp, ogs_diam_s6a_msisdn, &avpch1); + ogs_assert(ret == 0); + if (avpch1) { + ret = fd_msg_avp_hdr(avpch1, &hdr); + ogs_assert(ret == 0); + if (hdr->avp_value->os.data && hdr->avp_value->os.len) { + mme_ue->msisdn_len = hdr->avp_value->os.len; + memcpy(mme_ue->msisdn, hdr->avp_value->os.data, + ogs_min(mme_ue->msisdn_len, OGS_MAX_MSISDN_LEN)); + ogs_buffer_to_bcd(mme_ue->msisdn, + mme_ue->msisdn_len, mme_ue->msisdn_bcd); + *subdatamask = (*subdatamask | OGS_DIAM_S6A_SUBDATA_MSISDN); + } + } + + /* AVP: 'A-MSISDN'(1643) + * The A-MSISDN AVP contains an A-MSISDN, in international number + * format as described in ITU-T Rec E.164, encoded as a TBCD-string. + * This AVP shall not include leading indicators for the nature of + * address and the numbering plan; it shall contain only the + * TBCD-encoded digits of the address. + * Reference: 3GPP TS 29.272 7.3.157 + */ + ret = fd_avp_search_avp(avp, ogs_diam_s6a_a_msisdn, &avpch1); + ogs_assert(ret == 0); + if (avpch1) { + ret = fd_msg_avp_hdr(avpch1, &hdr); + ogs_assert(ret == 0); + if (hdr->avp_value->os.data && hdr->avp_value->os.len) { + mme_ue->a_msisdn_len = hdr->avp_value->os.len; + memcpy(mme_ue->a_msisdn, hdr->avp_value->os.data, + ogs_min(mme_ue->a_msisdn_len, OGS_MAX_MSISDN_LEN)); + ogs_buffer_to_bcd(mme_ue->a_msisdn, + mme_ue->a_msisdn_len, mme_ue->a_msisdn_bcd); + *subdatamask = (*subdatamask | OGS_DIAM_S6A_SUBDATA_A_MSISDN); + } + } + + /* AVP: 'Network-Access-Mode'(1417) + * The Network-Access-Mode AVP shall indicate one of three options + * through its value. + * (EPS-IMSI-COMBINED/RESERVED/EPS-ONLY) + * Reference: 3GPP TS 29.272 7.3.21 + */ + ret = fd_avp_search_avp(avp, ogs_diam_s6a_network_access_mode, &avpch1); + ogs_assert(ret == 0); + if (avpch1) { + ret = fd_msg_avp_hdr(avpch1, &hdr); + ogs_assert(ret == 0); + mme_ue->network_access_mode = hdr->avp_value->i32; + *subdatamask = (*subdatamask | OGS_DIAM_S6A_SUBDATA_NAM); + } + + /* AVP: '3GPP-Charging-Characteristics'(13) + * For GGSN, it contains the charging characteristics for + * this PDP Context received in the Create PDP Context + * Request Message (only available in R99 and later releases). + * For PGW, it contains the charging characteristics for the + * IP-CAN bearer. + * Reference: 3GPP TS 29.061 16.4.7.2 13 + */ + ret = fd_avp_search_avp(avp, ogs_diam_s6a_3gpp_charging_characteristics, + &avpch1); + ogs_assert(ret == 0); + if (avpch1) { + ret = fd_msg_avp_hdr(avpch1, &hdr); + memcpy(mme_ue->charging_characteristics, + OGS_HEX(hdr->avp_value->os.data, (int)hdr->avp_value->os.len, buf), + OGS_CHRGCHARS_LEN); + mme_ue->charging_characteristics_presence = true; + *subdatamask = (*subdatamask | OGS_DIAM_S6A_SUBDATA_CC); + } + + /* AVP: 'AMBR'(1435) + * The Amber AVP contains the Max-Requested-Bandwidth-UL and + * Max-Requested-Bandwidth-DL AVPs. + * Reference: 3GPP TS 29.272 7.3.41 + */ + ret = fd_avp_search_avp(avp, ogs_diam_s6a_ambr, &avpch1); + ogs_assert(ret == 0); + if (avpch1) { + /* AVP: 'Max-Requested-Bandwidth-UL'(516) + * The Max -Bandwidth-UL AVP indicates the maximum requested + * bandwidth in bits per second for an uplink IP flow. + * Reference: 3GPP TS 29.212 7.3.41 + */ + ret = fd_avp_search_avp(avpch1, + ogs_diam_s6a_max_bandwidth_ul, &avpch2); + ogs_assert(ret == 0); + if (avpch2) { + ret = fd_msg_avp_hdr(avpch2, &hdr); + ogs_assert(ret == 0); + subscription_data->ambr.uplink = hdr->avp_value->u32; + } else { + ogs_error("no_Max-Bandwidth-UL"); + error++; + } + + /* AVP: 'Max-Requested-Bandwidth-DL'(515) + * The Max-Requested-Bandwidth-DL AVP indicates the maximum + * bandwidth in bits per second for a downlink IP flow. + * Reference: 3GPP TS 29.212 7.3.41 + */ + ret = fd_avp_search_avp(avpch1, + ogs_diam_s6a_max_bandwidth_dl, &avpch2); + ogs_assert(ret == 0); + if (avpch2) { + ret = fd_msg_avp_hdr(avpch2, &hdr); + ogs_assert(ret == 0); + subscription_data->ambr.downlink = hdr->avp_value->u32; + } else { + ogs_error("no_Max-Bandwidth-DL"); + error++; + } + *subdatamask = (*subdatamask | OGS_DIAM_S6A_SUBDATA_UEAMBR); + } + + /* AVP: 'Subscribed-Periodic-RAU-TAU-Timer'(1619) + * The Subscribed-Periodic-TAU-RAU-Timer AVP contains the subscribed + * periodic TAU/RAU timer value in seconds. + * Reference: 3GPP TS 29.272 7.3.134 + */ + ret = fd_avp_search_avp(avp, + ogs_diam_s6a_subscribed_rau_tau_timer, &avpch1); + ogs_assert(ret == 0); + if (avpch1) { + ret = fd_msg_avp_hdr(avpch1, &hdr); + ogs_assert(ret == 0); + subscription_data->subscribed_rau_tau_timer = hdr->avp_value->i32; + *subdatamask = (*subdatamask | OGS_DIAM_S6A_SUBDATA_RAU_TAU_TIMER); + } + + /* AVP: 'APN-Configuration-Profile'(1429) + * The APN-Configuration-Profile AVP shall contain the information + * related to the user's subscribed APN configurations for EPS. The + * Context-Identifier AVP within it shall identify the per subscriber's + * default APN configuration. The Subscription-Data AVP associated + * with an IMSI contains one APN-Configuration-Profile AVP. Each + * APN-Configuration-Profile AVP contains one or more APN-Configuration + * AVPs. Each APN-Configuration AVP describes the configuration for a + * single APN. Therefore, the cardinality of the relationship between + * IMSI and APN is one-to-many. + * Reference: 3GPP TS 29.272 7.3.34 + */ + ret = fd_avp_search_avp(avp, + ogs_diam_s6a_apn_configuration_profile, &avpch1); + ogs_assert(ret == 0); + if (avpch1) { + ogs_slice_data_t *slice_data = NULL; + + ret = fd_msg_browse(avpch1, MSG_BRW_FIRST_CHILD, &avpch2, NULL); + ogs_assert(ret == 0); + + ogs_assert(subscription_data->num_of_slice == 0); + slice_data = &subscription_data->slice0; + while (avpch2) { + ret = fd_msg_avp_hdr(avpch2, &hdr); + ogs_assert(ret == 0);
View file
open5gs_2.4.11.tar.xz/src/mme/mme-path.c -> open5gs_2.5.0.tar.xz/src/mme/mme-path.c
Changed
@@ -28,8 +28,9 @@ { ogs_assert(mme_ue); - switch (mme_ue->nas_eps.detach_type) { - case MME_EPS_TYPE_DETACH_REQUEST_FROM_UE: + switch (mme_ue->detach_type) { + case MME_DETACH_TYPE_REQUEST_FROM_UE: + ogs_debug("Detach Request from UE"); if (SESSION_CONTEXT_IS_AVAILABLE(mme_ue)) { mme_gtp_send_delete_all_sessions( mme_ue, OGS_GTP_DELETE_SEND_DETACH_ACCEPT); @@ -37,13 +38,56 @@ ogs_assert(OGS_OK == nas_eps_send_detach_accept(mme_ue)); } break; - case MME_EPS_TYPE_DETACH_REQUEST_TO_UE: + + /* MME Explicit Detach, ie: O&M Procedures */ + case MME_DETACH_TYPE_MME_EXPLICIT: + ogs_fatal("Not Implemented : MME_DETACH_TYPE_MME_EXPLICIT"); + ogs_assert_if_reached(); + break; + + /* HSS Explicit Detach, ie: Subscription Withdrawl Cancel Location + * + * TS23.401 - V16.10.0 + * Ch 5.3.8 Detach procedure + * Ch 5.3.8.4 HSS-initiated Detach procedure + */ + case MME_DETACH_TYPE_HSS_EXPLICIT: + ogs_debug("Explicit HSS Detach"); if (SESSION_CONTEXT_IS_AVAILABLE(mme_ue)) { mme_gtp_send_delete_all_sessions(mme_ue, OGS_GTP_DELETE_NO_ACTION); } break; + + /* MME Implicit Detach, ie: Lost Communication */ + case MME_DETACH_TYPE_MME_IMPLICIT: + ogs_fatal("Not Implemented : MME_DETACH_TYPE_MME_IMPLICIT"); + ogs_assert_if_reached(); + break; + + /* HSS Implicit Detach, ie: MME-UPDATE-PROCEDURE + * + * TS23.401 - V16.10.0 + * Ch 5.3.2 Attach procedure + * Ch 5.3.2.1 E-UTRAN Initial Attach + * + * 9. The HSS sends Cancel Location (IMSI, Cancellation Type) + * to the old MME. The old MME acknowledges with Cancel Location Ack (IMSI) + * and removes the MM and bearer contexts. If the ULR-Flags indicates + * "Initial-Attach-Indicator" and the HSS has the SGSN registration, + * then the HSS sends Cancel Location (IMSI, Cancellation Type) + * to the old SGSN. The Cancellation Type indicates the old MME/SGSN + * to release the old Serving GW resource. + */ + case MME_DETACH_TYPE_HSS_IMPLICIT: + ogs_debug("Implicit HSS Detach"); + if (SESSION_CONTEXT_IS_AVAILABLE(mme_ue)) { + mme_gtp_send_delete_all_sessions(mme_ue, + OGS_GTP_DELETE_SEND_RELEASE_WITH_UE_CONTEXT_REMOVE); + } + break; + default: - ogs_fatal(" Invalid OGS_NAS_EPS TYPE%d", mme_ue->nas_eps.type); + ogs_fatal(" Invalid OGS_NAS_EPS TYPE%d", mme_ue->detach_type); ogs_assert_if_reached(); } } @@ -54,7 +98,7 @@ if (SESSION_CONTEXT_IS_AVAILABLE(mme_ue)) { mme_gtp_send_delete_all_sessions(mme_ue, - OGS_GTP_DELETE_SEND_UE_CONTEXT_RELEASE_COMMAND); + OGS_GTP_DELETE_SEND_RELEASE_WITH_UE_CONTEXT_REMOVE); } else { enb_ue_t *enb_ue = enb_ue_cycle(mme_ue->enb_ue); if (enb_ue) {
View file
open5gs_2.4.11.tar.xz/src/mme/mme-s11-handler.c -> open5gs_2.5.0.tar.xz/src/mme/mme-s11-handler.c
Changed
@@ -592,21 +592,22 @@ CLEAR_SGW_S1U_PATH(sess); return; - } else if (action == OGS_GTP_DELETE_SEND_UE_CONTEXT_RELEASE_COMMAND) { + } else if (action == OGS_GTP_DELETE_SEND_RELEASE_WITH_UE_CONTEXT_REMOVE) { if (mme_sess_count(mme_ue) == 1) /* Last Session */ { - enb_ue_t *enb_ue = NULL; - - enb_ue = enb_ue_cycle(mme_ue->enb_ue); - if (enb_ue) { + if (ECM_IDLE(mme_ue)) { + mme_ue_hash_remove(mme_ue); + mme_ue_remove(mme_ue); + } else { + ogs_assert(mme_ue->enb_ue); ogs_assert(OGS_OK == - s1ap_send_ue_context_release_command(enb_ue, + s1ap_send_ue_context_release_command(mme_ue->enb_ue, S1AP_Cause_PR_nas, S1AP_CauseNas_normal_release, S1AP_UE_CTX_REL_UE_CONTEXT_REMOVE, 0)); - } else - ogs_error("ENB-S1 Context has already been removed"); + } } - } else if (action == OGS_GTP_DELETE_SEND_S1_REMOVE_AND_UNLINK) { + } else if (action == + OGS_GTP_DELETE_SEND_RELEASE_WITH_S1_REMOVE_AND_UNLINK) { if (mme_sess_count(mme_ue) == 1) /* Last Session */ { enb_ue_t *enb_ue = NULL; @@ -633,7 +634,7 @@ } } - } else if (action == OGS_GTP_DELETE_UE_CONTEXT_REMOVE) { + } else if (action == OGS_GTP_DELETE_UE_CONTEXT_REMOVE_PARTIAL) { /* Remove MME-UE Context with Session Context since IMSI duplicated */ mme_ue_remove(mme_ue);
View file
open5gs_2.4.11.tar.xz/src/mme/mme-s6a-handler.c -> open5gs_2.5.0.tar.xz/src/mme/mme-s6a-handler.c
Changed
@@ -33,6 +33,9 @@ static uint8_t emm_cause_from_diameter( const uint32_t *dia_err, const uint32_t *dia_exp_err); +static uint8_t mme_ue_session_from_slice_data(mme_ue_t *mme_ue, + ogs_slice_data_t *slice_data); + uint8_t mme_s6a_handle_aia( mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message) { @@ -74,7 +77,7 @@ ogs_diam_s6a_ula_message_t *ula_message = NULL; ogs_subscription_data_t *subscription_data = NULL; ogs_slice_data_t *slice_data = NULL; - int i, rv; + int rv, num_of_session; ogs_assert(mme_ue); ogs_assert(s6a_message); @@ -95,58 +98,13 @@ mme_session_remove_all(mme_ue); - for (i = 0; i < slice_data->num_of_session; i++) { - if (i >= OGS_MAX_NUM_OF_SESS) { - ogs_warn("Ignore max session count overflow %d>=%d", - slice_data->num_of_session, OGS_MAX_NUM_OF_SESS); - break; - } - - if (slice_data->sessioni.name) { - mme_ue->sessioni.name = ogs_strdup(slice_data->sessioni.name); - ogs_assert(mme_ue->sessioni.name); - } - - mme_ue->sessioni.context_identifier = - slice_data->sessioni.context_identifier; - - if (slice_data->sessioni.session_type == OGS_PDU_SESSION_TYPE_IPV4 || - slice_data->sessioni.session_type == OGS_PDU_SESSION_TYPE_IPV6 || - slice_data->sessioni.session_type == - OGS_PDU_SESSION_TYPE_IPV4V6) { - mme_ue->sessioni.session_type = - slice_data->sessioni.session_type; - } else { - ogs_error("Invalid PDN_TYPE%d", - slice_data->sessioni.session_type); - if (mme_ue->sessioni.name) - ogs_free(mme_ue->sessioni.name); - break; - } - memcpy(&mme_ue->sessioni.paa, &slice_data->sessioni.paa, - sizeof(mme_ue->sessioni.paa)); - - memcpy(&mme_ue->sessioni.qos, &slice_data->sessioni.qos, - sizeof(mme_ue->sessioni.qos)); - memcpy(&mme_ue->sessioni.ambr, &slice_data->sessioni.ambr, - sizeof(mme_ue->sessioni.ambr)); - - memcpy(&mme_ue->sessioni.smf_ip, &slice_data->sessioni.smf_ip, - sizeof(mme_ue->sessioni.smf_ip)); - - memcpy(&mme_ue->sessioni.charging_characteristics, - &slice_data->sessioni.charging_characteristics, - sizeof(mme_ue->sessioni.charging_characteristics)); - mme_ue->sessioni.charging_characteristics_presence = - slice_data->sessioni.charging_characteristics_presence; - } - - if (i == 0) { + num_of_session = mme_ue_session_from_slice_data(mme_ue, slice_data); + if (num_of_session == 0) { ogs_error("No Session"); return OGS_NAS_EMM_CAUSE_SEVERE_NETWORK_FAILURE; } + mme_ue->num_of_session = num_of_session; - mme_ue->num_of_session = i; mme_ue->context_identifier = slice_data->context_identifier; if (mme_ue->nas_eps.type == MME_EPS_TYPE_ATTACH_REQUEST) { @@ -168,11 +126,78 @@ return OGS_NAS_EMM_CAUSE_REQUEST_ACCEPTED; } -void mme_s6a_handle_clr( - mme_ue_t *mme_ue, ogs_diam_s6a_clr_message_t *clr_message) +uint8_t mme_s6a_handle_idr( + mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message) +{ + ogs_diam_s6a_idr_message_t *idr_message = NULL; + ogs_subscription_data_t *subscription_data = NULL; + ogs_slice_data_t *slice_data = NULL; + int num_of_session; + + ogs_assert(mme_ue); + ogs_assert(s6a_message); + idr_message = &s6a_message->idr_message; + ogs_assert(idr_message); + subscription_data = &idr_message->subscription_data; + ogs_assert(subscription_data); + + if (idr_message->subdatamask & OGS_DIAM_S6A_SUBDATA_UEAMBR) { + memcpy(&mme_ue->ambr, &subscription_data->ambr, sizeof(ogs_bitrate_t)); + } + + if (idr_message->subdatamask & OGS_DIAM_S6A_SUBDATA_APN_CONFIG) { + ogs_assert(subscription_data->num_of_slice == 1); + slice_data = &subscription_data->slice0; + + if (slice_data->all_apn_config_inc == + OGS_ALL_APN_CONFIGURATIONS_INCLUDED) { + mme_session_remove_all(mme_ue); + num_of_session = mme_ue_session_from_slice_data(mme_ue, slice_data); + if (num_of_session == 0) { + ogs_error("No Session"); + return OGS_ERROR; + } + mme_ue->num_of_session = num_of_session; + } else { + ogs_error ("%d Partial APN-Configuration Not Supported in IDR.", + slice_data->all_apn_config_inc); + return OGS_ERROR; + } + + mme_ue->context_identifier = slice_data->context_identifier; + } + + return OGS_OK; +} + +void mme_s6a_handle_clr(mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message) { + ogs_diam_s6a_clr_message_t *clr_message = NULL; ogs_assert(mme_ue); - ogs_assert(clr_message); + ogs_assert(s6a_message); + clr_message = &s6a_message->clr_message; + ogs_assert(clr_message); + + mme_ue = mme_ue_cycle(mme_ue); + if (!mme_ue) { + ogs_warn("UE(mme-ue) context has already been removed"); + return; + } + + /* + * This causes issues in this scenario: + * 1. UE attaches + * 2. UE detaches (Airplane Mode) + * 3. Cancel Location is triggered by HSS + * + * If Cancel Locations are performed, UE(mme-ue) context must be removed. + */ + if (OGS_FSM_CHECK(&mme_ue->sm, emm_state_de_registered)) { + ogs_warn("UE has already been de-registered"); + mme_ue_hash_remove(mme_ue); + mme_ue_remove(mme_ue); + return; + } /* Set EPS Detach */ memset(&mme_ue->nas_eps.detach, 0, sizeof(ogs_nas_detach_type_t)); @@ -192,30 +217,107 @@ * * So, we will lose the MME_EPS_TYPE_DETACH_REQUEST_TO_UE. * - * We need more variable(nas_eps.detach_type) + * We need more variable(detach_type) * to keep Detach-Type whether UE-initiated or MME-initiaed. */ - mme_ue->nas_eps.type = mme_ue->nas_eps.detach_type = - MME_EPS_TYPE_DETACH_REQUEST_TO_UE; + mme_ue->nas_eps.type = MME_EPS_TYPE_DETACH_REQUEST_TO_UE; + ogs_debug(" OGS_NAS_EPS TYPE%d", mme_ue->nas_eps.type); - if (OGS_FSM_CHECK(&mme_ue->sm, emm_state_de_registered)) { - /* Remove all trace of subscriber even when detached. */ - mme_ue_hash_remove(mme_ue); - mme_ue_remove(mme_ue); - } else if (ECM_IDLE(mme_ue)) { - MME_STORE_PAGING_INFO(mme_ue, MME_PAGING_TYPE_DETACH_TO_UE, NULL); - ogs_assert(OGS_OK == s1ap_send_paging(mme_ue, S1AP_CNDomain_ps)); - } else { - ogs_assert(OGS_OK == nas_eps_send_detach_request(mme_ue)); + switch (clr_message->cancellation_type) { + case OGS_DIAM_S6A_CT_SUBSCRIPTION_WITHDRAWL: + mme_ue->detach_type = MME_DETACH_TYPE_HSS_EXPLICIT; + + /* + * Before sending Detach-Request, + * we need to check whether UE is IDLE or not. + */ + if (ECM_IDLE(mme_ue)) { + MME_STORE_PAGING_INFO(mme_ue, MME_PAGING_TYPE_DETACH_TO_UE, NULL); + ogs_assert(OGS_OK == s1ap_send_paging(mme_ue, S1AP_CNDomain_ps)); + } else { + ogs_assert(OGS_OK == nas_eps_send_detach_request(mme_ue)); + if (MME_P_TMSI_IS_AVAILABLE(mme_ue)) { + ogs_assert(OGS_OK == sgsap_send_detach_indication(mme_ue));
View file
open5gs_2.4.11.tar.xz/src/mme/mme-s6a-handler.h -> open5gs_2.5.0.tar.xz/src/mme/mme-s6a-handler.h
Changed
@@ -30,8 +30,10 @@ mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message); uint8_t mme_s6a_handle_ula( mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message); +uint8_t mme_s6a_handle_idr( + mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message); void mme_s6a_handle_clr( - mme_ue_t *mme_ue, ogs_diam_s6a_clr_message_t *clr_message); + mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message); #ifdef __cplusplus }
View file
open5gs_2.4.11.tar.xz/src/mme/mme-sm.c -> open5gs_2.5.0.tar.xz/src/mme/mme-sm.c
Changed
@@ -250,7 +250,15 @@ mme_ue = mme_ue_find_by_message(&nas_message); if (!mme_ue) { mme_ue = mme_ue_add(enb_ue); - ogs_assert(mme_ue); + if (mme_ue == NULL) { + ogs_expect(OGS_OK == + s1ap_send_ue_context_release_command(enb_ue, + S1AP_Cause_PR_misc, + S1AP_CauseMisc_control_processing_overload, + S1AP_UE_CTX_REL_S1_CONTEXT_REMOVE, 0)); + ogs_pkbuf_free(pkbuf); + return; + } } else { /* Here, if the MME_UE Context is found, * the integrity check is not performed @@ -432,14 +440,16 @@ } break; case OGS_DIAM_S6A_CMD_CODE_CANCEL_LOCATION: - mme_s6a_handle_clr(mme_ue, &s6a_message->clr_message); + mme_s6a_handle_clr(mme_ue, s6a_message); break; case OGS_DIAM_S6A_CMD_CODE_INSERT_SUBSCRIBER_DATA: + mme_s6a_handle_idr(mme_ue, s6a_message); break; default: ogs_error("Invalid Type%d", s6a_message->cmd_code); break; } + ogs_subscription_data_free(&s6a_message->idr_message.subscription_data); ogs_subscription_data_free(&s6a_message->ula_message.subscription_data); ogs_free(s6a_message); break;
View file
open5gs_2.4.11.tar.xz/src/mme/s1ap-handler.c -> open5gs_2.5.0.tar.xz/src/mme/s1ap-handler.c
Changed
@@ -258,7 +258,13 @@ enb_ue = enb_ue_find_by_enb_ue_s1ap_id(enb, *ENB_UE_S1AP_ID); if (!enb_ue) { enb_ue = enb_ue_add(enb, *ENB_UE_S1AP_ID); - ogs_assert(enb_ue); + if (enb_ue == NULL) { + ogs_assert(OGS_OK == + s1ap_send_error_indication(enb, NULL, NULL, + S1AP_Cause_PR_misc, + S1AP_CauseMisc_control_processing_overload)); + return; + } /* Find MME_UE if S_TMSI included */ if (S_TMSI) {
View file
open5gs_2.4.11.tar.xz/src/mme/s1ap-path.c -> open5gs_2.5.0.tar.xz/src/mme/s1ap-path.c
Changed
@@ -515,7 +515,13 @@ ogs_assert(target_enb); target_ue = enb_ue_add(target_enb, INVALID_UE_S1AP_ID); - ogs_assert(target_ue); + if (target_ue == NULL) { + ogs_assert(OGS_OK == + s1ap_send_error_indication(target_enb, NULL, NULL, + S1AP_Cause_PR_misc, + S1AP_CauseMisc_control_processing_overload)); + return OGS_ERROR; + } ogs_info(" Source : ENB_UE_S1AP_ID%d MME_UE_S1AP_ID%d", source_ue->enb_ue_s1ap_id, source_ue->mme_ue_s1ap_id);
View file
open5gs_2.4.11.tar.xz/src/nrf/context.c -> open5gs_2.5.0.tar.xz/src/nrf/context.c
Changed
@@ -44,8 +44,12 @@ ogs_assert(context_initialized == 1); ogs_list_for_each_safe( - &ogs_sbi_self()->nf_instance_list, next_nf_instance, nf_instance) - if (OGS_FSM_STATE(&nf_instance->sm)) nrf_nf_fsm_fini(nf_instance); + &ogs_sbi_self()->nf_instance_list, next_nf_instance, nf_instance) { + if (NF_INSTANCE_TYPE_IS_NRF(nf_instance)) + continue; + if (OGS_FSM_STATE(&nf_instance->sm)) + nrf_nf_fsm_fini(nf_instance); + } context_initialized = 0; }
View file
open5gs_2.4.11.tar.xz/src/nrf/event.c -> open5gs_2.5.0.tar.xz/src/nrf/event.c
Changed
@@ -20,54 +20,35 @@ #include "event.h" #include "context.h" -static OGS_POOL(pool, nrf_event_t); - -void nrf_event_init(void) -{ - ogs_pool_init(&pool, ogs_app()->pool.event); -} - -void nrf_event_final(void) -{ - ogs_pool_final(&pool); -} - -nrf_event_t *nrf_event_new(nrf_event_e id) +nrf_event_t *nrf_event_new(int id) { nrf_event_t *e = NULL; - ogs_pool_alloc(&pool, &e); + e = ogs_event_size(id, sizeof(nrf_event_t)); ogs_assert(e); - memset(e, 0, sizeof(*e)); - e->id = id; + e->h.id = id; return e; } -void nrf_event_free(nrf_event_t *e) -{ - ogs_assert(e); - ogs_pool_free(&pool, e); -} - const char *nrf_event_get_name(nrf_event_t *e) { if (e == NULL) return OGS_FSM_NAME_INIT_SIG; - switch (e->id) { + switch (e->h.id) { case OGS_FSM_ENTRY_SIG: return OGS_FSM_NAME_ENTRY_SIG; case OGS_FSM_EXIT_SIG: return OGS_FSM_NAME_EXIT_SIG; - case NRF_EVT_SBI_SERVER: - return "NRF_EVT_SBI_SERVER"; - case NRF_EVT_SBI_CLIENT: - return "NRF_EVT_SBI_CLIENT"; - case NRF_EVT_SBI_TIMER: - return "NRF_EVT_SBI_TIMER"; + case OGS_EVENT_SBI_SERVER: + return OGS_EVENT_NAME_SBI_SERVER; + case OGS_EVENT_SBI_CLIENT: + return OGS_EVENT_NAME_SBI_CLIENT; + case OGS_EVENT_SBI_TIMER: + return OGS_EVENT_NAME_SBI_TIMER; default: break;
View file
open5gs_2.4.11.tar.xz/src/nrf/event.h -> open5gs_2.5.0.tar.xz/src/nrf/event.h
Changed
@@ -26,44 +26,17 @@ extern "C" { #endif -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 ogs_sbi_nf_instance_s ogs_sbi_nf_instance_t; typedef struct ogs_sbi_subscription_data_s ogs_sbi_subscription_data_t; -typedef enum { - NRF_EVT_BASE = OGS_MAX_NUM_OF_PROTO_EVENT, - - NRF_EVT_SBI_SERVER, - NRF_EVT_SBI_CLIENT, - NRF_EVT_SBI_TIMER, - - NRF_EVT_TOP, - -} nrf_event_e; - typedef struct nrf_event_s { - int id; - int timer_id; - - struct { - ogs_sbi_request_t *request; - ogs_sbi_response_t *response; - void *data; - - ogs_sbi_message_t *message; - } sbi; + ogs_event_t h; ogs_sbi_nf_instance_t *nf_instance; ogs_sbi_subscription_data_t *subscription_data; } nrf_event_t; -void nrf_event_init(void); -void nrf_event_final(void); - -nrf_event_t *nrf_event_new(nrf_event_e id); -void nrf_event_free(nrf_event_t *e); +nrf_event_t *nrf_event_new(int id); const char *nrf_event_get_name(nrf_event_t *e);
View file
open5gs_2.4.11.tar.xz/src/nrf/init.c -> open5gs_2.5.0.tar.xz/src/nrf/init.c
Changed
@@ -30,7 +30,6 @@ ogs_sbi_context_init(); nrf_context_init(); - nrf_event_init(); rv = ogs_sbi_context_parse_config("nrf", NULL, "scp"); if (rv != OGS_OK) return rv; @@ -85,8 +84,6 @@ nrf_context_final(); ogs_sbi_context_final(); - - nrf_event_final(); /* Destroy event */ } static void nrf_main(void *data) @@ -127,7 +124,7 @@ ogs_assert(e); ogs_fsm_dispatch(&nrf_sm, e); - nrf_event_free(e); + ogs_event_free(e); } } done:
View file
open5gs_2.4.11.tar.xz/src/nrf/nf-sm.c -> open5gs_2.5.0.tar.xz/src/nrf/nf-sm.c
Changed
@@ -95,17 +95,17 @@ nf_instance = e->nf_instance; ogs_assert(nf_instance); - switch (e->id) { + switch (e->h.id) { case OGS_FSM_ENTRY_SIG: break; case OGS_FSM_EXIT_SIG: break; - case NRF_EVT_SBI_SERVER: - message = e->sbi.message; + case OGS_EVENT_SBI_SERVER: + message = e->h.sbi.message; ogs_assert(message); - stream = e->sbi.data; + stream = e->h.sbi.data; ogs_assert(stream); SWITCH(message->h.service.name) @@ -185,7 +185,7 @@ nf_instance = e->nf_instance; ogs_assert(nf_instance); - switch (e->id) { + switch (e->h.id) { case OGS_FSM_ENTRY_SIG: ogs_info("%s NF registered Heartbeat:%ds", nf_instance->id, nf_instance->time.heartbeat_interval); @@ -212,10 +212,10 @@ OpenAPI_notification_event_type_NF_DEREGISTERED, nf_instance)); break; - case NRF_EVT_SBI_SERVER: - message = e->sbi.message; + case OGS_EVENT_SBI_SERVER: + message = e->h.sbi.message; ogs_assert(message); - stream = e->sbi.data; + stream = e->h.sbi.data; ogs_assert(stream); SWITCH(message->h.service.name) @@ -300,7 +300,7 @@ nrf_sm_debug(e); - switch (e->id) { + switch (e->h.id) { case OGS_FSM_ENTRY_SIG: break; case OGS_FSM_EXIT_SIG: @@ -318,7 +318,7 @@ nrf_sm_debug(e); - switch (e->id) { + switch (e->h.id) { case OGS_FSM_ENTRY_SIG: break; case OGS_FSM_EXIT_SIG:
View file
open5gs_2.4.11.tar.xz/src/nrf/nnrf-build.c -> open5gs_2.5.0.tar.xz/src/nrf/nnrf-build.c
Changed
@@ -44,12 +44,18 @@ message.http.accept = (char *)OGS_SBI_CONTENT_PROBLEM_TYPE; NotificationData = ogs_calloc(1, sizeof(*NotificationData)); - ogs_expect_or_return_val(NotificationData, NULL); + if (!NotificationData) { + ogs_error("No NotificationData"); + goto end; + } NotificationData->event = event; server = ogs_list_first(&ogs_sbi_self()->server_list); - ogs_expect_or_return_val(server, NULL); + if (!server) { + ogs_error("No server"); + goto end; + } memset(&header, 0, sizeof(header)); header.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM; @@ -58,7 +64,10 @@ header.resource.component1 = nf_instance->id; NotificationData->nf_instance_uri = ogs_sbi_server_uri(server, &header); - ogs_expect_or_return_val(NotificationData->nf_instance_uri, NULL); + if (!server) { + ogs_error("No nf_instance_uri"); + goto end; + } if (event != OpenAPI_notification_event_type_NF_DEREGISTERED) { NotificationData->nf_profile = @@ -67,19 +76,26 @@ subscription_data->subscr_cond.service_name, NULL, subscription_data->requester_features); - ogs_expect_or_return_val(NotificationData->nf_profile, NULL); + if (!NotificationData->nf_profile) { + ogs_error("No nf_profile"); + goto end; + } } message.NotificationData = NotificationData; request = ogs_sbi_build_request(&message); - ogs_expect_or_return_val(request, NULL); + ogs_expect(request); - if (NotificationData->nf_profile) - ogs_nnrf_nfm_free_nf_profile(NotificationData->nf_profile); +end: - ogs_free(NotificationData->nf_instance_uri); - ogs_free(NotificationData); + if (NotificationData) { + if (NotificationData->nf_profile) + ogs_nnrf_nfm_free_nf_profile(NotificationData->nf_profile); + if (NotificationData->nf_instance_uri) + ogs_free(NotificationData->nf_instance_uri); + ogs_free(NotificationData); + } return request; }
View file
open5gs_2.4.11.tar.xz/src/nrf/nnrf-handler.c -> open5gs_2.5.0.tar.xz/src/nrf/nnrf-handler.c
Changed
@@ -40,7 +40,7 @@ return false; } - ogs_sbi_nnrf_handle_nf_profile(nf_instance, NFProfile); + ogs_nnrf_nfm_handle_nf_profile(nf_instance, NFProfile); if (OGS_FSM_CHECK(&nf_instance->sm, nrf_nf_state_will_register)) { recvmsg->http.location = recvmsg->h.uri;
View file
open5gs_2.4.11.tar.xz/src/nrf/nrf-sm.c -> open5gs_2.5.0.tar.xz/src/nrf/nrf-sm.c
Changed
@@ -51,17 +51,17 @@ ogs_assert(s); - switch (e->id) { + switch (e->h.id) { case OGS_FSM_ENTRY_SIG: break; case OGS_FSM_EXIT_SIG: break; - case NRF_EVT_SBI_SERVER: - request = e->sbi.request; + case OGS_EVENT_SBI_SERVER: + request = e->h.sbi.request; ogs_assert(request); - stream = e->sbi.data; + stream = e->h.sbi.data; ogs_assert(stream); rv = ogs_sbi_parse_request(&message, request); @@ -141,7 +141,7 @@ e->nf_instance = nf_instance; ogs_assert(OGS_FSM_STATE(&nf_instance->sm)); - e->sbi.message = &message; + e->h.sbi.message = &message; ogs_fsm_dispatch(&nf_instance->sm, e); if (OGS_FSM_CHECK(&nf_instance->sm, nrf_nf_state_de_registered)) { @@ -235,8 +235,8 @@ ogs_sbi_message_free(&message); break; - case NRF_EVT_SBI_TIMER: - switch(e->timer_id) { + case OGS_EVENT_SBI_TIMER: + switch(e->h.timer_id) { case NRF_TIMER_NF_INSTANCE_NO_HEARTBEAT: nf_instance = e->nf_instance; ogs_assert(nf_instance); @@ -261,7 +261,7 @@ default: ogs_error("Unknown timer%s:%d", - nrf_timer_get_name(e->timer_id), e->timer_id); + nrf_timer_get_name(e->h.timer_id), e->h.timer_id); } break;
View file
open5gs_2.4.11.tar.xz/src/nrf/sbi-path.c -> open5gs_2.5.0.tar.xz/src/nrf/sbi-path.c
Changed
@@ -19,34 +19,6 @@ #include "sbi-path.h" -static int server_cb(ogs_sbi_request_t *request, void *data) -{ - nrf_event_t *e = NULL; - int rv; - - ogs_assert(request); - ogs_assert(data); - - e = nrf_event_new(NRF_EVT_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) { - if (rv != OGS_DONE) - ogs_error("ogs_queue_push() failed:%d", (int)rv); - else - ogs_warn("ogs_queue_push() failed:%d", (int)rv); - ogs_sbi_request_free(request); - nrf_event_free(e); - return OGS_ERROR; - } - - return OGS_OK; -} - static int client_notify_cb( int status, ogs_sbi_response_t *response, void *data) { @@ -80,7 +52,16 @@ int nrf_sbi_open(void) { - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + ogs_sbi_nf_instance_t *nf_instance = NULL; + + /* Initialize SELF NF instance */ + nf_instance = ogs_sbi_self()->nf_instance; + ogs_assert(nf_instance); + + /* Build NF instance information. */ + ogs_sbi_nf_instance_build_default(nf_instance, OpenAPI_nf_type_NRF); + + if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) return OGS_ERROR; return OGS_OK; @@ -97,18 +78,25 @@ OpenAPI_notification_event_type_e event, ogs_sbi_nf_instance_t *nf_instance) { + bool rc; ogs_sbi_request_t *request = NULL; ogs_sbi_client_t *client = NULL; ogs_assert(subscription_data); client = subscription_data->client; - ogs_assert(client); + ogs_expect_or_return_val(client, false); request = nrf_nnrf_nfm_build_nf_status_notify( subscription_data, event, nf_instance); ogs_expect_or_return_val(request, false); - return ogs_sbi_scp_send_request(client, client_notify_cb, request, NULL); + rc = ogs_sbi_send_request_to_client( + client, client_notify_cb, request, NULL); + ogs_expect(rc == true); + + ogs_sbi_request_free(request); + + return rc; } bool nrf_nnrf_nfm_send_nf_status_notify_all(
View file
open5gs_2.4.11.tar.xz/src/nrf/timer.c -> open5gs_2.5.0.tar.xz/src/nrf/timer.c
Changed
@@ -19,9 +19,21 @@ #include "context.h" -const char *nrf_timer_get_name(nrf_timer_e id) +const char *nrf_timer_get_name(int timer_id) { - switch (id) { + switch (timer_id) { + case OGS_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + return OGS_TIMER_NAME_NF_INSTANCE_REGISTRATION_INTERVAL; + case OGS_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL: + return OGS_TIMER_NAME_NF_INSTANCE_HEARTBEAT_INTERVAL; + case OGS_TIMER_NF_INSTANCE_NO_HEARTBEAT: + return OGS_TIMER_NAME_NF_INSTANCE_NO_HEARTBEAT; + case OGS_TIMER_NF_INSTANCE_VALIDITY: + return OGS_TIMER_NAME_NF_INSTANCE_VALIDITY; + case OGS_TIMER_SUBSCRIPTION_VALIDITY: + return OGS_TIMER_NAME_SUBSCRIPTION_VALIDITY; + case OGS_TIMER_SBI_CLIENT_WAIT: + return OGS_TIMER_NAME_SBI_CLIENT_WAIT; case NRF_TIMER_NF_INSTANCE_NO_HEARTBEAT: return "NRF_TIMER_NF_INSTANCE_NO_HEARTBEAT"; case NRF_TIMER_SUBSCRIPTION_VALIDITY: @@ -30,6 +42,7 @@ break; } + ogs_error("Unknown Timer%d", timer_id); return "UNKNOWN_TIMER"; } @@ -41,13 +54,13 @@ switch (timer_id) { case NRF_TIMER_NF_INSTANCE_NO_HEARTBEAT: - e = nrf_event_new(NRF_EVT_SBI_TIMER); - e->timer_id = timer_id; + e = nrf_event_new(OGS_EVENT_SBI_TIMER); + e->h.timer_id = timer_id; e->nf_instance = data; break; case NRF_TIMER_SUBSCRIPTION_VALIDITY: - e = nrf_event_new(NRF_EVT_SBI_TIMER); - e->timer_id = timer_id; + e = nrf_event_new(OGS_EVENT_SBI_TIMER); + e->h.timer_id = timer_id; e->subscription_data = data; break; default: @@ -59,7 +72,7 @@ rv = ogs_queue_push(ogs_app()->queue, e); if (rv != OGS_OK) { ogs_error("ogs_queue_push() failed:%d", (int)rv); - nrf_event_free(e); + ogs_event_free(e); } }
View file
open5gs_2.4.11.tar.xz/src/nrf/timer.h -> open5gs_2.5.0.tar.xz/src/nrf/timer.h
Changed
@@ -28,7 +28,7 @@ /* forward declaration */ typedef enum { - NRF_TIMER_BASE = 0, + NRF_TIMER_BASE = OGS_MAX_NUM_OF_PROTO_TIMER, NRF_TIMER_NF_INSTANCE_NO_HEARTBEAT, NRF_TIMER_SUBSCRIPTION_VALIDITY, @@ -38,7 +38,7 @@ } nrf_timer_e; -const char *nrf_timer_get_name(nrf_timer_e id); +const char *nrf_timer_get_name(int timer_id); void nrf_timer_nf_instance_no_heartbeat(void *data); void nrf_timer_subscription_validity(void *data);
View file
open5gs_2.4.11.tar.xz/src/nssf/event.h -> open5gs_2.5.0.tar.xz/src/nssf/event.h
Changed
@@ -32,6 +32,8 @@ ogs_event_t h; } nssf_event_t; +OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(nssf_event_t)); + nssf_event_t *nssf_event_new(int id); const char *nssf_event_get_name(nssf_event_t *e);
View file
open5gs_2.4.11.tar.xz/src/nssf/nssf-sm.c -> open5gs_2.5.0.tar.xz/src/nssf/nssf-sm.c
Changed
@@ -179,7 +179,7 @@ CASE(OGS_SBI_HTTP_METHOD_POST) if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED || message.res_status == OGS_SBI_HTTP_STATUS_OK) { - ogs_nnrf_handle_nf_status_subscribe( + ogs_nnrf_nfm_handle_nf_status_subscribe( subscription_data, &message); } else { ogs_error("%s HTTP response error %d",
View file
open5gs_2.4.11.tar.xz/src/nssf/sbi-path.c -> open5gs_2.5.0.tar.xz/src/nssf/sbi-path.c
Changed
@@ -19,67 +19,12 @@ #include "sbi-path.h" -static int server_cb(ogs_sbi_request_t *request, void *data) -{ - nssf_event_t *e = NULL; - int rv; - - ogs_assert(request); - ogs_assert(data); - - e = nssf_event_new(OGS_EVENT_SBI_SERVER); - ogs_assert(e); - - e->h.sbi.request = request; - e->h.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; -} - -static int client_cb(int status, ogs_sbi_response_t *response, void *data) -{ - nssf_event_t *e = NULL; - int rv; - - if (status != OGS_OK) { - ogs_log_message( - status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0, - "client_cb() failed %d", status); - return OGS_ERROR; - } - - ogs_assert(response); - - e = nssf_event_new(OGS_EVENT_SBI_CLIENT); - ogs_assert(e); - e->h.sbi.response = response; - e->h.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; -} - int nssf_sbi_open(void) { ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_nf_service_t *service = NULL; - /* Add SELF NF instance */ + /* Initialize SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); ogs_sbi_nf_fsm_init(nf_instance); @@ -102,20 +47,10 @@ /* Initialize NRF NF Instance */ nf_instance = ogs_sbi_self()->nrf_instance; - if (nf_instance) { - ogs_sbi_client_t *client = NULL; - - /* Client callback is only used when NF sends to NRF */ - client = nf_instance->client; - ogs_assert(client); - client->cb = client_cb; - - /* NFRegister is sent and the response is received - * by the above client callback. */ + if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); - } - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) return OGS_ERROR; return OGS_OK;
View file
open5gs_2.4.11.tar.xz/src/pcf/event.h -> open5gs_2.5.0.tar.xz/src/pcf/event.h
Changed
@@ -38,6 +38,8 @@ pcf_app_t *app; } pcf_event_t; +OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(pcf_event_t)); + pcf_event_t *pcf_event_new(int id); const char *pcf_event_get_name(pcf_event_t *e);
View file
open5gs_2.4.11.tar.xz/src/pcf/naf-build.c -> open5gs_2.5.0.tar.xz/src/pcf/naf-build.c
Changed
@@ -31,12 +31,18 @@ message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST; message.h.uri = ogs_msprintf("%s/%s", app_session->notif_uri, OGS_SBI_RESOURCE_NAME_TERMINATE); - ogs_assert(message.h.uri); + if (!message.h.uri) { + ogs_error("No message.h.uri"); + goto end; + } request = ogs_sbi_build_request(&message); ogs_assert(request); - ogs_free(message.h.uri); +end: + + if (message.h.uri) + ogs_free(message.h.uri); return request; }
View file
open5gs_2.4.11.tar.xz/src/pcf/nbsf-build.c -> open5gs_2.5.0.tar.xz/src/pcf/nbsf-build.c
Changed
@@ -59,18 +59,27 @@ PcfBinding.ipv4_addr = sess->ipv4addr_string; PcfBinding.ipv6_prefix = sess->ipv6prefix_string; - ogs_expect_or_return_val(sess->dnn, NULL); + if (!sess->dnn) { + ogs_error("No DNN"); + goto end; + } PcfBinding.dnn = sess->dnn; nf_service = ogs_sbi_nf_service_find_by_name( nf_instance, (char *)OGS_SBI_SERVICE_NAME_NPCF_POLICYAUTHORIZATION); - ogs_expect_or_return_val(nf_service, NULL); + if (!nf_service) { + ogs_error("No NF-Service"); + goto end; + } if (nf_service->fqdn) PcfBinding.pcf_fqdn = ogs_strdup(nf_service->fqdn); - PcfIpEndPointList = OpenAPI_list_create(); - ogs_assert(PcfIpEndPointList); + PcfBinding.pcf_ip_end_points = PcfIpEndPointList = OpenAPI_list_create(); + if (!PcfIpEndPointList) { + ogs_error("No PcfIpEndPointList"); + goto end; + } for (i = 0; i < nf_service->num_of_addr; i++) { ogs_sockaddr_t *ipv4 = NULL; @@ -83,15 +92,30 @@ if (ipv4 || ipv6) { IpEndPoint = ogs_calloc(1, sizeof(*IpEndPoint)); - ogs_expect_or_return_val(IpEndPoint, NULL); + if (!IpEndPoint) { + ogs_error("No IpEndPoint"); + goto end; + } if (ipv4) { IpEndPoint->ipv4_address = ogs_ipstrdup(ipv4); - ogs_expect_or_return_val(IpEndPoint->ipv4_address, NULL); + if (!IpEndPoint->ipv4_address) { + ogs_error("No IpEndPoint->ipv4_address"); + if (IpEndPoint) + ogs_free(IpEndPoint); + goto end; + } } if (ipv6) { IpEndPoint->ipv6_address = ogs_ipstrdup(ipv6); - ogs_expect_or_return_val(IpEndPoint->ipv6_address, NULL); - + if (!IpEndPoint->ipv6_address) { + ogs_error("No IpEndPoint->ipv6_address"); + if (IpEndPoint) { + if (IpEndPoint->ipv6_address) + ogs_free(IpEndPoint->ipv6_address); + ogs_free(IpEndPoint); + } + goto end; + } } IpEndPoint->is_port = true; IpEndPoint->port = nf_service->addri.port; @@ -99,12 +123,10 @@ } } - if (PcfIpEndPointList->count) - PcfBinding.pcf_ip_end_points = PcfIpEndPointList; - else - OpenAPI_list_free(PcfIpEndPointList); - - ogs_expect_or_return_val(sess->s_nssai.sst, NULL); + if (!sess->s_nssai.sst) { + ogs_error("No SST"); + goto end; + } memset(&sNssai, 0, sizeof(sNssai)); sNssai.sst = sess->s_nssai.sst; sNssai.sd = ogs_s_nssai_sd_to_string(sess->s_nssai.sd); @@ -112,13 +134,18 @@ if (sess->management_features) { PcfBinding.supp_feat = ogs_uint64_to_string(sess->management_features); - ogs_expect_or_return_val(PcfBinding.supp_feat, NULL); + if (!PcfBinding.supp_feat) { + ogs_error("No supp_feat"); + goto end; + } } message.PcfBinding = &PcfBinding; request = ogs_sbi_build_request(&message); ogs_expect(request); + +end: if (sNssai.sd) ogs_free(sNssai.sd);
View file
open5gs_2.4.11.tar.xz/src/pcf/nnrf-handler.c -> open5gs_2.5.0.tar.xz/src/pcf/nnrf-handler.c
Changed
@@ -33,6 +33,7 @@ pcf_sess_t *sess = NULL; OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL; + OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL; OpenAPI_search_result_t *SearchResult = NULL; ogs_assert(recvmsg); @@ -43,6 +44,8 @@ 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; stream = xact->assoc_stream; @@ -67,15 +70,16 @@ ogs_assert_if_reached(); } - ogs_nnrf_handle_nf_discover_search_result(SearchResult); + ogs_nnrf_disc_handle_nf_discover_search_result(SearchResult); nf_instance = ogs_sbi_nf_instance_find_by_discovery_param( - target_nf_type, discovery_option); + target_nf_type, requester_nf_type, discovery_option); if (!nf_instance) { - ogs_error("%s:%d (NF discover) No %s", + ogs_error("%s:%d (NF discover) No %s:%s", pcf_ue ? pcf_ue->supi : "Unknown", sess ? sess->psi : 0, - ogs_sbi_service_type_to_name(service_type)); + ogs_sbi_service_type_to_name(service_type), + OpenAPI_nf_type_ToString(requester_nf_type)); return; }
View file
open5gs_2.4.11.tar.xz/src/pcf/nsmf-build.c -> open5gs_2.5.0.tar.xz/src/pcf/nsmf-build.c
Changed
@@ -35,7 +35,10 @@ ogs_assert(sess->notification_uri); server = ogs_list_first(&ogs_sbi_self()->server_list); - ogs_assert(server); + if (!server) { + ogs_error("No server"); + goto end; + } memset(&header, 0, sizeof(header)); header.service.name = (char *)OGS_SBI_SERVICE_NAME_NPCF_SMPOLICYCONTROL; @@ -47,7 +50,10 @@ memset(&SmPolicyNotification, 0, sizeof(SmPolicyNotification)); SmPolicyNotification.resource_uri = ogs_sbi_server_uri(server, &header); - ogs_assert(SmPolicyNotification.resource_uri); + if (!SmPolicyNotification.resource_uri) { + ogs_error("No resource_uri"); + goto end; + } SmPolicyDecision = data; ogs_assert(SmPolicyDecision); @@ -58,15 +64,22 @@ message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST; message.h.uri = ogs_msprintf("%s/%s", sess->notification_uri, OGS_SBI_RESOURCE_NAME_UPDATE); - ogs_assert(message.h.uri); + if (!message.h.uri) { + ogs_error("No message.h.uri"); + goto end; + } message.SmPolicyNotification = &SmPolicyNotification; request = ogs_sbi_build_request(&message); ogs_assert(request); - ogs_free(SmPolicyNotification.resource_uri); - ogs_free(message.h.uri); +end: + + if (SmPolicyNotification.resource_uri) + ogs_free(SmPolicyNotification.resource_uri); + if (message.h.uri) + ogs_free(message.h.uri); return request; } @@ -93,12 +106,18 @@ message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST; message.h.uri = ogs_msprintf("%s/%s", sess->notification_uri, OGS_SBI_RESOURCE_NAME_TERMINATE); - ogs_assert(message.h.uri); + if (!message.h.uri) { + ogs_error("No message.h.uri"); + goto end; + } request = ogs_sbi_build_request(&message); ogs_assert(request); - ogs_free(message.h.uri); +end: + + if (message.h.uri) + ogs_free(message.h.uri); return request; }
View file
open5gs_2.4.11.tar.xz/src/pcf/nudr-handler.c -> open5gs_2.5.0.tar.xz/src/pcf/nudr-handler.c
Changed
@@ -200,8 +200,11 @@ nf_instance = sess->sbi.service_type_arrayservice_type.nf_instance; if (!nf_instance) { - nf_instance = - ogs_sbi_nf_instance_find_by_service_type(service_type); + OpenAPI_nf_type_e requester_nf_type = + NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance); + ogs_assert(requester_nf_type); + nf_instance = ogs_sbi_nf_instance_find_by_service_type( + service_type, requester_nf_type); if (nf_instance) OGS_SBI_SETUP_NF_INSTANCE( sess->sbi.service_type_arrayservice_type,
View file
open5gs_2.4.11.tar.xz/src/pcf/pcf-sm.c -> open5gs_2.5.0.tar.xz/src/pcf/pcf-sm.c
Changed
@@ -100,7 +100,7 @@ CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY) SWITCH(message.h.method) CASE(OGS_SBI_HTTP_METHOD_POST) - ogs_nnrf_handle_nf_status_notify(stream, &message); + ogs_nnrf_nfm_handle_nf_status_notify(stream, &message); break; DEFAULT @@ -330,7 +330,7 @@ CASE(OGS_SBI_HTTP_METHOD_POST) if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED || message.res_status == OGS_SBI_HTTP_STATUS_OK) { - ogs_nnrf_handle_nf_status_subscribe( + ogs_nnrf_nfm_handle_nf_status_subscribe( subscription_data, &message); } else { ogs_error("%s HTTP response error %d",
View file
open5gs_2.4.11.tar.xz/src/pcf/sbi-path.c -> open5gs_2.5.0.tar.xz/src/pcf/sbi-path.c
Changed
@@ -19,61 +19,6 @@ #include "sbi-path.h" -static int server_cb(ogs_sbi_request_t *request, void *data) -{ - pcf_event_t *e = NULL; - int rv; - - ogs_assert(request); - ogs_assert(data); - - e = pcf_event_new(OGS_EVENT_SBI_SERVER); - ogs_assert(e); - - e->h.sbi.request = request; - e->h.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; -} - -static int client_cb(int status, ogs_sbi_response_t *response, void *data) -{ - pcf_event_t *e = NULL; - int rv; - - if (status != OGS_OK) { - ogs_log_message( - status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0, - "client_cb() failed %d", status); - return OGS_ERROR; - } - - ogs_assert(response); - - e = pcf_event_new(OGS_EVENT_SBI_CLIENT); - ogs_assert(e); - e->h.sbi.response = response; - e->h.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; -} - int pcf_sbi_open(void) { ogs_sbi_nf_instance_t *nf_instance = NULL; @@ -82,7 +27,7 @@ bool smpolicycontrol_enabled = false; bool policyauthorization_enabled = false; - /* Add SELF NF instance */ + /* Initialize SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); ogs_sbi_nf_fsm_init(nf_instance); @@ -148,18 +93,8 @@ /* Initialize NRF NF Instance */ nf_instance = ogs_sbi_self()->nrf_instance; - if (nf_instance) { - ogs_sbi_client_t *client = NULL; - - /* Client callback is only used when NF sends to NRF */ - client = nf_instance->client; - ogs_assert(client); - client->cb = client_cb; - - /* NFRegister is sent and the response is received - * by the above client callback. */ + if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); - } /* Build Subscription-Data */ ogs_sbi_subscription_data_build_default( @@ -167,7 +102,7 @@ ogs_sbi_subscription_data_build_default( OpenAPI_nf_type_UDR, OGS_SBI_SERVICE_NAME_NUDR_DR); - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) return OGS_ERROR; return OGS_OK; @@ -179,11 +114,12 @@ ogs_sbi_server_stop_all(); } -bool pcf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data) +bool pcf_sbi_send_request( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact) { ogs_assert(nf_instance); - - return ogs_sbi_send_request(nf_instance, client_cb, data); + ogs_assert(xact); + return ogs_sbi_send_request_to_nf_instance(nf_instance, xact); } static bool pcf_sbi_discover_and_send( @@ -207,7 +143,7 @@ xact->assoc_stream = stream; - if (ogs_sbi_discover_and_send(xact, client_cb) != true) { + if (ogs_sbi_discover_and_send(xact) != true) { ogs_error("ogs_sbi_discover_and_send() failed"); ogs_sbi_xact_remove(xact); return false; @@ -250,7 +186,7 @@ xact->assoc_stream = stream; - return ogs_sbi_discover_only(xact, client_cb); + return ogs_sbi_discover_only(xact); } bool pcf_sess_sbi_discover_and_send( @@ -320,6 +256,7 @@ bool pcf_sbi_send_am_policy_control_notify(pcf_ue_t *pcf_ue) { + bool rc; ogs_sbi_request_t *request = NULL; ogs_sbi_client_t *client = NULL; @@ -329,12 +266,20 @@ request = pcf_namf_callback_build_am_policy_control(pcf_ue, NULL); ogs_expect_or_return_val(request, false); - return ogs_sbi_client_send_request(client, client_notify_cb, request, NULL); + + rc = ogs_sbi_send_request_to_client( + client, client_notify_cb, request, NULL); + ogs_expect(rc == true); + + ogs_sbi_request_free(request); + + return rc; } bool pcf_sbi_send_smpolicycontrol_update_notify( pcf_sess_t *sess, OpenAPI_sm_policy_decision_t *SmPolicyDecision) { + bool rc; ogs_sbi_request_t *request = NULL; ogs_sbi_client_t *client = NULL; @@ -345,13 +290,21 @@ request = pcf_nsmf_callback_build_smpolicycontrol_update( sess, SmPolicyDecision); ogs_expect_or_return_val(request, false); - return ogs_sbi_client_send_request(client, client_notify_cb, request, NULL); + + rc = ogs_sbi_send_request_to_client( + client, client_notify_cb, request, NULL); + ogs_expect(rc == true); + + ogs_sbi_request_free(request); + + return rc; } bool pcf_sbi_send_smpolicycontrol_delete_notify( pcf_sess_t *sess, pcf_app_t *app_session, OpenAPI_sm_policy_decision_t *SmPolicyDecision) { + bool rc; ogs_sbi_request_t *request = NULL; ogs_sbi_client_t *client = NULL; @@ -362,12 +315,19 @@ request = pcf_nsmf_callback_build_smpolicycontrol_update( sess, SmPolicyDecision); ogs_expect_or_return_val(request, false); - return ogs_sbi_client_send_request( + + rc = ogs_sbi_send_request_to_client( client, client_delete_notify_cb, request, app_session); + ogs_expect(rc == true); + + ogs_sbi_request_free(request); + + return rc;
View file
open5gs_2.4.11.tar.xz/src/pcf/sbi-path.h -> open5gs_2.5.0.tar.xz/src/pcf/sbi-path.h
Changed
@@ -33,7 +33,8 @@ int pcf_sbi_open(void); void pcf_sbi_close(void); -bool pcf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data); +bool pcf_sbi_send_request( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact); bool pcf_ue_sbi_discover_and_send( ogs_sbi_service_type_e service_type, ogs_sbi_discovery_option_t *discovery_option,
View file
open5gs_2.4.11.tar.xz/src/scp/context.c -> open5gs_2.5.0.tar.xz/src/scp/context.c
Changed
@@ -23,11 +23,11 @@ int __scp_log_domain; -static OGS_POOL(scp_conn_pool, scp_conn_t); +static OGS_POOL(scp_assoc_pool, scp_assoc_t); static int context_initialized = 0; -static int max_num_of_scp_conn = 0; +static int max_num_of_scp_assoc = 0; void scp_context_init(void) { @@ -38,10 +38,10 @@ ogs_log_install_domain(&__scp_log_domain, "scp", ogs_core()->log.level); -#define MAX_NUM_OF_SCP_CONN 8 - max_num_of_scp_conn = ogs_app()->max.ue * MAX_NUM_OF_SCP_CONN; +#define MAX_NUM_OF_SCP_ASSOC 8 + max_num_of_scp_assoc = ogs_app()->max.ue * MAX_NUM_OF_SCP_ASSOC; - ogs_pool_init(&scp_conn_pool, max_num_of_scp_conn); + ogs_pool_init(&scp_assoc_pool, max_num_of_scp_assoc); context_initialized = 1; } @@ -50,9 +50,9 @@ { ogs_assert(context_initialized == 1); - scp_conn_remove_all(); + scp_assoc_remove_all(); - ogs_pool_final(&scp_conn_pool); + ogs_pool_final(&scp_assoc_pool); context_initialized = 0; } @@ -112,48 +112,50 @@ return OGS_OK; } -scp_conn_t *scp_conn_add(ogs_sbi_stream_t *stream) +scp_assoc_t *scp_assoc_add(ogs_sbi_stream_t *stream) { - scp_conn_t *conn = NULL; + scp_assoc_t *assoc = NULL; ogs_assert(stream); - ogs_pool_alloc(&scp_conn_pool, &conn); - if (!conn) { - ogs_error("Maximum number of connection%d reached", - max_num_of_scp_conn); + ogs_pool_alloc(&scp_assoc_pool, &assoc); + if (!assoc) { + ogs_error("Maximum number of association%d reached", + max_num_of_scp_assoc); return NULL; } - memset(conn, 0, sizeof *conn); + memset(assoc, 0, sizeof *assoc); - conn->stream = stream; + assoc->stream = stream; - ogs_list_add(&self.conn_list, conn); + ogs_list_add(&self.assoc_list, assoc); - return conn; + return assoc; } -void scp_conn_remove(scp_conn_t *conn) +void scp_assoc_remove(scp_assoc_t *assoc) { - ogs_assert(conn); + ogs_assert(assoc); - ogs_list_remove(&self.conn_list, conn); + ogs_list_remove(&self.assoc_list, assoc); - if (conn->client) - ogs_sbi_client_remove(conn->client); + if (assoc->client) + ogs_sbi_client_remove(assoc->client); + if (assoc->nrf_client) + ogs_sbi_client_remove(assoc->nrf_client); - ogs_pool_free(&scp_conn_pool, conn); + ogs_pool_free(&scp_assoc_pool, assoc); } -void scp_conn_remove_all(void) +void scp_assoc_remove_all(void) { - scp_conn_t *conn = NULL, *next_conn = NULL; + scp_assoc_t *assoc = NULL, *next_assoc = NULL; - ogs_list_for_each_safe(&self.conn_list, next_conn, conn) - scp_conn_remove(conn); + ogs_list_for_each_safe(&self.assoc_list, next_assoc, assoc) + scp_assoc_remove(assoc); } -scp_conn_t *scp_conn_find(uint32_t index) +scp_assoc_t *scp_assoc_find(uint32_t index) { - return ogs_pool_find(&scp_conn_pool, index); + return ogs_pool_find(&scp_assoc_pool, index); }
View file
open5gs_2.4.11.tar.xz/src/scp/context.h -> open5gs_2.5.0.tar.xz/src/scp/context.h
Changed
@@ -35,20 +35,25 @@ #define OGS_LOG_DOMAIN __scp_log_domain typedef struct scp_context_s { - ogs_list_t conn_list; + ogs_list_t assoc_list; } scp_context_t; -typedef struct scp_conn_s scp_conn_t; +typedef struct scp_assoc_s scp_assoc_t; -typedef struct scp_conn_s { +typedef struct scp_assoc_s { ogs_sbi_object_t sbi; + ogs_sbi_stream_t *stream; + ogs_sbi_client_t *client; + ogs_sbi_client_t *nrf_client; - ogs_sbi_stream_t *stream; ogs_sbi_request_t *request; + ogs_sbi_service_type_e service_type; + OpenAPI_nf_type_e requester_nf_type; -} scp_conn_t; + ogs_sbi_nf_instance_t *nf_service_producer; +} scp_assoc_t; void scp_context_init(void); void scp_context_final(void); @@ -56,11 +61,11 @@ int scp_context_parse_config(void); -scp_conn_t *scp_conn_add(ogs_sbi_stream_t *stream); -void scp_conn_remove(scp_conn_t *sess); -void scp_conn_remove_all(void); +scp_assoc_t *scp_assoc_add(ogs_sbi_stream_t *stream); +void scp_assoc_remove(scp_assoc_t *sess); +void scp_assoc_remove_all(void); -scp_conn_t *scp_conn_find(uint32_t index); +scp_assoc_t *scp_assoc_find(uint32_t index); #ifdef __cplusplus }
View file
open5gs_2.4.11.tar.xz/src/scp/event.h -> open5gs_2.5.0.tar.xz/src/scp/event.h
Changed
@@ -36,6 +36,8 @@ scp_sess_t *sess; } scp_event_t; +OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(scp_event_t)); + scp_event_t *scp_event_new(int id); const char *scp_event_get_name(scp_event_t *e);
View file
open5gs_2.4.11.tar.xz/src/scp/meson.build -> open5gs_2.5.0.tar.xz/src/scp/meson.build
Changed
@@ -19,9 +19,6 @@ context.c event.c - nnrf-handler.c - nscp-handler.c - sbi-path.c scp-sm.c
View file
open5gs_2.4.11.tar.xz/src/scp/sbi-path.c -> open5gs_2.5.0.tar.xz/src/scp/sbi-path.c
Changed
@@ -22,14 +22,19 @@ static int request_handler(ogs_sbi_request_t *request, void *data); static int response_handler( int status, ogs_sbi_response_t *response, void *data); +static int discover_handler( + int status, ogs_sbi_response_t *response, void *data); -static int client_cb(int status, ogs_sbi_response_t *response, void *data); +static void copy_request( + ogs_sbi_request_t *target, ogs_sbi_request_t *source, + bool include_discovery); int scp_sbi_open(void) { - ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_nf_instance_t *nf_instance = NULL, *nrf_instance = NULL; + ogs_sbi_client_t *nrf_client = NULL, *next_scp = NULL; - /* Add SELF NF instance */ + /* Initialize SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); ogs_sbi_nf_fsm_init(nf_instance); @@ -37,30 +42,43 @@ /* Build NF instance information. It will be transmitted to NRF. */ ogs_sbi_nf_instance_build_default(nf_instance, OpenAPI_nf_type_SCP); - /* Initialize NRF NF Instance */ - nf_instance = ogs_sbi_self()->nrf_instance; - if (nf_instance) { - ogs_sbi_client_t *client = NULL; + /* + * If the SCP is running in Model D, + * it can send NFRegister/NFStatusSubscribe messages to the NRF. + */ + nrf_instance = ogs_sbi_self()->nrf_instance; + nrf_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->nrf_instance); + + if (nrf_client) { + + /* Initialize NRF NF Instance */ + if (nrf_instance) + ogs_sbi_nf_fsm_init(nrf_instance); + } - /* Client callback is only used when NF sends to NRF */ - client = nf_instance->client; - ogs_assert(client); - client->cb = client_cb; + /* Check if Next-SCP's client */ + if (ogs_sbi_self()->discovery_config.delegated == + OGS_SBI_DISCOVERY_DELEGATED_AUTO) { + next_scp = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance); + } else if (ogs_sbi_self()->discovery_config.delegated == + OGS_SBI_DISCOVERY_DELEGATED_YES) { + next_scp = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance); + ogs_assert(next_scp); + } - /* NFRegister is sent and the response is received - * by the above client callback. */ - ogs_sbi_nf_fsm_init(nf_instance); - } - - /* Build Subscription-Data */ - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_AMF, NULL); - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_AUSF, NULL); - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_BSF, NULL); - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_NSSF, NULL); - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_PCF, NULL); - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_SMF, NULL); - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_UDM, NULL); - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_UDR, NULL); + /* If the SCP has an NRF client and does not delegate to Next-SCP */ + if (nrf_client && !next_scp) { + + /* Build Subscription-Data */ + ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_AMF, NULL); + ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_AUSF, NULL); + ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_BSF, NULL); + ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_NSSF, NULL); + ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_PCF, NULL); + ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_SMF, NULL); + ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_UDM, NULL); + ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_UDR, NULL); + } if (ogs_sbi_server_start_all(request_handler) != OGS_OK) return OGS_ERROR; @@ -74,28 +92,54 @@ ogs_sbi_server_stop_all(); } -static int request_handler(ogs_sbi_request_t *source, void *data) +static int request_handler(ogs_sbi_request_t *request, void *data) { int rv; ogs_hash_index_t *hi; + ogs_sbi_client_t *client = NULL, *nrf_client = NULL, *next_scp = NULL; ogs_sbi_stream_t *stream = data; + ogs_sbi_request_t scp_request; + char *apiroot = NULL, *newuri = NULL; + + 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 *discovery_option = NULL; + ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL; + bool discovery_presence = false; + + scp_assoc_t *assoc = NULL; + ogs_sbi_nf_instance_t *nf_instance = NULL; + struct { char *target_apiroot; - char *discovery; - char *accept; - char *content_type; - char *content_encoding; - } headers; + char *callback; + char *nrf_uri; + } headers = { + NULL, NULL, NULL + }; - ogs_assert(source); - ogs_assert(source->h.uri); + scp_event_t *e = NULL; + + ogs_assert(request); + ogs_assert(request->h.uri); ogs_assert(stream); - memset(&headers, 0, sizeof(headers)); + /* Check if Next-SCP's client */ + if (ogs_sbi_self()->discovery_config.delegated == + OGS_SBI_DISCOVERY_DELEGATED_AUTO) { + next_scp = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance); + } else if (ogs_sbi_self()->discovery_config.delegated == + OGS_SBI_DISCOVERY_DELEGATED_YES) { + next_scp = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance); + ogs_assert(next_scp); + } + + discovery_option = ogs_sbi_discovery_option_new(); + ogs_assert(discovery_option); /* Extract HTTP Header */ - for (hi = ogs_hash_first(source->http.headers); + for (hi = ogs_hash_first(request->http.headers); hi; hi = ogs_hash_next(hi)) { char *key = (char *)ogs_hash_this_key(hi); char *val = ogs_hash_this_val(hi); @@ -110,99 +154,129 @@ * Each header field consists of a name followed by a colon (":") * and the field value. Field names are case-insensitive. */ - if (!strcasecmp(key, OGS_SBI_CUSTOM_TARGET_APIROOT)) { + if (!strcasecmp(key, OGS_SBI_USER_AGENT)) { + if (val) requester_nf_type = OpenAPI_nf_type_FromString(val); + } else if (!strcasecmp(key, OGS_SBI_CUSTOM_TARGET_APIROOT)) { headers.target_apiroot = val; - } else if (!strncasecmp(key, - OGS_SBI_CUSTOM_DISCOVERY_COMMON, - strlen(OGS_SBI_CUSTOM_DISCOVERY_COMMON))) { - headers.discovery = val; - } else if (!strcasecmp(key, OGS_SBI_ACCEPT)) { - headers.accept = val; - } else if (!strcasecmp(key, OGS_SBI_CONTENT_TYPE)) { - headers.content_type = val; - } else if (!strcasecmp(key, OGS_SBI_ACCEPT_ENCODING)) { - headers.content_encoding = val; + } else if (!strcasecmp(key, OGS_SBI_CUSTOM_CALLBACK)) { + headers.callback = val; + } else if (!strcasecmp(key, OGS_SBI_CUSTOM_NRF_URI)) { + headers.nrf_uri = val; + } else if (!strcasecmp(key, OGS_SBI_CUSTOM_DISCOVERY_TARGET_NF_TYPE)) { + if (val) target_nf_type = OpenAPI_nf_type_FromString(val); + } else if (!strcasecmp(key, + OGS_SBI_CUSTOM_DISCOVERY_REQUESTER_NF_TYPE)) { + ogs_warn("Use User-Agent instead of Discovery-requester-nf-type"); + } else if (!strcasecmp(key, + OGS_SBI_CUSTOM_DISCOVERY_TARGET_NF_INSTANCE_ID)) { + ogs_sbi_discovery_option_set_target_nf_instance_id( + discovery_option, val); + } else if (!strcasecmp(key, + OGS_SBI_CUSTOM_DISCOVERY_REQUESTER_NF_INSTANCE_ID)) { + ogs_sbi_discovery_option_set_requester_nf_instance_id( + discovery_option, val); + } else if (!strcasecmp(key, OGS_SBI_CUSTOM_DISCOVERY_SERVICE_NAMES)) { + if (val) + ogs_sbi_discovery_option_parse_service_names( + discovery_option, val); + + /* + * So, we'll use the first item in service-names list. + * + * TS29.500 + * 6.10 Support of Indirect Communication
View file
open5gs_2.4.11.tar.xz/src/scp/sbi-path.h -> open5gs_2.5.0.tar.xz/src/scp/sbi-path.h
Changed
@@ -29,13 +29,6 @@ int scp_sbi_open(void); void scp_sbi_close(void); -bool scp_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data); -bool scp_sbi_discover_and_send( - ogs_sbi_service_type_e service_type, - ogs_sbi_discovery_option_t *discovery_option, - ogs_sbi_request_t *(*build)(scp_conn_t *conn, void *data), - scp_conn_t *conn, ogs_sbi_stream_t *stream, void *data); - #ifdef __cplusplus } #endif
View file
open5gs_2.4.11.tar.xz/src/scp/scp-sm.c -> open5gs_2.5.0.tar.xz/src/scp/scp-sm.c
Changed
@@ -18,8 +18,6 @@ */ #include "sbi-path.h" -#include "nnrf-handler.h" -#include "nscp-handler.h" void scp_state_initial(ogs_fsm_t *s, scp_event_t *e) { @@ -95,7 +93,7 @@ CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY) SWITCH(message.h.method) CASE(OGS_SBI_HTTP_METHOD_POST) - ogs_nnrf_handle_nf_status_notify(stream, &message); + ogs_nnrf_nfm_handle_nf_status_notify(stream, &message); break; DEFAULT @@ -118,71 +116,6 @@ END break; -#if 0 - CASE(OGS_SBI_SERVICE_NAME_NBSF_MANAGEMENT) - SWITCH(message.h.resource.component0) - CASE(OGS_SBI_RESOURCE_NAME_PCF_BINDINGS) - if (message.h.resource.component1) { - sess = scp_sess_find_by_binding_id( - message.h.resource.component1); - } else { - SWITCH(message.h.method) - CASE(OGS_SBI_HTTP_METHOD_POST) - if (message.PcfBinding && - message.PcfBinding->snssai && - message.PcfBinding->dnn) { - ogs_s_nssai_t s_nssai; - - s_nssai.sst = message.PcfBinding->snssai->sst; - s_nssai.sd = ogs_s_nssai_sd_from_string( - message.PcfBinding->snssai->sd); - - sess = scp_sess_find_by_snssai_and_dnn( - &s_nssai, message.PcfBinding->dnn); - if (!sess) { - sess = scp_sess_add_by_snssai_and_dnn( - &s_nssai, message.PcfBinding->dnn); - ogs_assert(sess); - } - } - break; - CASE(OGS_SBI_HTTP_METHOD_GET) - if (!sess && message.param.ipv4addr) - sess = scp_sess_find_by_ipv4addr( - message.param.ipv4addr); - if (!sess && message.param.ipv6prefix) - sess = scp_sess_find_by_ipv6prefix( - message.param.ipv6prefix); - break; - DEFAULT - ogs_error("Invalid HTTP method %s", message.h.method); - END - } - - if (!sess) { - ogs_error("Not found %s", message.h.uri); - ogs_assert(true == - ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_NOT_FOUND, - &message, "Not found", message.h.uri)); - break; - } - - scp_nscp_management_handle_pcf_binding(sess, stream, &message); - break; - - DEFAULT - ogs_error("Invalid resource name %s", - message.h.resource.component0); - ogs_assert(true == - ogs_sbi_server_send_error(stream, - OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, - "Invalid resource name", - message.h.resource.component0)); - END - break; -#endif - DEFAULT ogs_error("Invalid API name %s", message.h.service.name); ogs_assert(true == @@ -236,7 +169,7 @@ CASE(OGS_SBI_HTTP_METHOD_POST) if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED || message.res_status == OGS_SBI_HTTP_STATUS_OK) { - ogs_nnrf_handle_nf_status_subscribe( + ogs_nnrf_nfm_handle_nf_status_subscribe( subscription_data, &message); } else { ogs_error("HTTP response error : %d", @@ -262,34 +195,6 @@ DEFAULT ogs_error("Invalid resource name %s", message.h.resource.component0); - ogs_assert_if_reached(); - END - break; - - CASE(OGS_SBI_SERVICE_NAME_NNRF_DISC) - SWITCH(message.h.resource.component0) - CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) - sbi_xact = e->h.sbi.data; - ogs_assert(sbi_xact); - - SWITCH(message.h.method) - CASE(OGS_SBI_HTTP_METHOD_GET) - if (message.res_status == OGS_SBI_HTTP_STATUS_OK) - scp_nnrf_handle_nf_discover(sbi_xact, &message); - else - ogs_error("HTTP response error %d", - message.res_status); - break; - - DEFAULT - ogs_error("Invalid HTTP method %s", message.h.method); - ogs_assert_if_reached(); - END - break; - - DEFAULT - ogs_error("Invalid resource name %s", - message.h.resource.component0); ogs_assert_if_reached(); END break;
View file
open5gs_2.4.11.tar.xz/src/sgwc/event.h -> open5gs_2.5.0.tar.xz/src/sgwc/event.h
Changed
@@ -63,6 +63,8 @@ sgwc_bearer_t *bearer; } sgwc_event_t; +OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(sgwc_event_t)); + void sgwc_event_init(void); void sgwc_event_term(void); void sgwc_event_final(void);
View file
open5gs_2.4.11.tar.xz/src/sgwc/gtp-path.c -> open5gs_2.5.0.tar.xz/src/sgwc/gtp-path.c
Changed
@@ -231,6 +231,7 @@ gtp_xact = ogs_gtp_xact_local_create( sgwc_ue->gnode, &h, pkbuf, bearer_timeout, bearer); ogs_expect_or_return_val(gtp_xact, OGS_ERROR); + gtp_xact->local_teid = sgwc_ue->sgw_s11_teid; rv = ogs_gtp_xact_commit(gtp_xact); ogs_expect(rv == OGS_OK);
View file
open5gs_2.4.11.tar.xz/src/sgwc/s11-handler.c -> open5gs_2.5.0.tar.xz/src/sgwc/s11-handler.c
Changed
@@ -661,6 +661,7 @@ s5c_xact = ogs_gtp_xact_local_create( sess->gnode, &message->h, gtpbuf, gtp_sess_timeout, sess); ogs_expect_or_return(s5c_xact); + s5c_xact->local_teid = sess->sgw_s5c_teid; ogs_gtp_xact_associate(s11_xact, s5c_xact);
View file
open5gs_2.4.11.tar.xz/src/sgwc/s5c-handler.c -> open5gs_2.5.0.tar.xz/src/sgwc/s5c-handler.c
Changed
@@ -420,7 +420,6 @@ ogs_pkbuf_t *gtpbuf, ogs_gtp2_message_t *message) { int rv; - ogs_gtp2_cause_t *cause = NULL; uint8_t cause_value; sgwc_ue_t *sgwc_ue = NULL; @@ -466,37 +465,23 @@ return; } - /***************************************** - * Check Mandatory/Conditional IE Missing - *****************************************/ + /******************** + * Check Cause Value + ********************/ ogs_assert(cause_value == OGS_GTP2_CAUSE_REQUEST_ACCEPTED); - if (rsp->cause.presence == 0) { + if (rsp->cause.presence) { + ogs_gtp2_cause_t *cause = rsp->cause.data; + ogs_assert(cause); + + cause_value = cause->value; + } else { ogs_error("No Cause"); cause_value = OGS_GTP2_CAUSE_MANDATORY_IE_MISSING; } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp_send_error_message( - s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, cause_value); - return; - } - - /******************** - * Check Cause Value - ********************/ - ogs_assert(cause_value == OGS_GTP2_CAUSE_REQUEST_ACCEPTED); - - cause = rsp->cause.data; - ogs_assert(cause); - cause_value = cause->value; - if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_error("GTP Cause Value:%d", cause_value); - ogs_gtp_send_error_message( - s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, cause_value); - return; + ogs_error("GTP Cause Value:%d - Ignored", cause_value); } /******************** @@ -725,6 +710,7 @@ s11_xact = ogs_gtp_xact_local_create( sgwc_ue->gnode, &message->h, pkbuf, bearer_timeout, bearer); ogs_expect_or_return(s11_xact); + s11_xact->local_teid = sgwc_ue->sgw_s11_teid; ogs_gtp_xact_associate(s5c_xact, s11_xact); } else { @@ -870,6 +856,7 @@ s11_xact = ogs_gtp_xact_local_create( sgwc_ue->gnode, &message->h, pkbuf, bearer_timeout, bearer); ogs_expect_or_return(s11_xact); + s11_xact->local_teid = sgwc_ue->sgw_s11_teid; ogs_gtp_xact_associate(s5c_xact, s11_xact); } else {
View file
open5gs_2.4.11.tar.xz/src/sgwu/context.c -> open5gs_2.5.0.tar.xz/src/sgwu/context.c
Changed
@@ -154,7 +154,7 @@ ogs_hash_set(self.seid_hash, &sess->sgwc_sxa_f_seid.seid, sizeof(sess->sgwc_sxa_f_seid.seid), sess); - ogs_info("UE F-SEIDCP:0x%lx UP:0x%lx", + ogs_info("UE F-SEIDUP:0x%lx CP:0x%lx", (long)sess->sgwu_sxa_seid, (long)sess->sgwc_sxa_f_seid.seid); ogs_list_add(&self.sess_list, sess);
View file
open5gs_2.4.11.tar.xz/src/sgwu/event.h -> open5gs_2.5.0.tar.xz/src/sgwu/event.h
Changed
@@ -58,6 +58,8 @@ sgwu_bearer_t *bearer; } sgwu_event_t; +OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(sgwu_event_t)); + void sgwu_event_init(void); void sgwu_event_term(void); void sgwu_event_final(void);
View file
open5gs_2.4.11.tar.xz/src/smf/event.h -> open5gs_2.5.0.tar.xz/src/smf/event.h
Changed
@@ -102,6 +102,8 @@ smf_sess_t *sess; } smf_event_t; +OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(smf_event_t)); + smf_event_t *smf_event_new(int id); const char *smf_event_get_name(smf_event_t *e);
View file
open5gs_2.4.11.tar.xz/src/smf/n4-handler.c -> open5gs_2.5.0.tar.xz/src/smf/n4-handler.c
Changed
@@ -1117,7 +1117,7 @@ ogs_debug("Session Report Request"); - cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; + cause_value = OGS_PFCP_CAUSE_REQUEST_ACCEPTED; if (!sess) { ogs_error("No Context"); @@ -1126,10 +1126,10 @@ if (pfcp_req->report_type.presence == 0) { ogs_error("No Report Type"); - cause_value = OGS_GTP2_CAUSE_MANDATORY_IE_MISSING; + cause_value = OGS_PFCP_CAUSE_MANDATORY_IE_MISSING; } - if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { + if (cause_value != OGS_PFCP_CAUSE_REQUEST_ACCEPTED) { ogs_pfcp_send_error_message(pfcp_xact, 0, OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE, cause_value, 0); @@ -1168,14 +1168,19 @@ "Paging Policy Indication Value"); ogs_pfcp_send_error_message(pfcp_xact, 0, OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE, - OGS_GTP2_CAUSE_SERVICE_NOT_SUPPORTED, 0); + OGS_PFCP_CAUSE_SERVICE_NOT_SUPPORTED, 0); return; } if (qfi) { qos_flow = smf_qos_flow_find_by_qfi(sess, qfi); - if (!qos_flow) + if (!qos_flow) { ogs_error("Cannot find the QoS Flow%d", qfi); + ogs_pfcp_send_error_message(pfcp_xact, 0, + OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE, + OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND, 0); + return; + } } } else { ogs_error("No Info"); @@ -1187,7 +1192,6 @@ pfcp_req->downlink_data_report.pdr_id.u16); if (!pdr) ogs_error("Cannot find the PDR-ID%d", pdr_id); - } else { ogs_error("No PDR-ID"); } @@ -1195,11 +1199,11 @@ ogs_error("No Downlink Data Report"); } - if (!pdr || !qos_flow) { - ogs_error("No Context %p:%p", pdr, qos_flow); + if (!pdr) { + ogs_error("No Context"); ogs_pfcp_send_error_message(pfcp_xact, 0, OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE, - cause_value, 0); + OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND, 0); return; }
View file
open5gs_2.4.11.tar.xz/src/smf/namf-build.c -> open5gs_2.5.0.tar.xz/src/smf/namf-build.c
Changed
@@ -146,7 +146,7 @@ } request = ogs_sbi_build_request(&message); - ogs_assert(request); + ogs_expect(request); for (i = 0; i < message.num_of_part; i++) if (message.parti.pkbuf) @@ -184,7 +184,7 @@ message.SmContextStatusNotification = &SmContextStatusNotification; request = ogs_sbi_build_request(&message); - ogs_assert(request); + ogs_expect(request); return request; }
View file
open5gs_2.4.11.tar.xz/src/smf/nnrf-handler.c -> open5gs_2.5.0.tar.xz/src/smf/nnrf-handler.c
Changed
@@ -29,6 +29,7 @@ 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; OpenAPI_search_result_t *SearchResult = NULL; ogs_assert(recvmsg); @@ -39,6 +40,8 @@ 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; @@ -48,13 +51,14 @@ return; } - ogs_nnrf_handle_nf_discover_search_result(SearchResult); + ogs_nnrf_disc_handle_nf_discover_search_result(SearchResult); nf_instance = ogs_sbi_nf_instance_find_by_discovery_param( - target_nf_type, discovery_option); + target_nf_type, requester_nf_type, discovery_option); if (!nf_instance) { - ogs_error("(NF discover) No %s", - ogs_sbi_service_type_to_name(service_type)); + ogs_error("(NF discover) No %s:%s", + ogs_sbi_service_type_to_name(service_type), + OpenAPI_nf_type_ToString(requester_nf_type)); return; }
View file
open5gs_2.4.11.tar.xz/src/smf/npcf-build.c -> open5gs_2.5.0.tar.xz/src/smf/npcf-build.c
Changed
@@ -48,17 +48,32 @@ memset(&SmPolicyContextData, 0, sizeof(SmPolicyContextData)); - ogs_assert(smf_ue->supi); SmPolicyContextData.supi = smf_ue->supi; - ogs_assert(sess->psi); + if (!SmPolicyContextData.supi) { + ogs_error("No supi"); + goto end; + } SmPolicyContextData.pdu_session_id = sess->psi; - ogs_assert(sess->session.session_type); + if (!SmPolicyContextData.pdu_session_id) { + ogs_error("No pdu_session_id"); + goto end; + } SmPolicyContextData.pdu_session_type = sess->session.session_type; - ogs_assert(sess->session.name); + if (!SmPolicyContextData.pdu_session_type) { + ogs_error("No pdu_session_type"); + goto end; + } SmPolicyContextData.dnn = sess->session.name; + if (!SmPolicyContextData.dnn) { + ogs_error("No dnn"); + goto end; + } server = ogs_list_first(&ogs_sbi_self()->server_list); - ogs_assert(server); + if (!server) { + ogs_error("No server"); + goto end; + } memset(&header, 0, sizeof(header)); header.service.name = (char *)OGS_SBI_SERVICE_NAME_NSMF_CALLBACK; @@ -67,18 +82,27 @@ (char *)OGS_SBI_RESOURCE_NAME_SM_POLICY_NOTIFY; header.resource.component1 = sess->sm_context_ref; SmPolicyContextData.notification_uri = ogs_sbi_server_uri(server, &header); - ogs_assert(SmPolicyContextData.notification_uri); + if (!SmPolicyContextData.notification_uri) { + ogs_error("No notification_uri"); + goto end; + } if (sess->ipv4) { SmPolicyContextData.ipv4_address = ogs_ipv4_to_string(sess->ipv4->addr0); - ogs_expect_or_return_val(SmPolicyContextData.ipv4_address, NULL); + if (!SmPolicyContextData.ipv4_address) { + ogs_error("No ipv4_address"); + goto end; + } } if (sess->ipv6) { SmPolicyContextData.ipv6_address_prefix = ogs_ipv6prefix_to_string( (uint8_t *)sess->ipv6->addr, OGS_IPV6_128_PREFIX_LEN); - ogs_expect_or_return_val(SmPolicyContextData.ipv6_address_prefix, NULL); + if (!SmPolicyContextData.ipv6_address_prefix) { + ogs_error("No ipv6_address_prefix"); + goto end; + } } memset(&SubsSessAmbr, 0, sizeof(SubsSessAmbr)); @@ -104,14 +128,20 @@ else if (sess->session.qos.arp.pre_emption_capability == OGS_5GC_PRE_EMPTION_DISABLED) Arp.preempt_cap = OpenAPI_preemption_capability_NOT_PREEMPT; - ogs_assert(Arp.preempt_cap); + if (!Arp.preempt_cap) { + ogs_error("No Arp.preempt_cap"); + goto end; + } if (sess->session.qos.arp.pre_emption_vulnerability == OGS_5GC_PRE_EMPTION_ENABLED) Arp.preempt_vuln = OpenAPI_preemption_vulnerability_PREEMPTABLE; else if (sess->session.qos.arp.pre_emption_vulnerability == OGS_5GC_PRE_EMPTION_DISABLED) Arp.preempt_vuln = OpenAPI_preemption_vulnerability_NOT_PREEMPTABLE; - ogs_assert(Arp.preempt_vuln); + if (!Arp.preempt_vuln) { + ogs_error("No Arp.preempt_vuln"); + goto end; + } Arp.priority_level = sess->session.qos.arp.priority_level; memset(&SubsDefQos, 0, sizeof(SubsDefQos)); @@ -125,7 +155,10 @@ if (sess->smpolicycontrol_features) { SmPolicyContextData.supp_feat = ogs_uint64_to_string(sess->smpolicycontrol_features); - ogs_expect_or_return_val(SmPolicyContextData.supp_feat, NULL); + if (!SmPolicyContextData.supp_feat) { + ogs_error("No supp_feat"); + goto end; + } } memset(&sNssai, 0, sizeof(sNssai)); @@ -138,7 +171,9 @@ request = ogs_sbi_build_request(&message); ogs_expect(request); - ogs_free(SmPolicyContextData.notification_uri); +end: + if (SmPolicyContextData.notification_uri) + ogs_free(SmPolicyContextData.notification_uri); if (SmPolicyContextData.gpsi) ogs_free(SmPolicyContextData.gpsi); @@ -198,18 +233,29 @@ param->ran_nas_release.gsm_cause || param->ran_nas_release.ngap_cause.group) { - ranNasRelCause = ogs_calloc(1, sizeof(*ranNasRelCause)); - ogs_expect_or_return_val(ranNasRelCause, NULL); - ranNasRelCauseList = OpenAPI_list_create(); - ogs_expect_or_return_val(ranNasRelCauseList, NULL); + if (!ranNasRelCauseList) { + ogs_error("No ranNasRelCauseList"); + goto end; + } + + ranNasRelCause = ogs_calloc(1, sizeof(*ranNasRelCause)); + if (!ranNasRelCause) { + ogs_error("No ranNasRelCause"); + goto end; + } if (param->ran_nas_release.ngap_cause.group) { OpenAPI_ng_ap_cause_t *ngApCause = NULL; ranNasRelCause->ng_ap_cause = ngApCause = ogs_calloc(1, sizeof(*ngApCause)); - ogs_expect_or_return_val(ngApCause, NULL); + if (!ranNasRelCause->ng_ap_cause) { + ogs_error("No ranNasRelCause->ng_ap_cause"); + if (ranNasRelCause) + ogs_free(ranNasRelCause); + goto end; + } ngApCause->group = param->ran_nas_release.ngap_cause.group; ngApCause->value = param->ran_nas_release.ngap_cause.value; @@ -226,24 +272,35 @@ if (param->ue_location) { ueLocation.nr_location = ogs_sbi_build_nr_location( &sess->nr_tai, &sess->nr_cgi); - ogs_expect_or_return_val(ueLocation.nr_location, NULL); + if (!ueLocation.nr_location) { + ogs_error("ueLocation.nr_location"); + goto end; + } ueLocation.nr_location->ue_location_timestamp = ogs_sbi_gmtime_string(sess->ue_location_timestamp); - ogs_expect_or_return_val( - ueLocation.nr_location->ue_location_timestamp, NULL); + if (!ueLocation.nr_location->ue_location_timestamp) { + ogs_error("ueLocation.nr_location->ue_location_timestamp"); + goto end; + } SmPolicyDeleteData.user_location_info = &ueLocation; } if (param->ue_timezone) { SmPolicyDeleteData.ue_time_zone = ogs_sbi_timezone_string(ogs_timezone()); - ogs_expect_or_return_val(SmPolicyDeleteData.ue_time_zone, NULL); + if (!SmPolicyDeleteData.ue_time_zone) { + ogs_error("SmPolicyDeleteData.ue_time_zone"); + goto end; + } } } SmPolicyDeleteData.serving_network = ogs_sbi_build_plmn_id_nid(&sess->plmn_id); - ogs_expect_or_return_val(SmPolicyDeleteData.serving_network, NULL); + if (!SmPolicyDeleteData.serving_network) { + ogs_error("SmPolicyDeleteData.serving_network"); + goto end; + } SmPolicyDeleteData.ran_nas_rel_causes = ranNasRelCauseList; @@ -252,6 +309,8 @@ request = ogs_sbi_build_request(&message); ogs_expect(request); +end: + if (ueLocation.nr_location) { if (ueLocation.nr_location->ue_location_timestamp) ogs_free(ueLocation.nr_location->ue_location_timestamp);
View file
open5gs_2.4.11.tar.xz/src/smf/nudm-build.c -> open5gs_2.5.0.tar.xz/src/smf/nudm-build.c
Changed
@@ -45,7 +45,7 @@ message.param.dnn = sess->session.name; request = ogs_sbi_build_request(&message); - ogs_assert(request); + ogs_expect(request); return request; }
View file
open5gs_2.4.11.tar.xz/src/smf/pfcp-sm.c -> open5gs_2.5.0.tar.xz/src/smf/pfcp-sm.c
Changed
@@ -232,6 +232,7 @@ if (!sess) { ogs_gtp_xact_t *gtp_xact = xact->assoc_xact; + ogs_error("No Session"); if (!gtp_xact) { ogs_error("No associated GTP transaction"); break; @@ -266,6 +267,7 @@ if (!sess) { ogs_gtp_xact_t *gtp_xact = xact->assoc_xact; + ogs_error("No Session"); if (!gtp_xact) { ogs_error("No associated GTP transaction"); break;
View file
open5gs_2.4.11.tar.xz/src/smf/sbi-path.c -> open5gs_2.5.0.tar.xz/src/smf/sbi-path.c
Changed
@@ -21,67 +21,13 @@ #include "ngap-path.h" #include "sbi-path.h" -static int server_cb(ogs_sbi_request_t *request, void *data) -{ - smf_event_t *e = NULL; - int rv; - - ogs_assert(request); - ogs_assert(data); - - e = smf_event_new(OGS_EVENT_SBI_SERVER); - ogs_assert(e); - - e->h.sbi.request = request; - e->h.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; -} - -static int client_cb(int status, ogs_sbi_response_t *response, void *data) -{ - smf_event_t *e = NULL; - int rv; - - if (status != OGS_OK) { - ogs_log_message( - status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0, - "client_cb() failed %d", status); - return OGS_ERROR; - } - - ogs_assert(response); - - e = smf_event_new(OGS_EVENT_SBI_CLIENT); - ogs_assert(e); - e->h.sbi.response = response; - e->h.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; -} - int smf_sbi_open(void) { ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_nf_instance_t *nrf_instance = NULL, *scp_instance = NULL; ogs_sbi_nf_service_t *service = NULL; - /* Add SELF NF instance */ + /* Initialize SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); ogs_sbi_nf_fsm_init(nf_instance); @@ -101,30 +47,32 @@ ogs_sbi_nf_service_add_allowed_nf_type(service, OpenAPI_nf_type_AMF); } - /* Initialize NRF NF Instance */ - nf_instance = ogs_sbi_self()->nrf_instance; - if (nf_instance) { - ogs_sbi_client_t *client = NULL; - - /* Client callback is only used when NF sends to NRF */ - client = nf_instance->client; - ogs_assert(client); - client->cb = client_cb; - - /* NFRegister is sent and the response is received - * by the above client callback. */ - ogs_sbi_nf_fsm_init(nf_instance); - } - - /* Build Subscription-Data */ - ogs_sbi_subscription_data_build_default( - OpenAPI_nf_type_AMF, OGS_SBI_SERVICE_NAME_NAMF_COMM); - ogs_sbi_subscription_data_build_default( - OpenAPI_nf_type_PCF, OGS_SBI_SERVICE_NAME_NPCF_SMPOLICYCONTROL); - ogs_sbi_subscription_data_build_default( - OpenAPI_nf_type_UDM, OGS_SBI_SERVICE_NAME_NUDM_SDM); + /* + * SMF can only run to support 4G EPC mode. + * + * If the SMF is only running in 4G EPC mode, + * it should not send NFRegister/NFStatusSubscribe messages to the NRF. + */ + nrf_instance = ogs_sbi_self()->nrf_instance; + scp_instance = ogs_sbi_self()->scp_instance; + + if (NF_INSTANCE_CLIENT(nrf_instance) || NF_INSTANCE_CLIENT(scp_instance)) { + + /* Initialize NRF NF Instance */ + nf_instance = ogs_sbi_self()->nrf_instance; + if (nf_instance) + ogs_sbi_nf_fsm_init(nf_instance); + + /* Build Subscription-Data */ + ogs_sbi_subscription_data_build_default( + OpenAPI_nf_type_AMF, OGS_SBI_SERVICE_NAME_NAMF_COMM); + ogs_sbi_subscription_data_build_default( + OpenAPI_nf_type_PCF, OGS_SBI_SERVICE_NAME_NPCF_SMPOLICYCONTROL); + ogs_sbi_subscription_data_build_default( + OpenAPI_nf_type_UDM, OGS_SBI_SERVICE_NAME_NUDM_SDM); + } - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) return OGS_ERROR; return OGS_OK; @@ -136,11 +84,12 @@ ogs_sbi_server_stop_all(); } -bool smf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data) +bool smf_sbi_send_request( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact) { ogs_assert(nf_instance); - - return ogs_sbi_send_request(nf_instance, client_cb, data); + ogs_assert(xact); + return ogs_sbi_send_request_to_nf_instance(nf_instance, xact); } bool smf_sbi_discover_and_send( @@ -173,7 +122,7 @@ xact->state = state; xact->assoc_stream = stream; - if (ogs_sbi_discover_and_send(xact, client_cb) != true) { + if (ogs_sbi_discover_and_send(xact) != true) { ogs_error("smf_sbi_discover_and_send() failed"); ogs_sbi_xact_remove(xact); @@ -219,7 +168,7 @@ xact->state = param->state; - if (ogs_sbi_discover_and_send(xact, client_cb) != true) { + if (ogs_sbi_discover_and_send(xact) != true) { ogs_error("smf_namf_comm_send_n1_n2_message_transfer() failed"); ogs_sbi_xact_remove(xact); } @@ -438,6 +387,7 @@ bool smf_sbi_send_sm_context_status_notify(smf_sess_t *sess) { + bool rc; ogs_sbi_request_t *request = NULL; ogs_sbi_client_t *client = NULL; @@ -447,5 +397,12 @@ request = smf_namf_callback_build_sm_context_status(sess, NULL); ogs_expect_or_return_val(request, false); - return ogs_sbi_client_send_request(client, client_notify_cb, request, NULL); + + rc = ogs_sbi_send_request_to_client( + client, client_notify_cb, request, NULL); + ogs_expect(rc == true); + + ogs_sbi_request_free(request); + + return rc; }
View file
open5gs_2.4.11.tar.xz/src/smf/sbi-path.h -> open5gs_2.5.0.tar.xz/src/smf/sbi-path.h
Changed
@@ -33,7 +33,8 @@ int smf_sbi_open(void); void smf_sbi_close(void); -bool smf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data); +bool smf_sbi_send_request( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact); bool smf_sbi_discover_and_send( ogs_sbi_service_type_e service_type, ogs_sbi_discovery_option_t *discovery_option,
View file
open5gs_2.4.11.tar.xz/src/smf/smf-sm.c -> open5gs_2.5.0.tar.xz/src/smf/smf-sm.c
Changed
@@ -143,6 +143,7 @@ OGS_SETUP_GTP_NODE(sess, smf_gnode->gnode); } if (!sess) { + ogs_error("No Session"); ogs_gtp2_send_error_message(gtp_xact, 0, OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND); @@ -152,9 +153,11 @@ ogs_fsm_dispatch(&sess->sm, e); break; case OGS_GTP2_DELETE_SESSION_REQUEST_TYPE: + if (!gtp2_message.h.teid_presence) ogs_error("No TEID"); smf_metrics_inst_global_inc(SMF_METR_GLOB_CTR_S5C_RX_DELETESESSIONREQ); smf_metrics_inst_gtp_node_inc(smf_gnode->metrics, SMF_METR_GTP_NODE_CTR_S5C_RX_DELETESESSIONREQ); if (!sess) { + ogs_error("No Session"); ogs_gtp2_send_error_message(gtp_xact, 0, OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND); @@ -164,6 +167,7 @@ ogs_fsm_dispatch(&sess->sm, e); break; case OGS_GTP2_MODIFY_BEARER_REQUEST_TYPE: + if (!gtp2_message.h.teid_presence) ogs_error("No TEID"); smf_s5c_handle_modify_bearer_request( sess, gtp_xact, recvbuf, >p2_message.modify_bearer_request); break; @@ -188,6 +192,7 @@ ogs_fsm_dispatch(&sess->sm, e); break; case OGS_GTP2_BEARER_RESOURCE_COMMAND_TYPE: + if (!gtp2_message.h.teid_presence) ogs_error("No TEID"); smf_s5c_handle_bearer_resource_command( sess, gtp_xact, >p2_message.bearer_resource_command); break; @@ -461,7 +466,7 @@ CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY) SWITCH(sbi_message.h.method) CASE(OGS_SBI_HTTP_METHOD_POST) - ogs_nnrf_handle_nf_status_notify(stream, &sbi_message); + ogs_nnrf_nfm_handle_nf_status_notify(stream, &sbi_message); break; DEFAULT @@ -674,7 +679,7 @@ 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_handle_nf_status_subscribe( + ogs_nnrf_nfm_handle_nf_status_subscribe( subscription_data, &sbi_message); } else { ogs_error("HTTP response error : %d",
View file
open5gs_2.4.11.tar.xz/src/udm/context.c -> open5gs_2.5.0.tar.xz/src/udm/context.c
Changed
@@ -188,6 +188,8 @@ ogs_free(udm_ue->amf_instance_id); if (udm_ue->dereg_callback_uri) ogs_free(udm_ue->dereg_callback_uri); + if (udm_ue->data_change_callback_uri) + ogs_free(udm_ue->data_change_callback_uri); ogs_pool_free(&udm_ue_pool, udm_ue); }
View file
open5gs_2.4.11.tar.xz/src/udm/context.h -> open5gs_2.5.0.tar.xz/src/udm/context.h
Changed
@@ -58,6 +58,7 @@ char *amf_instance_id; char *dereg_callback_uri; + char *data_change_callback_uri; uint8_t kOGS_KEY_LEN; uint8_t opcOGS_KEY_LEN;
View file
open5gs_2.4.11.tar.xz/src/udm/event.h -> open5gs_2.5.0.tar.xz/src/udm/event.h
Changed
@@ -34,6 +34,8 @@ udm_ue_t *udm_ue; } udm_event_t; +OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(udm_event_t)); + udm_event_t *udm_event_new(int id); const char *udm_event_get_name(udm_event_t *e);
View file
open5gs_2.4.11.tar.xz/src/udm/nnrf-handler.c -> open5gs_2.5.0.tar.xz/src/udm/nnrf-handler.c
Changed
@@ -29,6 +29,7 @@ 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; OpenAPI_search_result_t *SearchResult = NULL; ogs_assert(recvmsg); @@ -39,6 +40,8 @@ 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; @@ -48,13 +51,14 @@ return; } - ogs_nnrf_handle_nf_discover_search_result(SearchResult); + ogs_nnrf_disc_handle_nf_discover_search_result(SearchResult); nf_instance = ogs_sbi_nf_instance_find_by_discovery_param( - target_nf_type, discovery_option); + target_nf_type, requester_nf_type, discovery_option); if (!nf_instance) { - ogs_error("(NF discover) No %s", - ogs_sbi_service_type_to_name(service_type)); + ogs_error("(NF discover) No %s:%s", + ogs_sbi_service_type_to_name(service_type), + OpenAPI_nf_type_ToString(requester_nf_type)); return; }
View file
open5gs_2.4.11.tar.xz/src/udm/nudm-handler.c -> open5gs_2.5.0.tar.xz/src/udm/nudm-handler.c
Changed
@@ -479,3 +479,85 @@ return true; } + +bool udm_nudm_sdm_handle_subscription_create( + udm_ue_t *udm_ue, ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg) +{ + ogs_sbi_message_t sendmsg; + ogs_sbi_response_t *response = NULL; + ogs_sbi_server_t *server = NULL; + ogs_sbi_header_t header; + + OpenAPI_sdm_subscription_t *SDMSubscription = NULL; + + ogs_assert(udm_ue); + ogs_assert(stream); + ogs_assert(recvmsg); + + SDMSubscription = recvmsg->SDMSubscription; + if (!SDMSubscription) { + ogs_error("%s No SDMSubscription", udm_ue->supi); + ogs_assert(true == + ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No SDMSubscription", udm_ue->supi)); + return false; + } + + if (!SDMSubscription->nf_instance_id) { + ogs_error("%s No nfInstanceId", udm_ue->supi); + ogs_assert(true == + ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No nfInstanceId", udm_ue->supi)); + return false; + } + + if (!SDMSubscription->callback_reference) { + ogs_error("%s No callbackReference", udm_ue->supi); + ogs_assert(true == + ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No callbackReference", udm_ue->supi)); + return false; + } + + if ((!SDMSubscription->monitored_resource_uris) && + (!SDMSubscription->monitored_resource_uris->count)) { + ogs_error("%s No monitoredResourceUris", udm_ue->supi); + ogs_assert(true == + ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No monitoredResourceUris", udm_ue->supi)); + return false; + } + + if (udm_ue->data_change_callback_uri) + ogs_free(udm_ue->data_change_callback_uri); + udm_ue->data_change_callback_uri = + ogs_strdup(SDMSubscription->callback_reference); + + + server = ogs_sbi_server_from_stream(stream); + ogs_assert(server); + + memset(&header, 0, sizeof(header)); + header.service.name = (char *)OGS_SBI_SERVICE_NAME_NUDM_SDM; + header.api.version = (char *)OGS_SBI_API_V2; + header.resource.component0 = udm_ue->supi; + header.resource.component1 = + (char *)OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS; + /* TODO: subscription id */ + header.resource.component2 = udm_ue->ctx_id; + + memset(&sendmsg, 0, sizeof(sendmsg)); + sendmsg.http.location = ogs_sbi_server_uri(server, &header); + + sendmsg.SDMSubscription = OpenAPI_sdm_subscription_copy( + sendmsg.SDMSubscription, SDMSubscription); + + response = ogs_sbi_build_response(&sendmsg, OGS_SBI_HTTP_STATUS_CREATED); + ogs_assert(response); + ogs_sbi_server_send_response(stream, response); + + ogs_free(sendmsg.http.location); + OpenAPI_sdm_subscription_free(sendmsg.SDMSubscription); + + return true; +}
View file
open5gs_2.4.11.tar.xz/src/udm/nudm-handler.h -> open5gs_2.5.0.tar.xz/src/udm/nudm-handler.h
Changed
@@ -38,6 +38,8 @@ bool udm_nudm_sdm_handle_subscription_provisioned( udm_ue_t *udm_ue, ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg); +bool udm_nudm_sdm_handle_subscription_create( + udm_ue_t *udm_ue, ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg); #ifdef __cplusplus }
View file
open5gs_2.4.11.tar.xz/src/udm/sbi-path.c -> open5gs_2.5.0.tar.xz/src/udm/sbi-path.c
Changed
@@ -19,67 +19,12 @@ #include "sbi-path.h" -static int server_cb(ogs_sbi_request_t *request, void *data) -{ - udm_event_t *e = NULL; - int rv; - - ogs_assert(request); - ogs_assert(data); - - e = udm_event_new(OGS_EVENT_SBI_SERVER); - ogs_assert(e); - - e->h.sbi.request = request; - e->h.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; -} - -static int client_cb(int status, ogs_sbi_response_t *response, void *data) -{ - udm_event_t *e = NULL; - int rv; - - if (status != OGS_OK) { - ogs_log_message( - status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0, - "client_cb() failed %d", status); - return OGS_ERROR; - } - - ogs_assert(response); - - e = udm_event_new(OGS_EVENT_SBI_CLIENT); - ogs_assert(e); - e->h.sbi.response = response; - e->h.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; -} - int udm_sbi_open(void) { ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_nf_service_t *service = NULL; - /* Add SELF NF instance */ + /* Initialize SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); ogs_sbi_nf_fsm_init(nf_instance); @@ -122,23 +67,13 @@ /* Initialize NRF NF Instance */ nf_instance = ogs_sbi_self()->nrf_instance; - if (nf_instance) { - ogs_sbi_client_t *client = NULL; - - /* Client callback is only used when NF sends to NRF */ - client = nf_instance->client; - ogs_assert(client); - client->cb = client_cb; - - /* NFRegister is sent and the response is received - * by the above client callback. */ + if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); - } /* Build Subscription-Data */ ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_UDR, NULL); - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) return OGS_ERROR; return OGS_OK; @@ -150,11 +85,12 @@ ogs_sbi_server_stop_all(); } -bool udm_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data) +bool udm_sbi_send_request( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact) { ogs_assert(nf_instance); - - return ogs_sbi_send_request(nf_instance, client_cb, data); + ogs_assert(xact); + return ogs_sbi_send_request_to_nf_instance(nf_instance, xact); } bool udm_sbi_discover_and_send( @@ -184,7 +120,7 @@ xact->assoc_stream = stream; - if (ogs_sbi_discover_and_send(xact, client_cb) != true) { + if (ogs_sbi_discover_and_send(xact) != true) { ogs_error("udm_sbi_discover_and_send() failed"); ogs_sbi_xact_remove(xact); ogs_assert(true ==
View file
open5gs_2.4.11.tar.xz/src/udm/sbi-path.h -> open5gs_2.5.0.tar.xz/src/udm/sbi-path.h
Changed
@@ -29,7 +29,8 @@ int udm_sbi_open(void); void udm_sbi_close(void); -bool udm_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data); +bool udm_sbi_send_request( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact); bool udm_sbi_discover_and_send( ogs_sbi_service_type_e service_type, ogs_sbi_discovery_option_t *discovery_option,
View file
open5gs_2.4.11.tar.xz/src/udm/udm-sm.c -> open5gs_2.5.0.tar.xz/src/udm/udm-sm.c
Changed
@@ -103,7 +103,7 @@ CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY) SWITCH(message.h.method) CASE(OGS_SBI_HTTP_METHOD_POST) - ogs_nnrf_handle_nf_status_notify(stream, &message); + ogs_nnrf_nfm_handle_nf_status_notify(stream, &message); break; DEFAULT @@ -247,7 +247,7 @@ CASE(OGS_SBI_HTTP_METHOD_POST) if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED || message.res_status == OGS_SBI_HTTP_STATUS_OK) { - ogs_nnrf_handle_nf_status_subscribe( + ogs_nnrf_nfm_handle_nf_status_subscribe( subscription_data, &message); } else { ogs_error("%s HTTP response error %d",
View file
open5gs_2.4.11.tar.xz/src/udm/ue-sm.c -> open5gs_2.5.0.tar.xz/src/udm/ue-sm.c
Changed
@@ -163,6 +163,23 @@ "Invalid resource name", message->h.method)); END break; + + CASE(OGS_SBI_HTTP_METHOD_POST) + SWITCH(message->h.resource.component1) + CASE(OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS) + udm_nudm_sdm_handle_subscription_create( + udm_ue, stream, message); + break; + + DEFAULT + ogs_error("%s Invalid resource name %s", + udm_ue->suci, message->h.resource.component1); + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, message, + "Invalid resource name", message->h.method)); + END + break; DEFAULT ogs_error("%s Invalid HTTP method %s", udm_ue->supi, message->h.method);
View file
open5gs_2.4.11.tar.xz/src/udr/event.h -> open5gs_2.5.0.tar.xz/src/udr/event.h
Changed
@@ -30,6 +30,8 @@ ogs_event_t h; } udr_event_t; +OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(udr_event_t)); + udr_event_t *udr_event_new(int id); const char *udr_event_get_name(udr_event_t *e);
View file
open5gs_2.4.11.tar.xz/src/udr/sbi-path.c -> open5gs_2.5.0.tar.xz/src/udr/sbi-path.c
Changed
@@ -19,67 +19,12 @@ #include "sbi-path.h" -static int server_cb(ogs_sbi_request_t *request, void *data) -{ - udr_event_t *e = NULL; - int rv; - - ogs_assert(request); - ogs_assert(data); - - e = udr_event_new(OGS_EVENT_SBI_SERVER); - ogs_assert(e); - - e->h.sbi.request = request; - e->h.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; -} - -static int client_cb(int status, ogs_sbi_response_t *response, void *data) -{ - udr_event_t *e = NULL; - int rv; - - if (status != OGS_OK) { - ogs_log_message( - status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0, - "client_cb() failed %d", status); - return OGS_ERROR; - } - - ogs_assert(response); - - e = udr_event_new(OGS_EVENT_SBI_CLIENT); - ogs_assert(e); - e->h.sbi.response = response; - e->h.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; -} - int udr_sbi_open(void) { ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_nf_service_t *service = NULL; - /* Add SELF NF instance */ + /* Initialize SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); ogs_sbi_nf_fsm_init(nf_instance); @@ -103,20 +48,10 @@ /* Initialize NRF NF Instance */ nf_instance = ogs_sbi_self()->nrf_instance; - if (nf_instance) { - ogs_sbi_client_t *client = NULL; - - /* Client callback is only used when NF sends to NRF */ - client = nf_instance->client; - ogs_assert(client); - client->cb = client_cb; - - /* NFRegister is sent and the response is received - * by the above client callback. */ + if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); - } - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) return OGS_ERROR; return OGS_OK;
View file
open5gs_2.4.11.tar.xz/src/udr/udr-sm.c -> open5gs_2.5.0.tar.xz/src/udr/udr-sm.c
Changed
@@ -93,7 +93,7 @@ CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY) SWITCH(message.h.method) CASE(OGS_SBI_HTTP_METHOD_POST) - ogs_nnrf_handle_nf_status_notify(stream, &message); + ogs_nnrf_nfm_handle_nf_status_notify(stream, &message); break; DEFAULT @@ -228,7 +228,7 @@ CASE(OGS_SBI_HTTP_METHOD_POST) if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED || message.res_status == OGS_SBI_HTTP_STATUS_OK) { - ogs_nnrf_handle_nf_status_subscribe( + ogs_nnrf_nfm_handle_nf_status_subscribe( subscription_data, &message); } else { ogs_error("%s HTTP response error %d",
View file
open5gs_2.4.11.tar.xz/src/upf/context.c -> open5gs_2.5.0.tar.xz/src/upf/context.c
Changed
@@ -394,7 +394,7 @@ pdr->dnn ? pdr->dnn : ""); } - ogs_info("UE F-SEIDCP:0x%lx UP:0x%lx " + ogs_info("UE F-SEIDUP:0x%lx CP:0x%lx " "APN%s PDN-Type%d IPv4%s IPv6%s", (long)sess->upf_n4_seid, (long)sess->smf_n4_f_seid.seid, pdr->dnn, session_type,
View file
open5gs_2.4.11.tar.xz/src/upf/event.h -> open5gs_2.5.0.tar.xz/src/upf/event.h
Changed
@@ -53,6 +53,8 @@ ogs_pfcp_message_t *pfcp_message; } upf_event_t; +OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(upf_event_t)); + void upf_event_init(void); void upf_event_term(void); void upf_event_final(void);
View file
open5gs_2.4.11.tar.xz/tests/af/af-sm.c -> open5gs_2.5.0.tar.xz/tests/af/af-sm.c
Changed
@@ -98,7 +98,7 @@ CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY) SWITCH(message.h.method) CASE(OGS_SBI_HTTP_METHOD_POST) - ogs_nnrf_handle_nf_status_notify(stream, &message); + ogs_nnrf_nfm_handle_nf_status_notify(stream, &message); break; DEFAULT @@ -230,7 +230,7 @@ CASE(OGS_SBI_HTTP_METHOD_POST) if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED || message.res_status == OGS_SBI_HTTP_STATUS_OK) { - ogs_nnrf_handle_nf_status_subscribe( + ogs_nnrf_nfm_handle_nf_status_subscribe( subscription_data, &message); } else { ogs_error("HTTP response error : %d",
View file
open5gs_2.4.11.tar.xz/tests/af/event.h -> open5gs_2.5.0.tar.xz/tests/af/event.h
Changed
@@ -52,6 +52,8 @@ af_sess_t *sess; } af_event_t; +OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(af_event_t)); + af_event_t *af_event_new(int id); const char *af_event_get_name(af_event_t *e);
View file
open5gs_2.4.11.tar.xz/tests/af/nbsf-build.c -> open5gs_2.5.0.tar.xz/tests/af/nbsf-build.c
Changed
@@ -38,7 +38,7 @@ message.param.ipv6prefix = sess->ipv6prefix; request = ogs_sbi_build_request(&message); - ogs_assert(request); + ogs_expect(request); return request; }
View file
open5gs_2.4.11.tar.xz/tests/af/nnrf-handler.c -> open5gs_2.5.0.tar.xz/tests/af/nnrf-handler.c
Changed
@@ -29,6 +29,7 @@ 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; OpenAPI_search_result_t *SearchResult = NULL; ogs_assert(recvmsg); @@ -39,6 +40,8 @@ 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; @@ -48,13 +51,14 @@ return; } - ogs_nnrf_handle_nf_discover_search_result(SearchResult); + ogs_nnrf_disc_handle_nf_discover_search_result(SearchResult); nf_instance = ogs_sbi_nf_instance_find_by_discovery_param( - target_nf_type, discovery_option); + target_nf_type, requester_nf_type, discovery_option); if (!nf_instance) { - ogs_error("(NF discover) No %s", - ogs_sbi_service_type_to_name(service_type)); + ogs_error("(NF discover) No %s:%s", + ogs_sbi_service_type_to_name(service_type), + OpenAPI_nf_type_ToString(requester_nf_type)); return; }
View file
open5gs_2.4.11.tar.xz/tests/af/npcf-build.c -> open5gs_2.5.0.tar.xz/tests/af/npcf-build.c
Changed
@@ -273,11 +273,13 @@ AscReqData.med_components = MediaComponentList; request = ogs_sbi_build_request(&message); - ogs_expect_or_return_val(request, NULL); + ogs_expect(request); - ogs_free(AscReqData.notif_uri); + if (AscReqData.notif_uri) + ogs_free(AscReqData.notif_uri); - ogs_free(AscReqData.supp_feat); + if (AscReqData.supp_feat) + ogs_free(AscReqData.supp_feat); EventList = evSubsc.events; OpenAPI_list_for_each(EventList, node) { @@ -534,7 +536,7 @@ AscUpdateData.med_components = MediaComponentList; request = ogs_sbi_build_request(&message); - ogs_expect_or_return_val(request, NULL); + ogs_expect(request); OpenAPI_list_for_each(MediaComponentList, node) { MediaComponentMap = node->data; @@ -616,7 +618,7 @@ (char *)OGS_SBI_RESOURCE_NAME_DELETE; request = ogs_sbi_build_request(&message); - ogs_expect_or_return_val(request, NULL); + ogs_expect(request); return request; } @@ -992,11 +994,13 @@ AscReqData.med_components = MediaComponentList; request = ogs_sbi_build_request(&message); - ogs_expect_or_return_val(request, NULL); + ogs_expect(request); - ogs_free(AscReqData.notif_uri); + if (AscReqData.notif_uri) + ogs_free(AscReqData.notif_uri); - ogs_free(AscReqData.supp_feat); + if (AscReqData.supp_feat) + ogs_free(AscReqData.supp_feat); EventList = evSubsc.events; OpenAPI_list_for_each(EventList, node) {
View file
open5gs_2.4.11.tar.xz/tests/af/sbi-path.c -> open5gs_2.5.0.tar.xz/tests/af/sbi-path.c
Changed
@@ -19,66 +19,11 @@ #include "sbi-path.h" -static int server_cb(ogs_sbi_request_t *request, void *data) -{ - af_event_t *e = NULL; - int rv; - - ogs_assert(request); - ogs_assert(data); - - e = af_event_new(OGS_EVENT_SBI_SERVER); - ogs_assert(e); - - e->h.sbi.request = request; - e->h.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; -} - -static int client_cb(int status, ogs_sbi_response_t *response, void *data) -{ - af_event_t *e = NULL; - int rv; - - if (status != OGS_OK) { - ogs_log_message( - status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0, - "client_cb() failed %d", status); - return OGS_ERROR; - } - - ogs_assert(response); - - e = af_event_new(OGS_EVENT_SBI_CLIENT); - ogs_assert(e); - e->h.sbi.response = response; - e->h.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; -} - int af_sbi_open(void) { ogs_sbi_nf_instance_t *nf_instance = NULL; - /* Add SELF NF instance */ + /* Initialize SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); ogs_sbi_nf_fsm_init(nf_instance); @@ -88,24 +33,14 @@ /* Initialize NRF NF Instance */ nf_instance = ogs_sbi_self()->nrf_instance; - if (nf_instance) { - ogs_sbi_client_t *client = NULL; - - /* Client callback is only used when NF sends to NRF */ - client = nf_instance->client; - ogs_assert(client); - client->cb = client_cb; - - /* NFRegister is sent and the response is received - * by the above client callback. */ + if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); - } /* Build Subscription-Data */ ogs_sbi_subscription_data_build_default( OpenAPI_nf_type_BSF, OGS_SBI_SERVICE_NAME_NBSF_MANAGEMENT); - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) return OGS_ERROR; return OGS_OK; @@ -117,11 +52,12 @@ ogs_sbi_server_stop_all(); } -bool af_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data) +bool af_sbi_send_request( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact) { ogs_assert(nf_instance); - - return ogs_sbi_send_request(nf_instance, client_cb, data); + ogs_assert(xact); + return ogs_sbi_send_request_to_nf_instance(nf_instance, xact); } void af_sbi_discover_and_send( @@ -144,7 +80,7 @@ return; } - if (ogs_sbi_discover_and_send(xact, client_cb) != true) { + if (ogs_sbi_discover_and_send(xact) != true) { ogs_error("af_sbi_discover_and_send() failed"); return; } @@ -164,5 +100,8 @@ request = (*build)(sess, data); ogs_assert(request); - ogs_sbi_client_send_request(client, client_cb, request, sess); + ogs_sbi_send_request_to_client( + client, ogs_sbi_client_handler, request, sess); + + ogs_sbi_request_free(request); }
View file
open5gs_2.4.11.tar.xz/tests/af/sbi-path.h -> open5gs_2.5.0.tar.xz/tests/af/sbi-path.h
Changed
@@ -30,7 +30,8 @@ int af_sbi_open(void); void af_sbi_close(void); -bool af_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data); +bool af_sbi_send_request( + ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact); void af_sbi_discover_and_send( ogs_sbi_service_type_e service_type, ogs_sbi_discovery_option_t *discovery_option,
View file
open5gs_2.4.11.tar.xz/webui/package-lock.json -> open5gs_2.5.0.tar.xz/webui/package-lock.json
Changed
@@ -1,61 +1,1085 @@ { "name": "open5gs", - "version": "2.4.11", + "version": "2.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "open5gs", - "version": "2.4.11", + "version": "2.5.0", "license": "AGPL-3.0", "dependencies": { - "axios": "^0.16.2", + "axios": "^1.1.3", "babel-plugin-polished": "^1.1.0", - "babel-plugin-styled-components": "^1.5.1", - "body-parser": "^1.18.3", - "connect-mongo": "^1.3.2", - "express": "^4.16.3", - "express-restify-mongoose": "^4.3.0", - "express-session": "^1.15.2", - "immutable": "^3.8.1", + "babel-plugin-styled-components": "^2.0.7", + "body-parser": "^1.20.1", + "connect-mongo": "^4.6.0", + "express": "^4.18.2", + "express-restify-mongoose": "^7.0.2", + "express-session": "^1.17.3", + "immutable": "^4.1.0", "jsonwebtoken": "^8.5.1", - "lodash": "^4.17.10", - "lusca": "^1.6.0", - "method-override": "^2.3.9", - "mongoose": "^4.13.14", - "mongoose-long": "^0.1.1", - "morgan": "^1.8.2", + "lodash": "^4.17.21", + "lusca": "^1.7.0", + "method-override": "^3.0.0", + "mongoose": "^6.7.0", + "mongoose-long": "^0.6.0", + "morgan": "^1.10.0", "next": "^3.2.3", "next-redux-wrapper": "^1.3.5", "nprogress": "^0.2.0", - "open-color": "^1.6.3", - "passport": "^0.4.0", + "open-color": "^1.9.1", + "passport": "^0.6.0", "passport-jwt": "^4.0.0", "passport-local": "^1.0.0", - "passport-local-mongoose": "^4.5.0", - "prop-types": "^15.6.2", + "passport-local-mongoose": "^7.1.2", + "prop-types": "^15.8.1", "react": "^15.6.1", "react-dom": "^15.6.1", "react-event-listener": "^0.5.9", "react-icons": "^2.2.5", "react-jsonschema-form": "^0.50.1", "react-notification-system": "^0.2.17", - "react-onclickoutside": "^6.7.1", + "react-onclickoutside": "^6.12.2", "react-redux": "^5.0.7", "react-transition-group": "^1.1.3", "redux": "^3.7.2", "redux-actions": "^2.4.0", "redux-saga": "^0.15.6", "styled-components": "^2.4.1", - "traverse": "^0.6.6" + "traverse": "^0.6.7" + } + }, + "node_modules/@aws-crypto/ie11-detection": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@aws-crypto/ie11-detection/-/ie11-detection-2.0.2.tgz", + "integrity": "sha512-5XDMQY98gMAf/WRTic5G++jfmS/VLM0rwpiOpaainKi4L0nqWMSB1SzsrEG5rjFZGYN6ZAefO+/Yta2dFM0kMw==", + "optional": true, + "dependencies": { + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/ie11-detection/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + }, + "node_modules/@aws-crypto/sha256-browser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-2.0.0.tgz", + "integrity": "sha512-rYXOQ8BFOaqMEHJrLHul/25ckWH6GTJtdLSajhlqGMx0PmSueAuvboCuZCTqEKlxR8CQOwRarxYMZZSYlhRA1A==", + "optional": true, + "dependencies": { + "@aws-crypto/ie11-detection": "^2.0.0", + "@aws-crypto/sha256-js": "^2.0.0", + "@aws-crypto/supports-web-crypto": "^2.0.0", + "@aws-crypto/util": "^2.0.0", + "@aws-sdk/types": "^3.1.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + }, + "node_modules/@aws-crypto/sha256-js": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-2.0.0.tgz", + "integrity": "sha512-VZY+mCY4Nmrs5WGfitmNqXzaE873fcIZDu54cbaDaaamsaTOP1DBImV9F4pICc3EHjQXujyE8jig+PFCaew9ig==", + "optional": true, + "dependencies": { + "@aws-crypto/util": "^2.0.0", + "@aws-sdk/types": "^3.1.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/sha256-js/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + }, + "node_modules/@aws-crypto/supports-web-crypto": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-2.0.2.tgz", + "integrity": "sha512-6mbSsLHwZ99CTOOswvCRP3C+VCWnzBf+1SnbWxzzJ9lR0mA0JnY2JEAhp8rqmTE0GPFy88rrM27ffgp62oErMQ==", + "optional": true, + "dependencies": { + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + }, + "node_modules/@aws-crypto/util": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-2.0.2.tgz", + "integrity": "sha512-Lgu5v/0e/BcrZ5m/IWqzPUf3UYFTy/PpeED+uc9SWUR1iZQL8XXbGQg10UfllwwBryO3hFF5dizK+78aoXC1eA==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "^3.110.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/util/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "optional": true + }, + "node_modules/@aws-sdk/abort-controller": { + "version": "3.193.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/abort-controller/-/abort-controller-3.193.0.tgz", + "integrity": "sha512-MYPBm5PWyKP+Tq37mKs5wDbyAyVMocF5iYmx738LYXBSj8A1V4LTFrvfd4U16BRC/sM0DYB9fBFJUQ9ISFRVYw==", + "optional": true, + "dependencies": { + "@aws-sdk/types": "3.193.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity": { + "version": "3.195.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.195.0.tgz", + "integrity": "sha512-yQFCoGqGcHvyeS3rL5H5L2I6m9XFWMLaK1/iALgYsITfmig0JzlzGH/ubStEiZMsQ8lhdWmUcOyhCK4+Bx9l0w==", + "optional": true, + "dependencies": { + "@aws-crypto/sha256-browser": "2.0.0", + "@aws-crypto/sha256-js": "2.0.0", + "@aws-sdk/client-sts": "3.194.0", + "@aws-sdk/config-resolver": "3.193.0", + "@aws-sdk/credential-provider-node": "3.193.0", + "@aws-sdk/fetch-http-handler": "3.193.0", + "@aws-sdk/hash-node": "3.193.0", + "@aws-sdk/invalid-dependency": "3.193.0", + "@aws-sdk/middleware-content-length": "3.193.0", + "@aws-sdk/middleware-endpoint": "3.193.0", + "@aws-sdk/middleware-host-header": "3.193.0", + "@aws-sdk/middleware-logger": "3.193.0", + "@aws-sdk/middleware-recursion-detection": "3.193.0", + "@aws-sdk/middleware-retry": "3.193.0", + "@aws-sdk/middleware-serde": "3.193.0", + "@aws-sdk/middleware-signing": "3.193.0", + "@aws-sdk/middleware-stack": "3.193.0", + "@aws-sdk/middleware-user-agent": "3.193.0", + "@aws-sdk/node-config-provider": "3.193.0", + "@aws-sdk/node-http-handler": "3.193.0",
View file
open5gs_2.4.11.tar.xz/webui/package.json -> open5gs_2.5.0.tar.xz/webui/package.json
Changed
@@ -1,51 +1,51 @@ { "name": "open5gs", - "version": "2.4.11", + "version": "2.5.0", "description": "Open5gs", "main": "index.js", "repository": "https://github.com/open5gs/open5gs/webui", "author": "Open5gs Group", "license": "AGPL-3.0", "dependencies": { - "axios": "^0.16.2", + "axios": "^1.1.3", "babel-plugin-polished": "^1.1.0", - "babel-plugin-styled-components": "^1.5.1", - "body-parser": "^1.18.3", - "connect-mongo": "^1.3.2", - "express": "^4.16.3", - "express-restify-mongoose": "^4.3.0", - "express-session": "^1.15.2", - "immutable": "^3.8.1", + "babel-plugin-styled-components": "^2.0.7", + "body-parser": "^1.20.1", + "connect-mongo": "^4.6.0", + "express": "^4.18.2", + "express-restify-mongoose": "^7.0.2", + "express-session": "^1.17.3", + "immutable": "^4.1.0", "jsonwebtoken": "^8.5.1", - "lodash": "^4.17.10", - "lusca": "^1.6.0", - "method-override": "^2.3.9", - "mongoose": "^4.13.14", - "mongoose-long": "^0.1.1", - "morgan": "^1.8.2", + "lodash": "^4.17.21", + "lusca": "^1.7.0", + "method-override": "^3.0.0", + "mongoose": "^6.7.0", + "mongoose-long": "^0.6.0", + "morgan": "^1.10.0", "next": "^3.2.3", "next-redux-wrapper": "^1.3.5", "nprogress": "^0.2.0", - "open-color": "^1.6.3", - "passport": "^0.4.0", + "open-color": "^1.9.1", + "passport": "^0.6.0", "passport-jwt": "^4.0.0", "passport-local": "^1.0.0", - "passport-local-mongoose": "^4.5.0", - "prop-types": "^15.6.2", + "passport-local-mongoose": "^7.1.2", + "prop-types": "^15.8.1", "react": "^15.6.1", "react-dom": "^15.6.1", "react-event-listener": "^0.5.9", "react-icons": "^2.2.5", "react-jsonschema-form": "^0.50.1", "react-notification-system": "^0.2.17", - "react-onclickoutside": "^6.7.1", + "react-onclickoutside": "^6.12.2", "react-redux": "^5.0.7", "react-transition-group": "^1.1.3", "redux": "^3.7.2", "redux-actions": "^2.4.0", "redux-saga": "^0.15.6", "styled-components": "^2.4.1", - "traverse": "^0.6.6" + "traverse": "^0.6.7" }, "scripts": { "dev": "node server/index.js",
View file
open5gs_2.4.11.tar.xz/webui/server/index.js -> open5gs_2.5.0.tar.xz/webui/server/index.js
Changed
@@ -17,7 +17,7 @@ const session = require('express-session'); const mongoose = require('mongoose'); -const MongoStore = require('connect-mongo')(session); +const MongoStore = require('connect-mongo'); const passport = require('passport'); const LocalStrategy = require('passport-local').Strategy; @@ -37,7 +37,8 @@ mongoose.set('debug', true); } const db = yield mongoose.connect(process.env.DB_URI, { - useMongoClient: true, + useNewUrlParser: true, + useUnifiedTopology: true /* other options */ }) @@ -70,8 +71,8 @@ server.use(session({ secret: secret, - store: new MongoStore({ - mongooseConnection: mongoose.connection, + store: MongoStore.create({ + mongoUrl: process.env.DB_URI, ttl: 60 * 60 * 24 * 7 * 2 }), resave: false,
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.