mirror of
https://github.com/open5gs/open5gs.git
synced 2025-10-23 07:41:57 +00:00
[HR] SMF selection (#2194)
SMF selection according to 4.3.2.2.3 of TS23.502. V-SMF makes discovery in the V-NRF according to V-NSSF. H-SMF makes discovery in the H-NRF according to H-NSSF. (The AMF goes through the V-NSSF and forwards the message seeking the NRF to the H-NSSF.)
This commit is contained in:
530
configs/examples/5gc-no-scp-sepp1-999-70.yaml.in
Normal file
530
configs/examples/5gc-no-scp-sepp1-999-70.yaml.in
Normal file
@@ -0,0 +1,530 @@
|
||||
db_uri: mongodb://localhost/open5gs
|
||||
|
||||
logger:
|
||||
|
||||
global:
|
||||
parameter:
|
||||
# no_nrf: true
|
||||
no_scp: true
|
||||
# no_sepp: true
|
||||
# no_amf: true
|
||||
# no_smf: true
|
||||
# no_upf: true
|
||||
# no_ausf: true
|
||||
# no_udm: true
|
||||
# no_pcf: true
|
||||
# no_nssf: true
|
||||
# no_bsf: true
|
||||
# no_udr: true
|
||||
no_mme: true
|
||||
no_sgwc: true
|
||||
no_sgwu: true
|
||||
no_pcrf: true
|
||||
no_hss: true
|
||||
|
||||
mme:
|
||||
freeDiameter:
|
||||
identity: mme.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.1.2
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_rfc5777.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_mip6i.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nasreq.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nas_mipv6.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca_3gpp/dict_dcca_3gpp.fdx
|
||||
connect:
|
||||
- identity: hss.localdomain
|
||||
address: 127.0.1.8
|
||||
|
||||
s1ap:
|
||||
server:
|
||||
- address: 127.0.1.2
|
||||
gtpc:
|
||||
server:
|
||||
- address: 127.0.1.2
|
||||
client:
|
||||
sgwc:
|
||||
- address: 127.0.1.3
|
||||
smf:
|
||||
- address: 127.0.1.4
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.1.2
|
||||
port: 9090
|
||||
gummei:
|
||||
- plmn_id:
|
||||
mcc: 999
|
||||
mnc: 70
|
||||
mme_gid: 2
|
||||
mme_code: 1
|
||||
tai:
|
||||
- plmn_id:
|
||||
mcc: 999
|
||||
mnc: 70
|
||||
tac: 1
|
||||
security:
|
||||
integrity_order : [ EIA2, EIA1, EIA0 ]
|
||||
ciphering_order : [ EEA0, EEA1, EEA2 ]
|
||||
network_name:
|
||||
full: Open5GS
|
||||
time:
|
||||
t3412:
|
||||
value: 3240
|
||||
|
||||
sgwc:
|
||||
gtpc:
|
||||
server:
|
||||
- address: 127.0.1.3
|
||||
pfcp:
|
||||
server:
|
||||
- address: 127.0.1.3
|
||||
client:
|
||||
sgwu:
|
||||
- address: 127.0.1.6
|
||||
|
||||
smf:
|
||||
sbi:
|
||||
server:
|
||||
# - address: 127.0.1.4
|
||||
# port: 7777
|
||||
- address: smf.5gc.mnc070.mcc999.3gppnetwork.org
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc070.mcc999.3gppnetwork.org
|
||||
pfcp:
|
||||
server:
|
||||
- address: 127.0.1.4
|
||||
client:
|
||||
upf:
|
||||
- address: 127.0.1.7
|
||||
gtpc:
|
||||
server:
|
||||
- address: 127.0.1.4
|
||||
gtpu:
|
||||
server:
|
||||
- address: 127.0.1.4
|
||||
metrics:
|
||||
server:
|
||||
- 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
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
- 2001:4860:4860::8888
|
||||
- 2001:4860:4860::8844
|
||||
mtu: 1400
|
||||
freeDiameter:
|
||||
identity: smf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.1.4
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_rfc5777.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_mip6i.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nasreq.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nas_mipv6.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca_3gpp/dict_dcca_3gpp.fdx
|
||||
connect:
|
||||
- identity: pcrf.localdomain
|
||||
address: 127.0.1.9
|
||||
|
||||
amf:
|
||||
sbi:
|
||||
server:
|
||||
- address: 127.0.1.5
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc070.mcc999.3gppnetwork.org
|
||||
ngap:
|
||||
server:
|
||||
- address: 127.0.1.5
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.1.5
|
||||
port: 9090
|
||||
access_control:
|
||||
- plmn_id:
|
||||
mcc: 999
|
||||
mnc: 70
|
||||
- plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
- plmn_id:
|
||||
mcc: 315
|
||||
mnc: 010
|
||||
guami:
|
||||
- plmn_id:
|
||||
mcc: 999
|
||||
mnc: 70
|
||||
amf_id:
|
||||
region: 2
|
||||
set: 1
|
||||
tai:
|
||||
- plmn_id:
|
||||
mcc: 999
|
||||
mnc: 70
|
||||
tac: 1
|
||||
plmn_support:
|
||||
- plmn_id:
|
||||
mcc: 999
|
||||
mnc: 70
|
||||
s_nssai:
|
||||
- sst: 1
|
||||
security:
|
||||
integrity_order : [ NIA2, NIA1, NIA0 ]
|
||||
ciphering_order : [ NEA0, NEA1, NEA2 ]
|
||||
network_name:
|
||||
full: Open5GS
|
||||
amf_name: open5gs-amf0
|
||||
time:
|
||||
t3512:
|
||||
value: 540 # 9 mintues * 60 = 540 seconds
|
||||
|
||||
sgwu:
|
||||
pfcp:
|
||||
server:
|
||||
- address: 127.0.1.6
|
||||
gtpu:
|
||||
server:
|
||||
- address: 127.0.1.6
|
||||
|
||||
upf:
|
||||
pfcp:
|
||||
server:
|
||||
- address: 127.0.1.7
|
||||
gtpu:
|
||||
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
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.1.7
|
||||
port: 9090
|
||||
|
||||
hss:
|
||||
freeDiameter:
|
||||
identity: hss.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.1.8
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_rfc5777.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_mip6i.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nasreq.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nas_mipv6.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca_3gpp/dict_dcca_3gpp.fdx
|
||||
connect:
|
||||
- identity: mme.localdomain
|
||||
address: 127.0.1.2
|
||||
pcrf:
|
||||
freeDiameter:
|
||||
identity: pcrf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.1.9
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_rfc5777.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_mip6i.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nasreq.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nas_mipv6.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca_3gpp/dict_dcca_3gpp.fdx
|
||||
connect:
|
||||
- identity: smf.localdomain
|
||||
address: 127.0.1.4
|
||||
|
||||
nrf:
|
||||
serving:
|
||||
- plmn_id:
|
||||
mcc: 999
|
||||
mnc: 70
|
||||
sbi:
|
||||
server:
|
||||
# - address: 127.0.1.10
|
||||
# port: 7777
|
||||
- address: nrf.5gc.mnc070.mcc999.3gppnetwork.org
|
||||
|
||||
sepp:
|
||||
default:
|
||||
tls:
|
||||
server:
|
||||
private_key: @build_configs_dir@/open5gs/tls/sepp1.key
|
||||
cert: @build_configs_dir@/open5gs/tls/sepp1.crt
|
||||
client:
|
||||
cacert: @build_configs_dir@/open5gs/tls/ca.crt
|
||||
sbi:
|
||||
server:
|
||||
- address: 127.0.1.250
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc070.mcc999.3gppnetwork.org
|
||||
n32:
|
||||
server:
|
||||
- sender: sepp1.localdomain
|
||||
address: 127.0.1.251
|
||||
port: 7777
|
||||
n32f:
|
||||
address: 127.0.1.252
|
||||
port: 7777
|
||||
client:
|
||||
sepp:
|
||||
- receiver: sepp2.localdomain
|
||||
uri: http://127.0.2.251:7777
|
||||
n32f:
|
||||
uri: http://127.0.2.252:7777
|
||||
- receiver: sepp3.localdomain
|
||||
uri: http://127.0.3.251:7777
|
||||
n32f:
|
||||
uri: http://127.0.3.252:7777
|
||||
|
||||
ausf:
|
||||
sbi:
|
||||
server:
|
||||
# - address: 127.0.1.11
|
||||
# port: 7777
|
||||
- address: ausf.5gc.mnc070.mcc999.3gppnetwork.org
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc070.mcc999.3gppnetwork.org
|
||||
|
||||
udm:
|
||||
hnet:
|
||||
- id: 1
|
||||
scheme: 1
|
||||
key: @build_configs_dir@/open5gs/hnet/curve25519-1.key
|
||||
- id: 2
|
||||
scheme: 2
|
||||
key: @build_configs_dir@/open5gs/hnet/secp256r1-2.key
|
||||
sbi:
|
||||
server:
|
||||
# - address: 127.0.1.12
|
||||
# port: 7777
|
||||
- address: udm.5gc.mnc070.mcc999.3gppnetwork.org
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc070.mcc999.3gppnetwork.org
|
||||
|
||||
pcf:
|
||||
sbi:
|
||||
server:
|
||||
- address: 127.0.1.13
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc070.mcc999.3gppnetwork.org
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.1.13
|
||||
port: 9090
|
||||
policy:
|
||||
- plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
slice:
|
||||
- sst: 1 # 1,2,3,4
|
||||
default_indicator: true
|
||||
session:
|
||||
- name: internet
|
||||
type: 3 # 1:IPv4, 2:IPv6, 3:IPv4v6
|
||||
ambr:
|
||||
downlink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 1
|
||||
unit: 3
|
||||
qos:
|
||||
index: 9 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 8 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
- name: ims
|
||||
type: 3 # 1:IPv4, 2:IPv6, 3:IPv4v6
|
||||
ambr:
|
||||
downlink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
qos:
|
||||
index: 5 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
pcc_rule:
|
||||
- qos:
|
||||
index: 1 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
mbr:
|
||||
downlink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
gbr:
|
||||
downlink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
- qos:
|
||||
index: 2 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 4 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 2 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 2 # 1: Disabled, 2:Enabled
|
||||
mbr:
|
||||
downlink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
gbr:
|
||||
downlink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
- plmn_id:
|
||||
mcc: 315
|
||||
mnc: 010
|
||||
slice:
|
||||
- sst: 1 # 1,2,3,4
|
||||
default_indicator: true
|
||||
session:
|
||||
- name: internet
|
||||
type: 3 # 1:IPv4, 2:IPv6, 3:IPv4v6
|
||||
ambr:
|
||||
downlink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 1
|
||||
unit: 3
|
||||
qos:
|
||||
index: 9 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 8 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
- name: ims
|
||||
type: 3 # 1:IPv4, 2:IPv6, 3:IPv4v6
|
||||
ambr:
|
||||
downlink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
qos:
|
||||
index: 5 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
pcc_rule:
|
||||
- qos:
|
||||
index: 1 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
mbr:
|
||||
downlink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
gbr:
|
||||
downlink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
- qos:
|
||||
index: 2 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 4 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 2 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 2 # 1: Disabled, 2:Enabled
|
||||
mbr:
|
||||
downlink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
gbr:
|
||||
downlink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
|
||||
nssf:
|
||||
sbi:
|
||||
server:
|
||||
# - address: 127.0.1.14
|
||||
# port: 7777
|
||||
- address: nssf.5gc.mnc070.mcc999.3gppnetwork.org
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc070.mcc999.3gppnetwork.org
|
||||
nsi:
|
||||
- uri: http://nrf.5gc.mnc070.mcc999.3gppnetwork.org
|
||||
s_nssai:
|
||||
sst: 1
|
||||
bsf:
|
||||
sbi:
|
||||
server:
|
||||
- address: 127.0.1.15
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc070.mcc999.3gppnetwork.org
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
server:
|
||||
- address: 127.0.1.20
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc070.mcc999.3gppnetwork.org
|
532
configs/examples/5gc-no-scp-sepp2-001-01.yaml.in
Normal file
532
configs/examples/5gc-no-scp-sepp2-001-01.yaml.in
Normal file
@@ -0,0 +1,532 @@
|
||||
db_uri: mongodb://localhost/open5gs
|
||||
|
||||
logger:
|
||||
|
||||
global:
|
||||
parameter:
|
||||
# no_nrf: true
|
||||
no_scp: true
|
||||
# no_sepp: true
|
||||
# no_amf: true
|
||||
# no_smf: true
|
||||
# no_upf: true
|
||||
# no_ausf: true
|
||||
# no_udm: true
|
||||
# no_pcf: true
|
||||
# no_nssf: true
|
||||
# no_bsf: true
|
||||
# no_udr: true
|
||||
no_mme: true
|
||||
no_sgwc: true
|
||||
no_sgwu: true
|
||||
no_pcrf: true
|
||||
no_hss: true
|
||||
|
||||
mme:
|
||||
freeDiameter:
|
||||
identity: mme.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.2.2
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_rfc5777.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_mip6i.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nasreq.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nas_mipv6.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca_3gpp/dict_dcca_3gpp.fdx
|
||||
connect:
|
||||
- identity: hss.localdomain
|
||||
address: 127.0.2.8
|
||||
|
||||
s1ap:
|
||||
server:
|
||||
- address: 127.0.2.2
|
||||
gtpc:
|
||||
server:
|
||||
- address: 127.0.2.2
|
||||
client:
|
||||
sgwc:
|
||||
- address: 127.0.2.3
|
||||
smf:
|
||||
- address: 127.0.2.4
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.2.2
|
||||
port: 9090
|
||||
gummei:
|
||||
- plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
mme_gid: 2
|
||||
mme_code: 1
|
||||
tai:
|
||||
- plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
tac: 1
|
||||
security:
|
||||
integrity_order : [ EIA2, EIA1, EIA0 ]
|
||||
ciphering_order : [ EEA0, EEA1, EEA2 ]
|
||||
network_name:
|
||||
full: Open5GS
|
||||
time:
|
||||
t3412:
|
||||
value: 3240
|
||||
|
||||
sgwc:
|
||||
gtpc:
|
||||
server:
|
||||
- address: 127.0.2.3
|
||||
pfcp:
|
||||
server:
|
||||
- address: 127.0.2.3
|
||||
client:
|
||||
sgwu:
|
||||
- address: 127.0.2.6
|
||||
|
||||
smf:
|
||||
sbi:
|
||||
server:
|
||||
# - address: 127.0.2.4
|
||||
# port: 7777
|
||||
- address: smf.5gc.mnc001.mcc001.3gppnetwork.org
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc001.mcc001.3gppnetwork.org
|
||||
pfcp:
|
||||
server:
|
||||
- address: 127.0.2.4
|
||||
client:
|
||||
upf:
|
||||
- address: 127.0.2.7
|
||||
gtpc:
|
||||
server:
|
||||
- address: 127.0.2.4
|
||||
gtpu:
|
||||
server:
|
||||
- address: 127.0.2.4
|
||||
metrics:
|
||||
server:
|
||||
- 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
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
- 2001:4860:4860::8888
|
||||
- 2001:4860:4860::8844
|
||||
mtu: 1400
|
||||
freeDiameter:
|
||||
identity: smf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.2.4
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_rfc5777.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_mip6i.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nasreq.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nas_mipv6.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca_3gpp/dict_dcca_3gpp.fdx
|
||||
connect:
|
||||
- identity: pcrf.localdomain
|
||||
address: 127.0.2.9
|
||||
|
||||
amf:
|
||||
sbi:
|
||||
server:
|
||||
- address: 127.0.2.5
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc001.mcc001.3gppnetwork.org
|
||||
ngap:
|
||||
server:
|
||||
- address: 127.0.2.5
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.2.5
|
||||
port: 9090
|
||||
access_control:
|
||||
- plmn_id:
|
||||
mcc: 999
|
||||
mnc: 70
|
||||
- plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
- plmn_id:
|
||||
mcc: 315
|
||||
mnc: 010
|
||||
guami:
|
||||
- plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
amf_id:
|
||||
region: 2
|
||||
set: 1
|
||||
tai:
|
||||
- plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
tac: 1
|
||||
plmn_support:
|
||||
- plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
s_nssai:
|
||||
- sst: 1
|
||||
security:
|
||||
integrity_order : [ NIA2, NIA1, NIA0 ]
|
||||
ciphering_order : [ NEA0, NEA1, NEA2 ]
|
||||
network_name:
|
||||
full: Open5GS
|
||||
amf_name: open5gs-amf0
|
||||
time:
|
||||
t3512:
|
||||
value: 540 # 9 mintues * 60 = 540 seconds
|
||||
|
||||
sgwu:
|
||||
pfcp:
|
||||
server:
|
||||
- address: 127.0.2.6
|
||||
gtpu:
|
||||
server:
|
||||
- address: 127.0.2.6
|
||||
|
||||
upf:
|
||||
pfcp:
|
||||
server:
|
||||
- address: 127.0.2.7
|
||||
gtpu:
|
||||
server:
|
||||
- address: 127.0.2.7
|
||||
session:
|
||||
- subnet: 10.46.0.0/16
|
||||
gateway: 10.46.0.1
|
||||
dev: ogstun2
|
||||
- subnet: 2001:db8:babe::/48
|
||||
gateway: 2001:db8:babe::1
|
||||
dev: ogstun2
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.2.7
|
||||
port: 9090
|
||||
|
||||
hss:
|
||||
freeDiameter:
|
||||
identity: hss.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.2.8
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_rfc5777.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_mip6i.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nasreq.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nas_mipv6.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca_3gpp/dict_dcca_3gpp.fdx
|
||||
connect:
|
||||
- identity: mme.localdomain
|
||||
address: 127.0.2.2
|
||||
pcrf:
|
||||
freeDiameter:
|
||||
identity: pcrf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.2.9
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_rfc5777.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_mip6i.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nasreq.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nas_mipv6.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca_3gpp/dict_dcca_3gpp.fdx
|
||||
connect:
|
||||
- identity: smf.localdomain
|
||||
address: 127.0.2.4
|
||||
|
||||
nrf:
|
||||
serving:
|
||||
- plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
sbi:
|
||||
server:
|
||||
# - address: 127.0.2.10
|
||||
# port: 7777
|
||||
- address: nrf.5gc.mnc001.mcc001.3gppnetwork.org
|
||||
|
||||
sepp:
|
||||
default:
|
||||
tls:
|
||||
server:
|
||||
private_key: @build_configs_dir@/open5gs/tls/sepp2.key
|
||||
cert: @build_configs_dir@/open5gs/tls/sepp2.crt
|
||||
client:
|
||||
cacert: @build_configs_dir@/open5gs/tls/ca.crt
|
||||
sbi:
|
||||
server:
|
||||
- address: 127.0.2.250
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc001.mcc001.3gppnetwork.org
|
||||
n32:
|
||||
server:
|
||||
- sender: sepp2.localdomain
|
||||
address: 127.0.2.251
|
||||
port: 7777
|
||||
n32f:
|
||||
address: 127.0.2.252
|
||||
port: 7777
|
||||
client:
|
||||
sepp:
|
||||
- receiver: sepp1.localdomain
|
||||
uri: http://127.0.1.251:7777
|
||||
n32f:
|
||||
uri: http://127.0.1.252:7777
|
||||
- receiver: sepp3.localdomain
|
||||
uri: http://127.0.3.251:7777
|
||||
n32f:
|
||||
uri: http://127.0.3.252:7777
|
||||
|
||||
ausf:
|
||||
sbi:
|
||||
server:
|
||||
# - address: 127.0.2.11
|
||||
# port: 7777
|
||||
- address: ausf.5gc.mnc001.mcc001.3gppnetwork.org
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc001.mcc001.3gppnetwork.org
|
||||
|
||||
udm:
|
||||
hnet:
|
||||
- id: 1
|
||||
scheme: 1
|
||||
key: @build_configs_dir@/open5gs/hnet/curve25519-1.key
|
||||
- id: 2
|
||||
scheme: 2
|
||||
key: @build_configs_dir@/open5gs/hnet/secp256r1-2.key
|
||||
sbi:
|
||||
server:
|
||||
# - address: 127.0.2.12
|
||||
# port: 7777
|
||||
- address: udm.5gc.mnc001.mcc001.3gppnetwork.org
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc001.mcc001.3gppnetwork.org
|
||||
|
||||
pcf:
|
||||
sbi:
|
||||
server:
|
||||
- address: 127.0.2.13
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc001.mcc001.3gppnetwork.org
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.2.13
|
||||
port: 9090
|
||||
policy:
|
||||
- plmn_id:
|
||||
mcc: 999
|
||||
mnc: 70
|
||||
slice:
|
||||
- sst: 1 # 1,2,3,4
|
||||
default_indicator: true
|
||||
session:
|
||||
- name: internet
|
||||
type: 3 # 1:IPv4, 2:IPv6, 3:IPv4v6
|
||||
ambr:
|
||||
downlink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 1
|
||||
unit: 3
|
||||
qos:
|
||||
index: 9 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 8 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
- name: ims
|
||||
type: 3 # 1:IPv4, 2:IPv6, 3:IPv4v6
|
||||
ambr:
|
||||
downlink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
qos:
|
||||
index: 5 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
pcc_rule:
|
||||
- qos:
|
||||
index: 1 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
mbr:
|
||||
downlink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
gbr:
|
||||
downlink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
- qos:
|
||||
index: 2 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 4 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 2 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 2 # 1: Disabled, 2:Enabled
|
||||
mbr:
|
||||
downlink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
gbr:
|
||||
downlink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
- plmn_id:
|
||||
mcc: 315
|
||||
mnc: 010
|
||||
slice:
|
||||
- sst: 1 # 1,2,3,4
|
||||
default_indicator: true
|
||||
session:
|
||||
- name: internet
|
||||
type: 3 # 1:IPv4, 2:IPv6, 3:IPv4v6
|
||||
ambr:
|
||||
downlink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 1
|
||||
unit: 3
|
||||
qos:
|
||||
index: 9 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 8 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
- name: ims
|
||||
type: 3 # 1:IPv4, 2:IPv6, 3:IPv4v6
|
||||
ambr:
|
||||
downlink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
qos:
|
||||
index: 5 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
pcc_rule:
|
||||
- qos:
|
||||
index: 1 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
mbr:
|
||||
downlink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
gbr:
|
||||
downlink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
- qos:
|
||||
index: 2 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 4 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 2 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 2 # 1: Disabled, 2:Enabled
|
||||
mbr:
|
||||
downlink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
gbr:
|
||||
downlink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
|
||||
nssf:
|
||||
sbi:
|
||||
server:
|
||||
# - address: 127.0.2.14
|
||||
# port: 7777
|
||||
- address: nssf.5gc.mnc001.mcc001.3gppnetwork.org
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc001.mcc001.3gppnetwork.org
|
||||
nsi:
|
||||
- uri: http://nrf.5gc.mnc001.mcc001.3gppnetwork.org
|
||||
s_nssai:
|
||||
sst: 1
|
||||
bsf:
|
||||
sbi:
|
||||
server:
|
||||
- address: 127.0.2.15
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc001.mcc001.3gppnetwork.org
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
server:
|
||||
- address: 127.0.2.20
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc001.mcc001.3gppnetwork.org
|
532
configs/examples/5gc-no-scp-sepp3-315-010.yaml.in
Normal file
532
configs/examples/5gc-no-scp-sepp3-315-010.yaml.in
Normal file
@@ -0,0 +1,532 @@
|
||||
db_uri: mongodb://localhost/open5gs
|
||||
|
||||
logger:
|
||||
|
||||
global:
|
||||
parameter:
|
||||
# no_nrf: true
|
||||
no_scp: true
|
||||
# no_sepp: true
|
||||
# no_amf: true
|
||||
# no_smf: true
|
||||
# no_upf: true
|
||||
# no_ausf: true
|
||||
# no_udm: true
|
||||
# no_pcf: true
|
||||
# no_nssf: true
|
||||
# no_bsf: true
|
||||
# no_udr: true
|
||||
no_mme: true
|
||||
no_sgwc: true
|
||||
no_sgwu: true
|
||||
no_pcrf: true
|
||||
no_hss: true
|
||||
|
||||
mme:
|
||||
freeDiameter:
|
||||
identity: mme.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.3.2
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_rfc5777.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_mip6i.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nasreq.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nas_mipv6.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca_3gpp/dict_dcca_3gpp.fdx
|
||||
connect:
|
||||
- identity: hss.localdomain
|
||||
address: 127.0.3.8
|
||||
|
||||
s1ap:
|
||||
server:
|
||||
- address: 127.0.3.2
|
||||
gtpc:
|
||||
server:
|
||||
- address: 127.0.3.2
|
||||
client:
|
||||
sgwc:
|
||||
- address: 127.0.3.3
|
||||
smf:
|
||||
- address: 127.0.3.4
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.3.2
|
||||
port: 9090
|
||||
gummei:
|
||||
- plmn_id:
|
||||
mcc: 315
|
||||
mnc: 010
|
||||
mme_gid: 2
|
||||
mme_code: 1
|
||||
tai:
|
||||
- plmn_id:
|
||||
mcc: 315
|
||||
mnc: 010
|
||||
tac: 1
|
||||
security:
|
||||
integrity_order : [ EIA2, EIA1, EIA0 ]
|
||||
ciphering_order : [ EEA0, EEA1, EEA2 ]
|
||||
network_name:
|
||||
full: Open5GS
|
||||
time:
|
||||
t3412:
|
||||
value: 3240
|
||||
|
||||
sgwc:
|
||||
gtpc:
|
||||
server:
|
||||
- address: 127.0.3.3
|
||||
pfcp:
|
||||
server:
|
||||
- address: 127.0.3.3
|
||||
client:
|
||||
sgwu:
|
||||
- address: 127.0.3.6
|
||||
|
||||
smf:
|
||||
sbi:
|
||||
server:
|
||||
# - address: 127.0.3.4
|
||||
# port: 7777
|
||||
- address: smf.5gc.mnc010.mcc315.3gppnetwork.org
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc010.mcc315.3gppnetwork.org
|
||||
pfcp:
|
||||
server:
|
||||
- address: 127.0.3.4
|
||||
client:
|
||||
upf:
|
||||
- address: 127.0.3.7
|
||||
gtpc:
|
||||
server:
|
||||
- address: 127.0.3.4
|
||||
gtpu:
|
||||
server:
|
||||
- address: 127.0.3.4
|
||||
metrics:
|
||||
server:
|
||||
- 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
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
- 2001:4860:4860::8888
|
||||
- 2001:4860:4860::8844
|
||||
mtu: 1400
|
||||
freeDiameter:
|
||||
identity: smf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.3.4
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_rfc5777.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_mip6i.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nasreq.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nas_mipv6.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca_3gpp/dict_dcca_3gpp.fdx
|
||||
connect:
|
||||
- identity: pcrf.localdomain
|
||||
address: 127.0.3.9
|
||||
|
||||
amf:
|
||||
sbi:
|
||||
server:
|
||||
- address: 127.0.3.5
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc010.mcc315.3gppnetwork.org
|
||||
ngap:
|
||||
server:
|
||||
- address: 127.0.3.5
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.3.5
|
||||
port: 9090
|
||||
access_control:
|
||||
- plmn_id:
|
||||
mcc: 999
|
||||
mnc: 70
|
||||
- plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
- plmn_id:
|
||||
mcc: 315
|
||||
mnc: 010
|
||||
guami:
|
||||
- plmn_id:
|
||||
mcc: 315
|
||||
mnc: 010
|
||||
amf_id:
|
||||
region: 2
|
||||
set: 1
|
||||
tai:
|
||||
- plmn_id:
|
||||
mcc: 315
|
||||
mnc: 010
|
||||
tac: 1
|
||||
plmn_support:
|
||||
- plmn_id:
|
||||
mcc: 315
|
||||
mnc: 010
|
||||
s_nssai:
|
||||
- sst: 1
|
||||
security:
|
||||
integrity_order : [ NIA2, NIA1, NIA0 ]
|
||||
ciphering_order : [ NEA0, NEA1, NEA2 ]
|
||||
network_name:
|
||||
full: Open5GS
|
||||
amf_name: open5gs-amf0
|
||||
time:
|
||||
t3512:
|
||||
value: 540 # 9 mintues * 60 = 540 seconds
|
||||
|
||||
sgwu:
|
||||
pfcp:
|
||||
server:
|
||||
- address: 127.0.3.6
|
||||
gtpu:
|
||||
server:
|
||||
- address: 127.0.3.6
|
||||
|
||||
upf:
|
||||
pfcp:
|
||||
server:
|
||||
- address: 127.0.3.7
|
||||
gtpu:
|
||||
server:
|
||||
- address: 127.0.3.7
|
||||
session:
|
||||
- subnet: 10.47.0.0/16
|
||||
gateway: 10.47.0.1
|
||||
dev: ogstun3
|
||||
- subnet: 2001:db8:face::/48
|
||||
gateway: 2001:db8:face::1
|
||||
dev: ogstun3
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.3.7
|
||||
port: 9090
|
||||
|
||||
hss:
|
||||
freeDiameter:
|
||||
identity: hss.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.3.8
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_rfc5777.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_mip6i.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nasreq.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nas_mipv6.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca_3gpp/dict_dcca_3gpp.fdx
|
||||
connect:
|
||||
- identity: mme.localdomain
|
||||
address: 127.0.3.2
|
||||
pcrf:
|
||||
freeDiameter:
|
||||
identity: pcrf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.3.9
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_rfc5777.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_mip6i.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nasreq.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nas_mipv6.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca.fdx
|
||||
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca_3gpp/dict_dcca_3gpp.fdx
|
||||
connect:
|
||||
- identity: smf.localdomain
|
||||
address: 127.0.3.4
|
||||
|
||||
nrf:
|
||||
serving:
|
||||
- plmn_id:
|
||||
mcc: 315
|
||||
mnc: 010
|
||||
sbi:
|
||||
server:
|
||||
# - address: 127.0.3.10
|
||||
# port: 7777
|
||||
- address: nrf.5gc.mnc010.mcc315.3gppnetwork.org
|
||||
|
||||
sepp:
|
||||
default:
|
||||
tls:
|
||||
server:
|
||||
private_key: @build_configs_dir@/open5gs/tls/sepp3.key
|
||||
cert: @build_configs_dir@/open5gs/tls/sepp3.crt
|
||||
client:
|
||||
cacert: @build_configs_dir@/open5gs/tls/ca.crt
|
||||
sbi:
|
||||
server:
|
||||
- address: 127.0.3.250
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc010.mcc315.3gppnetwork.org
|
||||
n32:
|
||||
server:
|
||||
- sender: sepp3.localdomain
|
||||
address: 127.0.3.251
|
||||
port: 7777
|
||||
n32f:
|
||||
address: 127.0.3.252
|
||||
port: 7777
|
||||
client:
|
||||
sepp:
|
||||
- receiver: sepp1.localdomain
|
||||
uri: http://127.0.1.251:7777
|
||||
n32f:
|
||||
uri: http://127.0.1.252:7777
|
||||
- receiver: sepp2.localdomain
|
||||
uri: http://127.0.2.251:7777
|
||||
n32f:
|
||||
uri: http://127.0.2.252:7777
|
||||
|
||||
ausf:
|
||||
sbi:
|
||||
server:
|
||||
# - address: 127.0.3.11
|
||||
# port: 7777
|
||||
- address: ausf.5gc.mnc010.mcc315.3gppnetwork.org
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc010.mcc315.3gppnetwork.org
|
||||
|
||||
udm:
|
||||
hnet:
|
||||
- id: 1
|
||||
scheme: 1
|
||||
key: @build_configs_dir@/open5gs/hnet/curve25519-1.key
|
||||
- id: 2
|
||||
scheme: 2
|
||||
key: @build_configs_dir@/open5gs/hnet/secp256r1-2.key
|
||||
sbi:
|
||||
server:
|
||||
# - address: 127.0.3.12
|
||||
# port: 7777
|
||||
- address: udm.5gc.mnc010.mcc315.3gppnetwork.org
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc010.mcc315.3gppnetwork.org
|
||||
|
||||
pcf:
|
||||
sbi:
|
||||
server:
|
||||
- address: 127.0.3.13
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc010.mcc315.3gppnetwork.org
|
||||
metrics:
|
||||
server:
|
||||
- address: 127.0.3.13
|
||||
port: 9090
|
||||
policy:
|
||||
- plmn_id:
|
||||
mcc: 999
|
||||
mnc: 70
|
||||
slice:
|
||||
- sst: 1 # 1,2,3,4
|
||||
default_indicator: true
|
||||
session:
|
||||
- name: internet
|
||||
type: 3 # 1:IPv4, 2:IPv6, 3:IPv4v6
|
||||
ambr:
|
||||
downlink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 1
|
||||
unit: 3
|
||||
qos:
|
||||
index: 9 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 8 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
- name: ims
|
||||
type: 3 # 1:IPv4, 2:IPv6, 3:IPv4v6
|
||||
ambr:
|
||||
downlink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
qos:
|
||||
index: 5 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
pcc_rule:
|
||||
- qos:
|
||||
index: 1 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
mbr:
|
||||
downlink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
gbr:
|
||||
downlink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
- qos:
|
||||
index: 2 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 4 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 2 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 2 # 1: Disabled, 2:Enabled
|
||||
mbr:
|
||||
downlink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
gbr:
|
||||
downlink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
- plmn_id:
|
||||
mcc: 001
|
||||
mnc: 01
|
||||
slice:
|
||||
- sst: 1 # 1,2,3,4
|
||||
default_indicator: true
|
||||
session:
|
||||
- name: internet
|
||||
type: 3 # 1:IPv4, 2:IPv6, 3:IPv4v6
|
||||
ambr:
|
||||
downlink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 1
|
||||
unit: 3
|
||||
qos:
|
||||
index: 9 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 8 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
- name: ims
|
||||
type: 3 # 1:IPv4, 2:IPv6, 3:IPv4v6
|
||||
ambr:
|
||||
downlink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 1
|
||||
unit: 3 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
qos:
|
||||
index: 5 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
pcc_rule:
|
||||
- qos:
|
||||
index: 1 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 1 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 1 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 1 # 1: Disabled, 2:Enabled
|
||||
mbr:
|
||||
downlink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
gbr:
|
||||
downlink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 82
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
- qos:
|
||||
index: 2 # 1, 2, 3, 4, 65, 66, 67, 75, 71, 72, 73, 74, 76, 5, 6, 7, 8, 9, 69, 70, 79, 80, 82, 83, 84, 85, 86
|
||||
arp:
|
||||
priority_level: 4 # 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||
pre_emption_vulnerability: 2 # 1: Disabled, 2:Enabled
|
||||
pre_emption_capability: 2 # 1: Disabled, 2:Enabled
|
||||
mbr:
|
||||
downlink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
gbr:
|
||||
downlink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
uplink:
|
||||
value: 802
|
||||
unit: 1 # 0:bps, 1:Kbps, 2:Mbps, 3:Gbps, 4:Tbps
|
||||
|
||||
nssf:
|
||||
sbi:
|
||||
server:
|
||||
# - address: 127.0.3.14
|
||||
# port: 7777
|
||||
- address: nssf.5gc.mnc010.mcc315.3gppnetwork.org
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc010.mcc315.3gppnetwork.org
|
||||
nsi:
|
||||
- uri: http://nrf.5gc.mnc010.mcc315.3gppnetwork.org
|
||||
s_nssai:
|
||||
sst: 1
|
||||
bsf:
|
||||
sbi:
|
||||
server:
|
||||
- address: 127.0.3.15
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc010.mcc315.3gppnetwork.org
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
server:
|
||||
- address: 127.0.3.20
|
||||
port: 7777
|
||||
client:
|
||||
nrf:
|
||||
- uri: http://nrf.5gc.mnc010.mcc315.3gppnetwork.org
|
@@ -19,6 +19,9 @@ examples_conf = '''
|
||||
5gc-sepp1-999-70.yaml
|
||||
5gc-sepp2-001-01.yaml
|
||||
5gc-sepp3-315-010.yaml
|
||||
5gc-no-scp-sepp1-999-70.yaml
|
||||
5gc-no-scp-sepp2-001-01.yaml
|
||||
5gc-no-scp-sepp3-315-010.yaml
|
||||
5gc-tls-sepp1-999-70.yaml
|
||||
5gc-tls-sepp2-001-01.yaml
|
||||
5gc-tls-sepp3-315-010.yaml
|
||||
|
@@ -1212,6 +1212,9 @@ void ogs_sbi_nf_instance_remove(ogs_sbi_nf_instance_t *nf_instance)
|
||||
ogs_free(nf_instance->id);
|
||||
}
|
||||
|
||||
if (nf_instance->hnrf_uri)
|
||||
ogs_free(nf_instance->hnrf_uri);
|
||||
|
||||
if (nf_instance->client)
|
||||
ogs_sbi_client_remove(nf_instance->client);
|
||||
|
||||
@@ -1973,6 +1976,11 @@ bool ogs_sbi_discovery_option_is_matched(
|
||||
return false;
|
||||
}
|
||||
|
||||
if (nf_instance->nf_type == OpenAPI_nf_type_NRF &&
|
||||
ogs_sbi_discovery_option_hnrf_uri_is_matched(
|
||||
nf_instance, discovery_option) == false)
|
||||
return false;
|
||||
|
||||
ogs_list_for_each(&nf_instance->nf_info_list, nf_info) {
|
||||
if (nf_instance->nf_type != nf_info->nf_type) {
|
||||
ogs_error("Invalid NF-Type [%d:%d]",
|
||||
@@ -2105,6 +2113,23 @@ bool ogs_sbi_discovery_option_target_plmn_list_is_matched(
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ogs_sbi_discovery_option_hnrf_uri_is_matched(
|
||||
ogs_sbi_nf_instance_t *nf_instance,
|
||||
ogs_sbi_discovery_option_t *discovery_option)
|
||||
{
|
||||
ogs_assert(nf_instance);
|
||||
ogs_assert(discovery_option);
|
||||
|
||||
if (nf_instance->hnrf_uri == NULL && discovery_option->hnrf_uri == NULL)
|
||||
return true;
|
||||
else if (nf_instance->hnrf_uri == NULL ||
|
||||
discovery_option->hnrf_uri == NULL)
|
||||
return false;
|
||||
|
||||
return ogs_strcasecmp(nf_instance->hnrf_uri,
|
||||
discovery_option->hnrf_uri) == 0;
|
||||
}
|
||||
|
||||
bool ogs_sbi_discovery_param_is_matched(
|
||||
ogs_sbi_nf_instance_t *nf_instance,
|
||||
OpenAPI_nf_type_e target_nf_type,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -151,6 +151,7 @@ typedef struct ogs_sbi_nf_instance_s {
|
||||
int num_of_plmn_id;
|
||||
|
||||
char *fqdn;
|
||||
char *hnrf_uri; /* NRF Only */
|
||||
|
||||
#define OGS_SBI_MAX_NUM_OF_IP_ADDRESS 8
|
||||
int num_of_ipv4;
|
||||
@@ -203,8 +204,8 @@ typedef struct ogs_sbi_object_s {
|
||||
* if no validityPeriod in SearchResult, validity_timeout is 0.
|
||||
*/
|
||||
ogs_time_t validity_timeout;
|
||||
} nf_type_array[OGS_SBI_MAX_NUM_OF_NF_TYPE],
|
||||
service_type_array[OGS_SBI_MAX_NUM_OF_SERVICE_TYPE];
|
||||
} service_type_array[OGS_SBI_MAX_NUM_OF_SERVICE_TYPE],
|
||||
home_nsmf_pdusession;
|
||||
|
||||
ogs_list_t xact_list;
|
||||
|
||||
@@ -534,6 +535,9 @@ bool ogs_sbi_discovery_option_requester_plmn_list_is_matched(
|
||||
bool ogs_sbi_discovery_option_target_plmn_list_is_matched(
|
||||
ogs_sbi_nf_instance_t *nf_instance,
|
||||
ogs_sbi_discovery_option_t *discovery_option);
|
||||
bool ogs_sbi_discovery_option_hnrf_uri_is_matched(
|
||||
ogs_sbi_nf_instance_t *nf_instance,
|
||||
ogs_sbi_discovery_option_t *discovery_option);
|
||||
|
||||
void ogs_sbi_object_free(ogs_sbi_object_t *sbi_object);
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -507,6 +507,10 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message)
|
||||
&discovery_option->requester_plmn_list[0]));
|
||||
}
|
||||
}
|
||||
if (discovery_option->hnrf_uri) {
|
||||
ogs_sbi_header_set(request->http.params,
|
||||
OGS_SBI_PARAM_HNRF_URI, discovery_option->hnrf_uri);
|
||||
}
|
||||
if (discovery_option->requester_features) {
|
||||
char *v = ogs_uint64_to_string(
|
||||
discovery_option->requester_features);
|
||||
@@ -602,15 +606,15 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message)
|
||||
ogs_sbi_header_set(request->http.params, OGS_SBI_PARAM_SNSSAI, v);
|
||||
ogs_free(v);
|
||||
}
|
||||
if (message->param.slice_info_request_for_pdu_session_presence) {
|
||||
if (message->param.slice_info_for_pdu_session_presence) {
|
||||
OpenAPI_slice_info_for_pdu_session_t SliceInfoForPDUSession;
|
||||
OpenAPI_snssai_t sNSSAI;
|
||||
OpenAPI_snssai_t sNssai, homeSnssai;
|
||||
|
||||
char *v = NULL;
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (!message->param.s_nssai.sst) {
|
||||
ogs_error("No S-NSSAI SST");
|
||||
if (!message->param.snssai_presence) {
|
||||
ogs_error("No S-NSSAI");
|
||||
ogs_sbi_request_free(request);
|
||||
return NULL;
|
||||
}
|
||||
@@ -620,22 +624,37 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(&sNSSAI, 0, sizeof(sNSSAI));
|
||||
sNSSAI.sst = message->param.s_nssai.sst;
|
||||
sNSSAI.sd = ogs_s_nssai_sd_to_string(message->param.s_nssai.sd);
|
||||
memset(&sNssai, 0, sizeof(sNssai));
|
||||
sNssai.sst = message->param.s_nssai.sst;
|
||||
sNssai.sd = ogs_s_nssai_sd_to_string(message->param.s_nssai.sd);
|
||||
|
||||
memset(&homeSnssai, 0, sizeof(homeSnssai));
|
||||
if (message->param.home_snssai_presence) {
|
||||
homeSnssai.sst = message->param.home_snssai.sst;
|
||||
homeSnssai.sd = ogs_s_nssai_sd_to_string(
|
||||
message->param.home_snssai.sd);
|
||||
}
|
||||
|
||||
memset(&SliceInfoForPDUSession, 0, sizeof(SliceInfoForPDUSession));
|
||||
|
||||
SliceInfoForPDUSession.s_nssai = &sNSSAI;
|
||||
SliceInfoForPDUSession.s_nssai = &sNssai;
|
||||
SliceInfoForPDUSession.roaming_indication =
|
||||
message->param.roaming_indication;
|
||||
if (homeSnssai.sst)
|
||||
SliceInfoForPDUSession.home_snssai = &homeSnssai;
|
||||
|
||||
item = OpenAPI_slice_info_for_pdu_session_convertToJSON(
|
||||
&SliceInfoForPDUSession);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_slice_info_for_pdu_session_convertToJSON() "
|
||||
"failed");
|
||||
|
||||
if (sNssai.sd)
|
||||
ogs_free(sNssai.sd);
|
||||
if (homeSnssai.sd)
|
||||
ogs_free(homeSnssai.sd);
|
||||
ogs_sbi_request_free(request);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -643,6 +662,12 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message)
|
||||
if (!v) {
|
||||
ogs_error("cJSON_PrintUnformatted() failed");
|
||||
ogs_sbi_request_free(request);
|
||||
|
||||
if (sNssai.sd)
|
||||
ogs_free(sNssai.sd);
|
||||
if (homeSnssai.sd)
|
||||
ogs_free(homeSnssai.sd);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
cJSON_Delete(item);
|
||||
@@ -651,8 +676,10 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message)
|
||||
OGS_SBI_PARAM_SLICE_INFO_REQUEST_FOR_PDU_SESSION, v);
|
||||
ogs_free(v);
|
||||
|
||||
if (sNSSAI.sd)
|
||||
ogs_free(sNSSAI.sd);
|
||||
if (sNssai.sd)
|
||||
ogs_free(sNssai.sd);
|
||||
if (homeSnssai.sd)
|
||||
ogs_free(homeSnssai.sd);
|
||||
}
|
||||
if (message->param.ipv4addr) {
|
||||
ogs_sbi_header_set(request->http.params,
|
||||
@@ -663,6 +690,72 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message)
|
||||
OGS_SBI_PARAM_IPV6PREFIX, message->param.ipv6prefix);
|
||||
}
|
||||
|
||||
if (message->param.home_plmn_id_presence) {
|
||||
OpenAPI_plmn_id_t home_plmn_id;
|
||||
|
||||
home_plmn_id.mnc = ogs_plmn_id_mnc_string(&message->param.home_plmn_id);
|
||||
home_plmn_id.mcc = ogs_plmn_id_mcc_string(&message->param.home_plmn_id);
|
||||
|
||||
if (home_plmn_id.mnc && home_plmn_id.mcc) {
|
||||
char *v = NULL;
|
||||
cJSON *item = NULL;
|
||||
|
||||
item = OpenAPI_plmn_id_convertToJSON(&home_plmn_id);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_plmn_id_convertToJSON() failed");
|
||||
ogs_sbi_request_free(request);
|
||||
return NULL;
|
||||
}
|
||||
if (home_plmn_id.mnc) ogs_free(home_plmn_id.mnc);
|
||||
if (home_plmn_id.mcc) ogs_free(home_plmn_id.mcc);
|
||||
|
||||
v = cJSON_PrintUnformatted(item);
|
||||
if (!v) {
|
||||
ogs_error("cJSON_PrintUnformatted() failed");
|
||||
ogs_sbi_request_free(request);
|
||||
return NULL;
|
||||
}
|
||||
cJSON_Delete(item);
|
||||
|
||||
ogs_sbi_header_set(
|
||||
request->http.params, OGS_SBI_PARAM_HOME_PLMN_ID, v);
|
||||
ogs_free(v);
|
||||
}
|
||||
}
|
||||
|
||||
if (message->param.tai_presence) {
|
||||
OpenAPI_tai_t tai;
|
||||
|
||||
memset(&tai, 0, sizeof(tai));
|
||||
tai.plmn_id = ogs_sbi_build_plmn_id(&message->param.tai.plmn_id);
|
||||
tai.tac = ogs_uint24_to_0string(message->param.tai.tac);
|
||||
|
||||
if (tai.plmn_id && tai.tac) {
|
||||
char *v = NULL;
|
||||
cJSON *item = NULL;
|
||||
|
||||
item = OpenAPI_tai_convertToJSON(&tai);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_tai_convertToJSON() failed");
|
||||
ogs_sbi_request_free(request);
|
||||
return NULL;
|
||||
}
|
||||
if (tai.plmn_id) ogs_sbi_free_plmn_id(tai.plmn_id);
|
||||
if (tai.tac) ogs_free(tai.tac);
|
||||
|
||||
v = cJSON_PrintUnformatted(item);
|
||||
if (!v) {
|
||||
ogs_error("cJSON_PrintUnformatted() failed");
|
||||
ogs_sbi_request_free(request);
|
||||
return NULL;
|
||||
}
|
||||
cJSON_Delete(item);
|
||||
|
||||
ogs_sbi_header_set(request->http.params, OGS_SBI_PARAM_TAI, v);
|
||||
ogs_free(v);
|
||||
}
|
||||
}
|
||||
|
||||
if (build_content(&request->http, message) == false) {
|
||||
ogs_error("build_content() failed");
|
||||
ogs_sbi_request_free(request);
|
||||
@@ -872,6 +965,12 @@ int ogs_sbi_parse_request(
|
||||
discovery_option->requester_plmn_list, v);
|
||||
discovery_option_presence = true;
|
||||
}
|
||||
} else if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_PARAM_HNRF_URI)) {
|
||||
char *v = ogs_hash_this_val(hi);
|
||||
if (v) {
|
||||
ogs_sbi_discovery_option_set_hnrf_uri(discovery_option, v);
|
||||
discovery_option_presence = true;
|
||||
}
|
||||
} else if (!strcmp(ogs_hash_this_key(hi),
|
||||
OGS_SBI_PARAM_REQUESTER_FEATURES)) {
|
||||
char *v = ogs_hash_this_val(hi);
|
||||
@@ -939,17 +1038,29 @@ int ogs_sbi_parse_request(
|
||||
SliceInfoForPduSession =
|
||||
OpenAPI_slice_info_for_pdu_session_parseFromJSON(item);
|
||||
if (SliceInfoForPduSession) {
|
||||
OpenAPI_snssai_t *s_nssai =
|
||||
SliceInfoForPduSession->s_nssai;
|
||||
OpenAPI_snssai_t *s_nssai = NULL, *home_snssai = NULL;
|
||||
|
||||
s_nssai = SliceInfoForPduSession->s_nssai;
|
||||
if (s_nssai) {
|
||||
message->param.s_nssai.sst = s_nssai->sst;
|
||||
message->param.s_nssai.sd =
|
||||
ogs_s_nssai_sd_from_string(s_nssai->sd);
|
||||
message->param.snssai_presence = true;
|
||||
}
|
||||
|
||||
message->param.roaming_indication =
|
||||
SliceInfoForPduSession->roaming_indication;
|
||||
|
||||
home_snssai = SliceInfoForPduSession->home_snssai;
|
||||
if (home_snssai) {
|
||||
message->param.home_snssai.sst = home_snssai->sst;
|
||||
message->param.home_snssai.sd =
|
||||
ogs_s_nssai_sd_from_string(home_snssai->sd);
|
||||
message->param.home_snssai_presence = true;
|
||||
}
|
||||
|
||||
message->param.
|
||||
slice_info_request_for_pdu_session_presence = true;
|
||||
slice_info_for_pdu_session_presence = true;
|
||||
|
||||
OpenAPI_slice_info_for_pdu_session_free(
|
||||
SliceInfoForPduSession);
|
||||
@@ -962,6 +1073,48 @@ int ogs_sbi_parse_request(
|
||||
message->param.ipv4addr = ogs_hash_this_val(hi);
|
||||
} else if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_PARAM_IPV6PREFIX)) {
|
||||
message->param.ipv6prefix = ogs_hash_this_val(hi);
|
||||
} else if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_PARAM_HOME_PLMN_ID)) {
|
||||
char *v = NULL;
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_plmn_id_t *home_plmn_id = NULL;
|
||||
|
||||
v = ogs_hash_this_val(hi);
|
||||
if (v) {
|
||||
item = cJSON_Parse(v);
|
||||
if (item) {
|
||||
home_plmn_id = OpenAPI_plmn_id_parseFromJSON(item);
|
||||
if (home_plmn_id &&
|
||||
home_plmn_id->mnc && home_plmn_id->mcc) {
|
||||
ogs_plmn_id_build(&message->param.home_plmn_id,
|
||||
atoi(home_plmn_id->mcc),
|
||||
atoi(home_plmn_id->mnc), strlen(home_plmn_id->mnc));
|
||||
message->param.home_plmn_id_presence = true;
|
||||
OpenAPI_plmn_id_free(home_plmn_id);
|
||||
}
|
||||
cJSON_Delete(item);
|
||||
}
|
||||
}
|
||||
} else if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_PARAM_TAI)) {
|
||||
char *v = NULL;
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_tai_t *tai = NULL;
|
||||
|
||||
v = ogs_hash_this_val(hi);
|
||||
if (v) {
|
||||
item = cJSON_Parse(v);
|
||||
if (item) {
|
||||
tai = OpenAPI_tai_parseFromJSON(item);
|
||||
if (tai && tai->plmn_id && tai->tac) {
|
||||
ogs_sbi_parse_plmn_id(
|
||||
&message->param.tai.plmn_id, tai->plmn_id);
|
||||
message->param.tai.tac =
|
||||
ogs_uint24_from_string(tai->tac);
|
||||
message->param.tai_presence = true;
|
||||
OpenAPI_tai_free(tai);
|
||||
}
|
||||
cJSON_Delete(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2946,6 +3099,9 @@ void ogs_sbi_discovery_option_free(
|
||||
for (i = 0; i < discovery_option->num_of_service_names; i++)
|
||||
ogs_free(discovery_option->service_names[i]);
|
||||
|
||||
if (discovery_option->hnrf_uri)
|
||||
ogs_free(discovery_option->hnrf_uri);
|
||||
|
||||
ogs_free(discovery_option);
|
||||
}
|
||||
|
||||
@@ -3456,3 +3612,22 @@ cleanup:
|
||||
|
||||
return num_of_plmn_list;
|
||||
}
|
||||
|
||||
void ogs_sbi_discovery_option_set_hnrf_uri(
|
||||
ogs_sbi_discovery_option_t *discovery_option, char *hnrf_uri)
|
||||
{
|
||||
ogs_assert(discovery_option);
|
||||
ogs_assert(hnrf_uri);
|
||||
|
||||
ogs_assert(!discovery_option->hnrf_uri);
|
||||
discovery_option->hnrf_uri = ogs_strdup(hnrf_uri);
|
||||
ogs_assert(discovery_option->hnrf_uri);
|
||||
}
|
||||
|
||||
void ogs_sbi_discovery_option_clear_hnrf_uri(
|
||||
ogs_sbi_discovery_option_t *discovery_option)
|
||||
{
|
||||
ogs_assert(discovery_option);
|
||||
ogs_free(discovery_option->hnrf_uri);
|
||||
discovery_option->hnrf_uri = NULL;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -298,6 +298,8 @@ extern "C" {
|
||||
OGS_SBI_CUSTOM_DISCOVERY_COMMON OGS_SBI_PARAM_REQUESTER_FEATURES
|
||||
#define OGS_SBI_CUSTOM_DISCOVERY_GUAMI \
|
||||
OGS_SBI_CUSTOM_DISCOVERY_COMMON OGS_SBI_PARAM_GUAMI
|
||||
#define OGS_SBI_CUSTOM_DISCOVERY_HNRF_URI \
|
||||
OGS_SBI_CUSTOM_DISCOVERY_COMMON OGS_SBI_PARAM_HNRF_URI
|
||||
#define OGS_SBI_CUSTOM_PRODUCER_ID \
|
||||
OGS_SBI_CUSTOM_3GPP_COMMON "Producer-Id"
|
||||
#define OGS_SBI_CUSTOM_OCI \
|
||||
@@ -340,6 +342,8 @@ extern "C" {
|
||||
"slice-info-request-for-pdu-session"
|
||||
#define OGS_SBI_PARAM_IPV4ADDR "ipv4Addr"
|
||||
#define OGS_SBI_PARAM_IPV6PREFIX "ipv6Prefix"
|
||||
#define OGS_SBI_PARAM_HOME_PLMN_ID "home-plmn-id"
|
||||
#define OGS_SBI_PARAM_HNRF_URI "hnrf-uri"
|
||||
|
||||
#define OGS_SBI_CONTENT_JSON_TYPE \
|
||||
OGS_SBI_APPLICATION_TYPE "/" OGS_SBI_APPLICATION_JSON_TYPE
|
||||
@@ -443,6 +447,8 @@ typedef struct ogs_sbi_discovery_option_s {
|
||||
int num_of_requester_plmn_list;
|
||||
ogs_plmn_id_t requester_plmn_list[OGS_MAX_NUM_OF_PLMN];
|
||||
|
||||
char *hnrf_uri;
|
||||
|
||||
uint64_t requester_features;
|
||||
} ogs_sbi_discovery_option_t;
|
||||
|
||||
@@ -477,17 +483,25 @@ typedef struct ogs_sbi_message_s {
|
||||
char *dnn;
|
||||
|
||||
/* Shared memory */
|
||||
ogs_plmn_id_t plmn_id;
|
||||
ogs_s_nssai_t s_nssai;
|
||||
|
||||
bool plmn_id_presence;
|
||||
ogs_plmn_id_t plmn_id;
|
||||
|
||||
bool single_nssai_presence;
|
||||
bool snssai_presence;
|
||||
bool slice_info_request_for_pdu_session_presence;
|
||||
ogs_s_nssai_t s_nssai;
|
||||
|
||||
bool slice_info_for_pdu_session_presence;
|
||||
OpenAPI_roaming_indication_e roaming_indication;
|
||||
bool home_snssai_presence;
|
||||
ogs_s_nssai_t home_snssai;
|
||||
|
||||
char *ipv4addr;
|
||||
char *ipv6prefix;
|
||||
|
||||
bool home_plmn_id_presence;
|
||||
ogs_plmn_id_t home_plmn_id;
|
||||
bool tai_presence;
|
||||
ogs_5gs_tai_t tai;
|
||||
} param;
|
||||
|
||||
int res_status;
|
||||
@@ -676,6 +690,11 @@ char *ogs_sbi_discovery_option_build_plmn_list(
|
||||
int ogs_sbi_discovery_option_parse_plmn_list(
|
||||
ogs_plmn_id_t *plmn_list, char *v);
|
||||
|
||||
void ogs_sbi_discovery_option_set_hnrf_uri(
|
||||
ogs_sbi_discovery_option_t *discovery_option, char *hnrf_uri);
|
||||
void ogs_sbi_discovery_option_clear_hnrf_uri(
|
||||
ogs_sbi_discovery_option_t *discovery_option);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -487,6 +487,13 @@ int ogs_sbi_discover_and_send(ogs_sbi_xact_t *xact)
|
||||
ogs_free(v);
|
||||
}
|
||||
|
||||
if (discovery_option && discovery_option->hnrf_uri) {
|
||||
ogs_debug("hnrf_uri [%s]", discovery_option->hnrf_uri);
|
||||
ogs_sbi_header_set(request->http.headers,
|
||||
OGS_SBI_CUSTOM_DISCOVERY_HNRF_URI,
|
||||
discovery_option->hnrf_uri);
|
||||
}
|
||||
|
||||
rc = ogs_sbi_client_send_via_scp_or_sepp(
|
||||
scp_client, client_discover_cb, request,
|
||||
OGS_UINT_TO_POINTER(xact->id));
|
||||
|
@@ -613,7 +613,7 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e)
|
||||
e->h.sbi.message = &sbi_message;;
|
||||
e->h.sbi.state = state;
|
||||
|
||||
amf_nnssf_nsselection_handle_get(sess, &sbi_message);
|
||||
amf_nnssf_nsselection_handle_get(sess, state, &sbi_message);
|
||||
break;
|
||||
|
||||
DEFAULT
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -2309,10 +2309,12 @@ void amf_sess_remove(amf_sess_t *sess)
|
||||
|
||||
if (sess->nssf.nsi_id)
|
||||
ogs_free(sess->nssf.nsi_id);
|
||||
if (sess->nssf.nrf.id)
|
||||
ogs_free(sess->nssf.nrf.id);
|
||||
if (sess->nssf.nrf_uri)
|
||||
ogs_free(sess->nssf.nrf_uri);
|
||||
if (sess->nssf.nrf.client)
|
||||
ogs_sbi_client_remove(sess->nssf.nrf.client);
|
||||
if (sess->nssf.hnrf_uri)
|
||||
ogs_free(sess->nssf.hnrf_uri);
|
||||
|
||||
ogs_pool_id_free(&amf_sess_pool, sess);
|
||||
|
||||
@@ -2349,53 +2351,6 @@ amf_sess_t *amf_sess_find_by_id(ogs_pool_id_t id)
|
||||
return ogs_pool_find_by_id(&amf_sess_pool, id);
|
||||
}
|
||||
|
||||
void amf_sbi_select_nf(
|
||||
ogs_sbi_object_t *sbi_object,
|
||||
ogs_sbi_service_type_e service_type,
|
||||
OpenAPI_nf_type_e requester_nf_type,
|
||||
ogs_sbi_discovery_option_t *discovery_option)
|
||||
{
|
||||
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
|
||||
ogs_sbi_nf_instance_t *nf_instance = NULL;
|
||||
amf_sess_t *sess = NULL;
|
||||
|
||||
ogs_assert(sbi_object);
|
||||
ogs_assert(service_type);
|
||||
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
|
||||
ogs_assert(target_nf_type);
|
||||
ogs_assert(requester_nf_type);
|
||||
|
||||
switch(sbi_object->type) {
|
||||
case OGS_SBI_OBJ_UE_TYPE:
|
||||
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
|
||||
target_nf_type, requester_nf_type, discovery_option);
|
||||
if (nf_instance)
|
||||
OGS_SBI_SETUP_NF_INSTANCE(
|
||||
sbi_object->service_type_array[service_type], nf_instance);
|
||||
break;
|
||||
case OGS_SBI_OBJ_SESS_TYPE:
|
||||
sess = (amf_sess_t *)sbi_object;
|
||||
ogs_assert(sess);
|
||||
|
||||
ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) {
|
||||
if (ogs_sbi_discovery_param_is_matched(
|
||||
nf_instance,
|
||||
target_nf_type, requester_nf_type, discovery_option) ==
|
||||
false)
|
||||
continue;
|
||||
|
||||
OGS_SBI_SETUP_NF_INSTANCE(
|
||||
sbi_object->service_type_array[service_type], nf_instance);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ogs_fatal("(NF discover search result) Not implemented [%d]",
|
||||
sbi_object->type);
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
}
|
||||
|
||||
int amf_sess_xact_count(amf_ue_t *amf_ue)
|
||||
{
|
||||
amf_sess_t *sess = NULL;
|
||||
|
@@ -801,10 +801,11 @@ typedef struct amf_sess_s {
|
||||
|
||||
struct {
|
||||
char *nsi_id;
|
||||
char *nrf_uri;
|
||||
struct {
|
||||
char *id;
|
||||
ogs_sbi_client_t *client;
|
||||
} nrf;
|
||||
char *hnrf_uri;
|
||||
} nssf;
|
||||
|
||||
/* last payload for sending back to the UE */
|
||||
@@ -821,6 +822,7 @@ typedef struct amf_sess_s {
|
||||
ogs_s_nssai_t s_nssai;
|
||||
ogs_s_nssai_t mapped_hplmn;
|
||||
char *dnn;
|
||||
bool lbo_roaming_allowed;
|
||||
|
||||
} amf_sess_t;
|
||||
|
||||
@@ -953,12 +955,6 @@ amf_sess_t *amf_sess_find_by_dnn(amf_ue_t *amf_ue, char *dnn);
|
||||
amf_ue_t *amf_ue_find_by_id(ogs_pool_id_t id);
|
||||
amf_sess_t *amf_sess_find_by_id(ogs_pool_id_t id);
|
||||
|
||||
void amf_sbi_select_nf(
|
||||
ogs_sbi_object_t *sbi_object,
|
||||
ogs_sbi_service_type_e service_type,
|
||||
OpenAPI_nf_type_e requester_nf_type,
|
||||
ogs_sbi_discovery_option_t *discovery_option);
|
||||
|
||||
#define AMF_SESSION_SYNC_DONE(__aMF, __sTATE) \
|
||||
(amf_sess_xact_state_count(__aMF, __sTATE) == 0)
|
||||
int amf_sess_xact_count(amf_ue_t *amf_ue);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -1131,7 +1131,6 @@ int gmm_handle_ul_nas_transport(ran_ue_t *ran_ue, amf_ue_t *amf_ue,
|
||||
int r;
|
||||
ogs_slice_data_t *selected_slice = NULL;
|
||||
amf_sess_t *sess = NULL;
|
||||
amf_nsmf_pdusession_sm_context_param_t param;
|
||||
|
||||
ogs_nas_payload_container_type_t *payload_container_type = NULL;
|
||||
ogs_nas_payload_container_t *payload_container = NULL;
|
||||
@@ -1308,7 +1307,6 @@ int gmm_handle_ul_nas_transport(ran_ue_t *ran_ue, amf_ue_t *amf_ue,
|
||||
|
||||
if (ul_nas_transport->presencemask &
|
||||
OGS_NAS_5GS_UL_NAS_TRANSPORT_DNN_PRESENT) {
|
||||
|
||||
for (k = 0;
|
||||
k < amf_ue->slice[i].num_of_session; k++) {
|
||||
if (k >= OGS_MAX_NUM_OF_SESS) {
|
||||
@@ -1329,13 +1327,15 @@ int gmm_handle_ul_nas_transport(ran_ue_t *ran_ue, amf_ue_t *amf_ue,
|
||||
sess->dnn = ogs_strdup(dnn->value);
|
||||
ogs_assert(sess->dnn);
|
||||
|
||||
sess->lbo_roaming_allowed =
|
||||
amf_ue->slice[i].
|
||||
session[k].lbo_roaming_allowed;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
selected_slice = amf_ue->slice + i;
|
||||
ogs_assert(selected_slice);
|
||||
|
||||
@@ -1345,6 +1345,9 @@ int gmm_handle_ul_nas_transport(ran_ue_t *ran_ue, amf_ue_t *amf_ue,
|
||||
sess->dnn = ogs_strdup(
|
||||
selected_slice->session[0].name);
|
||||
ogs_assert(sess->dnn);
|
||||
sess->lbo_roaming_allowed =
|
||||
amf_ue->slice[i].
|
||||
session[0].lbo_roaming_allowed;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1365,70 +1368,223 @@ int gmm_handle_ul_nas_transport(ran_ue_t *ran_ue, amf_ue_t *amf_ue,
|
||||
sess->s_nssai.sst = selected_slice->s_nssai.sst;
|
||||
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] "
|
||||
ogs_info("UE SUPI[%s] DNN[%s] LBO[%d] S_NSSAI[SST:%d SD:0x%x] "
|
||||
"smContextRef[%s] smContextResourceURI[%s]",
|
||||
amf_ue->supi, sess->dnn, sess->s_nssai.sst, sess->s_nssai.sd.v,
|
||||
amf_ue->supi, sess->dnn, sess->lbo_roaming_allowed,
|
||||
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");
|
||||
|
||||
if (!SESSION_CONTEXT_IN_SMF(sess)) {
|
||||
ogs_sbi_nf_instance_t *nf_instance = NULL;
|
||||
ogs_sbi_service_type_e service_type =
|
||||
OGS_SBI_SERVICE_TYPE_NSMF_PDUSESSION;
|
||||
ogs_sbi_nf_instance_t *v_smf_instance = NULL;
|
||||
ogs_sbi_nf_instance_t *h_smf_instance = NULL;
|
||||
ogs_sbi_discovery_option_t *v_discovery_option = NULL;
|
||||
|
||||
ogs_sbi_discovery_option_t *discovery_option = NULL;
|
||||
amf_nnssf_nsselection_param_t param;
|
||||
|
||||
discovery_option = ogs_sbi_discovery_option_new();
|
||||
ogs_assert(discovery_option);
|
||||
ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL;
|
||||
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
|
||||
OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
|
||||
|
||||
service_type = OGS_SBI_SERVICE_TYPE_NSMF_PDUSESSION;
|
||||
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
|
||||
ogs_assert(target_nf_type);
|
||||
requester_nf_type = NF_INSTANCE_TYPE(
|
||||
ogs_sbi_self()->nf_instance);
|
||||
ogs_assert(requester_nf_type);
|
||||
|
||||
int state = AMF_CREATE_SM_CONTEXT_NO_STATE;
|
||||
|
||||
/********************************************
|
||||
* Visited Discovery Option
|
||||
*******************************************/
|
||||
v_discovery_option = ogs_sbi_discovery_option_new();
|
||||
ogs_assert(v_discovery_option);
|
||||
|
||||
ogs_sbi_discovery_option_add_snssais(
|
||||
discovery_option, &sess->s_nssai);
|
||||
ogs_sbi_discovery_option_set_dnn(discovery_option, sess->dnn);
|
||||
v_discovery_option, &sess->s_nssai);
|
||||
ogs_sbi_discovery_option_set_dnn(
|
||||
v_discovery_option, sess->dnn);
|
||||
ogs_sbi_discovery_option_set_tai(
|
||||
discovery_option, &amf_ue->nr_tai);
|
||||
v_discovery_option, &amf_ue->nr_tai);
|
||||
|
||||
nf_instance = OGS_SBI_GET_NF_INSTANCE(
|
||||
sess->sbi.service_type_array[service_type]);
|
||||
if (!nf_instance) {
|
||||
OpenAPI_nf_type_e requester_nf_type =
|
||||
NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance);
|
||||
ogs_assert(requester_nf_type);
|
||||
/********************************************
|
||||
* Parameter for nnssf-nsselection build
|
||||
*******************************************/
|
||||
memset(¶m, 0, sizeof(param));
|
||||
param.slice_info_for_pdu_session.presence = true;
|
||||
param.slice_info_for_pdu_session.snssai = &sess->s_nssai;
|
||||
|
||||
amf_sbi_select_nf(
|
||||
&sess->sbi,
|
||||
OGS_SBI_SERVICE_TYPE_NSMF_PDUSESSION,
|
||||
requester_nf_type,
|
||||
discovery_option);
|
||||
nf_instance = OGS_SBI_GET_NF_INSTANCE(
|
||||
sess->sbi.service_type_array[service_type]);
|
||||
if (ogs_sbi_plmn_id_in_vplmn(&amf_ue->home_plmn_id) == true) {
|
||||
|
||||
if (!nf_instance)
|
||||
ogs_info("No SMF Instance");
|
||||
if (sess->lbo_roaming_allowed == true)
|
||||
param.slice_info_for_pdu_session.roaming_indication =
|
||||
OpenAPI_roaming_indication_LOCAL_BREAKOUT;
|
||||
else
|
||||
ogs_info("SMF Instance [%s]", nf_instance->id);
|
||||
} else
|
||||
ogs_info("SMF Instance [%s]", nf_instance->id);
|
||||
param.slice_info_for_pdu_session.roaming_indication =
|
||||
OpenAPI_roaming_indication_HOME_ROUTED_ROAMING;
|
||||
|
||||
if (nf_instance) {
|
||||
param.home_plmn_id = &amf_ue->home_plmn_id;
|
||||
|
||||
} else
|
||||
param.slice_info_for_pdu_session.roaming_indication =
|
||||
OpenAPI_roaming_indication_NON_ROAMING;
|
||||
|
||||
param.tai = &amf_ue->nr_tai;
|
||||
|
||||
/********************************************
|
||||
* Check Visited SMF Instance
|
||||
*******************************************/
|
||||
v_smf_instance = OGS_SBI_GET_NF_INSTANCE(
|
||||
sess->sbi.service_type_array[service_type]);
|
||||
if (!v_smf_instance) {
|
||||
v_smf_instance =
|
||||
ogs_sbi_nf_instance_find_by_discovery_param(
|
||||
target_nf_type,
|
||||
requester_nf_type,
|
||||
v_discovery_option);
|
||||
if (v_smf_instance) {
|
||||
ogs_info("V-SMF Instance [%s](LIST)",
|
||||
v_smf_instance->id);
|
||||
OGS_SBI_SETUP_NF_INSTANCE(
|
||||
sess->sbi.service_type_array[service_type],
|
||||
v_smf_instance);
|
||||
} else
|
||||
ogs_info("No V-SMF Instance");
|
||||
} else
|
||||
ogs_info("V-SMF Instance [%s](SESSION)",
|
||||
v_smf_instance->id);
|
||||
|
||||
if (v_smf_instance) {
|
||||
ogs_info("V-SMF Instance [%s]", v_smf_instance->id);
|
||||
if (param.slice_info_for_pdu_session.roaming_indication ==
|
||||
OpenAPI_roaming_indication_HOME_ROUTED_ROAMING) {
|
||||
|
||||
/********************************************
|
||||
* Check Home SMF Instance
|
||||
*******************************************/
|
||||
/* Home-Routed roaming */
|
||||
ogs_info("Home-Routed Roaming");
|
||||
|
||||
h_smf_instance = OGS_SBI_GET_NF_INSTANCE(
|
||||
sess->sbi.home_nsmf_pdusession);
|
||||
|
||||
if (!h_smf_instance) {
|
||||
ogs_sbi_discovery_option_t *h_discovery_option =
|
||||
ogs_sbi_discovery_option_new();
|
||||
ogs_assert(h_discovery_option);
|
||||
|
||||
ogs_sbi_discovery_option_add_snssais(
|
||||
h_discovery_option, &sess->s_nssai);
|
||||
ogs_sbi_discovery_option_set_dnn(
|
||||
h_discovery_option, sess->dnn);
|
||||
ogs_sbi_discovery_option_set_tai(
|
||||
h_discovery_option, &amf_ue->nr_tai);
|
||||
|
||||
ogs_sbi_discovery_option_add_target_plmn_list(
|
||||
h_discovery_option, &amf_ue->home_plmn_id);
|
||||
|
||||
ogs_assert(ogs_local_conf()->
|
||||
num_of_serving_plmn_id);
|
||||
for (i = 0; i <
|
||||
ogs_local_conf()->num_of_serving_plmn_id;
|
||||
i++) {
|
||||
ogs_sbi_discovery_option_add_requester_plmn_list(
|
||||
h_discovery_option,
|
||||
&ogs_local_conf()->serving_plmn_id[i]);
|
||||
}
|
||||
|
||||
h_smf_instance =
|
||||
ogs_sbi_nf_instance_find_by_discovery_param(
|
||||
target_nf_type,
|
||||
requester_nf_type,
|
||||
h_discovery_option);
|
||||
if (h_smf_instance) {
|
||||
ogs_info("H-SMF Instance [%s](LIST)",
|
||||
h_smf_instance->id);
|
||||
OGS_SBI_SETUP_NF_INSTANCE(
|
||||
sess->sbi.home_nsmf_pdusession,
|
||||
h_smf_instance);
|
||||
} else
|
||||
ogs_info("No H-SMF Instance");
|
||||
|
||||
ogs_sbi_discovery_option_free(h_discovery_option);
|
||||
|
||||
} else
|
||||
ogs_info("H-SMF Instance [%s](SESSION)",
|
||||
h_smf_instance->id);
|
||||
|
||||
if (h_smf_instance) {
|
||||
/* Both V-SMF and H-SMF Discovered */
|
||||
ogs_info("H-SMF Instance [%s]", h_smf_instance->id);
|
||||
} else {
|
||||
/* No H-SMF Instance */
|
||||
ogs_info("H-SMF not discovered");
|
||||
state = AMF_SMF_SELECTION_IN_VPLMN_IN_HOME_ROUTED;
|
||||
}
|
||||
|
||||
} else {
|
||||
/* Non-roaming or LBO roaming */
|
||||
ogs_info("V-SMF discovered in "
|
||||
"Non-Roaming or LBO-Roaming[%d]",
|
||||
sess->lbo_roaming_allowed);
|
||||
}
|
||||
} else {
|
||||
/* No V-SMF Instance */
|
||||
if (param.slice_info_for_pdu_session.roaming_indication ==
|
||||
OpenAPI_roaming_indication_HOME_ROUTED_ROAMING) {
|
||||
ogs_info("V-SMF not discovered in HOME-ROUTED");
|
||||
state = AMF_SMF_SELECTION_IN_VPLMN_IN_HOME_ROUTED;
|
||||
} else {
|
||||
ogs_info("V-SMF not discovered in NON-ROAMING OR LBO");
|
||||
state =
|
||||
AMF_SMF_SELECTION_IN_VPLMN_IN_NON_ROAMING_OR_LBO;
|
||||
}
|
||||
}
|
||||
|
||||
if (state == AMF_SMF_SELECTION_IN_VPLMN_IN_NON_ROAMING_OR_LBO ||
|
||||
state == AMF_SMF_SELECTION_IN_VPLMN_IN_HOME_ROUTED) {
|
||||
/********************************************
|
||||
* Send nnssf-nsselection (GET)
|
||||
*******************************************/
|
||||
ogs_info("nnssf-nsselection[%d:%d:%p:%p]",
|
||||
state,
|
||||
param.slice_info_for_pdu_session.roaming_indication,
|
||||
v_smf_instance,
|
||||
h_smf_instance);
|
||||
r = amf_sess_sbi_discover_and_send(
|
||||
OGS_SBI_SERVICE_TYPE_NNSSF_NSSELECTION, NULL,
|
||||
amf_nnssf_nsselection_build_get,
|
||||
ran_ue, sess, state, ¶m);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
|
||||
ogs_sbi_discovery_option_free(v_discovery_option);
|
||||
|
||||
} else if (state == AMF_CREATE_SM_CONTEXT_NO_STATE) {
|
||||
/********************************************
|
||||
* Send nsmf-pdusession (CREATE SM CONTEXT)
|
||||
*******************************************/
|
||||
ogs_info("nsmf_pdusession [%d:%p:%p]",
|
||||
param.slice_info_for_pdu_session.roaming_indication,
|
||||
v_smf_instance,
|
||||
h_smf_instance);
|
||||
r = amf_sess_sbi_discover_and_send(
|
||||
OGS_SBI_SERVICE_TYPE_NSMF_PDUSESSION,
|
||||
discovery_option,
|
||||
v_discovery_option,
|
||||
amf_nsmf_pdusession_build_create_sm_context,
|
||||
ran_ue, sess, AMF_CREATE_SM_CONTEXT_NO_STATE, NULL);
|
||||
ran_ue, sess, state, NULL);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
|
||||
} else {
|
||||
r = amf_sess_sbi_discover_and_send(
|
||||
OGS_SBI_SERVICE_TYPE_NNSSF_NSSELECTION,
|
||||
discovery_option,
|
||||
amf_nnssf_nsselection_build_get,
|
||||
ran_ue, sess, 0, NULL);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
ogs_error("Invalid state [%d]", state);
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
|
||||
} else {
|
||||
amf_nsmf_pdusession_sm_context_param_t param;
|
||||
|
||||
memset(¶m, 0, sizeof(param));
|
||||
param.release = 1;
|
||||
@@ -1445,7 +1601,6 @@ int gmm_handle_ul_nas_transport(ran_ue_t *ran_ue, amf_ue_t *amf_ue,
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (!SESSION_CONTEXT_IN_SMF(sess)) {
|
||||
ogs_error("[%s:%d] Session Context is not in SMF [%d]",
|
||||
amf_ue->supi, sess->psi, gsm_header->message_type);
|
||||
@@ -1456,11 +1611,13 @@ int gmm_handle_ul_nas_transport(ran_ue_t *ran_ue, amf_ue_t *amf_ue,
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
memset(¶m, 0, sizeof(param));
|
||||
param.n1smbuf = sess->payload_container;
|
||||
|
||||
if (gsm_header->message_type ==
|
||||
OGS_NAS_5GS_PDU_SESSION_RELEASE_COMPLETE) {
|
||||
amf_nsmf_pdusession_sm_context_param_t param;
|
||||
|
||||
memset(¶m, 0, sizeof(param));
|
||||
param.n1smbuf = sess->payload_container;
|
||||
|
||||
param.ue_location = true;
|
||||
param.ue_timezone = true;
|
||||
|
||||
@@ -1472,6 +1629,10 @@ int gmm_handle_ul_nas_transport(ran_ue_t *ran_ue, amf_ue_t *amf_ue,
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
} else {
|
||||
amf_nsmf_pdusession_sm_context_param_t param;
|
||||
|
||||
memset(¶m, 0, sizeof(param));
|
||||
param.n1smbuf = sess->payload_container;
|
||||
|
||||
r = amf_sess_sbi_discover_and_send(
|
||||
OGS_SBI_SERVICE_TYPE_NSMF_PDUSESSION, NULL,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
|
@@ -29,10 +29,15 @@ void amf_nnrf_handle_nf_discover(
|
||||
|
||||
ogs_sbi_nf_instance_t *nf_instance = NULL;
|
||||
ogs_sbi_object_t *sbi_object = NULL;
|
||||
ogs_pool_id_t sbi_object_id = OGS_INVALID_POOL_ID;
|
||||
ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL;
|
||||
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
|
||||
OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
|
||||
ogs_sbi_discovery_option_t *discovery_option = NULL;
|
||||
|
||||
amf_ue_t *amf_ue = NULL;
|
||||
amf_sess_t *sess = NULL;
|
||||
|
||||
OpenAPI_search_result_t *SearchResult = NULL;
|
||||
|
||||
ogs_assert(recvmsg);
|
||||
@@ -41,9 +46,15 @@ void amf_nnrf_handle_nf_discover(
|
||||
ogs_assert(sbi_object);
|
||||
service_type = xact->service_type;
|
||||
ogs_assert(service_type);
|
||||
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
|
||||
ogs_assert(target_nf_type);
|
||||
requester_nf_type = xact->requester_nf_type;
|
||||
ogs_assert(requester_nf_type);
|
||||
|
||||
sbi_object_id = xact->sbi_object_id;
|
||||
ogs_assert(sbi_object_id >= OGS_MIN_POOL_ID &&
|
||||
sbi_object_id <= OGS_MAX_POOL_ID);
|
||||
|
||||
discovery_option = xact->discovery_option;
|
||||
|
||||
SearchResult = recvmsg->SearchResult;
|
||||
@@ -52,24 +63,27 @@ void amf_nnrf_handle_nf_discover(
|
||||
return;
|
||||
}
|
||||
|
||||
if (sbi_object->type == OGS_SBI_OBJ_UE_TYPE) {
|
||||
amf_ue = amf_ue_find_by_id(sbi_object_id);
|
||||
ogs_assert(amf_ue);
|
||||
} else if (sbi_object->type == OGS_SBI_OBJ_SESS_TYPE) {
|
||||
sess = amf_sess_find_by_id(sbi_object_id);
|
||||
ogs_assert(sess);
|
||||
amf_ue = amf_ue_find_by_id(sess->amf_ue_id);
|
||||
ogs_assert(amf_ue);
|
||||
} else {
|
||||
ogs_fatal("(NF discover) Not implemented [%s:%d]",
|
||||
ogs_sbi_service_type_to_name(service_type), sbi_object->type);
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
|
||||
ogs_nnrf_disc_handle_nf_discover_search_result(SearchResult);
|
||||
|
||||
amf_sbi_select_nf(sbi_object,
|
||||
service_type, requester_nf_type, discovery_option);
|
||||
|
||||
nf_instance = OGS_SBI_GET_NF_INSTANCE(
|
||||
sbi_object->service_type_array[service_type]);
|
||||
|
||||
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
|
||||
target_nf_type, requester_nf_type, discovery_option);
|
||||
if (!nf_instance) {
|
||||
amf_ue_t *amf_ue = NULL;
|
||||
amf_sess_t *sess = NULL;
|
||||
|
||||
ogs_assert(sbi_object->type > OGS_SBI_OBJ_BASE &&
|
||||
sbi_object->type < OGS_SBI_OBJ_TOP);
|
||||
switch(sbi_object->type) {
|
||||
case OGS_SBI_OBJ_UE_TYPE:
|
||||
amf_ue = (amf_ue_t *)sbi_object;
|
||||
ogs_assert(amf_ue);
|
||||
ogs_error("[%s] (NF discover) No [%s]", amf_ue->suci,
|
||||
ogs_sbi_service_type_to_name(service_type));
|
||||
r = nas_5gs_send_gmm_reject_from_sbi(amf_ue,
|
||||
@@ -78,9 +92,6 @@ void amf_nnrf_handle_nf_discover(
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
break;
|
||||
case OGS_SBI_OBJ_SESS_TYPE:
|
||||
sess = (amf_sess_t *)sbi_object;
|
||||
ogs_assert(sess);
|
||||
|
||||
ogs_error("[%d:%d] (NF discover) No [%s]", sess->psi, sess->pti,
|
||||
ogs_sbi_service_type_to_name(service_type));
|
||||
if (sess->payload_container_type) {
|
||||
@@ -108,5 +119,8 @@ void amf_nnrf_handle_nf_discover(
|
||||
return;
|
||||
}
|
||||
|
||||
OGS_SBI_SETUP_NF_INSTANCE(
|
||||
sbi_object->service_type_array[service_type], nf_instance);
|
||||
|
||||
ogs_expect(true == amf_sbi_send_request(nf_instance, xact));
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -24,8 +24,14 @@ ogs_sbi_request_t *amf_nnssf_nsselection_build_get(
|
||||
{
|
||||
ogs_sbi_message_t message;
|
||||
ogs_sbi_request_t *request = NULL;
|
||||
amf_nnssf_nsselection_param_t *param = data;
|
||||
|
||||
amf_ue_t *amf_ue = NULL;
|
||||
|
||||
ogs_assert(param);
|
||||
ogs_assert(sess);
|
||||
amf_ue = amf_ue_find_by_id(sess->amf_ue_id);
|
||||
ogs_assert(amf_ue);
|
||||
|
||||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_GET;
|
||||
@@ -36,20 +42,60 @@ ogs_sbi_request_t *amf_nnssf_nsselection_build_get(
|
||||
|
||||
message.param.nf_id = NF_INSTANCE_ID(ogs_sbi_self()->nf_instance);
|
||||
if (!message.param.nf_id) {
|
||||
ogs_error("No nf_id");
|
||||
ogs_error("No nf-id");
|
||||
goto end;
|
||||
}
|
||||
message.param.nf_type = NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance);
|
||||
if (!message.param.nf_type) {
|
||||
ogs_error("No nf_type");
|
||||
ogs_error("No nf-type");
|
||||
goto end;
|
||||
}
|
||||
|
||||
message.param.slice_info_request_for_pdu_session_presence = true;
|
||||
message.param.roaming_indication = OpenAPI_roaming_indication_NON_ROAMING;
|
||||
memcpy(&message.param.s_nssai, &sess->s_nssai,
|
||||
message.param.slice_info_for_pdu_session_presence =
|
||||
param->slice_info_for_pdu_session.presence;
|
||||
|
||||
if (!message.param.slice_info_for_pdu_session_presence) {
|
||||
ogs_error("No sliceInfoForPDUSession");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!param->slice_info_for_pdu_session.snssai) {
|
||||
ogs_error("No sNssai");
|
||||
goto end;
|
||||
}
|
||||
|
||||
message.param.snssai_presence = true;
|
||||
memcpy(&message.param.s_nssai,
|
||||
param->slice_info_for_pdu_session.snssai,
|
||||
sizeof(message.param.s_nssai));
|
||||
|
||||
message.param.roaming_indication =
|
||||
param->slice_info_for_pdu_session.roaming_indication;
|
||||
|
||||
if (!message.param.roaming_indication) {
|
||||
ogs_error("No roamingIndication");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (param->slice_info_for_pdu_session.home_snssai) {
|
||||
message.param.home_snssai_presence = true;
|
||||
if (message.param.home_snssai_presence)
|
||||
memcpy(&message.param.home_snssai,
|
||||
param->slice_info_for_pdu_session.home_snssai,
|
||||
sizeof(message.param.home_snssai));
|
||||
}
|
||||
|
||||
if (param->home_plmn_id) {
|
||||
message.param.home_plmn_id_presence = true;
|
||||
memcpy(&message.param.home_plmn_id,
|
||||
param->home_plmn_id, sizeof(message.param.home_plmn_id));
|
||||
}
|
||||
|
||||
if (param->tai) {
|
||||
message.param.tai_presence = true;
|
||||
memcpy(&message.param.tai, param->tai, sizeof(message.param.tai));
|
||||
}
|
||||
|
||||
request = ogs_sbi_build_request(&message);
|
||||
ogs_expect(request);
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -26,6 +26,17 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct amf_nnssf_nsselection_param_s {
|
||||
struct {
|
||||
bool presence;
|
||||
ogs_s_nssai_t *snssai;
|
||||
OpenAPI_roaming_indication_e roaming_indication;
|
||||
ogs_s_nssai_t *home_snssai;
|
||||
} slice_info_for_pdu_session;
|
||||
ogs_plmn_id_t *home_plmn_id;
|
||||
ogs_5gs_tai_t *tai;
|
||||
} amf_nnssf_nsselection_param_t;
|
||||
|
||||
ogs_sbi_request_t *amf_nnssf_nsselection_build_get(
|
||||
amf_sess_t *sess, void *data);
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -22,10 +22,10 @@
|
||||
#include "sbi-path.h"
|
||||
|
||||
int amf_nnssf_nsselection_handle_get(
|
||||
amf_sess_t *sess, ogs_sbi_message_t *recvmsg)
|
||||
amf_sess_t *sess, int state, ogs_sbi_message_t *recvmsg)
|
||||
{
|
||||
bool rc;
|
||||
int r;
|
||||
int r, i;
|
||||
OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL;
|
||||
ogs_sbi_client_t *client = NULL, *scp_client = NULL;
|
||||
char *fqdn = NULL;
|
||||
@@ -39,6 +39,7 @@ int amf_nnssf_nsselection_handle_get(
|
||||
amf_ue_t *amf_ue = NULL;
|
||||
ran_ue_t *ran_ue = NULL;
|
||||
|
||||
ogs_assert(state);
|
||||
ogs_assert(recvmsg);
|
||||
ogs_assert(!SESSION_CONTEXT_IN_SMF(sess));
|
||||
|
||||
@@ -97,6 +98,27 @@ int amf_nnssf_nsselection_handle_get(
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
if (state == AMF_SMF_SELECTION_IN_HPLMN_IN_HOME_ROUTED) {
|
||||
if (!sess->nssf.nrf_uri) {
|
||||
ogs_error("No VPLMN nrf_uri");
|
||||
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;
|
||||
}
|
||||
|
||||
if (sess->nssf.hnrf_uri)
|
||||
ogs_free(sess->nssf.hnrf_uri);
|
||||
sess->nssf.hnrf_uri = ogs_strdup(NsiInformation->nrf_id);
|
||||
ogs_assert(sess->nssf.hnrf_uri);
|
||||
} else {
|
||||
if (sess->nssf.nrf_uri)
|
||||
ogs_free(sess->nssf.nrf_uri);
|
||||
sess->nssf.nrf_uri = ogs_strdup(NsiInformation->nrf_id);
|
||||
ogs_assert(sess->nssf.nrf_uri);
|
||||
}
|
||||
|
||||
discovery_option = ogs_sbi_discovery_option_new();
|
||||
ogs_assert(discovery_option);
|
||||
|
||||
@@ -104,18 +126,41 @@ int amf_nnssf_nsselection_handle_get(
|
||||
ogs_sbi_discovery_option_set_dnn(discovery_option, sess->dnn);
|
||||
ogs_sbi_discovery_option_set_tai(discovery_option, &amf_ue->nr_tai);
|
||||
|
||||
if (sess->nssf.nrf.id)
|
||||
ogs_free(sess->nssf.nrf.id);
|
||||
sess->nssf.nrf.id = ogs_strdup(NsiInformation->nrf_id);
|
||||
ogs_assert(sess->nssf.nrf.id);
|
||||
if (state == AMF_SMF_SELECTION_IN_HPLMN_IN_HOME_ROUTED) {
|
||||
/*
|
||||
* In order for Home Routed to find NRFs that are on HPLMN,
|
||||
* we need to include Home PLMN information in the Discovery Option.
|
||||
*/
|
||||
ogs_sbi_discovery_option_add_target_plmn_list(
|
||||
discovery_option, &amf_ue->home_plmn_id);
|
||||
|
||||
scp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance);
|
||||
ogs_assert(ogs_local_conf()->num_of_serving_plmn_id);
|
||||
for (i = 0; i < ogs_local_conf()->num_of_serving_plmn_id; i++) {
|
||||
ogs_sbi_discovery_option_add_requester_plmn_list(
|
||||
discovery_option,
|
||||
&ogs_local_conf()->serving_plmn_id[i]);
|
||||
}
|
||||
|
||||
ogs_assert(sess->nssf.hnrf_uri);
|
||||
ogs_sbi_discovery_option_set_hnrf_uri(
|
||||
discovery_option, sess->nssf.hnrf_uri);
|
||||
}
|
||||
|
||||
/*
|
||||
* SCP can only be used with Non-Roaming or LBO.
|
||||
*
|
||||
* In Home Routed, obtaining NRF from NSSF and selecting SMF
|
||||
* cannot be done via SCP.
|
||||
*/
|
||||
if (state == AMF_SMF_SELECTION_IN_VPLMN_IN_NON_ROAMING_OR_LBO)
|
||||
scp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance);
|
||||
|
||||
if (scp_client) {
|
||||
/* SCP can only be used with Non-Roaming or LBO. */
|
||||
amf_nsmf_pdusession_sm_context_param_t param;
|
||||
|
||||
memset(¶m, 0, sizeof(param));
|
||||
param.nrf_uri.nrf.id = sess->nssf.nrf.id;
|
||||
param.nrf_uri = sess->nssf.nrf_uri;
|
||||
|
||||
r = amf_sess_sbi_discover_and_send(
|
||||
OGS_SBI_SERVICE_TYPE_NSMF_PDUSESSION, discovery_option,
|
||||
@@ -124,6 +169,10 @@ int amf_nnssf_nsselection_handle_get(
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
} else {
|
||||
/*
|
||||
* In Home Routed, obtaining NRF from NSSF and selecting SMF
|
||||
* cannot be done via SCP.
|
||||
*/
|
||||
rc = ogs_sbi_getaddr_from_uri(
|
||||
&scheme, &fqdn, &fqdn_port, &addr, &addr6,
|
||||
NsiInformation->nrf_id);
|
||||
@@ -163,7 +212,7 @@ int amf_nnssf_nsselection_handle_get(
|
||||
|
||||
r = amf_sess_sbi_discover_by_nsi(
|
||||
ran_ue, sess,
|
||||
OGS_SBI_SERVICE_TYPE_NSMF_PDUSESSION, discovery_option);
|
||||
OGS_SBI_SERVICE_TYPE_NSMF_PDUSESSION, discovery_option, state);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -27,7 +27,7 @@ extern "C" {
|
||||
#include "context.h"
|
||||
|
||||
int amf_nnssf_nsselection_handle_get(
|
||||
amf_sess_t *sess, ogs_sbi_message_t *recvmsg);
|
||||
amf_sess_t *sess, int state, ogs_sbi_message_t *recvmsg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -66,7 +66,7 @@ ogs_sbi_request_t *amf_nsmf_pdusession_build_create_sm_context(
|
||||
|
||||
SmContextCreateData.serving_network =
|
||||
ogs_sbi_build_plmn_id_nid(&amf_ue->nr_tai.plmn_id);
|
||||
if (!SmContextCreateData.serving_nf_id) {
|
||||
if (!SmContextCreateData.serving_network) {
|
||||
ogs_error("No serving_network");
|
||||
goto end;
|
||||
}
|
||||
@@ -112,6 +112,24 @@ ogs_sbi_request_t *amf_nsmf_pdusession_build_create_sm_context(
|
||||
if (ogs_sbi_plmn_id_in_vplmn(&amf_ue->home_plmn_id) == true) {
|
||||
char *home_network_domain = NULL;
|
||||
|
||||
if (sess->lbo_roaming_allowed == false) {
|
||||
ogs_sbi_nf_instance_t *h_smf_instance = NULL;
|
||||
ogs_sbi_client_t *h_smf_client = NULL;
|
||||
|
||||
/* Home-Routed Roaming */
|
||||
h_smf_instance = OGS_SBI_GET_NF_INSTANCE(
|
||||
sess->sbi.home_nsmf_pdusession);
|
||||
ogs_assert(h_smf_instance);
|
||||
h_smf_client = NF_INSTANCE_CLIENT(h_smf_instance);
|
||||
ogs_assert(h_smf_client);
|
||||
|
||||
SmContextCreateData.h_smf_id = h_smf_instance->id;
|
||||
|
||||
SmContextCreateData.h_smf_uri =
|
||||
ogs_sbi_client_apiroot(h_smf_client);
|
||||
ogs_assert(SmContextCreateData.h_smf_uri);
|
||||
}
|
||||
|
||||
home_network_domain =
|
||||
ogs_home_network_domain_from_plmn_id(&amf_ue->home_plmn_id);
|
||||
ogs_assert(home_network_domain);
|
||||
@@ -227,10 +245,10 @@ ogs_sbi_request_t *amf_nsmf_pdusession_build_create_sm_context(
|
||||
message.http.custom.callback =
|
||||
(char *)OGS_SBI_CALLBACK_NSMF_PDUSESSION_STATUS_NOTIFY;
|
||||
|
||||
if (param && param->nrf_uri.nrf.id) {
|
||||
if (param && param->nrf_uri) {
|
||||
message.http.custom.nrf_uri =
|
||||
ogs_msprintf("%s: \"%s\"",
|
||||
OGS_SBI_SERVICE_NAME_NNRF_DISC, param->nrf_uri.nrf.id);
|
||||
OGS_SBI_SERVICE_NAME_NNRF_DISC, param->nrf_uri);
|
||||
}
|
||||
|
||||
request = ogs_sbi_build_request(&message);
|
||||
@@ -261,6 +279,9 @@ end:
|
||||
if (SmContextCreateData.ue_time_zone)
|
||||
ogs_free(SmContextCreateData.ue_time_zone);
|
||||
|
||||
if (SmContextCreateData.h_smf_uri)
|
||||
ogs_free(SmContextCreateData.h_smf_uri);
|
||||
|
||||
if (message.http.custom.nrf_uri)
|
||||
ogs_free(message.http.custom.nrf_uri);
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -52,11 +52,7 @@ typedef struct amf_nsmf_pdusession_sm_context_param_s {
|
||||
OpenAPI_ng_ran_target_id_t *targetId;
|
||||
NGAP_TargetID_t *TargetID;
|
||||
|
||||
struct {
|
||||
struct {
|
||||
char *id;
|
||||
} nrf;
|
||||
} nrf_uri;
|
||||
char *nrf_uri;
|
||||
} amf_nsmf_pdusession_sm_context_param_t;
|
||||
|
||||
ogs_sbi_request_t *amf_nsmf_pdusession_build_create_sm_context(
|
||||
|
@@ -228,6 +228,12 @@ int amf_nudm_sdm_handle_provisioned(
|
||||
DnnInfo->default_dnn_indicator;
|
||||
}
|
||||
slice->num_of_session++;
|
||||
|
||||
if (DnnInfo->is_lbo_roaming_allowed ==
|
||||
true) {
|
||||
session->lbo_roaming_allowed =
|
||||
DnnInfo->lbo_roaming_allowed;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -205,18 +205,25 @@ int amf_sess_sbi_discover_and_send(
|
||||
static int client_discover_cb(
|
||||
int status, ogs_sbi_response_t *response, void *data)
|
||||
{
|
||||
int r, rv;
|
||||
int r, i, rv;
|
||||
ogs_sbi_message_t message;
|
||||
|
||||
ogs_sbi_nf_instance_t *nf_instance = NULL;
|
||||
|
||||
ogs_sbi_xact_t *xact = NULL;
|
||||
ogs_pool_id_t xact_id = OGS_INVALID_POOL_ID;
|
||||
ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL;
|
||||
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
|
||||
OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
|
||||
ogs_sbi_discovery_option_t *discovery_option = NULL;
|
||||
amf_ue_t *amf_ue = NULL;
|
||||
ran_ue_t *ran_ue = NULL;
|
||||
amf_sess_t *sess = NULL;
|
||||
|
||||
ogs_sbi_discovery_option_t *v_discovery_option = NULL;
|
||||
|
||||
int current_state, next_state = AMF_CREATE_SM_CONTEXT_NO_STATE;
|
||||
|
||||
xact_id = OGS_POINTER_TO_UINT(data);
|
||||
ogs_assert(xact_id >= OGS_MIN_POOL_ID && xact_id <= OGS_MAX_POOL_ID);
|
||||
|
||||
@@ -230,10 +237,15 @@ static int client_discover_cb(
|
||||
|
||||
service_type = xact->service_type;
|
||||
ogs_assert(service_type);
|
||||
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
|
||||
ogs_assert(target_nf_type);
|
||||
requester_nf_type = xact->requester_nf_type;
|
||||
ogs_assert(requester_nf_type);
|
||||
discovery_option = xact->discovery_option;
|
||||
|
||||
current_state = xact->state;
|
||||
ogs_assert(current_state);
|
||||
|
||||
sess = amf_sess_find_by_id(xact->sbi_object_id);
|
||||
if (!sess) {
|
||||
ogs_error("Session has already been removed");
|
||||
@@ -306,11 +318,9 @@ static int client_discover_cb(
|
||||
|
||||
ogs_nnrf_disc_handle_nf_discover_search_result(message.SearchResult);
|
||||
|
||||
amf_sbi_select_nf(&sess->sbi,
|
||||
service_type, requester_nf_type, discovery_option);
|
||||
|
||||
if (!OGS_SBI_GET_NF_INSTANCE(
|
||||
sess->sbi.service_type_array[service_type])) {
|
||||
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
|
||||
target_nf_type, requester_nf_type, discovery_option);
|
||||
if (!nf_instance) {
|
||||
ogs_error("[%s:%d] (NF discover) No [%s]",
|
||||
amf_ue->supi, sess->psi,
|
||||
ogs_sbi_service_type_to_name(service_type));
|
||||
@@ -323,12 +333,117 @@ static int client_discover_cb(
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
r = amf_sess_sbi_discover_and_send(
|
||||
service_type, NULL,
|
||||
amf_nsmf_pdusession_build_create_sm_context,
|
||||
ran_ue, sess, AMF_CREATE_SM_CONTEXT_NO_STATE, NULL);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
v_discovery_option = ogs_sbi_discovery_option_new();
|
||||
ogs_assert(v_discovery_option);
|
||||
|
||||
ogs_sbi_discovery_option_add_snssais(v_discovery_option, &sess->s_nssai);
|
||||
ogs_sbi_discovery_option_set_dnn(v_discovery_option, sess->dnn);
|
||||
ogs_sbi_discovery_option_set_tai(v_discovery_option, &amf_ue->nr_tai);
|
||||
|
||||
if (current_state == AMF_SMF_SELECTION_IN_VPLMN_IN_NON_ROAMING_OR_LBO) {
|
||||
OGS_SBI_SETUP_NF_INSTANCE(
|
||||
sess->sbi.service_type_array[service_type], nf_instance);
|
||||
|
||||
} else if (current_state == AMF_SMF_SELECTION_IN_VPLMN_IN_HOME_ROUTED) {
|
||||
/* Home-Routed roaming */
|
||||
ogs_sbi_nf_instance_t *h_smf_instance = NULL;
|
||||
|
||||
ogs_info("Home-Routed Roaming(VPLMN)");
|
||||
|
||||
OGS_SBI_SETUP_NF_INSTANCE(
|
||||
sess->sbi.service_type_array[service_type], nf_instance);
|
||||
|
||||
h_smf_instance = OGS_SBI_GET_NF_INSTANCE(
|
||||
sess->sbi.home_nsmf_pdusession);
|
||||
|
||||
if (!h_smf_instance) {
|
||||
ogs_sbi_discovery_option_t *h_discovery_option =
|
||||
ogs_sbi_discovery_option_new();
|
||||
ogs_assert(h_discovery_option);
|
||||
|
||||
ogs_sbi_discovery_option_add_snssais(
|
||||
h_discovery_option, &sess->s_nssai);
|
||||
ogs_sbi_discovery_option_set_dnn(
|
||||
h_discovery_option, sess->dnn);
|
||||
ogs_sbi_discovery_option_set_tai(
|
||||
h_discovery_option, &amf_ue->nr_tai);
|
||||
|
||||
ogs_sbi_discovery_option_add_target_plmn_list(
|
||||
h_discovery_option, &amf_ue->home_plmn_id);
|
||||
|
||||
ogs_assert(ogs_local_conf()->num_of_serving_plmn_id);
|
||||
for (i = 0; i < ogs_local_conf()->num_of_serving_plmn_id; i++) {
|
||||
ogs_sbi_discovery_option_add_requester_plmn_list(
|
||||
h_discovery_option,
|
||||
&ogs_local_conf()->serving_plmn_id[i]);
|
||||
}
|
||||
|
||||
h_smf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
|
||||
target_nf_type, requester_nf_type, h_discovery_option);
|
||||
if (h_smf_instance) {
|
||||
ogs_info("H-SMF Instance [%s](LIST)", h_smf_instance->id);
|
||||
OGS_SBI_SETUP_NF_INSTANCE(
|
||||
sess->sbi.home_nsmf_pdusession, h_smf_instance);
|
||||
} else
|
||||
ogs_info("No H-SMF Instance");
|
||||
|
||||
ogs_sbi_discovery_option_free(h_discovery_option);
|
||||
} else
|
||||
ogs_info("H-SMF Instance [%s](SESSION)", h_smf_instance->id);
|
||||
|
||||
if (h_smf_instance) {
|
||||
/* Both V-SMF and H-SMF Discovered */
|
||||
ogs_info("H-SMF Instance [%s]", h_smf_instance->id);
|
||||
} else {
|
||||
ogs_info("H-SMF not discovered");
|
||||
next_state = AMF_SMF_SELECTION_IN_HPLMN_IN_HOME_ROUTED;
|
||||
}
|
||||
} else if (current_state == AMF_SMF_SELECTION_IN_HPLMN_IN_HOME_ROUTED) {
|
||||
ogs_info("Home-Routed Roaming(HPLMN)");
|
||||
|
||||
OGS_SBI_SETUP_NF_INSTANCE(sess->sbi.home_nsmf_pdusession, nf_instance);
|
||||
} else {
|
||||
ogs_fatal("Invalid current_state = %d", current_state);
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
|
||||
if (next_state == AMF_SMF_SELECTION_IN_HPLMN_IN_HOME_ROUTED) {
|
||||
|
||||
amf_nnssf_nsselection_param_t param;
|
||||
|
||||
memset(¶m, 0, sizeof(param));
|
||||
param.slice_info_for_pdu_session.presence = true;
|
||||
param.slice_info_for_pdu_session.snssai = &sess->s_nssai;
|
||||
param.slice_info_for_pdu_session.roaming_indication =
|
||||
OpenAPI_roaming_indication_HOME_ROUTED_ROAMING;
|
||||
param.slice_info_for_pdu_session.home_snssai = &sess->s_nssai;
|
||||
param.home_plmn_id = &amf_ue->home_plmn_id;
|
||||
param.tai = &amf_ue->nr_tai;
|
||||
|
||||
/* No H-SMF Instance */
|
||||
ogs_info("H-SMF not discovered");
|
||||
r = amf_sess_sbi_discover_and_send(
|
||||
OGS_SBI_SERVICE_TYPE_NNSSF_NSSELECTION, NULL,
|
||||
amf_nnssf_nsselection_build_get, ran_ue, sess,
|
||||
AMF_SMF_SELECTION_IN_HPLMN_IN_HOME_ROUTED, ¶m);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
|
||||
ogs_sbi_discovery_option_free(v_discovery_option);
|
||||
|
||||
} else if (next_state == AMF_CREATE_SM_CONTEXT_NO_STATE) {
|
||||
|
||||
r = amf_sess_sbi_discover_and_send(
|
||||
service_type, v_discovery_option,
|
||||
amf_nsmf_pdusession_build_create_sm_context,
|
||||
ran_ue, sess, next_state, NULL);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
|
||||
} else {
|
||||
ogs_error("Invalid NEXT state [%d]", next_state);
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
|
||||
ogs_sbi_xact_remove(xact);
|
||||
|
||||
@@ -349,7 +464,7 @@ cleanup:
|
||||
int amf_sess_sbi_discover_by_nsi(
|
||||
ran_ue_t *ran_ue, amf_sess_t *sess,
|
||||
ogs_sbi_service_type_e service_type,
|
||||
ogs_sbi_discovery_option_t *discovery_option)
|
||||
ogs_sbi_discovery_option_t *discovery_option, int state)
|
||||
{
|
||||
ogs_sbi_xact_t *xact = NULL;
|
||||
ogs_sbi_client_t *client = NULL;
|
||||
@@ -358,8 +473,9 @@ int amf_sess_sbi_discover_by_nsi(
|
||||
client = sess->nssf.nrf.client;
|
||||
ogs_assert(client);
|
||||
ogs_assert(service_type);
|
||||
ogs_assert(state);
|
||||
|
||||
ogs_warn("Try to discover [%s]",
|
||||
ogs_warn("Try to discover by NsiInformation [%s]",
|
||||
ogs_sbi_service_type_to_name(service_type));
|
||||
|
||||
if (ran_ue) {
|
||||
@@ -376,13 +492,15 @@ int amf_sess_sbi_discover_by_nsi(
|
||||
}
|
||||
|
||||
xact->request = amf_nnrf_disc_build_discover(
|
||||
sess->nssf.nrf.id, xact->service_type, xact->discovery_option);
|
||||
sess->nssf.nrf_uri, xact->service_type, xact->discovery_option);
|
||||
if (!xact->request) {
|
||||
ogs_error("amf_nnrf_disc_build_discover() failed");
|
||||
ogs_sbi_xact_remove(xact);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
xact->state = state;
|
||||
|
||||
return ogs_sbi_client_send_request(
|
||||
client, client_discover_cb, xact->request,
|
||||
OGS_UINT_TO_POINTER(xact->id)) == true ? OGS_OK : OGS_ERROR;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -65,6 +65,14 @@ bool amf_sbi_send_request(
|
||||
#define AMF_REMOVE_S1_CONTEXT_BY_RESET_ALL 52
|
||||
#define AMF_REMOVE_S1_CONTEXT_BY_RESET_PARTIAL 53
|
||||
|
||||
/*
|
||||
* TS23.502
|
||||
* 4.3.2.2.3 SMF selection
|
||||
*/
|
||||
#define AMF_SMF_SELECTION_IN_VPLMN_IN_NON_ROAMING_OR_LBO 1
|
||||
#define AMF_SMF_SELECTION_IN_VPLMN_IN_HOME_ROUTED 2
|
||||
#define AMF_SMF_SELECTION_IN_HPLMN_IN_HOME_ROUTED 3
|
||||
|
||||
int amf_ue_sbi_discover_and_send(
|
||||
ogs_sbi_service_type_e service_type,
|
||||
ogs_sbi_discovery_option_t *discovery_option,
|
||||
@@ -79,7 +87,7 @@ int amf_sess_sbi_discover_and_send(
|
||||
int amf_sess_sbi_discover_by_nsi(
|
||||
ran_ue_t *ran_ue, amf_sess_t *sess,
|
||||
ogs_sbi_service_type_e service_type,
|
||||
ogs_sbi_discovery_option_t *discovery_option);
|
||||
ogs_sbi_discovery_option_t *discovery_option, int state);
|
||||
|
||||
void amf_sbi_send_activating_session(
|
||||
ran_ue_t *ran_ue, amf_sess_t *sess, int state);
|
||||
|
@@ -877,6 +877,9 @@ bool nrf_nnrf_handle_nf_discover(
|
||||
ogs_plmn_id_mnc(
|
||||
&discovery_option->requester_plmn_list[i]));
|
||||
}
|
||||
if (discovery_option->hnrf_uri) {
|
||||
ogs_debug("hnrf_uri[%s]", discovery_option->hnrf_uri);
|
||||
}
|
||||
if (discovery_option->requester_features) {
|
||||
ogs_debug("requester-features[0x%llx]",
|
||||
(long long)discovery_option->requester_features);
|
||||
@@ -911,11 +914,12 @@ bool nrf_nnrf_handle_nf_discover(
|
||||
if (recvmsg->param.limit && i >= recvmsg->param.limit)
|
||||
break;
|
||||
|
||||
ogs_debug("[%s:%d] NF-Discovered [NF-Type:%s,NF-Status:%s,"
|
||||
"IPv4:%d,IPv6:%d]", nf_instance->id, i,
|
||||
ogs_info("[%s:%d] NF-Discovered [NF-Type:%s,NF-Status:%s,"
|
||||
"IPv4:%d,IPv6:%d,FQDN:%s]", nf_instance->id, i,
|
||||
OpenAPI_nf_type_ToString(nf_instance->nf_type),
|
||||
OpenAPI_nf_status_ToString(nf_instance->nf_status),
|
||||
nf_instance->num_of_ipv4, nf_instance->num_of_ipv6);
|
||||
nf_instance->num_of_ipv4, nf_instance->num_of_ipv6,
|
||||
nf_instance->fqdn ? nf_instance->fqdn : "NULL");
|
||||
|
||||
NFProfile = ogs_nnrf_nfm_build_nf_profile(
|
||||
nf_instance, NULL, discovery_option,
|
||||
@@ -982,6 +986,16 @@ bool nrf_nnrf_handle_nf_discover(
|
||||
nf_instance, discovery_option) == false)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* NRFs in Home PLMN are categorized into those with and without
|
||||
* hnrf-uri. Since Open5GS includes hnrf-uri in the Discovery
|
||||
* message, NRFs must be differentiated based on the presence or
|
||||
* absence of hnrf-uri, so the following match routine is used.
|
||||
*/
|
||||
if (ogs_sbi_discovery_option_hnrf_uri_is_matched(
|
||||
nf_instance, discovery_option) == false)
|
||||
continue;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1003,10 +1017,63 @@ bool nrf_nnrf_handle_nf_discover(
|
||||
nf_instance->num_of_plmn_id =
|
||||
discovery_option->num_of_target_plmn_list;
|
||||
|
||||
nf_instance->fqdn = ogs_nrf_fqdn_from_plmn_id(nf_instance->plmn_id);
|
||||
ogs_assert(nf_instance->fqdn);
|
||||
/*
|
||||
* NRFs with a Home PLMN can use the target_plmn information
|
||||
* to extract the FQDN. However, the standards documentation
|
||||
* describes hnrf-uri, so if hnrf-uri is included in discovery,
|
||||
* we implement it so that the FQDN of an NRF with a Home PLMN
|
||||
* is created using hnrf-uri.
|
||||
*/
|
||||
if (discovery_option->hnrf_uri) {
|
||||
OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL;
|
||||
char *fqdn = NULL;
|
||||
uint16_t fqdn_port = 0;
|
||||
ogs_sockaddr_t *addr = NULL, *addr6 = NULL;
|
||||
|
||||
rc = ogs_sbi_getaddr_from_uri(
|
||||
&scheme, &fqdn, &fqdn_port, &addr, &addr6,
|
||||
discovery_option->hnrf_uri);
|
||||
if (rc == false || scheme == OpenAPI_uri_scheme_NULL)
|
||||
ogs_error("Invalid URL [%s]", request->h.uri);
|
||||
else {
|
||||
/*
|
||||
* If there is an hnrf-uri, this value creates an nf-instance->fqdn,
|
||||
* which in turn creates a client->fqdn from the hnrf-uri.
|
||||
*/
|
||||
nf_instance->hnrf_uri =
|
||||
ogs_strdup(discovery_option->hnrf_uri);
|
||||
nf_instance->fqdn = ogs_strdup(fqdn);
|
||||
|
||||
ogs_free(fqdn);
|
||||
ogs_freeaddrinfo(addr);
|
||||
ogs_freeaddrinfo(addr6);
|
||||
}
|
||||
}
|
||||
|
||||
if (!nf_instance->fqdn) {
|
||||
nf_instance->fqdn =
|
||||
ogs_nrf_fqdn_from_plmn_id(nf_instance->plmn_id);
|
||||
ogs_assert(nf_instance->fqdn);
|
||||
}
|
||||
|
||||
/*
|
||||
* At this stage, the client->fqdn is set and this is
|
||||
* passed through to the Target-apiRoot to the Home PLMN.
|
||||
*
|
||||
* As mentioned above, if there is an hnrf-uri, this value creates
|
||||
* an nf-instance->fqdn, which in turn creates a client->fqdn
|
||||
* from the hnrf-uri.
|
||||
*/
|
||||
ogs_sbi_client_associate(nf_instance);
|
||||
|
||||
ogs_info("New NRF [fqdn:%s, hnrf_uri:%s]",
|
||||
nf_instance->fqdn ? nf_instance->fqdn : "NULL",
|
||||
nf_instance->hnrf_uri ? nf_instance->hnrf_uri : "NULL");
|
||||
|
||||
} else {
|
||||
ogs_info("NRF Found [fqdn:%s, hnrf_uri:%s]",
|
||||
nf_instance->fqdn ? nf_instance->fqdn : "NULL",
|
||||
nf_instance->hnrf_uri ? nf_instance->hnrf_uri : "NULL");
|
||||
}
|
||||
|
||||
client = NF_INSTANCE_CLIENT(nf_instance);
|
||||
@@ -1014,7 +1081,7 @@ bool nrf_nnrf_handle_nf_discover(
|
||||
|
||||
/*
|
||||
* TS29.510
|
||||
* 5.3.2.4 Service Discovery in a different PLMN
|
||||
* 5.3.2.2.3 Service Discovery in a different PLMN
|
||||
*
|
||||
* Then, steps 1-2 in Figure 5.3.2.2.3-1 are executed,
|
||||
* between the NRF in the Serving PLMN and the NRF in the Home PLMN.
|
||||
@@ -1022,6 +1089,7 @@ bool nrf_nnrf_handle_nf_discover(
|
||||
* in the query parameter of the URI is not required.
|
||||
*/
|
||||
discovery_option->num_of_target_plmn_list = 0;
|
||||
ogs_sbi_discovery_option_clear_hnrf_uri(discovery_option);
|
||||
|
||||
assoc = nrf_assoc_add(stream);
|
||||
if (!assoc) {
|
||||
|
@@ -24,6 +24,7 @@ static nssf_context_t self;
|
||||
int __nssf_log_domain;
|
||||
|
||||
static OGS_POOL(nssf_nsi_pool, nssf_nsi_t);
|
||||
static OGS_POOL(nssf_home_pool, nssf_home_t);
|
||||
|
||||
static int context_initialized = 0;
|
||||
|
||||
@@ -37,6 +38,7 @@ void nssf_context_init(void)
|
||||
ogs_log_install_domain(&__nssf_log_domain, "nssf", ogs_core()->log.level);
|
||||
|
||||
ogs_pool_init(&nssf_nsi_pool, ogs_app()->pool.nf);
|
||||
ogs_pool_init(&nssf_home_pool, ogs_app()->pool.nf);
|
||||
|
||||
context_initialized = 1;
|
||||
}
|
||||
@@ -46,8 +48,10 @@ void nssf_context_final(void)
|
||||
ogs_assert(context_initialized == 1);
|
||||
|
||||
nssf_nsi_remove_all();
|
||||
nssf_home_remove_all();
|
||||
|
||||
ogs_pool_final(&nssf_nsi_pool);
|
||||
ogs_pool_final(&nssf_home_pool);
|
||||
|
||||
context_initialized = 0;
|
||||
}
|
||||
@@ -339,6 +343,72 @@ nssf_nsi_t *nssf_nsi_find_by_s_nssai(ogs_s_nssai_t *s_nssai)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nssf_home_t *nssf_home_add(ogs_plmn_id_t *plmn_id, ogs_s_nssai_t *s_nssai)
|
||||
{
|
||||
nssf_home_t *home = NULL;
|
||||
|
||||
ogs_assert(plmn_id);
|
||||
ogs_assert(s_nssai);
|
||||
|
||||
ogs_pool_id_calloc(&nssf_home_pool, &home);
|
||||
if (home == NULL) {
|
||||
ogs_error("Could not allocate home context from pool");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memcpy(&home->plmn_id, plmn_id, sizeof(ogs_plmn_id_t));
|
||||
memcpy(&home->s_nssai, s_nssai, sizeof(ogs_s_nssai_t));
|
||||
|
||||
ogs_list_add(&self.home_list, home);
|
||||
|
||||
return home;
|
||||
}
|
||||
|
||||
void nssf_home_remove(nssf_home_t *home)
|
||||
{
|
||||
ogs_assert(home);
|
||||
|
||||
ogs_list_remove(&self.home_list, home);
|
||||
|
||||
if (home->nrf_id)
|
||||
ogs_free(home->nrf_id);
|
||||
|
||||
if (home->nsi_id)
|
||||
ogs_free(home->nsi_id);
|
||||
|
||||
ogs_pool_id_free(&nssf_home_pool, home);
|
||||
}
|
||||
|
||||
void nssf_home_remove_all(void)
|
||||
{
|
||||
nssf_home_t *home = NULL, *next_home = NULL;
|
||||
|
||||
ogs_list_for_each_safe(&self.home_list, next_home, home)
|
||||
nssf_home_remove(home);
|
||||
}
|
||||
|
||||
nssf_home_t *nssf_home_find(ogs_plmn_id_t *plmn_id, ogs_s_nssai_t *s_nssai)
|
||||
{
|
||||
nssf_home_t *home = NULL;
|
||||
|
||||
ogs_assert(plmn_id);
|
||||
ogs_assert(s_nssai);
|
||||
|
||||
ogs_list_for_each(&self.home_list, home) {
|
||||
if (memcmp(&home->plmn_id, plmn_id, sizeof(ogs_plmn_id_t)) == 0 &&
|
||||
memcmp(&home->s_nssai, s_nssai, sizeof(ogs_s_nssai_t)) == 0) {
|
||||
return home;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nssf_home_t *nssf_home_find_by_id(ogs_pool_id_t id)
|
||||
{
|
||||
return ogs_pool_find_by_id(&nssf_home_pool, id);
|
||||
}
|
||||
|
||||
int get_nsi_load(void)
|
||||
{
|
||||
return (((ogs_pool_size(&nssf_nsi_pool) -
|
||||
|
@@ -36,6 +36,7 @@ extern int __nssf_log_domain;
|
||||
|
||||
typedef struct nssf_context_s {
|
||||
ogs_list_t nsi_list; /* NSI List */
|
||||
ogs_list_t home_list; /* Home List for HR-Roaming*/
|
||||
} nssf_context_t;
|
||||
|
||||
void nssf_context_init(void);
|
||||
@@ -51,13 +52,34 @@ typedef struct nssf_nsi_s {
|
||||
char *nsi_id;
|
||||
|
||||
ogs_s_nssai_t s_nssai;
|
||||
OpenAPI_roaming_indication_e roaming_indication;
|
||||
|
||||
bool tai_presence;
|
||||
ogs_5gs_tai_t tai;
|
||||
} nssf_nsi_t;
|
||||
|
||||
typedef struct nssf_home_s {
|
||||
ogs_sbi_object_t sbi;
|
||||
ogs_pool_id_t id;
|
||||
|
||||
ogs_plmn_id_t plmn_id;
|
||||
ogs_s_nssai_t s_nssai;
|
||||
|
||||
char *nrf_id;
|
||||
char *nsi_id;
|
||||
} nssf_home_t;
|
||||
|
||||
nssf_nsi_t *nssf_nsi_add(char *nrf_id, uint8_t sst, ogs_uint24_t sd);
|
||||
void nssf_nsi_remove(nssf_nsi_t *nsi);
|
||||
void nssf_nsi_remove_all(void);
|
||||
nssf_nsi_t *nssf_nsi_find_by_s_nssai(ogs_s_nssai_t *s_nssai);
|
||||
|
||||
nssf_home_t *nssf_home_add(ogs_plmn_id_t *plmn_id, ogs_s_nssai_t *s_nssai);
|
||||
void nssf_home_remove(nssf_home_t *home);
|
||||
void nssf_home_remove_all(void);
|
||||
nssf_home_t *nssf_home_find(ogs_plmn_id_t *plmn_id, ogs_s_nssai_t *s_nssai);
|
||||
nssf_home_t *nssf_home_find_by_id(ogs_pool_id_t id);
|
||||
|
||||
int get_nsi_load(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -19,6 +19,9 @@ libnssf_sources = files('''
|
||||
context.c
|
||||
event.c
|
||||
|
||||
nnrf-handler.c
|
||||
|
||||
nnssf-build.c
|
||||
nnssf-handler.c
|
||||
|
||||
sbi-path.c
|
||||
|
69
src/nssf/nnrf-handler.c
Normal file
69
src/nssf/nnrf-handler.c
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "sbi-path.h"
|
||||
#include "nnrf-handler.h"
|
||||
|
||||
void nssf_nnrf_handle_nf_discover(
|
||||
ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg)
|
||||
{
|
||||
ogs_sbi_nf_instance_t *nf_instance = NULL;
|
||||
ogs_sbi_object_t *sbi_object = NULL;
|
||||
ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL;
|
||||
ogs_sbi_discovery_option_t *discovery_option = NULL;
|
||||
|
||||
OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL;
|
||||
OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL;
|
||||
OpenAPI_search_result_t *SearchResult = NULL;
|
||||
|
||||
ogs_assert(recvmsg);
|
||||
ogs_assert(xact);
|
||||
sbi_object = xact->sbi_object;
|
||||
ogs_assert(sbi_object);
|
||||
service_type = xact->service_type;
|
||||
ogs_assert(service_type);
|
||||
target_nf_type = ogs_sbi_service_type_to_nf_type(service_type);
|
||||
ogs_assert(target_nf_type);
|
||||
requester_nf_type = xact->requester_nf_type;
|
||||
ogs_assert(requester_nf_type);
|
||||
|
||||
discovery_option = xact->discovery_option;
|
||||
|
||||
SearchResult = recvmsg->SearchResult;
|
||||
if (!SearchResult) {
|
||||
ogs_error("No SearchResult");
|
||||
return;
|
||||
}
|
||||
|
||||
ogs_nnrf_disc_handle_nf_discover_search_result(SearchResult);
|
||||
|
||||
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
|
||||
target_nf_type, requester_nf_type, discovery_option);
|
||||
if (!nf_instance) {
|
||||
ogs_error("(NF discover) No [%s:%s]",
|
||||
ogs_sbi_service_type_to_name(service_type),
|
||||
OpenAPI_nf_type_ToString(requester_nf_type));
|
||||
return;
|
||||
}
|
||||
|
||||
OGS_SBI_SETUP_NF_INSTANCE(
|
||||
sbi_object->service_type_array[service_type], nf_instance);
|
||||
|
||||
ogs_expect(true == nssf_sbi_send_request(nf_instance, xact));
|
||||
}
|
36
src/nssf/nnrf-handler.h
Normal file
36
src/nssf/nnrf-handler.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2024 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 NSSF_NNRF_HANDLER_H
|
||||
#define NSSF_NNRF_HANDLER_H
|
||||
|
||||
#include "context.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void nssf_nnrf_handle_nf_discover(
|
||||
ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* NSSF_NNRF_HANDLER_H */
|
87
src/nssf/nnssf-build.c
Normal file
87
src/nssf/nnssf-build.c
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nnssf-build.h"
|
||||
|
||||
ogs_sbi_request_t *nssf_nnssf_nsselection_build_get(
|
||||
nssf_home_t *home, void *data)
|
||||
{
|
||||
ogs_sbi_message_t message;
|
||||
ogs_sbi_request_t *request = NULL;
|
||||
nssf_nnssf_nsselection_param_t *param = data;
|
||||
|
||||
ogs_assert(param);
|
||||
ogs_assert(home);
|
||||
|
||||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_GET;
|
||||
message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNSSF_NSSELECTION;
|
||||
message.h.api.version = (char *)OGS_SBI_API_V2;
|
||||
message.h.resource.component[0] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_NETWORK_SLICE_INFORMATION;
|
||||
|
||||
message.param.nf_id = NF_INSTANCE_ID(ogs_sbi_self()->nf_instance);
|
||||
if (!message.param.nf_id) {
|
||||
ogs_error("No nf-id");
|
||||
goto end;
|
||||
}
|
||||
message.param.nf_type = NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance);
|
||||
if (!message.param.nf_type) {
|
||||
ogs_error("No nf-type");
|
||||
goto end;
|
||||
}
|
||||
|
||||
message.param.slice_info_for_pdu_session_presence =
|
||||
param->slice_info_for_pdu_session.presence;
|
||||
|
||||
if (!message.param.slice_info_for_pdu_session_presence) {
|
||||
ogs_error("No sliceInfoForPDUSession");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!param->slice_info_for_pdu_session.snssai) {
|
||||
ogs_error("No sNssai");
|
||||
goto end;
|
||||
}
|
||||
|
||||
message.param.snssai_presence = true;
|
||||
memcpy(&message.param.s_nssai,
|
||||
param->slice_info_for_pdu_session.snssai,
|
||||
sizeof(message.param.s_nssai));
|
||||
|
||||
message.param.roaming_indication =
|
||||
param->slice_info_for_pdu_session.roaming_indication;
|
||||
|
||||
if (!message.param.roaming_indication) {
|
||||
ogs_error("No roamingIndication");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (param->tai) {
|
||||
message.param.tai_presence = true;
|
||||
memcpy(&message.param.tai, param->tai, sizeof(message.param.tai));
|
||||
}
|
||||
|
||||
request = ogs_sbi_build_request(&message);
|
||||
ogs_expect(request);
|
||||
|
||||
end:
|
||||
|
||||
return request;
|
||||
}
|
45
src/nssf/nnssf-build.h
Normal file
45
src/nssf/nnssf-build.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2024 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 AMF_NNSSF_BUILD_H
|
||||
#define AMF_NNSSF_BUILD_H
|
||||
|
||||
#include "context.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct nssf_nnssf_nsselection_param_s {
|
||||
struct {
|
||||
bool presence;
|
||||
ogs_s_nssai_t *snssai;
|
||||
OpenAPI_roaming_indication_e roaming_indication;
|
||||
} slice_info_for_pdu_session;
|
||||
ogs_5gs_tai_t *tai;
|
||||
} nssf_nnssf_nsselection_param_t;
|
||||
|
||||
ogs_sbi_request_t *nssf_nnssf_nsselection_build_get(
|
||||
nssf_home_t *home, void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AMF_NNSSF_BUILD_H */
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "nnrf-handler.h"
|
||||
#include "nnssf-handler.h"
|
||||
|
||||
bool nssf_nnrf_nsselection_handle_get(
|
||||
bool nssf_nnrf_nsselection_handle_get_from_amf_or_vnssf(
|
||||
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg)
|
||||
{
|
||||
int status = OGS_SBI_HTTP_STATUS_OK;
|
||||
@@ -50,12 +50,24 @@ bool nssf_nnrf_nsselection_handle_get(
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!recvmsg->param.slice_info_request_for_pdu_session_presence) {
|
||||
if (!recvmsg->param.slice_info_for_pdu_session_presence) {
|
||||
status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
|
||||
strerror = ogs_msprintf("Not implemented except PDU session");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!recvmsg->param.snssai_presence) {
|
||||
status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
|
||||
strerror = ogs_msprintf("No sNssai");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!recvmsg->param.roaming_indication) {
|
||||
status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
|
||||
strerror = ogs_msprintf("No roamingIndication");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
nsi = nssf_nsi_find_by_s_nssai(&recvmsg->param.s_nssai);
|
||||
if (!nsi) {
|
||||
status = OGS_SBI_HTTP_STATUS_FORBIDDEN;
|
||||
@@ -64,9 +76,76 @@ bool nssf_nnrf_nsselection_handle_get(
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
nsi->roaming_indication = recvmsg->param.roaming_indication;
|
||||
|
||||
if (recvmsg->param.tai_presence) {
|
||||
nsi->tai_presence = true;
|
||||
memcpy(&nsi->tai, &recvmsg->param.tai, sizeof(nsi->tai));
|
||||
}
|
||||
|
||||
memset(&NsiInformation, 0, sizeof(NsiInformation));
|
||||
NsiInformation.nrf_id = nsi->nrf_id;
|
||||
NsiInformation.nsi_id = nsi->nsi_id;
|
||||
|
||||
if (recvmsg->param.home_plmn_id_presence &&
|
||||
recvmsg->param.home_snssai_presence) {
|
||||
nssf_home_t *home = nssf_home_find(
|
||||
&recvmsg->param.home_plmn_id, &recvmsg->param.home_snssai);
|
||||
if (!home) {
|
||||
int r, i;
|
||||
nssf_nnssf_nsselection_param_t param;
|
||||
ogs_sbi_discovery_option_t *h_discovery_option = NULL;
|
||||
|
||||
home = nssf_home_add(
|
||||
&recvmsg->param.home_plmn_id, &recvmsg->param.home_snssai);
|
||||
if (!home) {
|
||||
status = OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR;
|
||||
strerror = ogs_msprintf("Cannot allocate Home Network "
|
||||
"by PLMN-ID(0x%x) S-NSSAI[SST:%d SD:0x%x]",
|
||||
ogs_plmn_id_hexdump(&recvmsg->param.home_plmn_id),
|
||||
recvmsg->param.home_snssai.sst,
|
||||
recvmsg->param.home_snssai.sd.v);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
h_discovery_option = ogs_sbi_discovery_option_new();
|
||||
ogs_assert(h_discovery_option);
|
||||
|
||||
ogs_sbi_discovery_option_add_snssais(
|
||||
h_discovery_option, &home->s_nssai);
|
||||
ogs_sbi_discovery_option_add_target_plmn_list(
|
||||
h_discovery_option, &home->plmn_id);
|
||||
ogs_assert(ogs_local_conf()->num_of_serving_plmn_id);
|
||||
for (i = 0; i < ogs_local_conf()->num_of_serving_plmn_id; i++) {
|
||||
ogs_sbi_discovery_option_add_requester_plmn_list(
|
||||
h_discovery_option,
|
||||
&ogs_local_conf()->serving_plmn_id[i]);
|
||||
}
|
||||
|
||||
memset(¶m, 0, sizeof(param));
|
||||
param.slice_info_for_pdu_session.presence = true;
|
||||
param.slice_info_for_pdu_session.snssai = &home->s_nssai;
|
||||
param.slice_info_for_pdu_session.roaming_indication =
|
||||
nsi->roaming_indication;
|
||||
|
||||
if (nsi->tai_presence) param.tai = &nsi->tai;
|
||||
|
||||
r = nssf_sbi_discover_and_send(
|
||||
OGS_SBI_SERVICE_TYPE_NNSSF_NSSELECTION, h_discovery_option,
|
||||
nssf_nnssf_nsselection_build_get,
|
||||
home, stream, ¶m);
|
||||
ogs_expect(r == OGS_OK);
|
||||
ogs_assert(r != OGS_ERROR);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Home Network */
|
||||
NsiInformation.nrf_id = home->nrf_id;
|
||||
NsiInformation.nsi_id = home->nsi_id;
|
||||
} else {
|
||||
/* Serving Network */
|
||||
NsiInformation.nrf_id = nsi->nrf_id;
|
||||
NsiInformation.nsi_id = nsi->nsi_id;
|
||||
}
|
||||
|
||||
memset(&AuthorizedNetworkSliceInfo, 0, sizeof(AuthorizedNetworkSliceInfo));
|
||||
AuthorizedNetworkSliceInfo.nsi_information = &NsiInformation;
|
||||
@@ -90,3 +169,78 @@ cleanup:
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool nssf_nnrf_nsselection_handle_get_from_hnssf(
|
||||
nssf_home_t *home,
|
||||
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg)
|
||||
{
|
||||
int status = OGS_SBI_HTTP_STATUS_OK;
|
||||
char *strerror = NULL;
|
||||
|
||||
OpenAPI_authorized_network_slice_info_t *AuthorizedNetworkSliceInfo = NULL;
|
||||
OpenAPI_nsi_information_t *NsiInformation = NULL;
|
||||
|
||||
ogs_sbi_message_t sendmsg;
|
||||
ogs_sbi_response_t *response = NULL;
|
||||
|
||||
ogs_assert(home);
|
||||
ogs_assert(stream);
|
||||
ogs_assert(recvmsg);
|
||||
|
||||
if (recvmsg->res_status != OGS_SBI_HTTP_STATUS_OK) {
|
||||
status = recvmsg->res_status;
|
||||
strerror = ogs_msprintf("HTTP response error [%d]",
|
||||
recvmsg->res_status);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
AuthorizedNetworkSliceInfo = recvmsg->AuthorizedNetworkSliceInfo;
|
||||
if (!AuthorizedNetworkSliceInfo) {
|
||||
status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
|
||||
strerror = ogs_msprintf("No AuthorizedNetworkSliceInfo");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
NsiInformation = AuthorizedNetworkSliceInfo->nsi_information;
|
||||
if (!NsiInformation) {
|
||||
status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
|
||||
strerror = ogs_msprintf("No NsiInformation");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!NsiInformation->nrf_id) {
|
||||
status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
|
||||
strerror = ogs_msprintf("No nrfId");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!NsiInformation->nsi_id) {
|
||||
status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
|
||||
strerror = ogs_msprintf("No nsiId");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
home->nrf_id = ogs_strdup(NsiInformation->nrf_id);
|
||||
ogs_assert(home->nrf_id);
|
||||
home->nsi_id = ogs_strdup(NsiInformation->nsi_id);
|
||||
ogs_assert(home->nsi_id);
|
||||
|
||||
memset(&sendmsg, 0, sizeof(sendmsg));
|
||||
sendmsg.AuthorizedNetworkSliceInfo = AuthorizedNetworkSliceInfo;
|
||||
|
||||
response = ogs_sbi_build_response(&sendmsg, OGS_SBI_HTTP_STATUS_OK);
|
||||
ogs_assert(response);
|
||||
ogs_assert(true == ogs_sbi_server_send_response(stream, response));
|
||||
|
||||
return true;
|
||||
|
||||
cleanup:
|
||||
ogs_assert(strerror);
|
||||
|
||||
ogs_error("%s", strerror);
|
||||
ogs_sbi_server_send_error(stream, status, recvmsg, strerror, NULL,
|
||||
NULL);
|
||||
ogs_free(strerror);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -26,7 +26,10 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
bool nssf_nnrf_nsselection_handle_get(
|
||||
bool nssf_nnrf_nsselection_handle_get_from_amf_or_vnssf(
|
||||
ogs_sbi_stream_t *stream, ogs_sbi_message_t *message);
|
||||
bool nssf_nnrf_nsselection_handle_get_from_hnssf(
|
||||
nssf_home_t *home,
|
||||
ogs_sbi_stream_t *stream, ogs_sbi_message_t *message);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -46,6 +46,12 @@ void nssf_state_operational(ogs_fsm_t *s, nssf_event_t *e)
|
||||
ogs_pool_id_t stream_id = OGS_INVALID_POOL_ID;
|
||||
ogs_sbi_request_t *request = NULL;
|
||||
|
||||
nssf_home_t *home = NULL;
|
||||
|
||||
ogs_pool_id_t sbi_object_id = OGS_INVALID_POOL_ID;
|
||||
ogs_sbi_xact_t *sbi_xact = NULL;
|
||||
ogs_pool_id_t sbi_xact_id = OGS_INVALID_POOL_ID;
|
||||
|
||||
ogs_sbi_nf_instance_t *nf_instance = NULL;
|
||||
ogs_sbi_subscription_data_t *subscription_data = NULL;
|
||||
ogs_sbi_response_t *response = NULL;
|
||||
@@ -141,7 +147,8 @@ void nssf_state_operational(ogs_fsm_t *s, nssf_event_t *e)
|
||||
CASE(OGS_SBI_RESOURCE_NAME_NETWORK_SLICE_INFORMATION)
|
||||
SWITCH(message.h.method)
|
||||
CASE(OGS_SBI_HTTP_METHOD_GET)
|
||||
nssf_nnrf_nsselection_handle_get(stream, &message);
|
||||
nssf_nnrf_nsselection_handle_get_from_amf_or_vnssf(
|
||||
stream, &message);
|
||||
break;
|
||||
|
||||
DEFAULT
|
||||
@@ -191,7 +198,16 @@ void nssf_state_operational(ogs_fsm_t *s, nssf_event_t *e)
|
||||
break;
|
||||
}
|
||||
|
||||
if (strcmp(message.h.api.version, OGS_SBI_API_V1) != 0) {
|
||||
SWITCH(message.h.service.name)
|
||||
CASE(OGS_SBI_SERVICE_NAME_NNSSF_NSSELECTION)
|
||||
api_version = OGS_SBI_API_V2;
|
||||
break;
|
||||
DEFAULT
|
||||
api_version = OGS_SBI_API_V1;
|
||||
END
|
||||
|
||||
ogs_assert(api_version);
|
||||
if (strcmp(message.h.api.version, api_version) != 0) {
|
||||
ogs_error("Not supported version [%s]", message.h.api.version);
|
||||
ogs_sbi_message_free(&message);
|
||||
ogs_sbi_response_free(response);
|
||||
@@ -266,6 +282,80 @@ void nssf_state_operational(ogs_fsm_t *s, nssf_event_t *e)
|
||||
END
|
||||
break;
|
||||
|
||||
CASE(OGS_SBI_SERVICE_NAME_NNRF_DISC)
|
||||
SWITCH(message.h.resource.component[0])
|
||||
CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES)
|
||||
sbi_xact_id = OGS_POINTER_TO_UINT(e->h.sbi.data);
|
||||
ogs_assert(sbi_xact_id >= OGS_MIN_POOL_ID &&
|
||||
sbi_xact_id <= OGS_MAX_POOL_ID);
|
||||
|
||||
sbi_xact = ogs_sbi_xact_find_by_id(sbi_xact_id);
|
||||
if (!sbi_xact) {
|
||||
/* CLIENT_WAIT timer could remove SBI transaction
|
||||
* before receiving SBI message */
|
||||
ogs_error("SBI transaction has already been removed [%d]",
|
||||
sbi_xact_id);
|
||||
break;
|
||||
}
|
||||
|
||||
SWITCH(message.h.method)
|
||||
CASE(OGS_SBI_HTTP_METHOD_GET)
|
||||
if (message.res_status == OGS_SBI_HTTP_STATUS_OK)
|
||||
nssf_nnrf_handle_nf_discover(sbi_xact, &message);
|
||||
else
|
||||
ogs_error("HTTP response error [%d]",
|
||||
message.res_status);
|
||||
break;
|
||||
|
||||
DEFAULT
|
||||
ogs_error("Invalid HTTP method [%s]", message.h.method);
|
||||
ogs_assert_if_reached();
|
||||
END
|
||||
break;
|
||||
|
||||
DEFAULT
|
||||
ogs_error("Invalid resource name [%s]",
|
||||
message.h.resource.component[0]);
|
||||
ogs_assert_if_reached();
|
||||
END
|
||||
break;
|
||||
|
||||
CASE(OGS_SBI_SERVICE_NAME_NNSSF_NSSELECTION)
|
||||
sbi_xact_id = OGS_POINTER_TO_UINT(e->h.sbi.data);
|
||||
ogs_assert(sbi_xact_id >= OGS_MIN_POOL_ID &&
|
||||
sbi_xact_id <= OGS_MAX_POOL_ID);
|
||||
|
||||
sbi_xact = ogs_sbi_xact_find_by_id(sbi_xact_id);
|
||||
if (!sbi_xact) {
|
||||
/* CLIENT_WAIT timer could remove SBI transaction
|
||||
* before receiving SBI message */
|
||||
ogs_error("SBI transaction has already been removed [%d]",
|
||||
sbi_xact_id);
|
||||
break;
|
||||
}
|
||||
|
||||
sbi_object_id = sbi_xact->sbi_object_id;
|
||||
ogs_assert(sbi_object_id >= OGS_MIN_POOL_ID &&
|
||||
sbi_object_id <= OGS_MAX_POOL_ID);
|
||||
|
||||
ogs_assert(sbi_xact->assoc_stream_id >= OGS_MIN_POOL_ID &&
|
||||
sbi_xact->assoc_stream_id <= OGS_MAX_POOL_ID);
|
||||
stream = ogs_sbi_stream_find_by_id(sbi_xact->assoc_stream_id);
|
||||
|
||||
ogs_sbi_xact_remove(sbi_xact);
|
||||
|
||||
home = nssf_home_find_by_id(sbi_object_id);
|
||||
if (!home) {
|
||||
ogs_error("Home Network Context has already been removed");
|
||||
break;
|
||||
}
|
||||
|
||||
e->h.sbi.message = &message;;
|
||||
|
||||
nssf_nnrf_nsselection_handle_get_from_hnssf(home, stream, &message);
|
||||
break;
|
||||
|
||||
|
||||
DEFAULT
|
||||
ogs_error("Invalid API name [%s]", message.h.service.name);
|
||||
ogs_assert_if_reached();
|
||||
@@ -323,6 +413,64 @@ void nssf_state_operational(ogs_fsm_t *s, nssf_event_t *e)
|
||||
subscription_data->id);
|
||||
break;
|
||||
|
||||
case OGS_TIMER_SBI_CLIENT_WAIT:
|
||||
/*
|
||||
* ogs_pollset_poll() receives the time of the expiration
|
||||
* of next timer as an argument. If this timeout is
|
||||
* in very near future (1 millisecond), and if there are
|
||||
* multiple events that need to be processed by ogs_pollset_poll(),
|
||||
* these could take more than 1 millisecond for processing,
|
||||
* resulting in the timer already passed the expiration.
|
||||
*
|
||||
* In case that another NF is under heavy load and responds
|
||||
* to an SBI request with some delay of a few seconds,
|
||||
* it can happen that ogs_pollset_poll() adds SBI responses
|
||||
* to the event list for further processing,
|
||||
* then ogs_timer_mgr_expire() is called which will add
|
||||
* an additional event for timer expiration. When all events are
|
||||
* processed one-by-one, the SBI xact would get deleted twice
|
||||
* in a row, resulting in a crash.
|
||||
*
|
||||
* 1. ogs_pollset_poll()
|
||||
* message was received and put into an event list,
|
||||
* 2. ogs_timer_mgr_expire()
|
||||
* add an additional event for timer expiration
|
||||
* 3. message event is processed. (free SBI xact)
|
||||
* 4. timer expiration event is processed. (double-free SBI xact)
|
||||
*
|
||||
* To avoid double-free SBI xact,
|
||||
* we need to check ogs_sbi_xact_find_by_id()
|
||||
*/
|
||||
sbi_xact_id = OGS_POINTER_TO_UINT(e->h.sbi.data);
|
||||
ogs_assert(sbi_xact_id >= OGS_MIN_POOL_ID &&
|
||||
sbi_xact_id <= OGS_MAX_POOL_ID);
|
||||
|
||||
sbi_xact = ogs_sbi_xact_find_by_id(sbi_xact_id);
|
||||
if (!sbi_xact) {
|
||||
ogs_error("SBI transaction has already been removed [%d]",
|
||||
sbi_xact_id);
|
||||
break;
|
||||
}
|
||||
|
||||
ogs_assert(sbi_xact->assoc_stream_id >= OGS_MIN_POOL_ID &&
|
||||
sbi_xact->assoc_stream_id <= OGS_MAX_POOL_ID);
|
||||
stream = ogs_sbi_stream_find_by_id(sbi_xact->assoc_stream_id);
|
||||
|
||||
ogs_sbi_xact_remove(sbi_xact);
|
||||
|
||||
ogs_error("Cannot receive SBI message");
|
||||
|
||||
if (!stream) {
|
||||
ogs_error("STREAM has alreadt been removed [%d]",
|
||||
sbi_xact->assoc_stream_id);
|
||||
break;
|
||||
}
|
||||
ogs_assert(true ==
|
||||
ogs_sbi_server_send_error(stream,
|
||||
OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL,
|
||||
"Cannot receive SBI message", NULL, NULL));
|
||||
break;
|
||||
|
||||
default:
|
||||
ogs_error("Unknown timer[%s:%d]",
|
||||
ogs_timer_get_name(e->h.timer_id), e->h.timer_id);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -33,6 +33,7 @@ int nssf_sbi_open(void)
|
||||
ogs_sbi_nf_instance_build_default(nf_instance);
|
||||
ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_SCP);
|
||||
ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_AMF);
|
||||
ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_NSSF);
|
||||
|
||||
/* Build NF service information. It will be transmitted to NRF. */
|
||||
if (ogs_sbi_nf_service_is_available(
|
||||
@@ -43,6 +44,7 @@ int nssf_sbi_open(void)
|
||||
ogs_sbi_nf_service_add_version(
|
||||
service, OGS_SBI_API_V2, OGS_SBI_API_V2_0_0, NULL);
|
||||
ogs_sbi_nf_service_add_allowed_nf_type(service, OpenAPI_nf_type_AMF);
|
||||
ogs_sbi_nf_service_add_allowed_nf_type(service, OpenAPI_nf_type_NSSF);
|
||||
}
|
||||
|
||||
/* Initialize NRF NF Instance */
|
||||
@@ -64,3 +66,57 @@ void nssf_sbi_close(void)
|
||||
ogs_sbi_client_stop_all();
|
||||
ogs_sbi_server_stop_all();
|
||||
}
|
||||
|
||||
bool nssf_sbi_send_request(
|
||||
ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact)
|
||||
{
|
||||
ogs_assert(nf_instance);
|
||||
ogs_assert(xact);
|
||||
return ogs_sbi_send_request_to_nf_instance(nf_instance, xact);
|
||||
}
|
||||
|
||||
int nssf_sbi_discover_and_send(
|
||||
ogs_sbi_service_type_e service_type,
|
||||
ogs_sbi_discovery_option_t *discovery_option,
|
||||
ogs_sbi_request_t *(*build)(nssf_home_t *home, void *data),
|
||||
nssf_home_t *home, ogs_sbi_stream_t *stream, void *data)
|
||||
{
|
||||
ogs_sbi_xact_t *xact = NULL;
|
||||
int r;
|
||||
|
||||
ogs_assert(service_type);
|
||||
ogs_assert(home);
|
||||
ogs_assert(stream);
|
||||
ogs_assert(build);
|
||||
|
||||
ogs_assert(home->id >= OGS_MIN_POOL_ID && home->id <= OGS_MAX_POOL_ID);
|
||||
|
||||
xact = ogs_sbi_xact_add(
|
||||
home->id, &home->sbi, service_type, discovery_option,
|
||||
(ogs_sbi_build_f)build, home, data);
|
||||
if (!xact) {
|
||||
ogs_error("nssf_sbi_discover_and_send() failed");
|
||||
ogs_assert(true ==
|
||||
ogs_sbi_server_send_error(stream,
|
||||
OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL,
|
||||
"Cannot discover", NULL, NULL));
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
xact->assoc_stream_id = ogs_sbi_id_from_stream(stream);
|
||||
ogs_assert(xact->assoc_stream_id >= OGS_MIN_POOL_ID &&
|
||||
xact->assoc_stream_id <= OGS_MAX_POOL_ID);
|
||||
|
||||
r = ogs_sbi_discover_and_send(xact);
|
||||
if (r != OGS_OK) {
|
||||
ogs_error("nssf_sbi_discover_and_send() failed");
|
||||
ogs_sbi_xact_remove(xact);
|
||||
ogs_assert(true ==
|
||||
ogs_sbi_server_send_error(stream,
|
||||
OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT, NULL,
|
||||
"Cannot discover", NULL, NULL));
|
||||
return r;
|
||||
}
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
@@ -21,6 +21,7 @@
|
||||
#define NSSF_SBI_PATH_H
|
||||
|
||||
#include "context.h"
|
||||
#include "nnssf-build.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -29,6 +30,14 @@ extern "C" {
|
||||
int nssf_sbi_open(void);
|
||||
void nssf_sbi_close(void);
|
||||
|
||||
bool nssf_sbi_send_request(
|
||||
ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact);
|
||||
int nssf_sbi_discover_and_send(
|
||||
ogs_sbi_service_type_e service_type,
|
||||
ogs_sbi_discovery_option_t *discovery_option,
|
||||
ogs_sbi_request_t *(*build)(nssf_home_t *home, void *data),
|
||||
nssf_home_t *home, ogs_sbi_stream_t *stream, void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -251,6 +251,8 @@ static int request_handler(ogs_sbi_request_t *request, void *data)
|
||||
discovery_option->num_of_target_plmn_list =
|
||||
ogs_sbi_discovery_option_parse_plmn_list(
|
||||
discovery_option->target_plmn_list, val);
|
||||
} else if (!strcasecmp(key, OGS_SBI_CUSTOM_DISCOVERY_HNRF_URI)) {
|
||||
ogs_sbi_discovery_option_set_hnrf_uri(discovery_option, val);
|
||||
} else if (!strcasecmp(key,
|
||||
OGS_SBI_CUSTOM_DISCOVERY_REQUESTER_PLMN_LIST)) {
|
||||
if (val)
|
||||
|
@@ -1777,6 +1777,8 @@ void smf_sess_remove(smf_sess_t *sess)
|
||||
if (sess->handover.upf_dl_addr6)
|
||||
ogs_freeaddrinfo(sess->handover.upf_dl_addr6);
|
||||
|
||||
if (sess->h_smf_uri)
|
||||
ogs_free(sess->h_smf_uri);
|
||||
if (sess->pcf_id)
|
||||
ogs_free(sess->pcf_id);
|
||||
if (sess->serving_nf_id)
|
||||
|
@@ -333,6 +333,9 @@ typedef struct smf_sess_s {
|
||||
ogs_nr_cgi_t nr_cgi;
|
||||
ogs_time_t ue_location_timestamp;
|
||||
|
||||
/* H-SMF URI */
|
||||
char *h_smf_uri;
|
||||
|
||||
/* PCF ID */
|
||||
char *pcf_id;
|
||||
|
||||
@@ -363,6 +366,9 @@ typedef struct smf_sess_s {
|
||||
ogs_pfcp_ue_ip_t *ipv4;
|
||||
ogs_pfcp_ue_ip_t *ipv6;
|
||||
|
||||
/* AN Type */
|
||||
OpenAPI_access_type_e an_type;
|
||||
|
||||
/* RAT Type */
|
||||
uint8_t gtp_rat_type;
|
||||
OpenAPI_rat_type_e sbi_rat_type;
|
||||
|
@@ -54,6 +54,7 @@ libsmf_sources = files('''
|
||||
nnrf-handler.h
|
||||
nudm-build.h
|
||||
nudm-handler.h
|
||||
nsmf-build.h
|
||||
nsmf-handler.h
|
||||
namf-build.h
|
||||
namf-handler.h
|
||||
@@ -93,6 +94,7 @@ libsmf_sources = files('''
|
||||
nnrf-handler.c
|
||||
nudm-build.c
|
||||
nudm-handler.c
|
||||
nsmf-build.c
|
||||
nsmf-handler.c
|
||||
namf-build.c
|
||||
namf-handler.c
|
||||
|
261
src/smf/nsmf-build.c
Normal file
261
src/smf/nsmf-build.c
Normal file
@@ -0,0 +1,261 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2024 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nsmf-build.h"
|
||||
|
||||
ogs_sbi_request_t *smf_nsmf_pdusession_build_create_sm_context(
|
||||
smf_sess_t *sess, void *data)
|
||||
{
|
||||
ogs_sbi_message_t message;
|
||||
ogs_sbi_request_t *request = NULL;
|
||||
|
||||
ogs_sbi_server_t *server = NULL;
|
||||
ogs_sbi_header_t header;
|
||||
|
||||
smf_ue_t *smf_ue = NULL;
|
||||
|
||||
OpenAPI_sm_context_create_data_t SmContextCreateData;
|
||||
OpenAPI_snssai_t sNssai;
|
||||
OpenAPI_snssai_t hplmnSnssai;
|
||||
OpenAPI_ref_to_binary_data_t n1SmMsg;
|
||||
OpenAPI_user_location_t ueLocation;
|
||||
#if 0 /* Needs to be checked against AMF's nsmf-builc.c */
|
||||
ogs_sbi_nf_instance_t *pcf_nf_instance = NULL;
|
||||
#endif
|
||||
|
||||
ogs_assert(sess);
|
||||
smf_ue = smf_ue_find_by_id(sess->smf_ue_id);
|
||||
ogs_assert(smf_ue);
|
||||
|
||||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST;
|
||||
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;
|
||||
|
||||
memset(&SmContextCreateData, 0, sizeof(SmContextCreateData));
|
||||
memset(&sNssai, 0, sizeof(sNssai));
|
||||
memset(&hplmnSnssai, 0, sizeof(hplmnSnssai));
|
||||
memset(&header, 0, sizeof(header));
|
||||
memset(&ueLocation, 0, sizeof(ueLocation));
|
||||
|
||||
SmContextCreateData.serving_nf_id =
|
||||
NF_INSTANCE_ID(ogs_sbi_self()->nf_instance);
|
||||
if (!SmContextCreateData.serving_nf_id) {
|
||||
ogs_error("No serving_nf_id");
|
||||
goto end;
|
||||
}
|
||||
|
||||
SmContextCreateData.serving_network =
|
||||
ogs_sbi_build_plmn_id_nid(&sess->nr_tai.plmn_id);
|
||||
if (!SmContextCreateData.serving_network) {
|
||||
ogs_error("No serving_network");
|
||||
goto end;
|
||||
}
|
||||
|
||||
SmContextCreateData.supi = smf_ue->supi;
|
||||
#if 0 /* Needs to be checked against AMF's nsmf-builc.c */
|
||||
SmContextCreateData.pei = smf_ue->pei;
|
||||
#endif
|
||||
if (smf_ue->msisdn_len) {
|
||||
SmContextCreateData.gpsi = ogs_msprintf("%s-%s",
|
||||
OGS_ID_GPSI_TYPE_MSISDN, smf_ue->msisdn_bcd);
|
||||
}
|
||||
SmContextCreateData.is_pdu_session_id = true;
|
||||
SmContextCreateData.pdu_session_id = sess->psi;
|
||||
if (!SmContextCreateData.pdu_session_id) {
|
||||
ogs_error("No pdu_session_id");
|
||||
goto end;
|
||||
}
|
||||
|
||||
/*
|
||||
* TS29.502
|
||||
* 6.1 Nsmf_PDUSession Service API
|
||||
* Table 6.1.6.2.2-1: Definition of type SmContextCreateData
|
||||
*
|
||||
* NAME: dnn
|
||||
* Data type: Dnn
|
||||
* P: C
|
||||
* Cardinality: 0..1
|
||||
*
|
||||
* This IE shall be present, except during an EPS to 5GS Idle mode mobility
|
||||
* or handover using the N26 interface.
|
||||
*
|
||||
* When present, it shall contain the requested DNN; the DNN shall
|
||||
* be the full DNN (i.e. with both the Network Identifier and
|
||||
* Operator Identifier) for a HR PDU session, and it should be
|
||||
* the full DNN in LBO and non-roaming scenarios. If the Operator Identifier
|
||||
* is absent, the serving core network operator shall be assumed.
|
||||
*/
|
||||
if (ogs_sbi_plmn_id_in_vplmn(&sess->home_plmn_id) == true) {
|
||||
SmContextCreateData.dnn = sess->full_dnn;
|
||||
} else {
|
||||
SmContextCreateData.dnn = sess->session.name;
|
||||
|
||||
}
|
||||
|
||||
sNssai.sst = sess->s_nssai.sst;
|
||||
sNssai.sd = ogs_s_nssai_sd_to_string(sess->s_nssai.sd);
|
||||
SmContextCreateData.s_nssai = &sNssai;
|
||||
|
||||
if (sess->mapped_hplmn.sst) {
|
||||
hplmnSnssai.sst = sess->mapped_hplmn.sst;
|
||||
hplmnSnssai.sd = ogs_s_nssai_sd_to_string(sess->mapped_hplmn.sd);
|
||||
SmContextCreateData.hplmn_snssai = &hplmnSnssai;
|
||||
}
|
||||
|
||||
#if 0 /* Needs to be checked against AMF's nsmf-builc.c */
|
||||
SmContextCreateData.guami = ogs_sbi_build_guami(amf_ue->guami);
|
||||
if (!SmContextCreateData.guami) {
|
||||
ogs_error("No guami");
|
||||
goto end;
|
||||
}
|
||||
#endif
|
||||
|
||||
header.service.name = (char *)OGS_SBI_SERVICE_NAME_NAMF_CALLBACK;
|
||||
header.api.version = (char *)OGS_SBI_API_V1;
|
||||
header.resource.component[0] = smf_ue->supi;
|
||||
header.resource.component[1] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_SM_CONTEXT_STATUS;
|
||||
header.resource.component[2] = ogs_msprintf("%d", sess->psi);
|
||||
if (!header.resource.component[2]) {
|
||||
ogs_error("No header.resource.component[2]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
server = ogs_sbi_server_first();
|
||||
if (!server) {
|
||||
ogs_error("No server");
|
||||
goto end;
|
||||
}
|
||||
SmContextCreateData.sm_context_status_uri =
|
||||
ogs_sbi_server_uri(server, &header);
|
||||
|
||||
n1SmMsg.content_id = (char *)OGS_SBI_CONTENT_5GNAS_SM_ID;
|
||||
SmContextCreateData.n1_sm_msg = &n1SmMsg;
|
||||
|
||||
SmContextCreateData.an_type = sess->an_type;
|
||||
SmContextCreateData.rat_type = sess->sbi_rat_type;
|
||||
|
||||
ueLocation.nr_location = ogs_sbi_build_nr_location(
|
||||
&sess->nr_tai, &sess->nr_cgi);
|
||||
if (!ueLocation.nr_location) {
|
||||
ogs_error("No ueLocation.nr_location");
|
||||
goto end;
|
||||
}
|
||||
ueLocation.nr_location->ue_location_timestamp =
|
||||
ogs_sbi_gmtime_string(sess->ue_location_timestamp);
|
||||
if (!ueLocation.nr_location->ue_location_timestamp) {
|
||||
ogs_error("No ue_location_timestamp");
|
||||
goto end;
|
||||
}
|
||||
|
||||
SmContextCreateData.ue_location = &ueLocation;
|
||||
SmContextCreateData.ue_time_zone = ogs_sbi_timezone_string(ogs_timezone());
|
||||
if (!SmContextCreateData.ue_time_zone) {
|
||||
ogs_error("No ue_time_zone");
|
||||
goto end;
|
||||
}
|
||||
|
||||
/*
|
||||
* We're experiencing an issue after changing SearchResult.validityTime
|
||||
* from 3600 seconds to 30 seconds. (#3210)
|
||||
*
|
||||
* When AMF finds a PCF through Discovery, it can be deleted
|
||||
* after 30 seconds by ValidityTime.
|
||||
*
|
||||
* We have changed our implementation to not send the PCF-ID in this case.
|
||||
*
|
||||
* What we need to do is proactively add a part that will re-discover
|
||||
* the PCF when a situation arises where we really need the PCF-ID.
|
||||
*/
|
||||
#if 0 /* Needs to be checked against AMF's nsmf-builc.c */
|
||||
pcf_nf_instance = OGS_SBI_GET_NF_INSTANCE(
|
||||
amf_ue->sbi.service_type_array[
|
||||
OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL]);
|
||||
if (pcf_nf_instance)
|
||||
SmContextCreateData.pcf_id = pcf_nf_instance->id;
|
||||
else
|
||||
ogs_error("No pcf_nf_instance");
|
||||
#endif
|
||||
|
||||
message.SmContextCreateData = &SmContextCreateData;
|
||||
|
||||
#if 0 /* Needs to be checked against AMF's nsmf-builc.c */
|
||||
message.part[message.num_of_part].pkbuf = sess->payload_container;
|
||||
if (message.part[message.num_of_part].pkbuf) {
|
||||
message.part[message.num_of_part].content_id =
|
||||
(char *)OGS_SBI_CONTENT_5GNAS_SM_ID;
|
||||
message.part[message.num_of_part].content_type =
|
||||
(char *)OGS_SBI_CONTENT_5GNAS_TYPE;
|
||||
message.num_of_part++;
|
||||
}
|
||||
#endif
|
||||
|
||||
message.http.accept = (char *)(OGS_SBI_CONTENT_JSON_TYPE ","
|
||||
OGS_SBI_CONTENT_NGAP_TYPE "," OGS_SBI_CONTENT_PROBLEM_TYPE);
|
||||
|
||||
message.http.custom.callback =
|
||||
(char *)OGS_SBI_CALLBACK_NSMF_PDUSESSION_STATUS_NOTIFY;
|
||||
|
||||
#if 0 /* Needs to be checked against AMF's nsmf-builc.c */
|
||||
if (param && param->nrf_uri) {
|
||||
message.http.custom.nrf_uri =
|
||||
ogs_msprintf("%s: \"%s\"",
|
||||
OGS_SBI_SERVICE_NAME_NNRF_DISC, param->nrf_uri);
|
||||
}
|
||||
#endif
|
||||
|
||||
request = ogs_sbi_build_request(&message);
|
||||
ogs_expect(request);
|
||||
|
||||
end:
|
||||
if (SmContextCreateData.serving_network)
|
||||
ogs_sbi_free_plmn_id_nid(SmContextCreateData.serving_network);
|
||||
if (SmContextCreateData.dnn)
|
||||
ogs_free(SmContextCreateData.dnn);
|
||||
if (SmContextCreateData.sm_context_status_uri)
|
||||
ogs_free(SmContextCreateData.sm_context_status_uri);
|
||||
if (header.resource.component[2])
|
||||
ogs_free(header.resource.component[2]);
|
||||
if (sNssai.sd)
|
||||
ogs_free(sNssai.sd);
|
||||
if (hplmnSnssai.sd)
|
||||
ogs_free(hplmnSnssai.sd);
|
||||
if (SmContextCreateData.guami)
|
||||
ogs_sbi_free_guami(SmContextCreateData.guami);
|
||||
if (SmContextCreateData.gpsi)
|
||||
ogs_free(SmContextCreateData.gpsi);
|
||||
if (ueLocation.nr_location) {
|
||||
if (ueLocation.nr_location->ue_location_timestamp)
|
||||
ogs_free(ueLocation.nr_location->ue_location_timestamp);
|
||||
ogs_sbi_free_nr_location(ueLocation.nr_location);
|
||||
}
|
||||
if (SmContextCreateData.ue_time_zone)
|
||||
ogs_free(SmContextCreateData.ue_time_zone);
|
||||
|
||||
if (SmContextCreateData.h_smf_uri)
|
||||
ogs_free(SmContextCreateData.h_smf_uri);
|
||||
|
||||
if (message.http.custom.nrf_uri)
|
||||
ogs_free(message.http.custom.nrf_uri);
|
||||
|
||||
return request;
|
||||
}
|
36
src/smf/nsmf-build.h
Normal file
36
src/smf/nsmf-build.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2024 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 SMF_NSMF_BUILD_H
|
||||
#define SMF_NSMF_BUILD_H
|
||||
|
||||
#include "context.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
ogs_sbi_request_t *smf_nsmf_pdusession_build_create_sm_context(
|
||||
smf_sess_t *sess, void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SMF_NSMF_BUILD_H */
|
@@ -226,6 +226,7 @@ bool smf_nsmf_handle_create_sm_context(
|
||||
ogs_sbi_parse_plmn_id_nid(&sess->serving_plmn_id, servingNetwork);
|
||||
memcpy(&sess->home_plmn_id, &sess->serving_plmn_id, OGS_PLMN_ID_LEN);
|
||||
|
||||
sess->an_type = SmContextCreateData->an_type;
|
||||
sess->sbi_rat_type = SmContextCreateData->rat_type;
|
||||
|
||||
ogs_sbi_parse_nr_location(&sess->nr_tai, &sess->nr_cgi, NrLocation);
|
||||
@@ -352,6 +353,12 @@ bool smf_nsmf_handle_create_sm_context(
|
||||
}
|
||||
}
|
||||
|
||||
if (SmContextCreateData->h_smf_uri) {
|
||||
if (sess->h_smf_uri) ogs_free(sess->h_smf_uri);
|
||||
sess->h_smf_uri = ogs_strdup(SmContextCreateData->h_smf_uri);
|
||||
ogs_assert(sess->h_smf_uri);
|
||||
}
|
||||
|
||||
if (SmContextCreateData->pcf_id) {
|
||||
if (sess->pcf_id) ogs_free(sess->pcf_id);
|
||||
sess->pcf_id = ogs_strdup(SmContextCreateData->pcf_id);
|
||||
|
@@ -44,6 +44,7 @@ int smf_sbi_open(void)
|
||||
ogs_sbi_nf_instance_build_default(nf_instance);
|
||||
ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_SCP);
|
||||
ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_AMF);
|
||||
ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_SMF);
|
||||
|
||||
/* Build NF service information. It will be transmitted to NRF. */
|
||||
if (ogs_sbi_nf_service_is_available(OGS_SBI_SERVICE_NAME_NSMF_PDUSESSION)) {
|
||||
@@ -53,6 +54,7 @@ int smf_sbi_open(void)
|
||||
ogs_sbi_nf_service_add_version(
|
||||
service, OGS_SBI_API_V1, OGS_SBI_API_V1_0_0, NULL);
|
||||
ogs_sbi_nf_service_add_allowed_nf_type(service, OpenAPI_nf_type_AMF);
|
||||
ogs_sbi_nf_service_add_allowed_nf_type(service, OpenAPI_nf_type_SMF);
|
||||
}
|
||||
|
||||
/* Initialize NRF NF Instance */
|
||||
|
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "nudm-build.h"
|
||||
#include "namf-build.h"
|
||||
#include "nsmf-build.h"
|
||||
#include "gsm-build.h"
|
||||
#include "nnrf-build.h"
|
||||
#include "npcf-build.h"
|
||||
|
@@ -1587,6 +1587,7 @@ bson_t *test_db_new_simple(test_ue_t *test_ue)
|
||||
"pre_emption_capability", BCON_INT32(1),
|
||||
"}",
|
||||
"}",
|
||||
"lbo_roaming_allowed", BCON_BOOL(true),
|
||||
"}", "]",
|
||||
"}", "]",
|
||||
"security", "{",
|
||||
|
Reference in New Issue
Block a user