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.
Changes of Revision 5
open5gs_2.4.11.tar.xz/docs/_docs/guide/03-splitting-network-functions.md
Deleted
x
1
2
----
3
-title: Open5GS Splitting Network Functions
4
-head_inline: "<style> .blue { color: blue; } </style>"
5
----
6
-
7
-In a production network, NFs are usually not on the same machine as the default example that comes with Open5GS.
8
-
9
-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.
10
-
11
-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.
12
-
13
-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.
14
-
15
-## 1. Configuring Open5GS (Without other vendors' NFs)
16
-
17
-_Cloud Authentication and Session Management Server_
18
-
19
-```
20
-MongoDB = 127.0.0.1 (subscriber data) - http://localhost:3000
21
-MME-s1ap = 10.10.0.2 :36412 (authVPN) for S1-MME
22
-MME-gtpc = 127.0.0.2 :2123 for S11
23
-MME-frDi = 127.0.0.2 :3868 for S6a auth
24
-SGWC-gtpc = 127.0.0.3 :2123 for S11
25
-SGWC-pfcp = 10.10.0.3 :8805 (authVPN) for Sxa
26
-SMF-gtpc = 127.0.0.4 :2123 for S5/8c, N11
27
-SMF-pfcp = 10.10.0.4 :8805 (authVPN) for N4
28
-SMF-frDi = 127.0.0.4 :3868 for Gx auth
29
-SMF-sbi = 127.0.0.4 :7777 for 5G SBI (N7,N10,N11)
30
-AMF-ngap = 10.10.0.5 :38412 (authVPN) for N2
31
-AMF-sbi = 127.0.0.5 :7777 for 5G SBI (N8,N12,N11)
32
-HSS-frDi = 127.0.0.8 :3868 for S6a auth
33
-PCRF-frDi = 127.0.0.9 :3868 for Gx auth
34
-NRF-sbi = 127.0.0.10:7777 for 5G SBI
35
-AUSF-sbi = 127.0.0.11:7777 for 5G SBI
36
-UDM-sbi = 127.0.0.12:7777 for 5G SBI
37
-PCF-sbi = 127.0.0.13:7777 for 5G SBI
38
-NSSF-sbi = 127.0.0.14:7777 for 5G SBI
39
-BSF-sbi = 127.0.0.15:7777 for 5G SBI
40
-UDR-sbi = 127.0.0.20:7777 for 5G SBI
41
-```
42
-
43
-_Cloud Userplane Server (to host IMS etc)_
44
-
45
-```
46
-SGWU-pfcp = 10.10.0.6 :8805 (authVPN) for Sxa
47
-SGWU-gtpu = 10.11.0.6 :2152 (userplaneVPN) for S1-U, S5/8u
48
-UPF-pfcp = 10.10.0.7 :8805 (authVPN) for N4
49
-UPF-gtpu = 10.11.0.7 :2152 (userplaneVPN) for S5/8u, N3
50
-```
51
-
52
-You can refer to the network settings at
53
-{{ 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)
54
-{: .notice--danger}
55
-
56
-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.
57
-
58
-```diff
59
-$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
60
---- mme.yaml.old 2020-08-22 11:36:40.512418765 -0400
61
-+++ mme.yaml 2020-08-22 11:36:27.081466682 -0400
62
-@@ -204,20 +204,20 @@
63
- mme:
64
- freeDiameter: /home/acetcom/Documents/git/open5gs/install/etc/freeDiameter/mme.conf
65
- s1ap:
66
-- addr: 127.0.0.2
67
-+ addr: 10.10.0.2
68
- gtpc:
69
- addr: 127.0.0.2
70
- gummei:
71
- plmn_id:
72
-- mcc: 001
73
-- mnc: 01
74
-+ mcc: 999
75
-+ mnc: 70
76
- mme_gid: 2
77
- mme_code: 1
78
- tai:
79
- plmn_id:
80
-- mcc: 001
81
-- mnc: 01
82
-- tac: 7
83
-+ mcc: 999
84
-+ mnc: 70
85
-+ tac: 1
86
- security:
87
- integrity_order : EIA1, EIA2, EIA0
88
- ciphering_order : EEA0, EEA1, EEA2
89
-```
90
-
91
-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.
92
-```diff
93
-$ diff -u /etc/open5gs/sgwc.yaml.old /etc/open5gs/sgwc.yaml
94
-@@ -49,7 +49,7 @@
95
- gtpc:
96
- addr: 127.0.0.3
97
- pfcp:
98
-- addr: 127.0.0.3
99
-+ addr: 10.10.0.3
100
-
101
- #
102
- # sgwu:
103
-@@ -100,7 +100,7 @@
104
- #
105
- sgwu:
106
- pfcp:
107
-- addr: 127.0.0.6
108
-+ addr: 10.10.0.6
109
-
110
- #
111
- # parameter:
112
-```
113
-
114
-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.
115
-```diff
116
-$ diff -u /etc/open5gs/smf.yaml.old /etc/open5gs/smf.yaml
117
---- smf.yaml.old 2020-08-22 11:37:39.990816411 -0400
118
-+++ smf.yaml 2020-08-22 11:38:18.647999952 -0400
119
-@@ -187,8 +187,7 @@
120
- - addr: 127.0.0.4
121
- - addr: ::1
122
- pfcp:
123
-- - addr: 127.0.0.4
124
-- - addr: ::1
125
-+ - addr: 10.10.0.4
126
- subnet:
127
- - addr: 10.45.0.1/16
128
- - addr: 2001:db8:cafe::1/48
129
-@@ -282,7 +281,7 @@
130
- #
131
- upf:
132
- pfcp:
133
-- - addr: 127.0.0.7
134
-+ - addr: 10.10.0.7
135
-
136
- #
137
- # parameter:
138
-
139
-```
140
-
141
-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.
142
-
143
-```diff
144
-diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
145
---- amf.yaml.old 2020-06-21 23:34:14.643114779 -0400
146
-+++ amf.yaml 2020-06-21 23:34:28.718482095 -0400
147
-@@ -67,25 +67,25 @@
148
- - addr: 127.0.0.5
149
- port: 7777
150
- ngap:
151
-- - addr: 127.0.0.5
152
-+ - addr: 10.10.0.5
153
- guami:
154
- - plmn_id:
155
-- mcc: 001
156
-- mnc: 01
157
-+ mcc: 999
158
-+ mnc: 70
159
- amf_id:
160
- region: 2
161
- set: 1
162
- tai:
163
- - plmn_id:
164
-- mcc: 001
165
-- mnc: 01
166
-- tac: 7
167
-+ mcc: 999
168
-+ mnc: 70
169
-+ tac: 1
170
- plmn_support:
171
- - plmn_id:
172
-- mcc: 001
173
-- mnc: 01
174
-+ mcc: 999
175
-+ mnc: 70
176
- s_nssai:
177
- - sst: 1
178
-- - sd: 2
179
- security:
180
- integrity_order : NIA1, NIA2, NIA0
181
- ciphering_order : NEA0, NEA1, NEA2
182
-```
183
-
184
-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.
185
-```diff
186
-$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
187
---- sgwu.yaml.old 2020-08-22 11:41:09.214670723 -0400
188
-+++ sgwu.yaml 2020-08-22 11:41:27.433937124 -0400
189
-@@ -51,9 +51,9 @@
190
- #
191
- sgwu:
192
- gtpu:
193
-- addr: 127.0.0.6
194
-+ addr: 10.11.0.6
195
- pfcp:
196
-- addr: 127.0.0.6
197
-+ addr: 10.10.0.6
198
-
199
- #
200
- # sgwc:
201
open5gs_2.4.11.tar.xz/src/scp/nnrf-handler.c
Deleted
67
1
2
-/*
3
- * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
4
- *
5
- * This file is part of Open5GS.
6
- *
7
- * This program is free software: you can redistribute it and/or modify
8
- * it under the terms of the GNU Affero General Public License as published by
9
- * the Free Software Foundation, either version 3 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
- */
20
-
21
-#include "sbi-path.h"
22
-#include "nnrf-handler.h"
23
-
24
-void scp_nnrf_handle_nf_discover(
25
- ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg)
26
-{
27
- ogs_sbi_nf_instance_t *nf_instance = NULL;
28
- ogs_sbi_object_t *sbi_object = NULL;
29
- ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL;
30
- ogs_sbi_discovery_option_t *discovery_option = NULL;
31
-
32
- OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
33
- OpenAPI_search_result_t *SearchResult = NULL;
34
-
35
- ogs_assert(recvmsg);
36
- ogs_assert(xact);
37
- sbi_object = xact->sbi_object;
38
- ogs_assert(sbi_object);
39
- service_type = xact->service_type;
40
- ogs_assert(service_type);
41
- target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
42
- ogs_assert(target_nf_type);
43
-
44
- discovery_option = xact->discovery_option;
45
-
46
- SearchResult = recvmsg->SearchResult;
47
- if (!SearchResult) {
48
- ogs_error("No SearchResult");
49
- return;
50
- }
51
-
52
- ogs_nnrf_handle_nf_discover_search_result(SearchResult);
53
-
54
- nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
55
- target_nf_type, discovery_option);
56
- if (!nf_instance) {
57
- ogs_error("(NF discover) No %s",
58
- ogs_sbi_service_type_to_name(service_type));
59
- return;
60
- }
61
-
62
- OGS_SBI_SETUP_NF_INSTANCE(
63
- sbi_object->service_type_arrayservice_type, nf_instance);
64
-
65
- ogs_expect(true == scp_sbi_send_request(nf_instance, xact));
66
-}
67
open5gs_2.4.11.tar.xz/src/scp/nnrf-handler.h
Deleted
38
1
2
-/*
3
- * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
4
- *
5
- * This file is part of Open5GS.
6
- *
7
- * This program is free software: you can redistribute it and/or modify
8
- * it under the terms of the GNU Affero General Public License as published by
9
- * the Free Software Foundation, either version 3 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
- */
20
-
21
-#ifndef SCP_NNRF_HANDLER_H
22
-#define SCP_NNRF_HANDLER_H
23
-
24
-#include "context.h"
25
-
26
-#ifdef __cplusplus
27
-extern "C" {
28
-#endif
29
-
30
-void scp_nnrf_handle_nf_discover(
31
- ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg);
32
-
33
-#ifdef __cplusplus
34
-}
35
-#endif
36
-
37
-#endif /* SCP_NNRF_HANDLER_H */
38
open5gs_2.4.11.tar.xz/src/scp/nscp-handler.c
Deleted
29
1
2
-/*
3
- * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
4
- *
5
- * This file is part of Open5GS.
6
- *
7
- * This program is free software: you can redistribute it and/or modify
8
- * it under the terms of the GNU Affero General Public License as published by
9
- * the Free Software Foundation, either version 3 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
- */
20
-
21
-#include "sbi-path.h"
22
-#include "nscp-handler.h"
23
-
24
-bool scp_nscp_management_handle_pcf_binding(
25
- scp_conn_t *conn, ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg)
26
-{
27
- return true;
28
-}
29
open5gs_2.4.11.tar.xz/src/scp/nscp-handler.h
Deleted
38
1
2
-/*
3
- * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
4
- *
5
- * This file is part of Open5GS.
6
- *
7
- * This program is free software: you can redistribute it and/or modify
8
- * it under the terms of the GNU Affero General Public License as published by
9
- * the Free Software Foundation, either version 3 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
- */
20
-
21
-#ifndef SCP_NSCP_HANDLER_H
22
-#define SCP_NSCP_HANDLER_H
23
-
24
-#include "context.h"
25
-
26
-#ifdef __cplusplus
27
-extern "C" {
28
-#endif
29
-
30
-bool scp_nscp_management_handle_pcf_binding(
31
- scp_conn_t *conn, ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg);
32
-
33
-#ifdef __cplusplus
34
-}
35
-#endif
36
-
37
-#endif /* SCP_NSCP_HANDLER_H */
38
open5gs_2.4.11.dsc -> open5gs_2.5.0.dsc
Changed
32
1
2
Format: 3.0 (native)
3
Source: open5gs
4
-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
5
+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
6
Architecture: any
7
-Version: 2.4.11
8
+Version: 2.5.0
9
Maintainer: Harald Welte <laforge@gnumonks.org>
10
Uploaders: Sukchan Lee <acetcom@gmail.com>
11
Homepage: https://open5gs.org
12
13
open5gs-nssf deb net optional arch=any
14
open5gs-pcf deb net optional arch=any
15
open5gs-pcrf deb net optional arch=any
16
+ open5gs-scp deb net optional arch=any
17
open5gs-sgwc deb net optional arch=any
18
open5gs-sgwu deb net optional arch=any
19
open5gs-smf deb net optional arch=any
20
21
open5gs-udr deb net optional arch=any
22
open5gs-upf deb net optional arch=any
23
Checksums-Sha1:
24
- 025adfa9aa77acd9427c62d403010c22ba7564bf 11467980 open5gs_2.4.11.tar.xz
25
+ 353601ab80fdfaa7ba7be678b3ad2f488e17d183 11505588 open5gs_2.5.0.tar.xz
26
Checksums-Sha256:
27
- f882f44b40969661e0d37b273104da6beac564990a2402d0fd742f806611d649 11467980 open5gs_2.4.11.tar.xz
28
+ 9ac45f2ea81ec312aded1e2965a2c82f48b80cd171d9b28f4e34def8bf989c42 11505588 open5gs_2.5.0.tar.xz
29
Files:
30
- d1e47814afea5b780b3825c5efadf83b 11467980 open5gs_2.4.11.tar.xz
31
+ 2b75dbf387ceb7be5b709adde0f19d09 11505588 open5gs_2.5.0.tar.xz
32
open5gs_2.4.11.tar.xz/.tarball-version -> open5gs_2.5.0.tar.xz/.tarball-version
Changed
4
1
2
-2.4.11
3
+2.5.0
4
open5gs_2.4.11.tar.xz/README.md -> open5gs_2.5.0.tar.xz/README.md
Changed
10
1
2
3
## Getting Started
4
5
-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.
6
+Please follow the documentation(https://open5gs.org/open5gs/docs/) at open5gs.org(https://open5gs.org/)!
7
8
## Sponsors
9
10
open5gs_2.4.11.tar.xz/configs/310014.yaml.in -> open5gs_2.5.0.tar.xz/configs/310014.yaml.in
Changed
10
1
2
- addr: 127.0.0.14
3
port: 7777
4
nsi:
5
- - addr: ::1
6
+ - addr: 127.0.0.10
7
port: 7777
8
s_nssai:
9
sst: 1
10
open5gs_2.4.11.tar.xz/configs/csfb.yaml.in -> open5gs_2.5.0.tar.xz/configs/csfb.yaml.in
Changed
10
1
2
- addr: 127.0.0.14
3
port: 7777
4
nsi:
5
- - addr: ::1
6
+ - addr: 127.0.0.10
7
port: 7777
8
s_nssai:
9
sst: 1
10
open5gs_2.4.11.tar.xz/configs/non3gpp.yaml.in -> open5gs_2.5.0.tar.xz/configs/non3gpp.yaml.in
Changed
10
1
2
- addr: 127.0.0.14
3
port: 7777
4
nsi:
5
- - addr: ::1
6
+ - addr: 127.0.0.10
7
port: 7777
8
s_nssai:
9
sst: 1
10
open5gs_2.4.11.tar.xz/configs/open5gs/amf.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/amf.yaml.in
Changed
109
1
2
#
3
logger:
4
file: @localstatedir@/log/open5gs/amf.log
5
+
6
#
7
# amf:
8
#
9
10
# 'service-names' is always included in the URI query parameter.
11
# * That is, 'no_service_names' has no effect.
12
#
13
+# <For Indirect Communication with Delegated Discovery>
14
+#
15
+# o (Default) If you do not set Delegated Discovery as shown below,
16
+#
17
+# sbi:
18
+# - addr: 127.0.0.5
19
+# port: 7777
20
+#
21
+# - Use SCP if SCP avaiable. Otherwise NRF is used.
22
+# => App fails if both NRF and SCP are unavailable.
23
+#
24
+# sbi:
25
+# - addr: 127.0.0.5
26
+# port: 7777
27
+# discovery:
28
+# delegated: auto
29
+#
30
+# o To use SCP always => App fails if no SCP available.
31
+# delegated: yes
32
+#
33
+# o Don't use SCP server => App fails if no NRF available.
34
+# delegated: no
35
+#
36
# <NGAP Server>>
37
#
38
# o NGAP Server(all address available)
39
40
amf_name: open5gs-amf0
41
42
#
43
+# scp:
44
+#
45
+# <SBI Client>>
46
+#
47
+# o SBI Client(http://127.0.1.10:7777)
48
+# sbi:
49
+# addr: 127.0.1.10
50
+# port: 7777
51
+#
52
+# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
53
+# sbi:
54
+# - addr: 127.0.1.10
55
+# tls:
56
+# key: scp.key
57
+# pem: scp.pem
58
+# - name: scp.open5gs.org
59
+#
60
+# o SBI Client(http://fd69:f21d:873c:fb::1:80)
61
+# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
62
+#
63
+# sbi:
64
+# addr:
65
+# - 127.0.1.10
66
+# - fd69:f21d:873c:fb::1
67
+#
68
+# o SBI Option (Default)
69
+# - tcp_nodelay : true
70
+# - so_linger.l_onoff : false
71
+#
72
+# sbi:
73
+# addr: 127.0.1.10
74
+# option:
75
+# tcp_nodelay: false
76
+# so_linger:
77
+# l_onoff: true
78
+# l_linger: 10
79
+#
80
+#
81
+scp:
82
+ sbi:
83
+ - addr: 127.0.1.10
84
+ port: 7777
85
+
86
+#
87
# nrf:
88
#
89
# <SBI Client>>
90
91
# l_onoff: true
92
# l_linger: 10
93
#
94
-nrf:
95
- sbi:
96
- - addr:
97
- - 127.0.0.10
98
- - ::1
99
- port: 7777
100
+#nrf:
101
+# sbi:
102
+# - addr:
103
+# - 127.0.0.10
104
+# - ::1
105
+# port: 7777
106
107
#
108
# parameter:
109
open5gs_2.4.11.tar.xz/configs/open5gs/ausf.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/ausf.yaml.in
Changed
108
1
2
#
3
logger:
4
file: @localstatedir@/log/open5gs/ausf.log
5
+
6
#
7
# ausf:
8
#
9
10
# 'service-names' is always included in the URI query parameter.
11
# * That is, 'no_service_names' has no effect.
12
#
13
+# <For Indirect Communication with Delegated Discovery>
14
+#
15
+# o (Default) If you do not set Delegated Discovery as shown below,
16
+#
17
+# sbi:
18
+# - addr: 127.0.0.11
19
+# port: 7777
20
+#
21
+# - Use SCP if SCP avaiable. Otherwise NRF is used.
22
+# => App fails if both NRF and SCP are unavailable.
23
+#
24
+# sbi:
25
+# - addr: 127.0.0.11
26
+# port: 7777
27
+# discovery:
28
+# delegated: auto
29
+#
30
+# o To use SCP always => App fails if no SCP available.
31
+# delegated: yes
32
+#
33
+# o Don't use SCP server => App fails if no NRF available.
34
+# delegated: no
35
+#
36
ausf:
37
sbi:
38
- addr: 127.0.0.11
39
port: 7777
40
41
#
42
+# scp:
43
+#
44
+# <SBI Client>>
45
+#
46
+# o SBI Client(http://127.0.1.10:7777)
47
+# sbi:
48
+# addr: 127.0.1.10
49
+# port: 7777
50
+#
51
+# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
52
+# sbi:
53
+# - addr: 127.0.1.10
54
+# tls:
55
+# key: scp.key
56
+# pem: scp.pem
57
+# - name: scp.open5gs.org
58
+#
59
+# o SBI Client(http://fd69:f21d:873c:fb::1:80)
60
+# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
61
+#
62
+# sbi:
63
+# addr:
64
+# - 127.0.1.10
65
+# - fd69:f21d:873c:fb::1
66
+#
67
+# o SBI Option (Default)
68
+# - tcp_nodelay : true
69
+# - so_linger.l_onoff : false
70
+#
71
+# sbi:
72
+# addr: 127.0.1.10
73
+# option:
74
+# tcp_nodelay: false
75
+# so_linger:
76
+# l_onoff: true
77
+# l_linger: 10
78
+#
79
+#
80
+scp:
81
+ sbi:
82
+ - addr: 127.0.1.10
83
+ port: 7777
84
+
85
+#
86
# nrf:
87
#
88
# <SBI Client>>
89
90
# l_onoff: true
91
# l_linger: 10
92
#
93
-nrf:
94
- sbi:
95
- - addr:
96
- - 127.0.0.10
97
- - ::1
98
- port: 7777
99
+#nrf:
100
+# sbi:
101
+# - addr:
102
+# - 127.0.0.10
103
+# - ::1
104
+# port: 7777
105
106
#
107
# parameter:
108
open5gs_2.4.11.tar.xz/configs/open5gs/bsf.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/bsf.yaml.in
Changed
108
1
2
#
3
logger:
4
file: @localstatedir@/log/open5gs/bsf.log
5
+
6
#
7
# bsf:
8
#
9
10
# 'service-names' is always included in the URI query parameter.
11
# * That is, 'no_service_names' has no effect.
12
#
13
+# <For Indirect Communication with Delegated Discovery>
14
+#
15
+# o (Default) If you do not set Delegated Discovery as shown below,
16
+#
17
+# sbi:
18
+# - addr: 127.0.0.15
19
+# port: 7777
20
+#
21
+# - Use SCP if SCP avaiable. Otherwise NRF is used.
22
+# => App fails if both NRF and SCP are unavailable.
23
+#
24
+# sbi:
25
+# - addr: 127.0.0.15
26
+# port: 7777
27
+# discovery:
28
+# delegated: auto
29
+#
30
+# o To use SCP always => App fails if no SCP available.
31
+# delegated: yes
32
+#
33
+# o Don't use SCP server => App fails if no NRF available.
34
+# delegated: no
35
+#
36
bsf:
37
sbi:
38
- addr: 127.0.0.15
39
port: 7777
40
41
#
42
+# scp:
43
+#
44
+# <SBI Client>>
45
+#
46
+# o SBI Client(http://127.0.1.10:7777)
47
+# sbi:
48
+# addr: 127.0.1.10
49
+# port: 7777
50
+#
51
+# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
52
+# sbi:
53
+# - addr: 127.0.1.10
54
+# tls:
55
+# key: scp.key
56
+# pem: scp.pem
57
+# - name: scp.open5gs.org
58
+#
59
+# o SBI Client(http://fd69:f21d:873c:fb::1:80)
60
+# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
61
+#
62
+# sbi:
63
+# addr:
64
+# - 127.0.1.10
65
+# - fd69:f21d:873c:fb::1
66
+#
67
+# o SBI Option (Default)
68
+# - tcp_nodelay : true
69
+# - so_linger.l_onoff : false
70
+#
71
+# sbi:
72
+# addr: 127.0.1.10
73
+# option:
74
+# tcp_nodelay: false
75
+# so_linger:
76
+# l_onoff: true
77
+# l_linger: 10
78
+#
79
+#
80
+scp:
81
+ sbi:
82
+ - addr: 127.0.1.10
83
+ port: 7777
84
+
85
+#
86
# nrf:
87
#
88
# <SBI Client>>
89
90
# l_onoff: true
91
# l_linger: 10
92
#
93
-nrf:
94
- sbi:
95
- - addr:
96
- - 127.0.0.10
97
- - ::1
98
- port: 7777
99
+#nrf:
100
+# sbi:
101
+# - addr:
102
+# - 127.0.0.10
103
+# - ::1
104
+# port: 7777
105
106
#
107
# parameter:
108
open5gs_2.4.11.tar.xz/configs/open5gs/nrf.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/nrf.yaml.in
Changed
52
1
2
port: 7777
3
4
#
5
+# scp:
6
+#
7
+# <SBI Client>>
8
+#
9
+# o SBI Client(http://127.0.1.10:7777)
10
+# sbi:
11
+# addr: 127.0.1.10
12
+# port: 7777
13
+#
14
+# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
15
+# sbi:
16
+# - addr: 127.0.1.10
17
+# tls:
18
+# key: scp.key
19
+# pem: scp.pem
20
+# - name: scp.open5gs.org
21
+#
22
+# o SBI Client(http://fd69:f21d:873c:fb::1:80)
23
+# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
24
+#
25
+# sbi:
26
+# addr:
27
+# - 127.0.1.10
28
+# - fd69:f21d:873c:fb::1
29
+#
30
+# o SBI Option (Default)
31
+# - tcp_nodelay : true
32
+# - so_linger.l_onoff : false
33
+#
34
+# sbi:
35
+# addr: 127.0.1.10
36
+# option:
37
+# tcp_nodelay: false
38
+# so_linger:
39
+# l_onoff: true
40
+# l_linger: 10
41
+#
42
+#
43
+scp:
44
+ sbi:
45
+ - addr: 127.0.1.10
46
+ port: 7777
47
+
48
+#
49
# parameter:
50
#
51
# o Disable use of IPv4 addresses (only IPv6)
52
open5gs_2.4.11.tar.xz/configs/open5gs/nssf.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/nssf.yaml.in
Changed
114
1
2
#
3
logger:
4
file: @localstatedir@/log/open5gs/nssf.log
5
+
6
#
7
# nssf:
8
#
9
10
# 'service-names' is always included in the URI query parameter.
11
# * That is, 'no_service_names' has no effect.
12
#
13
+# <For Indirect Communication with Delegated Discovery>
14
+#
15
+# o (Default) If you do not set Delegated Discovery as shown below,
16
+#
17
+# sbi:
18
+# - addr: 127.0.0.14
19
+# port: 7777
20
+#
21
+# - Use SCP if SCP avaiable. Otherwise NRF is used.
22
+# => App fails if both NRF and SCP are unavailable.
23
+#
24
+# sbi:
25
+# - addr: 127.0.0.14
26
+# port: 7777
27
+# discovery:
28
+# delegated: auto
29
+#
30
+# o To use SCP always => App fails if no SCP available.
31
+# delegated: yes
32
+#
33
+# o Don't use SCP server => App fails if no NRF available.
34
+# delegated: no
35
+#
36
nssf:
37
sbi:
38
- addr: 127.0.0.14
39
port: 7777
40
nsi:
41
- - addr: ::1
42
+ - addr: 127.0.0.10
43
port: 7777
44
s_nssai:
45
sst: 1
46
47
#
48
+# scp:
49
+#
50
+# <SBI Client>>
51
+#
52
+# o SBI Client(http://127.0.1.10:7777)
53
+# sbi:
54
+# addr: 127.0.1.10
55
+# port: 7777
56
+#
57
+# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
58
+# sbi:
59
+# - addr: 127.0.1.10
60
+# tls:
61
+# key: scp.key
62
+# pem: scp.pem
63
+# - name: scp.open5gs.org
64
+#
65
+# o SBI Client(http://fd69:f21d:873c:fb::1:80)
66
+# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
67
+#
68
+# sbi:
69
+# addr:
70
+# - 127.0.1.10
71
+# - fd69:f21d:873c:fb::1
72
+#
73
+# o SBI Option (Default)
74
+# - tcp_nodelay : true
75
+# - so_linger.l_onoff : false
76
+#
77
+# sbi:
78
+# addr: 127.0.1.10
79
+# option:
80
+# tcp_nodelay: false
81
+# so_linger:
82
+# l_onoff: true
83
+# l_linger: 10
84
+#
85
+#
86
+scp:
87
+ sbi:
88
+ - addr: 127.0.1.10
89
+ port: 7777
90
+
91
+#
92
# nrf:
93
#
94
# <SBI Client>>
95
96
# - 127.0.0.10
97
# - fd69:f21d:873c:fa::1
98
#
99
-nrf:
100
- sbi:
101
- - addr:
102
- - 127.0.0.10
103
- - ::1
104
- port: 7777
105
+#nrf:
106
+# sbi:
107
+# - addr:
108
+# - 127.0.0.10
109
+# - ::1
110
+# port: 7777
111
112
#
113
# parameter:
114
open5gs_2.4.11.tar.xz/configs/open5gs/pcf.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/pcf.yaml.in
Changed
108
1
2
#
3
logger:
4
file: @localstatedir@/log/open5gs/pcf.log
5
+
6
#
7
# pcf:
8
#
9
10
# 'service-names' is always included in the URI query parameter.
11
# * That is, 'no_service_names' has no effect.
12
#
13
+# <For Indirect Communication with Delegated Discovery>
14
+#
15
+# o (Default) If you do not set Delegated Discovery as shown below,
16
+#
17
+# sbi:
18
+# - addr: 127.0.0.13
19
+# port: 7777
20
+#
21
+# - Use SCP if SCP avaiable. Otherwise NRF is used.
22
+# => App fails if both NRF and SCP are unavailable.
23
+#
24
+# sbi:
25
+# - addr: 127.0.0.13
26
+# port: 7777
27
+# discovery:
28
+# delegated: auto
29
+#
30
+# o To use SCP always => App fails if no SCP available.
31
+# delegated: yes
32
+#
33
+# o Don't use SCP server => App fails if no NRF available.
34
+# delegated: no
35
+#
36
pcf:
37
sbi:
38
- addr: 127.0.0.13
39
port: 7777
40
41
#
42
+# scp:
43
+#
44
+# <SBI Client>>
45
+#
46
+# o SBI Client(http://127.0.1.10:7777)
47
+# sbi:
48
+# addr: 127.0.1.10
49
+# port: 7777
50
+#
51
+# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
52
+# sbi:
53
+# - addr: 127.0.1.10
54
+# tls:
55
+# key: scp.key
56
+# pem: scp.pem
57
+# - name: scp.open5gs.org
58
+#
59
+# o SBI Client(http://fd69:f21d:873c:fb::1:80)
60
+# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
61
+#
62
+# sbi:
63
+# addr:
64
+# - 127.0.1.10
65
+# - fd69:f21d:873c:fb::1
66
+#
67
+# o SBI Option (Default)
68
+# - tcp_nodelay : true
69
+# - so_linger.l_onoff : false
70
+#
71
+# sbi:
72
+# addr: 127.0.1.10
73
+# option:
74
+# tcp_nodelay: false
75
+# so_linger:
76
+# l_onoff: true
77
+# l_linger: 10
78
+#
79
+#
80
+scp:
81
+ sbi:
82
+ - addr: 127.0.1.10
83
+ port: 7777
84
+
85
+#
86
# nrf:
87
#
88
# <SBI Client>>
89
90
# l_onoff: true
91
# l_linger: 10
92
#
93
-nrf:
94
- sbi:
95
- - addr:
96
- - 127.0.0.10
97
- - ::1
98
- port: 7777
99
+#nrf:
100
+# sbi:
101
+# - addr:
102
+# - 127.0.0.10
103
+# - ::1
104
+# port: 7777
105
106
#
107
# parameter:
108
open5gs_2.4.11.tar.xz/configs/open5gs/scp.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/scp.yaml.in
Changed
75
1
2
# l_onoff: true
3
# l_linger: 10
4
#
5
-# <Next hop SCP>
6
-#
7
-# o Next hop SCP Server(https://127.0.1.11:7777)
8
-# next_scp:
9
-# sbi:
10
-# - addr: 127.0.1.11
11
-# port: 7777
12
-#
13
# <For Indirect Communication with Delegated Discovery>
14
#
15
# o (Default) If you do not set Delegated Discovery as shown below,
16
#
17
-# next_scp:
18
# sbi:
19
# - addr: 127.0.1.10
20
# port: 7777
21
22
# - Use SCP if SCP avaiable. Otherwise NRF is used.
23
# => App fails if both NRF and SCP are unavailable.
24
#
25
-# next_scp:
26
# sbi:
27
# - addr: 127.0.1.10
28
# port: 7777
29
30
port: 7777
31
32
#
33
+# next_scp:
34
+#
35
+# <Next hop SCP>
36
+#
37
+# o SBI Client(http://127.0.1.11:7777)
38
+# sbi:
39
+# addr: 127.0.1.11
40
+# port: 7777
41
+#
42
+# o SBI Client(https://127.0.1.11:443, http://next-scp.open5gs.org:80)
43
+# sbi:
44
+# - addr: 127.0.1.11
45
+# tls:
46
+# key: next-scp.key
47
+# pem: next-scp.pem
48
+# - name: next-scp.open5gs.org
49
+#
50
+# o SBI Client(http://fd69:f21d:873c:fb::1:80)
51
+# If prefer_ipv4 is true, http://127.0.1.11:80 is selected.
52
+#
53
+# sbi:
54
+# addr:
55
+# - 127.0.1.11
56
+# - fd69:f21d:873c:fb::1
57
+#
58
+# o SBI Option (Default)
59
+# - tcp_nodelay : true
60
+# - so_linger.l_onoff : false
61
+#
62
+# sbi:
63
+# addr: 127.0.1.11
64
+# option:
65
+# tcp_nodelay: false
66
+# so_linger:
67
+# l_onoff: true
68
+# l_linger: 10
69
+#
70
+
71
+#
72
# nrf:
73
#
74
# <SBI Client>>
75
open5gs_2.4.11.tar.xz/configs/open5gs/smf.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/smf.yaml.in
Changed
109
1
2
#
3
logger:
4
file: @localstatedir@/log/open5gs/smf.log
5
+
6
#
7
# smf:
8
#
9
10
# 'service-names' is always included in the URI query parameter.
11
# * That is, 'no_service_names' has no effect.
12
#
13
+# <For Indirect Communication with Delegated Discovery>
14
+#
15
+# o (Default) If you do not set Delegated Discovery as shown below,
16
+#
17
+# sbi:
18
+# - addr: 127.0.0.4
19
+# port: 7777
20
+#
21
+# - Use SCP if SCP avaiable. Otherwise NRF is used.
22
+# => App fails if both NRF and SCP are unavailable.
23
+#
24
+# sbi:
25
+# - addr: 127.0.0.4
26
+# port: 7777
27
+# discovery:
28
+# delegated: auto
29
+#
30
+# o To use SCP always => App fails if no SCP available.
31
+# delegated: yes
32
+#
33
+# o Don't use SCP server => App fails if no NRF available.
34
+# delegated: no
35
+#
36
#
37
# <PFCP Server>
38
#
39
40
freeDiameter: @sysconfdir@/freeDiameter/smf.conf
41
42
#
43
+# scp:
44
+#
45
+# <SBI Client>>
46
+#
47
+# o SBI Client(http://127.0.1.10:7777)
48
+# sbi:
49
+# addr: 127.0.1.10
50
+# port: 7777
51
+#
52
+# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
53
+# sbi:
54
+# - addr: 127.0.1.10
55
+# tls:
56
+# key: scp.key
57
+# pem: scp.pem
58
+# - name: scp.open5gs.org
59
+#
60
+# o SBI Client(http://fd69:f21d:873c:fb::1:80)
61
+# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
62
+#
63
+# sbi:
64
+# addr:
65
+# - 127.0.1.10
66
+# - fd69:f21d:873c:fb::1
67
+#
68
+# o SBI Option (Default)
69
+# - tcp_nodelay : true
70
+# - so_linger.l_onoff : false
71
+#
72
+# sbi:
73
+# addr: 127.0.1.10
74
+# option:
75
+# tcp_nodelay: false
76
+# so_linger:
77
+# l_onoff: true
78
+# l_linger: 10
79
+#
80
+#
81
+scp:
82
+ sbi:
83
+ - addr: 127.0.1.10
84
+ port: 7777
85
+
86
+#
87
# nrf:
88
#
89
# <SBI Client>>
90
91
# l_onoff: true
92
# l_linger: 10
93
#
94
-nrf:
95
- sbi:
96
- - addr:
97
- - 127.0.0.10
98
- - ::1
99
- port: 7777
100
+#nrf:
101
+# sbi:
102
+# - addr:
103
+# - 127.0.0.10
104
+# - ::1
105
+# port: 7777
106
107
#
108
# upf:
109
open5gs_2.4.11.tar.xz/configs/open5gs/udm.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/udm.yaml.in
Changed
108
1
2
#
3
logger:
4
file: @localstatedir@/log/open5gs/udm.log
5
+
6
#
7
# udm:
8
#
9
10
# 'service-names' is always included in the URI query parameter.
11
# * That is, 'no_service_names' has no effect.
12
#
13
+# <For Indirect Communication with Delegated Discovery>
14
+#
15
+# o (Default) If you do not set Delegated Discovery as shown below,
16
+#
17
+# sbi:
18
+# - addr: 127.0.0.12
19
+# port: 7777
20
+#
21
+# - Use SCP if SCP avaiable. Otherwise NRF is used.
22
+# => App fails if both NRF and SCP are unavailable.
23
+#
24
+# sbi:
25
+# - addr: 127.0.0.12
26
+# port: 7777
27
+# discovery:
28
+# delegated: auto
29
+#
30
+# o To use SCP always => App fails if no SCP available.
31
+# delegated: yes
32
+#
33
+# o Don't use SCP server => App fails if no NRF available.
34
+# delegated: no
35
+#
36
udm:
37
sbi:
38
- addr: 127.0.0.12
39
port: 7777
40
41
#
42
+# scp:
43
+#
44
+# <SBI Client>>
45
+#
46
+# o SBI Client(http://127.0.1.10:7777)
47
+# sbi:
48
+# addr: 127.0.1.10
49
+# port: 7777
50
+#
51
+# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
52
+# sbi:
53
+# - addr: 127.0.1.10
54
+# tls:
55
+# key: scp.key
56
+# pem: scp.pem
57
+# - name: scp.open5gs.org
58
+#
59
+# o SBI Client(http://fd69:f21d:873c:fb::1:80)
60
+# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
61
+#
62
+# sbi:
63
+# addr:
64
+# - 127.0.1.10
65
+# - fd69:f21d:873c:fb::1
66
+#
67
+# o SBI Option (Default)
68
+# - tcp_nodelay : true
69
+# - so_linger.l_onoff : false
70
+#
71
+# sbi:
72
+# addr: 127.0.1.10
73
+# option:
74
+# tcp_nodelay: false
75
+# so_linger:
76
+# l_onoff: true
77
+# l_linger: 10
78
+#
79
+#
80
+scp:
81
+ sbi:
82
+ - addr: 127.0.1.10
83
+ port: 7777
84
+
85
+#
86
# nrf:
87
#
88
# <SBI Client>>
89
90
# l_onoff: true
91
# l_linger: 10
92
#
93
-nrf:
94
- sbi:
95
- - addr:
96
- - 127.0.0.10
97
- - ::1
98
- port: 7777
99
+#nrf:
100
+# sbi:
101
+# - addr:
102
+# - 127.0.0.10
103
+# - ::1
104
+# port: 7777
105
106
#
107
# parameter:
108
open5gs_2.4.11.tar.xz/configs/open5gs/udr.yaml.in -> open5gs_2.5.0.tar.xz/configs/open5gs/udr.yaml.in
Changed
108
1
2
#
3
logger:
4
file: @localstatedir@/log/open5gs/udr.log
5
+
6
#
7
# udr:
8
#
9
10
# 'service-names' is always included in the URI query parameter.
11
# * That is, 'no_service_names' has no effect.
12
#
13
+# <For Indirect Communication with Delegated Discovery>
14
+#
15
+# o (Default) If you do not set Delegated Discovery as shown below,
16
+#
17
+# sbi:
18
+# - addr: 127.0.0.20
19
+# port: 7777
20
+#
21
+# - Use SCP if SCP avaiable. Otherwise NRF is used.
22
+# => App fails if both NRF and SCP are unavailable.
23
+#
24
+# sbi:
25
+# - addr: 127.0.0.20
26
+# port: 7777
27
+# discovery:
28
+# delegated: auto
29
+#
30
+# o To use SCP always => App fails if no SCP available.
31
+# delegated: yes
32
+#
33
+# o Don't use SCP server => App fails if no NRF available.
34
+# delegated: no
35
+#
36
udr:
37
sbi:
38
- addr: 127.0.0.20
39
port: 7777
40
41
#
42
+# scp:
43
+#
44
+# <SBI Client>>
45
+#
46
+# o SBI Client(http://127.0.1.10:7777)
47
+# sbi:
48
+# addr: 127.0.1.10
49
+# port: 7777
50
+#
51
+# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
52
+# sbi:
53
+# - addr: 127.0.1.10
54
+# tls:
55
+# key: scp.key
56
+# pem: scp.pem
57
+# - name: scp.open5gs.org
58
+#
59
+# o SBI Client(http://fd69:f21d:873c:fb::1:80)
60
+# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
61
+#
62
+# sbi:
63
+# addr:
64
+# - 127.0.1.10
65
+# - fd69:f21d:873c:fb::1
66
+#
67
+# o SBI Option (Default)
68
+# - tcp_nodelay : true
69
+# - so_linger.l_onoff : false
70
+#
71
+# sbi:
72
+# addr: 127.0.1.10
73
+# option:
74
+# tcp_nodelay: false
75
+# so_linger:
76
+# l_onoff: true
77
+# l_linger: 10
78
+#
79
+#
80
+scp:
81
+ sbi:
82
+ - addr: 127.0.1.10
83
+ port: 7777
84
+
85
+#
86
# nrf:
87
#
88
# <SBI Client>>
89
90
# l_onoff: true
91
# l_linger: 10
92
#
93
-nrf:
94
- sbi:
95
- - addr:
96
- - 127.0.0.10
97
- - ::1
98
- port: 7777
99
+#nrf:
100
+# sbi:
101
+# - addr:
102
+# - 127.0.0.10
103
+# - ::1
104
+# port: 7777
105
106
#
107
# parameter:
108
open5gs_2.4.11.tar.xz/configs/sample.yaml.in -> open5gs_2.5.0.tar.xz/configs/sample.yaml.in
Changed
10
1
2
- addr: 127.0.0.14
3
port: 7777
4
nsi:
5
- - addr: ::1
6
+ - addr: 127.0.0.10
7
port: 7777
8
s_nssai:
9
sst: 1
10
open5gs_2.4.11.tar.xz/configs/srslte.yaml.in -> open5gs_2.5.0.tar.xz/configs/srslte.yaml.in
Changed
10
1
2
- addr: 127.0.0.14
3
port: 7777
4
nsi:
5
- - addr: ::1
6
+ - addr: 127.0.0.10
7
port: 7777
8
s_nssai:
9
sst: 1
10
open5gs_2.4.11.tar.xz/configs/systemd/meson.build -> open5gs_2.5.0.tar.xz/configs/systemd/meson.build
Changed
9
1
2
open5gs-hssd.service
3
open5gs-pcrfd.service
4
open5gs-nrfd.service
5
+ open5gs-scpd.service
6
open5gs-ausfd.service
7
open5gs-udmd.service
8
open5gs-pcfd.service
9
open5gs_2.5.0.tar.xz/configs/systemd/open5gs-scpd.service.in
Added
20
1
2
+Unit
3
+Description=Open5GS NRF Daemon
4
+Wants=mongodb.service mongod.service
5
+
6
+Service
7
+Type=simple
8
+
9
+User=open5gs
10
+Group=open5gs
11
+
12
+Restart=always
13
+ExecStart=@bindir@/open5gs-nrfd -c @sysconfdir@/open5gs/nrf.yaml
14
+RestartSec=2
15
+RestartPreventExitStatus=1
16
+ExecReload=/bin/kill -HUP $MAINPID
17
+
18
+Install
19
+WantedBy=multi-user.target
20
open5gs_2.4.11.tar.xz/configs/volte.yaml.in -> open5gs_2.5.0.tar.xz/configs/volte.yaml.in
Changed
10
1
2
- addr: 127.0.0.14
3
port: 7777
4
nsi:
5
- - addr: ::1
6
+ - addr: 127.0.0.10
7
port: 7777
8
s_nssai:
9
sst: 1
10
open5gs_2.4.11.tar.xz/configs/vonr.yaml.in -> open5gs_2.5.0.tar.xz/configs/vonr.yaml.in
Changed
10
1
2
- addr: 127.0.0.14
3
port: 7777
4
nsi:
5
- - addr: ::1
6
+ - addr: 127.0.0.10
7
port: 7777
8
s_nssai:
9
sst: 1
10
open5gs_2.4.11.tar.xz/debian/changelog -> open5gs_2.5.0.tar.xz/debian/changelog
Changed
35
1
2
+open5gs (2.5.0) unstable; urgency=medium
3
+
4
+ * New NF - SCP(Service Communication Proxy)
5
+
6
+ -- Sukchan Lee <acetcom@gmail.com> Tue, 25 Oct 2022 22:46:32 +0900
7
+
8
+open5gs (2.5.0~kinetic2) kinetic; urgency=medium
9
+
10
+ * New NF - SCP(Service Communication Proxy)
11
+
12
+ -- Sukchan Lee <acetcom@gmail.com> Tue, 25 Oct 2022 22:45:05 +0900
13
+
14
+open5gs (2.5.0~jammy2) jammy; urgency=medium
15
+
16
+ * New NF - SCP(Service Communication Proxy)
17
+
18
+ -- Sukchan Lee <acetcom@gmail.com> Tue, 25 Oct 2022 22:43:33 +0900
19
+
20
+open5gs (2.5.0~focal2) focal; urgency=medium
21
+
22
+ * New NF - SCP(Service Communication Proxy)
23
+
24
+ -- Sukchan Lee <acetcom@gmail.com> Tue, 25 Oct 2022 22:41:49 +0900
25
+
26
+open5gs (2.5.0~bionic2) bionic; urgency=medium
27
+
28
+ * New NF - SCP(Service Communication Proxy)
29
+
30
+ -- Sukchan Lee <acetcom@gmail.com> Tue, 25 Oct 2022 22:40:16 +0900
31
+
32
open5gs (2.4.11) unstable; urgency=medium
33
34
* Bug Fixed
35
open5gs_2.4.11.tar.xz/debian/control -> open5gs_2.5.0.tar.xz/debian/control
Changed
20
1
2
.
3
This package provides the NRF (Network Repository Function)
4
5
+Package: open5gs-scp
6
+Architecture: any
7
+Multi-Arch: same
8
+Depends: ${shlibs:Depends},
9
+ ${misc:Depends},
10
+ open5gs-common (= ${binary:Version})
11
+Description: SCP (Network Repository Function)
12
+ Open5GS is a C-language implementation of 5G Core and EPC
13
+ Packet Core, i.e. the core network of an NR/LTE network (Release-16)
14
+ .
15
+ This package provides the SCP (Service Communication Proxy)
16
+
17
Package: open5gs-ausf
18
Architecture: any
19
Multi-Arch: same
20
open5gs_2.4.11.tar.xz/debian/open5gs-common.install -> open5gs_2.5.0.tar.xz/debian/open5gs-common.install
Changed
6
1
2
usr/lib/*/freeDiameter/*.fdx
3
configs/freeDiameter/cacert.pem /etc/freeDiameter
4
configs/logrotate/open5gs /etc/logrotate.d
5
-misc/db/open5gs-dbctl /usr/bin
6
open5gs_2.5.0.tar.xz/debian/open5gs-scp.install
Added
5
1
2
+usr/bin/open5gs-scpd
3
+configs/open5gs/scp.yaml etc/open5gs
4
+configs/systemd/open5gs-scpd.service lib/systemd/system
5
open5gs_2.4.11.tar.xz/docker/README.md -> open5gs_2.5.0.tar.xz/docker/README.md
Changed
17
1
2
$ ./misc/git-version-gen . > .tarball-version 2>/dev/null
3
```
4
5
+* WebUI Version Change
6
+
7
+ ```
8
+ $ cat ./docker/webui/Dockerfile
9
+ $ cat ./webui/package.json
10
+ $ cat ./webui/package-lock.json
11
+ $ cat ./docs/assets/webui/install
12
+ ```
13
+
14
* Upload OpenBuildService
15
16
```
17
open5gs_2.4.11.tar.xz/docker/webui/Dockerfile -> open5gs_2.5.0.tar.xz/docker/webui/Dockerfile
Changed
10
1
2
MAINTAINER Sukchan Lee <acetcom@gmail.com>
3
4
ARG PACKAGE=open5gs
5
-ARG VERSION=2.2.6
6
+ARG VERSION=2.5.0
7
8
RUN set -e; \
9
cd /usr/src; \
10
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
201
1
2
#### 5G SA Core
3
4
The Open5GS 5G SA Core contains the following functions:
5
+* NRF - NF Repository Function
6
+* SCP - Service Communication Proxy
7
* AMF - Access and Mobility Management Function
8
* SMF - Session Management Function
9
* UPF - User Plane Function
10
* AUSF - Authentication Server Function
11
-* NRF - NF Repository Function
12
* UDM - Unified Data Management
13
* UDR - Unified Data Repository
14
* PCF - Policy and Charging Function
15
* NSSF - Network Slice Selection Function
16
* BSF - Binding Support Function
17
18
-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.
19
+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.
20
21
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.
22
23
24
**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.
25
{: .notice--warning}
26
27
+#### Getting MongoDB
28
+---
29
+
30
+Import the public key used by the package management system.
31
+
32
+```bash
33
+$ sudo apt update
34
+$ sudo apt install wget gnupg
35
+$ wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
36
+```
37
+
38
+Create the list file /etc/apt/sources.list.d/mongodb-org-6.0.list for your version of Ubuntu.
39
+
40
+```bash
41
+$ 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
42
+```
43
+
44
+Install the MongoDB packages.
45
+```bash
46
+$ sudo apt update
47
+$ sudo apt-get install -y mongodb-org
48
+$ sudo systemctl start mongod (if '/usr/bin/mongod' is not running)
49
+$ sudo systemctl enable mongod (ensure to automatically start it on system boot)
50
+```
51
52
#### Ubuntu
53
54
*Ubuntu* makes it easy to install Open5GS as shown below.
55
56
```bash
57
-$ sudo apt update
58
-$ sudo apt install software-properties-common
59
$ sudo add-apt-repository ppa:open5gs/latest
60
$ sudo apt update
61
$ sudo apt install open5gs
62
63
64
```bash
65
$ sudo apt update
66
-$ sudo apt install wget gnupg
67
-$ wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
68
-$ echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org.list
69
$ wget -qO - https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_10/Release.key | sudo apt-key add -
70
$ sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_10/ ./' > /etc/apt/sources.list.d/open5gs.list"
71
$ sudo apt update
72
-$ sudo apt install mongodb-org
73
$ sudo apt install open5gs
74
```
75
76
77
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_22.04/
78
```
79
80
-#### openSUSE
81
-
82
-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).
83
-
84
-```bash
85
-$ sudo zypper addrepo -f obs://home:mnhauke:open5gs home:mnhauke:open5gs
86
-$ sudo zypper install mongodb-server mongodb-shell
87
-$ sudo zypper install open5gs
88
-```
89
-
90
#### Nightly Builds
91
92
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:
93
94
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_22.04/
95
```
96
97
+#### openSUSE
98
+
99
+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).
100
+
101
+```bash
102
+$ sudo zypper addrepo -f obs://home:mnhauke:open5gs home:mnhauke:open5gs
103
+$ sudo zypper install mongodb-server mongodb-shell
104
+$ sudo zypper install open5gs
105
+```
106
107
## 3. Install the WebUI of Open5GS
108
---
109
110
```bash
111
$ sudo apt update
112
$ sudo apt install curl
113
- $ curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
114
+ $ curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
115
$ sudo apt install nodejs
116
```
117
118
119
PCRF-frDi = 127.0.0.9 :3868 for Gx
120
121
NRF-sbi = 127.0.0.10:7777 for 5G SBI
122
+SCP-sbi = 127.0.1.10:7777 for 5G SBI
123
AUSF-sbi = 127.0.0.11:7777 for 5G SBI
124
UDM-sbi = 127.0.0.12:7777 for 5G SBI
125
PCF-sbi = 127.0.0.13:7777 for 5G SBI
126
127
128
```diff
129
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
130
-
131
- mme:
132
- freeDiameter: /etc/freeDiameter/mme.conf
133
+--- mme.yaml 2020-09-05 20:52:28.648235143 -0400
134
++++ mme.yaml.new 2020-09-05 20:56:05.434484208 -0400
135
+@@ -253,20 +253,20 @@ mme:
136
s1ap:
137
-- addr: 127.0.0.2
138
-+ addr: 10.10.0.2 # for external eNB - a local address that can be reached by the eNB
139
+ - addr: 127.0.0.2
140
gtpc:
141
+- - addr: 127.0.0.2
142
++ - addr: 10.10.0.2
143
+ metrics:
144
addr: 127.0.0.2
145
+ port: 9090
146
gummei:
147
plmn_id:
148
- mcc: 999
149
- mnc: 70
150
-+ mcc: 001 # set your PLMN-MCC
151
-+ mnc: 01 # set your PLMN-MNC
152
++ mcc: 001
153
++ mnc: 01
154
mme_gid: 2
155
mme_code: 1
156
tai:
157
plmn_id:
158
- mcc: 999
159
- mnc: 70
160
-- tac: 1
161
-+ mcc: 001 # set your PLMN-MCC
162
-+ mnc: 01 # set your PLMN-MNC
163
-+ tac: 2 # should match the TAC used by your eNB
164
++ mcc: 001
165
++ mnc: 01
166
+ tac: 1
167
security:
168
-
169
+ integrity_order : EIA2, EIA1, EIA0
170
```
171
172
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.
173
```diff
174
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
175
-
176
+--- sgwu.yaml 2020-09-05 20:50:39.393022566 -0400
177
++++ sgwu.yaml.new 2020-09-05 20:51:06.667838823 -0400
178
+@@ -98,7 +98,7 @@ logger:
179
+ #
180
sgwu:
181
- gtpu:
182
-- addr: 127.0.0.6
183
-+ addr: 10.11.0.6 # for external eNB - a local address that can be reached by the eNB
184
pfcp:
185
- addr: 127.0.0.6
186
-
187
+- - addr: 127.0.0.6
188
++ - addr: 10.11.0.6
189
+ gtpu:
190
+ - addr: 127.0.0.6
191
```
192
193
After changing config files, please restart Open5GS daemons.
194
195
196
```diff
197
$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
198
-
199
-amf:
200
- sbi:
201
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
201
1
2
### Getting MongoDB
3
---
4
5
-Install MongoDB with package manager. It is used as database for NRF/PCF/UDR and PCRF/HSS.
6
+Import the public key used by the package management system.
7
8
```bash
9
+$ wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
10
+```
11
+
12
+Create the list file /etc/apt/sources.list.d/mongodb-org-6.0.list for your version of Ubuntu.
13
+
14
+```bash
15
+$ 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
16
+```
17
+
18
+Install the MongoDB packages.
19
+```bash
20
$ sudo apt update
21
-$ sudo apt install mongodb
22
-$ sudo systemctl start mongodb (if '/usr/bin/mongod' is not running)
23
-$ sudo systemctl enable mongodb (ensure to automatically start it on system boot)
24
+$ sudo apt-get install -y mongodb-org
25
+$ sudo systemctl start mongod (if '/usr/bin/mongod' is not running)
26
+$ sudo systemctl enable mongod (ensure to automatically start it on system boot)
27
```
28
29
+**Tip:** MongoDB is used as database for NRF/PCF/UDR and PCRF/HSS.
30
+{: .notice--info}
31
+
32
### Setting up TUN device (not persistent after rebooting)
33
---
34
35
36
$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
37
--- amf.yaml 2020-09-05 20:52:28.652234967 -0400
38
+++ amf.yaml.new 2020-09-05 20:55:07.453114885 -0400
39
-@@ -165,23 +165,23 @@
40
+@@ -293,26 +293,26 @@ amf:
41
- addr: 127.0.0.5
42
port: 7777
43
ngap:
44
- - addr: 127.0.0.5
45
+ - addr: 10.10.0.5
46
+ metrics:
47
+ addr: 127.0.0.5
48
+ port: 9090
49
guami:
50
- plmn_id:
51
- mcc: 999
52
53
- plmn_id:
54
- mcc: 999
55
- mnc: 70
56
-- tac: 1
57
+ mcc: 001
58
+ mnc: 01
59
-+ tac: 2
60
+ tac: 1
61
plmn_support:
62
- plmn_id:
63
- mcc: 999
64
65
$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
66
--- upf.yaml 2020-09-05 20:52:28.652234967 -0400
67
+++ upf.yaml.new 2020-09-05 20:52:55.279052142 -0400
68
-@@ -137,9 +137,7 @@
69
+@@ -168,7 +168,7 @@ upf:
70
pfcp:
71
- addr: 127.0.0.7
72
gtpu:
73
-- - addr:
74
-- - 127.0.0.7
75
-- - ::1
76
+- - addr: 127.0.0.7
77
+ - addr: 10.11.0.7
78
subnet:
79
- addr: 10.45.0.1/16
80
81
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
82
--- mme.yaml 2020-09-05 20:52:28.648235143 -0400
83
+++ mme.yaml.new 2020-09-05 20:56:05.434484208 -0400
84
-@@ -204,20 +204,20 @@
85
- mme:
86
- freeDiameter: /home/acetcom/Documents/git/open5gs/install/etc/freeDiameter/mme.conf
87
+@@ -253,20 +253,20 @@ mme:
88
s1ap:
89
-- addr: 127.0.0.2
90
-+ addr: 10.10.0.2
91
+ - addr: 127.0.0.2
92
gtpc:
93
+- - addr: 127.0.0.2
94
++ - addr: 10.10.0.2
95
+ metrics:
96
addr: 127.0.0.2
97
+ port: 9090
98
gummei:
99
plmn_id:
100
- mcc: 999
101
102
plmn_id:
103
- mcc: 999
104
- mnc: 70
105
-- tac: 1
106
+ mcc: 001
107
+ mnc: 01
108
-+ tac: 2
109
+ tac: 1
110
security:
111
- integrity_order : EIA1, EIA2, EIA0
112
- ciphering_order : EEA0, EEA1, EEA2
113
+ integrity_order : EIA2, EIA1, EIA0
114
```
115
116
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.
117
118
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
119
--- sgwu.yaml 2020-09-05 20:50:39.393022566 -0400
120
+++ sgwu.yaml.new 2020-09-05 20:51:06.667838823 -0400
121
-@@ -51,7 +51,7 @@
122
+@@ -98,7 +98,7 @@ logger:
123
#
124
sgwu:
125
- gtpu:
126
-- addr: 127.0.0.6
127
-+ addr: 10.11.0.6
128
pfcp:
129
- addr: 127.0.0.6
130
-
131
+- - addr: 127.0.0.6
132
++ - addr: 10.11.0.6
133
+ gtpu:
134
+ - addr: 127.0.0.6
135
```
136
137
If you modify the config files while Open5GS daemons are running, please restart them
138
139
---
140
141
```bash
142
-$ ./install/bin/open5gs-mmed
143
-Open5GS daemon v2.1.0
144
+$ ./install/bin/open5gs-nrfd
145
+Open5GS daemon v2.4.11-100-gbea24d7
146
147
-08/21 22:53:47.328: app INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/mme.yaml' (../src/main.c:54)
148
-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)
149
-08/21 22:53:47.365: app INFO: MME initialize...done (../src/mme/app-init.c:33)
150
-08/21 22:53:47.365: gtp INFO: gtp_server() 127.0.0.2:2123 (../lib/gtp/path.c:32)
151
-08/21 22:53:47.365: gtp INFO: gtp_connect() 127.0.0.3:2123 (../lib/gtp/path.c:59)
152
-08/21 22:53:47.366: mme INFO: s1ap_server() 127.0.0.2:36412 (../src/mme/s1ap-sctp.c:57)
153
+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)
154
+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)
155
+10/22 10:43:43.670: sbi INFO: nghttp2_server() 127.0.0.10:7777 (../lib/sbi/nghttp2-server.c:150)
156
+10/22 10:43:43.670: sbi INFO: nghttp2_server() ::1:7777 (../lib/sbi/nghttp2-server.c:150)
157
+10/22 10:43:43.671: app INFO: NRF initialize...done (../src/nrf/app.c:31)
158
+
159
+$ ./install/bin/open5gs-scpd
160
+Open5GS daemon v2.4.11-100-gbea24d7
161
+
162
+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)
163
+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)
164
+10/22 10:43:45.711: sbi INFO: nghttp2_server() 127.0.1.10:7777 (../lib/sbi/nghttp2-server.c:150)
165
+10/22 10:43:45.712: app INFO: SCP initialize...done (../src/scp/app.c:31)
166
167
-$ ./install/bin/open5gs-sgwcd
168
-Open5GS daemon v2.1.0
169
+$ ./install/bin/open5gs-amfd
170
+Open5GS daemon v2.4.11-100-gbea24d7
171
172
-08/21 22:54:43.059: app INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwc.yaml' (../src/main.c:54)
173
-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)
174
-08/21 22:54:43.065: app INFO: SGW-C initialize...done (../src/sgwc/app.c:31)
175
-08/21 22:54:43.066: gtp INFO: gtp_server() 127.0.0.3:2123 (../lib/gtp/path.c:32)
176
-08/21 22:54:43.066: pfcp INFO: pfcp_server() 127.0.0.3:8805 (../lib/pfcp/path.c:32)
177
-08/21 22:54:43.066: pfcp INFO: ogs_pfcp_connect() 127.0.0.6:8805 (../lib/pfcp/path.c:60)
178
+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)
179
+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)
180
+10/22 10:44:01.419: sbi INFO: NF Service namf-comm (../lib/sbi/context.c:1401)
181
+10/22 10:44:01.420: sbi INFO: nghttp2_server() 127.0.0.5:7777 (../lib/sbi/nghttp2-server.c:150)
182
+10/22 10:44:01.420: amf INFO: ngap_server() 127.0.0.5:38412 (../src/amf/ngap-sctp.c:61)
183
+10/22 10:44:01.420: sctp INFO: AMF initialize...done (../src/amf/app.c:33)
184
185
$ ./install/bin/open5gs-smfd
186
-Open5GS daemon v2.1.0
187
+Open5GS daemon v2.4.11-100-gbea24d7
188
189
-08/21 22:54:56.000: app INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/smf.yaml' (../src/main.c:54)
190
-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)
191
-08/21 22:54:56.050: gtp INFO: gtp_server() 127.0.0.4:2123 (../lib/gtp/path.c:32)
192
-08/21 22:54:56.050: app INFO: SMF initialize...done (../src/smf/app.c:31)
193
-08/21 22:54:56.050: gtp INFO: gtp_server() ::1:2123 (../lib/gtp/path.c:32)
194
-08/21 22:54:56.050: pfcp INFO: pfcp_server() 127.0.0.4:8805 (../lib/pfcp/path.c:32)
195
-08/21 22:54:56.050: pfcp INFO: pfcp_server() ::1:8805 (../lib/pfcp/path.c:32)
196
-08/21 22:54:56.050: pfcp INFO: ogs_pfcp_connect() 127.0.0.7:8805 (../lib/pfcp/path.c:60)
197
-08/21 22:54:56.051: sbi INFO: sbi_server() 127.0.0.4:7777 (../lib/sbi/server.c:298)
198
+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)
199
+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)
200
+10/22 10:44:03.269: gtp INFO: gtp_server() 127.0.0.4:2123 (../lib/gtp/path.c:30)
201
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
24
1
2
$ ninja install
3
$ cd ../
4
$ ls install/bin
5
-open5gs-amfd open5gs-hssd open5gs-nrfd open5gs-sgwcd open5gs-smfd open5gs-udrd
6
-open5gs-ausfd open5gs-mmed open5gs-pcrfd open5gs-sgwud open5gs-udmd open5gs-pcfd
7
-open5gs-upfd open5gs-nssfd open5gs-bsfd
8
+open5gs-amfd open5gs-mmed open5gs-pcrfd open5gs-smfd
9
+open5gs-ausfd open5gs-nrfd open5gs-scpd open5gs-udmd
10
+open5gs-bsfd open5gs-nssfd open5gs-sgwcd open5gs-udrd
11
+open5gs-hssd open5gs-pcfd open5gs-sgwud open5gs-upfd
12
```
13
14
## Building WebUI of Open5GS
15
16
```bash
17
$ cd ~/open5gs
18
$ cd webui
19
-$ npm ci --no-optional
20
+$ npm ci
21
```
22
23
The WebUI runs as an npm(https://www.npmjs.com/) script.
24
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
10
1
2
3
```bash
4
$ cd webui
5
-$ npm ci --no-optional
6
+$ npm ci
7
```
8
9
The WebUI runs as an npm(https://www.npmjs.com/) script.
10
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
10
1
2
3
```bash
4
$ cd webui
5
-$ npm ci --no-optional
6
+$ npm ci
7
```
8
9
The WebUI runs as an npm(https://www.npmjs.com/) script.
10
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
10
1
2
3
```bash
4
$ cd webui
5
-$ npm ci --no-optional
6
+$ npm ci
7
```
8
9
The WebUI runs as an npm(https://www.npmjs.com/) script.
10
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
10
1
2
3
```bash
4
$ cd webui
5
-$ npm ci --no-optional
6
+$ npm ci
7
```
8
9
The WebUI runs as an npm(https://www.npmjs.com/) script.
10
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
10
1
2
3
```bash
4
$ cd webui
5
-$ npm ci --no-optional
6
+$ npm ci
7
```
8
9
The WebUI runs as an npm(https://www.npmjs.com/) script.
10
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
63
1
2
open5gs 27244 0.2 0.0 2861424 13584 ? Ssl 12:13 0:00 /usr/bin/open5gs-hssd -c /etc/open5gs/hss.yaml
3
open5gs 27366 0.0 0.0 2890772 14380 ? Ssl 12:13 0:00 /usr/bin/open5gs-pcrfd -c /etc/open5gs/pcrf.yaml
4
open5gs 27485 0.0 0.0 243816 15064 ? Ssl 12:13 0:00 /usr/bin/open5gs-nrfd -c /etc/open5gs/nrf.yaml
5
+open5gs 27485 0.0 0.0 243916 13064 ? Ssl 12:13 0:00 /usr/bin/open5gs-scpd -c /etc/open5gs/scp.yaml
6
open5gs 27543 0.0 0.0 222416 9672 ? Ssl 12:13 0:00 /usr/bin/open5gs-ausfd -c /etc/open5gs/ausf.yaml
7
open5gs 27600 0.0 0.0 222328 9668 ? Ssl 12:13 0:00 /usr/bin/open5gs-udmd -c /etc/open5gs/udm.yaml
8
open5gs 27600 0.0 0.0 222329 9669 ? Ssl 12:13 0:00 /usr/bin/open5gs-pcfd -c /etc/open5gs/pcf.yaml
9
10
open5gs 27697 0.0 0.0 243976 13716 ? Ssl 12:13 0:00 /usr/bin/open5gs-udrd -c /etc/open5gs/udr.yaml
11
```
12
13
-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.
14
+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.
15
16
If your instance doesn't show this make sure you're started each service:
17
```bash
18
19
$ systemctl start open5gs-hssd.service
20
$ systemctl start open5gs-pcrfd.service
21
$ systemctl start open5gs-nrfd.service
22
+$ systemctl start open5gs-scpd.service
23
$ systemctl start open5gs-ausfd.service
24
$ systemctl start open5gs-udmd.service
25
$ systemctl start open5gs-pcfd.service
26
27
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.
28
29
```bash
30
-$ cat /var/log/open5gs/mme.log
31
-Open5GS daemon v1.0.0
32
+$ cat a.log
33
+Open5GS daemon v2.4.11-100-gbea24d7
34
35
-app INFO: Configuration: '/etc/open5gs/mme.yaml' (../src/main.c:54)
36
-app INFO: File Logging: '/var/log/open5gs/mme.log' (../src/main.c:57)
37
-mme ERROR: No sgwc.gtpc in '/etc/open5gs/mme.yaml' (../src/mme/mme-context.c:192)
38
-app ERROR: Failed to intialize MME (../src/mme/app-init.c:30)
39
-app FATAL: Open5GS initialization failed. Aborted (../src/main.c:222)
40
+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)
41
+10/22 11:05:40.032: app INFO: File Logging: 'a.log' (../lib/app/ogs-init.c:129)
42
+10/22 11:05:40.094: gtp INFO: gtp_server() 127.0.0.2:2123 (../lib/gtp/path.c:30)
43
+10/22 11:05:40.094: gtp INFO: gtp_connect() 127.0.0.3:2123 (../lib/gtp/path.c:60)
44
+10/22 11:05:40.094: mme INFO: s1ap_server() 127.0.0.2:36412 (../src/mme/s1ap-sctp.c:62)
45
+10/22 11:05:40.094: sctp INFO: MME initialize...done (../src/mme/app-init.c:33)
46
```
47
48
Or, you can use `journalctl` like below to view live log.
49
50
@@ -20,6 +20,7 @@
51
#
52
logger:
53
- file: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/amf.log
54
+ file: @localstatedir@/log/open5gs/amf.log
55
+ level: debug
56
+
57
#
58
# amf:
59
- #
60
```
61
62
After changing conf files, please restart Open5GS daemons.
63
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
171
1
2
At this time, you need to check the DB schema is in the form below by using the command the below.
3
4
```
5
-$ mongo
6
+$ mongosh
7
> use open5gs
8
> db.subscribers.find().pretty()
9
{
10
11
If you see below, you are using the old format DB schema.
12
13
```
14
-$ mongo
15
+$ mongosh
16
> use open5gs
17
> db.subscribers.find().pretty()
18
{
19
20
21
1. First of all, it is recommended to use the following command to remove all existing subscription DB.
22
```
23
-$ mongo
24
+$ mongosh
25
> use open5gs
26
switched to db open5gs
27
> db.subscribers.drop()
28
29
4. Log in to the new WebUI and add new subscriber information using your web browser.
30
5. Make sure it is a new DB schema as below:
31
```
32
-$ mongo
33
+$ mongosh
34
> use open5gs
35
> db.subscribers.find().pretty()
36
{
37
38
39
To restart the test program, first remove all subscriber information using MongoDB Client
40
```
41
-$ mongo
42
+$ mongosh
43
> use open5gs
44
switched to db open5gs
45
> db.subscribers.find() ### Check the test subscriber
46
47
$ sudo pkill -9 open5gs-hssd
48
$ sudo pkill -9 open5gs-pcrfd
49
$ sudo pkill -9 open5gs-nrfd
50
+$ sudo pkill -9 open5gs-scpd
51
$ sudo pkill -9 open5gs-ausfd
52
$ sudo pkill -9 open5gs-udmd
53
$ sudo pkill -9 open5gs-pcfd
54
55
index 7e939e81..dfe4456d 100644
56
--- a/configs/open5gs/amf.yaml.in
57
+++ b/configs/open5gs/amf.yaml.in
58
-@@ -199,6 +199,12 @@ amf:
59
+@@ -315,6 +315,12 @@ amf:
60
mnc: 70
61
s_nssai:
62
- sst: 1
63
64
index d45aa60f..701ee533 100644
65
--- a/configs/open5gs/smf.yaml.in
66
+++ b/configs/open5gs/smf.yaml.in
67
-@@ -317,6 +317,11 @@ logger:
68
- #
69
-
70
+@@ -442,6 +442,11 @@ logger:
71
+ #
72
+
73
smf:
74
+ info:
75
+ - s_nssai:
76
77
index d45aa60f..949da220 100644
78
--- a/configs/open5gs/smf.yaml.in
79
+++ b/configs/open5gs/smf.yaml.in
80
-@@ -317,6 +317,12 @@ logger:
81
+@@ -442,6 +442,12 @@ logger:
82
#
83
84
smf:
85
86
index ecd4f7e2..04d9c4ba 100644
87
--- a/configs/open5gs/nssf.yaml.in
88
+++ b/configs/open5gs/nssf.yaml.in
89
-@@ -119,6 +119,11 @@ nssf:
90
+@@ -201,6 +201,12 @@ nssf:
91
port: 7777
92
s_nssai:
93
sst: 1
94
95
+ s_nssai:
96
+ sst: 1
97
+ sd: 000080
98
-
99
++
100
+
101
#
102
- # nrf:
103
+ # scp:
104
```
105
106
Then add a slice to MongoDB's subscriber info.
107
108
109
```bash
110
$ open5gs-nrfd
111
+$ open5gs-scpd
112
$ open5gs-amfd
113
$ open5gs-ausfd
114
$ open5gs-udmd
115
116
$ diff -u smf.yaml smf.yaml.new
117
--- smf.yaml 2020-09-17 09:31:16.547882093 -0400
118
+++ smf.yaml.new 2020-09-17 09:32:18.267726844 -0400
119
-@@ -190,7 +190,7 @@
120
- - addr: 127.0.0.4
121
- - addr: ::1
122
+@@ -458,7 +458,7 @@ smf:
123
+ addr: 127.0.0.4
124
+ port: 9090
125
subnet:
126
- - addr: 10.45.0.1/16
127
+ - addr: 10.46.0.1/16
128
129
$ diff -u upf.yaml upf.yaml.new
130
--- upf.yaml 2020-09-17 09:31:16.547882093 -0400
131
+++ upf.yaml.new 2020-09-17 09:32:25.199619989 -0400
132
-@@ -139,7 +139,7 @@
133
+@@ -170,7 +170,7 @@ upf:
134
gtpu:
135
- addr: 127.0.0.7
136
subnet:
137
138
139
Then, remove all subscriber information using MongoDB Client
140
```
141
-$ mongo
142
+$ mongosh
143
> use open5gs
144
switched to db open5gs
145
> db.subscribers.find() ### Check the test subscriber
146
147
$ sudo pkill -9 open5gs-hssd
148
$ sudo pkill -9 open5gs-pcrfd
149
$ sudo pkill -9 open5gs-nrfd
150
+$ sudo pkill -9 open5gs-scpd
151
$ sudo pkill -9 open5gs-ausfd
152
$ sudo pkill -9 open5gs-udmd
153
$ sudo pkill -9 open5gs-pcfd
154
155
156
Remove all subscriber information using MongoDB Client
157
```
158
-$ mongo
159
+$ mongosh
160
> db.subscribers.find() ### Check the test subscriber
161
> db.subscribers.drop() ### Remove all subscriber
162
> db.subscribers.find() ### Check that all subscribers are empty
163
164
* HSS : 127.0.0.8
165
* PCRF : 127.0.0.9
166
* NRF : 127.0.0.10
167
+* SCP : 127.0.1.10
168
* AUSF : 127.0.0.11
169
* UDM : 127.0.0.12
170
* PCF : 127.0.0.13
171
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
94
1
2
3
#### 3. Open5GS
4
5
+Install the MongoDB packages.
6
+
7
+```bash
8
+```
9
+
10
The Open5GS package is available on the recent versions of *Ubuntu*.
11
12
```bash
13
+# Install the MongoDB Packages
14
+$ wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
15
+$ 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
16
+$ sudo apt update
17
+$ sudo apt install mongodb-org
18
+
19
# Getting the authentication key
20
$ sudo apt install wget
21
$ wget https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_20.04/Release.key
22
23
The following shows how to install the Web UI of Open5GS.
24
25
```bash
26
-$ curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
27
+$ curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
28
$ sudo apt install nodejs
29
$ curl -fsSL https://open5gs.org/open5gs/assets/webui/install | sudo -E bash -
30
```
31
32
33
```diff
34
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
35
---- mme.yaml.old 2020-08-22 12:07:32.755250028 -0400
36
-+++ mme.yaml 2020-08-22 12:08:17.309320211 -0400
37
-@@ -208,20 +208,20 @@
38
- mme:
39
- freeDiameter: /home/acetcom/Documents/git/open5gs/install/etc/freeDiameter/mme.conf
40
+--- mme.yaml 2020-09-05 20:52:28.648235143 -0400
41
++++ mme.yaml.new 2020-09-05 20:56:05.434484208 -0400
42
+@@ -253,20 +253,20 @@ mme:
43
s1ap:
44
-- addr: 127.0.0.2
45
-+ addr: 127.0.1.2
46
+ - addr: 127.0.0.2
47
gtpc:
48
+- - addr: 10.11.0.2
49
++ - addr: 127.0.0.2
50
+ metrics:
51
addr: 127.0.0.2
52
+ port: 9090
53
gummei:
54
plmn_id:
55
- mcc: 999
56
57
plmn_id:
58
- mcc: 999
59
- mnc: 70
60
-- tac: 1
61
+ mcc: 310
62
+ mnc: 789
63
-+ tac: 2
64
+ tac: 1
65
security:
66
- integrity_order : EIA1, EIA2, EIA0
67
- ciphering_order : EEA0, EEA1, EEA2
68
+ integrity_order : EIA2, EIA1, EIA0
69
```
70
71
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.
72
```diff
73
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
74
---- sgwu.yaml.old 2020-08-22 12:08:44.782880778 -0400
75
-+++ sgwu.yaml 2020-08-22 12:06:49.809299514 -0400
76
-@@ -82,7 +82,7 @@
77
+--- sgwu.yaml 2020-09-05 20:50:39.393022566 -0400
78
++++ sgwu.yaml.new 2020-09-05 20:51:06.667838823 -0400
79
+@@ -98,7 +98,7 @@ logger:
80
#
81
sgwu:
82
- gtpu:
83
-- addr: 10.11.0.6
84
-+ addr: 127.0.0.6
85
pfcp:
86
- addr: 127.0.0.6
87
+- - addr: 10.11.0.6
88
++ - addr: 127.0.0.6
89
+ gtpu:
90
+ - addr: 127.0.0.6
91
```
92
93
94
open5gs_2.4.11.tar.xz/docs/_pages/docs.md -> open5gs_2.5.0.tar.xz/docs/_pages/docs.md
Changed
13
1
2
- Dockerized VoLTE Setup(tutorial/03-VoLTE-dockerized)
3
- Metrics with Prometheus(tutorial/04-metrics-prometheus)
4
5
+- Inside Source Code
6
+ - Detailed Architecture of Open5GS(https://chowdera.com/2022/151/202205312246348316.html)
7
+ - UPF Code Explanation(https://medium.com/@aditya.koranga/open5gs-upf-code-explanation-with-flow-c-79c50f253dd1)
8
+ - SMF Code Explanation(https://medium.com/@aditya.koranga/open5gs-smf-code-explanation-with-flow-charts-a3b3cd38c991)
9
+
10
- Troubleshooting
11
- Simple Issues(troubleshoot/01-simple-issues)
12
- Now in Github Issues(troubleshoot/02-now-in-github-issues)
13
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
19
1
2
$ git checkout v2.1.7
3
$ cd webui
4
$ rm -Rf ./node_modules
5
-$ npm ci --no-optional
6
+$ npm ci
7
$ npm run dev
8
9
## You should log out
10
11
$ git checkout main
12
$ cd webui
13
$ rm -Rf ./node_modules
14
-$ npm ci --no-optional
15
+$ npm ci
16
$ npm run dev
17
18
## You can log back in
19
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
19
1
2
$ git checkout v2.1.7
3
$ cd webui
4
$ rm -Rf ./node_modules
5
-$ npm ci --no-optional
6
+$ npm ci
7
$ npm run dev
8
9
## You should log out
10
11
$ git checkout main
12
$ cd webui
13
$ rm -Rf ./node_modules
14
-$ npm ci --no-optional
15
+$ npm ci
16
$ npm run dev
17
18
## You can log back in
19
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
19
1
2
$ git checkout v2.1.7
3
$ cd webui
4
$ rm -Rf ./node_modules
5
-$ npm ci --no-optional
6
+$ npm ci
7
$ npm run dev
8
9
## You should log out
10
11
$ git checkout main
12
$ cd webui
13
$ rm -Rf ./node_modules
14
-$ npm ci --no-optional
15
+$ npm ci
16
$ npm run dev
17
18
## You can log back in
19
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
19
1
2
$ git checkout v2.1.7
3
$ cd webui
4
$ rm -Rf ./node_modules
5
-$ npm ci --no-optional
6
+$ npm ci
7
$ npm run dev
8
9
## You should log out
10
11
$ git checkout main
12
$ cd webui
13
$ rm -Rf ./node_modules
14
-$ npm ci --no-optional
15
+$ npm ci
16
$ npm run dev
17
18
## You can log back in
19
open5gs_2.5.0.tar.xz/docs/_posts/2022-10-01-release-v2.4.11.md
Added
35
1
2
+---
3
+title: "v2.4.11 - Bug Fixes (critical: session deletion)"
4
+date: 2022-10-01 09:43:00 +0900
5
+categories:
6
+ - Release
7
+tags:
8
+ - News
9
+ - Release
10
+head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
11
+---
12
+
13
+#### Bug Fixes
14
+- 5GC Session deletion was not properly worked in BSF(#1725(https://github.com/open5gs/open5gs/issues/1725)) -- prasenjitpdas(https://github.com/prasenjitpdas)
15
+- AMF In deregistration state, we use an invalid state-machine pointer. (#1805(https://github.com/open5gs/open5gs/pull/1805)) -- bmeglicit(https://github.com/bmeglicit)
16
+- 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)
17
+- SMF Wait for both N1&N2 release signals before releasing session (#1753(https://github.com/open5gs/open5gs/pull/1753)) -- bmeglicit(https://github.com/bmeglicit)
18
+- UPF UL and DL URR usage Report was swapped (#1793(https://github.com/open5gs/open5gs/issues/1793)) -- dibasdas02(https://github.com/dibasdas02)
19
+- CORE Fixed timer overflow on 32bit systems (#1770(https://github.com/open5gs/open5gs/pull/1770)) -- spencersevilla(https://github.com/spencersevilla)
20
+
21
+#### Enhancements
22
+- MME Added protection code if no PDN-Type (#1756(https://github.com/open5gs/open5gs/pull/1756)) -- yar-or81(https://github.com/yar-or81)
23
+- Metric Move metrics configuration section under respective (#1754(https://github.com/open5gs/open5gs/pull/1754)) -- bmeglicit(https://github.com/bmeglicit)
24
+- Diameter Enable Change Streams (#1758(https://github.com/open5gs/open5gs/pull/1758)) -- jmasterfunk84(https://github.com/jmasterfunk84)
25
+- AMF Added amfInfoList to NFProfile (#1757(https://github.com/open5gs/open5gs/pull/1757)) -- gstaa(https://github.com/gstaa)
26
+- TLV Acceptable even if the TLV length is smaller than expected (#1780(https://github.com/open5gs/open5gs/discussions/1780)) -- infinitydon(https://github.com/infinitydon)
27
+- Diameter Introduce Cancel Location and Insert Subscription Data (#1744(https://github.com/open5gs/open5gs/pull/1744)) -- jmasterfunk84(https://github.com/jmasterfunk84)
28
+
29
+#### Security Issues
30
+- SBI Fixed HTTP2 crash from random JSON data (#1679(https://github.com/open5gs/open5gs/issues/1679)) -- Popvlvs(https://github.com/Popvlvs)
31
+- TLV UPF crashes after UDP port scan (#1767(https://github.com/open5gs/open5gs/issues/1767)) -- Popvlvs(https://github.com/Popvlvs)
32
+
33
+Download -- v2.4.11.tar.gz(https://github.com/open5gs/open5gs/archive/v2.4.11.tar.gz)
34
+{: .notice--info}
35
open5gs_2.4.11.tar.xz/docs/assets/webui/install -> open5gs_2.5.0.tar.xz/docs/assets/webui/install
Changed
19
1
2
#
3
4
PACKAGE="open5gs"
5
-VERSION="2.4.11"
6
+VERSION="2.5.0"
7
8
print_status() {
9
echo
10
11
fi
12
13
print_status "Build the Open5GS WebUI..."
14
-exec_cmd "cd ./${PACKAGE}-${VERSION}/webui && npm ci --no-optional && npm run build"
15
+exec_cmd "cd ./${PACKAGE}-${VERSION}/webui && npm ci && npm run build"
16
17
print_status "Install the Open5GS WebUI..."
18
exec_cmd "mv ./${PACKAGE}-${VERSION}/webui /usr/lib/node_modules/${PACKAGE}"
19
open5gs_2.4.11.tar.xz/lib/app/ogs-context.c -> open5gs_2.5.0.tar.xz/lib/app/ogs-context.c
Changed
14
1
2
ogs_yaml_iter_bool(¶meter_iter);
3
} else if (!strcmp(parameter_key,
4
"use_mongodb_change_stream")) {
5
+#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 9
6
self.use_mongodb_change_stream =
7
ogs_yaml_iter_bool(¶meter_iter);
8
+#else
9
+ self.use_mongodb_change_stream = false;
10
+#endif
11
} else
12
ogs_warn("unknown key `%s`", parameter_key);
13
}
14
open5gs_2.4.11.tar.xz/lib/dbi/ogs-mongoc.c -> open5gs_2.5.0.tar.xz/lib/dbi/ogs-mongoc.c
Changed
43
1
2
mongoc_collection_destroy(self.collection.subscriber);
3
}
4
5
+#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 9
6
if (self.stream) {
7
mongoc_change_stream_destroy(self.stream);
8
}
9
+#endif
10
11
ogs_mongoc_final();
12
}
13
14
int ogs_dbi_collection_watch_init(void)
15
{
16
+#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 9
17
bson_t empty = BSON_INITIALIZER;
18
const bson_t *err_doc;
19
bson_error_t error;
20
21
}
22
23
return OGS_OK;
24
+# else
25
+ return OGS_ERROR;
26
+#endif
27
}
28
29
int ogs_dbi_poll_change_stream(void)
30
{
31
+#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 9
32
int rv;
33
34
const bson_t *document;
35
36
}
37
38
return OGS_OK;
39
+# else
40
+ return OGS_ERROR;
41
+#endif
42
}
43
open5gs_2.4.11.tar.xz/lib/dbi/ogs-mongoc.h -> open5gs_2.5.0.tar.xz/lib/dbi/ogs-mongoc.h
Changed
11
1
2
void *client;
3
void *database;
4
5
+#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 9
6
mongoc_change_stream_t *stream;
7
+#endif
8
9
char *masked_db_uri;
10
11
open5gs_2.4.11.tar.xz/lib/dbi/path.c -> open5gs_2.5.0.tar.xz/lib/dbi/path.c
Changed
10
1
2
rv = ogs_queue_push(ogs_app()->queue, e);
3
if (rv != OGS_OK) {
4
ogs_error("ogs_queue_push() failed:%d", (int)rv);
5
- bson_destroy((bson_t*)e->dbi.document);
6
+ bson_destroy(e->dbi.document);
7
ogs_event_free(e);
8
} else {
9
ogs_pollset_notify(ogs_app()->pollset);
10
open5gs_2.4.11.tar.xz/lib/diameter/s6a/message.h -> open5gs_2.5.0.tar.xz/lib/diameter/s6a/message.h
Changed
37
1
2
#define OGS_DIAM_S6A_CT_UPDATE_PROCEDURE_IWF (3)
3
#define OGS_DIAM_S6A_CT_INITIAL_ATTACH_PROCEDURE (4)
4
5
+#define OGS_DIAM_S6A_SUBDATA_NO_UPDATE (0)
6
+#define OGS_DIAM_S6A_SUBDATA_SUB_STATUS (1)
7
+#define OGS_DIAM_S6A_SUBDATA_MSISDN (1 << 1)
8
+#define OGS_DIAM_S6A_SUBDATA_A_MSISDN (1 << 2)
9
+#define OGS_DIAM_S6A_SUBDATA_NAM (1 << 3)
10
+#define OGS_DIAM_S6A_SUBDATA_ODB (1 << 4)
11
+#define OGS_DIAM_S6A_SUBDATA_ARD (1 << 5)
12
+#define OGS_DIAM_S6A_SUBDATA_CC (1 << 6)
13
+#define OGS_DIAM_S6A_SUBDATA_UEAMBR (1 << 7)
14
+#define OGS_DIAM_S6A_SUBDATA_APN_CONFIG (1 << 8)
15
+#define OGS_DIAM_S6A_SUBDATA_RAU_TAU_TIMER (1 << 9)
16
+#define OGS_DIAM_S6A_SUBDATA_ALL 0xFFFFFFFF
17
+
18
extern struct dict_object *ogs_diam_s6a_application;
19
20
extern struct dict_object *ogs_diam_s6a_cmd_air;
21
22
#define OGS_DIAM_S6A_CLR_FLAGS_S6A_S6D_INDICATOR (1)
23
#define OGS_DIAM_S6A_CLR_FLAGS_REATTACH_REQUIRED (1 << 1)
24
uint32_t clr_flags;
25
+ uint32_t cancellation_type;
26
} ogs_diam_s6a_clr_message_t;
27
28
typedef struct ogs_diam_s6a_idr_message_s {
29
30
#define OGS_DIAM_S6A_IDR_FLAGS_RAT_TYPE (1 << 7)
31
#define OGS_DIAM_S6A_IDR_FLAGS_PCSCF_Restoration (1 << 8)
32
uint32_t idr_flags;
33
+ uint32_t subdatamask;
34
ogs_subscription_data_t subscription_data;
35
} ogs_diam_s6a_idr_message_t;
36
37
open5gs_2.4.11.tar.xz/lib/gtp/xact.h -> open5gs_2.5.0.tar.xz/lib/gtp/xact.h
Changed
27
1
2
#define OGS_GTP_MODIFY_QOS_UPDATE ((uint64_t)1<<1)
3
uint64_t update_flags;
4
5
-#define OGS_GTP_DELETE_NO_ACTION 1
6
-#define OGS_GTP_DELETE_SEND_AUTHENTICATION_REQUEST 2
7
-#define OGS_GTP_DELETE_SEND_DETACH_ACCEPT 3
8
-#define OGS_GTP_DELETE_SEND_DEACTIVATE_BEARER_CONTEXT_REQUEST 4
9
-#define OGS_GTP_DELETE_SEND_UE_CONTEXT_RELEASE_COMMAND 5
10
-#define OGS_GTP_DELETE_SEND_S1_REMOVE_AND_UNLINK 6
11
-#define OGS_GTP_DELETE_HANDLE_PDN_CONNECTIVITY_REQUEST 7
12
-#define OGS_GTP_DELETE_UE_CONTEXT_REMOVE 8
13
-#define OGS_GTP_DELETE_IN_PATH_SWITCH_REQUEST 9
14
+#define OGS_GTP_DELETE_NO_ACTION 1
15
+#define OGS_GTP_DELETE_SEND_AUTHENTICATION_REQUEST 2
16
+#define OGS_GTP_DELETE_SEND_DETACH_ACCEPT 3
17
+#define OGS_GTP_DELETE_SEND_DEACTIVATE_BEARER_CONTEXT_REQUEST 4
18
+#define OGS_GTP_DELETE_SEND_RELEASE_WITH_UE_CONTEXT_REMOVE 5
19
+#define OGS_GTP_DELETE_SEND_RELEASE_WITH_S1_REMOVE_AND_UNLINK 6
20
+#define OGS_GTP_DELETE_HANDLE_PDN_CONNECTIVITY_REQUEST 7
21
+#define OGS_GTP_DELETE_UE_CONTEXT_REMOVE_PARTIAL 8
22
+#define OGS_GTP_DELETE_IN_PATH_SWITCH_REQUEST 9
23
+
24
int delete_action;
25
26
#define OGS_GTP_RELEASE_SEND_UE_CONTEXT_RELEASE_COMMAND 1
27
open5gs_2.4.11.tar.xz/lib/pfcp/types.h -> open5gs_2.5.0.tar.xz/lib/pfcp/types.h
Changed
12
1
2
union {
3
struct {
4
ED3(uint8_t spare:6;,
5
- uint8_t dlpa:1;,
6
- uint8_t dlby:1;)
7
+ uint8_t dlby:1;,
8
+ uint8_t dlpa:1;)
9
};
10
uint8_t flags;
11
};
12
open5gs_2.4.11.tar.xz/lib/proto/event.c -> open5gs_2.5.0.tar.xz/lib/proto/event.c
Changed
10
1
2
3
ogs_event_t *ogs_event_new(int id)
4
{
5
- return ogs_event_size(id, sizeof(ogs_event_t));
6
+ return ogs_event_size(id, OGS_EVENT_SIZE);
7
}
8
9
void ogs_event_free(void *e)
10
open5gs_2.4.11.tar.xz/lib/proto/event.h -> open5gs_2.5.0.tar.xz/lib/proto/event.h
Changed
24
1
2
typedef struct ogs_sbi_response_s ogs_sbi_response_t;
3
typedef struct ogs_sbi_message_s ogs_sbi_message_t;
4
5
-typedef struct _bson_t bson_t;
6
-
7
typedef struct ogs_event_s {
8
int id;
9
int timer_id;
10
11
} sbi;
12
13
struct {
14
- const bson_t *document;
15
+ void *document;
16
} dbi;
17
} ogs_event_t;
18
19
+#define OGS_EVENT_SIZE 256
20
+
21
void *ogs_event_size(int id, size_t size);
22
ogs_event_t *ogs_event_new(int id);
23
void ogs_event_free(void *e);
24
open5gs_2.4.11.tar.xz/lib/proto/types.h -> open5gs_2.5.0.tar.xz/lib/proto/types.h
Changed
12
1
2
3
uint32_t context_identifier; /* EPC for checking default APN */
4
5
+#define OGS_ALL_APN_CONFIGURATIONS_INCLUDED 0
6
+#define OGS_MODIFIED_ADDED_APN_CONFIGURATIONS_INCLUDED 1
7
+ uint32_t all_apn_config_inc;
8
+
9
int num_of_session;
10
ogs_session_t sessionOGS_MAX_NUM_OF_SESS;
11
} ogs_slice_data_t;
12
open5gs_2.4.11.tar.xz/lib/sbi/client.c -> open5gs_2.5.0.tar.xz/lib/sbi/client.c
Changed
201
1
2
/*
3
- * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
5
*
6
* This file is part of Open5GS.
7
*
8
9
bool memory_overflow;
10
11
char *location;
12
+ char *producer_id;
13
14
ogs_timer_t *timer;
15
CURL *easy;
16
17
static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp);
18
static int multi_timer_cb(CURLM *multi, long timeout_ms, void *cbp);
19
static void multi_timer_expired(void *data);
20
-static void connection_timer_expired(void *data);
21
+
22
+static connection_t *connection_add(
23
+ ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
24
+ ogs_sbi_request_t *request, void *data);
25
+static void connection_remove(connection_t *conn);
26
+static void connection_free(connection_t *conn);
27
static void connection_remove_all(ogs_sbi_client_t *client);
28
+static void connection_timer_expired(void *data);
29
30
void ogs_sbi_client_init(int num_of_sockinfo_pool, int num_of_connection_pool)
31
{
32
33
return uri;
34
}
35
36
-static void _connection_remove(connection_t *conn);
37
-
38
static connection_t *connection_add(
39
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
40
ogs_sbi_request_t *request, void *data)
41
42
conn->method = ogs_strdup(request->h.method);
43
if (!conn->method) {
44
ogs_error("conn->method is NULL");
45
- _connection_remove(conn);
46
+ connection_free(conn);
47
return NULL;
48
}
49
50
51
conn->headers = ogs_calloc(conn->num_of_header, sizeof(char *));
52
if (!conn->headers) {
53
ogs_error("conn->headers is NULL");
54
- _connection_remove(conn);
55
+ connection_free(conn);
56
return NULL;
57
}
58
for (hi = ogs_hash_first(request->http.headers), i = 0;
59
60
conn->headersi = ogs_msprintf("%s: %s", key, val);
61
if (!conn->headersi) {
62
ogs_error("conn->headersi=%d is NULL", i);
63
- _connection_remove(conn);
64
+ connection_free(conn);
65
return NULL;
66
}
67
conn->header_list = curl_slist_append(
68
69
ogs_app()->timer_mgr, connection_timer_expired, conn);
70
if (!conn->timer) {
71
ogs_error("conn->timer is NULL");
72
- _connection_remove(conn);
73
+ connection_free(conn);
74
return NULL;
75
}
76
77
78
conn->easy = curl_easy_init();
79
if (!conn->easy) {
80
ogs_error("conn->easy is NULL");
81
- _connection_remove(conn);
82
+ connection_free(conn);
83
return NULL;
84
}
85
86
87
request->h.uri, request->http.params);
88
if (!uri) {
89
ogs_error("add_params_to_uri() failed");
90
- _connection_remove(conn);
91
+ connection_free(conn);
92
return NULL;
93
}
94
95
96
request->http.content, request->http.content_length);
97
if (!conn->content) {
98
ogs_error("conn->content is NULL");
99
- _connection_remove(conn);
100
+ connection_free(conn);
101
return NULL;
102
}
103
curl_easy_setopt(conn->easy,
104
105
return conn;
106
}
107
108
-static void _connection_remove(connection_t *conn)
109
+static void connection_remove(connection_t *conn)
110
+{
111
+ ogs_sbi_client_t *client = NULL;
112
+
113
+ ogs_assert(conn);
114
+ client = conn->client;
115
+ ogs_assert(client);
116
+
117
+ ogs_list_remove(&client->connection_list, conn);
118
+
119
+ ogs_assert(client->multi);
120
+ curl_multi_remove_handle(client->multi, conn->easy);
121
+
122
+ connection_free(conn);
123
+}
124
+
125
+static void connection_free(connection_t *conn)
126
{
127
int i;
128
129
130
131
if (conn->location)
132
ogs_free(conn->location);
133
+ if (conn->producer_id)
134
+ ogs_free(conn->producer_id);
135
136
if (conn->memory)
137
ogs_free(conn->memory);
138
139
ogs_pool_free(&connection_pool, conn);
140
}
141
142
-static void connection_remove(connection_t *conn)
143
-{
144
- ogs_sbi_client_t *client = NULL;
145
-
146
- ogs_assert(conn);
147
- client = conn->client;
148
- ogs_assert(client);
149
-
150
- ogs_list_remove(&client->connection_list, conn);
151
-
152
- ogs_assert(client->multi);
153
- curl_multi_remove_handle(client->multi, conn->easy);
154
-
155
- _connection_remove(conn);
156
-}
157
-
158
static void connection_remove_all(ogs_sbi_client_t *client)
159
{
160
connection_t *conn = NULL, *next_conn = NULL;
161
162
if (conn->location)
163
ogs_sbi_header_set(response->http.headers,
164
OGS_SBI_LOCATION, conn->location);
165
+ if (conn->producer_id)
166
+ ogs_sbi_header_set(response->http.headers,
167
+ OGS_SBI_CUSTOM_PRODUCER_ID, conn->producer_id);
168
169
if (conn->memory_overflow == true)
170
level = OGS_LOG_ERROR;
171
172
ogs_warn("%d %s", res, conn->error);
173
174
ogs_assert(conn->client_cb);
175
- conn->client_cb(res == CURLE_OK ? OGS_OK : OGS_ERROR,
176
- response, conn->data);
177
+ if (res == CURLE_OK)
178
+ conn->client_cb(OGS_OK, response, conn->data);
179
+ else
180
+ conn->client_cb(OGS_ERROR, NULL, conn->data);
181
+
182
connection_remove(conn);
183
break;
184
default:
185
186
}
187
}
188
189
-bool ogs_sbi_client_send_reqmem_persistent(
190
+bool ogs_sbi_client_send_request(
191
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
192
ogs_sbi_request_t *request, void *data)
193
{
194
195
196
ogs_assert(client);
197
ogs_assert(request);
198
-
199
if (request->h.uri == NULL) {
200
request->h.uri = ogs_sbi_client_uri(client, &request->h);
201
open5gs_2.4.11.tar.xz/lib/sbi/client.h -> open5gs_2.5.0.tar.xz/lib/sbi/client.h
Changed
36
1
2
/*
3
- * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
5
*
6
* This file is part of Open5GS.
7
*
8
9
const char *pem;
10
} tls;
11
12
- ogs_sbi_client_cb_f cb; /* Only used when NF send to NRF */
13
-
14
ogs_timer_t *t_curl; /* timer for CURL */
15
ogs_list_t connection_list; /* CURL connection list */
16
17
18
void ogs_sbi_client_stop(ogs_sbi_client_t *client);
19
void ogs_sbi_client_stop_all(void);
20
21
-bool ogs_sbi_client_send_reqmem_persistent(
22
- ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
23
- ogs_sbi_request_t *request, void *data);
24
bool ogs_sbi_client_send_request(
25
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
26
ogs_sbi_request_t *request, void *data);
27
-
28
-bool ogs_sbi_scp_send_reqmem_persistent(
29
- ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
30
- ogs_sbi_request_t *request, void *data);
31
-bool ogs_sbi_scp_send_request(
32
+bool ogs_sbi_client_send_via_scp(
33
ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
34
ogs_sbi_request_t *request, void *data);
35
36
open5gs_2.4.11.tar.xz/lib/sbi/context.c -> open5gs_2.5.0.tar.xz/lib/sbi/context.c
Changed
201
1
2
/*
3
- * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
5
*
6
* This file is part of Open5GS.
7
*
8
9
10
ogs_pool_init(&nf_info_pool, ogs_app()->pool.nf * OGS_MAX_NUM_OF_NF_INFO);
11
12
- /* Add SELF NF instance */
13
+ /* Add AELF NF-Instance */
14
self.nf_instance = ogs_sbi_nf_instance_add();
15
ogs_assert(self.nf_instance);
16
17
ogs_uuid_get(&self.uuid);
18
ogs_uuid_format(nf_instance_id, &self.uuid);
19
-
20
ogs_sbi_nf_instance_set_id(self.nf_instance, nf_instance_id);
21
22
+ /* Add NRF NF-Instance */
23
+ self.nrf_instance = ogs_sbi_nf_instance_add();
24
+ ogs_assert(self.nrf_instance);
25
+ ogs_sbi_nf_instance_set_type(self.nrf_instance, OpenAPI_nf_type_NRF);
26
+
27
+ /* Add SCP NF-Instance */
28
+ self.scp_instance = ogs_sbi_nf_instance_add();
29
+ ogs_assert(self.scp_instance);
30
+ ogs_sbi_nf_instance_set_type(self.scp_instance, OpenAPI_nf_type_SCP);
31
+
32
context_initialized = 1;
33
}
34
35
36
ogs_assert(context_initialized == 1);
37
switch (self.discovery_config.delegated) {
38
case OGS_SBI_DISCOVERY_DELEGATED_AUTO:
39
- if (strcmp(local, "nrf") != 0 && /* Skip NRF */
40
- strcmp(local, "smf") != 0 && /* Skip SMF since SMF can run 4G */
41
- ogs_sbi_self()->nrf_instance == NULL &&
42
- ogs_sbi_self()->scp_instance == NULL) {
43
- ogs_error("DELEGATED_AUTO - Both NRF and %s are unavailable",
44
- strcmp(scp, "next_scp") == 0 ? "Next-hop SCP" : "SCP");
45
- return OGS_ERROR;
46
+ if (strcmp(local, "nrf") == 0) {
47
+ /* Skip NRF */
48
+ } else if (strcmp(local, "scp") == 0) {
49
+ /* Skip SCP */
50
+ } else if (strcmp(local, "smf") == 0) {
51
+ /* Skip SMF since SMF can run 4G */
52
+ } else {
53
+ if (NF_INSTANCE_CLIENT(self.nrf_instance) ||
54
+ NF_INSTANCE_CLIENT(self.scp_instance)) {
55
+ } else {
56
+ ogs_error("DELEGATED_AUTO - Both NRF and %s are unavailable",
57
+ strcmp(scp, "next_scp") == 0 ? "Next-hop SCP" : "SCP");
58
+ return OGS_ERROR;
59
+ }
60
}
61
break;
62
case OGS_SBI_DISCOVERY_DELEGATED_YES:
63
- if (ogs_sbi_self()->scp_instance == NULL) {
64
+ if (NF_INSTANCE_CLIENT(self.scp_instance) == NULL) {
65
ogs_error("DELEGATED_YES - no %s available",
66
strcmp(scp, "next_scp") == 0 ? "Next-hop SCP" : "SCP");
67
return OGS_ERROR;
68
}
69
break;
70
case OGS_SBI_DISCOVERY_DELEGATED_NO:
71
- if (ogs_sbi_self()->nrf_instance == NULL) {
72
+ if (NF_INSTANCE_CLIENT(self.nrf_instance) == NULL) {
73
ogs_error("DELEGATED_NO - no NRF available");
74
return OGS_ERROR;
75
}
76
77
return OGS_OK;
78
}
79
80
-ogs_sbi_nf_instance_t *ogs_sbi_scp_instance(void)
81
-{
82
- return NULL;
83
-}
84
-
85
int ogs_sbi_context_parse_config(
86
const char *local, const char *nrf, const char *scp)
87
{
88
89
ogs_yaml_iter_t sbi_array, sbi_iter;
90
ogs_yaml_iter_recurse(&nrf_iter, &sbi_array);
91
do {
92
- ogs_sbi_nf_instance_t *nrf_instance = NULL;
93
ogs_sbi_client_t *client = NULL;
94
ogs_sockaddr_t *addr = NULL;
95
int family = AF_UNSPEC;
96
97
98
client = ogs_sbi_client_add(addr);
99
ogs_assert(client);
100
-
101
- ogs_sbi_self()->nrf_instance =
102
- nrf_instance = ogs_sbi_nf_instance_add();
103
- ogs_assert(nrf_instance);
104
- ogs_sbi_nf_instance_set_type(
105
- nrf_instance, OpenAPI_nf_type_NRF);
106
-
107
- OGS_SBI_SETUP_CLIENT(nrf_instance, client);
108
+ OGS_SBI_SETUP_CLIENT(self.nrf_instance, client);
109
110
if (key) client->tls.key = key;
111
if (pem) client->tls.pem = pem;
112
113
YAML_SEQUENCE_NODE);
114
}
115
}
116
- } else if (scp && !strcmp(root_key, scp)) {
117
+ } else if (ogs_app()->parameter.no_scp == false &&
118
+ scp && !strcmp(root_key, scp)) {
119
ogs_yaml_iter_t scp_iter;
120
ogs_yaml_iter_recurse(&root_iter, &scp_iter);
121
while (ogs_yaml_iter_next(&scp_iter)) {
122
123
ogs_yaml_iter_t sbi_array, sbi_iter;
124
ogs_yaml_iter_recurse(&scp_iter, &sbi_array);
125
do {
126
- ogs_sbi_nf_instance_t *scp_instance = NULL;
127
ogs_sbi_client_t *client = NULL;
128
ogs_sockaddr_t *addr = NULL;
129
int family = AF_UNSPEC;
130
131
132
client = ogs_sbi_client_add(addr);
133
ogs_assert(client);
134
-
135
- ogs_sbi_self()->scp_instance =
136
- scp_instance = ogs_sbi_nf_instance_add();
137
- ogs_assert(scp_instance);
138
- ogs_sbi_nf_instance_set_type(
139
- scp_instance, OpenAPI_nf_type_SCP);
140
-
141
- OGS_SBI_SETUP_CLIENT(scp_instance, client);
142
+ OGS_SBI_SETUP_CLIENT(self.scp_instance, client);
143
144
if (key) client->tls.key = key;
145
if (pem) client->tls.pem = pem;
146
147
148
ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find_by_discovery_param(
149
OpenAPI_nf_type_e target_nf_type,
150
+ OpenAPI_nf_type_e requester_nf_type,
151
ogs_sbi_discovery_option_t *discovery_option)
152
{
153
ogs_sbi_nf_instance_t *nf_instance = NULL;
154
155
ogs_assert(target_nf_type);
156
+ ogs_assert(requester_nf_type);
157
158
ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) {
159
if (ogs_sbi_discovery_param_is_matched(
160
- nf_instance, target_nf_type, discovery_option) == false)
161
+ nf_instance, target_nf_type, requester_nf_type,
162
+ discovery_option) == false)
163
continue;
164
165
return nf_instance;
166
167
}
168
169
ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find_by_service_type(
170
- ogs_sbi_service_type_e service_type)
171
+ ogs_sbi_service_type_e service_type,
172
+ OpenAPI_nf_type_e requester_nf_type)
173
{
174
ogs_sbi_nf_instance_t *nf_instance = NULL;
175
ogs_sbi_discovery_option_t *discovery_option = NULL;
176
177
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
178
char *service_name = NULL;
179
180
+ ogs_assert(requester_nf_type);
181
ogs_assert(service_type);
182
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
183
ogs_assert(target_nf_type);
184
185
ogs_sbi_discovery_option_add_service_names(discovery_option, service_name);
186
187
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
188
- target_nf_type, discovery_option);
189
+ target_nf_type, requester_nf_type, discovery_option);
190
191
ogs_sbi_discovery_option_free(discovery_option);
192
193
194
bool ogs_sbi_discovery_param_is_matched(
195
ogs_sbi_nf_instance_t *nf_instance,
196
OpenAPI_nf_type_e target_nf_type,
197
+ OpenAPI_nf_type_e requester_nf_type,
198
ogs_sbi_discovery_option_t *discovery_option)
199
{
200
- OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
201
open5gs_2.4.11.tar.xz/lib/sbi/context.h -> open5gs_2.5.0.tar.xz/lib/sbi/context.h
Changed
92
1
2
ogs_timer_t *t_no_heartbeat; /* check heartbeat */
3
ogs_timer_t *t_validity; /* check validation */
4
5
+#define NF_INSTANCE_ID(__nFInstance) \
6
+ ((__nFInstance) ? ((__nFInstance)->id) : NULL)
7
#define NF_INSTANCE_ID_IS_SELF(_iD) \
8
(_iD) && ogs_sbi_self()->nf_instance && \
9
strcmp((_iD), ogs_sbi_self()->nf_instance->id) == 0
10
#define NF_INSTANCE_ID_IS_OTHERS(_iD) \
11
(_iD) && ogs_sbi_self()->nf_instance && \
12
strcmp((_iD), ogs_sbi_self()->nf_instance->id) != 0
13
+ char *id;
14
15
+#define NF_INSTANCE_TYPE(__nFInstance) \
16
+ ((__nFInstance) ? ((__nFInstance)->nf_type) : OpenAPI_nf_type_NULL)
17
#define NF_INSTANCE_TYPE_IS_NRF(__nFInstance) \
18
- ((__nFInstance->nf_type) == OpenAPI_nf_type_NRF)
19
-
20
- char *id; /* NFInstanceId */
21
-
22
+ (NF_INSTANCE_TYPE(__nFInstance) == OpenAPI_nf_type_NRF)
23
OpenAPI_nf_type_e nf_type;
24
OpenAPI_nf_status_e nf_status;
25
26
27
ogs_list_t nf_service_list;
28
ogs_list_t nf_info_list;
29
30
+#define NF_INSTANCE_CLIENT(__nFInstance) \
31
+ ((__nFInstance) ? ((__nFInstance)->client) : NULL)
32
void *client; /* only used in CLIENT */
33
unsigned int reference_count; /* reference count for memory free */
34
} ogs_sbi_nf_instance_t;
35
36
ogs_lnode_t lnode;
37
38
ogs_sbi_service_type_e service_type;
39
+ OpenAPI_nf_type_e requester_nf_type;
40
ogs_sbi_discovery_option_t *discovery_option;
41
42
ogs_sbi_request_t *request;
43
44
45
struct {
46
OpenAPI_nf_type_e nf_type; /* nfType */
47
- char *service_name; /* ServiceName */
48
+ char *service_name; /* ServiceName */
49
} subscr_cond;
50
51
uint64_t requester_features;
52
53
54
bool ogs_sbi_nf_service_is_available(const char *name);
55
56
-ogs_sbi_nf_instance_t *ogs_sbi_scp_instance(void);
57
-
58
ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_add(void);
59
void ogs_sbi_nf_instance_set_id(ogs_sbi_nf_instance_t *nf_instance, char *id);
60
void ogs_sbi_nf_instance_set_type(
61
62
ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find(char *id);
63
ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find_by_discovery_param(
64
OpenAPI_nf_type_e nf_type,
65
+ OpenAPI_nf_type_e requester_nf_type,
66
ogs_sbi_discovery_option_t *discovery_option);
67
ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find_by_service_type(
68
- ogs_sbi_service_type_e service_type);
69
+ ogs_sbi_service_type_e service_type,
70
+ OpenAPI_nf_type_e requester_nf_type);
71
bool ogs_sbi_nf_instance_maximum_number_is_reached(void);
72
73
ogs_sbi_nf_service_t *ogs_sbi_nf_service_add(
74
75
76
ogs_sbi_client_t *ogs_sbi_client_find_by_service_name(
77
ogs_sbi_nf_instance_t *nf_instance, char *name, char *version);
78
+ogs_sbi_client_t *ogs_sbi_client_find_by_service_type(
79
+ ogs_sbi_nf_instance_t *nf_instance,
80
+ ogs_sbi_service_type_e service_type);
81
82
void ogs_sbi_client_associate(ogs_sbi_nf_instance_t *nf_instance);
83
84
85
bool ogs_sbi_discovery_param_is_matched(
86
ogs_sbi_nf_instance_t *nf_instance,
87
OpenAPI_nf_type_e target_nf_type,
88
+ OpenAPI_nf_type_e requester_nf_type,
89
ogs_sbi_discovery_option_t *discovery_option);
90
91
bool ogs_sbi_discovery_option_is_matched(
92
open5gs_2.4.11.tar.xz/lib/sbi/conv.c -> open5gs_2.5.0.tar.xz/lib/sbi/conv.c
Changed
74
1
2
return true;
3
}
4
5
+int ogs_sbi_rfc7231_string(char *date_str, ogs_time_t time)
6
+{
7
+ const char ogs_month_snames124 = {
8
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
9
+ "Aug", "Sep", "Oct", "Nov", "Dec"
10
+ };
11
+ const char ogs_day_snames74 = {
12
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
13
+ };
14
+
15
+ struct tm gmt;
16
+ const char *s;
17
+ int real_year;
18
+
19
+ ogs_time_t sec = ogs_time_sec(time);
20
+ ogs_time_t msec = ogs_time_msec(time);
21
+
22
+ ogs_assert(date_str);
23
+
24
+ ogs_gmtime(sec, &gmt);
25
+
26
+ /* example: "Sun, 04 Aug 2019 08:49:37.845 GMT" */
27
+ /* 123456789012345678901234567890123 */
28
+
29
+ s = &ogs_day_snamesgmt.tm_wday0;
30
+ *date_str++ = *s++;
31
+ *date_str++ = *s++;
32
+ *date_str++ = *s++;
33
+ *date_str++ = ',';
34
+ *date_str++ = ' ';
35
+ *date_str++ = gmt.tm_mday / 10 + '0';
36
+ *date_str++ = gmt.tm_mday % 10 + '0';
37
+ *date_str++ = ' ';
38
+ s = &ogs_month_snamesgmt.tm_mon0;
39
+ *date_str++ = *s++;
40
+ *date_str++ = *s++;
41
+ *date_str++ = *s++;
42
+ *date_str++ = ' ';
43
+ real_year = 1900 + gmt.tm_year;
44
+ /* This routine isn't y10k ready. */
45
+ *date_str++ = real_year / 1000 + '0';
46
+ *date_str++ = real_year % 1000 / 100 + '0';
47
+ *date_str++ = real_year % 100 / 10 + '0';
48
+ *date_str++ = real_year % 10 + '0';
49
+ *date_str++ = ' ';
50
+ *date_str++ = gmt.tm_hour / 10 + '0';
51
+ *date_str++ = gmt.tm_hour % 10 + '0';
52
+ *date_str++ = ':';
53
+ *date_str++ = gmt.tm_min / 10 + '0';
54
+ *date_str++ = gmt.tm_min % 10 + '0';
55
+ *date_str++ = ':';
56
+ *date_str++ = gmt.tm_sec / 10 + '0';
57
+ *date_str++ = gmt.tm_sec % 10 + '0';
58
+ *date_str++ = '.';
59
+ *date_str++ = msec / 100 + '0';
60
+ *date_str++ = msec % 100 / 10 + '0';
61
+ *date_str++ = msec % 10 + '0';
62
+ *date_str++ = ' ';
63
+ *date_str++ = 'G';
64
+ *date_str++ = 'M';
65
+ *date_str++ = 'T';
66
+ *date_str++ = 0;
67
+
68
+ return OGS_OK;
69
+}
70
+
71
char *ogs_sbi_s_nssai_to_string(ogs_s_nssai_t *s_nssai)
72
{
73
cJSON *item = NULL;
74
open5gs_2.4.11.tar.xz/lib/sbi/conv.h -> open5gs_2.5.0.tar.xz/lib/sbi/conv.h
Changed
11
1
2
char *ogs_sbi_timezone_string(int tm_gmtoff);
3
bool ogs_sbi_time_from_string(ogs_time_t *time, char *str);
4
5
+#define OGS_SBI_RFC7231_DATE_LEN (34)
6
+int ogs_sbi_rfc7231_string(char *date_str, ogs_time_t time);
7
+
8
char *ogs_sbi_s_nssai_to_string(ogs_s_nssai_t *s_nssai);
9
bool ogs_sbi_s_nssai_from_string(ogs_s_nssai_t *s_nssai, char *str);
10
11
open5gs_2.4.11.tar.xz/lib/sbi/meson.build -> open5gs_2.5.0.tar.xz/lib/sbi/meson.build
Changed
9
1
2
3
nnrf-build.c
4
nnrf-handler.c
5
+ nnrf-path.c
6
7
path.c
8
nf-sm.c
9
open5gs_2.4.11.tar.xz/lib/sbi/message.c -> open5gs_2.5.0.tar.xz/lib/sbi/message.c
Changed
201
1
2
OpenAPI_termination_notification_free(message->TerminationNotification);
3
if (message->DeregistrationData)
4
OpenAPI_deregistration_data_free(message->DeregistrationData);
5
+ if (message->SDMSubscription)
6
+ OpenAPI_sdm_subscription_free(message->SDMSubscription);
7
+ if (message->ModificationNotification)
8
+ OpenAPI_modification_notification_free(message->ModificationNotification);
9
10
/* HTTP Part */
11
for (i = 0; i < message->num_of_part; i++) {
12
13
{
14
int i;
15
ogs_sbi_request_t *request = NULL;
16
+ OpenAPI_nf_type_e nf_type = OpenAPI_nf_type_NULL;
17
+ char sender_timestampOGS_SBI_RFC7231_DATE_LEN;
18
+ char *max_rsp_time = NULL;
19
20
ogs_assert(message);
21
22
23
discovery_option->num_of_service_names) {
24
25
/* send array items separated by a comma */
26
- char *v = NULL;
27
-
28
- v = ogs_strdup(discovery_option->service_names0);
29
- ogs_expect_or_return_val(v, NULL);
30
-
31
- if (discovery_option->num_of_service_names > 1)
32
- {
33
- int i;
34
- for (i = 1; i < discovery_option->num_of_service_names; i++)
35
- v = ogs_mstrcatf(v, ",%s", discovery_option->service_namesi);
36
+ char *v = ogs_sbi_discovery_option_build_service_names(
37
+ discovery_option);
38
+ if (v) {
39
+ ogs_sbi_header_set(request->http.params,
40
+ OGS_SBI_PARAM_SERVICE_NAMES, v);
41
+ ogs_free(v);
42
+ } else {
43
+ ogs_warn("invalid service names failed%d:%s",
44
+ discovery_option->num_of_service_names,
45
+ discovery_option->service_names0);
46
}
47
-
48
- ogs_sbi_header_set(
49
- request->http.params, OGS_SBI_PARAM_SERVICE_NAMES, v);
50
- ogs_free(v);
51
}
52
}
53
54
55
END
56
}
57
58
+ nf_type = NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance);
59
+ if (nf_type) {
60
+ char *user_agent = OpenAPI_nf_type_ToString(nf_type);
61
+ if (user_agent)
62
+ ogs_sbi_header_set(request->http.headers,
63
+ OGS_SBI_USER_AGENT, user_agent);
64
+ }
65
+
66
+ ogs_assert(OGS_OK ==
67
+ ogs_sbi_rfc7231_string(sender_timestamp, ogs_time_now()));
68
+ ogs_sbi_header_set(request->http.headers,
69
+ OGS_SBI_OPTIONAL_CUSTOM_SENDER_TIMESTAMP, sender_timestamp);
70
+
71
+ ogs_assert(ogs_time_to_msec(ogs_app()->time.message.duration));
72
+ max_rsp_time = ogs_msprintf("%d",
73
+ (int)ogs_time_to_msec(ogs_app()->time.message.duration));
74
+ ogs_sbi_header_set(request->http.headers,
75
+ OGS_SBI_OPTIONAL_CUSTOM_MAX_RSP_TIME, max_rsp_time);
76
+ ogs_free(max_rsp_time);
77
+
78
if (message->http.content_encoding)
79
ogs_sbi_header_set(request->http.headers,
80
OGS_SBI_ACCEPT_ENCODING, message->http.content_encoding);
81
82
+ if (message->http.custom.callback)
83
+ ogs_sbi_header_set(request->http.headers,
84
+ OGS_SBI_CUSTOM_CALLBACK, message->http.custom.callback);
85
+
86
+ if (message->http.custom.nrf_uri)
87
+ ogs_sbi_header_set(request->http.headers,
88
+ OGS_SBI_CUSTOM_NRF_URI, message->http.custom.nrf_uri);
89
+
90
return request;
91
}
92
93
94
/* Discovery Option Parameter */
95
} else if (!strcmp(ogs_hash_this_key(hi),
96
OGS_SBI_PARAM_TARGET_NF_INSTANCE_ID)) {
97
- discovery_option_presence = true;
98
- ogs_sbi_discovery_option_set_target_nf_instance_id(
99
- discovery_option, ogs_hash_this_val(hi));
100
+ char *v = NULL;
101
+ v = ogs_hash_this_val(hi);
102
+
103
+ if (v) {
104
+ ogs_sbi_discovery_option_set_target_nf_instance_id(
105
+ discovery_option, v);
106
+ discovery_option_presence = true;
107
+ }
108
} else if (!strcmp(ogs_hash_this_key(hi),
109
OGS_SBI_PARAM_REQUESTER_NF_INSTANCE_ID)) {
110
- discovery_option_presence = true;
111
- ogs_sbi_discovery_option_set_requester_nf_instance_id(
112
- discovery_option, ogs_hash_this_val(hi));
113
+ char *v = NULL;
114
+ v = ogs_hash_this_val(hi);
115
+
116
+ if (v) {
117
+ ogs_sbi_discovery_option_set_requester_nf_instance_id(
118
+ discovery_option, v);
119
+ discovery_option_presence = true;
120
+ }
121
} else if (!strcmp(ogs_hash_this_key(hi),
122
OGS_SBI_PARAM_SERVICE_NAMES)) {
123
char *v = NULL;
124
- char *service_names;
125
- char *token;
126
- char *saveptr;
127
128
v = ogs_hash_this_val(hi);
129
if (v) {
130
- service_names = ogs_strdup(v);
131
- ogs_assert(service_names);
132
-
133
- token = ogs_strtok_r(service_names, ",", &saveptr);
134
- while (token != NULL)
135
- {
136
- discovery_option_presence = true;
137
- ogs_sbi_discovery_option_add_service_names(
138
- discovery_option, token);
139
-
140
- token = ogs_strtok_r(NULL, ",", &saveptr);
141
- }
142
-
143
- ogs_free(service_names);
144
+ ogs_sbi_discovery_option_parse_service_names(
145
+ discovery_option, v);
146
+ discovery_option_presence = true;
147
}
148
149
/* URL Query Parameter */
150
151
message->http.content_type = ogs_hash_this_val(hi);
152
} else if (!ogs_strcasecmp(ogs_hash_this_key(hi), OGS_SBI_ACCEPT)) {
153
message->http.accept = ogs_hash_this_val(hi);
154
+ } else if (!ogs_strcasecmp(ogs_hash_this_key(hi), OGS_SBI_USER_AGENT)) {
155
+ char *v = ogs_hash_this_val(hi);
156
+ if (v)
157
+ message->http.requester_nf_type =
158
+ OpenAPI_nf_type_FromString(v);
159
+ } else if (!ogs_strcasecmp(ogs_hash_this_key(hi),
160
+ OGS_SBI_CUSTOM_CALLBACK)) {
161
+ message->http.custom.callback = ogs_hash_this_val(hi);
162
}
163
}
164
165
+ if (!message->http.requester_nf_type) {
166
+ ogs_error("No User-Agent in HTTP2 Header");
167
+ ogs_sbi_message_free(message);
168
+ return OGS_ERROR;
169
+ }
170
+
171
if (parse_content(message, &request->http) != OGS_OK) {
172
ogs_error("parse_content() failed");
173
+ ogs_sbi_message_free(message);
174
return OGS_ERROR;
175
}
176
177
178
item = OpenAPI_deregistration_data_convertToJSON(
179
message->DeregistrationData);
180
ogs_assert(item);
181
+ } else if (message->SDMSubscription) {
182
+ item = OpenAPI_sdm_subscription_convertToJSON(
183
+ message->SDMSubscription);
184
+ ogs_assert(item);
185
+ }
186
+ else if (message->ModificationNotification) {
187
+ item = OpenAPI_modification_notification_convertToJSON(
188
+ message->ModificationNotification);
189
+ ogs_assert(item);
190
}
191
192
if (item) {
193
194
}
195
break;
196
197
+ CASE(OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS)
198
+ message->SDMSubscription =
199
+ OpenAPI_sdm_subscription_parseFromJSON(item);
200
+ if (!message->SDMSubscription) {
201
open5gs_2.4.11.tar.xz/lib/sbi/message.h -> open5gs_2.5.0.tar.xz/lib/sbi/message.h
Changed
125
1
2
#define OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA "ue-context-in-smf-data"
3
#define OGS_SBI_RESOURCE_NAME_SMF_SELECTION_SUBSCRIPTION_DATA \
4
"smf-selection-subscription-data"
5
+#define OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS "sdm-subscriptions"
6
7
#define OGS_SBI_RESOURCE_NAME_SECURITY_INFORMATION "security-information"
8
#define OGS_SBI_RESOURCE_NAME_GENERATE_AUTH_DATA "generate-auth-data"
9
10
#define OGS_SBI_RESOURCE_NAME_SM_CONTEXT_STATUS "sm-context-status"
11
#define OGS_SBI_RESOURCE_NAME_AM_POLICY_NOTIFY "am-policy-notify"
12
#define OGS_SBI_RESOURCE_NAME_DEREG_NOTIFY "dereg-notify"
13
+#define OGS_SBI_RESOURCE_NAME_SDMSUBSCRIPTION_NOTIFY \
14
+ "sdmsubscription-notify"
15
16
#define OGS_SBI_RESOURCE_NAME_POLICIES "policies"
17
#define OGS_SBI_RESOURCE_NAME_SM_POLICIES "sm-policies"
18
19
#define OGS_SBI_NBSF_MANAGEMENT_ES3XX 4
20
#define OGS_SBI_NBSF_MANAGEMENT_EXTENDED_SAME_PCF 5
21
22
+#define OGS_SBI_SCHEME ":scheme"
23
+#define OGS_SBI_AUTHORITY ":authority"
24
#define OGS_SBI_ACCEPT "Accept"
25
#define OGS_SBI_ACCEPT_ENCODING "Accept-Encoding"
26
+#define OGS_SBI_USER_AGENT "User-Agent"
27
#define OGS_SBI_CONTENT_TYPE "Content-Type"
28
#define OGS_SBI_LOCATION "Location"
29
#define OGS_SBI_EXPECT "Expect"
30
31
OGS_SBI_CUSTOM_3GPP_COMMON "Access-Scope"
32
#define OGS_SBI_CUSTOM_ACCESS_TOKEN \
33
OGS_SBI_CUSTOM_3GPP_COMMON "Access-Token"
34
+#define OGS_SBI_OPTIONAL_CUSTOM_SENDER_TIMESTAMP \
35
+ OGS_SBI_CUSTOM_3GPP_COMMON "Sender-Timestamp"
36
+#define OGS_SBI_OPTIONAL_CUSTOM_MAX_RSP_TIME \
37
+ OGS_SBI_CUSTOM_3GPP_COMMON "Max-Rsp-Time"
38
39
#define OGS_SBI_PARAM_TARGET_NF_TYPE "target-nf-type"
40
#define OGS_SBI_PARAM_REQUESTER_NF_TYPE "requester-nf-type"
41
42
#define OGS_SBI_CONTENT_5GNAS_SM_ID "5gnas-sm"
43
#define OGS_SBI_CONTENT_NGAP_SM_ID "ngap-sm"
44
45
+#define OGS_SBI_CALLBACK_NSMF_PDUSESSION_UPDATE \
46
+ "Nsmf_PDUSession_Update"
47
+#define OGS_SBI_CALLBACK_NSMF_PDUSESSION_STATUS_NOTIFY \
48
+ "Nsmf_PDUSession_StatusNotify"
49
+#define OGS_SBI_CALLBACK_NUDM_SDM_NOTIFICATION \
50
+ "Nudm_SDM_Notification"
51
+#define OGS_SBI_CALLBACK_NUDM_UECM_DEREGISTRATION_NOTIFICATION \
52
+ "Nudm_UECM_DeregistrationNotification"
53
+#define OGS_SBI_CALLBACK_NUDM_UECM_PCSCF_RESTORATION_NOTIFICATION \
54
+ "Nudm_UECM_PCSCFRestorationNotification"
55
+#define OGS_SBI_CALLBACK_NNRF_NFMANAGEMENT_NF_STATUS_NOTIFY \
56
+ "Nnrf_NFManagement_NFStatusNotify"
57
+#define OGS_SBI_CALLBACK_NAMF_EVENTEXPOSURE_NOTIFY \
58
+ "Namf_EventExposure_Notify"
59
+#define OGS_SBI_CALLBACK_NPCF_UEPOLICYCONTROL_UPDATE_NOTIFY \
60
+ "Npcf_UEPolicyControl_UpdateNotify"
61
+#define OGS_SBI_CALLBACK_NNSSF_NSSAIAVAILABILITY_NOTIFICATION \
62
+ "Nnssf_NSSAIAvailability_Notification"
63
+#define OGS_SBI_CALLBACK_NAMF_COMMUNICATION_AMF_STATUS_CHANGE_NOTIFY \
64
+ "Namf_Communication_AMFStatusChangeNotify"
65
+#define OGS_SBI_CALLBACK_NGMLC_LOCATION_EVENT_NOTIFY \
66
+ "Ngmlc_Location_EventNotify"
67
+#define OGS_SBI_CALLBACK_NCHF_CONVERGEDCHARGING_NOTIFY \
68
+ "Nchf_ConvergedCharging_Notify"
69
+#define OGS_SBI_CALLBACK_NNSSAAF_NSSAA_RE_AUTHENTICATION \
70
+ "Nnssaaf_NSSAA_ReAuthentication"
71
+#define OGS_SBI_CALLBACK_NNSSAAF_NSSAA_REVOCATION \
72
+ "Nnssaaf_NSSAA_Revocation"
73
+#define OGS_SBI_CALLBACK_N5G_DDNMF_DISCOVERY_MONITOR_UPDATE_RESULT \
74
+ "N5g-ddnmf_Discovery_MonitorUpdateResult"
75
+#define OGS_SBI_CALLBACK_N5G_DDNMF_DISCOVERY_MATCH_INFORMATION \
76
+ "N5g-ddnmf_Discovery_MatchInformation"
77
+
78
typedef struct ogs_sbi_header_s {
79
char *method;
80
char *uri;
81
82
ogs_sbi_header_t h;
83
84
struct {
85
+ OpenAPI_nf_type_e requester_nf_type;
86
+
87
char *accept;
88
char *content_encoding;
89
char *content_type;
90
char *location;
91
char *cache_control;
92
+
93
+ struct {
94
+ char *callback;
95
+ char *nrf_uri;
96
+ } custom;
97
} http;
98
99
struct {
100
101
OpenAPI_sm_policy_notification_t *SmPolicyNotification;
102
OpenAPI_termination_notification_t *TerminationNotification;
103
OpenAPI_deregistration_data_t *DeregistrationData;
104
+ OpenAPI_sdm_subscription_t *SDMSubscription;
105
+ OpenAPI_modification_notification_t *ModificationNotification;
106
107
ogs_sbi_links_t *links;
108
109
110
void ogs_sbi_discovery_option_set_requester_nf_instance_id(
111
ogs_sbi_discovery_option_t *discovery_option,
112
char *requester_nf_instance_id);
113
+
114
void ogs_sbi_discovery_option_add_service_names(
115
ogs_sbi_discovery_option_t *discovery_option,
116
char *service_name);
117
+char *ogs_sbi_discovery_option_build_service_names(
118
+ ogs_sbi_discovery_option_t *discovery_option);
119
+void ogs_sbi_discovery_option_parse_service_names(
120
+ ogs_sbi_discovery_option_t *discovery_option,
121
+ char *service_names);
122
123
#ifdef __cplusplus
124
}
125
open5gs_2.4.11.tar.xz/lib/sbi/nf-sm.c -> open5gs_2.5.0.tar.xz/lib/sbi/nf-sm.c
Changed
173
1
2
void ogs_sbi_nf_state_will_register(ogs_fsm_t *s, ogs_event_t *e)
3
{
4
ogs_sbi_nf_instance_t *nf_instance = NULL;
5
- ogs_sbi_client_t *client = NULL;
6
ogs_sbi_message_t *message = NULL;
7
- ogs_sockaddr_t *addr = NULL;
8
9
ogs_assert(s);
10
ogs_assert(e);
11
12
13
nf_instance = e->sbi.data;
14
ogs_assert(nf_instance);
15
- ogs_assert(ogs_sbi_self()->nf_instance);
16
ogs_assert(NF_INSTANCE_TYPE_IS_NRF(nf_instance));
17
18
switch (e->id) {
19
20
21
if (message->res_status == OGS_SBI_HTTP_STATUS_OK ||
22
message->res_status == OGS_SBI_HTTP_STATUS_CREATED) {
23
- ogs_sbi_nnrf_handle_nf_register(nf_instance, message);
24
+ ogs_nnrf_nfm_handle_nf_register(nf_instance, message);
25
OGS_FSM_TRAN(s, &ogs_sbi_nf_state_registered);
26
} else {
27
ogs_error("%s HTTP Response Status Code %d",
28
- ogs_sbi_self()->nf_instance->id,
29
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
30
message->res_status);
31
OGS_FSM_TRAN(s, &ogs_sbi_nf_state_exception);
32
}
33
34
35
DEFAULT
36
ogs_error("%s Invalid resource name %s",
37
- ogs_sbi_self()->nf_instance->id,
38
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
39
message->h.resource.component0);
40
END
41
break;
42
43
DEFAULT
44
ogs_error("%s Invalid API name %s",
45
- ogs_sbi_self()->nf_instance->id, message->h.service.name);
46
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
47
+ message->h.service.name);
48
END
49
break;
50
51
case OGS_EVENT_SBI_TIMER:
52
switch(e->timer_id) {
53
case OGS_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL:
54
- client = nf_instance->client;
55
- ogs_assert(client);
56
- addr = client->node.addr;
57
- ogs_assert(addr);
58
-
59
ogs_warn("%s Retry to registration with NRF",
60
- ogs_sbi_self()->nf_instance->id);
61
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance));
62
63
ogs_timer_start(nf_instance->t_registration_interval,
64
ogs_app()->time.message.sbi.nf_register_interval);
65
66
67
default:
68
ogs_error("%s Unknown timer%s:%d",
69
- ogs_sbi_self()->nf_instance->id,
70
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
71
ogs_timer_get_name(e->timer_id), e->timer_id);
72
}
73
break;
74
75
76
nf_instance = e->sbi.data;
77
ogs_assert(nf_instance);
78
- ogs_assert(ogs_sbi_self()->nf_instance);
79
80
switch (e->id) {
81
case OGS_FSM_ENTRY_SIG:
82
83
ogs_sbi_subscription_data_t *subscription_data = NULL;
84
85
ogs_info("%s NF registered Heartbeat:%ds",
86
- ogs_sbi_self()->nf_instance->id,
87
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
88
nf_instance->time.heartbeat_interval);
89
90
if (nf_instance->time.heartbeat_interval) {
91
92
93
case OGS_FSM_EXIT_SIG:
94
if (NF_INSTANCE_TYPE_IS_NRF(nf_instance)) {
95
- ogs_info("%s NF de-registered", ogs_sbi_self()->nf_instance->id);
96
+ ogs_info("%s NF de-registered",
97
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance));
98
99
if (nf_instance->time.heartbeat_interval) {
100
ogs_timer_stop(nf_instance->t_heartbeat_interval);
101
102
no_heartbeat_margin));
103
} else {
104
ogs_warn("%s HTTP response error %d",
105
- ogs_sbi_self()->nf_instance->id,
106
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
107
message->res_status);
108
OGS_FSM_TRAN(s, &ogs_sbi_nf_state_exception);
109
}
110
111
112
DEFAULT
113
ogs_error("%s Invalid resource name %s",
114
- ogs_sbi_self()->nf_instance->id,
115
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
116
message->h.resource.component0);
117
END
118
break;
119
120
DEFAULT
121
ogs_error("%s Invalid API name %s",
122
- ogs_sbi_self()->nf_instance->id, message->h.service.name);
123
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance),
124
+ message->h.service.name);
125
END
126
break;
127
128
129
break;
130
131
case OGS_TIMER_NF_INSTANCE_NO_HEARTBEAT:
132
- ogs_error("%s No heartbeat", ogs_sbi_self()->nf_instance->id);
133
+ ogs_error("%s No heartbeat",
134
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance));
135
OGS_FSM_TRAN(s, &ogs_sbi_nf_state_will_register);
136
break;
137
138
139
switch (e->id) {
140
case OGS_FSM_ENTRY_SIG:
141
if (NF_INSTANCE_TYPE_IS_NRF(nf_instance)) {
142
- ogs_info("%s NF de-registered", ogs_sbi_self()->nf_instance->id);
143
+ ogs_info("%s NF de-registered",
144
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance));
145
}
146
break;
147
148
149
void ogs_sbi_nf_state_exception(ogs_fsm_t *s, ogs_event_t *e)
150
{
151
ogs_sbi_nf_instance_t *nf_instance = NULL;
152
- ogs_sbi_client_t *client = NULL;
153
ogs_sbi_message_t *message = NULL;
154
- ogs_sockaddr_t *addr = NULL;
155
ogs_assert(s);
156
ogs_assert(e);
157
158
159
case OGS_EVENT_SBI_TIMER:
160
switch(e->timer_id) {
161
case OGS_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL:
162
- client = nf_instance->client;
163
- ogs_assert(client);
164
- addr = client->node.addr;
165
- ogs_assert(addr);
166
-
167
ogs_warn("%s Retry to registration with NRF",
168
- ogs_sbi_self()->nf_instance->id);
169
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance));
170
171
OGS_FSM_TRAN(s, &ogs_sbi_nf_state_will_register);
172
break;
173
open5gs_2.4.11.tar.xz/lib/sbi/nf-sm.h -> open5gs_2.5.0.tar.xz/lib/sbi/nf-sm.h
Changed
8
1
2
/*
3
- * Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
5
*
6
* This file is part of Open5GS.
7
*
8
open5gs_2.4.11.tar.xz/lib/sbi/nnrf-build.c -> open5gs_2.5.0.tar.xz/lib/sbi/nnrf-build.c
Changed
201
1
2
NFProfile = ogs_nnrf_nfm_build_nf_profile(
3
ogs_sbi_self()->nf_instance,
4
NULL, NULL, supported_features);
5
- ogs_expect_or_return_val(NFProfile, NULL);
6
+ if (!NFProfile) {
7
+ ogs_error("No NFProfile");
8
+ goto end;
9
+ }
10
11
message.NFProfile = NFProfile;
12
13
request = ogs_sbi_build_request(&message);
14
+ ogs_expect(request);
15
+
16
+end:
17
18
- ogs_nnrf_nfm_free_nf_profile(NFProfile);
19
+ if (NFProfile)
20
+ ogs_nnrf_nfm_free_nf_profile(NFProfile);
21
22
return request;
23
}
24
25
ogs_assert(nf_instance->id);
26
27
NFProfile = ogs_calloc(1, sizeof(*NFProfile));
28
- ogs_expect_or_return_val(NFProfile, NULL);
29
+ if (!NFProfile) {
30
+ ogs_error("No NFProfile");
31
+ return NULL;
32
+ }
33
34
NFProfile->nf_instance_id = nf_instance->id;
35
NFProfile->nf_type = nf_instance->nf_type;
36
37
NFProfile->is_load = true;
38
NFProfile->load = nf_instance->load;
39
40
- Ipv4AddrList = OpenAPI_list_create();
41
- ogs_assert(Ipv4AddrList);
42
- Ipv6AddrList = OpenAPI_list_create();
43
- ogs_assert(Ipv6AddrList);
44
+ NFProfile->ipv4_addresses = Ipv4AddrList = OpenAPI_list_create();
45
+ if (!Ipv4AddrList) {
46
+ ogs_error("No Ipv4AddrList");
47
+ ogs_nnrf_nfm_free_nf_profile(NFProfile);
48
+ return NULL;
49
+ }
50
51
for (i = 0; i < nf_instance->num_of_ipv4; i++) {
52
if (nf_instance->ipv4i) {
53
54
nf_instance->ipv4i->ogs_sin_port);
55
ogs_assert(nf_instance->ipv4i->ogs_sa_family == AF_INET);
56
ipstr = ogs_ipstrdup(nf_instance->ipv4i);
57
- ogs_expect_or_return_val(ipstr, NULL);
58
+ if (!ipstr) {
59
+ ogs_error("No ipstr");
60
+ ogs_nnrf_nfm_free_nf_profile(NFProfile);
61
+ return NULL;
62
+ }
63
OpenAPI_list_add(Ipv4AddrList, ipstr);
64
}
65
}
66
+
67
+ NFProfile->ipv6_addresses = Ipv6AddrList = OpenAPI_list_create();
68
+ if (!Ipv6AddrList) {
69
+ ogs_error("No IPv6AddrList");
70
+ ogs_nnrf_nfm_free_nf_profile(NFProfile);
71
+ return NULL;
72
+ }
73
+
74
for (i = 0; i < nf_instance->num_of_ipv6; i++) {
75
if (nf_instance->ipv6i) {
76
ogs_trace("IPv6 family:%d, port:%d",
77
78
nf_instance->ipv6i->ogs_sin_port);
79
ogs_assert(nf_instance->ipv6i->ogs_sa_family == AF_INET6);
80
ipstr = ogs_ipstrdup(nf_instance->ipv6i);
81
- ogs_expect_or_return_val(ipstr, NULL);
82
+ if (!ipstr) {
83
+ ogs_error("No ipstr");
84
+ ogs_nnrf_nfm_free_nf_profile(NFProfile);
85
+ return NULL;
86
+ }
87
OpenAPI_list_add(Ipv6AddrList, ipstr);
88
}
89
}
90
91
- if (Ipv4AddrList->count)
92
- NFProfile->ipv4_addresses = Ipv4AddrList;
93
- else
94
- OpenAPI_list_free(Ipv4AddrList);
95
- if (Ipv6AddrList->count)
96
- NFProfile->ipv6_addresses = Ipv6AddrList;
97
- else
98
- OpenAPI_list_free(Ipv6AddrList);
99
-
100
- AllowedNfTypeList = OpenAPI_list_create();
101
- ogs_assert(AllowedNfTypeList);
102
+ NFProfile->allowed_nf_types = AllowedNfTypeList = OpenAPI_list_create();
103
+ if (!AllowedNfTypeList) {
104
+ ogs_error("No AllowedNfTypeList");
105
+ ogs_nnrf_nfm_free_nf_profile(NFProfile);
106
+ return NULL;
107
+ }
108
109
for (i = 0; i < nf_instance->num_of_allowed_nf_type; i++) {
110
OpenAPI_list_add(AllowedNfTypeList,
111
(void *)(uintptr_t)nf_instance->allowed_nf_typei);
112
}
113
114
- if (AllowedNfTypeList->count)
115
- NFProfile->allowed_nf_types = AllowedNfTypeList;
116
- else
117
- OpenAPI_list_free(AllowedNfTypeList);
118
-
119
NFServiceList = OpenAPI_list_create();
120
- ogs_assert(NFServiceList);
121
+ if (!NFServiceList) {
122
+ ogs_error("No nf_service_list");
123
+ ogs_nnrf_nfm_free_nf_profile(NFProfile);
124
+ return NULL;
125
+ }
126
+
127
+ if (OGS_SBI_FEATURES_IS_SET(
128
+ supported_features, OGS_SBI_NNRF_NFM_SERVICE_MAP)) {
129
+ NFProfile->nf_service_list = NFServiceList;
130
+ } else {
131
+ NFProfile->nf_services = NFServiceList;
132
+ }
133
134
ogs_list_for_each(&nf_instance->nf_service_list, nf_service) {
135
OpenAPI_nf_service_t *NFService = NULL;
136
137
}
138
139
NFService = build_nf_service(nf_service);
140
- ogs_expect_or_return_val(NFService, NULL);
141
+ if (!NFService) {
142
+ ogs_error("No NFService");
143
+ ogs_nnrf_nfm_free_nf_profile(NFProfile);
144
+ return NULL;
145
+ }
146
147
if (OGS_SBI_FEATURES_IS_SET(
148
supported_features, OGS_SBI_NNRF_NFM_SERVICE_MAP)) {
149
NFServiceMap = OpenAPI_map_create(nf_service->id, NFService);
150
- ogs_assert(NFServiceMap);
151
+ if (!NFServiceMap) {
152
+ ogs_error("No NFServiceMap");
153
+ ogs_nnrf_nfm_free_nf_profile(NFProfile);
154
+ return NULL;
155
+ }
156
157
OpenAPI_list_add(NFServiceList, NFServiceMap);
158
} else {
159
160
}
161
}
162
163
- if (NFServiceList->count) {
164
- if (OGS_SBI_FEATURES_IS_SET(
165
- supported_features, OGS_SBI_NNRF_NFM_SERVICE_MAP)) {
166
- NFProfile->nf_service_list = NFServiceList;
167
- } else {
168
- NFProfile->nf_services = NFServiceList;
169
- }
170
- } else
171
- OpenAPI_list_free(NFServiceList);
172
-
173
InfoList = OpenAPI_list_create();
174
ogs_assert(InfoList);
175
176
177
}
178
179
SmfInfo = build_smf_info(nf_info);
180
- ogs_expect_or_return_val(SmfInfo, NULL);
181
+ ogs_assert(SmfInfo);
182
183
InfoMap = OpenAPI_map_create(
184
ogs_msprintf("%d", ++InfoMapKey), SmfInfo);
185
186
187
} else if (nf_info->nf_type == OpenAPI_nf_type_AMF) {
188
AmfInfo = build_amf_info(nf_info);
189
- ogs_expect_or_return_val(AmfInfo, NULL);
190
+ ogs_assert(AmfInfo);
191
192
InfoMap = OpenAPI_map_create(
193
ogs_msprintf("%d", ++InfoMapKey), AmfInfo);
194
195
ogs_assert(nf_service->name);
196
197
NFService = ogs_calloc(1, sizeof(*NFService));
198
- ogs_expect_or_return_val(NFService, NULL);
199
+ if (!NFService) {
200
+ ogs_error("No NFService");
201
open5gs_2.4.11.tar.xz/lib/sbi/nnrf-build.h -> open5gs_2.5.0.tar.xz/lib/sbi/nnrf-build.h
Changed
9
1
2
3
ogs_sbi_request_t *ogs_nnrf_disc_build_discover(
4
OpenAPI_nf_type_e target_nf_type,
5
+ OpenAPI_nf_type_e requester_nf_type,
6
ogs_sbi_discovery_option_t *discovery_option);
7
8
#ifdef __cplusplus
9
open5gs_2.4.11.tar.xz/lib/sbi/nnrf-handler.c -> open5gs_2.5.0.tar.xz/lib/sbi/nnrf-handler.c
Changed
83
1
2
static void handle_smf_info(
3
ogs_sbi_nf_instance_t *nf_instance, OpenAPI_smf_info_t *SmfInfo);
4
5
-void ogs_sbi_nnrf_handle_nf_register(
6
+void ogs_nnrf_nfm_handle_nf_register(
7
ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_message_t *recvmsg)
8
{
9
OpenAPI_nf_profile_t *NFProfile = NULL;
10
- ogs_sbi_client_t *client = NULL;
11
12
ogs_assert(recvmsg);
13
ogs_assert(nf_instance);
14
- client = nf_instance->client;
15
- ogs_assert(client);
16
17
NFProfile = recvmsg->NFProfile;
18
if (!NFProfile) {
19
20
nf_instance->time.heartbeat_interval = NFProfile->heart_beat_timer;
21
}
22
23
-void ogs_sbi_nnrf_handle_nf_profile(
24
+void ogs_nnrf_nfm_handle_nf_profile(
25
ogs_sbi_nf_instance_t *nf_instance, OpenAPI_nf_profile_t *NFProfile)
26
{
27
int rv;
28
29
}
30
}
31
32
-void ogs_nnrf_handle_nf_status_subscribe(
33
+void ogs_nnrf_nfm_handle_nf_status_subscribe(
34
ogs_sbi_subscription_data_t *subscription_data,
35
ogs_sbi_message_t *recvmsg)
36
{
37
OpenAPI_subscription_data_t *SubscriptionData = NULL;
38
- ogs_sbi_client_t *client = NULL;
39
40
ogs_assert(recvmsg);
41
ogs_assert(subscription_data);
42
- client = subscription_data->client;
43
- ogs_assert(client);
44
45
SubscriptionData = recvmsg->SubscriptionData;
46
if (!SubscriptionData) {
47
48
}
49
}
50
51
-bool ogs_nnrf_handle_nf_status_notify(
52
+bool ogs_nnrf_nfm_handle_nf_status_notify(
53
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg)
54
{
55
int rv;
56
57
message.h.resource.component1);
58
}
59
60
- ogs_sbi_nnrf_handle_nf_profile(nf_instance, NFProfile);
61
+ ogs_nnrf_nfm_handle_nf_profile(nf_instance, NFProfile);
62
63
ogs_info("%s (NRF-notify) NF Profile updated", nf_instance->id);
64
65
66
return true;
67
}
68
69
-void ogs_nnrf_handle_nf_discover_search_result(
70
+void ogs_nnrf_disc_handle_nf_discover_search_result(
71
OpenAPI_search_result_t *SearchResult)
72
{
73
OpenAPI_lnode_t *node = NULL;
74
75
}
76
77
if (NF_INSTANCE_ID_IS_OTHERS(nf_instance->id)) {
78
- ogs_sbi_nnrf_handle_nf_profile(nf_instance, NFProfile);
79
+ ogs_nnrf_nfm_handle_nf_profile(nf_instance, NFProfile);
80
81
ogs_sbi_client_associate(nf_instance);
82
83
open5gs_2.4.11.tar.xz/lib/sbi/nnrf-handler.h -> open5gs_2.5.0.tar.xz/lib/sbi/nnrf-handler.h
Changed
25
1
2
extern "C" {
3
#endif
4
5
-void ogs_sbi_nnrf_handle_nf_register(
6
+void ogs_nnrf_nfm_handle_nf_register(
7
ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_message_t *recvmsg);
8
-void ogs_sbi_nnrf_handle_nf_profile(
9
+void ogs_nnrf_nfm_handle_nf_profile(
10
ogs_sbi_nf_instance_t *nf_instance, OpenAPI_nf_profile_t *NFProfile);
11
12
-void ogs_nnrf_handle_nf_status_subscribe(
13
+void ogs_nnrf_nfm_handle_nf_status_subscribe(
14
ogs_sbi_subscription_data_t *subscription_data,
15
ogs_sbi_message_t *recvmsg);
16
-bool ogs_nnrf_handle_nf_status_notify(
17
+bool ogs_nnrf_nfm_handle_nf_status_notify(
18
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg);
19
20
-void ogs_nnrf_handle_nf_discover_search_result(
21
+void ogs_nnrf_disc_handle_nf_discover_search_result(
22
OpenAPI_search_result_t *SearchResult);
23
24
#ifdef __cplusplus
25
open5gs_2.5.0.tar.xz/lib/sbi/nnrf-path.c
Added
134
1
2
+/*
3
+ * Copyright (C) 2022 by Sukchan Lee <acetcom@gmail.com>
4
+ *
5
+ * This file is part of Open5GS.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Affero General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+
21
+#include "ogs-sbi.h"
22
+
23
+bool ogs_nnrf_nfm_send_nf_register(ogs_sbi_nf_instance_t *nf_instance)
24
+{
25
+ bool rc;
26
+ ogs_sbi_request_t *request = NULL;
27
+
28
+ ogs_assert(nf_instance);
29
+
30
+ request = ogs_nnrf_nfm_build_register();
31
+ if (!request) {
32
+ ogs_error("No Request");
33
+ return false;
34
+ }
35
+
36
+ rc = ogs_sbi_send_notification_request(
37
+ OGS_SBI_SERVICE_TYPE_NNRF_NFM, NULL, request, nf_instance);
38
+ ogs_expect(rc == true);
39
+
40
+ ogs_sbi_request_free(request);
41
+
42
+ return rc;
43
+}
44
+
45
+bool ogs_nnrf_nfm_send_nf_update(ogs_sbi_nf_instance_t *nf_instance)
46
+{
47
+ bool rc;
48
+ ogs_sbi_request_t *request = NULL;
49
+
50
+ ogs_assert(nf_instance);
51
+
52
+ request = ogs_nnrf_nfm_build_update();
53
+ if (!request) {
54
+ ogs_error("No Request");
55
+ return false;
56
+ }
57
+
58
+ rc = ogs_sbi_send_notification_request(
59
+ OGS_SBI_SERVICE_TYPE_NNRF_NFM, NULL, request, nf_instance);
60
+ ogs_expect(rc == true);
61
+
62
+ ogs_sbi_request_free(request);
63
+
64
+ return rc;
65
+}
66
+
67
+bool ogs_nnrf_nfm_send_nf_de_register(ogs_sbi_nf_instance_t *nf_instance)
68
+{
69
+ bool rc;
70
+ ogs_sbi_request_t *request = NULL;
71
+
72
+ ogs_assert(nf_instance);
73
+
74
+ request = ogs_nnrf_nfm_build_de_register();
75
+ if (!request) {
76
+ ogs_error("No Request");
77
+ return false;
78
+ }
79
+
80
+ rc = ogs_sbi_send_notification_request(
81
+ OGS_SBI_SERVICE_TYPE_NNRF_NFM, NULL, request, nf_instance);
82
+ ogs_expect(rc == true);
83
+
84
+ ogs_sbi_request_free(request);
85
+
86
+ return rc;
87
+}
88
+
89
+bool ogs_nnrf_nfm_send_nf_status_subscribe(
90
+ ogs_sbi_subscription_data_t *subscription_data)
91
+{
92
+ bool rc;
93
+ ogs_sbi_request_t *request = NULL;
94
+
95
+ ogs_assert(subscription_data);
96
+
97
+ request = ogs_nnrf_nfm_build_status_subscribe(subscription_data);
98
+ if (!request) {
99
+ ogs_error("No Request");
100
+ return false;
101
+ }
102
+
103
+ rc = ogs_sbi_send_notification_request(
104
+ OGS_SBI_SERVICE_TYPE_NNRF_NFM, NULL, request, subscription_data);
105
+ ogs_expect(rc == true);
106
+
107
+ ogs_sbi_request_free(request);
108
+
109
+ return rc;
110
+}
111
+
112
+bool ogs_nnrf_nfm_send_nf_status_unsubscribe(
113
+ ogs_sbi_subscription_data_t *subscription_data)
114
+{
115
+ bool rc;
116
+ ogs_sbi_request_t *request = NULL;
117
+
118
+ ogs_assert(subscription_data);
119
+
120
+ request = ogs_nnrf_nfm_build_status_unsubscribe(subscription_data);
121
+ if (!request) {
122
+ ogs_error("No Request");
123
+ return false;
124
+ }
125
+
126
+ rc = ogs_sbi_send_notification_request(
127
+ OGS_SBI_SERVICE_TYPE_NNRF_NFM, NULL, request, subscription_data);
128
+ ogs_expect(rc == true);
129
+
130
+ ogs_sbi_request_free(request);
131
+
132
+ return rc;
133
+}
134
open5gs_2.5.0.tar.xz/lib/sbi/nnrf-path.h
Added
47
1
2
+/*
3
+ * Copyright (C) 2022 by Sukchan Lee <acetcom@gmail.com>
4
+ *
5
+ * This file is part of Open5GS.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Affero General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+
21
+#ifndef OGS_NNRF_PATH_H
22
+#define OGS_NNRF_PATH_H
23
+
24
+#include "nnrf-build.h"
25
+
26
+#ifdef __cplusplus
27
+extern "C" {
28
+#endif
29
+
30
+bool ogs_nnrf_nfm_send_nf_register(ogs_sbi_nf_instance_t *nf_instance);
31
+bool ogs_nnrf_nfm_send_nf_update(ogs_sbi_nf_instance_t *nf_instance);
32
+bool ogs_nnrf_nfm_send_nf_de_register(ogs_sbi_nf_instance_t *nf_instance);
33
+bool ogs_nnrf_nfm_send_nf_status_subscribe(
34
+ ogs_sbi_subscription_data_t *subscription_data);
35
+bool ogs_nnrf_nfm_send_nf_status_unsubscribe(
36
+ ogs_sbi_subscription_data_t *subscription_data);
37
+
38
+bool ogs_nnrf_nfm_send_to_nrf(
39
+ ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
40
+ ogs_sbi_request_t *request, void *data);
41
+
42
+#ifdef __cplusplus
43
+}
44
+#endif
45
+
46
+#endif /* OGS_NNRF_PATH_H */
47
open5gs_2.4.11.tar.xz/lib/sbi/ogs-sbi.h -> open5gs_2.5.0.tar.xz/lib/sbi/ogs-sbi.h
Changed
25
1
2
/*
3
- * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
5
*
6
* This file is part of Open5GS.
7
*
8
9
#include "model/sm_policy_notification.h"
10
#include "model/termination_notification.h"
11
#include "model/deregistration_data.h"
12
+#include "model/sdm_subscription.h"
13
+#include "model/modification_notification.h"
14
15
#include "custom/links.h"
16
#include "custom/ue_authentication_ctx.h"
17
18
19
#include "sbi/nnrf-build.h"
20
#include "sbi/nnrf-handler.h"
21
+#include "sbi/nnrf-path.h"
22
23
#include "sbi/path.h"
24
25
open5gs_2.4.11.tar.xz/lib/sbi/path.c -> open5gs_2.5.0.tar.xz/lib/sbi/path.c
Changed
201
1
2
/*
3
- * Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
5
*
6
* This file is part of Open5GS.
7
*
8
9
10
#include "ogs-sbi.h"
11
12
-bool ogs_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance,
13
- ogs_sbi_client_cb_f client_cb, ogs_sbi_xact_t *xact)
14
+static void build_default_discovery_parameter(
15
+ ogs_sbi_request_t *request,
16
+ ogs_sbi_service_type_e service_type,
17
+ ogs_sbi_discovery_option_t *discovery_option);
18
+
19
+int ogs_sbi_server_handler(ogs_sbi_request_t *request, void *data)
20
{
21
- ogs_sbi_request_t *request = NULL;
22
- ogs_sbi_client_t *client = NULL;
23
+ ogs_event_t *e = NULL;
24
+ int rv;
25
+
26
+ ogs_assert(request);
27
+ ogs_assert(data);
28
+
29
+ e = ogs_event_new(OGS_EVENT_SBI_SERVER);
30
+ ogs_assert(e);
31
+
32
+ e->sbi.request = request;
33
+ e->sbi.data = data;
34
+
35
+ rv = ogs_queue_push(ogs_app()->queue, e);
36
+ if (rv != OGS_OK) {
37
+ ogs_error("ogs_queue_push() failed:%d", (int)rv);
38
+ ogs_sbi_request_free(request);
39
+ ogs_event_free(e);
40
+ return OGS_ERROR;
41
+ }
42
+
43
+ return OGS_OK;
44
+}
45
+
46
+int ogs_sbi_client_handler(
47
+ int status, ogs_sbi_response_t *response, void *data)
48
+{
49
+ ogs_event_t *e = NULL;
50
+ int rv;
51
+
52
+ if (status != OGS_OK) {
53
+ ogs_log_message(
54
+ status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0,
55
+ "ogs_sbi_client_handler() failed %d", status);
56
+ return OGS_ERROR;
57
+ }
58
+
59
+ ogs_assert(response);
60
+
61
+ e = ogs_event_new(OGS_EVENT_SBI_CLIENT);
62
+ ogs_assert(e);
63
+ e->sbi.response = response;
64
+ e->sbi.data = data;
65
+
66
+ rv = ogs_queue_push(ogs_app()->queue, e);
67
+ if (rv != OGS_OK) {
68
+ ogs_error("ogs_queue_push() failed:%d", (int)rv);
69
+ ogs_sbi_response_free(response);
70
+ ogs_event_free(e);
71
+ return OGS_ERROR;
72
+ }
73
+
74
+ return OGS_OK;
75
+}
76
+
77
+static int client_discover_cb(
78
+ int status, ogs_sbi_response_t *response, void *data)
79
+{
80
+ int rv;
81
+ ogs_event_t *e = NULL;
82
+
83
+ ogs_sbi_xact_t *xact = NULL;
84
ogs_sbi_object_t *sbi_object = NULL;
85
+ ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL;
86
+ OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
87
+ OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
88
89
+ ogs_hash_index_t *hi = NULL;
90
+ char *producer_id = NULL;
91
+
92
+ xact = data;
93
ogs_assert(xact);
94
+
95
+ xact = ogs_sbi_xact_cycle(xact);
96
+ if (!xact) {
97
+ ogs_error("SBI transaction has already been removed");
98
+ if (response)
99
+ ogs_sbi_response_free(response);
100
+ return OGS_ERROR;
101
+ }
102
+
103
sbi_object = xact->sbi_object;
104
ogs_assert(sbi_object);
105
- request = xact->request;
106
- ogs_assert(request);
107
+ service_type = xact->service_type;
108
+ ogs_assert(service_type);
109
+ target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
110
+ requester_nf_type = xact->requester_nf_type;
111
+ ogs_assert(requester_nf_type);
112
113
- ogs_assert(nf_instance);
114
+ if (status != OGS_OK) {
115
+ ogs_log_message(
116
+ status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0,
117
+ "ogs_sbi_client_handler() failed %d", status);
118
+ ogs_sbi_xact_remove(xact);
119
+ return OGS_ERROR;
120
+ }
121
122
- if (request->h.uri == NULL) {
123
- client = ogs_sbi_client_find_by_service_name(nf_instance,
124
- request->h.service.name, request->h.api.version);
125
- if (!client) {
126
- ogs_error("%s:%s Cannot find client %s:%s",
127
- OpenAPI_nf_type_ToString(nf_instance->nf_type),
128
- nf_instance->id,
129
- request->h.service.name, request->h.api.version);
130
- return false;
131
- }
132
- } else {
133
- ogs_sockaddr_t *addr = NULL;
134
- char bufOGS_ADDRSTRLEN;
135
+ ogs_assert(response);
136
137
- addr = ogs_sbi_getaddr_from_uri(request->h.uri);
138
- if (!addr) {
139
- ogs_error("%s:%s Invalid URL %s",
140
- OpenAPI_nf_type_ToString(nf_instance->nf_type),
141
- nf_instance->id, request->h.uri);
142
- return false;
143
+ /* Check if 3gpp-Sbi-Producer-Id in HTTP2 Header */
144
+ for (hi = ogs_hash_first(response->http.headers);
145
+ hi; hi = ogs_hash_next(hi)) {
146
+ if (!ogs_strcasecmp(ogs_hash_this_key(hi), OGS_SBI_CUSTOM_PRODUCER_ID)) {
147
+ producer_id = ogs_hash_this_val(hi);
148
+ break;
149
}
150
- client = ogs_sbi_client_find(addr);
151
- if (!client) {
152
- ogs_error("%s:%s Cannot find client %s:%d",
153
- OpenAPI_nf_type_ToString(nf_instance->nf_type),
154
- nf_instance->id,
155
- OGS_ADDR(addr, buf), OGS_PORT(addr));
156
- ogs_freeaddrinfo(addr);
157
- return false;
158
+ }
159
+
160
+ /* Added newly discovered NF Instance */
161
+ if (producer_id) {
162
+ ogs_sbi_nf_instance_t *nf_instance =
163
+ ogs_sbi_nf_instance_find(producer_id);
164
+ if (!nf_instance) {
165
+ nf_instance = ogs_sbi_nf_instance_add();
166
+ ogs_assert(nf_instance);
167
+
168
+ ogs_sbi_nf_instance_set_id(nf_instance, producer_id);
169
+ ogs_sbi_nf_instance_set_type(nf_instance, target_nf_type);
170
}
171
- ogs_freeaddrinfo(addr);
172
+
173
+ OGS_SBI_SETUP_NF_INSTANCE(
174
+ sbi_object->service_type_arrayservice_type, nf_instance);
175
}
176
177
- /* ogs_sbi_xact_remove() will call ogs_sbi_request_free()
178
- * As such, we'll use ogs_sbi_client_send_reqmem_persistent() */
179
- ogs_expect_or_return_val(true ==
180
- ogs_sbi_scp_send_reqmem_persistent(
181
- client, client_cb, request, xact), false);
182
+ e = ogs_event_new(OGS_EVENT_SBI_CLIENT);
183
+ ogs_assert(e);
184
+ e->sbi.response = response;
185
+ e->sbi.data = data;
186
+
187
+ rv = ogs_queue_push(ogs_app()->queue, e);
188
+ if (rv != OGS_OK) {
189
+ ogs_error("ogs_queue_push() failed:%d", (int)rv);
190
+ ogs_sbi_response_free(response);
191
+ ogs_event_free(e);
192
+ return OGS_ERROR;
193
+ }
194
195
- return true;
196
+ return OGS_OK;
197
}
198
199
-bool ogs_sbi_discover_only(
200
- ogs_sbi_xact_t *xact, ogs_sbi_client_cb_f client_cb)
201
open5gs_2.4.11.tar.xz/lib/sbi/path.h -> open5gs_2.5.0.tar.xz/lib/sbi/path.h
Changed
54
1
2
/*
3
- * Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
5
*
6
* This file is part of Open5GS.
7
*
8
9
extern "C" {
10
#endif
11
12
-bool ogs_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance,
13
- ogs_sbi_client_cb_f client_cb, ogs_sbi_xact_t *xact);
14
-bool ogs_sbi_discover_only(
15
- ogs_sbi_xact_t *xact, ogs_sbi_client_cb_f client_cb);
16
-bool ogs_sbi_discover_and_send(
17
- ogs_sbi_xact_t *xact, ogs_sbi_client_cb_f client_cb);
18
-
19
-bool ogs_nnrf_nfm_send_nf_register(ogs_sbi_nf_instance_t *nf_instance);
20
-bool ogs_nnrf_nfm_send_nf_update(ogs_sbi_nf_instance_t *nf_instance);
21
-bool ogs_nnrf_nfm_send_nf_de_register(ogs_sbi_nf_instance_t *nf_instance);
22
-bool ogs_nnrf_nfm_send_nf_profile_retrieve(ogs_sbi_nf_instance_t *nf_instance,
23
- char *nf_instance_id, void *data);
24
-
25
-bool ogs_nnrf_nfm_send_nf_status_subscribe(
26
- ogs_sbi_subscription_data_t *subscription_data);
27
-bool ogs_nnrf_nfm_send_nf_status_unsubscribe(
28
- ogs_sbi_subscription_data_t *subscription_data);
29
-
30
-bool ogs_nnrf_disc_send_nf_discover(
31
- ogs_sbi_nf_instance_t *nf_instance,
32
- OpenAPI_nf_type_e target_nf_type,
33
+int ogs_sbi_server_handler(ogs_sbi_request_t *request, void *data);
34
+int ogs_sbi_client_handler(
35
+ int status, ogs_sbi_response_t *response, void *data);
36
+
37
+bool ogs_sbi_discover_and_send(ogs_sbi_xact_t *xact);
38
+bool ogs_sbi_discover_only(ogs_sbi_xact_t *xact);
39
+
40
+bool ogs_sbi_send_request_to_nf_instance(
41
+ ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact);
42
+bool ogs_sbi_send_request_to_client(
43
+ ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
44
+ ogs_sbi_request_t *request, void *data);
45
+bool ogs_sbi_send_notification_request(
46
+ ogs_sbi_service_type_e service_type,
47
ogs_sbi_discovery_option_t *discovery_option,
48
- void *data);
49
-
50
+ ogs_sbi_request_t *request, void *data);
51
52
#define ogs_sbi_send_http_status_no_content(__sTREAM) \
53
ogs_sbi_send_response(__sTREAM, OGS_SBI_HTTP_STATUS_NO_CONTENT)
54
open5gs_2.4.11.tar.xz/meson.build -> open5gs_2.5.0.tar.xz/meson.build
Changed
19
1
2
# along with this program. If not, see <https://www.gnu.org/licenses/>.
3
4
project('open5gs', 'c', 'cpp',
5
- version : '2.4.11',
6
+ version : '2.5.0',
7
license : 'AGPL-3.0-or-later',
8
meson_version : '>= 0.43.0',
9
default_options :
10
11
,
12
)
13
14
-libogslib_version = '2.4.11'
15
+libogslib_version = '2.5.0'
16
17
prefix = get_option('prefix')
18
bindir = join_paths(prefix, get_option('bindir'))
19
open5gs_2.4.11.tar.xz/misc/netconf.sh -> open5gs_2.5.0.tar.xz/misc/netconf.sh
Changed
10
1
2
ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255
3
ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255
4
ifconfig lo0 alias 127.0.1.10 netmask 255.255.255.255
5
+ ifconfig lo0 alias 127.0.1.11 netmask 255.255.255.255
6
+ ifconfig lo0 alias 127.0.1.12 netmask 255.255.255.255
7
if "$SYSTEM" = "Darwin" ; then
8
if ! test -f /etc/pf.anchors/org.open5gs; then
9
sudo sh -c "echo 'nat on {en0} from 10.45.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
10
open5gs_2.4.11.tar.xz/src/amf/amf-sm.c -> open5gs_2.5.0.tar.xz/src/amf/amf-sm.c
Changed
48
1
2
CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY)
3
SWITCH(sbi_message.h.method)
4
CASE(OGS_SBI_HTTP_METHOD_POST)
5
- ogs_nnrf_handle_nf_status_notify(stream, &sbi_message);
6
+ ogs_nnrf_nfm_handle_nf_status_notify(stream, &sbi_message);
7
break;
8
9
DEFAULT
10
11
amf_namf_callback_handle_dereg_notify(stream, &sbi_message);
12
break;
13
14
+ CASE(OGS_SBI_RESOURCE_NAME_SDMSUBSCRIPTION_NOTIFY)
15
+ amf_namf_callback_handle_sdm_data_change_notify(
16
+ stream, &sbi_message);
17
+ break;
18
+
19
CASE(OGS_SBI_RESOURCE_NAME_AM_POLICY_NOTIFY)
20
ogs_assert(true == ogs_sbi_send_http_status_no_content(stream));
21
break;
22
23
CASE(OGS_SBI_HTTP_METHOD_POST)
24
if (sbi_message.res_status == OGS_SBI_HTTP_STATUS_CREATED ||
25
sbi_message.res_status == OGS_SBI_HTTP_STATUS_OK) {
26
- ogs_nnrf_handle_nf_status_subscribe(
27
+ ogs_nnrf_nfm_handle_nf_status_subscribe(
28
subscription_data, &sbi_message);
29
} else {
30
ogs_error("%s HTTP response error %d",
31
32
amf_ue = amf_ue_find_by_message(&nas_message);
33
if (!amf_ue) {
34
amf_ue = amf_ue_add(ran_ue);
35
- ogs_assert(amf_ue);
36
+ if (amf_ue == NULL) {
37
+ ogs_expect(OGS_OK ==
38
+ ngap_send_ran_ue_context_release_command(ran_ue,
39
+ NGAP_Cause_PR_misc,
40
+ NGAP_CauseMisc_control_processing_overload,
41
+ NGAP_UE_CTX_REL_NG_CONTEXT_REMOVE, 0));
42
+ ogs_pkbuf_free(pkbuf);
43
+ return;
44
+ }
45
} else {
46
/* Here, if the AMF_UE Context is found,
47
* the integrity check is not performed
48
open5gs_2.4.11.tar.xz/src/amf/context.c -> open5gs_2.5.0.tar.xz/src/amf/context.c
Changed
87
1
2
ogs_pool_init(&amf_ue_pool, ogs_app()->max.ue);
3
ogs_pool_init(&ran_ue_pool, ogs_app()->max.ue);
4
ogs_pool_init(&amf_sess_pool, ogs_app()->pool.sess);
5
- ogs_pool_init(&self.m_tmsi, ogs_app()->max.ue);
6
+ ogs_pool_init(&self.m_tmsi, ogs_app()->max.ue*2);
7
8
ogs_list_init(&self.gnb_list);
9
ogs_list_init(&self.amf_ue_list);
10
11
ogs_assert(gnb);
12
13
ogs_pool_alloc(&ran_ue_pool, &ran_ue);
14
- ogs_assert(ran_ue);
15
+ if (ran_ue == NULL) {
16
+ ogs_error("Could not allocate ran_ue context from pool");
17
+ return NULL;
18
+ }
19
+
20
memset(ran_ue, 0, sizeof *ran_ue);
21
22
ran_ue->t_ng_holding = ogs_timer_add(
23
24
ogs_assert(gnb);
25
26
ogs_pool_alloc(&amf_ue_pool, &amf_ue);
27
- ogs_assert(amf_ue);
28
+ if (amf_ue == NULL) {
29
+ ogs_error("Could not allocate amf_ue context from pool");
30
+ return NULL;
31
+ }
32
+
33
memset(amf_ue, 0, sizeof *amf_ue);
34
35
/* Add All Timers */
36
37
38
if (amf_ue->policy_association_id)
39
ogs_free(amf_ue->policy_association_id);
40
+ if (amf_ue->data_change_subscription_id)
41
+ ogs_free(amf_ue->data_change_subscription_id);
42
43
if (amf_ue->confirmation_url_for_5g_aka)
44
ogs_free(amf_ue->confirmation_url_for_5g_aka);
45
46
void amf_sbi_select_nf(
47
ogs_sbi_object_t *sbi_object,
48
ogs_sbi_service_type_e service_type,
49
+ OpenAPI_nf_type_e requester_nf_type,
50
ogs_sbi_discovery_option_t *discovery_option)
51
{
52
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
53
54
ogs_assert(service_type);
55
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
56
ogs_assert(target_nf_type);
57
+ ogs_assert(requester_nf_type);
58
59
switch(sbi_object->type) {
60
case OGS_SBI_OBJ_UE_TYPE:
61
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
62
- target_nf_type, discovery_option);
63
+ target_nf_type, requester_nf_type, discovery_option);
64
if (nf_instance)
65
OGS_SBI_SETUP_NF_INSTANCE(
66
sbi_object->service_type_arrayservice_type, nf_instance);
67
68
69
ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) {
70
if (ogs_sbi_discovery_param_is_matched(
71
- nf_instance, target_nf_type, discovery_option) == false)
72
+ nf_instance,
73
+ target_nf_type, requester_nf_type, discovery_option) ==
74
+ false)
75
continue;
76
77
nf_info = ogs_sbi_nf_info_find(
78
79
int index = 0;
80
81
ogs_trace("M-TMSI Pool try to generate...");
82
- for (i = 0; index < ogs_app()->max.ue; i++) {
83
+ for (i = 0; index < ogs_app()->max.ue*2; i++) {
84
amf_m_tmsi_t *m_tmsi = NULL;
85
int conflict = 0;
86
87
open5gs_2.4.11.tar.xz/src/amf/context.h -> open5gs_2.5.0.tar.xz/src/amf/context.h
Changed
19
1
2
/* Network Initiated De-Registration */
3
bool network_initiated_de_reg;
4
5
+ /* SubscriptionId of Subscription to Data Change Notification to UDM */
6
+ char *data_change_subscription_id;
7
+
8
ogs_list_t sess_list;
9
};
10
11
12
void amf_sbi_select_nf(
13
ogs_sbi_object_t *sbi_object,
14
ogs_sbi_service_type_e service_type,
15
+ OpenAPI_nf_type_e requester_nf_type,
16
ogs_sbi_discovery_option_t *discovery_option);
17
18
#define AMF_SESSION_SYNC_DONE(__aMF, __sTATE) \
19
open5gs_2.4.11.tar.xz/src/amf/event.h -> open5gs_2.5.0.tar.xz/src/amf/event.h
Changed
10
1
2
ogs_timer_t *timer;
3
} amf_event_t;
4
5
+OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(amf_event_t));
6
+
7
amf_event_t *amf_event_new(int id);
8
9
const char *amf_event_get_name(amf_event_t *e);
10
open5gs_2.4.11.tar.xz/src/amf/gmm-handler.c -> open5gs_2.5.0.tar.xz/src/amf/gmm-handler.c
Changed
16
1
2
nf_instance = sess->sbi.
3
service_type_arrayservice_type.nf_instance;
4
if (!nf_instance) {
5
- nf_instance =
6
- ogs_sbi_nf_instance_find_by_service_type(service_type);
7
+ OpenAPI_nf_type_e requester_nf_type =
8
+ NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance);
9
+ ogs_assert(requester_nf_type);
10
+
11
+ nf_instance = ogs_sbi_nf_instance_find_by_service_type(
12
+ service_type, requester_nf_type);
13
if (nf_instance)
14
OGS_SBI_SETUP_NF_INSTANCE(
15
sess->sbi.service_type_arrayservice_type,
16
open5gs_2.4.11.tar.xz/src/amf/gmm-sm.c -> open5gs_2.5.0.tar.xz/src/amf/gmm-sm.c
Changed
20
1
2
SWITCH(sbi_message->h.resource.component1)
3
CASE(OGS_SBI_RESOURCE_NAME_REGISTRATIONS)
4
if (sbi_message->res_status != OGS_SBI_HTTP_STATUS_CREATED &&
5
+ sbi_message->res_status != OGS_SBI_HTTP_STATUS_NO_CONTENT &&
6
sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) {
7
ogs_error("%s HTTP response error %d",
8
amf_ue->supi, sbi_message->res_status);
9
10
CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
11
CASE(OGS_SBI_RESOURCE_NAME_SMF_SELECT_DATA)
12
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)
13
- if (sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) {
14
+ CASE(OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS)
15
+ if ((sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) &&
16
+ (sbi_message->res_status != OGS_SBI_HTTP_STATUS_CREATED)) {
17
ogs_error("%s HTTP response error %d",
18
amf_ue->supi, sbi_message->res_status);
19
ogs_assert(OGS_OK ==
20
open5gs_2.4.11.tar.xz/src/amf/namf-handler.c -> open5gs_2.5.0.tar.xz/src/amf/namf-handler.c
Changed
116
1
2
3
return OGS_OK;
4
}
5
+
6
+int amf_namf_callback_handle_sdm_data_change_notify(
7
+ ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg)
8
+{
9
+ int status = OGS_SBI_HTTP_STATUS_NO_CONTENT;
10
+
11
+ amf_ue_t *amf_ue = NULL;
12
+
13
+ ogs_sbi_message_t sendmsg;
14
+ ogs_sbi_response_t *response = NULL;
15
+
16
+ OpenAPI_modification_notification_t *ModificationNotification;
17
+ OpenAPI_lnode_t *node;
18
+
19
+ char *ueid = NULL;
20
+ char *res_name = NULL;
21
+
22
+ ogs_assert(stream);
23
+ ogs_assert(recvmsg);
24
+
25
+ ModificationNotification = recvmsg->ModificationNotification;
26
+ if (!ModificationNotification) {
27
+ status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
28
+ ogs_error("%s No ModificationNotification", amf_ue->supi);
29
+ goto cleanup;
30
+ }
31
+
32
+
33
+ OpenAPI_list_for_each(ModificationNotification->notify_items, node)
34
+ {
35
+ OpenAPI_notify_item_t *item = node->data;
36
+
37
+ char *saveptr = NULL;
38
+
39
+ ueid = ogs_sbi_parse_uri(item->resource_id, "/", &saveptr);
40
+ if (!ueid) {
41
+ status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
42
+ ogs_error("%s No UeId", item->resource_id);
43
+ goto cleanup;
44
+ }
45
+
46
+ amf_ue = amf_ue_find_by_supi(ueid);
47
+ if (!amf_ue) {
48
+ status = OGS_SBI_HTTP_STATUS_NOT_FOUND;
49
+ ogs_error("Cannot find SUPI %s", ueid);
50
+ goto cleanup;
51
+ }
52
+
53
+ res_name = ogs_sbi_parse_uri(NULL, "/", &saveptr);
54
+ if (!res_name) {
55
+ status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
56
+ ogs_error("%s No Resource Name", item->resource_id);
57
+ goto cleanup;
58
+ }
59
+
60
+ SWITCH(res_name)
61
+ CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
62
+ OpenAPI_lnode_t *node_ci;
63
+
64
+ OpenAPI_list_for_each(item->changes, node_ci)
65
+ {
66
+ /*
67
+ OpenAPI_change_item_t *item_change = node_ci->data;
68
+ item_change->path;
69
+ item_change->from;
70
+ item_change->new_value;
71
+ item_change->orig_value;
72
+ */
73
+ /*
74
+ switch (item_change->op) {
75
+ case OpenAPI_change_type_ADD:
76
+ break;
77
+ case OpenAPI_change_type_MOVE:
78
+ break;
79
+ case OpenAPI_change_type__REMOVE:
80
+ break;
81
+ case OpenAPI_change_type_REPLACE:
82
+ break;
83
+ default:
84
+ break;
85
+ }
86
+ */
87
+ }
88
+ break;
89
+ DEFAULT
90
+ status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
91
+ ogs_error("Unknown Resource Name: %s", res_name);
92
+ goto cleanup;
93
+ END
94
+
95
+ ogs_free(ueid);
96
+ ogs_free(res_name);
97
+
98
+ ueid = NULL;
99
+ res_name = NULL;
100
+ }
101
+
102
+cleanup:
103
+ if (ueid)
104
+ ogs_free(ueid);
105
+ if (res_name)
106
+ ogs_free(res_name);
107
+
108
+ memset(&sendmsg, 0, sizeof(sendmsg));
109
+
110
+ response = ogs_sbi_build_response(&sendmsg, status);
111
+ ogs_assert(response);
112
+ ogs_assert(true == ogs_sbi_server_send_response(stream, response));
113
+
114
+ return OGS_OK;
115
+}
116
open5gs_2.4.11.tar.xz/src/amf/namf-handler.h -> open5gs_2.5.0.tar.xz/src/amf/namf-handler.h
Changed
10
1
2
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg);
3
int amf_namf_callback_handle_dereg_notify(
4
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg);
5
+int amf_namf_callback_handle_sdm_data_change_notify(
6
+ ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg);
7
8
#ifdef __cplusplus
9
}
10
open5gs_2.4.11.tar.xz/src/amf/nausf-build.c -> open5gs_2.5.0.tar.xz/src/amf/nausf-build.c
Changed
47
1
2
AuthenticationInfo.supi_or_suci = amf_ue->suci;
3
AuthenticationInfo.serving_network_name =
4
ogs_serving_network_name_from_plmn_id(&amf_ue->nr_tai.plmn_id);
5
- ogs_expect_or_return_val(AuthenticationInfo.serving_network_name, NULL);
6
+ if (!AuthenticationInfo.serving_network_name) {
7
+ ogs_error("No serving_network_name");
8
+ goto end;
9
+ }
10
11
if (auts) {
12
memset(&ResynchronizationInfo, 0, sizeof(ResynchronizationInfo));
13
14
request = ogs_sbi_build_request(&message);
15
ogs_expect(request);
16
17
- ogs_free(AuthenticationInfo.serving_network_name);
18
+end:
19
+ if (AuthenticationInfo.serving_network_name)
20
+ ogs_free(AuthenticationInfo.serving_network_name);
21
22
return request;
23
}
24
25
message.h.uri = amf_ue->confirmation_url_for_5g_aka;
26
27
ConfirmationData = ogs_calloc(1, sizeof(*ConfirmationData));
28
- ogs_expect_or_return_val(ConfirmationData, NULL);
29
+ if (!ConfirmationData) {
30
+ ogs_error("No ConfirmationData");
31
+ goto end;
32
+ }
33
34
ogs_hex_to_ascii(amf_ue->xres_star, sizeof(amf_ue->xres_star),
35
xres_star_string, sizeof(xres_star_string));
36
37
request = ogs_sbi_build_request(&message);
38
ogs_expect(request);
39
40
- ogs_free(ConfirmationData);
41
+end:
42
+ if (ConfirmationData)
43
+ ogs_free(ConfirmationData);
44
45
return request;
46
}
47
open5gs_2.4.11.tar.xz/src/amf/ngap-handler.c -> open5gs_2.5.0.tar.xz/src/amf/ngap-handler.c
Changed
30
1
2
ran_ue = ran_ue_find_by_ran_ue_ngap_id(gnb, *RAN_UE_NGAP_ID);
3
if (!ran_ue) {
4
ran_ue = ran_ue_add(gnb, *RAN_UE_NGAP_ID);
5
- ogs_assert(ran_ue);
6
+ if (ran_ue == NULL) {
7
+ ogs_assert(OGS_OK ==
8
+ ngap_send_error_indication(gnb, NULL, NULL,
9
+ NGAP_Cause_PR_misc,
10
+ NGAP_CauseMisc_control_processing_overload));
11
+ return;
12
+ }
13
14
/* Find AMF_UE if 5G-S_TMSI included */
15
if (FiveG_S_TMSI) {
16
17
18
/* Target UE */
19
target_ue = ran_ue_add(target_gnb, INVALID_UE_NGAP_ID);
20
- ogs_assert(target_ue);
21
+ if (target_ue == NULL) {
22
+ ogs_assert(OGS_OK ==
23
+ ngap_send_error_indication2(amf_ue, NGAP_Cause_PR_misc,
24
+ NGAP_CauseMisc_control_processing_overload));
25
+ return;
26
+ }
27
28
/* Source UE - Target UE associated */
29
source_ue_associate_target_ue(source_ue, target_ue);
30
open5gs_2.4.11.tar.xz/src/amf/nnrf-build.c -> open5gs_2.5.0.tar.xz/src/amf/nnrf-build.c
Changed
9
1
2
message.param.discovery_option = discovery_option;
3
4
request = ogs_sbi_build_request(&message);
5
+ ogs_expect(request);
6
7
return request;
8
}
9
open5gs_2.4.11.tar.xz/src/amf/nnrf-handler.c -> open5gs_2.5.0.tar.xz/src/amf/nnrf-handler.c
Changed
31
1
2
ogs_sbi_nf_instance_t *nf_instance = NULL;
3
ogs_sbi_object_t *sbi_object = NULL;
4
ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL;
5
+ OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
6
ogs_sbi_discovery_option_t *discovery_option = NULL;
7
8
OpenAPI_search_result_t *SearchResult = NULL;
9
10
ogs_assert(sbi_object);
11
service_type = xact->service_type;
12
ogs_assert(service_type);
13
+ requester_nf_type = xact->requester_nf_type;
14
+ ogs_assert(requester_nf_type);
15
16
discovery_option = xact->discovery_option;
17
18
19
return;
20
}
21
22
- ogs_nnrf_handle_nf_discover_search_result(SearchResult);
23
+ ogs_nnrf_disc_handle_nf_discover_search_result(SearchResult);
24
25
- amf_sbi_select_nf(sbi_object, service_type, discovery_option);
26
+ amf_sbi_select_nf(sbi_object,
27
+ service_type, requester_nf_type, discovery_option);
28
29
nf_instance = sbi_object->service_type_arrayservice_type.nf_instance;
30
if (!nf_instance) {
31
open5gs_2.4.11.tar.xz/src/amf/nnssf-build.c -> open5gs_2.5.0.tar.xz/src/amf/nnssf-build.c
Changed
32
1
2
message.h.resource.component0 =
3
(char *)OGS_SBI_RESOURCE_NAME_NETWORK_SLICE_INFORMATION;
4
5
- ogs_assert(ogs_sbi_self()->nf_instance);
6
- message.param.nf_id = ogs_sbi_self()->nf_instance->id;
7
- message.param.nf_type = ogs_sbi_self()->nf_instance->nf_type;
8
+ message.param.nf_id = NF_INSTANCE_ID(ogs_sbi_self()->nf_instance);
9
+ if (!message.param.nf_id) {
10
+ ogs_error("No nf_id");
11
+ goto end;
12
+ }
13
+ message.param.nf_type = NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance);
14
+ if (!message.param.nf_type) {
15
+ ogs_error("No nf_type");
16
+ goto end;
17
+ }
18
19
message.param.slice_info_request_for_pdu_session_presence = true;
20
message.param.roaming_indication = OpenAPI_roaming_indication_NON_ROAMING;
21
22
sizeof(message.param.s_nssai));
23
24
request = ogs_sbi_build_request(&message);
25
- ogs_assert(request);
26
+ ogs_expect(request);
27
+
28
+end:
29
30
return request;
31
}
32
open5gs_2.4.11.tar.xz/src/amf/nnssf-handler.c -> open5gs_2.5.0.tar.xz/src/amf/nnssf-handler.c
Changed
71
1
2
{
3
amf_ue_t *amf_ue = NULL;
4
5
- ogs_sbi_client_t *client = NULL;
6
+ ogs_sbi_client_t *client = NULL, *scp_client = NULL;
7
ogs_sockaddr_t *addr = NULL;
8
9
OpenAPI_authorized_network_slice_info_t *AuthorizedNetworkSliceInfo = NULL;
10
11
sess->nssf.nrf.id = ogs_strdup(NsiInformation->nrf_id);
12
ogs_assert(sess->nssf.nrf.id);
13
14
- addr = ogs_sbi_getaddr_from_uri(NsiInformation->nrf_id);
15
- if (!addr) {
16
- ogs_error("%s:%d Invalid URI %s",
17
- amf_ue->supi, sess->psi, NsiInformation->nrf_id);
18
- ogs_assert(OGS_OK ==
19
- nas_5gs_send_gmm_reject_from_sbi(
20
- amf_ue, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR));
21
- return OGS_ERROR;;
22
- }
23
+ scp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance);
24
25
- client = ogs_sbi_client_find(addr);
26
- if (!client) {
27
- client = ogs_sbi_client_add(addr);
28
- ogs_assert(client);
29
- }
30
+ if (scp_client) {
31
+ amf_nsmf_pdusession_sm_context_param_t param;
32
+
33
+ memset(¶m, 0, sizeof(param));
34
+ param.nrf_uri.nrf.id = sess->nssf.nrf.id;
35
36
- OGS_SBI_SETUP_CLIENT(&sess->nssf.nrf, client);
37
+ amf_sess_sbi_discover_and_send(
38
+ OGS_SBI_SERVICE_TYPE_NSMF_PDUSESSION, NULL,
39
+ amf_nsmf_pdusession_build_create_sm_context,
40
+ sess, AMF_CREATE_SM_CONTEXT_NO_STATE, ¶m);
41
+ } else {
42
+ addr = ogs_sbi_getaddr_from_uri(NsiInformation->nrf_id);
43
+ if (!addr) {
44
+ ogs_error("%s:%d Invalid URI %s",
45
+ amf_ue->supi, sess->psi, NsiInformation->nrf_id);
46
+ ogs_assert(OGS_OK ==
47
+ nas_5gs_send_gmm_reject_from_sbi(
48
+ amf_ue, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR));
49
+ return OGS_ERROR;;
50
+ }
51
+
52
+ client = ogs_sbi_client_find(addr);
53
+ if (!client) {
54
+ client = ogs_sbi_client_add(addr);
55
+ ogs_assert(client);
56
+ }
57
58
- ogs_freeaddrinfo(addr);
59
+ OGS_SBI_SETUP_CLIENT(&sess->nssf.nrf, client);
60
61
- ogs_assert(true == amf_sess_sbi_discover_by_nsi(
62
- sess, OGS_SBI_SERVICE_TYPE_NSMF_PDUSESSION, NULL));
63
+ ogs_freeaddrinfo(addr);
64
+
65
+ ogs_assert(true == amf_sess_sbi_discover_by_nsi(
66
+ sess, OGS_SBI_SERVICE_TYPE_NSMF_PDUSESSION, NULL));
67
+ }
68
69
return OGS_OK;
70
}
71
open5gs_2.4.11.tar.xz/src/amf/npcf-build.c -> open5gs_2.5.0.tar.xz/src/amf/npcf-build.c
Changed
122
1
2
memset(&PolicyAssociationRequest, 0, sizeof(PolicyAssociationRequest));
3
4
server = ogs_list_first(&ogs_sbi_self()->server_list);
5
- ogs_expect_or_return_val(server, NULL);
6
+ if (!server) {
7
+ ogs_error("No server");
8
+ goto end;
9
+ }
10
11
memset(&header, 0, sizeof(header));
12
header.service.name = (char *)OGS_SBI_SERVICE_NAME_NAMF_CALLBACK;
13
14
(char *)OGS_SBI_RESOURCE_NAME_AM_POLICY_NOTIFY;
15
PolicyAssociationRequest.notification_uri =
16
ogs_sbi_server_uri(server, &header);
17
- ogs_expect_or_return_val(PolicyAssociationRequest.notification_uri, NULL);
18
+ if (!PolicyAssociationRequest.notification_uri) {
19
+ ogs_error("No notifiation_uri");
20
+ goto end;
21
+ }
22
23
PolicyAssociationRequest.supi = amf_ue->supi;
24
25
26
if (amf_ue->msisdn0) {
27
PolicyAssociationRequest.gpsi = ogs_msprintf("%s-%s",
28
OGS_ID_GPSI_TYPE_MSISDN, amf_ue->msisdn0);
29
- ogs_assert(PolicyAssociationRequest.gpsi);
30
+ if (!PolicyAssociationRequest.gpsi) {
31
+ ogs_error("No gpsi");
32
+ goto end;
33
+ }
34
}
35
}
36
37
38
memset(&ueLocation, 0, sizeof(ueLocation));
39
ueLocation.nr_location = ogs_sbi_build_nr_location(
40
&amf_ue->nr_tai, &amf_ue->nr_cgi);
41
- ogs_expect_or_return_val(ueLocation.nr_location, NULL);
42
+ if (!ueLocation.nr_location) {
43
+ ogs_error("No ueLocation.nr_location");
44
+ goto end;
45
+ }
46
ueLocation.nr_location->ue_location_timestamp =
47
ogs_sbi_gmtime_string(amf_ue->ue_location_timestamp);
48
- ogs_expect_or_return_val(
49
- ueLocation.nr_location->ue_location_timestamp, NULL);
50
+ if (!ueLocation.nr_location->ue_location_timestamp) {
51
+ ogs_error("No ueLocation.nr_location->ue_location_timestamp");
52
+ goto end;
53
+ }
54
PolicyAssociationRequest.user_loc = &ueLocation;
55
56
PolicyAssociationRequest.time_zone =
57
ogs_sbi_timezone_string(ogs_timezone());
58
- ogs_expect_or_return_val(PolicyAssociationRequest.time_zone, NULL);
59
+ if (!PolicyAssociationRequest.time_zone) {
60
+ ogs_error("No time_zone");
61
+ goto end;
62
+ }
63
64
PolicyAssociationRequest.serving_plmn =
65
ogs_sbi_build_plmn_id_nid(&amf_ue->nr_tai.plmn_id);
66
- ogs_expect_or_return_val(PolicyAssociationRequest.serving_plmn, NULL);
67
+ if (!PolicyAssociationRequest.serving_plmn) {
68
+ ogs_error("No serving_plmn");
69
+ goto end;
70
+ }
71
72
PolicyAssociationRequest.rat_type = amf_ue_rat_type(amf_ue);
73
74
75
76
for (i = 0; i < amf_ue->allowed_nssai.num_of_s_nssai; i++) {
77
struct OpenAPI_snssai_s *Snssai = ogs_calloc(1, sizeof(*Snssai));
78
- ogs_expect_or_return_val(Snssai, NULL);
79
+ if (!Snssai) {
80
+ ogs_error("No Snssai");
81
+ goto end;
82
+ }
83
84
Snssai->sst = amf_ue->allowed_nssai.s_nssaii.sst;
85
Snssai->sd = ogs_s_nssai_sd_to_string(
86
87
OpenAPI_list_free(AllowedSnssais);
88
89
PolicyAssociationRequest.guami = ogs_sbi_build_guami(amf_ue->guami);
90
- ogs_expect_or_return_val(PolicyAssociationRequest.guami, NULL);
91
+ if (!PolicyAssociationRequest.guami) {
92
+ ogs_error("No guami");
93
+ goto end;
94
+ }
95
96
PolicyAssociationRequest.service_name =
97
(char *)OGS_SBI_SERVICE_NAME_NAMF_CALLBACK;
98
99
PolicyAssociationRequest.supp_feat =
100
ogs_uint64_to_string(amf_ue->am_policy_control_features);
101
- ogs_expect_or_return_val(PolicyAssociationRequest.supp_feat, NULL);
102
+ if (!PolicyAssociationRequest.supp_feat) {
103
+ ogs_error("No supp_feat");
104
+ goto end;
105
+ }
106
107
message.PolicyAssociationRequest = &PolicyAssociationRequest;
108
109
request = ogs_sbi_build_request(&message);
110
ogs_expect(request);
111
112
- ogs_free(PolicyAssociationRequest.notification_uri);
113
- ogs_free(PolicyAssociationRequest.supp_feat);
114
+end:
115
+ if (PolicyAssociationRequest.notification_uri)
116
+ ogs_free(PolicyAssociationRequest.notification_uri);
117
+ if (PolicyAssociationRequest.supp_feat)
118
+ ogs_free(PolicyAssociationRequest.supp_feat);
119
120
if (PolicyAssociationRequest.gpsi)
121
ogs_free(PolicyAssociationRequest.gpsi);
122
open5gs_2.4.11.tar.xz/src/amf/nsmf-build.c -> open5gs_2.5.0.tar.xz/src/amf/nsmf-build.c
Changed
201
1
2
ogs_sbi_request_t *amf_nsmf_pdusession_build_create_sm_context(
3
amf_sess_t *sess, void *data)
4
{
5
+ amf_nsmf_pdusession_sm_context_param_t *param = data;
6
ogs_sbi_message_t message;
7
ogs_sbi_request_t *request = NULL;
8
9
10
11
memset(&SmContextCreateData, 0, sizeof(SmContextCreateData));
12
13
- ogs_assert(ogs_sbi_self()->nf_instance);
14
- SmContextCreateData.serving_nf_id = ogs_sbi_self()->nf_instance->id;
15
+ SmContextCreateData.serving_nf_id =
16
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance);
17
+ if (!SmContextCreateData.serving_nf_id) {
18
+ ogs_error("No serving_nf_id");
19
+ goto end;
20
+ }
21
22
SmContextCreateData.serving_network =
23
ogs_sbi_build_plmn_id_nid(&amf_ue->nr_tai.plmn_id);
24
- ogs_expect_or_return_val(SmContextCreateData.serving_network, NULL);
25
+ if (!SmContextCreateData.serving_nf_id) {
26
+ ogs_error("No serving_network");
27
+ goto end;
28
+ }
29
30
SmContextCreateData.supi = amf_ue->supi;
31
SmContextCreateData.pei = amf_ue->pei;
32
33
if (amf_ue->msisdn0) {
34
SmContextCreateData.gpsi = ogs_msprintf("%s-%s",
35
OGS_ID_GPSI_TYPE_MSISDN, amf_ue->msisdn0);
36
- ogs_expect_or_return_val(SmContextCreateData.gpsi, NULL);
37
+ if (!SmContextCreateData.gpsi) {
38
+ ogs_error("No gpsi");
39
+ goto end;
40
+ }
41
}
42
}
43
SmContextCreateData.is_pdu_session_id = true;
44
SmContextCreateData.pdu_session_id = sess->psi;
45
- ogs_expect_or_return_val(sess->dnn, NULL);
46
+ if (!SmContextCreateData.pdu_session_id) {
47
+ ogs_error("No pdu_session_id");
48
+ goto end;
49
+ }
50
SmContextCreateData.dnn = sess->dnn;
51
52
memset(&sNssai, 0, sizeof(sNssai));
53
54
}
55
56
SmContextCreateData.guami = ogs_sbi_build_guami(amf_ue->guami);
57
- ogs_expect_or_return_val(SmContextCreateData.guami, NULL);
58
+ if (!SmContextCreateData.guami) {
59
+ ogs_error("No guami");
60
+ goto end;
61
+ }
62
SmContextCreateData.an_type = amf_ue->nas.access_type;
63
64
memset(&header, 0, sizeof(header));
65
66
header.resource.component1 =
67
(char *)OGS_SBI_RESOURCE_NAME_SM_CONTEXT_STATUS;
68
header.resource.component2 = ogs_msprintf("%d", sess->psi);
69
- ogs_expect_or_return_val(header.resource.component2, NULL);
70
+ if (!header.resource.component2) {
71
+ ogs_error("No header.resource.component2");
72
+ goto end;
73
+ }
74
75
server = ogs_list_first(&ogs_sbi_self()->server_list);
76
- ogs_expect_or_return_val(server, NULL);
77
+ if (!server) {
78
+ ogs_error("No server");
79
+ goto end;
80
+ }
81
SmContextCreateData.sm_context_status_uri =
82
ogs_sbi_server_uri(server, &header);
83
84
85
memset(&ueLocation, 0, sizeof(ueLocation));
86
ueLocation.nr_location = ogs_sbi_build_nr_location(
87
&amf_ue->nr_tai, &amf_ue->nr_cgi);
88
- ogs_expect_or_return_val(ueLocation.nr_location, NULL);
89
+ if (!ueLocation.nr_location) {
90
+ ogs_error("No ueLocation.nr_location");
91
+ goto end;
92
+ }
93
ueLocation.nr_location->ue_location_timestamp =
94
ogs_sbi_gmtime_string(amf_ue->ue_location_timestamp);
95
- ogs_expect_or_return_val(
96
- ueLocation.nr_location->ue_location_timestamp, NULL);
97
+ if (!ueLocation.nr_location->ue_location_timestamp) {
98
+ ogs_error("No ue_location_timestamp");
99
+ goto end;
100
+ }
101
102
SmContextCreateData.ue_location = &ueLocation;
103
SmContextCreateData.ue_time_zone = ogs_sbi_timezone_string(ogs_timezone());
104
- ogs_expect_or_return_val(SmContextCreateData.ue_time_zone, NULL);
105
+ if (!SmContextCreateData.ue_time_zone) {
106
+ ogs_error("No ue_time_zone");
107
+ goto end;
108
+ }
109
110
pcf_nf_instance = amf_ue->sbi.service_type_array
111
OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL.nf_instance;
112
- ogs_expect_or_return_val(pcf_nf_instance, NULL);
113
+ if (!pcf_nf_instance) {
114
+ ogs_error("No pcf_nf_instance");
115
+ goto end;
116
+ }
117
SmContextCreateData.pcf_id = pcf_nf_instance->id;
118
119
message.SmContextCreateData = &SmContextCreateData;
120
121
message.http.accept = (char *)(OGS_SBI_CONTENT_JSON_TYPE ","
122
OGS_SBI_CONTENT_NGAP_TYPE "," OGS_SBI_CONTENT_PROBLEM_TYPE);
123
124
+ message.http.custom.callback =
125
+ (char *)OGS_SBI_CALLBACK_NSMF_PDUSESSION_STATUS_NOTIFY;
126
+
127
+ if (param && param->nrf_uri.nrf.id) {
128
+ message.http.custom.nrf_uri =
129
+ ogs_msprintf("%s: \"%s\"",
130
+ OGS_SBI_SERVICE_NAME_NNRF_DISC, param->nrf_uri.nrf.id);
131
+ }
132
+
133
request = ogs_sbi_build_request(&message);
134
ogs_expect(request);
135
136
+end:
137
+
138
if (SmContextCreateData.serving_network)
139
ogs_sbi_free_plmn_id_nid(SmContextCreateData.serving_network);
140
- ogs_free(SmContextCreateData.sm_context_status_uri);
141
- ogs_free(header.resource.component2);
142
+ if (SmContextCreateData.sm_context_status_uri)
143
+ ogs_free(SmContextCreateData.sm_context_status_uri);
144
+ if (header.resource.component2)
145
+ ogs_free(header.resource.component2);
146
if (sNssai.sd)
147
ogs_free(sNssai.sd);
148
if (hplmnSnssai.sd)
149
150
if (SmContextCreateData.ue_time_zone)
151
ogs_free(SmContextCreateData.ue_time_zone);
152
153
+ if (message.http.custom.nrf_uri)
154
+ ogs_free(message.http.custom.nrf_uri);
155
+
156
return request;
157
}
158
159
160
}
161
162
if (param->n2smbuf) {
163
- ogs_expect_or_return_val(param->n2SmInfoType, NULL);
164
+ if (!param->n2SmInfoType) {
165
+ ogs_error("No n2SmInfoType");
166
+ goto end;
167
+ }
168
SmContextUpdateData.n2_sm_info_type = param->n2SmInfoType;
169
SmContextUpdateData.n2_sm_info = &n2SmInfo;
170
171
172
if (param->TargetID) {
173
SmContextUpdateData.target_id =
174
amf_nsmf_pdusession_build_target_id(param->TargetID);
175
- ogs_expect_or_return_val(SmContextUpdateData.target_id, NULL);
176
+ if (!SmContextUpdateData.target_id) {
177
+ ogs_error("No target_id");
178
+ goto end;
179
+ }
180
}
181
182
if (param->ngApCause.group) {
183
184
if (param->ue_location) {
185
ueLocation.nr_location = ogs_sbi_build_nr_location(
186
&amf_ue->nr_tai, &amf_ue->nr_cgi);
187
- ogs_expect_or_return_val(ueLocation.nr_location, NULL);
188
+ if (!ueLocation.nr_location) {
189
+ ogs_error("No ueLocation.nr_location");
190
+ goto end;
191
+ }
192
ueLocation.nr_location->ue_location_timestamp =
193
ogs_sbi_gmtime_string(amf_ue->ue_location_timestamp);
194
- ogs_expect_or_return_val(
195
- ueLocation.nr_location->ue_location_timestamp, NULL);
196
+ if (!ueLocation.nr_location->ue_location_timestamp) {
197
+ ogs_error("No ueLocation.nr_location->ue_location_timestamp");
198
+ goto end;
199
+ }
200
201
open5gs_2.4.11.tar.xz/src/amf/nsmf-build.h -> open5gs_2.5.0.tar.xz/src/amf/nsmf-build.h
Changed
14
1
2
OpenAPI_ho_state_e hoState;
3
OpenAPI_ng_ran_target_id_t *targetId;
4
NGAP_TargetID_t *TargetID;
5
+
6
+ struct {
7
+ struct {
8
+ char *id;
9
+ } nrf;
10
+ } nrf_uri;
11
} amf_nsmf_pdusession_sm_context_param_t;
12
13
ogs_sbi_request_t *amf_nsmf_pdusession_build_create_sm_context(
14
open5gs_2.4.11.tar.xz/src/amf/nudm-build.c -> open5gs_2.5.0.tar.xz/src/amf/nudm-build.c
Changed
167
1
2
3
memset(&Amf3GppAccessRegistration, 0, sizeof(Amf3GppAccessRegistration));
4
5
- ogs_assert(ogs_sbi_self()->nf_instance);
6
- Amf3GppAccessRegistration.amf_instance_id = ogs_sbi_self()->nf_instance->id;
7
+ Amf3GppAccessRegistration.amf_instance_id =
8
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance);
9
+ if (!Amf3GppAccessRegistration.amf_instance_id) {
10
+ ogs_error("No amf_instance_id");
11
+ goto end;
12
+ }
13
14
server = ogs_list_first(&ogs_sbi_self()->server_list);
15
- ogs_assert(server);
16
+ if (!server) {
17
+ ogs_error("No server");
18
+ goto end;
19
+ }
20
21
memset(&header, 0, sizeof(header));
22
header.service.name = (char *)OGS_SBI_SERVICE_NAME_NAMF_CALLBACK;
23
24
header.resource.component1 = (char *)OGS_SBI_RESOURCE_NAME_DEREG_NOTIFY;
25
Amf3GppAccessRegistration.dereg_callback_uri =
26
ogs_sbi_server_uri(server, &header);
27
- ogs_assert(Amf3GppAccessRegistration.dereg_callback_uri);
28
+ if (!Amf3GppAccessRegistration.dereg_callback_uri) {
29
+ ogs_error("No dereg_callback_uri");
30
+ goto end;
31
+ }
32
33
Amf3GppAccessRegistration.guami = ogs_sbi_build_guami(amf_ue->guami);
34
Amf3GppAccessRegistration.rat_type = amf_ue_rat_type(amf_ue);
35
- ogs_assert(Amf3GppAccessRegistration.rat_type != OpenAPI_rat_type_NULL);
36
+ if (Amf3GppAccessRegistration.rat_type == OpenAPI_rat_type_NULL) {
37
+ ogs_error("No rat_type");
38
+ goto end;
39
+ }
40
41
message.Amf3GppAccessRegistration = &Amf3GppAccessRegistration;
42
43
+ message.http.custom.callback =
44
+ (char *)OGS_SBI_CALLBACK_NUDM_UECM_DEREGISTRATION_NOTIFICATION;
45
+
46
request = ogs_sbi_build_request(&message);
47
- ogs_assert(request);
48
+ ogs_expect(request);
49
+
50
+end:
51
52
if (Amf3GppAccessRegistration.guami)
53
ogs_sbi_free_guami(Amf3GppAccessRegistration.guami);
54
- ogs_free(Amf3GppAccessRegistration.dereg_callback_uri);
55
+ if (Amf3GppAccessRegistration.dereg_callback_uri)
56
+ ogs_free(Amf3GppAccessRegistration.dereg_callback_uri);
57
58
return request;
59
}
60
61
62
Amf3GppAccessRegistrationModification.guami =
63
ogs_sbi_build_guami(amf_ue->guami);
64
+ if (!Amf3GppAccessRegistrationModification.guami) {
65
+ ogs_error("No guami");
66
+ goto end;
67
+ }
68
Amf3GppAccessRegistrationModification.is_purge_flag = true;
69
Amf3GppAccessRegistrationModification.purge_flag = 1;
70
71
72
&Amf3GppAccessRegistrationModification;
73
74
request = ogs_sbi_build_request(&message);
75
- ogs_assert(request);
76
+ ogs_expect(request);
77
+
78
+end:
79
80
if (Amf3GppAccessRegistrationModification.guami)
81
ogs_sbi_free_guami(Amf3GppAccessRegistrationModification.guami);
82
83
message.h.resource.component1 = data;
84
85
request = ogs_sbi_build_request(&message);
86
- ogs_assert(request);
87
+ ogs_expect(request);
88
+
89
+ return request;
90
+}
91
+
92
+ogs_sbi_request_t *amf_nudm_sdm_build_subscription(amf_ue_t *amf_ue, void *data)
93
+{
94
+ ogs_sbi_message_t message;
95
+ ogs_sbi_header_t header;
96
+ ogs_sbi_request_t *request = NULL;
97
+ ogs_sbi_server_t *server = NULL;
98
+
99
+ OpenAPI_sdm_subscription_t SDMSubscription;
100
+
101
+ char *monres = NULL;
102
+
103
+ ogs_assert(amf_ue);
104
+ ogs_assert(amf_ue->supi);
105
+ ogs_assert(data);
106
+
107
+ memset(&message, 0, sizeof(message));
108
+ message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST;
109
+ message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NUDM_SDM;
110
+ message.h.api.version = (char *)OGS_SBI_API_V2;
111
+ message.h.resource.component0 = amf_ue->supi;
112
+ message.h.resource.component1 =
113
+ (char *)OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS;
114
+
115
+ memset(&SDMSubscription, 0, sizeof(SDMSubscription));
116
+
117
+ SDMSubscription.nf_instance_id =
118
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance);
119
+
120
+ server = ogs_list_first(&ogs_sbi_self()->server_list);
121
+ if (!server) {
122
+ ogs_error("No server");
123
+ goto end;
124
+ }
125
+
126
+ memset(&header, 0, sizeof(header));
127
+ header.service.name = (char *)OGS_SBI_SERVICE_NAME_NAMF_CALLBACK;
128
+ header.api.version = (char *)OGS_SBI_API_V1;
129
+ header.resource.component0 = amf_ue->supi;
130
+ header.resource.component1 =
131
+ (char *)OGS_SBI_RESOURCE_NAME_SDMSUBSCRIPTION_NOTIFY;
132
+ SDMSubscription.callback_reference = ogs_sbi_server_uri(server, &header);
133
+ if (!SDMSubscription.callback_reference) {
134
+ ogs_error("No callback_reference");
135
+ goto end;
136
+ }
137
+
138
+ SDMSubscription.monitored_resource_uris = OpenAPI_list_create();
139
+
140
+ monres = ogs_msprintf("%s/%s", amf_ue->supi, (char *)data);
141
+ if (!monres) {
142
+ ogs_error("No monres");
143
+ goto end;
144
+ }
145
+
146
+ OpenAPI_list_add(SDMSubscription.monitored_resource_uris, monres);
147
+ SDMSubscription.implicit_unsubscribe = 1;
148
+
149
+ message.SDMSubscription = &SDMSubscription;
150
+
151
+ message.http.custom.callback =
152
+ (char *)OGS_SBI_CALLBACK_NUDM_SDM_NOTIFICATION;
153
+
154
+ request = ogs_sbi_build_request(&message);
155
+ ogs_expect(request);
156
+
157
+end:
158
+
159
+ if (monres)
160
+ ogs_free(monres);
161
+ OpenAPI_list_free(SDMSubscription.monitored_resource_uris);
162
+ if (SDMSubscription.callback_reference)
163
+ ogs_free(SDMSubscription.callback_reference);
164
165
return request;
166
}
167
open5gs_2.4.11.tar.xz/src/amf/nudm-build.h -> open5gs_2.5.0.tar.xz/src/amf/nudm-build.h
Changed
10
1
2
ogs_sbi_request_t *amf_nudm_uecm_build_registration_delete(
3
amf_ue_t *amf_ue, void *data);
4
ogs_sbi_request_t *amf_nudm_sdm_build_get(amf_ue_t *amf_ue, void *data);
5
+ogs_sbi_request_t *amf_nudm_sdm_build_subscription(
6
+ amf_ue_t *amf_ue, void *data);
7
8
#ifdef __cplusplus
9
}
10
open5gs_2.4.11.tar.xz/src/amf/nudm-handler.c -> open5gs_2.5.0.tar.xz/src/amf/nudm-handler.c
Changed
71
1
2
break;
3
4
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)
5
+
6
+ if (amf_ue->data_change_subscription_id) {
7
+ /* we already have a SDM subscription to UDM; continue without
8
+ * subscribing again */
9
+ ogs_assert(true ==
10
+ amf_ue_sbi_discover_and_send(
11
+ OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL, NULL,
12
+ amf_npcf_am_policy_control_build_create, amf_ue, NULL));
13
+ }
14
+ else {
15
+ ogs_assert(true ==
16
+ amf_ue_sbi_discover_and_send(
17
+ OGS_SBI_SERVICE_TYPE_NUDM_SDM, NULL,
18
+ amf_nudm_sdm_build_subscription, amf_ue,
19
+ (char *)OGS_SBI_RESOURCE_NAME_AM_DATA));
20
+ }
21
+ break;
22
+
23
+ CASE(OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS)
24
+
25
+ int rv;
26
+ ogs_sbi_message_t message;
27
+ ogs_sbi_header_t header;
28
+
29
+ if (!recvmsg->http.location) {
30
+ ogs_error("%s No http.location", amf_ue->supi);
31
+ ogs_assert(OGS_OK ==
32
+ nas_5gs_send_gmm_reject_from_sbi(
33
+ amf_ue, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR));
34
+ return OGS_ERROR;
35
+ }
36
+
37
+ memset(&header, 0, sizeof(header));
38
+ header.uri = recvmsg->http.location;
39
+
40
+ rv = ogs_sbi_parse_header(&message, &header);
41
+ if (rv != OGS_OK) {
42
+ ogs_error("%s Cannot parse http.location %s",
43
+ amf_ue->supi, recvmsg->http.location);
44
+ ogs_assert(OGS_OK ==
45
+ nas_5gs_send_gmm_reject_from_sbi(
46
+ amf_ue, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR));
47
+ return OGS_ERROR;
48
+ }
49
+
50
+ if (!message.h.resource.component2) {
51
+ ogs_error("%s No Subscription ID %s",
52
+ amf_ue->supi, recvmsg->http.location);
53
+
54
+ ogs_sbi_header_free(&header);
55
+ ogs_assert(OGS_OK ==
56
+ nas_5gs_send_gmm_reject_from_sbi(
57
+ amf_ue, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR));
58
+ return OGS_ERROR;
59
+ }
60
+
61
+ if (amf_ue->data_change_subscription_id)
62
+ ogs_free(amf_ue->data_change_subscription_id);
63
+ amf_ue->data_change_subscription_id =
64
+ ogs_strdup(message.h.resource.component2);
65
+
66
+ ogs_sbi_header_free(&header);
67
+
68
ogs_assert(true ==
69
amf_ue_sbi_discover_and_send(
70
OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL, NULL,
71
open5gs_2.4.11.tar.xz/src/amf/sbi-path.c -> open5gs_2.5.0.tar.xz/src/amf/sbi-path.c
Changed
201
1
2
#include "ngap-path.h"
3
#include "nnrf-handler.h"
4
5
-static int server_cb(ogs_sbi_request_t *request, void *data)
6
-{
7
- amf_event_t *e = NULL;
8
- int rv;
9
-
10
- ogs_assert(request);
11
- ogs_assert(data);
12
-
13
- e = amf_event_new(OGS_EVENT_SBI_SERVER);
14
- ogs_assert(e);
15
-
16
- e->h.sbi.request = request;
17
- e->h.sbi.data = data;
18
-
19
- rv = ogs_queue_push(ogs_app()->queue, e);
20
- if (rv != OGS_OK) {
21
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
22
- ogs_sbi_request_free(request);
23
- ogs_event_free(e);
24
- return OGS_ERROR;
25
- }
26
-
27
- return OGS_OK;
28
-}
29
-
30
-static int client_cb(int status, ogs_sbi_response_t *response, void *data)
31
-{
32
- amf_event_t *e = NULL;
33
- int rv;
34
-
35
- if (status != OGS_OK) {
36
- ogs_log_message(
37
- status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0,
38
- "client_cb() failed %d", status);
39
- return OGS_ERROR;
40
- }
41
-
42
- ogs_assert(response);
43
-
44
- e = amf_event_new(OGS_EVENT_SBI_CLIENT);
45
- ogs_assert(e);
46
- e->h.sbi.response = response;
47
- e->h.sbi.data = data;
48
-
49
- rv = ogs_queue_push(ogs_app()->queue, e);
50
- if (rv != OGS_OK) {
51
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
52
- ogs_sbi_response_free(response);
53
- ogs_event_free(e);
54
- return OGS_ERROR;
55
- }
56
-
57
- return OGS_OK;
58
-}
59
-
60
int amf_sbi_open(void)
61
{
62
ogs_sbi_nf_instance_t *nf_instance = NULL;
63
ogs_sbi_nf_service_t *service = NULL;
64
65
- /* Add SELF NF instance */
66
+ /* Initialize SELF NF instance */
67
nf_instance = ogs_sbi_self()->nf_instance;
68
ogs_assert(nf_instance);
69
ogs_sbi_nf_fsm_init(nf_instance);
70
71
72
/* Initialize NRF NF Instance */
73
nf_instance = ogs_sbi_self()->nrf_instance;
74
- if (nf_instance) {
75
- ogs_sbi_client_t *client = NULL;
76
-
77
- /* Client callback is only used when NF sends to NRF */
78
- client = nf_instance->client;
79
- ogs_assert(client);
80
- client->cb = client_cb;
81
-
82
- /* NFRegister is sent and the response is received
83
- * by the above client callback. */
84
+ if (nf_instance)
85
ogs_sbi_nf_fsm_init(nf_instance);
86
- }
87
88
/* Build Subscription-Data */
89
ogs_sbi_subscription_data_build_default(
90
91
ogs_sbi_subscription_data_build_default(
92
OpenAPI_nf_type_NSSF, OGS_SBI_SERVICE_NAME_NNSSF_NSSELECTION);
93
94
- if (ogs_sbi_server_start_all(server_cb) != OGS_OK)
95
+ if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK)
96
return OGS_ERROR;
97
98
return OGS_OK;
99
100
ogs_sbi_server_stop_all();
101
}
102
103
-bool amf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data)
104
+bool amf_sbi_send_request(
105
+ ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact)
106
{
107
ogs_assert(nf_instance);
108
- ogs_assert(data);
109
-
110
- return ogs_sbi_send_request(nf_instance, client_cb, data);
111
+ ogs_assert(xact);
112
+ return ogs_sbi_send_request_to_nf_instance(nf_instance, xact);
113
}
114
115
bool amf_ue_sbi_discover_and_send(
116
117
return false;
118
}
119
120
- if (ogs_sbi_discover_and_send(xact, client_cb) != true) {
121
+ if (ogs_sbi_discover_and_send(xact) != true) {
122
ogs_error("amf_ue_sbi_discover_and_send() failed");
123
ogs_sbi_xact_remove(xact);
124
ogs_assert(OGS_OK ==
125
126
127
xact->state = state;
128
129
- if (ogs_sbi_discover_and_send(xact, client_cb) != true) {
130
+ if (ogs_sbi_discover_and_send(xact) != true) {
131
ogs_error("amf_sess_sbi_discover_and_send() failed");
132
ogs_sbi_xact_remove(xact);
133
ogs_assert(OGS_OK == nas_5gs_send_back_gsm_message(sess,
134
135
136
ogs_sbi_xact_t *xact = NULL;
137
ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL;
138
+ OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
139
ogs_sbi_discovery_option_t *discovery_option = NULL;
140
amf_ue_t *amf_ue = NULL;
141
amf_sess_t *sess = NULL;
142
143
- ogs_assert(response);
144
-
145
xact = data;
146
ogs_assert(xact);
147
148
xact = ogs_sbi_xact_cycle(xact);
149
if (!xact) {
150
ogs_error("SBI transaction has already been removed");
151
+ if (response)
152
+ ogs_sbi_response_free(response);
153
return OGS_ERROR;
154
}
155
156
157
ogs_assert(sess);
158
159
service_type = xact->service_type;
160
+ ogs_assert(service_type);
161
+ requester_nf_type = xact->requester_nf_type;
162
+ ogs_assert(requester_nf_type);
163
discovery_option = xact->discovery_option;
164
165
sess = amf_sess_cycle(sess);
166
if (!sess) {
167
ogs_error("Session has already been removed");
168
ogs_sbi_xact_remove(xact);
169
+ if (response)
170
+ ogs_sbi_response_free(response);
171
return OGS_ERROR;
172
}
173
174
175
return OGS_ERROR;
176
}
177
178
+ ogs_assert(response);
179
+
180
rv = ogs_sbi_parse_response(&message, response);
181
if (rv != OGS_OK) {
182
ogs_error("cannot parse HTTP response");
183
184
goto cleanup;
185
}
186
187
- ogs_nnrf_handle_nf_discover_search_result(message.SearchResult);
188
+ ogs_nnrf_disc_handle_nf_discover_search_result(message.SearchResult);
189
190
- amf_sbi_select_nf(&sess->sbi, service_type, discovery_option);
191
+ amf_sbi_select_nf(&sess->sbi,
192
+ service_type, requester_nf_type, discovery_option);
193
194
if (!sess->sbi.service_type_arrayservice_type.nf_instance) {
195
ogs_error("%s:%d (NF discover) No %s",
196
197
amf_nsmf_pdusession_build_create_sm_context,
198
sess, AMF_CREATE_SM_CONTEXT_NO_STATE, NULL);
199
200
+ ogs_sbi_xact_remove(xact);
201
open5gs_2.4.11.tar.xz/src/amf/sbi-path.h -> open5gs_2.5.0.tar.xz/src/amf/sbi-path.h
Changed
11
1
2
int amf_sbi_open(void);
3
void amf_sbi_close(void);
4
5
-bool amf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data);
6
+bool amf_sbi_send_request(
7
+ ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact);
8
bool amf_ue_sbi_discover_and_send(
9
ogs_sbi_service_type_e service_type,
10
ogs_sbi_discovery_option_t *discovery_option,
11
open5gs_2.4.11.tar.xz/src/ausf/ausf-sm.c -> open5gs_2.5.0.tar.xz/src/ausf/ausf-sm.c
Changed
19
1
2
CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY)
3
SWITCH(message.h.method)
4
CASE(OGS_SBI_HTTP_METHOD_POST)
5
- ogs_nnrf_handle_nf_status_notify(stream, &message);
6
+ ogs_nnrf_nfm_handle_nf_status_notify(stream, &message);
7
break;
8
9
DEFAULT
10
11
CASE(OGS_SBI_HTTP_METHOD_POST)
12
if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED ||
13
message.res_status == OGS_SBI_HTTP_STATUS_OK) {
14
- ogs_nnrf_handle_nf_status_subscribe(
15
+ ogs_nnrf_nfm_handle_nf_status_subscribe(
16
subscription_data, &message);
17
} else {
18
ogs_error("%s HTTP response error %d",
19
open5gs_2.4.11.tar.xz/src/ausf/event.h -> open5gs_2.5.0.tar.xz/src/ausf/event.h
Changed
10
1
2
ausf_ue_t *ausf_ue;
3
} ausf_event_t;
4
5
+OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(ausf_event_t));
6
+
7
ausf_event_t *ausf_event_new(int id);
8
9
const char *ausf_event_get_name(ausf_event_t *e);
10
open5gs_2.4.11.tar.xz/src/ausf/nnrf-handler.c -> open5gs_2.5.0.tar.xz/src/ausf/nnrf-handler.c
Changed
37
1
2
ogs_sbi_discovery_option_t *discovery_option = NULL;
3
4
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
5
+ OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
6
OpenAPI_search_result_t *SearchResult = NULL;
7
8
ogs_assert(recvmsg);
9
10
ogs_assert(service_type);
11
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
12
ogs_assert(target_nf_type);
13
+ requester_nf_type = xact->requester_nf_type;
14
+ ogs_assert(requester_nf_type);
15
16
discovery_option = xact->discovery_option;
17
18
19
return;
20
}
21
22
- ogs_nnrf_handle_nf_discover_search_result(SearchResult);
23
+ ogs_nnrf_disc_handle_nf_discover_search_result(SearchResult);
24
25
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
26
- target_nf_type, discovery_option);
27
+ target_nf_type, requester_nf_type, discovery_option);
28
if (!nf_instance) {
29
- ogs_error("(NF discover) No %s",
30
- ogs_sbi_service_type_to_name(service_type));
31
+ ogs_error("(NF discover) No %s:%s",
32
+ ogs_sbi_service_type_to_name(service_type),
33
+ OpenAPI_nf_type_ToString(requester_nf_type));
34
return;
35
}
36
37
open5gs_2.4.11.tar.xz/src/ausf/nudm-build.c -> open5gs_2.5.0.tar.xz/src/ausf/nudm-build.c
Changed
64
1
2
3
AuthenticationInfoRequest.serving_network_name =
4
ausf_ue->serving_network_name;
5
- ogs_assert(ogs_sbi_self()->nf_instance);
6
AuthenticationInfoRequest.ausf_instance_id =
7
- ogs_sbi_self()->nf_instance->id;
8
+ NF_INSTANCE_ID(ogs_sbi_self()->nf_instance);
9
10
if (data) {
11
OpenAPI_resynchronization_info_t *recvinfo = data;
12
13
message.AuthenticationInfoRequest = &AuthenticationInfoRequest;
14
15
request = ogs_sbi_build_request(&message);
16
- ogs_expect_or_return_val(request, NULL);
17
+ ogs_expect(request);
18
19
return request;
20
}
21
22
message.h.resource.component1 = (char *)OGS_SBI_RESOURCE_NAME_AUTH_EVENTS;
23
24
AuthEvent = ogs_calloc(1, sizeof(*AuthEvent));
25
- ogs_expect_or_return_val(AuthEvent, NULL);
26
+ if (!AuthEvent) {
27
+ ogs_error("No AuthEvent");
28
+ goto end;
29
+ }
30
31
AuthEvent->time_stamp = ogs_sbi_localtime_string(ogs_time_now());
32
- ogs_expect_or_return_val(AuthEvent->time_stamp, NULL);
33
+ if (!AuthEvent->time_stamp) {
34
+ ogs_error("No time_stamp");
35
+ goto end;
36
+ }
37
38
- ogs_assert(ogs_sbi_self()->nf_instance);
39
- AuthEvent->nf_instance_id = ogs_sbi_self()->nf_instance->id;
40
+ AuthEvent->nf_instance_id = NF_INSTANCE_ID(ogs_sbi_self()->nf_instance);
41
if (ausf_ue->auth_result == OpenAPI_auth_result_AUTHENTICATION_SUCCESS)
42
AuthEvent->success = true;
43
else
44
45
message.AuthEvent = AuthEvent;
46
47
request = ogs_sbi_build_request(&message);
48
- ogs_expect_or_return_val(request, NULL);
49
+ ogs_expect(request);
50
51
- if (AuthEvent->time_stamp)
52
- ogs_free(AuthEvent->time_stamp);
53
- ogs_free(AuthEvent);
54
+end:
55
+
56
+ if (AuthEvent) {
57
+ if (AuthEvent->time_stamp)
58
+ ogs_free(AuthEvent->time_stamp);
59
+ ogs_free(AuthEvent);
60
+ }
61
62
return request;
63
}
64
open5gs_2.4.11.tar.xz/src/ausf/sbi-path.c -> open5gs_2.5.0.tar.xz/src/ausf/sbi-path.c
Changed
122
1
2
3
#include "sbi-path.h"
4
5
-static int server_cb(ogs_sbi_request_t *request, void *data)
6
-{
7
- ausf_event_t *e = NULL;
8
- int rv;
9
-
10
- ogs_assert(request);
11
- ogs_assert(data);
12
-
13
- e = ausf_event_new(OGS_EVENT_SBI_SERVER);
14
- ogs_assert(e);
15
-
16
- e->h.sbi.request = request;
17
- e->h.sbi.data = data;
18
-
19
- rv = ogs_queue_push(ogs_app()->queue, e);
20
- if (rv != OGS_OK) {
21
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
22
- ogs_sbi_request_free(request);
23
- ogs_event_free(e);
24
- return OGS_ERROR;
25
- }
26
-
27
- return OGS_OK;
28
-}
29
-
30
-static int client_cb(int status, ogs_sbi_response_t *response, void *data)
31
-{
32
- ausf_event_t *e = NULL;
33
- int rv;
34
-
35
- if (status != OGS_OK) {
36
- ogs_log_message(
37
- status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0,
38
- "client_cb() failed %d", status);
39
- return OGS_ERROR;
40
- }
41
-
42
- ogs_assert(response);
43
-
44
- e = ausf_event_new(OGS_EVENT_SBI_CLIENT);
45
- ogs_assert(e);
46
- e->h.sbi.response = response;
47
- e->h.sbi.data = data;
48
-
49
- rv = ogs_queue_push(ogs_app()->queue, e);
50
- if (rv != OGS_OK) {
51
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
52
- ogs_sbi_response_free(response);
53
- ogs_event_free(e);
54
- return OGS_ERROR;
55
- }
56
-
57
- return OGS_OK;
58
-}
59
-
60
int ausf_sbi_open(void)
61
{
62
ogs_sbi_nf_instance_t *nf_instance = NULL;
63
ogs_sbi_nf_service_t *service = NULL;
64
65
- /* Add SELF NF instance */
66
+ /* Initialize SELF NF instance */
67
nf_instance = ogs_sbi_self()->nf_instance;
68
ogs_assert(nf_instance);
69
ogs_sbi_nf_fsm_init(nf_instance);
70
71
72
/* Initialize NRF NF Instance */
73
nf_instance = ogs_sbi_self()->nrf_instance;
74
- if (nf_instance) {
75
- ogs_sbi_client_t *client = NULL;
76
-
77
- /* Client callback is only used when NF sends to NRF */
78
- client = nf_instance->client;
79
- ogs_assert(client);
80
- client->cb = client_cb;
81
-
82
- /* NFRegister is sent and the response is received
83
- * by the above client callback. */
84
+ if (nf_instance)
85
ogs_sbi_nf_fsm_init(nf_instance);
86
- }
87
88
/* Build Subscription-Data */
89
ogs_sbi_subscription_data_build_default(
90
OpenAPI_nf_type_UDM, OGS_SBI_SERVICE_NAME_NUDM_UEAU);
91
92
- if (ogs_sbi_server_start_all(server_cb) != OGS_OK)
93
+ if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK)
94
return OGS_ERROR;
95
96
return OGS_OK;
97
98
ogs_sbi_server_stop_all();
99
}
100
101
-bool ausf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data)
102
+bool ausf_sbi_send_request(
103
+ ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact)
104
{
105
ogs_assert(nf_instance);
106
-
107
- return ogs_sbi_send_request(nf_instance, client_cb, data);
108
+ ogs_assert(xact);
109
+ return ogs_sbi_send_request_to_nf_instance(nf_instance, xact);
110
}
111
112
bool ausf_sbi_discover_and_send(
113
114
115
xact->assoc_stream = stream;
116
117
- if (ogs_sbi_discover_and_send(xact, client_cb) != true) {
118
+ if (ogs_sbi_discover_and_send(xact) != true) {
119
ogs_error("ausf_sbi_discover_and_send() failed");
120
ogs_sbi_xact_remove(xact);
121
ogs_assert(true ==
122
open5gs_2.4.11.tar.xz/src/ausf/sbi-path.h -> open5gs_2.5.0.tar.xz/src/ausf/sbi-path.h
Changed
11
1
2
int ausf_sbi_open(void);
3
void ausf_sbi_close(void);
4
5
-bool ausf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data);
6
+bool ausf_sbi_send_request(
7
+ ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact);
8
bool ausf_sbi_discover_and_send(
9
ogs_sbi_service_type_e service_type,
10
ogs_sbi_discovery_option_t *discovery_option,
11
open5gs_2.4.11.tar.xz/src/bsf/bsf-sm.c -> open5gs_2.5.0.tar.xz/src/bsf/bsf-sm.c
Changed
19
1
2
CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY)
3
SWITCH(message.h.method)
4
CASE(OGS_SBI_HTTP_METHOD_POST)
5
- ogs_nnrf_handle_nf_status_notify(stream, &message);
6
+ ogs_nnrf_nfm_handle_nf_status_notify(stream, &message);
7
break;
8
9
DEFAULT
10
11
CASE(OGS_SBI_HTTP_METHOD_POST)
12
if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED ||
13
message.res_status == OGS_SBI_HTTP_STATUS_OK) {
14
- ogs_nnrf_handle_nf_status_subscribe(
15
+ ogs_nnrf_nfm_handle_nf_status_subscribe(
16
subscription_data, &message);
17
} else {
18
ogs_error("HTTP response error : %d",
19
open5gs_2.4.11.tar.xz/src/bsf/event.h -> open5gs_2.5.0.tar.xz/src/bsf/event.h
Changed
10
1
2
bsf_sess_t *sess;
3
} bsf_event_t;
4
5
+OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(bsf_event_t));
6
+
7
bsf_event_t *bsf_event_new(int id);
8
9
const char *bsf_event_get_name(bsf_event_t *e);
10
open5gs_2.4.11.tar.xz/src/bsf/nnrf-handler.c -> open5gs_2.5.0.tar.xz/src/bsf/nnrf-handler.c
Changed
37
1
2
ogs_sbi_discovery_option_t *discovery_option = NULL;
3
4
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
5
+ OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
6
OpenAPI_search_result_t *SearchResult = NULL;
7
8
ogs_assert(recvmsg);
9
10
ogs_assert(service_type);
11
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
12
ogs_assert(target_nf_type);
13
+ requester_nf_type = xact->requester_nf_type;
14
+ ogs_assert(requester_nf_type);
15
16
discovery_option = xact->discovery_option;
17
18
19
return;
20
}
21
22
- ogs_nnrf_handle_nf_discover_search_result(SearchResult);
23
+ ogs_nnrf_disc_handle_nf_discover_search_result(SearchResult);
24
25
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
26
- target_nf_type, discovery_option);
27
+ target_nf_type, requester_nf_type, discovery_option);
28
if (!nf_instance) {
29
- ogs_error("(NF discover) No %s",
30
- ogs_sbi_service_type_to_name(service_type));
31
+ ogs_error("(NF discover) No %s:%s",
32
+ ogs_sbi_service_type_to_name(service_type),
33
+ OpenAPI_nf_type_ToString(requester_nf_type));
34
return;
35
}
36
37
open5gs_2.4.11.tar.xz/src/bsf/sbi-path.c -> open5gs_2.5.0.tar.xz/src/bsf/sbi-path.c
Changed
118
1
2
3
#include "sbi-path.h"
4
5
-static int server_cb(ogs_sbi_request_t *request, void *data)
6
-{
7
- bsf_event_t *e = NULL;
8
- int rv;
9
-
10
- ogs_assert(request);
11
- ogs_assert(data);
12
-
13
- e = bsf_event_new(OGS_EVENT_SBI_SERVER);
14
- ogs_assert(e);
15
-
16
- e->h.sbi.request = request;
17
- e->h.sbi.data = data;
18
-
19
- rv = ogs_queue_push(ogs_app()->queue, e);
20
- if (rv != OGS_OK) {
21
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
22
- ogs_sbi_request_free(request);
23
- ogs_event_free(e);
24
- return OGS_ERROR;
25
- }
26
-
27
- return OGS_OK;
28
-}
29
-
30
-static int client_cb(int status, ogs_sbi_response_t *response, void *data)
31
-{
32
- bsf_event_t *e = NULL;
33
- int rv;
34
-
35
- if (status != OGS_OK) {
36
- ogs_log_message(
37
- status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0,
38
- "client_cb() failed %d", status);
39
- return OGS_ERROR;
40
- }
41
-
42
- ogs_assert(response);
43
-
44
- e = bsf_event_new(OGS_EVENT_SBI_CLIENT);
45
- ogs_assert(e);
46
- e->h.sbi.response = response;
47
- e->h.sbi.data = data;
48
-
49
- rv = ogs_queue_push(ogs_app()->queue, e);
50
- if (rv != OGS_OK) {
51
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
52
- ogs_sbi_response_free(response);
53
- ogs_event_free(e);
54
- return OGS_ERROR;
55
- }
56
-
57
- return OGS_OK;
58
-}
59
-
60
int bsf_sbi_open(void)
61
{
62
ogs_sbi_nf_instance_t *nf_instance = NULL;
63
ogs_sbi_nf_service_t *service = NULL;
64
65
- /* Add SELF NF instance */
66
+ /* Initialize SELF NF instance */
67
nf_instance = ogs_sbi_self()->nf_instance;
68
ogs_assert(nf_instance);
69
ogs_sbi_nf_fsm_init(nf_instance);
70
71
72
/* Initialize NRF NF Instance */
73
nf_instance = ogs_sbi_self()->nrf_instance;
74
- if (nf_instance) {
75
- ogs_sbi_client_t *client = NULL;
76
-
77
- /* Client callback is only used when NF sends to NRF */
78
- client = nf_instance->client;
79
- ogs_assert(client);
80
- client->cb = client_cb;
81
-
82
- /* NFRegister is sent and the response is received
83
- * by the above client callback. */
84
+ if (nf_instance)
85
ogs_sbi_nf_fsm_init(nf_instance);
86
- }
87
88
- if (ogs_sbi_server_start_all(server_cb) != OGS_OK)
89
+ if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK)
90
return OGS_ERROR;
91
92
return OGS_OK;
93
94
ogs_sbi_server_stop_all();
95
}
96
97
-bool bsf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data)
98
+bool bsf_sbi_send_request(
99
+ ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact)
100
{
101
ogs_assert(nf_instance);
102
-
103
- return ogs_sbi_send_request(nf_instance, client_cb, data);
104
+ ogs_assert(xact);
105
+ return ogs_sbi_send_request_to_nf_instance(nf_instance, xact);
106
}
107
108
bool bsf_sbi_discover_and_send(
109
110
111
xact->assoc_stream = stream;
112
113
- if (ogs_sbi_discover_and_send(xact, client_cb) != true) {
114
+ if (ogs_sbi_discover_and_send(xact) != true) {
115
ogs_error("bsf_sbi_discover_and_send() failed");
116
ogs_sbi_xact_remove(xact);
117
ogs_assert(true ==
118
open5gs_2.4.11.tar.xz/src/bsf/sbi-path.h -> open5gs_2.5.0.tar.xz/src/bsf/sbi-path.h
Changed
11
1
2
int bsf_sbi_open(void);
3
void bsf_sbi_close(void);
4
5
-bool bsf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data);
6
+bool bsf_sbi_send_request(
7
+ ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact);
8
bool bsf_sbi_discover_and_send(
9
ogs_sbi_service_type_e service_type,
10
ogs_sbi_discovery_option_t *discovery_option,
11
open5gs_2.4.11.tar.xz/src/hss/hss-context.c -> open5gs_2.5.0.tar.xz/src/hss/hss-context.c
Changed
93
1
2
3
int hss_handle_change_event(const bson_t *document)
4
{
5
- bson_iter_t iter, child1_iter, child2_iter, child3_iter;
6
+ bson_iter_t iter, child1_iter, child2_iter;
7
8
char *utf8 = NULL;
9
uint32_t length = 0;
10
11
12
char *imsi_bcd;
13
14
+#if BSON_MAJOR_VERSION >= 1 && BSON_MINOR_VERSION >= 7
15
char *as_json = bson_as_relaxed_extended_json(document, NULL);
16
- ogs_debug("Got document: %s\n", as_json);
17
+ ogs_debug("Received change stream document: %s\n", as_json);
18
+ bson_free (as_json);
19
+# else
20
+ ogs_debug("Received change stream document.");
21
+#endif
22
if (!bson_iter_init_find(&iter, document, "fullDocument")) {
23
ogs_error("No 'imsi' field in this document.");
24
return OGS_ERROR;
25
26
"request_cancel_location") &&
27
BSON_ITER_HOLDS_BOOL(&child2_iter)) {
28
send_clr_flag = (char *)bson_iter_bool(&child2_iter);
29
- } else if (!strncmp(child2_key, "msisdn",
30
- strlen("msisdn"))) {
31
- int msisdn_count = 0;
32
- bson_iter_recurse(&child2_iter, &child3_iter);
33
- while (bson_iter_next(&child3_iter)) {
34
- if (BSON_ITER_HOLDS_UTF8(&child3_iter)) {
35
- msisdn_count++;
36
- }
37
- }
38
- if (msisdn_count) {
39
- send_idr_flag = true;
40
- subdatamask = (subdatamask |
41
- OGS_HSS_SUBDATA_MSISDN);
42
- } else {
43
- send_clr_flag = true;
44
- }
45
} else if (!strncmp(child2_key,
46
"access_restriction_data",
47
strlen("access_restriction_data"))) {
48
send_idr_flag = true;
49
- subdatamask = (subdatamask | OGS_HSS_SUBDATA_ARD);
50
+ subdatamask = (subdatamask | OGS_DIAM_S6A_SUBDATA_ARD);
51
} else if (!strncmp(child2_key,
52
"subscriber_status",
53
strlen("subscriber_status"))) {
54
send_idr_flag = true;
55
subdatamask = (subdatamask |
56
- OGS_HSS_SUBDATA_SUB_STATUS);
57
+ OGS_DIAM_S6A_SUBDATA_SUB_STATUS);
58
} else if (!strncmp(child2_key,
59
"network_access_mode",
60
strlen("network_access_mode"))) {
61
send_idr_flag = true;
62
- subdatamask = (subdatamask | OGS_HSS_SUBDATA_NAM);
63
+ subdatamask = (subdatamask | OGS_DIAM_S6A_SUBDATA_NAM);
64
} else if (!strncmp(child2_key, "ambr", strlen("ambr"))) {
65
send_idr_flag = true;
66
- subdatamask = (subdatamask | OGS_HSS_SUBDATA_UEAMBR);
67
+ subdatamask = (subdatamask |
68
+ OGS_DIAM_S6A_SUBDATA_UEAMBR);
69
} else if (!strncmp(child2_key,
70
"subscribed_rau_tau_timer",
71
strlen("subscribed_rau_tau_timer"))) {
72
send_idr_flag = true;
73
subdatamask = (subdatamask |
74
- OGS_HSS_SUBDATA_RAU_TAU_TIMER);
75
+ OGS_DIAM_S6A_SUBDATA_RAU_TAU_TIMER);
76
} else if (!strncmp(child2_key, "slice", strlen("slice"))) {
77
send_idr_flag = true;
78
- subdatamask = (subdatamask | OGS_HSS_SUBDATA_SLICE);
79
+ subdatamask = (subdatamask |
80
+ OGS_DIAM_S6A_SUBDATA_APN_CONFIG);
81
}
82
}
83
}
84
85
ogs_debug("No 'updateDescription' field in this document");
86
}
87
88
- bson_free (as_json);
89
-
90
if (send_clr_flag) {
91
ogs_info("%s Cancel Location Requested", imsi_bcd);
92
hss_s6a_send_clr(imsi_bcd, NULL, NULL,
93
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
82
1
2
3
int i;
4
5
- if (subdatamask & OGS_HSS_SUBDATA_MSISDN) {
6
+ if (subdatamask & OGS_DIAM_S6A_SUBDATA_MSISDN) {
7
/*
8
* TS29.328
9
* 6.3.2 MSISDN AVP
10
11
}
12
}
13
14
- if (subdatamask & OGS_HSS_SUBDATA_ARD) {
15
+ if (subdatamask & OGS_DIAM_S6A_SUBDATA_ARD) {
16
if (subscription_data->access_restriction_data) {
17
ret = fd_msg_avp_new(ogs_diam_s6a_access_restriction_data, 0,
18
&avp_access_restriction_data);
19
20
}
21
}
22
23
- if (subdatamask & OGS_HSS_SUBDATA_SUB_STATUS) {
24
+ if (subdatamask & OGS_DIAM_S6A_SUBDATA_SUB_STATUS) {
25
ret = fd_msg_avp_new(
26
ogs_diam_s6a_subscriber_status, 0, &avp_subscriber_status);
27
ogs_assert(ret == 0);
28
29
ogs_assert(ret == 0);
30
}
31
32
- if (subdatamask & OGS_HSS_SUBDATA_NAM) {
33
+ if (subdatamask & OGS_DIAM_S6A_SUBDATA_NAM) {
34
ret = fd_msg_avp_new(ogs_diam_s6a_network_access_mode, 0,
35
&avp_network_access_mode);
36
ogs_assert(ret == 0);
37
38
ogs_assert(ret == 0);
39
}
40
41
- if (subdatamask & OGS_HSS_SUBDATA_UEAMBR) {
42
+ if (subdatamask & OGS_DIAM_S6A_SUBDATA_UEAMBR) {
43
/* Set the AMBR */
44
ret = fd_msg_avp_new(ogs_diam_s6a_ambr, 0, &avp_ambr);
45
ogs_assert(ret == 0);
46
47
ogs_assert(ret == 0);
48
}
49
50
- if (subdatamask & OGS_HSS_SUBDATA_RAU_TAU_TIMER) {
51
+ if (subdatamask & OGS_DIAM_S6A_SUBDATA_RAU_TAU_TIMER) {
52
/* Set the Subscribed RAU TAU Timer */
53
ret = fd_msg_avp_new(
54
ogs_diam_s6a_subscribed_rau_tau_timer, 0, &avp_rau_tau_timer);
55
56
ogs_assert(ret == 0);
57
}
58
59
- if (subdatamask & OGS_HSS_SUBDATA_SLICE) {
60
+ if (subdatamask & OGS_DIAM_S6A_SUBDATA_APN_CONFIG) {
61
/* For EPC, we'll use first Slice in Subscription */
62
if (subscription_data->num_of_slice)
63
slice_data = &subscription_data->slice0;
64
65
ogs_diam_s6a_all_apn_configuration_included_indicator, 0,
66
&all_apn_configuration_included_indicator);
67
ogs_assert(ret == 0);
68
- val.i32 = 0;
69
+ val.i32 = OGS_ALL_APN_CONFIGURATIONS_INCLUDED;
70
ret = fd_msg_avp_setvalue(
71
all_apn_configuration_included_indicator, &val);
72
ogs_assert(ret == 0);
73
74
ret = fd_msg_avp_new(ogs_diam_s6a_subscription_data, 0, &avp);
75
ogs_assert(ret == 0);
76
rv = hss_s6a_avp_add_subscription_data(&subscription_data,
77
- avp, OGS_HSS_SUBDATA_ALL);
78
+ avp, OGS_DIAM_S6A_SUBDATA_ALL);
79
if (rv != OGS_OK) {
80
result_code = OGS_DIAM_S6A_ERROR_UNKNOWN_EPS_SUBSCRIPTION;
81
goto out;
82
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
18
1
2
extern "C" {
3
#endif
4
5
-#define OGS_HSS_SUBDATA_NO_UPDATE (0)
6
-#define OGS_HSS_SUBDATA_MSISDN (1)
7
-#define OGS_HSS_SUBDATA_ARD (1 << 1)
8
-#define OGS_HSS_SUBDATA_SUB_STATUS (1 << 2)
9
-#define OGS_HSS_SUBDATA_NAM (1 << 3)
10
-#define OGS_HSS_SUBDATA_UEAMBR (1 << 4)
11
-#define OGS_HSS_SUBDATA_RAU_TAU_TIMER (1 << 5)
12
-#define OGS_HSS_SUBDATA_SLICE (1 << 6)
13
-#define OGS_HSS_SUBDATA_ALL 0xFFFFFFFF
14
-
15
/* HSS Sends Cancel Location Request to MME */
16
void hss_s6a_send_clr(char *imsi_bcd, char *mme_host, char *mme_realm,
17
uint32_t cancellation_type);
18
open5gs_2.4.11.tar.xz/src/hss/hss-sm.c -> open5gs_2.5.0.tar.xz/src/hss/hss-sm.c
Changed
10
1
2
ogs_assert(e->dbi.document);
3
hss_handle_change_event(e->dbi.document);
4
5
- bson_destroy((bson_t*)e->dbi.document);
6
+ bson_destroy(e->dbi.document);
7
break;
8
9
default:
10
open5gs_2.4.11.tar.xz/src/mme/emm-handler.c -> open5gs_2.5.0.tar.xz/src/mme/emm-handler.c
Changed
15
1
2
*
3
* So, we will lose the MME_EPS_TYPE_DETACH_REQUEST_TO_UE.
4
*
5
- * We need more variable(nas_eps.detach_type)
6
+ * We need more variable(detach_type)
7
* to keep Detach-Type whether UE-initiated or MME-initiaed. */
8
- mme_ue->nas_eps.type = mme_ue->nas_eps.detach_type =
9
- MME_EPS_TYPE_DETACH_REQUEST_FROM_UE;
10
+ mme_ue->nas_eps.type = MME_EPS_TYPE_DETACH_REQUEST_FROM_UE;
11
+ mme_ue->detach_type = MME_DETACH_TYPE_REQUEST_FROM_UE;
12
13
mme_ue->nas_eps.ksi = detach_type->nas_key_set_identifier;
14
ogs_debug(" OGS_NAS_EPS TYPE%d KSI%d",
15
open5gs_2.4.11.tar.xz/src/mme/mme-context.c -> open5gs_2.5.0.tar.xz/src/mme/mme-context.c
Changed
54
1
2
ogs_pool_init(&sgw_ue_pool, ogs_app()->max.ue);
3
ogs_pool_init(&mme_sess_pool, ogs_app()->pool.sess);
4
ogs_pool_init(&mme_bearer_pool, ogs_app()->pool.bearer);
5
- ogs_pool_init(&self.m_tmsi, ogs_app()->max.ue);
6
+ ogs_pool_init(&self.m_tmsi, ogs_app()->max.ue*2);
7
8
self.enb_addr_hash = ogs_hash_make();
9
ogs_assert(self.enb_addr_hash);
10
11
ogs_assert(enb);
12
13
ogs_pool_alloc(&enb_ue_pool, &enb_ue);
14
- ogs_assert(enb_ue);
15
+ if (enb_ue == NULL) {
16
+ ogs_error("Could not allocate enb_ue context from pool");
17
+ return NULL;
18
+ }
19
+
20
memset(enb_ue, 0, sizeof *enb_ue);
21
22
enb_ue->t_s1_holding = ogs_timer_add(
23
24
ogs_assert(enb);
25
26
ogs_pool_alloc(&mme_ue_pool, &mme_ue);
27
- ogs_assert(mme_ue);
28
+ if (mme_ue == NULL) {
29
+ ogs_error("Could not allocate mme_ue context from pool");
30
+ return NULL;
31
+ }
32
+
33
memset(mme_ue, 0, sizeof *mme_ue);
34
35
/* Add All Timers */
36
37
if (SESSION_CONTEXT_IS_AVAILABLE(old_mme_ue)) {
38
ogs_warn("%s Trigger OLD Session Remove", mme_ue->imsi_bcd);
39
mme_gtp_send_delete_all_sessions(old_mme_ue,
40
- OGS_GTP_DELETE_UE_CONTEXT_REMOVE);
41
+ OGS_GTP_DELETE_UE_CONTEXT_REMOVE_PARTIAL);
42
}
43
}
44
}
45
46
int index = 0;
47
48
ogs_trace("M-TMSI Pool try to generate...");
49
- for (i = 0; index < ogs_app()->max.ue; i++) {
50
+ for (i = 0; index < ogs_app()->max.ue*2; i++) {
51
mme_m_tmsi_t *m_tmsi = NULL;
52
int conflict = 0;
53
54
open5gs_2.4.11.tar.xz/src/mme/mme-context.h -> open5gs_2.5.0.tar.xz/src/mme/mme-context.h
Changed
39
1
2
ogs_nas_eps_update_type_t update;
3
ogs_nas_service_type_t service;
4
ogs_nas_detach_type_t detach;
5
-
6
- /* 1. MME initiated detach request to the UE.
7
- * (nas_eps.type = MME_EPS_TYPE_DETACH_REQUEST_TO_UE)
8
- * 2. If UE is IDLE, Paging sent to the UE
9
- * 3. If UE is wake-up, UE will send Server Request.
10
- * (nas_eps.type = MME_EPS_TYPE_SERVICE_REQUEST)
11
- *
12
- * So, we will lose the MME_EPS_TYPE_DETACH_REQUEST_TO_UE.
13
- *
14
- * We need more variable(nas_eps.detach_type)
15
- * to keep Detach-Type whether UE-initiated or MME-initiaed. */
16
- uint8_t detach_type;
17
} nas_eps;
18
19
+ /* 1. MME initiated detach request to the UE.
20
+ * (nas_eps.type = MME_EPS_TYPE_DETACH_REQUEST_TO_UE)
21
+ * 2. If UE is IDLE, Paging sent to the UE
22
+ * 3. If UE is wake-up, UE will send Server Request.
23
+ * (nas_eps.type = MME_EPS_TYPE_SERVICE_REQUEST)
24
+ *
25
+ * So, we will lose the MME_EPS_TYPE_DETACH_REQUEST_TO_UE.
26
+ *
27
+ * We need more variable(detach_type)
28
+ * to keep Detach-Type whether UE-initiated or MME-initiaed. */
29
+#define MME_DETACH_TYPE_REQUEST_FROM_UE 1
30
+#define MME_DETACH_TYPE_MME_EXPLICIT 2
31
+#define MME_DETACH_TYPE_HSS_EXPLICIT 3
32
+#define MME_DETACH_TYPE_MME_IMPLICIT 4
33
+#define MME_DETACH_TYPE_HSS_IMPLICIT 5
34
+ uint8_t detach_type;
35
+
36
/* UE identity */
37
#define MME_UE_HAVE_IMSI(__mME) \
38
((__mME) && ((__mME)->imsi_len))
39
open5gs_2.4.11.tar.xz/src/mme/mme-event.h -> open5gs_2.5.0.tar.xz/src/mme/mme-event.h
Changed
10
1
2
ogs_timer_t *timer;
3
} mme_event_t;
4
5
+OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(mme_event_t));
6
+
7
void mme_event_term(void);
8
9
mme_event_t *mme_event_new(mme_event_e id);
10
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
201
1
2
3
static struct session_handler *mme_s6a_reg = NULL;
4
5
+/* s6a process Subscription-Data from avp */
6
+static int mme_s6a_subscription_data_from_avp(struct avp *avp,
7
+ ogs_subscription_data_t *subscription_data,
8
+ mme_ue_t *mme_ue, uint32_t *subdatamask);
9
+
10
struct sess_state {
11
mme_ue_t *mme_ue;
12
struct timespec ts; /* Time of sending the message */
13
14
ogs_free(sess_data);
15
}
16
17
+/* s6a process Subscription-Data from avp */
18
+static int mme_s6a_subscription_data_from_avp(struct avp *avp,
19
+ ogs_subscription_data_t *subscription_data,
20
+ mme_ue_t *mme_ue, uint32_t *subdatamask)
21
+{
22
+ int ret;
23
+ int error = 0;
24
+ char bufOGS_CHRGCHARS_LEN;
25
+ struct avp *avpch1, *avpch2, *avpch3, *avpch4, *avpch5;
26
+ struct avp_hdr *hdr;
27
+ ogs_sockaddr_t addr;
28
+
29
+ ogs_assert(avp);
30
+ ogs_assert(subscription_data);
31
+ ogs_assert(mme_ue);
32
+ ogs_assert(subdatamask);
33
+
34
+ /* AVP: 'MSISDN'( 701 )
35
+ * The MSISDN AVP is of type OctetString. This AVP contains an MSISDN,
36
+ * in international number format as described in ITU-T Rec E.164 8,
37
+ * encoded as a TBCD-string, i.e. digits from 0 through 9 are encoded
38
+ * 0000 to 1001; 1111 is used as a filler when there is an odd number
39
+ * of digits; bits 8 to 5 of octet n encode digit 2n; bits 4 to 1 of
40
+ * octet n encode digit 2(n-1)+1.
41
+ * Reference: 3GPP TS 29.329
42
+ */
43
+ ret = fd_avp_search_avp(avp, ogs_diam_s6a_msisdn, &avpch1);
44
+ ogs_assert(ret == 0);
45
+ if (avpch1) {
46
+ ret = fd_msg_avp_hdr(avpch1, &hdr);
47
+ ogs_assert(ret == 0);
48
+ if (hdr->avp_value->os.data && hdr->avp_value->os.len) {
49
+ mme_ue->msisdn_len = hdr->avp_value->os.len;
50
+ memcpy(mme_ue->msisdn, hdr->avp_value->os.data,
51
+ ogs_min(mme_ue->msisdn_len, OGS_MAX_MSISDN_LEN));
52
+ ogs_buffer_to_bcd(mme_ue->msisdn,
53
+ mme_ue->msisdn_len, mme_ue->msisdn_bcd);
54
+ *subdatamask = (*subdatamask | OGS_DIAM_S6A_SUBDATA_MSISDN);
55
+ }
56
+ }
57
+
58
+ /* AVP: 'A-MSISDN'(1643)
59
+ * The A-MSISDN AVP contains an A-MSISDN, in international number
60
+ * format as described in ITU-T Rec E.164, encoded as a TBCD-string.
61
+ * This AVP shall not include leading indicators for the nature of
62
+ * address and the numbering plan; it shall contain only the
63
+ * TBCD-encoded digits of the address.
64
+ * Reference: 3GPP TS 29.272 7.3.157
65
+ */
66
+ ret = fd_avp_search_avp(avp, ogs_diam_s6a_a_msisdn, &avpch1);
67
+ ogs_assert(ret == 0);
68
+ if (avpch1) {
69
+ ret = fd_msg_avp_hdr(avpch1, &hdr);
70
+ ogs_assert(ret == 0);
71
+ if (hdr->avp_value->os.data && hdr->avp_value->os.len) {
72
+ mme_ue->a_msisdn_len = hdr->avp_value->os.len;
73
+ memcpy(mme_ue->a_msisdn, hdr->avp_value->os.data,
74
+ ogs_min(mme_ue->a_msisdn_len, OGS_MAX_MSISDN_LEN));
75
+ ogs_buffer_to_bcd(mme_ue->a_msisdn,
76
+ mme_ue->a_msisdn_len, mme_ue->a_msisdn_bcd);
77
+ *subdatamask = (*subdatamask | OGS_DIAM_S6A_SUBDATA_A_MSISDN);
78
+ }
79
+ }
80
+
81
+ /* AVP: 'Network-Access-Mode'(1417)
82
+ * The Network-Access-Mode AVP shall indicate one of three options
83
+ * through its value.
84
+ * (EPS-IMSI-COMBINED/RESERVED/EPS-ONLY)
85
+ * Reference: 3GPP TS 29.272 7.3.21
86
+ */
87
+ ret = fd_avp_search_avp(avp, ogs_diam_s6a_network_access_mode, &avpch1);
88
+ ogs_assert(ret == 0);
89
+ if (avpch1) {
90
+ ret = fd_msg_avp_hdr(avpch1, &hdr);
91
+ ogs_assert(ret == 0);
92
+ mme_ue->network_access_mode = hdr->avp_value->i32;
93
+ *subdatamask = (*subdatamask | OGS_DIAM_S6A_SUBDATA_NAM);
94
+ }
95
+
96
+ /* AVP: '3GPP-Charging-Characteristics'(13)
97
+ * For GGSN, it contains the charging characteristics for
98
+ * this PDP Context received in the Create PDP Context
99
+ * Request Message (only available in R99 and later releases).
100
+ * For PGW, it contains the charging characteristics for the
101
+ * IP-CAN bearer.
102
+ * Reference: 3GPP TS 29.061 16.4.7.2 13
103
+ */
104
+ ret = fd_avp_search_avp(avp, ogs_diam_s6a_3gpp_charging_characteristics,
105
+ &avpch1);
106
+ ogs_assert(ret == 0);
107
+ if (avpch1) {
108
+ ret = fd_msg_avp_hdr(avpch1, &hdr);
109
+ memcpy(mme_ue->charging_characteristics,
110
+ OGS_HEX(hdr->avp_value->os.data, (int)hdr->avp_value->os.len, buf),
111
+ OGS_CHRGCHARS_LEN);
112
+ mme_ue->charging_characteristics_presence = true;
113
+ *subdatamask = (*subdatamask | OGS_DIAM_S6A_SUBDATA_CC);
114
+ }
115
+
116
+ /* AVP: 'AMBR'(1435)
117
+ * The Amber AVP contains the Max-Requested-Bandwidth-UL and
118
+ * Max-Requested-Bandwidth-DL AVPs.
119
+ * Reference: 3GPP TS 29.272 7.3.41
120
+ */
121
+ ret = fd_avp_search_avp(avp, ogs_diam_s6a_ambr, &avpch1);
122
+ ogs_assert(ret == 0);
123
+ if (avpch1) {
124
+ /* AVP: 'Max-Requested-Bandwidth-UL'(516)
125
+ * The Max -Bandwidth-UL AVP indicates the maximum requested
126
+ * bandwidth in bits per second for an uplink IP flow.
127
+ * Reference: 3GPP TS 29.212 7.3.41
128
+ */
129
+ ret = fd_avp_search_avp(avpch1,
130
+ ogs_diam_s6a_max_bandwidth_ul, &avpch2);
131
+ ogs_assert(ret == 0);
132
+ if (avpch2) {
133
+ ret = fd_msg_avp_hdr(avpch2, &hdr);
134
+ ogs_assert(ret == 0);
135
+ subscription_data->ambr.uplink = hdr->avp_value->u32;
136
+ } else {
137
+ ogs_error("no_Max-Bandwidth-UL");
138
+ error++;
139
+ }
140
+
141
+ /* AVP: 'Max-Requested-Bandwidth-DL'(515)
142
+ * The Max-Requested-Bandwidth-DL AVP indicates the maximum
143
+ * bandwidth in bits per second for a downlink IP flow.
144
+ * Reference: 3GPP TS 29.212 7.3.41
145
+ */
146
+ ret = fd_avp_search_avp(avpch1,
147
+ ogs_diam_s6a_max_bandwidth_dl, &avpch2);
148
+ ogs_assert(ret == 0);
149
+ if (avpch2) {
150
+ ret = fd_msg_avp_hdr(avpch2, &hdr);
151
+ ogs_assert(ret == 0);
152
+ subscription_data->ambr.downlink = hdr->avp_value->u32;
153
+ } else {
154
+ ogs_error("no_Max-Bandwidth-DL");
155
+ error++;
156
+ }
157
+ *subdatamask = (*subdatamask | OGS_DIAM_S6A_SUBDATA_UEAMBR);
158
+ }
159
+
160
+ /* AVP: 'Subscribed-Periodic-RAU-TAU-Timer'(1619)
161
+ * The Subscribed-Periodic-TAU-RAU-Timer AVP contains the subscribed
162
+ * periodic TAU/RAU timer value in seconds.
163
+ * Reference: 3GPP TS 29.272 7.3.134
164
+ */
165
+ ret = fd_avp_search_avp(avp,
166
+ ogs_diam_s6a_subscribed_rau_tau_timer, &avpch1);
167
+ ogs_assert(ret == 0);
168
+ if (avpch1) {
169
+ ret = fd_msg_avp_hdr(avpch1, &hdr);
170
+ ogs_assert(ret == 0);
171
+ subscription_data->subscribed_rau_tau_timer = hdr->avp_value->i32;
172
+ *subdatamask = (*subdatamask | OGS_DIAM_S6A_SUBDATA_RAU_TAU_TIMER);
173
+ }
174
+
175
+ /* AVP: 'APN-Configuration-Profile'(1429)
176
+ * The APN-Configuration-Profile AVP shall contain the information
177
+ * related to the user's subscribed APN configurations for EPS. The
178
+ * Context-Identifier AVP within it shall identify the per subscriber's
179
+ * default APN configuration. The Subscription-Data AVP associated
180
+ * with an IMSI contains one APN-Configuration-Profile AVP. Each
181
+ * APN-Configuration-Profile AVP contains one or more APN-Configuration
182
+ * AVPs. Each APN-Configuration AVP describes the configuration for a
183
+ * single APN. Therefore, the cardinality of the relationship between
184
+ * IMSI and APN is one-to-many.
185
+ * Reference: 3GPP TS 29.272 7.3.34
186
+ */
187
+ ret = fd_avp_search_avp(avp,
188
+ ogs_diam_s6a_apn_configuration_profile, &avpch1);
189
+ ogs_assert(ret == 0);
190
+ if (avpch1) {
191
+ ogs_slice_data_t *slice_data = NULL;
192
+
193
+ ret = fd_msg_browse(avpch1, MSG_BRW_FIRST_CHILD, &avpch2, NULL);
194
+ ogs_assert(ret == 0);
195
+
196
+ ogs_assert(subscription_data->num_of_slice == 0);
197
+ slice_data = &subscription_data->slice0;
198
+ while (avpch2) {
199
+ ret = fd_msg_avp_hdr(avpch2, &hdr);
200
+ ogs_assert(ret == 0);
201
open5gs_2.4.11.tar.xz/src/mme/mme-path.c -> open5gs_2.5.0.tar.xz/src/mme/mme-path.c
Changed
81
1
2
{
3
ogs_assert(mme_ue);
4
5
- switch (mme_ue->nas_eps.detach_type) {
6
- case MME_EPS_TYPE_DETACH_REQUEST_FROM_UE:
7
+ switch (mme_ue->detach_type) {
8
+ case MME_DETACH_TYPE_REQUEST_FROM_UE:
9
+ ogs_debug("Detach Request from UE");
10
if (SESSION_CONTEXT_IS_AVAILABLE(mme_ue)) {
11
mme_gtp_send_delete_all_sessions(
12
mme_ue, OGS_GTP_DELETE_SEND_DETACH_ACCEPT);
13
14
ogs_assert(OGS_OK == nas_eps_send_detach_accept(mme_ue));
15
}
16
break;
17
- case MME_EPS_TYPE_DETACH_REQUEST_TO_UE:
18
+
19
+ /* MME Explicit Detach, ie: O&M Procedures */
20
+ case MME_DETACH_TYPE_MME_EXPLICIT:
21
+ ogs_fatal("Not Implemented : MME_DETACH_TYPE_MME_EXPLICIT");
22
+ ogs_assert_if_reached();
23
+ break;
24
+
25
+ /* HSS Explicit Detach, ie: Subscription Withdrawl Cancel Location
26
+ *
27
+ * TS23.401 - V16.10.0
28
+ * Ch 5.3.8 Detach procedure
29
+ * Ch 5.3.8.4 HSS-initiated Detach procedure
30
+ */
31
+ case MME_DETACH_TYPE_HSS_EXPLICIT:
32
+ ogs_debug("Explicit HSS Detach");
33
if (SESSION_CONTEXT_IS_AVAILABLE(mme_ue)) {
34
mme_gtp_send_delete_all_sessions(mme_ue, OGS_GTP_DELETE_NO_ACTION);
35
}
36
break;
37
+
38
+ /* MME Implicit Detach, ie: Lost Communication */
39
+ case MME_DETACH_TYPE_MME_IMPLICIT:
40
+ ogs_fatal("Not Implemented : MME_DETACH_TYPE_MME_IMPLICIT");
41
+ ogs_assert_if_reached();
42
+ break;
43
+
44
+ /* HSS Implicit Detach, ie: MME-UPDATE-PROCEDURE
45
+ *
46
+ * TS23.401 - V16.10.0
47
+ * Ch 5.3.2 Attach procedure
48
+ * Ch 5.3.2.1 E-UTRAN Initial Attach
49
+ *
50
+ * 9. The HSS sends Cancel Location (IMSI, Cancellation Type)
51
+ * to the old MME. The old MME acknowledges with Cancel Location Ack (IMSI)
52
+ * and removes the MM and bearer contexts. If the ULR-Flags indicates
53
+ * "Initial-Attach-Indicator" and the HSS has the SGSN registration,
54
+ * then the HSS sends Cancel Location (IMSI, Cancellation Type)
55
+ * to the old SGSN. The Cancellation Type indicates the old MME/SGSN
56
+ * to release the old Serving GW resource.
57
+ */
58
+ case MME_DETACH_TYPE_HSS_IMPLICIT:
59
+ ogs_debug("Implicit HSS Detach");
60
+ if (SESSION_CONTEXT_IS_AVAILABLE(mme_ue)) {
61
+ mme_gtp_send_delete_all_sessions(mme_ue,
62
+ OGS_GTP_DELETE_SEND_RELEASE_WITH_UE_CONTEXT_REMOVE);
63
+ }
64
+ break;
65
+
66
default:
67
- ogs_fatal(" Invalid OGS_NAS_EPS TYPE%d", mme_ue->nas_eps.type);
68
+ ogs_fatal(" Invalid OGS_NAS_EPS TYPE%d", mme_ue->detach_type);
69
ogs_assert_if_reached();
70
}
71
}
72
73
74
if (SESSION_CONTEXT_IS_AVAILABLE(mme_ue)) {
75
mme_gtp_send_delete_all_sessions(mme_ue,
76
- OGS_GTP_DELETE_SEND_UE_CONTEXT_RELEASE_COMMAND);
77
+ OGS_GTP_DELETE_SEND_RELEASE_WITH_UE_CONTEXT_REMOVE);
78
} else {
79
enb_ue_t *enb_ue = enb_ue_cycle(mme_ue->enb_ue);
80
if (enb_ue) {
81
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
42
1
2
CLEAR_SGW_S1U_PATH(sess);
3
return;
4
5
- } else if (action == OGS_GTP_DELETE_SEND_UE_CONTEXT_RELEASE_COMMAND) {
6
+ } else if (action == OGS_GTP_DELETE_SEND_RELEASE_WITH_UE_CONTEXT_REMOVE) {
7
if (mme_sess_count(mme_ue) == 1) /* Last Session */ {
8
- enb_ue_t *enb_ue = NULL;
9
-
10
- enb_ue = enb_ue_cycle(mme_ue->enb_ue);
11
- if (enb_ue) {
12
+ if (ECM_IDLE(mme_ue)) {
13
+ mme_ue_hash_remove(mme_ue);
14
+ mme_ue_remove(mme_ue);
15
+ } else {
16
+ ogs_assert(mme_ue->enb_ue);
17
ogs_assert(OGS_OK ==
18
- s1ap_send_ue_context_release_command(enb_ue,
19
+ s1ap_send_ue_context_release_command(mme_ue->enb_ue,
20
S1AP_Cause_PR_nas, S1AP_CauseNas_normal_release,
21
S1AP_UE_CTX_REL_UE_CONTEXT_REMOVE, 0));
22
- } else
23
- ogs_error("ENB-S1 Context has already been removed");
24
+ }
25
}
26
27
- } else if (action == OGS_GTP_DELETE_SEND_S1_REMOVE_AND_UNLINK) {
28
+ } else if (action ==
29
+ OGS_GTP_DELETE_SEND_RELEASE_WITH_S1_REMOVE_AND_UNLINK) {
30
if (mme_sess_count(mme_ue) == 1) /* Last Session */ {
31
enb_ue_t *enb_ue = NULL;
32
33
34
}
35
}
36
37
- } else if (action == OGS_GTP_DELETE_UE_CONTEXT_REMOVE) {
38
+ } else if (action == OGS_GTP_DELETE_UE_CONTEXT_REMOVE_PARTIAL) {
39
40
/* Remove MME-UE Context with Session Context since IMSI duplicated */
41
mme_ue_remove(mme_ue);
42
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
201
1
2
static uint8_t emm_cause_from_diameter(
3
const uint32_t *dia_err, const uint32_t *dia_exp_err);
4
5
+static uint8_t mme_ue_session_from_slice_data(mme_ue_t *mme_ue,
6
+ ogs_slice_data_t *slice_data);
7
+
8
uint8_t mme_s6a_handle_aia(
9
mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message)
10
{
11
12
ogs_diam_s6a_ula_message_t *ula_message = NULL;
13
ogs_subscription_data_t *subscription_data = NULL;
14
ogs_slice_data_t *slice_data = NULL;
15
- int i, rv;
16
+ int rv, num_of_session;
17
18
ogs_assert(mme_ue);
19
ogs_assert(s6a_message);
20
21
22
mme_session_remove_all(mme_ue);
23
24
- for (i = 0; i < slice_data->num_of_session; i++) {
25
- if (i >= OGS_MAX_NUM_OF_SESS) {
26
- ogs_warn("Ignore max session count overflow %d>=%d",
27
- slice_data->num_of_session, OGS_MAX_NUM_OF_SESS);
28
- break;
29
- }
30
-
31
- if (slice_data->sessioni.name) {
32
- mme_ue->sessioni.name = ogs_strdup(slice_data->sessioni.name);
33
- ogs_assert(mme_ue->sessioni.name);
34
- }
35
-
36
- mme_ue->sessioni.context_identifier =
37
- slice_data->sessioni.context_identifier;
38
-
39
- if (slice_data->sessioni.session_type == OGS_PDU_SESSION_TYPE_IPV4 ||
40
- slice_data->sessioni.session_type == OGS_PDU_SESSION_TYPE_IPV6 ||
41
- slice_data->sessioni.session_type ==
42
- OGS_PDU_SESSION_TYPE_IPV4V6) {
43
- mme_ue->sessioni.session_type =
44
- slice_data->sessioni.session_type;
45
- } else {
46
- ogs_error("Invalid PDN_TYPE%d",
47
- slice_data->sessioni.session_type);
48
- if (mme_ue->sessioni.name)
49
- ogs_free(mme_ue->sessioni.name);
50
- break;
51
- }
52
- memcpy(&mme_ue->sessioni.paa, &slice_data->sessioni.paa,
53
- sizeof(mme_ue->sessioni.paa));
54
-
55
- memcpy(&mme_ue->sessioni.qos, &slice_data->sessioni.qos,
56
- sizeof(mme_ue->sessioni.qos));
57
- memcpy(&mme_ue->sessioni.ambr, &slice_data->sessioni.ambr,
58
- sizeof(mme_ue->sessioni.ambr));
59
-
60
- memcpy(&mme_ue->sessioni.smf_ip, &slice_data->sessioni.smf_ip,
61
- sizeof(mme_ue->sessioni.smf_ip));
62
-
63
- memcpy(&mme_ue->sessioni.charging_characteristics,
64
- &slice_data->sessioni.charging_characteristics,
65
- sizeof(mme_ue->sessioni.charging_characteristics));
66
- mme_ue->sessioni.charging_characteristics_presence =
67
- slice_data->sessioni.charging_characteristics_presence;
68
- }
69
-
70
- if (i == 0) {
71
+ num_of_session = mme_ue_session_from_slice_data(mme_ue, slice_data);
72
+ if (num_of_session == 0) {
73
ogs_error("No Session");
74
return OGS_NAS_EMM_CAUSE_SEVERE_NETWORK_FAILURE;
75
}
76
+ mme_ue->num_of_session = num_of_session;
77
78
- mme_ue->num_of_session = i;
79
mme_ue->context_identifier = slice_data->context_identifier;
80
81
if (mme_ue->nas_eps.type == MME_EPS_TYPE_ATTACH_REQUEST) {
82
83
return OGS_NAS_EMM_CAUSE_REQUEST_ACCEPTED;
84
}
85
86
-void mme_s6a_handle_clr(
87
- mme_ue_t *mme_ue, ogs_diam_s6a_clr_message_t *clr_message)
88
+uint8_t mme_s6a_handle_idr(
89
+ mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message)
90
+{
91
+ ogs_diam_s6a_idr_message_t *idr_message = NULL;
92
+ ogs_subscription_data_t *subscription_data = NULL;
93
+ ogs_slice_data_t *slice_data = NULL;
94
+ int num_of_session;
95
+
96
+ ogs_assert(mme_ue);
97
+ ogs_assert(s6a_message);
98
+ idr_message = &s6a_message->idr_message;
99
+ ogs_assert(idr_message);
100
+ subscription_data = &idr_message->subscription_data;
101
+ ogs_assert(subscription_data);
102
+
103
+ if (idr_message->subdatamask & OGS_DIAM_S6A_SUBDATA_UEAMBR) {
104
+ memcpy(&mme_ue->ambr, &subscription_data->ambr, sizeof(ogs_bitrate_t));
105
+ }
106
+
107
+ if (idr_message->subdatamask & OGS_DIAM_S6A_SUBDATA_APN_CONFIG) {
108
+ ogs_assert(subscription_data->num_of_slice == 1);
109
+ slice_data = &subscription_data->slice0;
110
+
111
+ if (slice_data->all_apn_config_inc ==
112
+ OGS_ALL_APN_CONFIGURATIONS_INCLUDED) {
113
+ mme_session_remove_all(mme_ue);
114
+ num_of_session = mme_ue_session_from_slice_data(mme_ue, slice_data);
115
+ if (num_of_session == 0) {
116
+ ogs_error("No Session");
117
+ return OGS_ERROR;
118
+ }
119
+ mme_ue->num_of_session = num_of_session;
120
+ } else {
121
+ ogs_error ("%d Partial APN-Configuration Not Supported in IDR.",
122
+ slice_data->all_apn_config_inc);
123
+ return OGS_ERROR;
124
+ }
125
+
126
+ mme_ue->context_identifier = slice_data->context_identifier;
127
+ }
128
+
129
+ return OGS_OK;
130
+}
131
+
132
+void mme_s6a_handle_clr(mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message)
133
{
134
+ ogs_diam_s6a_clr_message_t *clr_message = NULL;
135
ogs_assert(mme_ue);
136
- ogs_assert(clr_message);
137
+ ogs_assert(s6a_message);
138
+ clr_message = &s6a_message->clr_message;
139
+ ogs_assert(clr_message);
140
+
141
+ mme_ue = mme_ue_cycle(mme_ue);
142
+ if (!mme_ue) {
143
+ ogs_warn("UE(mme-ue) context has already been removed");
144
+ return;
145
+ }
146
+
147
+ /*
148
+ * This causes issues in this scenario:
149
+ * 1. UE attaches
150
+ * 2. UE detaches (Airplane Mode)
151
+ * 3. Cancel Location is triggered by HSS
152
+ *
153
+ * If Cancel Locations are performed, UE(mme-ue) context must be removed.
154
+ */
155
+ if (OGS_FSM_CHECK(&mme_ue->sm, emm_state_de_registered)) {
156
+ ogs_warn("UE has already been de-registered");
157
+ mme_ue_hash_remove(mme_ue);
158
+ mme_ue_remove(mme_ue);
159
+ return;
160
+ }
161
162
/* Set EPS Detach */
163
memset(&mme_ue->nas_eps.detach, 0, sizeof(ogs_nas_detach_type_t));
164
165
*
166
* So, we will lose the MME_EPS_TYPE_DETACH_REQUEST_TO_UE.
167
*
168
- * We need more variable(nas_eps.detach_type)
169
+ * We need more variable(detach_type)
170
* to keep Detach-Type whether UE-initiated or MME-initiaed. */
171
- mme_ue->nas_eps.type = mme_ue->nas_eps.detach_type =
172
- MME_EPS_TYPE_DETACH_REQUEST_TO_UE;
173
+ mme_ue->nas_eps.type = MME_EPS_TYPE_DETACH_REQUEST_TO_UE;
174
+
175
ogs_debug(" OGS_NAS_EPS TYPE%d", mme_ue->nas_eps.type);
176
177
- if (OGS_FSM_CHECK(&mme_ue->sm, emm_state_de_registered)) {
178
- /* Remove all trace of subscriber even when detached. */
179
- mme_ue_hash_remove(mme_ue);
180
- mme_ue_remove(mme_ue);
181
- } else if (ECM_IDLE(mme_ue)) {
182
- MME_STORE_PAGING_INFO(mme_ue, MME_PAGING_TYPE_DETACH_TO_UE, NULL);
183
- ogs_assert(OGS_OK == s1ap_send_paging(mme_ue, S1AP_CNDomain_ps));
184
- } else {
185
- ogs_assert(OGS_OK == nas_eps_send_detach_request(mme_ue));
186
+ switch (clr_message->cancellation_type) {
187
+ case OGS_DIAM_S6A_CT_SUBSCRIPTION_WITHDRAWL:
188
+ mme_ue->detach_type = MME_DETACH_TYPE_HSS_EXPLICIT;
189
+
190
+ /*
191
+ * Before sending Detach-Request,
192
+ * we need to check whether UE is IDLE or not.
193
+ */
194
+ if (ECM_IDLE(mme_ue)) {
195
+ MME_STORE_PAGING_INFO(mme_ue, MME_PAGING_TYPE_DETACH_TO_UE, NULL);
196
+ ogs_assert(OGS_OK == s1ap_send_paging(mme_ue, S1AP_CNDomain_ps));
197
+ } else {
198
+ ogs_assert(OGS_OK == nas_eps_send_detach_request(mme_ue));
199
+ if (MME_P_TMSI_IS_AVAILABLE(mme_ue)) {
200
+ ogs_assert(OGS_OK == sgsap_send_detach_indication(mme_ue));
201
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
13
1
2
mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message);
3
uint8_t mme_s6a_handle_ula(
4
mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message);
5
+uint8_t mme_s6a_handle_idr(
6
+ mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message);
7
void mme_s6a_handle_clr(
8
- mme_ue_t *mme_ue, ogs_diam_s6a_clr_message_t *clr_message);
9
+ mme_ue_t *mme_ue, ogs_diam_s6a_message_t *s6a_message);
10
11
#ifdef __cplusplus
12
}
13
open5gs_2.4.11.tar.xz/src/mme/mme-sm.c -> open5gs_2.5.0.tar.xz/src/mme/mme-sm.c
Changed
36
1
2
mme_ue = mme_ue_find_by_message(&nas_message);
3
if (!mme_ue) {
4
mme_ue = mme_ue_add(enb_ue);
5
- ogs_assert(mme_ue);
6
+ if (mme_ue == NULL) {
7
+ ogs_expect(OGS_OK ==
8
+ s1ap_send_ue_context_release_command(enb_ue,
9
+ S1AP_Cause_PR_misc,
10
+ S1AP_CauseMisc_control_processing_overload,
11
+ S1AP_UE_CTX_REL_S1_CONTEXT_REMOVE, 0));
12
+ ogs_pkbuf_free(pkbuf);
13
+ return;
14
+ }
15
} else {
16
/* Here, if the MME_UE Context is found,
17
* the integrity check is not performed
18
19
}
20
break;
21
case OGS_DIAM_S6A_CMD_CODE_CANCEL_LOCATION:
22
- mme_s6a_handle_clr(mme_ue, &s6a_message->clr_message);
23
+ mme_s6a_handle_clr(mme_ue, s6a_message);
24
break;
25
case OGS_DIAM_S6A_CMD_CODE_INSERT_SUBSCRIBER_DATA:
26
+ mme_s6a_handle_idr(mme_ue, s6a_message);
27
break;
28
default:
29
ogs_error("Invalid Type%d", s6a_message->cmd_code);
30
break;
31
}
32
+ ogs_subscription_data_free(&s6a_message->idr_message.subscription_data);
33
ogs_subscription_data_free(&s6a_message->ula_message.subscription_data);
34
ogs_free(s6a_message);
35
break;
36
open5gs_2.4.11.tar.xz/src/mme/s1ap-handler.c -> open5gs_2.5.0.tar.xz/src/mme/s1ap-handler.c
Changed
16
1
2
enb_ue = enb_ue_find_by_enb_ue_s1ap_id(enb, *ENB_UE_S1AP_ID);
3
if (!enb_ue) {
4
enb_ue = enb_ue_add(enb, *ENB_UE_S1AP_ID);
5
- ogs_assert(enb_ue);
6
+ if (enb_ue == NULL) {
7
+ ogs_assert(OGS_OK ==
8
+ s1ap_send_error_indication(enb, NULL, NULL,
9
+ S1AP_Cause_PR_misc,
10
+ S1AP_CauseMisc_control_processing_overload));
11
+ return;
12
+ }
13
14
/* Find MME_UE if S_TMSI included */
15
if (S_TMSI) {
16
open5gs_2.4.11.tar.xz/src/mme/s1ap-path.c -> open5gs_2.5.0.tar.xz/src/mme/s1ap-path.c
Changed
16
1
2
ogs_assert(target_enb);
3
4
target_ue = enb_ue_add(target_enb, INVALID_UE_S1AP_ID);
5
- ogs_assert(target_ue);
6
+ if (target_ue == NULL) {
7
+ ogs_assert(OGS_OK ==
8
+ s1ap_send_error_indication(target_enb, NULL, NULL,
9
+ S1AP_Cause_PR_misc,
10
+ S1AP_CauseMisc_control_processing_overload));
11
+ return OGS_ERROR;
12
+ }
13
14
ogs_info(" Source : ENB_UE_S1AP_ID%d MME_UE_S1AP_ID%d",
15
source_ue->enb_ue_s1ap_id, source_ue->mme_ue_s1ap_id);
16
open5gs_2.4.11.tar.xz/src/nrf/context.c -> open5gs_2.5.0.tar.xz/src/nrf/context.c
Changed
16
1
2
ogs_assert(context_initialized == 1);
3
4
ogs_list_for_each_safe(
5
- &ogs_sbi_self()->nf_instance_list, next_nf_instance, nf_instance)
6
- if (OGS_FSM_STATE(&nf_instance->sm)) nrf_nf_fsm_fini(nf_instance);
7
+ &ogs_sbi_self()->nf_instance_list, next_nf_instance, nf_instance) {
8
+ if (NF_INSTANCE_TYPE_IS_NRF(nf_instance))
9
+ continue;
10
+ if (OGS_FSM_STATE(&nf_instance->sm))
11
+ nrf_nf_fsm_fini(nf_instance);
12
+ }
13
14
context_initialized = 0;
15
}
16
open5gs_2.4.11.tar.xz/src/nrf/event.c -> open5gs_2.5.0.tar.xz/src/nrf/event.c
Changed
66
1
2
#include "event.h"
3
#include "context.h"
4
5
-static OGS_POOL(pool, nrf_event_t);
6
-
7
-void nrf_event_init(void)
8
-{
9
- ogs_pool_init(&pool, ogs_app()->pool.event);
10
-}
11
-
12
-void nrf_event_final(void)
13
-{
14
- ogs_pool_final(&pool);
15
-}
16
-
17
-nrf_event_t *nrf_event_new(nrf_event_e id)
18
+nrf_event_t *nrf_event_new(int id)
19
{
20
nrf_event_t *e = NULL;
21
22
- ogs_pool_alloc(&pool, &e);
23
+ e = ogs_event_size(id, sizeof(nrf_event_t));
24
ogs_assert(e);
25
- memset(e, 0, sizeof(*e));
26
27
- e->id = id;
28
+ e->h.id = id;
29
30
return e;
31
}
32
33
-void nrf_event_free(nrf_event_t *e)
34
-{
35
- ogs_assert(e);
36
- ogs_pool_free(&pool, e);
37
-}
38
-
39
const char *nrf_event_get_name(nrf_event_t *e)
40
{
41
if (e == NULL)
42
return OGS_FSM_NAME_INIT_SIG;
43
44
- switch (e->id) {
45
+ switch (e->h.id) {
46
case OGS_FSM_ENTRY_SIG:
47
return OGS_FSM_NAME_ENTRY_SIG;
48
case OGS_FSM_EXIT_SIG:
49
return OGS_FSM_NAME_EXIT_SIG;
50
51
- case NRF_EVT_SBI_SERVER:
52
- return "NRF_EVT_SBI_SERVER";
53
- case NRF_EVT_SBI_CLIENT:
54
- return "NRF_EVT_SBI_CLIENT";
55
- case NRF_EVT_SBI_TIMER:
56
- return "NRF_EVT_SBI_TIMER";
57
+ case OGS_EVENT_SBI_SERVER:
58
+ return OGS_EVENT_NAME_SBI_SERVER;
59
+ case OGS_EVENT_SBI_CLIENT:
60
+ return OGS_EVENT_NAME_SBI_CLIENT;
61
+ case OGS_EVENT_SBI_TIMER:
62
+ return OGS_EVENT_NAME_SBI_TIMER;
63
64
default:
65
break;
66
open5gs_2.4.11.tar.xz/src/nrf/event.h -> open5gs_2.5.0.tar.xz/src/nrf/event.h
Changed
48
1
2
extern "C" {
3
#endif
4
5
-typedef struct ogs_sbi_request_s ogs_sbi_request_t;
6
-typedef struct ogs_sbi_response_s ogs_sbi_response_t;
7
-typedef struct ogs_sbi_message_s ogs_sbi_message_t;
8
typedef struct ogs_sbi_nf_instance_s ogs_sbi_nf_instance_t;
9
typedef struct ogs_sbi_subscription_data_s ogs_sbi_subscription_data_t;
10
11
-typedef enum {
12
- NRF_EVT_BASE = OGS_MAX_NUM_OF_PROTO_EVENT,
13
-
14
- NRF_EVT_SBI_SERVER,
15
- NRF_EVT_SBI_CLIENT,
16
- NRF_EVT_SBI_TIMER,
17
-
18
- NRF_EVT_TOP,
19
-
20
-} nrf_event_e;
21
-
22
typedef struct nrf_event_s {
23
- int id;
24
- int timer_id;
25
-
26
- struct {
27
- ogs_sbi_request_t *request;
28
- ogs_sbi_response_t *response;
29
- void *data;
30
-
31
- ogs_sbi_message_t *message;
32
- } sbi;
33
+ ogs_event_t h;
34
35
ogs_sbi_nf_instance_t *nf_instance;
36
ogs_sbi_subscription_data_t *subscription_data;
37
} nrf_event_t;
38
39
-void nrf_event_init(void);
40
-void nrf_event_final(void);
41
-
42
-nrf_event_t *nrf_event_new(nrf_event_e id);
43
-void nrf_event_free(nrf_event_t *e);
44
+nrf_event_t *nrf_event_new(int id);
45
46
const char *nrf_event_get_name(nrf_event_t *e);
47
48
open5gs_2.4.11.tar.xz/src/nrf/init.c -> open5gs_2.5.0.tar.xz/src/nrf/init.c
Changed
27
1
2
ogs_sbi_context_init();
3
4
nrf_context_init();
5
- nrf_event_init();
6
7
rv = ogs_sbi_context_parse_config("nrf", NULL, "scp");
8
if (rv != OGS_OK) return rv;
9
10
11
nrf_context_final();
12
ogs_sbi_context_final();
13
-
14
- nrf_event_final(); /* Destroy event */
15
}
16
17
static void nrf_main(void *data)
18
19
20
ogs_assert(e);
21
ogs_fsm_dispatch(&nrf_sm, e);
22
- nrf_event_free(e);
23
+ ogs_event_free(e);
24
}
25
}
26
done:
27
open5gs_2.4.11.tar.xz/src/nrf/nf-sm.c -> open5gs_2.5.0.tar.xz/src/nrf/nf-sm.c
Changed
64
1
2
nf_instance = e->nf_instance;
3
ogs_assert(nf_instance);
4
5
- switch (e->id) {
6
+ switch (e->h.id) {
7
case OGS_FSM_ENTRY_SIG:
8
break;
9
10
case OGS_FSM_EXIT_SIG:
11
break;
12
13
- case NRF_EVT_SBI_SERVER:
14
- message = e->sbi.message;
15
+ case OGS_EVENT_SBI_SERVER:
16
+ message = e->h.sbi.message;
17
ogs_assert(message);
18
- stream = e->sbi.data;
19
+ stream = e->h.sbi.data;
20
ogs_assert(stream);
21
22
SWITCH(message->h.service.name)
23
24
nf_instance = e->nf_instance;
25
ogs_assert(nf_instance);
26
27
- switch (e->id) {
28
+ switch (e->h.id) {
29
case OGS_FSM_ENTRY_SIG:
30
ogs_info("%s NF registered Heartbeat:%ds",
31
nf_instance->id, nf_instance->time.heartbeat_interval);
32
33
OpenAPI_notification_event_type_NF_DEREGISTERED, nf_instance));
34
break;
35
36
- case NRF_EVT_SBI_SERVER:
37
- message = e->sbi.message;
38
+ case OGS_EVENT_SBI_SERVER:
39
+ message = e->h.sbi.message;
40
ogs_assert(message);
41
- stream = e->sbi.data;
42
+ stream = e->h.sbi.data;
43
ogs_assert(stream);
44
45
SWITCH(message->h.service.name)
46
47
48
nrf_sm_debug(e);
49
50
- switch (e->id) {
51
+ switch (e->h.id) {
52
case OGS_FSM_ENTRY_SIG:
53
break;
54
case OGS_FSM_EXIT_SIG:
55
56
57
nrf_sm_debug(e);
58
59
- switch (e->id) {
60
+ switch (e->h.id) {
61
case OGS_FSM_ENTRY_SIG:
62
break;
63
case OGS_FSM_EXIT_SIG:
64
open5gs_2.4.11.tar.xz/src/nrf/nnrf-build.c -> open5gs_2.5.0.tar.xz/src/nrf/nnrf-build.c
Changed
67
1
2
message.http.accept = (char *)OGS_SBI_CONTENT_PROBLEM_TYPE;
3
4
NotificationData = ogs_calloc(1, sizeof(*NotificationData));
5
- ogs_expect_or_return_val(NotificationData, NULL);
6
+ if (!NotificationData) {
7
+ ogs_error("No NotificationData");
8
+ goto end;
9
+ }
10
11
NotificationData->event = event;
12
13
server = ogs_list_first(&ogs_sbi_self()->server_list);
14
- ogs_expect_or_return_val(server, NULL);
15
+ if (!server) {
16
+ ogs_error("No server");
17
+ goto end;
18
+ }
19
20
memset(&header, 0, sizeof(header));
21
header.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM;
22
23
header.resource.component1 = nf_instance->id;
24
25
NotificationData->nf_instance_uri = ogs_sbi_server_uri(server, &header);
26
- ogs_expect_or_return_val(NotificationData->nf_instance_uri, NULL);
27
+ if (!server) {
28
+ ogs_error("No nf_instance_uri");
29
+ goto end;
30
+ }
31
32
if (event != OpenAPI_notification_event_type_NF_DEREGISTERED) {
33
NotificationData->nf_profile =
34
35
subscription_data->subscr_cond.service_name,
36
NULL,
37
subscription_data->requester_features);
38
- ogs_expect_or_return_val(NotificationData->nf_profile, NULL);
39
+ if (!NotificationData->nf_profile) {
40
+ ogs_error("No nf_profile");
41
+ goto end;
42
+ }
43
}
44
45
message.NotificationData = NotificationData;
46
47
request = ogs_sbi_build_request(&message);
48
- ogs_expect_or_return_val(request, NULL);
49
+ ogs_expect(request);
50
51
- if (NotificationData->nf_profile)
52
- ogs_nnrf_nfm_free_nf_profile(NotificationData->nf_profile);
53
+end:
54
55
- ogs_free(NotificationData->nf_instance_uri);
56
- ogs_free(NotificationData);
57
+ if (NotificationData) {
58
+ if (NotificationData->nf_profile)
59
+ ogs_nnrf_nfm_free_nf_profile(NotificationData->nf_profile);
60
+ if (NotificationData->nf_instance_uri)
61
+ ogs_free(NotificationData->nf_instance_uri);
62
+ ogs_free(NotificationData);
63
+ }
64
65
return request;
66
}
67
open5gs_2.4.11.tar.xz/src/nrf/nnrf-handler.c -> open5gs_2.5.0.tar.xz/src/nrf/nnrf-handler.c
Changed
10
1
2
return false;
3
}
4
5
- ogs_sbi_nnrf_handle_nf_profile(nf_instance, NFProfile);
6
+ ogs_nnrf_nfm_handle_nf_profile(nf_instance, NFProfile);
7
8
if (OGS_FSM_CHECK(&nf_instance->sm, nrf_nf_state_will_register)) {
9
recvmsg->http.location = recvmsg->h.uri;
10
open5gs_2.4.11.tar.xz/src/nrf/nrf-sm.c -> open5gs_2.5.0.tar.xz/src/nrf/nrf-sm.c
Changed
52
1
2
3
ogs_assert(s);
4
5
- switch (e->id) {
6
+ switch (e->h.id) {
7
case OGS_FSM_ENTRY_SIG:
8
break;
9
10
case OGS_FSM_EXIT_SIG:
11
break;
12
13
- case NRF_EVT_SBI_SERVER:
14
- request = e->sbi.request;
15
+ case OGS_EVENT_SBI_SERVER:
16
+ request = e->h.sbi.request;
17
ogs_assert(request);
18
- stream = e->sbi.data;
19
+ stream = e->h.sbi.data;
20
ogs_assert(stream);
21
22
rv = ogs_sbi_parse_request(&message, request);
23
24
e->nf_instance = nf_instance;
25
ogs_assert(OGS_FSM_STATE(&nf_instance->sm));
26
27
- e->sbi.message = &message;
28
+ e->h.sbi.message = &message;
29
ogs_fsm_dispatch(&nf_instance->sm, e);
30
if (OGS_FSM_CHECK(&nf_instance->sm,
31
nrf_nf_state_de_registered)) {
32
33
ogs_sbi_message_free(&message);
34
break;
35
36
- case NRF_EVT_SBI_TIMER:
37
- switch(e->timer_id) {
38
+ case OGS_EVENT_SBI_TIMER:
39
+ switch(e->h.timer_id) {
40
case NRF_TIMER_NF_INSTANCE_NO_HEARTBEAT:
41
nf_instance = e->nf_instance;
42
ogs_assert(nf_instance);
43
44
45
default:
46
ogs_error("Unknown timer%s:%d",
47
- nrf_timer_get_name(e->timer_id), e->timer_id);
48
+ nrf_timer_get_name(e->h.timer_id), e->h.timer_id);
49
}
50
break;
51
52
open5gs_2.4.11.tar.xz/src/nrf/sbi-path.c -> open5gs_2.5.0.tar.xz/src/nrf/sbi-path.c
Changed
82
1
2
3
#include "sbi-path.h"
4
5
-static int server_cb(ogs_sbi_request_t *request, void *data)
6
-{
7
- nrf_event_t *e = NULL;
8
- int rv;
9
-
10
- ogs_assert(request);
11
- ogs_assert(data);
12
-
13
- e = nrf_event_new(NRF_EVT_SBI_SERVER);
14
- ogs_assert(e);
15
-
16
- e->sbi.request = request;
17
- e->sbi.data = data;
18
-
19
- rv = ogs_queue_push(ogs_app()->queue, e);
20
- if (rv != OGS_OK) {
21
- if (rv != OGS_DONE)
22
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
23
- else
24
- ogs_warn("ogs_queue_push() failed:%d", (int)rv);
25
- ogs_sbi_request_free(request);
26
- nrf_event_free(e);
27
- return OGS_ERROR;
28
- }
29
-
30
- return OGS_OK;
31
-}
32
-
33
static int client_notify_cb(
34
int status, ogs_sbi_response_t *response, void *data)
35
{
36
37
38
int nrf_sbi_open(void)
39
{
40
- if (ogs_sbi_server_start_all(server_cb) != OGS_OK)
41
+ ogs_sbi_nf_instance_t *nf_instance = NULL;
42
+
43
+ /* Initialize SELF NF instance */
44
+ nf_instance = ogs_sbi_self()->nf_instance;
45
+ ogs_assert(nf_instance);
46
+
47
+ /* Build NF instance information. */
48
+ ogs_sbi_nf_instance_build_default(nf_instance, OpenAPI_nf_type_NRF);
49
+
50
+ if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK)
51
return OGS_ERROR;
52
53
return OGS_OK;
54
55
OpenAPI_notification_event_type_e event,
56
ogs_sbi_nf_instance_t *nf_instance)
57
{
58
+ bool rc;
59
ogs_sbi_request_t *request = NULL;
60
ogs_sbi_client_t *client = NULL;
61
62
ogs_assert(subscription_data);
63
client = subscription_data->client;
64
- ogs_assert(client);
65
+ ogs_expect_or_return_val(client, false);
66
67
request = nrf_nnrf_nfm_build_nf_status_notify(
68
subscription_data, event, nf_instance);
69
ogs_expect_or_return_val(request, false);
70
71
- return ogs_sbi_scp_send_request(client, client_notify_cb, request, NULL);
72
+ rc = ogs_sbi_send_request_to_client(
73
+ client, client_notify_cb, request, NULL);
74
+ ogs_expect(rc == true);
75
+
76
+ ogs_sbi_request_free(request);
77
+
78
+ return rc;
79
}
80
81
bool nrf_nnrf_nfm_send_nf_status_notify_all(
82
open5gs_2.4.11.tar.xz/src/nrf/timer.c -> open5gs_2.5.0.tar.xz/src/nrf/timer.c
Changed
60
1
2
3
#include "context.h"
4
5
-const char *nrf_timer_get_name(nrf_timer_e id)
6
+const char *nrf_timer_get_name(int timer_id)
7
{
8
- switch (id) {
9
+ switch (timer_id) {
10
+ case OGS_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL:
11
+ return OGS_TIMER_NAME_NF_INSTANCE_REGISTRATION_INTERVAL;
12
+ case OGS_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL:
13
+ return OGS_TIMER_NAME_NF_INSTANCE_HEARTBEAT_INTERVAL;
14
+ case OGS_TIMER_NF_INSTANCE_NO_HEARTBEAT:
15
+ return OGS_TIMER_NAME_NF_INSTANCE_NO_HEARTBEAT;
16
+ case OGS_TIMER_NF_INSTANCE_VALIDITY:
17
+ return OGS_TIMER_NAME_NF_INSTANCE_VALIDITY;
18
+ case OGS_TIMER_SUBSCRIPTION_VALIDITY:
19
+ return OGS_TIMER_NAME_SUBSCRIPTION_VALIDITY;
20
+ case OGS_TIMER_SBI_CLIENT_WAIT:
21
+ return OGS_TIMER_NAME_SBI_CLIENT_WAIT;
22
case NRF_TIMER_NF_INSTANCE_NO_HEARTBEAT:
23
return "NRF_TIMER_NF_INSTANCE_NO_HEARTBEAT";
24
case NRF_TIMER_SUBSCRIPTION_VALIDITY:
25
26
break;
27
}
28
29
+ ogs_error("Unknown Timer%d", timer_id);
30
return "UNKNOWN_TIMER";
31
}
32
33
34
35
switch (timer_id) {
36
case NRF_TIMER_NF_INSTANCE_NO_HEARTBEAT:
37
- e = nrf_event_new(NRF_EVT_SBI_TIMER);
38
- e->timer_id = timer_id;
39
+ e = nrf_event_new(OGS_EVENT_SBI_TIMER);
40
+ e->h.timer_id = timer_id;
41
e->nf_instance = data;
42
break;
43
case NRF_TIMER_SUBSCRIPTION_VALIDITY:
44
- e = nrf_event_new(NRF_EVT_SBI_TIMER);
45
- e->timer_id = timer_id;
46
+ e = nrf_event_new(OGS_EVENT_SBI_TIMER);
47
+ e->h.timer_id = timer_id;
48
e->subscription_data = data;
49
break;
50
default:
51
52
rv = ogs_queue_push(ogs_app()->queue, e);
53
if (rv != OGS_OK) {
54
ogs_error("ogs_queue_push() failed:%d", (int)rv);
55
- nrf_event_free(e);
56
+ ogs_event_free(e);
57
}
58
}
59
60
open5gs_2.4.11.tar.xz/src/nrf/timer.h -> open5gs_2.5.0.tar.xz/src/nrf/timer.h
Changed
19
1
2
3
/* forward declaration */
4
typedef enum {
5
- NRF_TIMER_BASE = 0,
6
+ NRF_TIMER_BASE = OGS_MAX_NUM_OF_PROTO_TIMER,
7
8
NRF_TIMER_NF_INSTANCE_NO_HEARTBEAT,
9
NRF_TIMER_SUBSCRIPTION_VALIDITY,
10
11
12
} nrf_timer_e;
13
14
-const char *nrf_timer_get_name(nrf_timer_e id);
15
+const char *nrf_timer_get_name(int timer_id);
16
17
void nrf_timer_nf_instance_no_heartbeat(void *data);
18
void nrf_timer_subscription_validity(void *data);
19
open5gs_2.4.11.tar.xz/src/nssf/event.h -> open5gs_2.5.0.tar.xz/src/nssf/event.h
Changed
10
1
2
ogs_event_t h;
3
} nssf_event_t;
4
5
+OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(nssf_event_t));
6
+
7
nssf_event_t *nssf_event_new(int id);
8
9
const char *nssf_event_get_name(nssf_event_t *e);
10
open5gs_2.4.11.tar.xz/src/nssf/nssf-sm.c -> open5gs_2.5.0.tar.xz/src/nssf/nssf-sm.c
Changed
10
1
2
CASE(OGS_SBI_HTTP_METHOD_POST)
3
if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED ||
4
message.res_status == OGS_SBI_HTTP_STATUS_OK) {
5
- ogs_nnrf_handle_nf_status_subscribe(
6
+ ogs_nnrf_nfm_handle_nf_status_subscribe(
7
subscription_data, &message);
8
} else {
9
ogs_error("%s HTTP response error %d",
10
open5gs_2.4.11.tar.xz/src/nssf/sbi-path.c -> open5gs_2.5.0.tar.xz/src/nssf/sbi-path.c
Changed
93
1
2
3
#include "sbi-path.h"
4
5
-static int server_cb(ogs_sbi_request_t *request, void *data)
6
-{
7
- nssf_event_t *e = NULL;
8
- int rv;
9
-
10
- ogs_assert(request);
11
- ogs_assert(data);
12
-
13
- e = nssf_event_new(OGS_EVENT_SBI_SERVER);
14
- ogs_assert(e);
15
-
16
- e->h.sbi.request = request;
17
- e->h.sbi.data = data;
18
-
19
- rv = ogs_queue_push(ogs_app()->queue, e);
20
- if (rv != OGS_OK) {
21
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
22
- ogs_sbi_request_free(request);
23
- ogs_event_free(e);
24
- return OGS_ERROR;
25
- }
26
-
27
- return OGS_OK;
28
-}
29
-
30
-static int client_cb(int status, ogs_sbi_response_t *response, void *data)
31
-{
32
- nssf_event_t *e = NULL;
33
- int rv;
34
-
35
- if (status != OGS_OK) {
36
- ogs_log_message(
37
- status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0,
38
- "client_cb() failed %d", status);
39
- return OGS_ERROR;
40
- }
41
-
42
- ogs_assert(response);
43
-
44
- e = nssf_event_new(OGS_EVENT_SBI_CLIENT);
45
- ogs_assert(e);
46
- e->h.sbi.response = response;
47
- e->h.sbi.data = data;
48
-
49
- rv = ogs_queue_push(ogs_app()->queue, e);
50
- if (rv != OGS_OK) {
51
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
52
- ogs_sbi_response_free(response);
53
- ogs_event_free(e);
54
- return OGS_ERROR;
55
- }
56
-
57
- return OGS_OK;
58
-}
59
-
60
int nssf_sbi_open(void)
61
{
62
ogs_sbi_nf_instance_t *nf_instance = NULL;
63
ogs_sbi_nf_service_t *service = NULL;
64
65
- /* Add SELF NF instance */
66
+ /* Initialize SELF NF instance */
67
nf_instance = ogs_sbi_self()->nf_instance;
68
ogs_assert(nf_instance);
69
ogs_sbi_nf_fsm_init(nf_instance);
70
71
72
/* Initialize NRF NF Instance */
73
nf_instance = ogs_sbi_self()->nrf_instance;
74
- if (nf_instance) {
75
- ogs_sbi_client_t *client = NULL;
76
-
77
- /* Client callback is only used when NF sends to NRF */
78
- client = nf_instance->client;
79
- ogs_assert(client);
80
- client->cb = client_cb;
81
-
82
- /* NFRegister is sent and the response is received
83
- * by the above client callback. */
84
+ if (nf_instance)
85
ogs_sbi_nf_fsm_init(nf_instance);
86
- }
87
88
- if (ogs_sbi_server_start_all(server_cb) != OGS_OK)
89
+ if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK)
90
return OGS_ERROR;
91
92
return OGS_OK;
93
open5gs_2.4.11.tar.xz/src/pcf/event.h -> open5gs_2.5.0.tar.xz/src/pcf/event.h
Changed
10
1
2
pcf_app_t *app;
3
} pcf_event_t;
4
5
+OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(pcf_event_t));
6
+
7
pcf_event_t *pcf_event_new(int id);
8
9
const char *pcf_event_get_name(pcf_event_t *e);
10
open5gs_2.4.11.tar.xz/src/pcf/naf-build.c -> open5gs_2.5.0.tar.xz/src/pcf/naf-build.c
Changed
22
1
2
message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST;
3
message.h.uri = ogs_msprintf("%s/%s",
4
app_session->notif_uri, OGS_SBI_RESOURCE_NAME_TERMINATE);
5
- ogs_assert(message.h.uri);
6
+ if (!message.h.uri) {
7
+ ogs_error("No message.h.uri");
8
+ goto end;
9
+ }
10
11
request = ogs_sbi_build_request(&message);
12
ogs_assert(request);
13
14
- ogs_free(message.h.uri);
15
+end:
16
+
17
+ if (message.h.uri)
18
+ ogs_free(message.h.uri);
19
20
return request;
21
}
22
open5gs_2.4.11.tar.xz/src/pcf/nbsf-build.c -> open5gs_2.5.0.tar.xz/src/pcf/nbsf-build.c
Changed
105
1
2
PcfBinding.ipv4_addr = sess->ipv4addr_string;
3
PcfBinding.ipv6_prefix = sess->ipv6prefix_string;
4
5
- ogs_expect_or_return_val(sess->dnn, NULL);
6
+ if (!sess->dnn) {
7
+ ogs_error("No DNN");
8
+ goto end;
9
+ }
10
PcfBinding.dnn = sess->dnn;
11
12
nf_service = ogs_sbi_nf_service_find_by_name(
13
nf_instance, (char *)OGS_SBI_SERVICE_NAME_NPCF_POLICYAUTHORIZATION);
14
- ogs_expect_or_return_val(nf_service, NULL);
15
+ if (!nf_service) {
16
+ ogs_error("No NF-Service");
17
+ goto end;
18
+ }
19
20
if (nf_service->fqdn)
21
PcfBinding.pcf_fqdn = ogs_strdup(nf_service->fqdn);
22
23
- PcfIpEndPointList = OpenAPI_list_create();
24
- ogs_assert(PcfIpEndPointList);
25
+ PcfBinding.pcf_ip_end_points = PcfIpEndPointList = OpenAPI_list_create();
26
+ if (!PcfIpEndPointList) {
27
+ ogs_error("No PcfIpEndPointList");
28
+ goto end;
29
+ }
30
31
for (i = 0; i < nf_service->num_of_addr; i++) {
32
ogs_sockaddr_t *ipv4 = NULL;
33
34
35
if (ipv4 || ipv6) {
36
IpEndPoint = ogs_calloc(1, sizeof(*IpEndPoint));
37
- ogs_expect_or_return_val(IpEndPoint, NULL);
38
+ if (!IpEndPoint) {
39
+ ogs_error("No IpEndPoint");
40
+ goto end;
41
+ }
42
if (ipv4) {
43
IpEndPoint->ipv4_address = ogs_ipstrdup(ipv4);
44
- ogs_expect_or_return_val(IpEndPoint->ipv4_address, NULL);
45
+ if (!IpEndPoint->ipv4_address) {
46
+ ogs_error("No IpEndPoint->ipv4_address");
47
+ if (IpEndPoint)
48
+ ogs_free(IpEndPoint);
49
+ goto end;
50
+ }
51
}
52
if (ipv6) {
53
IpEndPoint->ipv6_address = ogs_ipstrdup(ipv6);
54
- ogs_expect_or_return_val(IpEndPoint->ipv6_address, NULL);
55
-
56
+ if (!IpEndPoint->ipv6_address) {
57
+ ogs_error("No IpEndPoint->ipv6_address");
58
+ if (IpEndPoint) {
59
+ if (IpEndPoint->ipv6_address)
60
+ ogs_free(IpEndPoint->ipv6_address);
61
+ ogs_free(IpEndPoint);
62
+ }
63
+ goto end;
64
+ }
65
}
66
IpEndPoint->is_port = true;
67
IpEndPoint->port = nf_service->addri.port;
68
69
}
70
}
71
72
- if (PcfIpEndPointList->count)
73
- PcfBinding.pcf_ip_end_points = PcfIpEndPointList;
74
- else
75
- OpenAPI_list_free(PcfIpEndPointList);
76
-
77
- ogs_expect_or_return_val(sess->s_nssai.sst, NULL);
78
+ if (!sess->s_nssai.sst) {
79
+ ogs_error("No SST");
80
+ goto end;
81
+ }
82
memset(&sNssai, 0, sizeof(sNssai));
83
sNssai.sst = sess->s_nssai.sst;
84
sNssai.sd = ogs_s_nssai_sd_to_string(sess->s_nssai.sd);
85
86
87
if (sess->management_features) {
88
PcfBinding.supp_feat = ogs_uint64_to_string(sess->management_features);
89
- ogs_expect_or_return_val(PcfBinding.supp_feat, NULL);
90
+ if (!PcfBinding.supp_feat) {
91
+ ogs_error("No supp_feat");
92
+ goto end;
93
+ }
94
}
95
96
message.PcfBinding = &PcfBinding;
97
98
request = ogs_sbi_build_request(&message);
99
ogs_expect(request);
100
+
101
+end:
102
103
if (sNssai.sd)
104
ogs_free(sNssai.sd);
105
open5gs_2.4.11.tar.xz/src/pcf/nnrf-handler.c -> open5gs_2.5.0.tar.xz/src/pcf/nnrf-handler.c
Changed
39
1
2
pcf_sess_t *sess = NULL;
3
4
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
5
+ OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
6
OpenAPI_search_result_t *SearchResult = NULL;
7
8
ogs_assert(recvmsg);
9
10
ogs_assert(service_type);
11
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
12
ogs_assert(target_nf_type);
13
+ requester_nf_type = xact->requester_nf_type;
14
+ ogs_assert(requester_nf_type);
15
16
discovery_option = xact->discovery_option;
17
stream = xact->assoc_stream;
18
19
ogs_assert_if_reached();
20
}
21
22
- ogs_nnrf_handle_nf_discover_search_result(SearchResult);
23
+ ogs_nnrf_disc_handle_nf_discover_search_result(SearchResult);
24
25
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
26
- target_nf_type, discovery_option);
27
+ target_nf_type, requester_nf_type, discovery_option);
28
if (!nf_instance) {
29
- ogs_error("%s:%d (NF discover) No %s",
30
+ ogs_error("%s:%d (NF discover) No %s:%s",
31
pcf_ue ? pcf_ue->supi : "Unknown",
32
sess ? sess->psi : 0,
33
- ogs_sbi_service_type_to_name(service_type));
34
+ ogs_sbi_service_type_to_name(service_type),
35
+ OpenAPI_nf_type_ToString(requester_nf_type));
36
return;
37
}
38
39
open5gs_2.4.11.tar.xz/src/pcf/nsmf-build.c -> open5gs_2.5.0.tar.xz/src/pcf/nsmf-build.c
Changed
72
1
2
ogs_assert(sess->notification_uri);
3
4
server = ogs_list_first(&ogs_sbi_self()->server_list);
5
- ogs_assert(server);
6
+ if (!server) {
7
+ ogs_error("No server");
8
+ goto end;
9
+ }
10
11
memset(&header, 0, sizeof(header));
12
header.service.name = (char *)OGS_SBI_SERVICE_NAME_NPCF_SMPOLICYCONTROL;
13
14
memset(&SmPolicyNotification, 0, sizeof(SmPolicyNotification));
15
16
SmPolicyNotification.resource_uri = ogs_sbi_server_uri(server, &header);
17
- ogs_assert(SmPolicyNotification.resource_uri);
18
+ if (!SmPolicyNotification.resource_uri) {
19
+ ogs_error("No resource_uri");
20
+ goto end;
21
+ }
22
23
SmPolicyDecision = data;
24
ogs_assert(SmPolicyDecision);
25
26
message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST;
27
message.h.uri = ogs_msprintf("%s/%s",
28
sess->notification_uri, OGS_SBI_RESOURCE_NAME_UPDATE);
29
- ogs_assert(message.h.uri);
30
+ if (!message.h.uri) {
31
+ ogs_error("No message.h.uri");
32
+ goto end;
33
+ }
34
35
message.SmPolicyNotification = &SmPolicyNotification;
36
37
request = ogs_sbi_build_request(&message);
38
ogs_assert(request);
39
40
- ogs_free(SmPolicyNotification.resource_uri);
41
- ogs_free(message.h.uri);
42
+end:
43
+
44
+ if (SmPolicyNotification.resource_uri)
45
+ ogs_free(SmPolicyNotification.resource_uri);
46
+ if (message.h.uri)
47
+ ogs_free(message.h.uri);
48
49
return request;
50
}
51
52
message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST;
53
message.h.uri = ogs_msprintf("%s/%s",
54
sess->notification_uri, OGS_SBI_RESOURCE_NAME_TERMINATE);
55
- ogs_assert(message.h.uri);
56
+ if (!message.h.uri) {
57
+ ogs_error("No message.h.uri");
58
+ goto end;
59
+ }
60
61
request = ogs_sbi_build_request(&message);
62
ogs_assert(request);
63
64
- ogs_free(message.h.uri);
65
+end:
66
+
67
+ if (message.h.uri)
68
+ ogs_free(message.h.uri);
69
70
return request;
71
}
72
open5gs_2.4.11.tar.xz/src/pcf/nudr-handler.c -> open5gs_2.5.0.tar.xz/src/pcf/nudr-handler.c
Changed
15
1
2
3
nf_instance = sess->sbi.service_type_arrayservice_type.nf_instance;
4
if (!nf_instance) {
5
- nf_instance =
6
- ogs_sbi_nf_instance_find_by_service_type(service_type);
7
+ OpenAPI_nf_type_e requester_nf_type =
8
+ NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance);
9
+ ogs_assert(requester_nf_type);
10
+ nf_instance = ogs_sbi_nf_instance_find_by_service_type(
11
+ service_type, requester_nf_type);
12
if (nf_instance)
13
OGS_SBI_SETUP_NF_INSTANCE(
14
sess->sbi.service_type_arrayservice_type,
15
open5gs_2.4.11.tar.xz/src/pcf/pcf-sm.c -> open5gs_2.5.0.tar.xz/src/pcf/pcf-sm.c
Changed
19
1
2
CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY)
3
SWITCH(message.h.method)
4
CASE(OGS_SBI_HTTP_METHOD_POST)
5
- ogs_nnrf_handle_nf_status_notify(stream, &message);
6
+ ogs_nnrf_nfm_handle_nf_status_notify(stream, &message);
7
break;
8
9
DEFAULT
10
11
CASE(OGS_SBI_HTTP_METHOD_POST)
12
if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED ||
13
message.res_status == OGS_SBI_HTTP_STATUS_OK) {
14
- ogs_nnrf_handle_nf_status_subscribe(
15
+ ogs_nnrf_nfm_handle_nf_status_subscribe(
16
subscription_data, &message);
17
} else {
18
ogs_error("%s HTTP response error %d",
19
open5gs_2.4.11.tar.xz/src/pcf/sbi-path.c -> open5gs_2.5.0.tar.xz/src/pcf/sbi-path.c
Changed
201
1
2
3
#include "sbi-path.h"
4
5
-static int server_cb(ogs_sbi_request_t *request, void *data)
6
-{
7
- pcf_event_t *e = NULL;
8
- int rv;
9
-
10
- ogs_assert(request);
11
- ogs_assert(data);
12
-
13
- e = pcf_event_new(OGS_EVENT_SBI_SERVER);
14
- ogs_assert(e);
15
-
16
- e->h.sbi.request = request;
17
- e->h.sbi.data = data;
18
-
19
- rv = ogs_queue_push(ogs_app()->queue, e);
20
- if (rv != OGS_OK) {
21
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
22
- ogs_sbi_request_free(request);
23
- ogs_event_free(e);
24
- return OGS_ERROR;
25
- }
26
-
27
- return OGS_OK;
28
-}
29
-
30
-static int client_cb(int status, ogs_sbi_response_t *response, void *data)
31
-{
32
- pcf_event_t *e = NULL;
33
- int rv;
34
-
35
- if (status != OGS_OK) {
36
- ogs_log_message(
37
- status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0,
38
- "client_cb() failed %d", status);
39
- return OGS_ERROR;
40
- }
41
-
42
- ogs_assert(response);
43
-
44
- e = pcf_event_new(OGS_EVENT_SBI_CLIENT);
45
- ogs_assert(e);
46
- e->h.sbi.response = response;
47
- e->h.sbi.data = data;
48
-
49
- rv = ogs_queue_push(ogs_app()->queue, e);
50
- if (rv != OGS_OK) {
51
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
52
- ogs_sbi_response_free(response);
53
- ogs_event_free(e);
54
- return OGS_ERROR;
55
- }
56
-
57
- return OGS_OK;
58
-}
59
-
60
int pcf_sbi_open(void)
61
{
62
ogs_sbi_nf_instance_t *nf_instance = NULL;
63
64
bool smpolicycontrol_enabled = false;
65
bool policyauthorization_enabled = false;
66
67
- /* Add SELF NF instance */
68
+ /* Initialize SELF NF instance */
69
nf_instance = ogs_sbi_self()->nf_instance;
70
ogs_assert(nf_instance);
71
ogs_sbi_nf_fsm_init(nf_instance);
72
73
74
/* Initialize NRF NF Instance */
75
nf_instance = ogs_sbi_self()->nrf_instance;
76
- if (nf_instance) {
77
- ogs_sbi_client_t *client = NULL;
78
-
79
- /* Client callback is only used when NF sends to NRF */
80
- client = nf_instance->client;
81
- ogs_assert(client);
82
- client->cb = client_cb;
83
-
84
- /* NFRegister is sent and the response is received
85
- * by the above client callback. */
86
+ if (nf_instance)
87
ogs_sbi_nf_fsm_init(nf_instance);
88
- }
89
90
/* Build Subscription-Data */
91
ogs_sbi_subscription_data_build_default(
92
93
ogs_sbi_subscription_data_build_default(
94
OpenAPI_nf_type_UDR, OGS_SBI_SERVICE_NAME_NUDR_DR);
95
96
- if (ogs_sbi_server_start_all(server_cb) != OGS_OK)
97
+ if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK)
98
return OGS_ERROR;
99
100
return OGS_OK;
101
102
ogs_sbi_server_stop_all();
103
}
104
105
-bool pcf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data)
106
+bool pcf_sbi_send_request(
107
+ ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact)
108
{
109
ogs_assert(nf_instance);
110
-
111
- return ogs_sbi_send_request(nf_instance, client_cb, data);
112
+ ogs_assert(xact);
113
+ return ogs_sbi_send_request_to_nf_instance(nf_instance, xact);
114
}
115
116
static bool pcf_sbi_discover_and_send(
117
118
119
xact->assoc_stream = stream;
120
121
- if (ogs_sbi_discover_and_send(xact, client_cb) != true) {
122
+ if (ogs_sbi_discover_and_send(xact) != true) {
123
ogs_error("ogs_sbi_discover_and_send() failed");
124
ogs_sbi_xact_remove(xact);
125
return false;
126
127
128
xact->assoc_stream = stream;
129
130
- return ogs_sbi_discover_only(xact, client_cb);
131
+ return ogs_sbi_discover_only(xact);
132
}
133
134
bool pcf_sess_sbi_discover_and_send(
135
136
137
bool pcf_sbi_send_am_policy_control_notify(pcf_ue_t *pcf_ue)
138
{
139
+ bool rc;
140
ogs_sbi_request_t *request = NULL;
141
ogs_sbi_client_t *client = NULL;
142
143
144
145
request = pcf_namf_callback_build_am_policy_control(pcf_ue, NULL);
146
ogs_expect_or_return_val(request, false);
147
- return ogs_sbi_client_send_request(client, client_notify_cb, request, NULL);
148
+
149
+ rc = ogs_sbi_send_request_to_client(
150
+ client, client_notify_cb, request, NULL);
151
+ ogs_expect(rc == true);
152
+
153
+ ogs_sbi_request_free(request);
154
+
155
+ return rc;
156
}
157
158
bool pcf_sbi_send_smpolicycontrol_update_notify(
159
pcf_sess_t *sess, OpenAPI_sm_policy_decision_t *SmPolicyDecision)
160
{
161
+ bool rc;
162
ogs_sbi_request_t *request = NULL;
163
ogs_sbi_client_t *client = NULL;
164
165
166
request = pcf_nsmf_callback_build_smpolicycontrol_update(
167
sess, SmPolicyDecision);
168
ogs_expect_or_return_val(request, false);
169
- return ogs_sbi_client_send_request(client, client_notify_cb, request, NULL);
170
+
171
+ rc = ogs_sbi_send_request_to_client(
172
+ client, client_notify_cb, request, NULL);
173
+ ogs_expect(rc == true);
174
+
175
+ ogs_sbi_request_free(request);
176
+
177
+ return rc;
178
}
179
180
bool pcf_sbi_send_smpolicycontrol_delete_notify(
181
pcf_sess_t *sess, pcf_app_t *app_session,
182
OpenAPI_sm_policy_decision_t *SmPolicyDecision)
183
{
184
+ bool rc;
185
ogs_sbi_request_t *request = NULL;
186
ogs_sbi_client_t *client = NULL;
187
188
189
request = pcf_nsmf_callback_build_smpolicycontrol_update(
190
sess, SmPolicyDecision);
191
ogs_expect_or_return_val(request, false);
192
- return ogs_sbi_client_send_request(
193
+
194
+ rc = ogs_sbi_send_request_to_client(
195
client, client_delete_notify_cb, request, app_session);
196
+ ogs_expect(rc == true);
197
+
198
+ ogs_sbi_request_free(request);
199
+
200
+ return rc;
201
open5gs_2.4.11.tar.xz/src/pcf/sbi-path.h -> open5gs_2.5.0.tar.xz/src/pcf/sbi-path.h
Changed
11
1
2
int pcf_sbi_open(void);
3
void pcf_sbi_close(void);
4
5
-bool pcf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data);
6
+bool pcf_sbi_send_request(
7
+ ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact);
8
bool pcf_ue_sbi_discover_and_send(
9
ogs_sbi_service_type_e service_type,
10
ogs_sbi_discovery_option_t *discovery_option,
11
open5gs_2.4.11.tar.xz/src/scp/context.c -> open5gs_2.5.0.tar.xz/src/scp/context.c
Changed
114
1
2
3
int __scp_log_domain;
4
5
-static OGS_POOL(scp_conn_pool, scp_conn_t);
6
+static OGS_POOL(scp_assoc_pool, scp_assoc_t);
7
8
static int context_initialized = 0;
9
10
-static int max_num_of_scp_conn = 0;
11
+static int max_num_of_scp_assoc = 0;
12
13
void scp_context_init(void)
14
{
15
16
17
ogs_log_install_domain(&__scp_log_domain, "scp", ogs_core()->log.level);
18
19
-#define MAX_NUM_OF_SCP_CONN 8
20
- max_num_of_scp_conn = ogs_app()->max.ue * MAX_NUM_OF_SCP_CONN;
21
+#define MAX_NUM_OF_SCP_ASSOC 8
22
+ max_num_of_scp_assoc = ogs_app()->max.ue * MAX_NUM_OF_SCP_ASSOC;
23
24
- ogs_pool_init(&scp_conn_pool, max_num_of_scp_conn);
25
+ ogs_pool_init(&scp_assoc_pool, max_num_of_scp_assoc);
26
27
context_initialized = 1;
28
}
29
30
{
31
ogs_assert(context_initialized == 1);
32
33
- scp_conn_remove_all();
34
+ scp_assoc_remove_all();
35
36
- ogs_pool_final(&scp_conn_pool);
37
+ ogs_pool_final(&scp_assoc_pool);
38
39
context_initialized = 0;
40
}
41
42
return OGS_OK;
43
}
44
45
-scp_conn_t *scp_conn_add(ogs_sbi_stream_t *stream)
46
+scp_assoc_t *scp_assoc_add(ogs_sbi_stream_t *stream)
47
{
48
- scp_conn_t *conn = NULL;
49
+ scp_assoc_t *assoc = NULL;
50
51
ogs_assert(stream);
52
53
- ogs_pool_alloc(&scp_conn_pool, &conn);
54
- if (!conn) {
55
- ogs_error("Maximum number of connection%d reached",
56
- max_num_of_scp_conn);
57
+ ogs_pool_alloc(&scp_assoc_pool, &assoc);
58
+ if (!assoc) {
59
+ ogs_error("Maximum number of association%d reached",
60
+ max_num_of_scp_assoc);
61
return NULL;
62
}
63
- memset(conn, 0, sizeof *conn);
64
+ memset(assoc, 0, sizeof *assoc);
65
66
- conn->stream = stream;
67
+ assoc->stream = stream;
68
69
- ogs_list_add(&self.conn_list, conn);
70
+ ogs_list_add(&self.assoc_list, assoc);
71
72
- return conn;
73
+ return assoc;
74
}
75
76
-void scp_conn_remove(scp_conn_t *conn)
77
+void scp_assoc_remove(scp_assoc_t *assoc)
78
{
79
- ogs_assert(conn);
80
+ ogs_assert(assoc);
81
82
- ogs_list_remove(&self.conn_list, conn);
83
+ ogs_list_remove(&self.assoc_list, assoc);
84
85
- if (conn->client)
86
- ogs_sbi_client_remove(conn->client);
87
+ if (assoc->client)
88
+ ogs_sbi_client_remove(assoc->client);
89
+ if (assoc->nrf_client)
90
+ ogs_sbi_client_remove(assoc->nrf_client);
91
92
- ogs_pool_free(&scp_conn_pool, conn);
93
+ ogs_pool_free(&scp_assoc_pool, assoc);
94
}
95
96
-void scp_conn_remove_all(void)
97
+void scp_assoc_remove_all(void)
98
{
99
- scp_conn_t *conn = NULL, *next_conn = NULL;
100
+ scp_assoc_t *assoc = NULL, *next_assoc = NULL;
101
102
- ogs_list_for_each_safe(&self.conn_list, next_conn, conn)
103
- scp_conn_remove(conn);
104
+ ogs_list_for_each_safe(&self.assoc_list, next_assoc, assoc)
105
+ scp_assoc_remove(assoc);
106
}
107
108
-scp_conn_t *scp_conn_find(uint32_t index)
109
+scp_assoc_t *scp_assoc_find(uint32_t index)
110
{
111
- return ogs_pool_find(&scp_conn_pool, index);
112
+ return ogs_pool_find(&scp_assoc_pool, index);
113
}
114
open5gs_2.4.11.tar.xz/src/scp/context.h -> open5gs_2.5.0.tar.xz/src/scp/context.h
Changed
48
1
2
#define OGS_LOG_DOMAIN __scp_log_domain
3
4
typedef struct scp_context_s {
5
- ogs_list_t conn_list;
6
+ ogs_list_t assoc_list;
7
} scp_context_t;
8
9
-typedef struct scp_conn_s scp_conn_t;
10
+typedef struct scp_assoc_s scp_assoc_t;
11
12
-typedef struct scp_conn_s {
13
+typedef struct scp_assoc_s {
14
ogs_sbi_object_t sbi;
15
16
+ ogs_sbi_stream_t *stream;
17
+
18
ogs_sbi_client_t *client;
19
+ ogs_sbi_client_t *nrf_client;
20
21
- ogs_sbi_stream_t *stream;
22
ogs_sbi_request_t *request;
23
+ ogs_sbi_service_type_e service_type;
24
+ OpenAPI_nf_type_e requester_nf_type;
25
26
-} scp_conn_t;
27
+ ogs_sbi_nf_instance_t *nf_service_producer;
28
+} scp_assoc_t;
29
30
void scp_context_init(void);
31
void scp_context_final(void);
32
33
34
int scp_context_parse_config(void);
35
36
-scp_conn_t *scp_conn_add(ogs_sbi_stream_t *stream);
37
-void scp_conn_remove(scp_conn_t *sess);
38
-void scp_conn_remove_all(void);
39
+scp_assoc_t *scp_assoc_add(ogs_sbi_stream_t *stream);
40
+void scp_assoc_remove(scp_assoc_t *sess);
41
+void scp_assoc_remove_all(void);
42
43
-scp_conn_t *scp_conn_find(uint32_t index);
44
+scp_assoc_t *scp_assoc_find(uint32_t index);
45
46
#ifdef __cplusplus
47
}
48
open5gs_2.4.11.tar.xz/src/scp/event.h -> open5gs_2.5.0.tar.xz/src/scp/event.h
Changed
10
1
2
scp_sess_t *sess;
3
} scp_event_t;
4
5
+OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(scp_event_t));
6
+
7
scp_event_t *scp_event_new(int id);
8
9
const char *scp_event_get_name(scp_event_t *e);
10
open5gs_2.4.11.tar.xz/src/scp/meson.build -> open5gs_2.5.0.tar.xz/src/scp/meson.build
Changed
11
1
2
context.c
3
event.c
4
5
- nnrf-handler.c
6
- nscp-handler.c
7
-
8
sbi-path.c
9
scp-sm.c
10
11
open5gs_2.4.11.tar.xz/src/scp/sbi-path.c -> open5gs_2.5.0.tar.xz/src/scp/sbi-path.c
Changed
201
1
2
static int request_handler(ogs_sbi_request_t *request, void *data);
3
static int response_handler(
4
int status, ogs_sbi_response_t *response, void *data);
5
+static int discover_handler(
6
+ int status, ogs_sbi_response_t *response, void *data);
7
8
-static int client_cb(int status, ogs_sbi_response_t *response, void *data);
9
+static void copy_request(
10
+ ogs_sbi_request_t *target, ogs_sbi_request_t *source,
11
+ bool include_discovery);
12
13
int scp_sbi_open(void)
14
{
15
- ogs_sbi_nf_instance_t *nf_instance = NULL;
16
+ ogs_sbi_nf_instance_t *nf_instance = NULL, *nrf_instance = NULL;
17
+ ogs_sbi_client_t *nrf_client = NULL, *next_scp = NULL;
18
19
- /* Add SELF NF instance */
20
+ /* Initialize SELF NF instance */
21
nf_instance = ogs_sbi_self()->nf_instance;
22
ogs_assert(nf_instance);
23
ogs_sbi_nf_fsm_init(nf_instance);
24
25
/* Build NF instance information. It will be transmitted to NRF. */
26
ogs_sbi_nf_instance_build_default(nf_instance, OpenAPI_nf_type_SCP);
27
28
- /* Initialize NRF NF Instance */
29
- nf_instance = ogs_sbi_self()->nrf_instance;
30
- if (nf_instance) {
31
- ogs_sbi_client_t *client = NULL;
32
+ /*
33
+ * If the SCP is running in Model D,
34
+ * it can send NFRegister/NFStatusSubscribe messages to the NRF.
35
+ */
36
+ nrf_instance = ogs_sbi_self()->nrf_instance;
37
+ nrf_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->nrf_instance);
38
+
39
+ if (nrf_client) {
40
+
41
+ /* Initialize NRF NF Instance */
42
+ if (nrf_instance)
43
+ ogs_sbi_nf_fsm_init(nrf_instance);
44
+ }
45
46
- /* Client callback is only used when NF sends to NRF */
47
- client = nf_instance->client;
48
- ogs_assert(client);
49
- client->cb = client_cb;
50
+ /* Check if Next-SCP's client */
51
+ if (ogs_sbi_self()->discovery_config.delegated ==
52
+ OGS_SBI_DISCOVERY_DELEGATED_AUTO) {
53
+ next_scp = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance);
54
+ } else if (ogs_sbi_self()->discovery_config.delegated ==
55
+ OGS_SBI_DISCOVERY_DELEGATED_YES) {
56
+ next_scp = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance);
57
+ ogs_assert(next_scp);
58
+ }
59
60
- /* NFRegister is sent and the response is received
61
- * by the above client callback. */
62
- ogs_sbi_nf_fsm_init(nf_instance);
63
- }
64
-
65
- /* Build Subscription-Data */
66
- ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_AMF, NULL);
67
- ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_AUSF, NULL);
68
- ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_BSF, NULL);
69
- ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_NSSF, NULL);
70
- ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_PCF, NULL);
71
- ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_SMF, NULL);
72
- ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_UDM, NULL);
73
- ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_UDR, NULL);
74
+ /* If the SCP has an NRF client and does not delegate to Next-SCP */
75
+ if (nrf_client && !next_scp) {
76
+
77
+ /* Build Subscription-Data */
78
+ ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_AMF, NULL);
79
+ ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_AUSF, NULL);
80
+ ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_BSF, NULL);
81
+ ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_NSSF, NULL);
82
+ ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_PCF, NULL);
83
+ ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_SMF, NULL);
84
+ ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_UDM, NULL);
85
+ ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_UDR, NULL);
86
+ }
87
88
if (ogs_sbi_server_start_all(request_handler) != OGS_OK)
89
return OGS_ERROR;
90
91
ogs_sbi_server_stop_all();
92
}
93
94
-static int request_handler(ogs_sbi_request_t *source, void *data)
95
+static int request_handler(ogs_sbi_request_t *request, void *data)
96
{
97
int rv;
98
ogs_hash_index_t *hi;
99
+ ogs_sbi_client_t *client = NULL, *nrf_client = NULL, *next_scp = NULL;
100
ogs_sbi_stream_t *stream = data;
101
102
+ ogs_sbi_request_t scp_request;
103
+ char *apiroot = NULL, *newuri = NULL;
104
+
105
+ OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
106
+ OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
107
+ ogs_sbi_discovery_option_t *discovery_option = NULL;
108
+ ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL;
109
+ bool discovery_presence = false;
110
+
111
+ scp_assoc_t *assoc = NULL;
112
+ ogs_sbi_nf_instance_t *nf_instance = NULL;
113
+
114
struct {
115
char *target_apiroot;
116
- char *discovery;
117
- char *accept;
118
- char *content_type;
119
- char *content_encoding;
120
- } headers;
121
+ char *callback;
122
+ char *nrf_uri;
123
+ } headers = {
124
+ NULL, NULL, NULL
125
+ };
126
127
- ogs_assert(source);
128
- ogs_assert(source->h.uri);
129
+ scp_event_t *e = NULL;
130
+
131
+ ogs_assert(request);
132
+ ogs_assert(request->h.uri);
133
ogs_assert(stream);
134
135
- memset(&headers, 0, sizeof(headers));
136
+ /* Check if Next-SCP's client */
137
+ if (ogs_sbi_self()->discovery_config.delegated ==
138
+ OGS_SBI_DISCOVERY_DELEGATED_AUTO) {
139
+ next_scp = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance);
140
+ } else if (ogs_sbi_self()->discovery_config.delegated ==
141
+ OGS_SBI_DISCOVERY_DELEGATED_YES) {
142
+ next_scp = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance);
143
+ ogs_assert(next_scp);
144
+ }
145
+
146
+ discovery_option = ogs_sbi_discovery_option_new();
147
+ ogs_assert(discovery_option);
148
149
/* Extract HTTP Header */
150
- for (hi = ogs_hash_first(source->http.headers);
151
+ for (hi = ogs_hash_first(request->http.headers);
152
hi; hi = ogs_hash_next(hi)) {
153
char *key = (char *)ogs_hash_this_key(hi);
154
char *val = ogs_hash_this_val(hi);
155
156
* Each header field consists of a name followed by a colon (":")
157
* and the field value. Field names are case-insensitive.
158
*/
159
- if (!strcasecmp(key, OGS_SBI_CUSTOM_TARGET_APIROOT)) {
160
+ if (!strcasecmp(key, OGS_SBI_USER_AGENT)) {
161
+ if (val) requester_nf_type = OpenAPI_nf_type_FromString(val);
162
+ } else if (!strcasecmp(key, OGS_SBI_CUSTOM_TARGET_APIROOT)) {
163
headers.target_apiroot = val;
164
- } else if (!strncasecmp(key,
165
- OGS_SBI_CUSTOM_DISCOVERY_COMMON,
166
- strlen(OGS_SBI_CUSTOM_DISCOVERY_COMMON))) {
167
- headers.discovery = val;
168
- } else if (!strcasecmp(key, OGS_SBI_ACCEPT)) {
169
- headers.accept = val;
170
- } else if (!strcasecmp(key, OGS_SBI_CONTENT_TYPE)) {
171
- headers.content_type = val;
172
- } else if (!strcasecmp(key, OGS_SBI_ACCEPT_ENCODING)) {
173
- headers.content_encoding = val;
174
+ } else if (!strcasecmp(key, OGS_SBI_CUSTOM_CALLBACK)) {
175
+ headers.callback = val;
176
+ } else if (!strcasecmp(key, OGS_SBI_CUSTOM_NRF_URI)) {
177
+ headers.nrf_uri = val;
178
+ } else if (!strcasecmp(key, OGS_SBI_CUSTOM_DISCOVERY_TARGET_NF_TYPE)) {
179
+ if (val) target_nf_type = OpenAPI_nf_type_FromString(val);
180
+ } else if (!strcasecmp(key,
181
+ OGS_SBI_CUSTOM_DISCOVERY_REQUESTER_NF_TYPE)) {
182
+ ogs_warn("Use User-Agent instead of Discovery-requester-nf-type");
183
+ } else if (!strcasecmp(key,
184
+ OGS_SBI_CUSTOM_DISCOVERY_TARGET_NF_INSTANCE_ID)) {
185
+ ogs_sbi_discovery_option_set_target_nf_instance_id(
186
+ discovery_option, val);
187
+ } else if (!strcasecmp(key,
188
+ OGS_SBI_CUSTOM_DISCOVERY_REQUESTER_NF_INSTANCE_ID)) {
189
+ ogs_sbi_discovery_option_set_requester_nf_instance_id(
190
+ discovery_option, val);
191
+ } else if (!strcasecmp(key, OGS_SBI_CUSTOM_DISCOVERY_SERVICE_NAMES)) {
192
+ if (val)
193
+ ogs_sbi_discovery_option_parse_service_names(
194
+ discovery_option, val);
195
+
196
+ /*
197
+ * So, we'll use the first item in service-names list.
198
+ *
199
+ * TS29.500
200
+ * 6.10 Support of Indirect Communication
201
open5gs_2.4.11.tar.xz/src/scp/sbi-path.h -> open5gs_2.5.0.tar.xz/src/scp/sbi-path.h
Changed
15
1
2
int scp_sbi_open(void);
3
void scp_sbi_close(void);
4
5
-bool scp_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data);
6
-bool scp_sbi_discover_and_send(
7
- ogs_sbi_service_type_e service_type,
8
- ogs_sbi_discovery_option_t *discovery_option,
9
- ogs_sbi_request_t *(*build)(scp_conn_t *conn, void *data),
10
- scp_conn_t *conn, ogs_sbi_stream_t *stream, void *data);
11
-
12
#ifdef __cplusplus
13
}
14
#endif
15
open5gs_2.4.11.tar.xz/src/scp/scp-sm.c -> open5gs_2.5.0.tar.xz/src/scp/scp-sm.c
Changed
135
1
2
*/
3
4
#include "sbi-path.h"
5
-#include "nnrf-handler.h"
6
-#include "nscp-handler.h"
7
8
void scp_state_initial(ogs_fsm_t *s, scp_event_t *e)
9
{
10
11
CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY)
12
SWITCH(message.h.method)
13
CASE(OGS_SBI_HTTP_METHOD_POST)
14
- ogs_nnrf_handle_nf_status_notify(stream, &message);
15
+ ogs_nnrf_nfm_handle_nf_status_notify(stream, &message);
16
break;
17
18
DEFAULT
19
20
END
21
break;
22
23
-#if 0
24
- CASE(OGS_SBI_SERVICE_NAME_NBSF_MANAGEMENT)
25
- SWITCH(message.h.resource.component0)
26
- CASE(OGS_SBI_RESOURCE_NAME_PCF_BINDINGS)
27
- if (message.h.resource.component1) {
28
- sess = scp_sess_find_by_binding_id(
29
- message.h.resource.component1);
30
- } else {
31
- SWITCH(message.h.method)
32
- CASE(OGS_SBI_HTTP_METHOD_POST)
33
- if (message.PcfBinding &&
34
- message.PcfBinding->snssai &&
35
- message.PcfBinding->dnn) {
36
- ogs_s_nssai_t s_nssai;
37
-
38
- s_nssai.sst = message.PcfBinding->snssai->sst;
39
- s_nssai.sd = ogs_s_nssai_sd_from_string(
40
- message.PcfBinding->snssai->sd);
41
-
42
- sess = scp_sess_find_by_snssai_and_dnn(
43
- &s_nssai, message.PcfBinding->dnn);
44
- if (!sess) {
45
- sess = scp_sess_add_by_snssai_and_dnn(
46
- &s_nssai, message.PcfBinding->dnn);
47
- ogs_assert(sess);
48
- }
49
- }
50
- break;
51
- CASE(OGS_SBI_HTTP_METHOD_GET)
52
- if (!sess && message.param.ipv4addr)
53
- sess = scp_sess_find_by_ipv4addr(
54
- message.param.ipv4addr);
55
- if (!sess && message.param.ipv6prefix)
56
- sess = scp_sess_find_by_ipv6prefix(
57
- message.param.ipv6prefix);
58
- break;
59
- DEFAULT
60
- ogs_error("Invalid HTTP method %s", message.h.method);
61
- END
62
- }
63
-
64
- if (!sess) {
65
- ogs_error("Not found %s", message.h.uri);
66
- ogs_assert(true ==
67
- ogs_sbi_server_send_error(stream,
68
- OGS_SBI_HTTP_STATUS_NOT_FOUND,
69
- &message, "Not found", message.h.uri));
70
- break;
71
- }
72
-
73
- scp_nscp_management_handle_pcf_binding(sess, stream, &message);
74
- break;
75
-
76
- DEFAULT
77
- ogs_error("Invalid resource name %s",
78
- message.h.resource.component0);
79
- ogs_assert(true ==
80
- ogs_sbi_server_send_error(stream,
81
- OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message,
82
- "Invalid resource name",
83
- message.h.resource.component0));
84
- END
85
- break;
86
-#endif
87
-
88
DEFAULT
89
ogs_error("Invalid API name %s", message.h.service.name);
90
ogs_assert(true ==
91
92
CASE(OGS_SBI_HTTP_METHOD_POST)
93
if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED ||
94
message.res_status == OGS_SBI_HTTP_STATUS_OK) {
95
- ogs_nnrf_handle_nf_status_subscribe(
96
+ ogs_nnrf_nfm_handle_nf_status_subscribe(
97
subscription_data, &message);
98
} else {
99
ogs_error("HTTP response error : %d",
100
101
DEFAULT
102
ogs_error("Invalid resource name %s",
103
message.h.resource.component0);
104
- ogs_assert_if_reached();
105
- END
106
- break;
107
-
108
- CASE(OGS_SBI_SERVICE_NAME_NNRF_DISC)
109
- SWITCH(message.h.resource.component0)
110
- CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES)
111
- sbi_xact = e->h.sbi.data;
112
- ogs_assert(sbi_xact);
113
-
114
- SWITCH(message.h.method)
115
- CASE(OGS_SBI_HTTP_METHOD_GET)
116
- if (message.res_status == OGS_SBI_HTTP_STATUS_OK)
117
- scp_nnrf_handle_nf_discover(sbi_xact, &message);
118
- else
119
- ogs_error("HTTP response error %d",
120
- message.res_status);
121
- break;
122
-
123
- DEFAULT
124
- ogs_error("Invalid HTTP method %s", message.h.method);
125
- ogs_assert_if_reached();
126
- END
127
- break;
128
-
129
- DEFAULT
130
- ogs_error("Invalid resource name %s",
131
- message.h.resource.component0);
132
ogs_assert_if_reached();
133
END
134
break;
135
open5gs_2.4.11.tar.xz/src/sgwc/event.h -> open5gs_2.5.0.tar.xz/src/sgwc/event.h
Changed
10
1
2
sgwc_bearer_t *bearer;
3
} sgwc_event_t;
4
5
+OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(sgwc_event_t));
6
+
7
void sgwc_event_init(void);
8
void sgwc_event_term(void);
9
void sgwc_event_final(void);
10
open5gs_2.4.11.tar.xz/src/sgwc/gtp-path.c -> open5gs_2.5.0.tar.xz/src/sgwc/gtp-path.c
Changed
9
1
2
gtp_xact = ogs_gtp_xact_local_create(
3
sgwc_ue->gnode, &h, pkbuf, bearer_timeout, bearer);
4
ogs_expect_or_return_val(gtp_xact, OGS_ERROR);
5
+ gtp_xact->local_teid = sgwc_ue->sgw_s11_teid;
6
7
rv = ogs_gtp_xact_commit(gtp_xact);
8
ogs_expect(rv == OGS_OK);
9
open5gs_2.4.11.tar.xz/src/sgwc/s11-handler.c -> open5gs_2.5.0.tar.xz/src/sgwc/s11-handler.c
Changed
9
1
2
s5c_xact = ogs_gtp_xact_local_create(
3
sess->gnode, &message->h, gtpbuf, gtp_sess_timeout, sess);
4
ogs_expect_or_return(s5c_xact);
5
+ s5c_xact->local_teid = sess->sgw_s5c_teid;
6
7
ogs_gtp_xact_associate(s11_xact, s5c_xact);
8
9
open5gs_2.4.11.tar.xz/src/sgwc/s5c-handler.c -> open5gs_2.5.0.tar.xz/src/sgwc/s5c-handler.c
Changed
73
1
2
ogs_pkbuf_t *gtpbuf, ogs_gtp2_message_t *message)
3
{
4
int rv;
5
- ogs_gtp2_cause_t *cause = NULL;
6
uint8_t cause_value;
7
8
sgwc_ue_t *sgwc_ue = NULL;
9
10
return;
11
}
12
13
- /*****************************************
14
- * Check Mandatory/Conditional IE Missing
15
- *****************************************/
16
+ /********************
17
+ * Check Cause Value
18
+ ********************/
19
ogs_assert(cause_value == OGS_GTP2_CAUSE_REQUEST_ACCEPTED);
20
21
- if (rsp->cause.presence == 0) {
22
+ if (rsp->cause.presence) {
23
+ ogs_gtp2_cause_t *cause = rsp->cause.data;
24
+ ogs_assert(cause);
25
+
26
+ cause_value = cause->value;
27
+ } else {
28
ogs_error("No Cause");
29
cause_value = OGS_GTP2_CAUSE_MANDATORY_IE_MISSING;
30
}
31
32
if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) {
33
- ogs_gtp_send_error_message(
34
- s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0,
35
- OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, cause_value);
36
- return;
37
- }
38
-
39
- /********************
40
- * Check Cause Value
41
- ********************/
42
- ogs_assert(cause_value == OGS_GTP2_CAUSE_REQUEST_ACCEPTED);
43
-
44
- cause = rsp->cause.data;
45
- ogs_assert(cause);
46
- cause_value = cause->value;
47
- if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) {
48
- ogs_error("GTP Cause Value:%d", cause_value);
49
- ogs_gtp_send_error_message(
50
- s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0,
51
- OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, cause_value);
52
- return;
53
+ ogs_error("GTP Cause Value:%d - Ignored", cause_value);
54
}
55
56
/********************
57
58
s11_xact = ogs_gtp_xact_local_create(
59
sgwc_ue->gnode, &message->h, pkbuf, bearer_timeout, bearer);
60
ogs_expect_or_return(s11_xact);
61
+ s11_xact->local_teid = sgwc_ue->sgw_s11_teid;
62
63
ogs_gtp_xact_associate(s5c_xact, s11_xact);
64
} else {
65
66
s11_xact = ogs_gtp_xact_local_create(
67
sgwc_ue->gnode, &message->h, pkbuf, bearer_timeout, bearer);
68
ogs_expect_or_return(s11_xact);
69
+ s11_xact->local_teid = sgwc_ue->sgw_s11_teid;
70
71
ogs_gtp_xact_associate(s5c_xact, s11_xact);
72
} else {
73
open5gs_2.4.11.tar.xz/src/sgwu/context.c -> open5gs_2.5.0.tar.xz/src/sgwu/context.c
Changed
10
1
2
ogs_hash_set(self.seid_hash, &sess->sgwc_sxa_f_seid.seid,
3
sizeof(sess->sgwc_sxa_f_seid.seid), sess);
4
5
- ogs_info("UE F-SEIDCP:0x%lx UP:0x%lx",
6
+ ogs_info("UE F-SEIDUP:0x%lx CP:0x%lx",
7
(long)sess->sgwu_sxa_seid, (long)sess->sgwc_sxa_f_seid.seid);
8
9
ogs_list_add(&self.sess_list, sess);
10
open5gs_2.4.11.tar.xz/src/sgwu/event.h -> open5gs_2.5.0.tar.xz/src/sgwu/event.h
Changed
10
1
2
sgwu_bearer_t *bearer;
3
} sgwu_event_t;
4
5
+OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(sgwu_event_t));
6
+
7
void sgwu_event_init(void);
8
void sgwu_event_term(void);
9
void sgwu_event_final(void);
10
open5gs_2.4.11.tar.xz/src/smf/event.h -> open5gs_2.5.0.tar.xz/src/smf/event.h
Changed
10
1
2
smf_sess_t *sess;
3
} smf_event_t;
4
5
+OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(smf_event_t));
6
+
7
smf_event_t *smf_event_new(int id);
8
9
const char *smf_event_get_name(smf_event_t *e);
10
open5gs_2.4.11.tar.xz/src/smf/n4-handler.c -> open5gs_2.5.0.tar.xz/src/smf/n4-handler.c
Changed
68
1
2
3
ogs_debug("Session Report Request");
4
5
- cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED;
6
+ cause_value = OGS_PFCP_CAUSE_REQUEST_ACCEPTED;
7
8
if (!sess) {
9
ogs_error("No Context");
10
11
12
if (pfcp_req->report_type.presence == 0) {
13
ogs_error("No Report Type");
14
- cause_value = OGS_GTP2_CAUSE_MANDATORY_IE_MISSING;
15
+ cause_value = OGS_PFCP_CAUSE_MANDATORY_IE_MISSING;
16
}
17
18
- if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) {
19
+ if (cause_value != OGS_PFCP_CAUSE_REQUEST_ACCEPTED) {
20
ogs_pfcp_send_error_message(pfcp_xact, 0,
21
OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE,
22
cause_value, 0);
23
24
"Paging Policy Indication Value");
25
ogs_pfcp_send_error_message(pfcp_xact, 0,
26
OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE,
27
- OGS_GTP2_CAUSE_SERVICE_NOT_SUPPORTED, 0);
28
+ OGS_PFCP_CAUSE_SERVICE_NOT_SUPPORTED, 0);
29
return;
30
}
31
32
if (qfi) {
33
qos_flow = smf_qos_flow_find_by_qfi(sess, qfi);
34
- if (!qos_flow)
35
+ if (!qos_flow) {
36
ogs_error("Cannot find the QoS Flow%d", qfi);
37
+ ogs_pfcp_send_error_message(pfcp_xact, 0,
38
+ OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE,
39
+ OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND, 0);
40
+ return;
41
+ }
42
}
43
} else {
44
ogs_error("No Info");
45
46
pfcp_req->downlink_data_report.pdr_id.u16);
47
if (!pdr)
48
ogs_error("Cannot find the PDR-ID%d", pdr_id);
49
-
50
} else {
51
ogs_error("No PDR-ID");
52
}
53
54
ogs_error("No Downlink Data Report");
55
}
56
57
- if (!pdr || !qos_flow) {
58
- ogs_error("No Context %p:%p", pdr, qos_flow);
59
+ if (!pdr) {
60
+ ogs_error("No Context");
61
ogs_pfcp_send_error_message(pfcp_xact, 0,
62
OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE,
63
- cause_value, 0);
64
+ OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND, 0);
65
return;
66
}
67
68
open5gs_2.4.11.tar.xz/src/smf/namf-build.c -> open5gs_2.5.0.tar.xz/src/smf/namf-build.c
Changed
19
1
2
}
3
4
request = ogs_sbi_build_request(&message);
5
- ogs_assert(request);
6
+ ogs_expect(request);
7
8
for (i = 0; i < message.num_of_part; i++)
9
if (message.parti.pkbuf)
10
11
message.SmContextStatusNotification = &SmContextStatusNotification;
12
13
request = ogs_sbi_build_request(&message);
14
- ogs_assert(request);
15
+ ogs_expect(request);
16
17
return request;
18
}
19
open5gs_2.4.11.tar.xz/src/smf/nnrf-handler.c -> open5gs_2.5.0.tar.xz/src/smf/nnrf-handler.c
Changed
37
1
2
ogs_sbi_discovery_option_t *discovery_option = NULL;
3
4
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
5
+ OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
6
OpenAPI_search_result_t *SearchResult = NULL;
7
8
ogs_assert(recvmsg);
9
10
ogs_assert(service_type);
11
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
12
ogs_assert(target_nf_type);
13
+ requester_nf_type = xact->requester_nf_type;
14
+ ogs_assert(requester_nf_type);
15
16
discovery_option = xact->discovery_option;
17
18
19
return;
20
}
21
22
- ogs_nnrf_handle_nf_discover_search_result(SearchResult);
23
+ ogs_nnrf_disc_handle_nf_discover_search_result(SearchResult);
24
25
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
26
- target_nf_type, discovery_option);
27
+ target_nf_type, requester_nf_type, discovery_option);
28
if (!nf_instance) {
29
- ogs_error("(NF discover) No %s",
30
- ogs_sbi_service_type_to_name(service_type));
31
+ ogs_error("(NF discover) No %s:%s",
32
+ ogs_sbi_service_type_to_name(service_type),
33
+ OpenAPI_nf_type_ToString(requester_nf_type));
34
return;
35
}
36
37
open5gs_2.4.11.tar.xz/src/smf/npcf-build.c -> open5gs_2.5.0.tar.xz/src/smf/npcf-build.c
Changed
201
1
2
3
memset(&SmPolicyContextData, 0, sizeof(SmPolicyContextData));
4
5
- ogs_assert(smf_ue->supi);
6
SmPolicyContextData.supi = smf_ue->supi;
7
- ogs_assert(sess->psi);
8
+ if (!SmPolicyContextData.supi) {
9
+ ogs_error("No supi");
10
+ goto end;
11
+ }
12
SmPolicyContextData.pdu_session_id = sess->psi;
13
- ogs_assert(sess->session.session_type);
14
+ if (!SmPolicyContextData.pdu_session_id) {
15
+ ogs_error("No pdu_session_id");
16
+ goto end;
17
+ }
18
SmPolicyContextData.pdu_session_type = sess->session.session_type;
19
- ogs_assert(sess->session.name);
20
+ if (!SmPolicyContextData.pdu_session_type) {
21
+ ogs_error("No pdu_session_type");
22
+ goto end;
23
+ }
24
SmPolicyContextData.dnn = sess->session.name;
25
+ if (!SmPolicyContextData.dnn) {
26
+ ogs_error("No dnn");
27
+ goto end;
28
+ }
29
30
server = ogs_list_first(&ogs_sbi_self()->server_list);
31
- ogs_assert(server);
32
+ if (!server) {
33
+ ogs_error("No server");
34
+ goto end;
35
+ }
36
37
memset(&header, 0, sizeof(header));
38
header.service.name = (char *)OGS_SBI_SERVICE_NAME_NSMF_CALLBACK;
39
40
(char *)OGS_SBI_RESOURCE_NAME_SM_POLICY_NOTIFY;
41
header.resource.component1 = sess->sm_context_ref;
42
SmPolicyContextData.notification_uri = ogs_sbi_server_uri(server, &header);
43
- ogs_assert(SmPolicyContextData.notification_uri);
44
+ if (!SmPolicyContextData.notification_uri) {
45
+ ogs_error("No notification_uri");
46
+ goto end;
47
+ }
48
49
if (sess->ipv4) {
50
SmPolicyContextData.ipv4_address =
51
ogs_ipv4_to_string(sess->ipv4->addr0);
52
- ogs_expect_or_return_val(SmPolicyContextData.ipv4_address, NULL);
53
+ if (!SmPolicyContextData.ipv4_address) {
54
+ ogs_error("No ipv4_address");
55
+ goto end;
56
+ }
57
}
58
59
if (sess->ipv6) {
60
SmPolicyContextData.ipv6_address_prefix = ogs_ipv6prefix_to_string(
61
(uint8_t *)sess->ipv6->addr, OGS_IPV6_128_PREFIX_LEN);
62
- ogs_expect_or_return_val(SmPolicyContextData.ipv6_address_prefix, NULL);
63
+ if (!SmPolicyContextData.ipv6_address_prefix) {
64
+ ogs_error("No ipv6_address_prefix");
65
+ goto end;
66
+ }
67
}
68
69
memset(&SubsSessAmbr, 0, sizeof(SubsSessAmbr));
70
71
else if (sess->session.qos.arp.pre_emption_capability ==
72
OGS_5GC_PRE_EMPTION_DISABLED)
73
Arp.preempt_cap = OpenAPI_preemption_capability_NOT_PREEMPT;
74
- ogs_assert(Arp.preempt_cap);
75
+ if (!Arp.preempt_cap) {
76
+ ogs_error("No Arp.preempt_cap");
77
+ goto end;
78
+ }
79
if (sess->session.qos.arp.pre_emption_vulnerability ==
80
OGS_5GC_PRE_EMPTION_ENABLED)
81
Arp.preempt_vuln = OpenAPI_preemption_vulnerability_PREEMPTABLE;
82
else if (sess->session.qos.arp.pre_emption_vulnerability ==
83
OGS_5GC_PRE_EMPTION_DISABLED)
84
Arp.preempt_vuln = OpenAPI_preemption_vulnerability_NOT_PREEMPTABLE;
85
- ogs_assert(Arp.preempt_vuln);
86
+ if (!Arp.preempt_vuln) {
87
+ ogs_error("No Arp.preempt_vuln");
88
+ goto end;
89
+ }
90
Arp.priority_level = sess->session.qos.arp.priority_level;
91
92
memset(&SubsDefQos, 0, sizeof(SubsDefQos));
93
94
if (sess->smpolicycontrol_features) {
95
SmPolicyContextData.supp_feat =
96
ogs_uint64_to_string(sess->smpolicycontrol_features);
97
- ogs_expect_or_return_val(SmPolicyContextData.supp_feat, NULL);
98
+ if (!SmPolicyContextData.supp_feat) {
99
+ ogs_error("No supp_feat");
100
+ goto end;
101
+ }
102
}
103
104
memset(&sNssai, 0, sizeof(sNssai));
105
106
request = ogs_sbi_build_request(&message);
107
ogs_expect(request);
108
109
- ogs_free(SmPolicyContextData.notification_uri);
110
+end:
111
+ if (SmPolicyContextData.notification_uri)
112
+ ogs_free(SmPolicyContextData.notification_uri);
113
if (SmPolicyContextData.gpsi)
114
ogs_free(SmPolicyContextData.gpsi);
115
116
117
param->ran_nas_release.gsm_cause ||
118
param->ran_nas_release.ngap_cause.group) {
119
120
- ranNasRelCause = ogs_calloc(1, sizeof(*ranNasRelCause));
121
- ogs_expect_or_return_val(ranNasRelCause, NULL);
122
-
123
ranNasRelCauseList = OpenAPI_list_create();
124
- ogs_expect_or_return_val(ranNasRelCauseList, NULL);
125
+ if (!ranNasRelCauseList) {
126
+ ogs_error("No ranNasRelCauseList");
127
+ goto end;
128
+ }
129
+
130
+ ranNasRelCause = ogs_calloc(1, sizeof(*ranNasRelCause));
131
+ if (!ranNasRelCause) {
132
+ ogs_error("No ranNasRelCause");
133
+ goto end;
134
+ }
135
136
if (param->ran_nas_release.ngap_cause.group) {
137
OpenAPI_ng_ap_cause_t *ngApCause = NULL;
138
139
ranNasRelCause->ng_ap_cause = ngApCause =
140
ogs_calloc(1, sizeof(*ngApCause));
141
- ogs_expect_or_return_val(ngApCause, NULL);
142
+ if (!ranNasRelCause->ng_ap_cause) {
143
+ ogs_error("No ranNasRelCause->ng_ap_cause");
144
+ if (ranNasRelCause)
145
+ ogs_free(ranNasRelCause);
146
+ goto end;
147
+ }
148
149
ngApCause->group = param->ran_nas_release.ngap_cause.group;
150
ngApCause->value = param->ran_nas_release.ngap_cause.value;
151
152
if (param->ue_location) {
153
ueLocation.nr_location = ogs_sbi_build_nr_location(
154
&sess->nr_tai, &sess->nr_cgi);
155
- ogs_expect_or_return_val(ueLocation.nr_location, NULL);
156
+ if (!ueLocation.nr_location) {
157
+ ogs_error("ueLocation.nr_location");
158
+ goto end;
159
+ }
160
ueLocation.nr_location->ue_location_timestamp =
161
ogs_sbi_gmtime_string(sess->ue_location_timestamp);
162
- ogs_expect_or_return_val(
163
- ueLocation.nr_location->ue_location_timestamp, NULL);
164
+ if (!ueLocation.nr_location->ue_location_timestamp) {
165
+ ogs_error("ueLocation.nr_location->ue_location_timestamp");
166
+ goto end;
167
+ }
168
169
SmPolicyDeleteData.user_location_info = &ueLocation;
170
}
171
if (param->ue_timezone) {
172
SmPolicyDeleteData.ue_time_zone =
173
ogs_sbi_timezone_string(ogs_timezone());
174
- ogs_expect_or_return_val(SmPolicyDeleteData.ue_time_zone, NULL);
175
+ if (!SmPolicyDeleteData.ue_time_zone) {
176
+ ogs_error("SmPolicyDeleteData.ue_time_zone");
177
+ goto end;
178
+ }
179
}
180
}
181
182
SmPolicyDeleteData.serving_network =
183
ogs_sbi_build_plmn_id_nid(&sess->plmn_id);
184
- ogs_expect_or_return_val(SmPolicyDeleteData.serving_network, NULL);
185
+ if (!SmPolicyDeleteData.serving_network) {
186
+ ogs_error("SmPolicyDeleteData.serving_network");
187
+ goto end;
188
+ }
189
190
SmPolicyDeleteData.ran_nas_rel_causes = ranNasRelCauseList;
191
192
193
request = ogs_sbi_build_request(&message);
194
ogs_expect(request);
195
196
+end:
197
+
198
if (ueLocation.nr_location) {
199
if (ueLocation.nr_location->ue_location_timestamp)
200
ogs_free(ueLocation.nr_location->ue_location_timestamp);
201
open5gs_2.4.11.tar.xz/src/smf/nudm-build.c -> open5gs_2.5.0.tar.xz/src/smf/nudm-build.c
Changed
10
1
2
message.param.dnn = sess->session.name;
3
4
request = ogs_sbi_build_request(&message);
5
- ogs_assert(request);
6
+ ogs_expect(request);
7
8
return request;
9
}
10
open5gs_2.4.11.tar.xz/src/smf/pfcp-sm.c -> open5gs_2.5.0.tar.xz/src/smf/pfcp-sm.c
Changed
17
1
2
3
if (!sess) {
4
ogs_gtp_xact_t *gtp_xact = xact->assoc_xact;
5
+ ogs_error("No Session");
6
if (!gtp_xact) {
7
ogs_error("No associated GTP transaction");
8
break;
9
10
11
if (!sess) {
12
ogs_gtp_xact_t *gtp_xact = xact->assoc_xact;
13
+ ogs_error("No Session");
14
if (!gtp_xact) {
15
ogs_error("No associated GTP transaction");
16
break;
17
open5gs_2.4.11.tar.xz/src/smf/sbi-path.c -> open5gs_2.5.0.tar.xz/src/smf/sbi-path.c
Changed
183
1
2
#include "ngap-path.h"
3
#include "sbi-path.h"
4
5
-static int server_cb(ogs_sbi_request_t *request, void *data)
6
-{
7
- smf_event_t *e = NULL;
8
- int rv;
9
-
10
- ogs_assert(request);
11
- ogs_assert(data);
12
-
13
- e = smf_event_new(OGS_EVENT_SBI_SERVER);
14
- ogs_assert(e);
15
-
16
- e->h.sbi.request = request;
17
- e->h.sbi.data = data;
18
-
19
- rv = ogs_queue_push(ogs_app()->queue, e);
20
- if (rv != OGS_OK) {
21
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
22
- ogs_sbi_request_free(request);
23
- ogs_event_free(e);
24
- return OGS_ERROR;
25
- }
26
-
27
- return OGS_OK;
28
-}
29
-
30
-static int client_cb(int status, ogs_sbi_response_t *response, void *data)
31
-{
32
- smf_event_t *e = NULL;
33
- int rv;
34
-
35
- if (status != OGS_OK) {
36
- ogs_log_message(
37
- status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0,
38
- "client_cb() failed %d", status);
39
- return OGS_ERROR;
40
- }
41
-
42
- ogs_assert(response);
43
-
44
- e = smf_event_new(OGS_EVENT_SBI_CLIENT);
45
- ogs_assert(e);
46
- e->h.sbi.response = response;
47
- e->h.sbi.data = data;
48
-
49
- rv = ogs_queue_push(ogs_app()->queue, e);
50
- if (rv != OGS_OK) {
51
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
52
- ogs_sbi_response_free(response);
53
- ogs_event_free(e);
54
- return OGS_ERROR;
55
- }
56
-
57
- return OGS_OK;
58
-}
59
-
60
int smf_sbi_open(void)
61
{
62
ogs_sbi_nf_instance_t *nf_instance = NULL;
63
+ ogs_sbi_nf_instance_t *nrf_instance = NULL, *scp_instance = NULL;
64
ogs_sbi_nf_service_t *service = NULL;
65
66
- /* Add SELF NF instance */
67
+ /* Initialize SELF NF instance */
68
nf_instance = ogs_sbi_self()->nf_instance;
69
ogs_assert(nf_instance);
70
ogs_sbi_nf_fsm_init(nf_instance);
71
72
ogs_sbi_nf_service_add_allowed_nf_type(service, OpenAPI_nf_type_AMF);
73
}
74
75
- /* Initialize NRF NF Instance */
76
- nf_instance = ogs_sbi_self()->nrf_instance;
77
- if (nf_instance) {
78
- ogs_sbi_client_t *client = NULL;
79
-
80
- /* Client callback is only used when NF sends to NRF */
81
- client = nf_instance->client;
82
- ogs_assert(client);
83
- client->cb = client_cb;
84
-
85
- /* NFRegister is sent and the response is received
86
- * by the above client callback. */
87
- ogs_sbi_nf_fsm_init(nf_instance);
88
- }
89
-
90
- /* Build Subscription-Data */
91
- ogs_sbi_subscription_data_build_default(
92
- OpenAPI_nf_type_AMF, OGS_SBI_SERVICE_NAME_NAMF_COMM);
93
- ogs_sbi_subscription_data_build_default(
94
- OpenAPI_nf_type_PCF, OGS_SBI_SERVICE_NAME_NPCF_SMPOLICYCONTROL);
95
- ogs_sbi_subscription_data_build_default(
96
- OpenAPI_nf_type_UDM, OGS_SBI_SERVICE_NAME_NUDM_SDM);
97
+ /*
98
+ * SMF can only run to support 4G EPC mode.
99
+ *
100
+ * If the SMF is only running in 4G EPC mode,
101
+ * it should not send NFRegister/NFStatusSubscribe messages to the NRF.
102
+ */
103
+ nrf_instance = ogs_sbi_self()->nrf_instance;
104
+ scp_instance = ogs_sbi_self()->scp_instance;
105
+
106
+ if (NF_INSTANCE_CLIENT(nrf_instance) || NF_INSTANCE_CLIENT(scp_instance)) {
107
+
108
+ /* Initialize NRF NF Instance */
109
+ nf_instance = ogs_sbi_self()->nrf_instance;
110
+ if (nf_instance)
111
+ ogs_sbi_nf_fsm_init(nf_instance);
112
+
113
+ /* Build Subscription-Data */
114
+ ogs_sbi_subscription_data_build_default(
115
+ OpenAPI_nf_type_AMF, OGS_SBI_SERVICE_NAME_NAMF_COMM);
116
+ ogs_sbi_subscription_data_build_default(
117
+ OpenAPI_nf_type_PCF, OGS_SBI_SERVICE_NAME_NPCF_SMPOLICYCONTROL);
118
+ ogs_sbi_subscription_data_build_default(
119
+ OpenAPI_nf_type_UDM, OGS_SBI_SERVICE_NAME_NUDM_SDM);
120
+ }
121
122
- if (ogs_sbi_server_start_all(server_cb) != OGS_OK)
123
+ if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK)
124
return OGS_ERROR;
125
126
return OGS_OK;
127
128
ogs_sbi_server_stop_all();
129
}
130
131
-bool smf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data)
132
+bool smf_sbi_send_request(
133
+ ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact)
134
{
135
ogs_assert(nf_instance);
136
-
137
- return ogs_sbi_send_request(nf_instance, client_cb, data);
138
+ ogs_assert(xact);
139
+ return ogs_sbi_send_request_to_nf_instance(nf_instance, xact);
140
}
141
142
bool smf_sbi_discover_and_send(
143
144
xact->state = state;
145
xact->assoc_stream = stream;
146
147
- if (ogs_sbi_discover_and_send(xact, client_cb) != true) {
148
+ if (ogs_sbi_discover_and_send(xact) != true) {
149
ogs_error("smf_sbi_discover_and_send() failed");
150
ogs_sbi_xact_remove(xact);
151
152
153
154
xact->state = param->state;
155
156
- if (ogs_sbi_discover_and_send(xact, client_cb) != true) {
157
+ if (ogs_sbi_discover_and_send(xact) != true) {
158
ogs_error("smf_namf_comm_send_n1_n2_message_transfer() failed");
159
ogs_sbi_xact_remove(xact);
160
}
161
162
163
bool smf_sbi_send_sm_context_status_notify(smf_sess_t *sess)
164
{
165
+ bool rc;
166
ogs_sbi_request_t *request = NULL;
167
ogs_sbi_client_t *client = NULL;
168
169
170
171
request = smf_namf_callback_build_sm_context_status(sess, NULL);
172
ogs_expect_or_return_val(request, false);
173
- return ogs_sbi_client_send_request(client, client_notify_cb, request, NULL);
174
+
175
+ rc = ogs_sbi_send_request_to_client(
176
+ client, client_notify_cb, request, NULL);
177
+ ogs_expect(rc == true);
178
+
179
+ ogs_sbi_request_free(request);
180
+
181
+ return rc;
182
}
183
open5gs_2.4.11.tar.xz/src/smf/sbi-path.h -> open5gs_2.5.0.tar.xz/src/smf/sbi-path.h
Changed
11
1
2
int smf_sbi_open(void);
3
void smf_sbi_close(void);
4
5
-bool smf_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data);
6
+bool smf_sbi_send_request(
7
+ ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact);
8
bool smf_sbi_discover_and_send(
9
ogs_sbi_service_type_e service_type,
10
ogs_sbi_discovery_option_t *discovery_option,
11
open5gs_2.4.11.tar.xz/src/smf/smf-sm.c -> open5gs_2.5.0.tar.xz/src/smf/smf-sm.c
Changed
55
1
2
OGS_SETUP_GTP_NODE(sess, smf_gnode->gnode);
3
}
4
if (!sess) {
5
+ ogs_error("No Session");
6
ogs_gtp2_send_error_message(gtp_xact, 0,
7
OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE,
8
OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND);
9
10
ogs_fsm_dispatch(&sess->sm, e);
11
break;
12
case OGS_GTP2_DELETE_SESSION_REQUEST_TYPE:
13
+ if (!gtp2_message.h.teid_presence) ogs_error("No TEID");
14
smf_metrics_inst_global_inc(SMF_METR_GLOB_CTR_S5C_RX_DELETESESSIONREQ);
15
smf_metrics_inst_gtp_node_inc(smf_gnode->metrics, SMF_METR_GTP_NODE_CTR_S5C_RX_DELETESESSIONREQ);
16
if (!sess) {
17
+ ogs_error("No Session");
18
ogs_gtp2_send_error_message(gtp_xact, 0,
19
OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE,
20
OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND);
21
22
ogs_fsm_dispatch(&sess->sm, e);
23
break;
24
case OGS_GTP2_MODIFY_BEARER_REQUEST_TYPE:
25
+ if (!gtp2_message.h.teid_presence) ogs_error("No TEID");
26
smf_s5c_handle_modify_bearer_request(
27
sess, gtp_xact, recvbuf, >p2_message.modify_bearer_request);
28
break;
29
30
ogs_fsm_dispatch(&sess->sm, e);
31
break;
32
case OGS_GTP2_BEARER_RESOURCE_COMMAND_TYPE:
33
+ if (!gtp2_message.h.teid_presence) ogs_error("No TEID");
34
smf_s5c_handle_bearer_resource_command(
35
sess, gtp_xact, >p2_message.bearer_resource_command);
36
break;
37
38
CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY)
39
SWITCH(sbi_message.h.method)
40
CASE(OGS_SBI_HTTP_METHOD_POST)
41
- ogs_nnrf_handle_nf_status_notify(stream, &sbi_message);
42
+ ogs_nnrf_nfm_handle_nf_status_notify(stream, &sbi_message);
43
break;
44
45
DEFAULT
46
47
CASE(OGS_SBI_HTTP_METHOD_POST)
48
if (sbi_message.res_status == OGS_SBI_HTTP_STATUS_CREATED ||
49
sbi_message.res_status == OGS_SBI_HTTP_STATUS_OK) {
50
- ogs_nnrf_handle_nf_status_subscribe(
51
+ ogs_nnrf_nfm_handle_nf_status_subscribe(
52
subscription_data, &sbi_message);
53
} else {
54
ogs_error("HTTP response error : %d",
55
open5gs_2.4.11.tar.xz/src/udm/context.c -> open5gs_2.5.0.tar.xz/src/udm/context.c
Changed
10
1
2
ogs_free(udm_ue->amf_instance_id);
3
if (udm_ue->dereg_callback_uri)
4
ogs_free(udm_ue->dereg_callback_uri);
5
+ if (udm_ue->data_change_callback_uri)
6
+ ogs_free(udm_ue->data_change_callback_uri);
7
8
ogs_pool_free(&udm_ue_pool, udm_ue);
9
}
10
open5gs_2.4.11.tar.xz/src/udm/context.h -> open5gs_2.5.0.tar.xz/src/udm/context.h
Changed
9
1
2
char *amf_instance_id;
3
4
char *dereg_callback_uri;
5
+ char *data_change_callback_uri;
6
7
uint8_t kOGS_KEY_LEN;
8
uint8_t opcOGS_KEY_LEN;
9
open5gs_2.4.11.tar.xz/src/udm/event.h -> open5gs_2.5.0.tar.xz/src/udm/event.h
Changed
10
1
2
udm_ue_t *udm_ue;
3
} udm_event_t;
4
5
+OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(udm_event_t));
6
+
7
udm_event_t *udm_event_new(int id);
8
9
const char *udm_event_get_name(udm_event_t *e);
10
open5gs_2.4.11.tar.xz/src/udm/nnrf-handler.c -> open5gs_2.5.0.tar.xz/src/udm/nnrf-handler.c
Changed
37
1
2
ogs_sbi_discovery_option_t *discovery_option = NULL;
3
4
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
5
+ OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
6
OpenAPI_search_result_t *SearchResult = NULL;
7
8
ogs_assert(recvmsg);
9
10
ogs_assert(service_type);
11
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
12
ogs_assert(target_nf_type);
13
+ requester_nf_type = xact->requester_nf_type;
14
+ ogs_assert(requester_nf_type);
15
16
discovery_option = xact->discovery_option;
17
18
19
return;
20
}
21
22
- ogs_nnrf_handle_nf_discover_search_result(SearchResult);
23
+ ogs_nnrf_disc_handle_nf_discover_search_result(SearchResult);
24
25
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
26
- target_nf_type, discovery_option);
27
+ target_nf_type, requester_nf_type, discovery_option);
28
if (!nf_instance) {
29
- ogs_error("(NF discover) No %s",
30
- ogs_sbi_service_type_to_name(service_type));
31
+ ogs_error("(NF discover) No %s:%s",
32
+ ogs_sbi_service_type_to_name(service_type),
33
+ OpenAPI_nf_type_ToString(requester_nf_type));
34
return;
35
}
36
37
open5gs_2.4.11.tar.xz/src/udm/nudm-handler.c -> open5gs_2.5.0.tar.xz/src/udm/nudm-handler.c
Changed
87
1
2
3
return true;
4
}
5
+
6
+bool udm_nudm_sdm_handle_subscription_create(
7
+ udm_ue_t *udm_ue, ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg)
8
+{
9
+ ogs_sbi_message_t sendmsg;
10
+ ogs_sbi_response_t *response = NULL;
11
+ ogs_sbi_server_t *server = NULL;
12
+ ogs_sbi_header_t header;
13
+
14
+ OpenAPI_sdm_subscription_t *SDMSubscription = NULL;
15
+
16
+ ogs_assert(udm_ue);
17
+ ogs_assert(stream);
18
+ ogs_assert(recvmsg);
19
+
20
+ SDMSubscription = recvmsg->SDMSubscription;
21
+ if (!SDMSubscription) {
22
+ ogs_error("%s No SDMSubscription", udm_ue->supi);
23
+ ogs_assert(true ==
24
+ ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST,
25
+ recvmsg, "No SDMSubscription", udm_ue->supi));
26
+ return false;
27
+ }
28
+
29
+ if (!SDMSubscription->nf_instance_id) {
30
+ ogs_error("%s No nfInstanceId", udm_ue->supi);
31
+ ogs_assert(true ==
32
+ ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST,
33
+ recvmsg, "No nfInstanceId", udm_ue->supi));
34
+ return false;
35
+ }
36
+
37
+ if (!SDMSubscription->callback_reference) {
38
+ ogs_error("%s No callbackReference", udm_ue->supi);
39
+ ogs_assert(true ==
40
+ ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST,
41
+ recvmsg, "No callbackReference", udm_ue->supi));
42
+ return false;
43
+ }
44
+
45
+ if ((!SDMSubscription->monitored_resource_uris) &&
46
+ (!SDMSubscription->monitored_resource_uris->count)) {
47
+ ogs_error("%s No monitoredResourceUris", udm_ue->supi);
48
+ ogs_assert(true ==
49
+ ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST,
50
+ recvmsg, "No monitoredResourceUris", udm_ue->supi));
51
+ return false;
52
+ }
53
+
54
+ if (udm_ue->data_change_callback_uri)
55
+ ogs_free(udm_ue->data_change_callback_uri);
56
+ udm_ue->data_change_callback_uri =
57
+ ogs_strdup(SDMSubscription->callback_reference);
58
+
59
+
60
+ server = ogs_sbi_server_from_stream(stream);
61
+ ogs_assert(server);
62
+
63
+ memset(&header, 0, sizeof(header));
64
+ header.service.name = (char *)OGS_SBI_SERVICE_NAME_NUDM_SDM;
65
+ header.api.version = (char *)OGS_SBI_API_V2;
66
+ header.resource.component0 = udm_ue->supi;
67
+ header.resource.component1 =
68
+ (char *)OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS;
69
+ /* TODO: subscription id */
70
+ header.resource.component2 = udm_ue->ctx_id;
71
+
72
+ memset(&sendmsg, 0, sizeof(sendmsg));
73
+ sendmsg.http.location = ogs_sbi_server_uri(server, &header);
74
+
75
+ sendmsg.SDMSubscription = OpenAPI_sdm_subscription_copy(
76
+ sendmsg.SDMSubscription, SDMSubscription);
77
+
78
+ response = ogs_sbi_build_response(&sendmsg, OGS_SBI_HTTP_STATUS_CREATED);
79
+ ogs_assert(response);
80
+ ogs_sbi_server_send_response(stream, response);
81
+
82
+ ogs_free(sendmsg.http.location);
83
+ OpenAPI_sdm_subscription_free(sendmsg.SDMSubscription);
84
+
85
+ return true;
86
+}
87
open5gs_2.4.11.tar.xz/src/udm/nudm-handler.h -> open5gs_2.5.0.tar.xz/src/udm/nudm-handler.h
Changed
10
1
2
3
bool udm_nudm_sdm_handle_subscription_provisioned(
4
udm_ue_t *udm_ue, ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg);
5
+bool udm_nudm_sdm_handle_subscription_create(
6
+ udm_ue_t *udm_ue, ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg);
7
8
#ifdef __cplusplus
9
}
10
open5gs_2.4.11.tar.xz/src/udm/sbi-path.c -> open5gs_2.5.0.tar.xz/src/udm/sbi-path.c
Changed
121
1
2
3
#include "sbi-path.h"
4
5
-static int server_cb(ogs_sbi_request_t *request, void *data)
6
-{
7
- udm_event_t *e = NULL;
8
- int rv;
9
-
10
- ogs_assert(request);
11
- ogs_assert(data);
12
-
13
- e = udm_event_new(OGS_EVENT_SBI_SERVER);
14
- ogs_assert(e);
15
-
16
- e->h.sbi.request = request;
17
- e->h.sbi.data = data;
18
-
19
- rv = ogs_queue_push(ogs_app()->queue, e);
20
- if (rv != OGS_OK) {
21
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
22
- ogs_sbi_request_free(request);
23
- ogs_event_free(e);
24
- return OGS_ERROR;
25
- }
26
-
27
- return OGS_OK;
28
-}
29
-
30
-static int client_cb(int status, ogs_sbi_response_t *response, void *data)
31
-{
32
- udm_event_t *e = NULL;
33
- int rv;
34
-
35
- if (status != OGS_OK) {
36
- ogs_log_message(
37
- status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0,
38
- "client_cb() failed %d", status);
39
- return OGS_ERROR;
40
- }
41
-
42
- ogs_assert(response);
43
-
44
- e = udm_event_new(OGS_EVENT_SBI_CLIENT);
45
- ogs_assert(e);
46
- e->h.sbi.response = response;
47
- e->h.sbi.data = data;
48
-
49
- rv = ogs_queue_push(ogs_app()->queue, e);
50
- if (rv != OGS_OK) {
51
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
52
- ogs_sbi_response_free(response);
53
- ogs_event_free(e);
54
- return OGS_ERROR;
55
- }
56
-
57
- return OGS_OK;
58
-}
59
-
60
int udm_sbi_open(void)
61
{
62
ogs_sbi_nf_instance_t *nf_instance = NULL;
63
ogs_sbi_nf_service_t *service = NULL;
64
65
- /* Add SELF NF instance */
66
+ /* Initialize SELF NF instance */
67
nf_instance = ogs_sbi_self()->nf_instance;
68
ogs_assert(nf_instance);
69
ogs_sbi_nf_fsm_init(nf_instance);
70
71
72
/* Initialize NRF NF Instance */
73
nf_instance = ogs_sbi_self()->nrf_instance;
74
- if (nf_instance) {
75
- ogs_sbi_client_t *client = NULL;
76
-
77
- /* Client callback is only used when NF sends to NRF */
78
- client = nf_instance->client;
79
- ogs_assert(client);
80
- client->cb = client_cb;
81
-
82
- /* NFRegister is sent and the response is received
83
- * by the above client callback. */
84
+ if (nf_instance)
85
ogs_sbi_nf_fsm_init(nf_instance);
86
- }
87
88
/* Build Subscription-Data */
89
ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_UDR, NULL);
90
91
- if (ogs_sbi_server_start_all(server_cb) != OGS_OK)
92
+ if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK)
93
return OGS_ERROR;
94
95
return OGS_OK;
96
97
ogs_sbi_server_stop_all();
98
}
99
100
-bool udm_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data)
101
+bool udm_sbi_send_request(
102
+ ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact)
103
{
104
ogs_assert(nf_instance);
105
-
106
- return ogs_sbi_send_request(nf_instance, client_cb, data);
107
+ ogs_assert(xact);
108
+ return ogs_sbi_send_request_to_nf_instance(nf_instance, xact);
109
}
110
111
bool udm_sbi_discover_and_send(
112
113
114
xact->assoc_stream = stream;
115
116
- if (ogs_sbi_discover_and_send(xact, client_cb) != true) {
117
+ if (ogs_sbi_discover_and_send(xact) != true) {
118
ogs_error("udm_sbi_discover_and_send() failed");
119
ogs_sbi_xact_remove(xact);
120
ogs_assert(true ==
121
open5gs_2.4.11.tar.xz/src/udm/sbi-path.h -> open5gs_2.5.0.tar.xz/src/udm/sbi-path.h
Changed
11
1
2
int udm_sbi_open(void);
3
void udm_sbi_close(void);
4
5
-bool udm_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data);
6
+bool udm_sbi_send_request(
7
+ ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact);
8
bool udm_sbi_discover_and_send(
9
ogs_sbi_service_type_e service_type,
10
ogs_sbi_discovery_option_t *discovery_option,
11
open5gs_2.4.11.tar.xz/src/udm/udm-sm.c -> open5gs_2.5.0.tar.xz/src/udm/udm-sm.c
Changed
19
1
2
CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY)
3
SWITCH(message.h.method)
4
CASE(OGS_SBI_HTTP_METHOD_POST)
5
- ogs_nnrf_handle_nf_status_notify(stream, &message);
6
+ ogs_nnrf_nfm_handle_nf_status_notify(stream, &message);
7
break;
8
9
DEFAULT
10
11
CASE(OGS_SBI_HTTP_METHOD_POST)
12
if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED ||
13
message.res_status == OGS_SBI_HTTP_STATUS_OK) {
14
- ogs_nnrf_handle_nf_status_subscribe(
15
+ ogs_nnrf_nfm_handle_nf_status_subscribe(
16
subscription_data, &message);
17
} else {
18
ogs_error("%s HTTP response error %d",
19
open5gs_2.4.11.tar.xz/src/udm/ue-sm.c -> open5gs_2.5.0.tar.xz/src/udm/ue-sm.c
Changed
25
1
2
"Invalid resource name", message->h.method));
3
END
4
break;
5
+
6
+ CASE(OGS_SBI_HTTP_METHOD_POST)
7
+ SWITCH(message->h.resource.component1)
8
+ CASE(OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS)
9
+ udm_nudm_sdm_handle_subscription_create(
10
+ udm_ue, stream, message);
11
+ break;
12
+
13
+ DEFAULT
14
+ ogs_error("%s Invalid resource name %s",
15
+ udm_ue->suci, message->h.resource.component1);
16
+ ogs_assert(true ==
17
+ ogs_sbi_server_send_error(stream,
18
+ OGS_SBI_HTTP_STATUS_BAD_REQUEST, message,
19
+ "Invalid resource name", message->h.method));
20
+ END
21
+ break;
22
DEFAULT
23
ogs_error("%s Invalid HTTP method %s",
24
udm_ue->supi, message->h.method);
25
open5gs_2.4.11.tar.xz/src/udr/event.h -> open5gs_2.5.0.tar.xz/src/udr/event.h
Changed
10
1
2
ogs_event_t h;
3
} udr_event_t;
4
5
+OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(udr_event_t));
6
+
7
udr_event_t *udr_event_new(int id);
8
9
const char *udr_event_get_name(udr_event_t *e);
10
open5gs_2.4.11.tar.xz/src/udr/sbi-path.c -> open5gs_2.5.0.tar.xz/src/udr/sbi-path.c
Changed
93
1
2
3
#include "sbi-path.h"
4
5
-static int server_cb(ogs_sbi_request_t *request, void *data)
6
-{
7
- udr_event_t *e = NULL;
8
- int rv;
9
-
10
- ogs_assert(request);
11
- ogs_assert(data);
12
-
13
- e = udr_event_new(OGS_EVENT_SBI_SERVER);
14
- ogs_assert(e);
15
-
16
- e->h.sbi.request = request;
17
- e->h.sbi.data = data;
18
-
19
- rv = ogs_queue_push(ogs_app()->queue, e);
20
- if (rv != OGS_OK) {
21
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
22
- ogs_sbi_request_free(request);
23
- ogs_event_free(e);
24
- return OGS_ERROR;
25
- }
26
-
27
- return OGS_OK;
28
-}
29
-
30
-static int client_cb(int status, ogs_sbi_response_t *response, void *data)
31
-{
32
- udr_event_t *e = NULL;
33
- int rv;
34
-
35
- if (status != OGS_OK) {
36
- ogs_log_message(
37
- status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0,
38
- "client_cb() failed %d", status);
39
- return OGS_ERROR;
40
- }
41
-
42
- ogs_assert(response);
43
-
44
- e = udr_event_new(OGS_EVENT_SBI_CLIENT);
45
- ogs_assert(e);
46
- e->h.sbi.response = response;
47
- e->h.sbi.data = data;
48
-
49
- rv = ogs_queue_push(ogs_app()->queue, e);
50
- if (rv != OGS_OK) {
51
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
52
- ogs_sbi_response_free(response);
53
- ogs_event_free(e);
54
- return OGS_ERROR;
55
- }
56
-
57
- return OGS_OK;
58
-}
59
-
60
int udr_sbi_open(void)
61
{
62
ogs_sbi_nf_instance_t *nf_instance = NULL;
63
ogs_sbi_nf_service_t *service = NULL;
64
65
- /* Add SELF NF instance */
66
+ /* Initialize SELF NF instance */
67
nf_instance = ogs_sbi_self()->nf_instance;
68
ogs_assert(nf_instance);
69
ogs_sbi_nf_fsm_init(nf_instance);
70
71
72
/* Initialize NRF NF Instance */
73
nf_instance = ogs_sbi_self()->nrf_instance;
74
- if (nf_instance) {
75
- ogs_sbi_client_t *client = NULL;
76
-
77
- /* Client callback is only used when NF sends to NRF */
78
- client = nf_instance->client;
79
- ogs_assert(client);
80
- client->cb = client_cb;
81
-
82
- /* NFRegister is sent and the response is received
83
- * by the above client callback. */
84
+ if (nf_instance)
85
ogs_sbi_nf_fsm_init(nf_instance);
86
- }
87
88
- if (ogs_sbi_server_start_all(server_cb) != OGS_OK)
89
+ if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK)
90
return OGS_ERROR;
91
92
return OGS_OK;
93
open5gs_2.4.11.tar.xz/src/udr/udr-sm.c -> open5gs_2.5.0.tar.xz/src/udr/udr-sm.c
Changed
19
1
2
CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY)
3
SWITCH(message.h.method)
4
CASE(OGS_SBI_HTTP_METHOD_POST)
5
- ogs_nnrf_handle_nf_status_notify(stream, &message);
6
+ ogs_nnrf_nfm_handle_nf_status_notify(stream, &message);
7
break;
8
9
DEFAULT
10
11
CASE(OGS_SBI_HTTP_METHOD_POST)
12
if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED ||
13
message.res_status == OGS_SBI_HTTP_STATUS_OK) {
14
- ogs_nnrf_handle_nf_status_subscribe(
15
+ ogs_nnrf_nfm_handle_nf_status_subscribe(
16
subscription_data, &message);
17
} else {
18
ogs_error("%s HTTP response error %d",
19
open5gs_2.4.11.tar.xz/src/upf/context.c -> open5gs_2.5.0.tar.xz/src/upf/context.c
Changed
10
1
2
pdr->dnn ? pdr->dnn : "");
3
}
4
5
- ogs_info("UE F-SEIDCP:0x%lx UP:0x%lx "
6
+ ogs_info("UE F-SEIDUP:0x%lx CP:0x%lx "
7
"APN%s PDN-Type%d IPv4%s IPv6%s",
8
(long)sess->upf_n4_seid, (long)sess->smf_n4_f_seid.seid,
9
pdr->dnn, session_type,
10
open5gs_2.4.11.tar.xz/src/upf/event.h -> open5gs_2.5.0.tar.xz/src/upf/event.h
Changed
10
1
2
ogs_pfcp_message_t *pfcp_message;
3
} upf_event_t;
4
5
+OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(upf_event_t));
6
+
7
void upf_event_init(void);
8
void upf_event_term(void);
9
void upf_event_final(void);
10
open5gs_2.4.11.tar.xz/tests/af/af-sm.c -> open5gs_2.5.0.tar.xz/tests/af/af-sm.c
Changed
19
1
2
CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY)
3
SWITCH(message.h.method)
4
CASE(OGS_SBI_HTTP_METHOD_POST)
5
- ogs_nnrf_handle_nf_status_notify(stream, &message);
6
+ ogs_nnrf_nfm_handle_nf_status_notify(stream, &message);
7
break;
8
9
DEFAULT
10
11
CASE(OGS_SBI_HTTP_METHOD_POST)
12
if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED ||
13
message.res_status == OGS_SBI_HTTP_STATUS_OK) {
14
- ogs_nnrf_handle_nf_status_subscribe(
15
+ ogs_nnrf_nfm_handle_nf_status_subscribe(
16
subscription_data, &message);
17
} else {
18
ogs_error("HTTP response error : %d",
19
open5gs_2.4.11.tar.xz/tests/af/event.h -> open5gs_2.5.0.tar.xz/tests/af/event.h
Changed
10
1
2
af_sess_t *sess;
3
} af_event_t;
4
5
+OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(af_event_t));
6
+
7
af_event_t *af_event_new(int id);
8
9
const char *af_event_get_name(af_event_t *e);
10
open5gs_2.4.11.tar.xz/tests/af/nbsf-build.c -> open5gs_2.5.0.tar.xz/tests/af/nbsf-build.c
Changed
10
1
2
message.param.ipv6prefix = sess->ipv6prefix;
3
4
request = ogs_sbi_build_request(&message);
5
- ogs_assert(request);
6
+ ogs_expect(request);
7
8
return request;
9
}
10
open5gs_2.4.11.tar.xz/tests/af/nnrf-handler.c -> open5gs_2.5.0.tar.xz/tests/af/nnrf-handler.c
Changed
37
1
2
ogs_sbi_discovery_option_t *discovery_option = NULL;
3
4
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
5
+ OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
6
OpenAPI_search_result_t *SearchResult = NULL;
7
8
ogs_assert(recvmsg);
9
10
ogs_assert(service_type);
11
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
12
ogs_assert(target_nf_type);
13
+ requester_nf_type = xact->requester_nf_type;
14
+ ogs_assert(requester_nf_type);
15
16
discovery_option = xact->discovery_option;
17
18
19
return;
20
}
21
22
- ogs_nnrf_handle_nf_discover_search_result(SearchResult);
23
+ ogs_nnrf_disc_handle_nf_discover_search_result(SearchResult);
24
25
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
26
- target_nf_type, discovery_option);
27
+ target_nf_type, requester_nf_type, discovery_option);
28
if (!nf_instance) {
29
- ogs_error("(NF discover) No %s",
30
- ogs_sbi_service_type_to_name(service_type));
31
+ ogs_error("(NF discover) No %s:%s",
32
+ ogs_sbi_service_type_to_name(service_type),
33
+ OpenAPI_nf_type_ToString(requester_nf_type));
34
return;
35
}
36
37
open5gs_2.4.11.tar.xz/tests/af/npcf-build.c -> open5gs_2.5.0.tar.xz/tests/af/npcf-build.c
Changed
53
1
2
AscReqData.med_components = MediaComponentList;
3
4
request = ogs_sbi_build_request(&message);
5
- ogs_expect_or_return_val(request, NULL);
6
+ ogs_expect(request);
7
8
- ogs_free(AscReqData.notif_uri);
9
+ if (AscReqData.notif_uri)
10
+ ogs_free(AscReqData.notif_uri);
11
12
- ogs_free(AscReqData.supp_feat);
13
+ if (AscReqData.supp_feat)
14
+ ogs_free(AscReqData.supp_feat);
15
16
EventList = evSubsc.events;
17
OpenAPI_list_for_each(EventList, node) {
18
19
AscUpdateData.med_components = MediaComponentList;
20
21
request = ogs_sbi_build_request(&message);
22
- ogs_expect_or_return_val(request, NULL);
23
+ ogs_expect(request);
24
25
OpenAPI_list_for_each(MediaComponentList, node) {
26
MediaComponentMap = node->data;
27
28
(char *)OGS_SBI_RESOURCE_NAME_DELETE;
29
30
request = ogs_sbi_build_request(&message);
31
- ogs_expect_or_return_val(request, NULL);
32
+ ogs_expect(request);
33
34
return request;
35
}
36
37
AscReqData.med_components = MediaComponentList;
38
39
request = ogs_sbi_build_request(&message);
40
- ogs_expect_or_return_val(request, NULL);
41
+ ogs_expect(request);
42
43
- ogs_free(AscReqData.notif_uri);
44
+ if (AscReqData.notif_uri)
45
+ ogs_free(AscReqData.notif_uri);
46
47
- ogs_free(AscReqData.supp_feat);
48
+ if (AscReqData.supp_feat)
49
+ ogs_free(AscReqData.supp_feat);
50
51
EventList = evSubsc.events;
52
OpenAPI_list_for_each(EventList, node) {
53
open5gs_2.4.11.tar.xz/tests/af/sbi-path.c -> open5gs_2.5.0.tar.xz/tests/af/sbi-path.c
Changed
131
1
2
3
#include "sbi-path.h"
4
5
-static int server_cb(ogs_sbi_request_t *request, void *data)
6
-{
7
- af_event_t *e = NULL;
8
- int rv;
9
-
10
- ogs_assert(request);
11
- ogs_assert(data);
12
-
13
- e = af_event_new(OGS_EVENT_SBI_SERVER);
14
- ogs_assert(e);
15
-
16
- e->h.sbi.request = request;
17
- e->h.sbi.data = data;
18
-
19
- rv = ogs_queue_push(ogs_app()->queue, e);
20
- if (rv != OGS_OK) {
21
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
22
- ogs_sbi_request_free(request);
23
- ogs_event_free(e);
24
- return OGS_ERROR;
25
- }
26
-
27
- return OGS_OK;
28
-}
29
-
30
-static int client_cb(int status, ogs_sbi_response_t *response, void *data)
31
-{
32
- af_event_t *e = NULL;
33
- int rv;
34
-
35
- if (status != OGS_OK) {
36
- ogs_log_message(
37
- status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0,
38
- "client_cb() failed %d", status);
39
- return OGS_ERROR;
40
- }
41
-
42
- ogs_assert(response);
43
-
44
- e = af_event_new(OGS_EVENT_SBI_CLIENT);
45
- ogs_assert(e);
46
- e->h.sbi.response = response;
47
- e->h.sbi.data = data;
48
-
49
- rv = ogs_queue_push(ogs_app()->queue, e);
50
- if (rv != OGS_OK) {
51
- ogs_error("ogs_queue_push() failed:%d", (int)rv);
52
- ogs_sbi_response_free(response);
53
- ogs_event_free(e);
54
- return OGS_ERROR;
55
- }
56
-
57
- return OGS_OK;
58
-}
59
-
60
int af_sbi_open(void)
61
{
62
ogs_sbi_nf_instance_t *nf_instance = NULL;
63
64
- /* Add SELF NF instance */
65
+ /* Initialize SELF NF instance */
66
nf_instance = ogs_sbi_self()->nf_instance;
67
ogs_assert(nf_instance);
68
ogs_sbi_nf_fsm_init(nf_instance);
69
70
71
/* Initialize NRF NF Instance */
72
nf_instance = ogs_sbi_self()->nrf_instance;
73
- if (nf_instance) {
74
- ogs_sbi_client_t *client = NULL;
75
-
76
- /* Client callback is only used when NF sends to NRF */
77
- client = nf_instance->client;
78
- ogs_assert(client);
79
- client->cb = client_cb;
80
-
81
- /* NFRegister is sent and the response is received
82
- * by the above client callback. */
83
+ if (nf_instance)
84
ogs_sbi_nf_fsm_init(nf_instance);
85
- }
86
87
/* Build Subscription-Data */
88
ogs_sbi_subscription_data_build_default(
89
OpenAPI_nf_type_BSF, OGS_SBI_SERVICE_NAME_NBSF_MANAGEMENT);
90
91
- if (ogs_sbi_server_start_all(server_cb) != OGS_OK)
92
+ if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK)
93
return OGS_ERROR;
94
95
return OGS_OK;
96
97
ogs_sbi_server_stop_all();
98
}
99
100
-bool af_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data)
101
+bool af_sbi_send_request(
102
+ ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact)
103
{
104
ogs_assert(nf_instance);
105
-
106
- return ogs_sbi_send_request(nf_instance, client_cb, data);
107
+ ogs_assert(xact);
108
+ return ogs_sbi_send_request_to_nf_instance(nf_instance, xact);
109
}
110
111
void af_sbi_discover_and_send(
112
113
return;
114
}
115
116
- if (ogs_sbi_discover_and_send(xact, client_cb) != true) {
117
+ if (ogs_sbi_discover_and_send(xact) != true) {
118
ogs_error("af_sbi_discover_and_send() failed");
119
return;
120
}
121
122
123
request = (*build)(sess, data);
124
ogs_assert(request);
125
- ogs_sbi_client_send_request(client, client_cb, request, sess);
126
+ ogs_sbi_send_request_to_client(
127
+ client, ogs_sbi_client_handler, request, sess);
128
+
129
+ ogs_sbi_request_free(request);
130
}
131
open5gs_2.4.11.tar.xz/tests/af/sbi-path.h -> open5gs_2.5.0.tar.xz/tests/af/sbi-path.h
Changed
11
1
2
int af_sbi_open(void);
3
void af_sbi_close(void);
4
5
-bool af_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, void *data);
6
+bool af_sbi_send_request(
7
+ ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact);
8
void af_sbi_discover_and_send(
9
ogs_sbi_service_type_e service_type,
10
ogs_sbi_discovery_option_t *discovery_option,
11
open5gs_2.4.11.tar.xz/webui/package-lock.json -> open5gs_2.5.0.tar.xz/webui/package-lock.json
Changed
201
1
2
{
3
"name": "open5gs",
4
- "version": "2.4.11",
5
+ "version": "2.5.0",
6
"lockfileVersion": 2,
7
"requires": true,
8
"packages": {
9
"": {
10
"name": "open5gs",
11
- "version": "2.4.11",
12
+ "version": "2.5.0",
13
"license": "AGPL-3.0",
14
"dependencies": {
15
- "axios": "^0.16.2",
16
+ "axios": "^1.1.3",
17
"babel-plugin-polished": "^1.1.0",
18
- "babel-plugin-styled-components": "^1.5.1",
19
- "body-parser": "^1.18.3",
20
- "connect-mongo": "^1.3.2",
21
- "express": "^4.16.3",
22
- "express-restify-mongoose": "^4.3.0",
23
- "express-session": "^1.15.2",
24
- "immutable": "^3.8.1",
25
+ "babel-plugin-styled-components": "^2.0.7",
26
+ "body-parser": "^1.20.1",
27
+ "connect-mongo": "^4.6.0",
28
+ "express": "^4.18.2",
29
+ "express-restify-mongoose": "^7.0.2",
30
+ "express-session": "^1.17.3",
31
+ "immutable": "^4.1.0",
32
"jsonwebtoken": "^8.5.1",
33
- "lodash": "^4.17.10",
34
- "lusca": "^1.6.0",
35
- "method-override": "^2.3.9",
36
- "mongoose": "^4.13.14",
37
- "mongoose-long": "^0.1.1",
38
- "morgan": "^1.8.2",
39
+ "lodash": "^4.17.21",
40
+ "lusca": "^1.7.0",
41
+ "method-override": "^3.0.0",
42
+ "mongoose": "^6.7.0",
43
+ "mongoose-long": "^0.6.0",
44
+ "morgan": "^1.10.0",
45
"next": "^3.2.3",
46
"next-redux-wrapper": "^1.3.5",
47
"nprogress": "^0.2.0",
48
- "open-color": "^1.6.3",
49
- "passport": "^0.4.0",
50
+ "open-color": "^1.9.1",
51
+ "passport": "^0.6.0",
52
"passport-jwt": "^4.0.0",
53
"passport-local": "^1.0.0",
54
- "passport-local-mongoose": "^4.5.0",
55
- "prop-types": "^15.6.2",
56
+ "passport-local-mongoose": "^7.1.2",
57
+ "prop-types": "^15.8.1",
58
"react": "^15.6.1",
59
"react-dom": "^15.6.1",
60
"react-event-listener": "^0.5.9",
61
"react-icons": "^2.2.5",
62
"react-jsonschema-form": "^0.50.1",
63
"react-notification-system": "^0.2.17",
64
- "react-onclickoutside": "^6.7.1",
65
+ "react-onclickoutside": "^6.12.2",
66
"react-redux": "^5.0.7",
67
"react-transition-group": "^1.1.3",
68
"redux": "^3.7.2",
69
"redux-actions": "^2.4.0",
70
"redux-saga": "^0.15.6",
71
"styled-components": "^2.4.1",
72
- "traverse": "^0.6.6"
73
+ "traverse": "^0.6.7"
74
+ }
75
+ },
76
+ "node_modules/@aws-crypto/ie11-detection": {
77
+ "version": "2.0.2",
78
+ "resolved": "https://registry.npmjs.org/@aws-crypto/ie11-detection/-/ie11-detection-2.0.2.tgz",
79
+ "integrity": "sha512-5XDMQY98gMAf/WRTic5G++jfmS/VLM0rwpiOpaainKi4L0nqWMSB1SzsrEG5rjFZGYN6ZAefO+/Yta2dFM0kMw==",
80
+ "optional": true,
81
+ "dependencies": {
82
+ "tslib": "^1.11.1"
83
+ }
84
+ },
85
+ "node_modules/@aws-crypto/ie11-detection/node_modules/tslib": {
86
+ "version": "1.14.1",
87
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
88
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
89
+ "optional": true
90
+ },
91
+ "node_modules/@aws-crypto/sha256-browser": {
92
+ "version": "2.0.0",
93
+ "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-2.0.0.tgz",
94
+ "integrity": "sha512-rYXOQ8BFOaqMEHJrLHul/25ckWH6GTJtdLSajhlqGMx0PmSueAuvboCuZCTqEKlxR8CQOwRarxYMZZSYlhRA1A==",
95
+ "optional": true,
96
+ "dependencies": {
97
+ "@aws-crypto/ie11-detection": "^2.0.0",
98
+ "@aws-crypto/sha256-js": "^2.0.0",
99
+ "@aws-crypto/supports-web-crypto": "^2.0.0",
100
+ "@aws-crypto/util": "^2.0.0",
101
+ "@aws-sdk/types": "^3.1.0",
102
+ "@aws-sdk/util-locate-window": "^3.0.0",
103
+ "@aws-sdk/util-utf8-browser": "^3.0.0",
104
+ "tslib": "^1.11.1"
105
+ }
106
+ },
107
+ "node_modules/@aws-crypto/sha256-browser/node_modules/tslib": {
108
+ "version": "1.14.1",
109
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
110
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
111
+ "optional": true
112
+ },
113
+ "node_modules/@aws-crypto/sha256-js": {
114
+ "version": "2.0.0",
115
+ "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-2.0.0.tgz",
116
+ "integrity": "sha512-VZY+mCY4Nmrs5WGfitmNqXzaE873fcIZDu54cbaDaaamsaTOP1DBImV9F4pICc3EHjQXujyE8jig+PFCaew9ig==",
117
+ "optional": true,
118
+ "dependencies": {
119
+ "@aws-crypto/util": "^2.0.0",
120
+ "@aws-sdk/types": "^3.1.0",
121
+ "tslib": "^1.11.1"
122
+ }
123
+ },
124
+ "node_modules/@aws-crypto/sha256-js/node_modules/tslib": {
125
+ "version": "1.14.1",
126
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
127
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
128
+ "optional": true
129
+ },
130
+ "node_modules/@aws-crypto/supports-web-crypto": {
131
+ "version": "2.0.2",
132
+ "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-2.0.2.tgz",
133
+ "integrity": "sha512-6mbSsLHwZ99CTOOswvCRP3C+VCWnzBf+1SnbWxzzJ9lR0mA0JnY2JEAhp8rqmTE0GPFy88rrM27ffgp62oErMQ==",
134
+ "optional": true,
135
+ "dependencies": {
136
+ "tslib": "^1.11.1"
137
+ }
138
+ },
139
+ "node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib": {
140
+ "version": "1.14.1",
141
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
142
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
143
+ "optional": true
144
+ },
145
+ "node_modules/@aws-crypto/util": {
146
+ "version": "2.0.2",
147
+ "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-2.0.2.tgz",
148
+ "integrity": "sha512-Lgu5v/0e/BcrZ5m/IWqzPUf3UYFTy/PpeED+uc9SWUR1iZQL8XXbGQg10UfllwwBryO3hFF5dizK+78aoXC1eA==",
149
+ "optional": true,
150
+ "dependencies": {
151
+ "@aws-sdk/types": "^3.110.0",
152
+ "@aws-sdk/util-utf8-browser": "^3.0.0",
153
+ "tslib": "^1.11.1"
154
+ }
155
+ },
156
+ "node_modules/@aws-crypto/util/node_modules/tslib": {
157
+ "version": "1.14.1",
158
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
159
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
160
+ "optional": true
161
+ },
162
+ "node_modules/@aws-sdk/abort-controller": {
163
+ "version": "3.193.0",
164
+ "resolved": "https://registry.npmjs.org/@aws-sdk/abort-controller/-/abort-controller-3.193.0.tgz",
165
+ "integrity": "sha512-MYPBm5PWyKP+Tq37mKs5wDbyAyVMocF5iYmx738LYXBSj8A1V4LTFrvfd4U16BRC/sM0DYB9fBFJUQ9ISFRVYw==",
166
+ "optional": true,
167
+ "dependencies": {
168
+ "@aws-sdk/types": "3.193.0",
169
+ "tslib": "^2.3.1"
170
+ },
171
+ "engines": {
172
+ "node": ">= 12.0.0"
173
+ }
174
+ },
175
+ "node_modules/@aws-sdk/client-cognito-identity": {
176
+ "version": "3.195.0",
177
+ "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.195.0.tgz",
178
+ "integrity": "sha512-yQFCoGqGcHvyeS3rL5H5L2I6m9XFWMLaK1/iALgYsITfmig0JzlzGH/ubStEiZMsQ8lhdWmUcOyhCK4+Bx9l0w==",
179
+ "optional": true,
180
+ "dependencies": {
181
+ "@aws-crypto/sha256-browser": "2.0.0",
182
+ "@aws-crypto/sha256-js": "2.0.0",
183
+ "@aws-sdk/client-sts": "3.194.0",
184
+ "@aws-sdk/config-resolver": "3.193.0",
185
+ "@aws-sdk/credential-provider-node": "3.193.0",
186
+ "@aws-sdk/fetch-http-handler": "3.193.0",
187
+ "@aws-sdk/hash-node": "3.193.0",
188
+ "@aws-sdk/invalid-dependency": "3.193.0",
189
+ "@aws-sdk/middleware-content-length": "3.193.0",
190
+ "@aws-sdk/middleware-endpoint": "3.193.0",
191
+ "@aws-sdk/middleware-host-header": "3.193.0",
192
+ "@aws-sdk/middleware-logger": "3.193.0",
193
+ "@aws-sdk/middleware-recursion-detection": "3.193.0",
194
+ "@aws-sdk/middleware-retry": "3.193.0",
195
+ "@aws-sdk/middleware-serde": "3.193.0",
196
+ "@aws-sdk/middleware-signing": "3.193.0",
197
+ "@aws-sdk/middleware-stack": "3.193.0",
198
+ "@aws-sdk/middleware-user-agent": "3.193.0",
199
+ "@aws-sdk/node-config-provider": "3.193.0",
200
+ "@aws-sdk/node-http-handler": "3.193.0",
201
open5gs_2.4.11.tar.xz/webui/package.json -> open5gs_2.5.0.tar.xz/webui/package.json
Changed
74
1
2
{
3
"name": "open5gs",
4
- "version": "2.4.11",
5
+ "version": "2.5.0",
6
"description": "Open5gs",
7
"main": "index.js",
8
"repository": "https://github.com/open5gs/open5gs/webui",
9
"author": "Open5gs Group",
10
"license": "AGPL-3.0",
11
"dependencies": {
12
- "axios": "^0.16.2",
13
+ "axios": "^1.1.3",
14
"babel-plugin-polished": "^1.1.0",
15
- "babel-plugin-styled-components": "^1.5.1",
16
- "body-parser": "^1.18.3",
17
- "connect-mongo": "^1.3.2",
18
- "express": "^4.16.3",
19
- "express-restify-mongoose": "^4.3.0",
20
- "express-session": "^1.15.2",
21
- "immutable": "^3.8.1",
22
+ "babel-plugin-styled-components": "^2.0.7",
23
+ "body-parser": "^1.20.1",
24
+ "connect-mongo": "^4.6.0",
25
+ "express": "^4.18.2",
26
+ "express-restify-mongoose": "^7.0.2",
27
+ "express-session": "^1.17.3",
28
+ "immutable": "^4.1.0",
29
"jsonwebtoken": "^8.5.1",
30
- "lodash": "^4.17.10",
31
- "lusca": "^1.6.0",
32
- "method-override": "^2.3.9",
33
- "mongoose": "^4.13.14",
34
- "mongoose-long": "^0.1.1",
35
- "morgan": "^1.8.2",
36
+ "lodash": "^4.17.21",
37
+ "lusca": "^1.7.0",
38
+ "method-override": "^3.0.0",
39
+ "mongoose": "^6.7.0",
40
+ "mongoose-long": "^0.6.0",
41
+ "morgan": "^1.10.0",
42
"next": "^3.2.3",
43
"next-redux-wrapper": "^1.3.5",
44
"nprogress": "^0.2.0",
45
- "open-color": "^1.6.3",
46
- "passport": "^0.4.0",
47
+ "open-color": "^1.9.1",
48
+ "passport": "^0.6.0",
49
"passport-jwt": "^4.0.0",
50
"passport-local": "^1.0.0",
51
- "passport-local-mongoose": "^4.5.0",
52
- "prop-types": "^15.6.2",
53
+ "passport-local-mongoose": "^7.1.2",
54
+ "prop-types": "^15.8.1",
55
"react": "^15.6.1",
56
"react-dom": "^15.6.1",
57
"react-event-listener": "^0.5.9",
58
"react-icons": "^2.2.5",
59
"react-jsonschema-form": "^0.50.1",
60
"react-notification-system": "^0.2.17",
61
- "react-onclickoutside": "^6.7.1",
62
+ "react-onclickoutside": "^6.12.2",
63
"react-redux": "^5.0.7",
64
"react-transition-group": "^1.1.3",
65
"redux": "^3.7.2",
66
"redux-actions": "^2.4.0",
67
"redux-saga": "^0.15.6",
68
"styled-components": "^2.4.1",
69
- "traverse": "^0.6.6"
70
+ "traverse": "^0.6.7"
71
},
72
"scripts": {
73
"dev": "node server/index.js",
74
open5gs_2.4.11.tar.xz/webui/server/index.js -> open5gs_2.5.0.tar.xz/webui/server/index.js
Changed
31
1
2
const session = require('express-session');
3
4
const mongoose = require('mongoose');
5
-const MongoStore = require('connect-mongo')(session);
6
+const MongoStore = require('connect-mongo');
7
8
const passport = require('passport');
9
const LocalStrategy = require('passport-local').Strategy;
10
11
mongoose.set('debug', true);
12
}
13
const db = yield mongoose.connect(process.env.DB_URI, {
14
- useMongoClient: true,
15
+ useNewUrlParser: true,
16
+ useUnifiedTopology: true
17
/* other options */
18
})
19
20
21
22
server.use(session({
23
secret: secret,
24
- store: new MongoStore({
25
- mongooseConnection: mongoose.connection,
26
+ store: MongoStore.create({
27
+ mongoUrl: process.env.DB_URI,
28
ttl: 60 * 60 * 24 * 7 * 2
29
}),
30
resave: false,
31