forked from acouzens/open5gs
Compare commits
11 Commits
main
...
pcrf_simpl
Author | SHA1 | Date |
---|---|---|
Oliver Smith | 746e2a3405 | |
Oliver Smith | efd777fca8 | |
Daniel Willmann | 782c40aad3 | |
Oliver Smith | df6ec47f88 | |
Alexander Couzens | 5759f4a6af | |
Daniel Willmann | 0afa4ccf16 | |
Alexander Couzens | def65362d0 | |
Alexander Couzens | 056e5d0fd3 | |
Alexander Couzens | 1c99b1a485 | |
Alexander Couzens | 2502387e4b | |
root | 2521c7ae6e |
|
@ -109,10 +109,8 @@ smf:
|
|||
server:
|
||||
- address: 127.0.0.4
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -191,10 +189,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -142,10 +142,8 @@ smf:
|
|||
server:
|
||||
- address: 127.0.0.4
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -221,10 +219,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -112,10 +112,8 @@ smf:
|
|||
- address: 127.0.1.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -209,10 +207,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.1.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.1.7
|
||||
|
|
|
@ -112,10 +112,8 @@ smf:
|
|||
- address: 127.0.2.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.46.0.0/16
|
||||
gateway: 10.46.0.1
|
||||
- subnet: 2001:db8:babe::/48
|
||||
gateway: 2001:db8:babe::1
|
||||
- subnet: 10.46.0.1/16
|
||||
- subnet: 2001:db8:babe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -209,11 +207,9 @@ upf:
|
|||
server:
|
||||
- address: 127.0.2.7
|
||||
session:
|
||||
- subnet: 10.46.0.0/16
|
||||
gateway: 10.46.0.1
|
||||
- subnet: 10.46.0.1/16
|
||||
dev: ogstun2
|
||||
- subnet: 2001:db8:babe::/48
|
||||
gateway: 2001:db8:babe::1
|
||||
- subnet: 2001:db8:babe::1/48
|
||||
dev: ogstun2
|
||||
metrics:
|
||||
server:
|
||||
|
|
|
@ -112,10 +112,8 @@ smf:
|
|||
- address: 127.0.3.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.47.0.0/16
|
||||
gateway: 10.47.0.1
|
||||
- subnet: 2001:db8:face::/48
|
||||
gateway: 2001:db8:face::1
|
||||
- subnet: 10.47.0.1/16
|
||||
- subnet: 2001:db8:face::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -209,11 +207,9 @@ upf:
|
|||
server:
|
||||
- address: 127.0.3.7
|
||||
session:
|
||||
- subnet: 10.47.0.0/16
|
||||
gateway: 10.47.0.1
|
||||
- subnet: 10.47.0.1/16
|
||||
dev: ogstun3
|
||||
- subnet: 2001:db8:face::/48
|
||||
gateway: 2001:db8:face::1
|
||||
- subnet: 2001:db8:face::1/48
|
||||
dev: ogstun3
|
||||
metrics:
|
||||
server:
|
||||
|
|
|
@ -113,10 +113,8 @@ smf:
|
|||
- address: 127.0.1.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -210,10 +208,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.1.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.1.7
|
||||
|
|
|
@ -113,10 +113,8 @@ smf:
|
|||
- address: 127.0.2.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.46.0.0/16
|
||||
gateway: 10.46.0.1
|
||||
- subnet: 2001:db8:babe::/48
|
||||
gateway: 2001:db8:babe::1
|
||||
- subnet: 10.46.0.1/16
|
||||
- subnet: 2001:db8:babe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -210,11 +208,9 @@ upf:
|
|||
server:
|
||||
- address: 127.0.2.7
|
||||
session:
|
||||
- subnet: 10.46.0.0/16
|
||||
gateway: 10.46.0.1
|
||||
- subnet: 10.46.0.1/16
|
||||
dev: ogstun2
|
||||
- subnet: 2001:db8:babe::/48
|
||||
gateway: 2001:db8:babe::1
|
||||
- subnet: 2001:db8:babe::1/48
|
||||
dev: ogstun2
|
||||
metrics:
|
||||
server:
|
||||
|
|
|
@ -113,10 +113,8 @@ smf:
|
|||
- address: 127.0.3.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.47.0.0/16
|
||||
gateway: 10.47.0.1
|
||||
- subnet: 2001:db8:face::/48
|
||||
gateway: 2001:db8:face::1
|
||||
- subnet: 10.47.0.1/16
|
||||
- subnet: 2001:db8:face::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -210,11 +208,9 @@ upf:
|
|||
server:
|
||||
- address: 127.0.3.7
|
||||
session:
|
||||
- subnet: 10.47.0.0/16
|
||||
gateway: 10.47.0.1
|
||||
- subnet: 10.47.0.1/16
|
||||
dev: ogstun3
|
||||
- subnet: 2001:db8:face::/48
|
||||
gateway: 2001:db8:face::1
|
||||
- subnet: 2001:db8:face::1/48
|
||||
dev: ogstun3
|
||||
metrics:
|
||||
server:
|
||||
|
|
|
@ -118,10 +118,8 @@ smf:
|
|||
- address: 127.0.0.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -205,10 +203,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -118,10 +118,8 @@ smf:
|
|||
- address: 127.0.0.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -205,10 +203,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -116,10 +116,8 @@ smf:
|
|||
- address: 127.0.0.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -200,10 +198,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -118,10 +118,8 @@ smf:
|
|||
- address: 127.0.0.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -205,10 +203,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -116,10 +116,8 @@ smf:
|
|||
- address: 127.0.0.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -200,10 +198,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -118,10 +118,8 @@ smf:
|
|||
- address: 127.0.0.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -205,10 +203,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -118,10 +118,8 @@ smf:
|
|||
- address: 127.0.0.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -205,10 +203,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -118,10 +118,8 @@ smf:
|
|||
- address: 127.0.0.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -205,10 +203,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -116,10 +116,8 @@ smf:
|
|||
- address: 127.0.0.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -200,10 +198,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -110,10 +110,8 @@ smf:
|
|||
server:
|
||||
- address: 127.0.0.4
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -194,10 +192,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/amf.log
|
||||
file: @localstatedir@/log/open5gs/amf.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/ausf.log
|
||||
file: @localstatedir@/log/open5gs/ausf.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/bsf.log
|
||||
file: @localstatedir@/log/open5gs/bsf.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
db_uri: mongodb://localhost/open5gs
|
||||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/hss.log
|
||||
file: @localstatedir@/log/open5gs/hss.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/mme.log
|
||||
file: @localstatedir@/log/open5gs/mme.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/nrf.log
|
||||
file: @localstatedir@/log/open5gs/nrf.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/nssf.log
|
||||
file: @localstatedir@/log/open5gs/nssf.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
db_uri: mongodb://localhost/open5gs
|
||||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/pcf.log
|
||||
file: @localstatedir@/log/open5gs/pcf.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
|
|
@ -1,7 +1,59 @@
|
|||
db_uri: mongodb://localhost/open5gs
|
||||
db_json:
|
||||
default:
|
||||
af:
|
||||
ambr:
|
||||
up: 10000
|
||||
down: 10000
|
||||
gmbr:
|
||||
up: 1000
|
||||
down: 1000
|
||||
qci: 4
|
||||
normal:
|
||||
ambr:
|
||||
up: 10000
|
||||
down: 10000
|
||||
gmbr:
|
||||
up: 10000
|
||||
down: 10000
|
||||
qci: 5
|
||||
charging_profiles:
|
||||
af:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
- 4
|
||||
normal:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
- 4
|
||||
dir:
|
||||
normal: "/tmp/profiles"
|
||||
af: "/tmp/profiles_af"
|
||||
#
|
||||
# o Set OGS_LOG_INFO to all domain level
|
||||
# - If `level` is omitted, the default level is OGS_LOG_INFO)
|
||||
# - If `domain` is omitted, the all domain level is set from 'level'
|
||||
# (Default values are used, so no configuration is required)
|
||||
#
|
||||
# o Set OGS_LOG_ERROR to all domain level
|
||||
# - `level` can be set with none, fatal, error, warn, info, debug, trace
|
||||
# logger:
|
||||
# level: error
|
||||
#
|
||||
# o Set OGS_LOG_DEBUG to mme/emm domain level
|
||||
# logger:
|
||||
# level: debug
|
||||
# domain: mme,emm
|
||||
#
|
||||
# o Set OGS_LOG_TRACE to all domain level
|
||||
# logger:
|
||||
# level: trace
|
||||
# domain: core,sbi,ausf,event,tlv,mem,sock
|
||||
#
|
||||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/pcrf.log
|
||||
file: @localstatedir@/log/open5gs/pcrf.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/scp.log
|
||||
file: @localstatedir@/log/open5gs/scp.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/sepp1.log
|
||||
file: @localstatedir@/log/open5gs/sepp1.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/sepp2.log
|
||||
file: @localstatedir@/log/open5gs/sepp2.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/sgwc.log
|
||||
file: @localstatedir@/log/open5gs/sgwc.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/sgwu.log
|
||||
file: @localstatedir@/log/open5gs/sgwu.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/smf.log
|
||||
file: @localstatedir@/log/open5gs/smf.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
@ -35,10 +34,8 @@ smf:
|
|||
- address: 127.0.0.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -330,26 +327,23 @@ smf:
|
|||
# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, 2001:db8:babe::1/48
|
||||
# (If the UE has unknown DNN/APN(not internet/ims), SMF/UPF will crash.)
|
||||
# session:
|
||||
# - subnet: 10.45.0.0/16
|
||||
# gateway: 10.45.0.1
|
||||
# - subnet: 10.45.0.1/16
|
||||
# dnn: internet
|
||||
# - subnet: 2001:db8:cafe::/48
|
||||
# - subnet: 2001:db8:cafe::1/48
|
||||
# dnn: internet
|
||||
# - subnet: 10.46.0.0/16
|
||||
# gateway: 10.46.0.1
|
||||
# - subnet: 10.46.0.1/16
|
||||
# dnn: ims
|
||||
# - subnet: 2001:db8:babe::/48
|
||||
# - subnet: 2001:db8:babe::1/48
|
||||
# dnn: ims
|
||||
#
|
||||
# o Pool Range
|
||||
# session:
|
||||
# - subnet: 10.45.0.0/16
|
||||
# gateway: 10.45.0.1
|
||||
# - subnet: 10.45.0.1/16
|
||||
# range:
|
||||
# - 10.45.0.100-10.45.0.200
|
||||
# - 10.45.1.100-
|
||||
# - -10.45.0.200
|
||||
# - subnet: 2001:db8:cafe::/48
|
||||
# - subnet: 2001:db8:cafe::1/48
|
||||
# range:
|
||||
# - 2001:db8:cafe:a0::0-2001:db8:cafe:b0::0
|
||||
# - 2001:db8:cafe:c0::0-2001:db8:cafe:d0::0
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/udm.log
|
||||
file: @localstatedir@/log/open5gs/udm.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
db_uri: mongodb://localhost/open5gs
|
||||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/udr.log
|
||||
file: @localstatedir@/log/open5gs/udr.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/upf.log
|
||||
file: @localstatedir@/log/open5gs/upf.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
@ -19,10 +18,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
@ -73,16 +70,14 @@ upf:
|
|||
# $ sudo ip addr add 2001:db8:babe::1/48 dev ogstun3
|
||||
#
|
||||
# session:
|
||||
# - subnet: 10.45.0.0/16
|
||||
# gateway: 10.45.0.1
|
||||
# - subnet: 10.45.0.1/16
|
||||
# dnn: internet
|
||||
# - subnet: 2001:db8:cafe::/48
|
||||
# - subnet: 2001:db8:cafe::1/48
|
||||
# dnn: internet
|
||||
# dev: ogstun2
|
||||
# - subnet: 10.46.0.0/16
|
||||
# gateway: 10.46.0.1
|
||||
# - subnet: 10.46.0.1/16
|
||||
# dnn: ims
|
||||
# dev: ogstun3
|
||||
# - subnet: 2001:db8:babe::/48
|
||||
# - subnet: 2001:db8:babe::1/48
|
||||
# dnn: ims
|
||||
# dev: ogstun3
|
||||
|
|
|
@ -118,10 +118,8 @@ smf:
|
|||
- address: 127.0.0.4
|
||||
port: 9090
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -205,10 +203,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -110,10 +110,8 @@ smf:
|
|||
server:
|
||||
- address: 127.0.0.4
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -196,10 +194,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -107,10 +107,8 @@ smf:
|
|||
server:
|
||||
- address: 127.0.0.4
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -186,10 +184,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -5,14 +5,6 @@ Name=ogstun
|
|||
Address=10.45.0.1/16
|
||||
Address=2001:db8:cafe::1/48
|
||||
|
||||
[Route]
|
||||
Gateway=0.0.0.0
|
||||
Destination=10.45.0.0/16
|
||||
|
||||
[Route]
|
||||
Gateway=::
|
||||
Destination=2001:db8:cafe::0/48
|
||||
|
||||
[Link]
|
||||
MTUBytes=1400
|
||||
RequiredForOnline=false
|
||||
|
|
|
@ -107,10 +107,8 @@ smf:
|
|||
server:
|
||||
- address: 127.0.0.4
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -189,10 +187,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
gateway: 2001:db8:cafe::1
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -110,9 +110,8 @@ smf:
|
|||
server:
|
||||
- address: 127.0.0.4
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -194,9 +193,8 @@ upf:
|
|||
server:
|
||||
- address: 127.0.0.7
|
||||
session:
|
||||
- subnet: 10.45.0.0/16
|
||||
gateway: 10.45.0.1
|
||||
- subnet: 2001:db8:cafe::/48
|
||||
- subnet: 10.45.0.1/16
|
||||
- subnet: 2001:db8:cafe::1/48
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.0.7
|
||||
|
|
|
@ -1,32 +1,15 @@
|
|||
open5gs (2.7.1) unstable; urgency=medium
|
||||
open5gs (2.7.0~sysmocom2) unstable; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
* Rebase on open5gs.git main of 2024-04-09
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Fri, 19 Apr 2024 21:21:46 +0900
|
||||
-- Oliver Smith <osmith@sysmocom.de> Tue, 09 Apr 2024 14:05:56 +0200
|
||||
|
||||
open5gs (2.7.1~mantic) mantic; urgency=medium
|
||||
open5gs (2.7.0sysmocom1) unstable; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
* Remove mongodb dependency
|
||||
* Use default APN if none could be found
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Fri, 19 Apr 2024 21:18:53 +0900
|
||||
|
||||
open5gs (2.7.1~bionic) bionic; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Fri, 19 Apr 2024 21:16:21 +0900
|
||||
|
||||
open5gs (2.7.1~jammy) jammy; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Fri, 19 Apr 2024 21:11:30 +0900
|
||||
|
||||
open5gs (2.7.1~focal) focal; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Fri, 19 Apr 2024 21:08:46 +0900
|
||||
-- Daniel Willmann <dwillmann@sysmocom.de> Mon, 29 Jan 2024 20:17:10 +0100
|
||||
|
||||
open5gs (2.7.0) unstable; urgency=medium
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ Build-Depends: debhelper (>= 11),
|
|||
libgcrypt-dev,
|
||||
libssl-dev,
|
||||
libidn11-dev,
|
||||
libmongoc-dev,
|
||||
libbson-dev,
|
||||
libsctp-dev,
|
||||
libyaml-dev,
|
||||
|
@ -121,29 +120,11 @@ Description: UPF (User Plane Function)
|
|||
.
|
||||
This package provides the UPF (User Plane Function)
|
||||
|
||||
Package: open5gs-hss
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
mongodb-org | mongodb,
|
||||
open5gs-common (= ${binary:Version})
|
||||
Description: HSS (Home Subscriber Server)
|
||||
Open5GS is a C-language implementation of 5G Core and EPC
|
||||
Packet Core, i.e. the core network of an NR/LTE network (Release-17)
|
||||
.
|
||||
This package provides the HSS (Home Subscriber Server) element of the
|
||||
EPC, i.e. the central database of mobile network subscribers, with
|
||||
their IMSI, MSISDN, cryptographic key materials, service subscription
|
||||
information, etc. It implements the S6a interface towards the MME
|
||||
using the DIAMETER protocol.
|
||||
|
||||
Package: open5gs-pcrf
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
mongodb-org | mongodb,
|
||||
open5gs-common (= ${binary:Version})
|
||||
Description: PCRF (Policy and Charging Rules Function)
|
||||
Open5GS is a C-language implementation of 5G Core and EPC
|
||||
|
@ -273,7 +254,6 @@ Depends: ${misc:Depends},
|
|||
open5gs-amf (= ${binary:Version}),
|
||||
open5gs-sgwu (= ${binary:Version}),
|
||||
open5gs-upf (= ${binary:Version}),
|
||||
open5gs-hss (= ${binary:Version}),
|
||||
open5gs-pcrf (= ${binary:Version}),
|
||||
open5gs-nrf (= ${binary:Version}),
|
||||
open5gs-scp (= ${binary:Version}),
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
usr/bin/open5gs-hssd
|
||||
configs/freeDiameter/hss.* etc/freeDiameter
|
||||
configs/open5gs/hss.yaml etc/open5gs
|
||||
configs/open5gs/tls/hss.key etc/open5gs/tls
|
||||
configs/open5gs/tls/hss.crt etc/open5gs/tls
|
||||
configs/systemd/open5gs-hssd.service lib/systemd/system
|
|
@ -428,34 +428,6 @@ $ sudo systemctl restart open5gs-amfd
|
|||
$ sudo systemctl restart open5gs-upfd
|
||||
```
|
||||
|
||||
#### Configure logging
|
||||
|
||||
The Open5GS components log to `/var/log/open5gs/*.log` and to `stderr` by
|
||||
default.
|
||||
|
||||
##### Avoid duplicate timestamps in journalctl
|
||||
|
||||
Open5GS adds timestamps to each log line in the log file, and on `stderr`. If
|
||||
you run Open5GS with systemd and prefer looking at the logs with `journalctl`,
|
||||
then each line will have two timestamps. To fix this, disable the timestamp for
|
||||
`stderr` with the following configuration change:
|
||||
|
||||
```diff
|
||||
diff --git a/configs/open5gs/mme.yaml.in b/configs/open5gs/mme.yaml.in
|
||||
index 87c251b9d..599032b8a 100644
|
||||
--- a/configs/open5gs/mme.yaml.in
|
||||
+++ b/configs/open5gs/mme.yaml.in
|
||||
@@ -1,6 +1,9 @@
|
||||
logger:
|
||||
+ default:
|
||||
+ timestamp: false
|
||||
file:
|
||||
path: /var/log/open5gs/mme.log
|
||||
+ timestamp: true
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
```
|
||||
|
||||
#### Register Subscriber Information
|
||||
---
|
||||
|
|
|
@ -169,8 +169,7 @@ index a70143f08..e0dba560c 100644
|
|||
+++ b/configs/open5gs/amf.yaml.in
|
||||
@@ -1,6 +1,6 @@
|
||||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/amf.log
|
||||
file: @localstatedir@/log/open5gs/amf.log
|
||||
-# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
+ level: debug
|
||||
|
||||
|
|
|
@ -485,8 +485,7 @@ index a70143f08..e0dba560c 100644
|
|||
+++ b/configs/open5gs/amf.yaml.in
|
||||
@@ -1,6 +1,6 @@
|
||||
logger:
|
||||
file:
|
||||
path: @localstatedir@/log/open5gs/amf.log
|
||||
file: @localstatedir@/log/open5gs/amf.log
|
||||
-# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
+ level: debug
|
||||
|
||||
|
|
|
@ -92,8 +92,7 @@ NRF shall follow TS23.003(28.3.2.3.2 Format of NRF FQDN) for routing.
|
|||
```bash
|
||||
$ sh -c 'cat << EOF > ./install/etc/open5gs/h-nrf.yaml
|
||||
logger:
|
||||
file:
|
||||
path: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/h-nrf.log
|
||||
file: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/h-nrf.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
@ -117,8 +116,7 @@ EOF'
|
|||
```bash
|
||||
$ sh -c 'cat << EOF > ./install/etc/open5gs/h-scp.yaml
|
||||
logger:
|
||||
file:
|
||||
path: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/h-scp.log
|
||||
file: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/h-scp.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
global:
|
||||
|
@ -304,8 +302,7 @@ $ diff -u ./install/etc/open5gs/pcf.yaml.old ./install/etc/open5gs/pcf.yaml
|
|||
@@ -1,4 +1,3 @@
|
||||
-db_uri: mongodb://localhost/open5gs
|
||||
logger:
|
||||
file:
|
||||
path: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcf.log
|
||||
file: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcf.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
@@ -22,6 +21,29 @@
|
||||
server:
|
||||
|
@ -649,8 +646,7 @@ For now we will set up SEPP without using TLS.
|
|||
```bash
|
||||
$ sh -c 'cat << EOF > ./install/etc/open5gs/sepp.yaml
|
||||
logger:
|
||||
file:
|
||||
path: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sepp.log
|
||||
file: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sepp.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
max:
|
||||
|
@ -970,8 +966,7 @@ For now we will set up SEPP without using TLS.
|
|||
```bash
|
||||
$ sh -c 'cat << EOF > ./install/etc/open5gs/sepp.yaml
|
||||
logger:
|
||||
file:
|
||||
path: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sepp.log
|
||||
file: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sepp.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
max:
|
||||
|
@ -1291,8 +1286,7 @@ For now we will set up SEPP without using TLS.
|
|||
```bash
|
||||
$ sh -c 'cat << EOF > ./install/etc/open5gs/sepp.yaml
|
||||
logger:
|
||||
file:
|
||||
path: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sepp.log
|
||||
file: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sepp.log
|
||||
# level: info # fatal|error|warn|info(default)|debug|trace
|
||||
|
||||
max:
|
||||
|
|
|
@ -25,8 +25,7 @@ Example of sgw.yaml to use this feature:
|
|||
|
||||
```
|
||||
logger:
|
||||
file:
|
||||
path: /var/log/open5gs/sgw.log
|
||||
file: /var/log/open5gs/sgw.log
|
||||
level: debug
|
||||
|
||||
parameter:
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
---
|
||||
title: "v2.7.1 - Bug Fixed"
|
||||
date: 2024-04-19 21:23:00 +0900
|
||||
categories:
|
||||
- Release
|
||||
tags:
|
||||
- News
|
||||
- Release
|
||||
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
|
||||
---
|
||||
|
||||
See [Release Note](https://github.com/open5gs/open5gs/releases/tag/v2.7.1)
|
||||
|
||||
Download -- [v2.7.1.tar.gz](https://github.com/open5gs/open5gs/archive/v2.7.1.tar.gz)
|
||||
{: .notice--info}
|
|
@ -36,15 +36,10 @@ typedef struct ogs_app_context_s {
|
|||
|
||||
const char *db_uri;
|
||||
|
||||
struct {
|
||||
ogs_log_ts_e timestamp;
|
||||
} logger_default;
|
||||
|
||||
struct {
|
||||
const char *file;
|
||||
const char *level;
|
||||
const char *domain;
|
||||
ogs_log_ts_e timestamp;
|
||||
} logger;
|
||||
|
||||
ogs_queue_t *queue;
|
||||
|
|
|
@ -114,9 +114,6 @@ int ogs_app_initialize(
|
|||
ogs_app()->logger.domain, ogs_app()->logger.level);
|
||||
if (rv != OGS_OK) return rv;
|
||||
|
||||
ogs_log_set_timestamp(ogs_app()->logger_default.timestamp,
|
||||
ogs_app()->logger.timestamp);
|
||||
|
||||
/**************************************************************************
|
||||
* Stage 5 : Setup Database Module
|
||||
*/
|
||||
|
@ -257,57 +254,6 @@ static int context_validation(void)
|
|||
return OGS_OK;
|
||||
}
|
||||
|
||||
static void parse_config_logger_file(ogs_yaml_iter_t *logger_iter,
|
||||
const char *logger_key)
|
||||
{
|
||||
ogs_yaml_iter_t iter;
|
||||
|
||||
/* Legacy format:
|
||||
* logger:
|
||||
* file: /var/log/open5gs/mme.log */
|
||||
if (!strcmp(logger_key, "file") && ogs_yaml_iter_has_value(logger_iter)) {
|
||||
ogs_app()->logger.file = ogs_yaml_iter_value(logger_iter);
|
||||
|
||||
ogs_warn("Please change the configuration file as below.");
|
||||
ogs_log_print(OGS_LOG_WARN, "\n<OLD Format>\n");
|
||||
ogs_log_print(OGS_LOG_WARN, "logger:\n");
|
||||
ogs_log_print(OGS_LOG_WARN, " file: %s\n", ogs_app()->logger.file);
|
||||
ogs_log_print(OGS_LOG_WARN, "\n<NEW Format>\n");
|
||||
ogs_log_print(OGS_LOG_WARN, "logger:\n");
|
||||
ogs_log_print(OGS_LOG_WARN, " file:\n");
|
||||
ogs_log_print(OGS_LOG_WARN, " path: %s\n", ogs_app()->logger.file);
|
||||
ogs_log_print(OGS_LOG_WARN, "\n\n\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Current format:
|
||||
* logger:
|
||||
* default:
|
||||
* timestamp: false
|
||||
* file:
|
||||
* path: /var/log/open5gs/mme.log
|
||||
* timestamp: true */
|
||||
ogs_yaml_iter_recurse(logger_iter, &iter);
|
||||
while (ogs_yaml_iter_next(&iter)) {
|
||||
const char *key = ogs_yaml_iter_key(&iter);
|
||||
ogs_assert(key);
|
||||
if (!strcmp(key, "timestamp")) {
|
||||
ogs_log_ts_e ts = ogs_yaml_iter_bool(&iter)
|
||||
? OGS_LOG_TS_ENABLED
|
||||
: OGS_LOG_TS_DISABLED;
|
||||
if (!strcmp(logger_key, "default")) {
|
||||
ogs_app()->logger_default.timestamp = ts;
|
||||
} else if (!strcmp(logger_key, "file")) {
|
||||
ogs_app()->logger.timestamp = ts;
|
||||
}
|
||||
} else if (!strcmp(key, "path")) {
|
||||
if (!strcmp(logger_key, "file")) {
|
||||
ogs_app()->logger.file = ogs_yaml_iter_value(&iter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int parse_config(void)
|
||||
{
|
||||
int rv;
|
||||
|
@ -332,8 +278,9 @@ static int parse_config(void)
|
|||
while (ogs_yaml_iter_next(&logger_iter)) {
|
||||
const char *logger_key = ogs_yaml_iter_key(&logger_iter);
|
||||
ogs_assert(logger_key);
|
||||
parse_config_logger_file(&logger_iter, logger_key);
|
||||
if (!strcmp(logger_key, "level")) {
|
||||
if (!strcmp(logger_key, "file")) {
|
||||
ogs_app()->logger.file = ogs_yaml_iter_value(&logger_iter);
|
||||
} else if (!strcmp(logger_key, "level")) {
|
||||
ogs_app()->logger.level =
|
||||
ogs_yaml_iter_value(&logger_iter);
|
||||
} else if (!strcmp(logger_key, "domain")) {
|
||||
|
|
|
@ -178,34 +178,6 @@ const char *ogs_yaml_iter_value(ogs_yaml_iter_t *iter)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int ogs_yaml_iter_has_value(ogs_yaml_iter_t *iter)
|
||||
{
|
||||
ogs_assert(iter);
|
||||
ogs_assert(iter->document);
|
||||
ogs_assert(iter->node);
|
||||
|
||||
if (iter->node->type == YAML_SCALAR_NODE) {
|
||||
return 1;
|
||||
} else if (iter->node->type == YAML_MAPPING_NODE) {
|
||||
yaml_node_t *node = NULL;
|
||||
|
||||
ogs_assert(iter->pair);
|
||||
node = yaml_document_get_node(iter->document, iter->pair->value);
|
||||
ogs_assert(node);
|
||||
return node->type == YAML_SCALAR_NODE;
|
||||
} else if (iter->node->type == YAML_SEQUENCE_NODE) {
|
||||
yaml_node_t *node = NULL;
|
||||
|
||||
ogs_assert(iter->item);
|
||||
node = yaml_document_get_node(iter->document, *iter->item);
|
||||
ogs_assert(node);
|
||||
return node->type == YAML_SCALAR_NODE;
|
||||
}
|
||||
|
||||
ogs_assert_if_reached();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ogs_yaml_iter_bool(ogs_yaml_iter_t *iter)
|
||||
{
|
||||
const char *v = ogs_yaml_iter_value(iter);
|
||||
|
|
|
@ -59,7 +59,6 @@ void ogs_yaml_iter_recurse(ogs_yaml_iter_t *parent, ogs_yaml_iter_t *iter);
|
|||
int ogs_yaml_iter_type(ogs_yaml_iter_t *iter);
|
||||
const char *ogs_yaml_iter_key(ogs_yaml_iter_t *iter);
|
||||
const char *ogs_yaml_iter_value(ogs_yaml_iter_t *iter);
|
||||
int ogs_yaml_iter_has_value(ogs_yaml_iter_t *iter);
|
||||
int ogs_yaml_iter_bool(ogs_yaml_iter_t *iter);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -340,28 +340,6 @@ void ogs_log_set_mask_level(const char *_mask, ogs_log_level_e level)
|
|||
}
|
||||
}
|
||||
|
||||
void ogs_log_set_timestamp(ogs_log_ts_e ts_default, ogs_log_ts_e ts_file)
|
||||
{
|
||||
ogs_log_t *log;
|
||||
|
||||
if (ts_default == OGS_LOG_TS_UNSET)
|
||||
ts_default = OGS_LOG_TS_ENABLED;
|
||||
|
||||
if (ts_file == OGS_LOG_TS_UNSET)
|
||||
ts_file = ts_default;
|
||||
|
||||
ogs_list_for_each(&log_list, log) {
|
||||
switch (log->type) {
|
||||
case OGS_LOG_FILE_TYPE:
|
||||
log->print.timestamp = (ts_file == OGS_LOG_TS_ENABLED);
|
||||
break;
|
||||
default:
|
||||
log->print.timestamp = (ts_default == OGS_LOG_TS_ENABLED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static ogs_log_level_e ogs_log_level_from_string(const char *string)
|
||||
{
|
||||
ogs_log_level_e level = OGS_ERROR;
|
||||
|
|
|
@ -64,12 +64,6 @@ typedef enum {
|
|||
OGS_LOG_FULL = OGS_LOG_TRACE,
|
||||
} ogs_log_level_e;
|
||||
|
||||
typedef enum {
|
||||
OGS_LOG_TS_UNSET,
|
||||
OGS_LOG_TS_ENABLED,
|
||||
OGS_LOG_TS_DISABLED,
|
||||
} ogs_log_ts_e;
|
||||
|
||||
typedef struct ogs_log_s ogs_log_t;
|
||||
typedef struct ogs_log_domain_s ogs_log_domain_t;
|
||||
|
||||
|
@ -96,7 +90,6 @@ void ogs_log_install_domain(int *domain_id,
|
|||
int ogs_log_config_domain(const char *domain, const char *level);
|
||||
|
||||
void ogs_log_set_mask_level(const char *mask, ogs_log_level_e level);
|
||||
void ogs_log_set_timestamp(ogs_log_ts_e ts_default, ogs_log_ts_e ts_file);
|
||||
|
||||
void ogs_log_vprintf(ogs_log_level_e level, int id,
|
||||
ogs_err_t err, const char *file, int line, const char *func,
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "ogs-dbi.h"
|
||||
|
||||
#ifdef OGS_DBI_WITH_MONGODB
|
||||
int ogs_dbi_msisdn_data(
|
||||
char *imsi_or_msisdn_bcd, ogs_msisdn_data_t *msisdn_data)
|
||||
{
|
||||
|
@ -202,3 +203,15 @@ out:
|
|||
|
||||
return rv;
|
||||
}
|
||||
#else /* OGS_DBI_WITH_MONGODB */
|
||||
int ogs_dbi_msisdn_data(
|
||||
char *imsi_or_msisdn_bcd, ogs_msisdn_data_t *msisdn_data)
|
||||
{
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
int ogs_dbi_ims_data(char *supi, ogs_ims_data_t *ims_data)
|
||||
{
|
||||
return OGS_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -25,9 +25,6 @@ libdbi_sources = files('''
|
|||
session.c
|
||||
ims.c
|
||||
'''.split())
|
||||
|
||||
libmongoc_dep = dependency('libmongoc-1.0')
|
||||
|
||||
libdbi_inc = include_directories('.')
|
||||
|
||||
libdbi = library('ogsdbi',
|
||||
|
@ -35,10 +32,10 @@ libdbi = library('ogsdbi',
|
|||
version : libogslib_version,
|
||||
c_args : '-DOGS_DBI_COMPILATION',
|
||||
include_directories : [libdbi_inc, libinc],
|
||||
dependencies : [libproto_dep, libmongoc_dep],
|
||||
dependencies : [libproto_dep],
|
||||
install : true)
|
||||
|
||||
libdbi_dep = declare_dependency(
|
||||
link_with : libdbi,
|
||||
include_directories : [libdbi_inc, libinc],
|
||||
dependencies : [libproto_dep, libmongoc_dep])
|
||||
dependencies : [libproto_dep])
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef MESON_DUMMY_H
|
||||
#define MESON_DUMMY_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct dummy_bson;
|
||||
typedef struct dummy_bson bson_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MESON_DUMMY_H */
|
|
@ -17,12 +17,14 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <mongoc.h>
|
||||
|
||||
#include "ogs-dbi.h"
|
||||
|
||||
int __ogs_dbi_domain;
|
||||
|
||||
#ifdef OGS_DBI_WITH_MONGODB
|
||||
#include <mongoc.h>
|
||||
|
||||
|
||||
static ogs_mongoc_t self;
|
||||
|
||||
/*
|
||||
|
@ -220,3 +222,28 @@ int ogs_dbi_collection_watch_init(void)
|
|||
return OGS_ERROR;
|
||||
#endif
|
||||
}
|
||||
|
||||
#else /* OGS_DBI_WITH_MONGODB */
|
||||
int ogs_mongoc_init(const char *db_uri)
|
||||
{
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
void ogs_mongoc_final(void)
|
||||
{
|
||||
}
|
||||
|
||||
ogs_mongoc_t *ogs_mongoc(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int ogs_dbi_init(const char *db_uri)
|
||||
{
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
void ogs_dbi_final()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
#ifndef OGS_MONGOC_H
|
||||
#define OGS_MONGOC_H
|
||||
|
||||
#include <mongoc.h>
|
||||
/* STUB to disable building with mongodb (OS#6215) */
|
||||
#define MONGOC_CHECK_VERSION(a, b, c) false
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "ogs-dbi.h"
|
||||
|
||||
#ifdef OGS_DBI_WITH_MONGODB
|
||||
int ogs_dbi_session_data(char *supi, ogs_s_nssai_t *s_nssai, char *dnn,
|
||||
ogs_session_data_t *session_data)
|
||||
{
|
||||
|
@ -503,3 +504,27 @@ out:
|
|||
|
||||
return rv;
|
||||
}
|
||||
|
||||
#else /* OGS_DBI_WITH_MONGODB */
|
||||
|
||||
int ogs_dbi_session_data(char *supi, ogs_s_nssai_t *s_nssai, char *dnn,
|
||||
ogs_session_data_t *session_data)
|
||||
{
|
||||
ogs_session_t *session = &session_data->session;
|
||||
ogs_qos_t *qos = &session->qos;
|
||||
|
||||
session->name = ogs_strndup("staticprof", strlen("foobar"));
|
||||
/* check if have to set type */
|
||||
session->ambr.downlink = 300 * 1024 * 1024;
|
||||
session->ambr.uplink = 150 * 1024 * 1024;
|
||||
|
||||
session->qos.index = OGS_QOS_INDEX_5;
|
||||
session->qos.arp.priority_level = 1;
|
||||
session->qos.mbr.downlink = 10;
|
||||
session->qos.mbr.uplink = 10;
|
||||
session->qos.gbr.downlink = 10;
|
||||
session->qos.gbr.uplink = 10;
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
#endif /* OGS_DBI_WITH_MONGODB */
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "ogs-dbi.h"
|
||||
|
||||
#ifdef OGS_DBI_WITH_MONGODB
|
||||
int ogs_dbi_auth_info(char *supi, ogs_dbi_auth_info_t *auth_info)
|
||||
{
|
||||
int rv = OGS_OK;
|
||||
|
@ -816,3 +817,31 @@ out:
|
|||
|
||||
return rv;
|
||||
}
|
||||
#else
|
||||
int ogs_dbi_auth_info(char *supi, ogs_dbi_auth_info_t *auth_info)
|
||||
{
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
int ogs_dbi_update_sqn(char *supi, uint64_t sqn)
|
||||
{
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
int ogs_dbi_update_imeisv(char *supi, char *imeisv)
|
||||
{
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
int ogs_dbi_increment_sqn(char *supi)
|
||||
{
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
int ogs_dbi_subscription_data(char *supi,
|
||||
ogs_subscription_data_t *subscription_data)
|
||||
{
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
#endif /* OGS_DBI_WITH_MONGODB */
|
||||
|
|
|
@ -483,59 +483,35 @@ int ogs_nas_parse_qos_flow_descriptions(
|
|||
|
||||
ogs_assert(description);
|
||||
ogs_assert(descriptions);
|
||||
|
||||
if (descriptions->length == 0) {
|
||||
ogs_error("Length is 0");
|
||||
goto cleanup;
|
||||
}
|
||||
if (descriptions->buffer == NULL) {
|
||||
ogs_error("Buffer is NULL");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ogs_assert(descriptions->length);
|
||||
length = descriptions->length;
|
||||
ogs_assert(descriptions->buffer);
|
||||
buffer = descriptions->buffer;
|
||||
|
||||
size = 0;
|
||||
while (size < length) {
|
||||
memset(description, 0, sizeof(*description));
|
||||
|
||||
if (size+3 > length) {
|
||||
ogs_error("Overflow : size[%d] length[%d]", size, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+3 <= length);
|
||||
memcpy(description, buffer+size, 3);
|
||||
size += 3;
|
||||
|
||||
for (i = 0; i < description->num_of_parameter &&
|
||||
i < OGS_NAS_MAX_NUM_OF_QOS_FLOW_PARAMETER; i++) {
|
||||
if (size+sizeof(description->param[i].identifier) > length) {
|
||||
ogs_error("Overflow : size[%d] length[%d]", size, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+sizeof(description->param[i].identifier) <= length);
|
||||
memcpy(&description->param[i].identifier, buffer+size,
|
||||
sizeof(description->param[i].identifier));
|
||||
size += sizeof(description->param[i].identifier);
|
||||
|
||||
if (size+sizeof(description->param[i].len) > length) {
|
||||
ogs_error("Overflow : size[%d] length[%d]", size, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+sizeof(description->param[i].len) <= length);
|
||||
memcpy(&description->param[i].len, buffer+size,
|
||||
sizeof(description->param[i].len));
|
||||
size += sizeof(description->param[i].len);
|
||||
|
||||
switch(description->param[i].identifier) {
|
||||
case OGS_NAX_QOS_FLOW_PARAMETER_ID_5QI:
|
||||
if (description->param[i].len != 1) {
|
||||
ogs_error("Invalid len[%d]", description->param[i].len);
|
||||
goto cleanup;
|
||||
}
|
||||
if (size+description->param[i].len > length) {
|
||||
ogs_error("Overflow: len[%d] length[%d]",
|
||||
description->param[i].len, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(description->param[i].len == 1);
|
||||
ogs_assert(size+description->param[i].len <= length);
|
||||
memcpy(&description->param[i].qos_index,
|
||||
buffer+size, description->param[i].len);
|
||||
size += description->param[i].len;
|
||||
|
@ -545,15 +521,8 @@ int ogs_nas_parse_qos_flow_descriptions(
|
|||
case OGS_NAX_QOS_FLOW_PARAMETER_ID_GFBR_DOWNLINK:
|
||||
case OGS_NAX_QOS_FLOW_PARAMETER_ID_MFBR_UPLINK:
|
||||
case OGS_NAX_QOS_FLOW_PARAMETER_ID_MFBR_DOWNLINK:
|
||||
if (description->param[i].len != 3) {
|
||||
ogs_error("Invalid len[%d]", description->param[i].len);
|
||||
goto cleanup;
|
||||
}
|
||||
if (size+description->param[i].len > length) {
|
||||
ogs_error("Overflow: len[%d] length[%d]",
|
||||
description->param[i].len, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(description->param[i].len == 3);
|
||||
ogs_assert(size+description->param[i].len <= length);
|
||||
memcpy(&description->param[i].br,
|
||||
buffer+size, description->param[i].len);
|
||||
description->param[i].br.value =
|
||||
|
@ -561,17 +530,15 @@ int ogs_nas_parse_qos_flow_descriptions(
|
|||
size += description->param[i].len;
|
||||
break;
|
||||
default:
|
||||
ogs_error("Unknown qos_flow parameter identifier [%d]",
|
||||
ogs_fatal("Unknown qos_flow parameter identifier [%d]",
|
||||
description->param[i].identifier);
|
||||
goto cleanup;
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
}
|
||||
|
||||
description++;
|
||||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
return (int)(description-first);
|
||||
}
|
||||
|
||||
|
@ -810,50 +777,28 @@ int ogs_nas_parse_qos_rules(
|
|||
|
||||
ogs_assert(rule);
|
||||
ogs_assert(rules);
|
||||
|
||||
if (rules->length == 0) {
|
||||
ogs_error("Length is 0");
|
||||
goto cleanup;
|
||||
}
|
||||
if (rules->buffer == NULL) {
|
||||
ogs_error("Buffer is NULL");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ogs_assert(rules->length);
|
||||
length = rules->length;
|
||||
ogs_assert(rules->buffer);
|
||||
buffer = rules->buffer;
|
||||
|
||||
size = 0;
|
||||
while (size < length) {
|
||||
memset(rule, 0, sizeof(*rule));
|
||||
|
||||
if (size+sizeof(rule->identifier) > length) {
|
||||
ogs_error("Overflow : size[%d] length[%d]", size, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+sizeof(rule->identifier) <= length);
|
||||
memcpy(&rule->identifier, buffer+size, sizeof(rule->identifier));
|
||||
size += sizeof(rule->identifier);
|
||||
|
||||
if (size+sizeof(rule->length) > length) {
|
||||
ogs_error("Overflow : size[%d] length[%d]", size, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+sizeof(rule->length) <= length);
|
||||
memcpy(&rule->length, buffer+size, sizeof(rule->length));
|
||||
rule->length = be16toh(rule->length);
|
||||
size += sizeof(rule->length);
|
||||
|
||||
if (size+sizeof(rule->flags) > length) {
|
||||
ogs_error("Overflow : size[%d] length[%d]", size, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+sizeof(rule->flags) <= length);
|
||||
memcpy(&rule->flags, buffer+size, sizeof(rule->flags));
|
||||
size += sizeof(rule->flags);
|
||||
|
||||
if (rule->code == 0 || rule->code == 7) { /* Reserved */
|
||||
ogs_error("Reserved Rule Code [%d]", rule->code);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (rule->code == OGS_NAS_QOS_CODE_DELETE_EXISTING_QOS_RULE ||
|
||||
rule->code == OGS_NAS_QOS_CODE_MODIFY_EXISTING_QOS_RULE_WITHOUT_MODIFYING_PACKET_FILTERS) {
|
||||
if (rule->num_of_packet_filter != 0) {
|
||||
|
@ -861,16 +806,12 @@ int ogs_nas_parse_qos_rules(
|
|||
"and number of packet filter[%d]",
|
||||
rule->code, rule->num_of_packet_filter);
|
||||
rule->num_of_packet_filter = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < rule->num_of_packet_filter &&
|
||||
i < OGS_MAX_NUM_OF_FLOW_IN_GTP; i++) {
|
||||
if (size+sizeof(rule->pf[i].flags) > length) {
|
||||
ogs_error("Overflow : size[%d] length[%d]", size, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+sizeof(rule->pf[i].flags) <= length);
|
||||
memcpy(&rule->pf[i].flags, buffer+size, sizeof(rule->pf[i].flags));
|
||||
size += sizeof(rule->pf[i].flags);
|
||||
|
||||
|
@ -878,35 +819,24 @@ int ogs_nas_parse_qos_rules(
|
|||
OGS_NAS_QOS_CODE_MODIFY_EXISTING_QOS_RULE_AND_DELETE_PACKET_FILTERS)
|
||||
continue;
|
||||
|
||||
if (size+sizeof(rule->pf[i].content.length) > length) {
|
||||
ogs_error("Overflow : size[%d] length[%d]", size, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+sizeof(rule->pf[i].content.length) <= length);
|
||||
memcpy(&rule->pf[i].content.length, buffer+size,
|
||||
sizeof(rule->pf[i].content.length));
|
||||
size += sizeof(rule->pf[i].content.length);
|
||||
|
||||
j = 0; len = 0;
|
||||
while(len < rule->pf[i].content.length) {
|
||||
if (size+len+
|
||||
sizeof(rule->pf[i].content.component[j].type) > length) {
|
||||
ogs_error("Overflow : size[%d] len[%d] length[%d]",
|
||||
size, len, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+len+
|
||||
sizeof(rule->pf[i].content.component[j].type) <= length);
|
||||
memcpy(&rule->pf[i].content.component[j].type,
|
||||
buffer+size+len,
|
||||
sizeof(rule->pf[i].content.component[j].type));
|
||||
len += sizeof(rule->pf[i].content.component[j].type);
|
||||
switch(rule->pf[i].content.component[j].type) {
|
||||
case OGS_PACKET_FILTER_PROTOCOL_IDENTIFIER_NEXT_HEADER_TYPE:
|
||||
if (size+len+
|
||||
sizeof(rule->pf[i].content.component[j].proto) >
|
||||
length) {
|
||||
ogs_error("Overflow : size[%d] len[%d] length[%d]",
|
||||
size, len, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+len+
|
||||
sizeof(rule->pf[i].content.component[j].proto) <=
|
||||
length);
|
||||
memcpy(&rule->pf[i].content.component[j].proto,
|
||||
buffer+size+len,
|
||||
sizeof(rule->pf[i].content.component[j].proto));
|
||||
|
@ -914,25 +844,17 @@ int ogs_nas_parse_qos_rules(
|
|||
break;
|
||||
case OGS_PACKET_FILTER_IPV4_REMOTE_ADDRESS_TYPE:
|
||||
case OGS_PACKET_FILTER_IPV4_LOCAL_ADDRESS_TYPE:
|
||||
if (size+len+
|
||||
sizeof(rule->pf[i].content.component[j].ipv4.addr) >
|
||||
length) {
|
||||
ogs_error("Overflow : size[%d] len[%d] length[%d]",
|
||||
size, len, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+len+
|
||||
sizeof(rule->pf[i].content.component[j].ipv4.addr) <=
|
||||
length);
|
||||
memcpy(&rule->pf[i].content.component[j].ipv4.addr,
|
||||
buffer+size+len,
|
||||
sizeof(rule->pf[i].content.component[j].ipv4.addr));
|
||||
len += sizeof(rule->pf[i].content.component[j].ipv4.addr);
|
||||
|
||||
if (size+len+
|
||||
sizeof(rule->pf[i].content.component[j].ipv4.mask) >
|
||||
length) {
|
||||
ogs_error("Overflow : size[%d] len[%d] length[%d]",
|
||||
size, len, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+len+
|
||||
sizeof(rule->pf[i].content.component[j].ipv4.mask) <=
|
||||
length);
|
||||
memcpy(&rule->pf[i].content.component[j].ipv4.mask,
|
||||
buffer+size+len,
|
||||
sizeof(rule->pf[i].content.component[j].ipv4.mask));
|
||||
|
@ -940,26 +862,18 @@ int ogs_nas_parse_qos_rules(
|
|||
break;
|
||||
case OGS_PACKET_FILTER_IPV6_LOCAL_ADDRESS_PREFIX_LENGTH_TYPE:
|
||||
case OGS_PACKET_FILTER_IPV6_REMOTE_ADDRESS_PREFIX_LENGTH_TYPE:
|
||||
if (size+len+
|
||||
sizeof(rule->pf[i].content.component[j].ipv6.addr) >
|
||||
length) {
|
||||
ogs_error("Overflow : size[%d] len[%d] length[%d]",
|
||||
size, len, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+len+
|
||||
sizeof(rule->pf[i].content.component[j].ipv6.addr) <=
|
||||
length);
|
||||
memcpy(&rule->pf[i].content.component[j].ipv6.addr,
|
||||
buffer+size+len,
|
||||
sizeof(rule->pf[i].content.component[j].ipv6.addr));
|
||||
len += sizeof(rule->pf[i].content.component[j].ipv6.addr);
|
||||
|
||||
if (size+len+
|
||||
ogs_assert(size+len+
|
||||
sizeof(
|
||||
rule->pf[i].content.component[j].ipv6.prefixlen) >
|
||||
length) {
|
||||
ogs_error("Overflow : size[%d] len[%d] length[%d]",
|
||||
size, len, length);
|
||||
goto cleanup;
|
||||
}
|
||||
rule->pf[i].content.component[j].ipv6.prefixlen) <=
|
||||
length);
|
||||
memcpy(&rule->pf[i].content.component[j].ipv6.prefixlen,
|
||||
buffer+size+len,
|
||||
sizeof(
|
||||
|
@ -969,14 +883,10 @@ int ogs_nas_parse_qos_rules(
|
|||
break;
|
||||
case OGS_PACKET_FILTER_IPV6_LOCAL_ADDRESS_TYPE:
|
||||
case OGS_PACKET_FILTER_IPV6_REMOTE_ADDRESS_TYPE:
|
||||
if (size+len+
|
||||
ogs_assert(size+len+
|
||||
sizeof(
|
||||
rule->pf[i].content.component[j].ipv6_mask.addr) >
|
||||
length) {
|
||||
ogs_error("Overflow : size[%d] len[%d] length[%d]",
|
||||
size, len, length);
|
||||
goto cleanup;
|
||||
}
|
||||
rule->pf[i].content.component[j].ipv6_mask.addr) <=
|
||||
length);
|
||||
memcpy(&rule->pf[i].content.component[j].ipv6_mask.addr,
|
||||
buffer+size+len,
|
||||
sizeof(
|
||||
|
@ -984,14 +894,10 @@ int ogs_nas_parse_qos_rules(
|
|||
len += sizeof(
|
||||
rule->pf[i].content.component[j].ipv6_mask.addr);
|
||||
|
||||
if (size+len+
|
||||
ogs_assert(size+len+
|
||||
sizeof(
|
||||
rule->pf[i].content.component[j].ipv6_mask.mask) >
|
||||
length) {
|
||||
ogs_error("Overflow : size[%d] len[%d] length[%d]",
|
||||
size, len, length);
|
||||
goto cleanup;
|
||||
}
|
||||
rule->pf[i].content.component[j].ipv6_mask.mask) <=
|
||||
length);
|
||||
memcpy(&rule->pf[i].content.component[j].ipv6_mask.mask,
|
||||
buffer+size+len,
|
||||
sizeof(
|
||||
|
@ -1001,13 +907,9 @@ int ogs_nas_parse_qos_rules(
|
|||
break;
|
||||
case OGS_PACKET_FILTER_SINGLE_LOCAL_PORT_TYPE:
|
||||
case OGS_PACKET_FILTER_SINGLE_REMOTE_PORT_TYPE:
|
||||
if (size+len+
|
||||
sizeof(rule->pf[i].content.component[j].port.low) >
|
||||
length) {
|
||||
ogs_error("Overflow : size[%d] len[%d] length[%d]",
|
||||
size, len, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+len+
|
||||
sizeof(rule->pf[i].content.component[j].port.low) <=
|
||||
length);
|
||||
memcpy(&rule->pf[i].content.component[j].port.low,
|
||||
buffer+size+len,
|
||||
sizeof(rule->pf[i].content.component[j].port.low));
|
||||
|
@ -1017,13 +919,9 @@ int ogs_nas_parse_qos_rules(
|
|||
break;
|
||||
case OGS_PACKET_FILTER_LOCAL_PORT_RANGE_TYPE:
|
||||
case OGS_PACKET_FILTER_REMOTE_PORT_RANGE_TYPE:
|
||||
if (size+len+
|
||||
sizeof(rule->pf[i].content.component[j].port.low) >
|
||||
length) {
|
||||
ogs_error("Overflow : size[%d] len[%d] length[%d]",
|
||||
size, len, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+len+
|
||||
sizeof(rule->pf[i].content.component[j].port.low) <=
|
||||
length);
|
||||
memcpy(&rule->pf[i].content.component[j].port.low,
|
||||
buffer+size+len,
|
||||
sizeof(rule->pf[i].content.component[j].port.low));
|
||||
|
@ -1031,13 +929,9 @@ int ogs_nas_parse_qos_rules(
|
|||
be16toh(rule->pf[i].content.component[j].port.low);
|
||||
len += sizeof(rule->pf[i].content.component[j].port.low);
|
||||
|
||||
if (size+len+
|
||||
sizeof(rule->pf[i].content.component[j].port.high) >
|
||||
length) {
|
||||
ogs_error("Overflow : size[%d] len[%d] length[%d]",
|
||||
size, len, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+len+
|
||||
sizeof(rule->pf[i].content.component[j].port.high) <=
|
||||
length);
|
||||
memcpy(&rule->pf[i].content.component[j].port.high,
|
||||
buffer+size+len,
|
||||
sizeof(rule->pf[i].content.component[j].port.high));
|
||||
|
@ -1048,7 +942,7 @@ int ogs_nas_parse_qos_rules(
|
|||
default:
|
||||
ogs_error("Unknown Packet Filter Type(%d)",
|
||||
rule->pf[i].content.component[j].type);
|
||||
goto cleanup;
|
||||
return -1;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
|
@ -1060,17 +954,11 @@ int ogs_nas_parse_qos_rules(
|
|||
rule->code != OGS_NAS_QOS_CODE_MODIFY_EXISTING_QOS_RULE_AND_DELETE_PACKET_FILTERS &&
|
||||
rule->code != OGS_NAS_QOS_CODE_MODIFY_EXISTING_QOS_RULE_WITHOUT_MODIFYING_PACKET_FILTERS) {
|
||||
|
||||
if (size+sizeof(rule->precedence) > length) {
|
||||
ogs_error("Overflow : size[%d] length[%d]", size, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+sizeof(rule->precedence) <= length);
|
||||
memcpy(&rule->precedence, buffer+size, sizeof(rule->precedence));
|
||||
size += sizeof(rule->precedence);
|
||||
|
||||
if (size+sizeof(rule->flow.flags) > length) {
|
||||
ogs_error("Overflow : size[%d] length[%d]", size, length);
|
||||
goto cleanup;
|
||||
}
|
||||
ogs_assert(size+sizeof(rule->flow.flags) <= length);
|
||||
memcpy(&rule->flow.flags, buffer+size, sizeof(rule->flow.flags));
|
||||
size += sizeof(rule->flow.flags);
|
||||
}
|
||||
|
@ -1078,8 +966,6 @@ int ogs_nas_parse_qos_rules(
|
|||
rule++;
|
||||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
return (int)(rule-first);
|
||||
}
|
||||
|
||||
|
|
|
@ -743,7 +743,6 @@ int ogs_pfcp_context_parse_config(const char *local, const char *remote)
|
|||
do {
|
||||
ogs_pfcp_subnet_t *subnet = NULL;
|
||||
const char *ipstr = NULL;
|
||||
const char *gateway = NULL;
|
||||
const char *mask_or_numbits = NULL;
|
||||
const char *dnn = NULL;
|
||||
const char *dev = self.tun_ifname;
|
||||
|
@ -782,8 +781,6 @@ int ogs_pfcp_context_parse_config(const char *local, const char *remote)
|
|||
mask_or_numbits = (const char *)v;
|
||||
}
|
||||
}
|
||||
} else if (!strcmp(subnet_key, "gateway")) {
|
||||
gateway = ogs_yaml_iter_value(&subnet_iter);
|
||||
} else if (!strcmp(subnet_key, "apn") ||
|
||||
!strcmp(subnet_key, "dnn")) {
|
||||
dnn = ogs_yaml_iter_value(&subnet_iter);
|
||||
|
@ -828,7 +825,7 @@ int ogs_pfcp_context_parse_config(const char *local, const char *remote)
|
|||
}
|
||||
|
||||
subnet = ogs_pfcp_subnet_add(
|
||||
ipstr, mask_or_numbits, gateway, dnn, dev);
|
||||
ipstr, mask_or_numbits, dnn, dev);
|
||||
ogs_assert(subnet);
|
||||
|
||||
subnet->num_of_range = num;
|
||||
|
@ -2153,7 +2150,7 @@ ogs_pfcp_dev_t *ogs_pfcp_dev_find_by_ifname(const char *ifname)
|
|||
|
||||
ogs_pfcp_subnet_t *ogs_pfcp_subnet_add(
|
||||
const char *ipstr, const char *mask_or_numbits,
|
||||
const char *gateway, const char *dnn, const char *ifname)
|
||||
const char *dnn, const char *ifname)
|
||||
{
|
||||
int rv;
|
||||
ogs_pfcp_dev_t *dev = NULL;
|
||||
|
@ -2182,41 +2179,6 @@ ogs_pfcp_subnet_t *ogs_pfcp_subnet_add(
|
|||
|
||||
subnet->family = subnet->gw.family;
|
||||
subnet->prefixlen = atoi(mask_or_numbits);
|
||||
|
||||
if (memcmp(subnet->gw.sub, subnet->sub.sub,
|
||||
sizeof(subnet->gw.sub)) != 0) {
|
||||
char *subnet_string = NULL;
|
||||
|
||||
if (subnet->family == AF_INET) {
|
||||
subnet_string = ogs_ipv4_to_string(subnet->sub.sub[0]);
|
||||
ogs_assert(subnet_string);
|
||||
} else if (subnet->family == AF_INET6) {
|
||||
subnet_string = ogs_ipv6addr_to_string(
|
||||
(uint8_t*)&subnet->sub.sub[0]);
|
||||
ogs_assert(subnet_string);
|
||||
}
|
||||
|
||||
ogs_warn("Please change the configuration files of "
|
||||
"smf.yaml and upf.yaml as below.");
|
||||
ogs_log_print(OGS_LOG_WARN, "\n<OLD Format>\n");
|
||||
ogs_log_print(OGS_LOG_WARN, "smf:\n");
|
||||
ogs_log_print(OGS_LOG_WARN, " session:\n");
|
||||
ogs_log_print(OGS_LOG_WARN, " - subnet: %s/%s\n",
|
||||
ipstr, mask_or_numbits);
|
||||
ogs_log_print(OGS_LOG_WARN, "\n<NEW Format>\n");
|
||||
ogs_log_print(OGS_LOG_WARN, "smf:\n");
|
||||
ogs_log_print(OGS_LOG_WARN, " session:\n");
|
||||
ogs_log_print(OGS_LOG_WARN, " - subnet: %s/%s\n",
|
||||
subnet_string ? subnet_string : "Unknown", mask_or_numbits);
|
||||
ogs_log_print(OGS_LOG_WARN, " gateway: %s\n\n\n", ipstr);
|
||||
|
||||
ogs_free(subnet_string);
|
||||
}
|
||||
}
|
||||
|
||||
if (gateway) {
|
||||
rv = ogs_ipsubnet(&subnet->gw, gateway, NULL);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
}
|
||||
|
||||
if (dnn)
|
||||
|
|
|
@ -491,7 +491,7 @@ ogs_pfcp_dev_t *ogs_pfcp_dev_find_by_ifname(const char *ifname);
|
|||
|
||||
ogs_pfcp_subnet_t *ogs_pfcp_subnet_add(
|
||||
const char *ipstr, const char *mask_or_numbits,
|
||||
const char *gateway, const char *dnn, const char *ifname);
|
||||
const char *dnn, const char *ifname);
|
||||
ogs_pfcp_subnet_t *ogs_pfcp_subnet_next(ogs_pfcp_subnet_t *subnet);
|
||||
void ogs_pfcp_subnet_remove(ogs_pfcp_subnet_t *subnet);
|
||||
void ogs_pfcp_subnet_remove_all(void);
|
||||
|
|
|
@ -2493,26 +2493,12 @@ ogs_sbi_subscription_data_t *ogs_sbi_subscription_data_add(void)
|
|||
return subscription_data;
|
||||
}
|
||||
|
||||
void ogs_sbi_subscription_data_set_resource_uri(
|
||||
ogs_sbi_subscription_data_t *subscription_data, char *resource_uri)
|
||||
{
|
||||
ogs_assert(subscription_data);
|
||||
ogs_assert(resource_uri);
|
||||
|
||||
if (subscription_data->resource_uri)
|
||||
ogs_free(subscription_data->resource_uri);
|
||||
subscription_data->resource_uri = ogs_strdup(resource_uri);
|
||||
ogs_assert(subscription_data->resource_uri);
|
||||
}
|
||||
|
||||
void ogs_sbi_subscription_data_set_id(
|
||||
ogs_sbi_subscription_data_t *subscription_data, char *id)
|
||||
{
|
||||
ogs_assert(subscription_data);
|
||||
ogs_assert(id);
|
||||
|
||||
if (subscription_data->id)
|
||||
ogs_free(subscription_data->id);
|
||||
subscription_data->id = ogs_strdup(id);
|
||||
ogs_assert(subscription_data->id);
|
||||
}
|
||||
|
@ -2530,9 +2516,6 @@ void ogs_sbi_subscription_data_remove(
|
|||
if (subscription_data->notification_uri)
|
||||
ogs_free(subscription_data->notification_uri);
|
||||
|
||||
if (subscription_data->resource_uri)
|
||||
ogs_free(subscription_data->resource_uri);
|
||||
|
||||
if (subscription_data->req_nf_instance_id)
|
||||
ogs_free(subscription_data->req_nf_instance_id);
|
||||
|
||||
|
|
|
@ -286,7 +286,6 @@ typedef struct ogs_sbi_subscription_data_s {
|
|||
OpenAPI_nf_type_e req_nf_type; /* reqNfType */
|
||||
OpenAPI_nf_status_e nf_status;
|
||||
char *notification_uri;
|
||||
char *resource_uri;
|
||||
|
||||
struct {
|
||||
OpenAPI_nf_type_e nf_type; /* nfType */
|
||||
|
@ -296,7 +295,7 @@ typedef struct ogs_sbi_subscription_data_s {
|
|||
uint64_t requester_features;
|
||||
uint64_t nrf_supported_features;
|
||||
|
||||
void *client;
|
||||
void *client; /* only used in SERVER */
|
||||
} ogs_sbi_subscription_data_t;
|
||||
|
||||
typedef struct ogs_sbi_smf_info_s {
|
||||
|
@ -516,8 +515,6 @@ void ogs_sbi_subscription_spec_remove(
|
|||
void ogs_sbi_subscription_spec_remove_all(void);
|
||||
|
||||
ogs_sbi_subscription_data_t *ogs_sbi_subscription_data_add(void);
|
||||
void ogs_sbi_subscription_data_set_resource_uri(
|
||||
ogs_sbi_subscription_data_t *subscription_data, char *resource_uri);
|
||||
void ogs_sbi_subscription_data_set_id(
|
||||
ogs_sbi_subscription_data_t *subscription_data, char *id);
|
||||
void ogs_sbi_subscription_data_remove(
|
||||
|
|
|
@ -1712,7 +1712,11 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_status_update(
|
|||
|
||||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_PATCH;
|
||||
message.h.uri = subscription_data->resource_uri;
|
||||
message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM;
|
||||
message.h.api.version = (char *)OGS_SBI_API_V1;
|
||||
message.h.resource.component[0] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS;
|
||||
message.h.resource.component[1] = subscription_data->id;
|
||||
|
||||
message.http.content_type = (char *)OGS_SBI_CONTENT_PATCH_TYPE;
|
||||
|
||||
|
@ -1767,7 +1771,11 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_status_unsubscribe(
|
|||
|
||||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_DELETE;
|
||||
message.h.uri = subscription_data->resource_uri;
|
||||
message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM;
|
||||
message.h.api.version = (char *)OGS_SBI_API_V1;
|
||||
message.h.resource.component[0] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS;
|
||||
message.h.resource.component[1] = subscription_data->id;
|
||||
|
||||
message.http.custom.callback =
|
||||
(char *)OGS_SBI_CALLBACK_NNRF_NFMANAGEMENT_NF_STATUS_NOTIFY;
|
||||
|
|
|
@ -824,17 +824,6 @@ void ogs_nnrf_nfm_handle_nf_status_subscribe(
|
|||
{
|
||||
OpenAPI_subscription_data_t *SubscriptionData = NULL;
|
||||
|
||||
int rv;
|
||||
ogs_sbi_message_t message;
|
||||
ogs_sbi_header_t header;
|
||||
|
||||
bool rc;
|
||||
ogs_sbi_client_t *client = NULL;
|
||||
OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL;
|
||||
char *fqdn = NULL;
|
||||
uint16_t fqdn_port = 0;
|
||||
ogs_sockaddr_t *addr = NULL, *addr6 = NULL;
|
||||
|
||||
ogs_assert(recvmsg);
|
||||
ogs_assert(subscription_data);
|
||||
|
||||
|
@ -844,62 +833,44 @@ void ogs_nnrf_nfm_handle_nf_status_subscribe(
|
|||
return;
|
||||
}
|
||||
|
||||
if (!recvmsg->http.location) {
|
||||
ogs_error("No http.location");
|
||||
return;
|
||||
}
|
||||
if (recvmsg->http.location) {
|
||||
int rv;
|
||||
ogs_sbi_message_t message;
|
||||
ogs_sbi_header_t header;
|
||||
|
||||
memset(&header, 0, sizeof(header));
|
||||
header.uri = recvmsg->http.location;
|
||||
|
||||
rv = ogs_sbi_parse_header(&message, &header);
|
||||
if (rv != OGS_OK) {
|
||||
ogs_error("Cannot parse http.location [%s]",
|
||||
recvmsg->http.location);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!message.h.resource.component[1]) {
|
||||
ogs_error("No Subscription ID [%s]", recvmsg->http.location);
|
||||
ogs_sbi_header_free(&header);
|
||||
return;
|
||||
}
|
||||
|
||||
rc = ogs_sbi_getaddr_from_uri(
|
||||
&scheme, &fqdn, &fqdn_port, &addr, &addr6, header.uri);
|
||||
if (rc == false || scheme == OpenAPI_uri_scheme_NULL) {
|
||||
ogs_error("Invalid URI [%s]", header.uri);
|
||||
ogs_sbi_header_free(&header);
|
||||
return;
|
||||
}
|
||||
|
||||
client = ogs_sbi_client_find(scheme, fqdn, fqdn_port, addr, addr6);
|
||||
if (!client) {
|
||||
ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC);
|
||||
client = ogs_sbi_client_add(scheme, fqdn, fqdn_port, addr, addr6);
|
||||
if (!client) {
|
||||
ogs_error("%s: ogs_sbi_client_add() failed", OGS_FUNC);
|
||||
|
||||
ogs_sbi_header_free(&header);
|
||||
ogs_free(fqdn);
|
||||
ogs_freeaddrinfo(addr);
|
||||
ogs_freeaddrinfo(addr6);
|
||||
memset(&header, 0, sizeof(header));
|
||||
header.uri = recvmsg->http.location;
|
||||
|
||||
rv = ogs_sbi_parse_header(&message, &header);
|
||||
if (rv != OGS_OK) {
|
||||
ogs_error("Cannot parse http.location [%s]",
|
||||
recvmsg->http.location);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!message.h.resource.component[1]) {
|
||||
ogs_error("No Subscription ID [%s]", recvmsg->http.location);
|
||||
ogs_sbi_header_free(&header);
|
||||
return;
|
||||
}
|
||||
|
||||
ogs_sbi_subscription_data_set_id(
|
||||
subscription_data, message.h.resource.component[1]);
|
||||
|
||||
ogs_sbi_header_free(&header);
|
||||
|
||||
} else if (SubscriptionData->subscription_id) {
|
||||
/*
|
||||
* For compatibility with v2.5.x and lower versions
|
||||
*
|
||||
* Deprecated : It will be removed soon.
|
||||
*/
|
||||
ogs_sbi_subscription_data_set_id(
|
||||
subscription_data, SubscriptionData->subscription_id);
|
||||
} else {
|
||||
ogs_error("No Subscription ID");
|
||||
return;
|
||||
}
|
||||
OGS_SBI_SETUP_CLIENT(subscription_data, client);
|
||||
|
||||
ogs_free(fqdn);
|
||||
ogs_freeaddrinfo(addr);
|
||||
ogs_freeaddrinfo(addr6);
|
||||
|
||||
ogs_sbi_subscription_data_set_resource_uri(
|
||||
subscription_data, header.uri);
|
||||
ogs_sbi_subscription_data_set_id(
|
||||
subscription_data, message.h.resource.component[1]);
|
||||
|
||||
ogs_sbi_header_free(&header);
|
||||
|
||||
/* SBI Features */
|
||||
if (SubscriptionData->nrf_supported_features) {
|
||||
|
|
|
@ -313,11 +313,6 @@ int ogs_sbi_discover_and_send(ogs_sbi_xact_t *xact)
|
|||
ogs_free(fqdn);
|
||||
ogs_freeaddrinfo(addr);
|
||||
ogs_freeaddrinfo(addr6);
|
||||
|
||||
if (!client) {
|
||||
ogs_fatal("No Client : [%s]", request->h.uri);
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
}
|
||||
|
||||
if (scp_client) {
|
||||
|
|
|
@ -46,6 +46,7 @@ if host_system == 'darwin'
|
|||
libsctp_sources += files('ogs-usrsctp.c')
|
||||
libsctp_conf.set('HAVE_USRSCTP', 1)
|
||||
else
|
||||
libsctp_conf.set('HAVE_NETINET_SCTP_H', 1)
|
||||
sctp_dep = cc.find_library('sctp', required : false)
|
||||
libsctp_sources += files('ogs-lksctp.c')
|
||||
endif
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
project('open5gs', 'c', 'cpp',
|
||||
version : '2.7.1',
|
||||
version : '2.7.0',
|
||||
license : 'AGPL-3.0-or-later',
|
||||
meson_version : '>= 0.43.0',
|
||||
default_options : [
|
||||
|
@ -25,7 +25,7 @@ project('open5gs', 'c', 'cpp',
|
|||
],
|
||||
)
|
||||
|
||||
libogslib_version = '2.7.1'
|
||||
libogslib_version = '2.7.0'
|
||||
|
||||
prefix = get_option('prefix')
|
||||
bindir = join_paths(prefix, get_option('bindir'))
|
||||
|
@ -127,7 +127,7 @@ subdir('src')
|
|||
subdir('misc')
|
||||
# Don't build the tests unless we can run them (either natively or in an exe wrapper)
|
||||
build_tests = not meson.is_cross_build() or (meson.is_cross_build() and meson.has_exe_wrapper())
|
||||
if build_tests
|
||||
if build_tests and get_option('mongodb')
|
||||
subdir('tests')
|
||||
endif
|
||||
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
option('fuzzing', type: 'boolean', value: false, description: 'Enable fuzzing tests')
|
||||
option('lib_fuzzing_engine', type : 'string', value : '', description : 'Path to the libFuzzer engine library')
|
||||
option('metrics_impl', type : 'combo', choices : ['void', 'prometheus'], value : 'void', description : 'libogsmetrics implementation')
|
||||
option('mongodb', type : 'boolean', value : 'false', description : 'build with mongo db support')
|
||||
|
|
|
@ -1676,17 +1676,13 @@ void amf_ue_remove(amf_ue_t *amf_ue)
|
|||
/* Clear SubscribedInfo */
|
||||
amf_clear_subscribed_info(amf_ue);
|
||||
|
||||
PCF_AM_POLICY_CLEAR(amf_ue);
|
||||
if (amf_ue->policy_association.client)
|
||||
ogs_sbi_client_remove(amf_ue->policy_association.client);
|
||||
if (amf_ue->policy_association_id)
|
||||
ogs_free(amf_ue->policy_association_id);
|
||||
if (amf_ue->data_change_subscription_id)
|
||||
ogs_free(amf_ue->data_change_subscription_id);
|
||||
|
||||
UDM_SDM_CLEAR(amf_ue);
|
||||
if (amf_ue->data_change_subscription.client)
|
||||
ogs_sbi_client_remove(amf_ue->data_change_subscription.client);
|
||||
|
||||
CLEAR_5G_AKA_CONFIRMATION(amf_ue);
|
||||
if (amf_ue->confirmation_for_5g_aka.client)
|
||||
ogs_sbi_client_remove(amf_ue->confirmation_for_5g_aka.client);
|
||||
if (amf_ue->confirmation_url_for_5g_aka)
|
||||
ogs_free(amf_ue->confirmation_url_for_5g_aka);
|
||||
|
||||
/* Free UeRadioCapability */
|
||||
OGS_ASN_CLEAR_DATA(&amf_ue->ueRadioCapability);
|
||||
|
@ -2253,10 +2249,8 @@ void amf_sess_remove(amf_sess_t *sess)
|
|||
ogs_list_count(&sess->sbi.xact_list));
|
||||
ogs_sbi_object_free(&sess->sbi);
|
||||
|
||||
CLEAR_SESSION_CONTEXT(sess);
|
||||
|
||||
if (sess->sm_context.client)
|
||||
ogs_sbi_client_remove(sess->sm_context.client);
|
||||
if (sess->sm_context_ref)
|
||||
ogs_free(sess->sm_context_ref);
|
||||
|
||||
if (sess->payload_container)
|
||||
ogs_pkbuf_free(sess->payload_container);
|
||||
|
|
|
@ -290,33 +290,13 @@ struct amf_ue_s {
|
|||
/* PCF sends the RESPONSE
|
||||
* of [POST] /npcf-am-polocy-control/v1/policies */
|
||||
#define PCF_AM_POLICY_ASSOCIATED(__aMF) \
|
||||
((__aMF) && ((__aMF)->policy_association.id))
|
||||
((__aMF) && ((__aMF)->policy_association_id))
|
||||
|
||||
#define PCF_AM_POLICY_CLEAR(__aMF) \
|
||||
do { \
|
||||
ogs_assert((__aMF)); \
|
||||
if ((__aMF)->policy_association.resource_uri) \
|
||||
ogs_free((__aMF)->policy_association.resource_uri); \
|
||||
(__aMF)->policy_association.resource_uri = NULL; \
|
||||
if ((__aMF)->policy_association.id) \
|
||||
ogs_free((__aMF)->policy_association.id); \
|
||||
(__aMF)->policy_association.id = NULL; \
|
||||
} while(0)
|
||||
#define PCF_AM_POLICY_STORE(__aMF, __rESOURCE_URI, __iD) \
|
||||
do { \
|
||||
ogs_assert((__aMF)); \
|
||||
ogs_assert((__rESOURCE_URI)); \
|
||||
ogs_assert((__iD)); \
|
||||
PCF_AM_POLICY_CLEAR(__aMF); \
|
||||
(__aMF)->policy_association.resource_uri = ogs_strdup(__rESOURCE_URI); \
|
||||
ogs_assert((__aMF)->policy_association.resource_uri); \
|
||||
(__aMF)->policy_association.id = ogs_strdup(__iD); \
|
||||
ogs_assert((__aMF)->policy_association.id); \
|
||||
} while(0)
|
||||
struct {
|
||||
char *resource_uri;
|
||||
char *id;
|
||||
ogs_sbi_client_t *client;
|
||||
} policy_association;
|
||||
OGS_MEM_CLEAR((__aMF)->policy_association_id);
|
||||
#define PCF_AM_POLICY_STORE(__aMF, __iD) \
|
||||
OGS_STRING_DUP((__aMF)->policy_association_id, __iD);
|
||||
char *policy_association_id;
|
||||
|
||||
/* 5GMM Capability */
|
||||
struct {
|
||||
|
@ -342,27 +322,7 @@ struct amf_ue_s {
|
|||
/* Security Context */
|
||||
ogs_nas_ue_security_capability_t ue_security_capability;
|
||||
ogs_nas_ue_network_capability_t ue_network_capability;
|
||||
#define CHECK_5G_AKA_CONFIRMATION(__aMF) \
|
||||
((__aMF) && ((__aMF)->confirmation_for_5g_aka.resource_uri))
|
||||
#define STORE_5G_AKA_CONFIRMATION(__aMF, __rESOURCE_URI) \
|
||||
do { \
|
||||
ogs_assert((__aMF)); \
|
||||
CLEAR_5G_AKA_CONFIRMATION(__aMF); \
|
||||
(__aMF)->confirmation_for_5g_aka.resource_uri = \
|
||||
ogs_strdup(__rESOURCE_URI); \
|
||||
ogs_assert((__aMF)->confirmation_for_5g_aka.resource_uri); \
|
||||
} while(0)
|
||||
#define CLEAR_5G_AKA_CONFIRMATION(__aMF) \
|
||||
do { \
|
||||
ogs_assert((__aMF)); \
|
||||
if ((__aMF)->confirmation_for_5g_aka.resource_uri) \
|
||||
ogs_free((__aMF)->confirmation_for_5g_aka.resource_uri); \
|
||||
(__aMF)->confirmation_for_5g_aka.resource_uri = NULL; \
|
||||
} while(0)
|
||||
struct {
|
||||
char *resource_uri;
|
||||
ogs_sbi_client_t *client;
|
||||
} confirmation_for_5g_aka;
|
||||
char *confirmation_url_for_5g_aka;
|
||||
uint8_t rand[OGS_RAND_LEN];
|
||||
uint8_t autn[OGS_AUTN_LEN];
|
||||
uint8_t xres_star[OGS_MAX_RES_LEN];
|
||||
|
@ -508,34 +468,8 @@ struct amf_ue_s {
|
|||
|
||||
/* SubscriptionId of Subscription to Data Change Notification to UDM */
|
||||
#define UDM_SDM_SUBSCRIBED(__aMF) \
|
||||
((__aMF) && ((__aMF)->data_change_subscription.id))
|
||||
#define UDM_SDM_CLEAR(__aMF) \
|
||||
do { \
|
||||
ogs_assert((__aMF)); \
|
||||
if ((__aMF)->data_change_subscription.resource_uri) \
|
||||
ogs_free((__aMF)->data_change_subscription.resource_uri); \
|
||||
(__aMF)->data_change_subscription.resource_uri = NULL; \
|
||||
if ((__aMF)->data_change_subscription.id) \
|
||||
ogs_free((__aMF)->data_change_subscription.id); \
|
||||
(__aMF)->data_change_subscription.id = NULL; \
|
||||
} while(0)
|
||||
#define UDM_SDM_STORE(__aMF, __rESOURCE_URI, __iD) \
|
||||
do { \
|
||||
ogs_assert((__aMF)); \
|
||||
ogs_assert((__rESOURCE_URI)); \
|
||||
ogs_assert((__iD)); \
|
||||
UDM_SDM_CLEAR(__aMF); \
|
||||
(__aMF)->data_change_subscription.resource_uri = \
|
||||
ogs_strdup(__rESOURCE_URI); \
|
||||
ogs_assert((__aMF)->data_change_subscription.resource_uri); \
|
||||
(__aMF)->data_change_subscription.id = ogs_strdup(__iD); \
|
||||
ogs_assert((__aMF)->data_change_subscription.id); \
|
||||
} while(0)
|
||||
struct {
|
||||
char *resource_uri;
|
||||
char *id;
|
||||
ogs_sbi_client_t *client;
|
||||
} data_change_subscription;
|
||||
((__aMF) && ((__aMF)->data_change_subscription_id))
|
||||
char *data_change_subscription_id;
|
||||
|
||||
struct {
|
||||
/*
|
||||
|
@ -565,37 +499,18 @@ typedef struct amf_sess_s {
|
|||
uint8_t pti; /* Procedure Trasaction Identity */
|
||||
|
||||
#define SESSION_CONTEXT_IN_SMF(__sESS) \
|
||||
((__sESS) && (__sESS)->sm_context.ref)
|
||||
#define STORE_SESSION_CONTEXT(__sESS, __rESOURCE_URI, __rEF) \
|
||||
((__sESS) && (__sESS)->sm_context_ref)
|
||||
#define CLEAR_SM_CONTEXT_REF(__sESS) \
|
||||
do { \
|
||||
ogs_assert(__sESS); \
|
||||
ogs_assert(__rESOURCE_URI); \
|
||||
ogs_assert(__rEF); \
|
||||
CLEAR_SESSION_CONTEXT(__sESS); \
|
||||
(__sESS)->sm_context.resource_uri = ogs_strdup(__rESOURCE_URI); \
|
||||
ogs_assert((__sESS)->sm_context.resource_uri); \
|
||||
(__sESS)->sm_context.ref = ogs_strdup(__rEF); \
|
||||
ogs_assert((__sESS)->sm_context.ref); \
|
||||
} while(0);
|
||||
#define CLEAR_SESSION_CONTEXT(__sESS) \
|
||||
do { \
|
||||
ogs_assert(__sESS); \
|
||||
if ((__sESS)->sm_context.ref) \
|
||||
ogs_free((__sESS)->sm_context.ref); \
|
||||
(__sESS)->sm_context.ref = NULL; \
|
||||
if ((__sESS)->sm_context.resource_uri) \
|
||||
ogs_free((__sESS)->sm_context.resource_uri); \
|
||||
(__sESS)->sm_context.resource_uri = NULL; \
|
||||
ogs_assert((__sESS)->sm_context_ref); \
|
||||
ogs_free((__sESS)->sm_context_ref); \
|
||||
(__sESS)->sm_context_ref = NULL; \
|
||||
} while(0);
|
||||
|
||||
/* SMF sends the RESPONSE
|
||||
* of [POST] /nsmf-pdusession/v1/sm-contexts */
|
||||
struct {
|
||||
char *resource_uri;
|
||||
char *ref;
|
||||
ogs_sbi_client_t *client;
|
||||
} sm_context;
|
||||
|
||||
char *sm_context_ref;
|
||||
bool pdu_session_release_complete_received;
|
||||
bool pdu_session_resource_release_response_received;
|
||||
|
||||
|
|
|
@ -1283,11 +1283,9 @@ int gmm_handle_ul_nas_transport(ran_ue_t *ran_ue, amf_ue_t *amf_ue,
|
|||
sess->s_nssai.sd.v = selected_slice->s_nssai.sd.v;
|
||||
|
||||
ogs_info("UE SUPI[%s] DNN[%s] S_NSSAI[SST:%d SD:0x%x] "
|
||||
"smContextRef[%s] smContextResourceURI[%s]",
|
||||
"smContextRef [%s]",
|
||||
amf_ue->supi, sess->dnn, sess->s_nssai.sst, sess->s_nssai.sd.v,
|
||||
sess->sm_context.ref ? sess->sm_context.ref : "NULL",
|
||||
sess->sm_context.resource_uri ?
|
||||
sess->sm_context.resource_uri : "NULL");
|
||||
sess->sm_context_ref ? sess->sm_context_ref : "NULL");
|
||||
|
||||
if (!SESSION_CONTEXT_IN_SMF(sess)) {
|
||||
ogs_sbi_nf_instance_t *nf_instance = NULL;
|
||||
|
@ -1437,7 +1435,7 @@ int gmm_handle_ul_nas_transport(ran_ue_t *ran_ue, amf_ue_t *amf_ue,
|
|||
sess->pdu_session_release_complete_received = true;
|
||||
if (sess->pdu_session_resource_release_response_received ==
|
||||
true)
|
||||
CLEAR_SESSION_CONTEXT(sess);
|
||||
CLEAR_SM_CONTEXT_REF(sess);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -1678,7 +1676,7 @@ static void amf_namf_comm_decode_ue_session_context_list(
|
|||
sess = amf_sess_add(amf_ue, PduSessionContext->pdu_session_id);
|
||||
ogs_assert(sess);
|
||||
|
||||
sess->sm_context.ref = PduSessionContext->sm_context_ref;
|
||||
sess->sm_context_ref = PduSessionContext->sm_context_ref;
|
||||
|
||||
if (PduSessionContext->s_nssai) {
|
||||
memset(&sess->s_nssai, 0, sizeof(sess->s_nssai));
|
||||
|
|
|
@ -274,7 +274,9 @@ void gmm_state_de_registered(ogs_fsm_t *s, amf_event_t *e)
|
|||
ogs_warn("[%s] Ignore SBI message", amf_ue->suci);
|
||||
break;
|
||||
CASE(OGS_SBI_HTTP_METHOD_DELETE)
|
||||
CLEAR_5G_AKA_CONFIRMATION(amf_ue);
|
||||
if (amf_ue->confirmation_url_for_5g_aka)
|
||||
ogs_free(amf_ue->confirmation_url_for_5g_aka);
|
||||
amf_ue->confirmation_url_for_5g_aka = NULL;
|
||||
|
||||
if (state == AMF_RELEASE_SM_CONTEXT_NO_STATE ||
|
||||
state == AMF_UE_INITIATED_DE_REGISTERED) {
|
||||
|
@ -376,7 +378,10 @@ void gmm_state_de_registered(ogs_fsm_t *s, amf_event_t *e)
|
|||
*/
|
||||
if (state == AMF_RELEASE_SM_CONTEXT_NO_STATE ||
|
||||
state == AMF_UE_INITIATED_DE_REGISTERED) {
|
||||
UDM_SDM_CLEAR(amf_ue);
|
||||
if (amf_ue->data_change_subscription_id) {
|
||||
ogs_free(amf_ue->data_change_subscription_id);
|
||||
amf_ue->data_change_subscription_id = NULL;
|
||||
}
|
||||
|
||||
r = amf_ue_sbi_discover_and_send(
|
||||
OGS_SBI_SERVICE_TYPE_NUDM_UECM, NULL,
|
||||
|
@ -442,7 +447,7 @@ void gmm_state_de_registered(ogs_fsm_t *s, amf_event_t *e)
|
|||
if (state == AMF_RELEASE_SM_CONTEXT_NO_STATE ||
|
||||
state == AMF_UE_INITIATED_DE_REGISTERED) {
|
||||
|
||||
if (CHECK_5G_AKA_CONFIRMATION(amf_ue)) {
|
||||
if (amf_ue->confirmation_url_for_5g_aka) {
|
||||
r = amf_ue_sbi_discover_and_send(
|
||||
OGS_SBI_SERVICE_TYPE_NAUSF_AUTH,
|
||||
NULL,
|
||||
|
@ -852,7 +857,9 @@ void gmm_state_registered(ogs_fsm_t *s, amf_event_t *e)
|
|||
ogs_warn("[%s] Ignore SBI message", amf_ue->suci);
|
||||
break;
|
||||
CASE(OGS_SBI_HTTP_METHOD_DELETE)
|
||||
CLEAR_5G_AKA_CONFIRMATION(amf_ue);
|
||||
if (amf_ue->confirmation_url_for_5g_aka)
|
||||
ogs_free(amf_ue->confirmation_url_for_5g_aka);
|
||||
amf_ue->confirmation_url_for_5g_aka = NULL;
|
||||
|
||||
if (state == AMF_RELEASE_SM_CONTEXT_NO_STATE ||
|
||||
state == AMF_UE_INITIATED_DE_REGISTERED) {
|
||||
|
@ -960,7 +967,10 @@ void gmm_state_registered(ogs_fsm_t *s, amf_event_t *e)
|
|||
AMF_NETWORK_INITIATED_IMPLICIT_DE_REGISTERED ||
|
||||
state ==
|
||||
AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED) {
|
||||
UDM_SDM_CLEAR(amf_ue);
|
||||
if (amf_ue->data_change_subscription_id) {
|
||||
ogs_free(amf_ue->data_change_subscription_id);
|
||||
amf_ue->data_change_subscription_id = NULL;
|
||||
}
|
||||
|
||||
r = amf_ue_sbi_discover_and_send(
|
||||
OGS_SBI_SERVICE_TYPE_NUDM_UECM, NULL,
|
||||
|
@ -1034,7 +1044,7 @@ void gmm_state_registered(ogs_fsm_t *s, amf_event_t *e)
|
|||
state ==
|
||||
AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED) {
|
||||
|
||||
if (amf_ue->confirmation_for_5g_aka.resource_uri) {
|
||||
if (amf_ue->confirmation_url_for_5g_aka) {
|
||||
r = amf_ue_sbi_discover_and_send(
|
||||
OGS_SBI_SERVICE_TYPE_NAUSF_AUTH,
|
||||
NULL,
|
||||
|
|
|
@ -246,7 +246,7 @@ int amf_namf_comm_handle_n1_n2_message_transfer(
|
|||
amf_ue->supi, sess->psi,
|
||||
N1N2MessageTransferReqData->
|
||||
n1n2_failure_txf_notif_uri);
|
||||
return OGS_ERROR;
|
||||
return OGS_ERROR;;
|
||||
}
|
||||
|
||||
client = ogs_sbi_client_find(
|
||||
|
@ -287,7 +287,7 @@ int amf_namf_comm_handle_n1_n2_message_transfer(
|
|||
header.resource.component[1] = amf_ue->supi;
|
||||
header.resource.component[2] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_N1_N2_MESSAGES;
|
||||
header.resource.component[3] = sess->sm_context.ref;
|
||||
header.resource.component[3] = sess->sm_context_ref;
|
||||
|
||||
sendmsg.http.location = ogs_sbi_server_uri(server, &header);
|
||||
|
||||
|
@ -349,12 +349,13 @@ int amf_namf_comm_handle_n1_n2_message_transfer(
|
|||
header.resource.component[1] = amf_ue->supi;
|
||||
header.resource.component[2] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_N1_N2_MESSAGES;
|
||||
header.resource.component[3] = sess->sm_context.ref;
|
||||
header.resource.component[3] = sess->sm_context_ref;
|
||||
|
||||
sendmsg.http.location = ogs_sbi_server_uri(server, &header);
|
||||
|
||||
/* Store Paging Info */
|
||||
AMF_SESS_STORE_PAGING_INFO(sess, sendmsg.http.location, NULL);
|
||||
AMF_SESS_STORE_PAGING_INFO(
|
||||
sess, sendmsg.http.location, NULL);
|
||||
|
||||
/* Store 5GSM Message */
|
||||
AMF_SESS_STORE_5GSM_MESSAGE(sess,
|
||||
|
@ -423,12 +424,13 @@ int amf_namf_comm_handle_n1_n2_message_transfer(
|
|||
header.resource.component[1] = amf_ue->supi;
|
||||
header.resource.component[2] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_N1_N2_MESSAGES;
|
||||
header.resource.component[3] = sess->sm_context.ref;
|
||||
header.resource.component[3] = sess->sm_context_ref;
|
||||
|
||||
sendmsg.http.location = ogs_sbi_server_uri(server, &header);
|
||||
|
||||
/* Store Paging Info */
|
||||
AMF_SESS_STORE_PAGING_INFO(sess, sendmsg.http.location, NULL);
|
||||
AMF_SESS_STORE_PAGING_INFO(
|
||||
sess, sendmsg.http.location, NULL);
|
||||
|
||||
/* Store 5GSM Message */
|
||||
AMF_SESS_STORE_5GSM_MESSAGE(sess,
|
||||
|
@ -1172,7 +1174,7 @@ static OpenAPI_list_t *amf_namf_comm_encode_ue_session_context_list(amf_ue_t *am
|
|||
ogs_assert(sNSSAI);
|
||||
|
||||
PduSessionContext->pdu_session_id = sess->psi;
|
||||
PduSessionContext->sm_context_ref = sess->sm_context.ref;
|
||||
PduSessionContext->sm_context_ref = sess->sm_context_ref;
|
||||
|
||||
sNSSAI->sst = sess->s_nssai.sst;
|
||||
sNSSAI->sd = ogs_s_nssai_sd_to_string(sess->s_nssai.sd);
|
||||
|
|
|
@ -87,11 +87,11 @@ ogs_sbi_request_t *amf_nausf_auth_build_authenticate_delete(
|
|||
ogs_sbi_request_t *request = NULL;
|
||||
|
||||
ogs_assert(amf_ue);
|
||||
ogs_assert(amf_ue->confirmation_for_5g_aka.resource_uri);
|
||||
ogs_assert(amf_ue->confirmation_url_for_5g_aka);
|
||||
|
||||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_DELETE;
|
||||
message.h.uri = amf_ue->confirmation_for_5g_aka.resource_uri;
|
||||
message.h.uri = amf_ue->confirmation_url_for_5g_aka;
|
||||
|
||||
request = ogs_sbi_build_request(&message);
|
||||
ogs_expect(request);
|
||||
|
@ -110,11 +110,11 @@ ogs_sbi_request_t *amf_nausf_auth_build_authenticate_confirmation(
|
|||
OpenAPI_confirmation_data_t *ConfirmationData = NULL;
|
||||
|
||||
ogs_assert(amf_ue);
|
||||
ogs_assert(amf_ue->confirmation_for_5g_aka.resource_uri);
|
||||
ogs_assert(amf_ue->confirmation_url_for_5g_aka);
|
||||
|
||||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_PUT;
|
||||
message.h.uri = amf_ue->confirmation_for_5g_aka.resource_uri;
|
||||
message.h.uri = amf_ue->confirmation_url_for_5g_aka;
|
||||
|
||||
ConfirmationData = ogs_calloc(1, sizeof(*ConfirmationData));
|
||||
if (!ConfirmationData) {
|
||||
|
|
|
@ -30,21 +30,9 @@ int amf_nausf_auth_handle_authenticate(
|
|||
OpenAPI_map_t *LinksValueScheme = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
bool rc;
|
||||
ogs_sbi_client_t *client = NULL;
|
||||
OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL;
|
||||
char *fqdn = NULL;
|
||||
uint16_t fqdn_port = 0;
|
||||
ogs_sockaddr_t *addr = NULL, *addr6 = NULL;
|
||||
|
||||
ogs_assert(amf_ue);
|
||||
ogs_assert(message);
|
||||
|
||||
if (!message->http.location) {
|
||||
ogs_error("[%s] No http.location", amf_ue->suci);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
UeAuthenticationCtx = message->UeAuthenticationCtx;
|
||||
if (!UeAuthenticationCtx) {
|
||||
ogs_error("[%s] No UeAuthenticationCtx", amf_ue->suci);
|
||||
|
@ -104,36 +92,11 @@ int amf_nausf_auth_handle_authenticate(
|
|||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
rc = ogs_sbi_getaddr_from_uri(
|
||||
&scheme, &fqdn, &fqdn_port, &addr, &addr6, message->http.location);
|
||||
if (rc == false || scheme == OpenAPI_uri_scheme_NULL) {
|
||||
ogs_error("[%s] Invalid URI [%s]",
|
||||
amf_ue->suci, message->http.location);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
client = ogs_sbi_client_find(scheme, fqdn, fqdn_port, addr, addr6);
|
||||
if (!client) {
|
||||
ogs_debug("[%s] ogs_sbi_client_add()", amf_ue->suci);
|
||||
client = ogs_sbi_client_add(scheme, fqdn, fqdn_port, addr, addr6);
|
||||
if (!client) {
|
||||
ogs_error("[%s] ogs_sbi_client_add() failed", amf_ue->suci);
|
||||
|
||||
ogs_free(fqdn);
|
||||
ogs_freeaddrinfo(addr);
|
||||
ogs_freeaddrinfo(addr6);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
OGS_SBI_SETUP_CLIENT(&amf_ue->confirmation_for_5g_aka, client);
|
||||
|
||||
ogs_free(fqdn);
|
||||
ogs_freeaddrinfo(addr);
|
||||
ogs_freeaddrinfo(addr6);
|
||||
|
||||
STORE_5G_AKA_CONFIRMATION(amf_ue, message->http.location);
|
||||
if (amf_ue->confirmation_url_for_5g_aka)
|
||||
ogs_free(amf_ue->confirmation_url_for_5g_aka);
|
||||
amf_ue->confirmation_url_for_5g_aka =
|
||||
ogs_strdup(LinksValueSchemeValue->href);
|
||||
ogs_assert(amf_ue->confirmation_url_for_5g_aka);
|
||||
|
||||
ogs_ascii_to_hex(AV5G_AKA->rand, strlen(AV5G_AKA->rand),
|
||||
amf_ue->rand, sizeof(amf_ue->rand));
|
||||
|
|
|
@ -2516,7 +2516,7 @@ void ngap_handle_pdu_session_resource_release_response(
|
|||
|
||||
sess->pdu_session_resource_release_response_received = true;
|
||||
if (sess->pdu_session_release_complete_received == true)
|
||||
CLEAR_SESSION_CONTEXT(sess);
|
||||
CLEAR_SM_CONTEXT_REF(sess);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -200,7 +200,6 @@ int ngap_send_to_nas(ran_ue_t *ran_ue,
|
|||
default:
|
||||
ogs_error("Not implemented(security header type:0x%x)",
|
||||
sh->security_header_type);
|
||||
ran_ue_remove(ran_ue);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -208,39 +207,12 @@ int ngap_send_to_nas(ran_ue_t *ran_ue,
|
|||
if (nas_5gs_security_decode(ran_ue->amf_ue,
|
||||
security_header_type, nasbuf) != OGS_OK) {
|
||||
ogs_error("nas_eps_security_decode failed()");
|
||||
ran_ue_remove(ran_ue);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
h = (ogs_nas_5gmm_header_t *)nasbuf->data;
|
||||
ogs_assert(h);
|
||||
if (procedureCode == NGAP_ProcedureCode_id_InitialUEMessage) {
|
||||
if (h->extended_protocol_discriminator !=
|
||||
OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM) {
|
||||
|
||||
ogs_error("Invalid extended_protocol_discriminator [%d]",
|
||||
h->extended_protocol_discriminator);
|
||||
|
||||
ogs_pkbuf_free(nasbuf);
|
||||
ran_ue_remove(ran_ue);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
if (h->message_type != OGS_NAS_5GS_REGISTRATION_REQUEST &&
|
||||
h->message_type != OGS_NAS_5GS_SERVICE_REQUEST &&
|
||||
h->message_type != OGS_NAS_5GS_DEREGISTRATION_REQUEST_FROM_UE) {
|
||||
|
||||
ogs_error("Invalid 5GMM message type [%d]", h->message_type);
|
||||
|
||||
ogs_pkbuf_free(nasbuf);
|
||||
ran_ue_remove(ran_ue);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (h->extended_protocol_discriminator ==
|
||||
OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM) {
|
||||
e = amf_event_new(AMF_EVENT_5GMM_MESSAGE);
|
||||
|
@ -275,10 +247,7 @@ int ngap_send_to_nas(ran_ue_t *ran_ue,
|
|||
} else {
|
||||
ogs_error("Unknown NAS Protocol discriminator 0x%02x",
|
||||
h->extended_protocol_discriminator);
|
||||
|
||||
ogs_pkbuf_free(nasbuf);
|
||||
ran_ue_remove(ran_ue);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -221,11 +221,15 @@ ogs_sbi_request_t *amf_npcf_am_policy_control_build_delete(
|
|||
|
||||
ogs_assert(amf_ue);
|
||||
ogs_assert(amf_ue->supi);
|
||||
ogs_assert(amf_ue->policy_association.resource_uri);
|
||||
ogs_assert(amf_ue->policy_association_id);
|
||||
|
||||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_DELETE;
|
||||
message.h.uri = amf_ue->policy_association.resource_uri;
|
||||
message.h.service.name =
|
||||
(char *)OGS_SBI_SERVICE_NAME_NPCF_AM_POLICY_CONTROL;
|
||||
message.h.api.version = (char *)OGS_SBI_API_V1;
|
||||
message.h.resource.component[0] = (char *)OGS_SBI_RESOURCE_NAME_POLICIES;
|
||||
message.h.resource.component[1] = amf_ue->policy_association_id;
|
||||
|
||||
request = ogs_sbi_build_request(&message);
|
||||
ogs_expect(request);
|
||||
|
|
|
@ -35,13 +35,6 @@ int amf_npcf_am_policy_control_handle_create(
|
|||
ogs_sbi_message_t message;
|
||||
ogs_sbi_header_t header;
|
||||
|
||||
bool rc;
|
||||
ogs_sbi_client_t *client = NULL;
|
||||
OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL;
|
||||
char *fqdn = NULL;
|
||||
uint16_t fqdn_port = 0;
|
||||
ogs_sockaddr_t *addr = NULL, *addr6 = NULL;
|
||||
|
||||
if (recvmsg->res_status != OGS_SBI_HTTP_STATUS_CREATED) {
|
||||
ogs_error("[%s] HTTP response error [%d]",
|
||||
amf_ue->supi, recvmsg->res_status);
|
||||
|
@ -105,53 +98,12 @@ int amf_npcf_am_policy_control_handle_create(
|
|||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
rc = ogs_sbi_getaddr_from_uri(
|
||||
&scheme, &fqdn, &fqdn_port, &addr, &addr6, header.uri);
|
||||
if (rc == false || scheme == OpenAPI_uri_scheme_NULL) {
|
||||
ogs_error("[%s] Invalid URI [%s]", amf_ue->supi, header.uri);
|
||||
|
||||
ogs_sbi_header_free(&header);
|
||||
r = nas_5gs_send_gmm_reject_from_sbi(
|
||||
amf_ue, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
client = ogs_sbi_client_find(scheme, fqdn, fqdn_port, addr, addr6);
|
||||
if (!client) {
|
||||
ogs_debug("[%s] ogs_sbi_client_add()", amf_ue->supi);
|
||||
client = ogs_sbi_client_add(scheme, fqdn, fqdn_port, addr, addr6);
|
||||
if (!client) {
|
||||
ogs_error("[%s] ogs_sbi_client_add() failed", amf_ue->supi);
|
||||
|
||||
ogs_sbi_header_free(&header);
|
||||
r = nas_5gs_send_gmm_reject_from_sbi(
|
||||
amf_ue, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
|
||||
ogs_free(fqdn);
|
||||
ogs_freeaddrinfo(addr);
|
||||
ogs_freeaddrinfo(addr6);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
OGS_SBI_SETUP_CLIENT(&amf_ue->policy_association, client);
|
||||
|
||||
ogs_free(fqdn);
|
||||
ogs_freeaddrinfo(addr);
|
||||
ogs_freeaddrinfo(addr6);
|
||||
|
||||
PCF_AM_POLICY_STORE(amf_ue, header.uri, message.h.resource.component[1]);
|
||||
|
||||
/* SBI Features */
|
||||
supported_features = ogs_uint64_from_string(PolicyAssociation->supp_feat);
|
||||
amf_ue->am_policy_control_features &= supported_features;
|
||||
|
||||
PCF_AM_POLICY_STORE(amf_ue, message.h.resource.component[1]);
|
||||
|
||||
OpenAPI_list_for_each(PolicyAssociation->triggers, node) {
|
||||
if (node->data) {
|
||||
OpenAPI_request_trigger_e trigger = (intptr_t)node->data;
|
||||
|
|
|
@ -272,15 +272,17 @@ ogs_sbi_request_t *amf_nsmf_pdusession_build_update_sm_context(
|
|||
|
||||
ogs_assert(param);
|
||||
ogs_assert(sess);
|
||||
ogs_assert(sess->sm_context.resource_uri);
|
||||
ogs_assert(sess->sm_context_ref);
|
||||
amf_ue = sess->amf_ue;
|
||||
ogs_assert(amf_ue);
|
||||
|
||||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST;
|
||||
message.h.uri = ogs_msprintf("%s/%s",
|
||||
sess->sm_context.resource_uri, OGS_SBI_RESOURCE_NAME_MODIFY);
|
||||
ogs_assert(message.h.uri);
|
||||
message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NSMF_PDUSESSION;
|
||||
message.h.api.version = (char *)OGS_SBI_API_V1;
|
||||
message.h.resource.component[0] = (char *)OGS_SBI_RESOURCE_NAME_SM_CONTEXTS;
|
||||
message.h.resource.component[1] = sess->sm_context_ref;
|
||||
message.h.resource.component[2] = (char *)OGS_SBI_RESOURCE_NAME_MODIFY;
|
||||
|
||||
memset(&ueLocation, 0, sizeof(ueLocation));
|
||||
memset(&SmContextUpdateData, 0, sizeof(SmContextUpdateData));
|
||||
|
@ -375,8 +377,6 @@ ogs_sbi_request_t *amf_nsmf_pdusession_build_update_sm_context(
|
|||
ogs_expect(request);
|
||||
|
||||
end:
|
||||
if (message.h.uri)
|
||||
ogs_free(message.h.uri);
|
||||
if (ueLocation.nr_location) {
|
||||
if (ueLocation.nr_location->ue_location_timestamp)
|
||||
ogs_free(ueLocation.nr_location->ue_location_timestamp);
|
||||
|
@ -405,15 +405,18 @@ ogs_sbi_request_t *amf_nsmf_pdusession_build_release_sm_context(
|
|||
OpenAPI_user_location_t ueLocation;
|
||||
|
||||
ogs_assert(sess);
|
||||
ogs_assert(sess->sm_context.resource_uri);
|
||||
ogs_assert(sess->sm_context_ref);
|
||||
amf_ue = sess->amf_ue;
|
||||
ogs_assert(amf_ue);
|
||||
|
||||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST;
|
||||
message.h.uri = ogs_msprintf("%s/%s",
|
||||
sess->sm_context.resource_uri, OGS_SBI_RESOURCE_NAME_RELEASE);
|
||||
ogs_assert(message.h.uri);
|
||||
message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NSMF_PDUSESSION;
|
||||
message.h.api.version = (char *)OGS_SBI_API_V1;
|
||||
message.h.resource.component[0] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_SM_CONTEXTS;
|
||||
message.h.resource.component[1] = sess->sm_context_ref;
|
||||
message.h.resource.component[2] = (char *)OGS_SBI_RESOURCE_NAME_RELEASE;
|
||||
|
||||
memset(&SmContextReleaseData, 0, sizeof(SmContextReleaseData));
|
||||
|
||||
|
@ -457,8 +460,6 @@ ogs_sbi_request_t *amf_nsmf_pdusession_build_release_sm_context(
|
|||
ogs_expect(request);
|
||||
|
||||
end:
|
||||
if (message.h.uri)
|
||||
ogs_free(message.h.uri);
|
||||
if (ueLocation.nr_location) {
|
||||
if (ueLocation.nr_location->ue_location_timestamp)
|
||||
ogs_free(ueLocation.nr_location->ue_location_timestamp);
|
||||
|
|
|
@ -56,13 +56,6 @@ int amf_nsmf_pdusession_handle_create_sm_context(
|
|||
ogs_sbi_message_t message;
|
||||
ogs_sbi_header_t header;
|
||||
|
||||
bool rc;
|
||||
ogs_sbi_client_t *client = NULL;
|
||||
OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL;
|
||||
char *fqdn = NULL;
|
||||
uint16_t fqdn_port = 0;
|
||||
ogs_sockaddr_t *addr = NULL, *addr6 = NULL;
|
||||
|
||||
if (!recvmsg->http.location) {
|
||||
ogs_error("[%d:%d] No http.location", sess->psi, sess->pti);
|
||||
r = nas_5gs_send_back_gsm_message(ran_ue, sess,
|
||||
|
@ -104,55 +97,6 @@ int amf_nsmf_pdusession_handle_create_sm_context(
|
|||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
rc = ogs_sbi_getaddr_from_uri(
|
||||
&scheme, &fqdn, &fqdn_port, &addr, &addr6, header.uri);
|
||||
if (rc == false || scheme == OpenAPI_uri_scheme_NULL) {
|
||||
ogs_error("[%s:%d] Invalid URI [%s]",
|
||||
amf_ue->supi, sess->psi, header.uri);
|
||||
|
||||
ogs_sbi_header_free(&header);
|
||||
r = nas_5gs_send_back_gsm_message(ran_ue, sess,
|
||||
OGS_5GMM_CAUSE_PAYLOAD_WAS_NOT_FORWARDED,
|
||||
AMF_NAS_BACKOFF_TIME);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
client = ogs_sbi_client_find(scheme, fqdn, fqdn_port, addr, addr6);
|
||||
if (!client) {
|
||||
ogs_debug("[%s:%d] ogs_sbi_client_add()", amf_ue->supi, sess->psi);
|
||||
client = ogs_sbi_client_add(scheme, fqdn, fqdn_port, addr, addr6);
|
||||
if (!client) {
|
||||
ogs_error("[%s:%d] ogs_sbi_client_add() failed",
|
||||
amf_ue->supi, sess->psi);
|
||||
|
||||
ogs_sbi_header_free(&header);
|
||||
r = nas_5gs_send_back_gsm_message(ran_ue, sess,
|
||||
OGS_5GMM_CAUSE_PAYLOAD_WAS_NOT_FORWARDED,
|
||||
AMF_NAS_BACKOFF_TIME);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
|
||||
ogs_free(fqdn);
|
||||
ogs_freeaddrinfo(addr);
|
||||
ogs_freeaddrinfo(addr6);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
}
|
||||
OGS_SBI_SETUP_CLIENT(&sess->sm_context, client);
|
||||
|
||||
ogs_free(fqdn);
|
||||
ogs_freeaddrinfo(addr);
|
||||
ogs_freeaddrinfo(addr6);
|
||||
|
||||
STORE_SESSION_CONTEXT(
|
||||
sess, header.uri, message.h.resource.component[1]);
|
||||
|
||||
ogs_sbi_header_free(&header);
|
||||
|
||||
if (sess->pdu_session_establishment_accept) {
|
||||
/*
|
||||
* [1-SERVER] /namf-comm/v1/ue-contexts/{supi}/n1-n2-messages
|
||||
|
@ -173,6 +117,7 @@ int amf_nsmf_pdusession_handle_create_sm_context(
|
|||
ogs_error("[%d:%d] nas_5gs_send_to_gnb() failed",
|
||||
sess->psi, sess->pti);
|
||||
|
||||
ogs_sbi_header_free(&header);
|
||||
r = nas_5gs_send_back_gsm_message(ran_ue, sess,
|
||||
OGS_5GMM_CAUSE_PAYLOAD_WAS_NOT_FORWARDED,
|
||||
AMF_NAS_BACKOFF_TIME);
|
||||
|
@ -183,6 +128,13 @@ int amf_nsmf_pdusession_handle_create_sm_context(
|
|||
}
|
||||
}
|
||||
|
||||
if (sess->sm_context_ref)
|
||||
ogs_free(sess->sm_context_ref);
|
||||
sess->sm_context_ref = ogs_strdup(message.h.resource.component[1]);
|
||||
ogs_assert(sess->sm_context_ref);
|
||||
|
||||
ogs_sbi_header_free(&header);
|
||||
|
||||
} else {
|
||||
OpenAPI_sm_context_create_error_t *SmContextCreateError = NULL;
|
||||
OpenAPI_ref_to_binary_data_t *n1SmMsg = NULL;
|
||||
|
|
|
@ -255,11 +255,16 @@ ogs_sbi_request_t *amf_nudm_sdm_build_subscription_delete(
|
|||
|
||||
ogs_assert(amf_ue);
|
||||
ogs_assert(amf_ue->supi);
|
||||
ogs_assert(amf_ue->data_change_subscription.resource_uri);
|
||||
ogs_assert(amf_ue->data_change_subscription_id);
|
||||
|
||||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_DELETE;
|
||||
message.h.uri = amf_ue->data_change_subscription.resource_uri;
|
||||
message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NUDM_SDM;
|
||||
message.h.api.version = (char *)OGS_SBI_API_V2;
|
||||
message.h.resource.component[0] = amf_ue->supi;
|
||||
message.h.resource.component[1] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS;
|
||||
message.h.resource.component[2] = amf_ue->data_change_subscription_id;
|
||||
|
||||
request = ogs_sbi_build_request(&message);
|
||||
ogs_expect(request);
|
||||
|
|
|
@ -246,7 +246,7 @@ int amf_nudm_sdm_handle_provisioned(
|
|||
break;
|
||||
|
||||
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)
|
||||
if (UDM_SDM_SUBSCRIBED(amf_ue)) {
|
||||
if (amf_ue->data_change_subscription_id) {
|
||||
/* we already have a SDM subscription to UDM; continue without
|
||||
* subscribing again */
|
||||
r = amf_ue_sbi_discover_and_send(
|
||||
|
@ -272,13 +272,6 @@ int amf_nudm_sdm_handle_provisioned(
|
|||
ogs_sbi_message_t message;
|
||||
ogs_sbi_header_t header;
|
||||
|
||||
bool rc;
|
||||
ogs_sbi_client_t *client = NULL;
|
||||
OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL;
|
||||
char *fqdn = NULL;
|
||||
uint16_t fqdn_port = 0;
|
||||
ogs_sockaddr_t *addr = NULL, *addr6 = NULL;
|
||||
|
||||
if (!recvmsg->http.location) {
|
||||
ogs_error("[%s] No http.location", amf_ue->supi);
|
||||
r = nas_5gs_send_gmm_reject_from_sbi(
|
||||
|
@ -295,12 +288,10 @@ int amf_nudm_sdm_handle_provisioned(
|
|||
if (rv != OGS_OK) {
|
||||
ogs_error("[%s] Cannot parse http.location [%s]",
|
||||
amf_ue->supi, recvmsg->http.location);
|
||||
|
||||
r = nas_5gs_send_gmm_reject_from_sbi(
|
||||
amf_ue, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -313,52 +304,13 @@ int amf_nudm_sdm_handle_provisioned(
|
|||
amf_ue, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
rc = ogs_sbi_getaddr_from_uri(
|
||||
&scheme, &fqdn, &fqdn_port, &addr, &addr6, header.uri);
|
||||
if (rc == false || scheme == OpenAPI_uri_scheme_NULL) {
|
||||
ogs_error("[%s] Invalid URI [%s]", amf_ue->supi, header.uri);
|
||||
|
||||
ogs_sbi_header_free(&header);
|
||||
r = nas_5gs_send_gmm_reject_from_sbi(
|
||||
amf_ue, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
client = ogs_sbi_client_find(scheme, fqdn, fqdn_port, addr, addr6);
|
||||
if (!client) {
|
||||
ogs_debug("[%s] ogs_sbi_client_add()", amf_ue->supi);
|
||||
client = ogs_sbi_client_add(scheme, fqdn, fqdn_port, addr, addr6);
|
||||
if (!client) {
|
||||
ogs_error("[%s] ogs_sbi_client_add() failed", amf_ue->supi);
|
||||
|
||||
ogs_sbi_header_free(&header);
|
||||
r = nas_5gs_send_gmm_reject_from_sbi(
|
||||
amf_ue, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
|
||||
ogs_free(fqdn);
|
||||
ogs_freeaddrinfo(addr);
|
||||
ogs_freeaddrinfo(addr6);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
OGS_SBI_SETUP_CLIENT(&amf_ue->policy_association, client);
|
||||
|
||||
ogs_free(fqdn);
|
||||
ogs_freeaddrinfo(addr);
|
||||
ogs_freeaddrinfo(addr6);
|
||||
|
||||
UDM_SDM_STORE(amf_ue, header.uri, message.h.resource.component[2]);
|
||||
if (amf_ue->data_change_subscription_id)
|
||||
ogs_free(amf_ue->data_change_subscription_id);
|
||||
amf_ue->data_change_subscription_id =
|
||||
ogs_strdup(message.h.resource.component[2]);
|
||||
|
||||
ogs_sbi_header_free(&header);
|
||||
|
||||
|
|
|
@ -505,7 +505,7 @@ void amf_sbi_send_release_session(
|
|||
ogs_assert(r != OGS_ERROR);
|
||||
|
||||
/* Prevent to invoke SMF for this session */
|
||||
CLEAR_SESSION_CONTEXT(sess);
|
||||
CLEAR_SM_CONTEXT_REF(sess);
|
||||
}
|
||||
|
||||
void amf_sbi_send_release_all_sessions(
|
||||
|
|
|
@ -184,9 +184,8 @@ void ausf_ue_remove(ausf_ue_t *ausf_ue)
|
|||
ogs_free(ausf_ue->supi);
|
||||
}
|
||||
|
||||
AUTH_EVENT_CLEAR(ausf_ue);
|
||||
if (ausf_ue->auth_event.client)
|
||||
ogs_sbi_client_remove(ausf_ue->auth_event.client);
|
||||
if (ausf_ue->auth_events_url)
|
||||
ogs_free(ausf_ue->auth_events_url);
|
||||
|
||||
if (ausf_ue->serving_network_name)
|
||||
ogs_free(ausf_ue->serving_network_name);
|
||||
|
|
|
@ -52,25 +52,7 @@ struct ausf_ue_s {
|
|||
char *serving_network_name;
|
||||
|
||||
OpenAPI_auth_type_e auth_type;
|
||||
#define AUTH_EVENT_CLEAR(__aUSF) \
|
||||
do { \
|
||||
ogs_assert((__aUSF)); \
|
||||
if ((__aUSF)->auth_event.resource_uri) \
|
||||
ogs_free((__aUSF)->auth_event.resource_uri); \
|
||||
(__aUSF)->auth_event.resource_uri = NULL; \
|
||||
} while(0)
|
||||
#define AUTH_EVENT_STORE(__aUSF, __rESOURCE_URI) \
|
||||
do { \
|
||||
ogs_assert((__aUSF)); \
|
||||
ogs_assert((__rESOURCE_URI)); \
|
||||
AUTH_EVENT_CLEAR(__aUSF); \
|
||||
(__aUSF)->auth_event.resource_uri = ogs_strdup(__rESOURCE_URI); \
|
||||
ogs_assert((__aUSF)->auth_event.resource_uri); \
|
||||
} while(0)
|
||||
struct {
|
||||
char *resource_uri;
|
||||
ogs_sbi_client_t *client;
|
||||
} auth_event;
|
||||
char *auth_events_url;
|
||||
OpenAPI_auth_result_e auth_result;
|
||||
|
||||
uint8_t rand[OGS_RAND_LEN];
|
||||
|
|
|
@ -244,7 +244,8 @@ bool ausf_nudm_ueau_handle_get(ausf_ue_t *ausf_ue,
|
|||
|
||||
sendmsg.UeAuthenticationCtx = &UeAuthenticationCtx;
|
||||
|
||||
response = ogs_sbi_build_response(&sendmsg, OGS_SBI_HTTP_STATUS_CREATED);
|
||||
response = ogs_sbi_build_response(&sendmsg,
|
||||
OGS_SBI_HTTP_STATUS_CREATED);
|
||||
ogs_assert(response);
|
||||
ogs_assert(true == ogs_sbi_server_send_response(stream, response));
|
||||
|
||||
|
@ -285,13 +286,6 @@ bool ausf_nudm_ueau_handle_result_confirmation_inform(ausf_ue_t *ausf_ue,
|
|||
OpenAPI_confirmation_data_response_t ConfirmationDataResponse;
|
||||
OpenAPI_auth_event_t *AuthEvent = NULL;
|
||||
|
||||
bool rc;
|
||||
ogs_sbi_client_t *client = NULL;
|
||||
OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL;
|
||||
char *fqdn = NULL;
|
||||
uint16_t fqdn_port = 0;
|
||||
ogs_sockaddr_t *addr = NULL, *addr6 = NULL;
|
||||
|
||||
ogs_assert(ausf_ue);
|
||||
ogs_assert(stream);
|
||||
|
||||
|
@ -314,33 +308,10 @@ bool ausf_nudm_ueau_handle_result_confirmation_inform(ausf_ue_t *ausf_ue,
|
|||
return false;
|
||||
}
|
||||
|
||||
rc = ogs_sbi_getaddr_from_uri(
|
||||
&scheme, &fqdn, &fqdn_port, &addr, &addr6, recvmsg->http.location);
|
||||
if (rc == false || scheme == OpenAPI_uri_scheme_NULL) {
|
||||
ogs_error("[%s] Invalid URI [%s]",
|
||||
ausf_ue->suci, recvmsg->http.location);
|
||||
|
||||
ogs_assert(true ==
|
||||
ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST,
|
||||
recvmsg, "Invalid URI", ausf_ue->suci, NULL));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
client = ogs_sbi_client_find(scheme, fqdn, fqdn_port, addr, addr6);
|
||||
if (!client) {
|
||||
ogs_debug("[%s] ogs_sbi_client_add()", ausf_ue->suci);
|
||||
client = ogs_sbi_client_add(scheme, fqdn, fqdn_port, addr, addr6);
|
||||
ogs_assert(client);
|
||||
}
|
||||
|
||||
OGS_SBI_SETUP_CLIENT(&ausf_ue->auth_event, client);
|
||||
|
||||
ogs_free(fqdn);
|
||||
ogs_freeaddrinfo(addr);
|
||||
ogs_freeaddrinfo(addr6);
|
||||
|
||||
AUTH_EVENT_STORE(ausf_ue, recvmsg->http.location);
|
||||
if (ausf_ue->auth_events_url)
|
||||
ogs_free(ausf_ue->auth_events_url);
|
||||
ausf_ue->auth_events_url = ogs_strdup(recvmsg->http.location);
|
||||
ogs_assert(ausf_ue->auth_events_url);
|
||||
|
||||
memset(&ConfirmationDataResponse, 0, sizeof(ConfirmationDataResponse));
|
||||
|
||||
|
|
|
@ -34,7 +34,9 @@ version_conf.set_quoted('OPEN5GS_VERSION', package_version)
|
|||
configure_file(output : 'version.h', configuration : version_conf)
|
||||
|
||||
subdir('mme')
|
||||
subdir('hss')
|
||||
if get_option('mongodb')
|
||||
subdir('hss')
|
||||
endif
|
||||
subdir('sgwc')
|
||||
subdir('sgwu')
|
||||
subdir('pcrf')
|
||||
|
|
|
@ -187,8 +187,14 @@ int esm_handle_information_response(mme_sess_t *sess,
|
|||
|
||||
if (rsp->presencemask &
|
||||
OGS_NAS_EPS_ESM_INFORMATION_RESPONSE_ACCESS_POINT_NAME_PRESENT) {
|
||||
sess->session = mme_session_find_by_apn(
|
||||
ogs_session_t *session = mme_session_find_by_apn(
|
||||
mme_ue, rsp->access_point_name.apn);
|
||||
if (session) {
|
||||
sess->session = session;
|
||||
} else {
|
||||
ogs_error(" APN[%s] not found, using default!", rsp->access_point_name.apn);
|
||||
sess->session = mme_default_session(mme_ue);
|
||||
}
|
||||
}
|
||||
|
||||
if (rsp->presencemask &
|
||||
|
|
|
@ -586,8 +586,10 @@ void s1ap_handle_initial_ue_message(mme_enb_t *enb, ogs_s1ap_message_t *message)
|
|||
enb_ue->enb_ue_s1ap_id, enb_ue->mme_ue_s1ap_id,
|
||||
enb_ue->saved.tai.tac, enb_ue->saved.e_cgi.cell_id);
|
||||
|
||||
ogs_expect(OGS_OK == s1ap_send_to_nas(
|
||||
enb_ue, S1AP_ProcedureCode_id_initialUEMessage, NAS_PDU));
|
||||
r = s1ap_send_to_nas(enb_ue,
|
||||
S1AP_ProcedureCode_id_initialUEMessage, NAS_PDU);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
}
|
||||
|
||||
void s1ap_handle_uplink_nas_transport(
|
||||
|
@ -775,8 +777,10 @@ void s1ap_handle_uplink_nas_transport(
|
|||
ogs_error("No UE Context in UplinkNASTransport");
|
||||
}
|
||||
|
||||
ogs_expect(OGS_OK == s1ap_send_to_nas(
|
||||
enb_ue, S1AP_ProcedureCode_id_uplinkNASTransport, NAS_PDU));
|
||||
r = s1ap_send_to_nas(enb_ue,
|
||||
S1AP_ProcedureCode_id_uplinkNASTransport, NAS_PDU);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
}
|
||||
|
||||
void s1ap_handle_ue_capability_info_indication(
|
||||
|
|
|
@ -207,7 +207,6 @@ int s1ap_send_to_nas(enb_ue_t *enb_ue,
|
|||
default:
|
||||
ogs_error("Not implemented(security header type:0x%x)",
|
||||
sh->security_header_type);
|
||||
enb_ue_remove(enb_ue);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -215,42 +214,12 @@ int s1ap_send_to_nas(enb_ue_t *enb_ue,
|
|||
if (nas_eps_security_decode(enb_ue->mme_ue,
|
||||
security_header_type, nasbuf) != OGS_OK) {
|
||||
ogs_error("nas_eps_security_decode failed()");
|
||||
enb_ue_remove(enb_ue);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
h = (ogs_nas_emm_header_t *)nasbuf->data;
|
||||
ogs_assert(h);
|
||||
|
||||
if (procedureCode == S1AP_ProcedureCode_id_initialUEMessage) {
|
||||
if (h->protocol_discriminator != OGS_NAS_PROTOCOL_DISCRIMINATOR_EMM) {
|
||||
|
||||
ogs_error("Invalid protocol_discriminator [%d]",
|
||||
h->protocol_discriminator);
|
||||
|
||||
ogs_pkbuf_free(nasbuf);
|
||||
enb_ue_remove(enb_ue);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
if (h->security_header_type !=
|
||||
OGS_NAS_SECURITY_HEADER_FOR_SERVICE_REQUEST_MESSAGE &&
|
||||
h->message_type != OGS_NAS_EPS_ATTACH_REQUEST &&
|
||||
h->message_type != OGS_NAS_EPS_TRACKING_AREA_UPDATE_REQUEST &&
|
||||
h->message_type != OGS_NAS_EPS_EXTENDED_SERVICE_REQUEST &&
|
||||
h->message_type != OGS_NAS_EPS_DETACH_REQUEST) {
|
||||
|
||||
ogs_error("Invalid EMM message type [%d]", h->message_type);
|
||||
|
||||
ogs_pkbuf_free(nasbuf);
|
||||
enb_ue_remove(enb_ue);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if (h->protocol_discriminator == OGS_NAS_PROTOCOL_DISCRIMINATOR_EMM) {
|
||||
int rv;
|
||||
e = mme_event_new(MME_EVENT_EMM_MESSAGE);
|
||||
|
@ -286,10 +255,7 @@ int s1ap_send_to_nas(enb_ue_t *enb_ue,
|
|||
} else {
|
||||
ogs_error("Unknown/Unimplemented NAS Protocol discriminator 0x%02x",
|
||||
h->protocol_discriminator);
|
||||
|
||||
ogs_pkbuf_free(nasbuf);
|
||||
enb_ue_remove(enb_ue);
|
||||
|
||||
return OGS_ERROR;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -495,9 +495,8 @@ void pcf_sess_remove(pcf_sess_t *sess)
|
|||
ogs_assert(sess->sm_policy_id);
|
||||
ogs_free(sess->sm_policy_id);
|
||||
|
||||
PCF_BINDING_CLEAR(sess);
|
||||
if (sess->binding.client)
|
||||
ogs_sbi_client_remove(sess->binding.client);
|
||||
if (sess->binding_id)
|
||||
ogs_free(sess->binding_id);
|
||||
|
||||
if (sess->dnn)
|
||||
ogs_free(sess->dnn);
|
||||
|
|
|
@ -81,34 +81,7 @@ struct pcf_sess_s {
|
|||
|
||||
/* BSF sends the RESPONSE
|
||||
* of [POST] /nbsf-management/v1/PcfBindings */
|
||||
#define PCF_BINDING_ASSOCIATED(__sESS) \
|
||||
((__sESS) && ((__sESS)->binding.id))
|
||||
#define PCF_BINDING_CLEAR(__sESS) \
|
||||
do { \
|
||||
ogs_assert((__sESS)); \
|
||||
if ((__sESS)->binding.resource_uri) \
|
||||
ogs_free((__sESS)->binding.resource_uri); \
|
||||
(__sESS)->binding.resource_uri = NULL; \
|
||||
if ((__sESS)->binding.id) \
|
||||
ogs_free((__sESS)->binding.id); \
|
||||
(__sESS)->binding.id = NULL; \
|
||||
} while(0)
|
||||
#define PCF_BINDING_STORE(__sESS, __rESOURCE_URI, __iD) \
|
||||
do { \
|
||||
ogs_assert((__sESS)); \
|
||||
ogs_assert((__rESOURCE_URI)); \
|
||||
ogs_assert((__iD)); \
|
||||
PCF_BINDING_CLEAR(__sESS); \
|
||||
(__sESS)->binding.resource_uri = ogs_strdup(__rESOURCE_URI); \
|
||||
ogs_assert((__sESS)->binding.resource_uri); \
|
||||
(__sESS)->binding.id = ogs_strdup(__iD); \
|
||||
ogs_assert((__sESS)->binding.id); \
|
||||
} while(0)
|
||||
struct {
|
||||
char *resource_uri;
|
||||
char *id;
|
||||
ogs_sbi_client_t *client;
|
||||
} binding;
|
||||
char *binding_id;
|
||||
|
||||
uint8_t psi; /* PDU Session Identity */
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue