diff --git a/configs/310014.yaml.in b/configs/310014.yaml.in index 0a6f9079b..4dfdf030b 100644 --- a/configs/310014.yaml.in +++ b/configs/310014.yaml.in @@ -2,21 +2,16 @@ db_uri: mongodb://localhost/open5gs logger: -sbi: - server: - no_tls: true - cacert: @build_configs_dir@/open5gs/tls/ca.crt - key: @build_configs_dir@/open5gs/tls/testserver.key - cert: @build_configs_dir@/open5gs/tls/testserver.crt - client: - no_tls: true - cacert: @build_configs_dir@/open5gs/tls/ca.crt - key: @build_configs_dir@/open5gs/tls/testclient.key - cert: @build_configs_dir@/open5gs/tls/testclient.crt - -parameter: +test: + serving: + - plmn_id: + mcc: 310 + mnc: 014 +global: + parameter: # no_nrf: true # no_scp: true + no_sepp: true # no_amf: true # no_smf: true # no_upf: true @@ -31,231 +26,286 @@ parameter: # no_sgwu: true # no_pcrf: true # no_hss: true -# use_mongodb_change_stream: true mme: - freeDiameter: - identity: mme.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.8 + freeDiameter: + identity: mme.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.8 - s1ap: - - addr: 127.0.0.2 - gtpc: - - addr: 127.0.0.2 - gummei: - plmn_id: + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + gummei: + - plmn_id: mcc: 310 mnc: 014 mme_gid: 2 mme_code: 1 - tai: - plmn_id: + tai: + - plmn_id: mcc: 310 mnc: 014 tac: 1 - security: - integrity_order : [ EIA2, EIA1, EIA0 ] - ciphering_order : [ EEA0, EEA1, EEA2 ] - - network_name: - full: Open5GS + security: + integrity_order : [ EIA2, EIA1, EIA0 ] + ciphering_order : [ EEA0, EEA1, EEA2 ] + network_name: + full: Open5GS + time: + t3412: + value: 540 sgwc: - gtpc: - - addr: 127.0.0.3 - pfcp: - - addr: 127.0.0.3 + gtpc: + server: + - address: 127.0.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 smf: - sbi: - - addr: 127.0.0.4 + sbi: + server: + - address: 127.0.0.4 port: 7777 - pfcp: - - addr: 127.0.0.4 - gtpc: - - addr: 127.0.0.4 - - addr: ::1 - gtpu: - - addr: 127.0.0.4 - - addr: ::1 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - 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.0.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 - addr: 127.0.0.9 + client: + scp: + - uri: http://127.0.0.200:7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + 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.0.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.0.9 amf: - sbi: - - addr: 127.0.0.5 + sbi: + server: + - address: 127.0.0.5 port: 7777 - ngap: - - addr: 127.0.0.5 - guami: - - plmn_id: - mcc: 310 - mnc: 014 - amf_id: - region: 2 - set: 1 - tai: - - plmn_id: - mcc: 310 - mnc: 014 - tac: 1 - plmn_support: - - plmn_id: - mcc: 310 - mnc: 014 - s_nssai: - - sst: 1 - security: - integrity_order : [ NIA2, NIA1, NIA0 ] - ciphering_order : [ NEA0, NEA1, NEA2 ] - network_name: - full: Open5GS - amf_name: open5gs-amf0 + client: + scp: + - uri: http://127.0.0.200:7777 + ngap: + server: + - address: 127.0.0.5 + guami: + - plmn_id: + mcc: 310 + mnc: 014 + amf_id: + region: 2 + set: 1 + tai: + - plmn_id: + mcc: 310 + mnc: 014 + tac: 1 + plmn_support: + - plmn_id: + mcc: 310 + mnc: 014 + 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: - - addr: 127.0.0.6 - gtpu: - - addr: 127.0.0.6 + pfcp: + server: + - address: 127.0.0.6 + gtpu: + server: + - address: 127.0.0.6 upf: - pfcp: - - addr: 127.0.0.7 - gtpu: - - addr: 127.0.0.7 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - metrics: - - addr: 127.0.0.7 + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 port: 9090 hss: - freeDiameter: - identity: hss.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.2 + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 pcrf: - freeDiameter: - identity: pcrf.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.4 + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 nrf: - sbi: - - addr: - - 127.0.0.10 - - ::1 + sbi: + server: + - address: 127.0.0.10 port: 7777 scp: - sbi: - - addr: 127.0.1.10 + sbi: + server: + - address: 127.0.0.200 port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 ausf: - sbi: - - addr: 127.0.0.11 + sbi: + server: + - address: 127.0.0.11 port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 udm: - sbi: - - addr: 127.0.0.12 + sbi: + server: + - address: 127.0.0.12 port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 pcf: - sbi: - - addr: 127.0.0.13 + sbi: + server: + - address: 127.0.0.13 port: 7777 - metrics: - - addr: 127.0.0.13 + client: + scp: + - uri: http://127.0.0.200:7777 + metrics: + server: + - address: 127.0.0.13 port: 9090 nssf: - sbi: - - addr: 127.0.0.14 + sbi: + server: + - address: 127.0.0.14 port: 7777 - nsi: - - addr: 127.0.0.10 - port: 7777 - s_nssai: - sst: 1 + client: + scp: + - uri: http://127.0.0.200:7777 + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 bsf: - sbi: - - addr: 127.0.0.15 - port: 7777 + sbi: + server: + - address: 127.0.0.15 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 udr: - sbi: - - addr: 127.0.0.20 + sbi: + server: + - address: 127.0.0.20 port: 7777 - -time: - t3412: - value: 540 # 9 mintues * 60 = 540 seconds - t3512: - value: 540 # 9 mintues * 60 = 540 seconds + client: + scp: + - uri: http://127.0.0.200:7777 diff --git a/configs/csfb.yaml.in b/configs/csfb.yaml.in index 3adfaccca..d32047148 100644 --- a/configs/csfb.yaml.in +++ b/configs/csfb.yaml.in @@ -2,21 +2,17 @@ db_uri: mongodb://localhost/open5gs logger: -sbi: - server: - no_tls: true - cacert: @build_configs_dir@/open5gs/tls/ca.crt - key: @build_configs_dir@/open5gs/tls/testserver.key - cert: @build_configs_dir@/open5gs/tls/testserver.crt - client: - no_tls: true - cacert: @build_configs_dir@/open5gs/tls/ca.crt - key: @build_configs_dir@/open5gs/tls/testclient.key - cert: @build_configs_dir@/open5gs/tls/testclient.crt +test: + serving: + - plmn_id: + mcc: 999 + mnc: 70 -parameter: +global: + parameter: # no_nrf: true # no_scp: true + no_sepp: true # no_amf: true # no_smf: true # no_upf: true @@ -31,33 +27,40 @@ parameter: # no_sgwu: true # no_pcrf: true # no_hss: true -# use_mongodb_change_stream: true mme: - freeDiameter: - identity: mme.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.8 + freeDiameter: + identity: mme.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.8 - s1ap: - - addr: 127.0.0.2 - gtpc: - - addr: 127.0.0.2 - sgsap: - - addr: 127.0.0.2 + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + sgsap: + server: + - address: 127.0.0.2 map: tai: plmn_id: @@ -80,211 +83,227 @@ mme: mcc: 724 mnc: 21 lac: 51544 - gummei: - - plmn_id: - mcc: 999 - mnc: 70 - mme_gid: 2 - mme_code: 1 - - plmn_id: - mcc: 724 - mnc: 21 - mme_gid: 2 - mme_code: 1 - tai: - plmn_id: + gummei: + - plmn_id: + mcc: 999 + mnc: 70 + mme_gid: 2 + mme_code: 1 + - plmn_id: + mcc: 724 + mnc: 21 + mme_gid: 2 + mme_code: 1 + tai: + - plmn_id: mcc: 999 mnc: 70 tac: 7 - tai: - plmn_id: + tai: + - plmn_id: mcc: 724 mnc: 21 tac: 12345 - security: - integrity_order : [ EIA2, EIA1, EIA0 ] - ciphering_order : [ EEA0, EEA1, EEA2 ] - - network_name: - full: Open5GS + security: + integrity_order : [ EIA2, EIA1, EIA0 ] + ciphering_order : [ EEA0, EEA1, EEA2 ] + network_name: + full: Open5GS + time: + t3412: + value: 540 sgwc: - gtpc: - - addr: 127.0.0.3 - pfcp: - - addr: 127.0.0.3 + gtpc: + server: + - address: 127.0.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 smf: # sbi: -# - addr: 127.0.0.4 -# port: 7777 - pfcp: - - addr: 127.0.0.4 - gtpc: - - addr: 127.0.0.4 - - addr: ::1 - gtpu: - - addr: 127.0.0.4 - - addr: ::1 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - 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.0.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 - addr: 127.0.0.9 +# server: +# - address: 127.0.0.4 +# port: 7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + 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.0.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.0.9 amf: - sbi: - - addr: 127.0.0.5 + sbi: + server: + - address: 127.0.0.5 port: 7777 - ngap: - - addr: 127.0.0.5 - 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 + ngap: + server: + - address: 127.0.0.5 + 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: - - addr: 127.0.0.6 - gtpu: - - addr: 127.0.0.6 + pfcp: + server: + - address: 127.0.0.6 + gtpu: + server: + - address: 127.0.0.6 upf: - pfcp: - - addr: 127.0.0.7 - gtpu: - - addr: 127.0.0.7 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - metrics: - - addr: 127.0.0.7 + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 port: 9090 hss: - freeDiameter: - identity: hss.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.2 + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 pcrf: - freeDiameter: - identity: pcrf.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.4 - -#nrf: -# sbi: -# - addr: -# - 127.0.0.10 -# - ::1 -# port: 7777 + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 ausf: - sbi: - - addr: 127.0.0.11 + sbi: + server: + - address: 127.0.0.11 port: 7777 udm: - sbi: - - addr: 127.0.0.12 + sbi: + server: + - address: 127.0.0.12 port: 7777 pcf: - sbi: - - addr: 127.0.0.13 + sbi: + server: + - address: 127.0.0.13 port: 7777 - metrics: - - addr: 127.0.0.13 + metrics: + server: + - address: 127.0.0.13 port: 9090 nssf: - sbi: - - addr: 127.0.0.14 + sbi: + server: + - address: 127.0.0.14 port: 7777 - nsi: - - addr: 127.0.0.10 - port: 7777 - s_nssai: - sst: 1 + clinet: + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 bsf: - sbi: - - addr: 127.0.0.15 + sbi: + server: + - address: 127.0.0.15 port: 7777 udr: - sbi: - - addr: 127.0.0.20 + sbi: + server: + - address: 127.0.0.20 port: 7777 - -time: - t3412: - value: 540 # 9 mintues * 60 = 540 seconds - t3512: - value: 540 # 9 mintues * 60 = 540 seconds diff --git a/configs/examples/5gc-sepp1-999-70.yaml.in b/configs/examples/5gc-sepp1-999-70.yaml.in new file mode 100644 index 000000000..c0e1312af --- /dev/null +++ b/configs/examples/5gc-sepp1-999-70.yaml.in @@ -0,0 +1,534 @@ +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 + client: + scp: + - uri: http://127.0.1.200:7777 + 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.1/16 + - subnet: 2001:db8:cafe::1/48 + 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: + scp: + - uri: http://127.0.1.200:7777 + 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.1/16 + - subnet: 2001:db8:cafe::1/48 + 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 + +scp: + sbi: + server: + - address: 127.0.1.200 + port: 7777 + client: + nrf: +# - uri: http://127.0.1.10:7777 + - uri: http://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: + scp: + - uri: http://127.0.1.200:7777 + 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: + scp: + - uri: http://127.0.1.200:7777 + +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: + scp: + - uri: http://127.0.1.200:7777 + +pcf: + sbi: + server: + - address: 127.0.1.13 + port: 7777 + client: + scp: + - uri: http://127.0.1.200:7777 + 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 + client: + scp: + - uri: http://127.0.1.200:7777 + nsi: + - uri: http://nrf.5gc.mnc070.mcc999.3gppnetwork.org + s_nssai: + sst: 1 +bsf: + sbi: + server: + - address: 127.0.1.15 + port: 7777 + client: + scp: + - uri: http://127.0.1.200:7777 + +udr: + sbi: + server: + - address: 127.0.1.20 + port: 7777 + client: + scp: + - uri: http://127.0.1.200:7777 diff --git a/configs/examples/5gc-sepp2-001-01.yaml.in b/configs/examples/5gc-sepp2-001-01.yaml.in new file mode 100644 index 000000000..46e26d8a5 --- /dev/null +++ b/configs/examples/5gc-sepp2-001-01.yaml.in @@ -0,0 +1,535 @@ +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 + client: + scp: + - uri: http://127.0.2.200:7777 + 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.1/16 + - subnet: 2001:db8:babe::1/48 + 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: + scp: + - uri: http://127.0.2.200:7777 + 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.1/16 + dev: ogstun2 + - subnet: 2001:db8:babe::1/48 + 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 + +scp: + sbi: + server: + - address: 127.0.2.200 + port: 7777 + client: + nrf: + - uri: http://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: + scp: + - uri: http://127.0.2.200:7777 + 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: + scp: + - uri: http://127.0.2.200:7777 + +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: + scp: + - uri: http://127.0.2.200:7777 + +pcf: + sbi: + server: + - address: 127.0.2.13 + port: 7777 + client: + scp: + - uri: http://127.0.2.200:7777 + 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 + client: + scp: + - uri: http://127.0.2.200:7777 + nsi: + - uri: http://nrf.5gc.mnc001.mcc001.3gppnetwork.org + s_nssai: + sst: 1 +bsf: + sbi: + server: + - address: 127.0.2.15 + port: 7777 + client: + scp: + - uri: http://127.0.2.200:7777 + +udr: + sbi: + server: + - address: 127.0.2.20 + port: 7777 + client: + scp: + - uri: http://127.0.2.200:7777 diff --git a/configs/examples/5gc-sepp3-315-010.yaml.in b/configs/examples/5gc-sepp3-315-010.yaml.in new file mode 100644 index 000000000..8915574e3 --- /dev/null +++ b/configs/examples/5gc-sepp3-315-010.yaml.in @@ -0,0 +1,535 @@ +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 + client: + scp: + - uri: http://127.0.3.200:7777 + 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.1/16 + - subnet: 2001:db8:face::1/48 + 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: + scp: + - uri: http://127.0.3.200:7777 + 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.1/16 + dev: ogstun3 + - subnet: 2001:db8:face::1/48 + 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 + +scp: + sbi: + server: + - address: 127.0.3.200 + port: 7777 + client: + nrf: + - uri: http://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: + scp: + - uri: http://127.0.3.200:7777 + 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: + scp: + - uri: http://127.0.3.200:7777 + +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: + scp: + - uri: http://127.0.3.200:7777 + +pcf: + sbi: + server: + - address: 127.0.3.13 + port: 7777 + client: + scp: + - uri: http://127.0.3.200:7777 + 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 + client: + scp: + - uri: http://127.0.3.200:7777 + nsi: + - uri: http://nrf.5gc.mnc010.mcc315.3gppnetwork.org + s_nssai: + sst: 1 +bsf: + sbi: + server: + - address: 127.0.3.15 + port: 7777 + client: + scp: + - uri: http://127.0.3.200:7777 + +udr: + sbi: + server: + - address: 127.0.3.20 + port: 7777 + client: + scp: + - uri: http://127.0.3.200:7777 diff --git a/configs/examples/5gc-tls-sepp1-999-70.yaml.in b/configs/examples/5gc-tls-sepp1-999-70.yaml.in new file mode 100644 index 000000000..1edd26b7c --- /dev/null +++ b/configs/examples/5gc-tls-sepp1-999-70.yaml.in @@ -0,0 +1,539 @@ +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 +# use_mongodb_change_stream: 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 + client: + scp: + - uri: http://127.0.1.200:7777 + 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.1/16 + - subnet: 2001:db8:cafe::1/48 + 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: + scp: + - uri: http://127.0.1.200:7777 + 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.1/16 + - subnet: 2001:db8:cafe::1/48 + 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 + +scp: + sbi: + server: + - address: 127.0.1.200 + port: 7777 + client: + nrf: +# - uri: http://127.0.1.10:7777 + - uri: http://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: + scp: + - uri: http://127.0.1.200:7777 + n32: + server: + - sender: sepp1.localdomain + scheme: https + address: 127.0.1.251 + n32f: + scheme: https + address: 127.0.1.252 + client: + sepp: + - receiver: sepp2.localdomain + uri: https://sepp2.localdomain + resolve: 127.0.2.251 + n32f: + uri: https://sepp2.localdomain + resolve: 127.0.2.252 + - receiver: sepp3.localdomain + uri: https://sepp3.localdomain + resolve: 127.0.3.251 + n32f: + uri: https://sepp3.localdomain + resolve: 127.0.3.252 + +ausf: + sbi: + server: +# - address: 127.0.1.11 +# port: 7777 + - address: ausf.5gc.mnc070.mcc999.3gppnetwork.org + client: + scp: + - uri: http://127.0.1.200:7777 + +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: + scp: + - uri: http://127.0.1.200:7777 + +pcf: + sbi: + server: + - address: 127.0.1.13 + port: 7777 + client: + scp: + - uri: http://127.0.1.200:7777 + 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 + client: + scp: + - uri: http://127.0.1.200:7777 + nsi: + - uri: http://127.0.1.10:7777 + s_nssai: + sst: 1 +bsf: + sbi: + server: + - address: 127.0.1.15 + port: 7777 + client: + scp: + - uri: http://127.0.1.200:7777 + +udr: + sbi: + server: + - address: 127.0.1.20 + port: 7777 + client: + scp: + - uri: http://127.0.1.200:7777 diff --git a/configs/examples/5gc-tls-sepp2-001-01.yaml.in b/configs/examples/5gc-tls-sepp2-001-01.yaml.in new file mode 100644 index 000000000..9170cd726 --- /dev/null +++ b/configs/examples/5gc-tls-sepp2-001-01.yaml.in @@ -0,0 +1,540 @@ +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 +# use_mongodb_change_stream: 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 + client: + scp: + - uri: http://127.0.2.200:7777 + 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.1/16 + - subnet: 2001:db8:babe::1/48 + 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: + scp: + - uri: http://127.0.2.200:7777 + 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.1/16 + dev: ogstun2 + - subnet: 2001:db8:babe::1/48 + 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 + +scp: + sbi: + server: + - address: 127.0.2.200 + port: 7777 + client: + nrf: + - uri: http://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: + scp: + - uri: http://127.0.2.200:7777 + n32: + server: + - sender: sepp2.localdomain + scheme: https + address: 127.0.2.251 + n32f: + scheme: https + address: 127.0.2.252 + client: + sepp: + - receiver: sepp1.localdomain + uri: https://sepp1.localdomain + resolve: 127.0.1.251 + n32f: + uri: https://sepp1.localdomain + resolve: 127.0.1.252 + - receiver: sepp3.localdomain + uri: https://sepp3.localdomain + resolve: 127.0.3.251 + n32f: + uri: https://sepp3.localdomain + resolve: 127.0.3.252 + +ausf: + sbi: + server: +# - address: 127.0.2.11 +# port: 7777 + - address: ausf.5gc.mnc001.mcc001.3gppnetwork.org + client: + scp: + - uri: http://127.0.2.200:7777 + +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: + scp: + - uri: http://127.0.2.200:7777 + +pcf: + sbi: + server: + - address: 127.0.2.13 + port: 7777 + client: + scp: + - uri: http://127.0.2.200:7777 + 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 + client: + scp: + - uri: http://127.0.2.200:7777 + nsi: + - uri: http://127.0.2.10:7777 + s_nssai: + sst: 1 +bsf: + sbi: + server: + - address: 127.0.2.15 + port: 7777 + client: + scp: + - uri: http://127.0.2.200:7777 + +udr: + sbi: + server: + - address: 127.0.2.20 + port: 7777 + client: + scp: + - uri: http://127.0.2.200:7777 diff --git a/configs/examples/5gc-tls-sepp3-315-010.yaml.in b/configs/examples/5gc-tls-sepp3-315-010.yaml.in new file mode 100644 index 000000000..945b2b4c7 --- /dev/null +++ b/configs/examples/5gc-tls-sepp3-315-010.yaml.in @@ -0,0 +1,540 @@ +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 +# use_mongodb_change_stream: 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 + client: + scp: + - uri: http://127.0.3.200:7777 + 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.1/16 + - subnet: 2001:db8:face::1/48 + 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: + scp: + - uri: http://127.0.3.200:7777 + 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.1/16 + dev: ogstun3 + - subnet: 2001:db8:face::1/48 + 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 + +scp: + sbi: + server: + - address: 127.0.3.200 + port: 7777 + client: + nrf: + - uri: http://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: + scp: + - uri: http://127.0.3.200:7777 + n32: + server: + - sender: sepp3.localdomain + scheme: https + address: 127.0.3.251 + n32f: + scheme: https + address: 127.0.3.252 + client: + sepp: + - receiver: sepp1.localdomain + uri: https://sepp1.localdomain + resolve: 127.0.1.251 + n32f: + uri: https://sepp1.localdomain + resolve: 127.0.1.252 + - receiver: sepp2.localdomain + uri: https://sepp2.localdomain + resolve: 127.0.2.251 + n32f: + uri: https://sepp2.localdomain + resolve: 127.0.2.252 + +ausf: + sbi: + server: +# - address: 127.0.3.11 +# port: 7777 + - address: ausf.5gc.mnc010.mcc315.3gppnetwork.org + client: + scp: + - uri: http://127.0.3.200:7777 + +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: + scp: + - uri: http://127.0.3.200:7777 + +pcf: + sbi: + server: + - address: 127.0.3.13 + port: 7777 + client: + scp: + - uri: http://127.0.3.200:7777 + 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 + client: + scp: + - uri: http://127.0.3.200:7777 + nsi: + - uri: http://127.0.3.10:7777 + s_nssai: + sst: 1 +bsf: + sbi: + server: + - address: 127.0.3.15 + port: 7777 + client: + scp: + - uri: http://127.0.3.200:7777 + +udr: + sbi: + server: + - address: 127.0.3.20 + port: 7777 + client: + scp: + - uri: http://127.0.3.200:7777 diff --git a/configs/examples/gnb-001-01-ue-001-01.yaml.in b/configs/examples/gnb-001-01-ue-001-01.yaml.in new file mode 100644 index 000000000..5f132056e --- /dev/null +++ b/configs/examples/gnb-001-01-ue-001-01.yaml.in @@ -0,0 +1,331 @@ +db_uri: mongodb://localhost/open5gs + +logger: + +test: + serving: + - plmn_id: + mcc: 001 + mnc: 01 + +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.0.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.0.8 + + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.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.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 + +smf: + sbi: + server: + - address: 127.0.0.4 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.4 + port: 9090 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + 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.0.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.0.9 + +amf: + sbi: + server: + - address: 127.0.0.5 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + ngap: + server: + - address: 127.0.2.5 + metrics: + server: + - address: 127.0.0.5 + port: 9090 + 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.0.6 + gtpu: + server: + - address: 127.0.0.6 + +upf: + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 + port: 9090 + +hss: + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 +pcrf: + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 + +nrf: + sbi: + server: + - address: 127.0.0.10 + port: 7777 + +scp: + sbi: + server: + - address: 127.0.0.200 + port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 + +ausf: + sbi: + server: + - address: 127.0.0.11 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +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.0.12 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +pcf: + sbi: + server: + - address: 127.0.0.13 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + metrics: + server: + - address: 127.0.0.13 + port: 9090 + +nssf: + sbi: + server: + - address: 127.0.0.14 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 +bsf: + sbi: + server: + - address: 127.0.0.15 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +udr: + sbi: + server: + - address: 127.0.0.20 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 diff --git a/configs/examples/gnb-001-01-ue-315-010.yaml.in b/configs/examples/gnb-001-01-ue-315-010.yaml.in new file mode 100644 index 000000000..20f8756d6 --- /dev/null +++ b/configs/examples/gnb-001-01-ue-315-010.yaml.in @@ -0,0 +1,331 @@ +db_uri: mongodb://localhost/open5gs + +logger: + +test: + serving: + - plmn_id: + mcc: 315 + mnc: 010 + +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.0.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.0.8 + + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.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.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 + +smf: + sbi: + server: + - address: 127.0.0.4 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.4 + port: 9090 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + 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.0.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.0.9 + +amf: + sbi: + server: + - address: 127.0.0.5 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + ngap: + server: + - address: 127.0.2.5 + metrics: + server: + - address: 127.0.0.5 + port: 9090 + 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.0.6 + gtpu: + server: + - address: 127.0.0.6 + +upf: + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 + port: 9090 + +hss: + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 +pcrf: + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 + +nrf: + sbi: + server: + - address: 127.0.0.10 + port: 7777 + +scp: + sbi: + server: + - address: 127.0.0.200 + port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 + +ausf: + sbi: + server: + - address: 127.0.0.11 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +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.0.12 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +pcf: + sbi: + server: + - address: 127.0.0.13 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + metrics: + server: + - address: 127.0.0.13 + port: 9090 + +nssf: + sbi: + server: + - address: 127.0.0.14 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 +bsf: + sbi: + server: + - address: 127.0.0.15 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +udr: + sbi: + server: + - address: 127.0.0.20 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 diff --git a/configs/examples/gnb-001-01-ue-999-70.yaml.in b/configs/examples/gnb-001-01-ue-999-70.yaml.in new file mode 100644 index 000000000..16e2c65ac --- /dev/null +++ b/configs/examples/gnb-001-01-ue-999-70.yaml.in @@ -0,0 +1,326 @@ +db_uri: mongodb://localhost/open5gs + +logger: + +test: + serving: + - plmn_id: + mcc: 999 + mnc: 70 + +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.0.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.0.8 + + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.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 + +sgwc: + gtpc: + server: + - address: 127.0.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 + +smf: + sbi: + server: + - address: 127.0.0.4 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.4 + port: 9090 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + 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.0.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.0.9 + +amf: + sbi: + server: + - address: 127.0.0.5 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + ngap: + server: + - address: 127.0.2.5 + metrics: + server: + - address: 127.0.0.5 + port: 9090 + 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 + +sgwu: + pfcp: + server: + - address: 127.0.0.6 + gtpu: + server: + - address: 127.0.0.6 + +upf: + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 + port: 9090 + +hss: + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 +pcrf: + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 + +nrf: + sbi: + server: + - address: 127.0.0.10 + port: 7777 + +scp: + sbi: + server: + - address: 127.0.0.200 + port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 + +ausf: + sbi: + server: + - address: 127.0.0.11 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +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.0.12 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +pcf: + sbi: + server: + - address: 127.0.0.13 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + metrics: + server: + - address: 127.0.0.13 + port: 9090 + +nssf: + sbi: + server: + - address: 127.0.0.14 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 +bsf: + sbi: + server: + - address: 127.0.0.15 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +udr: + sbi: + server: + - address: 127.0.0.20 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 diff --git a/configs/examples/gnb-315-010-ue-001-01.yaml.in b/configs/examples/gnb-315-010-ue-001-01.yaml.in new file mode 100644 index 000000000..f970f2b8b --- /dev/null +++ b/configs/examples/gnb-315-010-ue-001-01.yaml.in @@ -0,0 +1,331 @@ +db_uri: mongodb://localhost/open5gs + +logger: + +test: + serving: + - plmn_id: + mcc: 001 + mnc: 01 + +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.0.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.0.8 + + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.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.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 + +smf: + sbi: + server: + - address: 127.0.0.4 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.4 + port: 9090 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + 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.0.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.0.9 + +amf: + sbi: + server: + - address: 127.0.0.5 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + ngap: + server: + - address: 127.0.3.5 + metrics: + server: + - address: 127.0.0.5 + port: 9090 + 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.0.6 + gtpu: + server: + - address: 127.0.0.6 + +upf: + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 + port: 9090 + +hss: + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 +pcrf: + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 + +nrf: + sbi: + server: + - address: 127.0.0.10 + port: 7777 + +scp: + sbi: + server: + - address: 127.0.0.200 + port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 + +ausf: + sbi: + server: + - address: 127.0.0.11 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +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.0.12 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +pcf: + sbi: + server: + - address: 127.0.0.13 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + metrics: + server: + - address: 127.0.0.13 + port: 9090 + +nssf: + sbi: + server: + - address: 127.0.0.14 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 +bsf: + sbi: + server: + - address: 127.0.0.15 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +udr: + sbi: + server: + - address: 127.0.0.20 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 diff --git a/configs/examples/gnb-315-010-ue-315-010.yaml.in b/configs/examples/gnb-315-010-ue-315-010.yaml.in new file mode 100644 index 000000000..30c681a5d --- /dev/null +++ b/configs/examples/gnb-315-010-ue-315-010.yaml.in @@ -0,0 +1,326 @@ +db_uri: mongodb://localhost/open5gs + +logger: + +test: + serving: + - plmn_id: + mcc: 315 + mnc: 010 + +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.0.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.0.8 + + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.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 + +sgwc: + gtpc: + server: + - address: 127.0.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 + +smf: + sbi: + server: + - address: 127.0.0.4 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.4 + port: 9090 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + 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.0.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.0.9 + +amf: + sbi: + server: + - address: 127.0.0.5 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + ngap: + server: + - address: 127.0.3.5 + metrics: + server: + - address: 127.0.0.5 + port: 9090 + 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 + +sgwu: + pfcp: + server: + - address: 127.0.0.6 + gtpu: + server: + - address: 127.0.0.6 + +upf: + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 + port: 9090 + +hss: + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 +pcrf: + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 + +nrf: + sbi: + server: + - address: 127.0.0.10 + port: 7777 + +scp: + sbi: + server: + - address: 127.0.0.200 + port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 + +ausf: + sbi: + server: + - address: 127.0.0.11 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +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.0.12 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +pcf: + sbi: + server: + - address: 127.0.0.13 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + metrics: + server: + - address: 127.0.0.13 + port: 9090 + +nssf: + sbi: + server: + - address: 127.0.0.14 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 +bsf: + sbi: + server: + - address: 127.0.0.15 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +udr: + sbi: + server: + - address: 127.0.0.20 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 diff --git a/configs/examples/gnb-315-010-ue-999-70.yaml.in b/configs/examples/gnb-315-010-ue-999-70.yaml.in new file mode 100644 index 000000000..ff0cbcdef --- /dev/null +++ b/configs/examples/gnb-315-010-ue-999-70.yaml.in @@ -0,0 +1,331 @@ +db_uri: mongodb://localhost/open5gs + +logger: + +test: + serving: + - plmn_id: + mcc: 999 + mnc: 70 + +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.0.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.0.8 + + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.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.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 + +smf: + sbi: + server: + - address: 127.0.0.4 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.4 + port: 9090 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + 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.0.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.0.9 + +amf: + sbi: + server: + - address: 127.0.0.5 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + ngap: + server: + - address: 127.0.3.5 + metrics: + server: + - address: 127.0.0.5 + port: 9090 + 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.0.6 + gtpu: + server: + - address: 127.0.0.6 + +upf: + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 + port: 9090 + +hss: + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 +pcrf: + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 + +nrf: + sbi: + server: + - address: 127.0.0.10 + port: 7777 + +scp: + sbi: + server: + - address: 127.0.0.200 + port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 + +ausf: + sbi: + server: + - address: 127.0.0.11 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +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.0.12 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +pcf: + sbi: + server: + - address: 127.0.0.13 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + metrics: + server: + - address: 127.0.0.13 + port: 9090 + +nssf: + sbi: + server: + - address: 127.0.0.14 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 +bsf: + sbi: + server: + - address: 127.0.0.15 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +udr: + sbi: + server: + - address: 127.0.0.20 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 diff --git a/configs/examples/gnb-999-70-ue-001-01.yaml.in b/configs/examples/gnb-999-70-ue-001-01.yaml.in new file mode 100644 index 000000000..202a5f02c --- /dev/null +++ b/configs/examples/gnb-999-70-ue-001-01.yaml.in @@ -0,0 +1,331 @@ +db_uri: mongodb://localhost/open5gs + +logger: + +test: + serving: + - plmn_id: + mcc: 001 + mnc: 01 + +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.0.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.0.8 + + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.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.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 + +smf: + sbi: + server: + - address: 127.0.0.4 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.4 + port: 9090 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + 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.0.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.0.9 + +amf: + sbi: + server: + - address: 127.0.0.5 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + ngap: + server: + - address: 127.0.1.5 + metrics: + server: + - address: 127.0.0.5 + port: 9090 + 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.0.6 + gtpu: + server: + - address: 127.0.0.6 + +upf: + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 + port: 9090 + +hss: + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 +pcrf: + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 + +nrf: + sbi: + server: + - address: 127.0.0.10 + port: 7777 + +scp: + sbi: + server: + - address: 127.0.0.200 + port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 + +ausf: + sbi: + server: + - address: 127.0.0.11 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +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.0.12 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +pcf: + sbi: + server: + - address: 127.0.0.13 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + metrics: + server: + - address: 127.0.0.13 + port: 9090 + +nssf: + sbi: + server: + - address: 127.0.0.14 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 +bsf: + sbi: + server: + - address: 127.0.0.15 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +udr: + sbi: + server: + - address: 127.0.0.20 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 diff --git a/configs/examples/gnb-999-70-ue-315-010.yaml.in b/configs/examples/gnb-999-70-ue-315-010.yaml.in new file mode 100644 index 000000000..dea839c0d --- /dev/null +++ b/configs/examples/gnb-999-70-ue-315-010.yaml.in @@ -0,0 +1,331 @@ +db_uri: mongodb://localhost/open5gs + +logger: + +test: + serving: + - plmn_id: + mcc: 315 + mnc: 010 + +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.0.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.0.8 + + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.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.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 + +smf: + sbi: + server: + - address: 127.0.0.4 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.4 + port: 9090 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + 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.0.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.0.9 + +amf: + sbi: + server: + - address: 127.0.0.5 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + ngap: + server: + - address: 127.0.1.5 + metrics: + server: + - address: 127.0.0.5 + port: 9090 + 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.0.6 + gtpu: + server: + - address: 127.0.0.6 + +upf: + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 + port: 9090 + +hss: + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 +pcrf: + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 + +nrf: + sbi: + server: + - address: 127.0.0.10 + port: 7777 + +scp: + sbi: + server: + - address: 127.0.0.200 + port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 + +ausf: + sbi: + server: + - address: 127.0.0.11 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +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.0.12 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +pcf: + sbi: + server: + - address: 127.0.0.13 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + metrics: + server: + - address: 127.0.0.13 + port: 9090 + +nssf: + sbi: + server: + - address: 127.0.0.14 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 +bsf: + sbi: + server: + - address: 127.0.0.15 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +udr: + sbi: + server: + - address: 127.0.0.20 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 diff --git a/configs/examples/gnb-999-70-ue-999-70.yaml.in b/configs/examples/gnb-999-70-ue-999-70.yaml.in new file mode 100644 index 000000000..b1bd3534b --- /dev/null +++ b/configs/examples/gnb-999-70-ue-999-70.yaml.in @@ -0,0 +1,326 @@ +db_uri: mongodb://localhost/open5gs + +logger: + +test: + serving: + - plmn_id: + mcc: 999 + mnc: 70 + +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.0.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.0.8 + + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.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 + +sgwc: + gtpc: + server: + - address: 127.0.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 + +smf: + sbi: + server: + - address: 127.0.0.4 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.4 + port: 9090 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + 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.0.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.0.9 + +amf: + sbi: + server: + - address: 127.0.0.5 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + ngap: + server: + - address: 127.0.1.5 + metrics: + server: + - address: 127.0.0.5 + port: 9090 + 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 + +sgwu: + pfcp: + server: + - address: 127.0.0.6 + gtpu: + server: + - address: 127.0.0.6 + +upf: + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 + port: 9090 + +hss: + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 +pcrf: + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 + +nrf: + sbi: + server: + - address: 127.0.0.10 + port: 7777 + +scp: + sbi: + server: + - address: 127.0.0.200 + port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 + +ausf: + sbi: + server: + - address: 127.0.0.11 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +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.0.12 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +pcf: + sbi: + server: + - address: 127.0.0.13 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + metrics: + server: + - address: 127.0.0.13 + port: 9090 + +nssf: + sbi: + server: + - address: 127.0.0.14 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 +bsf: + sbi: + server: + - address: 127.0.0.15 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 + +udr: + sbi: + server: + - address: 127.0.0.20 + port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 diff --git a/configs/examples/meson.build b/configs/examples/meson.build new file mode 100644 index 000000000..d536448e5 --- /dev/null +++ b/configs/examples/meson.build @@ -0,0 +1,41 @@ +# Copyright (C) 2023 by Sukchan Lee + +# 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 . + +examples_conf = ''' + 5gc-sepp1-999-70.yaml + 5gc-sepp2-001-01.yaml + 5gc-sepp3-315-010.yaml + 5gc-tls-sepp1-999-70.yaml + 5gc-tls-sepp2-001-01.yaml + 5gc-tls-sepp3-315-010.yaml + gnb-999-70-ue-999-70.yaml + gnb-999-70-ue-001-01.yaml + gnb-999-70-ue-315-010.yaml + gnb-001-01-ue-999-70.yaml + gnb-001-01-ue-001-01.yaml + gnb-001-01-ue-315-010.yaml + gnb-315-010-ue-999-70.yaml + gnb-315-010-ue-001-01.yaml + gnb-315-010-ue-315-010.yaml +'''.split() + +foreach file : examples_conf + gen = configure_file( + input : file + '.in', + output : file, + configuration : conf_data) +endforeach diff --git a/configs/logrotate/open5gs.in b/configs/logrotate/open5gs.in index bf7406207..113b12a2c 100644 --- a/configs/logrotate/open5gs.in +++ b/configs/logrotate/open5gs.in @@ -7,7 +7,7 @@ create 640 open5gs open5gs postrotate - for i in nrfd scpd pcrfd hssd ausfd udmd udrd upfd sgwcd sgwud smfd mmed amfd; do + for i in nrfd scpd seppd pcrfd hssd ausfd udmd udrd upfd sgwcd sgwud smfd mmed amfd; do systemctl reload open5gs-$i done endscript diff --git a/configs/meson.build b/configs/meson.build index 9e625248a..570b49542 100644 --- a/configs/meson.build +++ b/configs/meson.build @@ -53,3 +53,4 @@ subdir('freeDiameter') subdir('systemd') subdir('logrotate') subdir('newsyslog') +subdir('examples') diff --git a/configs/newsyslog/open5gs.conf.in b/configs/newsyslog/open5gs.conf.in index 917607340..a4c3e62f3 100644 --- a/configs/newsyslog/open5gs.conf.in +++ b/configs/newsyslog/open5gs.conf.in @@ -3,6 +3,7 @@ # logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] @localstatedir@/log/open5gs/nrf.log 644 14 * $D0 GZ @localstatedir@/run/open5gs-nrfd/pid` @localstatedir@/log/open5gs/scp.log 644 14 * $D0 GZ @localstatedir@/run/open5gs-scpd/pid` +@localstatedir@/log/open5gs/sepp.log 644 14 * $D0 GZ @localstatedir@/run/open5gs-seppd/pid` @localstatedir@/log/open5gs/pcrf.log 644 14 * $D0 GZ @localstatedir@/run/open5gs-pcrfd/pid` @localstatedir@/log/open5gs/hss.log 644 14 * $D0 GZ @localstatedir@/run/open5gs-hssd/pid` @localstatedir@/log/open5gs/ausf.log 644 14 * $D0 GZ @localstatedir@/run/open5gs-ausfd/pid` diff --git a/configs/non3gpp.yaml.in b/configs/non3gpp.yaml.in index ba84c020d..ac0477777 100644 --- a/configs/non3gpp.yaml.in +++ b/configs/non3gpp.yaml.in @@ -2,21 +2,17 @@ db_uri: mongodb://localhost/open5gs logger: -sbi: - server: - no_tls: true - cacert: @build_configs_dir@/open5gs/tls/ca.crt - key: @build_configs_dir@/open5gs/tls/testserver.key - cert: @build_configs_dir@/open5gs/tls/testserver.crt - client: - no_tls: true - cacert: @build_configs_dir@/open5gs/tls/ca.crt - key: @build_configs_dir@/open5gs/tls/testclient.key - cert: @build_configs_dir@/open5gs/tls/testclient.crt +test: + serving: + - plmn_id: + mcc: 999 + mnc: 70 -parameter: +global: + parameter: # no_nrf: true # no_scp: true + no_sepp: true # no_amf: true # no_smf: true # no_upf: true @@ -31,229 +27,280 @@ parameter: # no_sgwu: true # no_pcrf: true # no_hss: true -# use_mongodb_change_stream: true mme: - freeDiameter: - identity: mme.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.8 + freeDiameter: + identity: mme.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.8 - s1ap: - - addr: 127.0.0.2 - gtpc: - - addr: 127.0.0.2 - gummei: - plmn_id: + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + gummei: + - plmn_id: mcc: 999 mnc: 70 mme_gid: 2 mme_code: 1 - tai: - plmn_id: + tai: + - plmn_id: mcc: 999 mnc: 70 tac: 1 - security: - integrity_order : [ EIA2, EIA1, EIA0 ] - ciphering_order : [ EEA0, EEA1, EEA2 ] - - network_name: - full: Open5GS + security: + integrity_order : [ EIA2, EIA1, EIA0 ] + ciphering_order : [ EEA0, EEA1, EEA2 ] + network_name: + full: Open5GS + time: + t3412: + value: 540 sgwc: - gtpc: - - addr: 127.0.0.3 - pfcp: - - addr: 127.0.0.3 + gtpc: + server: + - address: 127.0.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 smf: - sbi: - - addr: 127.0.0.4 + sbi: + server: + - address: 127.0.0.4 port: 7777 - pfcp: - - addr: 127.0.0.4 - gtpc: - - addr: 127.0.0.4 - - addr: ::1 - gtpu: - - addr: 127.0.0.4 - - addr: ::1 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - 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.0.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 - addr: 127.0.0.9 - - identity: aaa.localdomain - addr: 127.0.0.1 + client: + nrf: + - uri: http://127.0.0.10:7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + 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.0.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.0.9 + - identity: aaa.localdomain + address: 127.0.0.1 amf: - sbi: - - addr: 127.0.0.5 + sbi: + server: + - address: 127.0.0.5 port: 7777 - ngap: - - addr: 127.0.0.5 - 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 + client: + nrf: + - uri: http://127.0.0.10:7777 + ngap: + server: + - address: 127.0.0.5 + 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: - - addr: 127.0.0.6 - gtpu: - - addr: 127.0.0.6 + pfcp: + server: + - address: 127.0.0.6 + gtpu: + server: + - address: 127.0.0.6 upf: - pfcp: - - addr: 127.0.0.7 - gtpu: - - addr: 127.0.0.7 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - metrics: - - addr: 127.0.0.7 + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 port: 9090 hss: - freeDiameter: - identity: hss.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.2 - - identity: aaa.localdomain - addr: 127.0.0.1 + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 + - identity: aaa.localdomain + address: 127.0.0.1 pcrf: - freeDiameter: - identity: pcrf.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.4 + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 nrf: - sbi: - - addr: - - 127.0.0.10 - - ::1 + sbi: + server: + - address: 127.0.0.10 port: 7777 ausf: - sbi: - - addr: 127.0.0.11 + sbi: + server: + - address: 127.0.0.11 port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 udm: - sbi: - - addr: 127.0.0.12 + sbi: + server: + - address: 127.0.0.12 port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 pcf: - sbi: - - addr: 127.0.0.13 + sbi: + server: + - address: 127.0.0.13 port: 7777 - metrics: - - addr: 127.0.0.13 + client: + nrf: + - uri: http://127.0.0.10:7777 + metrics: + server: + - address: 127.0.0.13 port: 9090 nssf: - sbi: - - addr: 127.0.0.14 + sbi: + server: + - address: 127.0.0.14 port: 7777 - nsi: - - addr: 127.0.0.10 - port: 7777 - s_nssai: - sst: 1 + client: + nrf: + - uri: http://127.0.0.10:7777 + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 bsf: - sbi: - - addr: 127.0.0.15 + sbi: + server: + - address: 127.0.0.15 port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 udr: - sbi: - - addr: 127.0.0.20 + sbi: + server: + - address: 127.0.0.20 port: 7777 - -time: - t3412: - value: 540 # 9 mintues * 60 = 540 seconds - t3512: - value: 540 # 9 mintues * 60 = 540 seconds + client: + nrf: + - uri: http://127.0.0.10:7777 diff --git a/configs/open5gs/amf.yaml.in b/configs/open5gs/amf.yaml.in index b022552db..4f9dbf544 100644 --- a/configs/open5gs/amf.yaml.in +++ b/configs/open5gs/amf.yaml.in @@ -1,714 +1,238 @@ -# -# o Set OGS_LOG_INFO to all domain level -# - If `level` is omitted, the default level is OGS_LOG_INFO) -# - If `domain` is omitted, the all domain level is set from 'level' -# (Default values are used, so no configuration is required) -# -# o Set OGS_LOG_ERROR to all domain level -# - `level` can be set with none, fatal, error, warn, info, debug, trace -# logger: -# level: error -# -# o Set OGS_LOG_DEBUG to mme/emm domain level -# logger: -# level: debug -# domain: mme,emm -# -# o Set OGS_LOG_TRACE to all domain level -# logger: -# level: trace -# domain: core,sbi,ausf,event,tlv,mem,sock -# logger: - file: @localstatedir@/log/open5gs/amf.log + file: @localstatedir@/log/open5gs/amf.log +# level: info # fatal|error|warn|info(default)|debug|trace -# -# o TLS enable/disable -# sbi: -# server|client: -# no_tls: false|true -# - false: (Default) Use TLS -# - true: TLS disabled -# -# o Verification enable/disable -# sbi: -# server|client: -# no_verify: false|true -# - false: (Default) Verify the PEER -# - true: Skip the verification step -# -# o Server-side does not use TLS -# sbi: -# server: -# no_tls: true -# -# o Client-side skips the verification step -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# -# o Use the specified certificate while verifying the client -# sbi: -# server -# cacert: /etc/open5gs/tls/ca.crt -# -# o Use the specified certificate while verifying the server -# sbi: -# client -# cacert: /etc/open5gs/tls/ca.crt -# -sbi: +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +amf: + sbi: server: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/amf.key - cert: @sysconfdir@/open5gs/tls/amf.crt + - address: 127.0.0.5 + port: 7777 client: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/amf.key - cert: @sysconfdir@/open5gs/tls/amf.crt +# nrf: +# - uri: http://127.0.0.10:7777 + scp: + - uri: http://127.0.0.200:7777 + ngap: + server: + - address: 127.0.0.5 + metrics: + server: + - address: 127.0.0.5 + port: 9090 + 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 + short: Next + amf_name: open5gs-amf0 + time: +# t3502: +# value: 720 # 12 minutes * 60 = 720 seconds + t3512: + value: 540 # 9 minutes * 60 = 540 seconds -# -# -# -# o SBI Server(http://:80) +################################################################################ +# SBI Server +################################################################################ +# o Override SBI address to be advertised to NRF # sbi: # server: -# no_tls: true -# amf: -# sbi: -# -# o SBI Server(http://:7777) -# sbi: -# server: -# no_tls: true -# amf: -# sbi: -# - addr: -# - 0.0.0.0 -# - ::0 -# port: 7777 -# -# o SBI Server(https://:443) -# sbi: -# server: -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# amf: -# sbi: -# -# o SBI Server(https://127.0.0.5:443, https://[::1]:443) without verification -# sbi: -# server: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# amf: -# sbi: -# - addr: 127.0.0.5 -# - addr: ::1 -# -# o SBI Server(https://amf.open5gs.org:443) -# Use the specified certificate while verifying the client -# -# sbi: -# server: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# amf: -# sbi: -# - name: amf.open5gs.org -# -# o SBI Server(http://127.0.0.5:7777) -# sbi: -# server: -# no_tls: true -# amf: -# sbi: -# - addr: 127.0.0.5 -# port: 7777 -# -# o SBI Server(http://:80) -# sbi: -# server: -# no_tls: true -# amf: -# sbi: -# - dev: eth0 -# -# o Provide custom SBI address to be advertised to NRF -# sbi: -# server: -# no_tls: true -# amf: -# sbi: -# - dev: eth0 +# - dev:eth0 # advertise: open5gs-amf.svc.local # -# o Another example of advertising on NRF # sbi: # server: -# no_tls: true -# amf: -# sbi: -# - addr: localhost +# - address: localhost # advertise: # - 127.0.0.99 # - ::1 # -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false +################################################################################ +# SBI Client +################################################################################ +# o Direct communication with NRF interaction +# sbi: +# client: +# nrf: +# - uri: http://127.0.0.10:7777 # +# o Indirect communication with delegated discovery +# sbi: +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# +# o Indirect communication without delegated discovery +# sbi: +# client: +# nrf: +# - uri: http://127.0.0.10:7777 +# scp: +# - uri: http://127.0.0.200:7777 +# discovery: +# delegated: no +# +################################################################################ +# HTTPS scheme with TLS +################################################################################ +# o Set as default if not individually set +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/amf.key +# cert: @sysconfdir@/open5gs/tls/amf.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt # sbi: # server: -# no_tls: true -# amf: -# sbi: -# addr: 127.0.0.5 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -# -# o NF Service Name(Default : all NF services available) -# amf: -# service_name: -# -# o NF Service Name(Only some NF services are available) -# amf: -# service_name: -# - namf-comm -# -# -# -# o (Default) If you do not set Query Parameter as shown below, +# - address: amf.localdomain +# client: +# nrf: +# - uri: https://nrf.localdomain # +# o Add client TLS verification +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/amf.key +# cert: @sysconfdir@/open5gs/tls/amf.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/amf.key +# client_cert: @sysconfdir@/open5gs/tls/amf.crt # sbi: # server: -# no_tls: true -# amf: -# sbi: -# - addr: 127.0.0.5 -# port: 7777 +# - address: amf.localdomain +# client: +# nrf: +# - uri: https://nrf.localdomain # -# - 'service-names' is included. -# -# o Service-Names are not included -# sbi: +################################################################################ +# NGAP Server +################################################################################ +# o Listen on address available in `eth0` interface +# ngap: # server: -# no_tls: true -# amf: -# sbi: -# - addr: 127.0.0.5 -# port: 7777 -# discovery: -# option: -# no_service_names: false -# -# o To remove 'service-names' from URI query parameters in NS Discovery -# no_service_names: true -# -# * For Indirect Communication with Delegated Discovery, -# 'service-names' is always included in the URI query parameter. -# * That is, 'no_service_names' has no effect. -# -# -# -# o (Default) If you do not set Delegated Discovery as shown below, -# -# sbi: -# server: -# no_tls: true -# amf: -# sbi: -# - addr: 127.0.0.5 -# port: 7777 -# -# - Use SCP if SCP avaiable. Otherwise NRF is used. -# => App fails if both NRF and SCP are unavailable. -# -# sbi: -# server: -# no_tls: true -# amf: -# sbi: -# - addr: 127.0.0.5 -# port: 7777 -# discovery: -# delegated: auto -# -# o To use SCP always => App fails if no SCP available. -# delegated: yes -# -# o Don't use SCP server => App fails if no NRF available. -# delegated: no -# -# > -# -# o NGAP Server(all address available) -# amf: -# ngap: -# -# o NGAP Server(0.0.0.0:38412) -# amf: -# ngap: -# addr: 0.0.0.0 -# -# o NGAP Server(127.0.0.5:38412, [::1]:38412) -# amf: -# ngap: -# - addr: 127.0.0.5 -# - addr: ::1 -# -# o NGAP Server(different port) -# amf: -# ngap: -# - addr: 127.0.0.5 -# port: 38413 -# -# o NGAP Server(address available in `eth0` interface) -# amf: -# ngap: -# dev: eth0 -# -# o NGAP Option (Default) -# - sctp_nodelay : true -# - so_linger.l_onoff : false -# -# amf: -# ngap: -# addr: 127.0.0.5 -# option: -# stcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# o NGAP SCTP Option (Default) -# - spp_hbinterval : 5000 (5secs) -# - spp_sackdelay : 200 (200ms) -# - srto_initial : 3000 (3secs) -# - srto_min : 1000 (1sec) -# - srto_max : 5000 (5secs) -# - sinit_num_ostreams : 30 -# - sinit_max_instreams : 65535 -# - sinit_max_attempts : 4 -# - sinit_max_init_timeo : 8000(8secs) -# -# amf: -# ngap: -# addr: 127.0.0.5 -# option: -# sctp: -# spp_hbinterval : 5000 -# spp_sackdelay : 200 -# srto_initial : 3000 -# srto_min : 1000 -# srto_max : 5000 -# sinit_num_ostreams : 30 -# sinit_max_instreams : 65535 -# sinit_max_attempts : 4 -# sinit_max_init_timeo : 8000 -# -# -# -# o Metrics Server(http://:9090) -# amf: -# metrics: -# - addr: 0.0.0.0 -# port: 9090 -# -# -# -# o Multiple GUAMI -# amf: -# guami: -# - plmn_id: -# mcc: 999 -# mnc: 70 -# amf_id: -# region: 2 -# set: 1 -# pointer: 4 -# - plmn_id: -# mcc: 001 -# mnc: 01 -# amf_id: -# region: 5 -# set: 2 -# -# -# -# o Multiple TAI -# -# When multiple TAIs are configured as shown below, -# the Served TAI is determined by comparing UserLocationInformation -# of UplinkNASTransport sent from gNB. -# -# For example, if the gNB sends TAC with 30 to the AMF, -# the fourth TAI (TAC: 20, 28, 29-32, 36-38, 40-42, 50, 60, 70, 70) -# is determined as the Served TAI. The result is transmitted to the gNB -# as a Tracking Area identity List in Registration Accept. -# -# amf: -# tai: -# - plmn_id: -# mcc: 001 -# mnc: 01 -# tac: [1, 3, 5] -# tai: -# - plmn_id: -# mcc: 002 -# mnc: 02 -# tac: [6-10, 15-18] -# tai: -# - plmn_id: -# mcc: 003 -# mnc: 03 -# tac: 20 -# - plmn_id: -# mcc: 004 -# mnc: 04 -# tac: 21 -# tai: -# - plmn_id: -# mcc: 005 -# mnc: 05 -# tac: [22, 28] -# - plmn_id: -# mcc: 006 -# mnc: 06 -# tac: [30-32, 34, 36-38, 40-42, 44, 46, 48] -# - plmn_id: -# mcc: 007 -# mnc: 07 -# tac: 50 -# - plmn_id: -# mcc: 008 -# mnc: 08 -# tac: 60 -# - plmn_id: -# mcc: 009 -# mnc: 09 -# tac: [70, 80] -# -# -# -# o Multiple PLMN Support -# amf: -# plmn_support: -# - plmn_id: -# mcc: 999 -# mnc: 70 -# s_nssai: -# - sst: 1 -# sd: 010000 -# - plmn_id: -# mcc: 999 -# mnc: 70 -# s_nssai: -# - sst: 1 -# -# -# -# -# If access_control is not specified, then all networks are allowed -# If access_control is defined, -# no other networks are allowed other than matching plmn_id. -# -# default_reject_cause may be used to overwrite the default error cause #11 -# for non matching plmn_id -# -# for matching plmn_id with reject_cause defined, -# the AMF rejects access with the reject_cause error cause -# -# for matching plmn_id without reject_cause defined, -# the AMF accepts the PLMN traffic -# -# o The example below only accepts 002/02 and 999/70 PLMNs. -# 001/01 is rejected with cause 15, -# and the rest of the PLMNs are rejected with default cause 13. -# -# amf: -# access_control: -# - default_reject_cause: 13 -# - plmn_id: -# reject_cause: 15 -# mcc: 001 -# mnc: 01 -# - plmn_id: -# mcc: 002 -# mnc: 02 -# - plmn_id: -# mcc: 999 -# mnc: 70 -# -# -# -# -# amf: -# network_name: -# full: Open5GS -# short: Next -# -# -# -# amf: -# amf_name: amf1.open5gs.amf.5gc.mnc70.mcc999.3gppnetwork.org -# -# - Default(255) -# -# amf: -# relative_capacity: 100 -# -amf: - sbi: - - addr: 127.0.0.5 - port: 7777 - ngap: - - addr: 127.0.0.5 - metrics: - - addr: 127.0.0.5 - port: 9090 - 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 - -# -# > -# -# o SBI Client(http://127.0.1.10:7777) -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# port: 7777 -# -# o SBI Client(https://127.0.1.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# scp: -# sbi: -# - addr: 127.0.1.10 -# - addr: ::1 -# -# o SBI Client(https://scp.open5gs.org:443) -# Use the specified certificate while verifying the server -# -# sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# scp: -# sbi: -# - name: scp.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fb::1]:80) -# If prefer_ipv4 is true, http://127.0.1.10:80 is selected. -# -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: -# - 127.0.1.10 -# - fd69:f21d:873c:fb::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -scp: - sbi: - - addr: 127.0.1.10 - port: 7777 - -# -# > -# -# o SBI Client(http://127.0.0.10:7777) -# sbi: -# client: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# port: 7777 -# -# o SBI Client(https://127.0.0.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# nrf: -# sbi: -# - addr: 127.0.0.10 -# - addr: ::1 -# -# o SBI Client(https://nrf.open5gs.org:443) -# Use the specified certificate while verifying the server -# -# sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# nrf: -# sbi: -# - name: nrf.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fa::1]:80) -# If prefer_ipv4 is true, http://127.0.0.10:80 is selected. -# -# sbi: -# addr: -# - 127.0.0.10 -# - fd69:f21d:873c:fa::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -#nrf: -# sbi: -# - addr: -# - 127.0.0.10 -# - ::1 -# port: 7777 - -# -# o Disable use of IPv4 addresses (only IPv6) -# parameter: -# no_ipv4: true -# -# o Disable use of IPv6 addresses (only IPv4) -# parameter: -# no_ipv6: true -# -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# parameter: -# prefer_ipv4: true -# -parameter: - -# -# o Maximum Number of UE -# max: -# ue: 1024 -# -# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) -# max: -# peer: 64 -# -max: - -# -# usrsctp: -# udp_port : 9899 -# -usrsctp: - -# -# o NF Instance Heartbeat (Default : 0) -# NFs will not send heart-beat timer in NFProfile -# NRF will send heart-beat timer in NFProfile -# (Default values are used, so no configuration is required) -# -# o NF Instance Heartbeat (20 seconds) -# NFs will send heart-beat timer (20 seconds) in NFProfile -# NRF can change heart-beat timer in NFProfile -# -# time: -# nf_instance: -# heartbeat: 20 -# -# o Message Wait Duration (Default : 10,000 ms = 10 seconds) -# (Default values are used, so no configuration is required) -# -# o Message Wait Duration (3000 ms) -# time: -# message: -# duration: 3000 -# -# o Handover Wait Duration (Default : 300 ms) -# Time to wait for AMF to send UEContextReleaseCommand -# to the source gNB after receiving HandoverNotify -# (Default values are used, so no configuration is required) -# -# o Handover Wait Duration (500ms) -# time: -# handover: -# duration: 500 -# -# o Timers of 5GS mobility/session management -# time: -# t3502: -# value: 720 # 12 minutes * 60 = 720 seconds -# t3512: -# value: 3240 # 54 minutes * 60 = 3240 seconds -# -time: - t3512: - value: 540 # 9 mintues * 60 = 540 seconds +# - dev: eth0 +# +################################################################################ +# 3GPP Specification +################################################################################ +# o GUAMI +# guami: +# - plmn_id: +# mcc: 999 +# mnc: 70 +# amf_id: +# region: 2 +# set: 1 +# pointer: 4 +# - plmn_id: +# mcc: 001 +# mnc: 01 +# amf_id: +# region: 5 +# set: 2 +# +# o TAI +# tai: +# - plmn_id: +# mcc: 001 +# mnc: 01 +# tac: [1, 3, 5] +# tai: +# - plmn_id: +# mcc: 002 +# mnc: 02 +# tac: [6-10, 15-18] +# tai: +# - plmn_id: +# mcc: 003 +# mnc: 03 +# tac: 20 +# - plmn_id: +# mcc: 004 +# mnc: 04 +# tac: 21 +# tai: +# - plmn_id: +# mcc: 005 +# mnc: 05 +# tac: [22, 28] +# - plmn_id: +# mcc: 006 +# mnc: 06 +# tac: [30-32, 34, 36-38, 40-42, 44, 46, 48] +# - plmn_id: +# mcc: 007 +# mnc: 07 +# tac: 50 +# - plmn_id: +# mcc: 008 +# mnc: 08 +# tac: 60 +# - plmn_id: +# mcc: 009 +# mnc: 09 +# tac: [70, 80] +# +# o PLMN Support +# plmn_support: +# - plmn_id: +# mcc: 999 +# mnc: 70 +# s_nssai: +# - sst: 1 +# sd: 010000 +# - plmn_id: +# mcc: 999 +# mnc: 70 +# s_nssai: +# - sst: 1 +# +# o Access Control +# access_control: +# - default_reject_cause: 13 +# - plmn_id: +# reject_cause: 15 +# mcc: 001 +# mnc: 01 +# - plmn_id: +# mcc: 002 +# mnc: 02 +# - plmn_id: +# mcc: 999 +# mnc: 70 +# +# o Relative Capacity +# relative_capacity: 100 diff --git a/configs/open5gs/ausf.yaml.in b/configs/open5gs/ausf.yaml.in index 9d81a7820..a7330403a 100644 --- a/configs/open5gs/ausf.yaml.in +++ b/configs/open5gs/ausf.yaml.in @@ -1,441 +1,101 @@ -# -# o Set OGS_LOG_INFO to all domain level -# - If `level` is omitted, the default level is OGS_LOG_INFO) -# - If `domain` is omitted, the all domain level is set from 'level' -# (Default values are used, so no configuration is required) -# -# o Set OGS_LOG_ERROR to all domain level -# - `level` can be set with none, fatal, error, warn, info, debug, trace -# logger: -# level: error -# -# o Set OGS_LOG_DEBUG to mme/emm domain level -# logger: -# level: debug -# domain: mme,emm -# -# o Set OGS_LOG_TRACE to all domain level -# logger: -# level: trace -# domain: core,sbi,ausf,event,tlv,mem,sock -# logger: - file: @localstatedir@/log/open5gs/ausf.log + file: @localstatedir@/log/open5gs/ausf.log +# level: info # fatal|error|warn|info(default)|debug|trace -# -# o TLS enable/disable -# sbi: -# server|client: -# no_tls: false|true -# - false: (Default) Use TLS -# - true: TLS disabled -# -# o Verification enable/disable -# sbi: -# server|client: -# no_verify: false|true -# - false: (Default) Verify the PEER -# - true: Skip the verification step -# -# o Server-side does not use TLS -# sbi: -# server: -# no_tls: true -# -# o Client-side skips the verification step -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# -# o Use the specified certificate while verifying the client -# sbi: -# server -# cacert: /etc/open5gs/tls/ca.crt -# -# o Use the specified certificate while verifying the server -# sbi: -# client -# cacert: /etc/open5gs/tls/ca.crt -# -sbi: +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +ausf: + sbi: server: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/ausf.key - cert: @sysconfdir@/open5gs/tls/ausf.crt + - address: 127.0.0.11 + port: 7777 client: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/ausf.key - cert: @sysconfdir@/open5gs/tls/ausf.crt +# nrf: +# - uri: http://127.0.0.10:7777 + scp: + - uri: http://127.0.0.200:7777 -# -# -# -# o SBI Server(http://:80) +################################################################################ +# SBI Server +################################################################################ +# o Override SBI address to be advertised to NRF # sbi: # server: -# no_tls: true -# ausf: -# sbi: -# -# o SBI Server(http://:7777) -# sbi: -# server: -# no_tls: true -# ausf: -# sbi: -# - addr: -# - 0.0.0.0 -# - ::0 -# port: 7777 -# -# o SBI Server(https://:443) -# sbi: -# server: -# key: /etc/open5gs/tls/ausf.key -# cert: /etc/open5gs/tls/ausf.crt -# ausf: -# sbi: -# -# o SBI Server(https://127.0.0.11:443, https://[::1]:443) without verification -# sbi: -# server: -# no_verify: true -# key: /etc/open5gs/tls/ausf.key -# cert: /etc/open5gs/tls/ausf.crt -# ausf: -# sbi: -# - addr: 127.0.0.11 -# - addr: ::1 -# -# o SBI Server(https://ausf.open5gs.org:443) -# Use the specified certificate while verifying the client -# -# sbi: -# server: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/ausf.key -# cert: /etc/open5gs/tls/ausf.crt -# ausf: -# sbi: -# - name: ausf.open5gs.org -# -# o SBI Server(http://127.0.0.11:7777) -# sbi: -# server: -# no_tls: true -# ausf: -# sbi: -# - addr: 127.0.0.11 -# port: 7777 -# -# o SBI Server(http://:80) -# sbi: -# server: -# no_tls: true -# ausf: -# sbi: -# - dev: eth0 -# -# o Provide custom SBI address to be advertised to NRF -# sbi: -# server: -# no_tls: true -# ausf: -# sbi: # - dev: eth0 # advertise: open5gs-ausf.svc.local # -# o Another example of advertising on NRF # sbi: # server: -# no_tls: true -# ausf: -# sbi: -# - addr: localhost +# - address: localhost # advertise: # - 127.0.0.99 # - ::1 # -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false +################################################################################ +# SBI Client +################################################################################ +# o Direct communication with NRF interaction +# sbi: +# client: +# nrf: +# - uri: http://127.0.0.10:7777 # +# o Indirect communication with delegated discovery +# sbi: +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# +# o Indirect communication without delegated discovery +# sbi: +# client: +# nrf: +# - uri: http://127.0.0.10:7777 +# scp: +# - uri: http://127.0.0.200:7777 +# discovery: +# delegated: no +# +################################################################################ +# HTTPS scheme with TLS +################################################################################ +# o Set as default if not individually set +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/ausf.key +# cert: @sysconfdir@/open5gs/tls/ausf.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt # sbi: # server: -# no_tls: true -# ausf: -# sbi: -# addr: 127.0.0.11 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -# -# o NF Service Name(Default : all NF services available) -# ausf: -# service_name: -# -# o NF Service Name(Only some NF services are available) -# ausf: -# service_name: -# - nausf-auth -# -# -# -# o (Default) If you do not set Query Parameter as shown below, +# - address: ausf.localdomain +# client: +# nrf: +# - uri: https://nrf.localdomain # +# o Add client TLS verification +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/ausf.key +# cert: @sysconfdir@/open5gs/tls/ausf.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/ausf.key +# client_cert: @sysconfdir@/open5gs/tls/ausf.crt # sbi: # server: -# no_tls: true -# ausf: -# sbi: -# - addr: 127.0.0.11 -# port: 7777 -# -# - 'service-names' is included. -# -# o Service-Names are not included -# sbi: -# server: -# no_tls: true -# ausf: -# sbi: -# - addr: 127.0.0.11 -# port: 7777 -# discovery: -# option: -# no_service_names: false -# -# o To remove 'service-names' from URI query parameters in NS Discovery -# no_service_names: true -# -# * For Indirect Communication with Delegated Discovery, -# 'service-names' is always included in the URI query parameter. -# * That is, 'no_service_names' has no effect. -# -# -# -# o (Default) If you do not set Delegated Discovery as shown below, -# -# sbi: -# server: -# no_tls: true -# ausf: -# sbi: -# - addr: 127.0.0.11 -# port: 7777 -# -# - Use SCP if SCP avaiable. Otherwise NRF is used. -# => App fails if both NRF and SCP are unavailable. -# -# sbi: -# server: -# no_tls: true -# ausf: -# sbi: -# - addr: 127.0.0.11 -# port: 7777 -# discovery: -# delegated: auto -# -# o To use SCP always => App fails if no SCP available. -# delegated: yes -# -# o Don't use SCP server => App fails if no NRF available. -# delegated: no -# -ausf: - sbi: - - addr: 127.0.0.11 - port: 7777 - -# -# > -# -# o SBI Client(http://127.0.1.10:7777) -# sbi: +# - address: ausf.localdomain # client: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# port: 7777 -# -# o SBI Client(https://127.0.1.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# scp: -# sbi: -# - addr: 127.0.1.10 -# - addr: ::1 -# -# o SBI Client(https://scp.open5gs.org:443) -# Use the specified certificate while verifying the server -# -# sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# scp: -# sbi: -# - name: scp.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fb::1]:80) -# If prefer_ipv4 is true, http://127.0.1.10:80 is selected. -# -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: -# - 127.0.1.10 -# - fd69:f21d:873c:fb::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -scp: - sbi: - - addr: 127.0.1.10 - port: 7777 - -# -# > -# -# o SBI Client(http://127.0.0.10:7777) -# sbi: -# client: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# port: 7777 -# -# o SBI Client(https://127.0.0.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# nrf: -# sbi: -# - addr: 127.0.0.10 -# - addr: ::1 -# -# o SBI Client(https://nrf.open5gs.org:443) -# Use the specified certificate while verifying the server -# -# sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# nrf: -# sbi: -# - name: nrf.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fa::1]:80) -# If prefer_ipv4 is true, http://127.0.0.10:80 is selected. -# -# sbi: -# addr: -# - 127.0.0.10 -# - fd69:f21d:873c:fa::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -#nrf: -# sbi: -# - addr: -# - 127.0.0.10 -# - ::1 -# port: 7777 - -# -# o Disable use of IPv4 addresses (only IPv6) -# parameter: -# no_ipv4: true -# -# o Disable use of IPv6 addresses (only IPv4) -# parameter: -# no_ipv6: true -# -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# parameter: -# prefer_ipv4: true -# -parameter: - -# -# o Maximum Number of UE -# max: -# ue: 1024 -# -# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) -# max: -# peer: 64 -# -max: - -# -# o NF Instance Heartbeat (Default : 0) -# NFs will not send heart-beat timer in NFProfile -# NRF will send heart-beat timer in NFProfile -# (Default values are used, so no configuration is required) -# -# o NF Instance Heartbeat (20 seconds) -# NFs will send heart-beat timer (20 seconds) in NFProfile -# NRF can change heart-beat timer in NFProfile -# -# time: -# nf_instance: -# heartbeat: 20 -# -# o Message Wait Duration (Default : 10,000 ms = 10 seconds) -# (Default values are used, so no configuration is required) -# -# o Message Wait Duration (3000 ms) -# time: -# message: -# duration: 3000 -time: +# nrf: +# - uri: https://nrf.localdomain diff --git a/configs/open5gs/bsf.yaml.in b/configs/open5gs/bsf.yaml.in index ab68354dc..95a6d93da 100644 --- a/configs/open5gs/bsf.yaml.in +++ b/configs/open5gs/bsf.yaml.in @@ -1,441 +1,101 @@ -# -# o Set OGS_LOG_INFO to all domain level -# - If `level` is omitted, the default level is OGS_LOG_INFO) -# - If `domain` is omitted, the all domain level is set from 'level' -# (Default values are used, so no configuration is required) -# -# o Set OGS_LOG_ERROR to all domain level -# - `level` can be set with none, fatal, error, warn, info, debug, trace -# logger: -# level: error -# -# o Set OGS_LOG_DEBUG to mme/emm domain level -# logger: -# level: debug -# domain: mme,emm -# -# o Set OGS_LOG_TRACE to all domain level -# logger: -# level: trace -# domain: core,sbi,ausf,event,tlv,mem,sock -# logger: - file: @localstatedir@/log/open5gs/bsf.log + file: @localstatedir@/log/open5gs/bsf.log +# level: info # fatal|error|warn|info(default)|debug|trace -# -# o TLS enable/disable -# sbi: -# server|client: -# no_tls: false|true -# - false: (Default) Use TLS -# - true: TLS disabled -# -# o Verification enable/disable -# sbi: -# server|client: -# no_verify: false|true -# - false: (Default) Verify the PEER -# - true: Skip the verification step -# -# o Server-side does not use TLS -# sbi: -# server: -# no_tls: true -# -# o Client-side skips the verification step -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# -# o Use the specified certificate while verifying the client -# sbi: -# server -# cacert: /etc/open5gs/tls/ca.crt -# -# o Use the specified certificate while verifying the server -# sbi: -# client -# cacert: /etc/open5gs/tls/ca.crt -# -sbi: +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +bsf: + sbi: server: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/bsf.key - cert: @sysconfdir@/open5gs/tls/bsf.crt + - address: 127.0.0.15 + port: 7777 client: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/bsf.key - cert: @sysconfdir@/open5gs/tls/bsf.crt +# nrf: +# - uri: http://127.0.0.10:7777 + scp: + - uri: http://127.0.0.200:7777 -# -# -# -# o SBI Server(http://:80) +################################################################################ +# SBI Server +################################################################################ +# o Override SBI address to be advertised to NRF # sbi: # server: -# no_tls: true -# bsf: -# sbi: -# -# o SBI Server(http://:7777) -# sbi: -# server: -# no_tls: true -# bsf: -# sbi: -# - addr: -# - 0.0.0.0 -# - ::0 -# port: 7777 -# -# o SBI Server(https://:443) -# sbi: -# server: -# key: /etc/open5gs/tls/bsf.key -# cert: /etc/open5gs/tls/bsf.crt -# bsf: -# sbi: -# -# o SBI Server(https://127.0.0.15:443, https://[::1]:443) without verification -# sbi: -# server: -# no_verify: true -# key: /etc/open5gs/tls/bsf.key -# cert: /etc/open5gs/tls/bsf.crt -# bsf: -# sbi: -# - addr: 127.0.0.15 -# - addr: ::1 -# -# o SBI Server(https://bsf.open5gs.org:443) -# Use the specified certificate while verifying the client -# -# sbi: -# server: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/bsf.key -# cert: /etc/open5gs/tls/bsf.crt -# bsf: -# sbi: -# - name: bsf.open5gs.org -# -# o SBI Server(http://127.0.0.15:7777) -# sbi: -# server: -# no_tls: true -# bsf: -# sbi: -# - addr: 127.0.0.15 -# port: 7777 -# -# o SBI Server(http://:80) -# sbi: -# server: -# no_tls: true -# bsf: -# sbi: -# - dev: eth0 -# -# o Provide custom SBI address to be advertised to NRF -# sbi: -# server: -# no_tls: true -# bsf: -# sbi: # - dev: eth0 # advertise: open5gs-bsf.svc.local # -# o Another example of advertising on NRF # sbi: # server: -# no_tls: true -# bsf: -# sbi: -# - addr: localhost +# - address: localhost # advertise: # - 127.0.0.99 # - ::1 # -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false +################################################################################ +# SBI Client +################################################################################ +# o Direct communication with NRF interaction +# sbi: +# client: +# nrf: +# - uri: http://127.0.0.10:7777 # +# o Indirect communication with delegated discovery +# sbi: +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# +# o Indirect communication without delegated discovery +# sbi: +# client: +# nrf: +# - uri: http://127.0.0.10:7777 +# scp: +# - uri: http://127.0.0.200:7777 +# discovery: +# delegated: no +# +################################################################################ +# HTTPS scheme with TLS +################################################################################ +# o Set as default if not individually set +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/bsf.key +# cert: @sysconfdir@/open5gs/tls/bsf.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt # sbi: # server: -# no_tls: true -# bsf: -# sbi: -# addr: 127.0.0.15 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -# -# o NF Service Name(Default : all NF services available) -# bsf: -# service_name: -# -# o NF Service Name(Only some NF services are available) -# bsf: -# service_name: -# - nbsf-management -# -# -# -# o (Default) If you do not set Query Parameter as shown below, +# - address: bsf.localdomain +# client: +# nrf: +# - uri: https://nrf.localdomain # +# o Add client TLS verification +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/bsf.key +# cert: @sysconfdir@/open5gs/tls/bsf.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/bsf.key +# client_cert: @sysconfdir@/open5gs/tls/bsf.crt # sbi: # server: -# no_tls: true -# bsf: -# sbi: -# - addr: 127.0.0.15 -# port: 7777 -# -# - 'service-names' is included. -# -# o Service-Names are not included -# sbi: -# server: -# no_tls: true -# bsf: -# sbi: -# - addr: 127.0.0.15 -# port: 7777 -# discovery: -# option: -# no_service_names: false -# -# o To remove 'service-names' from URI query parameters in NS Discovery -# no_service_names: true -# -# * For Indirect Communication with Delegated Discovery, -# 'service-names' is always included in the URI query parameter. -# * That is, 'no_service_names' has no effect. -# -# -# -# o (Default) If you do not set Delegated Discovery as shown below, -# -# sbi: -# server: -# no_tls: true -# bsf: -# sbi: -# - addr: 127.0.0.15 -# port: 7777 -# -# - Use SCP if SCP avaiable. Otherwise NRF is used. -# => App fails if both NRF and SCP are unavailable. -# -# sbi: -# server: -# no_tls: true -# bsf: -# sbi: -# - addr: 127.0.0.15 -# port: 7777 -# discovery: -# delegated: auto -# -# o To use SCP always => App fails if no SCP available. -# delegated: yes -# -# o Don't use SCP server => App fails if no NRF available. -# delegated: no -# -bsf: - sbi: - - addr: 127.0.0.15 - port: 7777 - -# -# > -# -# o SBI Client(http://127.0.1.10:7777) -# sbi: +# - address: bsf.localdomain # client: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# port: 7777 -# -# o SBI Client(https://127.0.1.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# scp: -# sbi: -# - addr: 127.0.1.10 -# - addr: ::1 -# -# o SBI Client(https://scp.open5gs.org:443) -# Use the specified certificate while verifying the server -# -# sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# scp: -# sbi: -# - name: scp.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fb::1]:80) -# If prefer_ipv4 is true, http://127.0.1.10:80 is selected. -# -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: -# - 127.0.1.10 -# - fd69:f21d:873c:fb::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -scp: - sbi: - - addr: 127.0.1.10 - port: 7777 - -# -# > -# -# o SBI Client(http://127.0.0.10:7777) -# sbi: -# client: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# port: 7777 -# -# o SBI Client(https://127.0.0.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# nrf: -# sbi: -# - addr: 127.0.0.10 -# - addr: ::1 -# -# o SBI Client(https://nrf.open5gs.org:443) -# Use the specified certificate while verifying the server -# -# sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# nrf: -# sbi: -# - name: nrf.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fa::1]:80) -# If prefer_ipv4 is true, http://127.0.0.10:80 is selected. -# -# sbi: -# addr: -# - 127.0.0.10 -# - fd69:f21d:873c:fa::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -#nrf: -# sbi: -# - addr: -# - 127.0.0.10 -# - ::1 -# port: 7777 - -# -# o Disable use of IPv4 addresses (only IPv6) -# parameter: -# no_ipv4: true -# -# o Disable use of IPv6 addresses (only IPv4) -# parameter: -# no_ipv6: true -# -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# parameter: -# prefer_ipv4: true -# -parameter: - -# -# o Maximum Number of UE -# max: -# ue: 1024 -# -# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) -# max: -# peer: 64 -# -max: - -# -# o NF Instance Heartbeat (Default : 0) -# NFs will not send heart-beat timer in NFProfile -# NRF will send heart-beat timer in NFProfile -# (Default values are used, so no configuration is required) -# -# o NF Instance Heartbeat (20 seconds) -# NFs will send heart-beat timer (20 seconds) in NFProfile -# NRF can change heart-beat timer in NFProfile -# -# time: -# nf_instance: -# heartbeat: 20 -# -# o Message Wait Duration (Default : 10,000 ms = 10 seconds) -# (Default values are used, so no configuration is required) -# -# o Message Wait Duration (3000 ms) -# time: -# message: -# duration: 3000 -time: +# nrf: +# - uri: https://nrf.localdomain diff --git a/configs/open5gs/hss.yaml.in b/configs/open5gs/hss.yaml.in index b9ec60e3f..2e304c021 100644 --- a/configs/open5gs/hss.yaml.in +++ b/configs/open5gs/hss.yaml.in @@ -1,63 +1,14 @@ db_uri: mongodb://localhost/open5gs - -# -# o Set OGS_LOG_INFO to all domain level -# - If `level` is omitted, the default level is OGS_LOG_INFO) -# - If `domain` is omitted, the all domain level is set from 'level' -# (Default values are used, so no configuration is required) -# -# o Set OGS_LOG_ERROR to all domain level -# - `level` can be set with none, fatal, error, warn, info, debug, trace -# logger: -# level: error -# -# o Set OGS_LOG_DEBUG to mme/emm domain level -# logger: -# level: debug -# domain: mme,emm -# -# o Set OGS_LOG_TRACE to all domain level -# logger: -# level: trace -# domain: core,sbi,ausf,event,tlv,mem,sock -# logger: - file: @localstatedir@/log/open5gs/hss.log + file: @localstatedir@/log/open5gs/hss.log +# level: info # fatal|error|warn|info(default)|debug|trace + +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 hss: - freeDiameter: @sysconfdir@/freeDiameter/hss.conf - -# -# hss: -# sms_over_ims: "sip:smsc.mnc001.mcc001.3gppnetwork.org:7060;transport=tcp" -# - -# -# o Disable use of IPv4 addresses (only IPv6) -# parameter: -# no_ipv4: true -# -# o Disable use of IPv6 addresses (only IPv4) -# parameter: -# no_ipv6: true -# -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# parameter: -# prefer_ipv4: true -# -# o Use MongoDB Change Stream -# parameter: -# use_mongodb_change_stream: true -# -parameter: - -# -# o Maximum Number of UE -# max: -# ue: 1024 -# -# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) -# max: -# peer: 64 -# -max: + freeDiameter: @sysconfdir@/freeDiameter/hss.conf +# sms_over_ims: "sip:smsc.mnc001.mcc001.3gppnetwork.org:7060;transport=tcp" +# use_mongodb_change_stream: true diff --git a/configs/open5gs/meson.build b/configs/open5gs/meson.build index 7d6419d4e..ed34d5807 100644 --- a/configs/open5gs/meson.build +++ b/configs/open5gs/meson.build @@ -30,6 +30,8 @@ open5gs_conf = ''' pcrf.yaml nrf.yaml scp.yaml + sepp1.yaml + sepp2.yaml ausf.yaml udm.yaml udr.yaml diff --git a/configs/open5gs/mme.yaml.in b/configs/open5gs/mme.yaml.in index 5c3cfa149..5acf05fdc 100644 --- a/configs/open5gs/mme.yaml.in +++ b/configs/open5gs/mme.yaml.in @@ -1,141 +1,170 @@ -# -# o Set OGS_LOG_INFO to all domain level -# - If `level` is omitted, the default level is OGS_LOG_INFO) -# - If `domain` is omitted, the all domain level is set from 'level' -# (Default values are used, so no configuration is required) -# -# o Set OGS_LOG_ERROR to all domain level -# - `level` can be set with none, fatal, error, warn, info, debug, trace -# logger: -# level: error -# -# o Set OGS_LOG_DEBUG to mme/emm domain level -# logger: -# level: debug -# domain: mme,emm -# -# o Set OGS_LOG_TRACE to all domain level -# logger: -# level: trace -# domain: core,sbi,ausf,event,tlv,mem,sock -# logger: - file: @localstatedir@/log/open5gs/mme.log + file: @localstatedir@/log/open5gs/mme.log +# level: info # fatal|error|warn|info(default)|debug|trace +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +mme: + freeDiameter: @sysconfdir@/freeDiameter/mme.conf + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.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 + short: Next + mme_name: open5gs-mme0 + time: +# t3402: +# value: 720 # 12 minutes * 60 = 720 seconds +# t3412: +# value: 3240 # 54 minutes * 60 = 3240 seconds +# t3423: +# value: 720 # 12 minutes * 60 = 720 seconds + +################################################################################ +# S1AP Server +################################################################################ +# o Listen on address available in `eth0` interface +# ngap: +# server: +# - dev: eth0 # -# > +################################################################################ +# GTP-C Server +################################################################################ +# o Listen on IPv4 and IPv6 +# gtpc: +# server: +# - address: 127.0.0.2 +# - address: ::1 # -# o S1AP Server(all address available) -# mme: -# s1ap: +################################################################################ +# GTP-C Client +################################################################################ +# o SGW selection by eNodeB TAC +# (either single TAC or multiple TACs, DECIMAL representation) +# gtpc: +# client: +# sgwc: +# - address: 127.0.0.3 +# tac: 26000 +# - address: 127.0.2.2 +# tac: [25000, 27000, 28000] # -# o S1AP Server(0.0.0.0:36412) -# mme: -# s1ap: -# addr: 0.0.0.0 +# o SGW selection by e_cell_id(28bit) +# (either single or multiple e_cell_id, HEX representation) +# gtpc: +# client: +# sgwc: +# - address: 127.0.0.3 +# e_cell_id: abcde01 +# - address: 127.0.2.2 +# e_cell_id: [12345, a9413, 98765] # -# o S1AP Server(127.0.0.2:36412, [::1]:36412) -# mme: -# s1ap: -# - addr: 127.0.0.2 -# - addr: ::1 +# o SMF selection by APN +# gtpc: +# client: +# smf: +# - address: 127.0.0.4 +# apn: internet +# - address: 127.0.0.5 +# apn: volte # -# o S1AP Server(different port) -# mme: -# s1ap: -# - addr: 127.0.0.2 -# port: 36413 +# o SMF selection by eNodeB TAC +# (either single TAC or multiple TACs, DECIMAL representation) +# gtpc: +# client: +# smf: +# - address: 127.0.0.4 +# tac: 26000 +# - address: 127.0.2.4 +# tac: [25000, 27000, 28000] # -# o S1AP Server(address available in `eth0` interface) -# mme: -# s1ap: -# dev: eth0 +# o SMF selection by e_cell_id(28bit) +# (either single or multiple e_cell_id, HEX representation) +# gtpc: +# client: +# smf: +# - address: 127.0.0.4 +# e_cell_id: abcde01 +# - address: 127.0.2.4 +# e_cell_id: [12345, a9413, 98765] # -# o S1AP Option (Default) -# - sctp_nodelay : true -# - so_linger.l_onoff : false +# o One SGSN is defined. +# If prefer_ipv4 is not true, [fd69:f21d:873c:fa::2] is selected. +# gtpc: +# client: +# sgsn: +# - address: +# - 127.0.0.3 +# - fd69:f21d:873c:fa::2 +# routes: +# - rai: +# lai: +# plmn_id: +# mcc: 001 +# mnc: 01 +# lac: 43690 +# rac: 187 +# ci: 1223 # -# mme: -# s1ap: -# addr: 127.0.0.2 -# option: -# stcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 # -# o S1AP SCTP Option (Default) -# - spp_hbinterval : 5000 (5secs) -# - spp_sackdelay : 200 (200ms) -# - srto_initial : 3000 (3secs) -# - srto_min : 1000 (1sec) -# - srto_max : 5000 (5secs) -# - sinit_num_ostreams : 30 -# - sinit_max_instreams : 65535 -# - sinit_max_attempts : 4 -# - sinit_max_init_timeo : 8000(8secs) +# o Two SGSNs are defined. Last one is used by default if no +# matching RAI+CI route is found. +# gtpc: +# client: +# sgsn: +# - address: +# - 127.0.0.3 +# - fd69:f21d:873c:fa::2 +# routes: +# - rai: +# lai: +# plmn_id: +# mcc: 001 +# mnc: 01 +# lac: 43690 +# rac: 187 +# ci: 1223 +# - name: sgsn3.open5gs.org +# default_route: true # -# mme: -# s1ap: -# addr: 127.0.0.2 -# option: -# sctp: -# spp_hbinterval : 5000 -# spp_sackdelay : 200 -# srto_initial : 3000 -# srto_min : 1000 -# srto_max : 5000 -# sinit_num_ostreams : 30 -# sinit_max_instreams : 65535 -# sinit_max_attempts : 4 -# sinit_max_init_timeo : 8000 -# -# > -# -# o GTP-C Server(all address available) -# mme: -# gtpc: -# -# o GTP-C Server(127.0.0.2:2123, [::1]:2123) -# mme: -# gtpc: -# - addr: 127.0.0.2 -# - addr: ::1 -# -# -# -# o Single MSC/VLR(127.0.0.2) -# mme: -# sgsap: -# addr: 127.0.0.2 -# map: -# tai: -# plmn_id: -# mcc: 001 -# mnc: 01 -# tac: 4130 -# lai: -# plmn_id: -# mcc: 001 -# mnc: 01 -# lac: 43690 -# map: -# tai: -# plmn_id: -# mcc: 002 -# mnc: 02 -# tac: 4132 -# lai: -# plmn_id: -# mcc: 002 -# mnc: 02 -# lac: 43692 -# -# o Multiple MSC/VLR -# mme: -# sgsap: -# - addr: 127.0.0.2 -# port: 29119 +################################################################################ +# SGaAP Server +################################################################################ +# o MSC/VLR +# sgsap: +# server: +# - address: 127.0.0.2 # map: # tai: # plmn_id: @@ -158,21 +187,7 @@ logger: # mcc: 002 # mnc: 02 # lac: 43692 -# - addr -# - 127.0.0.4 -# - fd69:f21d:873c:fa::2 -# map: -# tai: -# plmn_id: -# mcc: 001 -# mnc: 01 -# tac: 4132 -# lai: -# plmn_id: -# mcc: 002 -# mnc: 02 -# lac: 43692 -# - name: msc.open5gs.org +# - address: msc.open5gs.org # map: # tai: # plmn_id: @@ -185,401 +200,81 @@ logger: # mnc: 02 # lac: 43693 # -# -# -# o Metrics Server(http://:9090) -# mme: -# metrics: -# - addr: 0.0.0.0 -# port: 9090 -# -# -# -# o Multiple GUMMEI -# mme: -# gummei: -# - plmn_id: -# mcc: 001 -# mnc: 01 -# mme_gid: 2 -# mme_code: 1 -# - plmn_id: -# - mcc: 002 -# mnc: 02 -# - mcc: 003 -# mnc: 03 -# mme_gid: [3, 4] -# mme_code: -# - 2 -# - 3 -# -# -# -# -# o Multiple TAI -# -# When multiple TAIs are configured as shown below, -# the Served TAI is determined by comparing UserLocationInformation -# of UplinkNASTransport sent from eNB. -# -# For example, if the eNB sends TAC with 30 to the MME, -# the fourth TAI (TAC: 20, 28, 29-32, 36-38, 40-42, 50, 60, 70, 70) -# is determined as the Served TAI. The result is transmitted to the eNB -# as a Tracking Area identity List in Registration Accept. -# -# mme: -# tai: -# - plmn_id: -# mcc: 001 -# mnc: 01 -# tac: [1, 3, 5] -# tai: -# - plmn_id: -# mcc: 002 +################################################################################ +# 3GPP Specification +################################################################################ +# o GUMMEI +# gummei: +# - plmn_id: +# mcc: 001 +# mnc: 01 +# mme_gid: 2 +# mme_code: 1 +# - plmn_id: +# - mcc: 002 # mnc: 02 -# tac: [6-10, 15-18] -# tai: -# - plmn_id: -# mcc: 003 +# - mcc: 003 # mnc: 03 -# tac: 20 -# - plmn_id: -# mcc: 004 -# mnc: 04 -# tac: 21 -# tai: -# - plmn_id: -# mcc: 005 -# mnc: 05 -# tac: [22, 28] -# - plmn_id: -# mcc: 006 -# mnc: 06 -# tac: [30-32, 34, 36-38, 40-42, 44, 46, 48] -# - plmn_id: -# mcc: 007 -# mnc: 07 -# tac: 50 -# - plmn_id: -# mcc: 008 -# mnc: 08 -# tac: 60 -# - plmn_id: -# mcc: 009 -# mnc: 09 -# tac: [70, 80] +# mme_gid: [3, 4] +# mme_code: +# - 2 +# - 3 # +# o TAI +# tai: +# - plmn_id: +# mcc: 001 +# mnc: 01 +# tac: [1, 3, 5] +# tai: +# - plmn_id: +# mcc: 002 +# mnc: 02 +# tac: [6-10, 15-18] +# tai: +# - plmn_id: +# mcc: 003 +# mnc: 03 +# tac: 20 +# - plmn_id: +# mcc: 004 +# mnc: 04 +# tac: 21 +# tai: +# - plmn_id: +# mcc: 005 +# mnc: 05 +# tac: [22, 28] +# - plmn_id: +# mcc: 006 +# mnc: 06 +# tac: [30-32, 34, 36-38, 40-42, 44, 46, 48] +# - plmn_id: +# mcc: 007 +# mnc: 07 +# tac: 50 +# - plmn_id: +# mcc: 008 +# mnc: 08 +# tac: 60 +# - plmn_id: +# mcc: 009 +# mnc: 09 +# tac: [70, 80] # -# +# o Access Control +# access_control: +# - default_reject_cause: 13 +# - plmn_id: +# reject_cause: 15 +# mcc: 001 +# mnc: 01 +# - plmn_id: +# mcc: 002 +# mnc: 02 +# - plmn_id: +# mcc: 999 +# mnc: 70 # -# If access_control is not specified, then all networks are allowed -# If access_control is defined, -# no other networks are allowed other than matching plmn_id. -# -# default_reject_cause may be used to overwrite the default error cause #11 -# for non matching plmn_id -# -# for matching plmn_id with reject_cause defined, -# the MME rejects access with the reject_cause error cause -# -# for matching plmn_id without reject_cause defined, -# the MME accepts the PLMN traffic -# -# o The example below only accepts 002/02 and 999/70 PLMNs. -# 001/01 is rejected with cause 15, -# and the rest of the PLMNs are rejected with default cause 13. -# -# mme: -# access_control: -# - default_reject_cause: 13 -# - plmn_id: -# reject_cause: 15 -# mcc: 001 -# mnc: 01 -# - plmn_id: -# mcc: 002 -# mnc: 02 -# - plmn_id: -# mcc: 999 -# mnc: 70 -# -# -# -# mme: -# network_name: -# full: Open5GS -# short: Next -# -# -# mme: -# mme_name: open5gs-mme0 -# -# - Default(255) -# mme: -# relative_capacity: 100 -# -mme: - freeDiameter: @sysconfdir@/freeDiameter/mme.conf - s1ap: - - addr: 127.0.0.2 - gtpc: - - addr: 127.0.0.2 - metrics: - - addr: 127.0.0.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 - mme_name: open5gs-mme0 - -# -# -# -# o Specify SGW addresses the GTP-C must connect to -# -# o One SGW is defined. -# If prefer_ipv4 is not true, [fd69:f21d:873c:fa::2] is selected. -# sgwc: -# gtpc: -# addr: -# - 127.0.0.3 -# - fd69:f21d:873c:fa::2 -# -# o Two SGW are defined. MME selects SGW with round-robin manner per UE -# sgwc: -# gtpc: -# - addr: 127.0.0.3 -# - addr: fd69:f21d:873c:fa::2 -# -# o Three SGW are defined. MME selects SGW with round-robin manner per UE -# sgwc: -# gtpc: -# - addr -# - 127.0.0.3 -# - fd69:f21d:873c:fa::2 -# - addr -# - 127.0.0.22 -# - fd69:f21d:873c:fa::12 -# - name: sgw3.open5gs.org -# -# -# -# o Round-Robin -# sgwc: -# gtpc: -# addr: 127.0.0.3 -# addr: 127.0.2.2 -# addr: 127.0.4.2 -# -# o SGW selection by eNodeB TAC -# (either single TAC or multiple TACs, DECIMAL representation) -# -# sgwc: -# gtpc: -# - addr: 127.0.0.3 -# tac: 26000 -# - addr: 127.0.2.2 -# tac: [25000, 27000, 28000] -# -# o SGW selection by e_cell_id(28bit) -# (either single or multiple e_cell_id, HEX representation) -# -# sgwc: -# gtpc: -# - addr: 127.0.0.3 -# e_cell_id: abcde01 -# - addr: 127.0.2.2 -# e_cell_id: [12345, a9413, 98765] -# -sgwc: - gtpc: - - addr: 127.0.0.3 - -# -# smf: -# -# -# -# o By default, the SMF uses the first SMF node. -# - To use a different APN for each SMF, specify gtpc.apn as the APN name. -# - If the HSS uses WebUI to set the SMF IP for each UE, -# you can use a specific SMF node for each UE. -# (Default values are used, so no configuration is required) -# -# o Two SMF are defined. 127.0.0.4:2123 is used. -# [fd69:f21d:873c:fa::3]:2123 is ignored. -# smf: -# gtpc: -# - addr: 127.0.0.4 -# - addr: fd69:f21d:873c:fa::3 -# -# o One SMF is defined. if prefer_ipv4 is not true, -# [fd69:f21d:873c:fa::3] is selected. -# smf: -# gtpc: -# - addr: -# - 127.0.0.4 -# - fd69:f21d:873c:fa::3 -# -# o Two SMF are defined with a different APN. -# - Note that if SMF IP for UE is configured in HSS, -# the following configurion for this UE is ignored. -# smf: -# gtpc: -# - addr: 127.0.0.4 -# apn: internet -# - addr: 127.0.0.5 -# apn: volte -# -# o If APN is omitted, the default APN uses the first SMF node. -# smf: -# gtpc: -# - addr: 127.0.0.4 -# - addr: 127.0.0.5 -# apn: volte -# -# o SMF selection by eNodeB TAC -# (either single TAC or multiple TACs, DECIMAL representation) -# -# gtpc: -# - addr: 127.0.0.4 -# tac: 26000 -# - addr: 127.0.2.4 -# tac: [25000, 27000, 28000] -# -# o SMF selection by e_cell_id(28bit) -# (either single or multiple e_cell_id, HEX representation) -# -# gtpc: -# - addr: 127.0.0.4 -# e_cell_id: abcde01 -# - addr: 127.0.2.4 -# e_cell_id: [12345, a9413, 98765] -smf: - gtpc: - - addr: - - 127.0.0.4 - - ::1 - -# -# -# -# o Specify SGSN addresses the GTPv1C must connect to -# -# o One SGSN is defined. -# If prefer_ipv4 is not true, [fd69:f21d:873c:fa::2] is selected. -# sgsn: -# - gtpc: -# addr: -# - 127.0.0.3 -# - fd69:f21d:873c:fa::2 -# routes: -# - rai: -# lai: -# plmn_id: -# mcc: 001 -# mnc: 01 -# lac: 43690 -# rac: 187 -# ci: 1223 -# -# o Two SGSNs are defined. Last one is used by default if no -# matching RAI+CI route is found. -# sgsn: -# - gtpc: -# addr: -# - 127.0.0.3 -# - fd69:f21d:873c:fa::2 -# routes: -# - rai: -# lai: -# plmn_id: -# mcc: 001 -# mnc: 01 -# lac: 43690 -# rac: 187 -# ci: 1223 -# - name: sgsn3.open5gs.org -# default_route: true -# -sgsn: - - gtpc: - addr: - - 127.0.0.3 - default_route: true - -# -# o Disable use of IPv4 addresses (only IPv6) -# parameter: -# no_ipv4: true -# -# o Disable use of IPv6 addresses (only IPv4) -# parameter: -# no_ipv6: true -# -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# parameter: -# prefer_ipv4: true -# -parameter: - -# -# o Maximum Number of UE -# max: -# ue: 1024 -# -# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) -# max: -# peer: 64 -# -max: - -# -# usrsctp: -# udp_port : 9899 -# -usrsctp: - -# -# o Message Wait Duration (Default : 10,000 ms = 10 seconds) -# (Default values are used, so no configuration is required) -# -# o Message Wait Duration (3000 ms) -# time: -# message: -# duration: 3000 -# -# o Handover Wait Duration (Default : 300 ms) -# Time to wait for MME to send UEContextReleaseCommand -# to the source eNB after receiving HandoverNotify -# (Default values are used, so no configuration is required) -# -# o Handover Wait Duration (500ms) -# time: -# handover: -# duration: 500 -# -# o Timers of EPS mobility/session management -# time: -# t3402: -# value: 720 # 12 minutes * 60 = 720 seconds -# t3412: -# value: 3240 # 54 minutes * 60 = 3240 seconds -# t3423: -# value: 720 # 12 minutes * 60 = 720 seconds -time: - t3412: - value: 540 # 9 mintues * 60 = 540 seconds +# o Relative Capacity +# relative_capacity: 100 diff --git a/configs/open5gs/nrf.yaml.in b/configs/open5gs/nrf.yaml.in index 176ba4a29..cd9e45feb 100644 --- a/configs/open5gs/nrf.yaml.in +++ b/configs/open5gs/nrf.yaml.in @@ -1,337 +1,69 @@ -# -# o Set OGS_LOG_INFO to all domain level -# - If `level` is omitted, the default level is OGS_LOG_INFO) -# - If `domain` is omitted, the all domain level is set from 'level' -# (Default values are used, so no configuration is required) -# -# o Set OGS_LOG_ERROR to all domain level -# - `level` can be set with none, fatal, error, warn, info, debug, trace -# logger: -# level: error -# -# o Set OGS_LOG_DEBUG to mme/emm domain level -# logger: -# level: debug -# domain: mme,emm -# -# o Set OGS_LOG_TRACE to all domain level -# logger: -# level: trace -# domain: core,sbi,ausf,event,tlv,mem,sock -# logger: - file: @localstatedir@/log/open5gs/nrf.log + file: @localstatedir@/log/open5gs/nrf.log +# level: info # fatal|error|warn|info(default)|debug|trace -# -# o TLS enable/disable -# sbi: -# server|client: -# no_tls: false|true -# - false: (Default) Use TLS -# - true: TLS disabled -# -# o Verification enable/disable -# sbi: -# server|client: -# no_verify: false|true -# - false: (Default) Verify the PEER -# - true: Skip the verification step -# -# o Server-side does not use TLS -# sbi: -# server: -# no_tls: true -# -# o Client-side skips the verification step -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# -# o Use the specified certificate while verifying the client -# sbi: -# server -# cacert: /etc/open5gs/tls/ca.crt -# -# o Use the specified certificate while verifying the server -# sbi: -# client -# cacert: /etc/open5gs/tls/ca.crt -# -sbi: +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +nrf: + serving: # 5G roaming requires PLMN in NRF + - plmn_id: + mcc: 999 + mnc: 70 + sbi: server: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/nrf.key - cert: @sysconfdir@/open5gs/tls/nrf.crt - client: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/nrf.key - cert: @sysconfdir@/open5gs/tls/nrf.crt + - address: 127.0.0.10 + port: 7777 -# -# -# -# o SBI Server(http://:80) +################################################################################ +# SBI Server +################################################################################ +# o Override SBI address to be advertised to NRF # sbi: # server: -# no_tls: true -# nrf: -# sbi: -# -# o SBI Server(http://:7777) -# sbi: -# server: -# no_tls: true -# nrf: -# sbi: -# - addr: -# - 0.0.0.0 -# - ::0 -# port: 7777 -# -# o SBI Server(https://:443) -# sbi: -# server: -# key: /etc/open5gs/tls/nrf.key -# cert: /etc/open5gs/tls/nrf.crt -# nrf: -# sbi: -# -# o SBI Server(https://127.0.0.10:443, https://[::1]:443) without verification -# sbi: -# server: -# no_verify: true -# key: /etc/open5gs/tls/nrf.key -# cert: /etc/open5gs/tls/nrf.crt -# nrf: -# sbi: -# - addr: 127.0.0.10 -# - addr: ::1 -# -# o SBI Server(https://nrf.open5gs.org:443) -# Use the specified certificate while verifying the client -# -# sbi: -# server: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/nrf.key -# cert: /etc/open5gs/tls/nrf.crt -# nrf: -# sbi: -# - name: nrf.open5gs.org -# -# o SBI Server(http://127.0.0.10:7777) -# sbi: -# server: -# no_tls: true -# nrf: -# sbi: -# - addr: 127.0.0.10 -# port: 7777 -# -# o SBI Server(http://:80) -# sbi: -# server: -# no_tls: true -# nrf: -# sbi: -# - dev: eth0 -# -# o Provide custom SBI address to be advertised to NRF -# sbi: -# server: -# no_tls: true -# nrf: -# sbi: # - dev: eth0 # advertise: open5gs-nrf.svc.local # -# o Another example of advertising on NRF # sbi: # server: -# no_tls: true -# nrf: -# sbi: -# - addr: localhost +# - address: localhost # advertise: # - 127.0.0.99 # - ::1 # -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# +################################################################################ +# HTTPS scheme with TLS +################################################################################ +# o Set as default if not individually set +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/nrf.key +# cert: @sysconfdir@/open5gs/tls/nrf.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt # sbi: # server: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 +# - address: nrf.localdomain # -# -# -# o NF Service Name(Default : all NF services available) -# nrf: -# service_name: -# -# o NF Service Name(Only some NF services are available) -# nrf: -# service_name: -# - nnrf-nfm -# - nnrf-disc -# -nrf: - sbi: - - addr: - - 127.0.0.10 - - ::1 - port: 7777 - -# -# > -# -# o SBI Client(http://127.0.1.10:7777) +# o Add client TLS verification +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/nrf.key +# cert: @sysconfdir@/open5gs/tls/nrf.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/nrf.key +# client_cert: @sysconfdir@/open5gs/tls/nrf.crt # sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# port: 7777 -# -# o SBI Client(https://127.0.1.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# scp: -# sbi: -# - addr: 127.0.1.10 -# - addr: ::1 -# -# o SBI Client(https://scp.open5gs.org:443) -# Use the specified certificate while verifying the server -# -# sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# scp: -# sbi: -# - name: scp.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fb::1]:80) -# If prefer_ipv4 is true, http://127.0.1.10:80 is selected. -# -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: -# - 127.0.1.10 -# - fd69:f21d:873c:fb::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -scp: - sbi: - - addr: 127.0.1.10 - port: 7777 - - -# -# o Disable use of IPv4 addresses (only IPv6) -# parameter: -# no_ipv4: true -# -# o Disable use of IPv6 addresses (only IPv4) -# parameter: -# no_ipv6: true -# -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# parameter: -# prefer_ipv4: true -# -parameter: - -# -# o Maximum Number of UE -# max: -# ue: 1024 -# -# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) -# max: -# peer: 64 -# -max: - -# -# -# o NF Instance Heartbeat (Default : 10 seconds) -# (Default values are used, so no configuration is required) -# -# o NF Instance Heartbeat (Disabled) -# time: -# nf_instance: -# heartbeat: 0 -# -# o NF Instance Heartbeat (5 seconds) -# time: -# nf_instance: -# heartbeat: 5 -# -# o NF Instance Validity (Default : 3600 seconds = 1 hour) -# (Default values are used, so no configuration is required) -# -# o NF Instance Validity (10 seconds) -# time: -# nf_instance: -# validity: 10 -# -# o Subscription Validity (Default : 86400 seconds = 1 day) -# (Default values are used, so no configuration is required) -# -# o Subscription Validity (Disabled) -# time: -# subscription: -# validity: 0 -# -# o Subscription Validity (3600 seconds = 1 hour) -# time: -# subscription: -# validity: 3600 -# -# o Message Wait Duration (Default : 10,000 ms = 10 seconds) -# (Default values are used, so no configuration is required) -# -# o Message Wait Duration (3000 ms) -# time: -# message: -# duration: 3000 -time: +# server: +# - address: nrf.localdomain diff --git a/configs/open5gs/nssf.yaml.in b/configs/open5gs/nssf.yaml.in index b6c0557c5..d185be250 100644 --- a/configs/open5gs/nssf.yaml.in +++ b/configs/open5gs/nssf.yaml.in @@ -1,499 +1,135 @@ -# -# o Set OGS_LOG_INFO to all domain level -# - If `level` is omitted, the default level is OGS_LOG_INFO) -# - If `domain` is omitted, the all domain level is set from 'level' -# (Default values are used, so no configuration is required) -# -# o Set OGS_LOG_ERROR to all domain level -# - `level` can be set with none, fatal, error, warn, info, debug, trace -# logger: -# level: error -# -# o Set OGS_LOG_DEBUG to mme/emm domain level -# logger: -# level: debug -# domain: mme,emm -# -# o Set OGS_LOG_TRACE to all domain level -# logger: -# level: trace -# domain: core,sbi,ausf,event,tlv,mem,sock -# logger: - file: @localstatedir@/log/open5gs/nssf.log + file: @localstatedir@/log/open5gs/nssf.log +# level: info # fatal|error|warn|info(default)|debug|trace -# -# o TLS enable/disable -# sbi: -# server|client: -# no_tls: false|true -# - false: (Default) Use TLS -# - true: TLS disabled -# -# o Verification enable/disable -# sbi: -# server|client: -# no_verify: false|true -# - false: (Default) Verify the PEER -# - true: Skip the verification step -# -# o Server-side does not use TLS -# sbi: -# server: -# no_tls: true -# -# o Client-side skips the verification step -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# -# o Use the specified certificate while verifying the client -# sbi: -# server -# cacert: /etc/open5gs/tls/ca.crt -# -# o Use the specified certificate while verifying the server -# sbi: -# client -# cacert: /etc/open5gs/tls/ca.crt -# -sbi: +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +nssf: + sbi: server: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/nssf.key - cert: @sysconfdir@/open5gs/tls/nssf.crt + - address: 127.0.0.14 + port: 7777 client: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/nssf.key - cert: @sysconfdir@/open5gs/tls/nssf.crt - -# -# -# -# o SBI Server(http://:80) +# nrf: +# - uri: http://127.0.0.10:7777 + scp: + - uri: http://127.0.0.200:7777 + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 +################################################################################ +# SBI Server +################################################################################ +# o Override SBI address to be advertised to NRF # sbi: # server: -# no_tls: true -# nssf: -# sbi: -# -# o SBI Server(http://:7777) -# sbi: -# server: -# no_tls: true -# nssf: -# sbi: -# - addr: -# - 0.0.0.0 -# - ::0 -# port: 7777 -# -# o SBI Server(https://:443) -# sbi: -# server: -# key: /etc/open5gs/tls/nssf.key -# cert: /etc/open5gs/tls/nssf.crt -# nssf: -# sbi: -# -# o SBI Server(https://127.0.0.14:443, https://[::1]:443) without verification -# sbi: -# server: -# no_verify: true -# key: /etc/open5gs/tls/nssf.key -# cert: /etc/open5gs/tls/nssf.crt -# nssf: -# sbi: -# - addr: 127.0.0.14 -# - addr: ::1 -# -# o SBI Server(https://nssf.open5gs.org:443) -# Use the specified certificate while verifying the client -# -# sbi: -# server: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/nssf.key -# cert: /etc/open5gs/tls/nssf.crt -# nssf: -# sbi: -# - name: nssf.open5gs.org -# -# o SBI Server(http://127.0.0.14:7777) -# sbi: -# server: -# no_tls: true -# nssf: -# sbi: -# - addr: 127.0.0.14 -# port: 7777 -# -# o SBI Server(http://:80) -# sbi: -# server: -# no_tls: true -# nssf: -# sbi: -# - dev: eth0 -# -# o Provide custom SBI address to be advertised to NRF -# sbi: -# server: -# no_tls: true -# nssf: -# sbi: # - dev: eth0 # advertise: open5gs-nssf.svc.local # -# o Another example of advertising on NRF # sbi: # server: -# no_tls: true -# nssf: -# sbi: -# - addr: localhost +# - address: localhost # advertise: # - 127.0.0.99 # - ::1 # -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# server: -# no_tls: true -# nssf: -# sbi: -# addr: 127.0.0.14 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -# -# o One NSI -# - NRF[http://::1:7777/nnrf-nfm/v1/nf-instances] -# NSSAI[SST:1] -# -# nssf: -# nsi: -# - addr: ::1 -# port: 7777 -# s_nssai: -# sst: 1 -# -# o Three NSI +################################################################################ +# SBI Client +################################################################################ +# o Network Slice Instance(NSI) # 1. NRF[http://::1:7777/nnrf-nfm/v1/nf-instances] # S-NSSAI[SST:1] -# # 2. NRF[http://127.0.0.19:7777/nnrf-nfm/v1/nf-instances] # NSSAI[SST:1, SD:000080] -# -# 2. NRF[http://127.0.0.10:7777/nnrf-nfm/v1/nf-instances] +# 3. NRF[http://127.0.0.10:7777/nnrf-nfm/v1/nf-instances] # NSSAI[SST:1, SD:009000] # -# nssf: -# nsi: -# - addr: ::1 -# port: 7777 -# s_nssai: -# sst: 1 -# - addr: 127.0.0.19 -# port: 7777 -# s_nssai: -# sst: 1 -# sd: 000080 -# - addr: 127.0.0.10 -# port: 7777 -# s_nssai: -# sst: 1 -# sd: 009000 +# sbi: +# client: +# nsi: +# - uri: http://[::1]:7777 +# s_nssai: +# sst: 1 +# - uri: http://127.0.0.19:7777 +# s_nssai: +# sst: 1 +# sd: 000080 +# - uri: http://127.0.0.10:7777 +# s_nssai: +# sst: 1 +# sd: 009000 # -# o NSI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false +# o Direct communication with NRF interaction +# sbi: +# client: +# nrf: +# - uri: http://127.0.0.10:7777 # -# nssf: -# nsi: -# addr: ::1 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 +# o Indirect communication with delegated discovery +# sbi: +# client: +# scp: +# - uri: http://127.0.0.200:7777 # -# -# -# o NF Service Name(Default : all NF services available) -# nssf: -# service_name: -# -# o NF Service Name(Only some NF services are available) -# nssf: -# service_name: -# - nnssf-nsselection -# -# -# -# o (Default) If you do not set Query Parameter as shown below, +# o Indirect communication without delegated discovery +# sbi: +# client: +# nrf: +# - uri: http://127.0.0.10:7777 +# scp: +# - uri: http://127.0.0.200:7777 +# discovery: +# delegated: no # +################################################################################ +# HTTPS scheme with TLS +################################################################################ +# o Set as default if not individually set +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/nssf.key +# cert: @sysconfdir@/open5gs/tls/nssf.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt # sbi: # server: -# no_tls: true -# nssf: -# sbi: -# - addr: 127.0.0.14 -# port: 7777 +# - address: nssf.localdomain +# client: +# nrf: +# - uri: https://nrf.localdomain +# nsi: +# - uri: https://nrf.localdomain +# s_nssai: +# sst: 1 # -# - 'service-names' is included. -# -# o Service-Names are not included +# o Add client TLS verification +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/nssf.key +# cert: @sysconfdir@/open5gs/tls/nssf.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/nssf.key +# client_cert: @sysconfdir@/open5gs/tls/nssf.crt # sbi: # server: -# no_tls: true -# nssf: -# sbi: -# - addr: 127.0.0.14 -# port: 7777 -# discovery: -# option: -# no_service_names: false -# -# o To remove 'service-names' from URI query parameters in NS Discovery -# no_service_names: true -# -# * For Indirect Communication with Delegated Discovery, -# 'service-names' is always included in the URI query parameter. -# * That is, 'no_service_names' has no effect. -# -# -# -# o (Default) If you do not set Delegated Discovery as shown below, -# -# sbi: -# server: -# no_tls: true -# nssf: -# sbi: -# - addr: 127.0.0.14 -# port: 7777 -# -# - Use SCP if SCP avaiable. Otherwise NRF is used. -# => App fails if both NRF and SCP are unavailable. -# -# sbi: -# server: -# no_tls: true -# nssf: -# sbi: -# - addr: 127.0.0.14 -# port: 7777 -# discovery: -# delegated: auto -# -# o To use SCP always => App fails if no SCP available. -# delegated: yes -# -# o Don't use SCP server => App fails if no NRF available. -# delegated: no -# -nssf: - sbi: - - addr: 127.0.0.14 - port: 7777 - nsi: - - addr: 127.0.0.10 - port: 7777 - s_nssai: - sst: 1 - -# -# > -# -# o SBI Client(http://127.0.1.10:7777) -# sbi: +# - address: nssf.localdomain # client: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# port: 7777 -# -# o SBI Client(https://127.0.1.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# scp: -# sbi: -# - addr: 127.0.1.10 -# - addr: ::1 -# -# o SBI Client(https://scp.open5gs.org:443) -# Use the specified certificate while verifying the server -# -# sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# scp: -# sbi: -# - name: scp.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fb::1]:80) -# If prefer_ipv4 is true, http://127.0.1.10:80 is selected. -# -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: -# - 127.0.1.10 -# - fd69:f21d:873c:fb::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -scp: - sbi: - - addr: 127.0.1.10 - port: 7777 - -# -# > -# -# o SBI Client(http://127.0.0.10:7777) -# sbi: -# client: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# port: 7777 -# -# o SBI Client(https://127.0.0.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# nrf: -# sbi: -# - addr: 127.0.0.10 -# - addr: ::1 -# -# o SBI Client(https://nrf.open5gs.org:443) -# Use the specified certificate while verifying the server -# -# sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# nrf: -# sbi: -# - name: nrf.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fa::1]:80) -# If prefer_ipv4 is true, http://127.0.0.10:80 is selected. -# -# sbi: -# addr: -# - 127.0.0.10 -# - fd69:f21d:873c:fa::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -#nrf: -# sbi: -# - addr: -# - 127.0.0.10 -# - ::1 -# port: 7777 - -# -# o Disable use of IPv4 addresses (only IPv6) -# parameter: -# no_ipv4: true -# -# o Disable use of IPv6 addresses (only IPv4) -# parameter: -# no_ipv6: true -# -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# parameter: -# prefer_ipv4: true -# -parameter: - -# -# o Maximum Number of UE -# max: -# ue: 1024 -# -# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) -# max: -# peer: 64 -# -max: - -# -# o NF Instance Heartbeat (Default : 0) -# NFs will not send heart-beat timer in NFProfile -# NRF will send heart-beat timer in NFProfile -# (Default values are used, so no configuration is required) -# -# o NF Instance Heartbeat (20 seconds) -# NFs will send heart-beat timer (20 seconds) in NFProfile -# NRF can change heart-beat timer in NFProfile -# -# time: -# nf_instance: -# heartbeat: 20 -# -# o Message Wait Duration (Default : 10,000 ms = 10 seconds) -# (Default values are used, so no configuration is required) -# -# o Message Wait Duration (3000 ms) -# time: -# message: -# duration: 3000 -time: +# nrf: +# - uri: https://nrf.localdomain +# nsi: +# - uri: https://nrf.localdomain +# s_nssai: +# sst: 1 diff --git a/configs/open5gs/pcf.yaml.in b/configs/open5gs/pcf.yaml.in index 939ade8d4..2df2e9a36 100644 --- a/configs/open5gs/pcf.yaml.in +++ b/configs/open5gs/pcf.yaml.in @@ -1,427 +1,227 @@ db_uri: mongodb://localhost/open5gs - -# -# o Set OGS_LOG_INFO to all domain level -# - If `level` is omitted, the default level is OGS_LOG_INFO) -# - If `domain` is omitted, the all domain level is set from 'level' -# (Default values are used, so no configuration is required) -# -# o Set OGS_LOG_ERROR to all domain level -# - `level` can be set with none, fatal, error, warn, info, debug, trace -# logger: -# level: error -# -# o Set OGS_LOG_DEBUG to mme/emm domain level -# logger: -# level: debug -# domain: mme,emm -# -# o Set OGS_LOG_TRACE to all domain level -# logger: -# level: trace -# domain: core,sbi,ausf,event,tlv,mem,sock -# logger: - file: @localstatedir@/log/open5gs/pcf.log + file: @localstatedir@/log/open5gs/pcf.log +# level: info # fatal|error|warn|info(default)|debug|trace -# -# o TLS enable/disable -# sbi: -# server|client: -# no_tls: false|true -# - false: (Default) Use TLS -# - true: TLS disabled -# -# o Verification enable/disable -# sbi: -# server|client: -# no_verify: false|true -# - false: (Default) Verify the PEER -# - true: Skip the verification step -# -# o Server-side does not use TLS -# sbi: -# server: -# no_tls: true -# -# o Client-side skips the verification step -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# -# o Use the specified certificate while verifying the client -# sbi: -# server -# cacert: /etc/open5gs/tls/ca.crt -# -# o Use the specified certificate while verifying the server -# sbi: -# client -# cacert: /etc/open5gs/tls/ca.crt -# -sbi: +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +pcf: + sbi: server: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/pcf.key - cert: @sysconfdir@/open5gs/tls/pcf.crt + - address: 127.0.0.13 + port: 7777 client: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/pcf.key - cert: @sysconfdir@/open5gs/tls/pcf.crt +# nrf: +# - uri: http://127.0.0.10:7777 + scp: + - uri: http://127.0.0.200:7777 + metrics: + server: + - address: 127.0.0.13 + port: 9090 +################################################################################ +# Locally configured policy +# - The PCF in the VPLMN uses locally configured policies +# according to the roaming agreement with the HPLMN operator +# as input for PCC Rule generation. +################################################################################ # -# +# o You don't have to use MongoDB if you use the policy configuration as below. # -# o SBI Server(http://:80) +# 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 +# flow: +# - direction: 2 +# description: "permit out icmp from any to assigned" +# - direction: 1 +# description: "permit out icmp from any to assigned" +# - direction: 2 +# description: "permit out udp from 10.200.136.98/32 23455 to assigned 1-65535" +# - direction: 1 +# description: "permit out udp from 10.200.136.98/32 1-65535 to assigned 50021" +# - 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 +# sd: 000001 +# 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 +# +################################################################################ +# SBI Server +################################################################################ +# o Override SBI address to be advertised to NRF # sbi: # server: -# no_tls: true -# pcf: -# sbi: -# -# o SBI Server(http://:7777) -# sbi: -# server: -# no_tls: true -# pcf: -# sbi: -# - addr: -# - 0.0.0.0 -# - ::0 -# port: 7777 -# -# o SBI Server(https://:443) -# sbi: -# server: -# key: /etc/open5gs/tls/pcf.key -# cert: /etc/open5gs/tls/pcf.crt -# pcf: -# sbi: -# -# o SBI Server(https://127.0.0.13:443, https://[::1]:443) without verification -# sbi: -# server: -# no_verify: true -# key: /etc/open5gs/tls/pcf.key -# cert: /etc/open5gs/tls/pcf.crt -# pcf: -# sbi: -# - addr: 127.0.0.13 -# - addr: ::1 -# -# o SBI Server(https://pcf.open5gs.org:443) -# Use the specified certificate while verifying the client -# -# sbi: -# server: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/pcf.key -# cert: /etc/open5gs/tls/pcf.crt -# pcf: -# sbi: -# - name: pcf.open5gs.org -# -# o SBI Server(http://127.0.0.13:7777) -# sbi: -# server: -# no_tls: true -# pcf: -# sbi: -# - addr: 127.0.0.13 -# port: 7777 -# -# o SBI Server(http://:80) -# sbi: -# server: -# no_tls: true -# pcf: -# sbi: -# - dev: eth0 -# -# o Provide custom SBI address to be advertised to NRF -# sbi: -# server: -# no_tls: true -# pcf: -# sbi: # - dev: eth0 # advertise: open5gs-pcf.svc.local # -# o Another example of advertising on NRF # sbi: # server: -# no_tls: true -# pcf: -# sbi: -# - addr: localhost +# - address: localhost # advertise: # - 127.0.0.99 # - ::1 # -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# +################################################################################ +# SBI Client +################################################################################ +# o Direct communication with NRF interaction # sbi: -# server: -# no_tls: true -# pcf: -# sbi: -# addr: 127.0.0.13 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -# -# o NF Service Name(Default : all NF services available) -# pcf: -# service_name: -# -# o NF Service Name(Only some NF services are available) -# pcf: -# service_name: -# - npcf-am-policy-control -# - npcf-smpolicycontrol -# - npcf-policyauthorization -# -# == NOTE == -# Placing npcf-smpolicycontrol and pcf-policyauthorization -# in different NFs is not supported. Both npcf-smpolicycontrol -# and pcf-policyauthorization should be placed in the same NF. -# -# -# -# o (Default) If you do not set Query Parameter as shown below, -# -# sbi: -# - addr: 127.0.0.13 -# port: 7777 -# -# - 'service-names' is included. -# -# sbi: -# - addr: 127.0.0.13 -# port: 7777 -# discovery: -# option: -# no_service_names: false -# -# o To remove 'service-names' from URI query parameters in NS Discovery -# no_service_names: true -# -# * For Indirect Communication with Delegated Discovery, -# 'service-names' is always included in the URI query parameter. -# * That is, 'no_service_names' has no effect. -# -# -# -# o (Default) If you do not set Delegated Discovery as shown below, -# -# sbi: -# server: -# no_tls: true -# pcf: -# sbi: -# - addr: 127.0.0.13 -# port: 7777 -# -# - Use SCP if SCP avaiable. Otherwise NRF is used. -# => App fails if both NRF and SCP are unavailable. -# -# sbi: -# server: -# no_tls: true -# pcf: -# sbi: -# - addr: 127.0.0.13 -# port: 7777 -# discovery: -# delegated: auto -# -# o To use SCP always => App fails if no SCP available. -# delegated: yes -# -# o Don't use SCP server => App fails if no NRF available. -# delegated: no -# -# -# -# -# o Metrics Server(http://:9090) -# pcf: -# metrics: -# - addr: 0.0.0.0 -# port: 9090 -# -pcf: - sbi: - - addr: 127.0.0.13 - port: 7777 - metrics: - - addr: 127.0.0.13 - port: 9090 - -# -# scp: -# -# > -# -# o SBI Client(http://127.0.1.10:7777) -# sbi: -# addr: 127.0.1.10 -# port: 7777 -# -# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80) -# sbi: -# - addr: 127.0.1.10 -# tls: -# key: /etc/open5gs/tls/pcf.key -# cert: /etc/open5gs/tls/pcf.crt -# - name: scp.open5gs.org -# -# o SBI Client(https://scp.open5gs.org:443) -# Use the specified certificate to verify peer -# -# sbi: -# - name: scp.open5gs.org -# tls: -# cacert: /etc/open5gs/tls/ca.crt -# -# o SBI Client(http://[fd69:f21d:873c:fb::1]:80) -# If prefer_ipv4 is true, http://127.0.1.10:80 is selected. -# -# sbi: -# addr: -# - 127.0.1.10 -# - fd69:f21d:873c:fb::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# addr: 127.0.1.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -scp: - sbi: - - addr: 127.0.1.10 - port: 7777 - -# -# nrf: -# -# > -# -# o SBI Client(http://127.0.0.10:7777) -# sbi: -# addr: 127.0.0.10 -# port: 7777 -# -# o SBI Client(https://127.0.0.10:443, https://[::1]:443) -# tls: # client: -# key: /etc/open5gs/tls/pcf.key -# cert: /etc/open5gs/tls/pcf.crt -# nrf: -# sbi: -# - addr: 127.0.0.10 -# - addr: ::1 +# nrf: +# - uri: http://127.0.0.10:7777 # -# o SBI Client(https://nrf.open5gs.org:443) -# Use the specified certificate to verify server -# -# tls: +# o Indirect communication with delegated discovery +# sbi: # client: -# cacert: /etc/open5gs/tls/ca.crt -# nrf: -# sbi: -# - name: nrf.open5gs.org +# scp: +# - uri: http://127.0.0.200:7777 # -# o SBI Client(http://[fd69:f21d:873c:fa::1]:80) -# If prefer_ipv4 is true, http://127.0.0.10:80 is selected. +# o Indirect communication without delegated discovery +# sbi: +# client: +# nrf: +# - uri: http://127.0.0.10:7777 +# scp: +# - uri: http://127.0.0.200:7777 +# discovery: +# delegated: no # -# sbi: -# addr: -# - 127.0.0.10 -# - fd69:f21d:873c:fa::1 +################################################################################ +# HTTPS scheme with TLS +################################################################################ +# o Set as default if not individually set +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/pcf.key +# cert: @sysconfdir@/open5gs/tls/pcf.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# sbi: +# server: +# - address: pcf.localdomain +# client: +# nrf: +# - uri: https://nrf.localdomain # -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# addr: 127.0.0.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -#nrf: -# sbi: -# - addr: -# - 127.0.0.10 -# - ::1 -# port: 7777 - -# -# o Disable use of IPv4 addresses (only IPv6) -# parameter: -# no_ipv4: true -# -# o Disable use of IPv6 addresses (only IPv4) -# parameter: -# no_ipv6: true -# -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# parameter: -# prefer_ipv4: true -# -parameter: - -# -# o Maximum Number of UE -# max: -# ue: 1024 -# -# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) -# max: -# peer: 64 -# -max: - -# -# o NF Instance Heartbeat (Default : 0) -# NFs will not send heart-beat timer in NFProfile -# NRF will send heart-beat timer in NFProfile -# (Default values are used, so no configuration is required) -# -# o NF Instance Heartbeat (20 seconds) -# NFs will send heart-beat timer (20 seconds) in NFProfile -# NRF can change heart-beat timer in NFProfile -# -# time: -# nf_instance: -# heartbeat: 20 -# -# o Message Wait Duration (Default : 10,000 ms = 10 seconds) -# (Default values are used, so no configuration is required) -# -# o Message Wait Duration (3000 ms) -# time: -# message: -# duration: 3000 -time: +# o Add client TLS verification +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/pcf.key +# cert: @sysconfdir@/open5gs/tls/pcf.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/pcf.key +# client_cert: @sysconfdir@/open5gs/tls/pcf.crt +# sbi: +# server: +# - address: pcf.localdomain +# client: +# nrf: +# - uri: https://nrf.localdomain diff --git a/configs/open5gs/pcrf.yaml.in b/configs/open5gs/pcrf.yaml.in index eb38fd941..4cf913ab6 100644 --- a/configs/open5gs/pcrf.yaml.in +++ b/configs/open5gs/pcrf.yaml.in @@ -1,54 +1,100 @@ db_uri: mongodb://localhost/open5gs - -# -# o Set OGS_LOG_INFO to all domain level -# - If `level` is omitted, the default level is OGS_LOG_INFO) -# - If `domain` is omitted, the all domain level is set from 'level' -# (Default values are used, so no configuration is required) -# -# o Set OGS_LOG_ERROR to all domain level -# - `level` can be set with none, fatal, error, warn, info, debug, trace -# logger: -# level: error -# -# o Set OGS_LOG_DEBUG to mme/emm domain level -# logger: -# level: debug -# domain: mme,emm -# -# o Set OGS_LOG_TRACE to all domain level -# logger: -# level: trace -# domain: core,sbi,ausf,event,tlv,mem,sock -# logger: - file: @localstatedir@/log/open5gs/pcrf.log + file: @localstatedir@/log/open5gs/pcrf.log +# level: info # fatal|error|warn|info(default)|debug|trace -pcrf: - freeDiameter: @sysconfdir@/freeDiameter/pcrf.conf - -# -# o Disable use of IPv4 addresses (only IPv6) -# parameter: -# no_ipv4: true -# -# o Disable use of IPv6 addresses (only IPv4) -# parameter: -# no_ipv6: true -# -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# parameter: -# prefer_ipv4: true -# -parameter: - -# -# o Maximum Number of UE -# max: -# ue: 1024 -# -# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) -# max: +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. # peer: 64 +pcrf: + freeDiameter: @sysconfdir@/freeDiameter/pcrf.conf + +################################################################################ +# Locally configured policy +################################################################################ +# +# o You don't have to use MongoDB if you use the policy configuration as below. +# +# 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 +# flow: +# - direction: 2 +# description: "permit out icmp from any to assigned" +# - direction: 1 +# description: "permit out icmp from any to assigned" +# - direction: 2 +# description: "permit out udp from 10.200.136.98/32 23455 to assigned 1-65535" +# - direction: 1 +# description: "permit out udp from 10.200.136.98/32 1-65535 to assigned 50021" +# - 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 # -max: diff --git a/configs/open5gs/scp.yaml.in b/configs/open5gs/scp.yaml.in index 339ece80d..2387410da 100644 --- a/configs/open5gs/scp.yaml.in +++ b/configs/open5gs/scp.yaml.in @@ -1,439 +1,85 @@ -db_uri: mongodb://localhost/open5gs - -# -# o Set OGS_LOG_INFO to all domain level -# - If `level` is omitted, the default level is OGS_LOG_INFO) -# - If `domain` is omitted, the all domain level is set from 'level' -# (Default values are used, so no configuration is required) -# -# o Set OGS_LOG_ERROR to all domain level -# - `level` can be set with none, fatal, error, warn, info, debug, trace -# logger: -# level: error -# -# o Set OGS_LOG_DEBUG to mme/emm domain level -# logger: -# level: debug -# domain: mme,emm -# -# o Set OGS_LOG_TRACE to all domain level -# logger: -# level: trace -# domain: core,sbi,ausf,event,tlv,mem,sock -# logger: - file: @localstatedir@/log/open5gs/scp.log + file: @localstatedir@/log/open5gs/scp.log +# level: info # fatal|error|warn|info(default)|debug|trace -# -# o TLS enable/disable -# sbi: -# server|client: -# no_tls: false|true -# - false: (Default) Use TLS -# - true: TLS disabled -# -# o Verification enable/disable -# sbi: -# server|client: -# no_verify: false|true -# - false: (Default) Verify the PEER -# - true: Skip the verification step -# -# o Server-side does not use TLS -# sbi: -# server: -# no_tls: true -# -# o Client-side skips the verification step -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# -# o Use the specified certificate while verifying the client -# sbi: -# server -# cacert: /etc/open5gs/tls/ca.crt -# -# o Use the specified certificate while verifying the server -# sbi: -# client -# cacert: /etc/open5gs/tls/ca.crt -# -sbi: +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +scp: + sbi: server: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/scp.key - cert: @sysconfdir@/open5gs/tls/scp.crt + - address: 127.0.0.200 + port: 7777 client: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/scp.key - cert: @sysconfdir@/open5gs/tls/scp.crt + nrf: + - uri: http://127.0.0.10:7777 +################################################################################ +# SCP Info +################################################################################ +# o SCP port number(s) WITHOUT SCP Domain +# - If no SCP port information is present in ScpInfo or +# in ScpDomainInfo for a specific SCP domain, +# the HTTP client shall use the default HTTP port number, +# i.e. TCP port 80 for "http" URIs or TCP port 443 +# for "https" URIs as specified in IETF RFC 7540 [9] +# when sending a request to the SCP within the specific SCP domain. +# info: +# port: +# http: 7777 +# https: 8888 # -# +# o SCP port number(s) WITH SCP Domain +# - If this attribute is present, +# it has precedence over the scpPorts attribute of ScpInfo. +# info: +# domain: +# - name: SCP_Domain_1 +# fqdn: scp.localdomain +# port: +# http: 7777 +# https: 8888 # -# o SBI Server(http://:80) +# o Complex Example +# info: +# port: +# http: 7777 +# https: 8888 +# domain: +# - name: SCP_Domain_1 +# fqdn: scp.hplmndomain +# port: +# http: 3333 +# https: 4444 +# - name: SCP_Domain_2 +# fqdn: scp.vplmndomain +# port: +# http: 5555 +# https: 6666 +# +################################################################################ +# SBI Server +################################################################################ +# o Override SBI address to be advertised to NRF # sbi: # server: -# no_tls: true -# scp: -# sbi: -# -# o SBI Server(http://:7777) -# sbi: -# server: -# no_tls: true -# scp: -# sbi: -# - addr: -# - 0.0.0.0 -# - ::0 -# port: 7777 -# -# o SBI Server(https://:443) -# sbi: -# server: -# key: /etc/open5gs/tls/scp.key -# cert: /etc/open5gs/tls/scp.crt -# scp: -# sbi: -# -# o SBI Server(https://127.0.1.10:443, https://[::1]:443) without verification -# sbi: -# server: -# no_verify: true -# key: /etc/open5gs/tls/scp.key -# cert: /etc/open5gs/tls/scp.crt -# scp: -# sbi: -# - addr: 127.0.1.10 -# - addr: ::1 -# -# o SBI Server(https://scp.open5gs.org:443) -# Use the specified certificate while verifying the client -# -# sbi: -# server: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/scp.key -# cert: /etc/open5gs/tls/scp.crt -# scp: -# sbi: -# - name: scp.open5gs.org -# -# o SBI Server(http://127.0.1.10:7777) -# sbi: -# server: -# no_tls: true -# scp: -# sbi: -# - addr: 127.0.1.10 -# port: 7777 -# -# o SBI Server(http://:80) -# sbi: -# server: -# no_tls: true -# scp: -# sbi: -# - dev: eth0 -# -# o Provide custom SBI address to be advertised to NRF -# sbi: -# server: -# no_tls: true -# scp: -# sbi: # - dev: eth0 # advertise: open5gs-scp.svc.local # -# o Another example of advertising on NRF # sbi: # server: -# no_tls: true -# scp: -# sbi: -# - addr: localhost +# - address: localhost # advertise: # - 127.0.0.99 # - ::1 # -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# server: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -# -# o SCP port number(s) WITHOUT SCP Domain -# - If no SCP port information is present in ScpInfo or -# in ScpDomainInfo for a specific SCP domain, -# the HTTP client shall use the default HTTP port number, -# i.e. TCP port 80 for "http" URIs or TCP port 443 -# for "https" URIs as specified in IETF RFC 7540 [9] -# when sending a request to the SCP within the specific SCP domain. -# scp: -# info: -# port: -# http: 7777 -# https: 8888 -# -# o SCP port number(s) WITH SCP Domain -# - If this attribute is present, -# it has precedence over the scpPorts attribute of ScpInfo. -# scp: -# info: -# domain: -# - name: SCP_Domain_1 -# fqdn: scp.localdomain -# port: -# http: 7777 -# https: 8888 -# -# o Complex Example -# scp: -# info: -# port: -# http: 7777 -# https: 8888 -# domain: -# - name: SCP_Domain_1 -# fqdn: scp.hplmndomain -# port: -# http: 3333 -# https: 4444 -# - name: SCP_Domain_2 -# fqdn: scp.vplmndomain -# port: -# http: 5555 -# https: 6666 -# -# -# -# o (Default) If you do not set Delegated Discovery as shown below, -# -# sbi: -# server: -# no_tls: true -# scp: -# sbi: -# - addr: 127.0.1.10 -# port: 7777 -# -# - Use SCP if SCP avaiable. Otherwise NRF is used. -# => App fails if both NRF and SCP are unavailable. -# -# sbi: -# server: -# no_tls: true -# scp: -# sbi: -# - addr: 127.0.1.10 -# port: 7777 -# discovery: -# delegated: auto -# -# o To use SCP always => App fails if no SCP available. -# delegated: yes -# -# o Don't use SCP server => App fails if no NRF available. -# delegated: no -# -scp: - sbi: - - addr: 127.0.1.10 - port: 7777 - -# -# -# o SBI Client(http://127.0.1.10:7777) +################################################################################ +# SBI Client +################################################################################ +# o Direct communication with NRF interaction # sbi: # client: -# no_tls: true -# next_scp: -# sbi: -# addr: 127.0.1.10 -# port: 7777 -# -# o SBI Client(https://127.0.1.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# next_scp: -# sbi: -# - addr: 127.0.1.10 -# - addr: ::1 -# -# o SBI Client(https://scp.open5gs.org:443) -# Use the specified certificate while verifying the server -# -# sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# next_scp: -# sbi: -# - name: scp.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fb::1]:80) -# If prefer_ipv4 is true, http://127.0.1.10:80 is selected. -# -# sbi: -# client: -# no_tls: true -# next_scp: -# sbi: -# addr: -# - 127.0.1.10 -# - fd69:f21d:873c:fb::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# next_scp: -# sbi: -# addr: 127.0.1.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# - -# -# > -# -# o SBI Client(http://127.0.0.10:7777) -# sbi: -# client: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# port: 7777 -# -# o SBI Client(https://127.0.0.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# nrf: -# sbi: -# - addr: 127.0.0.10 -# - addr: ::1 -# -# o SBI Client(https://nrf.open5gs.org:443) -# Use the specified certificate while verifying the server -# -# sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# nrf: -# sbi: -# - name: nrf.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fa::1]:80) -# If prefer_ipv4 is true, http://127.0.0.10:80 is selected. -# -# sbi: -# addr: -# - 127.0.0.10 -# - fd69:f21d:873c:fa::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -nrf: - sbi: - - addr: - - 127.0.0.10 - - ::1 - port: 7777 - -# -# o Disable use of IPv4 addresses (only IPv6) -# parameter: -# no_ipv4: true -# -# o Disable use of IPv6 addresses (only IPv4) -# parameter: -# no_ipv6: true -# -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# parameter: -# prefer_ipv4: true -# -parameter: - -# -# o Maximum Number of UE -# max: -# ue: 1024 -# -# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) -# max: -# peer: 64 -# -max: - -# -# o NF Instance Heartbeat (Default : 0) -# NFs will not send heart-beat timer in NFProfile -# NRF will send heart-beat timer in NFProfile -# (Default values are used, so no configuration is required) -# -# o NF Instance Heartbeat (20 seconds) -# NFs will send heart-beat timer (20 seconds) in NFProfile -# NRF can change heart-beat timer in NFProfile -# -# time: -# nf_instance: -# heartbeat: 20 -# -# o Message Wait Duration (Default : 10,000 ms = 10 seconds) -# (Default values are used, so no configuration is required) -# -# o Message Wait Duration (3000 ms) -# time: -# message: -# duration: 3000 -time: +# nrf: +# - uri: http://127.0.0.10:7777 diff --git a/configs/open5gs/sepp1.yaml.in b/configs/open5gs/sepp1.yaml.in new file mode 100644 index 000000000..7ff9dde81 --- /dev/null +++ b/configs/open5gs/sepp1.yaml.in @@ -0,0 +1,254 @@ +logger: + file: @localstatedir@/log/open5gs/sepp1.log +# level: info # fatal|error|warn|info(default)|debug|trace + +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +sepp: + default: + tls: + server: + private_key: @sysconfdir@/open5gs/tls/sepp1.key + cert: @sysconfdir@/open5gs/tls/sepp1.crt + client: + cacert: @sysconfdir@/open5gs/tls/ca.crt + sbi: + server: + - address: 127.0.1.250 + port: 7777 + client: +# nrf: +# - uri: http://127.0.0.10:7777 + scp: + - uri: http://127.0.0.200:7777 + n32: + server: + - sender: sepp1.localdomain + scheme: https + address: 127.0.1.251 + port: 7777 + n32f: + scheme: https + address: 127.0.1.252 + port: 7777 + client: + sepp: + - receiver: sepp2.localdomain + uri: https://sepp2.localdomain:7777 + resolve: 127.0.2.251 + n32f: + uri: https://sepp2.localdomain:7777 + resolve: 127.0.2.252 + +################################################################################ +# SEPP Info +################################################################################ +# o SEPP port number(s) for HTTP and/or HTTPS +# - This attribute shall be present if the SEPP uses non-default HTTP and/or +# HTTPS ports. When present, it shall contain the HTTP and/or HTTPS ports. +# (Minimum: 0 Maximum: 65535) +# info: +# port: +# http: 7777 +# https: 8888 +# +################################################################################ +# No TLS - N32 Server/Client +################################################################################ +# o SEPP uses the same interface that other NFs(NRF, AMF, ...) use. +# sbi: +# server: +# - address: 127.0.1.250 +# port: 7777 +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# n32: +# server: +# - sender: sepp1.localdomain +# client: +# sepp: +# - receiver: sepp2.localdomain +# uri: http://127.0.2.250:7777 +# +# o SEPP uses a separate interface +# that is different from those used by other NFs. +# sbi: +# server: +# - address: 127.0.1.250 +# port: 7777 +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# n32: +# server: +# - sender: sepp1.localdomain +# address: 127.0.1.251 +# port: 7777 +# client: +# sepp: +# - receiver: sepp2.localdomain +# uri: http://127.0.2.251:7777 +# +# o Not only SEPP but also the N32 forwarding uses a separate interface +# that is different from those used by other NFs. +# sbi: +# server: +# - address: 127.0.1.250 +# port: 7777 +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# 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 +# +################################################################################ +# HTTPS scheme with TLS - N32 Server/Client +################################################################################ +# +# o Only N32 uses HTTPS with TLS, while other NFs use HTTP without TLS. +# default: +# tls: +# server: +# private_key: @sysconfdir@/open5gs/tls/sepp1.key +# cert: @sysconfdir@/open5gs/tls/sepp1.crt +# client: +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# sbi: +# server: +# - address: 127.0.1.250 +# port: 7777 +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# n32: +# server: +# - sender: sepp1.localdomain +# scheme: https +# address: 127.0.1.251 +# client: +# sepp: +# - receiver: sepp2.localdomain +# uri: https://sepp2.localdomain +# resolve: 127.0.2.251 +# +# o Add client TLS verification to N32 interface +# default: +# tls: +# server: +# private_key: @sysconfdir@/open5gs/tls/sepp1.key +# cert: @sysconfdir@/open5gs/tls/sepp1.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# client: +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/sepp1.key +# client_cert: @sysconfdir@/open5gs/tls/sepp1.crt +# sbi: +# server: +# - address: 127.0.1.250 +# port: 7777 +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# n32: +# server: +# - sender: sepp1.localdomain +# scheme: https +# address: 127.0.1.251 +# client: +# sepp: +# - receiver: sepp2.localdomain +# uri: https://sepp2.localdomain +# resolve: 127.0.2.251 +# +# o Both SEPP and N32 forwarding also uses HTTPS with TLS, +# while other NFs use HTTP without TLS. +# default: +# tls: +# server: +# private_key: @sysconfdir@/open5gs/tls/sepp1.key +# cert: @sysconfdir@/open5gs/tls/sepp1.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# client: +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/sepp1.key +# client_cert: @sysconfdir@/open5gs/tls/sepp1.crt +# sbi: +# server: +# - address: 127.0.1.250 +# port: 7777 +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# n32: +# server: +# - sender: sepp1.localdomain +# scheme: https +# address: 127.0.1.251 +# n32f: +# scheme: https +# address: 127.0.1.252 +# client: +# sepp: +# - receiver: sepp2.localdomain +# uri: https://sepp2.localdomain +# resolve: 127.0.2.251 +# n32f: +# uri: https://sepp2.localdomain +# resolve: 127.0.2.252 +# +# o N32 control and N32 forwarding interface use different key/certificate. +# sbi: +# server: +# - address: 127.0.1.250 +# port: 7777 +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# n32: +# server: +# - sender: sepp1.localdomain +# scheme: https +# address: 127.0.1.251 +# private_key: @sysconfdir@/open5gs/tls/sepp1.key +# cert: @sysconfdir@/open5gs/tls/sepp1.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# n32f: +# scheme: https +# address: 127.0.1.252 +# private_key: @sysconfdir@/open5gs/tls/sepp1-n32f.key +# cert: @sysconfdir@/open5gs/tls/sepp1-n32f.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# client: +# sepp: +# - receiver: sepp2.localdomain +# uri: https://sepp2.localdomain +# resolve: 127.0.2.251 +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/sepp1.key +# client_cert: @sysconfdir@/open5gs/tls/sepp1.crt +# n32f: +# uri: https://sepp2.localdomain +# resolve: 127.0.2.252 +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/sepp1-n32f.key +# client_cert: @sysconfdir@/open5gs/tls/sepp1-n32f.crt diff --git a/configs/open5gs/sepp2.yaml.in b/configs/open5gs/sepp2.yaml.in new file mode 100644 index 000000000..9a381ca5d --- /dev/null +++ b/configs/open5gs/sepp2.yaml.in @@ -0,0 +1,254 @@ +logger: + file: @localstatedir@/log/open5gs/sepp2.log +# level: info # fatal|error|warn|info(default)|debug|trace + +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +sepp: + default: + tls: + server: + private_key: @sysconfdir@/open5gs/tls/sepp2.key + cert: @sysconfdir@/open5gs/tls/sepp2.crt + client: + cacert: @sysconfdir@/open5gs/tls/ca.crt + sbi: + server: + - address: 127.0.2.250 + port: 7777 + client: +# nrf: +# - uri: http://127.0.0.10:7777 + scp: + - uri: http://127.0.0.200:7777 + n32: + server: + - sender: sepp2.localdomain + scheme: https + address: 127.0.2.251 + port: 7777 + n32f: + scheme: https + address: 127.0.2.252 + port: 7777 + client: + sepp: + - receiver: sepp1.localdomain + uri: https://sepp1.localdomain:7777 + resolve: 127.0.1.251 + n32f: + uri: https://sepp1.localdomain:7777 + resolve: 127.0.1.252 + +################################################################################ +# SEPP Info +################################################################################ +# o SEPP port number(s) for HTTP and/or HTTPS +# - This attribute shall be present if the SEPP uses non-default HTTP and/or +# HTTPS ports. When present, it shall contain the HTTP and/or HTTPS ports. +# (Minimum: 0 Maximum: 65535) +# info: +# port: +# http: 7777 +# https: 8888 +# +################################################################################ +# No TLS - N32 Server/Client +################################################################################ +# o SEPP uses the same interface that other NFs(NRF, AMF, ...) use. +# sbi: +# server: +# - address: 127.0.2.250 +# port: 7777 +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# n32: +# server: +# - sender: sepp2.localdomain +# client: +# sepp: +# - receiver: sepp1.localdomain +# uri: http://127.0.1.250:7777 +# +# o SEPP uses a separate interface +# that is different from those used by other NFs. +# sbi: +# server: +# - address: 127.0.2.250 +# port: 7777 +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# n32: +# server: +# - sender: sepp2.localdomain +# address: 127.0.2.251 +# port: 7777 +# client: +# sepp: +# - receiver: sepp1.localdomain +# uri: http://127.0.1.251:7777 +# +# o Not only SEPP but also the N32 forwarding uses a separate interface +# that is different from those used by other NFs. +# sbi: +# server: +# - address: 127.0.2.250 +# port: 7777 +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# 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 +# +################################################################################ +# HTTPS scheme with TLS - N32 Server/Client +################################################################################ +# +# o Only N32 uses HTTPS with TLS, while other NFs use HTTP without TLS. +# default: +# tls: +# server: +# private_key: @sysconfdir@/open5gs/tls/sepp2.key +# cert: @sysconfdir@/open5gs/tls/sepp2.crt +# client: +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# sbi: +# server: +# - address: 127.0.2.250 +# port: 7777 +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# n32: +# server: +# - sender: sepp2.localdomain +# scheme: https +# address: 127.0.2.251 +# client: +# sepp: +# - receiver: sepp1.localdomain +# uri: https://sepp1.localdomain +# resolve: 127.0.1.251 +# +# o Add client TLS verification to N32 interface +# default: +# tls: +# server: +# private_key: @sysconfdir@/open5gs/tls/sepp2.key +# cert: @sysconfdir@/open5gs/tls/sepp2.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# client: +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/sepp2.key +# client_cert: @sysconfdir@/open5gs/tls/sepp2.crt +# sbi: +# server: +# - address: 127.0.2.250 +# port: 7777 +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# n32: +# server: +# - sender: sepp2.localdomain +# scheme: https +# address: 127.0.2.251 +# client: +# sepp: +# - receiver: sepp1.localdomain +# uri: https://sepp1.localdomain +# resolve: 127.0.1.251 +# +# o Both SEPP and N32 forwarding also uses HTTPS with TLS, +# while other NFs use HTTP without TLS. +# default: +# tls: +# server: +# private_key: @sysconfdir@/open5gs/tls/sepp2.key +# cert: @sysconfdir@/open5gs/tls/sepp2.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# client: +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/sepp2.key +# client_cert: @sysconfdir@/open5gs/tls/sepp2.crt +# sbi: +# server: +# - address: 127.0.2.250 +# port: 7777 +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# n32: +# server: +# - sender: sepp2.localdomain +# scheme: https +# address: 127.0.2.251 +# n32f: +# scheme: https +# address: 127.0.2.252 +# client: +# sepp: +# - receiver: sepp1.localdomain +# uri: https://sepp1.localdomain +# resolve: 127.0.1.251 +# n32f: +# uri: https://sepp1.localdomain +# resolve: 127.0.1.252 +# +# o N32 control and N32 forwarding interface use different key/certificate. +# sbi: +# server: +# - address: 127.0.2.250 +# port: 7777 +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# n32: +# server: +# - sender: sepp2.localdomain +# scheme: https +# address: 127.0.2.251 +# private_key: @sysconfdir@/open5gs/tls/sepp2.key +# cert: @sysconfdir@/open5gs/tls/sepp2.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# n32f: +# scheme: https +# address: 127.0.2.252 +# private_key: @sysconfdir@/open5gs/tls/sepp2-n32f.key +# cert: @sysconfdir@/open5gs/tls/sepp2-n32f.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# client: +# sepp: +# - receiver: sepp1.localdomain +# uri: https://sepp1.localdomain +# resolve: 127.0.1.251 +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/sepp2.key +# client_cert: @sysconfdir@/open5gs/tls/sepp2.crt +# n32f: +# uri: https://sepp1.localdomain +# resolve: 127.0.1.252 +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/sepp2-n32f.key +# client_cert: @sysconfdir@/open5gs/tls/sepp2-n32f.crt diff --git a/configs/open5gs/sgwc.yaml.in b/configs/open5gs/sgwc.yaml.in index b87688187..9ccdaa0e8 100644 --- a/configs/open5gs/sgwc.yaml.in +++ b/configs/open5gs/sgwc.yaml.in @@ -1,177 +1,69 @@ -# -# o Set OGS_LOG_INFO to all domain level -# - If `level` is omitted, the default level is OGS_LOG_INFO) -# - If `domain` is omitted, the all domain level is set from 'level' -# (Default values are used, so no configuration is required) -# -# o Set OGS_LOG_ERROR to all domain level -# - `level` can be set with none, fatal, error, warn, info, debug, trace -# logger: -# level: error -# -# o Set OGS_LOG_DEBUG to mme/emm domain level -# logger: -# level: debug -# domain: mme,emm -# -# o Set OGS_LOG_TRACE to all domain level -# logger: -# level: trace -# domain: core,sbi,ausf,event,tlv,mem,sock -# logger: - file: @localstatedir@/log/open5gs/sgwc.log + file: @localstatedir@/log/open5gs/sgwc.log +# level: info # fatal|error|warn|info(default)|debug|trace + +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 -# -# -# -# o GTP-C Server(127.0.0.3:2123, [fd69:f21d:873c:fa::2]:2123) -# sgwc: -# gtpc: -# addr: -# - 127.0.0.3 -# - fd69:f21d:873c:fa::2 -# -# o On SGW, Same Configuration(127.0.0.3:2123, -# [fd69:f21d:873c:fa::2]:2123) as below. -# sgwc: -# gtpc: -# - addr: 127.0.0.3 -# - addr: fd69:f21d:873c:fa::2 -# -# o GTP-C Option (Default) -# - so_bindtodevice : NULL -# -# sgwc: -# gtpc: -# addr: 127.0.0.3 -# option: -# so_bindtodevice: vrf-blue -# -# -# -# o PFCP Server(127.0.0.3:8805, ::1:8805) -# sgwc: -# pfcp: -# - addr: 127.0.0.3 -# - addr: ::1 -# -# o PFCP-U Server(127.0.0.1:2152, [::1]:2152) -# sgwc: -# pfcp: -# name: localhost -# -# o PFCP Option (Default) -# - so_bindtodevice : NULL -# -# sgwc: -# pfcp: -# addr: 127.0.0.3 -# option: -# so_bindtodevice: vrf-blue -# -# o Provide custom PFCP address to be advertised in PFCP association -# request/respond -# sgwc: -# pfcp: -# - addr: 0.0.0.0 -# advertise: open5gs-smf.svc.local -# sgwc: - gtpc: - - addr: 127.0.0.3 - pfcp: - - addr: 127.0.0.3 + gtpc: + server: + - address: 127.0.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 +################################################################################ +# GTP-C Server +################################################################################ +# o Listen on IPv4 and IPv6 +# gtpc: +# server: +# - address: 127.0.0.3 +# - address: fd69:f21d:873c:fa::2 # -# > +################################################################################ +# PFCP Server +################################################################################ +# o Override PFCP address to be advertised to SGW-U in PFCP association +# pfcp: +# server: +# - dev: eth0 +# advertise: open5gs-sgwc.svc.local # -# o PFCP Client(127.0.0.6:8805) -# sgwu: -# pfcp: -# addr: 127.0.0.6 -# -# -# -# sgwu: -# pfcp: -# - addr: 127.0.0.6 -# - addr: 127.0.0.12 -# - addr: 127.0.0.18 -# -# o SGWU selection by eNodeB TAC +################################################################################ +# PFCP Client +################################################################################ +# o SGWU selection by eNodeB TAC # (either single TAC or multiple TACs, DECIMAL representation) +# pfcp: +# client: +# sgwu: +# - address: 127.0.0.6 +# tac: 1 +# - address: 127.0.0.12 +# tac: [3,5,8] # -# sgwu: -# pfcp: -# - addr: 127.0.0.6 -# tac: 1 -# - addr: 127.0.0.12 -# tac: [3,5,8] +# o SGWU selection by UE's APN (either single APN or multiple APNs) +# pfcp: +# client: +# sgwu: +# - address: 127.0.0.6 +# apn: ims +# - address: 127.0.0.12 +# apn: [internet, web] # -# o SGWU selection by UE's APN (either single APN or multiple APNs) -# -# sgwu: -# pfcp: -# - addr: 127.0.0.6 -# apn: ims -# - addr: 127.0.0.12 -# apn: [internet, web] -# -# o SGWU selection by CellID(e_cell_id: 28bit) +# o SGWU selection by CellID(e_cell_id: 28bit) # (either single e_cell_id or multiple e_cell_id, HEX representation) -# -# sgwu: -# pfcp: -# - addr: 127.0.0.6 -# e_cell_id: 463 -# - addr: 127.0.0.12 -# e_cell_id: [123456789, 9413] -# -sgwu: - pfcp: - - addr: 127.0.0.6 - -# -# o Disable use of IPv4 addresses (only IPv6) -# parameter: -# no_ipv4: true -# -# o Disable use of IPv6 addresses (only IPv4) -# parameter: -# no_ipv6: true -# -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# parameter: -# prefer_ipv4: true -# -# o Disable selection of SGW-U PFCP in Round-Robin manner -# parameter: -# no_pfcp_rr_select: true -# -parameter: - -# -# o Maximum Number of UE -# max: -# ue: 1024 -# -# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) -# max: -# peer: 64 -# -# o Maximum Number of GTP peer nodes per SGWC/SMF -# max: -# gtp_peer: 64 -# -max: - -# -# o Message Wait Duration (Default : 10,000 ms = 10 seconds) -# (Default values are used, so no configuration is required) -# -# o Message Wait Duration (3000 ms) -# time: -# message: -# duration: 3000 -time: +# pfcp: +# client: +# sgwu: +# - address: 127.0.0.6 +# e_cell_id: 463 +# - address: 127.0.0.12 +# e_cell_id: [123456789, 9413] diff --git a/configs/open5gs/sgwu.yaml.in b/configs/open5gs/sgwu.yaml.in index 546a981b8..9d72c92f8 100644 --- a/configs/open5gs/sgwu.yaml.in +++ b/configs/open5gs/sgwu.yaml.in @@ -1,166 +1,51 @@ -# -# o Set OGS_LOG_INFO to all domain level -# - If `level` is omitted, the default level is OGS_LOG_INFO) -# - If `domain` is omitted, the all domain level is set from 'level' -# (Default values are used, so no configuration is required) -# -# o Set OGS_LOG_ERROR to all domain level -# - `level` can be set with none, fatal, error, warn, info, debug, trace -# logger: -# level: error -# -# o Set OGS_LOG_DEBUG to mme/emm domain level -# logger: -# level: debug -# domain: mme,emm -# -# o Set OGS_LOG_TRACE to all domain level -# logger: -# level: trace -# domain: core,sbi,ausf,event,tlv,mem,sock -# logger: - file: @localstatedir@/log/open5gs/sgwu.log + file: @localstatedir@/log/open5gs/sgwu.log +# level: info # fatal|error|warn|info(default)|debug|trace +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +sgwu: + pfcp: + server: + - address: 127.0.0.6 + client: +# sgwc: # SGW-U PFCP Client try to associate SGW-C PFCP Server +# - address: 127.0.0.3 + gtpu: + server: + - address: 127.0.0.6 + +################################################################################ +# PFCP Server +################################################################################ +# o Override PFCP address to be advertised to SGW-C in PFCP association +# pfcp: +# server: +# - dev: eth0 +# advertise: open5gs-sgwu.svc.local # -# -# -# o PFCP Server(127.0.0.6:8805, ::1:8805) -# sgwu: -# pfcp: -# - addr: 127.0.0.6 -# - addr: ::1 -# -# o PFCP-U Server(127.0.0.1:2152, [::1]:2152) -# sgwu: -# pfcp: -# - name: localhost -# -# o PFCP Option (Default) -# - so_bindtodevice : NULL -# -# sgwu: -# pfcp: -# addr: 127.0.0.6 -# option: -# so_bindtodevice: vrf-blue -# -# o Provide custom PFCP address to be advertised in PFCP association -# request/respond -# sgwc: -# pfcp: -# - addr: 0.0.0.0 -# advertise: open5gs-smf.svc.local -# -# -# -# o GTP-U Server(127.0.0.6:2152, [::1]:2152) -# gtpu: -# - addr: 127.0.0.6 -# - addr: ::1 -# -# o GTP-U Server(127.0.0.1:2152, [::1]:2152) -# sgwu: -# gtpu: -# - name: localhost +################################################################################ +# GTP-U Server +################################################################################ +# o Override SGW-U GTP-U address to be advertised inside S1AP messages +# gtpu: +# server: +# - dev: ens3 +# advertise: sgw1.epc.mnc001.mcc001.3gppnetwork.org # # o User Plane IP Resource information -# sgwu: -# gtpu: -# - addr: -# - 127.0.0.6 -# - ::1 +# gtpu: +# server: +# - address: 127.0.0.6 # teid_range_indication: 4 # teid_range: 10 # network_instance: internet # source_interface: 0 -# - addr: 127.0.10.4 +# - address: 127.0.10.4 # teid_range_indication: 4 # teid_range: 5 # network_instance: ims # source_interface: 1 -# -# o Provide custom SGW-U GTP-U address to be advertised inside S1AP messages -# sgwu: -# gtpu: -# - addr: 10.4.128.21 -# advertise: 172.24.15.30 -# -# sgwu: -# gtpu: -# - addr: 10.4.128.21 -# advertise: -# - 127.0.0.1 -# - ::1 -# -# sgwu: -# gtpu: -# - addr: 10.4.128.21 -# advertise: sgw1.epc.mnc001.mcc001.3gppnetwork.org -# -# sgwu: -# gtpu: -# - dev: ens3 -# advertise: sgw1.epc.mnc001.mcc001.3gppnetwork.org -# -# o GTP-U Option (Default) -# - so_bindtodevice : NULL -# -# sgwu: -# gtpu: -# addr: 127.0.0.6 -# option: -# so_bindtodevice: vrf-blue -# -sgwu: - pfcp: - - addr: 127.0.0.6 - gtpu: - - addr: 127.0.0.6 - -# -# > -# -# o PFCP Client(127.0.0.3:8805) -# sgwc: -# pfcp: -# addr: 127.0.0.3 -# -sgwc: - -# -# o Disable use of IPv4 addresses (only IPv6) -# parameter: -# no_ipv4: true -# -# o Disable use of IPv6 addresses (only IPv4) -# parameter: -# no_ipv6: true -# -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# parameter: -# prefer_ipv4: true -# -parameter: - -# -# o Maximum Number of UE -# max: -# ue: 1024 -# -# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) -# max: -# peer: 64 -# -max: - -# -# -# o Message Wait Duration (Default : 10,000 ms = 10 seconds) -# (Default values are used, so no configuration is required) -# -# o Message Wait Duration (3000 ms) -# time: -# message: -# duration: 3000 -time: diff --git a/configs/open5gs/smf.yaml.in b/configs/open5gs/smf.yaml.in index 51120d51b..96f641bd1 100644 --- a/configs/open5gs/smf.yaml.in +++ b/configs/open5gs/smf.yaml.in @@ -1,453 +1,57 @@ -# -# o Set OGS_LOG_INFO to all domain level -# - If `level` is omitted, the default level is OGS_LOG_INFO) -# - If `domain` is omitted, the all domain level is set from 'level' -# (Default values are used, so no configuration is required) -# -# o Set OGS_LOG_ERROR to all domain level -# - `level` can be set with none, fatal, error, warn, info, debug, trace -# logger: -# level: error -# -# o Set OGS_LOG_DEBUG to mme/emm domain level -# logger: -# level: debug -# domain: mme,emm -# -# o Set OGS_LOG_TRACE to all domain level -# logger: -# level: trace -# domain: core,sbi,ausf,event,tlv,mem,sock -# logger: - file: @localstatedir@/log/open5gs/smf.log + file: @localstatedir@/log/open5gs/smf.log +# level: info # fatal|error|warn|info(default)|debug|trace -# -# o TLS enable/disable -# sbi: -# server|client: -# no_tls: false|true -# - false: (Default) Use TLS -# - true: TLS disabled -# -# o Verification enable/disable -# sbi: -# server|client: -# no_verify: false|true -# - false: (Default) Verify the PEER -# - true: Skip the verification step -# -# o Server-side does not use TLS -# sbi: -# server: -# no_tls: true -# -# o Client-side skips the verification step -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# -# o Use the specified certificate while verifying the client -# sbi: -# server -# cacert: /etc/open5gs/tls/ca.crt -# -# o Use the specified certificate while verifying the server -# sbi: -# client -# cacert: /etc/open5gs/tls/ca.crt -# -sbi: +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +smf: + sbi: server: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/smf.key - cert: @sysconfdir@/open5gs/tls/smf.crt + - address: 127.0.0.4 + port: 7777 client: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/smf.key - cert: @sysconfdir@/open5gs/tls/smf.crt +# nrf: +# - uri: http://127.0.0.10:7777 + scp: + - uri: http://127.0.0.200:7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.4 + port: 9090 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + dns: + - 8.8.8.8 + - 8.8.4.4 + - 2001:4860:4860::8888 + - 2001:4860:4860::8844 + mtu: 1400 +# p-cscf: +# - 127.0.0.1 +# - ::1 +# ctf: +# enabled: auto # auto(default)|yes|no + freeDiameter: @sysconfdir@/freeDiameter/smf.conf -# -# -# -# o SBI Server(http://:80) -# sbi: -# server: -# no_tls: true -# smf: -# sbi: -# -# o SBI Server(http://:7777) -# sbi: -# server: -# no_tls: true -# smf: -# sbi: -# - addr: -# - 0.0.0.0 -# - ::0 -# port: 7777 -# -# o SBI Server(https://:443) -# sbi: -# server: -# key: /etc/open5gs/tls/smf.key -# cert: /etc/open5gs/tls/smf.crt -# smf: -# sbi: -# -# o SBI Server(https://127.0.0.4:443, https://[::1]:443) without verification -# sbi: -# server: -# no_verify: true -# key: /etc/open5gs/tls/smf.key -# cert: /etc/open5gs/tls/smf.crt -# smf: -# sbi: -# - addr: 127.0.0.4 -# - addr: ::1 -# -# o SBI Server(https://smf.open5gs.org:443) -# Use the specified certificate while verifying the client -# -# sbi: -# server: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/smf.key -# cert: /etc/open5gs/tls/smf.crt -# smf: -# sbi: -# - name: smf.open5gs.org -# -# o SBI Server(http://127.0.0.4:7777) -# sbi: -# server: -# no_tls: true -# smf: -# sbi: -# - addr: 127.0.0.4 -# port: 7777 -# -# o SBI Server(http://:80) -# sbi: -# server: -# no_tls: true -# smf: -# sbi: -# - dev: eth0 -# -# o Provide custom SBI address to be advertised to NRF -# sbi: -# server: -# no_tls: true -# smf: -# sbi: -# - dev: eth0 -# advertise: open5gs-smf.svc.local -# -# o Another example of advertising on NRF -# sbi: -# server: -# no_tls: true -# smf: -# sbi: -# - addr: localhost -# advertise: -# - 127.0.0.99 -# - ::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# server: -# no_tls: true -# smf: -# sbi: -# addr: 127.0.0.4 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -# -# -# o NF Service Name(Default : all NF services available) -# smf: -# service_name: -# -# o NF Service Name(Only some NF services are available) -# smf: -# service_name: -# - nsmf-pdusession -# -# -# -# o (Default) If you do not set Query Parameter as shown below, -# -# sbi: -# server: -# no_tls: true -# smf: -# sbi: -# - addr: 127.0.0.4 -# port: 7777 -# -# - 'service-names' is included. -# -# o Service-Names are not included -# sbi: -# server: -# no_tls: true -# smf: -# sbi: -# - addr: 127.0.0.4 -# port: 7777 -# discovery: -# option: -# no_service_names: false -# -# o To remove 'service-names' from URI query parameters in NS Discovery -# no_service_names: true -# -# * For Indirect Communication with Delegated Discovery, -# 'service-names' is always included in the URI query parameter. -# * That is, 'no_service_names' has no effect. -# -# -# -# o (Default) If you do not set Delegated Discovery as shown below, -# -# sbi: -# server: -# no_tls: true -# smf: -# sbi: -# - addr: 127.0.0.4 -# port: 7777 -# -# - Use SCP if SCP avaiable. Otherwise NRF is used. -# => App fails if both NRF and SCP are unavailable. -# -# sbi: -# server: -# no_tls: true -# smf: -# sbi: -# - addr: 127.0.0.4 -# port: 7777 -# discovery: -# delegated: auto -# -# o To use SCP always => App fails if no SCP available. -# delegated: yes -# -# o Don't use SCP server => App fails if no NRF available. -# delegated: no -# -# -# -# o PFCP Server(127.0.0.4:8805, ::1:8805) -# smf: -# pfcp: -# - addr: 127.0.0.4 -# - addr: ::1 -# -# o PFCP-U Server(127.0.0.1:2152, [::1]:2152) -# smf: -# pfcp: -# name: localhost -# -# o PFCP Option (Default) -# - so_bindtodevice : NULL -# -# smf: -# pfcp: -# addr: 127.0.0.4 -# option: -# so_bindtodevice: vrf-blue -# -# o Provide custom PFCP address to be advertised to UPF in PFCP association -# request/respond -# smf: -# pfcp: -# - addr: 0.0.0.0 -# advertise: open5gs-smf.svc.local -# -# -# -# o GTP-C Server(127.0.0.4:2123, [fd69:f21d:873c:fa::3]:2123) -# smf: -# gtpc: -# addr: -# - 127.0.0.4 -# - fd69:f21d:873c:fa::3 -# -# o On SMF, Same configuration -# (127.0.0.4:2123, [fd69:f21d:873c:fa::3]:2123). -# smf: -# gtpc: -# - addr: 127.0.0.4 -# - addr: fd69:f21d:873c:fa::3 -# -# o GTP-C Option (Default) -# - so_bindtodevice : NULL -# -# smf: -# gtpc: -# addr: 127.0.0.4 -# option: -# so_bindtodevice: vrf-blue -# -# > -# -# o GTP-U Server(127.0.0.4:2152, [::1]:2152) -# smf: -# gtpu: -# - addr: 127.0.0.4 -# - addr: ::1 -# -# o GTP-U Server(127.0.0.1:2152, [::1]:2152) -# smf: -# gtpu: -# name: localhost -# -# o GTP-U Option (Default) -# - so_bindtodevice : NULL -# -# smf: -# gtpu: -# addr: 127.0.0.4 -# option: -# so_bindtodevice: vrf-blue -# -# -# -# o Metrics Server(http://:9090) -# smf: -# metrics: -# - addr: 0.0.0.0 -# port: 9090 -# -# -# -# o IPv4 Pool -# smf: -# subnet: -# addr: 10.45.0.1/16 -# -# o IPv4/IPv6 Pool -# smf: -# subnet: -# - addr: 10.45.0.1/16 -# - addr: 2001:db8:cafe::1/48 -# -# -# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, 2001:db8:babe::1/48 -# ; If the UE has unknown DNN/APN(not internet/ims), SMF/UPF will crash. -# -# smf: -# subnet: -# - addr: 10.45.0.1/16 -# dnn: internet -# - addr: 2001:db8:cafe::1/48 -# dnn: internet -# - addr: 10.46.0.1/16 -# dnn: ims -# - addr: 2001:db8:babe::1/48 -# dnn: ims -# -# o Specific DNN/APN with the FALLBACK SUBNET(10.47.0.1/16) -# ; Note that put the FALLBACK SUBNET last to avoid SMF/UPF crash. -# -# smf: -# subnet: -# - addr: 10.45.0.1/16 -# dnn: internet -# - addr: 10.46.0.1/16 -# dnn: ims -# - addr: 10.50.0.1/16 ## FALLBACK SUBNET -# -# o Pool Range Sample -# smf: -# subnet: -# - addr: 10.45.0.1/24 -# range: 10.45.0.100-10.45.0.200 -# -# smf: -# subnet: -# - addr: 10.45.0.1/24 -# range: -# - 10.45.0.5-10.45.0.50 -# - 10.45.0.100- -# -# smf: -# subnet: -# - addr: 10.45.0.1/24 -# range: -# - -10.45.0.200 -# - 10.45.0.210-10.45.0.220 -# -# smf: -# subnet: -# - addr: 10.45.0.1/16 -# range: -# - 10.45.0.100-10.45.0.200 -# - 10.45.1.100-10.45.1.200 -# - addr: 2001:db8:cafe::1/48 -# range: -# - 2001:db8:cafe:a0::0-2001:db8:cafe:b0::0 -# - 2001:db8:cafe:c0::0-2001:db8:cafe:d0::0 -# -# -# -# o Primary/Secondary can be configured. Others are ignored. -# -# smf: -# dns: -# - 8.8.8.8 -# - 8.8.4.4 -# - 2001:4860:4860::8888 -# - 2001:4860:4860::8844 -# -# -# -# o Provisioning a limit on the size of the packets sent by the MS -# to avoid packet fragmentation in the backbone network -# between the MS and the GGSN/PGW and/or across the (S)Gi reference point) -# when some of the backbone links does not support -# packets larger then 1500 octets -# -# -# -# o Proxy Call Session Control Function -# -# smf: -# p-cscf: -# - 127.0.0.1 -# - ::1 -# -# -# -# o Gy interface parameters towards OCS. -# o enabled: -# o auto: Default. Use Gy only if OCS available among Diameter peers -# o yes: Use Gy always; -# reject subscribers if no OCS available among Diameter peers -# o no: Don't use Gy interface if there is an OCS available -# -# smf: -# ctf: -# enabled: auto|yes|no -# -# +################################################################################ +# SMF Info +################################################################################ # # 1. SMF sends SmfInfo(S-NSSAI, DNN, TAI) to the NRF # 2. NRF responds to AMF with SmfInfo during NF-Discovery. @@ -456,428 +60,297 @@ sbi: # Note that if there is no SmfInfo, any AMF can select this SMF. # # o S-NSSAI[SST:1] and DNN[internet] - At least 1 DNN is required in S-NSSAI -# smf: -# info: -# - s_nssai: -# - sst: 1 -# dnn: -# - internet +# info: +# - s_nssai: +# - sst: 1 +# dnn: +# - internet # # o S-NSSAI[SST:1 SD:009000] and DNN[internet or ims] -# smf: -# info: -# - s_nssai: -# - sst: 1 -# sd: 009000 -# dnn: -# - internet -# - ims +# info: +# - s_nssai: +# - sst: 1 +# sd: 009000 +# dnn: +# - internet +# - ims # # o S-NSSAI[SST:1] and DNN[internet] and TAI[PLMN-ID:99970 TAC:1] -# smf: -# info: -# - s_nssai: -# - sst: 1 -# dnn: -# - internet -# tai: -# - plmn_id: -# mcc: 999 -# mnc: 70 -# tac: 1 +# info: +# - s_nssai: +# - sst: 1 +# dnn: +# - internet +# tai: +# - plmn_id: +# mcc: 999 +# mnc: 70 +# tac: 1 # # o If any of conditions below are met: # - S-NSSAI[SST:1] and DNN[internet] and TAI[PLMN-ID:99970 TAC:1-9] # - S-NSSAI[SST:2 SD:000080] and DNN[internet or ims] # - S-NSSAI[SST:4] and DNN[internet] and TAI[PLMN-ID:99970 TAC:10-20,30-40] -# -# smf: -# info: -# - s_nssai: -# - sst: 1 -# dnn: -# - internet -# tai: -# - plmn_id: -# mcc: 999 -# mnc: 70 -# tac: -# - 1-9 -# - s_nssai: -# - sst: 2 -# sd: 000080 -# dnn: -# - internet -# - ims -# - s_nssai: -# - sst: 4 -# dnn: -# - internet -# tai: -# - plmn_id: -# mcc: 999 -# mnc: 70 -# tac: -# - 10-20 -# - 30-40 +# info: +# - s_nssai: +# - sst: 1 +# dnn: +# - internet +# tai: +# - plmn_id: +# mcc: 999 +# mnc: 70 +# tac: +# - 1-9 +# - s_nssai: +# - sst: 2 +# sd: 000080 +# dnn: +# - internet +# - ims +# - s_nssai: +# - sst: 4 +# dnn: +# - internet +# tai: +# - plmn_id: +# mcc: 999 +# mnc: 70 +# tac: +# - 10-20 +# - 30-40 # # o Complex Example -# smf: -# info: -# - s_nssai: -# - sst: 1 -# dnn: -# - internet -# - sst: 1 -# sd: 000080 -# dnn: -# - internet -# - ims -# - sst: 1 -# sd: 009000 -# dnn: -# [internet, ims] -# - sst: 2 -# dnn: -# - internet -# - sst: 3 -# sd: 123456 -# dnn: -# - internet -# tai: -# - plmn_id: -# mcc: 999 -# mnc: 70 -# tac: [1, 2, 3] -# - plmn_id: -# mcc: 999 -# mnc: 70 -# tac: 4 -# - plmn_id: -# mcc: 999 -# mnc: 70 -# tac: -# - 5 -# - 6 -# - plmn_id: -# mcc: 999 -# mnc: 70 -# tac: -# - 100-200 -# - 300-400 -# - plmn_id: -# mcc: 999 -# mnc: 70 -# tac: -# - 500-600 -# - 700-800 -# - 900-1000 -# - s_nssai: -# - sst: 4 -# dnn: -# - internet -# tai: -# - plmn_id: -# mcc: 999 -# mnc: 70 -# tac: 99 +# info: +# - s_nssai: +# - sst: 1 +# dnn: +# - internet +# - sst: 1 +# sd: 000080 +# dnn: +# - internet +# - ims +# - sst: 1 +# sd: 009000 +# dnn: +# [internet, ims] +# - sst: 2 +# dnn: +# - internet +# - sst: 3 +# sd: 123456 +# dnn: +# - internet +# tai: +# - plmn_id: +# mcc: 999 +# mnc: 70 +# tac: [1, 2, 3] +# - plmn_id: +# mcc: 999 +# mnc: 70 +# tac: 4 +# - plmn_id: +# mcc: 999 +# mnc: 70 +# tac: +# - 5 +# - 6 +# - plmn_id: +# mcc: 999 +# mnc: 70 +# tac: +# - 100-200 +# - 300-400 +# - plmn_id: +# mcc: 999 +# mnc: 70 +# tac: +# - 500-600 +# - 700-800 +# - 900-1000 +# - s_nssai: +# - sst: 4 +# dnn: +# - internet +# tai: +# - plmn_id: +# mcc: 999 +# mnc: 70 +# tac: 99 # -# -# -# According to 3GPP TS38.413 Section 9.3.1.27, -# Security Indication IE may be instructed to 5G gNB. -# -# If you set the security_indication in smf.yaml, -# this information is delivered using PDU Session Resource Request Transfer IE -# -# smf: -# security_indication: -# integrity_protection_indication: required|preferred|not-needed -# confidentiality_protection_indication: required|preferred|not-needed -# maximum_integrity_protected_data_rate_uplink: bitrate64kbs|maximum-UE-rate -# maximum_integrity_protected_data_rate_downlink: bitrate64kbs|maximum-UE-rate -# -smf: - sbi: - - addr: 127.0.0.4 - port: 7777 - pfcp: - - addr: 127.0.0.4 - - addr: ::1 - gtpc: - - addr: 127.0.0.4 - - addr: ::1 - gtpu: - - addr: 127.0.0.4 - - addr: ::1 - metrics: - - addr: 127.0.0.4 - port: 9090 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - dns: - - 8.8.8.8 - - 8.8.4.4 - - 2001:4860:4860::8888 - - 2001:4860:4860::8844 - mtu: 1400 - ctf: - enabled: auto - freeDiameter: @sysconfdir@/freeDiameter/smf.conf - -# -# > -# -# o SBI Client(http://127.0.1.10:7777) +################################################################################ +# SBI Server +################################################################################ +# o Override SBI address to be advertised to NRF # sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# port: 7777 -# -# o SBI Client(https://127.0.1.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# scp: -# sbi: -# - addr: 127.0.1.10 -# - addr: ::1 -# -# o SBI Client(https://scp.open5gs.org:443) -# Use the specified certificate while verifying the server +# server: +# - dev: eth0 +# advertise: open5gs-smf.svc.local # # sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# scp: -# sbi: -# - name: scp.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fb::1]:80) -# If prefer_ipv4 is true, http://127.0.1.10:80 is selected. -# -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: -# - 127.0.1.10 -# - fd69:f21d:873c:fb::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -scp: - sbi: - - addr: 127.0.1.10 - port: 7777 - -# -# > -# -# o SBI Client(http://127.0.0.10:7777) -# sbi: -# client: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# port: 7777 -# -# o SBI Client(https://127.0.0.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# nrf: -# sbi: -# - addr: 127.0.0.10 -# - addr: ::1 -# -# o SBI Client(https://nrf.open5gs.org:443) -# Use the specified certificate while verifying the server -# -# sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# nrf: -# sbi: -# - name: nrf.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fa::1]:80) -# If prefer_ipv4 is true, http://127.0.0.10:80 is selected. -# -# sbi: -# addr: -# - 127.0.0.10 -# - fd69:f21d:873c:fa::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -#nrf: -# sbi: -# - addr: -# - 127.0.0.10 +# server: +# - address: localhost +# advertise: +# - 127.0.0.99 # - ::1 -# port: 7777 - # -# > +################################################################################ +# SBI Client +################################################################################ +# o Direct communication with NRF interaction +# sbi: +# client: +# nrf: +# - uri: http://127.0.0.10:7777 # -# o PFCP Client(127.0.0.7:8805) -# upf: -# pfcp: -# addr: 127.0.0.7 +# o Indirect communication with delegated discovery +# sbi: +# client: +# scp: +# - uri: http://127.0.0.200:7777 # -# +# o Indirect communication without delegated discovery +# sbi: +# client: +# nrf: +# - uri: http://127.0.0.10:7777 +# scp: +# - uri: http://127.0.0.200:7777 +# discovery: +# delegated: no # -# upf: -# pfcp: -# - addr: 127.0.0.7 -# - addr: 127.0.0.12 -# - addr: 127.0.0.19 +################################################################################ +# HTTPS scheme with TLS +################################################################################ +# o Set as default if not individually set +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/smf.key +# cert: @sysconfdir@/open5gs/tls/smf.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# sbi: +# server: +# - address: smf.localdomain +# client: +# nrf: +# - uri: https://nrf.localdomain # +# o Add client TLS verification +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/smf.key +# cert: @sysconfdir@/open5gs/tls/smf.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/smf.key +# client_cert: @sysconfdir@/open5gs/tls/smf.crt +# sbi: +# server: +# - address: smf.localdomain +# client: +# nrf: +# - uri: https://nrf.localdomain +# +################################################################################ +# PFCP Server +################################################################################ +# o Override PFCP address to be advertised to UPF in PFCP association +# pfcp: +# server: +# - dev: eth0 +# advertise: open5gs-smf.svc.local +# +################################################################################ +# PFCP Client +################################################################################ # o UPF selection by eNodeB TAC -# (either single TAC or multiple TACs, DECIMAL representation) -# -# upf: -# pfcp: -# - addr: 127.0.0.7 -# tac: 1 -# - addr: 127.0.0.12 -# tac: [3,5,8] +# (either single TAC or multiple TACs, DECIMAL representation) +# pfcp: +# client: +# upf: +# - address: 127.0.0.7 +# tac: 1 +# - address: 127.0.0.12 +# tac: [3,5,8] # # o UPF selection by UE's DNN/APN (either single DNN/APN or multiple DNNs/APNs) -# -# upf: -# pfcp: -# - addr: 127.0.0.7 -# dnn: ims -# - addr: 127.0.0.12 -# dnn: [internet, web] +# pfcp: +# client: +# upf: +# - address: 127.0.0.7 +# dnn: ims +# - address: 127.0.0.12 +# dnn: [internet, web] # # o UPF selection by CellID(e_cell_id: 28bit, nr_cell_id: 36bit) # (either single enb_id or multiple enb_ids, HEX representation) +# pfcp: +# client: +# upf: +# - address: 127.0.0.7 +# e_cell_id: 463 +# - address: 127.0.0.12 +# nr_cell_id: [123456789, 9413] # -# upf: -# pfcp: -# - addr: 127.0.0.7 -# e_cell_id: 463 -# - addr: 127.0.0.12 -# nr_cell_id: [123456789, 9413] +################################################################################ +# GTP-C Server +################################################################################ +# o Listen on IPv4 and IPv6 +# gtpc: +# server: +# - address: 127.0.0.4 +# - address: fd69:f21d:873c:fa::3 # -upf: - pfcp: - - addr: 127.0.0.7 - +################################################################################ +# GTP-U Server +################################################################################ +# o Listen on IPv4 and IPv6 +# gtpu: +# server: +# - address: 127.0.0.4 +# - address: ::1 # -# o Disable use of IPv4 addresses (only IPv6) -# parameter: -# no_ipv4: true +################################################################################ +# 3GPP Specification +################################################################################ +# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, 2001:db8:babe::1/48 +# (If the UE has unknown DNN/APN(not internet/ims), SMF/UPF will crash.) +# session: +# - subnet: 10.45.0.1/16 +# dnn: internet +# - subnet: 2001:db8:cafe::1/48 +# dnn: internet +# - subnet: 10.46.0.1/16 +# dnn: ims +# - subnet: 2001:db8:babe::1/48 +# dnn: ims # -# o Disable use of IPv6 addresses (only IPv4) -# parameter: -# no_ipv6: true +# o Pool Range +# session: +# - subnet: 10.45.0.1/16 +# range: +# - 10.45.0.100-10.45.0.200 +# - 10.45.1.100- +# - -10.45.0.200 +# - subnet: 2001:db8:cafe::1/48 +# range: +# - 2001:db8:cafe:a0::0-2001:db8:cafe:b0::0 +# - 2001:db8:cafe:c0::0-2001:db8:cafe:d0::0 # -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# parameter: -# prefer_ipv4: true -# -# o Disable selection of UPF PFCP in Round-Robin manner -# parameter: -# no_pfcp_rr_select: true -# -# o Legacy support for pre-release LTE 11 devices -# - Omits adding local address in packet filters for compatibility -# parameter: -# no_ipv4v6_local_addr_in_packet_filter: true -# -parameter: - -# -# o Maximum Number of UE -# max: -# ue: 1024 -# -# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) -# max: -# peer: 64 -# -# o Maximum Number of GTP peer nodes per SGWC/SMF -# max: -# gtp_peer: 64 -# -max: - -# -# o NF Instance Heartbeat (Default : 0) -# NFs will not send heart-beat timer in NFProfile -# NRF will send heart-beat timer in NFProfile -# (Default values are used, so no configuration is required) -# -# o NF Instance Heartbeat (20 seconds) -# NFs will send heart-beat timer (20 seconds) in NFProfile -# NRF can change heart-beat timer in NFProfile -# time: -# nf_instance: -# heartbeat: 20 -# -# o Message Wait Duration (Default : 10,000 ms = 10 seconds) -# (Default values are used, so no configuration is required) -# -# o Message Wait Duration (3000 ms) -# time: -# message: -# duration: 3000 -# -# o Handover Wait Duration (Default : 300 ms) -# Time to wait for SMF to send -# PFCP Session Modification Request(Remove Indirect Tunnel) to the UPF -# after sending Nsmf_PDUSession_UpdateSMContext Response(hoState:COMPLETED) -# (Default values are used, so no configuration is required) -# -# o Handover Wait Duration (500ms) -# time: -# handover: -# duration: 500 -time: +# o Security Indication(5G Core only) +# security_indication: +# integrity_protection_indication: required|preferred|not-needed +# confidentiality_protection_indication: required|preferred|not-needed +# maximum_integrity_protected_data_rate_uplink: bitrate64kbs|maximum-UE-rate +# maximum_integrity_protected_data_rate_downlink: bitrate64kbs|maximum-UE-rate diff --git a/configs/open5gs/tls/amf.crt b/configs/open5gs/tls/amf.crt index ad9b6a95d..f052f6004 100644 --- a/configs/open5gs/tls/amf.crt +++ b/configs/open5gs/tls/amf.crt @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- MIIDWzCCAkOgAwIBAgIBATANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK -DAhOZW9QbGFuZTAeFw0yMjExMTEyMzM3MjVaFw0zMjExMDgyMzM3MjVaMEoxCzAJ +DAhOZW9QbGFuZTAeFw0yMzA5MzAyMjU5MDZaFw0zMzA5MjcyMjU5MDZaMEoxCzAJ BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxGDAW BgNVBAMMD2FtZi5sb2NhbGRvbWFpbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAL5q1eXK8wzvyymrEpxLgdGg8ArHUiGk0BerkwIwOvkJRkqolQx1CVV+ -SZAsnLxrt1+DEb9PTEpqrAXXAWxGtjDCW8FARPFfhziq4B0NPHuTtXusvT+9xF0I -EY/HFyO/3EYh5vRh5gGZdW5Ukgh4We4Zw/lw0d2BFA2/L5Xz4zOV1P3vSeATyNMq -4mPWD5xUs0utUzOevmom/+vMO8HGecKv8dpdcM45Gget5pH9OwT0nEAOusW8vYZK -kCVKNFAvfyCOVzVG82jS8XARrMGzFPfnrkadYrf/sV4OQ7hLc4ZdO83kXubOoCJm -xrxp7Z8aaXjNEpGW2dZQqU9w57SP9sMCAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV -HQ4EFgQU2olHBnRSjS69sZRJT5rFpHAQDhcwHwYDVR0jBBgwFoAUsWr6nJm8BCpC -iGXXfr5gcKIO2kAwDQYJKoZIhvcNAQELBQADggEBAIEUFoQQ1yuR4apyUddE26Hm -tnYmXWaTFtL3D98rSj+mwyUOOPD/r7JcsK36XUj8bbMZ4avxMJpYhQGV7x8LG1t1 -3mKlq9JAvLzIREe7zvR8BbOmPu8AVO2Z4uCGrSAa1BsxGgobZ5E2btPHR5RVWiQS -yYhaIjBuUlPqpa20Pc5cKhZKa8bgfdVs/gsZVwa7T6Xr+hMiSlH0uGIUx85oW4sY -MidmaMRM1dabSo6nTLcQA0k7h3iC4nZ1MpyMpzt98vZCzVZzWlcJ7AW+py9xKUlN -48TKTdqHSwt5R9cLnrR7fSVzoPrS9H7KHcemP3poSN/E0PlD+Wou8AFBGBgle8o= +AQoCggEBAMgxuA/+na3AK01hZtQ0x202EBOHlaenDJiN34N8XnOpv9QG4/OYeY7P +kWqB1A/K0baSVik4kRsuQV5RArDDB71eLujnVmAl/AATvUS+6Lwp9VPdX40gfSbX +XvDQIoXUXKD6Y4TpzZcTuoJjK7d25a402gs4fbQNi3+cUu0bGgqVRO6rDWYFiQYA +bC8tSB8ze+Rpk37AleHtp72zQyjGSsAkmFf8Orf0VMBzOX0RcTWwXk31qJgd6L07 +gkIr+FTr0Qn/HHKaax4ipFQFGIZHGNXmArgUTh5gzAFHkhf3GGicJ9CQdARh8/65 +Gtf1LUHCG9o4ZLZuY5jbGa1LdjiLydMCAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV +HQ4EFgQUj77fWkkYf0fjHacP0JoGd8w72w0wHwYDVR0jBBgwFoAU2xbCTj9E9Ha4 +EurcTxHWMflmx3wwDQYJKoZIhvcNAQELBQADggEBAKXR8GHfuUWI1EJzDK0pSrKm +vezZYYBgy1QSgdPlVCyeprJlrKKstOA7P103hKI+OhTCqx6DOVsa0N3NdipSt0NF +walBbW+LbvcjTOYExjSwydv+wkran2fJVpnPA/ZYoWvm8e9tulsM79PRTD//B4Vq +6DRDQehryNr+O5ML5A8x9pFdXGGcv1ker8kgaW2IrtXv6PLH3A6u9+90ffdQwFET +Q/qaDD6UXcTBZGTPrlf70GDvc1COMi2tlIM1NmXHImo5L7Z8knLThq3e0waJECnM +SABIMkvjijnoVXKjMrKgQ9gd9Osp95E1Pysc23TtLH3jtYxfxPOYMJvpK1O2S4M= -----END CERTIFICATE----- diff --git a/configs/open5gs/tls/amf.csr b/configs/open5gs/tls/amf.csr index 6e4c22a5d..26a7c6499 100644 --- a/configs/open5gs/tls/amf.csr +++ b/configs/open5gs/tls/amf.csr @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE REQUEST----- MIICjzCCAXcCAQAwSjEYMBYGA1UEAwwPYW1mLmxvY2FsZG9tYWluMQswCQYDVQQG EwJLTzEOMAwGA1UECAwFU2VvdWwxETAPBgNVBAoMCE5lb1BsYW5lMIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvmrV5crzDO/LKasSnEuB0aDwCsdSIaTQ -F6uTAjA6+QlGSqiVDHUJVX5JkCycvGu3X4MRv09MSmqsBdcBbEa2MMJbwUBE8V+H -OKrgHQ08e5O1e6y9P73EXQgRj8cXI7/cRiHm9GHmAZl1blSSCHhZ7hnD+XDR3YEU -Db8vlfPjM5XU/e9J4BPI0yriY9YPnFSzS61TM56+aib/68w7wcZ5wq/x2l1wzjka -B63mkf07BPScQA66xby9hkqQJUo0UC9/II5XNUbzaNLxcBGswbMU9+euRp1it/+x -Xg5DuEtzhl07zeRe5s6gImbGvGntnxppeM0SkZbZ1lCpT3DntI/2wwIDAQABoAAw -DQYJKoZIhvcNAQELBQADggEBAGaPpZwtBx66RzpY4jkjHuIjxD4SQop5XbzfNr+l -HupHV/maWqEwlExTiRqQLUYJ01f4d6y/X8ABU4dyXbaqzWBEBtNg8uIifXLyGcfw -yzn9zzuE6Vlj2366ssJEP+YFYetrzGYkj4SrXQG7k9ZIM7cTTzD/ZjOAX4VI61LZ -VXpEOUsjdP9BcxwI6U17NkFePLfLKByp0uTwECFonIyxzlJLSTbk9xtzPtxA7pax -F/ZrQBEsTdzFQoZca1ZH3UTnmjpcbYJwOpzzlSfrMJs9sv42MZlBuSGzn8xq88xy -KylL9BUn7ZCOhawIz4FEi335e9aq8xcZXnx40OBMOTFE+xo= +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyDG4D/6drcArTWFm1DTHbTYQE4eVp6cM +mI3fg3xec6m/1Abj85h5js+RaoHUD8rRtpJWKTiRGy5BXlECsMMHvV4u6OdWYCX8 +ABO9RL7ovCn1U91fjSB9Jtde8NAihdRcoPpjhOnNlxO6gmMrt3blrjTaCzh9tA2L +f5xS7RsaCpVE7qsNZgWJBgBsLy1IHzN75GmTfsCV4e2nvbNDKMZKwCSYV/w6t/RU +wHM5fRFxNbBeTfWomB3ovTuCQiv4VOvRCf8ccpprHiKkVAUYhkcY1eYCuBROHmDM +AUeSF/cYaJwn0JB0BGHz/rka1/UtQcIb2jhktm5jmNsZrUt2OIvJ0wIDAQABoAAw +DQYJKoZIhvcNAQELBQADggEBACPQGxY87LUNIvvWqwDDLnZmV5sj5EA6O9gtlmbs +Eukjh3xnvGOEo7hpka0eM1EYX63trB3pv21kfU/SNiZNiqaKtBWbL3dvrEF7DERd +1HQDHOmpNUc9WvZ2vfrXhUqR7eDp6lyHiqu1Ij0fQOoV3h7uEFqw/wDFEzi/aIOp +66xKiqlsaPKbRQn0wmbUHNgLzjlllw+BQxIupCg83T2z77Mjz3gTiKIxcF3yZmRP +oOOHD39tcBT0DgpzafPC83WzGjoxbeQ0DRTvUTGWayz+7NsFmxrsqVsJcx0Q8gNw +HL2+9OHptC2DH1cj9FqbcU5KvdyzDYaUKSZualNkgAo5nuI= -----END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/amf.key b/configs/open5gs/tls/amf.key index 89f3f7428..065f21bf4 100644 --- a/configs/open5gs/tls/amf.key +++ b/configs/open5gs/tls/amf.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC+atXlyvMM78sp -qxKcS4HRoPAKx1IhpNAXq5MCMDr5CUZKqJUMdQlVfkmQLJy8a7dfgxG/T0xKaqwF -1wFsRrYwwlvBQETxX4c4quAdDTx7k7V7rL0/vcRdCBGPxxcjv9xGIeb0YeYBmXVu -VJIIeFnuGcP5cNHdgRQNvy+V8+MzldT970ngE8jTKuJj1g+cVLNLrVMznr5qJv/r -zDvBxnnCr/HaXXDOORoHreaR/TsE9JxADrrFvL2GSpAlSjRQL38gjlc1RvNo0vFw -EazBsxT3565GnWK3/7FeDkO4S3OGXTvN5F7mzqAiZsa8ae2fGml4zRKRltnWUKlP -cOe0j/bDAgMBAAECggEAU0sRaLTXj4ufH4l9GRAwZ73R8q0QwLXC7u+23Siyyzfi -3wqSNEJHxHV7AU16fDNUIbwIOdqaoRy7Rcywiyf9TyPdlhGidsEWOdQJN7wP/nB0 -3PYJTIYajKVYZT+t4A3vcWAoEjN2tLFnfE0TGhBnKi9sGcNfkdiCKKc+TgZCls/M -+ltrp3+QVH9UO6AMj74mNjNSN6EQOcsO8BUqNnzTsJ5mkTLfLyfoerWXtZlppXZM -/0gyYshP+SN4d3Iuj1NUlM3LLTAx/hg08u3ioBURcRBF0wSIkywpgC9SdqAWKWsX -V6BEIbNwRQk+0V782HTWaZ8H9aCRg6MOk5KO137r1QKBgQDkF5lApIoDAkVb0tFI -wyRNnoNtv0HitbXGLGKS3KGyPPqCLgdnngeEgEqB8ejqjkMzdOmn0eaSmg/yml5O -Vkkw1nSmYholzEbEzl7A34f3AOLMx5hegTjiJe3MrBjZN2qoyDJH8xikl+XFyV5J -sNZe6uRyFozIRrzEPMxgW+R3hQKBgQDVtys66kqUz+5EGwY/n6kIV3ip8zp08KQj -Q+a/h/2EZWvulKLv+Wcr8bwSqOs/ZSaKKgK6VOUK76CYQcHDIHuJEd6TEOC32wLM -uhsjX+aVcTuWPHmGZdJxk5JCI1W0NIxdLVJKg5J1nAmsfRmhtk3yG+C+1i7PSQRT -Y1m/92SzpwKBgQCpM3hUI7rdkImzHCh0OY5spfIJL5/IddNqNvLIzzKD7ghHGa4U -h348JI8g5jtKBE6FlWzfOS46Al9iMHFU211gBTZzVsLe1zKIPC6+FRPff6C/GDFH -qcRwvoIxGlk0iY9ttVTXWtYlAylIF6ECOVRNBSKCH4g/6XmOeSuDL6fDoQKBgQCk -UWouqTdgxaKnwLOENakMXdzLptR6Vw+Mgcen2dJlemmLDcNdiT/3PKzjF/eQTaBd -OMHSLDXSu72Zc22cLpxtHk0ofCCbnAvCBxGYmEK9AkvTTnoNiLpOUy1wJqTdok2N -0qvj2NfCD5AsjB8qA/ZYQXECqcFh5P0rdEbsXzWRHwKBgQCM/GGUXWI0LrkcQpDY -dpO1C161b+zNJHWwM+7cL2kM9azVwW3CNq1YV7c+GRuJG8YyToIYJJfIIUSiAFH0 -97J/JoQ2a/1baMXNaZf06WATtjsFywtG+O8FwZs9rAQ7oDeSe7l5jP5Mw/WjY/Kq -BKoi+9Nz8JldcTIi1rj/YyuHag== +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDIMbgP/p2twCtN +YWbUNMdtNhATh5WnpwyYjd+DfF5zqb/UBuPzmHmOz5FqgdQPytG2klYpOJEbLkFe +UQKwwwe9Xi7o51ZgJfwAE71Evui8KfVT3V+NIH0m117w0CKF1Fyg+mOE6c2XE7qC +Yyu3duWuNNoLOH20DYt/nFLtGxoKlUTuqw1mBYkGAGwvLUgfM3vkaZN+wJXh7ae9 +s0MoxkrAJJhX/Dq39FTAczl9EXE1sF5N9aiYHei9O4JCK/hU69EJ/xxymmseIqRU +BRiGRxjV5gK4FE4eYMwBR5IX9xhonCfQkHQEYfP+uRrX9S1BwhvaOGS2bmOY2xmt +S3Y4i8nTAgMBAAECggEAEpy0vR/x7u532CjfE4mYpOmq0vX/Dugz/pbqGeJdMamt +gPvnA4XAf2uC3IEXgyRbHPs78Xcl3n4Na8RiWKa5OHziJZskZ6oAZM1xAkwxfRT1 +jwd807UajZrmY8MmAoU822aMDBZkm9AkveyUaukt72VQhEyLO0srFgEloI+teyA9 +gFJnGEkGmDIuLLQv6bDfYPEWX0hN2TRyPzfm1+AOnHZN9FfKyJdMgeUST9D8JrDw +HMr3i1IjY4k9gRUOHTL2b+1wjselrcCbJaJA9MJPufAO2heyHryyqExY4UhcUuFS +/1i4AiwDKJuaH8M/BufR7Upn/CdjgEX1tkGA/8+CQQKBgQDlPeUGPofuAuCa4Q4C +31HJ4lvTrEDUrW155tdOmrmdh5nQMhJ0Sn9us9d+C8RXWhu/IjctdIj0wkrC/xNE +C+0VHTglW5lYhV6k70+91kLbTndqfMYbomg+NRaaY8wR2kdvAr2tf5XYqmivgqMJ +Duqj6O0yKnmcpRpRccxbwxJ6oQKBgQDfj9ZlffQNU61k3kMKr2ZLCTgA7j4pwpWh +RQ82JnxVTYLoTgGtM8QX9JfbrFIEp09DNd3Pc601STBQlHT2PRn5sTRaXPOGP5jP +XBQTAjrBh/H8WR0HvIOmgLs7ncOEIUYQS0BWN1HpeRZzAbyTR/CZzWYIokAq1kfn +hlviOqGD8wKBgQDH5d0cQNLPXXr2E2HgZ1Qus1BXmFFAI6rfLch6JrnNAD3EKqWk ++oF8yx4SL7iaY1zmorNy07fJltMSjtMB91RZoQ0gpmtloYcSVAw5Aelyy02ecgde +eZRlCm4XWwbMWocH6l/0Ntk4AgEfas84SuWY4LhVkmxRiDcW5iDJs6UdgQKBgQDI +rCkrovqNd93929Bb6AOvORAvLatY+tQrFX1JAxS50UC/Wz4ABaZwRlqFkdFxYekx +EEoRK+l/GjonKosueLw3OEwhDKx/hdiZ0TInuemZzHh3Jlp7lkiqDYWDRuK4WNG2 +UIXonfGF2+49v4JQxdN/izKab2Gf0gZrGVyi3jQa5wKBgQDRBY0Op4lRm02PCIVi +BRLIDMNzR/FDVCM7H1/SqB7fqqYAOKdvLjvOFXqBuHbw4JLh7Sxy1qt4YB3eJniJ +bkBBREpy/qP9s6kQARrAiWyRw/rCi6uwBejFG2f7EbT+QK8cxg9AIrZtzDyOMvEq +g9QwoqJkiXGpXNQe/aZL9V+9GA== -----END PRIVATE KEY----- diff --git a/configs/open5gs/tls/ausf.crt b/configs/open5gs/tls/ausf.crt index f2dae2caa..18b5c472a 100644 --- a/configs/open5gs/tls/ausf.crt +++ b/configs/open5gs/tls/ausf.crt @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- MIIDXDCCAkSgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK -DAhOZW9QbGFuZTAeFw0yMjExMTEyMzM3MjVaFw0zMjExMDgyMzM3MjVaMEsxCzAJ +DAhOZW9QbGFuZTAeFw0yMzA5MzAyMjU5MDdaFw0zMzA5MjcyMjU5MDdaMEsxCzAJ BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxGTAX BgNVBAMMEGF1c2YubG9jYWxkb21haW4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQC4kKPcYH2eCayT80Ye9dBf6JmJGwfpkkHlwSlMNW8hh/aCEhDF8pj6 -8xU1Wqqptxs6hHHyLMdtqw9AlnOZlOZdTh8zwA5ExR+vf0IPK/bCDkRtUwBlyOUy -LsEOoqMbdTEhGmriykQS0t7O63vsPeiX6oF31AgaNfI5glxZpjUI61rKcHTxCYAX -XALSnIw13fnaQxz2ucmnioTToM28X0GA4ByGs8zgPkAf8F+tDYr+vfiYPZ0ELmLY -AXJCdK4e/VzY1DsfkqnWCCbVZYg/sCjxFIa77PEQ8rUJ0VBdKE0n+O6hqR/7lL6g -Idrk9Vh0LWueQI+cNy/IcVQbBOJaPVZXAgMBAAGjTTBLMAkGA1UdEwQCMAAwHQYD -VR0OBBYEFBxp6AfQv4qeBrN5tM2WjNjC23pkMB8GA1UdIwQYMBaAFLFq+pyZvAQq -Qohl136+YHCiDtpAMA0GCSqGSIb3DQEBCwUAA4IBAQBBnrBNSkmzMM5TTBrzCmgo -GktZJy5iM5394OSNKwYdIAxFUotIP7PKwE4GGA9fMauYw+Q5AictubsZEW6Pc4SK -wtvgDUkCmtOitdMxRGYa7lmVpLxsyCvyMVTH5eKvSWQeMBomOP6WR4Huzj+RGcTc -dU3BbNByNMnGGoXO0WYoW6nal/cEIaogYtH2JM7v3otDztGN5ixmvkNxmd9ewLEu -jYkcpqY6WPpK7TM55fBr4f7N5Tin7GM8lE/SQfnJzREsCDPrkLoEuB6DXG7dgjvA -ZdrM3eD77xamzT3nA0/5Up2bDoQLtYMph0muVfDrOKL+pzrtSrR6CnkPVgX2aWrF +ggEKAoIBAQDbQWSkjNFtGaoMw9MHySnxSy3GxP/jA998L8vu6HLvr/Q+p/jUz0GV +9ids5Jj+GSOJyHaFdm27Nt0mcdSnwhhrdmlERpAtKV7FyfneNP/gop4F2+/fdLd0 +WkrnxKPIi7n007YzZVLF11YC3AUsxL/8H5es9xe/WBatOf78VhU3H5/kWjtslMpz +hOgphaUrXnEOU9RDeI/17sqcULGjcNxJu7R/kV1pHDSCi7YCLrazGe/gplm7/kW4 +il0cm3aJMYpAss0QI/tGPU+bRS/gVmQQfC2cgFup8DMPHbPeGDzkRUT2ertEzvEc +n3bfB2KouIgNZ6ekHwZlT0rdyvTna539AgMBAAGjTTBLMAkGA1UdEwQCMAAwHQYD +VR0OBBYEFPpBBKBdolJWbI15Yvcn5DgJ0Zo+MB8GA1UdIwQYMBaAFNsWwk4/RPR2 +uBLq3E8R1jH5Zsd8MA0GCSqGSIb3DQEBCwUAA4IBAQB32Rexzz+lBZ4JH8R1j/Hn +MiDzuoM+n3lhOaNP9NHOddpofOypSt60NvK4ejNKSvis6it4SiPtMCUMv/dxBzsI +AFYN9LfT41klVDZyD1vFaS/niIt4m1T4XR4x0P5ALjWqMWzKLEmFdXtN6OrbnORU +QfssTjbq/XgVOIKmwdbBheQJbIIDSNKt4sKH39yP4mdhl84vbklodXYXxOD7LEjw +ST2v9zsiuxCf2BXcXA3gmfJKFTib4CrrIvh9gHCvEyyD85psypmBuSovLSELBW2B +9OtFMKSqNu6pIdaLpNSxYnWbSzOeOM6ogPJ0QsPgkhhuhX2FA3DgIwF6++WCJEyw -----END CERTIFICATE----- diff --git a/configs/open5gs/tls/ausf.csr b/configs/open5gs/tls/ausf.csr index 1a75d7241..72973c917 100644 --- a/configs/open5gs/tls/ausf.csr +++ b/configs/open5gs/tls/ausf.csr @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE REQUEST----- MIICkDCCAXgCAQAwSzEZMBcGA1UEAwwQYXVzZi5sb2NhbGRvbWFpbjELMAkGA1UE BhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQKDAhOZW9QbGFuZTCCASIwDQYJ -KoZIhvcNAQEBBQADggEPADCCAQoCggEBALiQo9xgfZ4JrJPzRh710F/omYkbB+mS -QeXBKUw1byGH9oISEMXymPrzFTVaqqm3GzqEcfIsx22rD0CWc5mU5l1OHzPADkTF -H69/Qg8r9sIORG1TAGXI5TIuwQ6ioxt1MSEaauLKRBLS3s7re+w96JfqgXfUCBo1 -8jmCXFmmNQjrWspwdPEJgBdcAtKcjDXd+dpDHPa5yaeKhNOgzbxfQYDgHIazzOA+ -QB/wX60Niv69+Jg9nQQuYtgBckJ0rh79XNjUOx+SqdYIJtVliD+wKPEUhrvs8RDy -tQnRUF0oTSf47qGpH/uUvqAh2uT1WHQta55Aj5w3L8hxVBsE4lo9VlcCAwEAAaAA -MA0GCSqGSIb3DQEBCwUAA4IBAQBUpX2wR4LNsuhCeFLjjiJKClOdkqKel/U2gCr5 -pW7JisU1pnSBW1ZnI0usssGQeejJUvS+24fTb4aQp68DJ4E70s4N6M+oMyUlCIhH -5ELkG/rlXtir4/l7WP/vF5M1F0bPKLCA51nRfV9tvBR1nAVFfr5ZBGWo8vZBKz9v -v43beNjJxmCkurN7j78WP0TYEs7ehGCXh0mDtW6SurKpnWswsjInKtyUR470XHwt -cVJy0HelsBsqpf6I9SlY2J7SakGPDtqARkIisKA6vO4sZdKP0aYapY3nCB5rLvNH -mC28DCX1R0gqBoHTML0lNUiGEsDe4R4O70dHvWHdZr+zPow6 +KoZIhvcNAQEBBQADggEPADCCAQoCggEBANtBZKSM0W0ZqgzD0wfJKfFLLcbE/+MD +33wvy+7ocu+v9D6n+NTPQZX2J2zkmP4ZI4nIdoV2bbs23SZx1KfCGGt2aURGkC0p +XsXJ+d40/+CingXb7990t3RaSufEo8iLufTTtjNlUsXXVgLcBSzEv/wfl6z3F79Y +Fq05/vxWFTcfn+RaO2yUynOE6CmFpStecQ5T1EN4j/XuypxQsaNw3Em7tH+RXWkc +NIKLtgIutrMZ7+CmWbv+RbiKXRybdokxikCyzRAj+0Y9T5tFL+BWZBB8LZyAW6nw +Mw8ds94YPORFRPZ6u0TO8Ryfdt8HYqi4iA1np6QfBmVPSt3K9Odrnf0CAwEAAaAA +MA0GCSqGSIb3DQEBCwUAA4IBAQACJcOvM6YWxP6iLO9vfhNDIeko051KLraRXK0v +nmwcF0JIhbuo9NWI/1QeFYbe18sguA7s7M3G/Hz52yvRVKLlv/mmT7DzbafUfJ3n +AO35LaY5yRsJJB9eGYipB9IvwM5EyjquUQ2UUUVmYUQ5eyKd2cBXcB3Lu1tACE9C +yFoJiK+mTfnxwsmswj/m1N4VNNCOewgxbL1WjTz0goYtVSoC3Uru3J5Z2YPZMzQN +F8ql+NnfrE1LbUCN7+ukxpA/Jgl0b2XjVUGVw3BRPvT6qaF0pnP9wQ+hIhYk1Rut +WxYtVXbtFTgMwQ+igIx3q4JmloFEMb6ntKhWR4gXCyAPAWzH -----END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/ausf.key b/configs/open5gs/tls/ausf.key index 1d3202fc5..bc735c731 100644 --- a/configs/open5gs/tls/ausf.key +++ b/configs/open5gs/tls/ausf.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC4kKPcYH2eCayT -80Ye9dBf6JmJGwfpkkHlwSlMNW8hh/aCEhDF8pj68xU1Wqqptxs6hHHyLMdtqw9A -lnOZlOZdTh8zwA5ExR+vf0IPK/bCDkRtUwBlyOUyLsEOoqMbdTEhGmriykQS0t7O -63vsPeiX6oF31AgaNfI5glxZpjUI61rKcHTxCYAXXALSnIw13fnaQxz2ucmnioTT -oM28X0GA4ByGs8zgPkAf8F+tDYr+vfiYPZ0ELmLYAXJCdK4e/VzY1DsfkqnWCCbV -ZYg/sCjxFIa77PEQ8rUJ0VBdKE0n+O6hqR/7lL6gIdrk9Vh0LWueQI+cNy/IcVQb -BOJaPVZXAgMBAAECggEAIqhShNb/r7YMWKn1kGnDa8cfUa4oQbWLt0ua6Cseh7Li -2NDwomMoU/Nil6bDZmQycj4dsYa0GkVlc1DtOzlJOtspI8wcQdCsXwWsD3JHf3Az -bD4KVJKxa0d5TDjBHS5X/+nYiWbG+qvrV/rDRfzoGOLZ1fkUXmuj5SW0FseNrPNH -VaRrC+YdnFfOs1m+U7PZQmxSrp3C9FxQWCg1xTXT4vnOeoqsJLDQX6njCI6AONPD -9vfeGLMD3D45Bk06xfv1zFz7oNgdu0TbOISiDKewUJX1MIpZbaDvx0LO7dBeJBWI -x7yZymTy6B7cspyO9WuC7B3uvSZb4Dj0kmityXze0QKBgQDk/6QY2FMZbOpC0xuw -8T67sxiF9omr23lxWZD+2PMe4IgcD3mijr50bg+pnoZ/R1cPs9IRT27gtuKdpQlS -FOrV9kmJqXGGMO8R2edafzGRim3M+oKVOC8KuI0z/euGTKtKpozMKaoUF68nrMx4 -/7ybauLVYOuWDEqI+Fu6/yY+MQKBgQDOU8OOe5oW3BcNY3/yq+PWlaI9qEehsJTn -kyMvzn5YbKg5yfF6rexm04pY9WCOZfOzvP5NdwwG/InR86YaVOxuuiDE/4WMip18 -rDLabGhlcxsja137c14h8hr936xcF2A4Nd5Q6GYOtCMYNAvCTSAgI98jyiwDGxsY -vXl7WdQTBwKBgQCgZa8698q89FzhkZzDwzZ9omR68MRda80UZ/f3iV5BMmQjw3Mf -OXyNcMnntPHgFMgWZ42sMkcnfvIcGYz9wUj7tRatJdIue/f4OPijmpPNrXhbKtxs -SH4qtDmzQRfHacxQ7XeRSV2n1S8KSy6tUfN5qNRZQRnCb7mFVvBpem3/AQKBgEIs -VUzuUXZBcldF8TRIctNQvG8f+JFgC/HVm/RqOtVrS+z02rDo9SfpcrajRCuHgUjF -NZ5srvvSpPUkOsK5N/cvVPE5roBruKTSqaCqIjVfXHXYqpTJ5IfomUWRJjuG98Iv -bLTwREM0/Qh3MMpJaCNGvftBjSoV2HPv2PV50u2jAoGBALbTtPaHLmSjTE6L675y -Qb440nmgkI+5jl/KX21Gjnes5OqqVmmFzz/1fj1/ZwGpbzp10jdBG2zKChATMsjl -xqPq6G0Gu5RKUeRbT64at3e1+aukU1W4L05GAS8FQru4qixKVK5be/24bmTLTpJ8 -tm0reJD9N9KJQouyqctAnf1O +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDbQWSkjNFtGaoM +w9MHySnxSy3GxP/jA998L8vu6HLvr/Q+p/jUz0GV9ids5Jj+GSOJyHaFdm27Nt0m +cdSnwhhrdmlERpAtKV7FyfneNP/gop4F2+/fdLd0WkrnxKPIi7n007YzZVLF11YC +3AUsxL/8H5es9xe/WBatOf78VhU3H5/kWjtslMpzhOgphaUrXnEOU9RDeI/17sqc +ULGjcNxJu7R/kV1pHDSCi7YCLrazGe/gplm7/kW4il0cm3aJMYpAss0QI/tGPU+b +RS/gVmQQfC2cgFup8DMPHbPeGDzkRUT2ertEzvEcn3bfB2KouIgNZ6ekHwZlT0rd +yvTna539AgMBAAECggEAI7akIRV66215wHiJQERpG4+mVjEyiRTRa1YRvsmIJzie +7THJG0jjIv0kcN1Pelw36LKJc7XVq+AE58U04VqBRcfU37UquOB7OnZqx+IUJ8/1 +M3keumQ1mbM3bkcecoUn9hQiIn8Hm4g2z2JtSVyG9RdkSl05NgawMuk2en2/GOo1 +jC0F9R/TVNwnTacg9mi4K0NEjSH7SLUsckT9jokbaW+Dm7vlSR8I9vOIZURZhT8B +0NOW9hdD0rzefNCCNSXCSyY8zUr/uc+D8yryhba62MIp39cSlpxunVN510WexiuB +78ukCfyY7hkjsDxaolgrt1JPenYjvaOnYGLg8WHolQKBgQDinXQCfoyDj+neGd1T +KJ9WO4W7TiMsCN53yWeHeiB0Cq9VhLYZ6y5SzVz6NCsAJLBGpPSy/lOlUhR/aQ6N +0HB+2fsJ/syBbUtuqwkoQPq5PZScVzdZdFob0+2hCCCF6TuFkA2eY3dCTs141GQJ +tfPny+5uSdRwO/goPPRrAakmhwKBgQD3r6LCh+CZ2QrP4yNONXNVh69uDuimN7r+ +l06PyAe4pHeErClxLQI9XU2jG90h4dS2Qk2VJXO2JrOcxId9IEINnBZehor8veNg +MMtlr2U/EHbXIMNTqEOjQ3uuuFb3nXr8EMBU7vLX9pASrjB00l/CZK1pfRLG/h3e +HOMSriy0WwKBgB62XCyiXgTOklGJi9djYATd2EgEVPv4z73ITAGuaYuQjya178Af +gY2zS3CVdWZ1knZgkNFZapizQRfrcw+BOl3WyREXuTupRlnfUERmWhSU5fkyUMwM +2tF+rWvvoAjGDU0SsuXOcTFJYMuJbW1rfXzixJOp6eK0HfPGHxIJjZUtAoGBAMZZ +xgrpC4nJEWqH6GciUNmGzothrxglez+U5hoow14vf3Mk+A8lTyzbQmhD0SPoGRNY +J48wLekKNz5s+F/Q7HS/sf5C2p0qaCNJECm/e2I0iicfmqytDHV7flneT+7+E1Y3 +B/88WAdw8dGz4yQ6sOsY+vKGcfof2MVd9s6n4y8PAoGBAJE0X4QG4Y/JK2BuqNMO +McrbaoqH9y9DKBjly1yFz6S8K7niZ7n8z2FdbX86pJCxvUMnvFrd94HrYTKSQgpv +snTH4kQENzDgUqvm0KP1rq09UQM0ZJpTgBvtWf/IPFtP6PxQh4yauyJRY3sx3n3q +hlm9Rp3UwbYZM29LiiVpxDTi -----END PRIVATE KEY----- diff --git a/configs/open5gs/tls/bsf.crt b/configs/open5gs/tls/bsf.crt index cc896dc5d..cb120770f 100644 --- a/configs/open5gs/tls/bsf.crt +++ b/configs/open5gs/tls/bsf.crt @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- MIIDWzCCAkOgAwIBAgIBAzANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK -DAhOZW9QbGFuZTAeFw0yMjExMTEyMzM3MjZaFw0zMjExMDgyMzM3MjZaMEoxCzAJ +DAhOZW9QbGFuZTAeFw0yMzA5MzAyMjU5MDdaFw0zMzA5MjcyMjU5MDdaMEoxCzAJ BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxGDAW BgNVBAMMD2JzZi5sb2NhbGRvbWFpbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAKOY6GHHkFrexUafHFilmA+vsnx7tfbFS7Mkk41QmSXR2+xjG1MenpOQ -kOJdDq5tFm8SsBIqaNmyTM1Tx2j6vT01KnludLJait4Q1F8o5npF5YFwMegVf06o -ZcDrsFpdyIi1EjoFt1bhM02j1GkRVzfIycPi3xrJ1croWWtIj0J/CN4TkoAYaqUW -8B2pccwVbb4jvUyGU61xIARkm/pHIYrCEjiuWP99imbROSUMBX9ne/krtgsJYylZ -XPvZiZkrAXCFHx2KKrm9zOaXeYHSCEiHJQRAaSJICJA2COz3zzN8XpIJVP8paiXF -B5oFoUwex/VdZ/a0m8jm05++jcHXVIECAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV -HQ4EFgQUgkNWEi5vGgi/rNh4n4WI3VkWdxQwHwYDVR0jBBgwFoAUsWr6nJm8BCpC -iGXXfr5gcKIO2kAwDQYJKoZIhvcNAQELBQADggEBAE4+FPquzZPJfAg3namKryWe -zJjibTvvZenRDoYhkJ9HWhi4tPvLAUqCHLe8sUfxcf5k17T+u7pYfK/+1IpGomWh -Y6OxrxnNK4bnhxTFEch9j90x+cLyAAKVzDAotAgI/OoBQgqiSo0I3pe6MBVPZVIH -Ga5aghA1u9QsLOr7XcuHLAXzMpYPq+6vjHTy1cSi3csQcVNLo67pB3l+b9o1lVGz -6Y8V1L5n19OQ+gbCOSQrGXPAivWWJIDvKW6mtinFLNZ2f1/WDvkh9L/nSFNUsNOj -uWqheRX7FegwvwpjhFfe7TdLQg4OZ5Q82JRFiVmcwx3cDRHPe8BlIdkkTmJvilo= +AQoCggEBALcfit31Zsj4Dm8vBLaKwrO7idPNoxN7jUQTPdBR5+EA6g1bMZtyKqDS +Tio/FR2BnKGoCG9eRmz7yIdN/ctjipM/f+c44ElxWr2UprJihfaeJtj0yDwxAhWs +xdbzGTBAkz58QoA0hOAHk8jS7n5jHClDtUHLHpawBxvpIbSypRUR7P1BOXtKvLvC +AScY31sgbqXoyerH1x6KdAq+H1o8ohs6UQhF3x3fceY0w97WOK4GNz6JKgiguc8Z +NmJt3r/NotjSqfDHoseUmCLxY1nZgRDhC6yOlAhgZt3wU6vcZBGZod+RK7dPqb6d +Z6awyuZYv2vY4ck+TQwdbMQX6pU4g1MCAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV +HQ4EFgQUAioPxAkTUXOTQWmoxQi/KDtV5N8wHwYDVR0jBBgwFoAU2xbCTj9E9Ha4 +EurcTxHWMflmx3wwDQYJKoZIhvcNAQELBQADggEBALJDxgGqslk6HsI8JIM5G3/v +OltyUH01kx4zVk5Vmfd3kYsX+SkpfvShKTIuKTYj9mCO8r/tj71YYRobkGwZrzsp +MArGJYBjgj1m0UyCyK1YaHhUcHtp9A+xJP1bwpsvUGD0ltRvvB8eBf7A01+pCtq0 +t6Bz3IZGJbhtAXZMq2NT7P7T/hjpQCpJrXzNNNu54tFBzyPq9QMz4dufUHEetTVk +YwA1eXPeuAfau5azxOpePvB/iMqK+A+i556+BkOv/TImLeSm9dW1MqYLuvOnLsfA +tmZLgm8OUlXFnjXPXjT4qKszPoBQV6zEAxC58LPB9CU0Ka4UIOAjpkMIspU6ZBA= -----END CERTIFICATE----- diff --git a/configs/open5gs/tls/bsf.csr b/configs/open5gs/tls/bsf.csr index 743db7099..444fe99e3 100644 --- a/configs/open5gs/tls/bsf.csr +++ b/configs/open5gs/tls/bsf.csr @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE REQUEST----- MIICjzCCAXcCAQAwSjEYMBYGA1UEAwwPYnNmLmxvY2FsZG9tYWluMQswCQYDVQQG EwJLTzEOMAwGA1UECAwFU2VvdWwxETAPBgNVBAoMCE5lb1BsYW5lMIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAo5joYceQWt7FRp8cWKWYD6+yfHu19sVL -sySTjVCZJdHb7GMbUx6ek5CQ4l0Orm0WbxKwEipo2bJMzVPHaPq9PTUqeW50slqK -3hDUXyjmekXlgXAx6BV/TqhlwOuwWl3IiLUSOgW3VuEzTaPUaRFXN8jJw+LfGsnV -yuhZa0iPQn8I3hOSgBhqpRbwHalxzBVtviO9TIZTrXEgBGSb+kchisISOK5Y/32K -ZtE5JQwFf2d7+Su2CwljKVlc+9mJmSsBcIUfHYoqub3M5pd5gdIISIclBEBpIkgI -kDYI7PfPM3xekglU/ylqJcUHmgWhTB7H9V1n9rSbyObTn76NwddUgQIDAQABoAAw -DQYJKoZIhvcNAQELBQADggEBAGh+iW6t1TL6ylPvzJpICuoSitSF2FsxbfNBpu+o -rZpVlwUsJNRzofxoU7HGEJ8gIAs3MmkkMacaAnZ+o2sHuxtyVnHlXWBfFdRmJIW8 -WikaJTDV2s3lSgntvQJk9PiRtRJfUAO+z78WQisLah/lxKjDEUQs1PTKPbtQTj2O -S4ys26g0OsBwRV11qB93EEQFjz9eExYk18CKgmzntTU5yOJJ3PFj8rjvyyybNtdY -WulE9Ht0rcBZcsDfYw2DvOaz50MtUviTjAZxFHLuyE8igbjy3H5BORFOp5Vm2ybH -/YUwcmvXBiszycaG0JRL+vOIEXAc1lsgmfg3er1QK5N2u7o= +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtx+K3fVmyPgOby8EtorCs7uJ082jE3uN +RBM90FHn4QDqDVsxm3IqoNJOKj8VHYGcoagIb15GbPvIh039y2OKkz9/5zjgSXFa +vZSmsmKF9p4m2PTIPDECFazF1vMZMECTPnxCgDSE4AeTyNLufmMcKUO1QcselrAH +G+khtLKlFRHs/UE5e0q8u8IBJxjfWyBupejJ6sfXHop0Cr4fWjyiGzpRCEXfHd9x +5jTD3tY4rgY3PokqCKC5zxk2Ym3ev82i2NKp8Meix5SYIvFjWdmBEOELrI6UCGBm +3fBTq9xkEZmh35Ert0+pvp1nprDK5li/a9jhyT5NDB1sxBfqlTiDUwIDAQABoAAw +DQYJKoZIhvcNAQELBQADggEBAFSIMWWmF5dKNZK0+Adq4qmuT8e/YEues02gp1gn +kESG1UG5NIIuBFnznLS9LD5JrQ5VhhL6GswyLGy6KtTMuzjhHqQnxomw7ERUHHo+ +C8U0ZxpnfoiHcoJ2laoKsaxjtiRQLI8B72GDj2zsDR4qGpAb2F5AnWCWbVV+Elap +cAvNSulWTfkatSw1SM816N4jWohgqJO8nruT2PJ6eUGpetYqqZsRAfQsOGyTO/AS +C7LBaflPdOOib9X8m71G4fJgDylweqm3VOEToPl2bI80VKCKPJemjlNv5VU/ERbi +PfGFH7dpL2/SK9sNkUGX/90sgRoFw2xMUjxsO8tdRPKCeA4= -----END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/bsf.key b/configs/open5gs/tls/bsf.key index de2ea11bb..701973051 100644 --- a/configs/open5gs/tls/bsf.key +++ b/configs/open5gs/tls/bsf.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCjmOhhx5Ba3sVG -nxxYpZgPr7J8e7X2xUuzJJONUJkl0dvsYxtTHp6TkJDiXQ6ubRZvErASKmjZskzN -U8do+r09NSp5bnSyWoreENRfKOZ6ReWBcDHoFX9OqGXA67BaXciItRI6BbdW4TNN -o9RpEVc3yMnD4t8aydXK6FlrSI9CfwjeE5KAGGqlFvAdqXHMFW2+I71MhlOtcSAE -ZJv6RyGKwhI4rlj/fYpm0TklDAV/Z3v5K7YLCWMpWVz72YmZKwFwhR8diiq5vczm -l3mB0ghIhyUEQGkiSAiQNgjs988zfF6SCVT/KWolxQeaBaFMHsf1XWf2tJvI5tOf -vo3B11SBAgMBAAECggEAAlCr87PItz99LlPauWatA2ZQrd4sj9ugh85IBAVAqJJK -5OJNaQCHPRZ79WccmcNvkIZ0vUoSOifxuitiCFpZhpnnsiiZ8ErzmYNGlRrpoY/3 -CK0VOLgCqWLcz0VKlWnLuGMLGSz66GjnEmWD0FGTcNW3pLzzfDAgZVbiyo/QHrBS -mhayw3ceTgggFDeqBXEpG3w1CeWIdOLafdQ7fCUkv34Qww9/kJ7gERbX4eoAHZMO -fwkkOZ6xsKxH4tKOEAo4hkTnTo95P9n5UpvDGG/8fKV4vkto9KMWnCUSMUZz/t0Y -G/Jv5aHOQJkfnzS1QtfgfZiHGbto5R5oOGZsy0NdkQKBgQDbJgQwVErskpYGNJwc -tOcz3gooTEkE9tTsX6mT5cCtY2A59k/y6rXSv8X1es2CCkDFLqGHuOW/TBG6ZE9d -8JrQVqQbjLe3kcdRdHlwdfzaj9HfQa/ZBZ2gGzhzqrB9Cry7v14F8vQ1M4qWtEXn -XhWFbR3YP8qjFs3eKLS7DC3x0QKBgQC/G4DJPXvivz+M6iQOYWZH6aO+00Lrm0iv -UsHPphP3LbIz3cDSAqXRTG18oOikmFCQkfNCRzB55JFwf6Udd/A3CdrIQ4rsqEWn -kgtY2ZKkU2ZFtCs5wOiD9gk9CnsAb6D8rSaiKkp1X7VMssyoMrHkBFXvQKHtXuCk -OkEqR56zsQKBgQC43sst0g4aoFY7CeqgNOPN14QOFryKmYdpmBHAGFOAcZLdkrJD -JEkabnka6uuuxeN59CqECjCWPh++c5yYjL6s/koWi5D4JNxWFMHVY1NZNXZAtnMX -yyr7w7rNqLKV6ZbpczhoIFpu/vnsxEssMSxKkJBauwXAqx4kSYadPFsN4QKBgQCT -2SVDi0ui2q7ByArpDTViAUFrSmoFePc8nFvQ1/2uRy4MrkyUrPO3/tbdimcxn50E -m8WEyyqXwts6G6aUK8wt6HPYZ1i9SlnJEFWzAXBPrS38Uyz122aHYPs4vDj412PG -1/aBkxJTyB2tHs7yeXXin/ATzv73c2V76I2ttgbzoQKBgF3J7l1yUQ+4yxMUF9PI -Ta1S87ShIM6B6XgzmdGYyn27lB9jAvmnwNe4pLd5GXZsvIZi8FuQQ9WNPEl78Nj1 -8kSBwSi/MZS1/fiLyP+IaGuaKrfYbEzIlT2rXSgO9IG1gdfO/MouuL4+brynXeDS -BUuR/ojPd0aSsdGhNFvcwUYA +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC3H4rd9WbI+A5v +LwS2isKzu4nTzaMTe41EEz3QUefhAOoNWzGbciqg0k4qPxUdgZyhqAhvXkZs+8iH +Tf3LY4qTP3/nOOBJcVq9lKayYoX2nibY9Mg8MQIVrMXW8xkwQJM+fEKANITgB5PI +0u5+YxwpQ7VByx6WsAcb6SG0sqUVEez9QTl7Sry7wgEnGN9bIG6l6Mnqx9ceinQK +vh9aPKIbOlEIRd8d33HmNMPe1jiuBjc+iSoIoLnPGTZibd6/zaLY0qnwx6LHlJgi +8WNZ2YEQ4QusjpQIYGbd8FOr3GQRmaHfkSu3T6m+nWemsMrmWL9r2OHJPk0MHWzE +F+qVOINTAgMBAAECggEAApHf2VD0aGiWwN4VJllyW9Xxz4LPJ/RWNxJzQR7Z7rEc +SvCwx9PFbMYjkHmb9CYmZELFgrtjdWvfh6Qpph0kMjNnbTLB1Wk3H61cEE/MPa0N +fxwisGzA1zxtkFOPOTttKMJsp0ju/m4//cb8AtKlCaBohRJZJqTOWYifHCtcbRwl +OsSh1hRTJfLX7KH3JRHTGv3M+soYD0PCj3/5C2GZRdc0w8WGmp55pQWf13OmYbb3 +oVXZAg9aZmaFV1oeVoRAVqS1WZNiufsnbaOjzNrBoz+FbZRJCu8QFAawKx2yU15u +Svsn6mq1jp6DoxzWtP151ZG4V+h41UIMx4KwQqN46QKBgQC3iwe8eIbV/ygIuHGe +S2vNxhBd7AEQvRwE0p0rgSPOSYpQz/H8F4wEiqWtvOpeoiD2CEcTcUgAPNwGxUM7 +wSgk70DBDjEy4a76Pf9ET60RFNQn6sv0pKX7B+/s5A8m0A6D4uuBADxrNYI7etR/ +hTbNqMBhlODoGZV1PpWhJjUUOwKBgQD/ahRa4bU5eGE42XWvnOTfqoLyuFxgEe2+ +1selHXnYgyR9UUVHuEgp/1JjWpiWY5cqIseZ+JXq75ejf8/JF133zdVFzaVM6yKo +HJje6LpQwJP6+KXAXnAgNfyPzu/wKYimg9tVfc+yEkkrGyqIm9d6gPG5EF6irWvQ +rLW03q3TyQKBgEj49bJxGOqr73bIHiQZSFsfjBJLaoEFLsacFfDd/yZdBqjqhAL+ +OaT0mrpgia3mN8SZteh8+WtexvvKIdj4CsXkeZJH2jeokrDbRUobg2tvJIpaR4yU +iYkstq8wXPXJcnvtFETNmzfkpkqPozyv8gICPbqOPn0I7usWXtcbIa9RAoGAU3+p +ceCR71zUY9Jrr+KZzCkhMBpnUJzr3VS35dnSCJ8u4a0c+gpbxScMFyD5+0hJlePS +3xouYKS9LR1On439EVMAIxbMsG26Yb0fmNf6eQXMGuMIxO/ath0QGS9sr1XUr6Mx +pCxCJxPlSatS52ATPKBE5dxdI8+QDKM5sAyQRUkCgYBWu9dBiZVHQMAM3fwRXH0j +MUxkvZCqXN532oY/DzN7KSpEidj/pifFSkfCtxSsMNYEt8TjxQ3aGngbo3KLLSgR +KHveNNAC/cmsm+vOcwkByegxg3V1UjMBZZPDa8D5+EjdyMmw644kYsY+/MLaeC3f ++0AkmcNkkGEMf/vTkitaGg== -----END PRIVATE KEY----- diff --git a/configs/open5gs/tls/ca.crt b/configs/open5gs/tls/ca.crt index 60f49647b..477e907ea 100644 --- a/configs/open5gs/tls/ca.crt +++ b/configs/open5gs/tls/ca.crt @@ -1,21 +1,21 @@ -----BEGIN CERTIFICATE----- -MIIDczCCAlugAwIBAgIUWqr1d8XhDsM5Gk5y7G9u6KeTF1wwDQYJKoZIhvcNAQEL +MIIDczCCAlugAwIBAgIULbsCcbfly6gG1xNKgw+pd3Mpl/UwDQYJKoZIhvcNAQEL BQAwSTEXMBUGA1UEAwwOY2EubG9jYWxkb21haW4xCzAJBgNVBAYTAktPMQ4wDAYD -VQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUwHhcNMjIxMTExMjMzNzI1WhcN -MzIxMTA4MjMzNzI1WjBJMRcwFQYDVQQDDA5jYS5sb2NhbGRvbWFpbjELMAkGA1UE +VQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUwHhcNMjMwOTMwMjI1OTA2WhcN +MzMwOTI3MjI1OTA2WjBJMRcwFQYDVQQDDA5jYS5sb2NhbGRvbWFpbjELMAkGA1UE BhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQKDAhOZW9QbGFuZTCCASIwDQYJ -KoZIhvcNAQEBBQADggEPADCCAQoCggEBAOfs1L9v9DIXY21LuT8+Gvkmie4Zc1fN -OXP+rZAwZYiQpu9Awtk/L2YgAnJ9zXCNrL8DoGJGWGp9KyN3LJeFu6XUbyXgYDWu -Beg6LN6OUPv30zdjm6iIwEmBtiBgL5HYJZunP3b/OdABIJu9foeWdKVuT+jFNlHK -f6Arod4sVGp2kc6owkGgYE920m04a4UsYuDGhpGvIAv/r5/SBNdKuysF6gE5YHHv -4Hk8RnrxrRwQIGasMAlguwhNfbNqupQ1cxcOtMTBZ8KMv+dji+2f5PI0tmmbSeJO -nENk+A/i0JiuBH6szjZ3ylAuMiMZ42FqFLb9k3FHV/YosxZlzTyFldECAwEAAaNT -MFEwHQYDVR0OBBYEFLFq+pyZvAQqQohl136+YHCiDtpAMB8GA1UdIwQYMBaAFLFq -+pyZvAQqQohl136+YHCiDtpAMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL -BQADggEBAK01l12RIId/hjjaQy0pEbB8LU0DV9KYw3ibkFTrVnxXdAtOEvsAAGOX -s5hwltZChJJyIVEh5uwAHUMrOs3MazAMhD/FiWBeqeHjh60BTR66tof2Gll1uPRR -D7HHg8E2q01OQmZ1zhj25gd5FP7OSAgXh71TfB6CpRC/gPtYv4vrfe7ca7ZCXKM8 -h3sQxwAMajjHzIKn4ZbqzUfP+ALpOGokbCo+a83PlZgTrG0wHH5MheGQmGKUQaMP -THXAPNaAaoKXbA8rup/fzdinBG0aj5op8bNS+iZUKOLws6M2Zrns2UQ+PxkhlSoa -soOVoABREvi8iSj0hkEFrVdp8loESs0= +KoZIhvcNAQEBBQADggEPADCCAQoCggEBAN5zIbvVvMJiZ/WLpSeVMeiiv7dSPr7t +foxfyQBObbmkuEBzVodrIqTRz5dZtPwQsMcUb90ICwdqvSxcLSalRtB+XPRR805B +fa40e3sz1RxCbrtnCfBESQ8XGTLBoAFy5qQjnPxJN25/KJEpwcPeKRcsRZtOPz8v +cN7Zr2o/+EhYI7n6OHWorQXsiu8+flF7jx6R+CkvoUSZgPXc4YrP/kxCRvoIteNR +ZB2U5VO0gRZYxJW0u3eN971ECon+OWZA+zEtaWfHfCATaR8UHeiAIcMlg115NGmW +eS14DfLvNwzXdzNlQtGYtJB5ALdpkGv6rMkPbQd3Do5Muhe65vCzvykCAwEAAaNT +MFEwHQYDVR0OBBYEFNsWwk4/RPR2uBLq3E8R1jH5Zsd8MB8GA1UdIwQYMBaAFNsW +wk4/RPR2uBLq3E8R1jH5Zsd8MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL +BQADggEBABhYFDeiQqUueMaVyOEpagf7Nxmqdt1xWjbsY8JbbpfbQfCBZQJRXbzO +Q8bCDFCxqzXThu8mYrdXKCjqvlyinuwNJme904yEHNlIj5apVz9ZUiTmxxcI1RIA +AiK3LMag7Ymi0TLFgO0N8U4G2aeFLE8zfLVT7PhQN7ZUcYY3xpwXnyUkDpFYUQhh +jEosJWq6n3Bp7eAXhXb8iPdEdWoudZVVOXrbnIOMny0EVyAoUhlDmyJ/PBK4gD0a +str3BXbM+RjcmRQPcnYwjlA0F4yQ6etuAr4NzxWZCQUvaTQRlSk5OlpQY27p8AB/ +p4+VynSYQQxfw+t0xGC2Pd5cxM7i5eA= -----END CERTIFICATE----- diff --git a/configs/open5gs/tls/ca.key b/configs/open5gs/tls/ca.key index 5c3c6633d..78e529784 100644 --- a/configs/open5gs/tls/ca.key +++ b/configs/open5gs/tls/ca.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDn7NS/b/QyF2Nt -S7k/Phr5JonuGXNXzTlz/q2QMGWIkKbvQMLZPy9mIAJyfc1wjay/A6BiRlhqfSsj -dyyXhbul1G8l4GA1rgXoOizejlD799M3Y5uoiMBJgbYgYC+R2CWbpz92/znQASCb -vX6HlnSlbk/oxTZRyn+gK6HeLFRqdpHOqMJBoGBPdtJtOGuFLGLgxoaRryAL/6+f -0gTXSrsrBeoBOWBx7+B5PEZ68a0cECBmrDAJYLsITX2zarqUNXMXDrTEwWfCjL/n -Y4vtn+TyNLZpm0niTpxDZPgP4tCYrgR+rM42d8pQLjIjGeNhahS2/ZNxR1f2KLMW -Zc08hZXRAgMBAAECggEACK8vkDOK+00w5ejN+PZEYEv3IjlFvmXq3tMMgLevNZvl -BFRyd1wMVFCihtL7HFnRvB1Qph1oNiSVtvBBdTMGwcDgoJR0Rc5MXlO/Vl4R3j17 -ZTmPnJHyUU5QGYpAfb+QOPHcSIJqEcXZCLvhvwX9PCyTRW4NCKcCfGbl2sHiL1JL -BQ4++zPfjqoK7sJ+WC6bcEYQLpRHZSIZm+kzlBNUyWdtY9WzT8mTdfpzS4X8sZIH -DrmUFufMkgyciN7qt/jBhps/4/S4yjrbRcOsltcg/1Oba7ayC+vGyzGeGPGA1ddS -+bprG7+nUGRvo/bTC5YxVpIXSlOXizpwpzufpyV+GQKBgQDrVVROaG4dcUKdg35y -dLjhRcAAgR2gRJYxG2tYRGsDhBWAvVqJ5MwY919j4kdwQ6UBTnWgCFsByiv6OX6P -kK5Em8ImLEOPHn0nIYNFst5S9GfeEPaCo2jtH1k8KJYbIsUWg8toONv54Ee1VxXV -r6kS9H66zOC0GlayNazQV85JvwKBgQD8SuFHrKrGdo1Wa49LnWRQsTF0rkBXXUR8 -2NC3SiwyrCH8A+nGv4msbkKRcEOQjkbAthYjdhSXdYFtNLYsYa3VCsMDGV3YwA4w -LhjHUsdt2W8Wl26Oo+WcDa22NjTyc5kk827EsgB52N8ug/ylVP01AVr5kEeQ/t+T -yzQzeftkbwKBgAccINvtk8YX8edIXb2fgSZtMQvS2s5IxDDfnzKffowwpWWqUt3v -p6rpblxaLcZahNWxRSR8nCNFtGZu7j/wIxO3kPoORExCo41XGdw1NzpSYAD5ijkQ -Ls9bLxr+LurK9iFkAfU4Io0+FWyJIQO/tt/3uwxxvCg004G21W3F+VmJAoGBAPJZ -U7IwERP3yakcRVgTZsuEisdUo4XImAN9mnCXFYHPjA20DJrYXv1+JP/kYWK46Qox -X27M/NbJD3zBx8U2R2+AmPefJGETjA2IGlFOGThSR73h1Ve75NJU6WtBAvdrR88Q -8HSNsJtbUngyXTzMOTbziFp21+hWjJpB9nEEWhKNAoGAVLy+5NBYg3XUSZRDhjgG -D4LyKf7PjaleMceeZHlhOfG03pjnqZ6vEH6g86fUj4CT4m9JNJPtmhTu8vb96h9X -EVuEkfctkYy8KPmmqqiasZb8viMA3yz4o0gY2Vh/ZgEuFTjLVANmrP4FnPPQSLPX -OoF11bTHRPDa1vAN0sBCVoY= +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDecyG71bzCYmf1 +i6UnlTHoor+3Uj6+7X6MX8kATm25pLhAc1aHayKk0c+XWbT8ELDHFG/dCAsHar0s +XC0mpUbQflz0UfNOQX2uNHt7M9UcQm67ZwnwREkPFxkywaABcuakI5z8STdufyiR +KcHD3ikXLEWbTj8/L3De2a9qP/hIWCO5+jh1qK0F7IrvPn5Re48ekfgpL6FEmYD1 +3OGKz/5MQkb6CLXjUWQdlOVTtIEWWMSVtLt3jfe9RAqJ/jlmQPsxLWlnx3wgE2kf +FB3ogCHDJYNdeTRplnkteA3y7zcM13czZULRmLSQeQC3aZBr+qzJD20Hdw6OTLoX +uubws78pAgMBAAECggEADwsD7kljQe8le5sgpVjqbpwVUSB2AmbAhsQ/E5u6KAwF +5ingLjkzA9vCaS6vInELtPLI9WgPvHkqtAWQJUuXZEF49MOKXuTnF5d2ydtn+OJc +ANiHeTpZvHQ1IO14h6onA1UuaETLqfFeCdVw91drOb6lmGQsVJAKcHxetFWa6zCW +aGoqPDOkc4MfLzrhrarTRYY4SnATfpVDU6BQTNYPtogkejzTfhelrvBqWyIXDnPa +kLxRRSMY1f0uT91IkHfPqPi23V0EWzhKAzzfkLm/wnkp28lQp2dvckQcyq3N3/eE +leqpFabxNsvor/PQjB49h3ya9JgjO8RWviMtavkLRwKBgQDpTHARAUPlkBgwaGba +RvCzH4O1wE7CGF1ZQLrCv1lZlv7vAbKuT8z3DtHajdTUF68AztVYkidyrzAOvTkj ++yb9KQddMPnVnrJnlVlUKwbGMv/H9UDd5Z4wKkhkSvXW3u6RSP7p3Ai0NBX2VDQg +EGhHLHAkC7MHIYdkwfrqsK5/EwKBgQD0GHHZrzcOf/fuGMPqCpgdHZEOoiKR0ChK +Ms/P7ZMikvjCbDbaZ4u3lBugtKVpKUNGVtkUCOu9fYN3WLxZJfjejsjAplbKT4Dy +dFuuV9tC1tYh/FCA8PyV7IFIybyif631npDZdsPruExPzzPQ1mB1Qhx+3uD76Buq +WKAY0pLEUwKBgF0Pbox58rl5lwyIOK7NKWpqIcG4KjJmQaY+mcDhTyTbhGmWRc4e +auYJ9U+2z7Sild4+ov+nnTC0DPl0JXzizBSj7xoPVTkPCp8jBfT7DMK2ySzb+boJ +w+X2l9XZyOKjHoq5kWV7rcUkGbaetAQuR0pMwZa/S/SGPVnFvu8q9xAdAoGAZn31 +IBBAL+hvtBvV92mnYWJOzDQsC8m5gR5Av+/jffr0VL6XcbFUqyqXRy1S3wsiYmCJ +Ga59Pb17/BrYSx50lw6hILM3cg9b93IAJP5i5HfMxcxqCRonFNSPnH6IpDq0UpPY +AleqAEoMUN6RxTiem928lVEEawGUzDwWTRXt5l0CgYEAycUA4UwY4YX79LOwdS9w +mRJZytHYLNCalWU/pNQ14Ys37AQoP24LLSQQxmP1qz0pCtjpYDWVXt1Wx3KE/Gww +Mk3t5c6u3aOqm86cWGfjj+E6cL5e2TCqmr5B83nd+K1/XgvMVj9RjI9K/kbolfEa +y6RhFFkoV4KOmEMHGazVRzM= -----END PRIVATE KEY----- diff --git a/configs/open5gs/tls/hss.crt b/configs/open5gs/tls/hss.crt index 006de594d..e594a18f5 100644 --- a/configs/open5gs/tls/hss.crt +++ b/configs/open5gs/tls/hss.crt @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- MIIDWzCCAkOgAwIBAgIBBDANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK -DAhOZW9QbGFuZTAeFw0yMjExMTEyMzM3MjZaFw0zMjExMDgyMzM3MjZaMEoxCzAJ +DAhOZW9QbGFuZTAeFw0yMzA5MzAyMjU5MDdaFw0zMzA5MjcyMjU5MDdaMEoxCzAJ BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxGDAW BgNVBAMMD2hzcy5sb2NhbGRvbWFpbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBALljW/sKEWWc9NmMz8NpkskbjXtlhkduRWDapIKLTdUUjl+xP2Rbve0l -ag7Gxw/bX3IkSKQcHwiT1+QMD+CgCcMMd9txI4nVkCP/7+YQVGfEe+2iclp1CrM8 -P7a2oaG3LzzS8Xz+iTWFW+eLE20B4QHygCyQwN14IPGYLkzQvGAe8MfiBfOCIJnm -t4NKGyXGs31Tvbl5+Wzpm6hIXvlqPUEgjHXNtC6u6FQdCPPxcWwt2O8zT9aB5B4G -n/914qWlzurUTlnhYg8HV9L+iyidD66v8JMiKQ9xuPNWMKdoxaw034qH3Dg9in9j -Jqdk3AJdvuqjdmQvPBoOFBQKDcYW06kCAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV -HQ4EFgQU5GTunEyNMXr1ZZTh79w1hSC6wDYwHwYDVR0jBBgwFoAUsWr6nJm8BCpC -iGXXfr5gcKIO2kAwDQYJKoZIhvcNAQELBQADggEBADYTkXOb9Kx31MN3LSLCz+ky -KEi3Pio+eI65vTByclmfu/ej2AmGMmHylJQ2RpHzbWOe2MPmpFyI/yfqR7ZoIcfs -soEnYk3vi4Ul7ooYqWTIvAl24/g5ujb9vZ2+7ZtiyFsTNG3kB/zdtS6X6CUk+e3H -GbYTHjxvN+VmFJmCJjQpSMTQC9JGuqof3z+R7OODyJG24aw2g7rVtSDW3J0rvDgc -1RylH/D2KJMBGjo/JlXB6y6wCTu9iLQ5prqk7YunFlpLxjsEdqrQ+yukLhwRH93x -C0GQA6rMQEhC3paBukP2ePAJoGCqanipp/oJ6OJLnKqVDha69IXPSJLEhqAqtX4= +AQoCggEBAK8bG+Q0Ffy7mHyYV19pmCHlvSDqt/3SC/px6E+ChVJhhdezecfM6B50 +jlhEzZCnUP4WJY3pFcnoT1ot4ZMfzST36UB1rF782VIN1Tw9UMITNKB+OQD8g3b5 +2jKXcE8T9+YWQNdjW/UOHbTPcfioQ5CqwVJ0Mdtkvdia+lDPUQFZQLxSqSWpbCj/ +7zIuY6c4QIBcvCjFF+4Yio5aJ1+6eeoA8fvesqKKZ1LVYOiBMU7a9DZVng+m9TGK +m4+L5R0hsvPUvRuIgZb7Hs3lAmripUDeunjEz2hdrYhDg/gLe3ZxoatZ/FfVOGai +uGhQxT1xFwnCZUJ3y+aXbneGRoIHLQUCAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV +HQ4EFgQUHHVuri9UsBTZB/V1s5wsj6rpfUAwHwYDVR0jBBgwFoAU2xbCTj9E9Ha4 +EurcTxHWMflmx3wwDQYJKoZIhvcNAQELBQADggEBAFViLrjE9ajSHpwnhFp1vCJB +jXknhJiM1aK+fJuMmu0w7EcIzbLxV3Ciy+qFmYWLruTKCGJHRD5mLFkgU5EAlGXr +tUh6IwdHETYPfIjtFI/1gPFM1MhosCiaJ9H459O8bHvez2p3gKklAH82tG1ATv6p +phtxHsazRGn79Qixq6udF4k5ZxxqxxMYcQnTZjJPM0E5apPS2RgRYCa6wjxORoe6 +06XarDKR8Ynbl40IxiQhCl+IAhX1hq3J9Y0DFyKYTtklU6xBpkqLpUpzB6LmeeKR +OqPC9rAx+ZPYgBL7lnM2GvFmbtndQJp4BqwTzwove+mso3Iom/AV8YFqxN7PF18= -----END CERTIFICATE----- diff --git a/configs/open5gs/tls/hss.csr b/configs/open5gs/tls/hss.csr index b330380b4..03f07dfd2 100644 --- a/configs/open5gs/tls/hss.csr +++ b/configs/open5gs/tls/hss.csr @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE REQUEST----- MIICjzCCAXcCAQAwSjEYMBYGA1UEAwwPaHNzLmxvY2FsZG9tYWluMQswCQYDVQQG EwJLTzEOMAwGA1UECAwFU2VvdWwxETAPBgNVBAoMCE5lb1BsYW5lMIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuWNb+woRZZz02YzPw2mSyRuNe2WGR25F -YNqkgotN1RSOX7E/ZFu97SVqDsbHD9tfciRIpBwfCJPX5AwP4KAJwwx323EjidWQ -I//v5hBUZ8R77aJyWnUKszw/trahobcvPNLxfP6JNYVb54sTbQHhAfKALJDA3Xgg -8ZguTNC8YB7wx+IF84Igmea3g0obJcazfVO9uXn5bOmbqEhe+Wo9QSCMdc20Lq7o -VB0I8/FxbC3Y7zNP1oHkHgaf/3XipaXO6tROWeFiDwdX0v6LKJ0Prq/wkyIpD3G4 -81Ywp2jFrDTfiofcOD2Kf2Mmp2TcAl2+6qN2ZC88Gg4UFAoNxhbTqQIDAQABoAAw -DQYJKoZIhvcNAQELBQADggEBABWDs9H10OPMkVJspViUa7DpykmjwqgwZeobtUsn -7MRP7a4/UUA/OMEgK3HQArIE36byYQM9u80FQRVmlgdM8h3gOABNlyD+Xq/PPCdV -/+YrAWrLkPGbPgKeyAlVYlqi0j8laC9JB/5bEVh8JUxZ9RlZdYmMVITAnIAUfmJ+ -avGxytm5bss//Vat89HlUvPt5NzrmR2YgxzH5PmMx6AB13JIItg05YBE/KPZd+KC -CsLyCzjZj7GJ12l1X8nI/EN032kRPQD/0knq1rt2gyxs45pzA1XGJNiFMFEnJ7Oh -jIeFnbnGxBvx6hu8tOky41OubB1erMok0UV9XpT987tPA/Y= +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArxsb5DQV/LuYfJhXX2mYIeW9IOq3/dIL ++nHoT4KFUmGF17N5x8zoHnSOWETNkKdQ/hYljekVyehPWi3hkx/NJPfpQHWsXvzZ +Ug3VPD1QwhM0oH45APyDdvnaMpdwTxP35hZA12Nb9Q4dtM9x+KhDkKrBUnQx22S9 +2Jr6UM9RAVlAvFKpJalsKP/vMi5jpzhAgFy8KMUX7hiKjlonX7p56gDx+96yoopn +UtVg6IExTtr0NlWeD6b1MYqbj4vlHSGy89S9G4iBlvsezeUCauKlQN66eMTPaF2t +iEOD+At7dnGhq1n8V9U4ZqK4aFDFPXEXCcJlQnfL5pdud4ZGggctBQIDAQABoAAw +DQYJKoZIhvcNAQELBQADggEBAIGqHHJ/J73v/Jz2vUXFwHtNvFfd8N6PFmVJuDUu +07OikeFrtvluiTu608uurjvLr3gpY/0a7BORZDjg3UdK2kADQFsftKoNWYlJRga5 +4i33PI6bq/lQGVaeZWEqJli1vHdGvv9nFgd2pnXJfhhymaPSpXx7dpEDm1YQ85Dw +wcLQSX41bobcMqgFzrAO8YiYLzu/sm101DmO/IuCJ/HPFKlH3we8owGvEEgKembI +eFj5JzeajYsXT8aK6/1kmYF/I38MiNaqTUgc1hezxRe7HHF2lkDDNrrBmH9H2O+i +lKeMqHPnURvXha3C48NJ9mvqkvbMi0xsYoLJoQ6Nj7kGC/A= -----END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/hss.key b/configs/open5gs/tls/hss.key index cceb9cbd7..9818dd8b7 100644 --- a/configs/open5gs/tls/hss.key +++ b/configs/open5gs/tls/hss.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC5Y1v7ChFlnPTZ -jM/DaZLJG417ZYZHbkVg2qSCi03VFI5fsT9kW73tJWoOxscP219yJEikHB8Ik9fk -DA/goAnDDHfbcSOJ1ZAj/+/mEFRnxHvtonJadQqzPD+2tqGhty880vF8/ok1hVvn -ixNtAeEB8oAskMDdeCDxmC5M0LxgHvDH4gXzgiCZ5reDShslxrN9U725efls6Zuo -SF75aj1BIIx1zbQuruhUHQjz8XFsLdjvM0/WgeQeBp//deKlpc7q1E5Z4WIPB1fS -/osonQ+ur/CTIikPcbjzVjCnaMWsNN+Kh9w4PYp/YyanZNwCXb7qo3ZkLzwaDhQU -Cg3GFtOpAgMBAAECggEAO2h5PdnMmGTzW9HRdHwc80BWlvACV1qhdfeq10Cf2QQk -2cp5l4YEt32RXpnZiZ3RmMjC1IBEe6GxAd3RqrhuWGhi8lnvuwhKkBbAwFeETNp8 -ojq37X/rRWOtwTYGVsXWp+WrSFRjENkjCfCZ8Yk0G0UkSOO8QlxwJiuPzsLnUt+b -wO/bahViAu7c+CyPouw0+MJmysZba1DSRoYSAYF6yzOolOOfk9HIEcfFyY+wCO6d -hRVcGe5FgFS6hsBC2RLDrKc4sp1VoWOSkI8MfsTsnSvIdWHKLqvmdDlhoEgLJQ2C -BuPX9J50oa9naLb0FszZNjsF1o1xNXvdzzCvWXIYXwKBgQDWCjlJDte/o48jFbvV -aIa7jkChD6NWlMhGv6wRftblNU2WxzwQNiDxKo2OK3o2OZaOkXD7u/GrUzsOAnRs -N+4I340UQz9C7tfzUmsFjS4ju+xxeaPQX1Wmnz5HSN5mxU34y3FvLdyeitUbadNL -CbSeLXI+qzMoecrUp30qHsKarwKBgQDduzhI0xQS3BAWxVz63vMv/Pp7dCjgg/VC -ULYv2d4z5twS9fRwCzyhtmOPRQzHOvgxPbU/MF9DW/uXzAGPFYZSzfWuJcv4u1mp -Ha48GZcxA3C3HWpimsn9yZjcdWG7QV2BV6RgMwH0nUIxZHxQ7I6gplJasZN5dwlZ -glPAAOetJwKBgF8cV+xQ/ioYQgizJa5lLkm1op5vVoOoxX46uflkRZXAo+O2UMhb -ZTQFVrWwODRUTsS3eF9EWtVovLsy+A0GpW2n+QbiAwB5Jdjn7Mqgu7oBTcX26YY0 -dtj9tizzAnDkiAtgS929oWWKB7yQv+V+QJZxV2zlomwAAtOQQZwv4wXdAoGATReE -8D0DY7NDnMcuFsNhhjPM2xN+CuGWamIpleWIDj+cELOXM0WU5RzG7M8zLCnilSxB -UiD9XiwjA5oYiKkRNMULQGs/ydFJ0TTSmW7EVHQ/wkrl7DapOCXZkfz15+dIHWpd -al0RtvzeQNIRLwmwZUaup33KKpcqlwZrG/y0kE0CgYEAtSp7JuJWnFCRBGYzITFG -3gILjbzWxKquho7vOjlOZ9Jn0zHAMjMFaa5jO+jDVeFTo2ma6vJNjkrwwSt2ta5j -RL3+dBFB8uFgihY68j2yP8OeTuMOUevinbKgySMcTP7mlLzya/SAk9bZFqTJEB6w -CA6ghp5l+Pzf2ziJKd3nc0c= +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCvGxvkNBX8u5h8 +mFdfaZgh5b0g6rf90gv6cehPgoVSYYXXs3nHzOgedI5YRM2Qp1D+FiWN6RXJ6E9a +LeGTH80k9+lAdaxe/NlSDdU8PVDCEzSgfjkA/IN2+doyl3BPE/fmFkDXY1v1Dh20 +z3H4qEOQqsFSdDHbZL3YmvpQz1EBWUC8UqklqWwo/+8yLmOnOECAXLwoxRfuGIqO +WidfunnqAPH73rKiimdS1WDogTFO2vQ2VZ4PpvUxipuPi+UdIbLz1L0biIGW+x7N +5QJq4qVA3rp4xM9oXa2IQ4P4C3t2caGrWfxX1ThmorhoUMU9cRcJwmVCd8vml253 +hkaCBy0FAgMBAAECggEAHTz6kEU+MqAkWxGY7T6Vf3t79AYdSM2M4Hmqn7QcjN/p +2FWIjRsi2wr9RbHfXTsC5BpQlPyJfdhDf7xPgSB7QaP/l5rOeGHh67iRlWhrlqxc +SjwpSoffb7tSesYco6ei6hFnLE/T5/w+a5WD41A9T+ejNiBevtJ4fLWL/HhRf1bf +3d54Pt/G+mZj2LvfgySFm0/50K2Qf+L51VcydUEE3yxH4H9t5aEZL/h1l6+/SmCb +ZTk4UTuzImcm8jqNQVVfwmJ6zs0/kl3KnEnUom6FdRQu2Ur55lHWwSJPExnPvg8o +w7UHy+Oz862rjFDk+3t9oJ0nChdYZPcsdDBfDgrJgQKBgQDBHEgkZ0DiKNQDY7vs +7t5bowDqhwxXvHARFF8uWPHkOkB50t1/FAfigsNOw2eUBQV7HvxwtOmlROK+tG6T +a4m1Rm9DoYbFHqbas+oPwRgt7YHA5XOLB4EOWC4AqIv3RZsc37EwxAH0eO73s4/c +a3wYUSsFIvbhvh82bLdA+pYb5QKBgQDoIcasY3O/i5dFKx37gPoUB+AP2CaIz1h5 +SCyGnplfbnSr+6L8Fpex0jUsCeKLq3uNTrsXcnXnv6+TFfxGiZlGgiKoKhF+uBG1 +9T3PQxZ5xJkrUsEV7zhZB65jNFckX0b6QntmMJ+Lh0rTWfOG6Ft7OKGtS0PAZIIy +xSVE9rr6oQKBgEkH+hySVA5z5GJ3yG19lOhRCBqqAjf4EuXSr4BmsOxgP1wTLCNQ +Hv9B9r0F11k6YO1ENbImKSqQl7QJprvn8od04MVSBBbuVanmWsGkhBFyfhzGaeEN +cHhNTvB+zZgxYc0Up/1KU3byeWWCKgjxOVg08jEaHQYYkdNSYCeZ3UUlAoGAcHj9 +FEXTrXlrP/5WNqgVg2MVc1fdw+gDDDCmMkviMFUKftIb9FzV/zjEvqPDer0JzjvZ +dtDkw/cikPfUFjFRbNJdDHHlrCpvmmRLIIN2/mT9efpMx93yxWBtZG/V0S/A6j0Q +IUFp7GcPIDyzPCiVOq0D2T1ghHWuh/7xwepySkECgYEAgMx/+pXyxZgV/oPo8/E1 +Vqh2bANwKr3rNnsM0rL1C7IuKvU0x6zLMNk0sub3BWndm5M5ya9P6jXOORTls9We +UXWyJLWZ6cqM2M1LPye/8pL56ZtlqfLerP5ZuoR3daTAWaslANg7SUNtLG48bCuJ +TjNlLKcJAQ1NlDkh5uTvJ8o= -----END PRIVATE KEY----- diff --git a/configs/open5gs/tls/meson.build b/configs/open5gs/tls/meson.build index f20cb9857..c0a72e0f9 100644 --- a/configs/open5gs/tls/meson.build +++ b/configs/open5gs/tls/meson.build @@ -47,10 +47,12 @@ tls_security = ''' smf.crt udm.crt udr.crt - testserver.key - testserver.crt - testclient.key - testclient.crt + sepp1.key + sepp1.crt + sepp2.key + sepp2.crt + sepp3.key + sepp3.crt '''.split() foreach file : tls_security diff --git a/configs/open5gs/tls/mme.crt b/configs/open5gs/tls/mme.crt index 57d3843d8..4d1025771 100644 --- a/configs/open5gs/tls/mme.crt +++ b/configs/open5gs/tls/mme.crt @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- MIIDWzCCAkOgAwIBAgIBBTANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK -DAhOZW9QbGFuZTAeFw0yMjExMTEyMzM3MjZaFw0zMjExMDgyMzM3MjZaMEoxCzAJ +DAhOZW9QbGFuZTAeFw0yMzA5MzAyMjU5MDdaFw0zMzA5MjcyMjU5MDdaMEoxCzAJ BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxGDAW BgNVBAMMD21tZS5sb2NhbGRvbWFpbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAOfRYYARkQf16dejrenOv9VbNAInKLH5BByRobC/FXYs/1ZEpE26QQpj -ElSZfdc9ri6tlGm8JzsWdeospR10abH9wu/80lerrOJFsGAKC55tLbO0N71Odlk0 -UZms/Efets+4Y2N/ubgq1RStl6IhqkmUOgfbvX69h7+po4PILGMixbZiQTW9DwH+ -aZJ9Gb3YScewikE3J6E0RPf43ABX9roI1oU078n2nj7qZlCNd0zJ9vOXQiQOdcW3 -8PKHlrobulMYh5SmG5ASidZzexHy6csKiH/Rr2EC4mZTYBepb3QZy8+ad9b5Cl74 -yuCcKGf95xui1E+YqGBM9Gi5+HNdr3ECAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV -HQ4EFgQUVhByp4/5SHL0qj7sf6dXxrcO6L8wHwYDVR0jBBgwFoAUsWr6nJm8BCpC -iGXXfr5gcKIO2kAwDQYJKoZIhvcNAQELBQADggEBAJTHO3re3/Tc9YeMs3Z+Kog6 -9z3Rb+OJ5nB56Y7nXVpJ70piUpTSVwPxK1r5a6QqHO9tTTgp5kp5i3u1H3cYnn3q -r9if/lkNotdrOl1uwI9Kb3eb+4iwZe4VUnhDvWbC3oWVHcyZheS95qxuW/HfErxU -eZakK1J5rynrd0R8fZiJBfpYeBfOczshDlLZ8G40gwmGcHBTJYQ6bYJjjA1jQXzF -n1fE6WQBu7q79eX9w0U5Sf5Xo9Ale5Y7o6ud2aZT6F83Upt1G83BhEvQ8vrseTD6 -SHme/cpGXmSToBs9hJfrPuDzIkjGG/kjiVsFalHiaUtVbGvMqVa2iaHZ3HBzIro= +AQoCggEBAMre2PdKySqe+wUz87NIBO4agYNyy6E/Yb1sOBDdAzaqIZcFLxwwPl0c +zV7tWYr4N/7ahiVi4b8tPrHnOHEOuVwrzhZ9SKaKgo6/v4rdEYQsfWJ/q95bAutJ +CyPv6FtssxWNuNfs90YHYANhtWfNr+9cYPfYjBKxtIazLO/Am7IpedPl2nCQzy2i +RGaa6i91ihmOCcy2GmnZS+ri0pGJSQqueogQUusQQTTTcbyPfNj/O6LvllfxcWbu +rC2+cP1vidMQY3pivzoAjqWBcsiZWXvggslyQkV6xU4NCEKGzXMYNg1cx8XY4MIW +SLuKfPBqndJG6v6+7zO24kqsA8zVuy0CAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV +HQ4EFgQUlWnPImH1sbToftbtqjQoyKAqG94wHwYDVR0jBBgwFoAU2xbCTj9E9Ha4 +EurcTxHWMflmx3wwDQYJKoZIhvcNAQELBQADggEBAKVuWtSm3SAJxrasL7bvyuWU +lUv4+KE4BaIKsFFBOCGHyAShMmq8Bxf4wItER7VUiJDNMU3q+kzI+FSeDsy+nVSp +oC5Ar1PUzeHsalEleBjn5j5cEt/YHsvP8bUTxGanVM6SM/YPgJEV3/TyY6M94sxf +5Dy8MYVQk3WoQ5d++u9dxZkZw2lU1BNSzppSBpVqcEDOFN3su3BywAfZsE2RdvpV +l7cZzwF/GTBK9XeJAnQPBH/MwAvcIog+BqpsXN7OlhJ/dK/zR71dsV9+dh0PU5X2 +5eqgB2JWTjduIWqfVFjfQhhdRNnzqSf+LwPOJZe5qeiTrd2rdKL+T6FB3F+hGrU= -----END CERTIFICATE----- diff --git a/configs/open5gs/tls/mme.csr b/configs/open5gs/tls/mme.csr index fc8937766..ff278d6d5 100644 --- a/configs/open5gs/tls/mme.csr +++ b/configs/open5gs/tls/mme.csr @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE REQUEST----- MIICjzCCAXcCAQAwSjEYMBYGA1UEAwwPbW1lLmxvY2FsZG9tYWluMQswCQYDVQQG EwJLTzEOMAwGA1UECAwFU2VvdWwxETAPBgNVBAoMCE5lb1BsYW5lMIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA59FhgBGRB/Xp16Ot6c6/1Vs0AicosfkE -HJGhsL8Vdiz/VkSkTbpBCmMSVJl91z2uLq2UabwnOxZ16iylHXRpsf3C7/zSV6us -4kWwYAoLnm0ts7Q3vU52WTRRmaz8R962z7hjY3+5uCrVFK2XoiGqSZQ6B9u9fr2H -v6mjg8gsYyLFtmJBNb0PAf5pkn0ZvdhJx7CKQTcnoTRE9/jcAFf2ugjWhTTvyfae -PupmUI13TMn285dCJA51xbfw8oeWuhu6UxiHlKYbkBKJ1nN7EfLpywqIf9GvYQLi -ZlNgF6lvdBnLz5p31vkKXvjK4JwoZ/3nG6LUT5ioYEz0aLn4c12vcQIDAQABoAAw -DQYJKoZIhvcNAQELBQADggEBACCmqKiZ7lalTo2IacCqfhzE9XCzwltNoygocky7 -aEed7vSX/3pxf4x7ASphZd1gytnePc3bVvqChxFKkgTOUCLd6KTcKsPuXhVPcr6C -0/f3APspWyvZX/sYMLHpS+b1BkO6Uego3ZM9FauEP1kynNHy6Bf0h5BL3YB7yYBJ -nj9UaGWpEAs4LivGWD+4iici2a1GfhS++PBD8dSd6ipELCEOkTuTZoFquZF66cfC -3q+Isd29jbIiO40LnQg3Qi75ECXw7Rgzn5rr0eclIEv50fayyd1vWAG5yXbSOyxT -L/ZBnNDXSLtZV1DMHEvB7rlhXvLEK0874QDtYcQEOltgVOY= +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyt7Y90rJKp77BTPzs0gE7hqBg3LLoT9h +vWw4EN0DNqohlwUvHDA+XRzNXu1Zivg3/tqGJWLhvy0+sec4cQ65XCvOFn1IpoqC +jr+/it0RhCx9Yn+r3lsC60kLI+/oW2yzFY241+z3RgdgA2G1Z82v71xg99iMErG0 +hrMs78Cbsil50+XacJDPLaJEZprqL3WKGY4JzLYaadlL6uLSkYlJCq56iBBS6xBB +NNNxvI982P87ou+WV/FxZu6sLb5w/W+J0xBjemK/OgCOpYFyyJlZe+CCyXJCRXrF +Tg0IQobNcxg2DVzHxdjgwhZIu4p88Gqd0kbq/r7vM7biSqwDzNW7LQIDAQABoAAw +DQYJKoZIhvcNAQELBQADggEBAD2/tFJ8kLsl6wC5hPVOETTAQ/woSb9bte4rd40k +FlqImQy0kC0xf5CUfCNG4lgniq+t+HxTppjSkL4731o7enP0kUSnaKtY2stzR1pq +DxUlP0uZfqgDaBaAmS2e4e3yKY9q7yN5IA7QZYDiFBMxOSvdwmgxp0+BXdqxNy+w +2o3XfspkV0qg97VoHL7w757y8ZpNrnOPahUpsycCxhKPhMx0K0ZOCZVEx44PHsv3 +4yf/8bgAfrOttWp0dab3ySqcledlGgsiOw4kRUIrMDl/07lGpuKkfpt0qfLukKc4 +7qzujs2PYSligOrXE2Hd189fNEZWE4Rw1M6ZaDbHCtnAzCI= -----END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/mme.key b/configs/open5gs/tls/mme.key index b91a78f5b..2aec7893c 100644 --- a/configs/open5gs/tls/mme.key +++ b/configs/open5gs/tls/mme.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDn0WGAEZEH9enX -o63pzr/VWzQCJyix+QQckaGwvxV2LP9WRKRNukEKYxJUmX3XPa4urZRpvCc7FnXq -LKUddGmx/cLv/NJXq6ziRbBgCguebS2ztDe9TnZZNFGZrPxH3rbPuGNjf7m4KtUU -rZeiIapJlDoH271+vYe/qaODyCxjIsW2YkE1vQ8B/mmSfRm92EnHsIpBNyehNET3 -+NwAV/a6CNaFNO/J9p4+6mZQjXdMyfbzl0IkDnXFt/Dyh5a6G7pTGIeUphuQEonW -c3sR8unLCoh/0a9hAuJmU2AXqW90GcvPmnfW+Qpe+MrgnChn/ecbotRPmKhgTPRo -ufhzXa9xAgMBAAECggEAHPsdqSueXzQ8pZ32XjkKiCtXP1T9mZur38B1yjQRWaKl -fKJR4iUWACzuO+UBM6P9PyOp3rrMMsRg6G49aYcbYZ+mZmdL3/RRRZZ4cYE//kXg -RUuTU6zX+dijF5xl4RGe9tgH64aqcAjsIPd/cfWrJXi3n9zg/f5xgUy9aaUK+4zp -K77vv6ir3PjtHdQOqDTHblLdXJBDtNprF6Q3kvzWLdVptM2jhtsfhoZ5J4RnrkGm -e9VwUksWnWK6NU3ezYndN2zDe8fkwRKWmLD/DLMrWxOd/E+1T2sUsiTYytxhCMpR -+x9hQZ8P1ogWivYZe0aEwzEcr9SR7sOafdnF+pFnswKBgQD/4fFSHI+c/nL0d0TR -72BfNieuelnaxWzbsPDC8/7YzRd4g25uWCwoyMxzVntVSAdADmI2aD6REfIejLro -m27AvEkMvXCBJIn6ZD6a/GVvLGAiJt060Y3znyRm2xCsynnfw+4RAK3Rs3Vqu4EC -igHytUCKRsU1F3PeFYBABSKdswKBgQDn7JyG4uFl8YB3dm47SiaVxSNHVNnIKQJD -kULqgxLV0jWbMyXx/brS+tp0ABwavRFYxhl3f1wm/ZBk7YnFCTxrpwG3E1MPu4bn -fMJqVEbGFfJEkBePpB+3o2VFGYCrC8wsQx9+RsM98+f+jETqIn7J/j8W9Ht4Y1J/ -2mlWubqUSwKBgQDFugBSJQPMmsqVobwqRUFBEYXkS2M3rCsMMFQ7MXQSb5jdZSJm -XffxpAhob8FqCvifRP4bcL44N5fSh4i+yazxfg0srQ5MnMGKHQBLnxF6sN2wRjvZ -gaihQq5MVKcz/lni0XIa7V1jl7r5uN5d6erLc8flkf49olvElvS9g7pWBQKBgBNX -3q45WgdAnzBXhlYXlyRCrvCSGR/im7e689PPXtDKmYH6QB3wxZY3KeUm5TEtt7ap -vxICY1M1LsfcL/NpE8r+wNveFr1nLJc+BpELumNnDS++vNhUHfkY/adHuz2I3FyM -tKG5kSsnnp/SXyUP/3clZ2motmuSDR1wv/xlvTQFAoGBAKDDpj2v3u6R5qWWWb4C -+kO41YOGAlx52pcukmPV682CQZyJHdWFG3YHNeJaSBMVayHN+roIbnZQHJGTbS0B -jOMxgRyt6a86uGBHQ9PUDRrtOH8hcM4Wg5RnKip5GGHWnZYXH421p2ErpDE3ZAO2 -nt+0/3cXT4rENRXogOlzP3aG +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDK3tj3SskqnvsF +M/OzSATuGoGDcsuhP2G9bDgQ3QM2qiGXBS8cMD5dHM1e7VmK+Df+2oYlYuG/LT6x +5zhxDrlcK84WfUimioKOv7+K3RGELH1if6veWwLrSQsj7+hbbLMVjbjX7PdGB2AD +YbVnza/vXGD32IwSsbSGsyzvwJuyKXnT5dpwkM8tokRmmuovdYoZjgnMthpp2Uvq +4tKRiUkKrnqIEFLrEEE003G8j3zY/zui75ZX8XFm7qwtvnD9b4nTEGN6Yr86AI6l +gXLImVl74ILJckJFesVODQhChs1zGDYNXMfF2ODCFki7inzwap3SRur+vu8ztuJK +rAPM1bstAgMBAAECggEAXQJfab0NTq+VuXRwmfT+YaWgVEIorrRO3NgFOmIBq6nD +faggSaWqqejfFVLvNyIHFh5c2z4i7pHRSSIPg/HytJnWwgPNb6FYKxcpO4KQGc+F +6sdK5kZGp9WUuHSwzF2hG1Qe90wKsD4IXHSLBVzNeQma4XaT/awgbpMuGnttRngh +ajl1hDY0jymfPoZnY4MpwnewiTmAaTNwCob75u+wQZ05m+XySt1rlTf9VS2z+T9L +EsKieuLb00pbIc78ht6Od64cfONorsLs5IW8m7SBVDQMDwKeowV/Ny0/osxUQoGn +BDQvuHymUDklVowPs46kxrqRKbKVJCbjGElAoWNftwKBgQDbsKvHtvA4RH3oJ6vG +XSoc/9giEIx76XPEKzwfLM80IxOsHH/+oEC3O1ymgak1i4wm0m5cOuw7aZgx6mvR +aNwyK6QAVUSjoMcfVaiYx5kg8c/8l+AGOuKWraT8IALZVRO9A232NnxGlwE4Gg6c +K6GY3kQalqpmQ81JA9dKjxObnwKBgQDsZoUXP3Jg1r7bScdskShm4S8ozLibZgPr +7+aDSh0N19wTvj4c2EgFxDeF4Qqs2rcZWMLbAdwMYVqhvmy/WmhuopD1YD1Zuuhi +wx+QMc2dgnLYH2i4Dg1wOLiW+nm0EHihu25Tw1teVjc9GZa222/zjDHP4Vy0vcv/ +ahweZBg1swKBgQC1FHuTI4v/pRzutXxWBcbHnm6FLYTOQg/k+woUXDfyLpNxgxBR +Tb/qCCkHKcrSUtLT0RGcPgkns5L6WdJDCp6tT+FfUOlBwi0++7j7LVJfoFGiT4Ed +QX4xWrGqC6ytfP3HB0Ok9SYcfS1JE9lFCoWpXlNeYx/TKUHVVDApyaMM2wKBgH3l +Yz+sRGeaNe5m7lO9Qnz3s7vQuwfXXoNKMcL9t1dl/AhvqniGHmUjyEX+QUco+5X+ +FVe5N81IE5JL7XJC3Zb98KEc7c9ZoOTn8WlDfLNDg5HhuE08/p8jNfsBzcq9cuD/ +BpSJV6F33NcnR4J+frJ/mQ+Sf2KqKXgOtIbi25nNAoGAPfC01YgfEREH6n+63dBk +UFzQvMGSXx0xlEfCyyBzDi++dAotl/uU/8tHwfZQ+jPZvxytplwL+H7GekFCBJZD +uPyBfJ4IBwJFMlnYbwk+g49Ji4NGNN+0c5O9GdPyfo5LbeZTHyH2mPWOZAf6Zv7p +IOz39RluHAEgx7YBF03gtyM= -----END PRIVATE KEY----- diff --git a/configs/open5gs/tls/nrf.crt b/configs/open5gs/tls/nrf.crt index 687d389c6..8b1677974 100644 --- a/configs/open5gs/tls/nrf.crt +++ b/configs/open5gs/tls/nrf.crt @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- MIIDWzCCAkOgAwIBAgIBBjANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK -DAhOZW9QbGFuZTAeFw0yMjExMTEyMzM3MjZaFw0zMjExMDgyMzM3MjZaMEoxCzAJ +DAhOZW9QbGFuZTAeFw0yMzA5MzAyMjU5MDdaFw0zMzA5MjcyMjU5MDdaMEoxCzAJ BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxGDAW BgNVBAMMD25yZi5sb2NhbGRvbWFpbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAJYwtO+kISwKZjSQlQ9eQNtF1/DpUFi8qrupceRuPtlAwsEFaly8BRiH -bCuBcRdGjrIgHtoyFJDW3wi3veKn+xkUoSTcIdHahGwon6nryW049ef5tV2CtNqf -RovgVACdKh7QIruIyqUhJUED+lm4s18aJjKb8QYne4jl18unM5xQkdHfL2bRh7Ce -BZV9/GxjYyNGcLQUWf1Qme3dqLvq539XACxBr8NqmYSDJGlrSRG0i4z0Faa2Znnn -epOTyRuttBrRgsebzszh1evg/zWgc5hsMDr4DoPVOfWfAihNkXmq2LF5kZsBqXdr -kQS6rZsxV4KRF1ynafMNxp0E2I768ZECAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV -HQ4EFgQUofXRxrSK7mNyrNQCStGT0rE5vJAwHwYDVR0jBBgwFoAUsWr6nJm8BCpC -iGXXfr5gcKIO2kAwDQYJKoZIhvcNAQELBQADggEBAHAaED78OABG0UPbkWUG1Bqd -kWPiZVKySEj1zc8dOqCcgn79VGH8TruxK+/dHwQY/YClq/8o9tZzfFOwc/OdtdfO -dk4AxHwyA+5zJMBWOaGOAIFzPkrRY7RIQnUlkL9FgRg/3hel70TyjBsRm5QEUCPF -p100S0TS5AACJm5gcC7QPfx0Pz1EPsK0q8nm0V1zAus/mDY67jJcbkCGwH839J3s -rVzMrnXEVeoubEr0u4fPB4ulsT1uufnmRPjO+Gw4ToqW+QB8aUX1y0PdxaV2K17g -HD7N6TaLZzXLZDhXB183tMKgOMTzAN/+sDofLUgAT/npO35bAbMmbisCk8Alha0= +AQoCggEBAIW9eu+Ch+vWtlNyi2kJRmMzFDI3nSg3UCtSEgpb9GP47bvOSO01/psw +h2YMKaGFQlnHBMEfHpIDZuhI5CD7PnEJVqSEO8mIkISapz+wDawjcqKbinDPPSXk +iao8JWQ+XNRznw4dJL6WRMQnrmAbnaxNfFBX38kztvX5Vum3hrlT4IikVozqO3O/ +BtdKXSONMjE0Aja6ntA55bII49NLiSP70I42Wo6lFP7h58cNjbWZzRijjs+7ei72 +mW53Brs8STWEEAStfHGvoNWe3lviwvIBT6EXVhbapdV6HzUO1drH1uBh5ZhkkqCY +muxhguGaEkJ45/1De2l8a3x9PqM1vdUCAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV +HQ4EFgQUM0LJXI8GiLqqnXUk5aQZ/05y5AMwHwYDVR0jBBgwFoAU2xbCTj9E9Ha4 +EurcTxHWMflmx3wwDQYJKoZIhvcNAQELBQADggEBADAIXlbAq6rQkqh31QIbIT/O +NbMiJtan3NW542UjHZH52Xbw5R0rjy4CARFemF0p2Uty1+N4h3z0PEV9eVMzHqRy +zV421G+IWt0nc7T9q5VINYIgA9Mkp1pYNExrQo/rP+PgPkUVyLnUlagaU5ob9OSC +jimFNCQMu0Y6omf2l64mK+ILNWafqtS1Kt9WOGEGCLynzsgljO9bFFfPqhDea08l +sN3Kxym15Mnv0o26Vexke1zviQqkAH1ubl7F+doFFJB7EZo4bAXR67DV3hZV9Wd9 +SbgulDGjeM6a3VO5gH0oHA57L0meYeMXplCPsBPoT/Ctzdj274fCd4/0NQ8tEe0= -----END CERTIFICATE----- diff --git a/configs/open5gs/tls/nrf.csr b/configs/open5gs/tls/nrf.csr index e870777e6..c89da3b26 100644 --- a/configs/open5gs/tls/nrf.csr +++ b/configs/open5gs/tls/nrf.csr @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE REQUEST----- MIICjzCCAXcCAQAwSjEYMBYGA1UEAwwPbnJmLmxvY2FsZG9tYWluMQswCQYDVQQG EwJLTzEOMAwGA1UECAwFU2VvdWwxETAPBgNVBAoMCE5lb1BsYW5lMIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAljC076QhLApmNJCVD15A20XX8OlQWLyq -u6lx5G4+2UDCwQVqXLwFGIdsK4FxF0aOsiAe2jIUkNbfCLe94qf7GRShJNwh0dqE -bCifqevJbTj15/m1XYK02p9Gi+BUAJ0qHtAiu4jKpSElQQP6WbizXxomMpvxBid7 -iOXXy6cznFCR0d8vZtGHsJ4FlX38bGNjI0ZwtBRZ/VCZ7d2ou+rnf1cALEGvw2qZ -hIMkaWtJEbSLjPQVprZmeed6k5PJG620GtGCx5vOzOHV6+D/NaBzmGwwOvgOg9U5 -9Z8CKE2RearYsXmRmwGpd2uRBLqtmzFXgpEXXKdp8w3GnQTYjvrxkQIDAQABoAAw -DQYJKoZIhvcNAQELBQADggEBAD7FDen5uEbzgzjW6w3vbyKw/irx+s59YS9zLnrc -K1l4C/eGUxOjXzL1i5th6TJ6y+860OalWfui1JMfdKFXAz4a/wGhZGbGsQelau7r -lQTH1nlm+b5BGShGg0R053FuX3PK8vKBpZzPRuyn9n6unc/PKzoRjub5FXKZnrVJ -8rDz2HXi7ZdxBrU3FUU8dbiTuROgsrCEldyndxhD7vH4mJIPM/0+j8aAU0t9GbRK -pX2Jo1z0Z83NxKegAtMXho0IoEpESEMZmYStBreOY2mp38Zw3+hEJV7SP3nLxr68 -J/c1HVddfoLt7N6mKvIuVbWK7OxkeFLVGGq2o1/Gs+PkVjw= +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhb1674KH69a2U3KLaQlGYzMUMjedKDdQ +K1ISClv0Y/jtu85I7TX+mzCHZgwpoYVCWccEwR8ekgNm6EjkIPs+cQlWpIQ7yYiQ +hJqnP7ANrCNyopuKcM89JeSJqjwlZD5c1HOfDh0kvpZExCeuYBudrE18UFffyTO2 +9flW6beGuVPgiKRWjOo7c78G10pdI40yMTQCNrqe0Dnlsgjj00uJI/vQjjZajqUU +/uHnxw2NtZnNGKOOz7t6LvaZbncGuzxJNYQQBK18ca+g1Z7eW+LC8gFPoRdWFtql +1XofNQ7V2sfW4GHlmGSSoJia7GGC4ZoSQnjn/UN7aXxrfH0+ozW91QIDAQABoAAw +DQYJKoZIhvcNAQELBQADggEBAB5K/Y1wgvOeUO8r5UOP0khQ0+xb6pA/czV6W8cj +He9LBxEHMdLF/qSASq1Ro7x2BYDNi2frpG41m6jYXMQRYkCp38m6C3um1t+Aoa56 +3Q8MXZs6+uxjtvJ9Y6thjDVRZgJr4a6IAIxe580/y49cuC6+JJUZZrkoKpQr1clH +BmNfpGcpJ9tT/bl33AxQ96gAqI4DLsEbYB1H+dOCtSArnqNR5W7TPhUWNej5jaQ9 +Xd2HGbo3ySZ5I4O7Rj2LNOhGTx/JPv2CzhyGi85IXUF4/K0Zb+yulVAcCz6RwSbB +3k8/EOGH7E3rdZpST2arhr6m4fZww2eyu9SOBYsWngNwxKQ= -----END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/nrf.key b/configs/open5gs/tls/nrf.key index 8b963976e..ac66aa7ed 100644 --- a/configs/open5gs/tls/nrf.key +++ b/configs/open5gs/tls/nrf.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCWMLTvpCEsCmY0 -kJUPXkDbRdfw6VBYvKq7qXHkbj7ZQMLBBWpcvAUYh2wrgXEXRo6yIB7aMhSQ1t8I -t73ip/sZFKEk3CHR2oRsKJ+p68ltOPXn+bVdgrTan0aL4FQAnSoe0CK7iMqlISVB -A/pZuLNfGiYym/EGJ3uI5dfLpzOcUJHR3y9m0YewngWVffxsY2MjRnC0FFn9UJnt -3ai76ud/VwAsQa/DapmEgyRpa0kRtIuM9BWmtmZ553qTk8kbrbQa0YLHm87M4dXr -4P81oHOYbDA6+A6D1Tn1nwIoTZF5qtixeZGbAal3a5EEuq2bMVeCkRdcp2nzDcad -BNiO+vGRAgMBAAECggEADL0D06F5mMknAwVSRzPoz1A8sPew813JI1KLUOMS3I1U -F1f0vfnKetqdj5ESfPVki/ISe9IskV5QG2auKceykd2Aj2ZGTgy5F41YgWp4spVW -sf6pZc18tmA09Q8pQMYTuPpRP9Op0Fif1sRWGv8B46qNm9RDHJEDtsg7xc+gHn1L -oeMNin1jZvypm/ZHv0gv2s+/ziOP9ZLcEsI/Zp8ljlGMJJ4Gv5bpZyZB6MCrC1xI -2EOBIeQbO/DnvKw5tiflIiiE+UoTcLvRiX0yxS9IpcYTpV65uwsBsmj+yeg9eunh -ZhoQNnEYeTwHpdzCX0ZO0IwTacb/gElutJ1n/FlMUwKBgQDKHh9UZYx1ejPrCzKT -jyoiXClNEt14Ze3bh3hIgDLaENq24jadNYOfTyCwPd1CGYYkgnNlY8VWBtisafRW -g7e28VGrzaEoYZ0S8p1vNsMabM1oWnq/P/oy0vY9YFvth7lZdlegDj8om+7tA0L/ -q0bDpcU0rQhLzxGExJaLJUjlIwKBgQC+OrTxkfrPvK/CIXole2Gu/Se/5smWNxGc -LNuX39vgIzPvSf1I9rHCr4omqHoeFooujTckfNKR1yc6x/a0jPjDD35ztmPmSKs+ -8PCmhaq3yfjYnt2+0oZd3KVZ9acayNJ205/YVYxG27Gn8s2V2TnEHMXO18NZxPnL -KHKDCGm7uwKBgDf7L+JIXicLueWYLGICfUEXFblrSDxYvxDW7NHn8C3GDU4qScYx -VEuDtyIZgHcWarkiCKREhhvVuZ3Hmw17Xh8lp+FWCxUMNF1TJZfwKwneqOYGaYkf -R0VceSd20P9xYD0PMiX6zDOLPRoYlS4LWoZGG+EDLBETQV7stGXF5fLRAoGAa4xN -WHYr0t7ej2bV4/MJmyFNI9WbCu4/aoiB7i+F5AaDCjpOlL3EaklMVebSg8hCf2cf -UeWwNvvpFfaPqCw7SCyuVUU83akgCAm4RK01g4sQwYev3n6vsMlaQq37t8zqEHw8 -1tYm5Li4jDddu+aAHjwWKYcaztnqT82iUCqlfJkCgYEAyK8xQfiWNPWADHILRDy0 -xtI415k+skYDx77dSmancF/10PGaZRO+UWI/EfweV8lR6ChSf9MuJxKZXOGupv/N -2MY5qTAJ0WluunA/bGRS7VSzetq0ZC2LOLlARqvZQQSVINq406eUjhLzdwJZaR8z -dtlKQ+91L56ELsd1XZ5DZfQ= +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCFvXrvgofr1rZT +cotpCUZjMxQyN50oN1ArUhIKW/Rj+O27zkjtNf6bMIdmDCmhhUJZxwTBHx6SA2bo +SOQg+z5xCVakhDvJiJCEmqc/sA2sI3Kim4pwzz0l5ImqPCVkPlzUc58OHSS+lkTE +J65gG52sTXxQV9/JM7b1+Vbpt4a5U+CIpFaM6jtzvwbXSl0jjTIxNAI2up7QOeWy +COPTS4kj+9CONlqOpRT+4efHDY21mc0Yo47Pu3ou9pludwa7PEk1hBAErXxxr6DV +nt5b4sLyAU+hF1YW2qXVeh81DtXax9bgYeWYZJKgmJrsYYLhmhJCeOf9Q3tpfGt8 +fT6jNb3VAgMBAAECggEAC496bfOpjiBMOGBhXp33oKGMsF6QTiah3mzEtHKIaI/e +9On68c5GCOIkAhUxEA410w7aAVuQR+zVW2TZm2Q8XIcDH0ty45PTcjLwHBg6xlN2 +GEo7qE6xqXHc2INEdCrT2WV5LT4lq/fPT+liMFqSwY8dHNDLvlejDBYWhjNgCOrw +M48lXj+j8rx88qfjjFKEMMfGStSyw1XVu02VylByIUlsEA79yCeVO0Ri+UnXQx7q +WcEKwWpEjkZuoGCMgD5HFZU13mlWz/0RvUKie5SgTr/amjCs9t8WKTVm74x7cU3j +6IZ9V3fGnSvnSRNFpsuacsIuMQLL4iTCs2aPsrViTQKBgQC5IDipNwmn3I/ArgUY +vSwlE8YNKPBM79BtekrjzRvhfcqxCSPys+LliTbyqcrXlSVwrxob9kTvvbwWl8Io +5JoEbkzpIISKDaqnptArkViM3FqPTbUJwA4XftBURlFRJJLpkgeOEz83Tj0SAtVI +UY1OixcR35tnD6RntgLkMtuHFwKBgQC48Q8KltwYBlTucP59pVNV5vo5FRD4Q4gD +zXybNdnGNaT5UA/WSq1V4LHFLsHlTn6wKe/qfcWfyuK2OmMfsHVhY71MxwDO5uTy +NW7z8fDAe90CHrmwLweeGK7BznS31L1vhjCAjehNOZH3w4SaohGt35KZMP+SV7xp +LIEsJwF18wKBgDSMg+jsmY4PmrKb8xBpql0/9qkHpOaB8E0TOKzfLPneBiooqQ6c +p1x2jaVmMxDs4jrRSX0Ec98FoZ1cKJ4I/fsiACzwsQ6rAHUkcdTcJiGd7wrciPYi +kR10PtidOTnqQtWQQRrANeKSD93L9hTYKV9RNhQ5v9gKZaWW0c1K7muzAoGAQkJb +WTfjctgR5bul8e4hhU1TqM/bXJcVTAd69UC93T2q9YexpNzsbTArgLHX1gfha8wa +oLCe9TkDMLaKfPgDlfjeAXvq1jXzILP0JIIx90RpUjEf5fdzizjco6MMPjCCDkrN +ZcFx0PknStVJ1PzryJepNilP52Z3olbHkMIIy/ECgYBVExbAI5E1JsLH4+IKmaRK +gaUnQSeFjJd4pLAzoZLGomCJ4OXLQEay/GVAXhsaVDqP9VBaSUYOznhJkF5Y2rD0 +8AtoC1jm+X+yCHPIWEbLe8bgnr3HZ/t/byq7dNFPa2ZJt6UZMzYtnJXTl6f7Ez9q +3/2imAM/UDKwPkr4pjJ6Ew== -----END PRIVATE KEY----- diff --git a/configs/open5gs/tls/nssf.crt b/configs/open5gs/tls/nssf.crt index 0aeb86f79..5c9347a53 100644 --- a/configs/open5gs/tls/nssf.crt +++ b/configs/open5gs/tls/nssf.crt @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDXDCCAkSgAwIBAgIBBzANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s +MIIDXDCCAkSgAwIBAgIBCzANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK -DAhOZW9QbGFuZTAeFw0yMjExMTEyMzM3MjZaFw0zMjExMDgyMzM3MjZaMEsxCzAJ +DAhOZW9QbGFuZTAeFw0yMzA5MzAyMjU5MDhaFw0zMzA5MjcyMjU5MDhaMEsxCzAJ BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxGTAX BgNVBAMMEG5zc2YubG9jYWxkb21haW4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQDIrtclpBRox3SHlIWyxwKH/u77/UP+ML6C6AQOfsI6j7+G3o73cqIb -zVlpFCfuy7Xh6+Y6uLqLQccNFlj0ckX/k+T3wR3Xpj6YAJ3W9ynPcgDWDK75Mlta -YDR1r69mkZ+SvDAE2gjHgv9zb5Jujyd3s419wHv5qzJQmgEMmIfRhP3sBJNw5+GB -D226dIR4QWmySrNku3BpTXrmKT8piStnnpWvEaoIBrYcAhUvFkETpWv2FIJyQJGH -Ku5894DuK2kEdxhA2MTAeEOxRnq9Xfv4Qq9JpyYNRLSfpUeSeJW3ZjCYan+mpciA -y7QPY2dG/RraGPvkGtTmlBEUMV2kThYjAgMBAAGjTTBLMAkGA1UdEwQCMAAwHQYD -VR0OBBYEFKDi3dKxojvcTkXTSa6mQwULPtKBMB8GA1UdIwQYMBaAFLFq+pyZvAQq -Qohl136+YHCiDtpAMA0GCSqGSIb3DQEBCwUAA4IBAQBJ5p0AF6bwFB2IaCdcpPix -Ai8kh73og4G1fi6+5m0Es0Sj9atAS2jFerPw4w8qLlWQCQUu5c9TFRmC29PmYMKd -1uPFfxOoaw6ohnfqbrmZyNOFpKLSYAi7VAcmVTt2ErolVAkWxknVTNFbC4QtgqOl -vH7WF6UjRXpkGdEcDewBcNjo/GpMacTsMGpQrb09JH8Sfvi+O+RDJY3kYI8e8glx -ejonu+gKXxCEZf0ALI/dIGyDIDTG30nShCMSBjOy+VjVFt2W9PFYykEc0yOpa+jX -C0nbS8zvC0KnCFeIomYUTbkOj3mgEWKa+gewXkFA3+i8XxOPBbmsXU4cWyVJ3sBp +ggEKAoIBAQCkAaOGB42qIzn0gOFHohNmaNR0oYMUSsRGwElalHobPSXVi4943Zkg +vhAC8F8Zx3EReO0EK+HuMxqyf21noaw5n0Cn/TGDRm2FDifRTXrypvrKS51PxvpE +Ot9Kxv0d8P+oTm60lttNn23ekCRwMazoa4m28LnqsEaIhm2Gfdnb1o+D3l/6usdd +mR5j2tyI2lgvvewAALw4CHgZSDmnnX7XRsjWHQ9VwCFPF6OXqzVxjuCzE/yTrKUU +xaosg0WdP/Hc/ce4hfJUrIUos2443TJ3E2zsP1fZ3kkJuVw4mwA6VmYaiAdJ5ZlF +YyLYY92I5l/T7w3byHc17LNBP2ZlXguBAgMBAAGjTTBLMAkGA1UdEwQCMAAwHQYD +VR0OBBYEFJBi1oDE+Fai8sxS1CbGn/OkXiosMB8GA1UdIwQYMBaAFNsWwk4/RPR2 +uBLq3E8R1jH5Zsd8MA0GCSqGSIb3DQEBCwUAA4IBAQA5z2M4T0HHqRWiQ6j5rMmd +flNkAQA/j1y3A07RigWfPvHir+zlkxWFpYq1n/JmuBlZs5y5bmDiBex3mIU0hezc +Aupugqy2TyGl1+cJR4Z4nCJosEamwN14V/YVv8imNNyoJFW71VWTC5vdvG21tKGG +XbePaeRponksWLQB7y11YR58mO6VI5YpeqlXT+1CdsmsKGNVvAJ6tYaP8jSMWTEL ++agqeNIO3zevGSeOJZEuFzpv7qWkahXTsd+lOYUmNnBRwtI28YVCTwvjFGDhs0Dy +832dneoTj6ozBVSEY4K9hQeFat2wurcMgh7LnpAUwMZ1gwXqqT8w6yKDyq3w/dhT -----END CERTIFICATE----- diff --git a/configs/open5gs/tls/nssf.csr b/configs/open5gs/tls/nssf.csr index 10533f264..fdc57089a 100644 --- a/configs/open5gs/tls/nssf.csr +++ b/configs/open5gs/tls/nssf.csr @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE REQUEST----- MIICkDCCAXgCAQAwSzEZMBcGA1UEAwwQbnNzZi5sb2NhbGRvbWFpbjELMAkGA1UE BhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQKDAhOZW9QbGFuZTCCASIwDQYJ -KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMiu1yWkFGjHdIeUhbLHAof+7vv9Q/4w -voLoBA5+wjqPv4bejvdyohvNWWkUJ+7LteHr5jq4uotBxw0WWPRyRf+T5PfBHdem -PpgAndb3Kc9yANYMrvkyW1pgNHWvr2aRn5K8MATaCMeC/3Nvkm6PJ3ezjX3Ae/mr -MlCaAQyYh9GE/ewEk3Dn4YEPbbp0hHhBabJKs2S7cGlNeuYpPymJK2eela8RqggG -thwCFS8WQROla/YUgnJAkYcq7nz3gO4raQR3GEDYxMB4Q7FGer1d+/hCr0mnJg1E -tJ+lR5J4lbdmMJhqf6alyIDLtA9jZ0b9GtoY++Qa1OaUERQxXaROFiMCAwEAAaAA -MA0GCSqGSIb3DQEBCwUAA4IBAQCFIub4/cIs9fJihlSgOfkqR5BVjv+UZgKocmPz -wACPxgLeXGzH+8aQvCnsmb9p8A7r4CamKkpzeJHuYyzLj2wqTaif0gsAvVnjkksi -uyxZtkWV9HDKgWYIaJnCYtKvAl7qKiY6DDk7McqPcGnI5zjYakxi6pLE2ZC0TUH2 -M0Zy54Tzj7rC889TfwGjbPIPm4mqliy7isxDJed1yiFizG0RT3CFB2qnjxqoU3sa -x0fYGWP7mcNuioBU2VyPHkc8/8lNM9sR7+K5Ne8Orq8ooeb/kTdvGZJ5MX67W2Bz -g+TwAs7ZPD4+ZGNIihlIMl2w8aOibYKmdIR6sc/01GHDhmV+ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBAKQBo4YHjaojOfSA4UeiE2Zo1HShgxRK +xEbASVqUehs9JdWLj3jdmSC+EALwXxnHcRF47QQr4e4zGrJ/bWehrDmfQKf9MYNG +bYUOJ9FNevKm+spLnU/G+kQ630rG/R3w/6hObrSW202fbd6QJHAxrOhribbwueqw +RoiGbYZ92dvWj4PeX/q6x12ZHmPa3IjaWC+97AAAvDgIeBlIOaedftdGyNYdD1XA +IU8Xo5erNXGO4LMT/JOspRTFqiyDRZ0/8dz9x7iF8lSshSizbjjdMncTbOw/V9ne +SQm5XDibADpWZhqIB0nlmUVjIthj3YjmX9PvDdvIdzXss0E/ZmVeC4ECAwEAAaAA +MA0GCSqGSIb3DQEBCwUAA4IBAQCSlk6Gp397YRwXNZYtDfnHWU7bXpg9BkA7A10q +lRWx6jOY2y8OSzrJnysgbUrj4Yr2OKc56V+oepe+NaMaFEOxnpp5JubWKsCVTdpK +1ELMs4RWdfrtzQbXMGXRw2GelszMWl5rncDdKCXaJmbi/FSnA5Klc7oHMpbCFQkz ++dP+mZeuAfM4Nx6M+cNc3XvsI1Ieixk1/BrLgyTKvZTeDvT4cgczF36tKrhI7aVq +IwIfXSLIZhGlz/f3H4MvkBCMMN5xCBnsb9iGWlkJmsjgPBksHXhPmcRxiwfGKpES +8CcsmPxHhyQzBS/kQmpBq/uVOOzu3F3iTQJlnpjJsIFvMq2S -----END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/nssf.key b/configs/open5gs/tls/nssf.key index b4eb3be5a..4bc7cc226 100644 --- a/configs/open5gs/tls/nssf.key +++ b/configs/open5gs/tls/nssf.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDIrtclpBRox3SH -lIWyxwKH/u77/UP+ML6C6AQOfsI6j7+G3o73cqIbzVlpFCfuy7Xh6+Y6uLqLQccN -Flj0ckX/k+T3wR3Xpj6YAJ3W9ynPcgDWDK75MltaYDR1r69mkZ+SvDAE2gjHgv9z -b5Jujyd3s419wHv5qzJQmgEMmIfRhP3sBJNw5+GBD226dIR4QWmySrNku3BpTXrm -KT8piStnnpWvEaoIBrYcAhUvFkETpWv2FIJyQJGHKu5894DuK2kEdxhA2MTAeEOx -Rnq9Xfv4Qq9JpyYNRLSfpUeSeJW3ZjCYan+mpciAy7QPY2dG/RraGPvkGtTmlBEU -MV2kThYjAgMBAAECggEAHfOlE250cq781WogCkQUPKKanewkRGvsrd0IaKFtRmWY -pah8mLH4lUMGH94Xl6xlGQhRnwdd0Cr2anL2E9slAgrbbEmGYAk6jl/ehEGfcTay -qT/QsvYGbGwEvbaFlz66HPcOs6qsZMVIcGeBPhRfmkindX1Prj5pjrNtif5knFXZ -YezQyv32wsXn0blE6Nfz7s6udA2JOhEj9hbl7VpK5Diq9X7zXD9eLlEB2vcF06xW -u3mMZHCN0Bl9Ftq0KM3Mn56GjqIKMXZpQOZGL6hwKbQQRgLAwWqGGkQASsd+zpIJ -i4NTibBDQarf6Wiob6SluEkpeaCim3cvf+lpHYCnAQKBgQDc/1StN7SB5Hpw6ApF -RkWQb996UnmM7DUQp4G13iGww4iC9+pC/F6vb3WwcjITmxdLbSWPrMByTPzUIk+y -kkBRD/TaAfPqSRsect9DjMhNyjxjSYL46jH7sR9VhebmuL4LhD2OpSPNGsnJwZ7O -GcWWGRcEgQdMiXZTLpZhgJ+tXwKBgQDod9TRgADMMKFF55qCa5M+a/Jp2s6pgFBN -BY8S0JApcOec0EyUZZ4fKX+vzP2PvQj4ITbEwsnnYDxGUIp76Wgo6ZvD50nSaxCC -/liDY0pPEOFTIootByPVj56nrpBQ5Rcuon7DcIS2z7kCnoDZ3d52UTqXjuu1sQet -8B7L8OVJvQKBgQDICwvgG+t2JJY8u54IZPq1Kr8035ENYgcKw0WjlaYTdnuMadMQ -vZcL4K28gTIZEys76Fm2ux4cmNnHQCO6Na6ocfQmntvmuDQnFL5KTBZIbAbLrRA0 -NvH1rbf6V1HSiWnlzNdX1t4YW+ZKjcwtLaDwJFf0iMNNoaSM2T/glGh1qwKBgEB5 -5AQLTa1Um5Zo61ja/2bjx8OGVaV7mkoSjaE5SZLE5uh+eY77NEUOXITlBTrVwmQX -yjn+kMNk1LLn6dD+Zs5aJMLMJpR+74B1jRU798NAOk61mL9uaIj2IZn+d7aII8ri -dOg+EAEoUfchATnsKKSGWQrqMAQfyrJ6lAAam229AoGALHAQxLc2fXztnZ7g2ftw -YsjutOSPPf+xBWZBVILYQMdY7Y3bEMIuz0oJqWSnvJ5ZMz09JQwoz9EzM1PL7GJ6 -PVlNNqqWdHtDlFamXS4rUXdsJLbKdoHy51bG1qIc5euYutpSUpKuc4n/g6erz7RD -iJue+kVzeFjZeLSMFeoN5dQ= +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCkAaOGB42qIzn0 +gOFHohNmaNR0oYMUSsRGwElalHobPSXVi4943ZkgvhAC8F8Zx3EReO0EK+HuMxqy +f21noaw5n0Cn/TGDRm2FDifRTXrypvrKS51PxvpEOt9Kxv0d8P+oTm60lttNn23e +kCRwMazoa4m28LnqsEaIhm2Gfdnb1o+D3l/6usddmR5j2tyI2lgvvewAALw4CHgZ +SDmnnX7XRsjWHQ9VwCFPF6OXqzVxjuCzE/yTrKUUxaosg0WdP/Hc/ce4hfJUrIUo +s2443TJ3E2zsP1fZ3kkJuVw4mwA6VmYaiAdJ5ZlFYyLYY92I5l/T7w3byHc17LNB +P2ZlXguBAgMBAAECggEABZ2wLaV2kWUIQ3D0oVEtClEg7UvEQyfDsR2rExRAf0xI +l4U9v79aQEfGagNZab/bTpslBgMdhwEAsyxUcylJ8uV2bS7Ef/wjioC0BA8yt978 +wqDiONpn2Xn7LgJ5gUCJ0JoEqnIgkAoJHhl7eoN2qiLFtFD77xT15VjogBF6Tr1+ +NDTR32xDMr9zjgJaEqWarDvlx1oMr2WSxBe7cY+AcaqbC8CFt1WPpsquAKogOq2e +DMrTXQ9voWkgDFepgB24I3FHPBpLwfUKfhWVF/PZePpVKVpBzZCdUB0JFoxn1yW0 +xpzVvRMSVJnNEq8B39Gpf2QUX5ZKpLzSljeNpBWB3QKBgQC9b5o0VuYeCs31AQuw +cMyrildLEamlLQLm2Ohq8WKExRaVeiS0nst+ebl5S/eGEsByw41MkUKQe2+iNVS1 +4eE05BhQ/EJ5MHi/yDm8yYH9HGKTqX5QHcKJgwyyFaRw+JAuEjpFPWewEf+P7A+Y +sovMzv+bL4I/I43LXfMV05Qv2wKBgQDdopBMVd6hD1mnxvHoI14LWLn7tMCGAM6Y +7rzY+k5/2GEbN1HmBCs7CLqW1tvA8aNXFxuik/KdQv45A2NpisxNZ645KCJPR5rL +XBEZT/WqfwFN6eQVEbsbsmgl23rPMJWdkkwOQtRRLS5rcmgek7Bz50Z3B45WO6lX +43HxaEfu0wKBgQCMNR/TAUZMkf6iCeYW70Xs6PV3EFmZcVkmdwB+tq4OSrlOZRrp +vGYs8/b8+eb4CsT5rBbWxuSXf2S+j+5kuAwxU2lT94FTpTaZ654gRpy5M9saI2bj +8ULc+GvbGv2cx7we/Uq3mJ03yfp3EWbxw6SJL+QrfdxO0wfNr3mNfA2/5QKBgDsj +WFt2Aix5mxOgiwXFAiAG8cFO7pwS9Q1rjmpbB70nMGoBrdGxRRPAdYEwHXzzPQFN +Aiu0TGVX7duqoskTpwX0Z1GK+vSqh4xBqbJWWpe+wctXYGuaypFOXmnTkYZdUV61 +HaQkguCSLLOw2EVoZQnYKT4zfvBVhQ8Vel7O03rPAoGBAJTCJoGxMuxvG0j3jpey +rGagoyHCEtwhLObVb7IUuQx2MdtM8w3i8nG+0stahGL6gian0JtRIjtUjtb4LYLj +w9RdXCCkj9bYVuKuvj8DadlwlOQerYkBEqj+hOxopz77mSUnk7Mzi1EeM8Nxs9MW +PXfIDKQ2a7vtoQVbjwBCuZLl -----END PRIVATE KEY----- diff --git a/configs/open5gs/tls/pcf.crt b/configs/open5gs/tls/pcf.crt index 0833ef40b..7e45a8cb5 100644 --- a/configs/open5gs/tls/pcf.crt +++ b/configs/open5gs/tls/pcf.crt @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDWzCCAkOgAwIBAgIBCDANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s +MIIDWzCCAkOgAwIBAgIBDDANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK -DAhOZW9QbGFuZTAeFw0yMjExMTEyMzM3MjdaFw0zMjExMDgyMzM3MjdaMEoxCzAJ +DAhOZW9QbGFuZTAeFw0yMzA5MzAyMjU5MDlaFw0zMzA5MjcyMjU5MDlaMEoxCzAJ BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxGDAW BgNVBAMMD3BjZi5sb2NhbGRvbWFpbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBANJDzsbZ910GqsJTS2Z+FKu3KnNHtPUvtJ4/pXdz6b2s9ECm0bPpTofQ -7N17yvv1GmEoBiCEpoz13q6ZZ/CCW4PLXUTXQzKsB3HVbm7luJA9JziKbXnSrGnp -SQk97HWN1RYdTKQKi46JaEg8MfyImeopyHQUmYbyg6oJSm/8JyXT9LAil8BJeLgS -JpOGvhE+Pus1+7XS9hswr/zz/6jiy2i6Cc5AKxF1Qp1qp69/8EMBFPRtxiHkwnQR -jMS3A7sk8N4z2P6JlRx3uBHvrActS7Q2IAUZHCqGPO+atdWjPpZmDJTTkiBcPBid -xNBM1efy4xtCbJm3bXQStVgELdXxZwkCAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV -HQ4EFgQUAPQBjYhnG8101VwEMOb7qk7Lix4wHwYDVR0jBBgwFoAUsWr6nJm8BCpC -iGXXfr5gcKIO2kAwDQYJKoZIhvcNAQELBQADggEBADjP6PVyrc5X0Av/FvkODQ0f -9FcVH36olgqHMXH8HMtSaLhWB/NdOoeMfNnrZKlJJe12t05vd1b6c495Xg5bCpCn -14wjUg/TM4FijXECGl0KT/VvPd+DI6sJiDgJB6wwVQoujY8c8k3inPoRBmPY56C6 -6UeD+NA3rUKnCas2yKq+eR2l+U48nfN9Sxdj5/LAQeY6CEaKKAdLZoN5YyxzZfTZ -esG7mPpj5c7+oF2SBk7NEf+3yT8aZ2Uy20GXwLnQYk9d92AWUtBywe1LXgJxY3Yi -snDuwEymRteXODzjMp6JXsCUwZ7e2e2QvTdDASx1QREidr9z/ddcpnXQWwQncHA= +AQoCggEBAKG6c2IjFOFDfXeMbwxvJHgCUMxb0mrWecikqcpU6S2Di2YnymirZzFd +WCz6Go4lvLUAJJFqCkcdgLGz+Ab/hX5SF7lMLOUrfXeOvU1DqRaJPWrixZFRwuLu +CCeNEdR7C+hVW0Py2BCx7Ta/iZCCkK0xXezTPMq6zhHzESp46Cyc9ed+TPymaGqP +ilPAnzsW8+WlVD9CXtYDQ0QOAVjixBshMDOizDaL99kuU3rSoLHHArTLvEmwv8cO +VYnS72X6h+l+L7bxLNfZNzOo2syZaqmjrqqgiqYtNy0lfqu1f8/nVQBq4+DWxINx +YJrgK+Q2CDIgAISV1scqPoFKO4pewzkCAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV +HQ4EFgQUdLk+Tn54JS8yKzTkQggWvP1romowHwYDVR0jBBgwFoAU2xbCTj9E9Ha4 +EurcTxHWMflmx3wwDQYJKoZIhvcNAQELBQADggEBAK00ZUHQ4dId/9WKu3M75m3v +Ve2qqaYB8S5knF5iWvjKUGJcv48fyO6it7HpAHors5H9hc9IR/zXpjJ/cQm7pwuk +vIdRDwpbTEfjYH160Fi03scUXl5c0pb1xyjmTau8h3EBN6WyBji2lbb6o/+pU+LO +q34qKydNZu05WtjaRO1KbCLSZDYd65DTA5AbeNb5H2hv7IuUIgTJTDj9TuZrjyin +EI6oLPY3RQyFSfU4QUyvumBj9ib/qwS5zBat8H+En3Kvc58HFDVZQrMgQjKb2kIg +iIMttLXvB7YLeE/AfuYH4Pia0TiJRZNfOitiAN3Cz8J+nNFgkavCj80pYcZVIUw= -----END CERTIFICATE----- diff --git a/configs/open5gs/tls/pcf.csr b/configs/open5gs/tls/pcf.csr index 2b70e3146..5d32e396b 100644 --- a/configs/open5gs/tls/pcf.csr +++ b/configs/open5gs/tls/pcf.csr @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE REQUEST----- MIICjzCCAXcCAQAwSjEYMBYGA1UEAwwPcGNmLmxvY2FsZG9tYWluMQswCQYDVQQG EwJLTzEOMAwGA1UECAwFU2VvdWwxETAPBgNVBAoMCE5lb1BsYW5lMIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0kPOxtn3XQaqwlNLZn4Uq7cqc0e09S+0 -nj+ld3Ppvaz0QKbRs+lOh9Ds3XvK+/UaYSgGIISmjPXerpln8IJbg8tdRNdDMqwH -cdVubuW4kD0nOIptedKsaelJCT3sdY3VFh1MpAqLjoloSDwx/IiZ6inIdBSZhvKD -qglKb/wnJdP0sCKXwEl4uBImk4a+ET4+6zX7tdL2GzCv/PP/qOLLaLoJzkArEXVC -nWqnr3/wQwEU9G3GIeTCdBGMxLcDuyTw3jPY/omVHHe4Ee+sBy1LtDYgBRkcKoY8 -75q11aM+lmYMlNOSIFw8GJ3E0EzV5/LjG0JsmbdtdBK1WAQt1fFnCQIDAQABoAAw -DQYJKoZIhvcNAQELBQADggEBACom4xjdCg4uDodIeninSNXwaOFK4g3zI6aIDyi2 -FhBxDcutDAAJHnXTOxVNWHan09UiYUeCRlh22NXfOXTAkR2cWDDizIGlcw7IUPal -5+AqgyoBqZ1sD51+oDkZArZad07HbaBgkHoCDBDnGcWC7E6tpd1MniVuv5xPGp+g -TIEKR9wEiHsUEePON9rrIqntgvpq8LpHVv9+BDdn6AEbkAim0U/IvHcmCjIzwp+8 -N2iFBuqngt/P/v/A0/eL06qqWIpVuVpBIYDdd6JrMMM3QWcATiFTVX19Dpov0dRN -2iR9zsWC2Z/NYPQzGoJyKees7prTXpOyS/s8LLMTAKGnxdY= +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAobpzYiMU4UN9d4xvDG8keAJQzFvSatZ5 +yKSpylTpLYOLZifKaKtnMV1YLPoajiW8tQAkkWoKRx2AsbP4Bv+FflIXuUws5St9 +d469TUOpFok9auLFkVHC4u4IJ40R1HsL6FVbQ/LYELHtNr+JkIKQrTFd7NM8yrrO +EfMRKnjoLJz1535M/KZoao+KU8CfOxbz5aVUP0Je1gNDRA4BWOLEGyEwM6LMNov3 +2S5TetKgsccCtMu8SbC/xw5VidLvZfqH6X4vtvEs19k3M6jazJlqqaOuqqCKpi03 +LSV+q7V/z+dVAGrj4NbEg3FgmuAr5DYIMiAAhJXWxyo+gUo7il7DOQIDAQABoAAw +DQYJKoZIhvcNAQELBQADggEBAJjf5BK5HAFbhOFFgmYUlU124JDpQh7O4WF0CQNe +XSDKy1EyMgngvLRL/fMtsHUiLwAZ5681DxQ0zK93lAtlHKW2xA71QxQBbUwQdLIR +hCpQAY35gWektdhFbpSVMz23qLiShkbQv/Sza8ucfsqKPDTmO9bc8hPZth5GCJkl +nB81emMt9dvdkivaNfMTnBgdgy2ONY+gsF9xvnQCVRTc5cP+9PRwQI5Njg+mXLBO +BPvOu26HhJX1BmBP9U77Bqf5RgOR96BYisc10rw9XzfbCymh8dIKN72tFtQxlgXY +DbbT7UuGxFuaJeYfdeOeRc9wet/ALC12he+zbpz/F2oksHA= -----END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/pcf.key b/configs/open5gs/tls/pcf.key index 4c01d3fdb..3e5997d8e 100644 --- a/configs/open5gs/tls/pcf.key +++ b/configs/open5gs/tls/pcf.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDSQ87G2fddBqrC -U0tmfhSrtypzR7T1L7SeP6V3c+m9rPRAptGz6U6H0Ozde8r79RphKAYghKaM9d6u -mWfwgluDy11E10MyrAdx1W5u5biQPSc4im150qxp6UkJPex1jdUWHUykCouOiWhI -PDH8iJnqKch0FJmG8oOqCUpv/Ccl0/SwIpfASXi4EiaThr4RPj7rNfu10vYbMK/8 -8/+o4stougnOQCsRdUKdaqevf/BDART0bcYh5MJ0EYzEtwO7JPDeM9j+iZUcd7gR -76wHLUu0NiAFGRwqhjzvmrXVoz6WZgyU05IgXDwYncTQTNXn8uMbQmyZt210ErVY -BC3V8WcJAgMBAAECggEAEobL/ORuscEpIZcyQRUh4CFy+ZZbYPEzom/sNfK+KSrI -mLu6JXaMp1Xm0Psb3whxKxdaNtpJTIlLdinpKR1rT9kG3k5zSs8ylrqeEOJn2Tmy -L36u97ly3KAkAc71e0Qkft7VBm0xb702tYqsQtqMaUAGPAgmoOfUZxKLfwOCNYhn -FvD76Qvv2jOwO0UvDzrlOdDsLiDPqYGR+4VhJOGEBVzZnQeQswbhTEj9JTBNc6Dn -Gvh5ZxhaV82yxpB8J0JVWESb3w6KDnDpCskW8IVznjr4D2hxjQRjDXx4IMcWtCVg -BnEknKR74uSaKZza5jwGf6XwoA1YlkCNbEmGeZn8yQKBgQDlFGx/KkSNIeDOUuFQ -9la4jBjBf0RQkost9h10SVgk7UhnUOdhAzd8gygAdL8opesoVyY2lbIhv62iH+94 -5Eoh0mLT9siKjR/d56wyQRccrjoHLt91GnD6qKeGO0hbI5QeeKbdDrbCgzEpm385 -u0HYLhlkM+bpPnMDaai5wgnPpQKBgQDq+Vx2K9lNHN/Gdz7vq0xn/oGeiT0EWQAl -nGD9E03f1QYsSA0DqX3MWJ+7rmXHxZcT4HC1DNcgpG27mEnIVxw3n3JoPWaY5DKd -BXvQEA+SaNfXj+nEQft/mFgVGmadhnS8IgTk3obAQXVWXrgV/0xO4YaQH4D/08Zp -eeWr7neclQKBgBceZoy24VA0+REZgC/BjKL3UJBGnchb4bvzuKlBtamUYNg8a/14 -a6MfQWw6XAhoJkFd+jdMCDwrsgRIoMxcjba4Gs01fKuu7mZguRohQ4nbc3PCIT8a -Ogix+KYtWXIJNyuUFZL9pygeQVnnnYFgCpccn+di7Yzgho7znNmSYZcZAoGASOpi -r+UBhLVuF5dPd24vwqGutXSe86durT0ut7ny03+2b61YJIfHGs9xmfsPaIO/UxK1 -xukaJO4Bg1JJqxqlDfmztfc/zDgcIK/f8Pva6TMRr7nf7+AN3FV5F+teZomf1fW0 -kRUgua5WbBvughz8IApKCJVOIZUlH/wMsmLIyVUCgYBL9vzRI1RliwBWZRRHGuuX -Eg2x3GUvIAMbA7Yfpd08VCkxPGrNtPjb+nPbV5zHf0lSrKsBzCtgy6WAulhUGTBw -tfcU//wg+1MDb7OY3ZBy0+8e0FDfS674DnD4YT7E+RoEqSrNPJ7v+Z1+LjkQPU/k -58Nf0K4LaLiLah5T6dNIeA== +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQChunNiIxThQ313 +jG8MbyR4AlDMW9Jq1nnIpKnKVOktg4tmJ8poq2cxXVgs+hqOJby1ACSRagpHHYCx +s/gG/4V+Uhe5TCzlK313jr1NQ6kWiT1q4sWRUcLi7ggnjRHUewvoVVtD8tgQse02 +v4mQgpCtMV3s0zzKus4R8xEqeOgsnPXnfkz8pmhqj4pTwJ87FvPlpVQ/Ql7WA0NE +DgFY4sQbITAzosw2i/fZLlN60qCxxwK0y7xJsL/HDlWJ0u9l+ofpfi+28SzX2Tcz +qNrMmWqpo66qoIqmLTctJX6rtX/P51UAauPg1sSDcWCa4CvkNggyIACEldbHKj6B +SjuKXsM5AgMBAAECggEAB/7XxXpGhfx4L3jZ5Jt6ChTTOccwV+fSjYDWhBI+lOlz +8tD0yMfwihg7S73xoiVrdudS531+lJV4z1A+atonF1+nnJmPfqTvxwFfinpV2a9f +QfGEIvMP13g9HvdycjbDF/FgWbOfyvOA7rv5aROLY4SVSCgJUVx645hIuPjRQaNM +w1MsBGfnYsor5BsGI4ru5uCD0pHDDcxagso6CGN5kTTVxTKOlHvH22OIc9y5J3+k +73tOccfLZ+/VZCSno1+xfZmhXxP9ZOnYSgIk1cSGkELjWWSqOQv47ljJC//kQ5gG +vBhb4IDWsvdQv3kqjPY2NU/niBcPYG2VkNpV44B9oQKBgQDSrdWmu9x06TX1Gi9e +glKaFETxskAD7LFC25ZGjRITNOAtv8z8CAQa+MdnEchPh37w0lkLdDoZaY9Rbfya +ZyxLQdUl2t/rCIZno7N3U8HBSLaJhb3ZCy6sNSg8+J3XFgzoqv1oiKTMEJqSEFIS +24X3ntbf3SDkLK8gVNJ1dHlguwKBgQDEhOI47vA1qa5jbNpmIPqEqFYO3r2k5ta3 +yM3yNtY5sep+LukcHANpRKNNK1FZDIKBM/g6Or0I/mzldCtd16sWT41Os9JTb+/K +1UwT1adHqD0i6NXEHfs54HdMswSs4BJ++JSslIELvjc5di06DQ1dabdctDXHqUJj +MiogA7F2mwKBgHLX+eg67fD5E8W5cWr2ZarCM9cBEO5Sv0ovw1pQGjNIFpA5xrb4 +c6x0QtaHlgbsWKFUOOAKioVByrNb3mAYr8eSamuJRZise//Q98qraKpBRefvdM70 +zotnKrkZ2Yje50iJtTufiR4ISwomRWcsLXoPJxi/ROe9B/X65wLJ7ERzAoGBAKxJ +k8s2L4HccPbZx98hqoAC1O/Ud47KkhQuB+ACE24hfOODXPs31AXGFyTghUD8pq1/ +UnA6buAjrnS7lAmBuoyk0c3d+NcNm7zHoxsAhNddt7uTRVXasxXapLypdb/Z8l0+ +sZlb2IbjDKdj4+Kw7ramqAquMzgIPBubLzNCCaNhAoGBAI63kqL9qrqGuPCx4Su6 +buRcLTBiFDMYANZeUuqO/wb8HY2OYASwZyvBQEiSB7SghedkMu45yTWEE6ik6Ikh +NdF0x0lCzkjb3umIa06t9BDu1IJLs0HWvfLejhCzJDUa1z79UnP3158CNOufg5hE +Q/tV9EBP9Fb4BUMQjaHZNMBR -----END PRIVATE KEY----- diff --git a/configs/open5gs/tls/pcrf.crt b/configs/open5gs/tls/pcrf.crt index 621c33cfd..2eed41524 100644 --- a/configs/open5gs/tls/pcrf.crt +++ b/configs/open5gs/tls/pcrf.crt @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDXDCCAkSgAwIBAgIBCTANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s +MIIDXDCCAkSgAwIBAgIBDTANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK -DAhOZW9QbGFuZTAeFw0yMjExMTEyMzM3MjdaFw0zMjExMDgyMzM3MjdaMEsxCzAJ +DAhOZW9QbGFuZTAeFw0yMzA5MzAyMjU5MDlaFw0zMzA5MjcyMjU5MDlaMEsxCzAJ BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxGTAX BgNVBAMMEHBjcmYubG9jYWxkb21haW4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQDMiA6Y/1qYyV3CMfVer498oPZNlnjciFECal71JbgigzvUUAIXT5tx -KQUWKTjeyhbCGHMekwuyyUoljo6jMIoYFL5m1DKS6GV9mQgOhj2QpDEN44FFWm4B -BRM+pHxXr71h51lXffH6l+wt1O7Y76ok2ZIxB8vzUUfKzmeg6wUQntS4oWuzZCHl -5Ca/5FaDcty6H4ixE1O3+dRHPmbT+aWrZwekZyrOXYnOd4jNlJ9mz8STXLP+mEEH -X3VbPkBOwFOHNq44WHYzZNj0CEjVghWWtse0T5V3QWluYxiBmJF3q9sWNe6bn9FI -qOeJue5TzhqsldDZ75qhmvpRn7Kn+hz5AgMBAAGjTTBLMAkGA1UdEwQCMAAwHQYD -VR0OBBYEFGyP1+kC3lw5HoXa6O9i41J/tZZqMB8GA1UdIwQYMBaAFLFq+pyZvAQq -Qohl136+YHCiDtpAMA0GCSqGSIb3DQEBCwUAA4IBAQBkZI1BdcoRFyQGCb5AhiXc -Su7MlrdPBACUvXqF4R1OeNUAa6dwlFVINxZmrFYrJ2MCo+4KBURXEBjugLloWGTP -ChsM7eRoFniCQChWkEjoaTe8wDIWYSyZ6tBfiDgdM87uP4rbK9HO7C5lByj9QtAz -OHYbkv5NEi5j+S0i9et9jjXoHjtqBRnlzF3lSWc461CkJA1Dgv6jldY+ozhxJlPq -ZWvLc+8B44pgsQYkwpsg3CFESNAUa02h7qynswdmaB4AtPON13qjPzZxuawVco6K -Fuy68CkHwwUTk3Qq2Nd5DLE5yOstiUOpJJ5qlQy0Fkp2SG+FEC9Rlfbl9Eh/Yxua +ggEKAoIBAQCoaV8Sw9BUk70EsJYFcnZHKUR5zctXLlmF22roIe7vPFK4Pkpp0jSb +uukCrcm9YDvr32jZcoXdIcRHKWzaD/VrSJpPfrBSSvFUFJdTLCdnmp2POPwAZVbk +hfNo5atX+T/Fo9tYzPGFMUk5w6thXZVO8NbIZkYIYzsBDYn3CmlUN0/zJM3xtMPw +989CU3KPCtr97+eqMgitSZjZ16NHA3UA2orK/nPGreIwx5xkYfdQCF8noDmkIZ5M +52sMpiuFJJ28G+/xNFBz4bOsrHxZgRUaSxMm72jG7AuHXv8AQwCqg2d+lqeLEnJ+ +KSfu27LjBxvtXrnSeQCV10p3W0+DvvifAgMBAAGjTTBLMAkGA1UdEwQCMAAwHQYD +VR0OBBYEFCxEk3wASo20shbmQ9YbBVsKWHQ3MB8GA1UdIwQYMBaAFNsWwk4/RPR2 +uBLq3E8R1jH5Zsd8MA0GCSqGSIb3DQEBCwUAA4IBAQBb50ueuFMhqdDGRO2aD/Nx +vp1Pxg+YOcq9vHscY2o0dEyg+hJYoVhAFSZF0ay6H1gvLlNDtsN2MSzgwNp1CGVX +ku6MCXdXkoV8rBIkZpcdgjHBoZ3CEr3Akd7gtRdYxjv9/rtppNXCP8UJh3hi1Yvc +KGrfbhVYM0QxnQhwRypAzrpifrf+fbzyyZvfg8AlkUFqGAvIcA+VT7+TF3UjwAwP +KXl1dL8CFFakPutekeVXFYnG7pbgCsG/1f4zo8Mt5jP2cVkltudMLuZsh+/Zu5kP +wdYKs6xN14rvc/kMquPqswNHMlT//0MzF9otmnvkgrjtr1pOGqwUaMI7P8FUaLj/ -----END CERTIFICATE----- diff --git a/configs/open5gs/tls/pcrf.csr b/configs/open5gs/tls/pcrf.csr index 83237aa26..0f66c58c5 100644 --- a/configs/open5gs/tls/pcrf.csr +++ b/configs/open5gs/tls/pcrf.csr @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE REQUEST----- MIICkDCCAXgCAQAwSzEZMBcGA1UEAwwQcGNyZi5sb2NhbGRvbWFpbjELMAkGA1UE BhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQKDAhOZW9QbGFuZTCCASIwDQYJ -KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMyIDpj/WpjJXcIx9V6vj3yg9k2WeNyI -UQJqXvUluCKDO9RQAhdPm3EpBRYpON7KFsIYcx6TC7LJSiWOjqMwihgUvmbUMpLo -ZX2ZCA6GPZCkMQ3jgUVabgEFEz6kfFevvWHnWVd98fqX7C3U7tjvqiTZkjEHy/NR -R8rOZ6DrBRCe1Liha7NkIeXkJr/kVoNy3LofiLETU7f51Ec+ZtP5patnB6RnKs5d -ic53iM2Un2bPxJNcs/6YQQdfdVs+QE7AU4c2rjhYdjNk2PQISNWCFZa2x7RPlXdB -aW5jGIGYkXer2xY17puf0Uio54m57lPOGqyV0NnvmqGa+lGfsqf6HPkCAwEAAaAA -MA0GCSqGSIb3DQEBCwUAA4IBAQAmSA4jedvdB8xQrrEr5eJwAiBv72vu6t0okW/v -80cLid140/stZSNHdJ7dXlXWhyWfCxS6dMVuXhYBgRCucwVpMjU2CX/ukhzT0JQW -kTrdWCsrqzHnD/ukGQXA1fvaMHTLUzcBe/CznS/H3pVkSjdtiENZhxZwghigI0dP -hePe2O2GmhKXCl+mtD08Wo9cD5NuDj937Wa0x9JHsjsoKxBRVvdmOXBrAZ+8p2k1 -nwwadBpUpGLbMDS19CMGOXjRpITE1lhXFDn1xtQRAM0eYE93jLzUE+i+o90CR24Q -g21BL9lz3emPLDHgKB1PXdp2azdfd+cyVzDVGrzEFdFoqxNT +KoZIhvcNAQEBBQADggEPADCCAQoCggEBAKhpXxLD0FSTvQSwlgVydkcpRHnNy1cu +WYXbaugh7u88Urg+SmnSNJu66QKtyb1gO+vfaNlyhd0hxEcpbNoP9WtImk9+sFJK +8VQUl1MsJ2eanY84/ABlVuSF82jlq1f5P8Wj21jM8YUxSTnDq2FdlU7w1shmRghj +OwENifcKaVQ3T/MkzfG0w/D3z0JTco8K2v3v56oyCK1JmNnXo0cDdQDaisr+c8at +4jDHnGRh91AIXyegOaQhnkznawymK4Uknbwb7/E0UHPhs6ysfFmBFRpLEybvaMbs +C4de/wBDAKqDZ36Wp4sScn4pJ+7bsuMHG+1eudJ5AJXXSndbT4O++J8CAwEAAaAA +MA0GCSqGSIb3DQEBCwUAA4IBAQCjlFphKphYjN62Jkbd97sfHQePni13vOwh4XOa +ncs4uJ0p/zT3N1raeTaCkBbQdzg8tAOaHEtk2i8yhki9IF91g7afbxpczynunO8n ++lD085kGtguBcvyAc1WPAox8xLXqGFg1vFrEzdUMuCTfHFkMJg/0KTMBOu/e11Wo +0ZmaOZK2pcOMijEkCNpxks7kdhaRH307f0XTny/uumvUGAy+Ie3dqxVxrQXdz+UL +Jr0y3uFi/DAtGEDznhPN1GOFyyTY1sxEhEJbCVTKisjQopOjtxvu5W3HOKFyk2dc +OR0Mnll7a9oJ9ilagVilSsraLFIAsLTNDbH35V2xJu7q+4sP -----END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/pcrf.key b/configs/open5gs/tls/pcrf.key index eee24198c..f401e3e76 100644 --- a/configs/open5gs/tls/pcrf.key +++ b/configs/open5gs/tls/pcrf.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDMiA6Y/1qYyV3C -MfVer498oPZNlnjciFECal71JbgigzvUUAIXT5txKQUWKTjeyhbCGHMekwuyyUol -jo6jMIoYFL5m1DKS6GV9mQgOhj2QpDEN44FFWm4BBRM+pHxXr71h51lXffH6l+wt -1O7Y76ok2ZIxB8vzUUfKzmeg6wUQntS4oWuzZCHl5Ca/5FaDcty6H4ixE1O3+dRH -PmbT+aWrZwekZyrOXYnOd4jNlJ9mz8STXLP+mEEHX3VbPkBOwFOHNq44WHYzZNj0 -CEjVghWWtse0T5V3QWluYxiBmJF3q9sWNe6bn9FIqOeJue5TzhqsldDZ75qhmvpR -n7Kn+hz5AgMBAAECggEAAyK73I8fp7OAnztOWHkHEWFTXV2m9TSWz1troMUHBWpv -JqJiYdKb3riDBjO0FkBRaIDg9PFKrt9Epn5AxBI4r8VTpPZwXw22jp4jwDtBIuBN -izm3b+WCxbu6740shdihJeja1wtMhCvDmHFJByTnfiCiy+MjdpPCrsKK1q37uiU6 -NwQM96hwi6TYTX/i2FcTgB8TtPmy0hKiN5pUdWYGNq8xjNAKarNptELveOkTDmCc -dlpqS+4ii5BrADrNDjuP7FS4KnBn45vEB+y13OAPrY2TvbfQDBI4i5HdCVw3zo0c -NOf+TpJykg+Cxa/WqutX8im/3X8K8WymkcfdZ1I0QQKBgQDdadXvCrJNz8j5o2OU -ClCvkFnPoCiySCT19/RN6C45C/LiWi67OxcD1kr3uWMjblPwXoyrfZnxjraOpeaM -fVXnzNbqD+Rnre5/YskvU5hcgoKrAMSgcwa2wc/DKPrgj83PWaxrxLKCguPIh6zk -DTvAFsx13SBQuRQwiAVyJY6KIQKBgQDsex/TndN4+kxdPhZMENExoqZ9wBvLFuvq -q6ODTSDw/yahPlmAAuqyIYq3NY8Qdi4IEKnna6wVVBtZU313TADVntIKT+1xsdHp -SLKChdFggqdUXIS1/FOCosoWCaFHe0jM/YVxn+QpooZLWtEjTofxGbfEiQf+sKPV -+KDED5wn2QKBgQCM/wazMLaXAojTIA8biO4UvvHSXAVOcs7Gq92xdvdocIl9RzyX -Emv3j5Ex66aMO4fMfAlMc7GCuATdFhyYvn/kGveJGhGzTHmiOUAwmSVfU+TuDJEq -M9XEr+skNoZ8VlcTgeFgx2N95Og1HOEmYJ76Fgqhy+z2OsX2mcgOBoicwQKBgEah -R5I201CQwXof7xzs8O44PC3W0PZJdFD0zrOKt8oDCxChxK19MYfeiMXLk11BTuJN -x9E80XrVUg3N5+1Xn/AtrWIzGSIaEC3y7o4ZVb3TiBKkR2brZC3iXSVT3v2wjr/b -AJ49OTJOPnoHN+upquSR39ctblvdejGQPsQQPX2RAoGBAMPEbxnbW+4ueDqDLjZa -Sycio+MO8wPtsBL6g0sg80zduoBLPb0djCSiqYCTEgwtkYG9oQtKYvEycvb8h1qB -9TrLpwWTl/k1ERmjME94Kf0IJZU9KInq5zmIKAn0iIdoHjSWK78JiOMb9pw2A44V -RmU/iXW95u9YMWPrtijdc/9y +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCoaV8Sw9BUk70E +sJYFcnZHKUR5zctXLlmF22roIe7vPFK4Pkpp0jSbuukCrcm9YDvr32jZcoXdIcRH +KWzaD/VrSJpPfrBSSvFUFJdTLCdnmp2POPwAZVbkhfNo5atX+T/Fo9tYzPGFMUk5 +w6thXZVO8NbIZkYIYzsBDYn3CmlUN0/zJM3xtMPw989CU3KPCtr97+eqMgitSZjZ +16NHA3UA2orK/nPGreIwx5xkYfdQCF8noDmkIZ5M52sMpiuFJJ28G+/xNFBz4bOs +rHxZgRUaSxMm72jG7AuHXv8AQwCqg2d+lqeLEnJ+KSfu27LjBxvtXrnSeQCV10p3 +W0+DvvifAgMBAAECggEACJELmAMZPCQjukhX6UEFnosNLlD3O0u38WTUOaii5HfM +vA3XGoOUeijLeipoQld8f3wRc6DYCa6SXbhQDtY++qJqebQNDgfn4goGGeH7bdFh +8GDKriPO2WMC8F62ajbbNUIngeCIQekxkLGmVxaRO2m+0y94ooFBsBpbM+jLViWW +RWmnB3c4JhrCxRsCIcaCL4rjesShEAerDU45Drr6+7zC8gmifnkM3Co8yXEM2Sp7 +XtO3ZCOvbhiGEMugZS9jrr+5CNUCd7zk4lMpUtDI50gFU8THYZkZVWhd7EYhknmD +iCRqg6/sD39uosrGcqA6joehWwM6870eSqd5gdWBuQKBgQDh9cvbqa7NxPvGa04D +/OyjSkcC0NVDeM65CqvCuzeMQhizDsaiAi3BVBjyuaEgmAGu5Anm7qe4opTwUI5E +doPbfnUifK3kJefQBs2JPMNkIloGvbFQsbu7H7qUAhQCtvcHD5E95tnlB9GoyRCV +2tQRjGlFJVFflPPhr+LkbCuVlQKBgQC+zP/vjxaanEmULVPEd3+rhrsD5kfexwU4 +3WHpOinSkuccgWBMoIUYJHM0H2NCAbitcz4zLxVvRLQytGL3GHlSwNvHwWqZ6bv/ +gblMFzqt9/KJn9VwsqCW9rQpG2lkPk/Wl59oWosmOJ02vag0pzxK9DtsIPAwBMyg +D7/59AugYwKBgQCDU+J59vL78UMMHY2oT7YRabg/8LQilPJBJeySL1GnmTrVxv63 +ZmDFfmVJnY4CbZZ82VjP+WFNtGCwE4G8VM1qIuNdee1vLoC+rVWEL+a4Kib8x/9o +kQQ1S8mbAGI0+bY1Slz2B1gY/yRh3wpermKXGG6Om5Ph46ajQyCx9hSWyQKBgCmM +PGMvFm3+gGs635XVq8BvK0QzHg1d6z4xvwNpfffzs03awlyNS84xCcEc4KFb/JoQ +kUfWBeXf4Rl1fGNwOeMSSgmajZsMcbq2xeHS4R1G89KSMolC7INTH3IgHPgONZZ2 +F+lCZjChfWKRNBKbJB7yRgpKteLO+LwWEejdArcfAoGAFVL0YlwvtFpQSN8ttpGE +qdYp7nbcH8qV5vbDQq6M0iJ+lqKy+N4NxaD+J5fxrRnxy180w0thcj6ORCZQeo67 +4PRYb9X4z9G8cXDwkPeUW79Qf09ZfgqX7PfF9o1yVSpWK4k/pQAtSnevTc1wz/77 +4ynXBhLYHsulse8kkhBtHhc= -----END PRIVATE KEY----- diff --git a/configs/open5gs/tls/scp.crt b/configs/open5gs/tls/scp.crt index 092a53331..f1cee94db 100644 --- a/configs/open5gs/tls/scp.crt +++ b/configs/open5gs/tls/scp.crt @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDWzCCAkOgAwIBAgIBCjANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s +MIIDWzCCAkOgAwIBAgIBBzANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK -DAhOZW9QbGFuZTAeFw0yMjExMTEyMzM3MjdaFw0zMjExMDgyMzM3MjdaMEoxCzAJ +DAhOZW9QbGFuZTAeFw0yMzA5MzAyMjU5MDdaFw0zMzA5MjcyMjU5MDdaMEoxCzAJ BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxGDAW BgNVBAMMD3NjcC5sb2NhbGRvbWFpbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAJ34VbJi6C7XISkQdq0pKXcTITsG8w41IxlFm4nuglYyDWsdQJf4+sGO -I+E6E8b0LVDkUljh4cRD3ZTZy/MlBC2EHIi1zP0ZRDzl6Av9qVUhCkQ5bviPmvUe -fQp63Suo4MzdzhbAipzsEC/zFDdjtjHKziV16zxjzpWoR9Qhr8YzLWT4t2wxJVP8 -lOlgAdkWYPDW6/PAz9PNmJ0xuhtMC04Ia+RHxFi4xeH4umBcp2cHbdup8fW+sI4Q -RSg6449FiL4XlElggMpNlixcvNE6umzCAS5rJj2FIODd1i4J7JJjbs2nxZWJQTj5 -B5mpvFr5UlkKAxNVDfEC1jNzkS7ttscCAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV -HQ4EFgQUGcbPg++D5U187URxcjqTsqmmAogwHwYDVR0jBBgwFoAUsWr6nJm8BCpC -iGXXfr5gcKIO2kAwDQYJKoZIhvcNAQELBQADggEBAD3hPDcxv6j4n92UC/+XSsLQ -cR0gZH454Y52Tocee1MgbQeDQauJAVtu4A79reBDmL8pVF14auBzLqLdyBTxAfOn -4hcbw9OjxF/eKeNvYXL4tNu4KzZOoZuUiM78wnvJQObRp+30/dIUHt5B2nuKdStI -kHgQrUXMuvJBCzmDKqiyDkkY8gN6/no6LzHQcpC7KiAhhQZ9s6IIgg8ulVqgeLXd -Ia7Jit1Abm68+JDifwof3IGF6fzjxmWNzifxlVSgbMWMOnmgIVXojZrS2ofiJ2es -VvLkGvyeCQtUV0NuGNS5QHyKN68mfDNRbk7A5gcr4ga9YzXHc9aQ5VJZyDvax3I= +AQoCggEBAK3GrMBq6chj2u/sI05/uxfPeW5c5/GSSEFua4cIxVl8PrLDDz4KH/C0 +XRlHYAfglM5Loe7fogN+mmAG1bVOyOZjn2/YR7WN0TYFtst2NJ0aJt807xvIiBhz +njg/vry2QroKhrewOPkzPyYYhq5PLLG5IEPYDJbp/Dy57yJDgdN+KBP0Xo4J2V27 +nuTUgzmMpzylTjc0OE3f3EKb28AuNpnFN/Hh1VDig/QKfSIelCt3650l1iSkXghP +D1lqwkbynLftuqUH4TwmmbDAnTTngdug+iX14lITNUH9pZCaQzHu3s0loXCIM2cd +tTvYH8TDe7piWU5gVueyGliLxYTWnmMCAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV +HQ4EFgQUfQiOX60ERuQpEhO1spKSbulx/vEwHwYDVR0jBBgwFoAU2xbCTj9E9Ha4 +EurcTxHWMflmx3wwDQYJKoZIhvcNAQELBQADggEBAI1sl/aPVwvaQLESedl8oOcI +ueQ6xd3lCXUN9XbhLsZh3IfgNC1ug9iTLEK5Ky+e7tjVVnoOZ0wLnUJhIYL/gJp8 +4aqKs7qmHzRLFYVvEvWsO4eSr3qHNIykU16q7Ve746PsTQJGuQqjMynPO5rsUstn +JMLde/6MWh36Umqfk6/YILoCJO0BrtUt1UL/J40w6XvD8ARplDCi3HZDZ0aXMaWQ +2JGtLy8AuwK8G9IQiGMLmsXF5WzxDJ0tC+P7AeSYCBlRzzE59OgiCuYzgRzP34F7 +R9KTvi46L+16IZ2RcPIaWx+fZ15E32nvJCHaIU/fqQpakIC9wPUQ+QEfzUCm5iU= -----END CERTIFICATE----- diff --git a/configs/open5gs/tls/scp.csr b/configs/open5gs/tls/scp.csr index 00ff2844a..a45340153 100644 --- a/configs/open5gs/tls/scp.csr +++ b/configs/open5gs/tls/scp.csr @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE REQUEST----- MIICjzCCAXcCAQAwSjEYMBYGA1UEAwwPc2NwLmxvY2FsZG9tYWluMQswCQYDVQQG EwJLTzEOMAwGA1UECAwFU2VvdWwxETAPBgNVBAoMCE5lb1BsYW5lMIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnfhVsmLoLtchKRB2rSkpdxMhOwbzDjUj -GUWbie6CVjINax1Al/j6wY4j4ToTxvQtUORSWOHhxEPdlNnL8yUELYQciLXM/RlE -POXoC/2pVSEKRDlu+I+a9R59CnrdK6jgzN3OFsCKnOwQL/MUN2O2McrOJXXrPGPO -lahH1CGvxjMtZPi3bDElU/yU6WAB2RZg8Nbr88DP082YnTG6G0wLTghr5EfEWLjF -4fi6YFynZwdt26nx9b6wjhBFKDrjj0WIvheUSWCAyk2WLFy80Tq6bMIBLmsmPYUg -4N3WLgnskmNuzafFlYlBOPkHmam8WvlSWQoDE1UN8QLWM3ORLu22xwIDAQABoAAw -DQYJKoZIhvcNAQELBQADggEBAFRCjdAFXqzb4Hb9ssaABrW9nDwO+ZTGiMeQg122 -RJ8TiH0jq3qurRdq6owPDJiqVVNklCdba93fB9TRqXf3E8RKswp9JfM3OfVdpgT6 -gYoQcJOVsY1iyDbC/RQZvDGprAF/zUI/7+Lgb41CHU3rd2XOVgZtJf3NeBHV2ZmH -VMnPW8t2KSxtDiCNuAePfFnmUfSYZfTqpyswO5nO+qyfazyH1teLKcnjrHi5yCXD -r32l1W7sP46pQukJjLgEKQA+ekA7pTmqENJLY9a01yY42N/ZB35fXNuxeJNS0I8Q -Zo4AoFwBWINSTiOF4/n1OSIctmkxc/51dKNLWu3kZSOholA= +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArcaswGrpyGPa7+wjTn+7F895blzn8ZJI +QW5rhwjFWXw+ssMPPgof8LRdGUdgB+CUzkuh7t+iA36aYAbVtU7I5mOfb9hHtY3R +NgW2y3Y0nRom3zTvG8iIGHOeOD++vLZCugqGt7A4+TM/JhiGrk8ssbkgQ9gMlun8 +PLnvIkOB034oE/RejgnZXbue5NSDOYynPKVONzQ4Td/cQpvbwC42mcU38eHVUOKD +9Ap9Ih6UK3frnSXWJKReCE8PWWrCRvKct+26pQfhPCaZsMCdNOeB26D6JfXiUhM1 +Qf2lkJpDMe7ezSWhcIgzZx21O9gfxMN7umJZTmBW57IaWIvFhNaeYwIDAQABoAAw +DQYJKoZIhvcNAQELBQADggEBAAnjmoDZF3VdzFrQ3AGq84bhrlhRcLhG1zimagDP +PEY8kWw/Qtn2ZVFHgapWmGmBoNuh+6PskXAgTy7URJwCe6VPWkdPwlYwmoBkvr4B +rdGdlgDwsw0p+oP77KOuiaJdxl+9QhWIan0uUMGxykdOlr7ILCXzlN9Uy20H8lSX +0aCThiEPWhJXaRZNBTy+58mYss2d4iQB6sSXsSqr9gOh9N5lnB0KnHvprwLmJ/lv +87wh4dDezLaZrJfIOxg9KAkxcoMIoHMqAFBgDEXPPMGJ5bENHTlpAt2c6Z50sGeB +QRKvnvqvyzHXfPuTlIL3qMab8wr2rustf4+CfbOp/FO1JgQ= -----END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/scp.key b/configs/open5gs/tls/scp.key index a09c2acf4..f3e8b91c3 100644 --- a/configs/open5gs/tls/scp.key +++ b/configs/open5gs/tls/scp.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCd+FWyYugu1yEp -EHatKSl3EyE7BvMONSMZRZuJ7oJWMg1rHUCX+PrBjiPhOhPG9C1Q5FJY4eHEQ92U -2cvzJQQthByItcz9GUQ85egL/alVIQpEOW74j5r1Hn0Ket0rqODM3c4WwIqc7BAv -8xQ3Y7Yxys4ldes8Y86VqEfUIa/GMy1k+LdsMSVT/JTpYAHZFmDw1uvzwM/TzZid -MbobTAtOCGvkR8RYuMXh+LpgXKdnB23bqfH1vrCOEEUoOuOPRYi+F5RJYIDKTZYs -XLzROrpswgEuayY9hSDg3dYuCeySY27Np8WViUE4+QeZqbxa+VJZCgMTVQ3xAtYz -c5Eu7bbHAgMBAAECggEAFJLs2lxeYAddxsLhqgDT6THBILZxfna2OQrjTI4XRJGl -RL+dE432XrIcAy/0tnND2aa7AN9+b3jlSYcqNGMsTZ9IthdzeL1LMWFCHRmu7art -cuBGDzJo3KbZYz2IQ7DtglEbD8SI6RIns48FoYcnigmfWqqmdgmLtNsja8HtajM4 -nF9CZQvGkpM5DxXm5K6OigkZ9JKHkvw3a3uglH5uNTmf5UqMSktQQUks996lNlcF -ncjJeagOazWk5suG/fR8y7jrf2JrhcKwuYSg8jEFwf/ykAKuy0SNHU1TfF0ply9w -84HvMScv2nRsdB3cT0J2yfGhV1+y6S1tCkA1EhOWCQKBgQDY7V65kKaFJhyZDIrT -vZoJMCWfYAYe9It64LLuGl+K2b7HQWMa8AONy8PV1NPIoMzX+AKmfvo7Yt6WL4tW -lNdmQIcVPYnoPfGW+9si6ajByQuaLMYzFKXYsMmazNuIxgx/+4x7U4NJmtHxKhyW -izy8M0D2GY5wPQqKDYD5Ew2MDwKBgQC6bGsTVoUp3RyQfuH8zCCavOjJCk36pyYX -U7NToCNaDzA4j69NiDY3AQi4qjLN+qIuNh7WLi9VUubwaqiwVvzBiKe4AfVPlh2R -cOtXJZxCmZ0pcsSsMvv5JbQVLbmOTU5OVUBx1IosakXFyPbX0+HlRTCXQWV9/WGU -Rk1PvmZRyQKBgBApp3wmBfI3w7u3joR2RQrYNoVobyxRRi8ynMJW3rWGwcsw2QSB -y5H+E6pUAC+bo4eX6AKlxVk1ZaZFBpm930q0FhyECElwjBaWz14LkNJXe3DSUzYt -HKpHic3p45WORBIpGO97anXKfkf8vkKNP0o6e2Waw90i/y0IEor8W28LAoGBALQZ -nfBWu9tP5BKsogKp6i3Tp0jiDafD54bNtAdsQ/rzhXB/T6qll0rYUuakduSL6Dag -znW4tL3Hk5hcUo/Z2eHW9cFNEwNKUVJ7NsFAco/c+/pZCCwcLVXr2OhE/mi9wpLm -xZWy8bIrETEdD2w/JJNsnp7h7P0k1yp6KKKLnSoRAoGAEZOB+A1EGllcsEMX23jZ -SfECJntHZomP1GvstLvaQNlSC5lDmT6KO7Rw2RNEDJPyfelO/A17CICpDGU2NndC -hI4zzywqqsLfCaYpPz1CD/BzP4ugyXM8W/kP4w8hSlHdqgyNi+iWqeBzsrZXtHLT -4XJt75eQQ48u+NWkaQ4kLY4= +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCtxqzAaunIY9rv +7CNOf7sXz3luXOfxkkhBbmuHCMVZfD6yww8+Ch/wtF0ZR2AH4JTOS6Hu36IDfppg +BtW1TsjmY59v2Ee1jdE2BbbLdjSdGibfNO8byIgYc544P768tkK6Coa3sDj5Mz8m +GIauTyyxuSBD2AyW6fw8ue8iQ4HTfigT9F6OCdldu57k1IM5jKc8pU43NDhN39xC +m9vALjaZxTfx4dVQ4oP0Cn0iHpQrd+udJdYkpF4ITw9ZasJG8py37bqlB+E8Jpmw +wJ0054HboPol9eJSEzVB/aWQmkMx7t7NJaFwiDNnHbU72B/Ew3u6YllOYFbnshpY +i8WE1p5jAgMBAAECggEAKvoHn07Roo2Ph+aOlMtiKfFVxsWTV1smI4h7b1nr9MWV +fABhtKYsYAs7OxU72rbgFmT+F2WXW+Xjp/wIvl5NsSzSMYb7tRrtsr6XBpqlSHU/ +R9R/jg96GRH+/0pEkcdBmWEhECy06mySIYnPRSyvkQSHxj+YXXpgt2QEkCTB5tvU +COpxiasQqi7YbH0U6i7aMpcfbMVR2wipFaBLH5DLBm7pkMffM58ateCdV5Y7c7sp +GkMH1pdyJMOuOKS7Mv+6bUeX8AMeBdPEHQf9QnfJlAPmkEm15m6peAiFzr0iJ56t +gil1DHwcR+3Et9jHhYzLVmtczB/e6+AdxV0WvHU3gQKBgQDLgEiT+qmbTHXF2ACe +XnFi8y59g3aR6Lk2gLQudBitKyLXgSPrDiTZS4r334SiShFOXZnFNFkR8O2fYE0V +mtWlLSrKRzPW7062ZH5GePem8A5xxVoA1n52wpOF5rS0Ua8Myd3FxBTYrLhn386L +1J1GG2ud6wYgRrMQRNFVRUSZxQKBgQDam0bLBCPu4odCgX60+mI13ASObeqnpzI1 +EuDXgLaZ/0hpCZyOmLDN9aZjRFBbW5w9YjrpXPkG6Eify1PyjVyxFPbqbxdLG0hx +Duk4fvP2BufIgDGkk4RRuYHpuIH5ck4k49WEZKlMAcFX4oVrBlHqQt6sXBOIEfmU +emlg70ViBwKBgAcCHv3Bpy+q/W9X1gWeOQdwWoyGB4JU4nQHEK184BCuqJ+FWghR +T2GQYXPR5c51AI2TWaVZ/StKAdT4Sw9QasUqfgvDUfy39xz+7v5cUiMUp1qxsjzP +JkHOx6fX3ydKnN2y4glajGE96YfiREm6g8QTU6x3mJlp9ea8h/0IyqkFAoGBANhz +pR4BhH7VJ66PP+F8hd/kcVKBvTWxlEH+5kgbdzJ2FcGDNdPvlijokY56psI+rC4P +ZFuKpjzTpI0sK3vfwqbIJlAsHTlN02W2qPA6q96wKbJaVE0rj3nIH71G5tMR/hQC +z3ienw7WMhWOAiLdiCBXg9nP9brmaWQ97LeBUwbjAoGAeZfRoI+M9VCDHD/ijT+i +fWrz4lYu2qrH8M3MWOGolcCu59DLP3W0tLKGuYksYCHyFVCDWLMMfNjE4gxv/g3j +FRKA/ie00urp0UykWyqY9v9LzwUwiEttGP0wKykT4IobxtxSbkJ+Dd844O1sJCbW +x+bnT9xNAobxtS4kyGL1P3Q= -----END PRIVATE KEY----- diff --git a/configs/open5gs/tls/sepp1.crt b/configs/open5gs/tls/sepp1.crt new file mode 100644 index 000000000..8ea23c1be --- /dev/null +++ b/configs/open5gs/tls/sepp1.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDXTCCAkWgAwIBAgIBCDANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s +b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK +DAhOZW9QbGFuZTAeFw0yMzA5MzAyMjU5MDhaFw0zMzA5MjcyMjU5MDhaMEwxCzAJ +BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxGjAY +BgNVBAMMEXNlcHAxLmxvY2FsZG9tYWluMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAn3iXNzAoNRgi+tjJv1mlHqhmk2i7RNv9zaF8YxUrqLTS60CQNHL1 +2C4gfOdiDEM1CxkONS/amvMESZ1Y6EX2qTGMFVAKwKRA2I/RekSEYLDFmpXApCTS +YTxMP/SWGv/NPnoueOJxtx4GbCrqx/yra2KyPkwatFiL4+W7r3MC1vBu7KPVTapH +eDBDlFEdW7B4NgKkn2s9YhgtbfSrjttlzLAo8y5xZUEvTGPuvAmFtvyRQvL8IdPL +cuAD1iFlepjP+Ec+QioGl+Igu7h/V3BYkjDhTfwKTAcw30pdYF3r0ih18yKideC3 +Ewu1ZXgpcY/+TtOiAP4twbvlazvYjVnqFQIDAQABo00wSzAJBgNVHRMEAjAAMB0G +A1UdDgQWBBRbw2vCwmkly2RzHsK/FWJZi5o+jDAfBgNVHSMEGDAWgBTbFsJOP0T0 +drgS6txPEdYx+WbHfDANBgkqhkiG9w0BAQsFAAOCAQEAfg/NHhxSf2p4Jbu2aXWq +/Pfv1T+PwZWSMF7ikJ348Rw5FsVsAfIqe508jVIHaxQ78Ktu2/s7cIi2LkwEBVpH +v+3eeXOhAtJ+CdYh39iO84tg7WDShvUzo/ipELOk32kHppYDQkCLEhynQpcqKvP/ +WDHg0bovcLZrX9mZcsPJhISl9wut0EGQQ0rWtiv6Oxcei1D4dHJKlMD3l+4mEmd/ +R5Nxnt3/S/NHUfyKvRTwSRWElSrg3tCGa2vXPBbWIn5XPsXd/NL9DU5rofZqp4CD +L+q+xWnMeipT18TtLfxVuPf6/kiy/s/1iE2OsKxzyzbWYzOJmm8X5P0RRbi6TX+H +UQ== +-----END CERTIFICATE----- diff --git a/configs/open5gs/tls/sepp1.csr b/configs/open5gs/tls/sepp1.csr new file mode 100644 index 000000000..4b37943b3 --- /dev/null +++ b/configs/open5gs/tls/sepp1.csr @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICkTCCAXkCAQAwTDEaMBgGA1UEAwwRc2VwcDEubG9jYWxkb21haW4xCzAJBgNV +BAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCfeJc3MCg1GCL62Mm/WaUeqGaTaLtE +2/3NoXxjFSuotNLrQJA0cvXYLiB852IMQzULGQ41L9qa8wRJnVjoRfapMYwVUArA +pEDYj9F6RIRgsMWalcCkJNJhPEw/9JYa/80+ei544nG3HgZsKurH/KtrYrI+TBq0 +WIvj5buvcwLW8G7so9VNqkd4MEOUUR1bsHg2AqSfaz1iGC1t9KuO22XMsCjzLnFl +QS9MY+68CYW2/JFC8vwh08ty4APWIWV6mM/4Rz5CKgaX4iC7uH9XcFiSMOFN/ApM +BzDfSl1gXevSKHXzIqJ14LcTC7VleClxj/5O06IA/i3Bu+VrO9iNWeoVAgMBAAGg +ADANBgkqhkiG9w0BAQsFAAOCAQEALAzUdRb77/6ZWRAr7rFuuJWJP1EFzwzsM7LO +9x0Zc0X1pNJButZjV96lUeq9oi7Ewfez0CWa0gFB+3iQ3t8w/oJWRezaoYoogmle +bu6yPk6A9A+2HKaapw1NLKZEN5uc43NoS35dcbGGNp+49jqSKjzUvwNp+pBlpjDD +7d8lb6NxkgE3yDBhy67l+wJgl0hc3a2sndKYXwfEG6WYtlcQsYpNIYCFB8HFEzHB +5Vl//wUAkP7ruLw83BW1ivlWoe8IvkGL3hJa971GXV/xLhoFO0Jx2tF/Xpuh9KGx +itD7WWn2uPQUgQqyOF1HEyYHyyB9Sfqlo6aMLY3aeNd2anbDdQ== +-----END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/sepp1.key b/configs/open5gs/tls/sepp1.key new file mode 100644 index 000000000..455a76875 --- /dev/null +++ b/configs/open5gs/tls/sepp1.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCfeJc3MCg1GCL6 +2Mm/WaUeqGaTaLtE2/3NoXxjFSuotNLrQJA0cvXYLiB852IMQzULGQ41L9qa8wRJ +nVjoRfapMYwVUArApEDYj9F6RIRgsMWalcCkJNJhPEw/9JYa/80+ei544nG3HgZs +KurH/KtrYrI+TBq0WIvj5buvcwLW8G7so9VNqkd4MEOUUR1bsHg2AqSfaz1iGC1t +9KuO22XMsCjzLnFlQS9MY+68CYW2/JFC8vwh08ty4APWIWV6mM/4Rz5CKgaX4iC7 +uH9XcFiSMOFN/ApMBzDfSl1gXevSKHXzIqJ14LcTC7VleClxj/5O06IA/i3Bu+Vr +O9iNWeoVAgMBAAECggEACiO5wamPNOkG+FomYcNKa2ubsg27soImXhfBd+9VqlFt +A8ZEJQGWPhuYtzhjFJKFYeJC9ADJ7oY7JI8boxEnwNREquo+9Ma81Mg4MoT+wcMb +nVueNxGcStBxrLNZg/f1zd4o7EjBoDoJgIEuEm8vWxGYcbuXCxaCNohZ6arvaEkh +m9PSEEFhhx4Yo8vMKor6EVX8uZz8V9vYDceHIWttZhUsfljQQBU86qWNDKHGkkXs +ulzYr1ZOoqZgzhP/57D+GLY4g/xmol4cahMNgRV/hlWHRKR7pzLnGr8Y7uUsB50P +Ncs8TTro9+puEPLEAY4T6NAIVVlHoqo5YKftj1G24QKBgQDTg0N9R9CQ52G/k+/9 +rLgzot936tXQCf/pN18222gBlzHlUD+2NKl3VkZjNKYRogx33wRfembxCkFhrI1g +oLzkXSKiiPn3pb/Bgg1Z8plStzs6BOcgAqo96FE/BUmi2zsN0zC3JIiEmWbrTTlO +A0oIM0xllxdFg3y8veCfmdLYeQKBgQDBAy707GOWOFz/nZCdiwWAFg1chsVZYyRA +bWjcCbuWvRtRfSGQEZlwVc1zzb4Oxbezot4k95k2AtImSAAlTsa8/rW0OSmCFuNa +XEoLB6SMGe1iWEV9/v4THekajBkU4Xsl99yoI/4PSJgSz4RIFvgIe706fFs0bRGi +BNI1fugvfQKBgHC5AQvQbR/8oESIZBtupFComa4AEmkoGyHAZ9cFgV1vpaDPbtT9 +Jd+6tBKE6Yh2M2zjByKXSitlyshyPHplz6Vo2V+D3qwTwqkvVUw9lWbWzhKysDaI +FRCfMkWC3OaVLdjFV64TI0p/srDuW/7uk9Lg+/McXcOnOqAgFYkZYpwJAoGATPwU +EqTm49f/YAVc1TnKK9if47Ptq0WcBAafuIQ5SlqLNumOJYSfiuruU65QjFvYddIU +gPIxLhXZ9GLri/Xr1x5RI11ZbQXsEPKWpeeafjcpM/y5WxQGC2H2xBv1NRrqn65J +WNdiUn5GCdqzjH182QVh6J4JUtPeIJ2Dqsq/mZECgYBlrnKEq4/uaBtOlEgoCafR +vw5qGTRAIIPnYok8cP8OJ35U+TB0zggo/G+cgEJeen1ajBLW8d/LqI/B3e6XtxGR +DV4cT6hLra1oRsZKxuRrYPJFcRpIZlCldBDukNOe0BPLIZK6qayGVFreGbJ4VUhB +hFGewBvJ5cArp5jwWH/Rig== +-----END PRIVATE KEY----- diff --git a/configs/open5gs/tls/sepp2.crt b/configs/open5gs/tls/sepp2.crt new file mode 100644 index 000000000..c1ce8feea --- /dev/null +++ b/configs/open5gs/tls/sepp2.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDXTCCAkWgAwIBAgIBCTANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s +b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK +DAhOZW9QbGFuZTAeFw0yMzA5MzAyMjU5MDhaFw0zMzA5MjcyMjU5MDhaMEwxCzAJ +BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxGjAY +BgNVBAMMEXNlcHAyLmxvY2FsZG9tYWluMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEA5fNSoe2acQQKuitcJrp4ig3IRtunAzEqUzAVh0jGHr5JEDFA3hS9 +g8abjsgJdmzlaZnWLerHeahoNerOXBz9DjAZcU7xCjgrPpY+jI12p9PimmREq4mM +TGNTovi/V9dJbt8fRq35mwe8Tj+mc/iNiZjspCOXwBXc3djuyXfp9cPM0DZu+KbJ +kgx7R3ObjoFlV/BRM7nsLhp8uqaqXzZtB43aYalAmy/KP0xOCvrhTO3lSLe44gFz +Z4iLa9xIKiZlN1edNn4U4PqGwbgLoBXLKhpQosqrOFPiu6g1t4KHylAhrjf5IKgU +HLayMO5RtPDXnXcBAFWAhFXZ4rtW9w1bBQIDAQABo00wSzAJBgNVHRMEAjAAMB0G +A1UdDgQWBBS7tcA+yUHS0R3KjVZ7lE8d0vN1VDAfBgNVHSMEGDAWgBTbFsJOP0T0 +drgS6txPEdYx+WbHfDANBgkqhkiG9w0BAQsFAAOCAQEAFfz7DMZqfkX19zKsRBH6 +PsF3iUxwTLcaC//+Yv/Vdbp6EVknHdbqbSnKplphDMAwBRLncFb7a59m1Kbhceni +Uc1m1sWqCCfgIdOlABnCg+qo6g8bTeiOpSGic7K3KJiV0YQLoIPjtB9FwY6y34xl +EzRRl+FC8rFTTMGkducpAT2R1GDh5SDMVae8I4IOJUG6wPCN5RjsL+hiEkpmKJIi +G8HqlGTjCy0Sh5tIX7HyLoqkhtdRDM8wDz/4GWo0gbp1znrM0JQ7w3YLO0FUO651 +LFa+2gAj+47hnxfTSi6DvIaVmvz9GlGoqUBK+MBkynaSyAWIdfP5K4QsBbjgaXOA +Ww== +-----END CERTIFICATE----- diff --git a/configs/open5gs/tls/sepp2.csr b/configs/open5gs/tls/sepp2.csr new file mode 100644 index 000000000..7b4b21fd9 --- /dev/null +++ b/configs/open5gs/tls/sepp2.csr @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICkTCCAXkCAQAwTDEaMBgGA1UEAwwRc2VwcDIubG9jYWxkb21haW4xCzAJBgNV +BAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDl81Kh7ZpxBAq6K1wmuniKDchG26cD +MSpTMBWHSMYevkkQMUDeFL2DxpuOyAl2bOVpmdYt6sd5qGg16s5cHP0OMBlxTvEK +OCs+lj6MjXan0+KaZESriYxMY1Oi+L9X10lu3x9GrfmbB7xOP6Zz+I2JmOykI5fA +Fdzd2O7Jd+n1w8zQNm74psmSDHtHc5uOgWVX8FEzuewuGny6pqpfNm0HjdphqUCb +L8o/TE4K+uFM7eVIt7jiAXNniItr3EgqJmU3V502fhTg+obBuAugFcsqGlCiyqs4 +U+K7qDW3gofKUCGuN/kgqBQctrIw7lG08NeddwEAVYCEVdniu1b3DVsFAgMBAAGg +ADANBgkqhkiG9w0BAQsFAAOCAQEAoEwZVv6EuOlMv09FgLUu/77aUDF/NC4kPLME +SG4fxehfaQtt/zBYBujQAfOWQh0rKq1YBtgeIXIZ3P6pLkIq9+uUvQ0V0zL3vSVN +ZWXg7nalr370ydZTE2jIvkP1rrSU68lnu/ADcIkRXkChg+UeAUUZ5S+6rnjwawu3 +uRYjzR9gNTeNL5WnYxrTp+gPo2WZbmChQX5isUfdHp4xvr+UapZ4epmquCP2G6Ep +5F3X0zdywGEjLaQhWIG1XT9daDAE42BGb3IXVWeU8kqj4jixO4Z1oodHKHtz77L7 +aOZ9c144iKCMj3n4jhdVME5Kn0veTx8eMDSk+06f5cNRKtQWqA== +-----END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/sepp2.key b/configs/open5gs/tls/sepp2.key new file mode 100644 index 000000000..07c904d17 --- /dev/null +++ b/configs/open5gs/tls/sepp2.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDl81Kh7ZpxBAq6 +K1wmuniKDchG26cDMSpTMBWHSMYevkkQMUDeFL2DxpuOyAl2bOVpmdYt6sd5qGg1 +6s5cHP0OMBlxTvEKOCs+lj6MjXan0+KaZESriYxMY1Oi+L9X10lu3x9GrfmbB7xO +P6Zz+I2JmOykI5fAFdzd2O7Jd+n1w8zQNm74psmSDHtHc5uOgWVX8FEzuewuGny6 +pqpfNm0HjdphqUCbL8o/TE4K+uFM7eVIt7jiAXNniItr3EgqJmU3V502fhTg+obB +uAugFcsqGlCiyqs4U+K7qDW3gofKUCGuN/kgqBQctrIw7lG08NeddwEAVYCEVdni +u1b3DVsFAgMBAAECggEALnYkTVMGmEy2hSizKSEWr2A7BfQmMesqb94Aj5HY9AfD +F/o3rteWdix4LFiHLu4wSU67u5HbRZ3NFo3PrcVurQHzdhU69zNjq3TshPYlUiIq +AEN/q4AygJG2KbDkanF1pSkAdwW6cARXXCEYtwhywqlLMRv+8qEIPCvzjXIE6/LG +muLOXwahStXPVdI/X5DrxGkXavTZKA1zPN0MV2WctRsCG4kU8NTLix4HUYop1qj4 +nkZoJA3zk8XkWhOLa93B51u1moBXtYpTG/rkD13X0fz2V92OEdOPaSiV0MRVbPPM +NUCQ6fe9IVS9oVKn/MjfEWHoKSYSKtLg99WJeDuq2QKBgQD333Q6wY4WpVG8EAeF +jQOSKTAG8BNijxyxEfFfkYtjggCMIwJzl8R8VgbmZZFkHCSlQLR4IXx0f2elGaAz +hkfwoGyLPnvJrSOkreLVHWsTA3w0quVi51f8bfazb7kZnnJPSDm6WaJ5YVP6bC5J +YFsS28L1FCkLXXjYVjqdnIYOLQKBgQDtfW91oEp/tnwJqOKAGR7CV5lmkkWYj/j7 +HDEhGA1LSaKu/+r2wSk/IguYolVrSrSWcHUnWXgX55BJuenjJl8cJQRUR/EBlKXP +CxR21xNiKqwKsqSIjAiSkGkzLuNdzPUeny8U28NVpReynDzQnA+j+RZgjP+pincH +k5kNpiffOQKBgA9h05Gt30Zyfe8Aw6a7CISyf6N+lIViQjKO3X7DxnWnZKdNqOJJ +gc0Bfa4gkXQ39uI2cLyfv1xvZ5wsSe/InoBFRFcjyoTKdNLMY648BCAK8FNIY7HO +j3w/yrZ58W+wkIFxBvwUgeusaYy51+l/zEcQUjnpRV7KLyyltT+AriUFAoGBAKgm +Qf6kqVrXl+c2/nf4UUEEyQZI1qH4fi89fMOTxgXicx847+IaTdv3fQJrHdPDpy1F +Ho3n2RID0LOCwMkl5/2DcBdEgK2/085OaATkr0K4N+uzJK/RhlhPi0zEDBPkBEHU +L3+zQhCnvamm2aBSfvh4apGeA37FHRXuOVXiqSRxAoGAWAlEzJ/sVyEcjwogPGEN +OrrKzmPEmD9BEtthcV4RLOrAVjSnUvdbIJL0UNz6XCLvVN5Zc7Xg1zFEq7KXMMSU +gDaYiYNdM33l7Y9uoMb88bZ3fFlcUgSsWFkwXDxKJThd73c9u9wO/6Whka3qYOb3 +e/4WcRbqV/J3IJTzni48G70= +-----END PRIVATE KEY----- diff --git a/configs/open5gs/tls/sepp3.crt b/configs/open5gs/tls/sepp3.crt new file mode 100644 index 000000000..f011e6c6d --- /dev/null +++ b/configs/open5gs/tls/sepp3.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDXTCCAkWgAwIBAgIBCjANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s +b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK +DAhOZW9QbGFuZTAeFw0yMzA5MzAyMjU5MDhaFw0zMzA5MjcyMjU5MDhaMEwxCzAJ +BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxGjAY +BgNVBAMMEXNlcHAzLmxvY2FsZG9tYWluMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEA1oC3332RcSoq14WusOafHDsqBRgRqeaE5v4yeK5XMIwmViiIVQFG +YxWr+U+DpBiH4wWCFsqHkI7fTndaHJ9rPoDwAiSSAv8hfj7+KB8IADPJXwvYmYbY +wDAtFQrMjJgM95qjKnocP6JvgYcq5f33bd1tanXvWLowEGYP9fLKvY7JoCww1mve +MmnMgurNcOHfDsov4XNCLg790k4zpmcAo5PVnMdaT6tTrLUhqD16lVZrKTPDXzWT +BoDG45oeTDyJkV4iEid8FRje416gcgGTby2DE45dxte46TWw+cOe2AYBzhqsZqPG +p+YqU2Pu2imGJViE4qbFcfy2L0+pQXaihwIDAQABo00wSzAJBgNVHRMEAjAAMB0G +A1UdDgQWBBTG30WPdyWcDDZof4jJFxnjmbbzKDAfBgNVHSMEGDAWgBTbFsJOP0T0 +drgS6txPEdYx+WbHfDANBgkqhkiG9w0BAQsFAAOCAQEATMfIg3BaEv4sYPZd4/hc +kI1KRnPx7KjiUrWYqd3OZz0MqBpr7WMyLt+R4kSqB16fd1YpUwbPIDV7w/JAENZY +dFBqXD3uORvf00k48cSFjntLimu4nUHsY3zARK5hfpMfa5ojvvkEGqpvJwtAbyXG +Z64xFlowrwXOoyPBaHQEYWVtpbgqq+yRD6Btk+U6iiIwbzIJvp7k2XzLlefolzGi +V5YBnd3pUId2qYzm3RKNlAvPDpiKOv1fV9ExxXDxjkx/R1X/1FYLdFrEbDX8mCZB +YVebtWWyH7bdwKCa0YUAFhq2QkVxP2sPfAwNnEWmY/8FGWCIru3qwz/PpSkgk8WG +aw== +-----END CERTIFICATE----- diff --git a/configs/open5gs/tls/sepp3.csr b/configs/open5gs/tls/sepp3.csr new file mode 100644 index 000000000..188c0009f --- /dev/null +++ b/configs/open5gs/tls/sepp3.csr @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICkTCCAXkCAQAwTDEaMBgGA1UEAwwRc2VwcDMubG9jYWxkb21haW4xCzAJBgNV +BAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDWgLfffZFxKirXha6w5p8cOyoFGBGp +5oTm/jJ4rlcwjCZWKIhVAUZjFav5T4OkGIfjBYIWyoeQjt9Od1ocn2s+gPACJJIC +/yF+Pv4oHwgAM8lfC9iZhtjAMC0VCsyMmAz3mqMqehw/om+Bhyrl/fdt3W1qde9Y +ujAQZg/18sq9jsmgLDDWa94yacyC6s1w4d8Oyi/hc0IuDv3STjOmZwCjk9Wcx1pP +q1OstSGoPXqVVmspM8NfNZMGgMbjmh5MPImRXiISJ3wVGN7jXqByAZNvLYMTjl3G +17jpNbD5w57YBgHOGqxmo8an5ipTY+7aKYYlWITipsVx/LYvT6lBdqKHAgMBAAGg +ADANBgkqhkiG9w0BAQsFAAOCAQEAMTVgf7uBbHX5puA4U3JcDoAnGNVN12xxiNy8 +hwWxMbad+nLMmoXrs/zcQq/xLrr4tNZj5JWkZ8rGvlGVzcn/icI7QRcJXcDDYwFm +pPSjgTU+YBHdW+atn0TbqufbiIn4CEpw9qpKZWosAA/atw+lANpE1I1aPtvnWOBo +miBCCddfWEHFLrG4W9hdxj+7LYxGbL7K6YwoGm0Od5nwgBdiqus1FdR2Evt+QSBr +6wJ0LmUobxnjTD+wvESSXlrZgGED/LTRDAaHOFWniQDU3QSVQu3MjKS1JuNsQWYC +Uqu7lU37trU4wl3hSbZyEFIEJnGva8IFIaVdbdxYINrzWThfdw== +-----END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/sepp3.key b/configs/open5gs/tls/sepp3.key new file mode 100644 index 000000000..1769f8599 --- /dev/null +++ b/configs/open5gs/tls/sepp3.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDWgLfffZFxKirX +ha6w5p8cOyoFGBGp5oTm/jJ4rlcwjCZWKIhVAUZjFav5T4OkGIfjBYIWyoeQjt9O +d1ocn2s+gPACJJIC/yF+Pv4oHwgAM8lfC9iZhtjAMC0VCsyMmAz3mqMqehw/om+B +hyrl/fdt3W1qde9YujAQZg/18sq9jsmgLDDWa94yacyC6s1w4d8Oyi/hc0IuDv3S +TjOmZwCjk9Wcx1pPq1OstSGoPXqVVmspM8NfNZMGgMbjmh5MPImRXiISJ3wVGN7j +XqByAZNvLYMTjl3G17jpNbD5w57YBgHOGqxmo8an5ipTY+7aKYYlWITipsVx/LYv +T6lBdqKHAgMBAAECggEAPi933v9gxF10qSG02M0rMHyIfIyTRl2xhuQHzsvANC9V +R+IdUAN8G+qi/jaKk+6Wqn6kzaWucn6xB2b7hVPEPA0WR5DBkcPUOmzZstj4MVLS +HM9q3mtk+CafUzvbvCCyla/LgNuAyAP37qW4jo+3hS7N8zC4kFD98SsdknBuTVCJ +Bb33u7oy9BvH3R9tY4KYgByjWRQba+gTdhUjQPN/cCveJqEMqGC0N4FzjU+QCypm +3VsX7aeefjokB5hxpgDPFMPSPE1Ma6BmCcerhWEFzwWV5DrVUbP/tLNkOMidhyWP +jhHo5VYXRVzpb6iTnu+5EyI+DzrqBtKpaa/HEjJxpQKBgQDWiToSIrqgFzQyVknB +Kds+dvtLpnkkSVFdR8FQmXtdnB/D2TNdnkBH5ndLhRJ19pI+YnPZWKTWjaEGiNy7 +rS2gxJZqFo7KVOQwfM9218KMenis3kU8CNZlFtCQg7qPtEFbnX9Xh1U2pM2iCHVl +I9OM2L9N5A7KjyV/DAxLSXnvvQKBgQD/9djQ5nMxNR3m2zw4uO+E6h6EU3QF7Er/ +nl6Lj/V1/WeFTcx+S0eyEXHTRUapeNL7gwXhildBBLL10PYbj1kcGfDH4yJGVjb2 +f2+tJh6enMGLP3ErVBhPAkmFAIKhleRe/36O5RnUmHdwgpRTUvlAiBoxRLaCPIIE +D0kK+4DtkwKBgQDLZyAfwb2fu2BJuXYEJmMwPi7T8uo4dSsnfbjTajGE91lGntAM +mtXnVaMVfv2ZykWt0Dp2f40Jvw5E284sQm1YWAskWm7XdtVDA5LP4pEaD6QKglKy +MM7U2WS1H6/qP8UXz6PEoRMx098DGXH0ipswlvAKMYe0lTO/2PRvDSMHIQKBgQC1 +gxdFVRc9Pwi8bJ4xL1yTqh8IAdJWXPH2gc1UNTuBd7lQvBIXQbVPHrXUd90bU1Zz +C8BA6ATmU7nBPnU4qBguKGsqpPTqYjtJ5KdCZ7TxEALkh5Hugw1WAi42xlzcz9oK +UC7kkK0XqSOSQteCm2WskJfadnrispwU2u4WfrI4RwKBgQDRXWzuHOyOH3X1Q5SC +jtnu0C2EW3p59S82LQMnNlXMnG8Sy/cMIc3xN19+QOMICc/XHgkuB4wCkRQtklG2 +S4eQH2tVgzHgEM74xn3cbLaHcwLJW1Z6q4AR1M06SpaOBWHeQiMMWZDgwXQ2ClLW +GLjrCrbJR2OcYyJ7K2TzN3IveQ== +-----END PRIVATE KEY----- diff --git a/configs/open5gs/tls/smf.crt b/configs/open5gs/tls/smf.crt index 66d9f90fd..427e72caf 100644 --- a/configs/open5gs/tls/smf.crt +++ b/configs/open5gs/tls/smf.crt @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDWzCCAkOgAwIBAgIBCzANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s +MIIDWzCCAkOgAwIBAgIBDjANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK -DAhOZW9QbGFuZTAeFw0yMjExMTEyMzM3MjdaFw0zMjExMDgyMzM3MjdaMEoxCzAJ +DAhOZW9QbGFuZTAeFw0yMzA5MzAyMjU5MDlaFw0zMzA5MjcyMjU5MDlaMEoxCzAJ BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxGDAW BgNVBAMMD3NtZi5sb2NhbGRvbWFpbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAMrZsOPjIlGG8FptBo7fdxaEKusuBoQEfSV/8KoQovMca1yn3SEiFNdv -dDG2RusBCzZ6K/bjTieYpkUuTH5nTPQiz0MRM0ErlxUXKrosZ8aalRNajveq3fgR -K7pa1tnS4iEArMwtr1Fgj4jA5B48pOQrS5vmx8w5JCaPXJ9HPjTwdFubXSfMT9fT -qcP/E9Z13zfhDZ1TStz0hYIanQZlp2BTJJgZQJ5kJsdEsp5Ect+t3ZVwDxT90iFo -1X96dR/xf0DEKHxmybrahhmePvzEETgz03McVEUVBdQMMvDnqyXicLNzLJICY0Yw -KzGeAg9Lh3PVjUnx/ctGdp8BCJRRkS0CAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV -HQ4EFgQU6p4PokOU3iROPZzUmvS88xnI/QcwHwYDVR0jBBgwFoAUsWr6nJm8BCpC -iGXXfr5gcKIO2kAwDQYJKoZIhvcNAQELBQADggEBACpTSu1iB2ZWmTrR6zvnn57p -xuE7udN7M52yG58N5k+f9cwXwmvvo//VK5AkJLqc/qBERwOC1yUQPTotBq8K0dF7 -Gx+zyG7o24GjZYgJvqIADEE0pWLTN6GkkYTzYXQwfv9kPDpAWbXl2bsYoY8610ce -rRCQE7FkGuITR5mqKbJbvMSAwiH7gZ5yjjWXaUB1b6zzXiPOvME23IewgnddB3Ab -zkGqgYO2qCcelkE5ciFl75d+DovfMXQDU1qGV6s0NTEqIWy5BnYj2jKoJJp2zKfE -nOhyty5eh08CrH3PbYjmU5pNP7/ibG0oVJR5xLx5SWlPCbkEImcOwUH1cCoxEbU= +AQoCggEBAMj+kwsy6pZtuv8dHZ3oUXgA0DhdNg+nSu9G4TsoR3g26vEMOiF/bC9N +IUnoFKSjLCxIczxlBjOx3pXabw22USLppXnALqKPdpRWvrQPOnoHSkh1MJ0kXwqM +ZD7zExAYhglzvFA5Mne+K0+7tcZjQLtxZqZGkR/i7uCuD1JxWZSyoeVNSWrbuW3E +GSoGWk4Ph5GpkAS/i3pPCl8vhI1Zf31XoisrtiPQ057ap3fXs6VcBtxSoWunI4pF +H0qVMzftLb0xdS2wS4Aiw0nZHD5EVpWUXEKLDI2nQP9Z4/DQkIQyzXk17R2WIkIT +F/7gSHeWpWjVgrkYnGqoJ+p6qTQ7TuUCAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV +HQ4EFgQUkR2Bnli2ki/LRSIgmK/MRH42ZjYwHwYDVR0jBBgwFoAU2xbCTj9E9Ha4 +EurcTxHWMflmx3wwDQYJKoZIhvcNAQELBQADggEBANppO4boENRy8dUappDvxqO4 +l5kgGd4homCYXmac5zQl5E1hvJq5xUl07mHXsiWHee8d1LaIpf1HEnoRklSWIknp +mcE3FL0UVjQ5wVv/gDDaNIL2aiJUFYGPPTgQazL/mIT0TDZaq99qpoyIe+nn2Dfj +eOHiDGGLAdjfjs69+kuyFYgkFg6kYqYPL+osHS7NXP7ZCQDK/SJNeR3hBnBl0sZv +4b5xv6tDRQAJWfK21QRE1CO3TAUmNbQD6h2kwEGvJuzeO0lrmzBmIyv24mXEme+b +RHzUziPKizdUokMOu+SxO3EovJnXpMwoYnhjelFNItKpHtATcyaCjeHsUykpIHc= -----END CERTIFICATE----- diff --git a/configs/open5gs/tls/smf.csr b/configs/open5gs/tls/smf.csr index ace7d3fed..f8728b5c1 100644 --- a/configs/open5gs/tls/smf.csr +++ b/configs/open5gs/tls/smf.csr @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE REQUEST----- MIICjzCCAXcCAQAwSjEYMBYGA1UEAwwPc21mLmxvY2FsZG9tYWluMQswCQYDVQQG EwJLTzEOMAwGA1UECAwFU2VvdWwxETAPBgNVBAoMCE5lb1BsYW5lMIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAytmw4+MiUYbwWm0Gjt93FoQq6y4GhAR9 -JX/wqhCi8xxrXKfdISIU1290MbZG6wELNnor9uNOJ5imRS5MfmdM9CLPQxEzQSuX -FRcquixnxpqVE1qO96rd+BErulrW2dLiIQCszC2vUWCPiMDkHjyk5CtLm+bHzDkk -Jo9cn0c+NPB0W5tdJ8xP19Opw/8T1nXfN+ENnVNK3PSFghqdBmWnYFMkmBlAnmQm -x0SynkRy363dlXAPFP3SIWjVf3p1H/F/QMQofGbJutqGGZ4+/MQRODPTcxxURRUF -1Awy8OerJeJws3MskgJjRjArMZ4CD0uHc9WNSfH9y0Z2nwEIlFGRLQIDAQABoAAw -DQYJKoZIhvcNAQELBQADggEBAL883rfAD6ZTH1sxq7vdKax9V7R01o8b7IdQcV7M -nwZx0wIH4ZGef6LwUXfWa07X8DxlySPxiMwRitkKWtJ1D63AgsfUhi9UOHj6IWjW -skMVn/uczTq7eIZIjICftHVVvYd7HteMYxDLrLwWCSCE8P+UIE23eHrY391QOXjY -J3OUXb2kvNK2snEvAL3h+tULePFsUqZix08c+L2DtjFmb2xAia/jte3Qii8nj3et -9fw6Xl2yjM/fJ+pTwPXlmALvfzSxCFyBLdMAkuB/DeXeMsAEB6Z8S25lFEA3H6CD -F27mGEVKeSrH2c9O24N34vToOZ1PM5rU9dEVD71Zj107sG4= +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyP6TCzLqlm26/x0dnehReADQOF02D6dK +70bhOyhHeDbq8Qw6IX9sL00hSegUpKMsLEhzPGUGM7HeldpvDbZRIumlecAuoo92 +lFa+tA86egdKSHUwnSRfCoxkPvMTEBiGCXO8UDkyd74rT7u1xmNAu3FmpkaRH+Lu +4K4PUnFZlLKh5U1Jatu5bcQZKgZaTg+HkamQBL+Lek8KXy+EjVl/fVeiKyu2I9DT +ntqnd9ezpVwG3FKha6cjikUfSpUzN+0tvTF1LbBLgCLDSdkcPkRWlZRcQosMjadA +/1nj8NCQhDLNeTXtHZYiQhMX/uBId5alaNWCuRicaqgn6nqpNDtO5QIDAQABoAAw +DQYJKoZIhvcNAQELBQADggEBALKq0FB/aKNZGi4LTQHQLmDavBKGE2lKc4e/GPDt +xBehYoQQBy1wAYdZjNb8y3jRFPKQVudRkWIcdWZQQhHK7OdQ8NDKtfQTjvWfq0gU +i/NJwvmrKVW9EqdVfYU2CIyJOWAugISTcAzTzVNuaAAevStHjDMsTiFSF7zPpvx5 +ytnYwjdDcsv3qItvssl9L5zyT94SxntSy2/X/cSNJixRA3FoejPHjXYaMf2Rn9Tx +vh5lNYB5jyBtXwy6N9N4JZ8xYc7a4ddglS9V9jNNgSpVhrtiWGlhUb1ZOhtHjS2V +PQ24F+COeQ0RHFhsL66wAZLw/rngcd11RX9GA99TJyQ9QqE= -----END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/smf.key b/configs/open5gs/tls/smf.key index b2df6cd54..ce802ecba 100644 --- a/configs/open5gs/tls/smf.key +++ b/configs/open5gs/tls/smf.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDK2bDj4yJRhvBa -bQaO33cWhCrrLgaEBH0lf/CqEKLzHGtcp90hIhTXb3QxtkbrAQs2eiv2404nmKZF -Lkx+Z0z0Is9DETNBK5cVFyq6LGfGmpUTWo73qt34ESu6WtbZ0uIhAKzMLa9RYI+I -wOQePKTkK0ub5sfMOSQmj1yfRz408HRbm10nzE/X06nD/xPWdd834Q2dU0rc9IWC -Gp0GZadgUySYGUCeZCbHRLKeRHLfrd2VcA8U/dIhaNV/enUf8X9AxCh8Zsm62oYZ -nj78xBE4M9NzHFRFFQXUDDLw56sl4nCzcyySAmNGMCsxngIPS4dz1Y1J8f3LRnaf -AQiUUZEtAgMBAAECggEADlqgK0gPziAT0vpDDAohFa1Nki3EFURyDJzEjWw286gP -qtNQEP+l5ObEnJ3u38NHpVe407Qa/C9PmLahgBJUPjRWYUMO0u5ANyRYCCuLPmEC -6ocudbUYFu00IHA8ItbK3JX9JEeZT9Na5Mztd3xIGMM9iu8mNTvX5Iihf73dV4aK -AtD1L5fCGckEJ0Va/xLta0sjdxLSYMIzacIpn9gdK7DXf9DL/eTACrf1U2ZAMQRr -plKeri4OFBjMBy68kdpPF5ZyQwj1Plx6E2Dm0eNzsdF1zSkP75BYbi3OaIJR77Xk -jp9lQvkP74e2ItzYJn9sGWhwAW2AiQt1zn+7v5eGEQKBgQDSajh8jMvFt93GgCqR -OTGR2s4k4jp2XvcEWnJJax3ksqiGHMhlvCQDV/39saTcLUvc+bymtMc5Tws2ewaS -LstUeBh/GrEMn8tQH7TXns+rq62I+CwSYzYqu2/uHBHkk1nXrTBxQ4LE/l4a6ZyT -eVHr/x4iy9KMF3WhTBJytQJfFQKBgQD2y+7s1Hh7r+THSgo1CBZRtlw0CuA5EOgM -iuglkU2cbx8q/XdXb9u6sLfldHGu3E18TYUJqPTrc3PVSEEA948qJ527PZh3VxRg -L64M7gt+g1MqyZvuRYzTZOMBcJNJpfJSnP4mPY+o2L7mNpAS2Twe2K9/zuIWyChy -g6xbVw4vuQKBgQCOGWQKYP9giHqCip20s35RdQYQjKNUu29whjB2epuWjj0XTSrc -4cEkbPE/ug+PDhwUoKeRobaFcmctJMpcQLPaWLyaYgk9cFDazH7RuxOeaPNp88e3 -pz62fxzpHhXLWuOqrvBvHVub8/jTjf7K7XywtvrAHwwSxekPxBMVWj6+vQKBgHWS -H4d5jNA3skByeDxdVuykeHZefAUTlchr4D4NY7DTi0CasWDZLA9bIrBP8dyAnPVL -pMY+VDdar+L6YeVJCk3lw5GwvVKVDGLqM/t658TkYRlwJDW1smn+lNpZvAEI6lEK -81RaXXbtkrvvYGFqVebICYtUjoaV4hbzvYdiCKMZAoGBAIFv6AMnXaWHoO4Qpnch -FCSBNckhzajPmmZ1fskWR95d9ArmrJUaA0KKMqno767zVkrDzm2fw4+q12Ba1xRe -J2KW1M12IPfZtNwSfQPYs4wej0VGScbOWve9qpA3WrLv08W63MXz7XRpeg5ZnzG/ -3bZZLfqZIBdQR9/f9ibP1h98 +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDI/pMLMuqWbbr/ +HR2d6FF4ANA4XTYPp0rvRuE7KEd4NurxDDohf2wvTSFJ6BSkoywsSHM8ZQYzsd6V +2m8NtlEi6aV5wC6ij3aUVr60Dzp6B0pIdTCdJF8KjGQ+8xMQGIYJc7xQOTJ3vitP +u7XGY0C7cWamRpEf4u7grg9ScVmUsqHlTUlq27ltxBkqBlpOD4eRqZAEv4t6Twpf +L4SNWX99V6IrK7Yj0NOe2qd317OlXAbcUqFrpyOKRR9KlTM37S29MXUtsEuAIsNJ +2Rw+RFaVlFxCiwyNp0D/WePw0JCEMs15Ne0dliJCExf+4Eh3lqVo1YK5GJxqqCfq +eqk0O07lAgMBAAECggEAJU469KUqrWkIgDljOd/Y3zEndI64bgda/TZmr5g2S7XF +vZ/LWlRQPCdQumr9CeHPXRjFarxFfmrRKXc1jZH9VUGQmRx2i22dUMMY+kqpS+T2 +gKRftYr+qPKN2LE9JIuotTBqD2nOWDNPzqjEgGIDrcbKiqomXYi9Va544ZBwVAzP +VVf+3RdXc3dQP8Z+R8tT8850uefWzLSu1aQYGy3rNjmY2OfEjN/1Ejq34v2sxc93 +2tpCzRObGjwvTRHWjVzNiOreeqDYIk8VmAJ1K2bqFDWl1f856sWnfEElFRpr1jvW +UDxOXc7dylo+CpNGukdVn9gznunX+hkGlduWXYtSgQKBgQD0sSHfFDfrOHMRiMRl +fLwOR5XrnvdQkEadxjLbyGUQiXXTV3SuBIzVFpIpV/49vKe7QHC+XMWLRMDy7doP +n8PyRUmydmEScWm5cb/p4rbq/h1Z0QyTOMS9olQj4GVLnvXyXm3eILSA97ipmIcd +fxlB38H0TXlgh9zYrn6xywJGjQKBgQDSSHjGaV3BBEORCRTgD4Daieu6ciUnNDV4 +wVVEWsH1IxdzsELUKvTSSlQ71igXopMtK4m2dIYAB7241kRdcd8XJj1NlhJM8UZ3 +uMgFBzMPmSd/dlqys8SUqjRxjvTN2N6kzh62TH4M2bdG0RB9mwDiapBTmGBfaYy/ +Th87/whfuQKBgFBwClpzIw7IN8uD0kwqfQeUsMwMLfDl/NDQ3tcxQUf2aC1ZipnK +FSHXkaTVsFZLNjhwLp/lj2sA5wz088I/GwMBlAB+udp+PesgYZ5ZURhfAPcNqbyb +5NESE+bXVXVOhDtwn11uEuhyhtn5sjEYHw1wqSnObiA1iXwRoMSBn/XhAoGBALd1 +hPFN0f7o0m4B51WIERoZBDFZDrMCaLherB6Ds/5DzF0hZVyn0Yp6UL0XnUjpjM/2 +0SH+zT3PgyV0wpZoF4Oh2BANow+/3IPtEYzZeCHes8gPoReRoSs2x6RfXZMN50kP +j1nqqHpbo/vDwEhlaEMhR6O3KDV159aruLJmUY75AoGALu0xLCdoEFU387exq2Rv +7xWnimJVeSXyGIlMUVfYPCbxYlcyUlQIoM7EZVTXbVmKW9o/x2Tl8OO7nE6wSpWM +EOMea8Y3quiq6JY2RsYuPba7A8vCbnH2+rk3/NTEAl0EQQXSwG6vPI8d1RiTUPzV +33AmOLaUPVmzDe5OUzD6J0I= -----END PRIVATE KEY----- diff --git a/configs/open5gs/tls/testclient.crt b/configs/open5gs/tls/testclient.crt deleted file mode 100644 index 482bfc7ab..000000000 --- a/configs/open5gs/tls/testclient.crt +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDYjCCAkqgAwIBAgIBDzANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s -b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK -DAhOZW9QbGFuZTAeFw0yMjExMTEyMzM3MjhaFw0zMjExMDgyMzM3MjhaMFExCzAJ -BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxHzAd -BgNVBAMMFnRlc3RjbGllbnQubG9jYWxkb21haW4wggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQC/2SPBDa9KE9rRuKHp2ZNNm8X+Jgl34tocbcYiWm3I7+je -NPOiUIB6TpuP0gkwbzfhqbRdO59EmAsGjtjonwC2mTxDLWflfAUVUEGUml3b9ESf -ZUtMWh1qBBme99DL9kqqNWaXVL9xAX/yLWbdXxfc/+Zuc3j/uRVOzqGLROqfw/k7 -iKmfZvBjVrtxR/xyRa3LfjuTPnM30UA7sk0jrZH9feOCEbNeYGa12TloDh05RzU9 -RgkBL1AH7Zvha3iNlXwQLkgEpnJEeegQ/iS9pPEwgqsquBRoQTClzVGzbs5Ttpzi -ZL5q/Hf7sGE2x00v3XKNDvUPg9k7RvVZoG/fUy+VAgMBAAGjTTBLMAkGA1UdEwQC -MAAwHQYDVR0OBBYEFEegxvp7oDrpJfd4LDD4LSGouPVnMB8GA1UdIwQYMBaAFLFq -+pyZvAQqQohl136+YHCiDtpAMA0GCSqGSIb3DQEBCwUAA4IBAQAPDVSwdX8u25Pd -a7UNANFAf87AurQKsaeLpKu1AfZZakgu+XQ9W/5fJXCSvuVc3g+JAwxVKZfO3yae -C7vcLSughlUGbjJyVV4wn9xzbKISWwAXmBEt+pP+vJAcyCyRD2uXZjO89sCFxHmD -/Oh84m/ygiUAx+u2to55HPjNTZs9wphdyDws1lPUwxj01B84r6QPgTKBpnhOAr96 -xUYNZKAt1ycRXcoi7RNieEZP/r0j92RVA57twMGSDHpCgb7YnCXAS9ptlpHySbOK -akfqFx04eVilqKGee4NeM4rt7363Fr61H+bjkYjvS//ZS/L5ZrbNAMWmkr94Xkcj -m1BG0Bwg ------END CERTIFICATE----- diff --git a/configs/open5gs/tls/testclient.csr b/configs/open5gs/tls/testclient.csr deleted file mode 100644 index 18eb9b4bd..000000000 --- a/configs/open5gs/tls/testclient.csr +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIICljCCAX4CAQAwUTEfMB0GA1UEAwwWdGVzdGNsaWVudC5sb2NhbGRvbWFpbjEL -MAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQKDAhOZW9QbGFuZTCC -ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL/ZI8ENr0oT2tG4oenZk02b -xf4mCXfi2hxtxiJabcjv6N4086JQgHpOm4/SCTBvN+GptF07n0SYCwaO2OifALaZ -PEMtZ+V8BRVQQZSaXdv0RJ9lS0xaHWoEGZ730Mv2Sqo1ZpdUv3EBf/ItZt1fF9z/ -5m5zeP+5FU7OoYtE6p/D+TuIqZ9m8GNWu3FH/HJFrct+O5M+czfRQDuyTSOtkf19 -44IRs15gZrXZOWgOHTlHNT1GCQEvUAftm+FreI2VfBAuSASmckR56BD+JL2k8TCC -qyq4FGhBMKXNUbNuzlO2nOJkvmr8d/uwYTbHTS/dco0O9Q+D2TtG9Vmgb99TL5UC -AwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQAdqoupSBRB+iFdX3ULgt1sTfqxio9d -X2avV8mhQt8Ivrgw3/+iggz0y54JS+yL+tfzFu2upxmeemnImkKremt/zwQDhKJC -2yLtDBDCWIwrdQyoC8V5irUEZNwFjZn/VrZty7lFsAA46HOXPysPJuYEXMQ1JYoV -VB7N7JdfaFDGDLe7lKsOA/zK3QF1yRvFqdaNyeVP7SZ68K6JzzuP1eakp6BO0pBF -X8xQc3LlMcMSP+G+IjN5LFp+gRMpxv6BkLHFn3ahN9aUPOJb4np/uEg5Mo6fT+gc -qNW1NZ9ZkYPWfTV7SmgWfar+tKXjG7TQyLQfTDqMD+VbSZtWQFGLp5T5 ------END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/testclient.key b/configs/open5gs/tls/testclient.key deleted file mode 100644 index b94d56a87..000000000 --- a/configs/open5gs/tls/testclient.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC/2SPBDa9KE9rR -uKHp2ZNNm8X+Jgl34tocbcYiWm3I7+jeNPOiUIB6TpuP0gkwbzfhqbRdO59EmAsG -jtjonwC2mTxDLWflfAUVUEGUml3b9ESfZUtMWh1qBBme99DL9kqqNWaXVL9xAX/y -LWbdXxfc/+Zuc3j/uRVOzqGLROqfw/k7iKmfZvBjVrtxR/xyRa3LfjuTPnM30UA7 -sk0jrZH9feOCEbNeYGa12TloDh05RzU9RgkBL1AH7Zvha3iNlXwQLkgEpnJEeegQ -/iS9pPEwgqsquBRoQTClzVGzbs5TtpziZL5q/Hf7sGE2x00v3XKNDvUPg9k7RvVZ -oG/fUy+VAgMBAAECggEABEzMuJsYKp/4d7AR+aYYX1+xB8yDSfuHbyYwZUeOGOLJ -tHtO2lHqw0hc7mkN2YGl/hSZ7Ty0yeqM1WGLxTuqc4Kf6hM2i4X6A4Yy5hlcpl1a -prue56/zDf6CstWz9B0J2OKisUcjawLBLaTXXqRZlP5BBF4/CspI9Y/Q6Uh1ks2d -dkGob3+leeDCLtggVbIE7FqdjmLI4gD9cVYvH39cTvFd3uXYRyjDtGUdbAH5MYsy -/ji8Y7ZkR+Phas0xYiJBRSKIxsdZzDDRbVDaQJM8DgUOQawtE7aQs+s8+rddR0xH -WFdQIM51vTNYENVA0BzNY3Es7roBDaeaZbD53y30kQKBgQDLDq2c5OuxS66NaHGH -UShytecC9ugeKYVALzDen/CM7Wvf/3hJw/bXrzEm+FO0h/Xz7rHBtSfOzwHbQmM/ -FZ4TxGohDhPgqR0bP0vqR9sKE9Kc4K2eRjjncd7wiVBstHMKZysyD3IQtNDJqzqw -umVFyVy1lWBGLXM+l0IuTjNwRQKBgQDx3kse4lkIxYCFW+ZjJtUs2DzyOy0Ga7BD -UkRw/tbyzD7kzj3xp9MJAeUz8vaZ+zcqQgjsfhmLMbflCuuNdREWLA17Cpejekmf -nTu8hxpEEvtESkj0aq55iessUpfLxdPZepKfz/UkDNa+mJus4QILDp/tUnGSvGIA -v0DV8AT/EQKBgCSR6SyXgec1ZSNsiv2+3RUDs64x/43nFmt/1EJT9cO7wrDd1rEa -TOt9TtHg6VpbHi2ncHYdhSTW3VO6uhsTbpvKxP5dBbFxY5+Tn7164XUIKuc8A6i8 -puTv+iHB6S0atplKCVqDs5xUpEGdx/0qJLET2dGOLH+XEelU3oNubA8tAoGAbqs7 -Diede5D7LIoPUcD7+6f5wxBmmrB9l2A2JsnESpZAFOt1lnQm8NEoMevzACPdav2K -HcPZJkKalTe47iHpro57oJgJKGkU9O653Zqn3wwcYnPnC8cgjEYaEE6+XCPpunIG -Uw+RaGxjehRT7veJust3S9zUUMLXyOW54eoQLzECgYBBTcFVoDIqJY5MSOuQTYri -lro7YcXk0kvahCSgXzdecU+ajG6+ppHvIje/h7nBZizFfsGsZQj3j9hrmxXxJn4H -4gSLHSycFGY65G6tBC4eNKi6umBi8rgw+kQ0PtY23ZDoRTdePXYT4OzQaGiGzZhO -4su2WwkXmgev/Rcan3hj1w== ------END PRIVATE KEY----- diff --git a/configs/open5gs/tls/testserver.crt b/configs/open5gs/tls/testserver.crt deleted file mode 100644 index ab389a785..000000000 --- a/configs/open5gs/tls/testserver.crt +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDYjCCAkqgAwIBAgIBDjANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s -b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK -DAhOZW9QbGFuZTAeFw0yMjExMTEyMzM3MjhaFw0zMjExMDgyMzM3MjhaMFExCzAJ -BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxHzAd -BgNVBAMMFnRlc3RzZXJ2ZXIubG9jYWxkb21haW4wggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQDK/mRxA7vFDetSR7J58pT+deCpXdjH6rFyebKsPRklq6aq -P8eLMj3CYG641BHNFoMygnK1SEuPXxoLqVYFOf1aZh+9OdvLPjKB37ZfikzXR5az -PRvGKOO9bM+lgviZvmgnE2sEVYtoBJAeK+ZXQkPUQ+Q3QBsdyZXFKu4uQZukW7UO -sp+IGQ5guCi+MAkppB/T6WbuTl7Hr7wjLd/eFK5rHik57D0N1f1fX7G5+K1jfFu9 -OsVYDsp3f7LB1QjZntAfE7dnddmAXdDz3FCPm7keLSrdsYSY9Q5tVqBl5yRzMcq2 -C4DQX7JcqWCfpGjm8Gnc4gmDyKV4zZPaQXiXr6TzAgMBAAGjTTBLMAkGA1UdEwQC -MAAwHQYDVR0OBBYEFNNWx1Ixb8nBttAAziCdNf5iUfGCMB8GA1UdIwQYMBaAFLFq -+pyZvAQqQohl136+YHCiDtpAMA0GCSqGSIb3DQEBCwUAA4IBAQDeFTLtNW8hPvUB -QOBVZU4kyzOw3v7Y74lug88I92XMagWVV71lLGCzHcQodI7p0ih/3uK9CO+yuhU9 -Wkmimb3oh44wao6+R9qtYF/OdbKLvRZ9y3Fd5y5RiYJNFCuBPLGf/0UwIifP0tcI -bivpNkB5WByebbhzo7zZXz+pgMMDkLtBfvwNF9JYM6WAdEw/3cYaN6jwtwvA9/2O -wQ08z1BtuA0Cxjy+7DgFl9b7EQE4q85+TNCyl59x0vO2M9lo01C/APQ8HmCRc8Ax -YCY7zYz5AqnO3HPnQ6plYbIw1xaLEwNYDZ6sxIpCRP+g+ZDG6A3YW76n019lEm75 -02901MR9 ------END CERTIFICATE----- diff --git a/configs/open5gs/tls/testserver.csr b/configs/open5gs/tls/testserver.csr deleted file mode 100644 index 35b14091e..000000000 --- a/configs/open5gs/tls/testserver.csr +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN CERTIFICATE REQUEST----- -MIICljCCAX4CAQAwUTEfMB0GA1UEAwwWdGVzdHNlcnZlci5sb2NhbGRvbWFpbjEL -MAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQKDAhOZW9QbGFuZTCC -ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMr+ZHEDu8UN61JHsnnylP51 -4Kld2MfqsXJ5sqw9GSWrpqo/x4syPcJgbrjUEc0WgzKCcrVIS49fGgupVgU5/Vpm -H70528s+MoHftl+KTNdHlrM9G8Yo471sz6WC+Jm+aCcTawRVi2gEkB4r5ldCQ9RD -5DdAGx3JlcUq7i5Bm6RbtQ6yn4gZDmC4KL4wCSmkH9PpZu5OXsevvCMt394Urmse -KTnsPQ3V/V9fsbn4rWN8W706xVgOynd/ssHVCNme0B8Tt2d12YBd0PPcUI+buR4t -Kt2xhJj1Dm1WoGXnJHMxyrYLgNBfslypYJ+kaObwadziCYPIpXjNk9pBeJevpPMC -AwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQACkHItCrvQWANviVk27ntZE/Ze1/NF -W8jPeJG3V9Zemwp2QWE530gdhNy717kGJzW0Udvx57By4tS1bORlKDL7ikpPaIm3 -q2YLXzusJ3JXyD2aYoaY+uP6+gt1541aLep8eSQPgG0jJlo8VbbsrPrXj9T15Nsb -MhDlKDLZhW+JCwp53/IB8Az3s6oCUelwENOTDkmuaksTbo9NX9TJ68ByAtSqroT3 -/jHqvSpD+VVnQcWn6XE6lLNyXcFcQ/jQLKLVbdV+CLPrUORNCyB5Vy7Qxm49g4lB -H9Cx2fPDBpYw7BlFIrNU9bxLAem2lE2x+H5NbbFoMfi8Bq3q+2MWZg+a ------END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/testserver.key b/configs/open5gs/tls/testserver.key deleted file mode 100644 index cbfeacaf6..000000000 --- a/configs/open5gs/tls/testserver.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDK/mRxA7vFDetS -R7J58pT+deCpXdjH6rFyebKsPRklq6aqP8eLMj3CYG641BHNFoMygnK1SEuPXxoL -qVYFOf1aZh+9OdvLPjKB37ZfikzXR5azPRvGKOO9bM+lgviZvmgnE2sEVYtoBJAe -K+ZXQkPUQ+Q3QBsdyZXFKu4uQZukW7UOsp+IGQ5guCi+MAkppB/T6WbuTl7Hr7wj -Ld/eFK5rHik57D0N1f1fX7G5+K1jfFu9OsVYDsp3f7LB1QjZntAfE7dnddmAXdDz -3FCPm7keLSrdsYSY9Q5tVqBl5yRzMcq2C4DQX7JcqWCfpGjm8Gnc4gmDyKV4zZPa -QXiXr6TzAgMBAAECggEAGwG1EkDJaAJIkcCpMvE+YmEDcUpjj4F0Ie36rVCkT683 -yW8ag189TpGELuyZVlxNkILrc56OiEts9yqMdRM4gkuToxoXWcHIzXTv2g6Cgk0W -HyWc/tms0aRa4e3RWP8MnfpG4s47cazTEbiMeNp/lLYtntjVYrqm8D2cb6SvP4fu -kvi7bKLhcd4l9v42oZKF5wZjynUEh+424TNxqI8OTcnT15xoOjauM9aQnbFYB0ON -tOJ5cO8Pmjbo1wfFsSntC7NrIspaTrlseOl/bK3LadLlb9UHW3GRVwIcIzEYPabU -PZcTKjzk1nAu1fpHgoCuMequxDaXSSWyDLMqwLfqoQKBgQDtcOHFJHO63SIOrwlG -OjZiMxKekjVqtbdiN+7h3FBR0+M7EZnyFO7zsfmDaN3k4m3a6idlnn9HvsEilf+K -Cc+8I0dCeBbZOs/TqVN8ZHB6MqUmtMdGIc1Fau1HYis+d4g1pbQ9tpG0OVa806rR -AkBwD+/Vm6+8uZKilq+oijSpEwKBgQDa3Dt9LFYOG6gnWHlq7uLIWnA4wHKmgEGL -AykaZgW2bxIhQa1C+460OQaCwBbBG2NlN7Lt8MXsr48epnSKROfCYIBuqlH3i2CN -ka+W7pEtnkeEnZSUMb/IF5T868xbYkzXFqJkr17o2MBMbLiM2G79dT/j83MJVc1A -FecQByNwoQKBgArrdBai9IeVf+l49045gyLFAog0ZSyBKuvjcqMEhNUej4a56oCN -oeenObhnbD0IhNDaj/FGdsgP58X1bAknJlyaqr5N048t+zzavrIr1FhqV9oN2lRJ -Xa1hm4P66c43pRYChuWHre/B61FH0sVF+zysHvWN8WkWh73efDmeEYntAoGAMcq1 -Bg9WLLOCGCF6zic3FRnuOhseel7ninbXnRfk6NJwL3y/rGOK3dmzb3/ALYLLpDV9 -0cBbZzOxvelkzihLCd/mmEbLiyP8fXjNl+sCwHwoDTXEncqLtTwYO0pyHcBJdw3B -OGLlltfpN/nsKq764VMRjAzQ+Si6H4BcJztYhsECgYEAnql7JlJlg/jUOS3hU/sM -iZ1EY7K8DFjaIOitcPcjbZqH4Ha9922MSGW4hCKMo3ncDdaDKDvrfYd9pgtrSvHd -vH1vXcVrdzuLPVzvCxlRxQbSZpK6RZT+OF1OTvg9zMu2hemMwyKNxrRmjADwuU/E -f7etkEMnboFO//fGoMXU5cc= ------END PRIVATE KEY----- diff --git a/configs/open5gs/tls/udm.crt b/configs/open5gs/tls/udm.crt index 3e7845a93..bc41afb17 100644 --- a/configs/open5gs/tls/udm.crt +++ b/configs/open5gs/tls/udm.crt @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDWzCCAkOgAwIBAgIBDDANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s +MIIDWzCCAkOgAwIBAgIBDzANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK -DAhOZW9QbGFuZTAeFw0yMjExMTEyMzM3MjdaFw0zMjExMDgyMzM3MjdaMEoxCzAJ +DAhOZW9QbGFuZTAeFw0yMzA5MzAyMjU5MDlaFw0zMzA5MjcyMjU5MDlaMEoxCzAJ BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxGDAW BgNVBAMMD3VkbS5sb2NhbGRvbWFpbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAMnNHwgMDlTfi2x5QMvhdhGzOxCZvboqcrkHrTGkRJtUrxNjddjhSkm3 -KeRKEdcDq/t126t2CAxiYiRprKr9II1o6rq2JUZz7VU0aC9wWnZyWhIf4VIzyhz5 -G5s5cWT7IoJZ/cjmoS89e5cPv34G0jLaqz2m/Kl2zqmVozQRdDuO7Hreh9KgPs92 -kqA6XYy1z+hxUILAjpdVoTwgJm0UchF9Ibgc5+ab1XuaaYzxlYAzwcWcCibFzgGO -I6+MdTpJISJBHRzkLOsmFyJ2XpH53aRPN51yQDRnPTDfJj4og6FyFWjtIfCeBHBf -3taz6SPFPHIZhR8OIMt25T4r2bXmS68CAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV -HQ4EFgQUfzKzBycjEgN97TEqC+0iKaWBdVIwHwYDVR0jBBgwFoAUsWr6nJm8BCpC -iGXXfr5gcKIO2kAwDQYJKoZIhvcNAQELBQADggEBACQXPgeUMGyWGbGPwr/cg0lC -SPiIL1s7oZQoNisbTtTqnBHo36xLTGb051o9ZTwd2xTRNJ4ue9/rDnMTK//9+6V5 -FKDOYFqikSmCtzuJFB5Q24KxdUM679feAy7v7BWTGd7LoN0dOgPCHqPT7/daxgYW -Xaip1lslx5TYNTnhrJAoVfj0VGrSrTqQqCNf3ifQDI0HRuheKC2WM6Ep7E8MyjiT -kzfsznaWul06geQn7vT4MMTHUNUI49Y2uCCgosD8Xi23Oi8qSiguCeSLcg2ns0p6 -eELtPm1xcTWoJHomDNf150ZW5swFDfE9asAWGeYqONShUp5Zim1agcuGTpp9uaQ= +AQoCggEBANLitMimOGWgBh6udtzne7MGyj34uNxgyEkjavoX7ribuGJXs0gN98uH +1G6GbAQtXnI7OF0PoKFA6aMx3S7IO14alkNv+JzQ88HeLGiog8QhBFWpWWQYO98m +j5HYwJkt6K0jJA6HWjj5lD8kVzKWaSPG1nGtDHMoi8GT6ZWXkoJSJItl+r41p0kt +mS2bkr4DQ0Zd6m6/3syc2gecgUKKSACdI7yR1+HK9V/bh40akOyncZoyglW9ETRP +hcXwHK0fqNrklpPeus+ojVr3MkIIsHS7NojMbztfvEAqMW3Qz5P36N3Sf5UuI29j +VkSNUtI4J36MDYuMdJlc52+buyWsI9kCAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV +HQ4EFgQUcCwMBOvMLHoStj5qd8ry4/MW1MswHwYDVR0jBBgwFoAU2xbCTj9E9Ha4 +EurcTxHWMflmx3wwDQYJKoZIhvcNAQELBQADggEBAKpXKgmNrn7usCa8JKCeN0HZ +4fpPpniEo04YelmEzUPu/ajv99D1C+UiHeFNWywi5f9E8q4gxMUWIQjMfdWH2YqH +3yCA9OBJoOVTImDPY6HafTL7CcykEXkcix9Oe1IsU5/U2elRL/Qpp1LSJ4YlH11Y +JsFhOZ/bkiLROmxOohgtzRSUTMCz6Flsg/gP5Xr0d0elPunzzx1MdxsRtwstKxUa +OQl2nP30MS6Hn1rEii9o1L+nVYNoyu1oC5o9ulVrxyF0dphYJg8NRJc5OtOBOnBb +1eUJPYasFIYygJK9QzuH2CIbaULpZLNM+WQgC+L/tccMTT1Qd6JqEVehph4M9Mg= -----END CERTIFICATE----- diff --git a/configs/open5gs/tls/udm.csr b/configs/open5gs/tls/udm.csr index 1c11859b4..4385a2e77 100644 --- a/configs/open5gs/tls/udm.csr +++ b/configs/open5gs/tls/udm.csr @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE REQUEST----- MIICjzCCAXcCAQAwSjEYMBYGA1UEAwwPdWRtLmxvY2FsZG9tYWluMQswCQYDVQQG EwJLTzEOMAwGA1UECAwFU2VvdWwxETAPBgNVBAoMCE5lb1BsYW5lMIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyc0fCAwOVN+LbHlAy+F2EbM7EJm9uipy -uQetMaREm1SvE2N12OFKSbcp5EoR1wOr+3Xbq3YIDGJiJGmsqv0gjWjqurYlRnPt -VTRoL3BadnJaEh/hUjPKHPkbmzlxZPsigln9yOahLz17lw+/fgbSMtqrPab8qXbO -qZWjNBF0O47set6H0qA+z3aSoDpdjLXP6HFQgsCOl1WhPCAmbRRyEX0huBzn5pvV -e5ppjPGVgDPBxZwKJsXOAY4jr4x1OkkhIkEdHOQs6yYXInZekfndpE83nXJANGc9 -MN8mPiiDoXIVaO0h8J4EcF/e1rPpI8U8chmFHw4gy3blPivZteZLrwIDAQABoAAw -DQYJKoZIhvcNAQELBQADggEBAMN+RIzcc2m7iImxiGpwIitwP8l7XLVYdZhMm90/ -SEDHmmlxebl8Re/nrt/17xKTH7xM+vjvWqieal6MT476Ye3cvk/obR7mv6f5UPoq -nmOCr9Ov3SaUy0WKEqEShs171NM6+DOLoXaN8oBWYkL8mGL4tP7lKcBTmNlM5Vuu -Y42XzLa2NO4nkm3cVTJma/hvMw9zNDwbBeH7qgfWDAL4LAC9Ea6RrYgLvgEiiJHm -J6CkrntvPfemwMguWtt3Roq0MkR3J4vyHgyfIHpJIEM1GLJhXSaEZ3cUPELrIyVs -ro8vAXGEXaxriKCCQ0BWiCPUN08Tisc9k5AKEe8Yst2M2Qg= +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0uK0yKY4ZaAGHq523Od7swbKPfi43GDI +SSNq+hfuuJu4YlezSA33y4fUboZsBC1ecjs4XQ+goUDpozHdLsg7XhqWQ2/4nNDz +wd4saKiDxCEEValZZBg73yaPkdjAmS3orSMkDodaOPmUPyRXMpZpI8bWca0McyiL +wZPplZeSglIki2X6vjWnSS2ZLZuSvgNDRl3qbr/ezJzaB5yBQopIAJ0jvJHX4cr1 +X9uHjRqQ7KdxmjKCVb0RNE+FxfAcrR+o2uSWk966z6iNWvcyQgiwdLs2iMxvO1+8 +QCoxbdDPk/fo3dJ/lS4jb2NWRI1S0jgnfowNi4x0mVznb5u7Jawj2QIDAQABoAAw +DQYJKoZIhvcNAQELBQADggEBAJ0FYp8aKECvYf2+6K6pz7Om92oQdqf88J7h23u6 +TZAEt2+rkWJbSPlUdQJ5FTpCM//V4DVtj3MoX5LRmuo4t++3eEcxFnNiD/SN+ac4 +cxNjqAvOFmPDYGhP3+rxVNKJEa/STphjmGKxbeRMNOhZAv1cB/djHJrVprkaszpH +aIwQRRf2GKGKpuo5e6ZWt1sqjdHiGbUTZ9ZN4AszjRGaUigFlANJOPdLkm+zk6Is +Gr2S5OwSWtorNnJ4jxQAX7eUzlfKFdB6UOMc7KCS1PeLP6SQwIokFQR8vp5dPra8 +oUii6YmavQ0I7rEh08MF4ogSzG8RPxa2krKnBz7fH9AWqSI= -----END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/udm.key b/configs/open5gs/tls/udm.key index 0280c4205..77ddb0df9 100644 --- a/configs/open5gs/tls/udm.key +++ b/configs/open5gs/tls/udm.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDJzR8IDA5U34ts -eUDL4XYRszsQmb26KnK5B60xpESbVK8TY3XY4UpJtynkShHXA6v7ddurdggMYmIk -aayq/SCNaOq6tiVGc+1VNGgvcFp2cloSH+FSM8oc+RubOXFk+yKCWf3I5qEvPXuX -D79+BtIy2qs9pvypds6plaM0EXQ7jux63ofSoD7PdpKgOl2Mtc/ocVCCwI6XVaE8 -ICZtFHIRfSG4HOfmm9V7mmmM8ZWAM8HFnAomxc4BjiOvjHU6SSEiQR0c5CzrJhci -dl6R+d2kTzedckA0Zz0w3yY+KIOhchVo7SHwngRwX97Ws+kjxTxyGYUfDiDLduU+ -K9m15kuvAgMBAAECggEAGPA7bIAo6T4y+bXGVyvGrotKulN1ieMjCFC1i5P0UonV -lPzOnH3C83cqOycYK00t3MaE3hyZBAbIgB17FCpx8mfL0kUeOCWtZ8ExOuOUmlyp -WuILs1/pE0mJqtYfeE48xoUegsxVkQP1GQb+MDHhmh1B2j2frcWb5oMyhwW9KnrX -8yoMUq0J41keGbM4nd6hYY/0mqQL4BffJd/UdLOGL5SupAYTzyELuycktMBbt8EG -CIlIOsd5ZfD5aLHiM0ZUGnK7URQBIpf//tBw6SBeYmc02CmfaLvqRLvnH9oE47/9 -0vFLDGifUY9vRuX4rBlghmy+/jzCBMRW6Rlbj8LyGQKBgQDb2UXmQ7NiMAuNTb2+ -4498QIi1ReQyyg1ONtMoZ9vXc9CwtFVdLk6JTru2VRvXIwpCWHZGsS9vWtuIk+1p -QqZYT8lRqX4TEDIjC4MG2XdGCnox4FuKPqyjESwd0O45xqfv45Nbx2NAsNOgm/xg -oJULFMuVVHMztOcH+6fQamRJxQKBgQDq/B++VMDoXnYyNmhxfSR0NPfeQuCkHlXo -kfX2cve27yI9mLKXKtNKtwlAAdhSGZ9Hbe2B1mINLpqajKUuoyD0eyNPzZGWiINH -7BM+oxIMbzRo+o2a7Eyaa12RLJ1b2O2wOPriddwa0ycx3BqTy2mzgRvSzoA9fAPY -6mHAXp164wKBgE6YJSIFj+qJLIgOg8frSE9uLrFHVCZID2uns+NdBb3HXJLfVSkj -tdXmfLrZQEOv9inzwAzTqRaRD6yK3bPkrN0jYOA9zKF6B8J5ihT3x2kVs8uC3pbU -gxkkuXXLTG8BMuZSoEqORFBLJszjFt1gawf0Hje7YhfZE0LKV5rtff7VAoGAMIMg -opCoytBFopQs99EYJ42P5qjz663/mmYX22tczL2N2h2eMSs8N96V4EsBN+HmSj7d -m8KAt6v5axLCP2CaOx746U7NUcCZKc4JIxNTdJG4xjuD5IoIPpEP3hrR2dZtK8Z3 -tS0T5c3V96szKXQDPHXZIqpTO15RBQVObQKbjHUCgYEAo6smzS8yppgd4zQaPkIK -7gRdfvIxXwcmWeVG5GeFIHmSpBsdPVgcwhbsdHoFWLBu1kU4pXsi6Mm8RQqW8GQv -TqLtQg+8UZwOUcZpwK3ubEJpPst8meVfi5KPQYgeqNHcBjOhllQWobdI1Zh6i76r -BDBpY0brm19iZHspDFURjjY= +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDS4rTIpjhloAYe +rnbc53uzBso9+LjcYMhJI2r6F+64m7hiV7NIDffLh9RuhmwELV5yOzhdD6ChQOmj +Md0uyDteGpZDb/ic0PPB3ixoqIPEIQRVqVlkGDvfJo+R2MCZLeitIyQOh1o4+ZQ/ +JFcylmkjxtZxrQxzKIvBk+mVl5KCUiSLZfq+NadJLZktm5K+A0NGXepuv97MnNoH +nIFCikgAnSO8kdfhyvVf24eNGpDsp3GaMoJVvRE0T4XF8BytH6ja5JaT3rrPqI1a +9zJCCLB0uzaIzG87X7xAKjFt0M+T9+jd0n+VLiNvY1ZEjVLSOCd+jA2LjHSZXOdv +m7slrCPZAgMBAAECggEADBpdQEfD5Fc5CrE+GqMBZy6sVD6uU12NmR76gIR3m6o6 +PJCmdivxDQIMZ9R4pgu5iCpMa5DeSerpDcfqlwkAWUAC4DdwqAVY/AcletMzDsJL +VqQ7wGIgq4exxS/Qq+nl2OvzoY7Ul4EBaFdMVtepjJdYjtkc5g4NaUx1IzP6AVcd +WPkMOHbD4pfHpx/z4P+iN5eJe+12RyaUWkVsX1N9Mq6wzEsnc3Bahou5krw+LiIx +d3uQ6lhYlL7E46TfhlWi05z4N0fz7QlEePg4gaPAWjjVLMe1GSPrQYyMx/8/1n91 +MKFuQ7CvIWa7Gv52m938a0GGJi+NY9pOXzdfEQ6txQKBgQDgv+FY8CFieljzKX+S +5QLFLg3LzSac0aGWp1KoQacrD6mvMueGsriyYP0P3rYNEw0rnqOoENIdeYSWAQ+W +2x4cKmZsIY0hlChiLC0wpdKpRb5pUnwgtl+rq66kIF4822i4Ubyq0YmWT/vuErtF +xadZ+h89r/+Maq2L8LUC6XloTQKBgQDwNVQOajcpPDrYN/c+02cmbqIHFYNCcvw/ +91WYf04944iDbXCMqgXB9LpIwT3PbL7MkHFE9pO8Kt4ntI7ngog796YlqkWJlCxD +md9LYeXikVeanfa+qa9Mdcy2BIiV5y3UmxW4GgjagP95oygo91uTUwyyeXEQcqHM +NKVCInQvvQKBgQC8PZpV7pJXtBfKWoiilTNzyXX+q65ajG4mC7D8gjispWq+9gjb +VdfCd9+dKjEa1EkkrrNuMeB6lWwKY4sWFCKs/opYqOVXKYuFZnDXHRxLcMHh3xde +IsIQvDQC/aVQnYihULyP6f6uKgHdTk0STFE12HvQJBgLGNKQsiQ58ykfxQKBgFNS +XEbnxxyRnOPVffkYAabOJ3wHlVFea2uQ0usj9bL4Eylrs+fHLloaFugXx+YElaaF +0BSY56QUxpzFP/DEUZdjjwlvp9FSSYxlepQ+cCyIN/gVJTr7xyfhkNHufqZo23ft +F7qVpU6OApBh7RNQwj43R6c9AuAuszsPY+et5dmNAoGAZ67iJ3KonU7Gf6xVA5Ol +PRM3Jo3VnXbOf78t7yD/bzaFy2P8kBP5ExnmzbZR1crFL+MQJMe6XBe4KbOTAE4p +uAMIRbQrVQIqo9WSKC4bC4QGfT5A/f25My1LhuRKFRcvAHNP0OmNjntn7fyBj4e9 +BXjb3+IuXEhj4Xm/wqq4pY8= -----END PRIVATE KEY----- diff --git a/configs/open5gs/tls/udr.crt b/configs/open5gs/tls/udr.crt index 7e8229f50..88e3b43b6 100644 --- a/configs/open5gs/tls/udr.crt +++ b/configs/open5gs/tls/udr.crt @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDWzCCAkOgAwIBAgIBDTANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s +MIIDWzCCAkOgAwIBAgIBEDANBgkqhkiG9w0BAQsFADBJMRcwFQYDVQQDDA5jYS5s b2NhbGRvbWFpbjELMAkGA1UEBhMCS08xDjAMBgNVBAgMBVNlb3VsMREwDwYDVQQK -DAhOZW9QbGFuZTAeFw0yMjExMTEyMzM3MjhaFw0zMjExMDgyMzM3MjhaMEoxCzAJ +DAhOZW9QbGFuZTAeFw0yMzA5MzAyMjU5MTBaFw0zMzA5MjcyMjU5MTBaMEoxCzAJ BgNVBAYTAktPMQ4wDAYDVQQIDAVTZW91bDERMA8GA1UECgwITmVvUGxhbmUxGDAW BgNVBAMMD3Vkci5sb2NhbGRvbWFpbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBALS3q+2uJj5htQxIoV5PjCbuUbETFbWunNBpU3n/bs5wtcl1jf/Ez8f+ -4nhN+liNHvInFyxflA9Qu2eL9/+HbZxMXlyFwcHZo82SMa+CQEoFcZQUxtPa7Zo0 -WovYJJH+XMqdFFPMQgq3VRsRkbSJJIRID0Lx1jx3RSIMMCcWTOyrGgIDOySSkNGo -8CuJ3VzsH5Httj1crrZhypGrY4rgoYO2gsc9KtI4r3hS7hHTjD1C3lDLKJj035Xu -t8g0rDe4S5DqKJ7WF+z7nIplVuVmj6HWFhW8H16fxNMohmjkHMLL7QIkyCZOYkWY -rbymCPQGYuBRKajTAoI80yj237vxiFkCAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV -HQ4EFgQUoc0vMqJQ773qf3xn5qGb3YTTtDUwHwYDVR0jBBgwFoAUsWr6nJm8BCpC -iGXXfr5gcKIO2kAwDQYJKoZIhvcNAQELBQADggEBAFbO+6lgHIhX9tcNDspiO/2d -BwBVruQuslYNVmKN53IS+Dr1fku49/WDo5WVd59JVV5OStLdXMZoj6103ie12GQ0 -2fTelMDLk/GRBv80OpD8vPnUKRI/uNDjGjAgle6ruMX7LZHmPfoIM4s1yIfYMEOt -R9F6BmZbRAPQX6OgHsTp6+uaCRIk6nBVJP+eIdVU+IAON7gzJIsiJesm78u+Jmvm -SdOkSsoW/mHgoDtC5EgwMHYOfuHZPPBZOa5HOFvQPhi7lgFNUVUim2iNBxYoDecF -J2i3J07fE7mvETfmfiTUfWPqGHSJG9C8zuKvHRWW0rky9Vjjcux69QyUANnyYZU= +AQoCggEBAM7pdrLI+qyDPBBx6p7EEUJCve9/6hX3fc3ITpKHhoGUlQhBV+gzR1Su +JxhjuU7PqLhnhr3OMM+Nl+vkIBvALgYSYghh4P9t9osOhHvXTQard0ItZf2EFoyE +JvgytNXiRYGqu6qTtB/47/pAYUu9sEh0zUeWEzCycUEYeCjZOpt7l72dXAO54vCe +5qdGdZr5WnOnbukmu0LdYuEc/e0rBAT0pQYTSAiTCRCyxPSVqfBuZqhGZyDywX4A +0sCtIoyEx67yjNuvp23CmV42H7nlj+TkyMN5F0IilmkHtgCMJuqNUtXrUE50KhDY +Wemqlc8mY0unOawaW5+eTBLttjycuI0CAwEAAaNNMEswCQYDVR0TBAIwADAdBgNV +HQ4EFgQUTY8Bt61zuoOFOYaQv4vkvmlq7HUwHwYDVR0jBBgwFoAU2xbCTj9E9Ha4 +EurcTxHWMflmx3wwDQYJKoZIhvcNAQELBQADggEBAMDsV3o5iIugZmuVOpJ1cdzp +qyhk+Kr9PAdwODAJ6EBHgWUUkrArYHW0UT4oeK3jEYzlnN256rcZ9MU9XdspV06i +R9NpQEqEEYJ5eqSg2GU9BDT7+uBYiCm4DvWxruWRi9D1JS1qEyerrbSwg+/4f53i +figMumHHXK/kbB0jlk82izqjDzEoj/wxVuqSqynsfZ/Xoc+GNSMoLjBWK5e1BlZu +409Q6eUIm4YcEQiPCImUM9YFakLu2NiD4D0NApS8vR+tTceQ1pU4qs8IaVhtPeMR +Y9PLxAXUhL2hNOreZqOav2ocUMeW1/0fSCKUnEUJIun0Clj6Rqb09dCPKvozJWE= -----END CERTIFICATE----- diff --git a/configs/open5gs/tls/udr.csr b/configs/open5gs/tls/udr.csr index ae6a90a09..15f527634 100644 --- a/configs/open5gs/tls/udr.csr +++ b/configs/open5gs/tls/udr.csr @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE REQUEST----- MIICjzCCAXcCAQAwSjEYMBYGA1UEAwwPdWRyLmxvY2FsZG9tYWluMQswCQYDVQQG EwJLTzEOMAwGA1UECAwFU2VvdWwxETAPBgNVBAoMCE5lb1BsYW5lMIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtLer7a4mPmG1DEihXk+MJu5RsRMVta6c -0GlTef9uznC1yXWN/8TPx/7ieE36WI0e8icXLF+UD1C7Z4v3/4dtnExeXIXBwdmj -zZIxr4JASgVxlBTG09rtmjRai9gkkf5cyp0UU8xCCrdVGxGRtIkkhEgPQvHWPHdF -IgwwJxZM7KsaAgM7JJKQ0ajwK4ndXOwfke22PVyutmHKkatjiuChg7aCxz0q0jiv -eFLuEdOMPULeUMsomPTfle63yDSsN7hLkOoontYX7PucimVW5WaPodYWFbwfXp/E -0yiGaOQcwsvtAiTIJk5iRZitvKYI9AZi4FEpqNMCgjzTKPbfu/GIWQIDAQABoAAw -DQYJKoZIhvcNAQELBQADggEBAHSvfRFofc40z1H15RtNFs1aISVznyWYueOMcxlN -kJ6V6SzEhGhDCssGfP3o4/ruO/EKtj01YXJOQHfdU/tNv2ukDlJTOLXx7f3CTrOZ -U28esxISCbfrMcjHUe46cRc4fO6wW1GyZAB4engShdQLzTCPi+EMp6sodQt1aVV1 -wCs2t7FI35gXoxydTn/AGzW86nmy61XHNHxhSZPAH1cE+ynfN6PI1ApCX71HgsyN -3bWt1D+hFQ4Q1t0p2W2x3jyXS/1O/7Uxr7Og8Zwvziwb+WvZRSed1dyaR/kdo7pW -aMLhY/WGaSYY72mV+fXAhhwVW7A0u8EvrRmzpu/pjonsoVE= +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzul2ssj6rIM8EHHqnsQRQkK973/qFfd9 +zchOkoeGgZSVCEFX6DNHVK4nGGO5Ts+ouGeGvc4wz42X6+QgG8AuBhJiCGHg/232 +iw6Ee9dNBqt3Qi1l/YQWjIQm+DK01eJFgaq7qpO0H/jv+kBhS72wSHTNR5YTMLJx +QRh4KNk6m3uXvZ1cA7ni8J7mp0Z1mvlac6du6Sa7Qt1i4Rz97SsEBPSlBhNICJMJ +ELLE9JWp8G5mqEZnIPLBfgDSwK0ijITHrvKM26+nbcKZXjYfueWP5OTIw3kXQiKW +aQe2AIwm6o1S1etQTnQqENhZ6aqVzyZjS6c5rBpbn55MEu22PJy4jQIDAQABoAAw +DQYJKoZIhvcNAQELBQADggEBADX9e+307cmp0VSsmO15eT7Z8Jb83N3V1eRsUnbw +cl4FoYub8xXwvbj82mB/psFkZCcAcBtnp+d8rKx0FhdHX9rKakp/LaCIBtYNM+Wp +9zToJZnGtWNFQH3SkZtgRU/vC1EAkNSeF4wcHE2C7y9Sklk3ENZ/7uNUeGhsT83B +zTkACstKHYusd14JOCDBaMggdhDr1zXVEtSot6X3cofvKlj+hy+kPZT6JjAU+NiC +DaS/kqnj2sRusklRL2gDoK/CQfCA33ZrvbEMDFu13v56dg+F1ZAoIir1T7NnCB8g +4zEpYlt4z1g/EpnzO12kkzVieLXYhbzYgnG6w7n7tm+F4Rc= -----END CERTIFICATE REQUEST----- diff --git a/configs/open5gs/tls/udr.key b/configs/open5gs/tls/udr.key index c6fe8e1ba..ce970523c 100644 --- a/configs/open5gs/tls/udr.key +++ b/configs/open5gs/tls/udr.key @@ -1,28 +1,28 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC0t6vtriY+YbUM -SKFeT4wm7lGxExW1rpzQaVN5/27OcLXJdY3/xM/H/uJ4TfpYjR7yJxcsX5QPULtn -i/f/h22cTF5chcHB2aPNkjGvgkBKBXGUFMbT2u2aNFqL2CSR/lzKnRRTzEIKt1Ub -EZG0iSSESA9C8dY8d0UiDDAnFkzsqxoCAzskkpDRqPArid1c7B+R7bY9XK62YcqR -q2OK4KGDtoLHPSrSOK94Uu4R04w9Qt5QyyiY9N+V7rfINKw3uEuQ6iie1hfs+5yK -ZVblZo+h1hYVvB9en8TTKIZo5BzCy+0CJMgmTmJFmK28pgj0BmLgUSmo0wKCPNMo -9t+78YhZAgMBAAECggEADdVR7jKSl5uZ1OAB5zLaYPgE7ZOvCZ5dP1hSpR/sAtYu -miZbGWkeuRnOCuS4LTtXMzTSEanazu3QfJmCoS8kES7o2bb86QpwfxnJ3xwOsQPX -6PyKqDilz7QierovuXOxtWo+/jegVgro0za98yZ80rnj3i1eJ3h/RJ8PeAx9VK/W -nsE/aoR/AiNmdwyZRStVdsvW98GNdONc8la2Cs9fC71tbeKnL/QFSmgZpVGz606u -Y3ykNxPgcePFscS+6UR+ML5L34HtZfQV4KCAnEWUO1tXYoLDKM+h7sp03rNoGdQK -/L3xNd1jI0gcm/t0LFhBuKGrKo1pKwrONwm6LMbRkQKBgQDAep8a46jKwQbbVNnp -qSxy9l3it/TjbYuLSAuRlz8YXaJSvF/EMmTYtYQ1G4T2exkBN11UeP/tdywD+J/p -4jEI9UZz9QCjXFyleDZZfScs7SuRfKlZ6ygY+cbKb8T75rO/J/StU4VgNPtKjxzv -OZEpJwCLsZLkOj7mmqlfwSwaiQKBgQDwW2P9XF2XkcoGyEffQDX0qylekUZ8Zqq9 -UnuWmjLJxD+rbJcQiyMIKxzY5gKw1FtquBMKryfuKHiDRCTO/Sr5V4VjRG13etAN -WqPWUrjmvlutMZhvwS876wS15hyHkL9Jjbj6F0TvYRIMXTa6yLFMLVNBZFSJzfRH -aRxnfb9LUQKBgF2S/4i+BxBTGTdGIA6lrTNSrMAM+KQcXIvhAabNJeJ9mu2oINKs -QTTNwjFjaJe/rp9VwCzSCnHyztY7Z9r3mSkmvRKgmKfSvkO/loSZAJOp1dWMCnTp -ivvhapB+GADy3o3fKeedxCjKeSR9QO7YSMb97Bj9wlDsNCo+JHul2QApAoGAb5/B -3BRdUtreHDA/UKsdY7dpywVk2rlDahE4XETYeWOuvgn8Ti6P4mdDSmfnr/+vROyf -y0J1JOGetjebcJWas5m11NgejnJ21PzXQd3BCUg2g0SZKq1pJkaLNX7cmQjcDWjI -Ez1jQliubReNJ0m1LU+PbrsNl8ISRGfITTfU80ECgYEAjzlKdEB0GUyDev9yuJWb -xLPgbtQmIFJ0wcr55R1BrLlOw5nhJvHYUuAqNVwbZyDOcZT6RdC2k1uyybAupPFF -ZRFFBnGQGGXj2fiPvFyJCVcbT6QhtkvXqBRwbRakJY1FMWCw079VzcoRtt+mcgFu -u179+NNjjTx63C4ZElNl654= +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDO6XayyPqsgzwQ +ceqexBFCQr3vf+oV933NyE6Sh4aBlJUIQVfoM0dUricYY7lOz6i4Z4a9zjDPjZfr +5CAbwC4GEmIIYeD/bfaLDoR7100Gq3dCLWX9hBaMhCb4MrTV4kWBqruqk7Qf+O/6 +QGFLvbBIdM1HlhMwsnFBGHgo2Tqbe5e9nVwDueLwnuanRnWa+Vpzp27pJrtC3WLh +HP3tKwQE9KUGE0gIkwkQssT0lanwbmaoRmcg8sF+ANLArSKMhMeu8ozbr6dtwple +Nh+55Y/k5MjDeRdCIpZpB7YAjCbqjVLV61BOdCoQ2FnpqpXPJmNLpzmsGlufnkwS +7bY8nLiNAgMBAAECggEAH0g4OCT/ExxfNRxH7Lt3YYVuKlq0NSB/DmDRkkE3onko +hAA/Dl3MU77lrcAL+OCX4VNTkXguNH7zgEgz24Y1Xxkh5aMIrY1+N/1YpdGB9Xdw +dxqegBLbhuCG9MDTyr9kI0vBBjPBCJFuFK9tllImJ/oyu/cyTQs5aK5OolxfSjjC +Y3WrKaAQry9y64SUr5MwJLuZeUfM8RfApH9pcgVVMSxC8dXfVb9RrblWHYAniNeO +qoAc5H4ZJw8Q7Q/uiAej3lulNlugwsRnAcjIC3tt3OBUqjkW32F4g0wxq27sHWAR +6dxz9uOw3HZ/aeI3InbgnnKXU8hJEx58tcTAmmYWWQKBgQDyZadBQbSsvCotDiOb +I8/60pkRdz2bbaHhevGXGlwQsdJ2uZ+yjn0sdxceper4EwKmxUjWqIdUbmsYbUUU +fncZ1OO7/0+Ibff3OS9eUKBvVdHuOAb11MehY1/pRGtZ5p07C8py1ylW79abvVtG +zxRKWHjWFLPTOYpvlY1FUPymuQKBgQDahgVYYM10Lnii9z27SFd3uWa47+Q49K11 +zgHbbYbDQTd6//jafbR/JxqwKXEIMxTOwsiqbW0brtoMQHVqrN6PuCjHwNFjPnfP +5AnrI0CVeFn2cN2nzM0qhhEWKr2azMIQLq0+CTqXsyHFZcmWpEwS213vXd8US8LN +TCODoQW2dQKBgQCTHtGqENg5MyeiGv/PbKgSA3p2GFpjGOJ0+WrinFQeqd8kwjtE +Y6ljsJBuwKNhmCA22m0AJF+nBjGoLMIN00g0fHsQosBB/QTQn3u5kdQeXwdAv+6x +jEjyEl+nNCi38vmhWeGxXBgyNPWbpw1cZ9lX2mTVAtG2NSlp2mpZFPOTuQKBgDc0 +9rK+OgmpF+csCVeATkC8ATyltoXBIvWJJyT1hb9cgZS8iHVCntAk4/QvdBP7O72E +rkeIP7FnukSwIDnkFJJAl2TnzL6C8Kf/15WlIVLhxfCh0Q3sisS8fCKah65NHpYS +BMiQclIS+mwxa/134pQ9AX1QvOQWw88z9iDyFExlAoGARvRO/cfyPYXv+jeFgUkq +gQ+NPXz8qKGxvp+wNsnnIOiF4U0VRPGi2TJS0K9oSwjgBxX1woQmnGRwPw2f8p75 +E7EztYgOdsCANBV3mBlGmDrezyaBbduG1mmWf81oYKIrX9xNv0TaCC+CY0zIC2xJ +H0O25kuXMna7mhGiQzFEhUI= -----END PRIVATE KEY----- diff --git a/configs/open5gs/udm.yaml.in b/configs/open5gs/udm.yaml.in index 1f9fa2223..9af015c00 100644 --- a/configs/open5gs/udm.yaml.in +++ b/configs/open5gs/udm.yaml.in @@ -1,505 +1,161 @@ -# -# o Set OGS_LOG_INFO to all domain level -# - If `level` is omitted, the default level is OGS_LOG_INFO) -# - If `domain` is omitted, the all domain level is set from 'level' -# (Default values are used, so no configuration is required) -# -# o Set OGS_LOG_ERROR to all domain level -# - `level` can be set with none, fatal, error, warn, info, debug, trace -# logger: -# level: error -# -# o Set OGS_LOG_DEBUG to mme/emm domain level -# logger: -# level: debug -# domain: mme,emm -# -# o Set OGS_LOG_TRACE to all domain level -# logger: -# level: trace -# domain: core,sbi,ausf,event,tlv,mem,sock -# logger: - file: @localstatedir@/log/open5gs/udm.log + file: @localstatedir@/log/open5gs/udm.log +# level: info # fatal|error|warn|info(default)|debug|trace -# -# o TLS enable/disable -# sbi: -# server|client: -# no_tls: false|true -# - false: (Default) Use TLS -# - true: TLS disabled -# -# o Verification enable/disable -# sbi: -# server|client: -# no_verify: false|true -# - false: (Default) Verify the PEER -# - true: Skip the verification step -# -# o Server-side does not use TLS -# sbi: -# server: -# no_tls: true -# -# o Client-side skips the verification step -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# -# o Use the specified certificate while verifying the client -# sbi: -# server -# cacert: /etc/open5gs/tls/ca.crt -# -# o Use the specified certificate while verifying the server -# sbi: -# client -# cacert: /etc/open5gs/tls/ca.crt -# -sbi: +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +udm: + hnet: + - id: 1 + scheme: 1 + key: @sysconfdir@/open5gs/hnet/curve25519-1.key + - id: 2 + scheme: 2 + key: @sysconfdir@/open5gs/hnet/secp256r1-2.key + - id: 3 + scheme: 1 + key: @sysconfdir@/open5gs/hnet/curve25519-3.key + - id: 4 + scheme: 2 + key: @sysconfdir@/open5gs/hnet/secp256r1-4.key + - id: 5 + scheme: 1 + key: @sysconfdir@/open5gs/hnet/curve25519-5.key + - id: 6 + scheme: 2 + key: @sysconfdir@/open5gs/hnet/secp256r1-6.key + sbi: server: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/udm.key - cert: @sysconfdir@/open5gs/tls/udm.crt + - address: 127.0.0.12 + port: 7777 client: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/udm.key - cert: @sysconfdir@/open5gs/tls/udm.crt +# nrf: +# - uri: http://127.0.0.10:7777 + scp: + - uri: http://127.0.0.200:7777 # -# -# +################################################################################ +# Home Network Public Key +################################################################################ # o Generate the private key as below. -# $ openssl genpkey -algorithm X25519 -out /etc/open5gs/hnet/curve25519-1.key -# $ openssl ecparam -name prime256v1 -genkey -conv_form compressed -out /etc/open5gs/hnet/secp256r1-2.key +# $ openssl genpkey -algorithm X25519 -out /etc/open5gs/hnet/curve25519-1.key +# $ openssl ecparam -name prime256v1 -genkey -conv_form compressed -out /etc/open5gs/hnet/secp256r1-2.key # # o The private and public keys can be viewed with the command. # The public key is used when creating the SIM. -# $ openssl pkey -in /etc/open5gs/hnet/curve25519-1.key -text -# $ openssl ec -in /etc/open5gs/hnet/secp256r1-2.key -conv_form compressed -text +# $ openssl pkey -in /etc/open5gs/hnet/curve25519-1.key -text +# $ openssl ec -in /etc/open5gs/hnet/secp256r1-2.key -conv_form compressed -text # # o Home network public key identifier(PKI) value : 1 # Protection scheme identifier : ECIES scheme profile A -# udm: -# hnet: -# - id: 1 -# scheme: 1 -# key: /etc/open5gs/hnet/curve25519-1.key +# hnet: +# - id: 1 +# scheme: 1 +# key: /etc/open5gs/hnet/curve25519-1.key # # o Home network public key identifier(PKI) value : 2 # Protection scheme identifier : ECIES scheme profile B -# udm: -# hnet: -# - id: 2 -# scheme: 2 -# key: /etc/open5gs/hnet/secp256r1-2.key +# hnet: +# - id: 2 +# scheme: 2 +# key: /etc/open5gs/hnet/secp256r1-2.key # # o Home network public key identifier(PKI) value : 3 # Protection scheme identifier : ECIES scheme profile A -# udm: -# hnet: -# - id: 3 -# scheme: 1 -# key: /etc/open5gs/hnet/curve25519-1.key +# hnet: +# - id: 3 +# scheme: 1 +# key: /etc/open5gs/hnet/curve25519-1.key # # o Home network public key identifier(PKI) value : 4 # Protection scheme identifier : ECIES scheme profile B -# udm: -# hnet: -# - id: 4 -# scheme: 2 -# key: /etc/open5gs/hnet/secp256r1-2.key +# hnet: +# - id: 4 +# scheme: 2 +# key: /etc/open5gs/hnet/secp256r1-2.key # -# -# -# o SBI Server(http://:80) +################################################################################ +# SBI Server +################################################################################ +# o Override SBI address to be advertised to NRF # sbi: # server: -# no_tls: true -# udm: -# sbi: -# -# o SBI Server(http://:7777) -# sbi: -# server: -# no_tls: true -# udm: -# sbi: -# - addr: -# - 0.0.0.0 -# - ::0 -# port: 7777 -# -# o SBI Server(https://:443) -# sbi: -# server: -# key: /etc/open5gs/tls/udm.key -# cert: /etc/open5gs/tls/udm.crt -# udm: -# sbi: -# -# o SBI Server(https://127.0.0.12:443, https://[::1]:443) without verification -# sbi: -# server: -# no_verify: true -# key: /etc/open5gs/tls/udm.key -# cert: /etc/open5gs/tls/udm.crt -# udm: -# sbi: -# - addr: 127.0.0.12 -# - addr: ::1 -# -# o SBI Server(https://udm.open5gs.org:443) -# Use the specified certificate while verifying the client -# -# sbi: -# server: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/udm.key -# cert: /etc/open5gs/tls/udm.crt -# udm: -# sbi: -# - name: udm.open5gs.org -# -# o SBI Server(http://127.0.0.12:7777) -# sbi: -# server: -# no_tls: true -# udm: -# sbi: -# - addr: 127.0.0.12 -# port: 7777 -# -# o SBI Server(http://:80) -# sbi: -# server: -# no_tls: true -# udm: -# sbi: -# - dev: eth0 -# -# o Provide custom SBI address to be advertised to NRF -# sbi: -# server: -# no_tls: true -# udm: -# sbi: # - dev: eth0 # advertise: open5gs-udm.svc.local # -# o Another example of advertising on NRF # sbi: # server: -# no_tls: true -# udm: -# sbi: -# - addr: localhost +# - address: localhost # advertise: # - 127.0.0.99 # - ::1 # -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false +################################################################################ +# SBI Client +################################################################################ +# o Direct communication with NRF interaction +# sbi: +# client: +# nrf: +# - uri: http://127.0.0.10:7777 # +# o Indirect communication with delegated discovery +# sbi: +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# +# o Indirect communication without delegated discovery +# sbi: +# client: +# nrf: +# - uri: http://127.0.0.10:7777 +# scp: +# - uri: http://127.0.0.200:7777 +# discovery: +# delegated: no +# +################################################################################ +# HTTPS scheme with TLS +################################################################################ +# o Set as default if not individually set +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/udm.key +# cert: @sysconfdir@/open5gs/tls/udm.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt # sbi: # server: -# no_tls: true -# udm: -# sbi: -# addr: 127.0.0.12 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -# -# o NF Service Name(Default : all NF services available) -# udm: -# service_name: -# -# o NF Service Name(Only some NF services are available) -# udm: -# service_name: -# - nudm-sdm -# - nudm-uecm -# - nudm-ueau -# -# -# -# o (Default) If you do not set Query Parameter as shown below, +# - address: udm.localdomain +# client: +# nrf: +# - uri: https://nrf.localdomain # +# o Add client TLS verification +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/udm.key +# cert: @sysconfdir@/open5gs/tls/udm.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/udm.key +# client_cert: @sysconfdir@/open5gs/tls/udm.crt # sbi: # server: -# no_tls: true -# udm: -# sbi: -# - addr: 127.0.0.12 -# port: 7777 -# -# - 'service-names' is included. -# -# o Service-Names are not included -# sbi: -# server: -# no_tls: true -# udm: -# sbi: -# - addr: 127.0.0.12 -# port: 7777 -# discovery: -# option: -# no_service_names: false -# -# o To remove 'service-names' from URI query parameters in NS Discovery -# no_service_names: true -# -# * For Indirect Communication with Delegated Discovery, -# 'service-names' is always included in the URI query parameter. -# * That is, 'no_service_names' has no effect. -# -# -# -# o (Default) If you do not set Delegated Discovery as shown below, -# -# sbi: -# server: -# no_tls: true -# udm: -# sbi: -# - addr: 127.0.0.12 -# port: 7777 -# -# - Use SCP if SCP avaiable. Otherwise NRF is used. -# => App fails if both NRF and SCP are unavailable. -# -# sbi: -# server: -# no_tls: true -# udm: -# sbi: -# - addr: 127.0.0.12 -# port: 7777 -# discovery: -# delegated: auto -# -# o To use SCP always => App fails if no SCP available. -# delegated: yes -# -# o Don't use SCP server => App fails if no NRF available. -# delegated: no -# -udm: - hnet: - - id: 1 - scheme: 1 - key: @sysconfdir@/open5gs/hnet/curve25519-1.key - - id: 2 - scheme: 2 - key: @sysconfdir@/open5gs/hnet/secp256r1-2.key - - id: 3 - scheme: 1 - key: @sysconfdir@/open5gs/hnet/curve25519-3.key - - id: 4 - scheme: 2 - key: @sysconfdir@/open5gs/hnet/secp256r1-4.key - - id: 5 - scheme: 1 - key: @sysconfdir@/open5gs/hnet/curve25519-5.key - - id: 6 - scheme: 2 - key: @sysconfdir@/open5gs/hnet/secp256r1-6.key - sbi: - - addr: 127.0.0.12 - port: 7777 - -# -# > -# -# o SBI Client(http://127.0.1.10:7777) -# sbi: +# - address: udm.localdomain # client: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# port: 7777 -# -# o SBI Client(https://127.0.1.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# scp: -# sbi: -# - addr: 127.0.1.10 -# - addr: ::1 -# -# o SBI Client(https://scp.open5gs.org:443) -# Use the specified certificate while verifying the server -# -# sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# scp: -# sbi: -# - name: scp.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fb::1]:80) -# If prefer_ipv4 is true, http://127.0.1.10:80 is selected. -# -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: -# - 127.0.1.10 -# - fd69:f21d:873c:fb::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -scp: - sbi: - - addr: 127.0.1.10 - port: 7777 - -# -# > -# -# o SBI Client(http://127.0.0.10:7777) -# sbi: -# client: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# port: 7777 -# -# o SBI Client(https://127.0.0.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# nrf: -# sbi: -# - addr: 127.0.0.10 -# - addr: ::1 -# -# o SBI Client(https://nrf.open5gs.org:443) -# Use the specified certificate while verifying the server -# -# sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# nrf: -# sbi: -# - name: nrf.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fa::1]:80) -# If prefer_ipv4 is true, http://127.0.0.10:80 is selected. -# -# sbi: -# addr: -# - 127.0.0.10 -# - fd69:f21d:873c:fa::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -#nrf: -# sbi: -# - addr: -# - 127.0.0.10 -# - ::1 -# port: 7777 - -# -# o Disable use of IPv4 addresses (only IPv6) -# parameter: -# no_ipv4: true -# -# o Disable use of IPv6 addresses (only IPv4) -# parameter: -# no_ipv6: true -# -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# parameter: -# prefer_ipv4: true -# -parameter: - -# -# o Maximum Number of UE -# max: -# ue: 1024 -# -# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) -# max: -# peer: 64 -# -max: - -# -# o NF Instance Heartbeat (Default : 0) -# NFs will not send heart-beat timer in NFProfile -# NRF will send heart-beat timer in NFProfile -# (Default values are used, so no configuration is required) -# -# o NF Instance Heartbeat (20 seconds) -# NFs will send heart-beat timer (20 seconds) in NFProfile -# NRF can change heart-beat timer in NFProfile -# -# time: -# nf_instance: -# heartbeat: 20 -# -# o Message Wait Duration (Default : 10,000 ms = 10 seconds) -# (Default values are used, so no configuration is required) -# -# o Message Wait Duration (3000 ms) -# time: -# message: -# duration: 3000 -time: +# nrf: +# - uri: https://nrf.localdomain diff --git a/configs/open5gs/udr.yaml.in b/configs/open5gs/udr.yaml.in index b27aaa6f3..2c2e57bee 100644 --- a/configs/open5gs/udr.yaml.in +++ b/configs/open5gs/udr.yaml.in @@ -1,444 +1,102 @@ db_uri: mongodb://localhost/open5gs - -# -# o Set OGS_LOG_INFO to all domain level -# - If `level` is omitted, the default level is OGS_LOG_INFO) -# - If `domain` is omitted, the all domain level is set from 'level' -# (Default values are used, so no configuration is required) -# -# o Set OGS_LOG_ERROR to all domain level -# - `level` can be set with none, fatal, error, warn, info, debug, trace -# logger: -# level: error -# -# o Set OGS_LOG_DEBUG to mme/emm domain level -# logger: -# level: debug -# domain: mme,emm -# -# o Set OGS_LOG_TRACE to all domain level -# logger: -# level: trace -# domain: core,sbi,ausf,event,tlv,mem,sock -# logger: - file: @localstatedir@/log/open5gs/udr.log + file: @localstatedir@/log/open5gs/udr.log +# level: info # fatal|error|warn|info(default)|debug|trace -# -# o TLS enable/disable -# sbi: -# server|client: -# no_tls: false|true -# - false: (Default) Use TLS -# - true: TLS disabled -# -# o Verification enable/disable -# sbi: -# server|client: -# no_verify: false|true -# - false: (Default) Verify the PEER -# - true: Skip the verification step -# -# o Server-side does not use TLS -# sbi: -# server: -# no_tls: true -# -# o Client-side skips the verification step -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# -# o Use the specified certificate while verifying the client -# sbi: -# server -# cacert: /etc/open5gs/tls/ca.crt -# -# o Use the specified certificate while verifying the server -# sbi: -# client -# cacert: /etc/open5gs/tls/ca.crt -# -sbi: +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +udr: + sbi: server: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/udr.key - cert: @sysconfdir@/open5gs/tls/udr.crt + - address: 127.0.0.20 + port: 7777 client: - no_tls: true - cacert: @sysconfdir@/open5gs/tls/ca.crt - key: @sysconfdir@/open5gs/tls/udr.key - cert: @sysconfdir@/open5gs/tls/udr.crt +# nrf: +# - uri: http://127.0.0.10:7777 + scp: + - uri: http://127.0.0.200:7777 -# -# -# -# o SBI Server(http://:80) +################################################################################ +# SBI Server +################################################################################ +# o Override SBI address to be advertised to NRF # sbi: # server: -# no_tls: true -# bsf: -# sbi: -# -# o SBI Server(http://:7777) -# sbi: -# server: -# no_tls: true -# bsf: -# sbi: -# - addr: -# - 0.0.0.0 -# - ::0 -# port: 7777 -# -# o SBI Server(https://:443) -# sbi: -# server: -# key: /etc/open5gs/tls/bsf.key -# cert: /etc/open5gs/tls/bsf.crt -# bsf: -# sbi: -# -# o SBI Server(https://127.0.0.15:443, https://[::1]:443) without verification -# sbi: -# server: -# no_verify: true -# key: /etc/open5gs/tls/bsf.key -# cert: /etc/open5gs/tls/bsf.crt -# bsf: -# sbi: -# - addr: 127.0.0.15 -# - addr: ::1 -# -# o SBI Server(https://bsf.open5gs.org:443) -# Use the specified certificate while verifying the client -# -# sbi: -# server: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/bsf.key -# cert: /etc/open5gs/tls/bsf.crt -# bsf: -# sbi: -# - name: bsf.open5gs.org -# -# o SBI Server(http://127.0.0.15:7777) -# sbi: -# server: -# no_tls: true -# bsf: -# sbi: -# - addr: 127.0.0.15 -# port: 7777 -# -# o SBI Server(http://:80) -# sbi: -# server: -# no_tls: true -# bsf: -# sbi: # - dev: eth0 +# advertise: open5gs-udr.svc.local # -# o Provide custom SBI address to be advertised to NRF # sbi: # server: -# no_tls: true -# bsf: -# sbi: -# - dev: eth0 -# advertise: open5gs-bsf.svc.local -# -# o Another example of advertising on NRF -# sbi: -# server: -# no_tls: true -# bsf: -# sbi: -# - addr: localhost +# - address: localhost # advertise: # - 127.0.0.99 # - ::1 # -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false +################################################################################ +# SBI Client +################################################################################ +# o Direct communication with NRF interaction +# sbi: +# client: +# nrf: +# - uri: http://127.0.0.10:7777 # +# o Indirect communication with delegated discovery +# sbi: +# client: +# scp: +# - uri: http://127.0.0.200:7777 +# +# o Indirect communication without delegated discovery +# sbi: +# client: +# nrf: +# - uri: http://127.0.0.10:7777 +# scp: +# - uri: http://127.0.0.200:7777 +# discovery: +# delegated: no +# +################################################################################ +# HTTPS scheme with TLS +################################################################################ +# o Set as default if not individually set +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/udr.key +# cert: @sysconfdir@/open5gs/tls/udr.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt # sbi: # server: -# no_tls: true -# bsf: -# sbi: -# addr: 127.0.0.15 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -# -# -# o NF Service Name(Default : all NF services available) -# udr: -# service_name: -# -# o NF Service Name(Only some NF services are available) -# udr: -# service_name: -# - nudr-dr -# -# -# -# o (Default) If you do not set Query Parameter as shown below, +# - address: udr.localdomain +# client: +# nrf: +# - uri: https://nrf.localdomain # +# o Add client TLS verification +# default: +# tls: +# server: +# scheme: https +# private_key: @sysconfdir@/open5gs/tls/udr.key +# cert: @sysconfdir@/open5gs/tls/udr.crt +# verify_client: true +# verify_client_cacert: @sysconfdir@/open5gs/tls/ca.crt +# client: +# scheme: https +# cacert: @sysconfdir@/open5gs/tls/ca.crt +# client_private_key: @sysconfdir@/open5gs/tls/udr.key +# client_cert: @sysconfdir@/open5gs/tls/udr.crt # sbi: # server: -# no_tls: true -# udr: -# sbi: -# - addr: 127.0.0.20 -# port: 7777 -# -# - 'service-names' is included. -# -# o Service-Names are not included -# sbi: -# server: -# no_tls: true -# udr: -# sbi: -# - addr: 127.0.0.20 -# port: 7777 -# discovery: -# option: -# no_service_names: false -# -# o To remove 'service-names' from URI query parameters in NS Discovery -# no_service_names: true -# -# * For Indirect Communication with Delegated Discovery, -# 'service-names' is always included in the URI query parameter. -# * That is, 'no_service_names' has no effect. -# -# -# -# o (Default) If you do not set Delegated Discovery as shown below, -# -# sbi: -# server: -# no_tls: true -# udr: -# sbi: -# - addr: 127.0.0.20 -# port: 7777 -# -# - Use SCP if SCP avaiable. Otherwise NRF is used. -# => App fails if both NRF and SCP are unavailable. -# -# sbi: -# server: -# no_tls: true -# udr: -# sbi: -# - addr: 127.0.0.20 -# port: 7777 -# discovery: -# delegated: auto -# -# o To use SCP always => App fails if no SCP available. -# delegated: yes -# -# o Don't use SCP server => App fails if no NRF available. -# delegated: no -# -udr: - sbi: - - addr: 127.0.0.20 - port: 7777 - -# -# > -# -# o SBI Client(http://127.0.1.10:7777) -# sbi: +# - address: udr.localdomain # client: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# port: 7777 -# -# o SBI Client(https://127.0.1.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# scp: -# sbi: -# - addr: 127.0.1.10 -# - addr: ::1 -# -# o SBI Client(https://scp.open5gs.org:443) -# Use the specified certificate while verifying the server -# -# sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# scp: -# sbi: -# - name: scp.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fb::1]:80) -# If prefer_ipv4 is true, http://127.0.1.10:80 is selected. -# -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: -# - 127.0.1.10 -# - fd69:f21d:873c:fb::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# scp: -# sbi: -# addr: 127.0.1.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -# -scp: - sbi: - - addr: 127.0.1.10 - port: 7777 - -# -# > -# -# o SBI Client(http://127.0.0.10:7777) -# sbi: -# client: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# port: 7777 -# -# o SBI Client(https://127.0.0.10:443, https://[::1]:443) without verification -# sbi: -# client: -# no_verify: true -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# nrf: -# sbi: -# - addr: 127.0.0.10 -# - addr: ::1 -# -# o SBI Client(https://nrf.open5gs.org:443) -# Use the specified certificate while verifying the server -# -# sbi: -# client: -# cacert: /etc/open5gs/tls/ca.crt -# key: /etc/open5gs/tls/amf.key -# cert: /etc/open5gs/tls/amf.crt -# nrf: -# sbi: -# - name: nrf.open5gs.org -# -# o SBI Client(http://[fd69:f21d:873c:fa::1]:80) -# If prefer_ipv4 is true, http://127.0.0.10:80 is selected. -# -# sbi: -# addr: -# - 127.0.0.10 -# - fd69:f21d:873c:fa::1 -# -# o SBI Option (Default) -# - tcp_nodelay : true -# - so_linger.l_onoff : false -# -# sbi: -# client: -# no_tls: true -# nrf: -# sbi: -# addr: 127.0.0.10 -# option: -# tcp_nodelay: false -# so_linger: -# l_onoff: true -# l_linger: 10 -# -#nrf: -# sbi: -# - addr: -# - 127.0.0.10 -# - ::1 -# port: 7777 - -# -# o Disable use of IPv4 addresses (only IPv6) -# parameter: -# no_ipv4: true -# -# o Disable use of IPv6 addresses (only IPv4) -# parameter: -# no_ipv6: true -# -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# parameter: -# prefer_ipv4: true -# -parameter: - -# -# o Maximum Number of UE -# max: -# ue: 1024 -# -# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) -# max: -# peer: 64 -# -max: - -# -# o NF Instance Heartbeat (Default : 0) -# NFs will not send heart-beat timer in NFProfile -# NRF will send heart-beat timer in NFProfile -# (Default values are used, so no configuration is required) -# -# o NF Instance Heartbeat (20 seconds) -# NFs will send heart-beat timer (20 seconds) in NFProfile -# NRF can change heart-beat timer in NFProfile -# -# time: -# nf_instance: -# heartbeat: 20 -# -# o Message Wait Duration (Default : 10,000 ms = 10 seconds) -# (Default values are used, so no configuration is required) -# -# o Message Wait Duration (3000 ms) -# time: -# message: -# duration: 3000 -time: +# nrf: +# - uri: https://nrf.localdomain diff --git a/configs/open5gs/upf.yaml.in b/configs/open5gs/upf.yaml.in index b132a5b82..353d7bb64 100644 --- a/configs/open5gs/upf.yaml.in +++ b/configs/open5gs/upf.yaml.in @@ -1,257 +1,83 @@ -# -# o Set OGS_LOG_INFO to all domain level -# - If `level` is omitted, the default level is OGS_LOG_INFO) -# - If `domain` is omitted, the all domain level is set from 'level' -# (Default values are used, so no configuration is required) -# -# o Set OGS_LOG_ERROR to all domain level -# - `level` can be set with none, fatal, error, warn, info, debug, trace -# logger: -# level: error -# -# o Set OGS_LOG_DEBUG to mme/emm domain level -# logger: -# level: debug -# domain: mme,emm -# -# o Set OGS_LOG_TRACE to all domain level -# logger: -# level: trace -# domain: core,sbi,ausf,event,tlv,mem,sock -# logger: - file: @localstatedir@/log/open5gs/upf.log + file: @localstatedir@/log/open5gs/upf.log +# level: info # fatal|error|warn|info(default)|debug|trace +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +upf: + pfcp: + server: + - address: 127.0.0.7 + client: +# smf: # UPF PFCP Client try to associate SMF PFCP Server +# - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 + port: 9090 + +################################################################################ +# PFCP Server +################################################################################ +# o Override PFCP address to be advertised to SMF in PFCP association +# pfcp: +# server: +# - dev: eth0 +# advertise: open5gs-upf.svc.local # -# -# -# o PFCP Server(127.0.0.7:8805, ::1:8805) -# upf: -# pfcp: -# - addr: 127.0.0.7 -# - addr: ::1 -# -# o PFCP-U Server(127.0.0.1:2152, [::1]:2152) -# upf: -# pfcp: -# name: localhost -# -# o PFCP Option (Default) -# - so_bindtodevice : NULL -# -# upf: -# pfcp: -# addr: 127.0.0.7 -# option: -# so_bindtodevice: vrf-blue -# -# o Provide custom PFCP address to be advertised to SMF in PFCP association -# request/respond -# upf: -# pfcp: -# - addr: 0.0.0.0 -# advertise: open5gs-smf.svc.local -# -# > -# -# o GTP-U Server(127.0.0.7:2152, [::1]:2152) -# upf: -# gtpu: -# - addr: 127.0.0.7 -# - addr: ::1 -# -# o GTP-U Server(127.0.0.1:2152, [::1]:2152) -# upf: -# gtpu: -# name: localhost +################################################################################ +# GTP-U Server +################################################################################ +# o Override SGW-U GTP-U address to be advertised inside S1AP messages +# gtpu: +# server: +# - dev: ens3 +# advertise: upf1.5gc.mnc001.mcc001.3gppnetwork.org # # o User Plane IP Resource information -# upf: -# gtpu: -# - addr: +# gtpu: +# server: +# - address: # - 127.0.0.7 # - ::1 # teid_range_indication: 4 # teid_range: 10 # network_instance: internet # source_interface: 0 -# - addr: 127.0.10.4 +# - address: 127.0.10.4 # teid_range_indication: 4 # teid_range: 5 # network_instance: ims # source_interface: 1 # -# o Provide custom UPF GTP-U address to be advertised inside NGAP messages -# upf: -# gtpu: -# - addr: 10.4.128.21 -# advertise: 172.24.15.30 -# -# upf: -# gtpu: -# - addr: 10.4.128.21 -# advertise: -# - 127.0.0.1 -# - ::1 -# -# upf: -# gtpu: -# - addr: 10.4.128.21 -# advertise: upf1.5gc.mnc001.mcc001.3gppnetwork.org -# -# upf: -# gtpu: -# - dev: ens3 -# advertise: upf1.5gc.mnc001.mcc001.3gppnetwork.org -# -# o GTP-U Option (Default) -# - so_bindtodevice : NULL -# -# upf: -# gtpu: -# addr: 127.0.0.7 -# option: -# so_bindtodevice: vrf-blue -# -# -# -# Note that you need to setup your UE network using TUN device. -# (ogstun, ogstun2, ogstunX, ..) -# -# o IPv4 Pool -# $ sudo ip addr add 10.45.0.1/16 dev ogstun -# -# upf: -# subnet: -# addr: 10.45.0.1/16 -# -# o IPv4/IPv6 Pool -# $ sudo ip addr add 10.45.0.1/16 dev ogstun -# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun -# -# upf: -# subnet: -# - addr: 10.45.0.1/16 -# - addr: 2001:db8:cafe::1/48 -# +################################################################################ +# 3GPP Specification +################################################################################ # # o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, 2001:db8:babe::1/48 -# All other APNs use 10.45.0.1/16, 2001:db8:cafe::1/48 -# $ sudo ip addr add 10.45.0.1/16 dev ogstun -# $ sudo ip addr add 10.46.0.1/16 dev ogstun -# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun -# $ sudo ip addr add 2001:db8:babe::1/48 dev ogstun +# $ sudo ip addr add 10.45.0.1/16 dev ogstun +# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun2 +# $ sudo ip addr add 10.46.0.1/16 dev ogstun3 +# $ sudo ip addr add 2001:db8:babe::1/48 dev ogstun3 # -# ; If the UE has unknown DNN/APN(not internet/ims), SMF/UPF will crash. -# -# upf: -# subnet: -# - addr: 10.45.0.1/16 -# dnn: internet -# - addr: 2001:db8:cafe::1/48 -# dnn: internet -# - addr: 10.46.0.1/16 -# dnn: ims -# - addr: 2001:db8:babe::1/48 -# dnn: ims -# -# o Specific DNN/APN with the FALLBACK SUBNET(10.47.0.1/16) -# ; Note that put the FALLBACK SUBNET last to avoid SMF/UPF crash. -# -# upf: -# subnet: -# - addr: 10.45.0.1/16 -# dnn: internet -# - addr: 10.46.0.1/16 -# dnn: ims -# - addr: 10.50.0.1/16 ## FALLBACK SUBNET -# -# o Multiple Devices (default: ogstun) -# $ sudo ip addr add 10.45.0.1/16 dev ogstun -# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun2 -# $ sudo ip addr add 10.46.0.1/16 dev ogstun3 -# $ sudo ip addr add 2001:db8:babe::1/48 dev ogstun3 -# -# upf: -# subnet: -# - addr: 10.45.0.1/16 -# dnn: internet -# - addr: 2001:db8:cafe::1/48 -# dnn: internet -# dev: ogstun2 -# - addr: 10.46.0.1/16 -# dnn: ims -# dev: ogstun3 -# - addr: 2001:db8:babe::1/48 -# dnn: ims -# dev: ogstun3 -# -# -# -# o Metrics Server(http://:9090) -# upf: -# metrics: -# - addr: 0.0.0.0 -# port: 9090 -# -upf: - pfcp: - - addr: 127.0.0.7 - gtpu: - - addr: 127.0.0.7 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - metrics: - - addr: 127.0.0.7 - port: 9090 - -# -# > -# -# o PFCP Client(127.0.0.4:8805) -# smf: -# pfcp: -# addr: 127.0.0.4 -# -smf: - -# -# o Number of output streams per SCTP associations. -# parameter: -# sctp_streams: 30 -# -# o Disable use of IPv4 addresses (only IPv6) -# parameter: -# no_ipv4: true -# -# o Disable use of IPv6 addresses (only IPv4) -# parameter: -# no_ipv6: true -# -# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections. -# parameter: -# prefer_ipv4: true -# -parameter: - -# -# o Maximum Number of UE -# max: -# ue: 1024 -# -# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI) -# max: -# peer: 64 -# -max: - -# -# o Message Wait Duration (Default : 10,000 ms = 10 seconds) -# (Default values are used, so no configuration is required) -# -# o Message Wait Duration (3000 ms) -# time: -# message: -# duration: 3000 -time: +# session: +# - subnet: 10.45.0.1/16 +# dnn: internet +# - subnet: 2001:db8:cafe::1/48 +# dnn: internet +# dev: ogstun2 +# - subnet: 10.46.0.1/16 +# dnn: ims +# dev: ogstun3 +# - subnet: 2001:db8:babe::1/48 +# dnn: ims +# dev: ogstun3 diff --git a/configs/sample.yaml.in b/configs/sample.yaml.in index 2dc3187c3..2e7cfb8bd 100644 --- a/configs/sample.yaml.in +++ b/configs/sample.yaml.in @@ -2,21 +2,17 @@ db_uri: mongodb://localhost/open5gs logger: -sbi: - server: - no_tls: true - cacert: @build_configs_dir@/open5gs/tls/ca.crt - key: @build_configs_dir@/open5gs/tls/testserver.key - cert: @build_configs_dir@/open5gs/tls/testserver.crt - client: - no_tls: true - cacert: @build_configs_dir@/open5gs/tls/ca.crt - key: @build_configs_dir@/open5gs/tls/testclient.key - cert: @build_configs_dir@/open5gs/tls/testclient.crt +test: + serving: + - plmn_id: + mcc: 999 + mnc: 70 -parameter: +global: + parameter: # no_nrf: true # no_scp: true + no_sepp: true # no_amf: true # no_smf: true # no_upf: true @@ -31,247 +27,305 @@ parameter: # no_sgwu: true # no_pcrf: true # no_hss: true -# use_mongodb_change_stream: true mme: - freeDiameter: - identity: mme.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.8 + freeDiameter: + identity: mme.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.8 - s1ap: - - addr: 127.0.0.2 - gtpc: - - addr: 127.0.0.2 - metrics: - addr: 127.0.0.2 - port: 9090 - gummei: - plmn_id: + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.2 + port: 9090 + gummei: + - plmn_id: mcc: 999 mnc: 70 mme_gid: 2 mme_code: 1 - tai: - plmn_id: + tai: + - plmn_id: mcc: 999 mnc: 70 tac: 1 - security: - integrity_order : [ EIA2, EIA1, EIA0 ] - ciphering_order : [ EEA0, EEA1, EEA2 ] - - network_name: - full: Open5GS + security: + integrity_order : [ EIA2, EIA1, EIA0 ] + ciphering_order : [ EEA0, EEA1, EEA2 ] + network_name: + full: Open5GS + time: + t3412: + value: 540 sgwc: - gtpc: - - addr: 127.0.0.3 - pfcp: - - addr: 127.0.0.3 + gtpc: + server: + - address: 127.0.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 smf: - sbi: - - addr: 127.0.0.4 + sbi: + server: + - address: 127.0.0.4 port: 7777 - pfcp: - - addr: 127.0.0.4 - gtpc: - - addr: 127.0.0.4 - - addr: ::1 - gtpu: - - addr: 127.0.0.4 - - addr: ::1 - metrics: - addr: 127.0.0.4 - port: 9090 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - 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.0.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 - addr: 127.0.0.9 + client: + scp: + - uri: http://127.0.0.200:7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + metrics: + server: + - address: 127.0.0.4 + port: 9090 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + 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.0.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.0.9 amf: - sbi: - - addr: 127.0.0.5 + sbi: + server: + - address: 127.0.0.5 port: 7777 - ngap: - - addr: 127.0.0.5 - metrics: - addr: 127.0.0.5 - port: 9090 - 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 + client: + scp: + - uri: http://127.0.0.200:7777 + ngap: + server: + - address: 127.0.0.5 + metrics: + server: + - address: 127.0.0.5 + port: 9090 + 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: - - addr: 127.0.0.6 - gtpu: - - addr: 127.0.0.6 + pfcp: + server: + - address: 127.0.0.6 + gtpu: + server: + - address: 127.0.0.6 upf: - pfcp: - - addr: 127.0.0.7 - gtpu: - - addr: 127.0.0.7 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - metrics: - - addr: 127.0.0.7 + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 port: 9090 hss: - freeDiameter: - identity: hss.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.2 + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 pcrf: - freeDiameter: - identity: pcrf.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.4 + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 nrf: - sbi: - - addr: - - 127.0.0.10 - - ::1 + sbi: + server: + - address: 127.0.0.10 port: 7777 scp: - sbi: - - addr: 127.0.1.10 + sbi: + server: + - address: 127.0.0.200 port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 ausf: - sbi: - - addr: 127.0.0.11 + sbi: + server: + - address: 127.0.0.11 port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 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: - - addr: 127.0.0.12 + 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.0.12 port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 pcf: - sbi: - - addr: 127.0.0.13 + sbi: + server: + - address: 127.0.0.13 port: 7777 - metrics: - - addr: 127.0.0.13 + client: + scp: + - uri: http://127.0.0.200:7777 + metrics: + server: + - address: 127.0.0.13 port: 9090 nssf: - sbi: - - addr: 127.0.0.14 + sbi: + server: + - address: 127.0.0.14 port: 7777 - nsi: - - addr: 127.0.0.10 - port: 7777 - s_nssai: - sst: 1 + client: + scp: + - uri: http://127.0.0.200:7777 + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 bsf: - sbi: - - addr: 127.0.0.15 + sbi: + server: + - address: 127.0.0.15 port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 udr: - sbi: - - addr: 127.0.0.20 + sbi: + server: + - address: 127.0.0.20 port: 7777 - -time: - t3412: - value: 540 # 9 mintues * 60 = 540 seconds - t3512: - value: 540 # 9 mintues * 60 = 540 seconds + client: + scp: + - uri: http://127.0.0.200:7777 diff --git a/configs/slice.yaml.in b/configs/slice.yaml.in index 1273c5d1b..87a273133 100644 --- a/configs/slice.yaml.in +++ b/configs/slice.yaml.in @@ -2,21 +2,17 @@ db_uri: mongodb://localhost/open5gs logger: -sbi: - server: - no_tls: true - cacert: @build_configs_dir@/open5gs/tls/ca.crt - key: @build_configs_dir@/open5gs/tls/testserver.key - cert: @build_configs_dir@/open5gs/tls/testserver.crt - client: - no_tls: true - cacert: @build_configs_dir@/open5gs/tls/ca.crt - key: @build_configs_dir@/open5gs/tls/testclient.key - cert: @build_configs_dir@/open5gs/tls/testclient.crt +test: + serving: + - plmn_id: + mcc: 999 + mnc: 70 -parameter: +global: + parameter: # no_nrf: true no_scp: true + no_sepp: true # no_amf: true # no_smf: true # no_upf: true @@ -31,240 +27,289 @@ parameter: # no_sgwu: true # no_pcrf: true # no_hss: true -# use_mongodb_change_stream: true mme: - freeDiameter: - identity: mme.localdomain - realm: localdomain - listen_on: 127.0.0.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/dict_dcca_3gpp.fdx - connect: - - identity: hss.localdomain - addr: 127.0.0.8 + freeDiameter: + identity: mme.localdomain + realm: localdomain + listen_on: 127.0.0.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/dict_dcca_3gpp.fdx + connect: + - identity: hss.localdomain + address: 127.0.0.8 - s1ap: - - addr: 127.0.0.2 - gtpc: - - addr: 127.0.0.2 - gummei: - plmn_id: + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + gummei: + - plmn_id: mcc: 999 mnc: 70 mme_gid: 2 mme_code: 1 - tai: - plmn_id: + tai: + - plmn_id: mcc: 999 mnc: 70 tac: 1 - security: - integrity_order : [ EIA2, EIA1, EIA0 ] - ciphering_order : [ EEA0, EEA1, EEA2 ] - - network_name: - full: Open5GS + security: + integrity_order : [ EIA2, EIA1, EIA0 ] + ciphering_order : [ EEA0, EEA1, EEA2 ] + network_name: + full: Open5GS + time: + t3412: + value: 540 sgwc: - gtpc: - - addr: 127.0.0.3 - pfcp: - - addr: 127.0.0.3 + gtpc: + server: + - address: 127.0.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 smf: - sbi: - - addr: 127.0.0.4 + sbi: + server: + - address: 127.0.0.4 port: 7777 - pfcp: - - addr: 127.0.0.4 - gtpc: - - addr: 127.0.0.4 - - addr: ::1 - gtpu: - - addr: 127.0.0.4 - - addr: ::1 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - 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.0.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 - addr: 127.0.0.9 + client: + nrf: + - uri: http://127.0.0.10:7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + 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.0.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.0.9 amf: - sbi: - - addr: 127.0.0.5 + sbi: + server: + - address: 127.0.0.5 port: 7777 - ngap: - - addr: 127.0.0.5 - guami: - - plmn_id: - mcc: 999 - mnc: 70 - amf_id: - region: 202 - set: 1016 - tai: - - plmn_id: - mcc: 999 - mnc: 70 - tac: 1 - plmn_support: - - plmn_id: - mcc: 999 - mnc: 70 - s_nssai: - - sst: 1 - - sst: 1 - sd: 000080 - - sst: 1 - sd: 009000 - security: - integrity_order : [ NIA2, NIA1 ] - ciphering_order : [ NEA0, NEA1, NEA2 ] - network_name: - full: Open5GS - amf_name: open5gs-amf0 + client: + nrf: + - uri: http://127.0.0.10:7777 + ngap: + server: + - address: 127.0.0.5 + guami: + - plmn_id: + mcc: 999 + mnc: 70 + amf_id: + region: 202 + set: 1016 + tai: + - plmn_id: + mcc: 999 + mnc: 70 + tac: 1 + plmn_support: + - plmn_id: + mcc: 999 + mnc: 70 + s_nssai: + - sst: 1 + - sst: 1 + sd: 000080 + - sst: 1 + sd: 009000 + security: + integrity_order : [ NIA2, NIA1 ] + ciphering_order : [ NEA0, NEA1, NEA2 ] + network_name: + full: Open5GS + amf_name: open5gs-amf0 + time: + t3512: + value: 540 # 9 mintues * 60 = 540 seconds sgwu: - pfcp: - - addr: 127.0.0.6 - gtpu: - - addr: 127.0.0.6 + pfcp: + server: + - address: 127.0.0.6 + gtpu: + server: + - address: 127.0.0.6 upf: - pfcp: - - addr: 127.0.0.7 - gtpu: - - addr: 127.0.0.7 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - metrics: - - addr: 127.0.0.7 + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 port: 9090 hss: - freeDiameter: - identity: hss.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.2 + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 pcrf: - freeDiameter: - identity: pcrf.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.4 + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 nrf: - sbi: - - addr: - - 127.0.0.10 - - ::1 + sbi: + server: + - address: 127.0.0.10 port: 7777 ausf: - sbi: - - addr: 127.0.0.11 + sbi: + server: + - address: 127.0.0.11 port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 udm: - sbi: - - addr: 127.0.0.12 + sbi: + server: + - address: 127.0.0.12 port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 pcf: - sbi: - - addr: 127.0.0.13 + sbi: + server: + - address: 127.0.0.13 port: 7777 - metrics: - - addr: 127.0.0.13 + client: + nrf: + - uri: http://127.0.0.10:7777 + metrics: + server: + - address: 127.0.0.13 port: 9090 nssf: - sbi: - - addr: 127.0.0.14 + sbi: + server: + - address: 127.0.0.14 port: 7777 - nsi: - - addr: ::1 - port: 7777 - s_nssai: - sst: 1 - - addr: 127.0.0.19 - port: 7777 - s_nssai: - sst: 1 - sd: 000080 - - addr: 127.0.0.10 - port: 7777 - s_nssai: - sst: 1 - sd: 009000 + client: + nrf: + - uri: http://127.0.0.10:7777 + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 + - uri: http://127.0.0.19:7777 + s_nssai: + sst: 1 + sd: 000080 + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 + sd: 009000 bsf: - sbi: - - addr: 127.0.0.15 + sbi: + server: + - address: 127.0.0.15 port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 udr: - sbi: - - addr: 127.0.0.20 + sbi: + server: + - address: 127.0.0.20 port: 7777 - -time: - t3412: - value: 540 # 9 mintues * 60 = 540 seconds - t3512: - value: 540 # 9 mintues * 60 = 540 seconds + client: + nrf: + - uri: http://127.0.0.10:7777 diff --git a/configs/srsenb.yaml.in b/configs/srsenb.yaml.in index a24ef8504..113c2177e 100644 --- a/configs/srsenb.yaml.in +++ b/configs/srsenb.yaml.in @@ -2,21 +2,17 @@ db_uri: mongodb://localhost/open5gs logger: -sbi: - server: - no_tls: true - cacert: @build_configs_dir@/open5gs/tls/ca.crt - key: @build_configs_dir@/open5gs/tls/testserver.key - cert: @build_configs_dir@/open5gs/tls/testserver.crt - client: - no_tls: true - cacert: @build_configs_dir@/open5gs/tls/ca.crt - key: @build_configs_dir@/open5gs/tls/testclient.key - cert: @build_configs_dir@/open5gs/tls/testclient.crt +test: + serving: + - plmn_id: + mcc: 999 + mnc: 70 -parameter: +global: + parameter: # no_nrf: true # no_scp: true + no_sepp: true # no_amf: true # no_smf: true # no_upf: true @@ -31,226 +27,248 @@ parameter: # no_sgwu: true # no_pcrf: true # no_hss: true -# use_mongodb_change_stream: true mme: - freeDiameter: - identity: mme.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.8 + freeDiameter: + identity: mme.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.8 - s1ap: - - addr: 127.0.1.100 - gtpc: - - addr: 127.0.0.2 - gummei: - plmn_id: + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + gummei: + - plmn_id: mcc: 901 mnc: 70 mme_gid: 2 mme_code: 1 - tai: - plmn_id: + tai: + - plmn_id: mcc: 901 - mnc: 70 + mnc: 70 tac: 7 - security: - integrity_order : [ EIA2, EIA1, EIA0 ] - ciphering_order : [ EEA0, EEA1, EEA2 ] - - network_name: - full: Open5GS + security: + integrity_order : [ EIA2, EIA1, EIA0 ] + ciphering_order : [ EEA0, EEA1, EEA2 ] + network_name: + full: Open5GS + time: + t3412: + value: 540 sgwc: - gtpc: - - addr: 127.0.0.3 - pfcp: - - addr: 127.0.0.3 + gtpc: + server: + - address: 127.0.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 smf: # sbi: -# - addr: 127.0.0.4 -# port: 7777 - pfcp: - - addr: 127.0.0.4 - gtpc: - - addr: 127.0.0.4 - - addr: ::1 - gtpu: - - addr: 127.0.0.4 - - addr: ::1 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - 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.0.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 - addr: 127.0.0.9 +# server: +# - address: 127.0.0.4 +# port: 7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + 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.0.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.0.9 amf: - sbi: - - addr: 127.0.0.5 + sbi: + server: + - address: 127.0.0.5 port: 7777 - ngap: - - addr: 127.0.0.5 - guami: - - plmn_id: - mcc: 901 - mnc: 70 - amf_id: - region: 2 - set: 1 - tai: - - plmn_id: - mcc: 901 - mnc: 70 - tac: 1 - plmn_support: - - plmn_id: - mcc: 901 - 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 + ngap: + server: + - address: 127.0.0.5 + guami: + - plmn_id: + mcc: 901 + mnc: 70 + amf_id: + region: 2 + set: 1 + tai: + - plmn_id: + mcc: 901 + mnc: 70 + tac: 1 + plmn_support: + - plmn_id: + mcc: 901 + 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: - - addr: 127.0.0.6 - gtpu: - - addr: 127.0.0.6 + pfcp: + server: + - address: 127.0.0.6 + gtpu: + server: + - address: 127.0.0.6 upf: - pfcp: - - addr: 127.0.0.7 - gtpu: - - addr: 127.0.0.7 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - metrics: - - addr: 127.0.0.7 + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 port: 9090 hss: - freeDiameter: - identity: hss.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.2 + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 pcrf: - freeDiameter: - identity: pcrf.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.4 - -#nrf: -# sbi: -# - addr: -# - 127.0.0.10 -# - ::1 -# port: 7777 + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 ausf: - sbi: - - addr: 127.0.0.11 + sbi: + server: + - address: 127.0.0.11 port: 7777 udm: - sbi: - - addr: 127.0.0.12 + sbi: + server: + - address: 127.0.0.12 port: 7777 pcf: - sbi: - - addr: 127.0.0.13 + sbi: + server: + - address: 127.0.0.13 port: 7777 - metrics: - - addr: 127.0.0.13 + metrics: + server: + - address: 127.0.0.13 port: 9090 nssf: - sbi: - - addr: 127.0.0.14 + sbi: + server: + - address: 127.0.0.14 port: 7777 - nsi: - - addr: 127.0.0.10 - port: 7777 - s_nssai: - sst: 1 + client: + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 bsf: - sbi: - - addr: 127.0.0.15 + sbi: + server: + - address: 127.0.0.15 port: 7777 udr: - sbi: - - addr: 127.0.0.20 + sbi: + server: + - address: 127.0.0.20 port: 7777 - -time: - t3412: - value: 540 # 9 mintues * 60 = 540 seconds - t3512: - value: 540 # 9 mintues * 60 = 540 seconds diff --git a/configs/systemd/meson.build b/configs/systemd/meson.build index 73500ca78..c88c68ee2 100644 --- a/configs/systemd/meson.build +++ b/configs/systemd/meson.build @@ -26,6 +26,7 @@ systemd_conf_in = ''' open5gs-pcrfd.service open5gs-nrfd.service open5gs-scpd.service + open5gs-seppd.service open5gs-ausfd.service open5gs-udmd.service open5gs-pcfd.service diff --git a/configs/systemd/open5gs-seppd.service.in b/configs/systemd/open5gs-seppd.service.in new file mode 100644 index 000000000..34293097d --- /dev/null +++ b/configs/systemd/open5gs-seppd.service.in @@ -0,0 +1,18 @@ +[Unit] +Description=Open5GS SEPP Daemon +Wants=mongodb.service mongod.service + +[Service] +Type=simple + +User=open5gs +Group=open5gs + +Restart=always +ExecStart=@bindir@/open5gs-seppd -c @sysconfdir@/open5gs/sepp1.yaml +RestartSec=2 +RestartPreventExitStatus=1 +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/configs/volte.yaml.in b/configs/volte.yaml.in index 45b100776..a2f1106dc 100644 --- a/configs/volte.yaml.in +++ b/configs/volte.yaml.in @@ -2,21 +2,17 @@ db_uri: mongodb://localhost/open5gs logger: -sbi: - server: - no_tls: true - cacert: @build_configs_dir@/open5gs/tls/ca.crt - key: @build_configs_dir@/open5gs/tls/testserver.key - cert: @build_configs_dir@/open5gs/tls/testserver.crt - client: - no_tls: true - cacert: @build_configs_dir@/open5gs/tls/ca.crt - key: @build_configs_dir@/open5gs/tls/testclient.key - cert: @build_configs_dir@/open5gs/tls/testclient.crt +test: + serving: + - plmn_id: + mcc: 999 + mnc: 70 -parameter: +global: + parameter: # no_nrf: true # no_scp: true + no_sepp: true # no_amf: true # no_smf: true # no_upf: true @@ -31,233 +27,255 @@ parameter: # no_sgwu: true # no_pcrf: true # no_hss: true -# use_mongodb_change_stream: true mme: - freeDiameter: - identity: mme.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.8 + freeDiameter: + identity: mme.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.8 - s1ap: - - addr: 127.0.0.2 - gtpc: - - addr: 127.0.0.2 - gummei: - plmn_id: + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + gummei: + - plmn_id: mcc: 999 mnc: 70 mme_gid: 2 mme_code: 1 - tai: - plmn_id: + tai: + - plmn_id: mcc: 999 mnc: 70 tac: 1 - security: - integrity_order : [ EIA2, EIA1, EIA0 ] - ciphering_order : [ EEA0, EEA1, EEA2 ] - - network_name: - full: Open5GS + security: + integrity_order : [ EIA2, EIA1, EIA0 ] + ciphering_order : [ EEA0, EEA1, EEA2 ] + network_name: + full: Open5GS + time: + t3412: + value: 540 sgwc: - gtpc: - - addr: 127.0.0.3 - pfcp: - - addr: 127.0.0.3 + gtpc: + server: + - address: 127.0.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 smf: # sbi: -# - addr: 127.0.0.4 -# port: 7777 - pfcp: - - addr: 127.0.0.4 - gtpc: - - addr: 127.0.0.4 - - addr: ::1 - gtpu: - - addr: 127.0.0.4 - - addr: ::1 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - dns: - - 8.8.8.8 - - 8.8.4.4 - - 2001:4860:4860::8888 - - 2001:4860:4860::8844 - p-cscf: - - 127.0.0.1 - - ::1 - mtu: 1400 - freeDiameter: - identity: smf.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.9 +# server: +# - address: 127.0.0.4 +# port: 7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + dns: + - 8.8.8.8 + - 8.8.4.4 + - 2001:4860:4860::8888 + - 2001:4860:4860::8844 + p-cscf: + - 127.0.0.1 + - ::1 + mtu: 1400 + freeDiameter: + identity: smf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.9 amf: - sbi: - - addr: 127.0.0.5 + sbi: + server: + - address: 127.0.0.5 port: 7777 - ngap: - - addr: 127.0.0.5 - 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 + ngap: + server: + - address: 127.0.0.5 + 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: - - addr: 127.0.0.6 - gtpu: - - addr: 127.0.0.6 + pfcp: + server: + - address: 127.0.0.6 + gtpu: + server: + - address: 127.0.0.6 upf: - pfcp: - - addr: 127.0.0.7 - gtpu: - - addr: 127.0.0.7 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - metrics: - - addr: 127.0.0.7 + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 port: 9090 hss: - freeDiameter: - identity: hss.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.2 - - identity: ims.localdomain - addr: 127.0.0.1 + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 + - identity: ims.localdomain + address: 127.0.0.1 pcrf: - freeDiameter: - identity: pcrf.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.4 - - identity: ims.localdomain - addr: 127.0.0.1 - -#nrf: -# sbi: -# - addr: -# - 127.0.0.10 -# - ::1 -# port: 7777 + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 + - identity: ims.localdomain + address: 127.0.0.1 ausf: - sbi: - - addr: 127.0.0.11 + sbi: + server: + - address: 127.0.0.11 port: 7777 udm: - sbi: - - addr: 127.0.0.12 + sbi: + server: + - address: 127.0.0.12 port: 7777 pcf: - sbi: - - addr: 127.0.0.13 + sbi: + server: + - address: 127.0.0.13 port: 7777 - metrics: - - addr: 127.0.0.13 + metrics: + server: + - address: 127.0.0.13 port: 9090 nssf: - sbi: - - addr: 127.0.0.14 + sbi: + server: + - address: 127.0.0.14 port: 7777 - nsi: - - addr: 127.0.0.10 - port: 7777 - s_nssai: - sst: 1 + client: + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 bsf: - sbi: - - addr: 127.0.0.15 + sbi: + server: + - address: 127.0.0.15 port: 7777 udr: - sbi: - - addr: 127.0.0.20 + sbi: + server: + - address: 127.0.0.20 port: 7777 - -time: - t3412: - value: 540 # 9 mintues * 60 = 540 seconds - t3512: - value: 540 # 9 mintues * 60 = 540 seconds diff --git a/configs/vonr.yaml.in b/configs/vonr.yaml.in index e1c4c7ce1..9108f0bcc 100644 --- a/configs/vonr.yaml.in +++ b/configs/vonr.yaml.in @@ -2,21 +2,17 @@ db_uri: mongodb://localhost/open5gs logger: -sbi: - server: - no_tls: true - cacert: @build_configs_dir@/open5gs/tls/ca.crt - key: @build_configs_dir@/open5gs/tls/testserver.key - cert: @build_configs_dir@/open5gs/tls/testserver.crt - client: - no_tls: true - cacert: @build_configs_dir@/open5gs/tls/ca.crt - key: @build_configs_dir@/open5gs/tls/testclient.key - cert: @build_configs_dir@/open5gs/tls/testclient.crt +test: + serving: + - plmn_id: + mcc: 999 + mnc: 70 -parameter: +global: + parameter: # no_nrf: true # no_scp: true + no_sepp: true # no_amf: true # no_smf: true # no_upf: true @@ -31,241 +27,300 @@ parameter: # no_sgwu: true # no_pcrf: true # no_hss: true -# use_mongodb_change_stream: true mme: - freeDiameter: - identity: mme.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.8 + freeDiameter: + identity: mme.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.8 - s1ap: - - addr: 127.0.0.2 - gtpc: - - addr: 127.0.0.2 - gummei: - plmn_id: + s1ap: + server: + - address: 127.0.0.2 + gtpc: + server: + - address: 127.0.0.2 + client: + sgwc: + - address: 127.0.0.3 + smf: + - address: 127.0.0.4 + gummei: + - plmn_id: mcc: 999 mnc: 70 mme_gid: 2 mme_code: 1 - tai: - plmn_id: + tai: + - plmn_id: mcc: 999 mnc: 70 tac: 1 - security: - integrity_order : [ EIA2, EIA1, EIA0 ] - ciphering_order : [ EEA0, EEA1, EEA2 ] - - network_name: - full: Open5GS + security: + integrity_order : [ EIA2, EIA1, EIA0 ] + ciphering_order : [ EEA0, EEA1, EEA2 ] + network_name: + full: Open5GS + time: + t3412: + value: 540 sgwc: - gtpc: - - addr: 127.0.0.3 - pfcp: - - addr: 127.0.0.3 + gtpc: + server: + - address: 127.0.0.3 + pfcp: + server: + - address: 127.0.0.3 + client: + sgwu: + - address: 127.0.0.6 smf: - sbi: - - addr: 127.0.0.4 + sbi: + server: + - address: 127.0.0.4 port: 7777 - pfcp: - - addr: 127.0.0.4 - gtpc: - - addr: 127.0.0.4 - - addr: ::1 - gtpu: - - addr: 127.0.0.4 - - addr: ::1 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - dns: - - 8.8.8.8 - - 8.8.4.4 - - 2001:4860:4860::8888 - - 2001:4860:4860::8844 - p-cscf: - - 127.0.0.1 - - ::1 - mtu: 1400 - freeDiameter: - identity: smf.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.9 + client: + scp: + - uri: http://127.0.0.200:7777 + pfcp: + server: + - address: 127.0.0.4 + client: + upf: + - address: 127.0.0.7 + gtpc: + server: + - address: 127.0.0.4 + gtpu: + server: + - address: 127.0.0.4 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + dns: + - 8.8.8.8 + - 8.8.4.4 + - 2001:4860:4860::8888 + - 2001:4860:4860::8844 + p-cscf: + - 127.0.0.1 + - ::1 + mtu: 1400 + freeDiameter: + identity: smf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.9 amf: - sbi: - - addr: 127.0.0.5 + sbi: + server: + - address: 127.0.0.5 port: 7777 - ngap: - - addr: 127.0.0.5 - 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 + client: + scp: + - uri: http://127.0.0.200:7777 + ngap: + server: + - address: 127.0.0.5 + 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: - - addr: 127.0.0.6 - gtpu: - - addr: 127.0.0.6 + pfcp: + server: + - address: 127.0.0.6 + gtpu: + server: + - address: 127.0.0.6 upf: - pfcp: - - addr: 127.0.0.7 - gtpu: - - addr: 127.0.0.7 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 - metrics: - - addr: 127.0.0.7 + pfcp: + server: + - address: 127.0.0.7 + gtpu: + server: + - address: 127.0.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: + - address: 127.0.0.7 port: 9090 hss: - freeDiameter: - identity: hss.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.2 + freeDiameter: + identity: hss.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.2 pcrf: - freeDiameter: - identity: pcrf.localdomain - realm: localdomain - listen_on: 127.0.0.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 - addr: 127.0.0.4 - - identity: pcscf.localdomain - addr: 127.0.0.1 + freeDiameter: + identity: pcrf.localdomain + realm: localdomain + listen_on: 127.0.0.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.0.4 + - identity: pcscf.localdomain + address: 127.0.0.1 nrf: - sbi: - - addr: - - 127.0.0.10 - - ::1 + sbi: + server: + - address: 127.0.0.10 port: 7777 scp: - sbi: - - addr: 127.0.1.10 + sbi: + server: + - address: 127.0.0.200 port: 7777 + client: + nrf: + - uri: http://127.0.0.10:7777 ausf: - sbi: - - addr: 127.0.0.11 + sbi: + server: + - address: 127.0.0.11 port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 udm: - sbi: - - addr: 127.0.0.12 + sbi: + server: + - address: 127.0.0.12 port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 pcf: - sbi: - - addr: 127.0.0.13 + sbi: + server: + - address: 127.0.0.13 port: 7777 - metrics: - - addr: 127.0.0.13 + client: + scp: + - uri: http://127.0.0.200:7777 + metrics: + server: + - address: 127.0.0.13 port: 9090 nssf: - sbi: - - addr: 127.0.0.14 + sbi: + server: + - address: 127.0.0.14 port: 7777 - nsi: - - addr: 127.0.0.10 - port: 7777 - s_nssai: - sst: 1 + client: + scp: + - uri: http://127.0.0.200:7777 + nsi: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 bsf: - sbi: - - addr: 127.0.0.15 + sbi: + server: + - address: 127.0.0.15 port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 af: - sbi: - - addr: 127.0.0.16 + sbi: + server: + - address: 127.0.0.16 port: 7777 + client: + scp: + - uri: http://127.0.0.200:7777 udr: - sbi: - - addr: 127.0.0.20 + sbi: + server: + - address: 127.0.0.20 port: 7777 - -time: - t3412: - value: 540 # 9 mintues * 60 = 540 seconds - t3512: - value: 540 # 9 mintues * 60 = 540 seconds + client: + scp: + - uri: http://127.0.0.200:7777 diff --git a/debian/control b/debian/control index c10a0d0de..5923176a6 100644 --- a/debian/control +++ b/debian/control @@ -178,6 +178,18 @@ Description: SCP (Network Repository Function) . This package provides the SCP (Service Communication Proxy) +Package: open5gs-sepp +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, + ${misc:Depends}, + open5gs-common (= ${binary:Version}) +Description: SEPP (Security Edge Protection Proxy) + Open5GS is a C-language implementation of 5G Core and EPC + Packet Core, i.e. the core network of an NR/LTE network (Release-17) + . + This package provides the SEPP (Security Edge Protection Proxy) + Package: open5gs-ausf Architecture: any Multi-Arch: same diff --git a/docs/_docs/guide/01-quickstart.md b/docs/_docs/guide/01-quickstart.md index fe8644412..32100cccc 100644 --- a/docs/_docs/guide/01-quickstart.md +++ b/docs/_docs/guide/01-quickstart.md @@ -46,6 +46,7 @@ All of these Open5GS components have config files. Each config file contains the The Open5GS 5G SA Core contains the following functions: * NRF - NF Repository Function * SCP - Service Communication Proxy +* SEPP - Security Edge Protection Proxy * AMF - Access and Mobility Management Function * SMF - Session Management Function * UPF - User Plane Function @@ -56,7 +57,7 @@ The Open5GS 5G SA Core contains the following functions: * NSSF - Network Slice Selection Function * BSF - Binding Support Function -The 5G SA core works in a different way to the 4G core - it uses a **Service Based Architecture** (SBA). **Control plane** functions are configured to register with the NRF, and the NRF then helps them discover the other core functions. Running through the other functions: The AMF handles connection and mobility management; a subset of what the 4G MME is tasked with. gNBs (5G basestations) connect to the AMF. The UDM, AUSF and UDR carry out similar operations as the 4G HSS, generating SIM authentication vectors and holding the subscriber profile. Session management is all handled by the SMF (previously the responsibility of the 4G MME/ SGWC/ PGWC). The NSSF provides a way to select the network slice, and PCF is used for charging and enforcing subscriber policies. Finally there is the SCP that enable indirect communication. +The 5G SA core works in a different way to the 4G core - it uses a **Service Based Architecture** (SBA). **Control plane** functions are configured to register with the NRF, and the NRF then helps them discover the other core functions. Running through the other functions: The AMF handles connection and mobility management; a subset of what the 4G MME is tasked with. gNBs (5G basestations) connect to the AMF. The UDM, AUSF and UDR carry out similar operations as the 4G HSS, generating SIM authentication vectors and holding the subscriber profile. Session management is all handled by the SMF (previously the responsibility of the 4G MME/ SGWC/ PGWC). The NSSF provides a way to select the network slice, and PCF is used for charging and enforcing subscriber policies, and SEPP is part of the roaming security architecture. Finally there is the SCP that enable indirect communication. The 5G SA core **user plane** is much simpler, as it only contains a single function. The UPF carries user data packets between the gNB and the external WAN. It connects back to the SMF too. @@ -252,7 +253,10 @@ HSS-frDi = 127.0.0.8 :3868 for S6a, Cx PCRF-frDi = 127.0.0.9 :3868 for Gx NRF-sbi = 127.0.0.10:7777 for 5G SBI -SCP-sbi = 127.0.1.10:7777 for 5G SBI +SCP-sbi = 127.0.0.200:7777 for 5G SBI +SEPP-sbi = 127.0.0.250:7777 for 5G SBI +SEPP-n32 = 127.0.0.251:7777 for 5G N32 +SEPP-n32f = 127.0.0.252:7777 for 5G N32-f AUSF-sbi = 127.0.0.11:7777 for 5G SBI UDM-sbi = 127.0.0.12:7777 for 5G SBI PCF-sbi = 127.0.0.13:7777 for 5G SBI @@ -271,18 +275,21 @@ If you are aiming to connect an external eNB to your core, you will also need to Modify [/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC. ```diff -$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml ---- mme.yaml 2020-09-05 20:52:28.648235143 -0400 -+++ mme.yaml.new 2020-09-05 20:56:05.434484208 -0400 -@@ -253,20 +253,20 @@ mme: +$ diff --git a/configs/open5gs/mme.yaml.in b/configs/open5gs/mme.yaml.in +index db2cdaef1..2010f6691 100644 +--- a/configs/open5gs/mme.yaml.in ++++ b/configs/open5gs/mme.yaml.in +@@ -10,7 +10,7 @@ mme: + freeDiameter: @sysconfdir@/freeDiameter/mme.conf s1ap: -- - addr: 127.0.0.2 -+ - addr: 10.10.0.2 + server: +- - address: 127.0.0.2 ++ - address: 10.10.0.2 gtpc: - - addr: 127.0.0.2 - metrics: - addr: 127.0.0.2 - port: 9090 + server: + - address: 127.0.0.2 +@@ -25,14 +25,14 @@ mme: + port: 9090 gummei: plmn_id: - mcc: 999 @@ -305,18 +312,18 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml Modify [/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address. ```diff $ diff --git a/configs/open5gs/sgwu.yaml.in b/configs/open5gs/sgwu.yaml.in -index 8ccf94378..25b6884a3 100644 +index 7266e47fb..d640f0357 100644 --- a/configs/open5gs/sgwu.yaml.in +++ b/configs/open5gs/sgwu.yaml.in -@@ -100,7 +100,7 @@ sgwu: - pfcp: - - addr: 127.0.0.6 +@@ -15,7 +15,7 @@ sgwu: + # - address: 127.0.0.3 gtpu: -- - addr: 127.0.0.6 -+ - addr: 10.11.0.6 + server: +- - address: 127.0.0.6 ++ - address: 10.11.0.6 - # - # sgwc: + ################################################################################ + # PFCP Server ``` After changing config files, please restart Open5GS daemons. @@ -336,18 +343,20 @@ If you are aiming to connect an external gNB to your core, you will also need to Modify [/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/amf.yaml.in) to set the NGAP IP address, PLMN ID, TAC and NSSAI. ```diff -$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml ---- amf.yaml 2020-09-05 20:52:28.652234967 -0400 -+++ amf.yaml.new 2020-09-05 20:55:07.453114885 -0400 -@@ -293,26 +293,26 @@ amf: - - addr: 127.0.0.5 - port: 7777 +$ diff --git a/configs/open5gs/amf.yaml.in b/configs/open5gs/amf.yaml.in +index 938917e32..35d0ab5aa 100644 +--- a/configs/open5gs/amf.yaml.in ++++ b/configs/open5gs/amf.yaml.in +@@ -18,27 +18,27 @@ amf: + - uri: http://127.0.0.200:7777 ngap: -- - addr: 127.0.0.5 -+ - addr: 10.10.0.5 + server: +- - address: 127.0.0.5 ++ - address: 10.10.0.5 metrics: - addr: 127.0.0.5 - port: 9090 + server: + - address: 127.0.0.5 + port: 9090 guami: - plmn_id: - mcc: 999 @@ -377,18 +386,19 @@ $ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml Modify [/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/upf.yaml.in) to set the GTP-U address. ```diff -$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml ---- upf.yaml 2020-09-05 20:52:28.652234967 -0400 -+++ upf.yaml.new 2020-09-05 20:52:55.279052142 -0400 -@@ -168,7 +168,7 @@ upf: - pfcp: - - addr: 127.0.0.7 +$ diff --git a/configs/open5gs/upf.yaml.in b/configs/open5gs/upf.yaml.in +index e78b018f1..35a54419e 100644 +--- a/configs/open5gs/upf.yaml.in ++++ b/configs/open5gs/upf.yaml.in +@@ -15,7 +15,7 @@ upf: + # - address: 127.0.0.4 gtpu: -- - addr: 127.0.0.7 -+ - addr: 10.11.0.7 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 + server: +- - address: 127.0.0.7 ++ - address: 10.11.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 ``` After changing config files, please restart Open5GS daemons. @@ -502,6 +512,7 @@ $ sudo systemctl stop open5gs-hssd $ sudo systemctl stop open5gs-pcrfd $ sudo systemctl stop open5gs-nrfd $ sudo systemctl stop open5gs-scpd +$ sudo systemctl stop open5gs-seppd $ sudo systemctl stop open5gs-ausfd $ sudo systemctl stop open5gs-udmd $ sudo systemctl stop open5gs-pcfd @@ -522,6 +533,7 @@ $ sudo systemctl restart open5gs-hssd $ sudo systemctl restart open5gs-pcrfd $ sudo systemctl restart open5gs-nrfd $ sudo systemctl restart open5gs-scpd +$ sudo systemctl restart open5gs-seppd $ sudo systemctl restart open5gs-ausfd $ sudo systemctl restart open5gs-udmd $ sudo systemctl restart open5gs-pcfd diff --git a/docs/_docs/guide/02-building-open5gs-from-sources.md b/docs/_docs/guide/02-building-open5gs-from-sources.md index 4515b5794..34154ce38 100644 --- a/docs/_docs/guide/02-building-open5gs-from-sources.md +++ b/docs/_docs/guide/02-building-open5gs-from-sources.md @@ -113,18 +113,20 @@ $ cd ../ Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/amf.yaml.in) to set the NGAP IP address, PLMN ID, TAC and NSSAI. ```diff -$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml ---- amf.yaml 2020-09-05 20:52:28.652234967 -0400 -+++ amf.yaml.new 2020-09-05 20:55:07.453114885 -0400 -@@ -293,26 +293,26 @@ amf: - - addr: 127.0.0.5 - port: 7777 +$ diff --git a/configs/open5gs/amf.yaml.in b/configs/open5gs/amf.yaml.in +index 938917e32..35d0ab5aa 100644 +--- a/configs/open5gs/amf.yaml.in ++++ b/configs/open5gs/amf.yaml.in +@@ -18,27 +18,27 @@ amf: + - uri: http://127.0.0.200:7777 ngap: -- - addr: 127.0.0.5 -+ - addr: 10.10.0.5 + server: +- - address: 127.0.0.5 ++ - address: 10.10.0.5 metrics: - addr: 127.0.0.5 - port: 9090 + server: + - address: 127.0.0.5 + port: 9090 guami: - plmn_id: - mcc: 999 @@ -154,36 +156,40 @@ $ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml Modify [install/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/upf.yaml.in) to set the GTP-U and PFCP IP address. ```diff -$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml ---- upf.yaml 2020-09-05 20:52:28.652234967 -0400 -+++ upf.yaml.new 2020-09-05 20:52:55.279052142 -0400 -@@ -168,7 +168,7 @@ upf: - pfcp: - - addr: 127.0.0.7 +$ diff --git a/configs/open5gs/upf.yaml.in b/configs/open5gs/upf.yaml.in +index e78b018f1..35a54419e 100644 +--- a/configs/open5gs/upf.yaml.in ++++ b/configs/open5gs/upf.yaml.in +@@ -15,7 +15,7 @@ upf: + # - address: 127.0.0.4 gtpu: -- - addr: 127.0.0.7 -+ - addr: 10.11.0.7 - subnet: - - addr: 10.45.0.1/16 - - addr: 2001:db8:cafe::1/48 + server: +- - address: 127.0.0.7 ++ - address: 10.11.0.7 + session: + - subnet: 10.45.0.1/16 + - subnet: 2001:db8:cafe::1/48 ``` ##### 4G EPC Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC. ```diff -$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml ---- mme.yaml 2020-09-05 20:52:28.648235143 -0400 -+++ mme.yaml.new 2020-09-05 20:56:05.434484208 -0400 -@@ -253,20 +253,20 @@ mme: +$ diff --git a/configs/open5gs/mme.yaml.in b/configs/open5gs/mme.yaml.in +index db2cdaef1..2010f6691 100644 +--- a/configs/open5gs/mme.yaml.in ++++ b/configs/open5gs/mme.yaml.in +@@ -10,7 +10,7 @@ mme: + freeDiameter: @sysconfdir@/freeDiameter/mme.conf s1ap: -- - addr: 127.0.0.2 -+ - addr: 10.10.0.2 + server: +- - address: 127.0.0.2 ++ - address: 10.10.0.2 gtpc: - - addr: 127.0.0.2 - metrics: - addr: 127.0.0.2 - port: 9090 + server: + - address: 127.0.0.2 +@@ -25,14 +25,14 @@ mme: + port: 9090 gummei: plmn_id: - mcc: 999 @@ -206,18 +212,18 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address. ```diff $ diff --git a/configs/open5gs/sgwu.yaml.in b/configs/open5gs/sgwu.yaml.in -index 8ccf94378..25b6884a3 100644 +index 7266e47fb..d640f0357 100644 --- a/configs/open5gs/sgwu.yaml.in +++ b/configs/open5gs/sgwu.yaml.in -@@ -100,7 +100,7 @@ sgwu: - pfcp: - - addr: 127.0.0.6 +@@ -15,7 +15,7 @@ sgwu: + # - address: 127.0.0.3 gtpu: -- - addr: 127.0.0.6 -+ - addr: 10.11.0.6 + server: +- - address: 127.0.0.6 ++ - address: 10.11.0.6 - # - # sgwc: + ################################################################################ + # PFCP Server ``` If you modify the config files while Open5GS daemons are running, please restart them @@ -228,163 +234,172 @@ If you modify the config files while Open5GS daemons are running, please restart ```bash $ ./install/bin/open5gs-nrfd -Open5GS daemon v2.4.11-100-gbea24d7 +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:43:43.669: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/nrf.yaml' (../lib/app/ogs-init.c:126) -10/22 10:43:43.669: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/nrf.log' (../lib/app/ogs-init.c:129) -10/22 10:43:43.670: [sbi] INFO: nghttp2_server() [127.0.0.10]:7777 (../lib/sbi/nghttp2-server.c:150) -10/22 10:43:43.670: [sbi] INFO: nghttp2_server() [::1]:7777 (../lib/sbi/nghttp2-server.c:150) -10/22 10:43:43.671: [app] INFO: NRF initialize...done (../src/nrf/app.c:31) +10/02 10:09:15.476: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/nrf.yaml' (../lib/app/ogs-init.c:129) +10/02 10:09:15.476: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/nrf.log' (../lib/app/ogs-init.c:132) +10/02 10:09:15.478: [sbi] INFO: nghttp2_server() [http://127.0.0.10]:7777 (../lib/sbi/nghttp2-server.c:414) +10/02 10:09:15.478: [app] INFO: NRF initialize...done (../src/nrf/app.c:31) $ ./install/bin/open5gs-scpd -Open5GS daemon v2.4.11-100-gbea24d7 +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:43:45.709: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/scp.yaml' (../lib/app/ogs-init.c:126) -10/22 10:43:45.709: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/scp.log' (../lib/app/ogs-init.c:129) -10/22 10:43:45.711: [sbi] INFO: nghttp2_server() [127.0.1.10]:7777 (../lib/sbi/nghttp2-server.c:150) -10/22 10:43:45.712: [app] INFO: SCP initialize...done (../src/scp/app.c:31) +10/02 10:09:17.105: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/scp.yaml' (../lib/app/ogs-init.c:129) +10/02 10:09:17.105: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/scp.log' (../lib/app/ogs-init.c:132) +10/02 10:09:17.107: [sbi] INFO: nghttp2_server() [http://127.0.0.200]:7777 (../lib/sbi/nghttp2-server.c:414) +10/02 10:09:17.107: [app] INFO: SCP initialize...done (../src/scp/app.c:31) + +$ ./install/bin/open5gs-seppd -c ./install/etc/open5gs/sepp1.yaml +Open5GS daemon v2.6.4-59-g204ad57+ + +10/02 10:09:23.191: [app] INFO: Configuration: './install/etc/open5gs/sepp1.yaml' (../lib/app/ogs-init.c:129) +10/02 10:09:23.191: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sepp1.log' (../lib/app/ogs-init.c:132) +10/02 10:09:23.193: [sbi] INFO: nghttp2_server() [http://127.0.1.250]:7777 (../lib/sbi/nghttp2-server.c:414) +10/02 10:09:23.197: [sbi] INFO: nghttp2_server(n32f) [https://127.0.1.252]:7777 (../lib/sbi/nghttp2-server.c:414) +10/02 10:09:23.198: [sbi] INFO: nghttp2_server(sepp) [https://127.0.1.251]:7777 (../lib/sbi/nghttp2-server.c:414) +10/02 10:09:23.199: [app] INFO: SEPP initialize...done (../src/sepp/app.c:31) $ ./install/bin/open5gs-amfd -Open5GS daemon v2.4.11-100-gbea24d7 +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:44:01.416: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/amf.yaml' (../lib/app/ogs-init.c:126) -10/22 10:44:01.416: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/amf.log' (../lib/app/ogs-init.c:129) -10/22 10:44:01.419: [sbi] INFO: NF Service [namf-comm] (../lib/sbi/context.c:1401) -10/22 10:44:01.420: [sbi] INFO: nghttp2_server() [127.0.0.5]:7777 (../lib/sbi/nghttp2-server.c:150) -10/22 10:44:01.420: [amf] INFO: ngap_server() [127.0.0.5]:38412 (../src/amf/ngap-sctp.c:61) -10/22 10:44:01.420: [sctp] INFO: AMF initialize...done (../src/amf/app.c:33) +10/02 10:09:26.041: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/amf.yaml' (../lib/app/ogs-init.c:129) +10/02 10:09:26.041: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/amf.log' (../lib/app/ogs-init.c:132) +10/02 10:09:26.045: [metrics] INFO: metrics_server() [http://127.0.0.5]:9090 (../lib/metrics/prometheus/context.c:299) +10/02 10:09:26.045: [sbi] INFO: NF Service [namf-comm] (../lib/sbi/context.c:1744) +10/02 10:09:26.045: [sbi] INFO: nghttp2_server() [http://127.0.0.5]:7777 (../lib/sbi/nghttp2-server.c:414) +10/02 10:09:26.045: [amf] INFO: ngap_server() [127.0.0.5]:38412 (../src/amf/ngap-sctp.c:61) +10/02 10:09:26.046: [sctp] INFO: AMF initialize...done (../src/amf/app.c:33) $ ./install/bin/open5gs-smfd -Open5GS daemon v2.4.11-100-gbea24d7 +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:44:03.217: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/smf.yaml' (../lib/app/ogs-init.c:126) -10/22 10:44:03.217: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/smf.log' (../lib/app/ogs-init.c:129) -10/22 10:44:03.269: [gtp] INFO: gtp_server() [127.0.0.4]:2123 (../lib/gtp/path.c:30) -10/22 10:44:03.269: [gtp] INFO: gtp_server() [::1]:2123 (../lib/gtp/path.c:30) -10/22 10:44:03.269: [gtp] INFO: gtp_server() [127.0.0.4]:2152 (../lib/gtp/path.c:30) -10/22 10:44:03.269: [gtp] INFO: gtp_server() [::1]:2152 (../lib/gtp/path.c:30) -10/22 10:44:03.269: [pfcp] INFO: pfcp_server() [127.0.0.4]:8805 (../lib/pfcp/path.c:30) -10/22 10:44:03.269: [pfcp] INFO: pfcp_server() [::1]:8805 (../lib/pfcp/path.c:30) -10/22 10:44:03.269: [pfcp] INFO: ogs_pfcp_connect() [127.0.0.7]:8805 (../lib/pfcp/path.c:61) -10/22 10:44:03.269: [sbi] INFO: NF Service [nsmf-pdusession] (../lib/sbi/context.c:1401) -10/22 10:44:03.270: [sbi] INFO: nghttp2_server() [127.0.0.4]:7777 (../lib/sbi/nghttp2-server.c:150) -10/22 10:44:03.270: [app] INFO: SMF initialize...done (../src/smf/app.c:31) +10/02 10:09:27.887: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/smf.yaml' (../lib/app/ogs-init.c:129) +10/02 10:09:27.887: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/smf.log' (../lib/app/ogs-init.c:132) +10/02 10:09:27.947: [metrics] INFO: metrics_server() [http://127.0.0.4]:9090 (../lib/metrics/prometheus/context.c:299) +10/02 10:09:27.990: [gtp] INFO: gtp_server() [127.0.0.4]:2123 (../lib/gtp/path.c:30) +10/02 10:09:27.990: [gtp] INFO: gtp_server() [127.0.0.4]:2152 (../lib/gtp/path.c:30) +10/02 10:09:27.990: [pfcp] INFO: pfcp_server() [127.0.0.4]:8805 (../lib/pfcp/path.c:30) +10/02 10:09:27.990: [pfcp] INFO: ogs_pfcp_connect() [127.0.0.7]:8805 (../lib/pfcp/path.c:61) +10/02 10:09:27.990: [sbi] INFO: NF Service [nsmf-pdusession] (../lib/sbi/context.c:1744) +10/02 10:09:27.990: [sbi] INFO: nghttp2_server() [http://127.0.0.4]:7777 (../lib/sbi/nghttp2-server.c:414) +10/02 10:09:27.990: [app] INFO: SMF initialize...done (../src/smf/app.c:31) $ ./install/bin/open5gs-upfd -Open5GS daemon v2.4.11-100-gbea24d7 +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:44:06.884: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/upf.yaml' (../lib/app/ogs-init.c:126) -10/22 10:44:06.884: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/upf.log' (../lib/app/ogs-init.c:129) -10/22 10:44:06.892: [pfcp] INFO: pfcp_server() [127.0.0.7]:8805 (../lib/pfcp/path.c:30) -10/22 10:44:06.892: [gtp] INFO: gtp_server() [127.0.0.7]:2152 (../lib/gtp/path.c:30) -10/22 10:44:06.892: [app] INFO: UPF initialize...done (../src/upf/app.c:31) +10/02 10:09:34.259: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/upf.yaml' (../lib/app/ogs-init.c:129) +10/02 10:09:34.259: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/upf.log' (../lib/app/ogs-init.c:132) +10/02 10:09:34.340: [metrics] INFO: metrics_server() [http://127.0.0.7]:9090 (../lib/metrics/prometheus/context.c:299) +10/02 10:09:34.340: [pfcp] INFO: pfcp_server() [127.0.0.7]:8805 (../lib/pfcp/path.c:30) +10/02 10:09:34.341: [gtp] INFO: gtp_server() [127.0.0.7]:2152 (../lib/gtp/path.c:30) +10/02 10:09:34.343: [app] INFO: UPF initialize...done (../src/upf/app.c:31) -$./install/bin/open5gs-ausfd -Open5GS daemon v2.4.11-100-gbea24d7 +$ ./install/bin/open5gs-ausfd +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:44:08.747: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/ausf.yaml' (../lib/app/ogs-init.c:126) -10/22 10:44:08.747: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/ausf.log' (../lib/app/ogs-init.c:129) -10/22 10:44:08.748: [sbi] INFO: NF Service [nausf-auth] (../lib/sbi/context.c:1401) -10/22 10:44:08.749: [sbi] INFO: nghttp2_server() [127.0.0.11]:7777 (../lib/sbi/nghttp2-server.c:150) -10/22 10:44:08.749: [app] INFO: AUSF initialize...done (../src/ausf/app.c:31) +10/02 10:09:35.832: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/ausf.yaml' (../lib/app/ogs-init.c:129) +10/02 10:09:35.832: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/ausf.log' (../lib/app/ogs-init.c:132) +10/02 10:09:35.834: [sbi] INFO: NF Service [nausf-auth] (../lib/sbi/context.c:1744) +10/02 10:09:35.834: [sbi] INFO: nghttp2_server() [http://127.0.0.11]:7777 (../lib/sbi/nghttp2-server.c:414) +10/02 10:09:35.835: [app] INFO: AUSF initialize...done (../src/ausf/app.c:31) $ ./install/bin/open5gs-udmd -Open5GS daemon v2.4.11-100-gbea24d7 +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:44:10.724: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udm.yaml' (../lib/app/ogs-init.c:126) -10/22 10:44:10.724: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/udm.log' (../lib/app/ogs-init.c:129) -10/22 10:44:10.726: [sbi] INFO: NF Service [nudm-ueau] (../lib/sbi/context.c:1401) -10/22 10:44:10.726: [sbi] INFO: NF Service [nudm-uecm] (../lib/sbi/context.c:1401) -10/22 10:44:10.726: [sbi] INFO: NF Service [nudm-sdm] (../lib/sbi/context.c:1401) -10/22 10:44:10.727: [sbi] INFO: nghttp2_server() [127.0.0.12]:7777 (../lib/sbi/nghttp2-server.c:150) -10/22 10:44:10.727: [app] INFO: UDM initialize...done (../src/udm/app.c:31) +10/02 10:09:40.766: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udm.yaml' (../lib/app/ogs-init.c:129) +10/02 10:09:40.766: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/udm.log' (../lib/app/ogs-init.c:132) +10/02 10:09:40.768: [sbi] INFO: NF Service [nudm-ueau] (../lib/sbi/context.c:1744) +10/02 10:09:40.768: [sbi] INFO: NF Service [nudm-uecm] (../lib/sbi/context.c:1744) +10/02 10:09:40.768: [sbi] INFO: NF Service [nudm-sdm] (../lib/sbi/context.c:1744) +10/02 10:09:40.768: [sbi] INFO: nghttp2_server() [http://127.0.0.12]:7777 (../lib/sbi/nghttp2-server.c:414) +10/02 10:09:40.769: [app] INFO: UDM initialize...done (../src/udm/app.c:31) -$./install/bin/open5gs-pcfd -Open5GS daemon v2.4.11-100-gbea24d7 +$ ./install/bin/open5gs-pcfd +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:44:14.265: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcf.yaml' (../lib/app/ogs-init.c:126) -10/22 10:44:14.265: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcf.log' (../lib/app/ogs-init.c:129) -10/22 10:44:14.269: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:130) -10/22 10:44:14.269: [sbi] INFO: NF Service [npcf-am-policy-control] (../lib/sbi/context.c:1401) -10/22 10:44:14.269: [sbi] INFO: NF Service [npcf-smpolicycontrol] (../lib/sbi/context.c:1401) -10/22 10:44:14.269: [sbi] INFO: NF Service [npcf-policyauthorization] (../lib/sbi/context.c:1401) -10/22 10:44:14.269: [sbi] INFO: nghttp2_server() [127.0.0.13]:7777 (../lib/sbi/nghttp2-server.c:150) -10/22 10:44:14.269: [app] INFO: PCF initialize...done (../src/pcf/app.c:31) +10/02 10:09:43.335: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcf.yaml' (../lib/app/ogs-init.c:129) +10/02 10:09:43.335: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcf.log' (../lib/app/ogs-init.c:132) +10/02 10:09:43.337: [metrics] INFO: metrics_server() [http://127.0.0.13]:9090 (../lib/metrics/prometheus/context.c:299) +10/02 10:09:43.340: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:130) +10/02 10:09:43.340: [sbi] INFO: NF Service [npcf-am-policy-control] (../lib/sbi/context.c:1744) +10/02 10:09:43.340: [sbi] INFO: NF Service [npcf-smpolicycontrol] (../lib/sbi/context.c:1744) +10/02 10:09:43.340: [sbi] INFO: NF Service [npcf-policyauthorization] (../lib/sbi/context.c:1744) +10/02 10:09:43.340: [sbi] INFO: nghttp2_server() [http://127.0.0.13]:7777 (../lib/sbi/nghttp2-server.c:414) +10/02 10:09:43.340: [app] INFO: PCF initialize...done (../src/pcf/app.c:31) $ ./install/bin/open5gs-nssfd -Open5GS daemon v2.4.11-100-gbea24d7 +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:44:16.250: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/nssf.yaml' (../lib/app/ogs-init.c:126) -10/22 10:44:16.250: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/nssf.log' (../lib/app/ogs-init.c:129) -10/22 10:44:16.252: [sbi] INFO: NF Service [nnssf-nsselection] (../lib/sbi/context.c:1401) -10/22 10:44:16.252: [sbi] INFO: nghttp2_server() [127.0.0.14]:7777 (../lib/sbi/nghttp2-server.c:150) -10/22 10:44:16.252: [app] INFO: NSSF initialize...done (../src/nssf/app.c:31) +10/02 10:09:44.960: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/nssf.yaml' (../lib/app/ogs-init.c:129) +10/02 10:09:44.960: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/nssf.log' (../lib/app/ogs-init.c:132) +10/02 10:09:44.962: [sbi] INFO: NF Service [nnssf-nsselection] (../lib/sbi/context.c:1744) +10/02 10:09:44.962: [sbi] INFO: nghttp2_server() [http://127.0.0.14]:7777 (../lib/sbi/nghttp2-server.c:414) +10/02 10:09:44.962: [app] INFO: NSSF initialize...done (../src/nssf/app.c:31) $ ./install/bin/open5gs-bsfd -Open5GS daemon v2.4.11-100-gbea24d7 +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:44:18.836: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/bsf.yaml' (../lib/app/ogs-init.c:126) -10/22 10:44:18.836: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/bsf.log' (../lib/app/ogs-init.c:129) -10/22 10:44:18.837: [sbi] INFO: NF Service [nbsf-management] (../lib/sbi/context.c:1401) -10/22 10:44:18.837: [sbi] INFO: nghttp2_server() [127.0.0.15]:7777 (../lib/sbi/nghttp2-server.c:150) -10/22 10:44:18.837: [app] INFO: BSF initialize...done (../src/bsf/app.c:31) +10/02 10:09:47.413: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/bsf.yaml' (../lib/app/ogs-init.c:129) +10/02 10:09:47.413: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/bsf.log' (../lib/app/ogs-init.c:132) +10/02 10:09:47.415: [sbi] INFO: NF Service [nbsf-management] (../lib/sbi/context.c:1744) +10/02 10:09:47.415: [sbi] INFO: nghttp2_server() [http://127.0.0.15]:7777 (../lib/sbi/nghttp2-server.c:414) +10/02 10:09:47.415: [app] INFO: BSF initialize...done (../src/bsf/app.c:31) $ ./install/bin/open5gs-udrd -Open5GS daemon v2.4.11-100-gbea24d7 +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:44:24.018: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udr.yaml' (../lib/app/ogs-init.c:126) -10/22 10:44:24.018: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/udr.log' (../lib/app/ogs-init.c:129) -10/22 10:44:24.021: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:130) -10/22 10:44:24.021: [sbi] INFO: NF Service [nudr-dr] (../lib/sbi/context.c:1401) -10/22 10:44:24.021: [sbi] INFO: nghttp2_server() [127.0.0.20]:7777 (../lib/sbi/nghttp2-server.c:150) -10/22 10:44:24.021: [app] INFO: UDR initialize...done (../src/udr/app.c:31) +10/02 10:09:49.159: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udr.yaml' (../lib/app/ogs-init.c:129) +10/02 10:09:49.159: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/udr.log' (../lib/app/ogs-init.c:132) +10/02 10:09:49.162: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:130) +10/02 10:09:49.162: [sbi] INFO: NF Service [nudr-dr] (../lib/sbi/context.c:1744) +10/02 10:09:49.162: [sbi] INFO: nghttp2_server() [http://127.0.0.20]:7777 (../lib/sbi/nghttp2-server.c:414) +10/02 10:09:49.162: [app] INFO: UDR initialize...done (../src/udr/app.c:31) $ ./install/bin/open5gs-mmed -Open5GS daemon v2.4.11-100-gbea24d7 +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:44:26.011: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/mme.yaml' (../lib/app/ogs-init.c:126) -10/22 10:44:26.011: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/mme.log' (../lib/app/ogs-init.c:129) -10/22 10:44:26.062: [gtp] INFO: gtp_server() [127.0.0.2]:2123 (../lib/gtp/path.c:30) -10/22 10:44:26.063: [gtp] INFO: gtp_connect() [127.0.0.3]:2123 (../lib/gtp/path.c:60) -10/22 10:44:26.063: [mme] INFO: s1ap_server() [127.0.0.2]:36412 (../src/mme/s1ap-sctp.c:62) -10/22 10:44:26.063: [sctp] INFO: MME initialize...done (../src/mme/app-init.c:33) +10/02 10:09:54.793: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/mme.yaml' (../lib/app/ogs-init.c:129) +10/02 10:09:54.793: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/mme.log' (../lib/app/ogs-init.c:132) +10/02 10:09:54.796: [metrics] INFO: metrics_server() [http://127.0.0.2]:9090 (../lib/metrics/prometheus/context.c:299) +10/02 10:09:54.844: [gtp] INFO: gtp_server() [127.0.0.2]:2123 (../lib/gtp/path.c:30) +10/02 10:09:54.844: [gtp] INFO: gtp_connect() [127.0.0.3]:2123 (../lib/gtp/path.c:60) +10/02 10:09:54.844: [mme] INFO: s1ap_server() [127.0.0.2]:36412 (../src/mme/s1ap-sctp.c:62) +10/02 10:09:54.844: [sctp] INFO: MME initialize...done (../src/mme/app-init.c:33) $ ./install/bin/open5gs-sgwcd -Open5GS daemon v2.4.11-100-gbea24d7 +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:44:29.050: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwc.yaml' (../lib/app/ogs-init.c:126) -10/22 10:44:29.050: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sgwc.log' (../lib/app/ogs-init.c:129) -10/22 10:44:29.058: [gtp] INFO: gtp_server() [127.0.0.3]:2123 (../lib/gtp/path.c:30) -10/22 10:44:29.058: [pfcp] INFO: pfcp_server() [127.0.0.3]:8805 (../lib/pfcp/path.c:30) -10/22 10:44:29.058: [pfcp] INFO: ogs_pfcp_connect() [127.0.0.6]:8805 (../lib/pfcp/path.c:61) -10/22 10:44:29.058: [app] INFO: SGW-C initialize...done (../src/sgwc/app.c:31) +10/02 10:09:57.549: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwc.yaml' (../lib/app/ogs-init.c:129) +10/02 10:09:57.549: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sgwc.log' (../lib/app/ogs-init.c:132) +10/02 10:09:57.607: [gtp] INFO: gtp_server() [127.0.0.3]:2123 (../lib/gtp/path.c:30) +10/02 10:09:57.607: [pfcp] INFO: pfcp_server() [127.0.0.3]:8805 (../lib/pfcp/path.c:30) +10/02 10:09:57.607: [pfcp] INFO: ogs_pfcp_connect() [127.0.0.6]:8805 (../lib/pfcp/path.c:61) +10/02 10:09:57.607: [app] INFO: SGW-C initialize...done (../src/sgwc/app.c:31) $ ./install/bin/open5gs-sgwud -Open5GS daemon v2.4.11-100-gbea24d7 +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:44:36.178: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwu.yaml' (../lib/app/ogs-init.c:126) -10/22 10:44:36.178: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sgwu.log' (../lib/app/ogs-init.c:129) -10/22 10:44:36.185: [pfcp] INFO: pfcp_server() [127.0.0.6]:8805 (../lib/pfcp/path.c:30) -10/22 10:44:36.185: [gtp] INFO: gtp_server() [127.0.0.6]:2152 (../lib/gtp/path.c:30) -10/22 10:44:36.185: [app] INFO: SGW-U initialize...done (../src/sgwu/app.c:31) +10/02 10:10:01.720: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwu.yaml' (../lib/app/ogs-init.c:129) +10/02 10:10:01.720: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sgwu.log' (../lib/app/ogs-init.c:132) +10/02 10:10:01.775: [pfcp] INFO: pfcp_server() [127.0.0.6]:8805 (../lib/pfcp/path.c:30) +10/02 10:10:01.775: [gtp] INFO: gtp_server() [127.0.0.6]:2152 (../lib/gtp/path.c:30) +10/02 10:10:01.776: [app] INFO: SGW-U initialize...done (../src/sgwu/app.c:31) $ ./install/bin/open5gs-hssd -Open5GS daemon v2.4.11-100-gbea24d7 +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:49:22.963: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/hss.yaml' (../lib/app/ogs-init.c:126) -10/22 10:49:22.963: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/hss.log' (../lib/app/ogs-init.c:129) -10/22 10:49:22.965: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:130) -10/22 10:49:22.996: [app] INFO: HSS initialize...done (../src/hss/app-init.c:31) -10/22 10:49:22.997: [diam] INFO: CONNECTED TO 'mme.localdomain' (SCTP,soc#15): (../lib/diameter/common/logger.c:108) +10/02 10:10:05.765: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/hss.yaml' (../lib/app/ogs-init.c:129) +10/02 10:10:05.765: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/hss.log' (../lib/app/ogs-init.c:132) +10/02 10:10:05.766: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:130) +10/02 10:10:05.853: [app] INFO: HSS initialize...done (../src/hss/app-init.c:31) $ ./install/bin/open5gs-pcrfd -Open5GS daemon v2.4.11-100-gbea24d7 +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:49:26.089: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcrf.yaml' (../lib/app/ogs-init.c:126) -10/22 10:49:26.089: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcrf.log' (../lib/app/ogs-init.c:129) -10/22 10:49:26.091: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:130) -10/22 10:49:26.124: [app] INFO: PCRF initialize...done (../src/pcrf/app-init.c:31) -10/22 10:49:26.125: [diam] INFO: CONNECTED TO 'smf.localdomain' (SCTP,soc#15): (../lib/diameter/common/logger.c:108) +10/02 10:10:07.843: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcrf.yaml' (../lib/app/ogs-init.c:129) +10/02 10:10:07.843: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcrf.log' (../lib/app/ogs-init.c:132) +10/02 10:10:07.844: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:130) +10/02 10:10:07.879: [app] INFO: PCRF initialize...done (../src/pcrf/app-init.c:31) ``` Several command line options are provided. @@ -584,37 +599,29 @@ You can use the command line option[`-d`] to record more logs. ```bash $ ./tests/app/app -d -Open5GS daemon v2.4.11-100-gbea24d7 +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:59:03.813: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/build/configs/sample.yaml' (../lib/app/ogs-init.c:126) -10/22 10:59:03.813: [thread] DEBUG: [0x55fab86aff40] worker signal (../lib/core/ogs-thread.c:66) -10/22 10:59:03.813: [thread] DEBUG: [0x55fab86aff40] thread started (../lib/core/ogs-thread.c:101) -Open5GS daemon v2.4.11-100-gbea24d7 +10/02 10:13:57.009: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/build/configs/sample.yaml' (../lib/app/ogs-init.c:129) +10/02 10:13:57.009: [thread] DEBUG: [0x560e00a20420] worker signal (../lib/core/ogs-thread.c:66) +10/02 10:13:57.009: [thread] DEBUG: [0x560e00a20420] thread started (../lib/core/ogs-thread.c:104) +Open5GS daemon v2.6.4-59-g204ad57+ -10/22 10:59:03.818: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/build/configs/sample.yaml' (../lib/app/ogs-init.c:126) -10/22 10:59:03.819: [sock] DEBUG: addr:127.0.0.10, port:7777 (../lib/core/ogs-sockaddr.c:140) -10/22 10:59:03.819: [sock] DEBUG: addr:::1, port:7777 (../lib/core/ogs-sockaddr.c:140) -10/22 10:59:03.819: [sock] DEBUG: addr:127.0.1.10, port:7777 (../lib/core/ogs-sockaddr.c:140) -10/22 10:59:03.819: [sock] DEBUG: socket create(2:1:6) (../lib/core/ogs-socket.c:92) -10/22 10:59:03.819: [sock] DEBUG: Turn on TCP_NODELAY (../lib/core/ogs-sockopt.c:139) -10/22 10:59:03.819: [sock] DEBUG: Turn on SO_REUSEADDR (../lib/core/ogs-sockopt.c:120) -10/22 10:59:03.819: [sock] DEBUG: socket bind 127.0.0.10:7777 (../lib/core/ogs-socket.c:117) -10/22 10:59:03.819: [sock] DEBUG: tcp_server() [127.0.0.10]:7777 (../lib/core/ogs-tcp.c:60) -10/22 10:59:03.819: [sbi] INFO: nghttp2_server() [127.0.0.10]:7777 (../lib/sbi/nghttp2-server.c:150) -10/22 10:59:03.819: [sock] DEBUG: socket create(10:1:6) (../lib/core/ogs-socket.c:92) -10/22 10:59:03.819: [sock] DEBUG: Turn on TCP_NODELAY (../lib/core/ogs-sockopt.c:139) -10/22 10:59:03.819: [sock] DEBUG: Turn on SO_REUSEADDR (../lib/core/ogs-sockopt.c:120) -10/22 10:59:03.819: [sock] DEBUG: socket bind ::1:7777 (../lib/core/ogs-socket.c:117) -10/22 10:59:03.819: [sock] DEBUG: tcp_server() [::1]:7777 (../lib/core/ogs-tcp.c:60) -10/22 10:59:03.819: [sbi] INFO: nghttp2_server() [::1]:7777 (../lib/sbi/nghttp2-server.c:150) -10/22 10:59:03.819: [thread] DEBUG: [0x5601b141e520] worker signal (../lib/core/ogs-thread.c:66) -10/22 10:59:03.819: [nrf] DEBUG: nrf_state_initial(): INIT (../src/nrf/nrf-sm.c:25) -10/22 10:59:03.819: [nrf] DEBUG: nrf_state_operational(): ENTRY (../src/nrf/nrf-sm.c:50) -10/22 10:59:03.819: [thread] DEBUG: [0x5601b141e520] thread started (../lib/core/ogs-thread.c:101) -10/22 10:59:03.819: [app] INFO: NRF initialize...done (../src/nrf/app.c:31) -10/22 10:59:03.864: [thread] DEBUG: [0x55fab86d2100] worker signal (../lib/core/ogs-thread.c:66) -10/22 10:59:03.864: [thread] DEBUG: [0x55fab86d2100] thread started (../lib/core/ogs-thread.c:101) -Open5GS daemon v2.4.11-100-gbea24d7 +10/02 10:13:57.015: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/build/configs/sample.yaml' (../lib/app/ogs-init.c:129) +10/02 10:13:57.017: [sock] DEBUG: addr:127.0.0.10, port:7777 (../lib/core/ogs-sockaddr.c:143) +10/02 10:13:57.017: [sock] DEBUG: socket create(2:1:6) (../lib/core/ogs-socket.c:97) +10/02 10:13:57.017: [sock] DEBUG: Turn on TCP_NODELAY (../lib/core/ogs-sockopt.c:139) +10/02 10:13:57.017: [sock] DEBUG: Turn on SO_REUSEADDR (../lib/core/ogs-sockopt.c:120) +10/02 10:13:57.017: [sock] DEBUG: socket bind 127.0.0.10:7777 (../lib/core/ogs-socket.c:122) +10/02 10:13:57.017: [sock] DEBUG: tcp_server() [127.0.0.10]:7777 (../lib/core/ogs-tcp.c:60) +10/02 10:13:57.017: [sbi] INFO: nghttp2_server() [http://127.0.0.10]:7777 (../lib/sbi/nghttp2-server.c:414) +10/02 10:13:57.017: [thread] DEBUG: [0x559919881ac0] worker signal (../lib/core/ogs-thread.c:66) +10/02 10:13:57.017: [nrf] DEBUG: nrf_state_initial(): INIT (../src/nrf/nrf-sm.c:25) +10/02 10:13:57.017: [nrf] DEBUG: nrf_state_operational(): ENTRY (../src/nrf/nrf-sm.c:52) +10/02 10:13:57.017: [thread] DEBUG: [0x559919881ac0] thread started (../lib/core/ogs-thread.c:104) +10/02 10:13:57.017: [app] INFO: NRF initialize...done (../src/nrf/app.c:31) +10/02 10:13:57.060: [thread] DEBUG: [0x560e00a3a880] worker signal (../lib/core/ogs-thread.c:66) +10/02 10:13:57.060: [thread] DEBUG: [0x560e00a3a880] thread started (../lib/core/ogs-thread.c:104) +Open5GS daemon v2.6.4-59-g204ad57+ ... ``` diff --git a/docs/_docs/platform/02-centos.md b/docs/_docs/platform/02-centos.md index 1f49d252f..563fa4096 100644 --- a/docs/_docs/platform/02-centos.md +++ b/docs/_docs/platform/02-centos.md @@ -333,10 +333,10 @@ $ cd build $ ninja install $ cd ../ $ ls install/bin -open5gs-amfd open5gs-mmed open5gs-pcrfd open5gs-smfd -open5gs-ausfd open5gs-nrfd open5gs-scpd open5gs-udmd -open5gs-bsfd open5gs-nssfd open5gs-sgwcd open5gs-udrd -open5gs-hssd open5gs-pcfd open5gs-sgwud open5gs-upfd +open5gs-amfd open5gs-mmed open5gs-pcrfd open5gs-sgwud open5gs-upfd +open5gs-ausfd open5gs-nrfd open5gs-scpd open5gs-smfd +open5gs-bsfd open5gs-nssfd open5gs-seppd open5gs-udmd +open5gs-hssd open5gs-pcfd open5gs-sgwcd open5gs-udrd ``` ## Building WebUI of Open5GS diff --git a/docs/_docs/platform/05-macosx-apple-silicon.md b/docs/_docs/platform/05-macosx-apple-silicon.md index 9049ff48d..50005a5fe 100644 --- a/docs/_docs/platform/05-macosx-apple-silicon.md +++ b/docs/_docs/platform/05-macosx-apple-silicon.md @@ -53,7 +53,6 @@ $ sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.4 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255 -$ sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.6 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.7 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.8 netmask 255.255.255.255 @@ -69,7 +68,18 @@ $ sudo ifconfig lo0 alias 127.0.0.17 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255 -$ sudo ifconfig lo0 alias 127.0.1.10 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.200 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.201 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.202 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.250 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.251 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.252 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.1.250 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.1.251 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.1.252 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.2.250 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.2.251 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.2.252 netmask 255.255.255.255 ``` Enable IP forwarding & Masquerading diff --git a/docs/_docs/platform/06-macosx-intel.md b/docs/_docs/platform/06-macosx-intel.md index a006d9d5a..8764b2809 100644 --- a/docs/_docs/platform/06-macosx-intel.md +++ b/docs/_docs/platform/06-macosx-intel.md @@ -53,7 +53,6 @@ $ sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.4 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255 -$ sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.6 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.7 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.8 netmask 255.255.255.255 @@ -69,7 +68,18 @@ $ sudo ifconfig lo0 alias 127.0.0.17 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255 -$ sudo ifconfig lo0 alias 127.0.1.10 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.200 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.201 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.202 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.250 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.251 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.252 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.1.250 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.1.251 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.1.252 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.2.250 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.2.251 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.2.252 netmask 255.255.255.255 ``` Enable IP forwarding & Masquerading diff --git a/docs/_docs/platform/07-freebsd.md b/docs/_docs/platform/07-freebsd.md index 0ee173496..26ec88cc5 100644 --- a/docs/_docs/platform/07-freebsd.md +++ b/docs/_docs/platform/07-freebsd.md @@ -73,7 +73,6 @@ $ sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.4 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255 -$ sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.6 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.7 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.8 netmask 255.255.255.255 @@ -89,7 +88,18 @@ $ sudo ifconfig lo0 alias 127.0.0.17 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255 $ sudo ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255 -$ sudo ifconfig lo0 alias 127.0.1.10 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.200 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.201 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.202 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.250 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.251 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.0.252 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.1.250 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.1.251 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.1.252 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.2.250 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.2.251 netmask 255.255.255.255 +$ sudo ifconfig lo0 alias 127.0.2.252 netmask 255.255.255.255 ``` Enable IP forwarding diff --git a/docs/_docs/troubleshoot/01-simple-issues.md b/docs/_docs/troubleshoot/01-simple-issues.md index a4ad0bf9a..bed0d10ca 100644 --- a/docs/_docs/troubleshoot/01-simple-issues.md +++ b/docs/_docs/troubleshoot/01-simple-issues.md @@ -163,17 +163,18 @@ Problem with Open5GS can be filed as [GitHub Issues](https://github.com/{{ site. You can modify the configuration file to record more logs. ```diff -$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml ---- amf.yaml.old 2020-08-22 12:26:56.132213488 -0400 -+++ amf.yaml 2020-08-22 12:27:04.135901201 -0400 -@@ -20,6 +20,7 @@ - # +$ diff --git a/configs/open5gs/amf.yaml.in b/configs/open5gs/amf.yaml.in +index a70143f08..e0dba560c 100644 +--- a/configs/open5gs/amf.yaml.in ++++ b/configs/open5gs/amf.yaml.in +@@ -1,6 +1,6 @@ logger: file: @localstatedir@/log/open5gs/amf.log +-# level: info # fatal|error|warn|info(default)|debug|trace + level: debug - # - # amf: + max: + ue: 1024 # The number of UE can be increased depending on memory size. ``` After changing conf files, please restart Open5GS daemons. diff --git a/docs/_docs/troubleshoot/02-now-in-github-issues.md b/docs/_docs/troubleshoot/02-now-in-github-issues.md index 274e82fff..31e0ccbad 100644 --- a/docs/_docs/troubleshoot/02-now-in-github-issues.md +++ b/docs/_docs/troubleshoot/02-now-in-github-issues.md @@ -277,6 +277,7 @@ $ sudo pkill -9 open5gs-hssd $ sudo pkill -9 open5gs-pcrfd $ sudo pkill -9 open5gs-nrfd $ sudo pkill -9 open5gs-scpd +$ sudo pkill -9 open5gs-seppd $ sudo pkill -9 open5gs-ausfd $ sudo pkill -9 open5gs-udmd $ sudo pkill -9 open5gs-pcfd @@ -310,32 +311,28 @@ To add a slice with SST of 1 and SD of 000080, you need to update the configurat ### amf.yaml $ diff --git a/configs/open5gs/amf.yaml.in b/configs/open5gs/amf.yaml.in -index 7e939e81..dfe4456d 100644 +index a70143f08..e0dba560c 100644 --- a/configs/open5gs/amf.yaml.in +++ b/configs/open5gs/amf.yaml.in -@@ -315,6 +315,12 @@ amf: - mnc: 70 - s_nssai: - - sst: 1 -+ - plmn_id: -+ mcc: 999 -+ mnc: 70 -+ s_nssai: -+ - sst: 1 -+ sd: 000080 - security: - integrity_order : [ NIA2, NIA1, NIA0 ] - ciphering_order : [ NEA0, NEA1, NEA2 ] +@@ -1,6 +1,6 @@ + logger: + file: @localstatedir@/log/open5gs/amf.log +-# level: info # fatal|error|warn|info(default)|debug|trace ++ level: debug + + max: + ue: 1024 # The number of UE can be increased depending on memory size. + ### FIRST smf.yaml $ diff --git a/configs/open5gs/smf.yaml.in b/configs/open5gs/smf.yaml.in -index d45aa60f..701ee533 100644 +index 758ca9cb9..6800eeeec 100644 --- a/configs/open5gs/smf.yaml.in +++ b/configs/open5gs/smf.yaml.in -@@ -442,6 +442,11 @@ logger: - # - +@@ -7,6 +7,11 @@ max: + # peer: 64 + smf: + info: + - s_nssai: @@ -343,18 +340,19 @@ index d45aa60f..701ee533 100644 + dnn: + - internet sbi: - - addr: 127.0.0.4 - port: 7777 + server: + - address: 127.0.0.4 + ### SECOND smf.yaml $ diff --git a/configs/open5gs/smf.yaml.in b/configs/open5gs/smf.yaml.in -index d45aa60f..949da220 100644 +index 758ca9cb9..c3879fc70 100644 --- a/configs/open5gs/smf.yaml.in +++ b/configs/open5gs/smf.yaml.in -@@ -442,6 +442,12 @@ logger: - # - +@@ -7,6 +7,12 @@ max: + # peer: 64 + smf: + info: + - s_nssai: @@ -363,27 +361,33 @@ index d45aa60f..949da220 100644 + dnn: + - internet sbi: - - addr: 127.0.0.4 - port: 7777 + server: + - address: 127.0.0.4 + ### nssf.yaml + $ diff --git a/configs/open5gs/nssf.yaml.in b/configs/open5gs/nssf.yaml.in -index ecd4f7e2..04d9c4ba 100644 +index d01645b2c..48ed3f8ee 100644 --- a/configs/open5gs/nssf.yaml.in +++ b/configs/open5gs/nssf.yaml.in -@@ -201,6 +201,12 @@ nssf: - port: 7777 - s_nssai: - sst: 1 -+ - addr: 127.0.0.10 -+ port: 7777 -+ s_nssai: -+ sst: 1 -+ sd: 000080 +@@ -20,6 +20,11 @@ nssf: + - uri: http://127.0.0.10:7777 + s_nssai: + sst: 1 ++ - uri: http://127.0.0.10:7777 ++ s_nssai: ++ sst: 1 ++ sd: 000080 + - # - # scp: + ################################################################################ + # SBI Server + ################################################################################ + + ################################################################################ + # Network Slice Instance(NSI) + ################################################################################ ``` Then add a slice to MongoDB's subscriber info. @@ -412,6 +416,7 @@ And the process below is only used in 5G, so there is no need to run it. ```bash $ open5gs-nrfd $ open5gs-scpd +$ open5gs-seppd $ open5gs-amfd $ open5gs-ausfd $ open5gs-udmd @@ -434,41 +439,33 @@ However, among these, SMF and UPF are used by both 4G EPC and 5G Core. And SMF h To prevent SMF from attempting to access the 5G NRF, you need to modify the SMF configuration file as below. ```diff -$ diff -u ./install/etc/open5gs/smf.yaml.old ./install/etc/open5gs/smf.yaml ---- ./install/etc/open5gs/smf.yaml.old 2020-10-08 14:43:20.599734045 -0400 -+++ ./install/etc/open5gs/smf.yaml 2020-10-08 14:44:21.864952687 -0400 -@@ -168,9 +168,9 @@ - # - ::1 - # +$ diff --git a/configs/open5gs/smf.yaml.in b/configs/open5gs/smf.yaml.in +index 758ca9cb9..a9004ba9a 100644 +--- a/configs/open5gs/smf.yaml.in ++++ b/configs/open5gs/smf.yaml.in +@@ -7,15 +7,15 @@ max: + # peer: 64 + smf: - sbi: -- - addr: 127.0.0.4 -- port: 7777 +- server: +- - address: 127.0.0.4 +- port: 7777 +- client: +# sbi: -+# - addr: 127.0.0.4 -+# port: 7777 - gtpc: - - addr: 127.0.0.4 - - addr: ::1 -@@ -214,12 +214,12 @@ - # - 127.0.0.10 - # - fe80::1%lo - # --nrf: -- sbi: -- - addr: -- - 127.0.0.10 -- - ::1 -- port: 7777 -+#nrf: -+# sbi: -+# - addr: -+# - 127.0.0.10 -+# - ::1 -+# port: 7777 - - # - # upf: ++# server: ++# - address: 127.0.0.4 ++# port: 7777 ++# client: + # nrf: + # - uri: http://127.0.0.10:7777 +- scp: +- - uri: http://127.0.0.200:7777 ++# scp: ++# - uri: http://127.0.0.200:7777 + pfcp: + server: + - address: 127.0.0.4 ``` If you set as above and run SMF, you do not need to run NRF. Seven daemons operate in 4G only state. @@ -503,33 +500,32 @@ $ sudo iptables -t nat -A POSTROUTING -s 10.46.0.0/16 ! -o ogstun -j MASQUERADE Now, you need to modify the configuration file of Open5GS to adjust the UE IP Pool. UE IP Pool can be allocated by SMF or UPF, but in this tutorial, we will modify both configuration files. ```diff -$ diff -u smf.yaml smf.yaml.new ---- smf.yaml 2020-09-17 09:31:16.547882093 -0400 -+++ smf.yaml.new 2020-09-17 09:32:18.267726844 -0400 -@@ -458,7 +458,7 @@ smf: - addr: 127.0.0.4 - port: 9090 - subnet: -- - addr: 10.45.0.1/16 -+ - addr: 10.46.0.1/16 - - addr: 2001:db8:cafe::1/48 +$ diff --git a/configs/open5gs/smf.yaml.in b/configs/open5gs/smf.yaml.in +index 758ca9cb9..5c9b97cd0 100644 +--- a/configs/open5gs/smf.yaml.in ++++ b/configs/open5gs/smf.yaml.in +@@ -33,7 +33,7 @@ smf: + - address: 127.0.0.4 + port: 9090 + session: +- - subnet: 10.45.0.1/16 ++ - subnet: 10.46.0.1/16 + - subnet: 2001:db8:cafe::1/48 dns: - 8.8.8.8 -``` - -```diff -$ diff -u upf.yaml upf.yaml.new ---- upf.yaml 2020-09-17 09:31:16.547882093 -0400 -+++ upf.yaml.new 2020-09-17 09:32:25.199619989 -0400 -@@ -170,7 +170,7 @@ upf: - gtpu: - - addr: 127.0.0.7 - subnet: -- - addr: 10.45.0.1/16 -+ - addr: 10.46.0.1/16 - - addr: 2001:db8:cafe::1/48 - - # +$ diff --git a/configs/open5gs/upf.yaml.in b/configs/open5gs/upf.yaml.in +index e78b018f1..23cb273f8 100644 +--- a/configs/open5gs/upf.yaml.in ++++ b/configs/open5gs/upf.yaml.in +@@ -17,7 +17,7 @@ upf: + server: + - address: 127.0.0.7 + session: +- - subnet: 10.45.0.1/16 ++ - subnet: 10.46.0.1/16 + - subnet: 2001:db8:cafe::1/48 + metrics: + server: ``` Restart SMF/UPF @@ -620,6 +616,7 @@ $ sudo pkill -9 open5gs-hssd $ sudo pkill -9 open5gs-pcrfd $ sudo pkill -9 open5gs-nrfd $ sudo pkill -9 open5gs-scpd +$ sudo pkill -9 open5gs-seppd $ sudo pkill -9 open5gs-ausfd $ sudo pkill -9 open5gs-udmd $ sudo pkill -9 open5gs-pcfd @@ -846,45 +843,59 @@ By default, MME selects the SMF as the first SMF node. To use a different DNN/AP See the following example. ``` -### For reference, see `smf.yaml` +### For reference, see `mme.yaml` # -# smf: -# -# -# -# o By default, the SMF uses the first SMF node. -# - To use a different DNN/APN for each SMF, specify gtpc.dnn -# as the DNN/APN name. -# - If the HSS uses WebUI to set the SMF IP for each UE, -# you can use a specific SMF node for each UE. -# -# o Two SMF are defined. 127.0.0.4:2123 is used. -# [fe80::3%lo]:2123 is ignored. +################################################################################ +# GTP-C Client +################################################################################ +# o SGW selection by eNodeB TAC +# (either single TAC or multiple TACs, DECIMAL representation) # gtpc: -# - addr: 127.0.0.4 -# - addr: fe80::3%lo +# client: +# sgwc: +# - address: 127.0.0.3 +# tac: 26000 +# - address: 127.0.2.2 +# tac: [25000, 27000, 28000] # -# o One SMF is defined. if prefer_ipv4 is not true, -# [fe80::3%lo] is selected. +# o SGW selection by e_cell_id(28bit) +# (either single or multiple e_cell_id, HEX representation) # gtpc: -# - addr: -# - 127.0.0.4 -# - fe80::3%lo +# client: +# sgwc: +# - address: 127.0.0.3 +# e_cell_id: abcde01 +# - address: 127.0.2.2 +# e_cell_id: [12345, a9413, 98765] # -# o Two SMF are defined with a different DNN/APN. -# - Note that if SMF IP for UE is configured in HSS, -# the following configurion for this UE is ignored. +# o SMF selection by APN # gtpc: -# - addr: 127.0.0.4 -# dnn: internet -# - addr: 127.0.0.5 -# dnn: volte +# client: +# smf: +# - address: 127.0.0.4 +# apn: internet +# - address: 127.0.0.5 +# apn: volte # -# o If DNN/APN is omitted, the default DNN/APN uses the first SMF node. +# o SMF selection by eNodeB TAC +# (either single TAC or multiple TACs, DECIMAL representation) # gtpc: -# - addr: 127.0.0.4 -# - addr: 127.0.0.5 -# dnn: volte +# client: +# smf: +# - address: 127.0.0.4 +# tac: 26000 +# - address: 127.0.2.4 +# tac: [25000, 27000, 28000] +# +# o SMF selection by e_cell_id(28bit) +# (either single or multiple e_cell_id, HEX representation) +# gtpc: +# client: +# smf: +# - address: 127.0.0.4 +# e_cell_id: abcde01 +# - address: 127.0.2.4 +# e_cell_id: [12345, a9413, 98765] ``` The IP address of the UE can also use a different UE pool depending on the DNN/APN. @@ -896,16 +907,16 @@ The IP address of the UE can also use a different UE pool depending on the DNN/A # o IPv4 Pool # $ sudo ip addr add 10.45.0.1/16 dev ogstun # -# subnet: -# addr: 10.45.0.1/16 +# session: +# subnet: 10.45.0.1/16 # # o IPv4/IPv6 Pool # $ sudo ip addr add 10.45.0.1/16 dev ogstun # $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun # -# subnet: -# - addr: 10.45.0.1/16 -# - addr: 2001:db8:cafe::1/48 +# session: +# - subnet: 10.45.0.1/16 +# - subnet: 2001:db8:cafe::1/48 # # # o Specific DNN/APN(e.g 'volte') uses 10.46.0.1/16, 2001:db8:babe::1/48 @@ -915,37 +926,37 @@ The IP address of the UE can also use a different UE pool depending on the DNN/A # $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun # $ sudo ip addr add 2001:db8:babe::1/48 dev ogstun # -# subnet: -# - addr: 10.45.0.1/16 -# - addr: 2001:db8:cafe::1/48 -# - addr: 10.46.0.1/16 +# session: +# - subnet: 10.45.0.1/16 +# - subnet: 2001:db8:cafe::1/48 +# - subnet: 10.46.0.1/16 # dnn: volte -# - addr: 2001:db8:babe::1/48 +# - subnet: 2001:db8:babe::1/48 # dnn: volte # # o Pool Range Sample -# subnet: -# - addr: 10.45.0.1/24 +# session: +# - subnet: 10.45.0.1/24 # range: 10.45.0.100-10.45.0.200 # -# subnet: -# - addr: 10.45.0.1/24 +# session: +# - subnet: 10.45.0.1/24 # range: # - 10.45.0.5-10.45.0.50 # - 10.45.0.100- # -# subnet: -# - addr: 10.45.0.1/24 +# session: +# - subnet: 10.45.0.1/24 # range: # - -10.45.0.200 # - 10.45.0.210-10.45.0.220 # -# subnet: -# - addr: 10.45.0.1/16 +# session: +# - subnet: 10.45.0.1/16 # range: # - 10.45.0.100-10.45.0.200 # - 10.45.1.100-10.45.1.200 -# - addr: 2001:db8:cafe::1/48 +# - subnet: 2001:db8:cafe::1/48 # range: # - 2001:db8:cafe:a0::0-2001:db8:cafe:b0::0 # - 2001:db8:cafe:c0::0-2001:db8:cafe:d0::0 @@ -1081,7 +1092,10 @@ Currently, the number of UE is limited to `128*128`. * HSS : 127.0.0.8 * PCRF : 127.0.0.9 * NRF : 127.0.0.10 -* SCP : 127.0.1.10 +* SCP : 127.0.0.200 +* SEPP : 127.0.0.250 +* SEPP-n32 : 127.0.0.251 +* SEPP-n32f : 127.0.0.252 * AUSF : 127.0.0.11 * UDM : 127.0.0.12 * PCF : 127.0.0.13 diff --git a/docs/_docs/tutorial/01-your-first-lte.md b/docs/_docs/tutorial/01-your-first-lte.md index 0b78ed6d6..fc7e98c58 100644 --- a/docs/_docs/tutorial/01-your-first-lte.md +++ b/docs/_docs/tutorial/01-your-first-lte.md @@ -248,20 +248,20 @@ Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username ```diff $ diff --git a/configs/open5gs/mme.yaml.in b/configs/open5gs/mme.yaml.in -index 722648dd6..c998a1e47 100644 +index db2cdaef1..49bbeef76 100644 --- a/configs/open5gs/mme.yaml.in +++ b/configs/open5gs/mme.yaml.in -@@ -251,7 +251,7 @@ logger: - mme: +@@ -10,7 +10,7 @@ mme: freeDiameter: @sysconfdir@/freeDiameter/mme.conf s1ap: -- - addr: 127.0.0.2 -+ - addr: 127.0.1.2 + server: +- - address: 127.0.0.2 ++ - address: 127.0.1.2 gtpc: - - addr: 127.0.0.2 - metrics: -@@ -259,15 +259,15 @@ mme: - port: 9090 + server: + - address: 127.0.0.2 +@@ -25,15 +25,15 @@ mme: + port: 9090 gummei: plmn_id: - mcc: 999 diff --git a/docs/_docs/tutorial/04-metrics-prometheus.md b/docs/_docs/tutorial/04-metrics-prometheus.md index 72b314c44..80508f93c 100644 --- a/docs/_docs/tutorial/04-metrics-prometheus.md +++ b/docs/_docs/tutorial/04-metrics-prometheus.md @@ -45,18 +45,21 @@ A HTTP server is not created if 'metrics' is not defined. # # o Metrics Server(http://:9090) # metrics: -# - addr: 0.0.0.0 -# port: 9090 +# server: +# - address: 0.0.0.0 +# port: 9090 # # o Metrics Server(127.0.0.5:9090, [::1]:9090) # metrics: -# - addr: 127.0.0.5 -# - addr: ::1 +# server: +# - address: 127.0.0.5 +# - addr: ::1 # amf: metrics: - - addr: 127.0.0.5 - port: 9090 + server: + - address: 127.0.0.5 + port: 9090 ``` Note: You may want to change the default IP address or port if you are running diff --git a/docs/_docs/tutorial/05-roaming.md b/docs/_docs/tutorial/05-roaming.md index 3576711bb..6dcb4a7ba 100644 --- a/docs/_docs/tutorial/05-roaming.md +++ b/docs/_docs/tutorial/05-roaming.md @@ -21,11 +21,10 @@ Let's start the explanation assuming that the connection test of the UE to this #### Build & Install -We'll start with the `roaming-tier3` branch from now on. +Git clone, compile and install: ``` $ git clone https://github.com/open5gs/open5gs $ cd open5gs -$ git checkout roaming-tier3 $ meson build --prefix=`pwd`/install $ ninja -C build install ``` @@ -60,7 +59,7 @@ $ diff -u hosts.old hosts.new ``` -#### Running V-PLMN 5G Core and H-PLMN 5G Core in the Single Host +#### Run the V-PLMN 5G Core and H-PLMN 5G Core on a single host 5G Core requires root privileges as it uses reserved ports such as http(80) or https(443). @@ -82,8 +81,294 @@ $ ./build/tests/registration/registration -c ./build/configs/examples/gnb-315-01 You can see the sample traffic. -- [[5g-roaming-lbo.pcapng]]({{ site.url }}{{ site.baseurl }}/assets/pcapng/5g_roaming_lbo.pcapng). +## 2. Roaming Test on a Single Host -## 2. Roaming Deployment +### Home PLMN + +NRF shall follow TS23.003(28.3.2.3.2 Format of NRF FQDN) for routing. + +- Create h-nrf.yaml + +```bash +$ sh -c 'cat << EOF > ./install/etc/open5gs/h-nrf.yaml +logger: + file: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/h-nrf.log +# level: info # fatal|error|warn|info(default)|debug|trace + +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +nrf: + serving: # 5G roaming requires PLMN in NRF + - plmn_id: + mcc: 999 + mnc: 70 + sbi: + server: + - address: nrf.5gc.mnc070.mcc999.3gppnetwork.org +EOF' +``` + +- Update scp.yaml + +```bash +$ sh -c 'cat << EOF > ./install/etc/open5gs/h-scp.yaml +logger: + file: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/h-scp.log +# level: info # fatal|error|warn|info(default)|debug|trace + +global: + max: + ue: 1024 # The number of UE can be increased depending on memory size. +# peer: 64 + +scp: + sbi: + server: + - address: 127.0.1.200 + port: 7777 + client: + nrf: + - uri: http://nrf.5gc.mnc070.mcc999.3gppnetwork.org +EOF' +``` + +AUSF and UDM shall use FQDN in the Home PLMN. + +- Update ausf.yaml + +```diff +diff -u ./install/etc/open5gs/ausf.yaml.old ./install/etc/open5gs/ausf.yaml +--- ./install/etc/open5gs/ausf.yaml.old 2023-11-19 17:50:12.469116283 +0900 ++++ ./install/etc/open5gs/ausf.yaml 2023-11-19 17:52:35.201116202 +0900 +@@ -10,13 +10,12 @@ + ausf: + sbi: + server: +- - address: 127.0.0.11 +- port: 7777 ++ - address: ausf.5gc.mnc070.mcc999.3gppnetwork.org + client: + # nrf: + # - uri: http://127.0.0.10:7777 + scp: +- - uri: http://127.0.0.200:7777 ++ - uri: http://127.0.1.200:7777 + + ################################################################################ + # SBI Server +``` + +- Update udm.yaml + +```diff +$ diff -u ./install/etc/open5gs/udm.yaml.old ./install/etc/open5gs/udm.yaml +--- ./install/etc/open5gs/udm.yaml.old 2023-11-19 17:50:17.713116280 +0900 ++++ ./install/etc/open5gs/udm.yaml 2023-11-19 17:52:40.701116199 +0900 +@@ -29,13 +29,12 @@ + key: /home/acetcom/Documents/git/open5gs/install/etc/open5gs/hnet/secp256r1-6.key + sbi: + server: +- - address: 127.0.0.12 +- port: 7777 ++ - address: udm.5gc.mnc070.mcc999.3gppnetwork.org + client: + # nrf: + # - uri: http://127.0.0.10:7777 + scp: +- - uri: http://127.0.0.200:7777 ++ - uri: http://127.0.1.200:7777 + + # + ################################################################################ +``` + +- Update udr.yaml + +```diff +$ diff -u ./install/etc/open5gs/udr.yaml.old ./install/etc/open5gs/udr.yaml +--- ./install/etc/open5gs/udr.yaml.old 2023-11-19 18:00:27.049115935 +0900 ++++ ./install/etc/open5gs/udr.yaml 2023-11-19 18:00:31.713115932 +0900 +@@ -17,7 +17,7 @@ + # nrf: + # - uri: http://127.0.0.10:7777 + scp: +- - uri: http://127.0.0.200:7777 ++ - uri: http://127.0.1.200:7777 + + ################################################################################ + # SBI Server +``` + +- Update sepp1.yaml + +```diff +$ diff -u ./install/etc/open5gs/sepp1.yaml.old ./install/etc/open5gs/sepp1.yaml +--- ./install/etc/open5gs/sepp1.yaml.old 2023-11-19 19:11:02.293113538 +0900 ++++ ./install/etc/open5gs/sepp1.yaml 2023-11-19 19:11:22.429113526 +0900 +@@ -23,7 +23,7 @@ + # nrf: + # - uri: http://127.0.0.10:7777 + scp: +- - uri: http://127.0.0.200:7777 ++ - uri: http://127.0.1.200:7777 + n32: + server: + - sender: sepp1.localdomain +``` + +### Visited PLMN + +The Visited Network should be configured using the PLMN ID 001/01, so the NRF and AMF settings should be changed accordingly. + +- Update nrf.yaml + +```diff +$diff -u ./install/etc/open5gs/nrf.yaml.old ./install/etc/open5gs/nrf.yaml +--- ./install/etc/open5gs/nrf.yaml.old 2023-11-19 18:02:34.105115863 +0900 ++++ ./install/etc/open5gs/nrf.yaml 2023-11-19 18:02:59.981115848 +0900 +@@ -10,8 +10,8 @@ + nrf: + serving: # 5G roaming requires PLMN in NRF + - plmn_id: +- mcc: 999 +- mnc: 70 ++ mcc: 001 ++ mnc: 01 + sbi: + server: + - address: 127.0.0.10 +``` + +- Update amf.yaml + +```diff +$ diff -u ./install/etc/open5gs/amf.yaml.old ./install/etc/open5gs/amf.yaml +--- ./install/etc/open5gs/amf.yaml.old 2023-11-19 17:50:42.997116266 +0900 ++++ ./install/etc/open5gs/amf.yaml 2023-11-19 19:08:59.145113607 +0900 +@@ -19,27 +19,34 @@ + - uri: http://127.0.0.200:7777 + ngap: + server: +- - address: 127.0.0.5 ++ - address: 127.0.2.5 + metrics: + server: + - address: 127.0.0.5 + port: 9090 +- guami: ++ access_control: ++ - plmn_id: ++ mcc: 001 ++ mnc: 01 + - plmn_id: + mcc: 999 + mnc: 70 ++ guami: ++ - plmn_id: ++ mcc: 001 ++ mnc: 01 + amf_id: + region: 2 + set: 1 + tai: + - plmn_id: +- mcc: 999 +- mnc: 70 ++ mcc: 001 ++ mnc: 01 + tac: 1 + plmn_support: + - plmn_id: +- mcc: 999 +- mnc: 70 ++ mcc: 001 ++ mnc: 01 + s_nssai: + - sst: 1 + security: +``` + +Due to the absence of UDR in the visiting network, V-PCF uses locally configured policies. When the UE is located in the home PLMN (001/01), MongoDB is used. On the other hand, when the UE is located in the visiting PLMN (999/70, 315/010), locally configured policies are used. This is because there is no session management policy data for the UE in the visiting network, so locally configured information based on the roaming agreement is used. + +- Update pcf.yaml +```diff +$ diff -u ./install/etc/open5gs/pcf.yaml.old ./install/etc/open5gs/pcf.yaml +--- ./install/etc/open5gs/pcf.yaml.old 2023-11-19 18:05:35.389115760 +0900 ++++ ./install/etc/open5gs/pcf.yaml 2023-11-19 19:02:27.221113829 +0900 +@@ -1,4 +1,3 @@ +-db_uri: mongodb://localhost/open5gs + logger: + file: /home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcf.log + # level: info # fatal|error|warn|info(default)|debug|trace +@@ -22,6 +21,29 @@ + server: + - address: 127.0.0.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 + + ################################################################################ + # Locally configured policy +``` + +### Run the V-PLMN 5G Core and H-PLMN 5G Core on a single host + +#### Home Network + +5G Core requires root privileges as it uses reserved ports such as http(80) or https(443). + +``` +$ sudo ./install/bin/open5gs-nrfd -c ./install/etc/open5gs/h-nrf.yaml +$ ./install/bin/open5gs-scpd -c ./install/etc/open5gs/h-scp.yaml +$ sudo ./install/bin/open5gs-ausfd +$ sudo ./install/bin/open5gs-udmd +$ ./install/bin/open5gs-udrd +$ ./install/bin/open5gs-seppd -c ./install/etc/open5gs/sepp1.yaml +``` + +#### Visted Network +``` +$ ./install/bin/open5gs-nrfd +$ ./install/bin/open5gs-scpd +$ ./install/bin/open5gs-amfd +$ ./install/bin/open5gs-smfd +$ ./install/bin/open5gs-upfd +$ ./install/bin/open5gs-pcfd +$ ./install/bin/open5gs-bsfd +$ ./install/bin/open5gs-nssfd +$ ./install/bin/open5gs-seppd -c ./install/etc/open5gs/sepp2.yaml +``` + +### Performs a test of UE access while roaming subscribed to H-PLMN. +``` +$ ./build/tests/registration/registration -c ./build/configs/examples/gnb-001-01-ue-999-70.yaml simple-test +``` + +## 3. Roaming Deployment ### VM and Subscriber Information @@ -293,6 +578,64 @@ index e78b018f1..3032a06c6 100644 - subnet: 2001:db8:cafe::1/48 ``` +Due to the absence of UDR in the visiting network, V-PCF uses locally configured policies. When the UE is located in the home PLMN (999/70), MongoDB is used. On the other hand, when the UE is located in the visiting PLMN (001/01, 315/010), locally configured policies are used. This is because there is no session management policy data for the UE in the visiting network, so locally configured information based on the roaming agreement is used. + +- Update pcf.yaml +```diff +$ diff --git a/configs/open5gs/pcf.yaml.in b/configs/open5gs/pcf.yaml.in +index 2df2e9a36..9eea1f1de 100644 +--- a/configs/open5gs/pcf.yaml.in ++++ b/configs/open5gs/pcf.yaml.in +@@ -22,6 +22,51 @@ pcf: + server: + - address: 127.0.0.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 ++ - 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 +``` For now we will set up SEPP without using TLS. @@ -554,6 +897,64 @@ index e78b018f1..3032a06c6 100644 - subnet: 2001:db8:cafe::1/48 ``` +Due to the absence of UDR in the visiting network, V-PCF uses locally configured policies. When the UE is located in the home PLMN (001/01), MongoDB is used. On the other hand, when the UE is located in the visiting PLMN (999/70, 315/010), locally configured policies are used. This is because there is no session management policy data for the UE in the visiting network, so locally configured information based on the roaming agreement is used. + +- Update pcf.yaml +```diff +$ diff --git a/configs/open5gs/pcf.yaml.in b/configs/open5gs/pcf.yaml.in +index 2df2e9a36..9eea1f1de 100644 +--- a/configs/open5gs/pcf.yaml.in ++++ b/configs/open5gs/pcf.yaml.in +@@ -22,6 +22,51 @@ pcf: + server: + - address: 127.0.0.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 ++ - 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 +``` For now we will set up SEPP without using TLS. @@ -815,6 +1216,64 @@ index e78b018f1..3032a06c6 100644 - subnet: 2001:db8:cafe::1/48 ``` +Due to the absence of UDR in the visiting network, V-PCF uses locally configured policies. When the UE is located in the home PLMN (315/010), MongoDB is used. On the other hand, when the UE is located in the visiting PLMN (999/70, 001/01), locally configured policies are used. This is because there is no session management policy data for the UE in the visiting network, so locally configured information based on the roaming agreement is used. + +- Update pcf.yaml +```diff +$ diff --git a/configs/open5gs/pcf.yaml.in b/configs/open5gs/pcf.yaml.in +index 2df2e9a36..9eea1f1de 100644 +--- a/configs/open5gs/pcf.yaml.in ++++ b/configs/open5gs/pcf.yaml.in +@@ -22,6 +22,51 @@ pcf: + server: + - address: 127.0.0.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 ++ - 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 +``` For now we will set up SEPP without using TLS. @@ -890,7 +1349,7 @@ $ diff -u sepp.yaml.old sepp.yaml # peer: 64 sepp: -+ defconfig: ++ default: + tls: + server: + private_key: /home/acetcom/Documents/git/my/open5gs/build/configs/open5gs/tls/sepp1.key @@ -952,4 +1411,4 @@ $ diff -u sepp.yaml.old sepp.yaml - address: 127.0.0.250 ``` -For more information, please refer to the [LINK](https://github.com/open5gs/open5gs/blob/roaming-tier3/configs/open5gs/sepp1.yaml.in). +For more information, please refer to the [LINK](https://github.com/open5gs/open5gs/blob/main/configs/open5gs/sepp1.yaml.in). diff --git a/lib/app/meson.build b/lib/app/meson.build index 0a23d713e..6d6e0d4d8 100644 --- a/lib/app/meson.build +++ b/lib/app/meson.build @@ -38,11 +38,11 @@ libapp = library('ogsapp', version : libogslib_version, c_args : '-DOGS_APP_COMPILATION', include_directories : [libapp_inc, libinc], - dependencies : [libcore_dep, yaml_dep], + dependencies : [libproto_dep, yaml_dep], install : true) libapp_dep = declare_dependency( link_with : libapp, include_directories : [libapp_inc, libinc], - dependencies : [libcore_dep, yaml_dep], + dependencies : [libproto_dep, yaml_dep], ) diff --git a/lib/app/ogs-app.h b/lib/app/ogs-app.h index 53361c6d9..87b10862e 100644 --- a/lib/app/ogs-app.h +++ b/lib/app/ogs-app.h @@ -97,6 +97,9 @@ void amf_terminate(void); int scp_initialize(void); void scp_terminate(void); +int sepp_initialize(void); +void sepp_terminate(void); + #ifdef __cplusplus } #endif diff --git a/lib/app/ogs-config.c b/lib/app/ogs-config.c index 244847c5d..abfcccdeb 100644 --- a/lib/app/ogs-config.c +++ b/lib/app/ogs-config.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -19,7 +19,618 @@ #include "ogs-app.h" -int ogs_app_config_parse_sockopt( +static ogs_app_global_conf_t global_conf; +static ogs_app_local_conf_t local_conf; + +static OGS_POOL(policy_conf_pool, ogs_app_policy_conf_t); +static OGS_POOL(slice_conf_pool, ogs_app_slice_conf_t); +static OGS_POOL(session_conf_pool, ogs_app_session_conf_t); + +static int initialized = 0; + +int ogs_app_config_init(void) +{ + ogs_assert(initialized == 0); + + memset(&global_conf, 0, sizeof(ogs_app_global_conf_t)); + memset(&local_conf, 0, sizeof(ogs_app_local_conf_t)); + + ogs_pool_init(&policy_conf_pool, OGS_MAX_NUM_OF_PLMN); + ogs_pool_init(&slice_conf_pool, OGS_MAX_NUM_OF_SLICE); + ogs_pool_init(&session_conf_pool, + OGS_MAX_NUM_OF_SLICE*OGS_MAX_NUM_OF_SESS); + + initialized = 1; + + return OGS_OK; +} + +void ogs_app_config_final(void) +{ + ogs_assert(initialized == 1); + + ogs_app_policy_conf_remove_all(); + + ogs_pool_final(&policy_conf_pool); + ogs_pool_final(&slice_conf_pool); + ogs_pool_final(&session_conf_pool); + + initialized = 0; +} + +static void recalculate_pool_size(void) +{ + ogs_app()->pool.packet = + global_conf.max.ue * OGS_MAX_NUM_OF_PACKET_BUFFER; + +#define MAX_NUM_OF_TUNNEL 3 /* Num of Tunnel per Bearer */ + ogs_app()->pool.sess = global_conf.max.ue * OGS_MAX_NUM_OF_SESS; + ogs_app()->pool.bearer = ogs_app()->pool.sess * OGS_MAX_NUM_OF_BEARER; + ogs_app()->pool.tunnel = ogs_app()->pool.bearer * MAX_NUM_OF_TUNNEL; + +#define POOL_NUM_PER_UE 16 + ogs_app()->pool.timer = global_conf.max.ue * POOL_NUM_PER_UE; + ogs_app()->pool.message = global_conf.max.ue * POOL_NUM_PER_UE; + ogs_app()->pool.event = global_conf.max.ue * POOL_NUM_PER_UE; + ogs_app()->pool.socket = global_conf.max.ue * POOL_NUM_PER_UE; + ogs_app()->pool.xact = global_conf.max.ue * POOL_NUM_PER_UE; + ogs_app()->pool.stream = global_conf.max.ue * POOL_NUM_PER_UE; + + ogs_app()->pool.nf = global_conf.max.peer; +#define NF_SERVICE_PER_NF_INSTANCE 16 + ogs_app()->pool.nf_service = + ogs_app()->pool.nf * NF_SERVICE_PER_NF_INSTANCE; + ogs_app()->pool.subscription = + ogs_app()->pool.nf * NF_SERVICE_PER_NF_INSTANCE; + + ogs_app()->pool.gtp_node = ogs_app()->pool.nf; + if (global_conf.max.gtp_peer) + ogs_app()->pool.gtp_node = global_conf.max.gtp_peer; + + /* Num of TAI-LAI Mapping Table */ + ogs_app()->pool.csmap = ogs_app()->pool.nf; + +#define MAX_NUM_OF_IMPU 8 + ogs_app()->pool.impi = global_conf.max.ue; + ogs_app()->pool.impu = ogs_app()->pool.impi * MAX_NUM_OF_IMPU; +} + +ogs_app_global_conf_t *ogs_global_conf(void) +{ + return &global_conf; +} + +ogs_app_local_conf_t *ogs_local_conf(void) +{ + return &local_conf; +} + +static int global_conf_prepare(void) +{ + global_conf.sockopt.no_delay = true; + +#define MAX_NUM_OF_UE 1024 /* Num of UEs */ +#define MAX_NUM_OF_PEER 64 /* Num of Peer */ + + global_conf.max.ue = MAX_NUM_OF_UE; + global_conf.max.peer = MAX_NUM_OF_PEER; + + ogs_pkbuf_default_init(&global_conf.pkbuf_config); + + recalculate_pool_size(); + + return OGS_OK; +} + +static int global_conf_validation(void) +{ + if (global_conf.parameter.no_ipv4 == 1 && + global_conf.parameter.no_ipv6 == 1) { + ogs_error("Both `no_ipv4` and `no_ipv6` set to `true` in `%s`", + ogs_app()->file); + return OGS_ERROR; + } + + return OGS_OK; +} + +int ogs_app_parse_global_conf(ogs_yaml_iter_t *parent) +{ + int rv; + ogs_yaml_iter_t global_iter; + + ogs_assert(parent); + + rv = global_conf_prepare(); + if (rv != OGS_OK) return rv; + + ogs_yaml_iter_recurse(parent, &global_iter); + while (ogs_yaml_iter_next(&global_iter)) { + const char *global_key = ogs_yaml_iter_key(&global_iter); + ogs_assert(global_key); + if (!strcmp(global_key, "parameter")) { + ogs_yaml_iter_t parameter_iter; + ogs_yaml_iter_recurse(&global_iter, ¶meter_iter); + while (ogs_yaml_iter_next(¶meter_iter)) { + const char *parameter_key = ogs_yaml_iter_key(¶meter_iter); + ogs_assert(parameter_key); + if (!strcmp(parameter_key, "no_hss")) { + global_conf.parameter.no_hss = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_mme")) { + global_conf.parameter.no_mme = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_sgwu")) { + global_conf.parameter.no_sgwu = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_sgwc")) { + global_conf.parameter.no_sgwc = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_sgw")) { + global_conf.parameter.no_sgw = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_pgw")) { + global_conf.parameter.no_pgw = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_pcrf")) { + global_conf.parameter.no_pcrf = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_nrf")) { + global_conf.parameter.no_nrf = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_scp")) { + global_conf.parameter.no_scp = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_sepp")) { + global_conf.parameter.no_sepp = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_amf")) { + global_conf.parameter.no_amf = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_smf")) { + global_conf.parameter.no_smf = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_upf")) { + global_conf.parameter.no_upf = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_ausf")) { + global_conf.parameter.no_ausf = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_udm")) { + global_conf.parameter.no_udm = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_pcf")) { + global_conf.parameter.no_pcf = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_nssf")) { + global_conf.parameter.no_nssf = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_bsf")) { + global_conf.parameter.no_bsf = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_udr")) { + global_conf.parameter.no_udr = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_ipv4")) { + global_conf.parameter.no_ipv4 = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "no_ipv6")) { + global_conf.parameter.no_ipv6 = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "prefer_ipv4")) { + global_conf.parameter.prefer_ipv4 = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "multicast")) { + global_conf.parameter.multicast = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, "use_openair")) { + global_conf.parameter.use_openair = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, + "no_ipv4v6_local_addr_in_packet_filter")) { + global_conf.parameter. + no_ipv4v6_local_addr_in_packet_filter = + ogs_yaml_iter_bool(¶meter_iter); + } else if (!strcmp(parameter_key, + "no_pfcp_rr_select")) { + global_conf.parameter.no_pfcp_rr_select = + ogs_yaml_iter_bool(¶meter_iter); + } else + ogs_warn("unknown key `%s`", parameter_key); + } + } else if (!strcmp(global_key, "sockopt")) { + ogs_yaml_iter_t sockopt_iter; + ogs_yaml_iter_recurse(&global_iter, &sockopt_iter); + while (ogs_yaml_iter_next(&sockopt_iter)) { + const char *sockopt_key = + ogs_yaml_iter_key(&sockopt_iter); + ogs_assert(sockopt_key); + if (!strcmp(sockopt_key, "no_delay")) { + global_conf.sockopt.no_delay = + ogs_yaml_iter_bool(&sockopt_iter); + } else if (!strcmp(sockopt_key, "linger")) { + const char *v = ogs_yaml_iter_value(&sockopt_iter); + if (v) + global_conf.sockopt.l_linger = atoi(v); + global_conf.sockopt.l_onoff = true; + } else + ogs_warn("unknown key `%s`", sockopt_key); + } + } else if (!strcmp(global_key, "max")) { + ogs_yaml_iter_t max_iter; + ogs_yaml_iter_recurse(&global_iter, &max_iter); + while (ogs_yaml_iter_next(&max_iter)) { + const char *max_key = ogs_yaml_iter_key(&max_iter); + ogs_assert(max_key); + if (!strcmp(max_key, "ue")) { + const char *v = ogs_yaml_iter_value(&max_iter); + if (v) global_conf.max.ue = atoi(v); + } else if (!strcmp(max_key, "peer") || + !strcmp(max_key, "enb")) { + const char *v = ogs_yaml_iter_value(&max_iter); + if (v) global_conf.max.peer = atoi(v); + } else if (!strcmp(max_key, "gtp_peer") || + !strcmp(max_key, "enb")) { + const char *v = ogs_yaml_iter_value(&max_iter); + if (v) global_conf.max.gtp_peer = atoi(v); + } else + ogs_warn("unknown key `%s`", max_key); + } + + recalculate_pool_size(); + + } else if (!strcmp(global_key, "pool")) { + ogs_yaml_iter_t pool_iter; + ogs_yaml_iter_recurse(&global_iter, &pool_iter); + while (ogs_yaml_iter_next(&pool_iter)) { + const char *pool_key = ogs_yaml_iter_key(&pool_iter); + ogs_assert(pool_key); + if (!strcmp(pool_key, "128")) { + const char *v = ogs_yaml_iter_value(&pool_iter); + if (v) global_conf.pkbuf_config.cluster_128_pool = atoi(v); + } else if (!strcmp(pool_key, "256")) { + const char *v = ogs_yaml_iter_value(&pool_iter); + if (v) global_conf.pkbuf_config.cluster_256_pool = atoi(v); + } else if (!strcmp(pool_key, "512")) { + const char *v = ogs_yaml_iter_value(&pool_iter); + if (v) global_conf.pkbuf_config.cluster_512_pool = atoi(v); + } else if (!strcmp(pool_key, "1024")) { + const char *v = ogs_yaml_iter_value(&pool_iter); + if (v) global_conf.pkbuf_config.cluster_1024_pool = atoi(v); + } else if (!strcmp(pool_key, "2048")) { + const char *v = ogs_yaml_iter_value(&pool_iter); + if (v) global_conf.pkbuf_config.cluster_2048_pool = atoi(v); + } else if (!strcmp(pool_key, "8192")) { + const char *v = ogs_yaml_iter_value(&pool_iter); + if (v) global_conf.pkbuf_config.cluster_8192_pool = atoi(v); + } else if (!strcmp(pool_key, "32768")) { + const char *v = ogs_yaml_iter_value(&pool_iter); + if (v) global_conf.pkbuf_config.cluster_32768_pool = + atoi(v); + } else if (!strcmp(pool_key, "big")) { + const char *v = ogs_yaml_iter_value(&pool_iter); + if (v) global_conf.pkbuf_config.cluster_big_pool = atoi(v); + } else + ogs_warn("unknown key `%s`", pool_key); + } + } + } + + rv = global_conf_validation(); + if (rv != OGS_OK) return rv; + + return OGS_OK; +} + +static void regenerate_all_timer_duration(void) +{ + ogs_assert(local_conf.time.message.duration); + + local_conf.time.message.sbi.client_wait_duration = + local_conf.time.message.duration; + local_conf.time.message.sbi.connection_deadline = + local_conf.time.message.sbi.client_wait_duration + ogs_time_from_sec(1); + local_conf.time.message.sbi.reconnect_interval = + ogs_max(ogs_time_from_sec(3), + local_conf.time.message.sbi.client_wait_duration + + ogs_time_from_sec(1)); + local_conf.time.message.sbi.reconnect_interval_in_exception = + ogs_time_from_sec(2); + +#define PFCP_N1_RESPONSE_RETRY_COUNT 3 + local_conf.time.message.pfcp.n1_response_rcount = + PFCP_N1_RESPONSE_RETRY_COUNT; + local_conf.time.message.pfcp.t1_response_duration = + (local_conf.time.message.duration / + (local_conf.time.message.pfcp.n1_response_rcount + 1)); + ogs_assert(local_conf.time.message.pfcp.t1_response_duration); + +#define PFCP_N1_HOLDING_RETRY_COUNT 1 + local_conf.time.message.pfcp.n1_holding_rcount = + PFCP_N1_HOLDING_RETRY_COUNT; + local_conf.time.message.pfcp.t1_holding_duration = + local_conf.time.message.pfcp.n1_response_rcount * + local_conf.time.message.pfcp.t1_response_duration; + ogs_assert(local_conf.time.message.pfcp.t1_holding_duration); + + local_conf.time.message.pfcp.association_interval = + ogs_max(ogs_time_from_sec(3), + local_conf.time.message.sbi.client_wait_duration + + ogs_time_from_sec(1)); + + local_conf.time.message.pfcp.no_heartbeat_duration = + ogs_max(ogs_time_from_sec(10), + local_conf.time.message.sbi.client_wait_duration + + ogs_time_from_sec(1)); + +#define GTP_N3_RESPONSE_RETRY_COUNT 3 + local_conf.time.message.gtp.n3_response_rcount = + GTP_N3_RESPONSE_RETRY_COUNT; + local_conf.time.message.gtp.t3_response_duration = + (local_conf.time.message.duration / + (local_conf.time.message.gtp.n3_response_rcount + 1)); + ogs_assert(local_conf.time.message.gtp.t3_response_duration); + +#define GTP_N3_HOLDING_RETRY_COUNT 1 + local_conf.time.message.gtp.n3_holding_rcount = GTP_N3_HOLDING_RETRY_COUNT; + local_conf.time.message.gtp.t3_holding_duration = + local_conf.time.message.gtp.n3_response_rcount * + local_conf.time.message.gtp.t3_response_duration; + ogs_assert(local_conf.time.message.gtp.t3_holding_duration); + +#if 0 + ogs_trace("%lld, %lld, %lld, %d, %lld, %d %lld, %d, %lld, %d, %lld", + (long long)local_conf.time.message.duration, + (long long)local_conf.time.message.sbi.client_wait_duration, + (long long)local_conf.time.message.sbi.connection_deadline, + local_conf.time.message.pfcp.n1_response_rcount, + (long long)local_conf.time.message.pfcp.t1_response_duration, + local_conf.time.message.pfcp.n1_holding_rcount, + (long long)local_conf.time.message.pfcp.t1_holding_duration, + local_conf.time.message.gtp.n3_response_rcount, + (long long)local_conf.time.message.gtp.t3_response_duration, + local_conf.time.message.gtp.n3_holding_rcount, + (long long)local_conf.time.message.gtp.t3_holding_duration); + ogs_trace("%lld, %lld, %lld", + (long long)local_conf.time.message.sbi.reconnect_interval, + (long long)local_conf.time.message.pfcp.association_interval, + (long long)local_conf.time.message.pfcp.no_heartbeat_duration); +#endif +} + +static int local_conf_prepare(void) +{ + /* + * Heartbeat Interval(e.g: 10 seconds) + No Heartbeat Margin(1 second) */ + local_conf.time.nf_instance.no_heartbeat_margin = 1; + + /* 3600 seconds = 1 hour */ + local_conf.time.nf_instance.validity_duration = 3600; + + /* 86400 seconds = 1 day */ + local_conf.time.subscription.validity_duration = 86400; + + /* + * Message Wait Duration : 10 seconds (Default) + * + * The paging retry timer is 2 seconds and the retry count is 3. + * + * It is recomended to set at least 9 seconds to reflect + * the paging failure result to GTPv2-C or HTTP2(SBI). + */ + local_conf.time.message.duration = ogs_time_from_sec(10); + + /* + * Handover Wait Duration : 300 ms (Default) + * + * Time to wait for AMF/MME to send UEContextReleaseCommand + * to the source gNB/eNB after receiving HandoverNotify + */ + local_conf.time.handover.duration = ogs_time_from_msec(300); + + /* Size of internal metrics pool (amount of ogs_metrics_spec_t) */ + ogs_app()->metrics.max_specs = 512; + + regenerate_all_timer_duration(); + + return OGS_OK; +} + +static int local_conf_validation(void) +{ + if (local_conf.time.nf_instance.validity_duration == 0) { + ogs_error("NF Instance validity-time should not 0"); + ogs_error("time:"); + ogs_error(" nf_instance:"); + ogs_error(" validity: 0"); + + return OGS_ERROR; + } + + return OGS_OK; +} + +int ogs_app_parse_local_conf(const char *local) +{ + int rv; + yaml_document_t *document = NULL; + ogs_yaml_iter_t root_iter; + + document = ogs_app()->document; + ogs_assert(document); + + rv = local_conf_prepare(); + if (rv != OGS_OK) return rv; + + ogs_yaml_iter_init(&root_iter, document); + while (ogs_yaml_iter_next(&root_iter)) { + const char *root_key = ogs_yaml_iter_key(&root_iter); + ogs_assert(root_key); + if (!strcmp(root_key, local)) { + ogs_yaml_iter_t local_iter; + ogs_yaml_iter_recurse(&root_iter, &local_iter); + while (ogs_yaml_iter_next(&local_iter)) { + const char *local_key = ogs_yaml_iter_key(&local_iter); + ogs_assert(local_key); + if (!strcmp(local_key, "serving")) { + ogs_yaml_iter_t serving_array, serving_iter; + ogs_yaml_iter_recurse(&local_iter, &serving_array); + do { + const char *mnc = NULL, *mcc = NULL; + ogs_assert(local_conf.num_of_serving_plmn_id < + OGS_MAX_NUM_OF_PLMN); + + OGS_YAML_ARRAY_NEXT(&serving_array, &serving_iter); + while (ogs_yaml_iter_next(&serving_iter)) { + const char *serving_key = + ogs_yaml_iter_key(&serving_iter); + ogs_assert(serving_key); + if (!strcmp(serving_key, "plmn_id")) { + ogs_yaml_iter_t plmn_id_iter; + + ogs_yaml_iter_recurse(&serving_iter, + &plmn_id_iter); + while (ogs_yaml_iter_next(&plmn_id_iter)) { + const char *id_key = + ogs_yaml_iter_key(&plmn_id_iter); + ogs_assert(id_key); + if (!strcmp(id_key, "mcc")) { + mcc = ogs_yaml_iter_value( + &plmn_id_iter); + } else if (!strcmp(id_key, "mnc")) { + mnc = ogs_yaml_iter_value( + &plmn_id_iter); + } + } + + if (mcc && mnc) { + ogs_plmn_id_build( + &local_conf.serving_plmn_id[ + local_conf. + num_of_serving_plmn_id], + atoi(mcc), atoi(mnc), strlen(mnc)); + local_conf.num_of_serving_plmn_id++; + } else { + ogs_error("Invalid [MCC:%s, MNC:%s]", + mcc, mnc); + } + } else + ogs_warn("unknown key `%s`", serving_key); + } + } while (ogs_yaml_iter_type(&serving_array) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(local_key, "time")) { + ogs_yaml_iter_t time_iter; + ogs_yaml_iter_recurse(&local_iter, &time_iter); + while (ogs_yaml_iter_next(&time_iter)) { + const char *time_key = ogs_yaml_iter_key(&time_iter); + ogs_assert(time_key); + if (!strcmp(time_key, "nf_instance")) { + ogs_yaml_iter_t sbi_iter; + ogs_yaml_iter_recurse(&time_iter, &sbi_iter); + + while (ogs_yaml_iter_next(&sbi_iter)) { + const char *sbi_key = + ogs_yaml_iter_key(&sbi_iter); + ogs_assert(sbi_key); + + if (!strcmp(sbi_key, "heartbeat")) { + const char *v = ogs_yaml_iter_value( + &sbi_iter); + if (v) + local_conf.time.nf_instance. + heartbeat_interval = atoi(v); + } else if (!strcmp(sbi_key, "validity")) { + const char *v = + ogs_yaml_iter_value(&sbi_iter); + if (v) + local_conf.time.nf_instance. + validity_duration = atoi(v); + } else + ogs_warn("unknown key `%s`", sbi_key); + } + } else if (!strcmp(time_key, "subscription")) { + ogs_yaml_iter_t sbi_iter; + ogs_yaml_iter_recurse(&time_iter, &sbi_iter); + + while (ogs_yaml_iter_next(&sbi_iter)) { + const char *sbi_key = + ogs_yaml_iter_key(&sbi_iter); + ogs_assert(sbi_key); + + if (!strcmp(sbi_key, "validity")) { + const char *v = + ogs_yaml_iter_value(&sbi_iter); + if (v) + local_conf.time.subscription. + validity_duration = atoi(v); + } else + ogs_warn("unknown key `%s`", sbi_key); + } + } else if (!strcmp(time_key, "message")) { + ogs_yaml_iter_t msg_iter; + ogs_yaml_iter_recurse(&time_iter, &msg_iter); + + while (ogs_yaml_iter_next(&msg_iter)) { + const char *msg_key = + ogs_yaml_iter_key(&msg_iter); + ogs_assert(msg_key); + + if (!strcmp(msg_key, "duration")) { + const char *v = + ogs_yaml_iter_value(&msg_iter); + if (v) { + local_conf.time.message.duration = + ogs_time_from_msec(atoll(v)); + regenerate_all_timer_duration(); + } + } else + ogs_warn("unknown key `%s`", msg_key); + } + } else if (!strcmp(time_key, "handover")) { + ogs_yaml_iter_t msg_iter; + ogs_yaml_iter_recurse(&time_iter, &msg_iter); + + while (ogs_yaml_iter_next(&msg_iter)) { + const char *msg_key = + ogs_yaml_iter_key(&msg_iter); + ogs_assert(msg_key); + + if (!strcmp(msg_key, "duration")) { + const char *v = + ogs_yaml_iter_value(&msg_iter); + if (v) { + local_conf.time.handover.duration = + ogs_time_from_msec(atoll(v)); + } + } else + ogs_warn("unknown key `%s`", msg_key); + } + } else if (!strcmp(time_key, "t3502")) { + /* handle config in amf */ + } else if (!strcmp(time_key, "t3512")) { + /* handle config in amf */ + } else if (!strcmp(time_key, "t3402")) { + /* handle config in mme */ + } else if (!strcmp(time_key, "t3412")) { + /* handle config in mme */ + } else if (!strcmp(time_key, "t3423")) { + /* handle config in mme */ + } else + ogs_warn("unknown key `%s`", time_key); + } + } + } + } + } + + rv = local_conf_validation(); + if (rv != OGS_OK) return rv; + + return OGS_OK; +} + +int ogs_app_parse_sockopt_config( ogs_yaml_iter_t *parent, ogs_sockopt_t *option) { ogs_yaml_iter_t sockopt_iter; @@ -108,3 +719,729 @@ int ogs_app_config_parse_sockopt( return OGS_OK; } + +static int parse_br_conf(ogs_yaml_iter_t *parent, ogs_bitrate_t *br) +{ + ogs_yaml_iter_t br_iter; + ogs_yaml_iter_recurse(parent, &br_iter); + + while (ogs_yaml_iter_next(&br_iter)) { + const char *br_key = ogs_yaml_iter_key(&br_iter); + ogs_assert(br_key); + if (!strcmp(br_key, OGS_DOWNLINK_STRING)) { + uint8_t unit = 0; + int n; + + ogs_yaml_iter_t downlink_iter; + ogs_yaml_iter_recurse(&br_iter, &downlink_iter); + + while (ogs_yaml_iter_next(&downlink_iter)) { + const char *downlink_key = + ogs_yaml_iter_key(&downlink_iter); + ogs_assert(downlink_key); + if (!strcmp(downlink_key, OGS_VALUE_STRING)) { + const char *v = ogs_yaml_iter_value(&downlink_iter); + if (v) br->downlink = atoi(v); + } else if (!strcmp(downlink_key, OGS_UNIT_STRING)) { + const char *v = ogs_yaml_iter_value(&downlink_iter); + if (v) { + unit = atoi(v); + if (unit == 0 || unit == 1 || unit == 2 || + unit == 3 || unit == 4) { + } else { + ogs_error("Unknown Unit [%d]", unit); + return OGS_ERROR; + } + } + } else + ogs_warn("unknown key `%s`", downlink_key); + } + + for (n = 0; n < unit; n++) + br->downlink *= 1000; + } else if (!strcmp(br_key, OGS_UPLINK_STRING)) { + uint8_t unit = 0; + int n; + + ogs_yaml_iter_t uplink_iter; + ogs_yaml_iter_recurse(&br_iter, &uplink_iter); + + while (ogs_yaml_iter_next(&uplink_iter)) { + const char *uplink_key = + ogs_yaml_iter_key(&uplink_iter); + ogs_assert(uplink_key); + if (!strcmp(uplink_key, OGS_VALUE_STRING)) { + const char *v = ogs_yaml_iter_value(&uplink_iter); + if (v) br->uplink = atoi(v); + } else if (!strcmp(uplink_key, OGS_UNIT_STRING)) { + const char *v = ogs_yaml_iter_value(&uplink_iter); + if (v) { + unit = atoi(v); + if (unit == 0 || unit == 1 || unit == 2 || + unit == 3 || unit == 4) { + } else { + ogs_error("Unknown Unit [%d]", unit); + return OGS_ERROR; + } + } + } else + ogs_warn("unknown key `%s`", uplink_key); + } + + for (n = 0; n < unit; n++) + br->uplink *= 1000; + } else + ogs_warn("unknown key `%s`", br_key); + } + + return OGS_OK; +} + +static int parse_qos_conf(ogs_yaml_iter_t *parent, ogs_qos_t *qos) +{ + int rv; + ogs_yaml_iter_t qos_iter; + + ogs_assert(parent); + ogs_assert(qos); + + ogs_yaml_iter_recurse(parent, &qos_iter); + while (ogs_yaml_iter_next(&qos_iter)) { + const char *qos_key = ogs_yaml_iter_key(&qos_iter); + ogs_assert(qos_key); + if (!strcmp(qos_key, OGS_INDEX_STRING)) { + const char *v = ogs_yaml_iter_value(&qos_iter); + if (v) { + uint8_t index = atoi(v); + if (index == 1 || index == 2 || index == 3 || index == 4 || + index == 65 || index == 66 || index == 67 || index == 75 || + index == 71 || index == 72 || index == 73 || index == 74 || + index == 76 || index == 5 || index == 6 || index == 7 || + index == 8 || index == 9 || index == 69 || index == 70 || + index == 79 || index == 80 || index == 82 || index == 83 || + index == 84 || index == 85 || index == 86) + qos->index = index; + else { + ogs_error("Unknown QCI [%d]", index); + return OGS_ERROR; + } + } + } else if (!strcmp(qos_key, OGS_ARP_STRING)) { + ogs_yaml_iter_t arp_iter; + ogs_yaml_iter_recurse(&qos_iter, &arp_iter); + while (ogs_yaml_iter_next(&arp_iter)) { + const char *arp_key = ogs_yaml_iter_key(&arp_iter); + ogs_assert(arp_key); + if (!strcmp(arp_key, OGS_PRIORITY_LEVEL_STRING)) { + const char *v = ogs_yaml_iter_value(&arp_iter); + if (v) { + uint8_t priority_level = atoi(v); + if (priority_level >= 1 && priority_level <= 15) + qos->arp.priority_level = priority_level; + else { + ogs_error("Unknown Priority Level [%d]", + priority_level); + return OGS_ERROR; + } + } + } else if (!strcmp(arp_key, + OGS_PRE_EMPTION_CAPABILITY_STRING)) { + const char *v = ogs_yaml_iter_value(&arp_iter); + if (v) { + uint8_t pre_emption_capability = atoi(v); + if (pre_emption_capability == + OGS_5GC_PRE_EMPTION_DISABLED || + pre_emption_capability == + OGS_5GC_PRE_EMPTION_ENABLED) + qos->arp.pre_emption_capability = + pre_emption_capability; + else { + ogs_error("Unknown Preemption Capability [%d]", + pre_emption_capability); + return OGS_ERROR; + } + } + } else if (!strcmp(arp_key, + OGS_PRE_EMPTION_VULNERABILITY_STRING)) { + const char *v = ogs_yaml_iter_value(&arp_iter); + if (v) { + uint8_t pre_emption_vulnerability = atoi(v); + if (pre_emption_vulnerability == + OGS_5GC_PRE_EMPTION_DISABLED || + pre_emption_vulnerability == + OGS_5GC_PRE_EMPTION_ENABLED) + qos->arp.pre_emption_vulnerability = + pre_emption_vulnerability; + else { + ogs_error("Unknown Preemption Vulnerablility [%d]", + pre_emption_vulnerability); + return OGS_ERROR; + } + } + } else + ogs_warn("unknown key `%s`", arp_key); + } + } else if (!strcmp(qos_key, OGS_MBR_STRING)) { + rv = parse_br_conf(&qos_iter, &qos->mbr); + if (rv != OGS_OK) { + ogs_error("parse_br_conf() failed"); + return rv; + } + } else if (!strcmp(qos_key, OGS_GBR_STRING)) { + rv = parse_br_conf(&qos_iter, &qos->gbr); + if (rv != OGS_OK) { + ogs_error("parse_br_conf() failed"); + return rv; + } + } + } + + return OGS_OK; +} + +static int session_conf_prepare(ogs_app_slice_conf_t *slice_conf) +{ + ogs_assert(slice_conf); + return OGS_OK; +} + +static int session_conf_validation(ogs_app_slice_conf_t *slice_conf) +{ + int rv, j, k; + ogs_app_session_conf_t *session_conf = NULL; + ogs_assert(slice_conf); + + ogs_list_for_each(&slice_conf->sess_list, session_conf) { + ogs_session_data_t *session_data = &session_conf->data; + + ogs_info("NAME[%s]", session_data->session.name); + ogs_info("QCI[%d]", session_data->session.qos.index); + ogs_info("ARP[%d:%d:%d]", + session_data->session.qos.arp.priority_level, + session_data->session.qos.arp.pre_emption_capability, + session_data->session.qos.arp.pre_emption_vulnerability); + ogs_info("AMBR[Downlink:%lld:Uplink:%lld]", + (long long)session_data->session.ambr.downlink, + (long long)session_data->session.ambr.uplink); + for (j = 0; j < session_data->num_of_pcc_rule; j++) { + ogs_info("PCC_RULE[%d]", j+1); + ogs_info(" ID[%s]", session_data->pcc_rule[j].id); + ogs_info(" NAME[%s]", session_data->pcc_rule[j].name); + ogs_info(" QCI[%d]", session_data->pcc_rule[j].qos.index); + ogs_info(" ARP[%d:%d:%d]", + session_data->pcc_rule[j].qos.arp.priority_level, + session_data->pcc_rule[j].qos.arp. + pre_emption_capability, + session_data->pcc_rule[j].qos.arp. + pre_emption_vulnerability); + ogs_info(" MBR[Downlink:%lld:Uplink:%lld]", + (long long)session_data->pcc_rule[j].qos.mbr.downlink, + (long long)session_data->pcc_rule[j].qos.mbr.uplink); + ogs_info(" GBR[Downlink:%lld:Uplink:%lld]", + (long long)session_data->pcc_rule[j].qos.gbr.downlink, + (long long)session_data->pcc_rule[j].qos.gbr.uplink); + ogs_info(" NUM_OF_FLOW [%d]", + session_data->pcc_rule[j].num_of_flow); + + for (k = 0; k < session_data->pcc_rule[j].num_of_flow; k++) { + ogs_info(" DIRECTION[%d]", + session_data->pcc_rule[j].flow[k].direction); + ogs_info(" DESCRIPTION[%s]", + session_data->pcc_rule[j].flow[k].description); + } + } + + rv = ogs_check_br_conf(&session_data->session.ambr); + if (rv != OGS_OK) { + ogs_error("check_br_conf(AMBR) failed"); + return rv; + } + rv = ogs_check_qos_conf(&session_data->session.qos); + if (rv != OGS_OK) { + ogs_error("check_qos_conf(SESS) failed"); + return rv; + } + } + + return OGS_OK; +} + +int ogs_app_parse_session_conf( + ogs_yaml_iter_t *parent, ogs_app_slice_conf_t *slice_conf) +{ + int rv; + ogs_yaml_iter_t session_array, session_iter; + + ogs_assert(parent); + ogs_assert(slice_conf); + + rv = session_conf_prepare(slice_conf); + if (rv != OGS_OK) return rv; + + ogs_yaml_iter_recurse(parent, &session_array); + do { + const char *name = NULL; + ogs_app_session_conf_t *session_conf = NULL; + ogs_session_data_t *session_data = NULL; + + OGS_YAML_ARRAY_NEXT(&session_array, &session_iter); + while (ogs_yaml_iter_next(&session_iter)) { + const char *session_key = ogs_yaml_iter_key(&session_iter); + ogs_assert(session_key); + if (!strcmp(session_key, OGS_NAME_STRING)) { + name = (char *)ogs_yaml_iter_value(&session_iter); + } + } + + if (name) { + session_conf = ogs_app_session_conf_add(slice_conf, (char *)name); + if (!session_conf) { + ogs_error("ogs_app_session_conf_add() failed [DNN:%s]", name); + return OGS_ERROR; + } + } else { + ogs_error("No APN/DNN"); + return OGS_ERROR; + } + + session_data = &session_conf->data; + OGS_YAML_ARRAY_RECURSE(&session_array, &session_iter); + while (ogs_yaml_iter_next(&session_iter)) { + const char *session_key = ogs_yaml_iter_key(&session_iter); + ogs_assert(session_key); + if (!strcmp(session_key, OGS_TYPE_STRING)) { + const char *v = ogs_yaml_iter_value(&session_iter); + if (v) { + uint8_t session_type = atoi(v); + if (session_type == OGS_PDU_SESSION_TYPE_IPV4 || + session_type == OGS_PDU_SESSION_TYPE_IPV6 || + session_type == OGS_PDU_SESSION_TYPE_IPV4V6 || + session_type == OGS_PDU_SESSION_TYPE_UNSTRUCTURED || + session_type == OGS_PDU_SESSION_TYPE_ETHERNET) + session_data->session.session_type = session_type; + else { + ogs_error("Unknown Session Type [%d]", session_type); + return OGS_ERROR; + } + } + } else if (!strcmp(session_key, OGS_AMBR_STRING)) { + rv = parse_br_conf(&session_iter, &session_data->session.ambr); + if (rv != OGS_OK) { + ogs_error("parse_qos_conf() failed"); + return rv; + } + } else if (!strcmp(session_key, OGS_QOS_STRING)) { + rv = parse_qos_conf(&session_iter, &session_data->session.qos); + if (rv != OGS_OK) { + ogs_error("parse_qos_conf() failed"); + return rv; + } + } else if (!strcmp(session_key, OGS_PCC_RULE_STRING)) { + int pcc_rule_index = 0; + ogs_yaml_iter_t pcc_rule_array, pcc_rule_iter; + ogs_yaml_iter_recurse(&session_iter, &pcc_rule_array); + do { + ogs_pcc_rule_t *pcc_rule = NULL; + + ogs_assert(session_data->num_of_pcc_rule < + OGS_MAX_NUM_OF_PCC_RULE); + pcc_rule = &session_data-> + pcc_rule[session_data->num_of_pcc_rule]; + + OGS_YAML_ARRAY_NEXT(&pcc_rule_array, &pcc_rule_iter); + while (ogs_yaml_iter_next(&pcc_rule_iter)) { + const char *pcc_rule_key = + ogs_yaml_iter_key(&pcc_rule_iter); + ogs_assert(pcc_rule_key); + if (!strcmp(pcc_rule_key, OGS_QOS_STRING)) { + rv = parse_qos_conf(&pcc_rule_iter, &pcc_rule->qos); + if (rv != OGS_OK) { + ogs_error("parse_qos_conf() failed"); + return rv; + } + } else if (!strcmp(pcc_rule_key, OGS_FLOW_STRING)) { + ogs_yaml_iter_t flow_array, flow_iter; + ogs_yaml_iter_recurse( &pcc_rule_iter, &flow_array); + do { + ogs_flow_t *flow = NULL; + + ogs_assert(pcc_rule->num_of_flow < + OGS_MAX_NUM_OF_FLOW_IN_PCC_RULE); + flow = &pcc_rule->flow[pcc_rule->num_of_flow]; + + OGS_YAML_ARRAY_NEXT(&flow_array, &flow_iter); + while (ogs_yaml_iter_next(&flow_iter)) { + const char *flow_key = + ogs_yaml_iter_key(&flow_iter); + ogs_assert(flow_key); + if (!strcmp(flow_key, + OGS_DIRECTION_STRING)) { + const char *v = + ogs_yaml_iter_value(&flow_iter); + if (v) { + uint8_t direction = atoi(v); + if (direction == + OGS_FLOW_DOWNLINK_ONLY || + direction == + OGS_FLOW_UPLINK_ONLY) + flow->direction = direction; + else { + ogs_error( + "Unknown Direction [%d]", + direction); + return OGS_ERROR; + } + } + } else if (!strcmp(flow_key, + OGS_DESCRIPTION_STRING)) { + const char *v = + (char *)ogs_yaml_iter_value( + &flow_iter); + if (v) { + flow->description = ogs_strdup(v); + ogs_assert(flow->description); + } + } + } + + if (flow->direction && flow->description) + pcc_rule->num_of_flow++; + + } while (ogs_yaml_iter_type(&flow_array) == + YAML_SEQUENCE_NODE); + + } else + ogs_warn("unknown key `%s`", pcc_rule_key); + } + + if (pcc_rule->qos.index && + pcc_rule->qos.arp.priority_level && + pcc_rule->qos.arp.pre_emption_capability && + pcc_rule->qos.arp.pre_emption_vulnerability) { + + /* EPC: Charing-Rule-Name */ + ogs_assert(!pcc_rule->name); + pcc_rule->name = ogs_msprintf("%s-g%d", + session_data->session.name, pcc_rule_index+1); + ogs_assert(pcc_rule->name); + + /* 5GC: PCC-Rule-Id */ + ogs_assert(!pcc_rule->id); + pcc_rule->id = ogs_msprintf("%s-n%d", + session_data->session.name, pcc_rule_index+1); + ogs_assert(pcc_rule->id); + + pcc_rule->precedence = pcc_rule_index+1; + pcc_rule_index++; + + session_data->num_of_pcc_rule++; + } else + ogs_warn("Mandatory is MISSING - " + "QCI[%d], ARP[%d:%d:%d]", + pcc_rule->qos.index, + pcc_rule->qos.arp.priority_level, + pcc_rule->qos.arp. + pre_emption_capability, + pcc_rule->qos.arp. + pre_emption_vulnerability); + + } while (ogs_yaml_iter_type(&pcc_rule_array) == + YAML_SEQUENCE_NODE); + } + } + + } while (ogs_yaml_iter_type(&session_array) == YAML_SEQUENCE_NODE); + + rv = session_conf_validation(slice_conf); + if (rv != OGS_OK) return rv; + + return OGS_OK; +} + +ogs_app_policy_conf_t *ogs_app_policy_conf_add(ogs_plmn_id_t *plmn_id) +{ + ogs_app_policy_conf_t *policy_conf = NULL; + + ogs_assert(plmn_id); + + ogs_pool_alloc(&policy_conf_pool, &policy_conf); + if (!policy_conf) { + ogs_error("Maximum number of policy_conf[%d] reached", + OGS_MAX_NUM_OF_PLMN); + return NULL; + } + memset(policy_conf, 0, sizeof *policy_conf); + + memcpy(&policy_conf->plmn_id, plmn_id, sizeof(ogs_plmn_id_t)); + + ogs_list_init(&policy_conf->slice_list); + + ogs_list_add(&local_conf.policy_list, policy_conf); + + ogs_info("POLICY config added [%d]", + ogs_list_count(&local_conf.policy_list)); + return policy_conf; +} + +ogs_app_policy_conf_t *ogs_app_policy_conf_find_by_plmn_id( + ogs_plmn_id_t *plmn_id) +{ + ogs_app_policy_conf_t *policy_conf = NULL; + + ogs_assert(plmn_id); + + ogs_list_for_each(&local_conf.policy_list, policy_conf) { + if (memcmp(&policy_conf->plmn_id, plmn_id, sizeof(ogs_plmn_id_t)) == 0) + break; + } + + return policy_conf; +} +void ogs_app_policy_conf_remove(ogs_app_policy_conf_t *policy_conf) +{ + ogs_assert(policy_conf); + + ogs_list_remove(&local_conf.policy_list, policy_conf); + + ogs_app_slice_conf_remove_all(policy_conf); + + ogs_pool_free(&policy_conf_pool, policy_conf); + + ogs_info("POLICY config removed [%d]", + ogs_list_count(&local_conf.policy_list)); +} +void ogs_app_policy_conf_remove_all(void) +{ + ogs_app_policy_conf_t *policy_conf = NULL, *next_conf = NULL;; + + ogs_list_for_each_safe(&local_conf.policy_list, next_conf, policy_conf) + ogs_app_policy_conf_remove(policy_conf); +} + +ogs_app_slice_conf_t *ogs_app_slice_conf_add( + ogs_app_policy_conf_t *policy_conf, ogs_s_nssai_t *s_nssai) +{ + ogs_app_slice_conf_t *slice_conf = NULL; + + ogs_assert(policy_conf); + ogs_assert(s_nssai); + ogs_assert(s_nssai->sst); + + ogs_pool_alloc(&slice_conf_pool, &slice_conf); + if (!slice_conf) { + ogs_error("Maximum number of slice_conf[%d] reached", + OGS_MAX_NUM_OF_SLICE); + return NULL; + } + memset(slice_conf, 0, sizeof *slice_conf); + + slice_conf->data.s_nssai.sst = s_nssai->sst; + slice_conf->data.s_nssai.sd.v = s_nssai->sd.v; + + ogs_list_init(&slice_conf->sess_list); + + ogs_list_add(&policy_conf->slice_list, slice_conf); + + slice_conf->policy_conf = policy_conf; + + ogs_info("SLICE config added [%d]", + ogs_list_count(&policy_conf->slice_list)); + return slice_conf; +} + +ogs_app_slice_conf_t *ogs_app_slice_conf_find_by_s_nssai( + ogs_app_policy_conf_t *policy_conf, ogs_s_nssai_t *s_nssai) +{ + ogs_app_slice_conf_t *slice_conf = NULL; + + ogs_assert(policy_conf); + ogs_assert(s_nssai); + ogs_assert(s_nssai->sst); + + ogs_list_for_each(&policy_conf->slice_list, slice_conf) { + if (slice_conf->data.s_nssai.sst == s_nssai->sst && + slice_conf->data.s_nssai.sd.v == s_nssai->sd.v) + break; + } + + return slice_conf; +} +void ogs_app_slice_conf_remove(ogs_app_slice_conf_t *slice_conf) +{ + ogs_app_policy_conf_t *policy_conf = NULL; + + ogs_assert(slice_conf); + policy_conf = slice_conf->policy_conf; + ogs_assert(policy_conf); + + ogs_list_remove(&policy_conf->slice_list, slice_conf); + + ogs_app_session_conf_remove_all(slice_conf); + + ogs_pool_free(&slice_conf_pool, slice_conf); + + ogs_info("SLICE config removed [%d]", + ogs_list_count(&policy_conf->slice_list)); +} +void ogs_app_slice_conf_remove_all(ogs_app_policy_conf_t *policy_conf) +{ + ogs_app_slice_conf_t *slice_conf = NULL, *next_conf = NULL;; + + ogs_assert(policy_conf); + + ogs_list_for_each_safe(&policy_conf->slice_list, next_conf, slice_conf) + ogs_app_slice_conf_remove(slice_conf); +} + +int ogs_app_check_policy_conf(void) +{ + ogs_app_policy_conf_t *policy_conf = NULL; + + ogs_list_for_each(&ogs_local_conf()->policy_list, policy_conf) { + ogs_app_slice_conf_t *slice_conf = NULL; + bool default_indicator = false; + + ogs_list_for_each(&policy_conf->slice_list, slice_conf) { + if (slice_conf->data.default_indicator == true) + default_indicator = true; + + if (ogs_list_count(&slice_conf->sess_list) == 0) { + ogs_error("At least 1 Session is required"); + return OGS_ERROR; + } + } + + if (default_indicator == false) { + ogs_error("At least 1 Default S-NSSAI is required"); + return OGS_ERROR; + } + } + + return OGS_OK; +} + +ogs_app_session_conf_t *ogs_app_session_conf_add( + ogs_app_slice_conf_t *slice_conf, char *name) +{ + ogs_app_session_conf_t *session_conf = NULL; + + ogs_assert(slice_conf); + ogs_assert(name); + + ogs_pool_alloc(&session_conf_pool, &session_conf); + if (!session_conf) { + ogs_error("Maximum number of session_conf[%d] reached", + OGS_MAX_NUM_OF_SLICE*OGS_MAX_NUM_OF_SESS); + return NULL; + } + memset(session_conf, 0, sizeof *session_conf); + + session_conf->data.session.name = ogs_strdup(name); + if (!session_conf->data.session.name) { + ogs_error("No memory for DNN[%s]", name); + ogs_pool_free(&session_conf_pool, session_conf); + return NULL; + } + + ogs_list_add(&slice_conf->sess_list, session_conf); + + session_conf->slice_conf = slice_conf; + + ogs_info("SESSION config added [%d]", + ogs_list_count(&slice_conf->sess_list)); + + return session_conf; +} +ogs_app_session_conf_t *ogs_app_session_conf_find_by_dnn( + ogs_app_slice_conf_t *slice_conf, char *name) +{ + ogs_app_session_conf_t *session_conf = NULL; + + ogs_assert(slice_conf); + ogs_assert(name); + + ogs_list_for_each(&slice_conf->sess_list, session_conf) { + ogs_assert(session_conf->data.session.name); + if (strcmp(session_conf->data.session.name, name) == 0) + break; + } + + return session_conf; +} +void ogs_app_session_conf_remove(ogs_app_session_conf_t *session_conf) +{ + ogs_app_slice_conf_t *slice_conf = NULL; + + ogs_assert(session_conf); + slice_conf = session_conf->slice_conf; + ogs_assert(slice_conf); + + ogs_list_remove(&slice_conf->sess_list, session_conf); + + OGS_SESSION_DATA_FREE(&session_conf->data); + + ogs_pool_free(&session_conf_pool, session_conf); + + ogs_info("SESSION config removed [%d]", + ogs_list_count(&slice_conf->sess_list)); +} +void ogs_app_session_conf_remove_all(ogs_app_slice_conf_t *slice_conf) +{ + ogs_app_session_conf_t *session_conf = NULL, *next_conf = NULL;; + + ogs_assert(slice_conf); + + ogs_list_for_each_safe(&slice_conf->sess_list, next_conf, session_conf) + ogs_app_session_conf_remove(session_conf); +} + +int ogs_app_config_session_data( + ogs_plmn_id_t *plmn_id, ogs_s_nssai_t *s_nssai, char *dnn, + ogs_session_data_t *session_data) +{ + ogs_app_policy_conf_t *policy_conf = NULL; + ogs_app_slice_conf_t *slice_conf = NULL; + ogs_app_session_conf_t *session_conf = NULL; + + ogs_assert(dnn); + ogs_assert(session_data); + + if (plmn_id) { + policy_conf = ogs_app_policy_conf_find_by_plmn_id(plmn_id); + if (!policy_conf) { + ogs_error("No POLICY [MCC:%03d,MNC:%03d]", + ogs_plmn_id_mcc(plmn_id), ogs_plmn_id_mnc(plmn_id)); + return OGS_ERROR; + } + } else { + policy_conf = ogs_list_first(&ogs_local_conf()->policy_list); + if (!policy_conf) { + ogs_error("No default POLICY for EPC"); + return OGS_ERROR; + } + } + + if (s_nssai) { + slice_conf = ogs_app_slice_conf_find_by_s_nssai(policy_conf, s_nssai); + if (!slice_conf) { + ogs_error("No SLICE [SST:%d, SD:0x%x]", + s_nssai->sst, s_nssai->sd.v); + return OGS_ERROR; + } + } else { + slice_conf = ogs_list_first(&policy_conf->slice_list); + if (!slice_conf) { + ogs_error("No default SLICE for EPC"); + return OGS_ERROR; + } + } + session_conf = ogs_app_session_conf_find_by_dnn(slice_conf, dnn); + if (!session_conf) { + ogs_error("No SESSION [%s]", dnn); + return OGS_ERROR; + } + + OGS_STORE_SESSION_DATA(session_data, &session_conf->data); + + return OGS_OK; +} diff --git a/lib/app/ogs-config.h b/lib/app/ogs-config.h index c72e76a98..b6ac4923b 100644 --- a/lib/app/ogs-config.h +++ b/lib/app/ogs-config.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -28,9 +28,175 @@ extern "C" { #endif -int ogs_app_config_parse_sockopt( +typedef struct ogs_global_conf_s { + struct { + /* Element */ + int no_mme; + int no_hss; + int no_sgw; + int no_sgwc; + int no_sgwu; + int no_pgw; + int no_pcrf; + + int no_amf; + int no_smf; + int no_upf; + int no_ausf; + int no_udm; + int no_pcf; + int no_nssf; + int no_bsf; + int no_udr; + int no_sepp; + int no_scp; + int no_nrf; + + /* Network */ + int no_ipv4; + int no_ipv6; + int prefer_ipv4; + int multicast; + + int use_openair; + int no_ipv4v6_local_addr_in_packet_filter; + + int no_pfcp_rr_select; + } parameter; + + struct { + uint64_t ue; + uint64_t peer; + uint64_t gtp_peer; + } max; + + struct { + int no_delay; + int l_onoff; + int l_linger; + } sockopt; + + ogs_pkbuf_config_t pkbuf_config; + +} ogs_app_global_conf_t; + +typedef struct ogs_local_conf_s { + struct { + struct { + int heartbeat_interval; + int no_heartbeat_margin; + int validity_duration; + } nf_instance; + struct { + int validity_duration; + } subscription; + + struct { + ogs_time_t duration; + struct { + ogs_time_t client_wait_duration; + ogs_time_t connection_deadline; + ogs_time_t reconnect_interval; + ogs_time_t reconnect_interval_in_exception; + } sbi; + + struct { + ogs_time_t t3_response_duration; + int n3_response_rcount; + ogs_time_t t3_holding_duration; + int n3_holding_rcount; + } gtp; + + struct { + ogs_time_t t1_response_duration; + int n1_response_rcount; + ogs_time_t t1_holding_duration; + int n1_holding_rcount; + ogs_time_t association_interval; + ogs_time_t no_heartbeat_duration; + } pfcp; + } message; + + struct { + ogs_time_t duration; + ogs_time_t complete_delay; + } handover; + + } time; + + ogs_plmn_id_t serving_plmn_id[OGS_MAX_NUM_OF_PLMN]; + int num_of_serving_plmn_id; + + ogs_list_t policy_list; + +} ogs_app_local_conf_t; + +typedef struct ogs_app_policy_conf_s { + ogs_lnode_t lnode; + + ogs_plmn_id_t plmn_id; + + ogs_list_t slice_list; +} ogs_app_policy_conf_t; + +typedef struct ogs_app_slice_conf_s { + ogs_lnode_t lnode; + + ogs_slice_data_t data; + + ogs_list_t sess_list; + ogs_app_policy_conf_t *policy_conf; +} ogs_app_slice_conf_t; + +typedef struct ogs_app_session_conf_s { + ogs_lnode_t lnode; + + ogs_session_data_t data; + + ogs_app_slice_conf_t *slice_conf; +} ogs_app_session_conf_t; + +int ogs_app_config_init(void); +void ogs_app_config_final(void); + +ogs_app_global_conf_t *ogs_global_conf(void); +ogs_app_local_conf_t *ogs_local_conf(void); + +int ogs_app_parse_global_conf(ogs_yaml_iter_t *parent); +int ogs_app_parse_local_conf(const char *local); + +int ogs_app_parse_sockopt_config( ogs_yaml_iter_t *parent, ogs_sockopt_t *option); +int ogs_app_check_policy_conf(void); +int ogs_app_parse_session_conf( + ogs_yaml_iter_t *parent, ogs_app_slice_conf_t *slice_conf); + +ogs_app_policy_conf_t *ogs_app_policy_conf_add(ogs_plmn_id_t *plmn_id); +ogs_app_policy_conf_t *ogs_app_policy_conf_find_by_plmn_id( + ogs_plmn_id_t *plmn_id); +void ogs_app_policy_conf_remove(ogs_app_policy_conf_t *policy_conf); +void ogs_app_policy_conf_remove_all(void); + +ogs_app_slice_conf_t *ogs_app_slice_conf_add( + ogs_app_policy_conf_t *policy_conf, ogs_s_nssai_t *s_nssai); +ogs_app_slice_conf_t *ogs_app_slice_conf_find_by_s_nssai( + ogs_app_policy_conf_t *policy_conf, ogs_s_nssai_t *s_nssai); +void ogs_app_slice_conf_remove(ogs_app_slice_conf_t *slice_conf); +void ogs_app_slice_conf_remove_all(ogs_app_policy_conf_t *policy_conf); + +ogs_app_session_conf_t *ogs_app_session_conf_add( + ogs_app_slice_conf_t *slice_conf, char *name); +ogs_app_session_conf_t *ogs_app_session_conf_find_by_dnn( + ogs_app_slice_conf_t *slice_conf, char *name); +void ogs_app_session_conf_remove(ogs_app_session_conf_t *session_conf); +void ogs_app_session_conf_remove_all( + ogs_app_slice_conf_t *slice_conf); + +int ogs_app_config_session_data( + ogs_plmn_id_t *plmn_id, ogs_s_nssai_t *s_nssai, char *dnn, + ogs_session_data_t *session_data); + #ifdef __cplusplus } #endif diff --git a/lib/app/ogs-context.c b/lib/app/ogs-context.c index de568d1c4..c36663a7b 100644 --- a/lib/app/ogs-context.c +++ b/lib/app/ogs-context.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -23,16 +23,12 @@ static ogs_app_context_t self; static int initialized = 0; -static void app_context_prepare(void); - int ogs_app_context_init(void) { ogs_assert(initialized == 0); memset(&self, 0, sizeof(ogs_app_context_t)); - app_context_prepare(); - initialized = 1; return OGS_OK; @@ -61,539 +57,3 @@ ogs_app_context_t *ogs_app(void) { return &self; } - -static void recalculate_pool_size(void) -{ - self.pool.packet = self.max.ue * OGS_MAX_NUM_OF_PACKET_BUFFER; - -#define MAX_NUM_OF_TUNNEL 3 /* Num of Tunnel per Bearer */ - self.pool.sess = self.max.ue * OGS_MAX_NUM_OF_SESS; - self.pool.bearer = self.pool.sess * OGS_MAX_NUM_OF_BEARER; - self.pool.tunnel = self.pool.bearer * MAX_NUM_OF_TUNNEL; - -#define POOL_NUM_PER_UE 16 - self.pool.timer = self.max.ue * POOL_NUM_PER_UE; - self.pool.message = self.max.ue * POOL_NUM_PER_UE; - self.pool.event = self.max.ue * POOL_NUM_PER_UE; - self.pool.socket = self.max.ue * POOL_NUM_PER_UE; - self.pool.xact = self.max.ue * POOL_NUM_PER_UE; - self.pool.stream = self.max.ue * POOL_NUM_PER_UE; - - self.pool.nf = self.max.peer; -#define NF_SERVICE_PER_NF_INSTANCE 16 - self.pool.nf_service = self.pool.nf * NF_SERVICE_PER_NF_INSTANCE; - self.pool.subscription = self.pool.nf * NF_SERVICE_PER_NF_INSTANCE; - - self.pool.gtp_node = self.pool.nf; - if (self.max.gtp_peer) - self.pool.gtp_node = self.max.gtp_peer; - - /* Num of TAI-LAI Mapping Table */ - self.pool.csmap = self.pool.nf; - -#define MAX_NUM_OF_IMPU 8 - self.pool.impi = self.max.ue; - self.pool.impu = self.pool.impi * MAX_NUM_OF_IMPU; -} - -static void regenerate_all_timer_duration(void) -{ - ogs_assert(self.time.message.duration); - - self.time.message.sbi.client_wait_duration = self.time.message.duration; - self.time.message.sbi.connection_deadline = - self.time.message.sbi.client_wait_duration + ogs_time_from_sec(1); - self.time.message.sbi.nf_register_interval = - ogs_max(ogs_time_from_sec(3), - self.time.message.sbi.client_wait_duration + ogs_time_from_sec(1)); - self.time.message.sbi.nf_register_interval_in_exception = - ogs_time_from_sec(2); - -#define PFCP_N1_RESPONSE_RETRY_COUNT 3 - self.time.message.pfcp.n1_response_rcount = PFCP_N1_RESPONSE_RETRY_COUNT; - self.time.message.pfcp.t1_response_duration = - (self.time.message.duration / - (self.time.message.pfcp.n1_response_rcount + 1)); - ogs_assert(self.time.message.pfcp.t1_response_duration); - -#define PFCP_N1_HOLDING_RETRY_COUNT 1 - self.time.message.pfcp.n1_holding_rcount = PFCP_N1_HOLDING_RETRY_COUNT; - self.time.message.pfcp.t1_holding_duration = - self.time.message.pfcp.n1_response_rcount * - self.time.message.pfcp.t1_response_duration; - ogs_assert(self.time.message.pfcp.t1_holding_duration); - - self.time.message.pfcp.association_interval = - ogs_max(ogs_time_from_sec(3), - self.time.message.sbi.client_wait_duration + ogs_time_from_sec(1)); - - self.time.message.pfcp.no_heartbeat_duration = - ogs_max(ogs_time_from_sec(10), - self.time.message.sbi.client_wait_duration + ogs_time_from_sec(1)); - -#define GTP_N3_RESPONSE_RETRY_COUNT 3 - self.time.message.gtp.n3_response_rcount = GTP_N3_RESPONSE_RETRY_COUNT; - self.time.message.gtp.t3_response_duration = - (self.time.message.duration / - (self.time.message.gtp.n3_response_rcount + 1)); - ogs_assert(self.time.message.gtp.t3_response_duration); - -#define GTP_N3_HOLDING_RETRY_COUNT 1 - self.time.message.gtp.n3_holding_rcount = GTP_N3_HOLDING_RETRY_COUNT; - self.time.message.gtp.t3_holding_duration = - self.time.message.gtp.n3_response_rcount * - self.time.message.gtp.t3_response_duration; - ogs_assert(self.time.message.gtp.t3_holding_duration); - -#if 0 - ogs_trace("%lld, %lld, %lld, %d, %lld, %d %lld, %d, %lld, %d, %lld", - (long long)self.time.message.duration, - (long long)self.time.message.sbi.client_wait_duration, - (long long)self.time.message.sbi.connection_deadline, - self.time.message.pfcp.n1_response_rcount, - (long long)self.time.message.pfcp.t1_response_duration, - self.time.message.pfcp.n1_holding_rcount, - (long long)self.time.message.pfcp.t1_holding_duration, - self.time.message.gtp.n3_response_rcount, - (long long)self.time.message.gtp.t3_response_duration, - self.time.message.gtp.n3_holding_rcount, - (long long)self.time.message.gtp.t3_holding_duration); - ogs_trace("%lld, %lld, %lld", - (long long)self.time.message.sbi.nf_register_interval, - (long long)self.time.message.pfcp.association_interval, - (long long)self.time.message.pfcp.no_heartbeat_duration); -#endif -} - -static void app_context_prepare(void) -{ -#define USRSCTP_LOCAL_UDP_PORT 9899 - self.usrsctp.udp_port = USRSCTP_LOCAL_UDP_PORT; - - self.sockopt.no_delay = true; - -#define MAX_NUM_OF_UE 1024 /* Num of UEs */ -#define MAX_NUM_OF_PEER 64 /* Num of Peer */ - - self.max.ue = MAX_NUM_OF_UE; - self.max.peer = MAX_NUM_OF_PEER; - - ogs_pkbuf_default_init(&self.pool.defconfig); - - recalculate_pool_size(); - - /* - * Heartbeat Interval(e.g: 10 seconds) + No Heartbeat Margin(1 second) */ - self.time.nf_instance.no_heartbeat_margin = 1; - - /* 3600 seconds = 1 hour */ - self.time.nf_instance.validity_duration = 3600; - - /* 86400 seconds = 1 day */ - self.time.subscription.validity_duration = 86400; - - /* - * Message Wait Duration : 10 seconds (Default) - * - * The paging retry timer is 2 seconds and the retry count is 3. - * - * It is recomended to set at least 9 seconds to reflect - * the paging failure result to GTPv2-C or HTTP2(SBI). - */ - self.time.message.duration = ogs_time_from_sec(10); - - /* - * Handover Wait Duration : 300 ms (Default) - * - * Time to wait for AMF/MME to send UEContextReleaseCommand - * to the source gNB/eNB after receiving HandoverNotify - */ - self.time.handover.duration = ogs_time_from_msec(300); - - /* Size of internal metrics pool (amount of ogs_metrics_spec_t) */ - self.metrics.max_specs = 512; - - regenerate_all_timer_duration(); -} - -static int app_context_validation(void) -{ - if (self.parameter.no_ipv4 == 1 && - self.parameter.no_ipv6 == 1) { - ogs_error("Both `no_ipv4` and `no_ipv6` set to `true` in `%s`", - self.file); - return OGS_ERROR; - } - - if (self.time.nf_instance.validity_duration == 0) { - ogs_error("NF Instance validity-time should not 0"); - ogs_error("time:"); - ogs_error(" nf_instance:"); - ogs_error(" validity: 0"); - - return OGS_ERROR; - } - - return OGS_OK; -} - -int ogs_app_context_parse_config(void) -{ - int rv; - yaml_document_t *document = NULL; - ogs_yaml_iter_t root_iter; - - document = self.document; - ogs_assert(document); - - ogs_yaml_iter_init(&root_iter, document); - while (ogs_yaml_iter_next(&root_iter)) { - const char *root_key = ogs_yaml_iter_key(&root_iter); - ogs_assert(root_key); - if (!strcmp(root_key, "db_uri")) { - self.db_uri = ogs_yaml_iter_value(&root_iter); - } else if (!strcmp(root_key, "logger")) { - ogs_yaml_iter_t logger_iter; - ogs_yaml_iter_recurse(&root_iter, &logger_iter); - while (ogs_yaml_iter_next(&logger_iter)) { - const char *logger_key = ogs_yaml_iter_key(&logger_iter); - ogs_assert(logger_key); - if (!strcmp(logger_key, "file")) { - self.logger.file = ogs_yaml_iter_value(&logger_iter); - } else if (!strcmp(logger_key, "level")) { - self.logger.level = - ogs_yaml_iter_value(&logger_iter); - } else if (!strcmp(logger_key, "domain")) { - self.logger.domain = - ogs_yaml_iter_value(&logger_iter); - } - } - } else if (!strcmp(root_key, "parameter")) { - ogs_yaml_iter_t parameter_iter; - ogs_yaml_iter_recurse(&root_iter, ¶meter_iter); - while (ogs_yaml_iter_next(¶meter_iter)) { - const char *parameter_key = ogs_yaml_iter_key(¶meter_iter); - ogs_assert(parameter_key); - if (!strcmp(parameter_key, "no_hss")) { - self.parameter.no_hss = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_mme")) { - self.parameter.no_mme = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_sgwu")) { - self.parameter.no_sgwu = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_sgwc")) { - self.parameter.no_sgwc = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_sgw")) { - self.parameter.no_sgw = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_pgw")) { - self.parameter.no_pgw = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_pcrf")) { - self.parameter.no_pcrf = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_nrf")) { - self.parameter.no_nrf = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_scp")) { - self.parameter.no_scp = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_amf")) { - self.parameter.no_amf = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_smf")) { - self.parameter.no_smf = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_upf")) { - self.parameter.no_upf = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_ausf")) { - self.parameter.no_ausf = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_udm")) { - self.parameter.no_udm = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_pcf")) { - self.parameter.no_pcf = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_nssf")) { - self.parameter.no_nssf = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_bsf")) { - self.parameter.no_bsf = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_udr")) { - self.parameter.no_udr = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_ipv4")) { - self.parameter.no_ipv4 = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_ipv6")) { - self.parameter.no_ipv6 = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "prefer_ipv4")) { - self.parameter.prefer_ipv4 = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "multicast")) { - self.parameter.multicast = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "use_openair")) { - self.parameter.use_openair = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp( - parameter_key, "no_ipv4v6_local_addr_in_packet_filter")) { - self.parameter.no_ipv4v6_local_addr_in_packet_filter = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, "no_pfcp_rr_select")) { - self.parameter.no_pfcp_rr_select = - ogs_yaml_iter_bool(¶meter_iter); - } else if (!strcmp(parameter_key, - "use_mongodb_change_stream")) { - self.use_mongodb_change_stream = - ogs_yaml_iter_bool(¶meter_iter); - } else - ogs_warn("unknown key `%s`", parameter_key); - } - } else if (!strcmp(root_key, "sockopt")) { - ogs_yaml_iter_t sockopt_iter; - ogs_yaml_iter_recurse(&root_iter, &sockopt_iter); - while (ogs_yaml_iter_next(&sockopt_iter)) { - const char *sockopt_key = ogs_yaml_iter_key(&sockopt_iter); - ogs_assert(sockopt_key); - if (!strcmp(sockopt_key, "no_delay")) { - self.sockopt.no_delay = - ogs_yaml_iter_bool(&sockopt_iter); - } else if (!strcmp(sockopt_key, "linger")) { - const char *v = ogs_yaml_iter_value(&sockopt_iter); - if (v) self.sockopt.l_linger = atoi(v); - self.sockopt.l_onoff = true; - } else - ogs_warn("unknown key `%s`", sockopt_key); - } - } else if (!strcmp(root_key, "max")) { - ogs_yaml_iter_t max_iter; - ogs_yaml_iter_recurse(&root_iter, &max_iter); - while (ogs_yaml_iter_next(&max_iter)) { - const char *max_key = ogs_yaml_iter_key(&max_iter); - ogs_assert(max_key); - if (!strcmp(max_key, "ue")) { - const char *v = ogs_yaml_iter_value(&max_iter); - if (v) self.max.ue = atoi(v); - } else if (!strcmp(max_key, "peer") || - !strcmp(max_key, "enb")) { - const char *v = ogs_yaml_iter_value(&max_iter); - if (v) self.max.peer = atoi(v); - } else if (!strcmp(max_key, "gtp_peer") || - !strcmp(max_key, "enb")) { - const char *v = ogs_yaml_iter_value(&max_iter); - if (v) self.max.gtp_peer = atoi(v); - } else - ogs_warn("unknown key `%s`", max_key); - } - - recalculate_pool_size(); - } else if (!strcmp(root_key, "pool")) { - ogs_yaml_iter_t pool_iter; - ogs_yaml_iter_recurse(&root_iter, &pool_iter); - while (ogs_yaml_iter_next(&pool_iter)) { - const char *pool_key = ogs_yaml_iter_key(&pool_iter); - ogs_assert(pool_key); - if (!strcmp(pool_key, "128")) { - const char *v = ogs_yaml_iter_value(&pool_iter); - if (v) - self.pool.defconfig.cluster_128_pool = atoi(v); - } else if (!strcmp(pool_key, "256")) { - const char *v = ogs_yaml_iter_value(&pool_iter); - if (v) - self.pool.defconfig.cluster_256_pool = atoi(v); - } else if (!strcmp(pool_key, "512")) { - const char *v = ogs_yaml_iter_value(&pool_iter); - if (v) - self.pool.defconfig.cluster_512_pool = atoi(v); - } else if (!strcmp(pool_key, "1024")) { - const char *v = ogs_yaml_iter_value(&pool_iter); - if (v) - self.pool.defconfig.cluster_1024_pool = atoi(v); - } else if (!strcmp(pool_key, "2048")) { - const char *v = ogs_yaml_iter_value(&pool_iter); - if (v) - self.pool.defconfig.cluster_2048_pool = atoi(v); - } else if (!strcmp(pool_key, "8192")) { - const char *v = ogs_yaml_iter_value(&pool_iter); - if (v) - self.pool.defconfig.cluster_8192_pool = atoi(v); - } else if (!strcmp(pool_key, "32768")) { - const char *v = ogs_yaml_iter_value(&pool_iter); - if (v) - self.pool.defconfig.cluster_32768_pool = atoi(v); - } else if (!strcmp(pool_key, "big")) { - const char *v = ogs_yaml_iter_value(&pool_iter); - if (v) - self.pool.defconfig.cluster_big_pool = atoi(v); - } else - ogs_warn("unknown key `%s`", pool_key); - } - } else if (!strcmp(root_key, "time")) { - ogs_yaml_iter_t time_iter; - ogs_yaml_iter_recurse(&root_iter, &time_iter); - while (ogs_yaml_iter_next(&time_iter)) { - const char *time_key = ogs_yaml_iter_key(&time_iter); - ogs_assert(time_key); - if (!strcmp(time_key, "nf_instance")) { - ogs_yaml_iter_t sbi_iter; - ogs_yaml_iter_recurse(&time_iter, &sbi_iter); - - while (ogs_yaml_iter_next(&sbi_iter)) { - const char *sbi_key = - ogs_yaml_iter_key(&sbi_iter); - ogs_assert(sbi_key); - - if (!strcmp(sbi_key, "heartbeat")) { - const char *v = ogs_yaml_iter_value(&sbi_iter); - if (v) self.time.nf_instance.heartbeat_interval = - atoi(v); - } else if (!strcmp(sbi_key, "validity")) { - const char *v = ogs_yaml_iter_value(&sbi_iter); - if (v) self.time.nf_instance.validity_duration = - atoi(v); - } else - ogs_warn("unknown key `%s`", sbi_key); - } - } else if (!strcmp(time_key, "subscription")) { - ogs_yaml_iter_t sbi_iter; - ogs_yaml_iter_recurse(&time_iter, &sbi_iter); - - while (ogs_yaml_iter_next(&sbi_iter)) { - const char *sbi_key = - ogs_yaml_iter_key(&sbi_iter); - ogs_assert(sbi_key); - - if (!strcmp(sbi_key, "validity")) { - const char *v = ogs_yaml_iter_value(&sbi_iter); - if (v) self.time.subscription.validity_duration = - atoi(v); - } else - ogs_warn("unknown key `%s`", sbi_key); - } - } else if (!strcmp(time_key, "message")) { - ogs_yaml_iter_t msg_iter; - ogs_yaml_iter_recurse(&time_iter, &msg_iter); - - while (ogs_yaml_iter_next(&msg_iter)) { - const char *msg_key = - ogs_yaml_iter_key(&msg_iter); - ogs_assert(msg_key); - - if (!strcmp(msg_key, "duration")) { - const char *v = ogs_yaml_iter_value(&msg_iter); - if (v) { - self.time.message.duration = - ogs_time_from_msec(atoll(v)); - regenerate_all_timer_duration(); - } - } else - ogs_warn("unknown key `%s`", msg_key); - } - } else if (!strcmp(time_key, "handover")) { - ogs_yaml_iter_t msg_iter; - ogs_yaml_iter_recurse(&time_iter, &msg_iter); - - while (ogs_yaml_iter_next(&msg_iter)) { - const char *msg_key = - ogs_yaml_iter_key(&msg_iter); - ogs_assert(msg_key); - - if (!strcmp(msg_key, "duration")) { - const char *v = ogs_yaml_iter_value(&msg_iter); - if (v) { - self.time.handover.duration = - ogs_time_from_msec(atoll(v)); - } - } else - ogs_warn("unknown key `%s`", msg_key); - } - } else if (!strcmp(time_key, "t3502")) { - /* handle config in amf */ - } else if (!strcmp(time_key, "t3512")) { - /* handle config in amf */ - } else if (!strcmp(time_key, "t3402")) { - /* handle config in mme */ - } else if (!strcmp(time_key, "t3412")) { - /* handle config in mme */ - } else if (!strcmp(time_key, "t3423")) { - /* handle config in mme */ - } else - ogs_warn("unknown key `%s`", time_key); - } - } else if (!strcmp(root_key, "sbi")) { - ogs_yaml_iter_t tls_iter; - ogs_yaml_iter_recurse(&root_iter, &tls_iter); - while (ogs_yaml_iter_next(&tls_iter)) { - const char *tls_key = ogs_yaml_iter_key(&tls_iter); - ogs_assert(tls_key); - if (!strcmp(tls_key, "server")) { - ogs_yaml_iter_t server_iter; - ogs_yaml_iter_recurse(&tls_iter, &server_iter); - - while (ogs_yaml_iter_next(&server_iter)) { - const char *server_key = - ogs_yaml_iter_key(&server_iter); - ogs_assert(server_key); - if (!strcmp(server_key, "no_tls")) { - self.sbi.server.no_tls = - ogs_yaml_iter_bool(&server_iter); - } else if (!strcmp(server_key, "no_verify")) { - self.sbi.server.no_verify = - ogs_yaml_iter_bool(&server_iter); - } else if (!strcmp(server_key, "cacert")) { - self.sbi.server.cacert = - ogs_yaml_iter_value(&server_iter); - } else if (!strcmp(server_key, "cert")) { - self.sbi.server.cert = - ogs_yaml_iter_value(&server_iter); - } else if (!strcmp(server_key, "key")) { - self.sbi.server.key = - ogs_yaml_iter_value(&server_iter); - } else - ogs_warn("unknown key `%s`", server_key); - } - } else if (!strcmp(tls_key, "client")) { - ogs_yaml_iter_t client_iter; - ogs_yaml_iter_recurse(&tls_iter, &client_iter); - - while (ogs_yaml_iter_next(&client_iter)) { - const char *client_key = - ogs_yaml_iter_key(&client_iter); - ogs_assert(client_key); - if (!strcmp(client_key, "no_tls")) { - self.sbi.client.no_tls = - ogs_yaml_iter_bool(&client_iter); - } else if (!strcmp(client_key, "no_verify")) { - self.sbi.client.no_verify = - ogs_yaml_iter_bool(&client_iter); - } else if (!strcmp(client_key, "cacert")) { - self.sbi.client.cacert = - ogs_yaml_iter_value(&client_iter); - } else if (!strcmp(client_key, "cert")) { - self.sbi.client.cert = - ogs_yaml_iter_value(&client_iter); - } else if (!strcmp(client_key, "key")) { - self.sbi.client.key = - ogs_yaml_iter_value(&client_iter); - } else - ogs_warn("unknown key `%s`", client_key); - } - } else - ogs_warn("unknown key `%s`", tls_key); - } - } - } - - rv = app_context_validation(); - if (rv != OGS_OK) return rv; - - return OGS_OK; -} diff --git a/lib/app/ogs-context.h b/lib/app/ogs-context.h index b5edf9b0e..3e8e11bea 100644 --- a/lib/app/ogs-context.h +++ b/lib/app/ogs-context.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -28,12 +28,6 @@ extern "C" { #endif -typedef enum { - OGS_SBI_TLS_ENABLED_AUTO = 0, - OGS_SBI_TLS_ENABLED_YES, - OGS_SBI_TLS_ENABLED_NO, -} ogs_sbi_tls_enabled_mode_e; - typedef struct ogs_app_context_s { const char *version; @@ -41,7 +35,6 @@ typedef struct ogs_app_context_s { void *document; const char *db_uri; - int use_mongodb_change_stream; struct { const char *file; @@ -53,59 +46,11 @@ typedef struct ogs_app_context_s { ogs_timer_mgr_t *timer_mgr; ogs_pollset_t *pollset; - struct { - /* Element */ - int no_mme; - int no_hss; - int no_sgw; - int no_sgwc; - int no_sgwu; - int no_pgw; - int no_pcrf; - - int no_amf; - int no_smf; - int no_upf; - int no_ausf; - int no_udm; - int no_pcf; - int no_nssf; - int no_bsf; - int no_udr; - int no_scp; - int no_nrf; - - /* Network */ - int no_ipv4; - int no_ipv6; - int prefer_ipv4; - int multicast; - - int use_openair; - int no_ipv4v6_local_addr_in_packet_filter; - - int no_pfcp_rr_select; - } parameter; - - struct { - int no_delay; - int l_onoff; - int l_linger; - } sockopt; - struct { int udp_port; } usrsctp; struct { - uint64_t ue; - uint64_t peer; - uint64_t gtp_peer; - } max; - - struct { - ogs_pkbuf_config_t defconfig; - uint64_t packet; uint64_t sess; @@ -131,70 +76,16 @@ typedef struct ogs_app_context_s { uint64_t impu; } pool; - struct { - struct { - int heartbeat_interval; - int no_heartbeat_margin; - int validity_duration; - } nf_instance; - struct { - int validity_duration; - } subscription; - - struct { - ogs_time_t duration; - struct { - ogs_time_t client_wait_duration; - ogs_time_t connection_deadline; - ogs_time_t nf_register_interval; - ogs_time_t nf_register_interval_in_exception; - } sbi; - - struct { - ogs_time_t t3_response_duration; - int n3_response_rcount; - ogs_time_t t3_holding_duration; - int n3_holding_rcount; - } gtp; - - struct { - ogs_time_t t1_response_duration; - int n1_response_rcount; - ogs_time_t t1_holding_duration; - int n1_holding_rcount; - ogs_time_t association_interval; - ogs_time_t no_heartbeat_duration; - } pfcp; - } message; - - struct { - ogs_time_t duration; - ogs_time_t complete_delay; - } handover; - - } time; - struct metrics { uint64_t max_specs; } metrics; - struct { - struct { - bool no_tls; - bool no_verify; - const char *cacert; - const char *cert; - const char *key; - } server, client; - } sbi; - } ogs_app_context_t; int ogs_app_context_init(void); void ogs_app_context_final(void); -ogs_app_context_t *ogs_app(void); -int ogs_app_context_parse_config(void); +ogs_app_context_t *ogs_app(void); #ifdef __cplusplus } diff --git a/lib/app/ogs-init.c b/lib/app/ogs-init.c index e3fbeb916..77597b631 100644 --- a/lib/app/ogs-init.c +++ b/lib/app/ogs-init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -21,6 +21,9 @@ int __ogs_app_domain; +static int read_config(void); +static int parse_config(void); + int ogs_app_initialize( const char *version, const char *default_config, const char *const argv[]) @@ -38,6 +41,7 @@ int ogs_app_initialize( ogs_app_setup_log(); ogs_app_context_init(); + ogs_app_config_init(); ogs_app()->version = version; /************************************************************************** @@ -75,16 +79,16 @@ int ogs_app_initialize( else ogs_app()->file = default_config; - rv = ogs_app_config_read(); + rv = read_config(); if (rv != OGS_OK) return rv; - rv = ogs_app_context_parse_config(); + rv = parse_config(); if (rv != OGS_OK) return rv; /************************************************************************** * Stage 3 : Initialize Default Memory Pool */ - ogs_pkbuf_default_create(&ogs_app()->pool.defconfig); + ogs_pkbuf_default_create(&ogs_global_conf()->pkbuf_config); /************************************************************************** * Stage 4 : Setup LOG Module @@ -151,6 +155,7 @@ int ogs_app_initialize( void ogs_app_terminate(void) { + ogs_app_config_final(); ogs_app_context_final(); ogs_pkbuf_default_destroy(); @@ -158,7 +163,7 @@ void ogs_app_terminate(void) ogs_core_terminate(); } -int ogs_app_config_read(void) +static int read_config(void) { FILE *file; yaml_parser_t parser; @@ -236,6 +241,68 @@ int ogs_app_config_read(void) return OGS_OK; } +static int context_prepare(void) +{ +#define USRSCTP_LOCAL_UDP_PORT 9899 + ogs_app()->usrsctp.udp_port = USRSCTP_LOCAL_UDP_PORT; + + return OGS_OK; +} + +static int context_validation(void) +{ + return OGS_OK; +} + +static int parse_config(void) +{ + int rv; + yaml_document_t *document = NULL; + ogs_yaml_iter_t root_iter; + + document = ogs_app()->document; + ogs_assert(document); + + rv = context_prepare(); + if (rv != OGS_OK) return rv; + + ogs_yaml_iter_init(&root_iter, document); + while (ogs_yaml_iter_next(&root_iter)) { + const char *root_key = ogs_yaml_iter_key(&root_iter); + ogs_assert(root_key); + if (!strcmp(root_key, "db_uri")) { + ogs_app()->db_uri = ogs_yaml_iter_value(&root_iter); + } else if (!strcmp(root_key, "logger")) { + ogs_yaml_iter_t logger_iter; + ogs_yaml_iter_recurse(&root_iter, &logger_iter); + while (ogs_yaml_iter_next(&logger_iter)) { + const char *logger_key = ogs_yaml_iter_key(&logger_iter); + ogs_assert(logger_key); + if (!strcmp(logger_key, "file")) { + ogs_app()->logger.file = ogs_yaml_iter_value(&logger_iter); + } else if (!strcmp(logger_key, "level")) { + ogs_app()->logger.level = + ogs_yaml_iter_value(&logger_iter); + } else if (!strcmp(logger_key, "domain")) { + ogs_app()->logger.domain = + ogs_yaml_iter_value(&logger_iter); + } + } + } else if (!strcmp(root_key, "global")) { + rv = ogs_app_parse_global_conf(&root_iter); + if (rv != OGS_OK) { + ogs_error("ogs_global_conf_parse_config() failed"); + return rv; + } + } + } + + rv = context_validation(); + if (rv != OGS_OK) return rv; + + return OGS_OK; +} + void ogs_app_setup_log(void) { ogs_log_install_domain(&__ogs_app_domain, "app", ogs_core()->log.level); diff --git a/lib/app/ogs-yaml.c b/lib/app/ogs-yaml.c index bffb531b5..168ec50e8 100644 --- a/lib/app/ogs-yaml.c +++ b/lib/app/ogs-yaml.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * diff --git a/lib/app/ogs-yaml.h b/lib/app/ogs-yaml.h index 5a3e9752a..0fbd8646a 100644 --- a/lib/app/ogs-yaml.h +++ b/lib/app/ogs-yaml.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -30,6 +30,21 @@ extern "C" { #endif +#define OGS_YAML_ARRAY_RECURSE(ARRAY, ITERATOR) \ + if (ogs_yaml_iter_type(ARRAY) == YAML_MAPPING_NODE) { \ + memcpy((ITERATOR), (ARRAY), sizeof(ogs_yaml_iter_t)); \ + } else if (ogs_yaml_iter_type(ARRAY) == YAML_SEQUENCE_NODE) { \ + ogs_yaml_iter_recurse((ARRAY), (ITERATOR)); \ + } else if (ogs_yaml_iter_type(ARRAY) == YAML_SCALAR_NODE) { \ + break; \ + } else \ + ogs_assert_if_reached(); + +#define OGS_YAML_ARRAY_NEXT(ARRAY, ITERATOR) \ + if (ogs_yaml_iter_type(ARRAY) == YAML_SEQUENCE_NODE && \ + !ogs_yaml_iter_next(ARRAY)) break; \ + OGS_YAML_ARRAY_RECURSE(ARRAY, ITERATOR); + typedef struct { yaml_document_t *document; yaml_node_t *node; diff --git a/lib/core/ogs-sockaddr.h b/lib/core/ogs-sockaddr.h index 0d8910fc5..32817ee45 100644 --- a/lib/core/ogs-sockaddr.h +++ b/lib/core/ogs-sockaddr.h @@ -62,10 +62,25 @@ struct ogs_sockaddr_s { struct sockaddr sa; }; - /* User Area - * - Could add your attribute. + /* + * First we created a 'hostname' variable. + * If there is a name in the configuration file, + * it is set in the 'hostname' of ogs_sockaddr_t. + * Then, it immediately call getaddrinfo() to fill addr in ogs_sockaddr_t. + * + * When it was always possible to convert DNS to addr, that was no problem. + * However, in some environments, such as Roaming, there are situations + * where it is difficult to always change the DNS to addr. + * + * So, 'fqdn' was created for the purpose of first use in ogs_sbi_client_t. + * 'fqdn' always do not change with addr. + * This value is used as it is in the actual client connection. + * + * Note that 'hostname' is still in use for server or other client + * except for ogs_sbi_client_t. */ char *hostname; + char *fqdn; ogs_sockaddr_t *next; }; diff --git a/lib/dbi/meson.build b/lib/dbi/meson.build index ac3c9d3f3..a94613846 100644 --- a/lib/dbi/meson.build +++ b/lib/dbi/meson.build @@ -1,4 +1,4 @@ -# Copyright (C) 2019,2020 by Sukchan Lee +# Copyright (C) 2019-2023 by Sukchan Lee # This file is part of Open5GS. @@ -19,14 +19,11 @@ libdbi_sources = files(''' ogs-dbi.h ogs-mongoc.h - timer.h ogs-mongoc.c subscription.c session.c ims.c - path.c - timer.c '''.split()) libmongoc_dep = dependency('libmongoc-1.0') @@ -38,10 +35,10 @@ libdbi = library('ogsdbi', version : libogslib_version, c_args : '-DOGS_DBI_COMPILATION', include_directories : [libdbi_inc, libinc], - dependencies : [libcrypt_dep, libapp_dep, libmongoc_dep], + dependencies : [libproto_dep, libmongoc_dep], install : true) libdbi_dep = declare_dependency( link_with : libdbi, include_directories : [libdbi_inc, libinc], - dependencies : [libcrypt_dep, libapp_dep, libmongoc_dep]) + dependencies : [libproto_dep, libmongoc_dep]) diff --git a/lib/dbi/ogs-dbi.h b/lib/dbi/ogs-dbi.h index 7d575db29..63580abe1 100644 --- a/lib/dbi/ogs-dbi.h +++ b/lib/dbi/ogs-dbi.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019,2020 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -29,8 +29,6 @@ #include "dbi/subscription.h" #include "dbi/session.h" #include "dbi/ims.h" -#include "dbi/path.h" -#include "dbi/timer.h" #undef OGS_DBI_INSIDE diff --git a/lib/dbi/ogs-mongoc.c b/lib/dbi/ogs-mongoc.c index 169591061..9b1ce7bc1 100644 --- a/lib/dbi/ogs-mongoc.c +++ b/lib/dbi/ogs-mongoc.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019,2020 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -220,34 +220,3 @@ int ogs_dbi_collection_watch_init(void) return OGS_ERROR; #endif } - -int ogs_dbi_poll_change_stream(void) -{ -#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 9 - int rv; - - const bson_t *document; - const bson_t *err_document; - bson_error_t error; - - while (mongoc_change_stream_next(ogs_mongoc()->stream, &document)) { - rv = ogs_dbi_process_change_stream(document); - if (rv != OGS_OK) return rv; - } - - if (mongoc_change_stream_error_document(ogs_mongoc()->stream, &error, - &err_document)) { - if (!bson_empty (err_document)) { - ogs_debug("Server Error: %s\n", - bson_as_relaxed_extended_json(err_document, NULL)); - } else { - ogs_debug("Client Error: %s\n", error.message); - } - return OGS_ERROR; - } - - return OGS_OK; -# else - return OGS_ERROR; -#endif -} diff --git a/lib/dbi/session.c b/lib/dbi/session.c index 220fc8af1..b1e695b21 100644 --- a/lib/dbi/session.c +++ b/lib/dbi/session.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -40,17 +40,10 @@ int ogs_dbi_session_data(char *supi, ogs_s_nssai_t *s_nssai, char *dnn, char *supi_type = NULL; char *supi_id = NULL; - ogs_session_data_t zero_data; - ogs_assert(supi); ogs_assert(dnn); ogs_assert(session_data); - memset(&zero_data, 0, sizeof(zero_data)); - - /* session_data should be initialized to zero */ - ogs_assert(memcmp(session_data, &zero_data, sizeof(zero_data)) == 0); - supi_type = ogs_id_get_type(supi); ogs_assert(supi_type); supi_id = ogs_id_get_value(supi); @@ -89,7 +82,7 @@ int ogs_dbi_session_data(char *supi, ogs_s_nssai_t *s_nssai, char *dnn, while (bson_iter_next(&iter)) { const char *key = bson_iter_key(&iter); - if (!strcmp(key, "slice") && BSON_ITER_HOLDS_ARRAY(&iter)) { + if (!strcmp(key, OGS_SLICE_STRING) && BSON_ITER_HOLDS_ARRAY(&iter)) { bson_iter_recurse(&iter, &child1_iter); while (bson_iter_next(&child1_iter)) { uint8_t sst; @@ -102,15 +95,15 @@ int ogs_dbi_session_data(char *supi, ogs_s_nssai_t *s_nssai, char *dnn, while (bson_iter_next(&child2_iter)) { const char *child2_key = bson_iter_key(&child2_iter); - if (!strcmp(child2_key, "sst") && + if (!strcmp(child2_key, OGS_SST_STRING) && BSON_ITER_HOLDS_INT32(&child2_iter)) { sst = bson_iter_int32(&child2_iter); - } else if (!strcmp(child2_key, "sd") && + } else if (!strcmp(child2_key, OGS_SD_STRING) && BSON_ITER_HOLDS_UTF8(&child2_iter)) { utf8 = bson_iter_utf8(&child2_iter, &length); ogs_assert(utf8); sd = ogs_s_nssai_sd_from_string(utf8); - } else if (!strcmp(child2_key, "session") && + } else if (!strcmp(child2_key, OGS_SESSION_STRING) && BSON_ITER_HOLDS_ARRAY(&child2_iter)) { bson_iter_recurse(&child2_iter, &child3_iter); } @@ -133,7 +126,7 @@ int ogs_dbi_session_data(char *supi, ogs_s_nssai_t *s_nssai, char *dnn, bson_iter_recurse(&child3_iter, &child4_iter); while (bson_iter_next(&child4_iter)) { const char *child4_key = bson_iter_key(&child4_iter); - if (!strcmp(child4_key, "name") && + if (!strcmp(child4_key, OGS_NAME_STRING) && BSON_ITER_HOLDS_UTF8(&child4_iter)) { utf8 = bson_iter_utf8(&child4_iter, &length); if (ogs_strncasecmp(utf8, dnn, length) == 0) { @@ -163,38 +156,40 @@ done: bson_iter_recurse(&child3_iter, &child4_iter); while (bson_iter_next(&child4_iter)) { const char *child4_key = bson_iter_key(&child4_iter); - if (!strcmp(child4_key, "name") && + if (!strcmp(child4_key, OGS_NAME_STRING) && BSON_ITER_HOLDS_UTF8(&child4_iter)) { utf8 = bson_iter_utf8(&child4_iter, &length); + if (session->name) + ogs_free(session->name); session->name = ogs_strndup(utf8, length); ogs_assert(session->name); - } else if (!strcmp(child4_key, "type") && + } else if (!strcmp(child4_key, OGS_TYPE_STRING) && BSON_ITER_HOLDS_INT32(&child4_iter)) { session->session_type = bson_iter_int32(&child4_iter); - } else if (!strcmp(child4_key, "qos") && + } else if (!strcmp(child4_key, OGS_QOS_STRING) && BSON_ITER_HOLDS_DOCUMENT(&child4_iter)) { bson_iter_recurse(&child4_iter, &child5_iter); while (bson_iter_next(&child5_iter)) { const char *child5_key = bson_iter_key(&child5_iter); - if (!strcmp(child5_key, "index") && + if (!strcmp(child5_key, OGS_INDEX_STRING) && BSON_ITER_HOLDS_INT32(&child5_iter)) { session->qos.index = bson_iter_int32(&child5_iter); - } else if (!strcmp(child5_key, "arp") && + } else if (!strcmp(child5_key, OGS_ARP_STRING) && BSON_ITER_HOLDS_DOCUMENT(&child5_iter)) { bson_iter_recurse(&child5_iter, &child6_iter); while (bson_iter_next(&child6_iter)) { const char *child6_key = bson_iter_key(&child6_iter); - if (!strcmp(child6_key, "priority_level") && + if (!strcmp(child6_key, OGS_PRIORITY_LEVEL_STRING) && BSON_ITER_HOLDS_INT32(&child6_iter)) { session->qos.arp.priority_level = bson_iter_int32(&child6_iter); } else if (!strcmp(child6_key, - "pre_emption_capability") && + OGS_PRE_EMPTION_CAPABILITY_STRING) && BSON_ITER_HOLDS_INT32(&child6_iter)) { session->qos.arp.pre_emption_capability = bson_iter_int32(&child6_iter); } else if (!strcmp(child6_key, - "pre_emption_vulnerability") && + OGS_PRE_EMPTION_VULNERABILITY_STRING) && BSON_ITER_HOLDS_INT32(&child6_iter)) { session->qos.arp.pre_emption_vulnerability = bson_iter_int32(&child6_iter); @@ -202,12 +197,12 @@ done: } } } - } else if (!strcmp(child4_key, "ambr") && + } else if (!strcmp(child4_key, OGS_AMBR_STRING) && BSON_ITER_HOLDS_DOCUMENT(&child4_iter)) { bson_iter_recurse(&child4_iter, &child5_iter); while (bson_iter_next(&child5_iter)) { const char *child5_key = bson_iter_key(&child5_iter); - if (!strcmp(child5_key, "downlink") && + if (!strcmp(child5_key, OGS_DOWNLINK_STRING) && BSON_ITER_HOLDS_DOCUMENT(&child5_iter)) { uint8_t unit = 0; int n; @@ -215,11 +210,11 @@ done: bson_iter_recurse(&child5_iter, &child6_iter); while (bson_iter_next(&child6_iter)) { const char *child6_key = bson_iter_key(&child6_iter); - if (!strcmp(child6_key, "value") && + if (!strcmp(child6_key, OGS_VALUE_STRING) && BSON_ITER_HOLDS_INT32(&child6_iter)) { session->ambr.downlink = bson_iter_int32(&child6_iter); - } else if (!strcmp(child6_key, "unit") && + } else if (!strcmp(child6_key, OGS_UNIT_STRING) && BSON_ITER_HOLDS_INT32(&child6_iter)) { unit = bson_iter_int32(&child6_iter); } @@ -227,7 +222,7 @@ done: for (n = 0; n < unit; n++) session->ambr.downlink *= 1000; - } else if (!strcmp(child5_key, "uplink") && + } else if (!strcmp(child5_key, OGS_UPLINK_STRING) && BSON_ITER_HOLDS_DOCUMENT(&child5_iter)) { uint8_t unit = 0; int n; @@ -235,11 +230,11 @@ done: bson_iter_recurse(&child5_iter, &child6_iter); while (bson_iter_next(&child6_iter)) { const char *child6_key = bson_iter_key(&child6_iter); - if (!strcmp(child6_key, "value") && + if (!strcmp(child6_key, OGS_VALUE_STRING) && BSON_ITER_HOLDS_INT32(&child6_iter)) { session->ambr.uplink = bson_iter_int32(&child6_iter); - } else if (!strcmp(child6_key, "unit") && + } else if (!strcmp(child6_key, OGS_UNIT_STRING) && BSON_ITER_HOLDS_INT32(&child6_iter)) { unit = bson_iter_int32(&child6_iter); } @@ -250,9 +245,13 @@ done: } } - } else if (!strcmp(child4_key, "pcc_rule") && + } else if (!strcmp(child4_key, OGS_PCC_RULE_STRING) && BSON_ITER_HOLDS_ARRAY(&child4_iter)) { - int pcc_rule_index = 0; + int i, pcc_rule_index = 0; + + /* Free all PCC Rule present in the session */ + for (i = 0; i < session_data->num_of_pcc_rule; i++) + OGS_PCC_RULE_FREE(&session_data->pcc_rule[i]); bson_iter_recurse(&child4_iter, &child5_iter); while (bson_iter_next(&child5_iter)) { @@ -265,47 +264,49 @@ done: while (bson_iter_next(&child6_iter)) { const char *child6_key = bson_iter_key(&child6_iter); - if (!strcmp(child6_key, "qos") && + if (!strcmp(child6_key, OGS_QOS_STRING) && BSON_ITER_HOLDS_DOCUMENT(&child6_iter)) { bson_iter_recurse(&child6_iter, &child7_iter); while (bson_iter_next(&child7_iter)) { const char *child7_key = bson_iter_key(&child7_iter); - if (!strcmp(child7_key, "index") && + if (!strcmp(child7_key, OGS_INDEX_STRING) && BSON_ITER_HOLDS_INT32(&child7_iter)) { pcc_rule->qos.index = bson_iter_int32(&child7_iter); - } else if (!strcmp(child7_key, "arp") && + } else if (!strcmp(child7_key, OGS_ARP_STRING) && BSON_ITER_HOLDS_DOCUMENT(&child7_iter)) { bson_iter_recurse(&child7_iter, &child8_iter); while (bson_iter_next(&child8_iter)) { const char *child8_key = bson_iter_key(&child8_iter); - if (!strcmp(child8_key, "priority_level") && + if (!strcmp(child8_key, + OGS_PRIORITY_LEVEL_STRING) && BSON_ITER_HOLDS_INT32(&child8_iter)) { pcc_rule->qos.arp.priority_level = bson_iter_int32(&child8_iter); } else if (!strcmp(child8_key, - "pre_emption_capability") && + OGS_PRE_EMPTION_CAPABILITY_STRING) && BSON_ITER_HOLDS_INT32(&child8_iter)) { pcc_rule->qos.arp. pre_emption_capability = bson_iter_int32(&child8_iter); } else if (!strcmp(child8_key, - "pre_emption_vulnerability") && + OGS_PRE_EMPTION_VULNERABILITY_STRING) && BSON_ITER_HOLDS_INT32(&child8_iter)) { pcc_rule->qos.arp. pre_emption_vulnerability = bson_iter_int32(&child8_iter); } } - } else if (!strcmp(child7_key, "mbr") && + } else if (!strcmp(child7_key, OGS_MBR_STRING) && BSON_ITER_HOLDS_DOCUMENT(&child7_iter)) { bson_iter_recurse(&child7_iter, &child8_iter); while (bson_iter_next(&child8_iter)) { const char *child8_key = bson_iter_key(&child8_iter); - if (!strcmp(child8_key, "downlink") && + if (!strcmp(child8_key, + OGS_DOWNLINK_STRING) && BSON_ITER_HOLDS_DOCUMENT( &child8_iter)) { uint8_t unit = 0; @@ -316,14 +317,15 @@ done: while (bson_iter_next(&child9_iter)) { const char *child9_key = bson_iter_key(&child9_iter); - if (!strcmp(child9_key, "value") && + if (!strcmp(child9_key, + OGS_VALUE_STRING) && BSON_ITER_HOLDS_INT32( &child9_iter)) { pcc_rule->qos.mbr.downlink = bson_iter_int32( &child9_iter); - } else if (!strcmp( - child9_key, "unit") && + } else if (!strcmp(child9_key, + OGS_UNIT_STRING) && BSON_ITER_HOLDS_INT32( &child9_iter)) { unit = bson_iter_int32( @@ -334,7 +336,8 @@ done: for (n = 0; n < unit; n++) pcc_rule->qos.mbr.downlink *= 1000; - } else if (!strcmp(child8_key, "uplink") && + } else if (!strcmp(child8_key, + OGS_UPLINK_STRING) && BSON_ITER_HOLDS_DOCUMENT( &child8_iter)) { uint8_t unit = 0; @@ -345,14 +348,15 @@ done: while (bson_iter_next(&child9_iter)) { const char *child9_key = bson_iter_key(&child9_iter); - if (!strcmp(child9_key, "value") && + if (!strcmp(child9_key, + OGS_VALUE_STRING) && BSON_ITER_HOLDS_INT32( &child9_iter)) { pcc_rule->qos.mbr.uplink = bson_iter_int32( &child9_iter); - } else if (!strcmp( - child9_key, "unit") && + } else if (!strcmp(child9_key, + OGS_UNIT_STRING) && BSON_ITER_HOLDS_INT32( &child9_iter)) { unit = bson_iter_int32( @@ -364,13 +368,14 @@ done: pcc_rule->qos.mbr.uplink *= 1000; } } - } else if (!strcmp(child7_key, "gbr") && + } else if (!strcmp(child7_key, OGS_GBR_STRING) && BSON_ITER_HOLDS_DOCUMENT(&child7_iter)) { bson_iter_recurse(&child7_iter, &child8_iter); while (bson_iter_next(&child8_iter)) { const char *child8_key = bson_iter_key(&child8_iter); - if (!strcmp(child8_key, "downlink") && + if (!strcmp(child8_key, + OGS_DOWNLINK_STRING) && BSON_ITER_HOLDS_DOCUMENT( &child8_iter)) { uint8_t unit = 0; @@ -381,14 +386,15 @@ done: while (bson_iter_next(&child9_iter)) { const char *child9_key = bson_iter_key(&child9_iter); - if (!strcmp(child9_key, "value") && + if (!strcmp(child9_key, + OGS_VALUE_STRING) && BSON_ITER_HOLDS_INT32( &child9_iter)) { pcc_rule->qos.gbr.downlink = bson_iter_int32( &child9_iter); - } else if (!strcmp( - child9_key, "unit") && + } else if (!strcmp(child9_key, + OGS_UNIT_STRING) && BSON_ITER_HOLDS_INT32( &child9_iter)) { unit = bson_iter_int32( @@ -399,7 +405,8 @@ done: for (n = 0; n < unit; n++) pcc_rule->qos.gbr.downlink *= 1000; - } else if (!strcmp(child8_key, "uplink") && + } else if (!strcmp(child8_key, + OGS_UPLINK_STRING) && BSON_ITER_HOLDS_DOCUMENT( &child8_iter)) { uint8_t unit = 0; @@ -410,14 +417,15 @@ done: while (bson_iter_next(&child9_iter)) { const char *child9_key = bson_iter_key(&child9_iter); - if (!strcmp(child9_key, "value") && + if (!strcmp(child9_key, + OGS_VALUE_STRING) && BSON_ITER_HOLDS_INT32( &child9_iter)) { pcc_rule->qos.gbr.uplink = bson_iter_int32( &child9_iter); - } else if (!strcmp( - child9_key, "unit") && + } else if (!strcmp(child9_key, + OGS_UNIT_STRING) && BSON_ITER_HOLDS_INT32( &child9_iter)) { unit = bson_iter_int32( @@ -431,7 +439,7 @@ done: } } } - } else if (!strcmp(child6_key, "flow") && + } else if (!strcmp(child6_key, OGS_FLOW_STRING) && BSON_ITER_HOLDS_ARRAY(&child6_iter)) { int flow_index = 0; @@ -447,11 +455,12 @@ done: while (bson_iter_next(&child8_iter)) { const char *child8_key = bson_iter_key(&child8_iter); - if (!strcmp(child8_key, "direction") && + if (!strcmp(child8_key, OGS_DIRECTION_STRING) && BSON_ITER_HOLDS_INT32(&child8_iter)) { flow->direction = bson_iter_int32(&child8_iter); - } else if (!strcmp(child8_key, "description") && + } else if (!strcmp(child8_key, + OGS_DESCRIPTION_STRING) && BSON_ITER_HOLDS_UTF8(&child8_iter)) { utf8 = bson_iter_utf8( &child8_iter, &length); @@ -468,18 +477,12 @@ done: } /* EPC: Charing-Rule-Name */ - if (pcc_rule->name) { - ogs_error("PCC Rule Name has already been defined"); - ogs_free(pcc_rule->name); - } + ogs_assert(!pcc_rule->name); pcc_rule->name = ogs_msprintf("%s-g%d", dnn, pcc_rule_index+1); ogs_assert(pcc_rule->name); /* 5GC: PCC-Rule-Id */ - if (pcc_rule->id) { - ogs_error("PCC Rule Id has already been defined"); - ogs_free(pcc_rule->id); - } + ogs_assert(!pcc_rule->id); pcc_rule->id = ogs_msprintf("%s-n%d", dnn, pcc_rule_index+1); ogs_assert(pcc_rule->id); diff --git a/lib/dbi/subscription.c b/lib/dbi/subscription.c index 3c8e053bc..94cf16c82 100644 --- a/lib/dbi/subscription.c +++ b/lib/dbi/subscription.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -66,8 +66,8 @@ int ogs_dbi_auth_info(char *supi, ogs_dbi_auth_info_t *auth_info) goto out; } - if (!bson_iter_init_find(&iter, document, "security")) { - ogs_error("No 'security' field in this document"); + if (!bson_iter_init_find(&iter, document, OGS_SECURITY_STRING)) { + ogs_error("No '" OGS_SECURITY_STRING "' field in this document"); rv = OGS_ERROR; goto out; @@ -78,28 +78,33 @@ int ogs_dbi_auth_info(char *supi, ogs_dbi_auth_info_t *auth_info) while (bson_iter_next(&inner_iter)) { const char *key = bson_iter_key(&inner_iter); - if (!strcmp(key, "k") && BSON_ITER_HOLDS_UTF8(&inner_iter)) { + if (!strcmp(key, OGS_K_STRING) && BSON_ITER_HOLDS_UTF8(&inner_iter)) { utf8 = (char *)bson_iter_utf8(&inner_iter, &length); ogs_ascii_to_hex(utf8, length, buf, sizeof(buf)); memcpy(auth_info->k, buf, OGS_KEY_LEN); - } else if (!strcmp(key, "opc") && BSON_ITER_HOLDS_UTF8(&inner_iter)) { + } else if (!strcmp(key, OGS_OPC_STRING) && + BSON_ITER_HOLDS_UTF8(&inner_iter)) { utf8 = (char *)bson_iter_utf8(&inner_iter, &length); auth_info->use_opc = 1; ogs_ascii_to_hex(utf8, length, buf, sizeof(buf)); memcpy(auth_info->opc, buf, OGS_KEY_LEN); - } else if (!strcmp(key, "op") && BSON_ITER_HOLDS_UTF8(&inner_iter)) { + } else if (!strcmp(key, OGS_OP_STRING) && + BSON_ITER_HOLDS_UTF8(&inner_iter)) { utf8 = (char *)bson_iter_utf8(&inner_iter, &length); ogs_ascii_to_hex(utf8, length, buf, sizeof(buf)); memcpy(auth_info->op, buf, OGS_KEY_LEN); - } else if (!strcmp(key, "amf") && BSON_ITER_HOLDS_UTF8(&inner_iter)) { + } else if (!strcmp(key, OGS_AMF_STRING) && + BSON_ITER_HOLDS_UTF8(&inner_iter)) { utf8 = (char *)bson_iter_utf8(&inner_iter, &length); ogs_ascii_to_hex(utf8, length, buf, sizeof(buf)); memcpy(auth_info->amf, buf, OGS_AMF_LEN); - } else if (!strcmp(key, "rand") && BSON_ITER_HOLDS_UTF8(&inner_iter)) { + } else if (!strcmp(key, OGS_RAND_STRING) && + BSON_ITER_HOLDS_UTF8(&inner_iter)) { utf8 = (char *)bson_iter_utf8(&inner_iter, &length); ogs_ascii_to_hex(utf8, length, buf, sizeof(buf)); memcpy(auth_info->rand, buf, OGS_RAND_LEN); - } else if (!strcmp(key, "sqn") && BSON_ITER_HOLDS_INT64(&inner_iter)) { + } else if (!strcmp(key, OGS_SQN_STRING) && + BSON_ITER_HOLDS_INT64(&inner_iter)) { auth_info->sqn = bson_iter_int64(&inner_iter); } } @@ -134,7 +139,7 @@ int ogs_dbi_update_sqn(char *supi, uint64_t sqn) query = BCON_NEW(supi_type, BCON_UTF8(supi_id)); update = BCON_NEW("$set", "{", - "security.sqn", BCON_INT64(sqn), + OGS_SECURITY_STRING "." OGS_SQN_STRING, BCON_INT64(sqn), "}"); if (!mongoc_collection_update(ogs_mongoc()->collection.subscriber, @@ -176,7 +181,7 @@ int ogs_dbi_update_imeisv(char *supi, char *imeisv) query = BCON_NEW(supi_type, BCON_UTF8(supi_id)); update = BCON_NEW("$set", "{", - "imeisv", BCON_UTF8(imeisv), + OGS_IMEISV_STRING, BCON_UTF8(imeisv), "}"); if (!mongoc_collection_update(ogs_mongoc()->collection.subscriber, MONGOC_UPDATE_UPSERT, query, update, NULL, &error)) { @@ -218,10 +223,10 @@ int ogs_dbi_update_mme(char *supi, char *mme_host, char *mme_realm, query = BCON_NEW(supi_type, BCON_UTF8(supi_id)); update = BCON_NEW("$set", "{", - "mme_host", BCON_UTF8(mme_host), - "mme_realm", BCON_UTF8(mme_realm), - "mme_timestamp", BCON_INT64(ogs_time_now()), - "purge_flag", BCON_BOOL(purge_flag), + OGS_MME_HOST_STRING, BCON_UTF8(mme_host), + OGS_MME_REALM_STRING, BCON_UTF8(mme_realm), + OGS_MME_TIMESTAMP_STRING, BCON_INT64(ogs_time_now()), + OGS_PURGE_FLAG_STRING, BCON_BOOL(purge_flag), "}"); if (!mongoc_collection_update(ogs_mongoc()->collection.subscriber, MONGOC_UPDATE_UPSERT, query, update, NULL, &error)) { @@ -260,7 +265,7 @@ int ogs_dbi_increment_sqn(char *supi) query = BCON_NEW(supi_type, BCON_UTF8(supi_id)); update = BCON_NEW("$inc", "{", - "security.sqn", BCON_INT64(32), + OGS_SECURITY_STRING "." OGS_SQN_STRING, BCON_INT64(32), "}"); if (!mongoc_collection_update(ogs_mongoc()->collection.subscriber, MONGOC_UPDATE_NONE, query, update, NULL, &error)) { @@ -273,7 +278,7 @@ int ogs_dbi_increment_sqn(char *supi) update = BCON_NEW("$bit", "{", - "security.sqn", + OGS_SECURITY_STRING "." OGS_SQN_STRING, "{", "and", BCON_INT64(max_sqn), "}", "}"); if (!mongoc_collection_update(ogs_mongoc()->collection.subscriber, @@ -357,7 +362,7 @@ int ogs_dbi_subscription_data(char *supi, while (bson_iter_next(&iter)) { const char *key = bson_iter_key(&iter); - if (!strcmp(key, "msisdn") && + if (!strcmp(key, OGS_MSISDN_STRING) && BSON_ITER_HOLDS_ARRAY(&iter)) { int msisdn_index = 0; @@ -379,37 +384,38 @@ int ogs_dbi_subscription_data(char *supi, } subscription_data->num_of_msisdn = msisdn_index; - } else if (!strcmp(key, "imsi") && + } else if (!strcmp(key, OGS_IMSI_STRING) && BSON_ITER_HOLDS_UTF8(&iter)) { utf8 = bson_iter_utf8(&iter, &length); subscription_data->imsi = ogs_strndup(utf8, ogs_min(length, OGS_MAX_IMSI_BCD_LEN) + 1); ogs_assert(subscription_data->imsi); - } else if (!strcmp(key, "access_restriction_data") && + } else if (!strcmp(key, OGS_ACCESS_RESTRICTION_DATA_STRING) && BSON_ITER_HOLDS_INT32(&iter)) { subscription_data->access_restriction_data = bson_iter_int32(&iter); - } else if (!strcmp(key, "subscriber_status") && + } else if (!strcmp(key, OGS_SUBSCRIBER_STATUS_STRING) && BSON_ITER_HOLDS_INT32(&iter)) { subscription_data->subscriber_status = bson_iter_int32(&iter); - } else if (!strcmp(key, "operator_determined_barring") && + } else if (!strcmp(key, OGS_OPERATOR_DETERMINED_BARRING_STRING) && BSON_ITER_HOLDS_INT32(&iter)) { subscription_data->operator_determined_barring = bson_iter_int32(&iter); - } else if (!strcmp(key, "network_access_mode") && + } else if (!strcmp(key, OGS_NETWORK_ACCESS_MODE_STRING) && BSON_ITER_HOLDS_INT32(&iter)) { subscription_data->network_access_mode = bson_iter_int32(&iter); - } else if (!strcmp(key, "subscribed_rau_tau_timer") && + } else if (!strcmp(key, OGS_SUBSCRIBED_RAU_TAU_TIMER_STRING) && BSON_ITER_HOLDS_INT32(&iter)) { subscription_data->subscribed_rau_tau_timer = bson_iter_int32(&iter); - } else if (!strcmp(key, "ambr") && BSON_ITER_HOLDS_DOCUMENT(&iter)) { + } else if (!strcmp(key, OGS_AMBR_STRING) && + BSON_ITER_HOLDS_DOCUMENT(&iter)) { bson_iter_recurse(&iter, &child1_iter); while (bson_iter_next(&child1_iter)) { const char *child1_key = bson_iter_key(&child1_iter); - if (!strcmp(child1_key, "downlink") && + if (!strcmp(child1_key, OGS_DOWNLINK_STRING) && BSON_ITER_HOLDS_DOCUMENT(&child1_iter)) { uint8_t unit = 0; int n; @@ -417,11 +423,11 @@ int ogs_dbi_subscription_data(char *supi, bson_iter_recurse(&child1_iter, &child2_iter); while (bson_iter_next(&child2_iter)) { const char *child2_key = bson_iter_key(&child2_iter); - if (!strcmp(child2_key, "value") && + if (!strcmp(child2_key, OGS_VALUE_STRING) && BSON_ITER_HOLDS_INT32(&child2_iter)) { subscription_data->ambr.downlink = bson_iter_int32(&child2_iter); - } else if (!strcmp(child2_key, "unit") && + } else if (!strcmp(child2_key, OGS_UNIT_STRING) && BSON_ITER_HOLDS_INT32(&child2_iter)) { unit = bson_iter_int32(&child2_iter); } @@ -429,7 +435,7 @@ int ogs_dbi_subscription_data(char *supi, for (n = 0; n < unit; n++) subscription_data->ambr.downlink *= 1000; - } else if (!strcmp(child1_key, "uplink") && + } else if (!strcmp(child1_key, OGS_UPLINK_STRING) && BSON_ITER_HOLDS_DOCUMENT(&child1_iter)) { uint8_t unit = 0; int n; @@ -437,11 +443,11 @@ int ogs_dbi_subscription_data(char *supi, bson_iter_recurse(&child1_iter, &child2_iter); while (bson_iter_next(&child2_iter)) { const char *child2_key = bson_iter_key(&child2_iter); - if (!strcmp(child2_key, "value") && + if (!strcmp(child2_key, OGS_VALUE_STRING) && BSON_ITER_HOLDS_INT32(&child2_iter)) { subscription_data->ambr.uplink = bson_iter_int32(&child2_iter); - } else if (!strcmp(child2_key, "unit") && + } else if (!strcmp(child2_key, OGS_UNIT_STRING) && BSON_ITER_HOLDS_INT32(&child2_iter)) { unit = bson_iter_int32(&child2_iter); } @@ -452,7 +458,8 @@ int ogs_dbi_subscription_data(char *supi, } } - } else if (!strcmp(key, "slice") && BSON_ITER_HOLDS_ARRAY(&iter)) { + } else if (!strcmp(key, OGS_SLICE_STRING) && + BSON_ITER_HOLDS_ARRAY(&iter)) { bson_iter_recurse(&iter, &child1_iter); while (bson_iter_next(&child1_iter)) { @@ -471,20 +478,21 @@ int ogs_dbi_subscription_data(char *supi, while (bson_iter_next(&child2_iter)) { const char *child2_key = bson_iter_key(&child2_iter); - if (!strcmp(child2_key, "sst") && + if (!strcmp(child2_key, OGS_SST_STRING) && BSON_ITER_HOLDS_INT32(&child2_iter)) { slice_data->s_nssai.sst = bson_iter_int32(&child2_iter); - } else if (!strcmp(child2_key, "sd") && + } else if (!strcmp(child2_key, OGS_SD_STRING) && BSON_ITER_HOLDS_UTF8(&child2_iter)) { utf8 = bson_iter_utf8(&child2_iter, &length); ogs_assert(utf8); slice_data->s_nssai.sd = ogs_s_nssai_sd_from_string(utf8); - } else if (!strcmp(child2_key, "default_indicator") && + } else if (!strcmp(child2_key, + OGS_DEFAULT_INDICATOR_STRING) && BSON_ITER_HOLDS_BOOL(&child2_iter)) { slice_data->default_indicator = bson_iter_bool(&child2_iter); - } else if (!strcmp(child2_key, "session") && + } else if (!strcmp(child2_key, OGS_SESSION_STRING) && BSON_ITER_HOLDS_ARRAY(&child2_iter)) { bson_iter_recurse(&child2_iter, &child3_iter); @@ -501,29 +509,33 @@ int ogs_dbi_subscription_data(char *supi, while (bson_iter_next(&child4_iter)) { const char *child4_key = bson_iter_key(&child4_iter); - if (!strcmp(child4_key, "name") && + if (!strcmp(child4_key, OGS_NAME_STRING) && BSON_ITER_HOLDS_UTF8(&child4_iter)) { utf8 = bson_iter_utf8( &child4_iter, &length); session->name = ogs_strndup(utf8, length); ogs_assert(session->name); - } else if (!strcmp(child4_key, "type") && + } else if (!strcmp(child4_key, + OGS_TYPE_STRING) && BSON_ITER_HOLDS_INT32(&child4_iter)) { session->session_type = bson_iter_int32(&child4_iter); - } else if (!strcmp(child4_key, "qos") && + } else if (!strcmp(child4_key, + OGS_QOS_STRING) && BSON_ITER_HOLDS_DOCUMENT(&child4_iter)) { bson_iter_recurse( &child4_iter, &child5_iter); while (bson_iter_next(&child5_iter)) { const char *child5_key = bson_iter_key(&child5_iter); - if (!strcmp(child5_key, "index") && + if (!strcmp(child5_key, + OGS_INDEX_STRING) && BSON_ITER_HOLDS_INT32( &child5_iter)) { session->qos.index = bson_iter_int32(&child5_iter); - } else if (!strcmp(child5_key, "arp") && + } else if (!strcmp(child5_key, + OGS_ARP_STRING) && BSON_ITER_HOLDS_DOCUMENT( &child5_iter)) { bson_iter_recurse( @@ -533,7 +545,7 @@ int ogs_dbi_subscription_data(char *supi, const char *child6_key = bson_iter_key(&child6_iter); if (!strcmp(child6_key, - "priority_level") && + OGS_PRIORITY_LEVEL_STRING) && BSON_ITER_HOLDS_INT32( &child6_iter)) { session->qos.arp. @@ -541,7 +553,7 @@ int ogs_dbi_subscription_data(char *supi, bson_iter_int32( &child6_iter); } else if (!strcmp(child6_key, - "pre_emption_capability") && + OGS_PRE_EMPTION_CAPABILITY_STRING) && BSON_ITER_HOLDS_INT32( &child6_iter)) { session->qos.arp. @@ -549,7 +561,7 @@ int ogs_dbi_subscription_data(char *supi, bson_iter_int32( &child6_iter); } else if (!strcmp(child6_key, - "pre_emption_vulnerability") && + OGS_PRE_EMPTION_VULNERABILITY_STRING) && BSON_ITER_HOLDS_INT32( &child6_iter)) { session->qos.arp. @@ -560,7 +572,8 @@ int ogs_dbi_subscription_data(char *supi, } } } - } else if (!strcmp(child4_key, "ambr") && + } else if (!strcmp(child4_key, + OGS_AMBR_STRING) && BSON_ITER_HOLDS_DOCUMENT(&child4_iter)) { bson_iter_recurse( &child4_iter, &child5_iter); @@ -568,7 +581,8 @@ int ogs_dbi_subscription_data(char *supi, while (bson_iter_next(&child5_iter)) { const char *child5_key = bson_iter_key(&child5_iter); - if (!strcmp(child5_key, "downlink") && + if (!strcmp(child5_key, + OGS_DOWNLINK_STRING) && BSON_ITER_HOLDS_DOCUMENT( &child5_iter)) { uint8_t unit = 0; @@ -581,14 +595,14 @@ int ogs_dbi_subscription_data(char *supi, const char *child6_key = bson_iter_key(&child6_iter); if (!strcmp(child6_key, - "value") && + OGS_VALUE_STRING) && BSON_ITER_HOLDS_INT32( &child6_iter)) { session->ambr.downlink = bson_iter_int32( &child6_iter); } else if (!strcmp(child6_key, - "unit") && + OGS_UNIT_STRING) && BSON_ITER_HOLDS_INT32( &child6_iter)) { unit = bson_iter_int32( @@ -599,7 +613,7 @@ int ogs_dbi_subscription_data(char *supi, for (n = 0; n < unit; n++) session->ambr.downlink *= 1000; } else if (!strcmp(child5_key, - "uplink") && + OGS_UPLINK_STRING) && BSON_ITER_HOLDS_DOCUMENT( &child5_iter)) { uint8_t unit = 0; @@ -612,14 +626,14 @@ int ogs_dbi_subscription_data(char *supi, const char *child6_key = bson_iter_key(&child6_iter); if (!strcmp(child6_key, - "value") && + OGS_VALUE_STRING) && BSON_ITER_HOLDS_INT32( &child6_iter)) { session->ambr.uplink = bson_iter_int32( &child6_iter); } else if (!strcmp(child6_key, - "unit") && + OGS_UNIT_STRING) && BSON_ITER_HOLDS_INT32( &child6_iter)) { unit = bson_iter_int32( @@ -631,14 +645,16 @@ int ogs_dbi_subscription_data(char *supi, session->ambr.uplink *= 1000; } } - } else if (!strcmp(child4_key, "smf") && + } else if (!strcmp(child4_key, + OGS_SMF_STRING) && BSON_ITER_HOLDS_DOCUMENT(&child4_iter)) { bson_iter_recurse( &child4_iter, &child5_iter); while (bson_iter_next(&child5_iter)) { const char *child5_key = bson_iter_key(&child5_iter); - if (!strcmp(child5_key, "addr") && + if (!strcmp(child5_key, + OGS_IPV4_STRING) && BSON_ITER_HOLDS_UTF8( &child5_iter)) { ogs_ipsubnet_t ipsub; @@ -650,8 +666,8 @@ int ogs_dbi_subscription_data(char *supi, session->smf_ip.addr = ipsub.sub[0]; } - } else if (!strcmp( - child5_key, "addr6") && + } else if (!strcmp(child5_key, + OGS_IPV6_STRING) && BSON_ITER_HOLDS_UTF8( &child5_iter)) { ogs_ipsubnet_t ipsub; @@ -666,14 +682,15 @@ int ogs_dbi_subscription_data(char *supi, } } } - } else if (!strcmp(child4_key, "ue") && + } else if (!strcmp(child4_key, OGS_UE_STRING) && BSON_ITER_HOLDS_DOCUMENT(&child4_iter)) { bson_iter_recurse( &child4_iter, &child5_iter); while (bson_iter_next(&child5_iter)) { const char *child5_key = bson_iter_key(&child5_iter); - if (!strcmp(child5_key, "addr") && + if (!strcmp(child5_key, + OGS_IPV4_STRING) && BSON_ITER_HOLDS_UTF8( &child5_iter)) { ogs_ipsubnet_t ipsub; @@ -685,8 +702,8 @@ int ogs_dbi_subscription_data(char *supi, session->ue_ip.addr = ipsub.sub[0]; } - } else if (!strcmp( - child5_key, "addr6") && + } else if (!strcmp(child5_key, + OGS_IPV6_STRING) && BSON_ITER_HOLDS_UTF8( &child5_iter)) { ogs_ipsubnet_t ipsub; @@ -701,7 +718,8 @@ int ogs_dbi_subscription_data(char *supi, } } - } else if (!strcmp(child4_key, "ipv4_framed_routes") && + } else if (!strcmp(child4_key, + OGS_IPV4_FRAMED_ROUTES_STRING) && BSON_ITER_HOLDS_ARRAY(&child4_iter)) { int i; @@ -709,12 +727,15 @@ int ogs_dbi_subscription_data(char *supi, for (i = 0; i < OGS_MAX_NUM_OF_FRAMED_ROUTES_IN_PDI; i++) { if (!session->ipv4_framed_routes[i]) break; - ogs_free(session->ipv4_framed_routes[i]); + ogs_free(session-> + ipv4_framed_routes[i]); } } else { - session->ipv4_framed_routes = ogs_calloc( + session->ipv4_framed_routes = + ogs_calloc( OGS_MAX_NUM_OF_FRAMED_ROUTES_IN_PDI, - sizeof(session->ipv4_framed_routes[0])); + sizeof(session-> + ipv4_framed_routes[0])); } bson_iter_recurse( &child4_iter, &child5_iter); @@ -728,9 +749,11 @@ int ogs_dbi_subscription_data(char *supi, if (!BSON_ITER_HOLDS_UTF8(&child5_iter)) continue; v = bson_iter_utf8(&child5_iter, &length); - session->ipv4_framed_routes[i++] = ogs_strdup(v); + session->ipv4_framed_routes[i++] = + ogs_strdup(v); } - } else if (!strcmp(child4_key, "ipv6_framed_routes") && + } else if (!strcmp(child4_key, + OGS_IPV6_FRAMED_ROUTES_STRING) && BSON_ITER_HOLDS_ARRAY(&child4_iter)) { int i; @@ -738,12 +761,15 @@ int ogs_dbi_subscription_data(char *supi, for (i = 0; i < OGS_MAX_NUM_OF_FRAMED_ROUTES_IN_PDI; i++) { if (!session->ipv6_framed_routes[i]) break; - ogs_free(session->ipv6_framed_routes[i]); + ogs_free(session-> + ipv6_framed_routes[i]); } } else { - session->ipv6_framed_routes = ogs_calloc( + session->ipv6_framed_routes = + ogs_calloc( OGS_MAX_NUM_OF_FRAMED_ROUTES_IN_PDI, - sizeof(session->ipv6_framed_routes[0])); + sizeof(session-> + ipv6_framed_routes[0])); } bson_iter_recurse( &child4_iter, &child5_iter); @@ -757,7 +783,8 @@ int ogs_dbi_subscription_data(char *supi, if (!BSON_ITER_HOLDS_UTF8(&child5_iter)) continue; v = bson_iter_utf8(&child5_iter, &length); - session->ipv6_framed_routes[i++] = ogs_strdup(v); + session->ipv6_framed_routes[i++] = + ogs_strdup(v); } } } @@ -767,19 +794,19 @@ int ogs_dbi_subscription_data(char *supi, } subscription_data->num_of_slice++; } - } else if (!strcmp(key, "mme_host") && + } else if (!strcmp(key, OGS_MME_HOST_STRING) && BSON_ITER_HOLDS_UTF8(&iter)) { utf8 = bson_iter_utf8(&iter, &length); subscription_data->mme_host = ogs_strndup(utf8, ogs_min(length, OGS_MAX_FQDN_LEN) + 1); ogs_assert(subscription_data->mme_host); - } else if (!strcmp(key, "mme_realm") && + } else if (!strcmp(key, OGS_MME_REALM_STRING) && BSON_ITER_HOLDS_UTF8(&iter)) { utf8 = bson_iter_utf8(&iter, &length); subscription_data->mme_realm = ogs_strndup(utf8, ogs_min(length, OGS_MAX_FQDN_LEN) + 1); ogs_assert(subscription_data->mme_realm); - } else if (!strcmp(key, "purge_flag") && + } else if (!strcmp(key, OGS_PURGE_FLAG_STRING) && BSON_ITER_HOLDS_BOOL(&iter)) { subscription_data->purge_flag = bson_iter_bool(&iter); } diff --git a/lib/gtp/context.c b/lib/gtp/context.c index 810370157..a1cf22dcc 100644 --- a/lib/gtp/context.c +++ b/lib/gtp/context.c @@ -95,314 +95,363 @@ int ogs_gtp_context_parse_config(const char *local, const char *remote) const char *local_key = ogs_yaml_iter_key(&local_iter); ogs_assert(local_key); if (!strcmp(local_key, "gtpc")) { - ogs_yaml_iter_t gtpc_array, gtpc_iter; - ogs_yaml_iter_recurse(&local_iter, >pc_array); - do { - int family = AF_UNSPEC; - int i, num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = self.gtpc_port; - const char *dev = NULL; - ogs_sockaddr_t *addr = NULL; + ogs_yaml_iter_t gtpc_iter; + ogs_yaml_iter_recurse(&local_iter, >pc_iter); + while (ogs_yaml_iter_next(>pc_iter)) { + const char *gtpc_key = ogs_yaml_iter_key(>pc_iter); + ogs_assert(gtpc_key); + if (!strcmp(gtpc_key, "server")) { + ogs_yaml_iter_t server_array, server_iter; + ogs_yaml_iter_recurse(>pc_iter, &server_array); + do { + int family = AF_UNSPEC; + int i, num = 0; + const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; + uint16_t port = self.gtpc_port; + const char *dev = NULL; + ogs_sockaddr_t *addr = NULL; - ogs_sockopt_t option; - bool is_option = false; + ogs_sockopt_t option; + bool is_option = false; - if (ogs_yaml_iter_type(>pc_array) == - YAML_MAPPING_NODE) { - memcpy(>pc_iter, >pc_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(>pc_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(>pc_array)) - break; - ogs_yaml_iter_recurse(>pc_array, >pc_iter); - } else if (ogs_yaml_iter_type(>pc_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); + if (ogs_yaml_iter_type(&server_array) == + YAML_MAPPING_NODE) { + memcpy(&server_iter, &server_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&server_array)) + break; + ogs_yaml_iter_recurse( + &server_array, &server_iter); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); - while (ogs_yaml_iter_next(>pc_iter)) { - const char *gtpc_key = - ogs_yaml_iter_key(>pc_iter); - ogs_assert(gtpc_key); - if (!strcmp(gtpc_key, "family")) { - const char *v = ogs_yaml_iter_value(>pc_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; + while (ogs_yaml_iter_next(&server_iter)) { + const char *server_key = + ogs_yaml_iter_key(&server_iter); + ogs_assert(server_key); + if (!strcmp(server_key, "family")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) family = atoi(v); + if (family != AF_UNSPEC && + family != AF_INET && + family != AF_INET6) { + ogs_warn("Ignore family(%d) : " + "AF_UNSPEC(%d), " + "AF_INET(%d), AF_INET6(%d) ", + family, + AF_UNSPEC, AF_INET, AF_INET6); + family = AF_UNSPEC; + } + } else if (!strcmp(server_key, "address")) { + ogs_yaml_iter_t hostname_iter; + ogs_yaml_iter_recurse(&server_iter, + &hostname_iter); + ogs_assert(ogs_yaml_iter_type( + &hostname_iter) != + YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &hostname_iter)) + break; + } + + ogs_assert(num < + OGS_MAX_NUM_OF_HOSTNAME); + hostname[num++] = + ogs_yaml_iter_value( + &hostname_iter); + } while (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(server_key, "port")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) port = atoi(v); + } else if (!strcmp(server_key, "dev")) { + dev = ogs_yaml_iter_value(&server_iter); + } else if (!strcmp(server_key, "option")) { + rv = ogs_app_parse_sockopt_config( + &server_iter, &option); + if (rv != OGS_OK) { + ogs_error("ogs_app_parse_sockopt_" + "config() failed"); + return rv; + } + is_option = true; + } else if (!strcmp(server_key, "tac")) { + /* Nothing */ + } else if (!strcmp( + server_key, "e_cell_id")) { + /* Nothing */ + } else + ogs_warn("unknown key `%s`", + server_key); } - } else if (!strcmp(gtpc_key, "addr") || - !strcmp(gtpc_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse(>pc_iter, - &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&hostname_iter)) - break; - } + addr = NULL; + for (i = 0; i < num; i++) { + rv = ogs_addaddrinfo(&addr, + family, hostname[i], port, 0); + ogs_assert(rv == OGS_OK); + } - ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME); - hostname[num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(gtpc_key, "port")) { - const char *v = ogs_yaml_iter_value(>pc_iter); - if (v) port = atoi(v); - } else if (!strcmp(gtpc_key, "dev")) { - dev = ogs_yaml_iter_value(>pc_iter); - } else if (!strcmp(gtpc_key, "option")) { - rv = ogs_app_config_parse_sockopt( - >pc_iter, &option); - if (rv != OGS_OK) return rv; - is_option = true; - } else if (!strcmp(gtpc_key, "tac")) { - /* Nothing */ - } else if (!strcmp(gtpc_key, "e_cell_id")) { - /* Nothing */ - } else - ogs_warn("unknown key `%s`", gtpc_key); - } + if (addr) { + if (ogs_global_conf()->parameter. + no_ipv4 == 0) + ogs_socknode_add( + &self.gtpc_list, AF_INET, addr, + is_option ? &option : NULL); + if (ogs_global_conf()->parameter. + no_ipv6 == 0) + ogs_socknode_add( + &self.gtpc_list6, AF_INET6, addr, + is_option ? &option : NULL); + ogs_freeaddrinfo(addr); + } - addr = NULL; - for (i = 0; i < num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } + if (dev) { + rv = ogs_socknode_probe( + ogs_global_conf()->parameter. + no_ipv4 ? + NULL : &self.gtpc_list, + ogs_global_conf()->parameter. + no_ipv6 ? + NULL : &self.gtpc_list6, + dev, port, + is_option ? &option : NULL); + ogs_assert(rv == OGS_OK); + } - if (addr) { - if (ogs_app()->parameter.no_ipv4 == 0) - ogs_socknode_add( - &self.gtpc_list, AF_INET, addr, - is_option ? &option : NULL); - if (ogs_app()->parameter.no_ipv6 == 0) - ogs_socknode_add( - &self.gtpc_list6, AF_INET6, addr, - is_option ? &option : NULL); - ogs_freeaddrinfo(addr); - } + } while (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE); - if (dev) { - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? - NULL : &self.gtpc_list, - ogs_app()->parameter.no_ipv6 ? - NULL : &self.gtpc_list6, - dev, port, - is_option ? &option : NULL); - ogs_assert(rv == OGS_OK); - } - - } while (ogs_yaml_iter_type(>pc_array) == - YAML_SEQUENCE_NODE); - - if (ogs_list_empty(&self.gtpc_list) && - ogs_list_empty(&self.gtpc_list6)) { - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? - NULL : &self.gtpc_list, - ogs_app()->parameter.no_ipv6 ? - NULL : &self.gtpc_list6, - NULL, self.gtpc_port, NULL); - ogs_assert(rv == OGS_OK); + } else if (!strcmp(gtpc_key, "client")) { + /* handle config in application */ + } else + ogs_warn("unknown key `%s`", gtpc_key); } } else if (!strcmp(local_key, "gtpu")) { ogs_list_t list, list6; ogs_socknode_t *node = NULL, *node6 = NULL; ogs_socknode_t *iter = NULL, *next_iter = NULL; - ogs_yaml_iter_t gtpu_array, gtpu_iter; - ogs_yaml_iter_recurse(&local_iter, >pu_array); + ogs_yaml_iter_t gtpu_iter; + ogs_yaml_iter_recurse(&local_iter, >pu_iter); + while (ogs_yaml_iter_next(>pu_iter)) { + const char *gtpu_key = ogs_yaml_iter_key(>pu_iter); + ogs_assert(gtpu_key); + if (!strcmp(gtpu_key, "server")) { + ogs_yaml_iter_t server_array, server_iter; + ogs_yaml_iter_recurse(>pu_iter, &server_array); + do { + int family = AF_UNSPEC; + int i, num_of_hostname = 0; + const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; + int num_of_advertise = 0; + const char *advertise[OGS_MAX_NUM_OF_HOSTNAME]; + uint16_t port = self.gtpu_port; + const char *dev = NULL; + ogs_sockaddr_t *addr = NULL; + ogs_sockaddr_t *adv_addr = NULL; + ogs_sockaddr_t *adv_addr6 = NULL; + const char *teid_range_indication = NULL; + const char *teid_range = NULL; + const char *network_instance = NULL; + const char *source_interface = NULL; - do { - int family = AF_UNSPEC; - int i, num_of_hostname = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - int num_of_advertise = 0; - const char *advertise[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = self.gtpu_port; - const char *dev = NULL; - ogs_sockaddr_t *addr = NULL; - ogs_sockaddr_t *adv_addr = NULL; - ogs_sockaddr_t *adv_addr6 = NULL; - const char *teid_range_indication = NULL; - const char *teid_range = NULL; - const char *network_instance = NULL; - const char *source_interface = NULL; + ogs_sockopt_t option; + bool is_option = false; - ogs_sockopt_t option; - bool is_option = false; + if (ogs_yaml_iter_type(&server_array) == + YAML_MAPPING_NODE) { + memcpy(&server_iter, &server_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&server_array)) + break; + ogs_yaml_iter_recurse( + &server_array, &server_iter); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); - if (ogs_yaml_iter_type(>pu_array) == - YAML_MAPPING_NODE) { - memcpy(>pu_iter, >pu_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(>pu_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(>pu_array)) - break; - ogs_yaml_iter_recurse(>pu_array, >pu_iter); - } else if (ogs_yaml_iter_type(>pu_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); + while (ogs_yaml_iter_next(&server_iter)) { + const char *server_key = + ogs_yaml_iter_key(&server_iter); + ogs_assert(server_key); - while (ogs_yaml_iter_next(>pu_iter)) { - const char *gtpu_key = - ogs_yaml_iter_key(>pu_iter); - ogs_assert(gtpu_key); + if (ogs_list_count( + &self.gtpu_resource_list) >= + OGS_MAX_NUM_OF_GTPU_RESOURCE) { + ogs_warn( + "[Overflow]: Number of User Plane " + "IP Resource <= %d", + OGS_MAX_NUM_OF_GTPU_RESOURCE); + break; + } - if (ogs_list_count(&self.gtpu_resource_list) >= - OGS_MAX_NUM_OF_GTPU_RESOURCE) { - ogs_warn("[Overflow]: Number of User Plane " - "IP Resource <= %d", - OGS_MAX_NUM_OF_GTPU_RESOURCE); - break; - } + if (!strcmp(server_key, "family")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) family = atoi(v); + if (family != AF_UNSPEC && + family != AF_INET && + family != AF_INET6) { + ogs_warn("Ignore family(%d)" + ": AF_UNSPEC(%d), " + "AF_INET(%d), AF_INET6(%d) ", + family, + AF_UNSPEC, AF_INET, AF_INET6); + family = AF_UNSPEC; + } + } else if (!strcmp(server_key, "address")) { + ogs_yaml_iter_t hostname_iter; + ogs_yaml_iter_recurse(&server_iter, + &hostname_iter); + ogs_assert(ogs_yaml_iter_type( + &hostname_iter) != + YAML_MAPPING_NODE); - if (!strcmp(gtpu_key, "family")) { - const char *v = ogs_yaml_iter_value(>pu_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d)" - ": AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; + do { + if (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &hostname_iter)) + break; + } + + ogs_assert(num_of_hostname < + OGS_MAX_NUM_OF_HOSTNAME); + hostname[num_of_hostname++] = + ogs_yaml_iter_value( + &hostname_iter); + } while (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(server_key, + "advertise")) { + ogs_yaml_iter_t advertise_iter; + ogs_yaml_iter_recurse( + &server_iter, &advertise_iter); + ogs_assert(ogs_yaml_iter_type( + &advertise_iter) != + YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type( + &advertise_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &advertise_iter)) + break; + } + + ogs_assert(num_of_advertise < + OGS_MAX_NUM_OF_HOSTNAME); + advertise[num_of_advertise++] = + ogs_yaml_iter_value( + &advertise_iter); + } while (ogs_yaml_iter_type( + &advertise_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(server_key, "port")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) port = atoi(v); + } else if (!strcmp(server_key, "dev")) { + dev = ogs_yaml_iter_value(&server_iter); + } else if (!strcmp(server_key, "option")) { + rv = ogs_app_parse_sockopt_config( + &server_iter, &option); + if (rv != OGS_OK) { + ogs_error("ogs_app_parse_sockopt_" + "config() failed"); + return rv; + } + is_option = true; + } else if (!strcmp(server_key, + "teid_range_indication")) { + teid_range_indication = + ogs_yaml_iter_value(&server_iter); + } else if (!strcmp(server_key, + "teid_range")) { + teid_range = ogs_yaml_iter_value( + &server_iter); + } else if (!strcmp(server_key, + "network_instance")) { + network_instance = + ogs_yaml_iter_value(&server_iter); + } else if (!strcmp(server_key, + "source_interface")) { + source_interface = + ogs_yaml_iter_value(&server_iter); + } else + ogs_warn("unknown key `%s`", + server_key); } - } else if (!strcmp(gtpu_key, "addr") || - !strcmp(gtpu_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse( - >pu_iter, &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&hostname_iter)) - break; - } + addr = NULL; + for (i = 0; i < num_of_hostname; i++) { + rv = ogs_addaddrinfo(&addr, + family, hostname[i], port, 0); + ogs_assert(rv == OGS_OK); + } - ogs_assert(num_of_hostname < - OGS_MAX_NUM_OF_HOSTNAME); - hostname[num_of_hostname++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(gtpu_key, "advertise")) { - ogs_yaml_iter_t advertise_iter; - ogs_yaml_iter_recurse( - >pu_iter, &advertise_iter); - ogs_assert(ogs_yaml_iter_type( - &advertise_iter) != YAML_MAPPING_NODE); + ogs_list_init(&list); + ogs_list_init(&list6); - do { - if (ogs_yaml_iter_type(&advertise_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next( - &advertise_iter)) - break; - } + if (addr) { + if (ogs_global_conf()->parameter. + no_ipv4 == 0) + ogs_socknode_add( + &list, AF_INET, addr, + is_option ? &option : NULL); + if (ogs_global_conf()->parameter. + no_ipv6 == 0) + ogs_socknode_add( + &list6, AF_INET6, addr, + is_option ? &option : NULL); + ogs_freeaddrinfo(addr); + } - ogs_assert(num_of_advertise < - OGS_MAX_NUM_OF_HOSTNAME); - advertise[num_of_advertise++] = - ogs_yaml_iter_value(&advertise_iter); - } while ( - ogs_yaml_iter_type(&advertise_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(gtpu_key, "port")) { - const char *v = ogs_yaml_iter_value(>pu_iter); - if (v) port = atoi(v); - } else if (!strcmp(gtpu_key, "dev")) { - dev = ogs_yaml_iter_value(>pu_iter); - } else if (!strcmp(gtpu_key, "option")) { - rv = ogs_app_config_parse_sockopt( - >pu_iter, &option); - if (rv != OGS_OK) return rv; - is_option = true; - } else if (!strcmp(gtpu_key, - "teid_range_indication")) { - teid_range_indication = - ogs_yaml_iter_value(>pu_iter); - } else if (!strcmp(gtpu_key, - "teid_range")) { - teid_range = ogs_yaml_iter_value(>pu_iter); - } else if (!strcmp(gtpu_key, - "network_instance")) { - network_instance = - ogs_yaml_iter_value(>pu_iter); - } else if (!strcmp(gtpu_key, - "source_interface")) { - source_interface = - ogs_yaml_iter_value(>pu_iter); - } else - ogs_warn("unknown key `%s`", gtpu_key); - } + if (dev) { + rv = ogs_socknode_probe( + ogs_global_conf()->parameter.no_ipv4 ? + NULL : &list, + ogs_global_conf()->parameter.no_ipv6 ? + NULL : &list6, + dev, port, + is_option ? &option : NULL); + ogs_assert(rv == OGS_OK); + } - addr = NULL; - for (i = 0; i < num_of_hostname; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } + adv_addr = NULL; + for (i = 0; i < num_of_advertise; i++) { + rv = ogs_addaddrinfo(&adv_addr, + family, advertise[i], port, 0); + ogs_assert(rv == OGS_OK); + } + rv = ogs_copyaddrinfo(&adv_addr6, adv_addr); + ogs_assert(rv == OGS_OK); - ogs_list_init(&list); - ogs_list_init(&list6); - - if (addr) { - if (ogs_app()->parameter.no_ipv4 == 0) - ogs_socknode_add( - &list, AF_INET, addr, - is_option ? &option : NULL); - if (ogs_app()->parameter.no_ipv6 == 0) - ogs_socknode_add( - &list6, AF_INET6, addr, - is_option ? &option : NULL); - ogs_freeaddrinfo(addr); - } - - if (dev) { - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? NULL : &list, - ogs_app()->parameter.no_ipv6 ? NULL : &list6, - dev, port, - is_option ? &option : NULL); - ogs_assert(rv == OGS_OK); - } - - adv_addr = NULL; - for (i = 0; i < num_of_advertise; i++) { - rv = ogs_addaddrinfo(&adv_addr, - family, advertise[i], port, 0); - ogs_assert(rv == OGS_OK); - } - rv = ogs_copyaddrinfo(&adv_addr6, adv_addr); - ogs_assert(rv == OGS_OK); - - rv = ogs_filteraddrinfo(&adv_addr, AF_INET); - ogs_assert(rv == OGS_OK); - rv = ogs_filteraddrinfo(&adv_addr6, AF_INET6); - ogs_assert(rv == OGS_OK); + rv = ogs_filteraddrinfo(&adv_addr, AF_INET); + ogs_assert(rv == OGS_OK); + rv = ogs_filteraddrinfo(&adv_addr6, AF_INET6); + ogs_assert(rv == OGS_OK); /* Find first IPv4/IPv6 address in the list. * @@ -431,86 +480,54 @@ int ogs_gtp_context_parse_config(const char *local, const char *remote) * - 127.0.0.5 * - 2001:db8:cafe::1 */ - node = ogs_list_first(&list); - node6 = ogs_list_first(&list6); - if (node || node6) { - ogs_user_plane_ip_resource_info_t info; + node = ogs_list_first(&list); + node6 = ogs_list_first(&list6); + if (node || node6) { + ogs_user_plane_ip_resource_info_t info; - memset(&info, 0, sizeof(info)); - ogs_sockaddr_to_user_plane_ip_resource_info( - adv_addr ? adv_addr : - node ? node->addr : NULL, - adv_addr6 ? adv_addr6 : - node6 ? node6->addr : NULL, - &info); + memset(&info, 0, sizeof(info)); + ogs_sockaddr_to_user_plane_ip_resource_info( + adv_addr ? adv_addr : + node ? node->addr : NULL, + adv_addr6 ? adv_addr6 : + node6 ? node6->addr : NULL, + &info); - if (teid_range_indication) { - info.teidri = atoi(teid_range_indication); - if (teid_range) { - info.teid_range = atoi(teid_range); + if (teid_range_indication) { + info.teidri = atoi( + teid_range_indication); + if (teid_range) { + info.teid_range = atoi(teid_range); + } + } + if (network_instance) { + info.assoni = 1; + ogs_cpystrn(info.network_instance, + network_instance, + OGS_MAX_APN_LEN+1); + } + if (source_interface) { + info.assosi = 1; + info.source_interface = + atoi(source_interface); + } + + ogs_gtpu_resource_add( + &self.gtpu_resource_list, &info); } - } - if (network_instance) { - info.assoni = 1; - ogs_cpystrn(info.network_instance, - network_instance, OGS_MAX_APN_LEN+1); - } - if (source_interface) { - info.assosi = 1; - info.source_interface = atoi(source_interface); - } - ogs_gtpu_resource_add( - &self.gtpu_resource_list, &info); - } + ogs_list_for_each_safe(&list, next_iter, iter) + ogs_list_add(&self.gtpu_list, iter); + ogs_list_for_each_safe(&list6, next_iter, iter) + ogs_list_add(&self.gtpu_list, iter); - ogs_list_for_each_safe(&list, next_iter, iter) - ogs_list_add(&self.gtpu_list, iter); - ogs_list_for_each_safe(&list6, next_iter, iter) - ogs_list_add(&self.gtpu_list, iter); + ogs_freeaddrinfo(adv_addr); + ogs_freeaddrinfo(adv_addr6); - ogs_freeaddrinfo(adv_addr); - ogs_freeaddrinfo(adv_addr6); - - } while (ogs_yaml_iter_type(>pu_array) == - YAML_SEQUENCE_NODE); - - if (ogs_list_first(&self.gtpu_list) == NULL) { - ogs_list_init(&list); - ogs_list_init(&list6); - - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? NULL : &list, - ogs_app()->parameter.no_ipv6 ? NULL : &list6, - NULL, self.gtpu_port, NULL); - ogs_assert(rv == OGS_OK); - - /* - * The first tuple IPv4/IPv6 are added - * in User Plane IP resource information. - * - * TEID Range, Network Instance, Source Interface - * cannot be configured in automatic IP detection. - */ - node = ogs_list_first(&list); - node6 = ogs_list_first(&list6); - if (node || node6) { - ogs_user_plane_ip_resource_info_t info; - - memset(&info, 0, sizeof(info)); - ogs_sockaddr_to_user_plane_ip_resource_info( - node ? node->addr : NULL, - node6 ? node6->addr : NULL, - &info); - - ogs_gtpu_resource_add( - &self.gtpu_resource_list, &info); - } - - ogs_list_for_each_safe(&list, next_iter, iter) - ogs_list_add(&self.gtpu_list, iter); - ogs_list_for_each_safe(&list6, next_iter, iter) - ogs_list_add(&self.gtpu_list, iter); + } while (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE); + } else + ogs_warn("unknown key `%s`", gtpu_key); } } } @@ -573,9 +590,9 @@ ogs_gtp_node_t *ogs_gtp_node_add_by_f_teid( rv = ogs_filter_ip_version( &addr, - ogs_app()->parameter.no_ipv4, - ogs_app()->parameter.no_ipv6, - ogs_app()->parameter.prefer_ipv4); + ogs_global_conf()->parameter.no_ipv4, + ogs_global_conf()->parameter.no_ipv6, + ogs_global_conf()->parameter.prefer_ipv4); if (!addr) { ogs_error("ogs_filter_ip_version() failed"); return NULL; @@ -701,9 +718,9 @@ ogs_gtp_node_t *ogs_gtp_node_add_by_ip( rv = ogs_filter_ip_version( &addr, - ogs_app()->parameter.no_ipv4, - ogs_app()->parameter.no_ipv6, - ogs_app()->parameter.prefer_ipv4); + ogs_global_conf()->parameter.no_ipv4, + ogs_global_conf()->parameter.no_ipv6, + ogs_global_conf()->parameter.prefer_ipv4); if (!addr) { ogs_error("ogs_filter_ip_version() failed"); return NULL; diff --git a/lib/gtp/xact.c b/lib/gtp/xact.c index 1a35544a1..d459ea6ef 100644 --- a/lib/gtp/xact.c +++ b/lib/gtp/xact.c @@ -94,13 +94,14 @@ ogs_gtp_xact_t *ogs_gtp1_xact_local_create(ogs_gtp_node_t *gnode, xact->tm_response = ogs_timer_add( ogs_app()->timer_mgr, response_timeout, xact); ogs_assert(xact->tm_response); - xact->response_rcount = ogs_app()->time.message.gtp.n3_response_rcount; + xact->response_rcount = + ogs_local_conf()->time.message.gtp.n3_response_rcount; } xact->tm_holding = ogs_timer_add( ogs_app()->timer_mgr, holding_timeout, xact); ogs_assert(xact->tm_holding); - xact->holding_rcount = ogs_app()->time.message.gtp.n3_holding_rcount; + xact->holding_rcount = ogs_local_conf()->time.message.gtp.n3_holding_rcount; ogs_list_add(&xact->gnode->local_list, xact); @@ -151,12 +152,13 @@ ogs_gtp_xact_t *ogs_gtp_xact_local_create(ogs_gtp_node_t *gnode, xact->tm_response = ogs_timer_add( ogs_app()->timer_mgr, response_timeout, xact); ogs_assert(xact->tm_response); - xact->response_rcount = ogs_app()->time.message.gtp.n3_response_rcount, + xact->response_rcount = + ogs_local_conf()->time.message.gtp.n3_response_rcount, xact->tm_holding = ogs_timer_add( ogs_app()->timer_mgr, holding_timeout, xact); ogs_assert(xact->tm_holding); - xact->holding_rcount = ogs_app()->time.message.gtp.n3_holding_rcount, + xact->holding_rcount = ogs_local_conf()->time.message.gtp.n3_holding_rcount, ogs_list_add(&xact->gnode->local_list, xact); @@ -196,12 +198,13 @@ static ogs_gtp_xact_t *ogs_gtp_xact_remote_create(ogs_gtp_node_t *gnode, uint8_t xact->tm_response = ogs_timer_add( ogs_app()->timer_mgr, response_timeout, xact); ogs_assert(xact->tm_response); - xact->response_rcount = ogs_app()->time.message.gtp.n3_response_rcount, + xact->response_rcount = + ogs_local_conf()->time.message.gtp.n3_response_rcount, xact->tm_holding = ogs_timer_add( ogs_app()->timer_mgr, holding_timeout, xact); ogs_assert(xact->tm_holding); - xact->holding_rcount = ogs_app()->time.message.gtp.n3_holding_rcount, + xact->holding_rcount = ogs_local_conf()->time.message.gtp.n3_holding_rcount, ogs_list_add(&xact->gnode->remote_list, xact); @@ -474,7 +477,7 @@ static int ogs_gtp_xact_update_rx(ogs_gtp_xact_t *xact, uint8_t type) if (pkbuf) { if (xact->tm_holding) ogs_timer_start(xact->tm_holding, - ogs_app()->time.message. + ogs_local_conf()->time.message. gtp.t3_holding_duration); ogs_warn("[%d] %s Request Duplicated. Retransmit!" @@ -509,7 +512,7 @@ static int ogs_gtp_xact_update_rx(ogs_gtp_xact_t *xact, uint8_t type) if (xact->tm_holding) ogs_timer_start(xact->tm_holding, - ogs_app()->time.message.gtp.t3_holding_duration); + ogs_local_conf()->time.message.gtp.t3_holding_duration); break; @@ -539,7 +542,7 @@ static int ogs_gtp_xact_update_rx(ogs_gtp_xact_t *xact, uint8_t type) if (pkbuf) { if (xact->tm_holding) ogs_timer_start(xact->tm_holding, - ogs_app()->time.message. + ogs_local_conf()->time.message. gtp.t3_holding_duration); ogs_warn("[%d] %s Request Duplicated. Retransmit!" @@ -573,7 +576,7 @@ static int ogs_gtp_xact_update_rx(ogs_gtp_xact_t *xact, uint8_t type) } if (xact->tm_holding) ogs_timer_start(xact->tm_holding, - ogs_app()->time.message.gtp.t3_holding_duration); + ogs_local_conf()->time.message.gtp.t3_holding_duration); break; @@ -646,7 +649,8 @@ int ogs_gtp_xact_commit(ogs_gtp_xact_t *xact) if (xact->tm_response) ogs_timer_start(xact->tm_response, - ogs_app()->time.message.gtp.t3_response_duration); + ogs_local_conf()->time.message.gtp. + t3_response_duration); break; @@ -688,7 +692,8 @@ int ogs_gtp_xact_commit(ogs_gtp_xact_t *xact) } if (xact->tm_response) ogs_timer_start(xact->tm_response, - ogs_app()->time.message.gtp.t3_response_duration); + ogs_local_conf()->time.message.gtp. + t3_response_duration); break; @@ -745,7 +750,7 @@ static void response_timeout(void *data) if (xact->tm_response) ogs_timer_start(xact->tm_response, - ogs_app()->time.message.gtp.t3_response_duration); + ogs_local_conf()->time.message.gtp.t3_response_duration); pkbuf = xact->seq[xact->step-1].pkbuf; ogs_assert(pkbuf); @@ -786,7 +791,7 @@ static void holding_timeout(void *data) if (--xact->holding_rcount > 0) { if (xact->tm_holding) ogs_timer_start(xact->tm_holding, - ogs_app()->time.message.gtp.t3_holding_duration); + ogs_local_conf()->time.message.gtp.t3_holding_duration); } else { ogs_debug("[%d] %s Delete Transaction " "for step %d type %d peer [%s]:%d", diff --git a/lib/meson.build b/lib/meson.build index 2cdb7594a..4fc793c6f 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -19,13 +19,13 @@ libinc = include_directories('.') subdir('core') subdir('proto') +subdir('dbi') subdir('crypt') subdir('ipfw') +subdir('tun') subdir('app') subdir('metrics') subdir('sctp') -subdir('tun') -subdir('dbi') subdir('diameter') subdir('asn1c') subdir('ngap') diff --git a/lib/metrics/context.c b/lib/metrics/context.c index 794e1cf7b..158f8a1d0 100644 --- a/lib/metrics/context.c +++ b/lib/metrics/context.c @@ -95,159 +95,164 @@ int ogs_metrics_context_parse_config(const char *local) const char *local_key = ogs_yaml_iter_key(&local_iter); ogs_assert(local_key); if (!strcmp(local_key, "metrics")) { - ogs_list_t list, list6; - ogs_socknode_t *node = NULL, *node6 = NULL; + ogs_yaml_iter_t metrics_iter; + ogs_yaml_iter_recurse(&local_iter, &metrics_iter); + while (ogs_yaml_iter_next(&metrics_iter)) { + const char *metrics_key = + ogs_yaml_iter_key(&metrics_iter); + ogs_assert(metrics_key); + if (!strcmp(metrics_key, "server")) { + ogs_list_t list, list6; + ogs_socknode_t *node = NULL, *node6 = NULL; - ogs_yaml_iter_t metrics_array, metrics_iter; - ogs_yaml_iter_recurse(&local_iter, &metrics_array); - do { - int i, family = AF_UNSPEC; - int num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; + ogs_yaml_iter_t server_iter, server_array; + ogs_yaml_iter_recurse(&metrics_iter, &server_array); + do { + int i, family = AF_UNSPEC; + int num = 0; + const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = self.metrics_port; - const char *dev = NULL; - ogs_sockaddr_t *addr = NULL; + uint16_t port = self.metrics_port; + const char *dev = NULL; + ogs_sockaddr_t *addr = NULL; - ogs_sockopt_t option; - bool is_option = false; + ogs_sockopt_t option; + bool is_option = false; - if (ogs_yaml_iter_type(&metrics_array) == - YAML_MAPPING_NODE) { - memcpy(&metrics_iter, &metrics_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(&metrics_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&metrics_array)) - break; - ogs_yaml_iter_recurse( - &metrics_array, &metrics_iter); - } else if (ogs_yaml_iter_type(&metrics_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); + if (ogs_yaml_iter_type(&server_array) == + YAML_MAPPING_NODE) { + memcpy(&server_iter, &server_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&server_array)) + break; + ogs_yaml_iter_recurse( + &server_array, &server_iter); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); - while (ogs_yaml_iter_next(&metrics_iter)) { - const char *metrics_key = - ogs_yaml_iter_key(&metrics_iter); - ogs_assert(metrics_key); - if (!strcmp(metrics_key, "family")) { - const char *v = ogs_yaml_iter_value( - &metrics_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; + while (ogs_yaml_iter_next(&server_iter)) { + const char *server_key = + ogs_yaml_iter_key(&server_iter); + ogs_assert(server_key); + if (!strcmp(server_key, "family")) { + const char *v = ogs_yaml_iter_value( + &server_iter); + if (v) family = atoi(v); + if (family != AF_UNSPEC && + family != AF_INET && + family != AF_INET6) { + ogs_warn("Ignore family(%d) : " + "AF_UNSPEC(%d), " + "AF_INET(%d), AF_INET6(%d) ", + family, + AF_UNSPEC, AF_INET, AF_INET6); + family = AF_UNSPEC; + } + } else if (!strcmp(server_key, "address")) { + ogs_yaml_iter_t hostname_iter; + ogs_yaml_iter_recurse(&server_iter, + &hostname_iter); + ogs_assert(ogs_yaml_iter_type( + &hostname_iter) != + YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &hostname_iter)) + break; + } + + ogs_assert(num < + OGS_MAX_NUM_OF_HOSTNAME); + hostname[num++] = + ogs_yaml_iter_value( + &hostname_iter); + } while (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(server_key, "port")) { + const char *v = ogs_yaml_iter_value( + &server_iter); + if (v) + port = atoi(v); + } else if (!strcmp(server_key, "dev")) { + dev = ogs_yaml_iter_value(&server_iter); + } else if (!strcmp(server_key, "option")) { + rv = ogs_app_parse_sockopt_config( + &server_iter, &option); + if (rv != OGS_OK) { + ogs_error("ogs_app_parse_sockopt_" + "config() failed"); + return rv; + } + is_option = true; + } else + ogs_warn("unknown key `%s`", + server_key); } - } else if (!strcmp(metrics_key, "addr") || - !strcmp(metrics_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse(&metrics_iter, - &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next( - &hostname_iter)) - break; - } + addr = NULL; + for (i = 0; i < num; i++) { + rv = ogs_addaddrinfo(&addr, + family, hostname[i], port, 0); + ogs_assert(rv == OGS_OK); + } - ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME); - hostname[num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(metrics_key, "port")) { - const char *v = ogs_yaml_iter_value( - &metrics_iter); - if (v) - port = atoi(v); - } else if (!strcmp(metrics_key, "dev")) { - dev = ogs_yaml_iter_value(&metrics_iter); - } else if (!strcmp(metrics_key, "option")) { - rv = ogs_app_config_parse_sockopt( - &metrics_iter, &option); - if (rv != OGS_OK) return rv; - is_option = true; - } else - ogs_warn("unknown key `%s`", metrics_key); - } + ogs_list_init(&list); + ogs_list_init(&list6); - addr = NULL; - for (i = 0; i < num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } + if (addr) { + if (ogs_global_conf()->parameter.no_ipv4 == 0) + ogs_socknode_add( + &list, AF_INET, addr, NULL); + if (ogs_global_conf()->parameter.no_ipv6 == 0) + ogs_socknode_add( + &list6, AF_INET6, addr, NULL); + ogs_freeaddrinfo(addr); + } - ogs_list_init(&list); - ogs_list_init(&list6); + if (dev) { + rv = ogs_socknode_probe( + ogs_global_conf()->parameter.no_ipv4 ? + NULL : &list, + ogs_global_conf()->parameter.no_ipv6 ? + NULL : &list6, + dev, port, NULL); + ogs_assert(rv == OGS_OK); + } - if (addr) { - if (ogs_app()->parameter.no_ipv4 == 0) - ogs_socknode_add( - &list, AF_INET, addr, NULL); - if (ogs_app()->parameter.no_ipv6 == 0) - ogs_socknode_add( - &list6, AF_INET6, addr, NULL); - ogs_freeaddrinfo(addr); - } + node = ogs_list_first(&list); + if (node) { + ogs_metrics_server_t *server = + ogs_metrics_server_add( + node->addr, + is_option ? &option : NULL); + ogs_assert(server); + } + node6 = ogs_list_first(&list6); + if (node6) { + ogs_metrics_server_t *server = + ogs_metrics_server_add( + node6->addr, + is_option ? &option : NULL); + ogs_assert(server); + } - if (dev) { - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? NULL : &list, - ogs_app()->parameter.no_ipv6 ? NULL : &list6, - dev, port, NULL); - ogs_assert(rv == OGS_OK); - } + ogs_socknode_remove_all(&list); + ogs_socknode_remove_all(&list6); - node = ogs_list_first(&list); - if (node) { - ogs_metrics_server_t *server = - ogs_metrics_server_add( - node->addr, is_option ? &option : NULL); - ogs_assert(server); - } - node6 = ogs_list_first(&list6); - if (node6) { - ogs_metrics_server_t *server = - ogs_metrics_server_add( - node6->addr, is_option ? &option : NULL); - ogs_assert(server); - } - - ogs_socknode_remove_all(&list); - ogs_socknode_remove_all(&list6); - - } while (ogs_yaml_iter_type(&metrics_array) == - YAML_SEQUENCE_NODE); - - if (ogs_list_first(&self.server_list) == 0) { - ogs_list_init(&list); - ogs_list_init(&list6); - - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? NULL : &list, - ogs_app()->parameter.no_ipv6 ? NULL : &list6, - NULL, self.metrics_port, NULL); - ogs_assert(rv == OGS_OK); - - node = ogs_list_first(&list); - if (node) ogs_metrics_server_add(node->addr, NULL); - node6 = ogs_list_first(&list6); - if (node6) ogs_metrics_server_add(node6->addr, NULL); - - ogs_socknode_remove_all(&list); - ogs_socknode_remove_all(&list6); + } while (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE); + } else + ogs_warn("unknown key `%s`", metrics_key); } } } diff --git a/lib/nas/eps/types.h b/lib/nas/eps/types.h index ba15b748b..6bbceb178 100644 --- a/lib/nas/eps/types.h +++ b/lib/nas/eps/types.h @@ -339,7 +339,7 @@ typedef struct ogs_nas_eps_network_feature_support_s { ED7(uint8_t control_plane_ciot_eps_optimization:1;, uint8_t emm_registered_without_pdn_connectivity:1;, uint8_t support_of_extended_service_request_for_packet_services:1;, - uint8_t cs_lcs_no_information_about_support_of_location_service_via_cs_domain_is_avaiable:2;, + uint8_t cs_lcs_no_information_about_support_of_location_service_via_cs_domain_is_available:2;, uint8_t location_service_via_epc:1;, uint8_t emergency_bearer_services_in_s1_mode:1;, uint8_t ims_voice_over_ps_session_in_s1_mode:1;) diff --git a/lib/pfcp/context.c b/lib/pfcp/context.c index 39a4cfa52..3a44ff35a 100644 --- a/lib/pfcp/context.c +++ b/lib/pfcp/context.c @@ -203,7 +203,7 @@ static int ogs_pfcp_context_validation(const char *local) { if (ogs_list_first(&self.pfcp_list) == NULL && ogs_list_first(&self.pfcp_list6) == NULL) { - ogs_error("No %s.pfcp: in '%s'", local, ogs_app()->file); + ogs_error("No %s.pfcp.address: in '%s'", local, ogs_app()->file); return OGS_ERROR; } if (ogs_pfcp_check_subnet_overlapping() != OGS_OK) @@ -235,179 +235,506 @@ int ogs_pfcp_context_parse_config(const char *local, const char *remote) const char *local_key = ogs_yaml_iter_key(&local_iter); ogs_assert(local_key); if (!strcmp(local_key, "pfcp")) { - ogs_yaml_iter_t pfcp_array, pfcp_iter; - ogs_yaml_iter_recurse(&local_iter, &pfcp_array); - do { - int family = AF_UNSPEC; - int i, num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - int num_of_advertise = 0; - const char *advertise[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = self.pfcp_port; - const char *dev = NULL; - ogs_sockaddr_t *addr = NULL; + ogs_yaml_iter_t pfcp_iter; + ogs_yaml_iter_recurse(&local_iter, &pfcp_iter); + while (ogs_yaml_iter_next(&pfcp_iter)) { + const char *pfcp_key = ogs_yaml_iter_key(&pfcp_iter); + ogs_assert(pfcp_key); + if (!strcmp(pfcp_key, "server")) { + ogs_yaml_iter_t server_iter, server_array; + ogs_yaml_iter_recurse(&pfcp_iter, &server_array); + do { + int family = AF_UNSPEC; + int i, num = 0; + const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; + int num_of_advertise = 0; + const char *advertise[OGS_MAX_NUM_OF_HOSTNAME]; + uint16_t port = self.pfcp_port; + const char *dev = NULL; + ogs_sockaddr_t *addr = NULL; - ogs_sockopt_t option; - bool is_option = false; + ogs_sockopt_t option; + bool is_option = false; - if (ogs_yaml_iter_type(&pfcp_array) == - YAML_MAPPING_NODE) { - memcpy(&pfcp_iter, &pfcp_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(&pfcp_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&pfcp_array)) - break; - ogs_yaml_iter_recurse(&pfcp_array, &pfcp_iter); - } else if (ogs_yaml_iter_type(&pfcp_array) == - YAML_SCALAR_NODE) { - break; + if (ogs_yaml_iter_type(&server_array) == + YAML_MAPPING_NODE) { + memcpy(&server_iter, &server_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&server_array)) + break; + ogs_yaml_iter_recurse( + &server_array, &server_iter); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); + + while (ogs_yaml_iter_next(&server_iter)) { + const char *server_key = + ogs_yaml_iter_key(&server_iter); + ogs_assert(server_key); + if (!strcmp(server_key, "family")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) family = atoi(v); + if (family != AF_UNSPEC && + family != AF_INET && + family != AF_INET6) { + ogs_warn("Ignore family(%d) : " + "AF_UNSPEC(%d), " + "AF_INET(%d), AF_INET6(%d) ", + family, + AF_UNSPEC, AF_INET, AF_INET6); + family = AF_UNSPEC; + } + } else if (!strcmp(server_key, "address")) { + ogs_yaml_iter_t hostname_iter; + ogs_yaml_iter_recurse(&server_iter, + &hostname_iter); + ogs_assert(ogs_yaml_iter_type( + &hostname_iter) != + YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &hostname_iter)) + break; + } + + ogs_assert(num < + OGS_MAX_NUM_OF_HOSTNAME); + hostname[num++] = + ogs_yaml_iter_value( + &hostname_iter); + } while (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp( + server_key, "advertise")) { + ogs_yaml_iter_t hostname_iter; + ogs_yaml_iter_recurse(&server_iter, + &hostname_iter); + ogs_assert(ogs_yaml_iter_type( + &hostname_iter) != + YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &hostname_iter)) + break; + } + + ogs_assert(num < + OGS_MAX_NUM_OF_HOSTNAME); + advertise[num_of_advertise++] = + ogs_yaml_iter_value( + &hostname_iter); + } while (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(server_key, "port")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) { + port = atoi(v); + self.pfcp_port = port; + } + } else if (!strcmp(server_key, "dev")) { + dev = ogs_yaml_iter_value(&server_iter); + } else if (!strcmp(server_key, "option")) { + rv = ogs_app_parse_sockopt_config( + &server_iter, &option); + if (rv != OGS_OK) { + ogs_error("ogs_app_parse_sockopt_" + "config() failed"); + return rv; + } + is_option = true; + } else if (!strcmp(server_key, "apn") || + !strcmp(server_key, "dnn")) { + /* Skip */ + } else + ogs_warn("unknown key `%s`", + server_key); + } + + addr = NULL; + for (i = 0; i < num; i++) { + rv = ogs_addaddrinfo(&addr, + family, hostname[i], port, 0); + ogs_assert(rv == OGS_OK); + } + + if (addr) { + if (ogs_global_conf()-> + parameter.no_ipv4 == 0) + ogs_socknode_add( + &self.pfcp_list, AF_INET, addr, + is_option ? &option : NULL); + if (ogs_global_conf()-> + parameter.no_ipv6 == 0) + ogs_socknode_add( + &self.pfcp_list6, AF_INET6, addr, + is_option ? &option : NULL); + ogs_freeaddrinfo(addr); + } + + addr = NULL; + for (i = 0; i < num_of_advertise; i++) { + rv = ogs_addaddrinfo(&addr, + family, advertise[i], port, 0); + ogs_assert(rv == OGS_OK); + } + + if (addr) { + if (ogs_global_conf()-> + parameter.no_ipv4 == 0 && + !self.pfcp_advertise) { + ogs_copyaddrinfo( + &self.pfcp_advertise, addr); + ogs_filteraddrinfo( + &self.pfcp_advertise, AF_INET); + } + if (ogs_global_conf()-> + parameter.no_ipv6 == 0 && + !self.pfcp_advertise6) { + ogs_copyaddrinfo( + &self.pfcp_advertise6, addr); + ogs_filteraddrinfo( + &self.pfcp_advertise6, + AF_INET6); + } + ogs_freeaddrinfo(addr); + } + + if (dev) { + rv = ogs_socknode_probe( + ogs_global_conf()-> + parameter.no_ipv4 ? + NULL : &self.pfcp_list, + ogs_global_conf()-> + parameter.no_ipv6 ? + NULL : &self.pfcp_list6, + dev, self.pfcp_port, + is_option ? &option : NULL); + ogs_assert(rv == OGS_OK); + } + + } while (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(pfcp_key, "client")) { + ogs_yaml_iter_t client_iter; + ogs_yaml_iter_recurse(&pfcp_iter, &client_iter); + while (ogs_yaml_iter_next(&client_iter)) { + const char *client_key = + ogs_yaml_iter_key(&client_iter); + ogs_assert(client_key); + if (!strcmp(client_key, remote)) { + ogs_yaml_iter_t remote_array, remote_iter; + ogs_yaml_iter_recurse( + &client_iter, &remote_array); + do { + ogs_pfcp_node_t *node = NULL; + ogs_sockaddr_t *addr = NULL; + int family = AF_UNSPEC; + int i, num = 0; + const char *hostname[ + OGS_MAX_NUM_OF_HOSTNAME]; + uint16_t port = self.pfcp_port; + uint16_t tac[OGS_MAX_NUM_OF_TAI] = {0,}; + int num_of_tac = 0; + const char *dnn[OGS_MAX_NUM_OF_DNN]; + int num_of_dnn = 0; + uint32_t e_cell_id[ + OGS_MAX_NUM_OF_CELL_ID] = {0,}; + int num_of_e_cell_id = 0; + uint64_t nr_cell_id[ + OGS_MAX_NUM_OF_CELL_ID] = {0,}; + int num_of_nr_cell_id = 0; + + if (ogs_yaml_iter_type(&remote_array) == + YAML_MAPPING_NODE) { + memcpy(&remote_iter, &remote_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type( + &remote_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &remote_array)) + break; + ogs_yaml_iter_recurse(&remote_array, + &remote_iter); + } else if (ogs_yaml_iter_type( + &remote_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); + + while (ogs_yaml_iter_next( + &remote_iter)) { + const char *remote_key = + ogs_yaml_iter_key(&remote_iter); + ogs_assert(remote_key); + if (!strcmp(remote_key, "family")) { + const char *v = + ogs_yaml_iter_value( + &remote_iter); + if (v) family = atoi(v); + if (family != AF_UNSPEC && + family != AF_INET && + family != AF_INET6) { + ogs_warn( + "Ignore family(%d) : " + "AF_UNSPEC(%d), " + "AF_INET(%d), " + "AF_INET6(%d) ", + family, AF_UNSPEC, + AF_INET, AF_INET6); + family = AF_UNSPEC; + } + } else if (!strcmp(remote_key, + "address")) { + ogs_yaml_iter_t hostname_iter; + ogs_yaml_iter_recurse( + &remote_iter, + &hostname_iter); + ogs_assert(ogs_yaml_iter_type( + &hostname_iter) != + YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &hostname_iter)) + break; + } + + ogs_assert(num < + OGS_MAX_NUM_OF_HOSTNAME); + hostname[num++] = + ogs_yaml_iter_value( + &hostname_iter); + } while (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(remote_key, + "advertise")) { + /* Nothing in client */ + } else if (!strcmp(remote_key, + "port")) { + const char *v = + ogs_yaml_iter_value( + &remote_iter); + if (v) port = atoi(v); + } else if (!strcmp(remote_key, + "tac")) { + ogs_yaml_iter_t tac_iter; + ogs_yaml_iter_recurse( + &remote_iter, + &tac_iter); + ogs_assert(ogs_yaml_iter_type( + &tac_iter) != + YAML_MAPPING_NODE); + + do { + const char *v = NULL; + + ogs_assert(num_of_tac < + OGS_MAX_NUM_OF_TAI); + if (ogs_yaml_iter_type( + &tac_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &tac_iter)) + break; + } + + v = ogs_yaml_iter_value( + &tac_iter); + if (v) { + tac[num_of_tac] = + atoi(v); + num_of_tac++; + } + } while (ogs_yaml_iter_type( + &tac_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp( + remote_key, "apn") || + !strcmp( + remote_key, "dnn")) { + ogs_yaml_iter_t dnn_iter; + ogs_yaml_iter_recurse( + &remote_iter, + &dnn_iter); + ogs_assert(ogs_yaml_iter_type( + &dnn_iter) != + YAML_MAPPING_NODE); + + do { + const char *v = NULL; + + ogs_assert(num_of_dnn < + OGS_MAX_NUM_OF_DNN); + if (ogs_yaml_iter_type( + &dnn_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &dnn_iter)) + break; + } + + v = ogs_yaml_iter_value( + &dnn_iter); + if (v) { + dnn[num_of_dnn] = v; + num_of_dnn++; + } + } while (ogs_yaml_iter_type( + &dnn_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(remote_key, + "e_cell_id")) { + ogs_yaml_iter_t e_cell_id_iter; + ogs_yaml_iter_recurse( + &remote_iter, + &e_cell_id_iter); + ogs_assert(ogs_yaml_iter_type( + &e_cell_id_iter) != + YAML_MAPPING_NODE); + + do { + const char *v = NULL; + + ogs_assert( + num_of_e_cell_id < + OGS_MAX_NUM_OF_ENB_ID); + if (ogs_yaml_iter_type( + &e_cell_id_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &e_cell_id_iter)) + break; + } + + v = ogs_yaml_iter_value( + &e_cell_id_iter); + if (v) { + e_cell_id[ + num_of_e_cell_id] = + ogs_uint64_from_string( + (char*)v); + num_of_e_cell_id++; + } + } while (ogs_yaml_iter_type( + &e_cell_id_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(remote_key, + "nr_cell_id")) { + ogs_yaml_iter_t nr_cell_id_iter; + ogs_yaml_iter_recurse( + &remote_iter, + &nr_cell_id_iter); + ogs_assert(ogs_yaml_iter_type( + &nr_cell_id_iter) != + YAML_MAPPING_NODE); + + do { + const char *v = NULL; + + ogs_assert( + num_of_nr_cell_id < + OGS_MAX_NUM_OF_ENB_ID); + if (ogs_yaml_iter_type( + &nr_cell_id_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &nr_cell_id_iter)) + break; + } + + v = ogs_yaml_iter_value( + &nr_cell_id_iter); + if (v) { + nr_cell_id[ + num_of_nr_cell_id] = + ogs_uint64_from_string( + (char*)v); + num_of_nr_cell_id++; + } + } while (ogs_yaml_iter_type( + &nr_cell_id_iter) == + YAML_SEQUENCE_NODE); + } else + ogs_warn("unknown key `%s`", + remote_key); + } + + addr = NULL; + for (i = 0; i < num; i++) { + rv = ogs_addaddrinfo(&addr, family, + hostname[i], port, 0); + ogs_assert(rv == OGS_OK); + } + + ogs_filter_ip_version(&addr, + ogs_global_conf()->parameter. + no_ipv4, + ogs_global_conf()->parameter. + no_ipv6, + ogs_global_conf()->parameter. + prefer_ipv4); + + if (addr == NULL) continue; + + node = ogs_pfcp_node_new(addr); + ogs_assert(node); + ogs_list_add( + &self.pfcp_peer_list, node); + + node->num_of_tac = num_of_tac; + if (num_of_tac != 0) + memcpy(node->tac, + tac, sizeof(node->tac)); + + node->num_of_dnn = num_of_dnn; + if (num_of_dnn != 0) + memcpy(node->dnn, + dnn, sizeof(node->dnn)); + + node->num_of_e_cell_id = + num_of_e_cell_id; + if (num_of_e_cell_id != 0) + memcpy(node->e_cell_id, e_cell_id, + sizeof(node->e_cell_id)); + + node->num_of_nr_cell_id = + num_of_nr_cell_id; + if (num_of_nr_cell_id != 0) + memcpy(node->nr_cell_id, nr_cell_id, + sizeof(node->nr_cell_id)); + + } while (ogs_yaml_iter_type( + &remote_array) == + YAML_SEQUENCE_NODE); + } + } } else - ogs_assert_if_reached(); - - while (ogs_yaml_iter_next(&pfcp_iter)) { - const char *pfcp_key = - ogs_yaml_iter_key(&pfcp_iter); - ogs_assert(pfcp_key); - if (!strcmp(pfcp_key, "family")) { - const char *v = ogs_yaml_iter_value(&pfcp_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; - } - } else if (!strcmp(pfcp_key, "addr") || - !strcmp(pfcp_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse(&pfcp_iter, - &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next( - &hostname_iter)) - break; - } - - ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME); - hostname[num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(pfcp_key, "advertise")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse(&pfcp_iter, - &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next( - &hostname_iter)) - break; - } - - ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME); - advertise[num_of_advertise++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(pfcp_key, "port")) { - const char *v = ogs_yaml_iter_value(&pfcp_iter); - if (v) { - port = atoi(v); - self.pfcp_port = port; - } - } else if (!strcmp(pfcp_key, "dev")) { - dev = ogs_yaml_iter_value(&pfcp_iter); - } else if (!strcmp(pfcp_key, "option")) { - rv = ogs_app_config_parse_sockopt( - &pfcp_iter, &option); - if (rv != OGS_OK) return rv; - is_option = true; - } else if (!strcmp(pfcp_key, "apn") || - !strcmp(pfcp_key, "dnn")) { - /* Skip */ - } else - ogs_warn("unknown key `%s`", pfcp_key); - } - - addr = NULL; - for (i = 0; i < num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } - - if (addr) { - if (ogs_app()->parameter.no_ipv4 == 0) - ogs_socknode_add( - &self.pfcp_list, AF_INET, addr, - is_option ? &option : NULL); - if (ogs_app()->parameter.no_ipv6 == 0) - ogs_socknode_add( - &self.pfcp_list6, AF_INET6, addr, - is_option ? &option : NULL); - ogs_freeaddrinfo(addr); - } - - addr = NULL; - for (i = 0; i < num_of_advertise; i++) { - rv = ogs_addaddrinfo(&addr, - family, advertise[i], port, 0); - ogs_assert(rv == OGS_OK); - } - - if (addr) { - if (ogs_app()->parameter.no_ipv4 == 0 && - !self.pfcp_advertise) { - ogs_copyaddrinfo(&self.pfcp_advertise, addr); - ogs_filteraddrinfo(&self.pfcp_advertise, AF_INET); - } - if (ogs_app()->parameter.no_ipv6 == 0 && - !self.pfcp_advertise6) { - ogs_copyaddrinfo(&self.pfcp_advertise6, addr); - ogs_filteraddrinfo(&self.pfcp_advertise6, AF_INET6); - } - ogs_freeaddrinfo(addr); - } - - if (dev) { - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? - NULL : &self.pfcp_list, - ogs_app()->parameter.no_ipv6 ? - NULL : &self.pfcp_list6, - dev, self.pfcp_port, - is_option ? &option : NULL); - ogs_assert(rv == OGS_OK); - } - - } while (ogs_yaml_iter_type(&pfcp_array) == - YAML_SEQUENCE_NODE); - - if (ogs_list_first(&self.pfcp_list) == NULL && - ogs_list_first(&self.pfcp_list6) == NULL) { - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? - NULL : &self.pfcp_list, - ogs_app()->parameter.no_ipv6 ? - NULL : &self.pfcp_list6, - NULL, self.pfcp_port, NULL); - ogs_assert(rv == OGS_OK); + ogs_warn("unknown key `%s`", pfcp_key); } - } else if (!strcmp(local_key, "subnet")) { + } else if (!strcmp(local_key, "session")) { ogs_yaml_iter_t subnet_array, subnet_iter; ogs_yaml_iter_recurse(&local_iter, &subnet_array); @@ -440,7 +767,7 @@ int ogs_pfcp_context_parse_config(const char *local, const char *remote) const char *subnet_key = ogs_yaml_iter_key(&subnet_iter); ogs_assert(subnet_key); - if (!strcmp(subnet_key, "addr")) { + if (!strcmp(subnet_key, "subnet")) { char *v = (char *)ogs_yaml_iter_value(&subnet_iter); if (v) { @@ -506,238 +833,6 @@ int ogs_pfcp_context_parse_config(const char *local, const char *remote) YAML_SEQUENCE_NODE); } } - } else if (!strcmp(root_key, remote)) { - ogs_yaml_iter_t remote_iter; - ogs_yaml_iter_recurse(&root_iter, &remote_iter); - while (ogs_yaml_iter_next(&remote_iter)) { - const char *remote_key = ogs_yaml_iter_key(&remote_iter); - ogs_assert(remote_key); - if (!strcmp(remote_key, "pfcp")) { - ogs_yaml_iter_t pfcp_array, pfcp_iter; - ogs_yaml_iter_recurse(&remote_iter, &pfcp_array); - do { - ogs_pfcp_node_t *node = NULL; - ogs_sockaddr_t *addr = NULL; - int family = AF_UNSPEC; - int i, num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = self.pfcp_port; - uint16_t tac[OGS_MAX_NUM_OF_TAI] = {0,}; - int num_of_tac = 0; - const char *dnn[OGS_MAX_NUM_OF_DNN]; - int num_of_dnn = 0; - uint32_t e_cell_id[OGS_MAX_NUM_OF_CELL_ID] = {0,}; - int num_of_e_cell_id = 0; - uint64_t nr_cell_id[OGS_MAX_NUM_OF_CELL_ID] = {0,}; - int num_of_nr_cell_id = 0; - - if (ogs_yaml_iter_type(&pfcp_array) == - YAML_MAPPING_NODE) { - memcpy(&pfcp_iter, &pfcp_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(&pfcp_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&pfcp_array)) - break; - ogs_yaml_iter_recurse(&pfcp_array, &pfcp_iter); - } else if (ogs_yaml_iter_type(&pfcp_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); - - while (ogs_yaml_iter_next(&pfcp_iter)) { - const char *pfcp_key = - ogs_yaml_iter_key(&pfcp_iter); - ogs_assert(pfcp_key); - if (!strcmp(pfcp_key, "family")) { - const char *v = ogs_yaml_iter_value(&pfcp_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; - } - } else if (!strcmp(pfcp_key, "addr") || - !strcmp(pfcp_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse(&pfcp_iter, - &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&hostname_iter)) - break; - } - - ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME); - hostname[num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(pfcp_key, "advertise")) { - /* Nothing in client */ - } else if (!strcmp(pfcp_key, "port")) { - const char *v = ogs_yaml_iter_value(&pfcp_iter); - if (v) port = atoi(v); - } else if (!strcmp(pfcp_key, "tac")) { - ogs_yaml_iter_t tac_iter; - ogs_yaml_iter_recurse(&pfcp_iter, &tac_iter); - ogs_assert(ogs_yaml_iter_type(&tac_iter) != - YAML_MAPPING_NODE); - - do { - const char *v = NULL; - - ogs_assert(num_of_tac < - OGS_MAX_NUM_OF_TAI); - if (ogs_yaml_iter_type(&tac_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&tac_iter)) - break; - } - - v = ogs_yaml_iter_value(&tac_iter); - if (v) { - tac[num_of_tac] = atoi(v); - num_of_tac++; - } - } while ( - ogs_yaml_iter_type(&tac_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(pfcp_key, "apn") || - !strcmp(pfcp_key, "dnn")) { - ogs_yaml_iter_t dnn_iter; - ogs_yaml_iter_recurse(&pfcp_iter, &dnn_iter); - ogs_assert(ogs_yaml_iter_type(&dnn_iter) != - YAML_MAPPING_NODE); - - do { - const char *v = NULL; - - ogs_assert(num_of_dnn < - OGS_MAX_NUM_OF_DNN); - if (ogs_yaml_iter_type(&dnn_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&dnn_iter)) - break; - } - - v = ogs_yaml_iter_value(&dnn_iter); - if (v) { - dnn[num_of_dnn] = v; - num_of_dnn++; - } - } while ( - ogs_yaml_iter_type(&dnn_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(pfcp_key, "e_cell_id")) { - ogs_yaml_iter_t e_cell_id_iter; - ogs_yaml_iter_recurse( - &pfcp_iter, &e_cell_id_iter); - ogs_assert(ogs_yaml_iter_type( - &e_cell_id_iter) != YAML_MAPPING_NODE); - - do { - const char *v = NULL; - - ogs_assert(num_of_e_cell_id < - OGS_MAX_NUM_OF_ENB_ID); - if (ogs_yaml_iter_type(&e_cell_id_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next( - &e_cell_id_iter)) - break; - } - - v = ogs_yaml_iter_value(&e_cell_id_iter); - if (v) { - e_cell_id[num_of_e_cell_id] - = ogs_uint64_from_string((char*)v); - num_of_e_cell_id++; - } - } while ( - ogs_yaml_iter_type(&e_cell_id_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(pfcp_key, "nr_cell_id")) { - ogs_yaml_iter_t nr_cell_id_iter; - ogs_yaml_iter_recurse( - &pfcp_iter, &nr_cell_id_iter); - ogs_assert(ogs_yaml_iter_type( - &nr_cell_id_iter) != YAML_MAPPING_NODE); - - do { - const char *v = NULL; - - ogs_assert(num_of_nr_cell_id < - OGS_MAX_NUM_OF_ENB_ID); - if (ogs_yaml_iter_type(&nr_cell_id_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next( - &nr_cell_id_iter)) - break; - } - - v = ogs_yaml_iter_value(&nr_cell_id_iter); - if (v) { - nr_cell_id[num_of_nr_cell_id] - = ogs_uint64_from_string((char*)v); - num_of_nr_cell_id++; - } - } while ( - ogs_yaml_iter_type(&nr_cell_id_iter) == - YAML_SEQUENCE_NODE); - } else - ogs_warn("unknown key `%s`", pfcp_key); - } - - addr = NULL; - for (i = 0; i < num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } - - ogs_filter_ip_version(&addr, - ogs_app()->parameter.no_ipv4, - ogs_app()->parameter.no_ipv6, - ogs_app()->parameter.prefer_ipv4); - - if (addr == NULL) continue; - - node = ogs_pfcp_node_new(addr); - ogs_assert(node); - ogs_list_add(&self.pfcp_peer_list, node); - - node->num_of_tac = num_of_tac; - if (num_of_tac != 0) - memcpy(node->tac, tac, sizeof(node->tac)); - - node->num_of_dnn = num_of_dnn; - if (num_of_dnn != 0) - memcpy(node->dnn, dnn, sizeof(node->dnn)); - - node->num_of_e_cell_id = num_of_e_cell_id; - if (num_of_e_cell_id != 0) - memcpy(node->e_cell_id, e_cell_id, - sizeof(node->e_cell_id)); - - node->num_of_nr_cell_id = num_of_nr_cell_id; - if (num_of_nr_cell_id != 0) - memcpy(node->nr_cell_id, nr_cell_id, - sizeof(node->nr_cell_id)); - - } while (ogs_yaml_iter_type(&pfcp_array) == - YAML_SEQUENCE_NODE); - } - } } } diff --git a/lib/pfcp/conv.c b/lib/pfcp/conv.c index 54563c725..2a31395fc 100644 --- a/lib/pfcp/conv.c +++ b/lib/pfcp/conv.c @@ -28,7 +28,7 @@ int ogs_pfcp_sockaddr_to_node_id(ogs_pfcp_node_id_t *node_id, int *len) ogs_sockaddr_t *advertise6 = ogs_pfcp_self()->pfcp_advertise6; ogs_sockaddr_t *addr = ogs_pfcp_self()->pfcp_addr; ogs_sockaddr_t *addr6 = ogs_pfcp_self()->pfcp_addr6; - int prefer_ipv4 = ogs_app()->parameter.prefer_ipv4; + int prefer_ipv4 = ogs_global_conf()->parameter.prefer_ipv4; ogs_assert(node_id); diff --git a/lib/pfcp/handler.c b/lib/pfcp/handler.c index 51df89cb0..e540c1d8e 100644 --- a/lib/pfcp/handler.c +++ b/lib/pfcp/handler.c @@ -84,7 +84,7 @@ bool ogs_pfcp_handle_heartbeat_response( node->remote_recovery = rsp->recovery_time_stamp.u32; ogs_timer_start(node->t_no_heartbeat, - ogs_app()->time.message.pfcp.no_heartbeat_duration); + ogs_local_conf()->time.message.pfcp.no_heartbeat_duration); return true; } diff --git a/lib/pfcp/xact.c b/lib/pfcp/xact.c index 61398f22a..8e8334bd5 100644 --- a/lib/pfcp/xact.c +++ b/lib/pfcp/xact.c @@ -89,12 +89,14 @@ ogs_pfcp_xact_t *ogs_pfcp_xact_local_create(ogs_pfcp_node_t *node, xact->tm_response = ogs_timer_add( ogs_app()->timer_mgr, response_timeout, xact); ogs_assert(xact->tm_response); - xact->response_rcount = ogs_app()->time.message.pfcp.n1_response_rcount; + xact->response_rcount = + ogs_local_conf()->time.message.pfcp.n1_response_rcount; xact->tm_holding = ogs_timer_add( ogs_app()->timer_mgr, holding_timeout, xact); ogs_assert(xact->tm_holding); - xact->holding_rcount = ogs_app()->time.message.pfcp.n1_holding_rcount; + xact->holding_rcount = + ogs_local_conf()->time.message.pfcp.n1_holding_rcount; xact->tm_delayed_commit = ogs_timer_add( ogs_app()->timer_mgr, delayed_commit_timeout, xact); @@ -134,12 +136,14 @@ static ogs_pfcp_xact_t *ogs_pfcp_xact_remote_create( xact->tm_response = ogs_timer_add( ogs_app()->timer_mgr, response_timeout, xact); ogs_assert(xact->tm_response); - xact->response_rcount = ogs_app()->time.message.pfcp.n1_response_rcount; + xact->response_rcount = + ogs_local_conf()->time.message.pfcp.n1_response_rcount; xact->tm_holding = ogs_timer_add( ogs_app()->timer_mgr, holding_timeout, xact); ogs_assert(xact->tm_holding); - xact->holding_rcount = ogs_app()->time.message.pfcp.n1_holding_rcount; + xact->holding_rcount = + ogs_local_conf()->time.message.pfcp.n1_holding_rcount; xact->tm_delayed_commit = ogs_timer_add( ogs_app()->timer_mgr, delayed_commit_timeout, xact); @@ -313,7 +317,7 @@ static int ogs_pfcp_xact_update_rx(ogs_pfcp_xact_t *xact, uint8_t type) if (pkbuf) { if (xact->tm_holding) ogs_timer_start(xact->tm_holding, - ogs_app()->time.message. + ogs_local_conf()->time.message. pfcp.t1_holding_duration); ogs_warn("[%d] %s Request Duplicated. Retransmit!" @@ -348,7 +352,8 @@ static int ogs_pfcp_xact_update_rx(ogs_pfcp_xact_t *xact, uint8_t type) if (xact->tm_holding) ogs_timer_start(xact->tm_holding, - ogs_app()->time.message.pfcp.t1_holding_duration); + ogs_local_conf()->time.message.pfcp. + t1_holding_duration); break; @@ -378,7 +383,7 @@ static int ogs_pfcp_xact_update_rx(ogs_pfcp_xact_t *xact, uint8_t type) if (pkbuf) { if (xact->tm_holding) ogs_timer_start(xact->tm_holding, - ogs_app()->time.message. + ogs_local_conf()->time.message. pfcp.t1_holding_duration); ogs_warn("[%d] %s Request Duplicated. Retransmit!" @@ -412,7 +417,8 @@ static int ogs_pfcp_xact_update_rx(ogs_pfcp_xact_t *xact, uint8_t type) } if (xact->tm_holding) ogs_timer_start(xact->tm_holding, - ogs_app()->time.message.pfcp.t1_holding_duration); + ogs_local_conf()->time.message.pfcp. + t1_holding_duration); break; @@ -481,7 +487,7 @@ int ogs_pfcp_xact_commit(ogs_pfcp_xact_t *xact) if (xact->tm_response) ogs_timer_start(xact->tm_response, - ogs_app()->time.message.pfcp.t1_response_duration); + ogs_local_conf()->time.message.pfcp.t1_response_duration); break; @@ -523,7 +529,8 @@ int ogs_pfcp_xact_commit(ogs_pfcp_xact_t *xact) } if (xact->tm_response) ogs_timer_start(xact->tm_response, - ogs_app()->time.message.pfcp.t1_response_duration); + ogs_local_conf()->time.message.pfcp. + t1_response_duration); break; @@ -589,7 +596,7 @@ static void response_timeout(void *data) if (xact->tm_response) ogs_timer_start(xact->tm_response, - ogs_app()->time.message.pfcp.t1_response_duration); + ogs_local_conf()->time.message.pfcp.t1_response_duration); pkbuf = xact->seq[xact->step-1].pkbuf; ogs_assert(pkbuf); @@ -630,7 +637,7 @@ static void holding_timeout(void *data) if (--xact->holding_rcount > 0) { if (xact->tm_holding) ogs_timer_start(xact->tm_holding, - ogs_app()->time.message.pfcp.t1_holding_duration); + ogs_local_conf()->time.message.pfcp.t1_holding_duration); } else { ogs_debug("[%d] %s Delete Transaction " "for step %d type %d peer [%s]:%d", diff --git a/lib/proto/event.c b/lib/proto/event.c index 4073d3c7d..51b1930e8 100644 --- a/lib/proto/event.c +++ b/lib/proto/event.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -65,11 +65,6 @@ const char *ogs_event_get_name(ogs_event_t *e) case OGS_EVENT_SBI_TIMER: return OGS_EVENT_NAME_SBI_TIMER; - case OGS_EVENT_DBI_POLL_TIMER: - return "OGS_EVENT_DBI_POLL_TIMER"; - case OGS_EVENT_DBI_MESSAGE: - return "OGS_EVENT_DBI_MESSAGE"; - default: break; } diff --git a/lib/proto/event.h b/lib/proto/event.h index da92e0f57..1549a96ff 100644 --- a/lib/proto/event.h +++ b/lib/proto/event.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -39,9 +39,6 @@ typedef enum { OGS_EVENT_SBI_CLIENT, OGS_EVENT_SBI_TIMER, - OGS_EVENT_DBI_POLL_TIMER, - OGS_EVENT_DBI_MESSAGE, - OGS_MAX_NUM_OF_PROTO_EVENT, } ogs_event_e; @@ -63,9 +60,6 @@ typedef struct ogs_event_s { ogs_sbi_message_t *message; } sbi; - struct { - void *document; - } dbi; } ogs_event_t; #define OGS_EVENT_SIZE 256 diff --git a/lib/proto/timer.c b/lib/proto/timer.c index eff0d2e99..de758ad49 100644 --- a/lib/proto/timer.c +++ b/lib/proto/timer.c @@ -51,8 +51,6 @@ const char *ogs_timer_get_name(int timer_id) return OGS_TIMER_NAME_SUBSCRIPTION_PATCH; case OGS_TIMER_SBI_CLIENT_WAIT: return OGS_TIMER_NAME_SBI_CLIENT_WAIT; - case OGS_TIMER_DBI_POLL_CHANGE_STREAM: - return "OGS_TIMER_DBI_POLL_CHANGE_STREAM"; default: break; } diff --git a/lib/proto/timer.h b/lib/proto/timer.h index 05ac4c6ce..b65285c09 100644 --- a/lib/proto/timer.h +++ b/lib/proto/timer.h @@ -48,8 +48,6 @@ typedef enum { OGS_TIMER_SUBSCRIPTION_PATCH, OGS_TIMER_SBI_CLIENT_WAIT, - OGS_TIMER_DBI_POLL_CHANGE_STREAM, - OGS_MAX_NUM_OF_PROTO_TIMER, } ogs_timer_e; diff --git a/lib/proto/types.c b/lib/proto/types.c index e5fb5cba1..759d23acb 100644 --- a/lib/proto/types.c +++ b/lib/proto/types.c @@ -34,21 +34,26 @@ uint32_t ogs_plmn_id_hexdump(void *plmn_id) uint16_t ogs_plmn_id_mcc(ogs_plmn_id_t *plmn_id) { + ogs_assert(plmn_id); return plmn_id->mcc1 * 100 + plmn_id->mcc2 * 10 + plmn_id->mcc3; } uint16_t ogs_plmn_id_mnc(ogs_plmn_id_t *plmn_id) { + ogs_assert(plmn_id); return plmn_id->mnc1 == 0xf ? plmn_id->mnc2 * 10 + plmn_id->mnc3 : plmn_id->mnc1 * 100 + plmn_id->mnc2 * 10 + plmn_id->mnc3; } uint16_t ogs_plmn_id_mnc_len(ogs_plmn_id_t *plmn_id) { + ogs_assert(plmn_id); return plmn_id->mnc1 == 0xf ? 2 : 3; } void *ogs_plmn_id_build(ogs_plmn_id_t *plmn_id, uint16_t mcc, uint16_t mnc, uint16_t mnc_len) { + ogs_assert(plmn_id); + plmn_id->mcc1 = PLMN_ID_DIGIT1(mcc); plmn_id->mcc2 = PLMN_ID_DIGIT2(mcc); plmn_id->mcc3 = PLMN_ID_DIGIT3(mcc); @@ -67,6 +72,9 @@ void *ogs_plmn_id_build(ogs_plmn_id_t *plmn_id, void *ogs_nas_from_plmn_id( ogs_nas_plmn_id_t *ogs_nas_plmn_id, ogs_plmn_id_t *plmn_id) { + ogs_assert(ogs_nas_plmn_id); + ogs_assert(plmn_id); + memcpy(ogs_nas_plmn_id, plmn_id, OGS_PLMN_ID_LEN); if (plmn_id->mnc1 != 0xf) { ogs_nas_plmn_id->mnc1 = plmn_id->mnc1; @@ -78,6 +86,9 @@ void *ogs_nas_from_plmn_id( void *ogs_nas_to_plmn_id( ogs_plmn_id_t *plmn_id, ogs_nas_plmn_id_t *ogs_nas_plmn_id) { + ogs_assert(plmn_id); + ogs_assert(ogs_nas_plmn_id); + memcpy(plmn_id, ogs_nas_plmn_id, OGS_PLMN_ID_LEN); if (plmn_id->mnc1 != 0xf) { plmn_id->mnc1 = ogs_nas_plmn_id->mnc1; @@ -87,13 +98,6 @@ void *ogs_nas_to_plmn_id( return plmn_id; } -char *ogs_serving_network_name_from_plmn_id(ogs_plmn_id_t *plmn_id) -{ - ogs_assert(plmn_id); - return ogs_msprintf("5G:mnc%03d.mcc%03d.3gppnetwork.org", - ogs_plmn_id_mnc(plmn_id), ogs_plmn_id_mcc(plmn_id)); -} - char *ogs_plmn_id_mcc_string(ogs_plmn_id_t *plmn_id) { ogs_assert(plmn_id); @@ -124,6 +128,110 @@ char *ogs_plmn_id_to_string(ogs_plmn_id_t *plmn_id, char *buf) return buf; } +#define FQDN_3GPPNETWORK_ORG ".3gppnetwork.org" +#define FQDN_5GC_MNC "5gc.mnc" +#define FQDN_MCC ".mcc" + +char *ogs_serving_network_name_from_plmn_id(ogs_plmn_id_t *plmn_id) +{ + ogs_assert(plmn_id); + return ogs_msprintf("5G:mnc%03d.mcc%03d" FQDN_3GPPNETWORK_ORG, + ogs_plmn_id_mnc(plmn_id), ogs_plmn_id_mcc(plmn_id)); +} + +char *ogs_home_network_domain_from_plmn_id(ogs_plmn_id_t *plmn_id) +{ + ogs_assert(plmn_id); + return ogs_msprintf("5gc.mnc%03d.mcc%03d" FQDN_3GPPNETWORK_ORG, + ogs_plmn_id_mnc(plmn_id), ogs_plmn_id_mcc(plmn_id)); +} + +char *ogs_nrf_fqdn_from_plmn_id(ogs_plmn_id_t *plmn_id) +{ + return ogs_msprintf("nrf.5gc.mnc%03d.mcc%03d" FQDN_3GPPNETWORK_ORG, + ogs_plmn_id_mnc(plmn_id), ogs_plmn_id_mcc(plmn_id)); +} + +char *ogs_nssf_fqdn_from_plmn_id(ogs_plmn_id_t *plmn_id) +{ + return ogs_msprintf("nssf.5gc.mnc%03d.mcc%03d" FQDN_3GPPNETWORK_ORG, + ogs_plmn_id_mnc(plmn_id), ogs_plmn_id_mcc(plmn_id)); +} + +char *ogs_home_network_domain_from_fqdn(char *fqdn) +{ + char *p = NULL; + + ogs_assert(fqdn); + + if (strlen(fqdn) < + strlen(FQDN_5GC_MNC "XXX" FQDN_MCC "XXX" FQDN_3GPPNETWORK_ORG)) { + return NULL; + } + + p = fqdn + strlen(fqdn); + if (strncmp(p - strlen(FQDN_3GPPNETWORK_ORG), + FQDN_3GPPNETWORK_ORG, strlen(FQDN_3GPPNETWORK_ORG)) != 0) { + return NULL; + } + + p -= (strlen(FQDN_3GPPNETWORK_ORG) + 3); + if (strncmp(p - strlen(FQDN_MCC), + FQDN_MCC, strlen(FQDN_MCC)) != 0) { + return NULL; + } + + p -= (strlen(FQDN_MCC) + 3); + if (strncmp(p - strlen(FQDN_5GC_MNC), + FQDN_5GC_MNC, strlen(FQDN_5GC_MNC)) != 0) { + return NULL; + } + + return p - strlen(FQDN_5GC_MNC); +} + +uint16_t ogs_plmn_id_mcc_from_fqdn(char *fqdn) +{ + char mcc[4]; + char *p = NULL; + + ogs_assert(fqdn); + + p = ogs_home_network_domain_from_fqdn(fqdn); + if (p == NULL) { + ogs_error("Invalid FQDN [%d:%s]", (int)strlen(fqdn), fqdn); + return 0; + } + + p += strlen(FQDN_5GC_MNC) + 3 + strlen(FQDN_MCC); + + memcpy(mcc, p, 3); + mcc[3] = 0; + + return atoi(mcc); +} + +uint16_t ogs_plmn_id_mnc_from_fqdn(char *fqdn) +{ + char mnc[4]; + char *p = NULL; + + ogs_assert(fqdn); + + p = ogs_home_network_domain_from_fqdn(fqdn); + if (p == NULL) { + ogs_error("Invalid FQDN [%d:%s]", (int)strlen(fqdn), fqdn); + return 0; + } + + p += strlen(FQDN_5GC_MNC); + + memcpy(mnc, p, 3); + mnc[3] = 0; + + return atoi(mnc); +} + uint32_t ogs_amf_id_hexdump(ogs_amf_id_t *amf_id) { uint32_t hex; @@ -617,6 +725,47 @@ int ogs_ipv6prefix_from_string(uint8_t *addr6, uint8_t *prefixlen, char *string) return OGS_OK; } +int ogs_check_br_conf(ogs_bitrate_t *br) +{ + ogs_assert(br); + + if (br->downlink == 0) { + ogs_error("No Downlink"); + return OGS_ERROR; + } + if (br->uplink == 0) { + ogs_error("No Uplink"); + return OGS_ERROR; + } + + return OGS_OK; +} + +int ogs_check_qos_conf(ogs_qos_t *qos) +{ + ogs_assert(qos); + + if (!qos->index) { + ogs_error("No QCI"); + return OGS_ERROR; + } + + if (!qos->arp.priority_level) { + ogs_error("No Priority Level"); + return OGS_ERROR; + } + if (!qos->arp.pre_emption_capability) { + ogs_error("No Pre-emption Capability"); + return OGS_ERROR; + } + if (!qos->arp.pre_emption_vulnerability) { + ogs_error("No Pre-emption Vulnerability "); + return OGS_ERROR; + } + + return OGS_OK; +} + int ogs_sockaddr_to_user_plane_ip_resource_info( ogs_sockaddr_t *addr, ogs_sockaddr_t *addr6, ogs_user_plane_ip_resource_info_t *info) @@ -713,19 +862,6 @@ void ogs_subscription_data_free(ogs_subscription_data_t *subscription_data) subscription_data->num_of_msisdn = 0; } -void ogs_session_data_free(ogs_session_data_t *session_data) -{ - int i; - - ogs_assert(session_data); - - if (session_data->session.name) - ogs_free(session_data->session.name); - - for (i = 0; i < session_data->num_of_pcc_rule; i++) - OGS_PCC_RULE_FREE(&session_data->pcc_rule[i]); -} - void ogs_ims_data_free(ogs_ims_data_t *ims_data) { int i, j, k; diff --git a/lib/proto/types.h b/lib/proto/types.h index 50195253b..d7abcfc29 100644 --- a/lib/proto/types.h +++ b/lib/proto/types.h @@ -108,6 +108,64 @@ extern "C" { #define OGS_MAX_QOS_FLOW_ID 63 +#define OGS_IMSI_STRING "imsi" +#define OGS_MSISDN_STRING "msisdn" +#define OGS_IMEISV_STRING "imeisv" + +#define OGS_ACCESS_RESTRICTION_DATA_STRING "access_restriction_data" +#define OGS_SUBSCRIBER_STATUS_STRING "subscriber_status" +#define OGS_OPERATOR_DETERMINED_BARRING_STRING "operator_determined_barring" +#define OGS_NETWORK_ACCESS_MODE_STRING "network_access_mode" +#define OGS_SUBSCRIBED_RAU_TAU_TIMER_STRING "subscribed_rau_tau_timer" + +#define OGS_SECURITY_STRING "security" +#define OGS_K_STRING "k" +#define OGS_OPC_STRING "opc" +#define OGS_OP_STRING "op" +#define OGS_AMF_STRING "amf" +#define OGS_RAND_STRING "rand" +#define OGS_SQN_STRING "sqn" + +#define OGS_MME_HOST_STRING "mme_host" +#define OGS_MME_REALM_STRING "mme_realm" +#define OGS_MME_TIMESTAMP_STRING "mme_timestamp" +#define OGS_PURGE_FLAG_STRING "purge_flag" + +#define OGS_AMBR_STRING "ambr" +#define OGS_DOWNLINK_STRING "downlink" +#define OGS_UPLINK_STRING "uplink" +#define OGS_VALUE_STRING "value" +#define OGS_UNIT_STRING "unit" + +#define OGS_POLICY_STRING "policy" +#define OGS_SLICE_STRING "slice" +#define OGS_SST_STRING "sst" +#define OGS_SD_STRING "sd" +#define OGS_DEFAULT_INDICATOR_STRING "default_indicator" +#define OGS_SESSION_STRING "session" +#define OGS_NAME_STRING "name" +#define OGS_TYPE_STRING "type" +#define OGS_QOS_STRING "qos" +#define OGS_INDEX_STRING "index" +#define OGS_ARP_STRING "arp" +#define OGS_PRIORITY_LEVEL_STRING "priority_level" +#define OGS_PRE_EMPTION_CAPABILITY_STRING "pre_emption_capability" +#define OGS_PRE_EMPTION_VULNERABILITY_STRING "pre_emption_vulnerability" + +#define OGS_PCC_RULE_STRING "pcc_rule" +#define OGS_MBR_STRING "mbr" +#define OGS_GBR_STRING "gbr" +#define OGS_FLOW_STRING "flow" +#define OGS_DIRECTION_STRING "direction" +#define OGS_DESCRIPTION_STRING "description" + +#define OGS_SMF_STRING "smf" +#define OGS_IPV4_STRING "ipv4" +#define OGS_IPV6_STRING "ipv6" +#define OGS_UE_STRING "ue" +#define OGS_IPV4_FRAMED_ROUTES_STRING "ipv4_framed_routes" +#define OGS_IPV6_FRAMED_ROUTES_STRING "ipv6_framed_routes" + /************************************ * PLMN_ID Structure */ #define OGS_MAX_NUM_OF_PLMN 6 @@ -129,13 +187,20 @@ uint16_t ogs_plmn_id_mnc_len(ogs_plmn_id_t *plmn_id); void *ogs_plmn_id_build(ogs_plmn_id_t *plmn_id, uint16_t mcc, uint16_t mnc, uint16_t mnc_len); -char *ogs_serving_network_name_from_plmn_id(ogs_plmn_id_t *plmn_id); char *ogs_plmn_id_mcc_string(ogs_plmn_id_t *plmn_id); char *ogs_plmn_id_mnc_string(ogs_plmn_id_t *plmn_id); #define OGS_PLMNIDSTRLEN (sizeof(ogs_plmn_id_t)*2+1) char *ogs_plmn_id_to_string(ogs_plmn_id_t *plmn_id, char *buf); +char *ogs_serving_network_name_from_plmn_id(ogs_plmn_id_t *plmn_id); +char *ogs_home_network_domain_from_plmn_id(ogs_plmn_id_t *plmn_id); +char *ogs_nrf_fqdn_from_plmn_id(ogs_plmn_id_t *plmn_id); +char *ogs_nssf_fqdn_from_plmn_id(ogs_plmn_id_t *plmn_id); +char *ogs_home_network_domain_from_fqdn(char *fqdn); +uint16_t ogs_plmn_id_mnc_from_fqdn(char *fqdn); +uint16_t ogs_plmn_id_mcc_from_fqdn(char *fqdn); + /************************* * NAS PLMN_ID Structure */ typedef struct ogs_nas_plmn_id_s { @@ -331,6 +396,8 @@ typedef struct ogs_bitrate_s { uint64_t uplink; /* bits per seconds */ } ogs_bitrate_t; +int ogs_check_br_conf(ogs_bitrate_t *br); + /********************************** * QoS Structure */ typedef struct ogs_qos_s { @@ -373,6 +440,8 @@ typedef struct ogs_qos_s { ogs_bitrate_t gbr; /* Guaranteed Bit Rate (GBR) */ } ogs_qos_t; +int ogs_check_qos_conf(ogs_qos_t *qos); + /********************************** * Flow Structure */ #define OGS_FLOW_DOWNLINK_ONLY 1 @@ -413,8 +482,8 @@ typedef struct ogs_pcc_rule_s { #define OGS_STORE_PCC_RULE(__dST, __sRC) \ do { \ int __iNDEX; \ - ogs_assert((__sRC)); \ - ogs_assert((__dST)); \ + ogs_assert((__sRC) != NULL); \ + ogs_assert((__dST) != NULL); \ OGS_PCC_RULE_FREE(__dST); \ (__dST)->type = (__sRC)->type; \ if ((__sRC)->name) { \ @@ -441,7 +510,7 @@ typedef struct ogs_pcc_rule_s { #define OGS_PCC_RULE_FREE(__pCCrULE) \ do { \ int __pCCrULE_iNDEX; \ - ogs_assert((__pCCrULE)); \ + ogs_assert((__pCCrULE) != NULL); \ if ((__pCCrULE)->id) \ ogs_free((__pCCrULE)->id); \ if ((__pCCrULE)->name) \ @@ -450,10 +519,9 @@ typedef struct ogs_pcc_rule_s { __pCCrULE_iNDEX < (__pCCrULE)->num_of_flow; __pCCrULE_iNDEX++) { \ OGS_FLOW_FREE(&((__pCCrULE)->flow[__pCCrULE_iNDEX])); \ } \ - (__pCCrULE)->num_of_flow = 0; \ + memset((__pCCrULE), 0, sizeof(ogs_pcc_rule_t)); \ } while(0) - /********************************** * PDN Structure */ typedef struct ogs_session_s { @@ -732,7 +800,39 @@ typedef struct ogs_session_data_s { int num_of_pcc_rule; } ogs_session_data_t; -void ogs_session_data_free(ogs_session_data_t *session_data); +#define OGS_STORE_SESSION_DATA(__dST, __sRC) \ + do { \ + int rv, j; \ + ogs_assert((__dST) != NULL); \ + ogs_assert((__sRC) != NULL); \ + OGS_SESSION_DATA_FREE(__dST); \ + if ((__sRC)->session.name) { \ + (__dST)->session.name = ogs_strdup((__sRC)->session.name); \ + ogs_assert((__dST)->session.name); \ + } \ + (__dST)->session.session_type = (__sRC)->session.session_type; \ + memcpy(&(__dST)->session.ambr, &(__sRC)->session.ambr, \ + sizeof((__dST)->session.ambr)); \ + memcpy(&(__dST)->session.qos, &(__sRC)->session.qos, \ + sizeof((__dST)->session.qos)); \ + (__dST)->num_of_pcc_rule = (__sRC)->num_of_pcc_rule; \ + for (j = 0; j < (__dST)->num_of_pcc_rule; j++) { \ + rv = ogs_check_qos_conf(&(__sRC)->pcc_rule[j].qos); \ + ogs_assert(rv == OGS_OK); \ + OGS_STORE_PCC_RULE(&(__dST)->pcc_rule[j], &(__sRC)->pcc_rule[j]); \ + } \ + } while(0) + +#define OGS_SESSION_DATA_FREE(__sESSdATA) \ + do { \ + int i; \ + ogs_assert((__sESSdATA) != NULL); \ + if ((__sESSdATA)->session.name) \ + ogs_free((__sESSdATA)->session.name); \ + for (i = 0; i < (__sESSdATA)->num_of_pcc_rule; i++) \ + OGS_PCC_RULE_FREE(&(__sESSdATA)->pcc_rule[i]); \ + memset((__sESSdATA), 0, sizeof(ogs_session_data_t)); \ + } while(0) typedef struct ogs_media_sub_component_s { uint32_t flow_number; diff --git a/lib/sbi/client.c b/lib/sbi/client.c index eccd6a292..16ec19515 100644 --- a/lib/sbi/client.c +++ b/lib/sbi/client.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -39,6 +39,7 @@ typedef struct connection_s { int num_of_header; char **headers; struct curl_slist *header_list; + struct curl_slist *resolve_list; char *content; @@ -99,14 +100,15 @@ void ogs_sbi_client_final(void) } ogs_sbi_client_t *ogs_sbi_client_add( - OpenAPI_uri_scheme_e scheme, ogs_sockaddr_t *addr) + OpenAPI_uri_scheme_e scheme, + char *fqdn, uint16_t fqdn_port, + ogs_sockaddr_t *addr, ogs_sockaddr_t *addr6) { ogs_sbi_client_t *client = NULL; CURLM *multi = NULL; - char buf[OGS_ADDRSTRLEN]; ogs_assert(scheme); - ogs_assert(addr); + ogs_assert(fqdn || addr || addr6); ogs_pool_alloc(&client_pool, &client); if (!client) { @@ -117,9 +119,27 @@ ogs_sbi_client_t *ogs_sbi_client_add( client->scheme = scheme; + client->insecure_skip_verify = + ogs_sbi_self()->tls.client.insecure_skip_verify; + if (ogs_sbi_self()->tls.client.cacert) + client->cacert = ogs_strdup(ogs_sbi_self()->tls.client.cacert); + + if (ogs_sbi_self()->tls.client.private_key) + client->private_key = + ogs_strdup(ogs_sbi_self()->tls.client.private_key); + if (ogs_sbi_self()->tls.client.cert) + client->cert = ogs_strdup(ogs_sbi_self()->tls.client.cert); + + ogs_debug("ogs_sbi_client_add [%s]", OpenAPI_uri_scheme_ToString(scheme)); OGS_OBJECT_REF(client); - ogs_assert(OGS_OK == ogs_copyaddrinfo(&client->node.addr, addr)); + if (fqdn) + ogs_assert((client->fqdn = ogs_strdup(fqdn))); + client->fqdn_port = fqdn_port; + if (addr) + ogs_assert(OGS_OK == ogs_copyaddrinfo(&client->addr, addr)); + if (addr6) + ogs_assert(OGS_OK == ogs_copyaddrinfo(&client->addr6, addr6)); client->t_curl = ogs_timer_add( ogs_app()->timer_mgr, multi_timer_expired, client); @@ -144,23 +164,28 @@ ogs_sbi_client_t *ogs_sbi_client_add( ogs_list_add(&ogs_sbi_self()->client_list, client); - ogs_debug("[%d] CLEINT added with Ref [%s:%d]", - client->reference_count, OGS_ADDR(addr, buf), OGS_PORT(addr)); + ogs_debug("CLEINT added with Ref [%d]", client->reference_count); return client; } void ogs_sbi_client_remove(ogs_sbi_client_t *client) { - ogs_sockaddr_t *addr = NULL; char buf[OGS_ADDRSTRLEN]; ogs_assert(client); - addr = client->node.addr; - ogs_assert(addr); - ogs_debug("[%d] CLEINT UnRef [%s:%d]", - client->reference_count, OGS_ADDR(addr, buf), OGS_PORT(addr)); + ogs_debug("CLEINT UnRef [%d]", client->reference_count); + if (client->fqdn) + ogs_debug("- fqdn [%s:%d]", client->fqdn, client->fqdn_port); + if (client->resolve) + ogs_debug("- resolve [%s]", client->resolve); + if (client->addr) + ogs_debug("- addr [%s:%d]", + OGS_ADDR(client->addr, buf), OGS_PORT(client->addr)); + if (client->addr6) + ogs_debug("- addr6 [%s:%d]", + OGS_ADDR(client->addr6, buf), OGS_PORT(client->addr6)); /* ogs_sbi_client_t is always created with reference context */ if (OGS_OBJECT_IS_REF(client)) { @@ -168,8 +193,7 @@ void ogs_sbi_client_remove(ogs_sbi_client_t *client) return; } - ogs_debug("[%d] CLEINT removed [%s:%d]", - client->reference_count, OGS_ADDR(addr, buf), OGS_PORT(addr)); + ogs_debug("CLEINT removed [%d]", client->reference_count); ogs_list_remove(&ogs_sbi_self()->client_list, client); @@ -182,8 +206,22 @@ void ogs_sbi_client_remove(ogs_sbi_client_t *client) ogs_assert(client->multi); curl_multi_cleanup(client->multi); - ogs_assert(client->node.addr); - ogs_freeaddrinfo(client->node.addr); + if (client->cacert) + ogs_free(client->cacert); + if (client->private_key) + ogs_free(client->private_key); + if (client->cert) + ogs_free(client->cert); + + if (client->fqdn) + ogs_free(client->fqdn); + if (client->resolve) + ogs_free(client->resolve); + + if (client->addr) + ogs_freeaddrinfo(client->addr); + if (client->addr6) + ogs_freeaddrinfo(client->addr6); ogs_pool_free(&client_pool, client); } @@ -197,17 +235,39 @@ void ogs_sbi_client_remove_all(void) } ogs_sbi_client_t *ogs_sbi_client_find( - OpenAPI_uri_scheme_e scheme, ogs_sockaddr_t *addr) + OpenAPI_uri_scheme_e scheme, + char *fqdn, uint16_t fqdn_port, + ogs_sockaddr_t *addr, ogs_sockaddr_t *addr6) { ogs_sbi_client_t *client = NULL; ogs_assert(scheme); - ogs_assert(addr); ogs_list_for_each(&ogs_sbi_self()->client_list, client) { - if (client->scheme == scheme && - ogs_sockaddr_is_equal(client->node.addr, addr) == true) - break; + if (client->scheme != scheme) + continue; + + if (fqdn) { + if (!client->fqdn) + continue; + if (strcmp(client->fqdn, fqdn) != 0 || + client->fqdn_port != fqdn_port) + continue; + } + if (addr) { + if (!client->addr) + continue; + if (ogs_sockaddr_is_equal(client->addr, addr) == false) + continue; + } + if (addr6) { + if (!client->addr6) + continue; + if (ogs_sockaddr_is_equal(client->addr6, addr6) == false) + continue; + } + + break; } return client; @@ -370,7 +430,7 @@ static connection_t *connection_add( /* If http response is not received within deadline, * Open5GS will discard this request. */ ogs_timer_start(conn->timer, - ogs_app()->time.message.sbi.connection_deadline); + ogs_local_conf()->time.message.sbi.connection_deadline); conn->easy = curl_easy_init(); if (!conn->easy) { @@ -393,22 +453,18 @@ static connection_t *connection_add( curl_easy_setopt(conn->easy, CURLOPT_BUFFERSIZE, OGS_MAX_SDU_LEN); - if (ogs_app()->sbi.client.no_tls == false) { - ogs_assert(ogs_app()->sbi.client.key); - ogs_assert(ogs_app()->sbi.client.cert); - curl_easy_setopt(conn->easy, CURLOPT_SSLKEY, - ogs_app()->sbi.client.key); - curl_easy_setopt(conn->easy, CURLOPT_SSLCERT, - ogs_app()->sbi.client.cert); - - if (ogs_app()->sbi.client.no_verify == false) { - if (ogs_app()->sbi.client.cacert) { - curl_easy_setopt(conn->easy, CURLOPT_CAINFO, - ogs_app()->sbi.client.cacert); - } - } else { + if (client->scheme == OpenAPI_uri_scheme_https) { + if (client->insecure_skip_verify) { curl_easy_setopt(conn->easy, CURLOPT_SSL_VERIFYPEER, 0); curl_easy_setopt(conn->easy, CURLOPT_SSL_VERIFYHOST, 0); + } else { + if (client->cacert) + curl_easy_setopt(conn->easy, CURLOPT_CAINFO, client->cacert); + } + + if (client->private_key && client->cert) { + curl_easy_setopt(conn->easy, CURLOPT_SSLKEY, client->private_key); + curl_easy_setopt(conn->easy, CURLOPT_SSLCERT, client->cert); } } @@ -455,6 +511,11 @@ static connection_t *connection_add( curl_easy_setopt(conn->easy, CURLOPT_URL, request->h.uri); + if (client->resolve) { + conn->resolve_list = curl_slist_append(NULL, client->resolve); + curl_easy_setopt(conn->easy, CURLOPT_RESOLVE, conn->resolve_list); + } + curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn); curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, conn); @@ -516,6 +577,8 @@ static void connection_free(connection_t *conn) } curl_slist_free_all(conn->header_list); + curl_slist_free_all(conn->resolve_list); + if (conn->method) ogs_free(conn->method); @@ -673,7 +736,7 @@ bool ogs_sbi_client_send_request( return true; } -bool ogs_sbi_client_send_via_scp( +bool ogs_sbi_client_send_via_scp_or_sepp( ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb, ogs_sbi_request_t *request, void *data) { @@ -684,11 +747,13 @@ bool ogs_sbi_client_send_via_scp( if (request->h.uri) { /* - * In case of indirect communication using SCP, - * If the full URI is already defined, change full URI to SCP as below. + * In case of the communication using SCP or SEPP, + * If the full URI is already defined, + * change full URI to SCP or SEPP as below. * * OLD: http://127.0.0.5:7777/nnrf-nfm/v1/nf-status-notify - * NEW: https://scp.open5gs.org/nnrf-nfm/v1/nf-status-notify + * SCP: https://scp.open5gs.org/nnrf-nfm/v1/nf-status-notify + * SEPP: https://sepp.open5gs.org/nnrf-nfm/v1/nf-status-notify */ char *apiroot = NULL; char *path = NULL; diff --git a/lib/sbi/client.h b/lib/sbi/client.h index c1b84acdd..221bc7c59 100644 --- a/lib/sbi/client.h +++ b/lib/sbi/client.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -36,31 +36,45 @@ extern "C" { \ if ((__cTX)->client) { \ ogs_sbi_client_t *client = NULL; \ - ogs_sockaddr_t *addr = NULL; \ \ client = ((__cTX)->client); \ ogs_assert(client); \ - addr = client->node.addr; \ - ogs_assert(addr); \ - ogs_warn("NF EndPoint updated [%s:%d]", \ - OGS_ADDR(addr, buf), OGS_PORT(addr)); \ + if (client->fqdn) { \ + ogs_warn("NF EndPoint(fqdn) updated [%s:%d]", \ + client->fqdn, client->fqdn_port); \ + } \ + if (client->addr) { \ + ogs_warn("NF EndPoint(addr) updated [%s:%d]", \ + OGS_ADDR(client->addr, buf), OGS_PORT(client->addr)); \ + } \ + if (client->addr6) { \ + ogs_warn("NF EndPoint(addr6) updated [%s:%d]", \ + OGS_ADDR(client->addr6, buf), OGS_PORT(client->addr6)); \ + } \ ogs_sbi_client_remove(client); \ } \ \ OGS_OBJECT_REF(__pClient); \ ((__cTX)->client) = (__pClient); \ - ogs_debug("[%d] CLIENT Ref [%s:%d]", \ - (__pClient)->reference_count, \ - OGS_ADDR((__pClient)->node.addr, buf), \ - OGS_PORT((__pClient)->node.addr)); \ + ogs_debug("CLIENT Ref [%d]", (__pClient)->reference_count); \ } while(0) typedef int (*ogs_sbi_client_cb_f)( int status, ogs_sbi_response_t *response, void *data); typedef struct ogs_sbi_client_s { - ogs_socknode_t node; + ogs_lnode_t lnode; + OpenAPI_uri_scheme_e scheme; + bool insecure_skip_verify; + char *cacert, *private_key, *cert; + + char *fqdn; + uint16_t fqdn_port; + ogs_sockaddr_t *addr; + ogs_sockaddr_t *addr6; + + char *resolve; ogs_timer_t *t_curl; /* timer for CURL */ ogs_list_t connection_list; /* CURL connection list */ @@ -77,11 +91,15 @@ void ogs_sbi_client_init(int num_of_sockinfo_pool, int num_of_connection_pool); void ogs_sbi_client_final(void); ogs_sbi_client_t *ogs_sbi_client_add( - OpenAPI_uri_scheme_e scheme, ogs_sockaddr_t *addr); + OpenAPI_uri_scheme_e scheme, + char *fqdn, uint16_t fqdn_port, + ogs_sockaddr_t *addr, ogs_sockaddr_t *addr6); void ogs_sbi_client_remove(ogs_sbi_client_t *client); void ogs_sbi_client_remove_all(void); ogs_sbi_client_t *ogs_sbi_client_find( - OpenAPI_uri_scheme_e scheme, ogs_sockaddr_t *addr); + OpenAPI_uri_scheme_e scheme, + char *fqdn, uint16_t fqdn_port, + ogs_sockaddr_t *addr, ogs_sockaddr_t *addr6); void ogs_sbi_client_stop(ogs_sbi_client_t *client); void ogs_sbi_client_stop_all(void); @@ -89,7 +107,7 @@ void ogs_sbi_client_stop_all(void); bool ogs_sbi_client_send_request( ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb, ogs_sbi_request_t *request, void *data); -bool ogs_sbi_client_send_via_scp( +bool ogs_sbi_client_send_via_scp_or_sepp( ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb, ogs_sbi_request_t *request, void *data); diff --git a/lib/sbi/context.c b/lib/sbi/context.c index 054f86e62..d8f8ad6f2 100644 --- a/lib/sbi/context.c +++ b/lib/sbi/context.c @@ -81,9 +81,11 @@ void ogs_sbi_context_init(OpenAPI_nf_type_e nf_type) } /* Add SCP NF-Instance */ - self.scp_instance = ogs_sbi_nf_instance_add(); - ogs_assert(self.scp_instance); - ogs_sbi_nf_instance_set_type(self.scp_instance, OpenAPI_nf_type_SCP); + if (nf_type != OpenAPI_nf_type_NRF) { + self.scp_instance = ogs_sbi_nf_instance_add(); + ogs_assert(self.scp_instance); + ogs_sbi_nf_instance_set_type(self.scp_instance, OpenAPI_nf_type_SCP); + } context_initialized = 1; } @@ -126,6 +128,9 @@ static int ogs_sbi_context_prepare(void) self.content_encoding = "gzip"; #endif + self.tls.server.scheme = OpenAPI_uri_scheme_http; + self.tls.client.scheme = OpenAPI_uri_scheme_http; + return OGS_OK; } @@ -133,9 +138,8 @@ static int ogs_sbi_context_validation( const char *local, const char *nrf, const char *scp) { /* If SMF is only used in 4G EPC, no SBI interface is required. */ - if (local && strcmp(local, "smf") != 0 && - ogs_list_first(&self.server_list) == NULL) { - ogs_error("No %s.sbi: in '%s'", local, ogs_app()->file); + if (local && strcmp(local, "smf") != 0 && ogs_sbi_server_first() == NULL) { + ogs_error("No %s.sbi.address: in '%s'", local, ogs_app()->file); return OGS_ERROR; } @@ -179,24 +183,20 @@ static int ogs_sbi_context_validation( ogs_assert_if_reached(); } - if (ogs_app()->sbi.server.no_tls == false) { - if (!ogs_app()->sbi.server.key) { - ogs_error("TLS enabled but no server key"); + if (ogs_sbi_self()->tls.server.scheme == OpenAPI_uri_scheme_https) { + if (!ogs_sbi_self()->tls.server.private_key) { + ogs_error("HTTPS scheme enabled but no server key"); return OGS_ERROR; } - if (!ogs_app()->sbi.server.cert) { - ogs_error("TLS enabled but no server certificate"); + if (!ogs_sbi_self()->tls.server.cert) { + ogs_error("HTTPS scheme enabled but no server certificate"); return OGS_ERROR; } } - if (ogs_app()->sbi.client.no_tls == false) { - if (!ogs_app()->sbi.client.key) { - ogs_error("TLS enabled but no client key"); - return OGS_ERROR; - } - if (!ogs_app()->sbi.client.cert) { - ogs_error("TLS enabled but no client certificate"); + if (ogs_sbi_self()->tls.server.verify_client) { + if (!ogs_sbi_self()->tls.server.verify_client_cacert) { + ogs_error("CLIENT verification enabled but no CA certificate"); return OGS_ERROR; } } @@ -227,197 +227,256 @@ int ogs_sbi_context_parse_config( while (ogs_yaml_iter_next(&local_iter)) { const char *local_key = ogs_yaml_iter_key(&local_iter); ogs_assert(local_key); - if (!strcmp(local_key, "sbi")) { - ogs_list_t list, list6; - ogs_socknode_t *node = NULL, *node6 = NULL; - - ogs_yaml_iter_t sbi_array, sbi_iter; - ogs_yaml_iter_recurse(&local_iter, &sbi_array); - do { - int i, family = AF_UNSPEC; - int num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - int num_of_advertise = 0; - const char *advertise[OGS_MAX_NUM_OF_HOSTNAME]; - - uint16_t port = ogs_sbi_server_default_port(); - const char *dev = NULL; - ogs_sockaddr_t *addr = NULL; - - ogs_sockopt_t option; - bool is_option = false; - - if (ogs_yaml_iter_type(&sbi_array) == - YAML_MAPPING_NODE) { - memcpy(&sbi_iter, &sbi_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(&sbi_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&sbi_array)) - break; - ogs_yaml_iter_recurse(&sbi_array, &sbi_iter); - } else if (ogs_yaml_iter_type(&sbi_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); - - while (ogs_yaml_iter_next(&sbi_iter)) { - const char *sbi_key = - ogs_yaml_iter_key(&sbi_iter); - ogs_assert(sbi_key); - if (!strcmp(sbi_key, "family")) { - const char *v = ogs_yaml_iter_value(&sbi_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; + if (!strcmp(local_key, "default")) { + ogs_yaml_iter_t default_iter; + ogs_yaml_iter_recurse(&local_iter, &default_iter); + while (ogs_yaml_iter_next(&default_iter)) { + const char *default_key = + ogs_yaml_iter_key(&default_iter); + ogs_assert(default_key); + if (!strcmp(default_key, "tls")) { + ogs_yaml_iter_t tls_iter; + ogs_yaml_iter_recurse(&default_iter, &tls_iter); + while (ogs_yaml_iter_next(&tls_iter)) { + const char *tls_key = + ogs_yaml_iter_key(&tls_iter); + ogs_assert(tls_key); + if (!strcmp(tls_key, "server")) { + ogs_yaml_iter_t server_iter; + ogs_yaml_iter_recurse( + &tls_iter, &server_iter); + while (ogs_yaml_iter_next(&server_iter)) { + const char *server_key = + ogs_yaml_iter_key(&server_iter); + ogs_assert(server_key); + if (!strcmp(server_key, "scheme")) { + const char *v = ogs_yaml_iter_value( + &server_iter); + if (v) { + if (!ogs_strcasecmp( + v, "https")) + self.tls.server.scheme = + OpenAPI_uri_scheme_https; + else if (!ogs_strcasecmp( + v, "http")) + self.tls.server.scheme = + OpenAPI_uri_scheme_http; + else + ogs_warn( + "unknown scheme `%s`", + v); + } + } else if (!strcmp(server_key, + "private_key")) { + self.tls.server.private_key = + ogs_yaml_iter_value( + &server_iter); + } else if (!strcmp(server_key, + "cert")) { + self.tls.server.cert = + ogs_yaml_iter_value( + &server_iter); + } else if (!strcmp(server_key, + "verify_client")) { + self.tls.server.verify_client = + ogs_yaml_iter_bool( + &server_iter); + } else if (!strcmp(server_key, + "verify_client_cacert")) { + self.tls.server. + verify_client_cacert = + ogs_yaml_iter_value( + &server_iter); + } + } + } else if (!strcmp(tls_key, "client")) { + ogs_yaml_iter_t client_iter; + ogs_yaml_iter_recurse( + &tls_iter, &client_iter); + while (ogs_yaml_iter_next(&client_iter)) { + const char *client_key = + ogs_yaml_iter_key(&client_iter); + ogs_assert(client_key); + if (!strcmp(client_key, "scheme")) { + const char *v = ogs_yaml_iter_value( + &client_iter); + if (v) { + if (!ogs_strcasecmp( + v, "https")) + self.tls.client.scheme = + OpenAPI_uri_scheme_https; + else if (!ogs_strcasecmp( + v, "http")) + self.tls.client.scheme = + OpenAPI_uri_scheme_http; + else + ogs_warn( + "unknown scheme `%s`", + v); + } + } else if (!strcmp(client_key, + "insecure_skip_verify")) { + self.tls.client. + insecure_skip_verify = + ogs_yaml_iter_bool( + &client_iter); + } else if (!strcmp(client_key, + "cacert")) { + self.tls.client.cacert = + ogs_yaml_iter_value( + &client_iter); + } else if (!strcmp(client_key, + "client_private_key")) { + self.tls.client.private_key = + ogs_yaml_iter_value( + &client_iter); + } else if (!strcmp(client_key, + "client_cert")) { + self.tls.client.cert = + ogs_yaml_iter_value( + &client_iter); + } + } } - } else if (!strcmp(sbi_key, "addr") || - !strcmp(sbi_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse(&sbi_iter, - &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); + } + } + } + } + } + } + } - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next( - &hostname_iter)) - break; - } + ogs_yaml_iter_init(&root_iter, document); + while (ogs_yaml_iter_next(&root_iter)) { + const char *root_key = ogs_yaml_iter_key(&root_iter); + ogs_assert(root_key); + if (local && !strcmp(root_key, local)) { + ogs_yaml_iter_t local_iter; + ogs_yaml_iter_recurse(&root_iter, &local_iter); + while (ogs_yaml_iter_next(&local_iter)) { + const char *local_key = ogs_yaml_iter_key(&local_iter); + ogs_assert(local_key); + if (!strcmp(local_key, "sbi")) { + ogs_yaml_iter_t sbi_iter; + ogs_yaml_iter_recurse(&local_iter, &sbi_iter); + while (ogs_yaml_iter_next(&sbi_iter)) { + const char *sbi_key = ogs_yaml_iter_key(&sbi_iter); + ogs_assert(sbi_key); + if (!strcmp(sbi_key, "server")) { + rv = ogs_sbi_context_parse_server_config( + &sbi_iter, NULL); + if (rv != OGS_OK) { + ogs_error("ogs_sbi_context_parse_server_" + "config() failed"); + return rv; + } + } else if (!strcmp(sbi_key, "client")) { + ogs_yaml_iter_t client_iter; + ogs_yaml_iter_recurse(&sbi_iter, &client_iter); + while (ogs_yaml_iter_next(&client_iter)) { + const char *client_key = + ogs_yaml_iter_key(&client_iter); + ogs_assert(client_key); + if (ogs_global_conf()-> + parameter.no_nrf == false && + nrf && !strcmp(client_key, nrf)) { + ogs_yaml_iter_t nrf_array, nrf_iter; + ogs_yaml_iter_recurse(&client_iter, + &nrf_array); + do { + ogs_sbi_client_t *client = NULL; - ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME); - hostname[num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(sbi_key, "advertise")) { - ogs_yaml_iter_t advertise_iter; - ogs_yaml_iter_recurse(&sbi_iter, - &advertise_iter); - ogs_assert(ogs_yaml_iter_type( - &advertise_iter) != YAML_MAPPING_NODE); - - do { - if (ogs_yaml_iter_type(&advertise_iter) == + if (ogs_yaml_iter_type(&nrf_array) == + YAML_MAPPING_NODE) { + memcpy(&nrf_iter, &nrf_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type( + &nrf_array) == YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next( - &advertise_iter)) + if (!ogs_yaml_iter_next(&nrf_array)) + break; + ogs_yaml_iter_recurse( + &nrf_array, &nrf_iter); + } else if (ogs_yaml_iter_type( + &nrf_array) == + YAML_SCALAR_NODE) { break; - } + } else + ogs_assert_if_reached(); - ogs_assert(num_of_advertise < - OGS_MAX_NUM_OF_HOSTNAME); - advertise[num_of_advertise++] = - ogs_yaml_iter_value(&advertise_iter); - } while ( - ogs_yaml_iter_type(&advertise_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(sbi_key, "port")) { - const char *v = ogs_yaml_iter_value(&sbi_iter); - if (v) - port = atoi(v); - } else if (!strcmp(sbi_key, "dev")) { - dev = ogs_yaml_iter_value(&sbi_iter); - } else if (!strcmp(sbi_key, "option")) { - rv = ogs_app_config_parse_sockopt( - &sbi_iter, &option); - if (rv != OGS_OK) return rv; - is_option = true; - } else - ogs_warn("unknown key `%s`", sbi_key); - } + if (NF_INSTANCE_CLIENT( + self.nrf_instance)) { + ogs_error("Only one NRF client " + "can be set"); + return OGS_ERROR; + } - addr = NULL; - for (i = 0; i < num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } + client = + ogs_sbi_context_parse_client_config( + &nrf_iter); + if (!client) { + ogs_error("ogs_sbi_context_parse_" + "client_config() failed"); + return OGS_ERROR; + } - ogs_list_init(&list); - ogs_list_init(&list6); + OGS_SBI_SETUP_CLIENT( + self.nrf_instance, client); - if (addr) { - if (ogs_app()->parameter.no_ipv4 == 0) - ogs_socknode_add( - &list, AF_INET, addr, NULL); - if (ogs_app()->parameter.no_ipv6 == 0) - ogs_socknode_add( - &list6, AF_INET6, addr, NULL); - ogs_freeaddrinfo(addr); - } + } while (ogs_yaml_iter_type(&nrf_array) == + YAML_SEQUENCE_NODE); + } else if (ogs_global_conf()-> + parameter.no_scp == false && + scp && !strcmp(client_key, scp)) { + ogs_yaml_iter_t scp_array, scp_iter; + ogs_yaml_iter_recurse( + &client_iter, &scp_array); + do { + ogs_sbi_client_t *client = NULL; - if (dev) { - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? NULL : &list, - ogs_app()->parameter.no_ipv6 ? NULL : &list6, - dev, port, NULL); - ogs_assert(rv == OGS_OK); - } + if (ogs_yaml_iter_type(&scp_array) == + YAML_MAPPING_NODE) { + memcpy(&scp_iter, &scp_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type( + &scp_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&scp_array)) + break; + ogs_yaml_iter_recurse( + &scp_array, &scp_iter); + } else if (ogs_yaml_iter_type( + &scp_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); - addr = NULL; - for (i = 0; i < num_of_advertise; i++) { - rv = ogs_addaddrinfo(&addr, - family, advertise[i], port, 0); - ogs_assert(rv == OGS_OK); - } + if (NF_INSTANCE_CLIENT( + self.scp_instance)) { + ogs_error("Only one SCP client " + "can be set"); + return OGS_ERROR; + } - node = ogs_list_first(&list); - if (node) { - ogs_sbi_server_t *server = ogs_sbi_server_add( - node->addr, is_option ? &option : NULL); - ogs_assert(server); + client = + ogs_sbi_context_parse_client_config( + &scp_iter); + if (!client) { + ogs_error("ogs_sbi_context_parse_" + "client_config() failed"); + return OGS_ERROR; + } - if (addr && ogs_app()->parameter.no_ipv4 == 0) - ogs_sbi_server_set_advertise( - server, AF_INET, addr); - } - node6 = ogs_list_first(&list6); - if (node6) { - ogs_sbi_server_t *server = ogs_sbi_server_add( - node6->addr, is_option ? &option : NULL); - ogs_assert(server); + OGS_SBI_SETUP_CLIENT( + self.scp_instance, client); - if (addr && ogs_app()->parameter.no_ipv6 == 0) - ogs_sbi_server_set_advertise( - server, AF_INET6, addr); - } - - if (addr) - ogs_freeaddrinfo(addr); - - ogs_socknode_remove_all(&list); - ogs_socknode_remove_all(&list6); - - } while (ogs_yaml_iter_type(&sbi_array) == - YAML_SEQUENCE_NODE); - - if (ogs_list_first(&self.server_list) == 0) { - ogs_list_init(&list); - ogs_list_init(&list6); - - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? NULL : &list, - ogs_app()->parameter.no_ipv6 ? NULL : &list6, - NULL, ogs_sbi_server_default_port(), NULL); - ogs_assert(rv == OGS_OK); - - node = ogs_list_first(&list); - if (node) ogs_sbi_server_add(node->addr, NULL); - node6 = ogs_list_first(&list6); - if (node6) ogs_sbi_server_add(node6->addr, NULL); - - ogs_socknode_remove_all(&list); - ogs_socknode_remove_all(&list6); + } while (ogs_yaml_iter_type(&scp_array) == + YAML_SEQUENCE_NODE); + } + } + } else + ogs_warn("unknown key `%s`", sbi_key); } } else if (!strcmp(local_key, "service_name")) { ogs_yaml_iter_t service_name_iter; @@ -489,213 +548,6 @@ int ogs_sbi_context_parse_config( } } } - } else if (nrf && !strcmp(root_key, nrf)) { - ogs_yaml_iter_t nrf_iter; - ogs_yaml_iter_recurse(&root_iter, &nrf_iter); - while (ogs_yaml_iter_next(&nrf_iter)) { - const char *nrf_key = ogs_yaml_iter_key(&nrf_iter); - ogs_assert(nrf_key); - if (!strcmp(nrf_key, "sbi")) { - ogs_yaml_iter_t sbi_array, sbi_iter; - ogs_yaml_iter_recurse(&nrf_iter, &sbi_array); - do { - ogs_sbi_client_t *client = NULL; - ogs_sockaddr_t *addr = NULL; - int family = AF_UNSPEC; - int i, num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = ogs_sbi_client_default_port(); - - if (ogs_yaml_iter_type(&sbi_array) == - YAML_MAPPING_NODE) { - memcpy(&sbi_iter, &sbi_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(&sbi_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&sbi_array)) - break; - ogs_yaml_iter_recurse(&sbi_array, &sbi_iter); - } else if (ogs_yaml_iter_type(&sbi_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); - - while (ogs_yaml_iter_next(&sbi_iter)) { - const char *sbi_key = - ogs_yaml_iter_key(&sbi_iter); - ogs_assert(sbi_key); - if (!strcmp(sbi_key, "family")) { - const char *v = ogs_yaml_iter_value(&sbi_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; - } - } else if (!strcmp(sbi_key, "addr") || - !strcmp(sbi_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse(&sbi_iter, - &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&hostname_iter)) - break; - } - - ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME); - hostname[num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(sbi_key, "port")) { - const char *v = ogs_yaml_iter_value(&sbi_iter); - if (v) port = atoi(v); - } else if (!strcmp(sbi_key, "advertise")) { - /* Nothing in client */ - } else - ogs_warn("unknown key `%s`", sbi_key); - } - - addr = NULL; - for (i = 0; i < num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } - - ogs_filter_ip_version(&addr, - ogs_app()->parameter.no_ipv4, - ogs_app()->parameter.no_ipv6, - ogs_app()->parameter.prefer_ipv4); - - if (addr == NULL) continue; - - ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); - client = ogs_sbi_client_add( - ogs_sbi_client_default_scheme(), addr); - ogs_assert(client); - OGS_SBI_SETUP_CLIENT(self.nrf_instance, client); - - ogs_freeaddrinfo(addr); - - } while (ogs_yaml_iter_type(&sbi_array) == - YAML_SEQUENCE_NODE); - } - } - } else if (ogs_app()->parameter.no_scp == false && - scp && !strcmp(root_key, scp)) { - ogs_yaml_iter_t scp_iter; - ogs_yaml_iter_recurse(&root_iter, &scp_iter); - while (ogs_yaml_iter_next(&scp_iter)) { - const char *scp_key = ogs_yaml_iter_key(&scp_iter); - ogs_assert(scp_key); - if (!strcmp(scp_key, "sbi")) { - ogs_yaml_iter_t sbi_array, sbi_iter; - ogs_yaml_iter_recurse(&scp_iter, &sbi_array); - do { - ogs_sbi_client_t *client = NULL; - ogs_sockaddr_t *addr = NULL; - int family = AF_UNSPEC; - int i, num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = ogs_sbi_client_default_port(); - - if (ogs_yaml_iter_type(&sbi_array) == - YAML_MAPPING_NODE) { - memcpy(&sbi_iter, &sbi_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(&sbi_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&sbi_array)) - break; - ogs_yaml_iter_recurse(&sbi_array, &sbi_iter); - } else if (ogs_yaml_iter_type(&sbi_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); - - while (ogs_yaml_iter_next(&sbi_iter)) { - const char *sbi_key = - ogs_yaml_iter_key(&sbi_iter); - ogs_assert(sbi_key); - if (!strcmp(sbi_key, "family")) { - const char *v = ogs_yaml_iter_value(&sbi_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; - } - } else if (!strcmp(sbi_key, "addr") || - !strcmp(sbi_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse(&sbi_iter, - &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&hostname_iter)) - break; - } - - ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME); - hostname[num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(sbi_key, "port")) { - const char *v = ogs_yaml_iter_value(&sbi_iter); - if (v) port = atoi(v); - } else if (!strcmp(sbi_key, "advertise")) { - /* Nothing in client */ - } else - ogs_warn("unknown key `%s`", sbi_key); - } - - addr = NULL; - for (i = 0; i < num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } - - ogs_filter_ip_version(&addr, - ogs_app()->parameter.no_ipv4, - ogs_app()->parameter.no_ipv6, - ogs_app()->parameter.prefer_ipv4); - - if (addr == NULL) continue; - - ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); - client = ogs_sbi_client_add( - ogs_sbi_client_default_scheme(), addr); - ogs_assert(client); - OGS_SBI_SETUP_CLIENT(self.scp_instance, client); - - ogs_freeaddrinfo(addr); - - } while (ogs_yaml_iter_type(&sbi_array) == - YAML_SEQUENCE_NODE); - } - } } } @@ -781,6 +633,429 @@ int ogs_sbi_context_parse_hnet_config(ogs_yaml_iter_t *root_iter) return OGS_OK; } +int ogs_sbi_context_parse_server_config( + ogs_yaml_iter_t *parent, const char *interface) +{ + int rv; + ogs_sbi_server_t *server = NULL; + OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; + ogs_list_t list, list6; + ogs_socknode_t *node = NULL, *node6 = NULL; + + ogs_assert(parent); + + ogs_yaml_iter_t server_iter, server_array; + ogs_yaml_iter_recurse(parent, &server_array); + do { + int i, family = AF_UNSPEC; + int num = 0; + const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; + int num_of_advertise = 0; + const char *advertise[OGS_MAX_NUM_OF_HOSTNAME]; + + uint16_t port = 0; + const char *dev = NULL; + ogs_sockaddr_t *addr = NULL; + + const char *private_key = NULL, *cert = NULL; + + bool verify_client = false; + const char *verify_client_cacert = NULL; + + ogs_sockopt_t option; + bool is_option = false; + + if (ogs_yaml_iter_type(&server_array) == YAML_MAPPING_NODE) { + memcpy(&server_iter, &server_array, sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type(&server_array) == YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&server_array)) + break; + ogs_yaml_iter_recurse(&server_array, &server_iter); + } else if (ogs_yaml_iter_type(&server_array) == YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); + + while (ogs_yaml_iter_next(&server_iter)) { + const char *server_key = ogs_yaml_iter_key(&server_iter); + ogs_assert(server_key); + if (!strcmp(server_key, OGS_SBI_INTERFACE_NAME_N32F)) { + rv = ogs_sbi_context_parse_server_config( + &server_iter, server_key); + if (rv != OGS_OK) { + ogs_error("ogs_sbi_context_parse_server_config() " + "failed[key:%s]", server_key); + return rv; + } + } else if (!strcmp(server_key, "family")) { + const char *v = ogs_yaml_iter_value(&server_iter); + if (v) family = atoi(v); + if (family != AF_UNSPEC && family != AF_INET && + family != AF_INET6) { + ogs_warn("Ignore family(%d) : AF_UNSPEC(%d), " + "AF_INET(%d), AF_INET6(%d) ", + family, AF_UNSPEC, AF_INET, AF_INET6); + family = AF_UNSPEC; + } + } else if (!strcmp(server_key, "address")) { + ogs_yaml_iter_t hostname_iter; + ogs_yaml_iter_recurse(&server_iter, &hostname_iter); + ogs_assert(ogs_yaml_iter_type( + &hostname_iter) != YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type( + &hostname_iter) == YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&hostname_iter)) + break; + } + + ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME); + hostname[num++] = ogs_yaml_iter_value(&hostname_iter); + } while (ogs_yaml_iter_type( + &hostname_iter) == YAML_SEQUENCE_NODE); + } else if (!strcmp(server_key, "advertise")) { + ogs_yaml_iter_t advertise_iter; + ogs_yaml_iter_recurse(&server_iter, &advertise_iter); + ogs_assert(ogs_yaml_iter_type( + &advertise_iter) != YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type( + &advertise_iter) == YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&advertise_iter)) + break; + } + + ogs_assert(num_of_advertise < OGS_MAX_NUM_OF_HOSTNAME); + advertise[num_of_advertise++] = + ogs_yaml_iter_value(&advertise_iter); + } while (ogs_yaml_iter_type( + &advertise_iter) == YAML_SEQUENCE_NODE); + } else if (!strcmp(server_key, "port")) { + const char *v = ogs_yaml_iter_value(&server_iter); + if (v) + port = atoi(v); + } else if (!strcmp(server_key, "dev")) { + dev = ogs_yaml_iter_value(&server_iter); + } else if (!strcmp(server_key, "scheme")) { + const char *v = ogs_yaml_iter_value(&server_iter); + if (v) { + if (!ogs_strcasecmp(v, "https")) + scheme = OpenAPI_uri_scheme_https; + else if (!ogs_strcasecmp(v, "http")) + scheme = OpenAPI_uri_scheme_http; + else + ogs_warn("unknown scheme `%s`", v); + } + } else if (!strcmp(server_key, "private_key")) { + private_key = ogs_yaml_iter_value(&server_iter); + } else if (!strcmp(server_key, "cert")) { + cert = ogs_yaml_iter_value(&server_iter); + } else if (!strcmp(server_key, "verify_client")) { + verify_client = ogs_yaml_iter_bool(&server_iter); + } else if (!strcmp(server_key, "verify_client_cacert")) { + verify_client_cacert = ogs_yaml_iter_value(&server_iter); + } else if (!strcmp(server_key, "option")) { + rv = ogs_app_parse_sockopt_config(&server_iter, &option); + if (rv != OGS_OK) { + ogs_error("ogs_app_parse_sockopt_config() failed"); + return rv; + } + is_option = true; + } + } + + if (scheme == OpenAPI_uri_scheme_NULL) + scheme = ogs_sbi_self()->tls.server.scheme; + + if (!port) { + if (scheme == OpenAPI_uri_scheme_https) + port = OGS_SBI_HTTPS_PORT; + else if (scheme == OpenAPI_uri_scheme_http) + port = OGS_SBI_HTTP_PORT; + else + ogs_assert_if_reached(); + } + + addr = NULL; + for (i = 0; i < num; i++) { + rv = ogs_addaddrinfo(&addr, family, hostname[i], port, 0); + ogs_assert(rv == OGS_OK); + } + + ogs_list_init(&list); + ogs_list_init(&list6); + + if (addr) { + if (ogs_global_conf()->parameter.no_ipv4 == 0) + ogs_socknode_add(&list, AF_INET, addr, NULL); + if (ogs_global_conf()->parameter.no_ipv6 == 0) + ogs_socknode_add(&list6, AF_INET6, addr, NULL); + ogs_freeaddrinfo(addr); + } + + if (dev) { + rv = ogs_socknode_probe( + ogs_global_conf()->parameter.no_ipv4 ? NULL : &list, + ogs_global_conf()->parameter.no_ipv6 ? NULL : &list6, + dev, port, NULL); + ogs_assert(rv == OGS_OK); + } + + addr = NULL; + for (i = 0; i < num_of_advertise; i++) { + rv = ogs_addaddrinfo(&addr, family, advertise[i], port, 0); + ogs_assert(rv == OGS_OK); + } + + node = ogs_list_first(&list); + if (node) { + server = ogs_sbi_server_add( + interface, scheme, node->addr, is_option ? &option : NULL); + ogs_assert(server); + + if (addr && ogs_global_conf()->parameter.no_ipv4 == 0) + ogs_sbi_server_set_advertise(server, AF_INET, addr); + + if (verify_client == true) + server->verify_client = true; + + if (verify_client_cacert) { + if (server->verify_client_cacert) + ogs_free(server->verify_client_cacert); + server->verify_client_cacert = ogs_strdup(verify_client_cacert); + ogs_assert(server->verify_client_cacert); + } + + if (server->verify_client == true && + !server->verify_client_cacert) { + ogs_error("CLIENT verification enabled but no CA certificate"); + return OGS_ERROR; + } + + if (private_key) { + if (server->private_key) + ogs_free(server->private_key); + server->private_key = ogs_strdup(private_key); + ogs_assert(server->private_key); + } + if (cert) { + if (server->cert) + ogs_free(server->cert); + server->cert = ogs_strdup(cert); + ogs_assert(server->cert); + } + + if (scheme == OpenAPI_uri_scheme_https) { + if (!server->private_key) { + ogs_error("HTTPS scheme enabled but no server key"); + return OGS_ERROR; + } + if (!server->cert) { + ogs_error("HTTPS scheme enabled but no server certificate"); + return OGS_ERROR; + } + } + } + node6 = ogs_list_first(&list6); + if (node6) { + server = ogs_sbi_server_add( + interface, scheme, node6->addr, is_option ? &option : NULL); + ogs_assert(server); + + if (addr && ogs_global_conf()->parameter.no_ipv6 == 0) + ogs_sbi_server_set_advertise(server, AF_INET6, addr); + + if (verify_client == true) + server->verify_client = true; + + if (verify_client_cacert) { + if (server->verify_client_cacert) + ogs_free(server->verify_client_cacert); + server->verify_client_cacert = ogs_strdup(verify_client_cacert); + ogs_assert(server->verify_client_cacert); + } + + if (server->verify_client == true && + !server->verify_client_cacert) { + ogs_error("CLIENT verification enabled but no CA certificate"); + return OGS_ERROR; + } + + if (private_key) { + if (server->private_key) + ogs_free(server->private_key); + server->private_key = ogs_strdup(private_key); + ogs_assert(server->private_key); + } + if (cert) { + if (server->cert) + ogs_free(server->cert); + server->cert = ogs_strdup(cert); + ogs_assert(server->cert); + } + + if (scheme == OpenAPI_uri_scheme_https) { + if (!server->private_key) { + ogs_error("HTTPS scheme enabled but no server key"); + return OGS_ERROR; + } + if (!server->cert) { + ogs_error("HTTPS scheme enabled but no server certificate"); + return OGS_ERROR; + } + } + } + + if (addr) + ogs_freeaddrinfo(addr); + + ogs_socknode_remove_all(&list); + ogs_socknode_remove_all(&list6); + + } while (ogs_yaml_iter_type(&server_array) == YAML_SEQUENCE_NODE); + + return OGS_OK; +} + +ogs_sbi_client_t *ogs_sbi_context_parse_client_config(ogs_yaml_iter_t *iter) +{ + ogs_sbi_client_t *client = NULL; + const char *uri = NULL; + + int num_of_resolve = 0; + const char *resolve[OGS_MAX_NUM_OF_HOSTNAME]; + + bool insecure_skip_verify = false; + const char *cacert = NULL; + + const char *client_private_key = NULL; + const char *client_cert = NULL; + + bool rc; + + OpenAPI_uri_scheme_e scheme = + OpenAPI_uri_scheme_NULL; + + char *fqdn = NULL; + uint16_t fqdn_port = 0; + ogs_sockaddr_t *addr = NULL; + ogs_sockaddr_t *addr6 = NULL; + + ogs_assert(iter); + + while (ogs_yaml_iter_next(iter)) { + const char *key = ogs_yaml_iter_key(iter); + ogs_assert(key); + if (!strcmp(key, "uri")) { + uri = ogs_yaml_iter_value(iter); + } else if (!strcmp(key, "resolve")) { + ogs_yaml_iter_t resolve_iter; + ogs_yaml_iter_recurse(iter, &resolve_iter); + ogs_assert(ogs_yaml_iter_type(&resolve_iter) != YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type(&resolve_iter) == YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&resolve_iter)) + break; + } + + ogs_assert(num_of_resolve < OGS_MAX_NUM_OF_HOSTNAME); + resolve[num_of_resolve++] = ogs_yaml_iter_value(&resolve_iter); + } while (ogs_yaml_iter_type(&resolve_iter) == YAML_SEQUENCE_NODE); + + } else if (!strcmp(key, "insecure_skip_verify")) { + insecure_skip_verify = ogs_yaml_iter_bool(iter); + } else if (!strcmp(key, "cacert")) { + cacert = ogs_yaml_iter_value(iter); + } else if (!strcmp(key, "client_private_key")) { + client_private_key = ogs_yaml_iter_value(iter); + } else if (!strcmp(key, "client_cert")) { + client_cert = ogs_yaml_iter_value(iter); + } + } + + if (!uri) { + ogs_error("URI[%s] is required", uri ? uri : "NULL"); + return NULL; + } + + rc = ogs_sbi_getaddr_from_uri( + &scheme, &fqdn, &fqdn_port, &addr, &addr6, (char *)uri); + if (rc == false) { + if (!scheme) + ogs_error("Invalid Scheme in URI[%s]", uri); + else + ogs_error("Invalid URI[%s]", uri); + + return NULL; + } + + switch (scheme) { + case OpenAPI_uri_scheme_https: + if (!fqdn) { + ogs_error("HTTPS(TLS) must be set to FQDN [uri:%s]", uri); + + ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); + + return NULL; + } + client = ogs_sbi_client_add(scheme, fqdn, fqdn_port, NULL, NULL); + ogs_assert(client); + break; + case OpenAPI_uri_scheme_http: + client = ogs_sbi_client_add(scheme, fqdn, fqdn_port, addr, addr6); + ogs_assert(client); + break; + default: + ogs_fatal("Invalid Scheme[%d]", scheme); + ogs_assert_if_reached(); + } + + if (num_of_resolve) + client->resolve = ogs_sbi_client_resolve( + scheme, fqdn, fqdn_port, resolve, num_of_resolve); + + if (insecure_skip_verify == true) + client->insecure_skip_verify = true; + + if (cacert) { + if (client->cacert) + ogs_free(client->cacert); + client->cacert = ogs_strdup(cacert); + ogs_assert(client->cacert); + } + + if (client_private_key) { + if (client->private_key) + ogs_free(client->private_key); + client->private_key = ogs_strdup(client_private_key); + ogs_assert(client->private_key); + } + + if (client_cert) { + if (client->cert) + ogs_free(client->cert); + client->cert = ogs_strdup(client_cert); + ogs_assert(client->cert); + } + + if ((!client_private_key && client_cert) || + (client_private_key && !client_cert)) { + ogs_error("Either the private key or certificate is missing."); + ogs_sbi_client_remove(client); + return NULL; + } + + ogs_free(fqdn); + ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); + + return client; +} + bool ogs_sbi_nf_service_is_available(const char *name) { int i; @@ -810,7 +1085,7 @@ ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_add(void) OGS_OBJECT_REF(nf_instance); nf_instance->time.heartbeat_interval = - ogs_app()->time.nf_instance.heartbeat_interval; + ogs_local_conf()->time.nf_instance.heartbeat_interval; nf_instance->priority = OGS_SBI_DEFAULT_PRIORITY; nf_instance->capacity = OGS_SBI_DEFAULT_CAPACITY; @@ -1240,7 +1515,10 @@ ogs_sbi_nf_info_t *ogs_sbi_nf_info_add( ogs_assert(nf_type); ogs_pool_alloc(&nf_info_pool, &nf_info); - ogs_assert(nf_info); + if (!nf_info) { + ogs_fatal("ogs_pool_alloc() failed"); + return NULL; + } memset(nf_info, 0, sizeof(*nf_info)); nf_info->nf_type = nf_type; @@ -1274,9 +1552,20 @@ static void smf_info_free(ogs_sbi_smf_info_t *smf_info) static void scp_info_free(ogs_sbi_scp_info_t *scp_info) { + int i; + for (i = 0; i < scp_info->num_of_domain; i++) { + if (scp_info->domain[i].name) + ogs_free(scp_info->domain[i].name); + if (scp_info->domain[i].fqdn) + ogs_free(scp_info->domain[i].fqdn); + } scp_info->num_of_domain = 0; } +static void sepp_info_free(ogs_sbi_sepp_info_t *sepp_info) +{ +} + void ogs_sbi_nf_info_remove(ogs_list_t *list, ogs_sbi_nf_info_t *nf_info) { ogs_assert(list); @@ -1294,6 +1583,9 @@ void ogs_sbi_nf_info_remove(ogs_list_t *list, ogs_sbi_nf_info_t *nf_info) case OpenAPI_nf_type_SCP: scp_info_free(&nf_info->scp); break; + case OpenAPI_nf_type_SEPP: + sepp_info_free(&nf_info->sepp); + break; default: ogs_fatal("Not implemented NF-type[%s]", OpenAPI_nf_type_ToString(nf_info->nf_type)); @@ -1395,7 +1687,8 @@ void ogs_sbi_nf_instance_build_default(ogs_sbi_nf_instance_t *nf_instance) ogs_sbi_nf_instance_set_status(nf_instance, OpenAPI_nf_status_REGISTERED); hostname = NULL; - ogs_list_for_each(&ogs_sbi_self()->server_list, server) { + for (server = ogs_sbi_server_first(); + server; server = ogs_sbi_server_next(server)) { ogs_sockaddr_t *advertise = NULL; advertise = server->advertise; @@ -1432,7 +1725,13 @@ void ogs_sbi_nf_instance_build_default(ogs_sbi_nf_instance_t *nf_instance) } nf_instance->time.heartbeat_interval = - ogs_app()->time.nf_instance.heartbeat_interval; + ogs_local_conf()->time.nf_instance.heartbeat_interval; + + if (ogs_local_conf()->num_of_serving_plmn_id) { + memcpy(nf_instance->plmn_id, ogs_local_conf()->serving_plmn_id, + sizeof(nf_instance->plmn_id)); + nf_instance->num_of_plmn_id = ogs_local_conf()->num_of_serving_plmn_id; + } } ogs_sbi_nf_service_t *ogs_sbi_nf_service_build_default( @@ -1444,20 +1743,26 @@ ogs_sbi_nf_service_t *ogs_sbi_nf_service_build_default( char id[OGS_UUID_FORMATTED_LENGTH + 1]; char *hostname = NULL; + OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; + ogs_assert(nf_instance); ogs_assert(name); ogs_uuid_get(&uuid); ogs_uuid_format(id, &uuid); - nf_service = ogs_sbi_nf_service_add(nf_instance, id, name, - ogs_app()->sbi.server.no_tls == false ? - OpenAPI_uri_scheme_https : - OpenAPI_uri_scheme_http); + server = ogs_sbi_server_first(); + ogs_assert(server); + + scheme = server->scheme; + ogs_assert(scheme); + + nf_service = ogs_sbi_nf_service_add(nf_instance, id, name, scheme); ogs_assert(nf_service); hostname = NULL; - ogs_list_for_each(&ogs_sbi_self()->server_list, server) { + for (server = ogs_sbi_server_first(); + server; server = ogs_sbi_server_next(server)) { ogs_sockaddr_t *advertise = NULL; advertise = server->advertise; @@ -1509,73 +1814,69 @@ ogs_sbi_nf_service_t *ogs_sbi_nf_service_build_default( return nf_service; } -static ogs_sbi_client_t *find_client_by_fqdn( - OpenAPI_uri_scheme_e scheme, char *fqdn) -{ - int rv; - ogs_sockaddr_t *addr = NULL; - ogs_sbi_client_t *client = NULL; - - ogs_assert(scheme == OpenAPI_uri_scheme_https || - scheme == OpenAPI_uri_scheme_http); - ogs_assert(fqdn); - - rv = ogs_getaddrinfo( - &addr, AF_UNSPEC, fqdn, - scheme == OpenAPI_uri_scheme_https ? - OGS_SBI_HTTPS_PORT : OGS_SBI_HTTP_PORT, - 0); - if (rv != OGS_OK) { - ogs_error("Invalid NFProfile.fqdn"); - return NULL; - } - - client = ogs_sbi_client_find(scheme, addr); - if (!client) { - ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); - client = ogs_sbi_client_add(scheme, addr); - if (!client) { - char buf[OGS_ADDRSTRLEN]; - ogs_error("%s: ogs_sbi_client_add() failed [%s]:%d", - OGS_FUNC, OGS_ADDR(addr, buf), OGS_PORT(addr)); - ogs_freeaddrinfo(addr); - return NULL; - } - } - - ogs_freeaddrinfo(addr); - - return client; -} - static ogs_sbi_client_t *nf_instance_find_client( ogs_sbi_nf_instance_t *nf_instance) { ogs_sbi_client_t *client = NULL; - ogs_sockaddr_t *addr = NULL; + ogs_sockaddr_t *addr = NULL, *addr6 = NULL; OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; - scheme = ogs_sbi_client_default_scheme(); + ogs_sbi_nf_info_t *nf_info = NULL; + uint16_t port = 0; - if (nf_instance->fqdn) - client = find_client_by_fqdn(scheme, nf_instance->fqdn); + scheme = ogs_sbi_self()->tls.client.scheme; + ogs_assert(scheme); - if (!client) { - /* At this point, CLIENT selection method is very simple. */ - if (nf_instance->num_of_ipv4) addr = nf_instance->ipv4[0]; - if (nf_instance->num_of_ipv6) addr = nf_instance->ipv6[0]; + switch (nf_instance->nf_type) { + case OpenAPI_nf_type_SEPP: + nf_info = ogs_sbi_nf_info_find( + &nf_instance->nf_info_list, nf_instance->nf_type); + if (nf_info) { + if (scheme == OpenAPI_uri_scheme_https) + port = nf_info->sepp.https.port; + else if (scheme == OpenAPI_uri_scheme_http) + port = nf_info->sepp.http.port; + else + ogs_error("Unknown scheme [%d]", scheme); + } + break; + case OpenAPI_nf_type_SCP: + nf_info = ogs_sbi_nf_info_find( + &nf_instance->nf_info_list, nf_instance->nf_type); + if (nf_info) { + if (scheme == OpenAPI_uri_scheme_https) + port = nf_info->scp.https.port; + else if (scheme == OpenAPI_uri_scheme_http) + port = nf_info->scp.http.port; + else + ogs_error("Unknown scheme [%d]", scheme); + } + break; + default: + break; + } - if (addr) { - client = ogs_sbi_client_find(scheme, addr); + /* At this point, CLIENT selection method is very simple. */ + if (nf_instance->num_of_ipv4) addr = nf_instance->ipv4[0]; + if (nf_instance->num_of_ipv6) addr6 = nf_instance->ipv6[0]; + + if (port) { + if (addr) + addr->ogs_sin_port = htobe16(port); + if (addr6) + addr6->ogs_sin_port = htobe16(port); + } + + if (nf_instance->fqdn || addr || addr6) { + client = ogs_sbi_client_find( + scheme, nf_instance->fqdn, port, addr, addr6); + if (!client) { + ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); + client = ogs_sbi_client_add( + scheme, nf_instance->fqdn, port, addr, addr6); if (!client) { - ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); - client = ogs_sbi_client_add(scheme, addr); - if (!client) { - char buf[OGS_ADDRSTRLEN]; - ogs_error("%s: ogs_sbi_client_add() failed [%s]:%d", - OGS_FUNC, OGS_ADDR(addr, buf), OGS_PORT(addr)); - return NULL; - } + ogs_error("%s: ogs_sbi_client_add() failed", OGS_FUNC); + return NULL; } } } @@ -1586,31 +1887,26 @@ static ogs_sbi_client_t *nf_instance_find_client( static void nf_service_associate_client(ogs_sbi_nf_service_t *nf_service) { ogs_sbi_client_t *client = NULL; - ogs_sockaddr_t *addr = NULL; + ogs_sockaddr_t *addr = NULL, *addr6 = NULL; ogs_assert(nf_service->scheme); - if (nf_service->fqdn) - client = find_client_by_fqdn(nf_service->scheme, nf_service->fqdn); + /* At this point, CLIENT selection method is very simple. */ + if (nf_service->num_of_addr) { + addr = nf_service->addr[0].ipv4; + addr6 = nf_service->addr[0].ipv6; + } - if (!client) { - /* At this point, CLIENT selection method is very simple. */ - if (nf_service->num_of_addr) { - addr = nf_service->addr[0].ipv6; - if (!addr) - addr = nf_service->addr[0].ipv4; - } - - if (addr) { - client = ogs_sbi_client_find(nf_service->scheme, addr); + if (nf_service->fqdn || addr || addr6) { + client = ogs_sbi_client_find( + nf_service->scheme, nf_service->fqdn, 0, addr, addr6); + if (!client) { + ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); + client = ogs_sbi_client_add( + nf_service->scheme, nf_service->fqdn, 0, addr, addr6); if (!client) { - ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); - client = ogs_sbi_client_add(nf_service->scheme, addr); - if (!client) { - char buf[OGS_ADDRSTRLEN]; - ogs_error("%s: ogs_sbi_client_add() failed [%s]:%d", - OGS_FUNC, OGS_ADDR(addr, buf), OGS_PORT(addr)); - } + ogs_error("%s: ogs_sbi_client_add() failed", OGS_FUNC); + return; } } } @@ -1649,27 +1945,15 @@ bool ogs_sbi_discovery_option_is_matched( } if (discovery_option->num_of_service_names) { - ogs_sbi_nf_service_t *nf_service = NULL; + if (ogs_sbi_discovery_option_service_names_is_matched( + nf_instance, requester_nf_type, discovery_option) == false) + return false; + } - bool exist = false; - int i; - - ogs_list_for_each(&nf_instance->nf_service_list, nf_service) { - for (i = 0; i < discovery_option->num_of_service_names; i++) { - if (nf_service->name && - discovery_option->service_names[i] && - strcmp(nf_service->name, - discovery_option->service_names[i]) == 0) { - if (ogs_sbi_nf_service_is_allowed_nf_type( - nf_service, requester_nf_type) == true) { - exist = true; - break; - } - } - } - if (exist == true) break; - } - if (exist == false) return false; + if (discovery_option->num_of_target_plmn_list) { + if (ogs_sbi_discovery_option_target_plmn_list_is_matched( + nf_instance, discovery_option) == false) + return false; } ogs_list_for_each(&nf_instance->nf_info_list, nf_info) { @@ -1699,6 +1983,104 @@ bool ogs_sbi_discovery_option_is_matched( return true; } +bool ogs_sbi_discovery_option_service_names_is_matched( + ogs_sbi_nf_instance_t *nf_instance, + OpenAPI_nf_type_e requester_nf_type, + ogs_sbi_discovery_option_t *discovery_option) +{ + ogs_sbi_nf_service_t *nf_service = NULL; + int i; + + ogs_assert(nf_instance); + ogs_assert(requester_nf_type); + ogs_assert(discovery_option); + + ogs_list_for_each(&nf_instance->nf_service_list, nf_service) { + for (i = 0; i < discovery_option->num_of_service_names; i++) { + if (nf_service->name && + discovery_option->service_names[i] && + strcmp(nf_service->name, + discovery_option->service_names[i]) == 0) { + if (ogs_sbi_nf_service_is_allowed_nf_type( + nf_service, requester_nf_type) == true) { + return true; + } + } + } + } + return false; +} + +bool ogs_sbi_discovery_param_serving_plmn_list_is_matched( + ogs_sbi_nf_instance_t *nf_instance) +{ + int i, j; + + ogs_assert(nf_instance); + + /* + * The PLMN-ID is optional and may not be set. + * + * Does not compare if serving PLMN-ID is not set or NF-Instance is not set. + */ + if (ogs_local_conf()->num_of_serving_plmn_id == 0 || + nf_instance->num_of_plmn_id == 0) + return true; + + for (i = 0; i < nf_instance->num_of_plmn_id; i++) { + for (j = 0; j < ogs_local_conf()->num_of_serving_plmn_id; j++) { + if (memcmp(&nf_instance->plmn_id[i], + &ogs_local_conf()->serving_plmn_id[j], + OGS_PLMN_ID_LEN) == 0) { + return true; + } + } + } + return false; +} + +bool ogs_sbi_discovery_option_requester_plmn_list_is_matched( + ogs_sbi_nf_instance_t *nf_instance, + ogs_sbi_discovery_option_t *discovery_option) +{ + int i, j; + + ogs_assert(nf_instance); + ogs_assert(discovery_option); + + for (i = 0; i < nf_instance->num_of_plmn_id; i++) { + for (j = 0; j < discovery_option->num_of_requester_plmn_list; j++) { + if (memcmp(&nf_instance->plmn_id[i], + &discovery_option->requester_plmn_list[j], + OGS_PLMN_ID_LEN) == 0) { + return true; + } + } + } + return false; +} + +bool ogs_sbi_discovery_option_target_plmn_list_is_matched( + ogs_sbi_nf_instance_t *nf_instance, + ogs_sbi_discovery_option_t *discovery_option) +{ + int i, j; + + ogs_assert(nf_instance); + ogs_assert(discovery_option); + + for (i = 0; i < nf_instance->num_of_plmn_id; i++) { + for (j = 0; j < discovery_option->num_of_target_plmn_list; j++) { + if (memcmp(&nf_instance->plmn_id[i], + &discovery_option->target_plmn_list[j], + OGS_PLMN_ID_LEN) == 0) { + return true; + } + } + } + return false; +} + bool ogs_sbi_discovery_param_is_matched( ogs_sbi_nf_instance_t *nf_instance, OpenAPI_nf_type_e target_nf_type, @@ -1718,10 +2100,59 @@ bool ogs_sbi_discovery_param_is_matched( if (nf_instance->nf_type != target_nf_type) return false; - if (discovery_option && - ogs_sbi_discovery_option_is_matched( + /* + * For the same PLMN, The target-plmn-list may not be included + * in discovery request. + * + * If the Serving PLMN needs to be discovered, but the target-plmn-list + * is not included, the NF of the Home PLMN can be discovered. + * + * To avoid this situation, if the target-plmn-list is not included + * and the serving PLMN is known, it is compared first. + * + * Refer to the following standard for this issue. + * + * TS29.510 + * 6.2 Nnrf_NFDiscovery Service API + * 6.2.3 Resources + * Table 6.2.3.2.3.1-1: URI query parameters supported + * by the GET method on this resource + * + * NAME: target-plmn-list + * Data type: array(PlmnId) + * P: C + * Cardinality: 1..N + * + * This IE shall be included when NF services in a different PLMN, + * or NF services of specific PLMN ID(s) in a same PLMN + * comprising multiple PLMN IDs, need to be discovered. + * When included, this IE shall contain the PLMN ID of the target NF. + * If more than one PLMN ID is included, NFs from any PLMN ID present + * in the list matches the query parameter. This IE shall also + * be included in SNPN scenarios, when the entity owning + * the subscription, the Credentials Holder + * (see clause 5.30.2.9 in 3GPP TS 23.501 [2]) is a PLMN. + * + * For inter-PLMN service discovery, at most 1 PLMN ID shall + * be included in the list; it shall be included + * in the service discovery from the NF in the source PLMN sent + * to the NRF in the same PLMN, while it may be absent + * in the service discovery request sent from the source NRF + * to the target NRF. In such case, if the NRF receives more than + * 1 PLMN ID, it shall only consider the first element of the array, + * and ignore the rest. + */ + if (!discovery_option || !discovery_option->num_of_target_plmn_list) { + if (ogs_sbi_discovery_param_serving_plmn_list_is_matched( + nf_instance) == false) + return false; + } + + if (discovery_option) { + if (ogs_sbi_discovery_option_is_matched( nf_instance, requester_nf_type, discovery_option) == false) return false; + } return true; } @@ -1745,27 +2176,12 @@ void ogs_sbi_client_associate(ogs_sbi_nf_instance_t *nf_instance) nf_service_associate_client_all(nf_instance); } -OpenAPI_uri_scheme_e ogs_sbi_server_default_scheme(void) +int ogs_sbi_default_client_port(OpenAPI_uri_scheme_e scheme) { - return ogs_app()->sbi.server.no_tls == false ? - OpenAPI_uri_scheme_https : OpenAPI_uri_scheme_http; -} + if (scheme == OpenAPI_uri_scheme_NULL) + scheme = ogs_sbi_self()->tls.client.scheme; -OpenAPI_uri_scheme_e ogs_sbi_client_default_scheme(void) -{ - return ogs_app()->sbi.client.no_tls == false ? - OpenAPI_uri_scheme_https : OpenAPI_uri_scheme_http; -} - -int ogs_sbi_server_default_port(void) -{ - return ogs_app()->sbi.server.no_tls == false ? - OGS_SBI_HTTPS_PORT : OGS_SBI_HTTP_PORT; -} - -int ogs_sbi_client_default_port(void) -{ - return ogs_app()->sbi.client.no_tls == false ? + return scheme == OpenAPI_uri_scheme_https ? OGS_SBI_HTTPS_PORT : OGS_SBI_HTTP_PORT; } @@ -1891,7 +2307,7 @@ ogs_sbi_xact_t *ogs_sbi_xact_add( } ogs_timer_start(xact->t_response, - ogs_app()->time.message.sbi.client_wait_duration); + ogs_local_conf()->time.message.sbi.client_wait_duration); if (build) { xact->request = (*build)(context, data); @@ -1957,6 +2373,9 @@ void ogs_sbi_xact_remove(ogs_sbi_xact_t *xact) if (xact->request) ogs_sbi_request_free(xact->request); + if (xact->target_apiroot) + ogs_free(xact->target_apiroot); + ogs_list_remove(&sbi_object->xact_list, xact); ogs_pool_free(&xact_pool, xact); } @@ -2122,3 +2541,99 @@ ogs_sbi_subscription_data_t *ogs_sbi_subscription_data_find(char *id) return subscription_data; } + +bool ogs_sbi_supi_in_vplmn(char *supi) +{ + char imsi_bcd[OGS_MAX_IMSI_BCD_LEN+1]; + bool home_network = false; + int i; + + ogs_assert(supi); + + if (ogs_local_conf()->num_of_serving_plmn_id == 0) { + return false; + } + + ogs_extract_digit_from_string(imsi_bcd, supi); + + for (i = 0; i < ogs_local_conf()->num_of_serving_plmn_id; i++) { + char buf[OGS_PLMNIDSTRLEN]; + ogs_plmn_id_to_string(&ogs_local_conf()->serving_plmn_id[i], buf); + + if (strncmp(imsi_bcd, buf, strlen(buf)) == 0) { + home_network = true; + break; + } + } + + if (home_network == false) + return true; + + return false; +} + +bool ogs_sbi_plmn_id_in_vplmn(ogs_plmn_id_t *plmn_id) +{ + bool home_network = false; + int i; + + ogs_assert(plmn_id); + + if (ogs_local_conf()->num_of_serving_plmn_id == 0) { + return false; + } + + if (ogs_plmn_id_mcc(plmn_id) == 0) { + ogs_error("No MCC"); + return false; + } + + if (ogs_plmn_id_mnc(plmn_id) == 0) { + ogs_error("No MNC"); + return false; + } + + for (i = 0; i < ogs_local_conf()->num_of_serving_plmn_id; i++) { + if (memcmp(&ogs_local_conf()->serving_plmn_id[i], + plmn_id, OGS_PLMN_ID_LEN) == 0) { + home_network = true; + break; + } + } + + if (home_network == false) + return true; + + return false; +} + +bool ogs_sbi_fqdn_in_vplmn(char *fqdn) +{ + bool home_network = false; + int i; + + ogs_assert(fqdn); + + if (ogs_local_conf()->num_of_serving_plmn_id == 0) { + return false; + } + + if (ogs_home_network_domain_from_fqdn(fqdn) == NULL) { + return false; + } + + for (i = 0; i < ogs_local_conf()->num_of_serving_plmn_id; i++) { + if (ogs_plmn_id_mcc_from_fqdn(fqdn) == + ogs_plmn_id_mcc(&ogs_local_conf()->serving_plmn_id[i]) && + ogs_plmn_id_mnc_from_fqdn(fqdn) == + ogs_plmn_id_mnc(&ogs_local_conf()->serving_plmn_id[i])) { + home_network = true; + break; + } + } + + if (home_network == false) + return true; + + return false; +} diff --git a/lib/sbi/context.h b/lib/sbi/context.h index c08add26c..2537403ca 100644 --- a/lib/sbi/context.h +++ b/lib/sbi/context.h @@ -59,6 +59,27 @@ typedef struct ogs_sbi_context_s { uint8_t key[OGS_ECCKEY_LEN]; /* 32 bytes Private Key */ } hnet[OGS_HOME_NETWORK_PKI_VALUE_MAX+1]; /* PKI Value : 1 ~ 254 */ + struct { + struct { + OpenAPI_uri_scheme_e scheme; + + const char *private_key; + const char *cert; + + bool verify_client; + const char *verify_client_cacert; + } server; + struct { + OpenAPI_uri_scheme_e scheme; + + bool insecure_skip_verify; + const char *cacert; + + const char *private_key; + const char *cert; + } client; + } tls; + ogs_list_t server_list; ogs_list_t client_list; @@ -71,6 +92,7 @@ typedef struct ogs_sbi_context_s { ogs_sbi_nf_instance_t *nf_instance; /* SELF NF Instance */ ogs_sbi_nf_instance_t *nrf_instance; /* NRF Instance */ ogs_sbi_nf_instance_t *scp_instance; /* SCP Instance */ + ogs_sbi_nf_instance_t *sepp_instance; /* SEPP Instance */ const char *content_encoding; @@ -125,6 +147,9 @@ typedef struct ogs_sbi_nf_instance_s { OpenAPI_nf_type_e nf_type; OpenAPI_nf_status_e nf_status; + ogs_plmn_id_t plmn_id[OGS_MAX_NUM_OF_PLMN]; + int num_of_plmn_id; + char *fqdn; #define OGS_SBI_MAX_NUM_OF_IP_ADDRESS 8 @@ -191,6 +216,7 @@ typedef struct ogs_sbi_xact_s { ogs_sbi_stream_t *assoc_stream; int state; + char *target_apiroot; ogs_sbi_object_t *sbi_object; } ogs_sbi_xact_t; @@ -310,6 +336,10 @@ typedef struct ogs_sbi_scp_info_s { } ogs_sbi_scp_info_t; +typedef struct ogs_sbi_sepp_info_s { + ogs_port_t http, https; +} ogs_sbi_sepp_info_t; + typedef struct ogs_sbi_amf_info_s { int amf_set_id; int amf_region_id; @@ -342,6 +372,7 @@ typedef struct ogs_sbi_nf_info_s { ogs_sbi_smf_info_t smf; ogs_sbi_amf_info_t amf; ogs_sbi_scp_info_t scp; + ogs_sbi_sepp_info_t sepp; }; } ogs_sbi_nf_info_t; @@ -351,6 +382,10 @@ ogs_sbi_context_t *ogs_sbi_self(void); int ogs_sbi_context_parse_config( const char *local, const char *nrf, const char *scp); int ogs_sbi_context_parse_hnet_config(ogs_yaml_iter_t *root_iter); +int ogs_sbi_context_parse_server_config( + ogs_yaml_iter_t *parent, const char *interface); +ogs_sbi_client_t *ogs_sbi_context_parse_client_config( + ogs_yaml_iter_t *iter); bool ogs_sbi_nf_service_is_available(const char *name); @@ -419,10 +454,7 @@ ogs_sbi_client_t *ogs_sbi_client_find_by_service_type( void ogs_sbi_client_associate(ogs_sbi_nf_instance_t *nf_instance); -OpenAPI_uri_scheme_e ogs_sbi_server_default_scheme(void); -OpenAPI_uri_scheme_e ogs_sbi_client_default_scheme(void); -int ogs_sbi_server_default_port(void); -int ogs_sbi_client_default_port(void); +int ogs_sbi_default_client_port(OpenAPI_uri_scheme_e scheme); #define OGS_SBI_SETUP_NF_INSTANCE(__cTX, __nFInstance) \ do { \ @@ -445,10 +477,23 @@ bool ogs_sbi_discovery_param_is_matched( OpenAPI_nf_type_e requester_nf_type, ogs_sbi_discovery_option_t *discovery_option); +bool ogs_sbi_discovery_param_serving_plmn_list_is_matched( + ogs_sbi_nf_instance_t *nf_instance); + bool ogs_sbi_discovery_option_is_matched( ogs_sbi_nf_instance_t *nf_instance, OpenAPI_nf_type_e requester_nf_type, ogs_sbi_discovery_option_t *discovery_option); +bool ogs_sbi_discovery_option_service_names_is_matched( + ogs_sbi_nf_instance_t *nf_instance, + OpenAPI_nf_type_e requester_nf_type, + ogs_sbi_discovery_option_t *discovery_option); +bool ogs_sbi_discovery_option_requester_plmn_list_is_matched( + ogs_sbi_nf_instance_t *nf_instance, + ogs_sbi_discovery_option_t *discovery_option); +bool ogs_sbi_discovery_option_target_plmn_list_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); @@ -477,6 +522,10 @@ void ogs_sbi_subscription_data_remove_all_by_nf_instance_id( void ogs_sbi_subscription_data_remove_all(void); ogs_sbi_subscription_data_t *ogs_sbi_subscription_data_find(char *id); +bool ogs_sbi_supi_in_vplmn(char *supi); +bool ogs_sbi_plmn_id_in_vplmn(ogs_plmn_id_t *plmn_id); +bool ogs_sbi_fqdn_in_vplmn(char *fqdn); + #ifdef __cplusplus } #endif diff --git a/lib/sbi/conv.c b/lib/sbi/conv.c index 939f581c2..9b238a4bd 100644 --- a/lib/sbi/conv.c +++ b/lib/sbi/conv.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -272,44 +272,45 @@ cleanup: return supi; } -char *ogs_uridup(bool https, ogs_sockaddr_t *addr, ogs_sbi_header_t *h) +char *ogs_uridup( + OpenAPI_uri_scheme_e scheme, + char *fqdn, ogs_sockaddr_t *addr, ogs_sockaddr_t *addr6, uint16_t port, + ogs_sbi_header_t *h) { char buf[OGS_ADDRSTRLEN]; char uri[OGS_HUGE_LEN]; char *p, *last; int i; - char *hostname = NULL; - ogs_assert(addr); + ogs_assert(scheme); + ogs_assert(fqdn || addr || addr6); p = uri; last = uri + OGS_HUGE_LEN; /* HTTP scheme is selected based on TLS information */ - if (https == true) + if (scheme == OpenAPI_uri_scheme_https) p = ogs_slprintf(p, last, "https://"); - else + else if (scheme == OpenAPI_uri_scheme_http) p = ogs_slprintf(p, last, "http://"); + else { + ogs_fatal("Invalid scheme [%d]", scheme); + ogs_assert_if_reached(); + } /* Hostname/IP address */ - hostname = ogs_gethostname(addr); - if (hostname) { - p = ogs_slprintf(p, last, "%s", hostname); - } else { - if (addr->ogs_sa_family == AF_INET6) - p = ogs_slprintf(p, last, "[%s]", OGS_ADDR(addr, buf)); - else - p = ogs_slprintf(p, last, "%s", OGS_ADDR(addr, buf)); - } + if (fqdn) + p = ogs_slprintf(p, last, "%s", fqdn); + else if (addr6) { + p = ogs_slprintf(p, last, "[%s]", OGS_ADDR(addr6, buf)); + } else if (addr) { + p = ogs_slprintf(p, last, "%s", OGS_ADDR(addr, buf)); + } else + ogs_assert_if_reached(); /* Port number */ - if ((https == true && OGS_PORT(addr) == OGS_SBI_HTTPS_PORT)) { - /* No Port in URI */ - } else if (OGS_PORT(addr) == OGS_SBI_HTTP_PORT) { - /* No Port in URI */ - } else { - p = ogs_slprintf(p, last, ":%d", OGS_PORT(addr)); - } + if (port) + p = ogs_slprintf(p, last, ":%d", port); /* API */ if (h) { @@ -335,22 +336,92 @@ char *ogs_sbi_server_uri(ogs_sbi_server_t *server, ogs_sbi_header_t *h) ogs_assert(server); advertise = server->advertise; - if (!advertise) advertise = server->node.addr; ogs_assert(advertise); - return ogs_uridup(ogs_app()->sbi.server.no_tls == false, advertise, h); + return ogs_sbi_sockaddr_uri(server->scheme, advertise, h); +} + +uint16_t ogs_sbi_uri_port_from_scheme_and_addr( + OpenAPI_uri_scheme_e scheme, ogs_sockaddr_t *addr) +{ + uint16_t port = 0; + + ogs_assert(scheme); + ogs_assert(addr); + + if (scheme == OpenAPI_uri_scheme_https && + OGS_PORT(addr) == OGS_SBI_HTTPS_PORT) { + /* No Port in URI */ + } else if (scheme == OpenAPI_uri_scheme_http && + OGS_PORT(addr) == OGS_SBI_HTTP_PORT) { + /* No Port in URI */ + } else { + port = OGS_PORT(addr); + } + + return port; +} + +char *ogs_sbi_sockaddr_uri( + OpenAPI_uri_scheme_e scheme, + ogs_sockaddr_t *sa_list, ogs_sbi_header_t *h) +{ + int rv; + char *hostname = NULL; + ogs_sockaddr_t *addr = NULL, *addr6 = NULL; + uint16_t port = 0; + char *uri = NULL; + + ogs_assert(scheme); + ogs_assert(sa_list); + + hostname = ogs_gethostname(sa_list); + + rv = ogs_copyaddrinfo(&addr, sa_list); + ogs_assert(rv == OGS_OK); + rv = ogs_copyaddrinfo(&addr6, addr); + ogs_assert(rv == OGS_OK); + + rv = ogs_filteraddrinfo(&addr, AF_INET); + ogs_assert(rv == OGS_OK); + rv = ogs_filteraddrinfo(&addr6, AF_INET6); + ogs_assert(rv == OGS_OK); + + if (addr6) + port = ogs_sbi_uri_port_from_scheme_and_addr(scheme, addr6); + else if (addr) + port = ogs_sbi_uri_port_from_scheme_and_addr(scheme, addr); + + uri = ogs_uridup(scheme, hostname, addr, addr6, port, h); + + ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); + + return uri; } char *ogs_sbi_client_uri(ogs_sbi_client_t *client, ogs_sbi_header_t *h) { + uint16_t port = 0; + ogs_assert(client); + if (client->fqdn) { + port = client->fqdn_port; + } else { + if (client->addr6) { + port = ogs_sbi_uri_port_from_scheme_and_addr( + client->scheme, client->addr6); + } else if (client->addr) { + port = ogs_sbi_uri_port_from_scheme_and_addr( + client->scheme, client->addr); + } + } + return ogs_uridup( - ogs_app()->sbi.client.no_tls == false && - client->scheme == OpenAPI_uri_scheme_https, - client->node.addr, h); + client->scheme, client->fqdn, client->addr, client->addr6, port, h); } char *ogs_sbi_client_apiroot(ogs_sbi_client_t *client) @@ -446,13 +517,21 @@ char *ogs_sbi_parse_uri(char *uri, const char *delim, char **saveptr) } bool ogs_sbi_getaddr_from_uri( - OpenAPI_uri_scheme_e *scheme, ogs_sockaddr_t **addr, char *uri) + OpenAPI_uri_scheme_e *scheme, + char **fqdn, uint16_t *fqdn_port, + ogs_sockaddr_t **addr, ogs_sockaddr_t **addr6, + char *uri) { int rv; + ogs_sockaddr_t tmp; struct yuarel yuarel; char *p = NULL; - int port; + int port = 0; + ogs_assert(fqdn); + ogs_assert(fqdn_port); + ogs_assert(addr); + ogs_assert(addr6); ogs_assert(uri); p = ogs_strdup(uri); @@ -471,10 +550,8 @@ bool ogs_sbi_getaddr_from_uri( } if (strcmp(yuarel.scheme, "https") == 0) { - port = OGS_SBI_HTTPS_PORT; *scheme = OpenAPI_uri_scheme_https; } else if (strcmp(yuarel.scheme, "http") == 0) { - port = OGS_SBI_HTTP_PORT; *scheme = OpenAPI_uri_scheme_http; } else { ogs_error("Invalid http.scheme [%s:%s]", yuarel.scheme, uri); @@ -490,11 +567,30 @@ bool ogs_sbi_getaddr_from_uri( if (yuarel.port) port = yuarel.port; - rv = ogs_getaddrinfo(addr, AF_UNSPEC, yuarel.host, port, 0); - if (rv != OGS_OK) { - ogs_error("ogs_getaddrinfo() failed [%s]", uri); - ogs_free(p); - return false; + if (ogs_inet_pton(AF_INET, yuarel.host, &tmp) == OGS_OK || + ogs_inet_pton(AF_INET6, yuarel.host, &tmp) == OGS_OK) { + + rv = ogs_getaddrinfo(addr, AF_UNSPEC, yuarel.host, port, 0); + if (rv != OGS_OK) { + ogs_error("ogs_getaddrinfo() failed [%s]", uri); + ogs_free(p); + return false; + } + + rv = ogs_copyaddrinfo(addr6, *addr); + ogs_assert(rv == OGS_OK); + + rv = ogs_filteraddrinfo(addr, AF_INET); + ogs_assert(rv == OGS_OK); + rv = ogs_filteraddrinfo(addr6, AF_INET6); + ogs_assert(rv == OGS_OK); + + } else { + + *fqdn = ogs_strdup(yuarel.host); + ogs_assert(*fqdn); + *fqdn_port = port; + } ogs_free(p); @@ -553,6 +649,50 @@ bool ogs_sbi_getpath_from_uri(char **path, char *uri) return true; } +char *ogs_sbi_client_resolve( + OpenAPI_uri_scheme_e scheme, + char *fqdn, uint16_t fqdn_port, + const char **resolve, int num_of_resolve) +{ + int i; + uint16_t port; + char *result = NULL; + + ogs_assert(scheme); + ogs_assert(fqdn); + ogs_assert(resolve); + ogs_assert(resolve[0]); + ogs_assert(num_of_resolve); + + port = fqdn_port; + if (!port) { + if (scheme == OpenAPI_uri_scheme_https) + port = OGS_SBI_HTTPS_PORT; + else if (scheme == OpenAPI_uri_scheme_http) + port = OGS_SBI_HTTP_PORT; + else + ogs_assert_if_reached(); + } + + result = ogs_msprintf("%s:%d:%s", fqdn, port, resolve[0]); + if (!result) { + ogs_error("ogs_msprintf() failed"); + return NULL; + } + + for (i = 1; i < num_of_resolve; i++) { + ogs_assert(resolve[i]); + result = ogs_mstrcatf(result, ",%s", resolve[i]); + if (!result) { + ogs_error("ogs_mstrcatf() failed"); + ogs_free(result); + return NULL; + } + } + + return result; +} + char *ogs_sbi_bitrate_to_string(uint64_t bitrate, int unit) { if (unit == OGS_SBI_BITRATE_KBPS) { @@ -832,7 +972,7 @@ char *ogs_sbi_s_nssai_to_json(ogs_s_nssai_t *s_nssai) } if (sNSSAI.sd) ogs_free(sNSSAI.sd); - v = cJSON_Print(item); + v = cJSON_PrintUnformatted(item); ogs_expect(v); cJSON_Delete(item); @@ -982,6 +1122,71 @@ void ogs_sbi_free_plmn_id(OpenAPI_plmn_id_t *PlmnId) ogs_free(PlmnId); } +OpenAPI_list_t *ogs_sbi_build_plmn_list( + ogs_plmn_id_t *plmn_list, int num_of_plmn_list) +{ + OpenAPI_list_t *PlmnList = NULL; + OpenAPI_plmn_id_t *PlmnId = NULL; + int i; + + ogs_assert(plmn_list); + ogs_assert(num_of_plmn_list); + + PlmnList = OpenAPI_list_create(); + ogs_assert(PlmnList); + + for (i = 0; i < num_of_plmn_list; i++) { + PlmnId = ogs_sbi_build_plmn_id(plmn_list + i); + ogs_assert(PlmnId); + + OpenAPI_list_add(PlmnList, PlmnId); + } + + return PlmnList; +} + +int ogs_sbi_parse_plmn_list( + ogs_plmn_id_t *plmn_list, OpenAPI_list_t *PlmnList) +{ + OpenAPI_plmn_id_t *PlmnId = NULL; + OpenAPI_lnode_t *node = NULL; + int num_of_plmn_list = 0; + + ogs_assert(plmn_list); + ogs_assert(PlmnList); + + num_of_plmn_list = 0; + OpenAPI_list_for_each(PlmnList, node) { + PlmnId = node->data; + if (PlmnId) { + ogs_assert(PlmnId->mcc); + ogs_assert(PlmnId->mnc); + + ogs_plmn_id_build(plmn_list + num_of_plmn_list, + atoi(PlmnId->mcc), atoi(PlmnId->mnc), strlen(PlmnId->mnc)); + + num_of_plmn_list++; + } + } + + return num_of_plmn_list; +} + +void ogs_sbi_free_plmn_list(OpenAPI_list_t *PlmnList) +{ + OpenAPI_plmn_id_t *PlmnId = NULL; + OpenAPI_lnode_t *node = NULL; + + ogs_assert(PlmnList); + + OpenAPI_list_for_each(PlmnList, node) { + PlmnId = node->data; + if (PlmnId) + ogs_sbi_free_plmn_id(PlmnId); + } + OpenAPI_list_free(PlmnList); +} + OpenAPI_plmn_id_nid_t *ogs_sbi_build_plmn_id_nid(ogs_plmn_id_t *plmn_id) { OpenAPI_plmn_id_nid_t *PlmnIdNid = NULL; diff --git a/lib/sbi/conv.h b/lib/sbi/conv.h index 9ee6a3647..dc01e3069 100644 --- a/lib/sbi/conv.h +++ b/lib/sbi/conv.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -35,7 +35,15 @@ typedef struct ogs_sbi_header_s ogs_sbi_header_t; char *ogs_supi_from_suci(char *suci); char *ogs_supi_from_supi_or_suci(char *supi_or_suci); -char *ogs_uridup(bool https, ogs_sockaddr_t *addr, ogs_sbi_header_t *h); +char *ogs_uridup( + OpenAPI_uri_scheme_e scheme, + char *fqdn, ogs_sockaddr_t *addr, ogs_sockaddr_t *addr6, uint16_t port, + ogs_sbi_header_t *h); +uint16_t ogs_sbi_uri_port_from_scheme_and_addr( + OpenAPI_uri_scheme_e scheme, ogs_sockaddr_t *addr); +char *ogs_sbi_sockaddr_uri( + OpenAPI_uri_scheme_e scheme, + ogs_sockaddr_t *sa_list, ogs_sbi_header_t *h); char *ogs_sbi_server_uri(ogs_sbi_server_t *server, ogs_sbi_header_t *h); char *ogs_sbi_client_apiroot(ogs_sbi_client_t *client); char *ogs_sbi_client_uri(ogs_sbi_client_t *client, ogs_sbi_header_t *h); @@ -46,9 +54,17 @@ char *ogs_sbi_url_decode(const char *str); char *ogs_sbi_parse_uri(char *uri, const char *delim, char **saveptr); bool ogs_sbi_getaddr_from_uri( - OpenAPI_uri_scheme_e *scheme, ogs_sockaddr_t **addr, char *uri); + OpenAPI_uri_scheme_e *scheme, + char **fqdn, uint16_t *fqdn_port, + ogs_sockaddr_t **addr, ogs_sockaddr_t **addr6, + char *uri); bool ogs_sbi_getpath_from_uri(char **path, char *uri); +char *ogs_sbi_client_resolve( + OpenAPI_uri_scheme_e scheme, + char *fqdn, uint16_t fqdn_port, + const char **resolve, int num_of_resolve); + #define OGS_SBI_BITRATE_BPS 0 #define OGS_SBI_BITRATE_KBPS 1 #define OGS_SBI_BITRATE_MBPS 2 @@ -77,6 +93,12 @@ bool ogs_sbi_parse_plmn_id( ogs_plmn_id_t *plmn_id, OpenAPI_plmn_id_t *PlmnId); void ogs_sbi_free_plmn_id(OpenAPI_plmn_id_t *PlmnId); +OpenAPI_list_t *ogs_sbi_build_plmn_list( + ogs_plmn_id_t *plmn_list, int num_of_plmn_list); +int ogs_sbi_parse_plmn_list( + ogs_plmn_id_t *plmn_list, OpenAPI_list_t *PlmnList); +void ogs_sbi_free_plmn_list(OpenAPI_list_t *PlmnList); + OpenAPI_plmn_id_nid_t *ogs_sbi_build_plmn_id_nid(ogs_plmn_id_t *plmn_id); bool ogs_sbi_parse_plmn_id_nid( ogs_plmn_id_t *plmn_id, OpenAPI_plmn_id_nid_t *PlmnIdNid); diff --git a/lib/sbi/message.c b/lib/sbi/message.c index 970a7faea..7ee9b25d9 100644 --- a/lib/sbi/message.c +++ b/lib/sbi/message.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -185,6 +185,10 @@ void ogs_sbi_message_free(ogs_sbi_message_t *message) OpenAPI_sdm_subscription_free(message->SDMSubscription); if (message->ModificationNotification) OpenAPI_modification_notification_free(message->ModificationNotification); + if (message->SecNegotiateReqData) + OpenAPI_sec_negotiate_req_data_free(message->SecNegotiateReqData); + if (message->SecNegotiateRspData) + OpenAPI_sec_negotiate_rsp_data_free(message->SecNegotiateRspData); /* HTTP Part */ for (i = 0; i < message->num_of_part; i++) { @@ -454,6 +458,37 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message) discovery_option->tai[0].tac.v); } } + + if (discovery_option->num_of_target_plmn_list) { + char *v = ogs_sbi_discovery_option_build_plmn_list( + discovery_option->target_plmn_list, + discovery_option->num_of_target_plmn_list); + if (v) { + ogs_sbi_header_set(request->http.params, + OGS_SBI_PARAM_TARGET_PLMN_LIST, v); + ogs_free(v); + } else { + ogs_warn("invalid target-plmn-list failed[%d:%06x]", + discovery_option->num_of_target_plmn_list, + ogs_plmn_id_hexdump( + &discovery_option->target_plmn_list[0])); + } + } + if (discovery_option->num_of_requester_plmn_list) { + char *v = ogs_sbi_discovery_option_build_plmn_list( + discovery_option->requester_plmn_list, + discovery_option->num_of_requester_plmn_list); + if (v) { + ogs_sbi_header_set(request->http.params, + OGS_SBI_PARAM_REQUESTER_PLMN_LIST, v); + ogs_free(v); + } else { + ogs_warn("invalid target-plmn-list failed[%d:%06x]", + discovery_option->num_of_requester_plmn_list, + ogs_plmn_id_hexdump( + &discovery_option->requester_plmn_list[0])); + } + } if (discovery_option->requester_features) { char *v = ogs_uint64_to_string( discovery_option->requester_features); @@ -517,9 +552,9 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message) if (plmn_id.mnc) ogs_free(plmn_id.mnc); if (plmn_id.mcc) ogs_free(plmn_id.mcc); - v = cJSON_Print(item); + v = cJSON_PrintUnformatted(item); if (!v) { - ogs_error("cJSON_Print() failed"); + ogs_error("cJSON_PrintUnformatted() failed"); ogs_sbi_request_free(request); return NULL; } @@ -586,9 +621,9 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message) return NULL; } - v = cJSON_Print(item); + v = cJSON_PrintUnformatted(item); if (!v) { - ogs_error("cJSON_Print() failed"); + ogs_error("cJSON_PrintUnformatted() failed"); ogs_sbi_request_free(request); return NULL; } @@ -645,9 +680,9 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message) ogs_sbi_header_set(request->http.headers, OGS_SBI_OPTIONAL_CUSTOM_SENDER_TIMESTAMP, sender_timestamp); - ogs_assert(ogs_time_to_msec(ogs_app()->time.message.duration)); + ogs_assert(ogs_time_to_msec(ogs_local_conf()->time.message.duration)); max_rsp_time = ogs_msprintf("%d", - (int)ogs_time_to_msec(ogs_app()->time.message.duration)); + (int)ogs_time_to_msec(ogs_local_conf()->time.message.duration)); ogs_sbi_header_set(request->http.headers, OGS_SBI_OPTIONAL_CUSTOM_MAX_RSP_TIME, max_rsp_time); ogs_free(max_rsp_time); @@ -796,6 +831,24 @@ int ogs_sbi_parse_request( ogs_sbi_discovery_option_parse_tai(discovery_option, v); discovery_option_presence = true; } + } else if (!strcmp(ogs_hash_this_key(hi), + OGS_SBI_PARAM_TARGET_PLMN_LIST)) { + char *v = ogs_hash_this_val(hi); + if (v) { + discovery_option->num_of_target_plmn_list = + ogs_sbi_discovery_option_parse_plmn_list( + discovery_option->target_plmn_list, v); + discovery_option_presence = true; + } + } else if (!strcmp(ogs_hash_this_key(hi), + OGS_SBI_PARAM_REQUESTER_PLMN_LIST)) { + char *v = ogs_hash_this_val(hi); + if (v) { + discovery_option->num_of_requester_plmn_list = + ogs_sbi_discovery_option_parse_plmn_list( + discovery_option->requester_plmn_list, 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); @@ -1275,15 +1328,22 @@ static char *build_json(ogs_sbi_message_t *message) item = OpenAPI_sdm_subscription_convertToJSON( message->SDMSubscription); ogs_assert(item); - } - else if (message->ModificationNotification) { + } else if (message->ModificationNotification) { item = OpenAPI_modification_notification_convertToJSON( message->ModificationNotification); ogs_assert(item); + } else if (message->SecNegotiateReqData) { + item = OpenAPI_sec_negotiate_req_data_convertToJSON( + message->SecNegotiateReqData); + ogs_assert(item); + } else if (message->SecNegotiateRspData) { + item = OpenAPI_sec_negotiate_rsp_data_convertToJSON( + message->SecNegotiateRspData); + ogs_assert(item); } if (item) { - content = cJSON_Print(item); + content = cJSON_PrintUnformatted(item); ogs_assert(content); ogs_log_print(OGS_LOG_TRACE, "%s", content); cJSON_Delete(item); @@ -2228,6 +2288,39 @@ static int parse_json(ogs_sbi_message_t *message, END break; + CASE(OGS_SBI_SERVICE_NAME_N32C_HANDSHAKE) + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_EXCHANGE_CAPABILITY) + SWITCH(message->h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + if (message->res_status == 0) { + message->SecNegotiateReqData = + OpenAPI_sec_negotiate_req_data_parseFromJSON(item); + if (!message->SecNegotiateReqData) { + rv = OGS_ERROR; + ogs_error("JSON parse error"); + } + } else if (message->res_status == OGS_SBI_HTTP_STATUS_OK) { + message->SecNegotiateRspData = + OpenAPI_sec_negotiate_rsp_data_parseFromJSON(item); + if (!message->SecNegotiateRspData) { + rv = OGS_ERROR; + ogs_error("JSON parse error"); + } + } + break; + DEFAULT + rv = OGS_ERROR; + ogs_error("Unknown method [%s]", message->h.method); + END + break; + DEFAULT + rv = OGS_ERROR; + ogs_error("Unknown resource name [%s]", + message->h.resource.component[0]); + END + break; + CASE(OGS_SBI_SERVICE_NAME_NAMF_CALLBACK) SWITCH(message->h.resource.component[1]) CASE(OGS_SBI_RESOURCE_NAME_SM_CONTEXT_STATUS) @@ -2812,6 +2905,7 @@ void ogs_sbi_discovery_option_set_dnn( discovery_option->dnn = ogs_strdup(dnn); ogs_assert(discovery_option->dnn); } + void ogs_sbi_discovery_option_add_service_names( ogs_sbi_discovery_option_t *discovery_option, char *service_name) @@ -3112,3 +3206,111 @@ void ogs_sbi_discovery_option_parse_tai( ogs_free(v); } + +void ogs_sbi_discovery_option_add_target_plmn_list( + ogs_sbi_discovery_option_t *discovery_option, + ogs_plmn_id_t *target_plmn_id) +{ + ogs_assert(discovery_option); + ogs_assert(target_plmn_id); + + ogs_assert(discovery_option->num_of_target_plmn_list < + OGS_MAX_NUM_OF_PLMN); + + memcpy(&discovery_option->target_plmn_list[ + discovery_option->num_of_target_plmn_list], + target_plmn_id, OGS_PLMN_ID_LEN); + discovery_option->num_of_target_plmn_list++; +} + +void ogs_sbi_discovery_option_add_requester_plmn_list( + ogs_sbi_discovery_option_t *discovery_option, + ogs_plmn_id_t *requester_plmn_id) +{ + ogs_assert(discovery_option); + ogs_assert(requester_plmn_id); + + ogs_assert(discovery_option->num_of_requester_plmn_list < + OGS_MAX_NUM_OF_PLMN); + + memcpy(&discovery_option->requester_plmn_list[ + discovery_option->num_of_requester_plmn_list], + requester_plmn_id, OGS_PLMN_ID_LEN); + discovery_option->num_of_requester_plmn_list++; +} + +char *ogs_sbi_discovery_option_build_plmn_list( + ogs_plmn_id_t *plmn_list, int num_of_plmn_list) +{ + OpenAPI_list_t *PlmnList = NULL; + OpenAPI_plmn_id_t *PlmnId = NULL; + OpenAPI_lnode_t *node = NULL; + cJSON *item = NULL; + + char *v = NULL; + + ogs_assert(plmn_list); + ogs_assert(num_of_plmn_list); + + PlmnList = ogs_sbi_build_plmn_list(plmn_list, num_of_plmn_list); + ogs_assert(PlmnList); + + item = cJSON_CreateArray(); + ogs_assert(item); + + OpenAPI_list_for_each(PlmnList, node) { + PlmnId = node->data; + if (PlmnId) { + cJSON *PlmnIdItem = OpenAPI_plmn_id_convertToJSON(PlmnId); + ogs_assert(PlmnIdItem); + cJSON_AddItemToArray(item, PlmnIdItem); + } + } + + v = cJSON_PrintUnformatted(item); + ogs_assert(v); + + cJSON_Delete(item); + + ogs_sbi_free_plmn_list(PlmnList); + + return v; +} + +int ogs_sbi_discovery_option_parse_plmn_list( + ogs_plmn_id_t *plmn_list, char *v) +{ + cJSON *item = NULL; + cJSON *PlmnIdJSON = NULL; + OpenAPI_list_t *PlmnList = NULL; + OpenAPI_plmn_id_t *PlmnId = NULL; + int num_of_plmn_list = 0; + + ogs_assert(v); + ogs_assert(plmn_list); + + item = cJSON_Parse(v); + if (item) { + PlmnList = OpenAPI_list_create(); + ogs_assert(PlmnList); + cJSON_ArrayForEach(PlmnIdJSON, item) { + if (!cJSON_IsObject(PlmnIdJSON)) { + ogs_error("Unknown JSON"); + goto cleanup; + } + + PlmnId = OpenAPI_plmn_id_parseFromJSON(PlmnIdJSON); + ogs_assert(PlmnId); + + OpenAPI_list_add(PlmnList, PlmnId); + } + } + + num_of_plmn_list = ogs_sbi_parse_plmn_list(plmn_list, PlmnList); + +cleanup: + ogs_sbi_free_plmn_list(PlmnList); + cJSON_Delete(item); + + return num_of_plmn_list; +} diff --git a/lib/sbi/message.h b/lib/sbi/message.h index daa933546..80782a811 100644 --- a/lib/sbi/message.h +++ b/lib/sbi/message.h @@ -144,6 +144,8 @@ extern "C" { #define OGS_SBI_RESOURCE_NAME_PCF_BINDINGS "pcfBindings" +#define OGS_SBI_RESOURCE_NAME_EXCHANGE_CAPABILITY "exchange-capability" + #define OGS_SBI_PATCH_PATH_NF_STATUS "/nfStatus" #define OGS_SBI_PATCH_PATH_LOAD "/load" #define OGS_SBI_PATCH_PATH_VALIDITY_TIME "/validityTime" @@ -240,6 +242,8 @@ extern "C" { #define OGS_SBI_NBSF_MANAGEMENT_ES3XX 4 #define OGS_SBI_NBSF_MANAGEMENT_EXTENDED_SAME_PCF 5 +#define OGS_SBI_N32_HANDSHAKE_NFTLST 1 + #define OGS_SBI_SCHEME ":scheme" #define OGS_SBI_AUTHORITY ":authority" #define OGS_SBI_ACCEPT "Accept" @@ -285,6 +289,10 @@ extern "C" { OGS_SBI_CUSTOM_DISCOVERY_COMMON OGS_SBI_PARAM_DNN #define OGS_SBI_CUSTOM_DISCOVERY_TAI \ OGS_SBI_CUSTOM_DISCOVERY_COMMON OGS_SBI_PARAM_TAI +#define OGS_SBI_CUSTOM_DISCOVERY_TARGET_PLMN_LIST \ + OGS_SBI_CUSTOM_DISCOVERY_COMMON OGS_SBI_PARAM_TARGET_PLMN_LIST +#define OGS_SBI_CUSTOM_DISCOVERY_REQUESTER_PLMN_LIST \ + OGS_SBI_CUSTOM_DISCOVERY_COMMON OGS_SBI_PARAM_REQUESTER_PLMN_LIST #define OGS_SBI_CUSTOM_DISCOVERY_REQUESTER_FEATURES \ OGS_SBI_CUSTOM_DISCOVERY_COMMON OGS_SBI_PARAM_REQUESTER_FEATURES #define OGS_SBI_CUSTOM_PRODUCER_ID \ @@ -311,6 +319,8 @@ extern "C" { #define OGS_SBI_PARAM_TARGET_NF_INSTANCE_ID "target-nf-instance-id" #define OGS_SBI_PARAM_REQUESTER_NF_INSTANCE_ID "requester-nf-instance-id" #define OGS_SBI_PARAM_SERVICE_NAMES "service-names" +#define OGS_SBI_PARAM_TARGET_PLMN_LIST "target-plmn-list" +#define OGS_SBI_PARAM_REQUESTER_PLMN_LIST "requester-plmn-list" #define OGS_SBI_PARAM_REQUESTER_FEATURES "requester-features" #define OGS_SBI_PARAM_NF_ID "nf-id" @@ -421,6 +431,11 @@ typedef struct ogs_sbi_discovery_option_s { int num_of_tai; ogs_5gs_tai_t tai[OGS_MAX_NUM_OF_TAI]; + int num_of_target_plmn_list; + ogs_plmn_id_t target_plmn_list[OGS_MAX_NUM_OF_PLMN]; + int num_of_requester_plmn_list; + ogs_plmn_id_t requester_plmn_list[OGS_MAX_NUM_OF_PLMN]; + uint64_t requester_features; } ogs_sbi_discovery_option_t; @@ -525,6 +540,8 @@ typedef struct ogs_sbi_message_s { OpenAPI_sdm_subscription_t *SDMSubscription; OpenAPI_modification_notification_t *ModificationNotification; OpenAPI_smf_registration_t *SmfRegistration; + OpenAPI_sec_negotiate_req_data_t *SecNegotiateReqData; + OpenAPI_sec_negotiate_rsp_data_t *SecNegotiateRspData; ogs_sbi_links_t *links; @@ -631,6 +648,18 @@ char *ogs_sbi_discovery_option_build_tai( void ogs_sbi_discovery_option_parse_tai( ogs_sbi_discovery_option_t *discovery_option, char *tai); +void ogs_sbi_discovery_option_add_target_plmn_list( + ogs_sbi_discovery_option_t *discovery_option, + ogs_plmn_id_t *target_plmn_id); +void ogs_sbi_discovery_option_add_requester_plmn_list( + ogs_sbi_discovery_option_t *discovery_option, + ogs_plmn_id_t *requester_plmn_id); + +char *ogs_sbi_discovery_option_build_plmn_list( + ogs_plmn_id_t *plmn_list, int num_of_plmn_list); +int ogs_sbi_discovery_option_parse_plmn_list( + ogs_plmn_id_t *plmn_list, char *v); + #ifdef __cplusplus } #endif diff --git a/lib/sbi/mhd-server.c b/lib/sbi/mhd-server.c index 817a448aa..913d0f931 100644 --- a/lib/sbi/mhd-server.c +++ b/lib/sbi/mhd-server.c @@ -144,7 +144,7 @@ static ogs_sbi_session_t *session_add(ogs_sbi_server_t *server, /* If User does not send HTTP response within deadline, * Open5GS will assert this program. */ ogs_timer_start(sbi_sess->timer, - ogs_app()->time.message.sbi.connection_deadline); + ogs_local_conf()->time.message.sbi.connection_deadline); ogs_list_add(&server->session_list, sbi_sess); diff --git a/lib/sbi/nf-sm.c b/lib/sbi/nf-sm.c index 3971e01cf..39e2d76e1 100644 --- a/lib/sbi/nf-sm.c +++ b/lib/sbi/nf-sm.c @@ -54,6 +54,12 @@ void ogs_sbi_nf_fsm_fini(ogs_sbi_nf_instance_t *nf_instance) memset(&e, 0, sizeof(e)); e.sbi.data = nf_instance; + if (NF_INSTANCE_TYPE_IS_NRF(nf_instance) && + OGS_FSM_CHECK(&nf_instance->sm, ogs_sbi_nf_state_registered)) { + ogs_assert(true == + ogs_nnrf_nfm_send_nf_de_register(nf_instance)); + } + ogs_fsm_fini(&nf_instance->sm, &e); } @@ -125,9 +131,9 @@ void ogs_sbi_nf_state_will_register(ogs_fsm_t *s, ogs_event_t *e) switch (e->id) { case OGS_FSM_ENTRY_SIG: ogs_timer_start(nf_instance->t_registration_interval, - ogs_app()->time.message.sbi.nf_register_interval); + ogs_local_conf()->time.message.sbi.reconnect_interval); - ogs_assert(true == ogs_nnrf_nfm_send_nf_register(nf_instance)); + ogs_expect(true == ogs_nnrf_nfm_send_nf_register(nf_instance)); break; case OGS_FSM_EXIT_SIG: @@ -173,13 +179,13 @@ void ogs_sbi_nf_state_will_register(ogs_fsm_t *s, ogs_event_t *e) case OGS_EVENT_SBI_TIMER: switch(e->timer_id) { case OGS_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: - ogs_warn("[%s] Retry to registration with NRF", + ogs_warn("[%s] Retry registration with NRF", NF_INSTANCE_ID(ogs_sbi_self()->nf_instance)); ogs_timer_start(nf_instance->t_registration_interval, - ogs_app()->time.message.sbi.nf_register_interval); + ogs_local_conf()->time.message.sbi.reconnect_interval); - ogs_assert(true == ogs_nnrf_nfm_send_nf_register(nf_instance)); + ogs_expect(true == ogs_nnrf_nfm_send_nf_register(nf_instance)); break; default: @@ -222,7 +228,8 @@ void ogs_sbi_nf_state_registered(ogs_fsm_t *s, ogs_event_t *e) ogs_timer_start(nf_instance->t_no_heartbeat, ogs_time_from_sec( nf_instance->time.heartbeat_interval + - ogs_app()->time.nf_instance.no_heartbeat_margin)); + ogs_local_conf()->time.nf_instance. + no_heartbeat_margin)); } ogs_list_for_each( @@ -245,11 +252,6 @@ void ogs_sbi_nf_state_registered(ogs_fsm_t *s, ogs_event_t *e) ogs_timer_stop(nf_instance->t_heartbeat_interval); ogs_timer_stop(nf_instance->t_no_heartbeat); } - - if (!OGS_FSM_CHECK(&nf_instance->sm, ogs_sbi_nf_state_exception)) { - ogs_assert(true == - ogs_nnrf_nfm_send_nf_de_register(nf_instance)); - } } break; @@ -269,7 +271,7 @@ void ogs_sbi_nf_state_registered(ogs_fsm_t *s, ogs_event_t *e) ogs_timer_start(nf_instance->t_no_heartbeat, ogs_time_from_sec( nf_instance->time.heartbeat_interval + - ogs_app()->time.nf_instance. + ogs_local_conf()->time.nf_instance. no_heartbeat_margin)); } else { ogs_warn("[%s] HTTP response error [%d]", @@ -386,8 +388,8 @@ void ogs_sbi_nf_state_exception(ogs_fsm_t *s, ogs_event_t *e) case OGS_FSM_ENTRY_SIG: if (NF_INSTANCE_TYPE_IS_NRF(nf_instance)) { ogs_timer_start(nf_instance->t_registration_interval, - ogs_app()->time.message.sbi. - nf_register_interval_in_exception); + ogs_local_conf()->time.message.sbi. + reconnect_interval_in_exception); } break; @@ -400,7 +402,7 @@ void ogs_sbi_nf_state_exception(ogs_fsm_t *s, ogs_event_t *e) case OGS_EVENT_SBI_TIMER: switch(e->timer_id) { case OGS_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: - ogs_warn("[%s] Retry to registration with NRF", + ogs_warn("[%s] Retry registration with NRF", NF_INSTANCE_ID(ogs_sbi_self()->nf_instance)); OGS_FSM_TRAN(s, &ogs_sbi_nf_state_will_register); diff --git a/lib/sbi/nghttp2-server.c b/lib/sbi/nghttp2-server.c index 44f3242ff..43074beb9 100644 --- a/lib/sbi/nghttp2-server.c +++ b/lib/sbi/nghttp2-server.c @@ -312,57 +312,75 @@ static int server_start(ogs_sbi_server_t *server, ogs_assert(addr); /* Create SSL CTX */ - if (ogs_app()->sbi.server.no_tls == false) { + if (server->scheme == OpenAPI_uri_scheme_https) { - server->ssl_ctx = create_ssl_ctx( - ogs_app()->sbi.server.key, - ogs_app()->sbi.server.cert); + server->ssl_ctx = create_ssl_ctx(server->private_key, server->cert); if (!server->ssl_ctx) { ogs_error("Cannot create SSL CTX"); return OGS_ERROR; } - if (ogs_app()->sbi.server.no_verify == false) { - if (ogs_app()->sbi.server.cacert) { - STACK_OF(X509_NAME) *cert_names = NULL; + if (server->verify_client_cacert) { + char *context = NULL; + STACK_OF(X509_NAME) *cert_names = NULL; - if (SSL_CTX_load_verify_locations(server->ssl_ctx, - ogs_app()->sbi.server.cacert, NULL) != 1) { - ogs_error("Could not load trusted ca certificates " - "from %s:%s", ogs_app()->sbi.server.cacert, - ERR_error_string(ERR_get_error(), NULL)); - - if (server->ssl_ctx) - SSL_CTX_free(server->ssl_ctx); - - return OGS_ERROR; - } - - /* - * It is heard that SSL_CTX_load_verify_locations() may leave - * error even though it returns success. See - * http://forum.nginx.org/read.php?29,242540 - */ - cert_names = SSL_load_client_CA_file( - ogs_app()->sbi.server.cacert); - if (!cert_names) { - ogs_error("Could not load ca certificates from %s:%s", - ogs_app()->sbi.server.cacert, + if (SSL_CTX_load_verify_locations( + server->ssl_ctx, + server->verify_client_cacert, NULL) != 1) { + ogs_error("Could not load trusted ca certificates from %s:%s", + server->verify_client_cacert, ERR_error_string(ERR_get_error(), NULL)); - if (server->ssl_ctx) - SSL_CTX_free(server->ssl_ctx); + SSL_CTX_free(server->ssl_ctx); - return OGS_ERROR; - } - SSL_CTX_set_client_CA_list(server->ssl_ctx, cert_names); + return OGS_ERROR; } - SSL_CTX_set_verify( - server->ssl_ctx, - SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE | - SSL_VERIFY_FAIL_IF_NO_PEER_CERT, - verify_callback); + /* + * It is heard that SSL_CTX_load_verify_locations() may leave + * error even though it returns success. See + * http://forum.nginx.org/read.php?29,242540 + */ + cert_names = SSL_load_client_CA_file(server->verify_client_cacert); + if (!cert_names) { + ogs_error("Could not load ca certificates from %s:%s", + server->verify_client_cacert, + ERR_error_string(ERR_get_error(), NULL)); + + SSL_CTX_free(server->ssl_ctx); + + return OGS_ERROR; + } + SSL_CTX_set_client_CA_list(server->ssl_ctx, cert_names); + + if (server->verify_client) + SSL_CTX_set_verify( + server->ssl_ctx, + SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE | + SSL_VERIFY_FAIL_IF_NO_PEER_CERT, + verify_callback); + + context = ogs_sbi_server_id_context(server); + if (!context) { + ogs_error("ogs_sbi_server_id_context() failed"); + + SSL_CTX_free(server->ssl_ctx); + + return OGS_ERROR; + } + + if (!SSL_CTX_set_session_id_context( + server->ssl_ctx, + (unsigned char *)context, strlen(context))) { + ogs_error("SSL_CTX_set_session_id_context() failed"); + + ogs_free(context); + SSL_CTX_free(server->ssl_ctx); + + return OGS_ERROR; + } + + ogs_free(context); } } @@ -388,11 +406,13 @@ static int server_start(ogs_sbi_server_t *server, hostname = ogs_gethostname(addr); if (hostname) - ogs_info("nghttp2_server() [%s://%s]:%d", + ogs_info("nghttp2_server(%s) [%s://%s]:%d", + server->interface ? server->interface : "", server->ssl_ctx ? "https" : "http", hostname, OGS_PORT(addr)); else - ogs_info("nghttp2_server() [%s://%s]:%d", + ogs_info("nghttp2_server(%s) [%s://%s]:%d", + server->interface ? server->interface : "", server->ssl_ctx ? "https" : "http", OGS_ADDR(addr, buf), OGS_PORT(addr)); @@ -763,13 +783,37 @@ static ogs_sbi_session_t *session_add( memcpy(sbi_sess->addr, &sock->remote_addr, sizeof(ogs_sockaddr_t)); if (server->ssl_ctx) { + char *context = NULL; + sbi_sess->ssl = SSL_new(server->ssl_ctx); if (!sbi_sess->ssl) { ogs_error("SSL_new() failed"); - ogs_pool_free(&session_pool, sbi_sess); ogs_free(sbi_sess->addr); + ogs_pool_free(&session_pool, sbi_sess); return NULL; } + + context = ogs_msprintf("%d", + (int)ogs_pool_index(&session_pool, sbi_sess)); + if (!context) { + ogs_error("No memory for session id context"); + SSL_free(sbi_sess->ssl); + ogs_free(sbi_sess->addr); + ogs_pool_free(&session_pool, sbi_sess); + return NULL; + } + + if (!SSL_set_session_id_context( + sbi_sess->ssl, (unsigned char *)context, strlen(context))) { + ogs_error("SSL_set_session_id_context() failed"); + ogs_free(context); + ogs_free(sbi_sess->addr); + SSL_free(sbi_sess->ssl); + ogs_pool_free(&session_pool, sbi_sess); + return NULL; + } + + ogs_free(context); } ogs_list_add(&server->session_list, sbi_sess); diff --git a/lib/sbi/nnrf-build.c b/lib/sbi/nnrf-build.c index fc1caa899..0259a1dec 100644 --- a/lib/sbi/nnrf-build.c +++ b/lib/sbi/nnrf-build.c @@ -25,9 +25,11 @@ static void free_nf_service(OpenAPI_nf_service_t *NFService); static OpenAPI_smf_info_t *build_smf_info(ogs_sbi_nf_info_t *nf_info); static OpenAPI_amf_info_t *build_amf_info(ogs_sbi_nf_info_t *nf_info); static OpenAPI_scp_info_t *build_scp_info(ogs_sbi_nf_info_t *nf_info); +static OpenAPI_sepp_info_t *build_sepp_info(ogs_sbi_nf_info_t *nf_info); static void free_smf_info(OpenAPI_smf_info_t *SmfInfo); static void free_amf_info(OpenAPI_amf_info_t *AmfInfo); static void free_scp_info(OpenAPI_scp_info_t *ScpInfo); +static void free_sepp_info(OpenAPI_sepp_info_t *SeppInfo); ogs_sbi_request_t *ogs_nnrf_nfm_build_register(void) { @@ -123,6 +125,27 @@ OpenAPI_nf_profile_t *ogs_nnrf_nfm_build_nf_profile( NFProfile->is_heart_beat_timer = true; NFProfile->heart_beat_timer = nf_instance->time.heartbeat_interval; } + + if (nf_instance->num_of_plmn_id) { + OpenAPI_list_t *PlmnIdList = NULL; + OpenAPI_plmn_id_t *PlmnId = NULL; + int i; + + PlmnIdList = OpenAPI_list_create(); + ogs_assert(PlmnIdList); + + for (i = 0; i < nf_instance->num_of_plmn_id; i++) { + PlmnId = ogs_sbi_build_plmn_id(&nf_instance->plmn_id[i]); + ogs_assert(PlmnId); + OpenAPI_list_add(PlmnIdList, PlmnId); + } + + if (PlmnIdList->count) + NFProfile->plmn_list = PlmnIdList; + else + OpenAPI_list_free(PlmnIdList); + } + NFProfile->is_nf_profile_changes_support_ind = true; NFProfile->nf_profile_changes_support_ind = true; @@ -353,6 +376,14 @@ OpenAPI_nf_profile_t *ogs_nnrf_nfm_build_nf_profile( ogs_assert(NFProfile->scp_info); } + /* There can only be one SEPP info, not multiple. */ + nf_info = ogs_sbi_nf_info_find( + &nf_instance->nf_info_list, OpenAPI_nf_type_SEPP); + if (nf_info) { + NFProfile->sepp_info = build_sepp_info(nf_info); + ogs_assert(NFProfile->sepp_info); + } + return NFProfile; } @@ -378,6 +409,13 @@ void ogs_nnrf_nfm_free_nf_profile(OpenAPI_nf_profile_t *NFProfile) ogs_free(node->data); OpenAPI_list_free(NFProfile->ipv6_addresses); + OpenAPI_list_for_each(NFProfile->plmn_list, node) { + OpenAPI_plmn_id_t *PlmnId = node->data; + if (PlmnId) + ogs_sbi_free_plmn_id(PlmnId); + } + OpenAPI_list_free(NFProfile->plmn_list); + OpenAPI_list_free(NFProfile->allowed_nf_types); OpenAPI_list_for_each(NFProfile->nf_services, node) { @@ -433,6 +471,9 @@ void ogs_nnrf_nfm_free_nf_profile(OpenAPI_nf_profile_t *NFProfile) if (NFProfile->scp_info) free_scp_info(NFProfile->scp_info); + if (NFProfile->sepp_info) + free_sepp_info(NFProfile->sepp_info); + ogs_free(NFProfile); } @@ -1186,6 +1227,56 @@ static OpenAPI_scp_info_t *build_scp_info(ogs_sbi_nf_info_t *nf_info) return ScpInfo; } +static OpenAPI_sepp_info_t *build_sepp_info(ogs_sbi_nf_info_t *nf_info) +{ + OpenAPI_sepp_info_t *SeppInfo = NULL; + OpenAPI_list_t *PortList = NULL; + OpenAPI_map_t *PortMap = NULL; + + ogs_assert(nf_info); + + SeppInfo = ogs_calloc(1, sizeof(*SeppInfo)); + if (!SeppInfo) { + ogs_error("No SeppInfo"); + return NULL; + } + + PortList = OpenAPI_list_create(); + if (!PortList) { + ogs_error("No PortList"); + free_sepp_info(SeppInfo); + return NULL; + } + + if (nf_info->sepp.http.presence) { + PortMap = OpenAPI_map_create( + (char *)"http", ogs_alloc_double(nf_info->sepp.http.port)); + if (!PortMap) { + ogs_error("No PortMap"); + free_sepp_info(SeppInfo); + return NULL; + } + OpenAPI_list_add(PortList, PortMap); + } + if (nf_info->sepp.https.presence) { + PortMap = OpenAPI_map_create( + (char *)"https", ogs_alloc_double(nf_info->sepp.https.port)); + if (!PortMap) { + ogs_error("No PortMap"); + free_sepp_info(SeppInfo); + return NULL; + } + OpenAPI_list_add(PortList, PortMap); + } + + if (PortList->count) + SeppInfo->sepp_ports = PortList; + else + OpenAPI_list_free(PortList); + + return SeppInfo; +} + static void free_smf_info(OpenAPI_smf_info_t *SmfInfo) { OpenAPI_list_t *sNssaiSmfInfoList = NULL; @@ -1391,6 +1482,25 @@ static void free_scp_info(OpenAPI_scp_info_t *ScpInfo) ogs_free(ScpInfo); } +static void free_sepp_info(OpenAPI_sepp_info_t *SeppInfo) +{ + OpenAPI_map_t *PortMap = NULL; + OpenAPI_lnode_t *node = NULL; + + ogs_assert(SeppInfo); + + OpenAPI_list_for_each(SeppInfo->sepp_ports, node) { + PortMap = node->data; + if (PortMap) { + ogs_free(PortMap->value); + OpenAPI_map_free(PortMap); + } + } + OpenAPI_list_free(SeppInfo->sepp_ports); + + ogs_free(SeppInfo); +} + ogs_sbi_request_t *ogs_nnrf_nfm_build_update(void) { ogs_sbi_nf_instance_t *nf_instance = NULL; @@ -1518,7 +1628,7 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_status_subscribe( goto end; } - server = ogs_list_first(&ogs_sbi_self()->server_list); + server = ogs_sbi_server_first(); if (!server) { ogs_error("No server"); goto end; diff --git a/lib/sbi/nnrf-handler.c b/lib/sbi/nnrf-handler.c index 880a75fb7..1ee47134f 100644 --- a/lib/sbi/nnrf-handler.c +++ b/lib/sbi/nnrf-handler.c @@ -23,11 +23,16 @@ static void handle_nf_service( ogs_sbi_nf_service_t *nf_service, OpenAPI_nf_service_t *NFService); static void handle_smf_info( ogs_sbi_nf_instance_t *nf_instance, OpenAPI_smf_info_t *SmfInfo); +static void handle_scp_info( + ogs_sbi_nf_instance_t *nf_instance, OpenAPI_scp_info_t *SeppInfo); +static void handle_sepp_info( + ogs_sbi_nf_instance_t *nf_instance, OpenAPI_sepp_info_t *SeppInfo); void ogs_nnrf_nfm_handle_nf_register( ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_message_t *recvmsg) { OpenAPI_nf_profile_t *NFProfile = NULL; + OpenAPI_lnode_t *node; ogs_assert(recvmsg); ogs_assert(nf_instance); @@ -41,6 +46,19 @@ void ogs_nnrf_nfm_handle_nf_register( /* TIME : Update heartbeat from NRF */ if (NFProfile->is_heart_beat_timer == true) nf_instance->time.heartbeat_interval = NFProfile->heart_beat_timer; + + if (NFProfile->plmn_list) { + nf_instance->num_of_plmn_id = 0; + OpenAPI_list_for_each(NFProfile->plmn_list, node) { + OpenAPI_plmn_id_t *PlmnId = node->data; + if (PlmnId) { + ogs_sbi_parse_plmn_id( + &ogs_local_conf()->serving_plmn_id[ + ogs_local_conf()->num_of_serving_plmn_id], PlmnId); + ogs_local_conf()->num_of_serving_plmn_id++; + } + } + } } void ogs_nnrf_nfm_handle_nf_profile( @@ -72,6 +90,16 @@ void ogs_nnrf_nfm_handle_nf_profile( if (NFProfile->is_load == true) nf_instance->load = NFProfile->load; + nf_instance->num_of_plmn_id = 0; + OpenAPI_list_for_each(NFProfile->plmn_list, node) { + OpenAPI_plmn_id_t *PlmnId = node->data; + if (PlmnId) { + ogs_sbi_parse_plmn_id( + &nf_instance->plmn_id[nf_instance->num_of_plmn_id], PlmnId); + nf_instance->num_of_plmn_id++; + } + } + OpenAPI_list_for_each(NFProfile->ipv4_addresses, node) { ogs_sockaddr_t *addr = NULL; @@ -82,9 +110,14 @@ void ogs_nnrf_nfm_handle_nf_profile( if (nf_instance->num_of_ipv4 < OGS_SBI_MAX_NUM_OF_IP_ADDRESS) { - rv = ogs_getaddrinfo(&addr, AF_UNSPEC, - node->data, ogs_sbi_client_default_port(), 0); - if (rv != OGS_OK) continue; + rv = ogs_getaddrinfo( + &addr, AF_UNSPEC, + node->data, + ogs_sbi_default_client_port(OpenAPI_uri_scheme_NULL), 0); + if (rv != OGS_OK) { + ogs_error("ogs_getaddrinfo[%s] failed", (char *)node->data); + continue; + } nf_instance->ipv4[nf_instance->num_of_ipv4] = addr; nf_instance->num_of_ipv4++; @@ -100,9 +133,14 @@ void ogs_nnrf_nfm_handle_nf_profile( if (nf_instance->num_of_ipv6 < OGS_SBI_MAX_NUM_OF_IP_ADDRESS) { - rv = ogs_getaddrinfo(&addr, AF_UNSPEC, - node->data, ogs_sbi_client_default_port(), 0); - if (rv != OGS_OK) continue; + rv = ogs_getaddrinfo( + &addr, AF_UNSPEC, + node->data, + ogs_sbi_default_client_port(OpenAPI_uri_scheme_NULL), 0); + if (rv != OGS_OK) { + ogs_error("ogs_getaddrinfo[%s] failed", (char *)node->data); + continue; + } nf_instance->ipv6[nf_instance->num_of_ipv6] = addr; nf_instance->num_of_ipv6++; @@ -218,6 +256,11 @@ void ogs_nnrf_nfm_handle_nf_profile( if (SmfInfoMap && SmfInfoMap->value) handle_smf_info(nf_instance, SmfInfoMap->value); } + + if (NFProfile->scp_info) + handle_scp_info(nf_instance, NFProfile->scp_info); + if (NFProfile->sepp_info) + handle_sepp_info(nf_instance, NFProfile->sepp_info); } static void handle_nf_service( @@ -258,7 +301,7 @@ static void handle_nf_service( if (nf_service->num_of_addr < OGS_SBI_MAX_NUM_OF_IP_ADDRESS) { if (!IpEndPoint->is_port) - port = ogs_sbi_client_default_port(); + port = ogs_sbi_default_client_port(nf_service->scheme); else port = IpEndPoint->port; @@ -452,6 +495,162 @@ static void handle_smf_info( } } +static void handle_scp_info( + ogs_sbi_nf_instance_t *nf_instance, OpenAPI_scp_info_t *ScpInfo) +{ + ogs_sbi_nf_info_t *nf_info = NULL; + + OpenAPI_list_t *PortList = NULL; + OpenAPI_map_t *PortMap = NULL; + + OpenAPI_map_t *DomainInfoMap = NULL; + OpenAPI_scp_domain_info_t *DomainInfo = NULL; + + OpenAPI_lnode_t *node = NULL, *node2 = NULL; + + ogs_sbi_scp_info_t scp_info; + + ogs_assert(nf_instance); + ogs_assert(ScpInfo); + + memset(&scp_info, 0, sizeof(scp_info)); + + PortList = ScpInfo->scp_ports; + OpenAPI_list_for_each(PortList, node) { + PortMap = node->data; + if (PortMap) { + if (PortMap->key) { + double *port = PortMap->value; + if (strcmp(PortMap->key, "http") == 0) { + if (port) { + scp_info.http.presence = true; + scp_info.http.port = *port; + } else { + ogs_error("No Port Value"); + } + } else if (strcmp(PortMap->key, "https") == 0) { + if (port) { + scp_info.https.presence = true; + scp_info.https.port = *port; + } else { + ogs_error("No Port Value"); + } + } else { + ogs_error("Unknown Port Key = %s", PortMap->key); + } + } + } + } + + OpenAPI_list_for_each(ScpInfo->scp_domain_info_list, node) { + DomainInfoMap = node->data; + if (DomainInfoMap && DomainInfoMap->key && DomainInfoMap->value) { + scp_info.domain[scp_info.num_of_domain].name = + ogs_strdup(DomainInfoMap->key); + DomainInfo = DomainInfoMap->value; + if (DomainInfo->scp_fqdn) + scp_info.domain[scp_info.num_of_domain].fqdn = + ogs_strdup(DomainInfo->scp_fqdn); + OpenAPI_list_for_each(DomainInfo->scp_ports, node2) { + PortMap = node2->data; + if (PortMap) { + if (PortMap->key) { + double *port = PortMap->value; + if (strcmp(PortMap->key, "http") == 0) { + if (port) { + scp_info.domain[scp_info.num_of_domain]. + http.presence = true; + scp_info.domain[scp_info.num_of_domain]. + http.port = *port; + } else { + ogs_error("No Port Value"); + } + } else if (strcmp(PortMap->key, "https") == 0) { + if (port) { + scp_info.domain[scp_info.num_of_domain]. + https.presence = true; + scp_info.domain[scp_info.num_of_domain]. + https.port = *port; + } else { + ogs_error("No Port Value"); + } + } else { + ogs_error("Unknown Port Key = %s", PortMap->key); + } + } + } + } + scp_info.num_of_domain++; + } + } + + if (scp_info.http.presence || scp_info.https.presence) { + nf_info = ogs_sbi_nf_info_add( + &nf_instance->nf_info_list, OpenAPI_nf_type_SCP); + ogs_assert(nf_info); + + memcpy(&nf_info->scp, &scp_info, sizeof(scp_info)); + } +} + +static void handle_sepp_info( + ogs_sbi_nf_instance_t *nf_instance, OpenAPI_sepp_info_t *SeppInfo) +{ + ogs_sbi_nf_info_t *nf_info = NULL; + + OpenAPI_list_t *PortList = NULL; + OpenAPI_map_t *PortMap = NULL; + + OpenAPI_lnode_t *node = NULL; + + ogs_port_t http, https; + + ogs_assert(nf_instance); + ogs_assert(SeppInfo); + + http.presence = false; + https.presence = false; + + PortList = SeppInfo->sepp_ports; + OpenAPI_list_for_each(PortList, node) { + PortMap = node->data; + if (PortMap) { + if (PortMap->key) { + double *port = PortMap->value; + if (strcmp(PortMap->key, "http") == 0) { + if (port) { + http.presence = true; + http.port = *port; + } else { + ogs_error("No Port Value"); + } + } else if (strcmp(PortMap->key, "https") == 0) { + if (port) { + https.presence = true; + https.port = *port; + } else { + ogs_error("No Port Value"); + } + } else { + ogs_error("Unknown Port Key = %s", PortMap->key); + } + } + } + } + + if (http.presence || https.presence) { + nf_info = ogs_sbi_nf_info_add( + &nf_instance->nf_info_list, OpenAPI_nf_type_SEPP); + ogs_assert(nf_info); + + nf_info->sepp.http.presence = http.presence; + nf_info->sepp.http.port = http.port; + + nf_info->sepp.https.presence = https.presence; + nf_info->sepp.https.port = https.port; + } +} + static void handle_validity_time( ogs_sbi_subscription_data_t *subscription_data, char *validity_time, const char *action) @@ -743,6 +942,14 @@ bool ogs_nnrf_nfm_handle_nf_status_notify( ogs_sbi_client_associate(nf_instance); + switch (nf_instance->nf_type) { + case OpenAPI_nf_type_SEPP: + ogs_sbi_self()->sepp_instance = nf_instance; + break; + default: + break; + } + } else if (NotificationData->event == OpenAPI_notification_event_type_NF_DEREGISTERED) { nf_instance = ogs_sbi_nf_instance_find(message.h.resource.component[1]); @@ -861,6 +1068,14 @@ void ogs_nnrf_disc_handle_nf_discover_search_result( ogs_sbi_client_associate(nf_instance); + switch (nf_instance->nf_type) { + case OpenAPI_nf_type_SEPP: + ogs_sbi_self()->sepp_instance = nf_instance; + break; + default: + break; + } + /* TIME : Update validity from NRF */ if (SearchResult->is_validity_period && SearchResult->validity_period) { diff --git a/lib/sbi/ogs-sbi.h b/lib/sbi/ogs-sbi.h index 433d1aa8c..cafa2b728 100644 --- a/lib/sbi/ogs-sbi.h +++ b/lib/sbi/ogs-sbi.h @@ -80,6 +80,8 @@ #include "model/deregistration_data.h" #include "model/sdm_subscription.h" #include "model/modification_notification.h" +#include "model/sec_negotiate_req_data.h" +#include "model/sec_negotiate_rsp_data.h" #include "model/patch_item.h" #include "model/ue_authentication_ctx.h" diff --git a/lib/sbi/path.c b/lib/sbi/path.c index 443940a4c..59cc0c571 100644 --- a/lib/sbi/path.c +++ b/lib/sbi/path.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -19,6 +19,9 @@ #include "ogs-sbi.h" +static int sepp_discover_handler( + int status, ogs_sbi_response_t *response, void *data); + static void build_default_discovery_parameter( ogs_sbi_request_t *request, ogs_sbi_service_type_e service_type, @@ -111,6 +114,7 @@ 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); @@ -236,15 +240,21 @@ int ogs_sbi_discover_and_send(ogs_sbi_xact_t *xact) } } else { OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; - ogs_sockaddr_t *addr = NULL; + char *fqdn = NULL; + uint16_t fqdn_port = 0; + ogs_sockaddr_t *addr = NULL, *addr6 = NULL; - rc = ogs_sbi_getaddr_from_uri(&scheme, &addr, request->h.uri); + rc = ogs_sbi_getaddr_from_uri( + &scheme, &fqdn, &fqdn_port, &addr, &addr6, request->h.uri); if (rc == false || scheme == OpenAPI_uri_scheme_NULL) { ogs_error("Invalid URL [%s]", request->h.uri); return OGS_ERROR; } - client = ogs_sbi_client_find(scheme, addr); + client = ogs_sbi_client_find(scheme, fqdn, fqdn_port, addr, addr6); + + ogs_free(fqdn); ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); } if (scp_client) { @@ -256,7 +266,7 @@ int ogs_sbi_discover_and_send(ogs_sbi_xact_t *xact) if (client) { /* - * If `client` instance is avaiable, + * If `client` instance is available, * 3gpp-Sbi-Target-apiRoot is added to HTTP header. */ apiroot = ogs_sbi_client_apiroot(client); @@ -267,7 +277,7 @@ int ogs_sbi_discover_and_send(ogs_sbi_xact_t *xact) ogs_free(apiroot); - rc = ogs_sbi_client_send_via_scp( + rc = ogs_sbi_client_send_via_scp_or_sepp( scp_client, ogs_sbi_client_handler, request, xact); ogs_expect(rc == true); return (rc == true) ? OGS_OK : OGS_ERROR; @@ -370,7 +380,7 @@ int ogs_sbi_discover_and_send(ogs_sbi_xact_t *xact) ogs_free(v); } - rc = ogs_sbi_client_send_via_scp( + rc = ogs_sbi_client_send_via_scp_or_sepp( scp_client, client_discover_cb, request, xact); ogs_expect(rc == true); return (rc == true) ? OGS_OK : OGS_ERROR; @@ -382,7 +392,7 @@ int ogs_sbi_discover_and_send(ogs_sbi_xact_t *xact) ***********************/ /* If `client` instance is available, use direct communication */ - rc = ogs_sbi_client_send_request( + rc = ogs_sbi_send_request_to_client( client, ogs_sbi_client_handler, request, xact); ogs_expect(rc == true); return (rc == true) ? OGS_OK : OGS_ERROR; @@ -482,36 +492,107 @@ bool ogs_sbi_send_request_to_nf_instance( OpenAPI_nf_type_ToString(nf_instance->nf_type), nf_instance->id, request->h.service.name, request->h.api.version); + ogs_sbi_xact_remove(xact); return false; } } else { + + /********************************************************* + * + * DEPRECATED + * + ********************************************************/ + + ogs_fatal("[%s] %s", request->h.method, request->h.uri); + ogs_assert_if_reached(); + +#if 0 bool rc; OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; - ogs_sockaddr_t *addr = NULL; + char *fqdn = NULL; + uint16_t fqdn_port = 0; + ogs_sockaddr_t *addr = NULL, *addr6 = NULL; char buf[OGS_ADDRSTRLEN]; - rc = ogs_sbi_getaddr_from_uri(&scheme, &addr, request->h.uri); + rc = ogs_sbi_getaddr_from_uri( + &scheme, &fqdn, &fqdn_port, &addr, &addr6, request->h.uri); if (rc == false || scheme == OpenAPI_uri_scheme_NULL) { ogs_error("[%s:%s] Invalid URL [%s]", OpenAPI_nf_type_ToString(nf_instance->nf_type), nf_instance->id, request->h.uri); return false; } - client = ogs_sbi_client_find(scheme, addr); + client = ogs_sbi_client_find(scheme, fqdn, fqdn_port, addr, addr6); if (!client) { ogs_error("[%s:%s] Cannot find client [%s:%d]", OpenAPI_nf_type_ToString(nf_instance->nf_type), nf_instance->id, OGS_ADDR(addr, buf), OGS_PORT(addr)); + ogs_free(fqdn); ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); return false; } + + ogs_free(fqdn); ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); +#endif + } + + if (client->fqdn && ogs_sbi_fqdn_in_vplmn(client->fqdn) == true) { + ogs_sbi_client_t *sepp_client = NULL, *nrf_client = NULL; + + /* Visited Network requires SEPP */ + sepp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->sepp_instance); + nrf_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->nrf_instance); + + if (!sepp_client && !nrf_client) { + + ogs_error("No SEPP(%p) and NRF(%p) [%s]", + sepp_client, nrf_client, client->fqdn); + + ogs_sbi_xact_remove(xact); + return false; + + } else if (!sepp_client) { + + ogs_sbi_request_t *nrf_request = NULL; + + xact->target_apiroot = ogs_sbi_client_apiroot(client); + if (!xact->target_apiroot) { + ogs_error("ogs_strdup(xact->target_apiroot) failed"); + ogs_sbi_xact_remove(xact); + return false; + } + + nrf_request = ogs_nnrf_disc_build_discover( + OpenAPI_nf_type_SEPP, xact->requester_nf_type, NULL); + if (!nrf_request) { + ogs_error("ogs_nnrf_disc_build_discover() failed"); + ogs_sbi_xact_remove(xact); + return false; + } + + rc = ogs_sbi_client_send_request( + nrf_client, sepp_discover_handler, nrf_request, xact); + if (rc == false) { + ogs_error("ogs_sbi_client_send_request() failed"); + ogs_sbi_xact_remove(xact); + } + + ogs_sbi_request_free(nrf_request); + + return rc; + } } rc = ogs_sbi_send_request_to_client( client, ogs_sbi_client_handler, request, xact); - ogs_expect(rc == true); + if (rc == false) { + ogs_error("ogs_sbi_send_request_to_client() failed"); + ogs_sbi_xact_remove(xact); + } return rc; } @@ -521,7 +602,8 @@ bool ogs_sbi_send_request_to_client( ogs_sbi_request_t *request, void *data) { bool rc; - ogs_sbi_client_t *scp_client = NULL; + ogs_sbi_client_t *scp_client = NULL, *sepp_client = NULL; + ogs_sbi_client_t *scp_or_sepp = NULL; char *apiroot = NULL; /* @@ -532,12 +614,29 @@ bool ogs_sbi_send_request_to_client( ogs_assert(request); scp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance); + sepp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->sepp_instance); if (scp_client && scp_client != client) { /************************* * INDIRECT COMMUNICATION *************************/ + scp_or_sepp = scp_client; + + } else if (client->fqdn && ogs_sbi_fqdn_in_vplmn(client->fqdn) == true) { + + /*************************** + * SEPP for Visited Network + ***************************/ + if (sepp_client && sepp_client != client) { + scp_or_sepp = sepp_client; + } else { + ogs_error("No SEPP [%s]", client->fqdn); + return false; + } + } + + if (scp_or_sepp) { /* Added 3gpp-Sbi-Target-apiRoot to HTTP header */ apiroot = ogs_sbi_client_apiroot(client); @@ -548,8 +647,8 @@ bool ogs_sbi_send_request_to_client( ogs_free(apiroot); - rc = ogs_sbi_client_send_via_scp( - scp_client, client_cb, request, data); + rc = ogs_sbi_client_send_via_scp_or_sepp( + scp_or_sepp, client_cb, request, data); ogs_expect(rc == true); } else { @@ -558,7 +657,7 @@ bool ogs_sbi_send_request_to_client( * DIRECT COMMUNICATION ***********************/ - /* Direct communication since `client' instance is always avaiable */ + /* Direct communication since `client' instance is always available */ rc = ogs_sbi_client_send_request( client, client_cb, request, data); ogs_expect(rc == true); @@ -598,7 +697,7 @@ bool ogs_sbi_send_notification_request( build_default_discovery_parameter( request, service_type, discovery_option); - rc = ogs_sbi_client_send_via_scp( + rc = ogs_sbi_client_send_via_scp_or_sepp( scp_client, ogs_sbi_client_handler, request, data); ogs_expect(rc == true); @@ -608,7 +707,7 @@ bool ogs_sbi_send_notification_request( * DIRECT COMMUNICATION ***********************/ - /* NRF is avaiable */ + /* NRF is available */ rc = ogs_sbi_client_send_request( client, ogs_sbi_client_handler, request, data); ogs_expect(rc == true); @@ -645,6 +744,96 @@ bool ogs_sbi_send_response(ogs_sbi_stream_t *stream, int status) return ogs_sbi_server_send_response(stream, response); } +static int sepp_discover_handler( + int status, ogs_sbi_response_t *response, void *data) +{ + int rv; + char *strerror = NULL; + ogs_sbi_message_t message; + + ogs_sbi_xact_t *xact = data; + + ogs_sbi_request_t *request = NULL; + ogs_sbi_client_t *scp_client = NULL, *sepp_client = NULL; + + ogs_assert(xact); + request = xact->request; + ogs_assert(request); + + if (status != OGS_OK) { + + ogs_log_message( + status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0, + "sepp_discover_handler() failed [%d]", status); + + ogs_sbi_xact_remove(xact); + return OGS_ERROR; + } + + ogs_assert(response); + + rv = ogs_sbi_parse_response(&message, response); + if (rv != OGS_OK) { + strerror = ogs_msprintf("cannot parse HTTP response"); + goto cleanup; + } + + if (message.res_status != OGS_SBI_HTTP_STATUS_OK) { + strerror = ogs_msprintf("NF-Discover failed [%d]", message.res_status); + goto cleanup; + } + + if (!message.SearchResult) { + strerror = ogs_msprintf("No SearchResult"); + goto cleanup; + } + + ogs_nnrf_disc_handle_nf_discover_search_result(message.SearchResult); + + /***************************** + * Check if SEPP is discovered + *****************************/ + sepp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->sepp_instance); + if (!sepp_client) { + strerror = ogs_msprintf("No SEPP"); + goto cleanup; + } + + /* Added 3gpp-Sbi-Target-apiRoot to HTTP header */ + ogs_sbi_header_set(request->http.headers, + OGS_SBI_CUSTOM_TARGET_APIROOT, xact->target_apiroot); + + /********************************************************************** + * SCP should be checked considering 'discovery.delegated:no' situation + **********************************************************************/ + scp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance); + + if (false == ogs_sbi_client_send_via_scp_or_sepp( + scp_client ? scp_client : sepp_client, + ogs_sbi_client_handler, request, xact)) { + strerror = ogs_msprintf("ogs_sbi_client_send_via_scp_or_sepp() failed"); + goto cleanup; + } + + ogs_sbi_response_free(response); + ogs_sbi_message_free(&message); + + return OGS_OK; + +cleanup: + ogs_assert(strerror); + ogs_error("%s", strerror); + + ogs_free(strerror); + + ogs_sbi_xact_remove(xact); + + ogs_sbi_response_free(response); + ogs_sbi_message_free(&message); + + return OGS_ERROR; +} + static void build_default_discovery_parameter( ogs_sbi_request_t *request, ogs_sbi_service_type_e service_type, @@ -730,6 +919,38 @@ static void build_default_discovery_parameter( discovery_option->num_of_service_names, discovery_option->service_names[0]); } + + if (discovery_option->num_of_target_plmn_list) { + char *v = ogs_sbi_discovery_option_build_plmn_list( + discovery_option->target_plmn_list, + discovery_option->num_of_target_plmn_list); + if (v) { + ogs_sbi_header_set(request->http.headers, + OGS_SBI_CUSTOM_DISCOVERY_TARGET_PLMN_LIST, v); + ogs_free(v); + } else { + ogs_warn("invalid target-plmn-list failed[%d:%06x]", + discovery_option->num_of_target_plmn_list, + ogs_plmn_id_hexdump( + &discovery_option->target_plmn_list[0])); + } + } + + if (discovery_option->num_of_requester_plmn_list) { + char *v = ogs_sbi_discovery_option_build_plmn_list( + discovery_option->requester_plmn_list, + discovery_option->num_of_requester_plmn_list); + if (v) { + ogs_sbi_header_set(request->http.headers, + OGS_SBI_CUSTOM_DISCOVERY_REQUESTER_PLMN_LIST, v); + ogs_free(v); + } else { + ogs_warn("invalid target-plmn-list failed[%d:%06x]", + discovery_option->num_of_requester_plmn_list, + ogs_plmn_id_hexdump( + &discovery_option->requester_plmn_list[0])); + } + } } if (local_discovery_option) diff --git a/lib/sbi/server.c b/lib/sbi/server.c index af5cb8aad..151bcf033 100644 --- a/lib/sbi/server.c +++ b/lib/sbi/server.c @@ -53,16 +53,35 @@ void ogs_sbi_server_final(void) } ogs_sbi_server_t *ogs_sbi_server_add( - ogs_sockaddr_t *addr, ogs_sockopt_t *option) + const char *interface, + OpenAPI_uri_scheme_e scheme, ogs_sockaddr_t *addr, + ogs_sockopt_t *option) { ogs_sbi_server_t *server = NULL; ogs_assert(addr); + ogs_assert(scheme); ogs_pool_alloc(&server_pool, &server); ogs_assert(server); memset(server, 0, sizeof(ogs_sbi_server_t)); + if (interface) + server->interface = ogs_strdup(interface); + + server->scheme = scheme; + + if (ogs_sbi_self()->tls.server.private_key) + server->private_key = + ogs_strdup(ogs_sbi_self()->tls.server.private_key); + if (ogs_sbi_self()->tls.server.cert) + server->cert = ogs_strdup(ogs_sbi_self()->tls.server.cert); + + server->verify_client = ogs_sbi_self()->tls.server.verify_client; + if (ogs_sbi_self()->tls.server.verify_client_cacert) + server->verify_client_cacert = + ogs_strdup(ogs_sbi_self()->tls.server.verify_client_cacert); + ogs_assert(OGS_OK == ogs_copyaddrinfo(&server->node.addr, addr)); if (option) server->node.option = ogs_memdup(option, sizeof *option); @@ -78,6 +97,9 @@ void ogs_sbi_server_remove(ogs_sbi_server_t *server) ogs_list_remove(&ogs_sbi_self()->server_list, server); + if (server->interface) + ogs_free(server->interface); + ogs_assert(server->node.addr); ogs_freeaddrinfo(server->node.addr); if (server->node.option) @@ -85,6 +107,13 @@ void ogs_sbi_server_remove(ogs_sbi_server_t *server) if (server->advertise) ogs_freeaddrinfo(server->advertise); + if (server->verify_client_cacert) + ogs_free(server->verify_client_cacert); + if (server->private_key) + ogs_free(server->private_key); + if (server->cert) + ogs_free(server->cert); + ogs_pool_free(&server_pool, server); } @@ -210,3 +239,54 @@ ogs_sbi_server_t *ogs_sbi_server_from_stream(ogs_sbi_stream_t *stream) { return ogs_sbi_server_actions.from_stream(stream); } + +char *ogs_sbi_server_id_context(ogs_sbi_server_t *server) +{ + return ogs_msprintf("%d", (int)ogs_pool_index(&server_pool, server)); +} + +static ogs_sbi_server_t *ogs_sbi_server_find_by_interface( + ogs_sbi_server_t *current, const char *interface) +{ + ogs_sbi_server_t *server = NULL; + + server = current ? + ogs_list_next(current) : ogs_list_first(&ogs_sbi_self()->server_list); + + for (; server; server = ogs_list_next(server)) { + if (interface == NULL) { + if (server->interface == NULL) + return server; + } else { + if (server->interface && strcmp(interface, server->interface) == 0) + return server; + } + } + + return NULL; +} + +ogs_sbi_server_t *ogs_sbi_server_first(void) +{ + return ogs_sbi_server_find_by_interface(NULL, NULL); +} + +ogs_sbi_server_t *ogs_sbi_server_next(ogs_sbi_server_t *current) +{ + ogs_assert(current); + return ogs_sbi_server_find_by_interface(current, NULL); +} + +ogs_sbi_server_t *ogs_sbi_server_first_by_interface(const char *interface) +{ + ogs_assert(interface); + return ogs_sbi_server_find_by_interface(NULL, interface); +} + +ogs_sbi_server_t *ogs_sbi_server_next_by_interface( + ogs_sbi_server_t *current, const char *interface) +{ + ogs_assert(current); + ogs_assert(interface); + return ogs_sbi_server_find_by_interface(current, interface); +} diff --git a/lib/sbi/server.h b/lib/sbi/server.h index c112f9330..50480713f 100644 --- a/lib/sbi/server.h +++ b/lib/sbi/server.h @@ -37,6 +37,12 @@ typedef struct ogs_sbi_server_s { ogs_socknode_t node; ogs_sockaddr_t *advertise; + char *interface; + OpenAPI_uri_scheme_e scheme; + char *private_key, *cert; + bool verify_client; + char *verify_client_cacert; + SSL_CTX *ssl_ctx; int (*cb)(ogs_sbi_request_t *request, void *data); @@ -65,7 +71,9 @@ void ogs_sbi_server_init(int num_of_session_pool, int num_of_stream_pool); void ogs_sbi_server_final(void); ogs_sbi_server_t *ogs_sbi_server_add( - ogs_sockaddr_t *addr, ogs_sockopt_t *option); + const char *interface, + OpenAPI_uri_scheme_e scheme, ogs_sockaddr_t *addr, + ogs_sockopt_t *option); void ogs_sbi_server_remove(ogs_sbi_server_t *server); void ogs_sbi_server_remove_all(void); @@ -87,6 +95,13 @@ bool ogs_sbi_server_send_problem( ogs_sbi_stream_t *stream, OpenAPI_problem_details_t *problem); ogs_sbi_server_t *ogs_sbi_server_from_stream(ogs_sbi_stream_t *stream); +char *ogs_sbi_server_id_context(ogs_sbi_server_t *server); + +ogs_sbi_server_t *ogs_sbi_server_first(void); +ogs_sbi_server_t *ogs_sbi_server_next(ogs_sbi_server_t *current); +ogs_sbi_server_t *ogs_sbi_server_first_by_interface(const char *interface); +ogs_sbi_server_t *ogs_sbi_server_next_by_interface( + ogs_sbi_server_t *current, const char *interface); #ifdef __cplusplus } diff --git a/lib/sbi/types.h b/lib/sbi/types.h index e7c40f069..0fb5cc3ef 100644 --- a/lib/sbi/types.h +++ b/lib/sbi/types.h @@ -28,6 +28,9 @@ extern "C" { #endif +#define OGS_SBI_INTERFACE_NAME_SEPP "sepp" +#define OGS_SBI_INTERFACE_NAME_N32F "n32f" + typedef enum { OGS_SBI_SERVICE_TYPE_NULL = 0, @@ -153,6 +156,8 @@ typedef enum { #define OGS_SBI_SERVICE_NAME_NUDSF_DR "nudsf-dr" #define OGS_SBI_SERVICE_NAME_NNSSAAF_NSSAA "nnssaaf-nssaa" +#define OGS_SBI_SERVICE_NAME_N32C_HANDSHAKE "n32c-handshake" + #define OGS_SBI_SERVICE_NAME_NAMF_CALLBACK "namf-callback" #define OGS_SBI_SERVICE_NAME_NSMF_CALLBACK "nsmf-callback" diff --git a/lib/sctp/meson.build b/lib/sctp/meson.build index 3eaaa165b..fdbecfc02 100644 --- a/lib/sctp/meson.build +++ b/lib/sctp/meson.build @@ -59,10 +59,10 @@ libsctp = library('ogssctp', version : libogslib_version, c_args : '-DOGS_SCTP_COMPILATION', include_directories : [libsctp_inc, libinc], - dependencies : [libcore_dep, libapp_dep, sctp_dep], + dependencies : [libapp_dep, sctp_dep], install : true) libsctp_dep = declare_dependency( link_with : libsctp, include_directories : [libsctp_inc, libinc], - dependencies : [libcore_dep, libapp_dep, sctp_dep]) + dependencies : [libapp_dep, sctp_dep]) diff --git a/misc/db/open5gs-dbctl b/misc/db/open5gs-dbctl index 79b9affff..8ea7ccf4a 100755 --- a/misc/db/open5gs-dbctl +++ b/misc/db/open5gs-dbctl @@ -175,7 +175,7 @@ if [ "$1" = "add" ]; then }, \"ue\": { - \"addr\": \"$IP\" + \"ipv4\": \"$IP\" }, \"pcc_rule\": [], \"_id\": new ObjectId(), @@ -386,7 +386,7 @@ if [ "$1" = "addT1" ]; then }, \"ue\": { - \"addr\": \"$IP\" + \"ipv4\": \"$IP\" }, \"pcc_rule\": [], \"_id\": new ObjectId(), @@ -417,7 +417,7 @@ if [ "$1" = "addT1" ]; then }, \"ue\": { - \"addr\": \"$IP\" + \"ipv4\": \"$IP\" }, \"pcc_rule\": [], \"_id\": new ObjectId(), @@ -448,7 +448,7 @@ if [ "$1" = "addT1" ]; then }, \"ue\": { - \"addr\": \"$IP\" + \"ipv4\": \"$IP\" }, \"pcc_rule\": [], \"_id\": new ObjectId(), @@ -512,7 +512,7 @@ if [ "$1" = "static_ip" ]; then IMSI=$2 IP=$3 - mongosh --eval "db.subscribers.updateOne({\"imsi\": \"$IMSI\"},{\$set: { \"slice.0.session.0.ue.addr\": \"$IP\" }});" $DB_URI + mongosh --eval "db.subscribers.updateOne({\"imsi\": \"$IMSI\"},{\$set: { \"slice.0.session.0.ue.ipv4\": \"$IP\" }});" $DB_URI exit $? fi @@ -524,7 +524,7 @@ if [ "$1" = "static_ip6" ]; then IMSI=$2 IP=$3 - mongosh --eval "db.subscribers.updateOne({\"imsi\": \"$IMSI\"},{\$set: { \"slice.0.session.0.ue.addr6\": \"$IP\" }});" $DB_URI + mongosh --eval "db.subscribers.updateOne({\"imsi\": \"$IMSI\"},{\$set: { \"slice.0.session.0.ue.ipv6\": \"$IP\" }});" $DB_URI exit $? fi @@ -809,7 +809,7 @@ if [ "$1" = "showpretty" ]; then exit $? fi if [ "$1" = "showfiltered" ]; then - mongosh --eval "db.subscribers.find({},{'_id':0,'imsi':1,'security.k':1, 'security.opc':1,'slice.session.name':1,'slice.session.ue.addr':1})" $DB_URI + mongosh --eval "db.subscribers.find({},{'_id':0,'imsi':1,'security.k':1, 'security.opc':1,'slice.session.name':1,'slice.session.ue.ipv4':1})" $DB_URI exit $? fi diff --git a/misc/ipv6-netconf.sh b/misc/ipv6-netconf.sh index 7870358ae..3b1dc9003 100755 --- a/misc/ipv6-netconf.sh +++ b/misc/ipv6-netconf.sh @@ -10,6 +10,14 @@ if [ "$SYSTEM" = "Linux" ]; then ip addr add 10.45.0.1/16 dev ogstun ip addr del 2001:db8:cafe::1/48 dev ogstun 2> /dev/null ip addr add 2001:db8:cafe::1/48 dev ogstun + ip addr del 10.46.0.1/16 dev ogstun2 2> /dev/null + ip addr add 10.46.0.1/16 dev ogstun2 + ip addr del 2001:db8:babe::1/48 dev ogstun2 2> /dev/null + ip addr add 2001:db8:babe::1/48 dev ogstun2 + ip addr del 10.47.0.1/16 dev ogstun3 2> /dev/null + ip addr add 10.47.0.1/16 dev ogstun3 + ip addr del 2001:db8:face::1/48 dev ogstun3 2> /dev/null + ip addr add 2001:db8:face::1/48 dev ogstun3 ip link set ogstun up ip addr del fd69:f21d:873c:fa::1 dev lo 2> /dev/null ip addr del fd69:f21d:873c:fa::2 dev lo 2> /dev/null @@ -31,28 +39,90 @@ if [ "$SYSTEM" = "Linux" ]; then ip addr del fd69:f21d:873c:fa::18 dev lo 2> /dev/null ip addr del fd69:f21d:873c:fa::19 dev lo 2> /dev/null ip addr del fd69:f21d:873c:fa::20 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fa::200 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fa::201 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fa::202 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fa::250 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fa::251 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fa::252 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::1 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::2 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::3 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::4 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::5 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::6 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::7 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::8 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::9 dev lo 2> /dev/null ip addr del fd69:f21d:873c:fb::10 dev lo 2> /dev/null - ip addr add fd69:f21d:873c:fa::1 dev lo - ip addr add fd69:f21d:873c:fa::2 dev lo - ip addr add fd69:f21d:873c:fa::3 dev lo - ip addr add fd69:f21d:873c:fa::4 dev lo - ip addr add fd69:f21d:873c:fa::5 dev lo - ip addr add fd69:f21d:873c:fa::6 dev lo - ip addr add fd69:f21d:873c:fa::7 dev lo - ip addr add fd69:f21d:873c:fa::8 dev lo - ip addr add fd69:f21d:873c:fa::9 dev lo - ip addr add fd69:f21d:873c:fa::10 dev lo - ip addr add fd69:f21d:873c:fa::11 dev lo - ip addr add fd69:f21d:873c:fa::12 dev lo - ip addr add fd69:f21d:873c:fa::13 dev lo - ip addr add fd69:f21d:873c:fa::14 dev lo - ip addr add fd69:f21d:873c:fa::15 dev lo - ip addr add fd69:f21d:873c:fa::16 dev lo - ip addr add fd69:f21d:873c:fa::17 dev lo - ip addr add fd69:f21d:873c:fa::18 dev lo - ip addr add fd69:f21d:873c:fa::19 dev lo - ip addr add fd69:f21d:873c:fa::20 dev lo - ip addr add fd69:f21d:873c:fb::10 dev lo + ip addr del fd69:f21d:873c:fb::11 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::12 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::13 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::14 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::15 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::16 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::17 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::18 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::19 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::20 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::200 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::201 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::202 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::250 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::251 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fb::252 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::1 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::2 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::3 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::4 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::5 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::6 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::7 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::8 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::9 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::10 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::11 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::12 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::13 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::14 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::15 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::16 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::17 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::18 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::19 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::20 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::200 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::201 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::202 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::250 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::251 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fc::252 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::1 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::2 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::3 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::4 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::5 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::6 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::7 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::8 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::9 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::10 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::11 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::12 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::13 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::14 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::15 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::16 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::17 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::18 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::19 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::20 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::200 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::201 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::202 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::250 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::251 dev lo 2> /dev/null + ip addr del fd69:f21d:873c:fd::252 dev lo 2> /dev/null else sysctl -w net.inet.ip.forwarding=1 sysctl -w net.inet6.ip6.forwarding=1 @@ -75,7 +145,87 @@ else ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255 ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255 ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.0.200 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.0.201 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.0.202 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.0.250 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.0.251 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.0.252 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.2 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.3 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.4 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.5 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.6 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.7 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.8 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.9 netmask 255.255.255.255 ifconfig lo0 alias 127.0.1.10 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.11 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.12 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.13 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.14 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.15 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.16 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.17 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.18 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.19 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.20 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.200 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.201 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.202 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.250 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.251 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.252 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.2 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.3 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.4 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.5 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.6 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.7 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.8 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.9 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.10 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.11 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.12 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.13 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.14 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.15 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.16 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.17 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.18 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.19 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.20 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.200 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.201 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.202 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.250 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.251 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.252 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.2 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.3 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.4 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.5 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.6 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.7 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.8 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.9 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.10 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.11 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.12 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.13 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.14 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.15 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.16 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.17 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.18 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.19 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.20 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.200 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.201 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.202 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.250 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.251 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.252 netmask 255.255.255.255 ifconfig lo0 inet6 delete fd69:f21d:873c:fa::1 prefixlen 128 2> /dev/null ifconfig lo0 inet6 delete fd69:f21d:873c:fa::2 prefixlen 128 2> /dev/null ifconfig lo0 inet6 delete fd69:f21d:873c:fa::3 prefixlen 128 2> /dev/null @@ -96,7 +246,90 @@ else ifconfig lo0 inet6 delete fd69:f21d:873c:fa::18 prefixlen 128 2> /dev/null ifconfig lo0 inet6 delete fd69:f21d:873c:fa::19 prefixlen 128 2> /dev/null ifconfig lo0 inet6 delete fd69:f21d:873c:fa::20 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fa::200 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fa::201 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fa::202 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fa::250 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fa::251 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fa::252 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::1 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::2 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::3 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::4 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::5 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::6 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::7 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::8 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::9 prefixlen 128 2> /dev/null ifconfig lo0 inet6 delete fd69:f21d:873c:fb::10 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::11 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::12 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::13 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::14 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::15 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::16 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::17 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::18 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::19 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::20 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::200 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::201 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::202 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::250 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::251 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fb::252 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::1 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::2 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::3 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::4 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::5 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::6 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::7 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::8 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::9 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::10 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::11 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::12 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::13 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::14 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::15 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::16 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::17 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::18 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::19 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::20 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::200 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::201 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::202 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::250 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::251 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fc::252 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::1 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::2 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::3 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::4 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::5 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::6 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::7 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::8 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::9 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::10 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::11 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::12 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::13 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::14 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::15 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::16 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::17 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::18 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::19 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::20 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::200 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::201 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::202 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::250 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::251 prefixlen 128 2> /dev/null + ifconfig lo0 inet6 delete fd69:f21d:873c:fd::252 prefixlen 128 2> /dev/null ifconfig lo0 inet6 add fd69:f21d:873c:fa::1 prefixlen 128 ifconfig lo0 inet6 add fd69:f21d:873c:fa::2 prefixlen 128 ifconfig lo0 inet6 add fd69:f21d:873c:fa::3 prefixlen 128 @@ -117,11 +350,98 @@ else ifconfig lo0 inet6 add fd69:f21d:873c:fa::18 prefixlen 128 ifconfig lo0 inet6 add fd69:f21d:873c:fa::19 prefixlen 128 ifconfig lo0 inet6 add fd69:f21d:873c:fa::20 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fa::200 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fa::201 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fa::202 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fa::250 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fa::251 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fa::252 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::1 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::2 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::3 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::4 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::5 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::6 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::7 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::8 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::9 prefixlen 128 ifconfig lo0 inet6 add fd69:f21d:873c:fb::10 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::11 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::12 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::13 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::14 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::15 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::16 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::17 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::18 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::19 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::20 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::200 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::201 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::202 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::250 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::251 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fb::252 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::1 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::2 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::3 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::4 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::5 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::6 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::7 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::8 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::9 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::10 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::11 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::12 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::13 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::14 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::15 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::16 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::17 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::18 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::19 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::20 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::200 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::201 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::202 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::250 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::251 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fc::252 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::1 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::2 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::3 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::4 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::5 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::6 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::7 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::8 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::9 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::10 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::11 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::12 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::13 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::14 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::15 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::16 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::17 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::18 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::19 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::20 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::200 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::201 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::202 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::250 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::251 prefixlen 128 + ifconfig lo0 inet6 add fd69:f21d:873c:fd::252 prefixlen 128 if [ "$SYSTEM" = "Darwin" ]; then if ! test -f /etc/pf.anchors/org.open5gs; then sudo sh -c "echo 'nat on {en0} from 10.45.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs" sudo sh -c "echo 'nat on {en0} from 2001:db8:cafe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs" + sudo sh -c "echo 'nat on {en0} from 10.46.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs" + sudo sh -c "echo 'nat on {en0} from 2001:db8:babe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs" + sudo sh -c "echo 'nat on {en0} from 10.47.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs" + sudo sh -c "echo 'nat on {en0} from 2001:db8:face::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs" fi pfctl -e -f /etc/pf.anchors/org.open5gs fi diff --git a/misc/make-certs.sh b/misc/make-certs.sh index 125f2192a..42e47aa7e 100755 --- a/misc/make-certs.sh +++ b/misc/make-certs.sh @@ -15,7 +15,7 @@ touch demoCA/index.txt openssl req -new -x509 -days 3650 -newkey rsa:2048 -nodes -keyout $1/ca.key -out $1/ca.crt \ -subj /CN=ca.localdomain/C=KO/ST=Seoul/O=NeoPlane -for i in amf ausf bsf hss mme nrf nssf pcf pcrf scp smf udm udr testserver testclient +for i in amf ausf bsf hss mme nrf scp sepp1 sepp2 sepp3 nssf pcf pcrf smf udm udr do openssl genpkey -algorithm rsa -pkeyopt rsa_keygen_bits:2048 \ -out $1/$i.key diff --git a/misc/netconf.sh b/misc/netconf.sh index 78da22d22..d6a16b56e 100755 --- a/misc/netconf.sh +++ b/misc/netconf.sh @@ -14,6 +14,14 @@ if [ "$SYSTEM" = "Linux" ]; then ip addr add 10.45.0.1/16 dev ogstun ip addr del 2001:db8:cafe::1/48 dev ogstun 2> /dev/null ip addr add 2001:db8:cafe::1/48 dev ogstun + ip addr del 10.46.0.1/16 dev ogstun2 2> /dev/null + ip addr add 10.46.0.1/16 dev ogstun2 + ip addr del 2001:db8:babe::1/48 dev ogstun2 2> /dev/null + ip addr add 2001:db8:babe::1/48 dev ogstun2 + ip addr del 10.47.0.1/16 dev ogstun3 2> /dev/null + ip addr add 10.47.0.1/16 dev ogstun3 + ip addr del 2001:db8:face::1/48 dev ogstun3 2> /dev/null + ip addr add 2001:db8:face::1/48 dev ogstun3 ip link set ogstun up else sysctl -w net.inet.ip.forwarding=1 @@ -37,13 +45,95 @@ else ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255 ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255 ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.0.200 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.0.201 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.0.202 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.0.250 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.0.251 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.0.252 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.2 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.3 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.4 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.5 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.6 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.7 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.8 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.9 netmask 255.255.255.255 ifconfig lo0 alias 127.0.1.10 netmask 255.255.255.255 ifconfig lo0 alias 127.0.1.11 netmask 255.255.255.255 ifconfig lo0 alias 127.0.1.12 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.13 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.14 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.15 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.16 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.17 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.18 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.19 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.20 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.200 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.201 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.202 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.250 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.251 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.1.252 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.2 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.3 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.4 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.5 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.6 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.7 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.8 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.9 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.10 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.11 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.12 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.13 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.14 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.15 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.16 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.17 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.18 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.19 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.20 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.200 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.201 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.202 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.250 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.251 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.2.252 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.2 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.3 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.4 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.5 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.6 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.7 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.8 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.9 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.10 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.11 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.12 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.13 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.14 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.15 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.16 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.17 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.18 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.19 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.20 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.200 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.201 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.202 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.250 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.251 netmask 255.255.255.255 + ifconfig lo0 alias 127.0.3.252 netmask 255.255.255.255 if [ "$SYSTEM" = "Darwin" ]; then if ! test -f /etc/pf.anchors/org.open5gs; then sudo sh -c "echo 'nat on {en0} from 10.45.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs" sudo sh -c "echo 'nat on {en0} from 2001:db8:cafe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs" + sudo sh -c "echo 'nat on {en0} from 10.46.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs" + sudo sh -c "echo 'nat on {en0} from 2001:db8:babe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs" + sudo sh -c "echo 'nat on {en0} from 10.47.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs" + sudo sh -c "echo 'nat on {en0} from 2001:db8:face::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs" fi pfctl -e -f /etc/pf.anchors/org.open5gs fi diff --git a/src/amf/context.c b/src/amf/context.c index a714ecec4..017ba2495 100644 --- a/src/amf/context.c +++ b/src/amf/context.c @@ -58,11 +58,11 @@ void amf_context_init(void) ogs_list_init(&self.ngap_list6); /* Allocate TWICE the pool to check if maximum number of gNBs is reached */ - ogs_pool_init(&amf_gnb_pool, ogs_app()->max.peer*2); - ogs_pool_init(&amf_ue_pool, ogs_app()->max.ue); - ogs_pool_init(&ran_ue_pool, ogs_app()->max.ue); + ogs_pool_init(&amf_gnb_pool, ogs_global_conf()->max.peer*2); + ogs_pool_init(&amf_ue_pool, ogs_global_conf()->max.ue); + ogs_pool_init(&ran_ue_pool, ogs_global_conf()->max.ue); ogs_pool_init(&amf_sess_pool, ogs_app()->pool.sess); - ogs_pool_init(&m_tmsi_pool, ogs_app()->max.ue*2); + ogs_pool_init(&m_tmsi_pool, ogs_global_conf()->max.ue*2); ogs_pool_random_id_generate(&m_tmsi_pool); ogs_list_init(&self.gnb_list); @@ -130,7 +130,7 @@ static int amf_context_validation(void) if (ogs_list_first(&self.ngap_list) == NULL && ogs_list_first(&self.ngap_list6) == NULL) { - ogs_error("No amf.ngap in '%s'", ogs_app()->file); + ogs_error("No amf.ngap.address in '%s'", ogs_app()->file); return OGS_ERROR; } @@ -222,126 +222,143 @@ int amf_context_parse_config(void) const char *v = ogs_yaml_iter_value(&amf_iter); if (v) self.relative_capacity = atoi(v); } else if (!strcmp(amf_key, "ngap")) { - ogs_yaml_iter_t ngap_array, ngap_iter; - ogs_yaml_iter_recurse(&amf_iter, &ngap_array); - do { - int family = AF_UNSPEC; - int i, num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = self.ngap_port; - const char *dev = NULL; - ogs_sockaddr_t *addr = NULL; + ogs_yaml_iter_t ngap_iter; + ogs_yaml_iter_recurse(&amf_iter, &ngap_iter); + while (ogs_yaml_iter_next(&ngap_iter)) { + const char *ngap_key = ogs_yaml_iter_key(&ngap_iter); + ogs_assert(ngap_key); + if (!strcmp(ngap_key, "server")) { + ogs_yaml_iter_t server_iter, server_array; + ogs_yaml_iter_recurse(&ngap_iter, &server_array); + do { + int family = AF_UNSPEC; + int i, num = 0; + const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; + uint16_t port = self.ngap_port; + const char *dev = NULL; + ogs_sockaddr_t *addr = NULL; - ogs_sockopt_t option; - bool is_option = false; + ogs_sockopt_t option; + bool is_option = false; - if (ogs_yaml_iter_type(&ngap_array) == - YAML_MAPPING_NODE) { - memcpy(&ngap_iter, &ngap_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(&ngap_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&ngap_array)) - break; - ogs_yaml_iter_recurse(&ngap_array, &ngap_iter); - } else if (ogs_yaml_iter_type(&ngap_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); + if (ogs_yaml_iter_type(&server_array) == + YAML_MAPPING_NODE) { + memcpy(&server_iter, &server_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&server_array)) + break; + ogs_yaml_iter_recurse( + &server_array, &server_iter); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); - while (ogs_yaml_iter_next(&ngap_iter)) { - const char *ngap_key = - ogs_yaml_iter_key(&ngap_iter); - ogs_assert(ngap_key); - if (!strcmp(ngap_key, "family")) { - const char *v = ogs_yaml_iter_value(&ngap_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; + while (ogs_yaml_iter_next(&server_iter)) { + const char *server_key = + ogs_yaml_iter_key(&server_iter); + ogs_assert(server_key); + if (!strcmp(server_key, "family")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) family = atoi(v); + if (family != AF_UNSPEC && + family != AF_INET && + family != AF_INET6) { + ogs_warn("Ignore family(%d) : " + "AF_UNSPEC(%d), " + "AF_INET(%d), AF_INET6(%d) ", + family, + AF_UNSPEC, AF_INET, AF_INET6); + family = AF_UNSPEC; + } + } else if (!strcmp(server_key, "address")) { + ogs_yaml_iter_t hostname_iter; + ogs_yaml_iter_recurse( + &server_iter, &hostname_iter); + ogs_assert(ogs_yaml_iter_type( + &hostname_iter) != + YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &hostname_iter)) + break; + } + + ogs_assert(num < + OGS_MAX_NUM_OF_HOSTNAME); + hostname[num++] = + ogs_yaml_iter_value( + &hostname_iter); + } while ( + ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(server_key, "port")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) port = atoi(v); + } else if (!strcmp(server_key, "dev")) { + dev = ogs_yaml_iter_value(&server_iter); + } else if (!strcmp(server_key, "option")) { + rv = ogs_app_parse_sockopt_config( + &server_iter, &option); + if (rv != OGS_OK) { + ogs_error("ogs_app_parse_socket_" + "config() failed"); + return rv; + } + is_option = true; + } else + ogs_warn("unknown key `%s`", + server_key); } - } else if (!strcmp(ngap_key, "addr") || - !strcmp(ngap_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse( - &ngap_iter, &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&hostname_iter)) - break; - } + addr = NULL; + for (i = 0; i < num; i++) { + rv = ogs_addaddrinfo(&addr, + family, hostname[i], port, 0); + ogs_assert(rv == OGS_OK); + } - ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME); - hostname[num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(ngap_key, "port")) { - const char *v = ogs_yaml_iter_value(&ngap_iter); - if (v) port = atoi(v); - } else if (!strcmp(ngap_key, "dev")) { - dev = ogs_yaml_iter_value(&ngap_iter); - } else if (!strcmp(ngap_key, "option")) { - rv = ogs_app_config_parse_sockopt( - &ngap_iter, &option); - if (rv != OGS_OK) return rv; - is_option = true; - } else - ogs_warn("unknown key `%s`", ngap_key); - } + if (addr) { + if (ogs_global_conf()->parameter. + no_ipv4 == 0) + ogs_socknode_add( + &self.ngap_list, AF_INET, addr, + is_option ? &option : NULL); + if (ogs_global_conf()->parameter. + no_ipv6 == 0) + ogs_socknode_add( + &self.ngap_list6, AF_INET6, addr, + is_option ? &option : NULL); + ogs_freeaddrinfo(addr); + } - addr = NULL; - for (i = 0; i < num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } + if (dev) { + rv = ogs_socknode_probe( + ogs_global_conf()->parameter. + no_ipv4 ? + NULL : &self.ngap_list, + ogs_global_conf()->parameter. + no_ipv6 ? + NULL : &self.ngap_list6, + dev, port, + is_option ? &option : NULL); + ogs_assert(rv == OGS_OK); + } - if (addr) { - if (ogs_app()->parameter.no_ipv4 == 0) - ogs_socknode_add( - &self.ngap_list, AF_INET, addr, - is_option ? &option : NULL); - if (ogs_app()->parameter.no_ipv6 == 0) - ogs_socknode_add( - &self.ngap_list6, AF_INET6, addr, - is_option ? &option : NULL); - ogs_freeaddrinfo(addr); - } - - if (dev) { - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? - NULL : &self.ngap_list, - ogs_app()->parameter.no_ipv6 ? - NULL : &self.ngap_list6, - dev, port, - is_option ? &option : NULL); - ogs_assert(rv == OGS_OK); - } - - } while (ogs_yaml_iter_type(&ngap_array) == - YAML_SEQUENCE_NODE); - - if (ogs_list_first(&self.ngap_list) == NULL && - ogs_list_first(&self.ngap_list6) == NULL) { - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? - NULL : &self.ngap_list, - ogs_app()->parameter.no_ipv6 ? - NULL : &self.ngap_list6, - NULL, self.ngap_port, NULL); - ogs_assert(rv == OGS_OK); + } while (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE); + } else + ogs_warn("unknown key `%s`", ngap_key); } } else if (!strcmp(amf_key, "guami")) { ogs_yaml_iter_t guami_array, guami_iter; @@ -981,8 +998,66 @@ int amf_context_parse_config(void) } } else if (!strcmp(amf_key, "amf_name")) { self.amf_name = ogs_yaml_iter_value(&amf_iter); + + } else if (!strcmp(amf_key, "time")) { + ogs_yaml_iter_t time_iter; + ogs_yaml_iter_recurse(&amf_iter, &time_iter); + while (ogs_yaml_iter_next(&time_iter)) { + const char *time_key = ogs_yaml_iter_key(&time_iter); + ogs_assert(time_key); + if (!strcmp(time_key, "t3502")) { + ogs_yaml_iter_t t3502_iter; + ogs_yaml_iter_recurse(&time_iter, &t3502_iter); + + while (ogs_yaml_iter_next(&t3502_iter)) { + const char *t3502_key = + ogs_yaml_iter_key(&t3502_iter); + ogs_assert(t3502_key); + + if (!strcmp(t3502_key, "value")) { + const char *v = ogs_yaml_iter_value(&t3502_iter); + if (v) + self.time.t3502.value = atoll(v); + } else + ogs_warn("unknown key `%s`", t3502_key); + } + } else if (!strcmp(time_key, "t3512")) { + ogs_yaml_iter_t t3512_iter; + ogs_yaml_iter_recurse(&time_iter, &t3512_iter); + + while (ogs_yaml_iter_next(&t3512_iter)) { + const char *t3512_key = + ogs_yaml_iter_key(&t3512_iter); + ogs_assert(t3512_key); + + if (!strcmp(t3512_key, "value")) { + const char *v = ogs_yaml_iter_value(&t3512_iter); + if (v) + self.time.t3512.value = atoll(v); + } else + ogs_warn("unknown key `%s`", t3512_key); + } + } else if (!strcmp(time_key, "t3412")) { + /* handle config in mme */ + } else if (!strcmp(time_key, "nf_instance")) { + /* handle config in app library */ + } else if (!strcmp(time_key, "subscription")) { + /* handle config in app library */ + } else if (!strcmp(time_key, "message")) { + /* handle config in app library */ + } else if (!strcmp(time_key, "handover")) { + /* handle config in app library */ + } else + ogs_warn("unknown key `%s`", time_key); + } + } else if (!strcmp(amf_key, "default")) { + /* handle config in sbi library */ } else if (!strcmp(amf_key, "sbi")) { /* handle config in sbi library */ + } else if (!strcmp(amf_key, "nrf")) { + /* handle config in sbi library */ + } else if (!strcmp(amf_key, "scp")) { + /* handle config in sbi library */ } else if (!strcmp(amf_key, "service_name")) { /* handle config in sbi library */ } else if (!strcmp(amf_key, "discovery")) { @@ -992,57 +1067,6 @@ int amf_context_parse_config(void) } else ogs_warn("unknown key `%s`", amf_key); } - } else if (!strcmp(root_key, "time")) { - ogs_yaml_iter_t time_iter; - ogs_yaml_iter_recurse(&root_iter, &time_iter); - while (ogs_yaml_iter_next(&time_iter)) { - const char *time_key = ogs_yaml_iter_key(&time_iter); - ogs_assert(time_key); - if (!strcmp(time_key, "t3502")) { - ogs_yaml_iter_t t3502_iter; - ogs_yaml_iter_recurse(&time_iter, &t3502_iter); - - while (ogs_yaml_iter_next(&t3502_iter)) { - const char *t3502_key = - ogs_yaml_iter_key(&t3502_iter); - ogs_assert(t3502_key); - - if (!strcmp(t3502_key, "value")) { - const char *v = ogs_yaml_iter_value(&t3502_iter); - if (v) - self.time.t3502.value = atoll(v); - } else - ogs_warn("unknown key `%s`", t3502_key); - } - } else if (!strcmp(time_key, "t3512")) { - ogs_yaml_iter_t t3512_iter; - ogs_yaml_iter_recurse(&time_iter, &t3512_iter); - - while (ogs_yaml_iter_next(&t3512_iter)) { - const char *t3512_key = - ogs_yaml_iter_key(&t3512_iter); - ogs_assert(t3512_key); - - if (!strcmp(t3512_key, "value")) { - const char *v = ogs_yaml_iter_value(&t3512_iter); - if (v) - self.time.t3512.value = atoll(v); - } else - ogs_warn("unknown key `%s`", t3512_key); - } - } else if (!strcmp(time_key, "t3412")) { - /* handle config in mme */ - } else if (!strcmp(time_key, "nf_instance")) { - /* handle config in app library */ - } else if (!strcmp(time_key, "subscription")) { - /* handle config in app library */ - } else if (!strcmp(time_key, "message")) { - /* handle config in app library */ - } else if (!strcmp(time_key, "handover")) { - /* handle config in app library */ - } else - ogs_warn("unknown key `%s`", time_key); - } } } @@ -1309,14 +1333,14 @@ ran_ue_t *ran_ue_add(amf_gnb_t *gnb, uint32_t ran_ue_ngap_id) } ran_ue->index = ogs_pool_index(&ran_ue_pool, ran_ue); - ogs_assert(ran_ue->index > 0 && ran_ue->index <= ogs_app()->max.ue); + ogs_assert(ran_ue->index > 0 && ran_ue->index <= ogs_global_conf()->max.ue); ran_ue->ran_ue_ngap_id = ran_ue_ngap_id; ran_ue->amf_ue_ngap_id = ran_ue->index; /* * SCTP output stream identification - * Default ogs_app()->parameter.sctp_streams : 30 + * Default ogs_global_conf()->parameter.sctp_streams : 30 * 0 : Non UE signalling * 1-29 : UE specific association */ @@ -2390,7 +2414,7 @@ int amf_m_tmsi_pool_generate(void) int index = 0; ogs_trace("M-TMSI Pool try to generate..."); - while (index < ogs_app()->max.ue*2) { + while (index < ogs_global_conf()->max.ue*2) { amf_m_tmsi_t *m_tmsi = NULL; int conflict = 0; diff --git a/src/amf/context.h b/src/amf/context.h index 077fb64ff..4bcb091a5 100644 --- a/src/amf/context.h +++ b/src/amf/context.h @@ -246,6 +246,9 @@ struct amf_ue_s { char *supi; /* TS33.501 : SUPI */ ogs_nas_5gs_mobile_identity_suci_t nas_mobile_identity_suci; + /* Home PLMN ID */ + ogs_plmn_id_t home_plmn_id; + char *pei; uint8_t masked_imeisv[OGS_MAX_IMEISV_LEN]; int masked_imeisv_len; diff --git a/src/amf/gmm-handler.c b/src/amf/gmm-handler.c index 64790d3d8..8117ac017 100644 --- a/src/amf/gmm-handler.c +++ b/src/amf/gmm-handler.c @@ -153,6 +153,15 @@ ogs_nas_5gmm_cause_t gmm_handle_registration_request(amf_ue_t *amf_ue, mobile_identity_suci->protection_scheme_id); return OGS_5GMM_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE; } + ogs_nas_to_plmn_id(&amf_ue->home_plmn_id, + &mobile_identity_suci->nas_plmn_id); + + gmm_cause = gmm_cause_from_access_control(&amf_ue->home_plmn_id); + if (gmm_cause != OGS_5GMM_CAUSE_REQUEST_ACCEPTED) { + ogs_error("Rejected by PLMN-ID access control"); + return gmm_cause; + } + amf_ue_set_suci(amf_ue, mobile_identity); ogs_info("[%s] SUCI", amf_ue->suci); break; @@ -289,18 +298,6 @@ ogs_nas_5gmm_cause_t gmm_handle_registration_request(amf_ue_t *amf_ue, memcpy(&amf_ue->nr_cgi, &ran_ue->saved.nr_cgi, sizeof(ogs_nr_cgi_t)); amf_ue->ue_location_timestamp = ogs_time_now(); - /* Check PLMN-ID access control */ - gmm_cause = gmm_cause_from_access_control(&amf_ue->nr_tai.plmn_id); - if (gmm_cause != OGS_5GMM_CAUSE_REQUEST_ACCEPTED) { - ogs_error("Rejected by PLMN-ID(in TAI) access control"); - return gmm_cause; - } - gmm_cause = gmm_cause_from_access_control(&amf_ue->nr_cgi.plmn_id); - if (gmm_cause != OGS_5GMM_CAUSE_REQUEST_ACCEPTED) { - ogs_error("Rejected by PLMN-ID(in CGI) access control"); - return gmm_cause; - } - /* Check TAI */ served_tai_index = amf_find_served_tai(&amf_ue->nr_tai); if (served_tai_index < 0) { @@ -539,7 +536,6 @@ ogs_nas_5gmm_cause_t gmm_handle_service_request(amf_ue_t *amf_ue, ogs_nas_5gs_service_request_t *service_request) { int served_tai_index = 0; - uint8_t gmm_cause; ran_ue_t *ran_ue = NULL; ogs_nas_key_set_identifier_t *ngksi = NULL; @@ -634,18 +630,6 @@ ogs_nas_5gmm_cause_t gmm_handle_service_request(amf_ue_t *amf_ue, memcpy(&amf_ue->nr_cgi, &ran_ue->saved.nr_cgi, sizeof(ogs_nr_cgi_t)); amf_ue->ue_location_timestamp = ogs_time_now(); - /* Check PLMN-ID access control */ - gmm_cause = gmm_cause_from_access_control(&amf_ue->nr_tai.plmn_id); - if (gmm_cause != OGS_5GMM_CAUSE_REQUEST_ACCEPTED) { - ogs_error("Rejected by PLMN-ID(in TAI) access control"); - return gmm_cause; - } - gmm_cause = gmm_cause_from_access_control(&amf_ue->nr_cgi.plmn_id); - if (gmm_cause != OGS_5GMM_CAUSE_REQUEST_ACCEPTED) { - ogs_error("Rejected by PLMN-ID(in CGI) access control"); - return gmm_cause; - } - /* Check TAI */ served_tai_index = amf_find_served_tai(&amf_ue->nr_tai); if (served_tai_index < 0) { @@ -879,10 +863,11 @@ int gmm_handle_authentication_response(amf_ue_t *amf_ue, return OGS_OK; } -int gmm_handle_identity_response(amf_ue_t *amf_ue, +ogs_nas_5gmm_cause_t gmm_handle_identity_response(amf_ue_t *amf_ue, ogs_nas_5gs_identity_response_t *identity_response) { ran_ue_t *ran_ue = NULL; + uint8_t gmm_cause; ogs_nas_5gs_mobile_identity_t *mobile_identity = NULL; ogs_nas_5gs_mobile_identity_suci_t *mobile_identity_suci = NULL; @@ -898,7 +883,7 @@ int gmm_handle_identity_response(amf_ue_t *amf_ue, if (!mobile_identity->length || !mobile_identity->buffer) { ogs_error("No Mobile Identity"); - return OGS_ERROR; + return OGS_5GMM_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE; } mobile_identity_header = @@ -921,8 +906,17 @@ int gmm_handle_identity_response(amf_ue_t *amf_ue, OGS_PROTECTION_SCHEME_PROFILE_B) { ogs_error("Invalid ProtectionSchemeID(%d) in SUCI", mobile_identity_suci->protection_scheme_id); - return OGS_ERROR; + return OGS_5GMM_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE; } + ogs_nas_to_plmn_id(&amf_ue->home_plmn_id, + &mobile_identity_suci->nas_plmn_id); + + gmm_cause = gmm_cause_from_access_control(&amf_ue->home_plmn_id); + if (gmm_cause != OGS_5GMM_CAUSE_REQUEST_ACCEPTED) { + ogs_error("Rejected by PLMN-ID access control"); + return gmm_cause; + } + amf_ue_set_suci(amf_ue, mobile_identity); ogs_info("[%s] SUCI", amf_ue->suci); } else { @@ -930,7 +924,7 @@ int gmm_handle_identity_response(amf_ue_t *amf_ue, mobile_identity_header->type); } - return OGS_OK; + return OGS_5GMM_CAUSE_REQUEST_ACCEPTED; } ogs_nas_5gmm_cause_t gmm_handle_security_mode_complete(amf_ue_t *amf_ue, diff --git a/src/amf/gmm-handler.h b/src/amf/gmm-handler.h index 56d93333d..77c92ca7c 100644 --- a/src/amf/gmm-handler.h +++ b/src/amf/gmm-handler.h @@ -44,7 +44,7 @@ int gmm_handle_deregistration_request(amf_ue_t *amf_ue, int gmm_handle_authentication_response(amf_ue_t *amf_ue, ogs_nas_5gs_authentication_response_t *authentication_response); -int gmm_handle_identity_response(amf_ue_t *amf_ue, +ogs_nas_5gmm_cause_t gmm_handle_identity_response(amf_ue_t *amf_ue, ogs_nas_5gs_identity_response_t *identity_response); ogs_nas_5gmm_cause_t gmm_handle_security_mode_complete(amf_ue_t *amf_ue, diff --git a/src/amf/gmm-sm.c b/src/amf/gmm-sm.c index 0ed9ca095..9ce0a8952 100644 --- a/src/amf/gmm-sm.c +++ b/src/amf/gmm-sm.c @@ -1128,7 +1128,7 @@ void gmm_state_registered(ogs_fsm_t *s, amf_event_t *e) static void common_register_state(ogs_fsm_t *s, amf_event_t *e, gmm_common_state_e state) { - int r, rv, xact_count = 0; + int r, xact_count = 0; ogs_nas_5gmm_cause_t gmm_cause; amf_ue_t *amf_ue = NULL; @@ -1336,16 +1336,24 @@ static void common_register_state(ogs_fsm_t *s, amf_event_t *e, CLEAR_AMF_UE_TIMER(amf_ue->t3570); ogs_info("Identity response"); - rv = gmm_handle_identity_response(amf_ue, + gmm_cause = gmm_handle_identity_response(amf_ue, &nas_message->gmm.identity_response); - if (rv != OGS_OK) { - ogs_error("gmm_handle_identity_response() failed"); + if (gmm_cause != OGS_5GMM_CAUSE_REQUEST_ACCEPTED) { + ogs_error("gmm_handle_identity_response() " + "failed [%d] in type [%d]", + gmm_cause, amf_ue->nas.message_type); + r = nas_5gs_send_gmm_reject(amf_ue, gmm_cause); + ogs_expect(r == OGS_OK); + ogs_assert(r != OGS_ERROR); OGS_FSM_TRAN(s, gmm_state_exception); break; } if (!AMF_UE_HAVE_SUCI(amf_ue)) { ogs_error("No SUCI"); + r = nas_5gs_send_gmm_reject(amf_ue, gmm_cause); + ogs_expect(r == OGS_OK); + ogs_assert(r != OGS_ERROR); OGS_FSM_TRAN(s, gmm_state_exception); break; } diff --git a/src/amf/init.c b/src/amf/init.c index 9c485d646..9a43ecadf 100644 --- a/src/amf/init.c +++ b/src/amf/init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -29,15 +29,19 @@ int amf_initialize(void) { int rv; +#define APP_NAME "amf" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + amf_metrics_init(); ogs_sbi_context_init(OpenAPI_nf_type_AMF); amf_context_init(); - rv = ogs_sbi_context_parse_config("amf", "nrf", "scp"); + rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp"); if (rv != OGS_OK) return rv; - rv = ogs_metrics_context_parse_config("amf"); + rv = ogs_metrics_context_parse_config(APP_NAME); if (rv != OGS_OK) return rv; rv = amf_context_parse_config(); diff --git a/src/amf/namf-handler.c b/src/amf/namf-handler.c index 7594d874b..355e96410 100644 --- a/src/amf/namf-handler.c +++ b/src/amf/namf-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -228,7 +228,9 @@ int amf_namf_comm_handle_n1_n2_message_transfer( ogs_sbi_header_t header; ogs_sbi_client_t *client = NULL; OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; - ogs_sockaddr_t *addr = NULL; + char *fqdn = NULL; + uint16_t fqdn_port = 0; + ogs_sockaddr_t *addr = NULL, *addr6 = NULL; if (!N1N2MessageTransferReqData->n1n2_failure_txf_notif_uri) { ogs_error("[%s:%d] No n1-n2-failure-notification-uri", @@ -236,7 +238,8 @@ int amf_namf_comm_handle_n1_n2_message_transfer( return OGS_ERROR; } - rc = ogs_sbi_getaddr_from_uri(&scheme, &addr, + rc = ogs_sbi_getaddr_from_uri( + &scheme, &fqdn, &fqdn_port, &addr, &addr6, N1N2MessageTransferReqData->n1n2_failure_txf_notif_uri); if (rc == false || scheme == OpenAPI_uri_scheme_NULL) { ogs_error("[%s:%d] Invalid URI [%s]", @@ -246,20 +249,27 @@ int amf_namf_comm_handle_n1_n2_message_transfer( return OGS_ERROR;; } - client = ogs_sbi_client_find(scheme, addr); + client = ogs_sbi_client_find( + scheme, fqdn, fqdn_port, addr, addr6); if (!client) { ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); - client = ogs_sbi_client_add(scheme, addr); + client = ogs_sbi_client_add( + scheme, fqdn, fqdn_port, addr, addr6); if (!client) { - char buf[OGS_ADDRSTRLEN]; - ogs_error("%s: ogs_sbi_client_add() failed [%s]:%d", - OGS_FUNC, OGS_ADDR(addr, buf), OGS_PORT(addr)); + ogs_error("%s: ogs_sbi_client_add() failed", OGS_FUNC); + + ogs_free(fqdn); ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); + return OGS_ERROR; } } OGS_SBI_SETUP_CLIENT(&sess->paging, client); + + ogs_free(fqdn); ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); status = OGS_SBI_HTTP_STATUS_ACCEPTED; N1N2MessageTransferRspData.cause = diff --git a/src/amf/ngap-handler.c b/src/amf/ngap-handler.c index 133a34bd3..42ca46dcc 100644 --- a/src/amf/ngap-handler.c +++ b/src/amf/ngap-handler.c @@ -33,7 +33,7 @@ static bool maximum_number_of_gnbs_is_reached(void) } } - return number_of_gnbs_online >= ogs_app()->max.peer; + return number_of_gnbs_online >= ogs_global_conf()->max.peer; } static bool gnb_plmn_id_is_foreign(amf_gnb_t *gnb) @@ -4066,7 +4066,7 @@ void ngap_handle_handover_notification( NGAP_Cause_PR_radioNetwork, NGAP_CauseRadioNetwork_successful_handover, NGAP_UE_CTX_REL_NG_HANDOVER_COMPLETE, - ogs_app()->time.handover.duration); + ogs_local_conf()->time.handover.duration); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); diff --git a/src/amf/nnssf-handler.c b/src/amf/nnssf-handler.c index 10de73c0f..1df215705 100644 --- a/src/amf/nnssf-handler.c +++ b/src/amf/nnssf-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -28,7 +28,9 @@ int amf_nnssf_nsselection_handle_get( int r; OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; ogs_sbi_client_t *client = NULL, *scp_client = NULL; - ogs_sockaddr_t *addr = NULL; + char *fqdn = NULL; + uint16_t fqdn_port = 0; + ogs_sockaddr_t *addr = NULL, *addr6 = NULL; ogs_sbi_discovery_option_t *discovery_option = NULL; OpenAPI_authorized_network_slice_info_t *AuthorizedNetworkSliceInfo = NULL; @@ -115,7 +117,9 @@ int amf_nnssf_nsselection_handle_get( ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); } else { - rc = ogs_sbi_getaddr_from_uri(&scheme, &addr, NsiInformation->nrf_id); + rc = ogs_sbi_getaddr_from_uri( + &scheme, &fqdn, &fqdn_port, &addr, &addr6, + NsiInformation->nrf_id); if (rc == false || scheme == OpenAPI_uri_scheme_NULL) { ogs_error("[%s:%d] Invalid URI [%s]", amf_ue->supi, sess->psi, NsiInformation->nrf_id); @@ -129,24 +133,26 @@ int amf_nnssf_nsselection_handle_get( return OGS_ERROR; } - client = ogs_sbi_client_find(scheme, addr); + client = ogs_sbi_client_find(scheme, fqdn, fqdn_port, addr, addr6); if (!client) { ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); - client = ogs_sbi_client_add(scheme, addr); + client = ogs_sbi_client_add(scheme, fqdn, fqdn_port, addr, addr6); if (!client) { - char buf[OGS_ADDRSTRLEN]; - ogs_error("%s: ogs_sbi_client_add() failed [%s]:%d", - OGS_FUNC, OGS_ADDR(addr, buf), OGS_PORT(addr)); + ogs_error("%s: ogs_sbi_client_add() failed", OGS_FUNC); ogs_sbi_discovery_option_free(discovery_option); + ogs_free(fqdn); ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); return OGS_ERROR; } } - OGS_SBI_SETUP_CLIENT(&sess->nssf.nrf, client); + + ogs_free(fqdn); ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); r = amf_sess_sbi_discover_by_nsi( sess, OGS_SBI_SERVICE_TYPE_NSMF_PDUSESSION, discovery_option); diff --git a/src/amf/npcf-build.c b/src/amf/npcf-build.c index cf0b59e1d..ba4263412 100644 --- a/src/amf/npcf-build.c +++ b/src/amf/npcf-build.c @@ -51,7 +51,7 @@ ogs_sbi_request_t *amf_npcf_am_policy_control_build_create( memset(&ueLocation, 0, sizeof(ueLocation)); memset(&UeAmbr, 0, sizeof(UeAmbr)); - server = ogs_list_first(&ogs_sbi_self()->server_list); + server = ogs_sbi_server_first(); if (!server) { ogs_error("No server"); goto end; diff --git a/src/amf/nsmf-build.c b/src/amf/nsmf-build.c index c776edea9..4a36649a9 100644 --- a/src/amf/nsmf-build.c +++ b/src/amf/nsmf-build.c @@ -89,7 +89,45 @@ ogs_sbi_request_t *amf_nsmf_pdusession_build_create_sm_context( ogs_error("No pdu_session_id"); goto end; } - SmContextCreateData.dnn = sess->dnn; + + /* + * 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(&amf_ue->home_plmn_id) == true) { + char *home_network_domain = NULL; + + home_network_domain = + ogs_home_network_domain_from_plmn_id(&amf_ue->home_plmn_id); + ogs_assert(home_network_domain); + + SmContextCreateData.dnn = + ogs_msprintf("%s.%s", sess->dnn, home_network_domain); + ogs_assert(SmContextCreateData.dnn); + + ogs_free(home_network_domain); + + } else { + + SmContextCreateData.dnn = ogs_strdup(sess->dnn); + ogs_assert(SmContextCreateData.dnn); + + } sNssai.sst = sess->s_nssai.sst; sNssai.sd = ogs_s_nssai_sd_to_string(sess->s_nssai.sd); @@ -119,7 +157,7 @@ ogs_sbi_request_t *amf_nsmf_pdusession_build_create_sm_context( goto end; } - server = ogs_list_first(&ogs_sbi_self()->server_list); + server = ogs_sbi_server_first(); if (!server) { ogs_error("No server"); goto end; @@ -187,9 +225,10 @@ ogs_sbi_request_t *amf_nsmf_pdusession_build_create_sm_context( 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]) diff --git a/src/amf/nudm-build.c b/src/amf/nudm-build.c index 89a16b7a2..463a23c59 100644 --- a/src/amf/nudm-build.c +++ b/src/amf/nudm-build.c @@ -51,7 +51,7 @@ ogs_sbi_request_t *amf_nudm_uecm_build_registration( goto end; } - server = ogs_list_first(&ogs_sbi_self()->server_list); + server = ogs_sbi_server_first(); if (!server) { ogs_error("No server"); goto end; @@ -192,7 +192,7 @@ ogs_sbi_request_t *amf_nudm_sdm_build_subscription(amf_ue_t *amf_ue, void *data) SDMSubscription.nf_instance_id = NF_INSTANCE_ID(ogs_sbi_self()->nf_instance); - server = ogs_list_first(&ogs_sbi_self()->server_list); + server = ogs_sbi_server_first(); if (!server) { ogs_error("No server"); goto end; diff --git a/src/amf/sbi-path.c b/src/amf/sbi-path.c index fd0aa62b5..f136df24a 100644 --- a/src/amf/sbi-path.c +++ b/src/amf/sbi-path.c @@ -34,8 +34,8 @@ int amf_sbi_open(void) /* Build NF instance information. It will be transmitted to NRF. */ ogs_sbi_nf_instance_build_default(nf_instance); - ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_SMF); 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_SMF); /* Build NF service information. It will be transmitted to NRF. */ if (ogs_sbi_nf_service_is_available(OGS_SBI_SERVICE_NAME_NAMF_COMM)) { @@ -53,6 +53,7 @@ int amf_sbi_open(void) ogs_sbi_nf_fsm_init(nf_instance); /* Setup Subscription-Data */ + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_SEPP, NULL); ogs_sbi_subscription_spec_add( OpenAPI_nf_type_NULL, OGS_SBI_SERVICE_NAME_NAUSF_AUTH); ogs_sbi_subscription_spec_add( @@ -95,11 +96,34 @@ int amf_ue_sbi_discover_and_send( int r; int rv; ogs_sbi_xact_t *xact = NULL; + OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL; ogs_assert(service_type); + target_nf_type = ogs_sbi_service_type_to_nf_type(service_type); + ogs_assert(target_nf_type); ogs_assert(amf_ue); ogs_assert(build); + if ((target_nf_type == OpenAPI_nf_type_AUSF || + target_nf_type == OpenAPI_nf_type_UDM) && + ogs_sbi_plmn_id_in_vplmn(&amf_ue->home_plmn_id) == true) { + int i; + + if (!discovery_option) { + discovery_option = ogs_sbi_discovery_option_new(); + ogs_assert(discovery_option); + } + + ogs_sbi_discovery_option_add_target_plmn_list( + 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( + discovery_option, &ogs_local_conf()->serving_plmn_id[i]); + } + } + xact = ogs_sbi_xact_add( &amf_ue->sbi, service_type, discovery_option, (ogs_sbi_build_f)build, amf_ue, data); diff --git a/src/ausf/ausf-sm.c b/src/ausf/ausf-sm.c index d2b7228dd..a7eb5ae60 100644 --- a/src/ausf/ausf-sm.c +++ b/src/ausf/ausf-sm.c @@ -254,7 +254,7 @@ void ausf_state_operational(ogs_fsm_t *s, ausf_event_t *e) ogs_assert_if_reached(); END break; - + DEFAULT ogs_error("Invalid resource name [%s]", message.h.resource.component[0]); diff --git a/src/ausf/context.c b/src/ausf/context.c index 29ffaf9f1..6b96d4dd4 100644 --- a/src/ausf/context.c +++ b/src/ausf/context.c @@ -36,7 +36,7 @@ void ausf_context_init(void) ogs_log_install_domain(&__ausf_log_domain, "ausf", ogs_core()->log.level); - ogs_pool_init(&ausf_ue_pool, ogs_app()->max.ue); + ogs_pool_init(&ausf_ue_pool, ogs_global_conf()->max.ue); ogs_list_init(&self.ausf_ue_list); self.suci_hash = ogs_hash_make(); @@ -100,7 +100,13 @@ int ausf_context_parse_config(void) while (ogs_yaml_iter_next(&ausf_iter)) { const char *ausf_key = ogs_yaml_iter_key(&ausf_iter); ogs_assert(ausf_key); - if (!strcmp(ausf_key, "sbi")) { + if (!strcmp(ausf_key, "default")) { + /* handle config in sbi library */ + } else if (!strcmp(ausf_key, "sbi")) { + /* handle config in sbi library */ + } else if (!strcmp(ausf_key, "nrf")) { + /* handle config in sbi library */ + } else if (!strcmp(ausf_key, "scp")) { /* handle config in sbi library */ } else if (!strcmp(ausf_key, "service_name")) { /* handle config in sbi library */ diff --git a/src/ausf/init.c b/src/ausf/init.c index 5e73d892e..ac8824c0b 100644 --- a/src/ausf/init.c +++ b/src/ausf/init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -27,10 +27,14 @@ int ausf_initialize(void) { int rv; +#define APP_NAME "ausf" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + ogs_sbi_context_init(OpenAPI_nf_type_AUSF); ausf_context_init(); - rv = ogs_sbi_context_parse_config("ausf", "nrf", "scp"); + rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp"); if (rv != OGS_OK) return rv; rv = ausf_context_parse_config(); diff --git a/src/ausf/nnrf-handler.c b/src/ausf/nnrf-handler.c index d826a7894..8bf5d13ef 100644 --- a/src/ausf/nnrf-handler.c +++ b/src/ausf/nnrf-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * diff --git a/src/ausf/sbi-path.c b/src/ausf/sbi-path.c index 6feb27a8a..d80c81aa4 100644 --- a/src/ausf/sbi-path.c +++ b/src/ausf/sbi-path.c @@ -31,8 +31,8 @@ int ausf_sbi_open(void) /* Build NF instance information. It will be transmitted to NRF. */ ogs_sbi_nf_instance_build_default(nf_instance); - 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_SCP); + ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_AMF); /* Build NF service information. It will be transmitted to NRF. */ if (ogs_sbi_nf_service_is_available(OGS_SBI_SERVICE_NAME_NAUSF_AUTH)) { @@ -50,6 +50,7 @@ int ausf_sbi_open(void) ogs_sbi_nf_fsm_init(nf_instance); /* Setup Subscription-Data */ + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_SEPP, NULL); ogs_sbi_subscription_spec_add( OpenAPI_nf_type_NULL, OGS_SBI_SERVICE_NAME_NUDM_UEAU); diff --git a/src/bsf/context.c b/src/bsf/context.c index 2d59e6961..21c419dfe 100644 --- a/src/bsf/context.c +++ b/src/bsf/context.c @@ -99,7 +99,13 @@ int bsf_context_parse_config(void) while (ogs_yaml_iter_next(&bsf_iter)) { const char *bsf_key = ogs_yaml_iter_key(&bsf_iter); ogs_assert(bsf_key); - if (!strcmp(bsf_key, "sbi")) { + if (!strcmp(bsf_key, "default")) { + /* handle config in sbi library */ + } else if (!strcmp(bsf_key, "sbi")) { + /* handle config in sbi library */ + } else if (!strcmp(bsf_key, "nrf")) { + /* handle config in sbi library */ + } else if (!strcmp(bsf_key, "scp")) { /* handle config in sbi library */ } else if (!strcmp(bsf_key, "service_name")) { /* handle config in sbi library */ diff --git a/src/bsf/init.c b/src/bsf/init.c index a578420d1..6560c8178 100644 --- a/src/bsf/init.c +++ b/src/bsf/init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -29,10 +29,14 @@ int bsf_initialize(void) { int rv; +#define APP_NAME "bsf" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + ogs_sbi_context_init(OpenAPI_nf_type_BSF); bsf_context_init(); - rv = ogs_sbi_context_parse_config("bsf", "nrf", "scp"); + rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp"); if (rv != OGS_OK) return rv; rv = bsf_context_parse_config(); diff --git a/src/bsf/nnrf-handler.c b/src/bsf/nnrf-handler.c index 2b7e2f107..8cb686661 100644 --- a/src/bsf/nnrf-handler.c +++ b/src/bsf/nnrf-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * diff --git a/src/bsf/sbi-path.c b/src/bsf/sbi-path.c index e376ae7c7..d9d973905 100644 --- a/src/bsf/sbi-path.c +++ b/src/bsf/sbi-path.c @@ -31,9 +31,9 @@ int bsf_sbi_open(void) /* Build NF instance information. It will be transmitted to NRF. */ 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_PCF); ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_AF); - ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_SCP); /* Build NF service information. It will be transmitted to NRF. */ if (ogs_sbi_nf_service_is_available(OGS_SBI_SERVICE_NAME_NBSF_MANAGEMENT)) { @@ -51,6 +51,9 @@ int bsf_sbi_open(void) if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); + /* Setup Subscription-Data */ + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_SEPP, NULL); + if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) return OGS_ERROR; diff --git a/src/hss/hss-context.c b/src/hss/hss-context.c index 99e949add..b88725627 100644 --- a/src/hss/hss-context.c +++ b/src/hss/hss-context.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -296,7 +296,8 @@ int hss_context_parse_config(void) if (!strcmp(conn_key, "identity")) { identity = ogs_yaml_iter_value( &conn_iter); - } else if (!strcmp(conn_key, "addr")) { + } else if (!strcmp(conn_key, + "address")) { addr = ogs_yaml_iter_value( &conn_iter); } else if (!strcmp(conn_key, "port")) { @@ -329,6 +330,13 @@ int hss_context_parse_config(void) } else if (!strcmp(hss_key, "sms_over_ims")) { self.sms_over_ims = ogs_yaml_iter_value(&hss_iter); + } else if (!strcmp(hss_key, "use_mongodb_change_stream")) { +#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 9 + self.use_mongodb_change_stream = + ogs_yaml_iter_bool(&hss_iter); +#else + self.use_mongodb_change_stream = false; +#endif } else ogs_warn("unknown key `%s`", hss_key); } @@ -1175,19 +1183,74 @@ char *hss_cx_download_user_data( return user_data; } +static int poll_change_stream(void); +static int process_change_stream(const bson_t *document); + int hss_db_poll_change_stream(void) { int rv; ogs_thread_mutex_lock(&self.db_lock); - rv = ogs_dbi_poll_change_stream(); + rv = poll_change_stream(); ogs_thread_mutex_unlock(&self.db_lock); return rv; } +static int poll_change_stream(void) +{ +#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 9 + int rv; + + const bson_t *document; + const bson_t *err_document; + bson_error_t error; + + while (mongoc_change_stream_next(ogs_mongoc()->stream, &document)) { + rv = process_change_stream(document); + if (rv != OGS_OK) return rv; + } + + if (mongoc_change_stream_error_document(ogs_mongoc()->stream, &error, + &err_document)) { + if (!bson_empty (err_document)) { + ogs_debug("Server Error: %s\n", + bson_as_relaxed_extended_json(err_document, NULL)); + } else { + ogs_debug("Client Error: %s\n", error.message); + } + return OGS_ERROR; + } + + return OGS_OK; +# else + return OGS_ERROR; +#endif +} + +static int process_change_stream(const bson_t *document) +{ + int rv; + + hss_event_t *e = NULL; + + e = hss_event_new(HSS_EVENT_DBI_MESSAGE); + ogs_assert(e); + e->dbi.document = bson_copy(document); + rv = ogs_queue_push(ogs_app()->queue, e); + if (rv != OGS_OK) { + ogs_error("ogs_queue_push() failed:%d", (int)rv); + bson_destroy(e->dbi.document); + hss_event_free(e); + } else { + ogs_pollset_notify(ogs_app()->pollset); + } + + return OGS_OK; +} + int hss_handle_change_event(const bson_t *document) { bson_iter_t iter, child1_iter, child2_iter; @@ -1244,25 +1307,25 @@ int hss_handle_change_event(const bson_t *document) BSON_ITER_HOLDS_BOOL(&child2_iter)) { send_clr_flag = (char *)bson_iter_bool(&child2_iter); } else if (!strncmp(child2_key, - "access_restriction_data", - strlen("access_restriction_data"))) { + OGS_ACCESS_RESTRICTION_DATA_STRING, + strlen(OGS_ACCESS_RESTRICTION_DATA_STRING))) { send_idr_flag = true; subdatamask = (subdatamask | OGS_DIAM_S6A_SUBDATA_ARD); } else if (!strncmp(child2_key, - "subscriber_status", - strlen("subscriber_status"))) { + OGS_SUBSCRIBER_STATUS_STRING, + strlen(OGS_SUBSCRIBER_STATUS_STRING))) { send_idr_flag = true; subdatamask = (subdatamask | OGS_DIAM_S6A_SUBDATA_SUB_STATUS); } else if (!strncmp(child2_key, - "operator_determined_barring", - strlen("operator_determined_barring"))) { + OGS_OPERATOR_DETERMINED_BARRING_STRING, + strlen(OGS_OPERATOR_DETERMINED_BARRING_STRING))) { send_idr_flag = true; subdatamask = (subdatamask | OGS_DIAM_S6A_SUBDATA_OP_DET_BARRING); } else if (!strncmp(child2_key, - "network_access_mode", - strlen("network_access_mode"))) { + OGS_NETWORK_ACCESS_MODE_STRING, + strlen(OGS_NETWORK_ACCESS_MODE_STRING))) { send_idr_flag = true; subdatamask = (subdatamask | OGS_DIAM_S6A_SUBDATA_NAM); } else if (!strncmp(child2_key, "ambr", strlen("ambr"))) { @@ -1270,8 +1333,8 @@ int hss_handle_change_event(const bson_t *document) subdatamask = (subdatamask | OGS_DIAM_S6A_SUBDATA_UEAMBR); } else if (!strncmp(child2_key, - "subscribed_rau_tau_timer", - strlen("subscribed_rau_tau_timer"))) { + OGS_SUBSCRIBED_RAU_TAU_TIMER_STRING, + strlen(OGS_SUBSCRIBED_RAU_TAU_TIMER_STRING))) { send_idr_flag = true; subdatamask = (subdatamask | OGS_DIAM_S6A_SUBDATA_RAU_TAU_TIMER); diff --git a/src/hss/hss-context.h b/src/hss/hss-context.h index decb94b6d..b5afd46b4 100644 --- a/src/hss/hss-context.h +++ b/src/hss/hss-context.h @@ -39,6 +39,7 @@ typedef struct _hss_context_t { const char *diam_conf_path;/* HSS Diameter conf path */ ogs_diam_config_t *diam_config; /* HSS Diameter config */ const char *sms_over_ims; /* SMS over IMS */ + int use_mongodb_change_stream; ogs_thread_mutex_t db_lock; ogs_thread_mutex_t cx_lock; diff --git a/src/hss/hss-event.c b/src/hss/hss-event.c index a3c783cf0..db4e88314 100644 --- a/src/hss/hss-event.c +++ b/src/hss/hss-event.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -20,8 +20,62 @@ #include "hss-event.h" #include "ogs-app.h" +static OGS_POOL(pool, hss_event_t); + +void hss_event_init(void) +{ + ogs_pool_init(&pool, ogs_app()->pool.event); +} + void hss_event_term(void) { ogs_queue_term(ogs_app()->queue); ogs_pollset_notify(ogs_app()->pollset); } + +void hss_event_final(void) +{ + ogs_pool_final(&pool); +} + +hss_event_t *hss_event_new(hss_event_e id) +{ + hss_event_t *e = NULL; + + ogs_pool_alloc(&pool, &e); + ogs_assert(e); + memset(e, 0, sizeof(*e)); + + e->id = id; + + return e; +} + +void hss_event_free(hss_event_t *e) +{ + ogs_assert(e); + ogs_pool_free(&pool, e); +} + +const char *hss_event_get_name(hss_event_t *e) +{ + if (e == NULL) + return OGS_FSM_NAME_INIT_SIG; + + switch (e->id) { + case OGS_FSM_ENTRY_SIG: + return OGS_FSM_NAME_ENTRY_SIG; + case OGS_FSM_EXIT_SIG: + return OGS_FSM_NAME_EXIT_SIG; + + case HSS_EVENT_DBI_POLL_TIMER: + return "HSS_EVENT_DBI_POLL_TIMER"; + case HSS_EVENT_DBI_MESSAGE: + return "HSS_EVENT_DBI_MESSAGE"; + + default: + break; + } + + return "UNKNOWN_EVENT"; +} diff --git a/src/hss/hss-event.h b/src/hss/hss-event.h index 91e4fe417..311782e47 100644 --- a/src/hss/hss-event.h +++ b/src/hss/hss-event.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -20,13 +20,38 @@ #ifndef HSS_EVENT_H #define HSS_EVENT_H -#include "ogs-core.h" +#include "ogs-proto.h" #ifdef __cplusplus extern "C" { #endif +typedef enum { + HSS_EVT_BASE = OGS_MAX_NUM_OF_PROTO_EVENT, + + HSS_EVENT_DBI_POLL_TIMER, + HSS_EVENT_DBI_MESSAGE, + + HSS_EVT_TOP, +} hss_event_e; + +typedef struct hss_event_s { + int id; + int timer_id; + + struct { + void *document; + } dbi; +} hss_event_t; + +void hss_event_init(void); void hss_event_term(void); +void hss_event_final(void); + +hss_event_t *hss_event_new(hss_event_e id); +void hss_event_free(hss_event_t *e); + +const char *hss_event_get_name(hss_event_t *e); #ifdef __cplusplus } diff --git a/src/hss/hss-init.c b/src/hss/hss-init.c index 2a29b0f19..ebd95afec 100644 --- a/src/hss/hss-init.c +++ b/src/hss/hss-init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -31,6 +31,10 @@ int hss_initialize(void) { int rv; +#define APP_NAME "hss" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + hss_context_init(); rv = hss_context_parse_config(); @@ -94,7 +98,7 @@ static void hss_main(void *data) ogs_timer_mgr_expire(ogs_app()->timer_mgr); for ( ;; ) { - ogs_event_t *e = NULL; + hss_event_t *e = NULL; rv = ogs_queue_trypop(ogs_app()->queue, (void**)&e); ogs_assert(rv != OGS_ERROR); @@ -107,7 +111,7 @@ static void hss_main(void *data) ogs_assert(e); ogs_fsm_dispatch(&hss_sm, e); - ogs_event_free(e); + hss_event_free(e); } } done: diff --git a/src/hss/hss-sm.c b/src/hss/hss-sm.c index c87462a43..9d3ed63ff 100644 --- a/src/hss/hss-sm.c +++ b/src/hss/hss-sm.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -20,23 +20,24 @@ #include "hss-sm.h" #include "hss-context.h" #include "hss-event.h" +#include "hss-timer.h" #define DB_POLLING_TIME ogs_time_from_msec(100) static ogs_timer_t *t_db_polling = NULL; -void hss_state_initial(ogs_fsm_t *s, ogs_event_t *e) +void hss_state_initial(ogs_fsm_t *s, hss_event_t *e) { hss_sm_debug(e); ogs_assert(s); #if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 9 - if (ogs_app()->use_mongodb_change_stream) { + if (hss_self()->use_mongodb_change_stream) { ogs_dbi_collection_watch_init(); t_db_polling = ogs_timer_add(ogs_app()->timer_mgr, - ogs_timer_dbi_poll_change_stream, 0); + hss_timer_dbi_poll_change_stream, 0); ogs_assert(t_db_polling); ogs_timer_start(t_db_polling, DB_POLLING_TIME); @@ -45,7 +46,7 @@ void hss_state_initial(ogs_fsm_t *s, ogs_event_t *e) #endif } -void hss_state_final(ogs_fsm_t *s, ogs_event_t *e) +void hss_state_final(ogs_fsm_t *s, hss_event_t *e) { hss_sm_debug(e); @@ -55,7 +56,7 @@ void hss_state_final(ogs_fsm_t *s, ogs_event_t *e) ogs_assert(s); } -void hss_state_operational(ogs_fsm_t *s, ogs_event_t *e) +void hss_state_operational(ogs_fsm_t *s, hss_event_t *e) { hss_sm_debug(e); @@ -71,11 +72,11 @@ void hss_state_operational(ogs_fsm_t *s, ogs_event_t *e) } break; - case OGS_EVENT_DBI_POLL_TIMER: + case HSS_EVENT_DBI_POLL_TIMER: ogs_assert(e); switch(e->timer_id) { - case OGS_TIMER_DBI_POLL_CHANGE_STREAM: + case HSS_TIMER_DBI_POLL_CHANGE_STREAM: hss_db_poll_change_stream(); ogs_timer_start(t_db_polling, DB_POLLING_TIME); break; @@ -86,7 +87,7 @@ void hss_state_operational(ogs_fsm_t *s, ogs_event_t *e) } break; - case OGS_EVENT_DBI_MESSAGE: + case HSS_EVENT_DBI_MESSAGE: ogs_assert(e); ogs_assert(e->dbi.document); @@ -96,7 +97,7 @@ void hss_state_operational(ogs_fsm_t *s, ogs_event_t *e) break; default: - ogs_error("No handler for event %s", ogs_event_get_name(e)); + ogs_error("No handler for event %s", hss_event_get_name(e)); break; } } diff --git a/src/hss/hss-sm.h b/src/hss/hss-sm.h index ce18d30fa..a7c049b22 100644 --- a/src/hss/hss-sm.h +++ b/src/hss/hss-sm.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -27,13 +27,13 @@ extern "C" { #endif -void hss_state_initial(ogs_fsm_t *s, ogs_event_t *e); -void hss_state_final(ogs_fsm_t *s, ogs_event_t *e); -void hss_state_operational(ogs_fsm_t *s, ogs_event_t *e); -void hss_state_exception(ogs_fsm_t *s, ogs_event_t *e); +void hss_state_initial(ogs_fsm_t *s, hss_event_t *e); +void hss_state_final(ogs_fsm_t *s, hss_event_t *e); +void hss_state_operational(ogs_fsm_t *s, hss_event_t *e); +void hss_state_exception(ogs_fsm_t *s, hss_event_t *e); #define hss_sm_debug(__pe) \ - ogs_debug("%s(): %s", __func__, ogs_event_get_name(__pe)) + ogs_debug("%s(): %s", __func__, hss_event_get_name(__pe)) #ifdef __cplusplus } diff --git a/lib/dbi/timer.c b/src/hss/hss-timer.c similarity index 62% rename from lib/dbi/timer.c rename to src/hss/hss-timer.c index 743bb6a08..56eb9fd19 100644 --- a/lib/dbi/timer.c +++ b/src/hss/hss-timer.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -17,25 +17,39 @@ * along with this program. If not, see . */ -#include "ogs-dbi.h" +#include "hss-timer.h" +#include "hss-event.h" +#include "ogs-app.h" + +const char *hss_timer_get_name(hss_timer_e id) +{ + switch (id) { + case HSS_TIMER_DBI_POLL_CHANGE_STREAM: + return "HSS_TIMER_DBI_POLL_CHANGE_STREAM"; + default: + break; + } + + return "UNKNOWN_TIMER"; +} static void timer_send_event(int timer_id, void *data) { int rv; - ogs_event_t *e = NULL; + hss_event_t *e = NULL; - e = ogs_event_new(OGS_EVENT_DBI_POLL_TIMER); + e = hss_event_new(HSS_EVENT_DBI_POLL_TIMER); ogs_assert(e); e->timer_id = timer_id; rv = ogs_queue_push(ogs_app()->queue, e); if (rv != OGS_OK) { ogs_error("ogs_queue_push() failed:%d", (int)rv); - ogs_event_free(e); + hss_event_free(e); } } -void ogs_timer_dbi_poll_change_stream(void *data) +void hss_timer_dbi_poll_change_stream(void *data) { - timer_send_event(OGS_TIMER_DBI_POLL_CHANGE_STREAM, data); + timer_send_event(HSS_TIMER_DBI_POLL_CHANGE_STREAM, data); } diff --git a/lib/dbi/path.h b/src/hss/hss-timer.h similarity index 67% rename from lib/dbi/path.h rename to src/hss/hss-timer.h index e6486d5e7..bec30aaf1 100644 --- a/lib/dbi/path.h +++ b/src/hss/hss-timer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019,2020 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -17,17 +17,29 @@ * along with this program. If not, see . */ -#ifndef OGS_DBI_PATH_H -#define OGS_DBI_PATH_H +#ifndef HSS_TIMER_H +#define HSS_TIMER_H #ifdef __cplusplus extern "C" { #endif -int ogs_dbi_process_change_stream(const bson_t *document); +/* forward declaration */ +typedef enum { + HSS_TIMER_BASE = 0, + + HSS_TIMER_DBI_POLL_CHANGE_STREAM, + + MAX_NUM_OF_HSS_TIMER, + +} hss_timer_e; + +const char *hss_timer_get_name(hss_timer_e id); + +void hss_timer_dbi_poll_change_stream(void *data); #ifdef __cplusplus } #endif -#endif /* OGS_DBI_PATH_H */ +#endif /* HSS_TIMER_H */ diff --git a/src/hss/meson.build b/src/hss/meson.build index f2b6ce57c..83130a444 100644 --- a/src/hss/meson.build +++ b/src/hss/meson.build @@ -1,4 +1,4 @@ -# Copyright (C) 2019 by Sukchan Lee +# Copyright (C) 2019-2023 by Sukchan Lee # This file is part of Open5GS. @@ -20,11 +20,13 @@ libhss_sources = files(''' hss-fd-path.h hss-s6a-path.h hss-event.h + hss-timer.h hss-sm.h hss-init.c hss-context.c hss-event.c + hss-timer.c hss-sm.c hss-s6a-path.c @@ -37,6 +39,7 @@ libhss_sources = files(''' libhss = static_library('hss', sources : libhss_sources, dependencies : [libapp_dep, + libcrypt_dep, libdbi_dep, libdiameter_s6a_dep, libdiameter_cx_dep, @@ -46,6 +49,7 @@ libhss = static_library('hss', libhss_dep = declare_dependency( link_with : libhss, dependencies : [libapp_dep, + libcrypt_dep, libdbi_dep, libdiameter_s6a_dep, libdiameter_cx_dep, diff --git a/src/meson.build b/src/meson.build index d313b6932..8dd3eaa2e 100644 --- a/src/meson.build +++ b/src/meson.build @@ -41,6 +41,7 @@ subdir('pcrf') subdir('nrf') subdir('scp') +subdir('sepp') subdir('udr') subdir('udm') diff --git a/src/mme/emm-build.c b/src/mme/emm-build.c index 4b2fb0880..3dde09111 100644 --- a/src/mme/emm-build.c +++ b/src/mme/emm-build.c @@ -199,7 +199,7 @@ ogs_pkbuf_t *emm_build_attach_accept( attach_accept->presencemask |= OGS_NAS_EPS_ATTACH_ACCEPT_EPS_NETWORK_FEATURE_SUPPORT_PRESENT; - if (ogs_app()->parameter.use_openair == false) { + if (ogs_global_conf()->parameter.use_openair == false) { eps_network_feature_support->length = 2; } else { eps_network_feature_support->length = 1; @@ -416,7 +416,7 @@ ogs_pkbuf_t *emm_build_security_mode_command(mme_ue_t *mme_ue) * However, Openair UE does not support HashMME. For user convenience, * we added a way not to include HashMME through the configuration file. */ - if (ogs_app()->parameter.use_openair == false) { + if (ogs_global_conf()->parameter.use_openair == false) { security_mode_command->presencemask |= OGS_NAS_EPS_SECURITY_MODE_COMMAND_HASHMME_PRESENT; hashmme->length = OGS_HASH_MME_LEN; @@ -611,7 +611,7 @@ ogs_pkbuf_t *emm_build_tau_accept(mme_ue_t *mme_ue) /* Set EPS network feature support */ tau_accept->presencemask |= OGS_NAS_EPS_TRACKING_AREA_UPDATE_ACCEPT_EPS_NETWORK_FEATURE_SUPPORT_PRESENT; - if (ogs_app()->parameter.use_openair == false) { + if (ogs_global_conf()->parameter.use_openair == false) { tau_accept->eps_network_feature_support.length = 2; } else { tau_accept->eps_network_feature_support.length = 1; diff --git a/src/mme/emm-handler.c b/src/mme/emm-handler.c index 20ae5c990..f89e68c66 100644 --- a/src/mme/emm-handler.c +++ b/src/mme/emm-handler.c @@ -32,7 +32,7 @@ #undef OGS_LOG_DOMAIN #define OGS_LOG_DOMAIN __emm_log_domain -static uint8_t emm_cause_from_access_control(ogs_plmn_id_t *plmn_id); +static uint8_t emm_cause_from_access_control(mme_ue_t *mme_ue); int emm_handle_attach_request(mme_ue_t *mme_ue, ogs_nas_eps_attach_request_t *attach_request, ogs_pkbuf_t *pkbuf) @@ -137,26 +137,6 @@ int emm_handle_attach_request(mme_ue_t *mme_ue, memcpy(&mme_ue->e_cgi, &enb_ue->saved.e_cgi, sizeof(ogs_e_cgi_t)); mme_ue->ue_location_timestamp = ogs_time_now(); - /* Check PLMN-ID access control */ - emm_cause = emm_cause_from_access_control(&mme_ue->tai.plmn_id); - if (emm_cause != OGS_NAS_EMM_CAUSE_REQUEST_ACCEPTED) { - ogs_error("Rejected by PLMN-ID(in TAI) access control"); - r = nas_eps_send_attach_reject(mme_ue, - emm_cause, OGS_NAS_ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED); - ogs_expect(r == OGS_OK); - ogs_assert(r != OGS_ERROR); - return OGS_ERROR; - } - emm_cause = emm_cause_from_access_control(&mme_ue->e_cgi.plmn_id); - if (emm_cause != OGS_NAS_EMM_CAUSE_REQUEST_ACCEPTED) { - ogs_error("Rejected by PLMN-ID(in CGI) access control"); - r = nas_eps_send_attach_reject(mme_ue, - emm_cause, OGS_NAS_ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED); - ogs_expect(r == OGS_OK); - ogs_assert(r != OGS_ERROR); - return OGS_ERROR; - } - /* Check TAI */ served_tai_index = mme_find_served_tai(&mme_ue->tai); if (served_tai_index < 0) { @@ -226,6 +206,17 @@ int emm_handle_attach_request(mme_ue_t *mme_ue, } memcpy(&mme_ue->nas_mobile_identity_imsi, &eps_mobile_identity->imsi, eps_mobile_identity->length); + + emm_cause = emm_cause_from_access_control(mme_ue); + if (emm_cause != OGS_NAS_EMM_CAUSE_REQUEST_ACCEPTED) { + ogs_error("Rejected by PLMN-ID access control"); + r = nas_eps_send_attach_reject(mme_ue, + emm_cause, OGS_NAS_ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED); + ogs_expect(r == OGS_OK); + ogs_assert(r != OGS_ERROR); + return OGS_ERROR; + } + ogs_nas_eps_imsi_to_bcd( &eps_mobile_identity->imsi, eps_mobile_identity->length, imsi_bcd); @@ -375,6 +366,8 @@ int emm_handle_attach_complete( int emm_handle_identity_response( mme_ue_t *mme_ue, ogs_nas_eps_identity_response_t *identity_response) { + int r; + uint8_t emm_cause; ogs_nas_mobile_identity_t *mobile_identity = NULL; enb_ue_t *enb_ue = NULL; @@ -393,16 +386,37 @@ int emm_handle_identity_response( ogs_error("mobile_identity length (%d != %d)", (int)sizeof(ogs_nas_mobile_identity_imsi_t), mobile_identity->length); + r = nas_eps_send_attach_reject(mme_ue, + OGS_NAS_EMM_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE, + OGS_NAS_ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED); + ogs_expect(r == OGS_OK); + ogs_assert(r != OGS_ERROR); return OGS_ERROR; } memcpy(&mme_ue->nas_mobile_identity_imsi, &mobile_identity->imsi, mobile_identity->length); + + emm_cause = emm_cause_from_access_control(mme_ue); + if (emm_cause != OGS_NAS_EMM_CAUSE_REQUEST_ACCEPTED) { + ogs_error("Rejected by PLMN-ID access control"); + r = nas_eps_send_attach_reject(mme_ue, + emm_cause, OGS_NAS_ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED); + ogs_expect(r == OGS_OK); + ogs_assert(r != OGS_ERROR); + return OGS_ERROR; + } + ogs_nas_eps_imsi_to_bcd( &mobile_identity->imsi, mobile_identity->length, imsi_bcd); mme_ue_set_imsi(mme_ue, imsi_bcd); if (mme_ue->imsi_len != OGS_MAX_IMSI_LEN) { ogs_error("Invalid IMSI LEN[%d]", mme_ue->imsi_len); + r = nas_eps_send_attach_reject(mme_ue, + OGS_NAS_EMM_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE, + OGS_NAS_ESM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED); + ogs_expect(r == OGS_OK); + ogs_assert(r != OGS_ERROR); return OGS_ERROR; } @@ -535,7 +549,6 @@ int emm_handle_tau_request(mme_ue_t *mme_ue, { int r; int served_tai_index = 0; - uint8_t emm_cause; ogs_nas_eps_mobile_identity_guti_t *eps_mobile_identity_guti = NULL; ogs_nas_eps_guti_t nas_guti; @@ -602,24 +615,6 @@ int emm_handle_tau_request(mme_ue_t *mme_ue, memcpy(&mme_ue->e_cgi, &enb_ue->saved.e_cgi, sizeof(ogs_e_cgi_t)); mme_ue->ue_location_timestamp = ogs_time_now(); - /* Check PLMN-ID access control */ - emm_cause = emm_cause_from_access_control(&mme_ue->tai.plmn_id); - if (emm_cause != OGS_NAS_EMM_CAUSE_REQUEST_ACCEPTED) { - ogs_error("Rejected by PLMN-ID(in TAI) access control"); - r = nas_eps_send_tau_reject(mme_ue, emm_cause); - ogs_expect(r == OGS_OK); - ogs_assert(r != OGS_ERROR); - return OGS_ERROR; - } - emm_cause = emm_cause_from_access_control(&mme_ue->e_cgi.plmn_id); - if (emm_cause != OGS_NAS_EMM_CAUSE_REQUEST_ACCEPTED) { - ogs_error("Rejected by PLMN-ID(in CGI) access control"); - r = nas_eps_send_tau_reject(mme_ue, emm_cause); - ogs_expect(r == OGS_OK); - ogs_assert(r != OGS_ERROR); - return OGS_ERROR; - } - /* Check TAI */ served_tai_index = mme_find_served_tai(&mme_ue->tai); if (served_tai_index < 0) { @@ -694,7 +689,6 @@ int emm_handle_extended_service_request(mme_ue_t *mme_ue, { int r; int served_tai_index = 0; - uint8_t emm_cause; ogs_nas_service_type_t *service_type = &extended_service_request->service_type; @@ -741,24 +735,6 @@ int emm_handle_extended_service_request(mme_ue_t *mme_ue, memcpy(&mme_ue->e_cgi, &enb_ue->saved.e_cgi, sizeof(ogs_e_cgi_t)); mme_ue->ue_location_timestamp = ogs_time_now(); - /* Check PLMN-ID access control */ - emm_cause = emm_cause_from_access_control(&mme_ue->tai.plmn_id); - if (emm_cause != OGS_NAS_EMM_CAUSE_REQUEST_ACCEPTED) { - ogs_error("Rejected by PLMN-ID(in TAI) access control"); - r = nas_eps_send_tau_reject(mme_ue, emm_cause); - ogs_expect(r == OGS_OK); - ogs_assert(r != OGS_ERROR); - return OGS_ERROR; - } - emm_cause = emm_cause_from_access_control(&mme_ue->e_cgi.plmn_id); - if (emm_cause != OGS_NAS_EMM_CAUSE_REQUEST_ACCEPTED) { - ogs_error("Rejected by PLMN-ID(in CGI) access control"); - r = nas_eps_send_tau_reject(mme_ue, emm_cause); - ogs_expect(r == OGS_OK); - ogs_assert(r != OGS_ERROR); - return OGS_ERROR; - } - /* Check TAI */ served_tai_index = mme_find_served_tai(&mme_ue->tai); if (served_tai_index < 0) { @@ -838,19 +814,35 @@ int emm_handle_security_mode_complete(mme_ue_t *mme_ue, return OGS_OK; } -static uint8_t emm_cause_from_access_control(ogs_plmn_id_t *plmn_id) +static uint8_t emm_cause_from_access_control(mme_ue_t *mme_ue) { + ogs_nas_mobile_identity_imsi_t *nas_mobile_identity_imsi = NULL; int i; - ogs_assert(plmn_id); + ogs_assert(mme_ue); + nas_mobile_identity_imsi = &mme_ue->nas_mobile_identity_imsi; /* No Access Control */ if (mme_self()->num_of_access_control == 0) return OGS_NAS_EMM_CAUSE_REQUEST_ACCEPTED; for (i = 0; i < mme_self()->num_of_access_control; i++) { - if (memcmp(&mme_self()->access_control[i].plmn_id, - plmn_id, OGS_PLMN_ID_LEN) == 0) { + if ((nas_mobile_identity_imsi->digit1 == + mme_self()->access_control[i].plmn_id.mcc1 && + nas_mobile_identity_imsi->digit2 == + mme_self()->access_control[i].plmn_id.mcc2 && + nas_mobile_identity_imsi->digit3 == + mme_self()->access_control[i].plmn_id.mcc3) && + ((nas_mobile_identity_imsi->digit4 == + mme_self()->access_control[i].plmn_id.mnc2 && + nas_mobile_identity_imsi->digit5 == + mme_self()->access_control[i].plmn_id.mnc3) || + (nas_mobile_identity_imsi->digit4 == + mme_self()->access_control[i].plmn_id.mnc1 && + nas_mobile_identity_imsi->digit5 == + mme_self()->access_control[i].plmn_id.mnc2 && + nas_mobile_identity_imsi->digit6 == + mme_self()->access_control[i].plmn_id.mnc3))) { if (mme_self()->access_control[i].reject_cause) return mme_self()->access_control[i].reject_cause; else diff --git a/src/mme/mme-context.c b/src/mme/mme-context.c index d853f0d06..b5618c85e 100644 --- a/src/mme/mme-context.c +++ b/src/mme/mme-context.c @@ -105,17 +105,17 @@ void mme_context_init(void) ogs_pool_init(&mme_csmap_pool, ogs_app()->pool.csmap); /* Allocate TWICE the pool to check if maximum number of eNBs is reached */ - ogs_pool_init(&mme_enb_pool, ogs_app()->max.peer*2); + ogs_pool_init(&mme_enb_pool, ogs_global_conf()->max.peer*2); - ogs_pool_init(&mme_ue_pool, ogs_app()->max.ue); - ogs_pool_init(&mme_s11_teid_pool, ogs_app()->max.ue); + ogs_pool_init(&mme_ue_pool, ogs_global_conf()->max.ue); + ogs_pool_init(&mme_s11_teid_pool, ogs_global_conf()->max.ue); ogs_pool_random_id_generate(&mme_s11_teid_pool); - ogs_pool_init(&enb_ue_pool, ogs_app()->max.ue); - ogs_pool_init(&sgw_ue_pool, ogs_app()->max.ue); + ogs_pool_init(&enb_ue_pool, ogs_global_conf()->max.ue); + ogs_pool_init(&sgw_ue_pool, ogs_global_conf()->max.ue); ogs_pool_init(&mme_sess_pool, ogs_app()->pool.sess); ogs_pool_init(&mme_bearer_pool, ogs_app()->pool.bearer); - ogs_pool_init(&m_tmsi_pool, ogs_app()->max.ue*2); + ogs_pool_init(&m_tmsi_pool, ogs_global_conf()->max.ue*2); ogs_pool_random_id_generate(&m_tmsi_pool); self.enb_addr_hash = ogs_hash_make(); @@ -213,23 +213,23 @@ static int mme_context_validation(void) if (ogs_list_first(&self.s1ap_list) == NULL && ogs_list_first(&self.s1ap_list6) == NULL) { - ogs_error("No mme.s1ap in '%s'", ogs_app()->file); + ogs_error("No mme.s1ap.address in '%s'", ogs_app()->file); return OGS_RETRY; } if (ogs_list_first(&ogs_gtp_self()->gtpc_list) == NULL && ogs_list_first(&ogs_gtp_self()->gtpc_list6) == NULL) { - ogs_error("No mme.gtpc in '%s'", ogs_app()->file); + ogs_error("No mme.gtpc.address in '%s'", ogs_app()->file); return OGS_RETRY; } if (ogs_list_first(&self.sgw_list) == NULL) { - ogs_error("No sgw.gtpc in '%s'", ogs_app()->file); + ogs_error("No sgw.gtpc.address in '%s'", ogs_app()->file); return OGS_ERROR; } if (ogs_list_first(&self.pgw_list) == NULL) { - ogs_error("No pgw.gtpc in '%s'", ogs_app()->file); + ogs_error("No pgw.gtpc.address in '%s'", ogs_app()->file); return OGS_ERROR; } @@ -520,7 +520,8 @@ int mme_context_parse_config(void) if (!strcmp(conn_key, "identity")) { identity = ogs_yaml_iter_value(&conn_iter); - } else if (!strcmp(conn_key, "addr")) { + } else if (!strcmp(conn_key, + "address")) { addr = ogs_yaml_iter_value(&conn_iter); } else if (!strcmp(conn_key, "port")) { @@ -554,129 +555,834 @@ int mme_context_parse_config(void) const char *v = ogs_yaml_iter_value(&mme_iter); if (v) self.relative_capacity = atoi(v); } else if (!strcmp(mme_key, "s1ap")) { - ogs_yaml_iter_t s1ap_array, s1ap_iter; - ogs_yaml_iter_recurse(&mme_iter, &s1ap_array); - do { - int family = AF_UNSPEC; - int i, num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = self.s1ap_port; - const char *dev = NULL; - ogs_sockaddr_t *addr = NULL; + ogs_yaml_iter_t s1ap_iter; + ogs_yaml_iter_recurse(&mme_iter, &s1ap_iter); + while (ogs_yaml_iter_next(&s1ap_iter)) { + const char *s1ap_key = ogs_yaml_iter_key(&s1ap_iter); + ogs_assert(s1ap_key); + if (!strcmp(s1ap_key, "server")) { + ogs_yaml_iter_t server_iter, server_array; + ogs_yaml_iter_recurse(&s1ap_iter, &server_array); + do { + int family = AF_UNSPEC; + int i, num = 0; + const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; + uint16_t port = self.s1ap_port; + const char *dev = NULL; + ogs_sockaddr_t *addr = NULL; - ogs_sockopt_t option; - bool is_option = false; + ogs_sockopt_t option; + bool is_option = false; - if (ogs_yaml_iter_type(&s1ap_array) == - YAML_MAPPING_NODE) { - memcpy(&s1ap_iter, &s1ap_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(&s1ap_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&s1ap_array)) - break; - ogs_yaml_iter_recurse(&s1ap_array, &s1ap_iter); - } else if (ogs_yaml_iter_type(&s1ap_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); + if (ogs_yaml_iter_type(&server_array) == + YAML_MAPPING_NODE) { + memcpy(&server_iter, &server_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&server_array)) + break; + ogs_yaml_iter_recurse( + &server_array, &server_iter); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); - while (ogs_yaml_iter_next(&s1ap_iter)) { - const char *s1ap_key = - ogs_yaml_iter_key(&s1ap_iter); - ogs_assert(s1ap_key); - if (!strcmp(s1ap_key, "family")) { - const char *v = ogs_yaml_iter_value(&s1ap_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; + while (ogs_yaml_iter_next(&server_iter)) { + const char *server_key = + ogs_yaml_iter_key(&server_iter); + ogs_assert(server_key); + if (!strcmp(server_key, "family")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) family = atoi(v); + if (family != AF_UNSPEC && + family != AF_INET && + family != AF_INET6) { + ogs_warn("Ignore family(%d) : " + "AF_UNSPEC(%d), " + "AF_INET(%d), AF_INET6(%d) ", + family, + AF_UNSPEC, AF_INET, AF_INET6); + family = AF_UNSPEC; + } + } else if (!strcmp(server_key, "address")) { + ogs_yaml_iter_t hostname_iter; + ogs_yaml_iter_recurse( + &server_iter, &hostname_iter); + ogs_assert(ogs_yaml_iter_type( + &hostname_iter) != + YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &hostname_iter)) + break; + } + + ogs_assert(num < + OGS_MAX_NUM_OF_HOSTNAME); + hostname[num++] = + ogs_yaml_iter_value( + &hostname_iter); + } while (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(server_key, "port")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) port = atoi(v); + } else if (!strcmp(server_key, "dev")) { + dev = ogs_yaml_iter_value(&server_iter); + } else if (!strcmp(server_key, "option")) { + rv = ogs_app_parse_sockopt_config( + &server_iter, &option); + if (rv != OGS_OK) { + ogs_error("ogs_app_parse_sockopt_" + "config() failed"); + return rv; + } + is_option = true; + } else + ogs_warn("unknown key `%s`", + server_key); } - } else if (!strcmp(s1ap_key, "addr") || - !strcmp(s1ap_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse( - &s1ap_iter, &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&hostname_iter)) - break; - } + addr = NULL; + for (i = 0; i < num; i++) { + rv = ogs_addaddrinfo(&addr, + family, hostname[i], port, 0); + ogs_assert(rv == OGS_OK); + } - ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME); - hostname[num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(s1ap_key, "port")) { - const char *v = ogs_yaml_iter_value(&s1ap_iter); - if (v) port = atoi(v); - } else if (!strcmp(s1ap_key, "dev")) { - dev = ogs_yaml_iter_value(&s1ap_iter); - } else if (!strcmp(s1ap_key, "option")) { - rv = ogs_app_config_parse_sockopt( - &s1ap_iter, &option); - if (rv != OGS_OK) return rv; - is_option = true; - } else - ogs_warn("unknown key `%s`", s1ap_key); - } + if (addr) { + if (ogs_global_conf()->parameter. + no_ipv4 == 0) + ogs_socknode_add( + &self.s1ap_list, AF_INET, addr, + is_option ? &option : NULL); + if (ogs_global_conf()->parameter. + no_ipv6 == 0) + ogs_socknode_add( + &self.s1ap_list6, AF_INET6, addr, + is_option ? &option : NULL); + ogs_freeaddrinfo(addr); + } - addr = NULL; - for (i = 0; i < num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } + if (dev) { + rv = ogs_socknode_probe( + ogs_global_conf()->parameter. + no_ipv4 ? + NULL : &self.s1ap_list, + ogs_global_conf()->parameter. + no_ipv6 ? + NULL : &self.s1ap_list6, + dev, port, + is_option ? &option : NULL); + ogs_assert(rv == OGS_OK); + } - if (addr) { - if (ogs_app()->parameter.no_ipv4 == 0) - ogs_socknode_add( - &self.s1ap_list, AF_INET, addr, - is_option ? &option : NULL); - if (ogs_app()->parameter.no_ipv6 == 0) - ogs_socknode_add( - &self.s1ap_list6, AF_INET6, addr, - is_option ? &option : NULL); - ogs_freeaddrinfo(addr); - } - - if (dev) { - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? - NULL : &self.s1ap_list, - ogs_app()->parameter.no_ipv6 ? - NULL : &self.s1ap_list6, - dev, port, - is_option ? &option : NULL); - ogs_assert(rv == OGS_OK); - } - - } while (ogs_yaml_iter_type(&s1ap_array) == - YAML_SEQUENCE_NODE); - - if (ogs_list_first(&self.s1ap_list) == NULL && - ogs_list_first(&self.s1ap_list6) == NULL) { - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? - NULL : &self.s1ap_list, - ogs_app()->parameter.no_ipv6 ? - NULL : &self.s1ap_list6, - NULL, self.s1ap_port, NULL); - ogs_assert(rv == OGS_OK); + } while (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE); + } else + ogs_warn("unknown key `%s`", s1ap_key); } } else if (!strcmp(mme_key, "gtpc")) { - /* handle config in gtp library */ + ogs_yaml_iter_t gtpc_iter; + ogs_yaml_iter_recurse(&mme_iter, >pc_iter); + while (ogs_yaml_iter_next(>pc_iter)) { + const char *gtpc_key = ogs_yaml_iter_key(>pc_iter); + ogs_assert(gtpc_key); + if (!strcmp(gtpc_key, "server")) { + /* handle config in gtp library */ + } else if (!strcmp(gtpc_key, "client")) { + ogs_yaml_iter_t client_iter; + ogs_yaml_iter_recurse(>pc_iter, &client_iter); + while (ogs_yaml_iter_next(&client_iter)) { + const char *client_key = + ogs_yaml_iter_key(&client_iter); + ogs_assert(client_key); + if (!strcmp(client_key, "sgwc")) { + ogs_yaml_iter_t sgwc_array, sgwc_iter; + ogs_yaml_iter_recurse( + &client_iter, &sgwc_array); + do { + mme_sgw_t *sgw = NULL; + ogs_sockaddr_t *addr = NULL; + int family = AF_UNSPEC; + int i, num = 0; + const char *hostname[ + OGS_MAX_NUM_OF_HOSTNAME]; + uint16_t port = + ogs_gtp_self()->gtpc_port; + uint16_t tac[OGS_MAX_NUM_OF_TAI] = {0,}; + int num_of_tac = 0; + uint32_t e_cell_id[ + OGS_MAX_NUM_OF_CELL_ID] = {0,}; + int num_of_e_cell_id = 0; + + if (ogs_yaml_iter_type(&sgwc_array) == + YAML_MAPPING_NODE) { + memcpy(&sgwc_iter, &sgwc_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type( + &sgwc_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &sgwc_array)) + break; + ogs_yaml_iter_recurse( + &sgwc_array, &sgwc_iter); + } else if (ogs_yaml_iter_type( + &sgwc_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); + + while (ogs_yaml_iter_next(&sgwc_iter)) { + const char *sgwc_key = + ogs_yaml_iter_key(&sgwc_iter); + ogs_assert(sgwc_key); + if (!strcmp(sgwc_key, "family")) { + const char *v = + ogs_yaml_iter_value( + &sgwc_iter); + if (v) family = atoi(v); + if (family != AF_UNSPEC && + family != AF_INET && + family != AF_INET6) { + ogs_warn( + "Ignore family(%d) : " + "AF_UNSPEC(%d), " + "AF_INET(%d), " + "AF_INET6(%d) ", + family, AF_UNSPEC, + AF_INET, AF_INET6); + family = AF_UNSPEC; + } + } else if (!strcmp(sgwc_key, + "address")) { + ogs_yaml_iter_t hostname_iter; + ogs_yaml_iter_recurse( + &sgwc_iter, + &hostname_iter); + ogs_assert(ogs_yaml_iter_type( + &hostname_iter) != + YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &hostname_iter)) + break; + } + + ogs_assert(num < + OGS_MAX_NUM_OF_HOSTNAME); + hostname[num++] = + ogs_yaml_iter_value( + &hostname_iter); + } while ( + ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(sgwc_key, + "port")) { + const char *v = + ogs_yaml_iter_value( + &sgwc_iter); + if (v) port = atoi(v); + } else if (!strcmp( + sgwc_key, "tac")) { + ogs_yaml_iter_t tac_iter; + ogs_yaml_iter_recurse( + &sgwc_iter, &tac_iter); + ogs_assert(ogs_yaml_iter_type( + &tac_iter) != + YAML_MAPPING_NODE); + + do { + const char *v = NULL; + + ogs_assert(num_of_tac < + OGS_MAX_NUM_OF_TAI); + if (ogs_yaml_iter_type( + &tac_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &tac_iter)) + break; + } + + v = ogs_yaml_iter_value( + &tac_iter); + if (v) { + tac[num_of_tac] = + atoi(v); + num_of_tac++; + } + } while ( + ogs_yaml_iter_type( + &tac_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(sgwc_key, + "e_cell_id")) { + ogs_yaml_iter_t e_cell_id_iter; + ogs_yaml_iter_recurse( + &sgwc_iter, + &e_cell_id_iter); + ogs_assert(ogs_yaml_iter_type( + &e_cell_id_iter) != + YAML_MAPPING_NODE); + + do { + const char *v = NULL; + + ogs_assert( + num_of_e_cell_id < + OGS_MAX_NUM_OF_CELL_ID); + if (ogs_yaml_iter_type( + &e_cell_id_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &e_cell_id_iter)) + break; + } + v = ogs_yaml_iter_value( + &e_cell_id_iter); + if (v) { + e_cell_id[ + num_of_e_cell_id] = + ogs_uint64_from_string( + (char*)v); + num_of_e_cell_id++; + } + } while (ogs_yaml_iter_type( + &e_cell_id_iter) == + YAML_SEQUENCE_NODE); + } else + ogs_warn("unknown key `%s`", + sgwc_key); + } + + addr = NULL; + for (i = 0; i < num; i++) { + rv = ogs_addaddrinfo(&addr, family, + hostname[i], port, 0); + ogs_assert(rv == OGS_OK); + } + + ogs_filter_ip_version(&addr, + ogs_global_conf()->parameter. + no_ipv4, + ogs_global_conf()->parameter. + no_ipv6, + ogs_global_conf()->parameter. + prefer_ipv4); + + if (addr == NULL) continue; + + sgw = mme_sgw_add(addr); + ogs_assert(sgw); + + sgw->num_of_tac = num_of_tac; + if (num_of_tac != 0) + memcpy(sgw->tac, + tac, sizeof(sgw->tac)); + + sgw->num_of_e_cell_id = + num_of_e_cell_id; + if (num_of_e_cell_id != 0) + memcpy(sgw->e_cell_id, e_cell_id, + sizeof(sgw->e_cell_id)); + + } while (ogs_yaml_iter_type(&sgwc_array) == + YAML_SEQUENCE_NODE); + + } else if (!strcmp(client_key, "smf")) { + ogs_yaml_iter_t smf_array, smf_iter; + ogs_yaml_iter_recurse( + &client_iter, &smf_array); + do { + mme_pgw_t *pgw = NULL; + ogs_sockaddr_t *addr = NULL; + int family = AF_UNSPEC; + int i, num = 0; + const char *hostname[ + OGS_MAX_NUM_OF_HOSTNAME]; + uint16_t port = + ogs_gtp_self()->gtpc_port; + const char *apn[ + OGS_MAX_NUM_OF_APN] = {NULL,}; + uint8_t num_of_apn = 0; + uint16_t tac[OGS_MAX_NUM_OF_TAI] = {0,}; + uint8_t num_of_tac = 0; + uint32_t e_cell_id[ + OGS_MAX_NUM_OF_CELL_ID] = {0,}; + uint8_t num_of_e_cell_id = 0; + + if (ogs_yaml_iter_type(&smf_array) == + YAML_MAPPING_NODE) { + memcpy(&smf_iter, &smf_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type( + &smf_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&smf_array)) + break; + ogs_yaml_iter_recurse( + &smf_array, &smf_iter); + } else if (ogs_yaml_iter_type( + &smf_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); + + while (ogs_yaml_iter_next(&smf_iter)) { + const char *smf_key = + ogs_yaml_iter_key(&smf_iter); + ogs_assert(smf_key); + if (!strcmp(smf_key, "family")) { + const char *v = + ogs_yaml_iter_value( + &smf_iter); + if (v) family = atoi(v); + if (family != AF_UNSPEC && + family != AF_INET && + family != AF_INET6) { + ogs_warn( + "Ignore family(%d) : " + "AF_UNSPEC(%d), " + "AF_INET(%d), " + "AF_INET6(%d) ", + family, AF_UNSPEC, + AF_INET, AF_INET6); + family = AF_UNSPEC; + } + } else if (!strcmp(smf_key, + "address")) { + ogs_yaml_iter_t hostname_iter; + ogs_yaml_iter_recurse(&smf_iter, + &hostname_iter); + ogs_assert(ogs_yaml_iter_type( + &hostname_iter) != + YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &hostname_iter)) + break; + } + + ogs_assert(num < + OGS_MAX_NUM_OF_HOSTNAME); + hostname[num++] = + ogs_yaml_iter_value( + &hostname_iter); + } while (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp( + smf_key, "port")) { + const char *v = + ogs_yaml_iter_value( + &smf_iter); + if (v) port = atoi(v); + } else if (!strcmp( + smf_key, "apn")) { + ogs_yaml_iter_t apn_iter; + ogs_yaml_iter_recurse( + &smf_iter, &apn_iter); + ogs_assert(ogs_yaml_iter_type( + &apn_iter) != + YAML_MAPPING_NODE); + + do { + const char *v = NULL; + + ogs_assert(num_of_apn < + OGS_MAX_NUM_OF_APN); + if (ogs_yaml_iter_type( + &apn_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &apn_iter)) + break; + } + + v = ogs_yaml_iter_value( + &apn_iter); + if (v) { + apn[num_of_apn] = v; + num_of_apn++; + } + } while (ogs_yaml_iter_type( + &apn_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp( + smf_key, "tac")) { + ogs_yaml_iter_t tac_iter; + ogs_yaml_iter_recurse( + &smf_iter, &tac_iter); + ogs_assert(ogs_yaml_iter_type( + &tac_iter) != + YAML_MAPPING_NODE); + + do { + const char *v = NULL; + + ogs_assert(num_of_tac < + OGS_MAX_NUM_OF_TAI); + if (ogs_yaml_iter_type( + &tac_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &tac_iter)) + break; + } + + v = ogs_yaml_iter_value( + &tac_iter); + if (v) { + tac[num_of_tac] = + atoi(v); + num_of_tac++; + } + } while (ogs_yaml_iter_type( + &tac_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(smf_key, + "e_cell_id")) { + ogs_yaml_iter_t e_cell_id_iter; + ogs_yaml_iter_recurse(&smf_iter, + &e_cell_id_iter); + ogs_assert(ogs_yaml_iter_type( + &e_cell_id_iter) != + YAML_MAPPING_NODE); + + do { + const char *v = NULL; + + ogs_assert( + num_of_e_cell_id < + OGS_MAX_NUM_OF_CELL_ID); + if (ogs_yaml_iter_type( + &e_cell_id_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &e_cell_id_iter)) + break; + } + v = ogs_yaml_iter_value( + &e_cell_id_iter); + if (v) { + e_cell_id[ + num_of_e_cell_id] = + ogs_uint64_from_string( + (char*)v); + num_of_e_cell_id++; + } + } while (ogs_yaml_iter_type( + &e_cell_id_iter) == + YAML_SEQUENCE_NODE); + } else + ogs_warn("unknown key `%s`", + smf_key); + } + + addr = NULL; + for (i = 0; i < num; i++) { + rv = ogs_addaddrinfo(&addr, family, + hostname[i], port, 0); + ogs_assert(rv == OGS_OK); + } + + ogs_filter_ip_version(&addr, + ogs_global_conf()->parameter. + no_ipv4, + ogs_global_conf()->parameter. + no_ipv6, + ogs_global_conf()->parameter. + prefer_ipv4); + + if (addr == NULL) continue; + + pgw = mme_pgw_add(addr); + ogs_assert(pgw); + + pgw->num_of_apn = num_of_apn; + if (num_of_apn != 0) + memcpy(pgw->apn, + apn, sizeof(pgw->apn)); + + pgw->num_of_tac = num_of_tac; + if (num_of_tac != 0) + memcpy(pgw->tac, + tac, sizeof(pgw->tac)); + + pgw->num_of_e_cell_id = + num_of_e_cell_id; + if (num_of_e_cell_id != 0) + memcpy(pgw->e_cell_id, e_cell_id, + sizeof(pgw->e_cell_id)); + + } while (ogs_yaml_iter_type(&smf_array) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(client_key, "sgsn")) { + ogs_yaml_iter_t sgsn_array, sgsn_iter; + ogs_yaml_iter_recurse(&client_iter, + &sgsn_array); + ogs_assert(ogs_yaml_iter_type( + &sgsn_array) == + YAML_SEQUENCE_NODE); + do { + mme_sgsn_t *sgsn = NULL; + + ogs_sockaddr_t *addr = NULL; + int family = AF_UNSPEC; + int i, num = 0; + const char *hostname[ + OGS_MAX_NUM_OF_HOSTNAME]; + uint16_t port = + ogs_gtp_self()->gtpc_port; + + OGS_LIST(route_list); + bool default_route = false; + + if (ogs_yaml_iter_type(&sgsn_array) == + YAML_MAPPING_NODE) { + memcpy(&sgsn_iter, &sgsn_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type( + &sgsn_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &sgsn_array)) + break; + ogs_yaml_iter_recurse(&sgsn_array, + &sgsn_iter); + } else if (ogs_yaml_iter_type( + &sgsn_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); + + while (ogs_yaml_iter_next(&sgsn_iter)) { + const char *sgsn_key = + ogs_yaml_iter_key(&sgsn_iter); + ogs_assert(sgsn_key); + if (!strcmp(sgsn_key, "family")) { + const char *v = + ogs_yaml_iter_value( + &sgsn_iter); + if (v) family = atoi(v); + if (family != AF_UNSPEC && + family != AF_INET && + family != AF_INET6) { + ogs_warn("Ignore family(%d)" + ": AF_UNSPEC(%d), " + "AF_INET(%d), " + "AF_INET6(%d) ", + family, AF_UNSPEC, + AF_INET, AF_INET6); + family = AF_UNSPEC; + } + } else if (!strcmp(sgsn_key, + "address")) { + ogs_yaml_iter_t hostname_iter; + ogs_yaml_iter_recurse( + &sgsn_iter, + &hostname_iter); + ogs_assert(ogs_yaml_iter_type( + &hostname_iter) != + YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &hostname_iter)) + break; + } + + ogs_assert(num < + OGS_MAX_NUM_OF_HOSTNAME); + hostname[num++] = + ogs_yaml_iter_value( + &hostname_iter); + } while ( + ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(sgsn_key, + "port")) { + const char *v = + ogs_yaml_iter_value( + &sgsn_iter); + if (v) port = atoi(v); + } else if (!strcmp(sgsn_key, + "routes")) { + ogs_yaml_iter_t routes_array; + ogs_yaml_iter_t routes_iter; + ogs_yaml_iter_recurse( + &sgsn_iter, + &routes_array); + do { + ogs_nas_rai_t rai; + uint16_t cell_id = 0; + bool rai_parsed = false; + bool cell_id_parsed = false; + mme_sgsn_route_t *sgsn_rt = + NULL; + + if (ogs_yaml_iter_type( + &routes_array) == + YAML_MAPPING_NODE) { + memcpy(&routes_iter, + &routes_array, + sizeof( + ogs_yaml_iter_t)); + } else if ( + ogs_yaml_iter_type( + &routes_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &routes_array)) + break; + ogs_yaml_iter_recurse( + &routes_array, + &routes_iter); + } else if ( + ogs_yaml_iter_type( + &routes_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); + + while (ogs_yaml_iter_next( + &routes_iter)) { + const char *routes_key = + ogs_yaml_iter_key( + &routes_iter); + ogs_assert(routes_key); + if (!strcmp(routes_key, + "rai")) { + memset(&rai, 0, + sizeof(rai)); + rv = parse_rai( + &routes_iter, + &rai); + ogs_assert(rv == + OGS_OK); + rai_parsed = true; + } else if (!strcmp( + routes_key, + "ci")) { + ogs_yaml_iter_t cell_id_iter; + ogs_yaml_iter_recurse( + &routes_iter, &cell_id_iter); + ogs_assert(ogs_yaml_iter_type( + &cell_id_iter) != + YAML_MAPPING_NODE); + do { + const char *v = NULL; + + if (ogs_yaml_iter_type( + &cell_id_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &cell_id_iter)) + break; + } + v = ogs_yaml_iter_value( + &cell_id_iter); + if (v) { + cell_id = atoi((char*)v); + cell_id_parsed = true; + } + } while ( + ogs_yaml_iter_type(&cell_id_iter) == + YAML_SEQUENCE_NODE); + + } else + ogs_warn("unknown " + "key `%s`", + routes_key); + } + + ogs_assert(rai_parsed && + cell_id_parsed); + ogs_pool_alloc( + &mme_sgsn_route_pool, + &sgsn_rt); + ogs_assert(sgsn_rt); + memcpy(&sgsn_rt->rai, &rai, + sizeof(rai)); + sgsn_rt->cell_id = cell_id; + ogs_list_add(&route_list, + sgsn_rt); + + } while (ogs_yaml_iter_type( + &routes_array) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(sgsn_key, + "default_route")) { + default_route = true; + } else + ogs_warn("unknown key `%s`", + sgsn_key); + } + + addr = NULL; + for (i = 0; i < num; i++) { + rv = ogs_addaddrinfo(&addr, + family, hostname[i], port, + 0); + ogs_assert(rv == OGS_OK); + } + + ogs_filter_ip_version(&addr, + ogs_global_conf()->parameter. + no_ipv4, + ogs_global_conf()->parameter. + no_ipv6, + ogs_global_conf()->parameter. + prefer_ipv4); + + if (addr == NULL) continue; + + sgsn = mme_sgsn_add(addr); + ogs_assert(sgsn); + + if (ogs_list_count(&route_list)) + ogs_list_copy(&sgsn->route_list, + &route_list); + + sgsn->default_route = default_route; + + } while (ogs_yaml_iter_type(&sgsn_array) == + YAML_SEQUENCE_NODE); + } else + ogs_warn("unknown key `%s`", client_key); + } + } else + ogs_warn("unknown key `%s`", gtpc_key); + } } else if (!strcmp(mme_key, "gummei")) { ogs_yaml_iter_t gummei_array, gummei_iter; ogs_yaml_iter_recurse(&mme_iter, &gummei_array); @@ -1242,907 +1948,449 @@ int mme_context_parse_config(void) ogs_warn("unknown key `%s`", network_name_key); } } else if (!strcmp(mme_key, "sgsap")) { - ogs_yaml_iter_t sgsap_array, sgsap_iter; - ogs_yaml_iter_recurse(&mme_iter, &sgsap_array); - do { - mme_vlr_t *vlr = NULL; - ogs_plmn_id_t plmn_id; + ogs_yaml_iter_t sgsap_iter; + ogs_yaml_iter_recurse(&mme_iter, &sgsap_iter); + while (ogs_yaml_iter_next(&sgsap_iter)) { + const char *sgsap_key = ogs_yaml_iter_key(&sgsap_iter); + ogs_assert(sgsap_key); + if (!strcmp(sgsap_key, "server")) { + ogs_yaml_iter_t server_iter, server_array; + ogs_yaml_iter_recurse(&sgsap_iter, &server_array); + do { + mme_vlr_t *vlr = NULL; + ogs_plmn_id_t plmn_id; #define MAX_NUM_OF_CSMAP 128 /* Num of TAI-LAI MAP per MME */ - struct { - const char *tai_mcc, *tai_mnc; - const char *lai_mcc, *lai_mnc; - const char *tac, *lac; - } map[MAX_NUM_OF_CSMAP]; - int map_num = 0; - ogs_sockaddr_t *addr = NULL; - int family = AF_UNSPEC; - int i, hostname_num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = self.sgsap_port; + struct { + const char *tai_mcc, *tai_mnc; + const char *lai_mcc, *lai_mnc; + const char *tac, *lac; + } map[MAX_NUM_OF_CSMAP]; + int map_num = 0; + ogs_sockaddr_t *addr = NULL; + int family = AF_UNSPEC; + int i, hostname_num = 0; + const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; + uint16_t port = self.sgsap_port; - ogs_sockopt_t option; - bool is_option = false; + ogs_sockopt_t option; + bool is_option = false; - if (ogs_yaml_iter_type(&sgsap_array) == - YAML_MAPPING_NODE) { - memcpy(&sgsap_iter, &sgsap_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(&sgsap_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&sgsap_array)) - break; - ogs_yaml_iter_recurse(&sgsap_array, &sgsap_iter); - } else if (ogs_yaml_iter_type(&sgsap_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); + if (ogs_yaml_iter_type(&server_array) == + YAML_MAPPING_NODE) { + memcpy(&server_iter, &server_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&server_array)) + break; + ogs_yaml_iter_recurse( + &server_array, &server_iter); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); - while (ogs_yaml_iter_next(&sgsap_iter)) { - const char *sgsap_key = - ogs_yaml_iter_key(&sgsap_iter); - ogs_assert(sgsap_key); - if (!strcmp(sgsap_key, "family")) { - const char *v = - ogs_yaml_iter_value(&sgsap_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; - } - } else if (!strcmp(sgsap_key, "addr") || - !strcmp(sgsap_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse(&sgsap_iter, - &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); + while (ogs_yaml_iter_next(&server_iter)) { + const char *server_key = + ogs_yaml_iter_key(&server_iter); + ogs_assert(server_key); + if (!strcmp(server_key, "family")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) family = atoi(v); + if (family != AF_UNSPEC && + family != AF_INET && + family != AF_INET6) { + ogs_warn("Ignore family(%d) : " + "AF_UNSPEC(%d), " + "AF_INET(%d), AF_INET6(%d) ", + family, + AF_UNSPEC, AF_INET, AF_INET6); + family = AF_UNSPEC; + } + } else if (!strcmp(server_key, "address")) { + ogs_yaml_iter_t hostname_iter; + ogs_yaml_iter_recurse(&server_iter, + &hostname_iter); + ogs_assert(ogs_yaml_iter_type( + &hostname_iter) != + YAML_MAPPING_NODE); - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&hostname_iter)) - break; - } + do { + if (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &hostname_iter)) + break; + } - ogs_assert(hostname_num < - OGS_MAX_NUM_OF_HOSTNAME); - hostname[hostname_num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(sgsap_key, "port")) { - const char *v = - ogs_yaml_iter_value(&sgsap_iter); - if (v) { - port = atoi(v); - self.sgsap_port = port; - } - } else if (!strcmp(sgsap_key, "option")) { - rv = ogs_app_config_parse_sockopt( - &sgsap_iter, &option); - if (rv != OGS_OK) return rv; - is_option = true; - } else if (!strcmp(sgsap_key, "map")) { - ogs_yaml_iter_t map_iter; - ogs_yaml_iter_recurse(&sgsap_iter, &map_iter); + ogs_assert(hostname_num < + OGS_MAX_NUM_OF_HOSTNAME); + hostname[hostname_num++] = + ogs_yaml_iter_value( + &hostname_iter); + } while (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(server_key, "port")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) { + port = atoi(v); + self.sgsap_port = port; + } + } else if (!strcmp(server_key, "option")) { + rv = ogs_app_parse_sockopt_config( + &server_iter, &option); + if (rv != OGS_OK) { + ogs_error("ogs_app_parse_sockopt_" + "config() failed"); + return rv; + } + is_option = true; + } else if (!strcmp(server_key, "map")) { + ogs_yaml_iter_t map_iter; + ogs_yaml_iter_recurse( + &server_iter, &map_iter); - map[map_num].tai_mcc = NULL; - map[map_num].tai_mnc = NULL; - map[map_num].tac = NULL; - map[map_num].lai_mcc = NULL; - map[map_num].lai_mnc = NULL; - map[map_num].lac = NULL; + map[map_num].tai_mcc = NULL; + map[map_num].tai_mnc = NULL; + map[map_num].tac = NULL; + map[map_num].lai_mcc = NULL; + map[map_num].lai_mnc = NULL; + map[map_num].lac = NULL; - while (ogs_yaml_iter_next(&map_iter)) { - const char *map_key = - ogs_yaml_iter_key(&map_iter); - ogs_assert(map_key); - if (!strcmp(map_key, "tai")) { - ogs_yaml_iter_t tai_iter; - ogs_yaml_iter_recurse(&map_iter, - &tai_iter); - - while (ogs_yaml_iter_next(&tai_iter)) { - const char *tai_key = - ogs_yaml_iter_key(&tai_iter); - ogs_assert(tai_key); - - if (!strcmp(tai_key, "plmn_id")) { - ogs_yaml_iter_t plmn_id_iter; - ogs_yaml_iter_recurse(&tai_iter, - &plmn_id_iter); - - while (ogs_yaml_iter_next( - &plmn_id_iter)) { - const char *plmn_id_key = - ogs_yaml_iter_key( - &plmn_id_iter); - ogs_assert(plmn_id_key); - - if (!strcmp(plmn_id_key, - "mcc")) { - map[map_num].tai_mcc = - ogs_yaml_iter_value( - &plmn_id_iter); - } else if (!strcmp( - plmn_id_key, "mnc")) { - map[map_num].tai_mnc = - ogs_yaml_iter_value( - &plmn_id_iter); - } else - ogs_warn( - "unknown key `%s`", - plmn_id_key); - } - } else if (!strcmp(tai_key, - "tac")) { - map[map_num].tac = - ogs_yaml_iter_value( + while (ogs_yaml_iter_next(&map_iter)) { + const char *map_key = + ogs_yaml_iter_key(&map_iter); + ogs_assert(map_key); + if (!strcmp(map_key, "tai")) { + ogs_yaml_iter_t tai_iter; + ogs_yaml_iter_recurse(&map_iter, &tai_iter); - } else - ogs_warn("unknown key `%s`", - tai_key); - } - } else if (!strcmp(map_key, "lai")) { - ogs_yaml_iter_t lai_iter; - ogs_yaml_iter_recurse(&map_iter, - &lai_iter); - - while (ogs_yaml_iter_next(&lai_iter)) { - const char *lai_key = - ogs_yaml_iter_key(&lai_iter); - ogs_assert(lai_key); - - if (!strcmp(lai_key, "plmn_id")) { - ogs_yaml_iter_t plmn_id_iter; - ogs_yaml_iter_recurse(&lai_iter, - &plmn_id_iter); while (ogs_yaml_iter_next( - &plmn_id_iter)) { - const char *plmn_id_key = - ogs_yaml_iter_key( - &plmn_id_iter); - ogs_assert(plmn_id_key); + &tai_iter)) { + const char *tai_key = + ogs_yaml_iter_key( + &tai_iter); + ogs_assert(tai_key); - if (!strcmp(plmn_id_key, - "mcc")) { - map[map_num].lai_mcc = + if (!strcmp(tai_key, + "plmn_id")) { + ogs_yaml_iter_t + plmn_id_iter; + ogs_yaml_iter_recurse( + &tai_iter, + &plmn_id_iter); + + while ( + ogs_yaml_iter_next( + &plmn_id_iter)) { + const char + *plmn_id_key = + ogs_yaml_iter_key( + &plmn_id_iter); + ogs_assert( + plmn_id_key); + + if (!strcmp( + plmn_id_key, + "mcc")) { + map[map_num]. + tai_mcc = ogs_yaml_iter_value( &plmn_id_iter); - } else if (!strcmp( - plmn_id_key, "mnc")) { - map[map_num].lai_mnc = + } else if (!strcmp( + plmn_id_key, + "mnc")) { + map[map_num]. + tai_mnc = ogs_yaml_iter_value( &plmn_id_iter); + } else + ogs_warn( + "unknown key `%s`", + plmn_id_key); + } + } else if (!strcmp(tai_key, + "tac")) { + map[map_num].tac = + ogs_yaml_iter_value( + &tai_iter); } else ogs_warn( "unknown key `%s`", - plmn_id_key); + tai_key); } - } else if (!strcmp(lai_key, - "lac")) { - map[map_num].lac = - ogs_yaml_iter_value( + } else if (!strcmp(map_key, + "lai")) { + ogs_yaml_iter_t lai_iter; + ogs_yaml_iter_recurse(&map_iter, &lai_iter); + + while (ogs_yaml_iter_next( + &lai_iter)) { + const char *lai_key = + ogs_yaml_iter_key( + &lai_iter); + ogs_assert(lai_key); + + if (!strcmp(lai_key, + "plmn_id")) { + ogs_yaml_iter_t + plmn_id_iter; + ogs_yaml_iter_recurse( + &lai_iter, + &plmn_id_iter); + + while ( + ogs_yaml_iter_next( + &plmn_id_iter)) { + const char + *plmn_id_key = + ogs_yaml_iter_key( + &plmn_id_iter); + ogs_assert( + plmn_id_key); + + if (!strcmp( + plmn_id_key, + "mcc")) { + map[map_num]. + lai_mcc = + ogs_yaml_iter_value( + &plmn_id_iter); + } else if (!strcmp( + plmn_id_key, + "mnc")) { + map[map_num]. + lai_mnc = + ogs_yaml_iter_value( + &plmn_id_iter); + } else + ogs_warn( + "unknown key `%s`", + plmn_id_key); + } + } else if (!strcmp(lai_key, + "lac")) { + map[map_num].lac = + ogs_yaml_iter_value( + &lai_iter); + } else + ogs_warn( + "unknown key `%s`", + lai_key); + } } else ogs_warn("unknown key `%s`", - lai_key); + map_key); } + + if (!map[map_num].tai_mcc) { + ogs_error("No map.tai.plmn_id.mcc " + "in configuration file"); + return OGS_ERROR; + } + if (!map[map_num].tai_mnc) { + ogs_error("No map.tai.plmn_id.mnc " + "in configuration file"); + return OGS_ERROR; + } + if (!map[map_num].tac) { + ogs_error("No map.tai.tac " + "in configuration file"); + return OGS_ERROR; + } + if (!map[map_num].lai_mcc) { + ogs_error("No map.lai.plmn_id.mcc " + "in configuration file"); + return OGS_ERROR; + } + if (!map[map_num].lai_mnc) { + ogs_error("No map.lai.plmn_id.mnc " + "in configuration file"); + return OGS_ERROR; + } + if (!map[map_num].lac) { + ogs_error("No map.lai.lac " + "in configuration file"); + return OGS_ERROR; + } + + map_num++; + + } else if (!strcmp(server_key, "tai")) { + ogs_error( + "tai/lai configuraton changed to " + "map.tai/map.lai"); + ogs_log_print(OGS_LOG_ERROR, + "sgsap:\n" + " server\n" + " address: 127.0.0.2\n" + " map:\n" + " tai:\n" + " plmn_id:\n" + " mcc: 001\n" + " mnc: 01\n" + " tac: 4131\n" + " lai:\n" + " plmn_id:\n" + " mcc: 001\n" + " mnc: 01\n" + " lac: 43691\n"); + return OGS_ERROR; + } else if (!strcmp(server_key, "lai")) { + ogs_error( + "tai/lai configuraton changed to " + "map.tai/map.lai"); + ogs_log_print(OGS_LOG_ERROR, + "sgsap:\n" + " server\n" + " address: 127.0.0.2\n" + " map:\n" + " tai:\n" + " plmn_id:\n" + " mcc: 001\n" + " mnc: 01\n" + " tac: 4131\n" + " lai:\n" + " plmn_id:\n" + " mcc: 001\n" + " mnc: 01\n" + " lac: 43691\n"); + return OGS_ERROR; } else - ogs_warn("unknown key `%s`", map_key); + ogs_warn("unknown key `%s`", + server_key); + } - if (!map[map_num].tai_mcc) { - ogs_error("No map.tai.plmn_id.mcc " - "in configuration file"); - return OGS_ERROR; - } - if (!map[map_num].tai_mnc) { - ogs_error("No map.tai.plmn_id.mnc " - "in configuration file"); - return OGS_ERROR; - } - if (!map[map_num].tac) { - ogs_error("No map.tai.tac " - "in configuration file"); - return OGS_ERROR; - } - if (!map[map_num].lai_mcc) { - ogs_error("No map.lai.plmn_id.mcc " - "in configuration file"); - return OGS_ERROR; - } - if (!map[map_num].lai_mnc) { - ogs_error("No map.lai.plmn_id.mnc " - "in configuration file"); - return OGS_ERROR; - } - if (!map[map_num].lac) { - ogs_error("No map.lai.lac " - "in configuration file"); + if (map_num == 0) { + ogs_error("No TAI-LAI Map"); return OGS_ERROR; } - map_num++; + addr = NULL; + for (i = 0; i < hostname_num; i++) { + rv = ogs_addaddrinfo(&addr, + family, hostname[i], port, 0); + ogs_assert(rv == OGS_OK); + } - } else if (!strcmp(sgsap_key, "tai")) { - ogs_error("tai/lai configuraton changed to " - "map.tai/map.lai"); - printf("sgsap:\n" - " addr: 127.0.0.2\n" - " map:\n" - " tai:\n" - " plmn_id:\n" - " mcc: 001\n" - " mnc: 01\n" - " tac: 4131\n" - " lai:\n" - " plmn_id:\n" - " mcc: 001\n" - " mnc: 01\n" - " lac: 43691\n"); - return OGS_ERROR; - } else if (!strcmp(sgsap_key, "lai")) { - ogs_error("tai/lai configuraton changed to " - "map.tai/map.lai"); - printf("sgsap:\n" - " addr: 127.0.0.2\n" - " map:\n" - " tai:\n" - " plmn_id:\n" - " mcc: 001\n" - " mnc: 01\n" - " tac: 4131\n" - " lai:\n" - " plmn_id:\n" - " mcc: 001\n" - " mnc: 01\n" - " lac: 43691\n"); - return OGS_ERROR; - } else - ogs_warn("unknown key `%s`", sgsap_key); + ogs_filter_ip_version(&addr, + ogs_global_conf()->parameter.no_ipv4, + ogs_global_conf()->parameter.no_ipv6, + ogs_global_conf()->parameter. + prefer_ipv4); - } + if (addr == NULL) continue; - if (map_num == 0) { - ogs_error("No TAI-LAI Map"); - return OGS_ERROR; - } + vlr = mme_vlr_add(addr, + is_option ? &option : NULL); + ogs_assert(vlr); - addr = NULL; - for (i = 0; i < hostname_num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } + for (i = 0; i < map_num; i++) { + mme_csmap_t *csmap = mme_csmap_add(vlr); + ogs_assert(csmap); - ogs_filter_ip_version(&addr, - ogs_app()->parameter.no_ipv4, - ogs_app()->parameter.no_ipv6, - ogs_app()->parameter.prefer_ipv4); - - if (addr == NULL) continue; - - vlr = mme_vlr_add(addr, is_option ? &option : NULL); - ogs_assert(vlr); - - for (i = 0; i < map_num; i++) { - mme_csmap_t *csmap = mme_csmap_add(vlr); - ogs_assert(csmap); - - ogs_plmn_id_build(&plmn_id, atoi(map[i].tai_mcc), - atoi(map[i].tai_mnc), strlen(map[i].tai_mnc)); - ogs_nas_from_plmn_id( - &csmap->tai.nas_plmn_id, &plmn_id); - csmap->tai.tac = atoi(map[i].tac); - ogs_plmn_id_build(&plmn_id, atoi(map[i].lai_mcc), - atoi(map[i].lai_mnc), strlen(map[i].lai_mnc)); - ogs_nas_from_plmn_id( - &csmap->lai.nas_plmn_id, &plmn_id); - csmap->lai.lac = atoi(map[i].lac); - } - } while (ogs_yaml_iter_type(&sgsap_array) == - YAML_SEQUENCE_NODE); + ogs_plmn_id_build(&plmn_id, + atoi(map[i].tai_mcc), + atoi(map[i].tai_mnc), + strlen(map[i].tai_mnc)); + ogs_nas_from_plmn_id( + &csmap->tai.nas_plmn_id, &plmn_id); + csmap->tai.tac = atoi(map[i].tac); + ogs_plmn_id_build(&plmn_id, + atoi(map[i].lai_mcc), + atoi(map[i].lai_mnc), + strlen(map[i].lai_mnc)); + ogs_nas_from_plmn_id( + &csmap->lai.nas_plmn_id, &plmn_id); + csmap->lai.lac = atoi(map[i].lac); + } + } while (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE); + } else + ogs_warn("unknown key `%s`", sgsap_key); + } } else if (!strcmp(mme_key, "mme_name")) { self.mme_name = ogs_yaml_iter_value(&mme_iter); + } else if (!strcmp(mme_key, "time")) { + ogs_yaml_iter_t time_iter; + ogs_yaml_iter_recurse(&mme_iter, &time_iter); + while (ogs_yaml_iter_next(&time_iter)) { + const char *time_key = ogs_yaml_iter_key(&time_iter); + ogs_assert(time_key); + if (!strcmp(time_key, "t3402")) { + ogs_yaml_iter_t t3402_iter; + ogs_yaml_iter_recurse(&time_iter, &t3402_iter); + + while (ogs_yaml_iter_next(&t3402_iter)) { + const char *t3402_key = + ogs_yaml_iter_key(&t3402_iter); + ogs_assert(t3402_key); + + if (!strcmp(t3402_key, "value")) { + const char *v = ogs_yaml_iter_value(&t3402_iter); + if (v) + self.time.t3402.value = atoll(v); + } else + ogs_warn("unknown key `%s`", t3402_key); + } + } else if (!strcmp(time_key, "t3412")) { + ogs_yaml_iter_t t3412_iter; + ogs_yaml_iter_recurse(&time_iter, &t3412_iter); + + while (ogs_yaml_iter_next(&t3412_iter)) { + const char *t3412_key = + ogs_yaml_iter_key(&t3412_iter); + ogs_assert(t3412_key); + + if (!strcmp(t3412_key, "value")) { + const char *v = ogs_yaml_iter_value(&t3412_iter); + if (v) + self.time.t3412.value = atoll(v); + } else + ogs_warn("unknown key `%s`", t3412_key); + } + } else if (!strcmp(time_key, "t3423")) { + ogs_yaml_iter_t t3423_iter; + ogs_yaml_iter_recurse(&time_iter, &t3423_iter); + + while (ogs_yaml_iter_next(&t3423_iter)) { + const char *t3423_key = + ogs_yaml_iter_key(&t3423_iter); + ogs_assert(t3423_key); + + if (!strcmp(t3423_key, "value")) { + const char *v = ogs_yaml_iter_value(&t3423_iter); + if (v) + self.time.t3423.value = atoll(v); + } else + ogs_warn("unknown key `%s`", t3423_key); + } + } else if (!strcmp(time_key, "t3512")) { + /* handle config in amf */ + } else if (!strcmp(time_key, "nf_instance")) { + /* handle config in app library */ + } else if (!strcmp(time_key, "subscription")) { + /* handle config in app library */ + } else if (!strcmp(time_key, "message")) { + /* handle config in app library */ + } else if (!strcmp(time_key, "handover")) { + /* handle config in app library */ + } else + ogs_warn("unknown key `%s`", time_key); + } } else if (!strcmp(mme_key, "metrics")) { /* handle config in metrics library */ } else ogs_warn("unknown key `%s`", mme_key); } - } else if (!strcmp(root_key, "sgsn")) { - ogs_yaml_iter_t sgsn_array, sgsn_iter; - ogs_yaml_iter_recurse(&root_iter, &sgsn_array); - ogs_assert(ogs_yaml_iter_type(&sgsn_array) == YAML_SEQUENCE_NODE); - do { - mme_sgsn_t *sgsn = NULL; - if (!ogs_yaml_iter_next(&sgsn_array)) - break; - ogs_yaml_iter_recurse(&sgsn_array, &sgsn_iter); - while (ogs_yaml_iter_next(&sgsn_iter)) { - const char *sgsn_key = ogs_yaml_iter_key(&sgsn_iter); - ogs_assert(sgsn_key); - if (!strcmp(sgsn_key, "gtpc")) { - ogs_yaml_iter_t gtpc_array, gtpc_iter; - ogs_yaml_iter_recurse(&sgsn_iter, >pc_array); - do { - ogs_sockaddr_t *addr = NULL; - int family = AF_UNSPEC; - int i, num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = ogs_gtp_self()->gtpc_port; - - if (ogs_yaml_iter_type(>pc_array) == - YAML_MAPPING_NODE) { - memcpy(>pc_iter, >pc_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(>pc_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(>pc_array)) - break; - ogs_yaml_iter_recurse(>pc_array, >pc_iter); - } else if (ogs_yaml_iter_type(>pc_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); - - while (ogs_yaml_iter_next(>pc_iter)) { - const char *gtpc_key = - ogs_yaml_iter_key(>pc_iter); - ogs_assert(gtpc_key); - if (!strcmp(gtpc_key, "family")) { - const char *v = ogs_yaml_iter_value(>pc_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; - } - } else if (!strcmp(gtpc_key, "addr") || - !strcmp(gtpc_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse(>pc_iter, - &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&hostname_iter)) - break; - } - - ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME); - hostname[num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(gtpc_key, "port")) { - const char *v = ogs_yaml_iter_value(>pc_iter); - if (v) port = atoi(v); - } - } - - addr = NULL; - for (i = 0; i < num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } - - ogs_filter_ip_version(&addr, - ogs_app()->parameter.no_ipv4, - ogs_app()->parameter.no_ipv6, - ogs_app()->parameter.prefer_ipv4); - - if (addr == NULL) continue; - - sgsn = mme_sgsn_add(addr); - ogs_assert(sgsn); - - } while (ogs_yaml_iter_type(>pc_array) == YAML_SEQUENCE_NODE); - } else if (!strcmp(sgsn_key, "routes")) { - ogs_yaml_iter_t routes_array, routes_iter; - ogs_yaml_iter_recurse(&sgsn_iter, &routes_array); - do { - ogs_nas_rai_t rai; - uint16_t cell_id = 0; - bool rai_parsed = false, cell_id_parsed = false; - mme_sgsn_route_t *sgsn_rt = NULL; - - if (ogs_yaml_iter_type(&routes_array) == YAML_MAPPING_NODE) { - memcpy(&routes_iter, &routes_array, sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(&routes_array) == YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&routes_array)) - break; - ogs_yaml_iter_recurse(&routes_array, &routes_iter); - } else if (ogs_yaml_iter_type(&routes_array) == YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); - - while (ogs_yaml_iter_next(&routes_iter)) { - const char *routes_key = ogs_yaml_iter_key(&routes_iter); - ogs_assert(routes_key); - if (!strcmp(routes_key, "rai")) { - memset(&rai, 0, sizeof(rai)); - rv = parse_rai(&routes_iter, &rai); - ogs_assert(rv == OGS_OK); - rai_parsed = true; - } else if (!strcmp(routes_key, "ci")) { - ogs_yaml_iter_t cell_id_iter; - ogs_yaml_iter_recurse(&routes_iter, - &cell_id_iter); - ogs_assert(ogs_yaml_iter_type(&cell_id_iter) - != YAML_MAPPING_NODE); - - do { - const char *v = NULL; - - if (ogs_yaml_iter_type(&cell_id_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next( - &cell_id_iter)) - break; - } - v = ogs_yaml_iter_value(&cell_id_iter); - if (v) { - cell_id = atoi((char*)v); - cell_id_parsed = true; - } - } while ( - ogs_yaml_iter_type(&cell_id_iter) == - YAML_SEQUENCE_NODE); - } else - ogs_warn("unknown key `%s`", routes_key); - } - - ogs_assert(rai_parsed && cell_id_parsed); - ogs_pool_alloc(&mme_sgsn_route_pool, &sgsn_rt); - ogs_assert(sgsn_rt); - memcpy(&sgsn_rt->rai, &rai, sizeof(rai)); - sgsn_rt->cell_id = cell_id; - ogs_list_add(&sgsn->route_list, sgsn_rt); - - } while (ogs_yaml_iter_type(&routes_array) == YAML_SEQUENCE_NODE); - } else if (!strcmp(sgsn_key, "default_route")) { - sgsn->default_route = true; - } - } - } while (ogs_yaml_iter_type(&sgsn_array) == YAML_SEQUENCE_NODE); - } else if (!strcmp(root_key, "sgw") || !strcmp(root_key, "sgwc")) { - ogs_yaml_iter_t sgw_iter; - ogs_yaml_iter_recurse(&root_iter, &sgw_iter); - while (ogs_yaml_iter_next(&sgw_iter)) { - const char *sgw_key = ogs_yaml_iter_key(&sgw_iter); - ogs_assert(sgw_key); - if (!strcmp(sgw_key, "gtpc")) { - ogs_yaml_iter_t gtpc_array, gtpc_iter; - ogs_yaml_iter_recurse(&sgw_iter, >pc_array); - do { - mme_sgw_t *sgw = NULL; - ogs_sockaddr_t *addr = NULL; - int family = AF_UNSPEC; - int i, num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = ogs_gtp_self()->gtpc_port; - uint16_t tac[OGS_MAX_NUM_OF_TAI] = {0,}; - int num_of_tac = 0; - uint32_t e_cell_id[OGS_MAX_NUM_OF_CELL_ID] = {0,}; - int num_of_e_cell_id = 0; - - if (ogs_yaml_iter_type(>pc_array) == - YAML_MAPPING_NODE) { - memcpy(>pc_iter, >pc_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(>pc_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(>pc_array)) - break; - ogs_yaml_iter_recurse(>pc_array, >pc_iter); - } else if (ogs_yaml_iter_type(>pc_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); - - while (ogs_yaml_iter_next(>pc_iter)) { - const char *gtpc_key = - ogs_yaml_iter_key(>pc_iter); - ogs_assert(gtpc_key); - if (!strcmp(gtpc_key, "family")) { - const char *v = ogs_yaml_iter_value(>pc_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; - } - } else if (!strcmp(gtpc_key, "addr") || - !strcmp(gtpc_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse(>pc_iter, - &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&hostname_iter)) - break; - } - - ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME); - hostname[num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(gtpc_key, "port")) { - const char *v = ogs_yaml_iter_value(>pc_iter); - if (v) port = atoi(v); - } else if (!strcmp(gtpc_key, "tac")) { - ogs_yaml_iter_t tac_iter; - ogs_yaml_iter_recurse(>pc_iter, &tac_iter); - ogs_assert(ogs_yaml_iter_type(&tac_iter) != - YAML_MAPPING_NODE); - - do { - const char *v = NULL; - - ogs_assert(num_of_tac < - OGS_MAX_NUM_OF_TAI); - if (ogs_yaml_iter_type(&tac_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&tac_iter)) - break; - } - - v = ogs_yaml_iter_value(&tac_iter); - if (v) { - tac[num_of_tac] = atoi(v); - num_of_tac++; - } - } while ( - ogs_yaml_iter_type(&tac_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(gtpc_key, "e_cell_id")) { - ogs_yaml_iter_t e_cell_id_iter; - ogs_yaml_iter_recurse(>pc_iter, - &e_cell_id_iter); - ogs_assert(ogs_yaml_iter_type(&e_cell_id_iter) - != YAML_MAPPING_NODE); - - do { - const char *v = NULL; - - ogs_assert(num_of_e_cell_id < - OGS_MAX_NUM_OF_CELL_ID); - if (ogs_yaml_iter_type(&e_cell_id_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next( - &e_cell_id_iter)) - break; - } - v = ogs_yaml_iter_value(&e_cell_id_iter); - if (v) { - e_cell_id[num_of_e_cell_id] - = ogs_uint64_from_string((char*)v); - num_of_e_cell_id++; - } - } while ( - ogs_yaml_iter_type(&e_cell_id_iter) == - YAML_SEQUENCE_NODE); - } else - ogs_warn("unknown key `%s`", gtpc_key); - } - - addr = NULL; - for (i = 0; i < num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } - - ogs_filter_ip_version(&addr, - ogs_app()->parameter.no_ipv4, - ogs_app()->parameter.no_ipv6, - ogs_app()->parameter.prefer_ipv4); - - if (addr == NULL) continue; - - sgw = mme_sgw_add(addr); - ogs_assert(sgw); - - sgw->num_of_tac = num_of_tac; - if (num_of_tac != 0) - memcpy(sgw->tac, tac, sizeof(sgw->tac)); - - sgw->num_of_e_cell_id = num_of_e_cell_id; - if (num_of_e_cell_id != 0) - memcpy(sgw->e_cell_id, e_cell_id, - sizeof(sgw->e_cell_id)); - - } while (ogs_yaml_iter_type(>pc_array) == - YAML_SEQUENCE_NODE); - } - } - } else if (!strcmp(root_key, "pgw") || !strcmp(root_key, "smf")) { - ogs_yaml_iter_t pgw_iter; - ogs_yaml_iter_recurse(&root_iter, &pgw_iter); - while (ogs_yaml_iter_next(&pgw_iter)) { - const char *pgw_key = ogs_yaml_iter_key(&pgw_iter); - ogs_assert(pgw_key); - if (!strcmp(pgw_key, "gtpc")) { - ogs_yaml_iter_t gtpc_array, gtpc_iter; - ogs_yaml_iter_recurse(&pgw_iter, >pc_array); - do { - mme_pgw_t *pgw = NULL; - ogs_sockaddr_t *addr = NULL; - int family = AF_UNSPEC; - int i, num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = ogs_gtp_self()->gtpc_port; - const char *apn[OGS_MAX_NUM_OF_APN] = {NULL,}; - uint8_t num_of_apn = 0; - uint16_t tac[OGS_MAX_NUM_OF_TAI] = {0,}; - uint8_t num_of_tac = 0; - uint32_t e_cell_id[OGS_MAX_NUM_OF_CELL_ID] = {0,}; - uint8_t num_of_e_cell_id = 0; - - if (ogs_yaml_iter_type(>pc_array) == - YAML_MAPPING_NODE) { - memcpy(>pc_iter, >pc_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(>pc_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(>pc_array)) - break; - ogs_yaml_iter_recurse(>pc_array, >pc_iter); - } else if (ogs_yaml_iter_type(>pc_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); - - while (ogs_yaml_iter_next(>pc_iter)) { - const char *gtpc_key = - ogs_yaml_iter_key(>pc_iter); - ogs_assert(gtpc_key); - if (!strcmp(gtpc_key, "family")) { - const char *v = ogs_yaml_iter_value(>pc_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; - } - } else if (!strcmp(gtpc_key, "addr") || - !strcmp(gtpc_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse( - >pc_iter, &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&hostname_iter)) - break; - } - - ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME); - hostname[num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(gtpc_key, "port")) { - const char *v = ogs_yaml_iter_value(>pc_iter); - if (v) port = atoi(v); - } else if (!strcmp(gtpc_key, "apn")) { - ogs_yaml_iter_t apn_iter; - ogs_yaml_iter_recurse(>pc_iter, &apn_iter); - ogs_assert(ogs_yaml_iter_type(&apn_iter) != - YAML_MAPPING_NODE); - - do { - const char *v = NULL; - - ogs_assert(num_of_apn < - OGS_MAX_NUM_OF_APN); - if (ogs_yaml_iter_type(&apn_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&apn_iter)) - break; - } - - v = ogs_yaml_iter_value(&apn_iter); - if (v) { - apn[num_of_apn] = v; - num_of_apn++; - } - } while ( - ogs_yaml_iter_type(&apn_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(gtpc_key, "tac")) { - ogs_yaml_iter_t tac_iter; - ogs_yaml_iter_recurse(>pc_iter, &tac_iter); - ogs_assert(ogs_yaml_iter_type(&tac_iter) != - YAML_MAPPING_NODE); - - do { - const char *v = NULL; - - ogs_assert(num_of_tac < - OGS_MAX_NUM_OF_TAI); - if (ogs_yaml_iter_type(&tac_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&tac_iter)) - break; - } - - v = ogs_yaml_iter_value(&tac_iter); - if (v) { - tac[num_of_tac] = atoi(v); - num_of_tac++; - } - } while ( - ogs_yaml_iter_type(&tac_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(gtpc_key, "e_cell_id")) { - ogs_yaml_iter_t e_cell_id_iter; - ogs_yaml_iter_recurse(>pc_iter, - &e_cell_id_iter); - ogs_assert(ogs_yaml_iter_type(&e_cell_id_iter) - != YAML_MAPPING_NODE); - - do { - const char *v = NULL; - - ogs_assert(num_of_e_cell_id < - OGS_MAX_NUM_OF_CELL_ID); - if (ogs_yaml_iter_type(&e_cell_id_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next( - &e_cell_id_iter)) - break; - } - v = ogs_yaml_iter_value(&e_cell_id_iter); - if (v) { - e_cell_id[num_of_e_cell_id] - = ogs_uint64_from_string((char*)v); - num_of_e_cell_id++; - } - } while ( - ogs_yaml_iter_type(&e_cell_id_iter) == - YAML_SEQUENCE_NODE); - } else - ogs_warn("unknown key `%s`", gtpc_key); - } - - addr = NULL; - for (i = 0; i < num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } - - ogs_filter_ip_version(&addr, - ogs_app()->parameter.no_ipv4, - ogs_app()->parameter.no_ipv6, - ogs_app()->parameter.prefer_ipv4); - - if (addr == NULL) continue; - - pgw = mme_pgw_add(addr); - ogs_assert(pgw); - - pgw->num_of_apn = num_of_apn; - if (num_of_apn != 0) - memcpy(pgw->apn, apn, sizeof(pgw->apn)); - - pgw->num_of_tac = num_of_tac; - if (num_of_tac != 0) - memcpy(pgw->tac, tac, sizeof(pgw->tac)); - - pgw->num_of_e_cell_id = num_of_e_cell_id; - if (num_of_e_cell_id != 0) - memcpy(pgw->e_cell_id, e_cell_id, - sizeof(pgw->e_cell_id)); - - } while (ogs_yaml_iter_type(>pc_array) == - YAML_SEQUENCE_NODE); - } - } - } else if (!strcmp(root_key, "time")) { - ogs_yaml_iter_t time_iter; - ogs_yaml_iter_recurse(&root_iter, &time_iter); - while (ogs_yaml_iter_next(&time_iter)) { - const char *time_key = ogs_yaml_iter_key(&time_iter); - ogs_assert(time_key); - if (!strcmp(time_key, "t3402")) { - ogs_yaml_iter_t t3402_iter; - ogs_yaml_iter_recurse(&time_iter, &t3402_iter); - - while (ogs_yaml_iter_next(&t3402_iter)) { - const char *t3402_key = - ogs_yaml_iter_key(&t3402_iter); - ogs_assert(t3402_key); - - if (!strcmp(t3402_key, "value")) { - const char *v = ogs_yaml_iter_value(&t3402_iter); - if (v) - self.time.t3402.value = atoll(v); - } else - ogs_warn("unknown key `%s`", t3402_key); - } - } else if (!strcmp(time_key, "t3412")) { - ogs_yaml_iter_t t3412_iter; - ogs_yaml_iter_recurse(&time_iter, &t3412_iter); - - while (ogs_yaml_iter_next(&t3412_iter)) { - const char *t3412_key = - ogs_yaml_iter_key(&t3412_iter); - ogs_assert(t3412_key); - - if (!strcmp(t3412_key, "value")) { - const char *v = ogs_yaml_iter_value(&t3412_iter); - if (v) - self.time.t3412.value = atoll(v); - } else - ogs_warn("unknown key `%s`", t3412_key); - } - } else if (!strcmp(time_key, "t3423")) { - ogs_yaml_iter_t t3423_iter; - ogs_yaml_iter_recurse(&time_iter, &t3423_iter); - - while (ogs_yaml_iter_next(&t3423_iter)) { - const char *t3423_key = - ogs_yaml_iter_key(&t3423_iter); - ogs_assert(t3423_key); - - if (!strcmp(t3423_key, "value")) { - const char *v = ogs_yaml_iter_value(&t3423_iter); - if (v) - self.time.t3423.value = atoll(v); - } else - ogs_warn("unknown key `%s`", t3423_key); - } - } else if (!strcmp(time_key, "t3512")) { - /* handle config in amf */ - } else if (!strcmp(time_key, "nf_instance")) { - /* handle config in app library */ - } else if (!strcmp(time_key, "subscription")) { - /* handle config in app library */ - } else if (!strcmp(time_key, "message")) { - /* handle config in app library */ - } else if (!strcmp(time_key, "handover")) { - /* handle config in app library */ - } else - ogs_warn("unknown key `%s`", time_key); - } } } @@ -2675,14 +2923,14 @@ enb_ue_t *enb_ue_add(mme_enb_t *enb, uint32_t enb_ue_s1ap_id) } enb_ue->index = ogs_pool_index(&enb_ue_pool, enb_ue); - ogs_assert(enb_ue->index > 0 && enb_ue->index <= ogs_app()->max.ue); + ogs_assert(enb_ue->index > 0 && enb_ue->index <= ogs_global_conf()->max.ue); enb_ue->enb_ue_s1ap_id = enb_ue_s1ap_id; enb_ue->mme_ue_s1ap_id = enb_ue->index; /* * SCTP output stream identification - * Default ogs_app()->parameter.sctp_streams : 30 + * Default ogs_global_conf()->parameter.sctp_streams : 30 * 0 : Non UE signalling * 1-29 : UE specific association */ @@ -4288,7 +4536,7 @@ int mme_m_tmsi_pool_generate(void) int index = 0; ogs_trace("M-TMSI Pool try to generate..."); - while (index < ogs_app()->max.ue*2) { + while (index < ogs_global_conf()->max.ue*2) { mme_m_tmsi_t *m_tmsi = NULL; int conflict = 0; diff --git a/src/mme/mme-init.c b/src/mme/mme-init.c index 3c2571a28..63729a781 100644 --- a/src/mme/mme-init.c +++ b/src/mme/mme-init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -40,6 +40,10 @@ int mme_initialize(void) { int rv; +#define APP_NAME "mme" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + mme_metrics_init(); ogs_gtp_context_init(OGS_MAX_NUM_OF_GTPU_RESOURCE); @@ -48,10 +52,10 @@ int mme_initialize(void) rv = ogs_gtp_xact_init(); if (rv != OGS_OK) return rv; - rv = ogs_gtp_context_parse_config("mme", "sgwc"); + rv = ogs_gtp_context_parse_config(APP_NAME, "sgwc"); if (rv != OGS_OK) return rv; - rv = ogs_metrics_context_parse_config("mme"); + rv = ogs_metrics_context_parse_config(APP_NAME); if (rv != OGS_OK) return rv; rv = mme_context_parse_config(); diff --git a/src/mme/s1ap-handler.c b/src/mme/s1ap-handler.c index f7bbbcca2..62be95fac 100644 --- a/src/mme/s1ap-handler.c +++ b/src/mme/s1ap-handler.c @@ -45,7 +45,7 @@ static bool maximum_number_of_enbs_is_reached(void) } } - return number_of_enbs_online >= ogs_app()->max.peer; + return number_of_enbs_online >= ogs_global_conf()->max.peer; } static bool enb_plmn_id_is_foreign(mme_enb_t *enb) @@ -3693,7 +3693,7 @@ void s1ap_handle_handover_notification( S1AP_Cause_PR_radioNetwork, S1AP_CauseRadioNetwork_successful_handover, S1AP_UE_CTX_REL_S1_HANDOVER_COMPLETE, - ogs_app()->time.handover.duration); + ogs_local_conf()->time.handover.duration); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); diff --git a/src/nrf/context.c b/src/nrf/context.c index 1ccc2f91d..881988f5b 100644 --- a/src/nrf/context.c +++ b/src/nrf/context.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -23,8 +23,12 @@ static nrf_context_t self; int __nrf_log_domain; +static OGS_POOL(nrf_assoc_pool, nrf_assoc_t); + static int context_initialized = 0; +static int max_num_of_nrf_assoc = 0; + void nrf_context_init(void) { ogs_assert(context_initialized == 0); @@ -34,6 +38,10 @@ void nrf_context_init(void) ogs_log_install_domain(&__nrf_log_domain, "nrf", ogs_core()->log.level); +#define MAX_NUM_OF_NRF_ASSOC 8 + max_num_of_nrf_assoc = ogs_global_conf()->max.ue * MAX_NUM_OF_NRF_ASSOC; + ogs_pool_init(&nrf_assoc_pool, max_num_of_nrf_assoc); + context_initialized = 1; } @@ -51,6 +59,10 @@ void nrf_context_final(void) nrf_nf_fsm_fini(nf_instance); } + nrf_assoc_remove_all(); + + ogs_pool_final(&nrf_assoc_pool); + context_initialized = 0; } @@ -63,8 +75,8 @@ static int nrf_context_prepare(void) { /* NF Instance Heartbeat * Default value is 10 seconds if it is not configured in nrf.yaml */ - if (!ogs_app()->time.nf_instance.heartbeat_interval) - ogs_app()->time.nf_instance.heartbeat_interval = 10; + if (!ogs_local_conf()->time.nf_instance.heartbeat_interval) + ogs_local_conf()->time.nf_instance.heartbeat_interval = 10; return OGS_OK; } @@ -107,7 +119,7 @@ int nrf_context_parse_config(void) if (!strcmp(sbi_key, "heartbeat")) { const char *v = ogs_yaml_iter_value(&sbi_iter); - if (v) ogs_app()->time.nf_instance. + if (v) ogs_local_conf()->time.nf_instance. heartbeat_interval = atoi(v); } } @@ -121,3 +133,41 @@ int nrf_context_parse_config(void) return OGS_OK; } + +nrf_assoc_t *nrf_assoc_add(ogs_sbi_stream_t *stream) +{ + nrf_assoc_t *assoc = NULL; + + ogs_assert(stream); + + ogs_pool_alloc(&nrf_assoc_pool, &assoc); + if (!assoc) { + ogs_error("Maximum number of association[%d] reached", + max_num_of_nrf_assoc); + return NULL; + } + memset(assoc, 0, sizeof *assoc); + + assoc->stream = stream; + + ogs_list_add(&self.assoc_list, assoc); + + return assoc; +} + +void nrf_assoc_remove(nrf_assoc_t *assoc) +{ + ogs_assert(assoc); + + ogs_list_remove(&self.assoc_list, assoc); + + ogs_pool_free(&nrf_assoc_pool, assoc); +} + +void nrf_assoc_remove_all(void) +{ + nrf_assoc_t *assoc = NULL, *next_assoc = NULL; + + ogs_list_for_each_safe(&self.assoc_list, next_assoc, assoc) + nrf_assoc_remove(assoc); +} diff --git a/src/nrf/context.h b/src/nrf/context.h index 2cce05ab9..b35bfd3f6 100644 --- a/src/nrf/context.h +++ b/src/nrf/context.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -36,15 +36,27 @@ extern int __nrf_log_domain; #define OGS_LOG_DOMAIN __nrf_log_domain typedef struct nrf_context_s { - int dummy; + ogs_list_t assoc_list; } nrf_context_t; +typedef struct nrf_assoc_s nrf_assoc_t; + +typedef struct nrf_assoc_s { + ogs_lnode_t lnode; + + ogs_sbi_stream_t *stream; +} nrf_assoc_t; + void nrf_context_init(void); void nrf_context_final(void); nrf_context_t *nrf_self(void); int nrf_context_parse_config(void); +nrf_assoc_t *nrf_assoc_add(ogs_sbi_stream_t *stream); +void nrf_assoc_remove(nrf_assoc_t *assoc); +void nrf_assoc_remove_all(void); + #ifdef __cplusplus } #endif diff --git a/src/nrf/init.c b/src/nrf/init.c index d56050a4a..5bb3593da 100644 --- a/src/nrf/init.c +++ b/src/nrf/init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -27,10 +27,14 @@ int nrf_initialize(void) { int rv; +#define APP_NAME "nrf" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + ogs_sbi_context_init(OpenAPI_nf_type_NRF); nrf_context_init(); - rv = ogs_sbi_context_parse_config("nrf", NULL, "scp"); + rv = ogs_sbi_context_parse_config(APP_NAME, NULL, NULL); if (rv != OGS_OK) return rv; rv = nrf_context_parse_config(); diff --git a/src/nrf/nf-sm.c b/src/nrf/nf-sm.c index aab91d109..8e2047297 100644 --- a/src/nrf/nf-sm.c +++ b/src/nrf/nf-sm.c @@ -193,7 +193,8 @@ void nrf_nf_state_registered(ogs_fsm_t *s, nrf_event_t *e) ogs_timer_start(nf_instance->t_no_heartbeat, ogs_time_from_sec( nf_instance->time.heartbeat_interval + - ogs_app()->time.nf_instance.no_heartbeat_margin)); + ogs_local_conf()->time.nf_instance. + no_heartbeat_margin)); } ogs_assert(true == @@ -231,7 +232,7 @@ void nrf_nf_state_registered(ogs_fsm_t *s, nrf_event_t *e) ogs_timer_start(nf_instance->t_no_heartbeat, ogs_time_from_sec( nf_instance->time.heartbeat_interval + - ogs_app()->time.nf_instance. + ogs_local_conf()->time.nf_instance. no_heartbeat_margin)); } diff --git a/src/nrf/nnrf-build.c b/src/nrf/nnrf-build.c index d957f6a4e..38fcb0a11 100644 --- a/src/nrf/nnrf-build.c +++ b/src/nrf/nnrf-build.c @@ -51,7 +51,7 @@ ogs_sbi_request_t *nrf_nnrf_nfm_build_nf_status_notify( NotificationData->event = event; - server = ogs_list_first(&ogs_sbi_self()->server_list); + server = ogs_sbi_server_first(); if (!server) { ogs_error("No server"); goto end; diff --git a/src/nrf/nnrf-handler.c b/src/nrf/nnrf-handler.c index 166ce17b1..024219e23 100644 --- a/src/nrf/nnrf-handler.c +++ b/src/nrf/nnrf-handler.c @@ -18,6 +18,12 @@ */ #include "nnrf-handler.h" +#include "sbi-path.h" + +static int discover_handler( + int status, ogs_sbi_response_t *response, void *data); +static void handle_nf_discover_search_result( + OpenAPI_search_result_t *SearchResult); bool nrf_nnrf_handle_nf_register(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg) @@ -69,6 +75,33 @@ bool nrf_nnrf_handle_nf_register(ogs_sbi_nf_instance_t *nf_instance, ogs_nnrf_nfm_handle_nf_profile(nf_instance, NFProfile); + ogs_sbi_client_associate(nf_instance); + + switch (nf_instance->nf_type) { + case OpenAPI_nf_type_SEPP: + ogs_sbi_self()->sepp_instance = nf_instance; + break; + case OpenAPI_nf_type_SCP: + ogs_sbi_self()->scp_instance = nf_instance; + break; + default: + break; + } + + /* + * TS29.510 + * Table 6.1.6.2.2-1: Definition of type NFProfile + * If not provided, the PLMN of the NRF are assumed for the NF. + */ + if (ogs_local_conf()->num_of_serving_plmn_id && + NFProfile->plmn_list == NULL) { + /* NRF has PLMN and NF does NOT have PLMN, + * so, copy NRF PLMN to NF PLMN */ + memcpy(nf_instance->plmn_id, ogs_local_conf()->serving_plmn_id, + sizeof(nf_instance->plmn_id)); + nf_instance->num_of_plmn_id = ogs_local_conf()->num_of_serving_plmn_id; + } + if (OGS_FSM_CHECK(&nf_instance->sm, nrf_nf_state_will_register)) { recvmsg->http.location = recvmsg->h.uri; status = OGS_SBI_HTTP_STATUS_CREATED; @@ -80,7 +113,7 @@ bool nrf_nnrf_handle_nf_register(ogs_sbi_nf_instance_t *nf_instance, /* NRF uses pre-configured heartbeat if NFs did not send it */ if (NFProfile->is_heart_beat_timer == false) nf_instance->time.heartbeat_interval = - ogs_app()->time.nf_instance.heartbeat_interval; + ogs_local_conf()->time.nf_instance.heartbeat_interval; /* * TS29.510 @@ -93,6 +126,9 @@ bool nrf_nnrf_handle_nf_register(ogs_sbi_nf_instance_t *nf_instance, OpenAPI_nf_profile_t NFProfileChanges; ogs_sbi_message_t sendmsg; + OpenAPI_plmn_id_t *PlmnId = NULL; + OpenAPI_lnode_t *node = NULL; + memset(&NFProfileChanges, 0, sizeof(NFProfileChanges)); NFProfileChanges.nf_instance_id = NFProfile->nf_instance_id; NFProfileChanges.nf_type = NFProfile->nf_type; @@ -107,12 +143,40 @@ bool nrf_nnrf_handle_nf_register(ogs_sbi_nf_instance_t *nf_instance, NFProfileChanges.is_nf_profile_changes_ind = true; NFProfileChanges.nf_profile_changes_ind = true; + if (ogs_local_conf()->num_of_serving_plmn_id && + NFProfile->plmn_list == NULL) { + OpenAPI_list_t *PlmnIdList = NULL; + int i; + + PlmnIdList = OpenAPI_list_create(); + ogs_assert(PlmnIdList); + + for (i = 0; i < ogs_local_conf()->num_of_serving_plmn_id; i++) { + PlmnId = ogs_sbi_build_plmn_id( + &ogs_local_conf()->serving_plmn_id[i]); + ogs_assert(PlmnId); + OpenAPI_list_add(PlmnIdList, PlmnId); + } + + if (PlmnIdList->count) + NFProfileChanges.plmn_list = PlmnIdList; + else + OpenAPI_list_free(PlmnIdList); + } + memset(&sendmsg, 0, sizeof(sendmsg)); sendmsg.http.location = recvmsg->http.location; sendmsg.NFProfile = &NFProfileChanges; response = ogs_sbi_build_response(&sendmsg, status); + OpenAPI_list_for_each(NFProfileChanges.plmn_list, node) { + PlmnId = node->data; + if (PlmnId) + ogs_sbi_free_plmn_id(PlmnId); + } + OpenAPI_list_free(NFProfileChanges.plmn_list); + } else { if (NFProfile->is_heart_beat_timer == false) { @@ -213,7 +277,9 @@ bool nrf_nnrf_handle_nf_status_subscribe( ogs_sbi_subscription_data_t *subscription_data = NULL; ogs_sbi_client_t *client = NULL; OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; - ogs_sockaddr_t *addr = NULL; + char *fqdn = NULL; + uint16_t fqdn_port = 0; + ogs_sockaddr_t *addr = NULL, *addr6 = NULL; ogs_sbi_server_t *server = NULL; ogs_sbi_header_t header; @@ -331,7 +397,7 @@ bool nrf_nnrf_handle_nf_status_subscribe( ogs_strdup(SubscriptionData->nf_status_notification_uri); ogs_assert(subscription_data->notification_uri); - rc = ogs_sbi_getaddr_from_uri(&scheme, &addr, + rc = ogs_sbi_getaddr_from_uri(&scheme, &fqdn, &fqdn_port, &addr, &addr6, subscription_data->notification_uri); if (rc == false || scheme == OpenAPI_uri_scheme_NULL) { ogs_assert(true == @@ -342,20 +408,23 @@ bool nrf_nnrf_handle_nf_status_subscribe( return false; } - client = ogs_sbi_client_find(scheme, addr); + client = ogs_sbi_client_find(scheme, fqdn, fqdn_port, addr, addr6); if (!client) { ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); - client = ogs_sbi_client_add(scheme, addr); + client = ogs_sbi_client_add(scheme, fqdn, fqdn_port, addr, addr6); ogs_assert(client); } OGS_SBI_SETUP_CLIENT(subscription_data, client); + + ogs_free(fqdn); ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); /* * The NRF validity is initially set in configuration. */ subscription_data->time.validity_duration = - ogs_app()->time.subscription.validity_duration; + ogs_local_conf()->time.subscription.validity_duration; if (subscription_data->time.validity_duration) { SubscriptionData->validity_time = ogs_sbi_localtime_string( @@ -729,17 +798,6 @@ bool nrf_nnrf_handle_nf_discover( OpenAPI_nf_type_ToString(recvmsg->param.requester_nf_type), OpenAPI_nf_type_ToString(recvmsg->param.target_nf_type)); - SearchResult = ogs_calloc(1, sizeof(*SearchResult)); - ogs_assert(SearchResult); - - SearchResult->is_validity_period = true; - SearchResult->validity_period = - ogs_app()->time.nf_instance.validity_duration; - ogs_assert(SearchResult->validity_period); - - SearchResult->nf_instances = OpenAPI_list_create(); - ogs_assert(SearchResult->nf_instances); - if (recvmsg->param.discovery_option) discovery_option = recvmsg->param.discovery_option; @@ -773,12 +831,34 @@ bool nrf_nnrf_handle_nf_discover( &discovery_option->tai[0].plmn_id), discovery_option->tai[0].tac.v); } + if (discovery_option->num_of_target_plmn_list) { + for (i = 0; i < discovery_option->num_of_target_plmn_list; i++) + ogs_debug("[%d] target-plmn-list[MCC:%03d,MNC:%03d]", i, + ogs_plmn_id_mcc( + &discovery_option->target_plmn_list[i]), + ogs_plmn_id_mnc( + &discovery_option->target_plmn_list[i])); + } + if (discovery_option->num_of_requester_plmn_list) { + for (i = 0; i < discovery_option->num_of_requester_plmn_list; i++) + ogs_debug("[%d] requester-plmn-list[MCC:%03d,MNC:%03d]", i, + ogs_plmn_id_mcc( + &discovery_option->requester_plmn_list[i]), + ogs_plmn_id_mnc( + &discovery_option->requester_plmn_list[i])); + } if (discovery_option->requester_features) { ogs_debug("requester-features[0x%llx]", (long long)discovery_option->requester_features); } } + SearchResult = ogs_calloc(1, sizeof(*SearchResult)); + ogs_assert(SearchResult); + + SearchResult->nf_instances = OpenAPI_list_create(); + ogs_assert(SearchResult->nf_instances); + i = 0; ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) { if (NF_INSTANCE_EXCLUDED_FROM_DISCOVERY(nf_instance)) @@ -813,6 +893,7 @@ bool nrf_nnrf_handle_nf_discover( OGS_SBI_FEATURES_IS_SET( discovery_option->requester_features, OGS_SBI_NNRF_DISC_SERVICE_MAP) ? true : false); + OpenAPI_list_add(SearchResult->nf_instances, NFProfile); i++; @@ -821,15 +902,138 @@ bool nrf_nnrf_handle_nf_discover( if (recvmsg->param.limit) SearchResult->num_nf_inst_complete = i; memset(&sendmsg, 0, sizeof(sendmsg)); - sendmsg.SearchResult = SearchResult; - sendmsg.http.cache_control = - ogs_msprintf("max-age=%d", SearchResult->validity_period); - ogs_assert(sendmsg.http.cache_control); - response = ogs_sbi_build_response(&sendmsg, OGS_SBI_HTTP_STATUS_OK); - ogs_assert(response); - ogs_assert(true == ogs_sbi_server_send_response(stream, response)); + if (SearchResult->nf_instances->count) { + /* NF-Instances are Discovered */ + + SearchResult->is_validity_period = true; + SearchResult->validity_period = + ogs_local_conf()->time.nf_instance.validity_duration; + ogs_assert(SearchResult->validity_period); + + sendmsg.SearchResult = SearchResult; + sendmsg.http.cache_control = + ogs_msprintf("max-age=%d", SearchResult->validity_period); + ogs_assert(sendmsg.http.cache_control); + + response = ogs_sbi_build_response(&sendmsg, OGS_SBI_HTTP_STATUS_OK); + ogs_assert(response); + ogs_assert(true == ogs_sbi_server_send_response(stream, response)); + + goto cleanup; + + } else if (discovery_option->num_of_target_plmn_list && + discovery_option->num_of_requester_plmn_list) { + + /* No Discovery, Try to find different PLMN */ + + bool rc; + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_client_t *client = NULL; + ogs_sbi_request_t *request = NULL; + + nrf_assoc_t *assoc = NULL; + + ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) { + if (nf_instance->nf_type != OpenAPI_nf_type_NRF) + continue; + + if (ogs_sbi_discovery_option_target_plmn_list_is_matched( + nf_instance, discovery_option) == false) + continue; + + break; + } + + if (!nf_instance) { + nf_instance = ogs_sbi_nf_instance_add(); + ogs_assert(nf_instance); + ogs_sbi_nf_instance_set_type(nf_instance, OpenAPI_nf_type_NRF); + + /* + * If nrf_nf_fsm_init() is not executed, nf_instance->sm is NULL. + * + * Since nf_instance->sm is NULL, nrf_nf_fsm_final() + * is not executed later in nrf_context_final(). + */ + + memcpy(nf_instance->plmn_id, + discovery_option->target_plmn_list, + sizeof(nf_instance->plmn_id)); + 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); + + ogs_sbi_client_associate(nf_instance); + } + + client = NF_INSTANCE_CLIENT(nf_instance); + ogs_assert(client); + + /* + * TS29.510 + * 5.3.2.4 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. + * In this step, the presence of the PLMN ID of the Home NRF + * in the query parameter of the URI is not required. + */ + discovery_option->num_of_target_plmn_list = 0; + + assoc = nrf_assoc_add(stream); + if (!assoc) { + ogs_error("nrf_assoc_add() failed"); + ogs_assert(true == ogs_sbi_server_send_error( + stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, + recvmsg, "nrf_assoc_add() failed", NULL)); + goto cleanup; + } + + request = ogs_nnrf_disc_build_discover( + recvmsg->param.target_nf_type, + recvmsg->param.requester_nf_type, + discovery_option); + if (!request) { + ogs_error("ogs_nnrf_disc_build_discover() failed"); + ogs_assert(true == ogs_sbi_server_send_error( + stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, + recvmsg, "ogs_nnrf_disc_build_discover() failed", NULL)); + nrf_assoc_remove(assoc); + goto cleanup; + } + + rc = ogs_sbi_send_request_to_client( + client, discover_handler, request, assoc); + if (rc == false) { + ogs_error("ogs_sbi_send_request_to_client"); + ogs_assert(true == ogs_sbi_server_send_error( + stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, + recvmsg, "ogs_sbi_send_request_to_client() failed", NULL)); + ogs_sbi_request_free(request); + nrf_assoc_remove(assoc); + goto cleanup; + } + + ogs_sbi_request_free(request); + + } else { + + /* No Discovery */ + + sendmsg.SearchResult = SearchResult; + + response = ogs_sbi_build_response(&sendmsg, OGS_SBI_HTTP_STATUS_OK); + ogs_assert(response); + ogs_assert(true == ogs_sbi_server_send_response(stream, response)); + + goto cleanup; + } + +cleanup: OpenAPI_list_for_each(SearchResult->nf_instances, node) { NFProfile = node->data; if (NFProfile) ogs_nnrf_nfm_free_nf_profile(NFProfile); @@ -838,7 +1042,144 @@ bool nrf_nnrf_handle_nf_discover( if (sendmsg.http.cache_control) ogs_free(sendmsg.http.cache_control); + ogs_free(SearchResult); return true; } + +static int discover_handler( + int status, ogs_sbi_response_t *response, void *data) +{ + int rv; + ogs_sbi_message_t message; + + nrf_assoc_t *assoc = data; + ogs_sbi_stream_t *stream = NULL; + + ogs_assert(assoc); + stream = assoc->stream; + ogs_assert(stream); + + if (status != OGS_OK) { + + ogs_log_message( + status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0, + "response_handler() failed [%d]", status); + + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL, + "response_handler() failed", NULL)); + + nrf_assoc_remove(assoc); + + return OGS_ERROR; + } + + ogs_assert(response); + + rv = ogs_sbi_parse_response(&message, response); + if (rv != OGS_OK) { + ogs_error("cannot parse HTTP response"); + goto cleanup; + } + + if (message.res_status != OGS_SBI_HTTP_STATUS_OK) { + ogs_error("NF-Discover failed [%d]", message.res_status); + goto cleanup; + } + + if (!message.SearchResult) { + ogs_error("No SearchResult"); + goto cleanup; + } + + handle_nf_discover_search_result(message.SearchResult); + +cleanup: + ogs_expect(true == ogs_sbi_server_send_response(stream, response)); + nrf_assoc_remove(assoc); + ogs_sbi_message_free(&message); + + return OGS_OK; +} + +static void handle_nf_discover_search_result( + OpenAPI_search_result_t *SearchResult) +{ + OpenAPI_lnode_t *node = NULL; + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_assert(SearchResult); + + OpenAPI_list_for_each(SearchResult->nf_instances, node) { + OpenAPI_nf_profile_t *NFProfile = NULL; + + if (!node->data) continue; + + NFProfile = node->data; + + if (!NFProfile) { + ogs_error("No NFProfile"); + continue; + } + + if (!NFProfile->nf_instance_id) { + ogs_error("No NFProfile.NFInstanceId"); + continue; + } + + if (!NFProfile->nf_type) { + ogs_error("No NFProfile.NFType"); + continue; + } + + if (!NFProfile->nf_status) { + ogs_error("No NFProfile.NFStatus"); + continue; + } + + nf_instance = ogs_sbi_nf_instance_find(NFProfile->nf_instance_id); + if (!nf_instance) { + nf_instance = ogs_sbi_nf_instance_add(); + ogs_assert(nf_instance); + + ogs_sbi_nf_instance_set_id(nf_instance, NFProfile->nf_instance_id); + + /* + * If nrf_nf_fsm_init() is not executed, nf_instance->sm is NULL. + * + * Since nf_instance->sm is NULL, nrf_nf_fsm_final() + * is not executed later in nrf_context_final(). + */ + + ogs_info("[%s:%s] (NF-discover) NF registered", + NFProfile->nf_instance_id, + OpenAPI_nf_type_ToString(NFProfile->nf_type)); + } else { + + ogs_warn("[%s:%s] (NF-discover) NF has already been added", + NFProfile->nf_instance_id, + OpenAPI_nf_type_ToString(NFProfile->nf_type)); + } + + if (NF_INSTANCE_ID_IS_OTHERS(nf_instance->id)) { + ogs_nnrf_nfm_handle_nf_profile(nf_instance, NFProfile); + + ogs_sbi_client_associate(nf_instance); + + switch (nf_instance->nf_type) { + case OpenAPI_nf_type_SEPP: + ogs_sbi_self()->sepp_instance = nf_instance; + break; + default: + break; + } + + ogs_info("[%s:%s] (NF-discover) NF Profile updated", + nf_instance->id, + OpenAPI_nf_type_ToString(nf_instance->nf_type)); + } + } +} diff --git a/src/nrf/nrf-sm.c b/src/nrf/nrf-sm.c index 21b49b708..d9038e333 100644 --- a/src/nrf/nrf-sm.c +++ b/src/nrf/nrf-sm.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -41,10 +41,12 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) int rv; ogs_sbi_stream_t *stream = NULL; ogs_sbi_request_t *request = NULL; - ogs_sbi_message_t message; + ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_subscription_data_t *subscription_data = NULL; + ogs_sbi_message_t message; + ogs_assert(e); nrf_sm_debug(e); @@ -137,6 +139,11 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) ogs_sbi_nf_instance_set_id(nf_instance, message.h.resource.component[1]); + /* + * If nrf_nf_fsm_init() is executed, + * nrf_nf_fsm_final() is executed later + * in nrf_context_final(). + */ nrf_nf_fsm_init(nf_instance); break; DEFAULT diff --git a/src/nrf/sbi-path.c b/src/nrf/sbi-path.c index 257c52ccc..1e92f0d21 100644 --- a/src/nrf/sbi-path.c +++ b/src/nrf/sbi-path.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -20,35 +20,7 @@ #include "sbi-path.h" static int client_notify_cb( - int status, ogs_sbi_response_t *response, void *data) -{ - int rv; - ogs_sbi_message_t message; - - if (status != OGS_OK) { - ogs_log_message( - status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0, - "client_notify_cb() failed [%d]", status); - return OGS_ERROR; - } - - ogs_assert(response); - - rv = ogs_sbi_parse_response(&message, response); - if (rv != OGS_OK) { - ogs_error("cannot parse HTTP response"); - ogs_sbi_message_free(&message); - ogs_sbi_response_free(response); - return OGS_ERROR; - } - - if (message.res_status != OGS_SBI_HTTP_STATUS_NO_CONTENT) - ogs_warn("Subscription notification failed [%d]", message.res_status); - - ogs_sbi_message_free(&message); - ogs_sbi_response_free(response); - return OGS_OK; -} + int status, ogs_sbi_response_t *response, void *data); int nrf_sbi_open(void) { @@ -155,3 +127,34 @@ bool nrf_nnrf_nfm_send_nf_status_notify_all( return true; } + +static int client_notify_cb( + int status, ogs_sbi_response_t *response, void *data) +{ + int rv; + ogs_sbi_message_t message; + + if (status != OGS_OK) { + ogs_log_message( + status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0, + "client_notify_cb() failed [%d]", status); + return OGS_ERROR; + } + + ogs_assert(response); + + rv = ogs_sbi_parse_response(&message, response); + if (rv != OGS_OK) { + ogs_error("cannot parse HTTP response"); + ogs_sbi_message_free(&message); + ogs_sbi_response_free(response); + return OGS_ERROR; + } + + if (message.res_status != OGS_SBI_HTTP_STATUS_NO_CONTENT) + ogs_warn("Subscription notification failed [%d]", message.res_status); + + ogs_sbi_message_free(&message); + ogs_sbi_response_free(response); + return OGS_OK; +} diff --git a/src/nrf/sbi-path.h b/src/nrf/sbi-path.h index ad173c22d..0203f698b 100644 --- a/src/nrf/sbi-path.h +++ b/src/nrf/sbi-path.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * diff --git a/src/nssf/context.c b/src/nssf/context.c index 5da8b61c6..d776926f2 100644 --- a/src/nssf/context.c +++ b/src/nssf/context.c @@ -94,168 +94,174 @@ int nssf_context_parse_config(void) while (ogs_yaml_iter_next(&nssf_iter)) { const char *nssf_key = ogs_yaml_iter_key(&nssf_iter); ogs_assert(nssf_key); - if (!strcmp(nssf_key, "sbi")) { + if (!strcmp(nssf_key, "default")) { + /* handle config in sbi library */ + } else if (!strcmp(nssf_key, "sbi")) { + /* handle config in sbi library */ + ogs_yaml_iter_t sbi_iter; + ogs_yaml_iter_recurse(&nssf_iter, &sbi_iter); + while (ogs_yaml_iter_next(&sbi_iter)) { + const char *sbi_key = ogs_yaml_iter_key(&sbi_iter); + ogs_assert(sbi_key); + if (!strcmp(sbi_key, "server")) { + } else if (!strcmp(sbi_key, "client")) { + ogs_yaml_iter_t client_iter; + ogs_yaml_iter_recurse(&sbi_iter, &client_iter); + while (ogs_yaml_iter_next(&client_iter)) { + const char *client_key = + ogs_yaml_iter_key(&client_iter); + ogs_assert(client_key); + if (!strcmp(client_key, "nsi")) { + ogs_yaml_iter_t nsi_array, nsi_iter; + ogs_yaml_iter_recurse(&client_iter, + &nsi_array); + do { + const char *uri = NULL; + const char *sst = NULL, *sd = NULL; + + if (ogs_yaml_iter_type(&nsi_array) == + YAML_MAPPING_NODE) { + memcpy(&nsi_iter, &nsi_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type( + &nsi_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&nsi_array)) + break; + ogs_yaml_iter_recurse( + &nsi_array, &nsi_iter); + } else if (ogs_yaml_iter_type( + &nsi_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); + + while (ogs_yaml_iter_next(&nsi_iter)) { + const char *nsi_key = + ogs_yaml_iter_key(&nsi_iter); + ogs_assert(nsi_key); + if (!strcmp(nsi_key, "uri")) { + uri = ogs_yaml_iter_value( + &nsi_iter); + } else if (!strcmp(nsi_key, + "s_nssai")) { + ogs_yaml_iter_t s_nssai_iter; + ogs_yaml_iter_recurse(&nsi_iter, + &s_nssai_iter); + + while (ogs_yaml_iter_next( + &s_nssai_iter)) { + const char *s_nssai_key = + ogs_yaml_iter_key( + &s_nssai_iter); + ogs_assert(s_nssai_key); + + if (!strcmp(s_nssai_key, + "sst")) { + sst = + ogs_yaml_iter_value( + &s_nssai_iter); + } else if (!strcmp( + s_nssai_key, + "sd")) { + sd = + ogs_yaml_iter_value( + &s_nssai_iter); + } else + ogs_warn( + "unknown key `%s`", + s_nssai_key); + } + } else + ogs_warn("unknown key `%s`", + nsi_key); + } + + if (uri) { + bool rc; + + OpenAPI_uri_scheme_e scheme = + OpenAPI_uri_scheme_NULL; + + char *fqdn = NULL; + uint16_t fqdn_port = 0; + ogs_sockaddr_t *addr = NULL; + ogs_sockaddr_t *addr6 = NULL; + + ogs_sbi_header_t h; + uint16_t port = 0; + + nssf_nsi_t *nsi = NULL; + char *nrf_id = NULL; + + rc = ogs_sbi_getaddr_from_uri( + &scheme, &fqdn, &fqdn_port, + &addr, &addr6, + (char *)uri); + if (rc == false) { + if (!scheme) + ogs_error("Invalid Scheme " + "in URI[%s]", uri); + else + ogs_error("Invalid URI[%s]", + uri); + + return OGS_ERROR; + } + + if (fqdn) { + port = fqdn_port; + } else { + if (addr6) { + port = ogs_sbi_uri_port_from_scheme_and_addr( + scheme, addr6); + } else if (addr) { + port = ogs_sbi_uri_port_from_scheme_and_addr( + scheme, addr); + } + } + + memset(&h, 0, sizeof(h)); + h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_DISC; + h.api.version = + (char *)OGS_SBI_API_V1; + h.resource.component[0] = (char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES; + + nrf_id = ogs_uridup( + scheme, fqdn, + addr, addr6, port, &h); + ogs_assert(nrf_id); + + nsi = nssf_nsi_add( + nrf_id, + atoi(sst), + ogs_s_nssai_sd_from_string( + sd)); + ogs_assert(nsi); + + ogs_free(nrf_id); + + ogs_free(fqdn); + ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); + } + + } while (ogs_yaml_iter_type(&nsi_array) == + YAML_SEQUENCE_NODE); + } + } + } else + ogs_warn("unknown key `%s`", sbi_key); + } + } else if (!strcmp(nssf_key, "nrf")) { + /* handle config in sbi library */ + } else if (!strcmp(nssf_key, "scp")) { /* handle config in sbi library */ } else if (!strcmp(nssf_key, "service_name")) { /* handle config in sbi library */ } else if (!strcmp(nssf_key, "discovery")) { /* handle config in sbi library */ - } else if (!strcmp(nssf_key, "nsi")) { - ogs_list_t list, list6; - ogs_socknode_t *node = NULL, *node6 = NULL; - - ogs_yaml_iter_t nsi_array, nsi_iter; - ogs_yaml_iter_recurse(&nssf_iter, &nsi_array); - do { - int family = AF_UNSPEC; - int i, num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = ogs_sbi_server_default_port(); - const char *dev = NULL; - ogs_sockaddr_t *addr = NULL; - const char *sst = NULL, *sd = NULL; - - ogs_sockopt_t option; - bool is_option = false; - - if (ogs_yaml_iter_type(&nsi_array) == - YAML_MAPPING_NODE) { - memcpy(&nsi_iter, &nsi_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(&nsi_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&nsi_array)) - break; - ogs_yaml_iter_recurse(&nsi_array, &nsi_iter); - } else if (ogs_yaml_iter_type(&nsi_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); - - while (ogs_yaml_iter_next(&nsi_iter)) { - const char *nsi_key = - ogs_yaml_iter_key(&nsi_iter); - ogs_assert(nsi_key); - if (!strcmp(nsi_key, "family")) { - const char *v = ogs_yaml_iter_value(&nsi_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; - } - } else if (!strcmp(nsi_key, "addr") || - !strcmp(nsi_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse(&nsi_iter, - &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next( - &hostname_iter)) - break; - } - - ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME); - hostname[num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(nsi_key, "port")) { - const char *v = ogs_yaml_iter_value(&nsi_iter); - if (v) { - port = atoi(v); - } - } else if (!strcmp(nsi_key, "dev")) { - dev = ogs_yaml_iter_value(&nsi_iter); - } else if (!strcmp(nsi_key, "option")) { - rv = ogs_app_config_parse_sockopt( - &nsi_iter, &option); - if (rv != OGS_OK) return rv; - is_option = true; - } else if (!strcmp(nsi_key, "s_nssai")) { - ogs_yaml_iter_t s_nssai_iter; - ogs_yaml_iter_recurse(&nsi_iter, &s_nssai_iter); - - while (ogs_yaml_iter_next(&s_nssai_iter)) { - const char *s_nssai_key = - ogs_yaml_iter_key(&s_nssai_iter); - ogs_assert(s_nssai_key); - - if (!strcmp(s_nssai_key, "sst")) { - sst = ogs_yaml_iter_value( - &s_nssai_iter); - } else if (!strcmp(s_nssai_key, "sd")) { - sd = ogs_yaml_iter_value(&s_nssai_iter); - } else - ogs_warn("unknown key `%s`", - s_nssai_key); - } - } else - ogs_warn("unknown key `%s`", nsi_key); - } - - addr = NULL; - for (i = 0; i < num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } - - ogs_list_init(&list); - ogs_list_init(&list6); - - if (addr) { - if (ogs_app()->parameter.no_ipv4 == 0) - ogs_socknode_add( - &list, AF_INET, addr, - is_option ? &option : NULL); - if (ogs_app()->parameter.no_ipv6 == 0) - ogs_socknode_add( - &list6, AF_INET6, addr, - is_option ? &option : NULL); - ogs_freeaddrinfo(addr); - } - - if (dev) { - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? NULL : &list, - ogs_app()->parameter.no_ipv6 ? NULL : &list6, - dev, port, - is_option ? &option : NULL); - ogs_assert(rv == OGS_OK); - } - - node = ogs_list_first(&list); - if (node) { - ogs_assert(sst); - - nssf_nsi_t *nsi = nssf_nsi_add(node->addr, - atoi(sst), ogs_s_nssai_sd_from_string(sd)); - ogs_assert(nsi); - } - node6 = ogs_list_first(&list6); - if (node6) { - ogs_assert(sst); - - nssf_nsi_t *nsi = nssf_nsi_add(node6->addr, - atoi(sst), ogs_s_nssai_sd_from_string(sd)); - ogs_assert(nsi); - } - - ogs_socknode_remove_all(&list); - ogs_socknode_remove_all(&list6); - } while (ogs_yaml_iter_type(&nsi_array) == - YAML_SEQUENCE_NODE); } else ogs_warn("unknown key `%s`", nssf_key); } @@ -268,11 +274,11 @@ int nssf_context_parse_config(void) return OGS_OK; } -nssf_nsi_t *nssf_nsi_add(ogs_sockaddr_t *addr, uint8_t sst, ogs_uint24_t sd) +nssf_nsi_t *nssf_nsi_add(char *nrf_id, uint8_t sst, ogs_uint24_t sd) { nssf_nsi_t *nsi = NULL; - ogs_assert(addr); + ogs_assert(nrf_id); ogs_assert(sst); ogs_pool_alloc(&nssf_nsi_pool, &nsi); @@ -282,7 +288,8 @@ nssf_nsi_t *nssf_nsi_add(ogs_sockaddr_t *addr, uint8_t sst, ogs_uint24_t sd) nsi->nsi_id = ogs_msprintf("%d", (int)ogs_pool_index(&nssf_nsi_pool, nsi)); ogs_assert(nsi->nsi_id); - ogs_assert(OGS_OK == ogs_copyaddrinfo(&nsi->addr, addr)); + nsi->nrf_id = ogs_strdup(nrf_id); + ogs_assert(nsi->nrf_id); nsi->s_nssai.sst = sst; nsi->s_nssai.sd.v = sd.v; @@ -298,8 +305,8 @@ void nssf_nsi_remove(nssf_nsi_t *nsi) ogs_list_remove(&self.nsi_list, nsi); - ogs_assert(nsi->addr); - ogs_freeaddrinfo(nsi->addr); + ogs_assert(nsi->nrf_id); + ogs_free(nsi->nrf_id); ogs_assert(nsi->nsi_id); ogs_free(nsi->nsi_id); @@ -332,21 +339,6 @@ nssf_nsi_t *nssf_nsi_find_by_s_nssai(ogs_s_nssai_t *s_nssai) return NULL; } -char *nssf_nsi_nrf_uri(nssf_nsi_t *nsi) -{ - ogs_sbi_header_t h; - - ogs_assert(nsi); - - memset(&h, 0, sizeof(h)); - - h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_DISC; - h.api.version = (char *)OGS_SBI_API_V1; - h.resource.component[0] = (char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES; - - return ogs_uridup(ogs_app()->sbi.server.no_tls == false, nsi->addr, &h); -} - int get_nsi_load(void) { return (((ogs_pool_size(&nssf_nsi_pool) - diff --git a/src/nssf/context.h b/src/nssf/context.h index 45457cdbf..c2bf844ee 100644 --- a/src/nssf/context.h +++ b/src/nssf/context.h @@ -47,19 +47,17 @@ int nssf_context_parse_config(void); typedef struct nssf_nsi_s { ogs_lnode_t lnode; + char *nrf_id; char *nsi_id; - ogs_sockaddr_t *addr; - ogs_s_nssai_t s_nssai; } nssf_nsi_t; -nssf_nsi_t *nssf_nsi_add(ogs_sockaddr_t *addr, uint8_t sst, ogs_uint24_t sd); +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); -char *nssf_nsi_nrf_uri(nssf_nsi_t *nsi); int get_nsi_load(void); #ifdef __cplusplus diff --git a/src/nssf/init.c b/src/nssf/init.c index a44960cc2..08bed9247 100644 --- a/src/nssf/init.c +++ b/src/nssf/init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -27,10 +27,14 @@ int nssf_initialize(void) { int rv; +#define APP_NAME "nssf" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + ogs_sbi_context_init(OpenAPI_nf_type_NSSF); nssf_context_init(); - rv = ogs_sbi_context_parse_config("nssf", "nrf", "scp"); + rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp"); if (rv != OGS_OK) return rv; rv = nssf_context_parse_config(); diff --git a/src/nssf/nnssf-handler.c b/src/nssf/nnssf-handler.c index b18f44d74..8d4371fc6 100644 --- a/src/nssf/nnssf-handler.c +++ b/src/nssf/nnssf-handler.c @@ -65,7 +65,7 @@ bool nssf_nnrf_nsselection_handle_get( } memset(&NsiInformation, 0, sizeof(NsiInformation)); - NsiInformation.nrf_id = nssf_nsi_nrf_uri(nsi); + NsiInformation.nrf_id = nsi->nrf_id; NsiInformation.nsi_id = nsi->nsi_id; memset(&AuthorizedNetworkSliceInfo, 0, sizeof(AuthorizedNetworkSliceInfo)); @@ -78,9 +78,6 @@ bool nssf_nnrf_nsselection_handle_get( ogs_assert(response); ogs_assert(true == ogs_sbi_server_send_response(stream, response)); - if (NsiInformation.nrf_id) - ogs_free(NsiInformation.nrf_id); - return true; cleanup: diff --git a/src/nssf/sbi-path.c b/src/nssf/sbi-path.c index 6553d4e57..13bfd778c 100644 --- a/src/nssf/sbi-path.c +++ b/src/nssf/sbi-path.c @@ -31,8 +31,8 @@ int nssf_sbi_open(void) /* Build NF instance information. It will be transmitted to NRF. */ ogs_sbi_nf_instance_build_default(nf_instance); - 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_SCP); + ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_AMF); /* Build NF service information. It will be transmitted to NRF. */ if (ogs_sbi_nf_service_is_available( @@ -50,6 +50,9 @@ int nssf_sbi_open(void) if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); + /* Setup Subscription-Data */ + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_SEPP, NULL); + if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) return OGS_ERROR; diff --git a/src/pcf/am-sm.c b/src/pcf/am-sm.c index f9d3429d0..b8ba51e5a 100644 --- a/src/pcf/am-sm.c +++ b/src/pcf/am-sm.c @@ -65,7 +65,7 @@ void pcf_am_state_operational(ogs_fsm_t *s, pcf_event_t *e) SWITCH(message->h.method) CASE(OGS_SBI_HTTP_METHOD_POST) - handled = pcf_npcf_am_policy_contrtol_handle_create( + handled = pcf_npcf_am_policy_control_handle_create( pcf_ue, stream, message); if (!handled) { ogs_error("[%s] Cannot handle SBI message", pcf_ue->supi); diff --git a/src/pcf/context.c b/src/pcf/context.c index f87be9ba6..d6de447e5 100644 --- a/src/pcf/context.c +++ b/src/pcf/context.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -42,7 +42,7 @@ void pcf_context_init(void) ogs_log_install_domain(&__ogs_dbi_domain, "dbi", ogs_core()->log.level); ogs_log_install_domain(&__pcf_log_domain, "pcf", ogs_core()->log.level); - ogs_pool_init(&pcf_ue_pool, ogs_app()->max.ue); + ogs_pool_init(&pcf_ue_pool, ogs_global_conf()->max.ue); ogs_pool_init(&pcf_sess_pool, ogs_app()->pool.sess); ogs_pool_init(&pcf_app_pool, ogs_app()->pool.sess); @@ -93,6 +93,183 @@ static int pcf_context_validation(void) return OGS_OK; } +static int slice_conf_prepare(void) +{ + return OGS_OK; +} + +static int slice_conf_validation(void) +{ + return OGS_OK; +} + +static int parse_slice_conf( + ogs_yaml_iter_t *parent, ogs_app_policy_conf_t *policy_conf) +{ + int rv; + ogs_yaml_iter_t slice_array, slice_iter; + + ogs_assert(parent); + ogs_assert(policy_conf); + + rv = slice_conf_prepare(); + if (rv != OGS_OK) return rv; + + ogs_yaml_iter_recurse(parent, &slice_array); + do { + ogs_app_slice_conf_t *slice_conf = NULL; + ogs_s_nssai_t s_nssai; + bool default_indicator = false; + + s_nssai.sst = 0; + s_nssai.sd.v = OGS_S_NSSAI_NO_SD_VALUE; + + OGS_YAML_ARRAY_NEXT(&slice_array, &slice_iter); + while (ogs_yaml_iter_next(&slice_iter)) { + const char *slice_key = ogs_yaml_iter_key(&slice_iter); + ogs_assert(slice_key); + if (!strcmp(slice_key, OGS_SST_STRING)) { + const char *v = ogs_yaml_iter_value(&slice_iter); + if (v) { + s_nssai.sst = atoi(v); + if (s_nssai.sst == 1 || s_nssai.sst == 2 || + s_nssai.sst == 3 || s_nssai.sst == 4) { + } else { + ogs_error("Unknown SST [%d]", s_nssai.sst); + return OGS_ERROR; + } + } + } else if (!strcmp(slice_key, OGS_SD_STRING)) { + const char *v = ogs_yaml_iter_value(&slice_iter); + if (v) s_nssai.sd = ogs_s_nssai_sd_from_string(v); + } else if (!strcmp(slice_key, OGS_DEFAULT_INDICATOR_STRING)) { + default_indicator = ogs_yaml_iter_bool(&slice_iter); + } + } + + if (s_nssai.sst) { + slice_conf = ogs_app_slice_conf_add(policy_conf, &s_nssai); + if (!slice_conf) { + ogs_error("ogs_app_slice_conf_add() failed [SST:%d,SD:0x%x]", + s_nssai.sst, s_nssai.sd.v); + return OGS_ERROR; + } + slice_conf->data.default_indicator = default_indicator; + } else { + ogs_error("No SST"); + return OGS_ERROR; + } + + OGS_YAML_ARRAY_RECURSE(&slice_array, &slice_iter); + while (ogs_yaml_iter_next(&slice_iter)) { + const char *slice_key = ogs_yaml_iter_key(&slice_iter); + ogs_assert(slice_key); + if (!strcmp(slice_key, OGS_SESSION_STRING)) { + rv = ogs_app_parse_session_conf(&slice_iter, slice_conf); + if (rv != OGS_OK) { + ogs_error("parse_session_conf() failed"); + return rv; + } + } + } + + } while (ogs_yaml_iter_type(&slice_array) == YAML_SEQUENCE_NODE); + + rv = slice_conf_validation(); + if (rv != OGS_OK) return rv; + + return OGS_OK; +} + +static int policy_conf_prepare(void) +{ + return OGS_OK; +} + +static int policy_conf_validation(void) +{ + int rv; + + rv = ogs_app_check_policy_conf(); + if (rv != OGS_OK) { + ogs_error("ogs_app_check_policy_conf() failed"); + return OGS_ERROR; + } + + return OGS_OK; +} + +static int parse_policy_conf(ogs_yaml_iter_t *parent) +{ + int rv; + ogs_yaml_iter_t policy_array, policy_iter; + + ogs_assert(parent); + + rv = policy_conf_prepare(); + if (rv != OGS_OK) return rv; + + ogs_yaml_iter_recurse(parent, &policy_array); + do { + const char *mnc = NULL, *mcc = NULL; + ogs_app_policy_conf_t *policy_conf = NULL; + + OGS_YAML_ARRAY_NEXT(&policy_array, &policy_iter); + while (ogs_yaml_iter_next(&policy_iter)) { + const char *policy_key = ogs_yaml_iter_key(&policy_iter); + ogs_assert(policy_key); + if (!strcmp(policy_key, "plmn_id")) { + ogs_yaml_iter_t plmn_id_iter; + + ogs_yaml_iter_recurse(&policy_iter, &plmn_id_iter); + while (ogs_yaml_iter_next(&plmn_id_iter)) { + const char *id_key = ogs_yaml_iter_key(&plmn_id_iter); + ogs_assert(id_key); + if (!strcmp(id_key, "mcc")) { + mcc = ogs_yaml_iter_value(&plmn_id_iter); + } else if (!strcmp(id_key, "mnc")) { + mnc = ogs_yaml_iter_value(&plmn_id_iter); + } + } + + } + } + + if (mcc && mnc) { + ogs_plmn_id_t plmn_id; + ogs_plmn_id_build(&plmn_id, atoi(mcc), atoi(mnc), strlen(mnc)); + policy_conf = ogs_app_policy_conf_add(&plmn_id); + if (!policy_conf) { + ogs_error("ogs_app_policy_conf_add() failed " + "[MCC:%s,MNC:%s]", mcc, mnc); + return OGS_ERROR; + } + } else { + ogs_error("No PLMN-ID [MCC:%s, MNC:%s]", mcc, mnc); + return OGS_ERROR; + } + + OGS_YAML_ARRAY_RECURSE(&policy_array, &policy_iter); + while (ogs_yaml_iter_next(&policy_iter)) { + const char *policy_key = ogs_yaml_iter_key(&policy_iter); + ogs_assert(policy_key); + if (!strcmp(policy_key, OGS_SLICE_STRING)) { + rv = parse_slice_conf(&policy_iter, policy_conf); + if (rv != OGS_OK) { + ogs_error("parse_slice_conf() failed"); + return rv; + } + } + } + + } while (ogs_yaml_iter_type(&policy_array) == YAML_SEQUENCE_NODE); + + rv = policy_conf_validation(); + if (rv != OGS_OK) return rv; + + return OGS_OK; +} + int pcf_context_parse_config(void) { int rv; @@ -115,7 +292,13 @@ int pcf_context_parse_config(void) while (ogs_yaml_iter_next(&pcf_iter)) { const char *pcf_key = ogs_yaml_iter_key(&pcf_iter); ogs_assert(pcf_key); - if (!strcmp(pcf_key, "sbi")) { + if (!strcmp(pcf_key, "default")) { + /* handle config in sbi library */ + } else if (!strcmp(pcf_key, "sbi")) { + /* handle config in sbi library */ + } else if (!strcmp(pcf_key, "nrf")) { + /* handle config in sbi library */ + } else if (!strcmp(pcf_key, "scp")) { /* handle config in sbi library */ } else if (!strcmp(pcf_key, "service_name")) { /* handle config in sbi library */ @@ -123,6 +306,12 @@ int pcf_context_parse_config(void) /* handle config in sbi library */ } else if (!strcmp(pcf_key, "metrics")) { /* handle config in metrics library */ + } else if (!strcmp(pcf_key, OGS_POLICY_STRING)) { + rv = parse_policy_conf(&pcf_iter); + if (rv != OGS_OK) { + ogs_error("parse_policy_conf() failed"); + return rv; + } } else ogs_warn("unknown key `%s`", pcf_key); } @@ -311,6 +500,8 @@ void pcf_sess_remove(pcf_sess_t *sess) if (sess->dnn) ogs_free(sess->dnn); + if (sess->full_dnn) + ogs_free(sess->full_dnn); if (sess->notification_uri) ogs_free(sess->notification_uri); @@ -601,3 +792,46 @@ int pcf_instance_get_load(void) ogs_pool_avail(&pcf_ue_pool)) * 100) / ogs_pool_size(&pcf_ue_pool)); } + +int pcf_db_qos_data(char *supi, + ogs_plmn_id_t *plmn_id, ogs_s_nssai_t *s_nssai, char *dnn, + ogs_session_data_t *session_data) +{ + int rv; + ogs_session_data_t zero_data; + + ogs_app_policy_conf_t *policy_conf = NULL; + + ogs_assert(supi); + ogs_assert(s_nssai); + ogs_assert(dnn); + ogs_assert(session_data); + + memset(&zero_data, 0, sizeof(zero_data)); + + /* session_data should be initialized to zero */ + ogs_assert(memcmp(session_data, &zero_data, sizeof(zero_data)) == 0); + + if (plmn_id) + policy_conf = ogs_app_policy_conf_find_by_plmn_id(plmn_id); + else + ogs_warn("No PLMN_ID"); + + if (policy_conf) { + rv = ogs_app_config_session_data( + plmn_id, s_nssai, dnn, session_data); + if (rv != OGS_OK) + ogs_error("ogs_app_config_session_data() failed - " + "MCC[%d] MNC[%d] SST[%d] SD[0x%x] DNN[%s]", + ogs_plmn_id_mcc(plmn_id), ogs_plmn_id_mnc(plmn_id), + s_nssai->sst, s_nssai->sd.v, dnn); + } else { + rv = ogs_dbi_session_data(supi, s_nssai, dnn, session_data); + if (rv != OGS_OK) + ogs_error("ogs_dbi_session_data() failed - " + "SUPI[%s] SST[%d] SD[0x%x] DNN[%s]", + supi, s_nssai->sst, s_nssai->sd.v, dnn); + } + + return rv; +} diff --git a/src/pcf/context.h b/src/pcf/context.h index 0bcaba25a..87d446ec3 100644 --- a/src/pcf/context.h +++ b/src/pcf/context.h @@ -86,7 +86,16 @@ struct pcf_sess_s { uint8_t psi; /* PDU Session Identity */ uint8_t pdu_session_type; + + /* DNN */ char *dnn; + char *full_dnn; + + /* Serving PLMN ID & Home PLMN ID */ + struct { + bool presence; + ogs_plmn_id_t plmn_id; + } serving, home; char *notification_uri; struct { @@ -176,6 +185,10 @@ pcf_app_t *pcf_app_find(uint32_t index); pcf_app_t *pcf_app_find_by_app_session_id(char *app_session_id); int pcf_instance_get_load(void); +int pcf_db_qos_data(char *supi, + ogs_plmn_id_t *plmn_id, ogs_s_nssai_t *s_nssai, char *dnn, + ogs_session_data_t *session_data); + #ifdef __cplusplus } #endif diff --git a/src/pcf/init.c b/src/pcf/init.c index 144a9ada1..f0d47ea92 100644 --- a/src/pcf/init.c +++ b/src/pcf/init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -28,15 +28,19 @@ int pcf_initialize(void) { int rv; +#define APP_NAME "pcf" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + pcf_metrics_init(); ogs_sbi_context_init(OpenAPI_nf_type_PCF); pcf_context_init(); - rv = ogs_sbi_context_parse_config("pcf", "nrf", "scp"); + rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp"); if (rv != OGS_OK) return rv; - rv = ogs_metrics_context_parse_config("pcf"); + rv = ogs_metrics_context_parse_config(APP_NAME); if (rv != OGS_OK) return rv; rv = pcf_context_parse_config(); @@ -48,8 +52,10 @@ int pcf_initialize(void) ogs_metrics_context_open(ogs_metrics_self()); - rv = ogs_dbi_init(ogs_app()->db_uri); - if (rv != OGS_OK) return rv; + if (ogs_app()->db_uri) { + rv = ogs_dbi_init(ogs_app()->db_uri); + if (rv != OGS_OK) return rv; + } rv = pcf_sbi_open(); if (rv != OGS_OK) return rv; @@ -96,7 +102,9 @@ void pcf_terminate(void) ogs_metrics_context_close(ogs_metrics_self()); - ogs_dbi_final(); + if (ogs_app()->db_uri) { + ogs_dbi_final(); + } pcf_context_final(); ogs_sbi_context_final(); diff --git a/src/pcf/nbsf-handler.c b/src/pcf/nbsf-handler.c index 906941b30..56f6345eb 100644 --- a/src/pcf/nbsf-handler.c +++ b/src/pcf/nbsf-handler.c @@ -122,8 +122,10 @@ bool pcf_nbsf_management_handle_register( ogs_sbi_header_free(&header); - rv = ogs_dbi_session_data( - pcf_ue->supi, &sess->s_nssai, sess->dnn, &session_data); + rv = pcf_db_qos_data( + pcf_ue->supi, + sess->home.presence == true ? &sess->home.plmn_id : NULL, + &sess->s_nssai, sess->dnn, &session_data); if (rv != OGS_OK) { strerror = ogs_msprintf("[%s:%d] Cannot find SUPI in DB", pcf_ue->supi, sess->psi); @@ -277,6 +279,7 @@ bool pcf_nbsf_management_handle_register( ogs_pcc_rule_t *pcc_rule = &session_data.pcc_rule[i]; ogs_assert(pcc_rule); + ogs_assert(pcc_rule->id); if (!pcc_rule->num_of_flow) { /* No Flow */ @@ -387,7 +390,7 @@ bool pcf_nbsf_management_handle_register( pcf_metrics_inst_by_slice_add(&sess->pcf_ue->guami.plmn_id, &sess->s_nssai, PCF_METR_CTR_PA_POLICYSMASSOSUCC, 1); - ogs_session_data_free(&session_data); + OGS_SESSION_DATA_FREE(&session_data); return true; @@ -399,7 +402,7 @@ cleanup: ogs_sbi_server_send_error(stream, status, recvmsg, strerror, NULL)); ogs_free(strerror); - ogs_session_data_free(&session_data); + OGS_SESSION_DATA_FREE(&session_data); return false; } diff --git a/src/pcf/nnrf-handler.c b/src/pcf/nnrf-handler.c index 3ed02f20a..35fb52be3 100644 --- a/src/pcf/nnrf-handler.c +++ b/src/pcf/nnrf-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * diff --git a/src/pcf/npcf-handler.c b/src/pcf/npcf-handler.c index 581a5531a..e5d5ad751 100644 --- a/src/pcf/npcf-handler.c +++ b/src/pcf/npcf-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019,2020 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -21,7 +21,7 @@ #include "npcf-handler.h" -bool pcf_npcf_am_policy_contrtol_handle_create(pcf_ue_t *pcf_ue, +bool pcf_npcf_am_policy_control_handle_create(pcf_ue_t *pcf_ue, ogs_sbi_stream_t *stream, ogs_sbi_message_t *message) { bool rc; @@ -33,12 +33,17 @@ bool pcf_npcf_am_policy_contrtol_handle_create(pcf_ue_t *pcf_ue, uint64_t supported_features = 0; + ogs_sbi_server_t *server = NULL; ogs_sbi_client_t *client = NULL; OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; - ogs_sockaddr_t *addr = NULL; + char *fqdn = NULL; + uint16_t fqdn_port = 0; + ogs_sockaddr_t *addr = NULL, *addr6 = NULL; ogs_assert(pcf_ue); ogs_assert(stream); + server = ogs_sbi_server_from_stream(stream); + ogs_assert(server); ogs_assert(message); PolicyAssociationRequest = message->PolicyAssociationRequest; @@ -74,7 +79,7 @@ bool pcf_npcf_am_policy_contrtol_handle_create(pcf_ue_t *pcf_ue, return false; } - rc = ogs_sbi_getaddr_from_uri(&scheme, &addr, + rc = ogs_sbi_getaddr_from_uri(&scheme, &fqdn, &fqdn_port, &addr, &addr6, PolicyAssociationRequest->notification_uri); if (rc == false || scheme == OpenAPI_uri_scheme_NULL) { ogs_error("[%s] Invalid URI [%s]", @@ -91,20 +96,25 @@ bool pcf_npcf_am_policy_contrtol_handle_create(pcf_ue_t *pcf_ue, PolicyAssociationRequest->notification_uri); ogs_assert(pcf_ue->notification_uri); - client = ogs_sbi_client_find(scheme, addr); + client = ogs_sbi_client_find(scheme, fqdn, fqdn_port, addr, addr6); if (!client) { ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); - client = ogs_sbi_client_add(scheme, addr); + client = ogs_sbi_client_add(scheme, fqdn, fqdn_port, addr, addr6); if (!client) { - char buf[OGS_ADDRSTRLEN]; - ogs_error("%s: ogs_sbi_client_add() failed [%s]:%d", - OGS_FUNC, OGS_ADDR(addr, buf), OGS_PORT(addr)); + ogs_error("%s: ogs_sbi_client_add() failed", OGS_FUNC); + + ogs_free(fqdn); ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); + return false; } } OGS_SBI_SETUP_CLIENT(&pcf_ue->namf, client); + + ogs_free(fqdn); ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); supported_features = ogs_uint64_from_string(PolicyAssociationRequest->supp_feat); @@ -156,12 +166,50 @@ bool pcf_npcf_am_policy_contrtol_handle_create(pcf_ue_t *pcf_ue, pcf_ue->subscribed_ue_ambr = OpenAPI_ambr_copy( pcf_ue->subscribed_ue_ambr, PolicyAssociationRequest->ue_ambr); - r = pcf_ue_sbi_discover_and_send(OGS_SBI_SERVICE_TYPE_NUDR_DR, NULL, - pcf_nudr_dr_build_query_am_data, pcf_ue, stream, NULL); - ogs_expect(r == OGS_OK); - ogs_assert(r != OGS_ERROR); + if (ogs_sbi_supi_in_vplmn(pcf_ue->supi) == true) { + /* Visited PLMN */ + OpenAPI_policy_association_t PolicyAssociation; - return (r == OGS_OK); + ogs_sbi_message_t sendmsg; + ogs_sbi_header_t header; + ogs_sbi_response_t *response = NULL; + + memset(&PolicyAssociation, 0, sizeof(PolicyAssociation)); + PolicyAssociation.request = pcf_ue->policy_association_request; + PolicyAssociation.supp_feat = + ogs_uint64_to_string(pcf_ue->am_policy_control_features); + ogs_assert(PolicyAssociation.supp_feat); + + memset(&header, 0, sizeof(header)); + header.service.name = + (char *)OGS_SBI_SERVICE_NAME_NPCF_AM_POLICY_CONTROL; + header.api.version = (char *)OGS_SBI_API_V1; + header.resource.component[0] = (char *)OGS_SBI_RESOURCE_NAME_POLICIES; + header.resource.component[1] = pcf_ue->association_id; + + memset(&sendmsg, 0, sizeof(sendmsg)); + sendmsg.PolicyAssociation = &PolicyAssociation; + sendmsg.http.location = ogs_sbi_server_uri(server, &header); + + response = ogs_sbi_build_response( + &sendmsg, OGS_SBI_HTTP_STATUS_CREATED); + ogs_assert(response); + ogs_assert(true == ogs_sbi_server_send_response(stream, response)); + + ogs_free(sendmsg.http.location); + + ogs_free(PolicyAssociation.supp_feat); + + return true; + } else { + /* Home PLMN */ + r = pcf_ue_sbi_discover_and_send(OGS_SBI_SERVICE_TYPE_NUDR_DR, NULL, + pcf_nudr_dr_build_query_am_data, pcf_ue, stream, NULL); + ogs_expect(r == OGS_OK); + ogs_assert(r != OGS_ERROR); + + return (r == OGS_OK); + } } bool pcf_npcf_smpolicycontrol_handle_create(pcf_sess_t *sess, @@ -174,11 +222,16 @@ bool pcf_npcf_smpolicycontrol_handle_create(pcf_sess_t *sess, pcf_ue_t *pcf_ue = NULL; OpenAPI_sm_policy_context_data_t *SmPolicyContextData = NULL; + OpenAPI_plmn_id_nid_t *servingNetwork = NULL; OpenAPI_snssai_t *sliceInfo = NULL; ogs_sbi_client_t *client = NULL; OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; - ogs_sockaddr_t *addr = NULL; + char *fqdn = NULL; + uint16_t fqdn_port = 0; + ogs_sockaddr_t *addr = NULL, *addr6 = NULL; + + char *home_network_domain = NULL; ogs_assert(sess); pcf_ue = sess->pcf_ue; @@ -252,7 +305,25 @@ bool pcf_npcf_smpolicycontrol_handle_create(pcf_sess_t *sess, goto cleanup; } - rc = ogs_sbi_getaddr_from_uri(&scheme, &addr, + servingNetwork = SmPolicyContextData->serving_network; + if (servingNetwork) { + if (!servingNetwork->mcc) { + strerror = ogs_msprintf("[%s:%d] No servingNetwork->mcc", + pcf_ue->supi, sess->psi); + status = OGS_SBI_HTTP_STATUS_BAD_REQUEST; + goto cleanup; + } + if (!servingNetwork->mnc) { + strerror = ogs_msprintf("[%s:%d] No servingNetwork->mnc", + pcf_ue->supi, sess->psi); + status = OGS_SBI_HTTP_STATUS_BAD_REQUEST; + goto cleanup; + } + } else { + ogs_warn("No servingNetwork"); + } + + rc = ogs_sbi_getaddr_from_uri(&scheme, &fqdn, &fqdn_port, &addr, &addr6, SmPolicyContextData->notification_uri); if (rc == false || scheme == OpenAPI_uri_scheme_NULL) { strerror = ogs_msprintf("[%s:%d] Invalid URI [%s]", @@ -271,31 +342,112 @@ bool pcf_npcf_smpolicycontrol_handle_create(pcf_sess_t *sess, sess->pdu_session_type = SmPolicyContextData->pdu_session_type; - if (sess->dnn) - ogs_free(sess->dnn); - sess->dnn = ogs_strdup(SmPolicyContextData->dnn); - ogs_assert(sess->dnn); + /* Serving PLMN & Home PLMN */ + if (servingNetwork) { + sess->serving.presence = true; + ogs_sbi_parse_plmn_id_nid(&sess->serving.plmn_id, servingNetwork); + + sess->home.presence = true; + memcpy(&sess->home.plmn_id, &sess->serving.plmn_id, OGS_PLMN_ID_LEN); + } + + /* + * TS29.512 + * 5 Npcf_SMPolicyControl Service API + * 5.6 Data Model + * 5.6.2 Structured data types + * Table 5.6.2.3-1: Definition of type SmPolicyContextData + * + * NAME: dnn + * Data type: Dnn + * P: M + * Cardinality: 1 + * The DNN of the PDU session, a full DNN with both the Network Identifier + * and Operator Identifier, or a DNN with the Network Identifier only + */ + home_network_domain = ogs_home_network_domain_from_fqdn( + SmPolicyContextData->dnn); + + if (home_network_domain) { + char dnn_network_identifer[OGS_MAX_DNN_LEN+1]; + uint16_t mcc = 0, mnc = 0; + + ogs_assert(home_network_domain > SmPolicyContextData->dnn); + + ogs_cpystrn(dnn_network_identifer, SmPolicyContextData->dnn, + ogs_min(OGS_MAX_DNN_LEN, + home_network_domain - SmPolicyContextData->dnn)); + + if (sess->dnn) + ogs_free(sess->dnn); + sess->dnn = ogs_strdup(dnn_network_identifer); + ogs_assert(sess->dnn); + + if (sess->full_dnn) + ogs_free(sess->full_dnn); + sess->full_dnn = ogs_strdup(SmPolicyContextData->dnn); + ogs_assert(sess->full_dnn); + + mcc = ogs_plmn_id_mcc_from_fqdn(sess->full_dnn); + mnc = ogs_plmn_id_mnc_from_fqdn(sess->full_dnn); + + /* + * To generate the Home PLMN ID of the SMF-UE, + * the length of the MNC is obtained + * by comparing the MNC part of the SUPI and full-DNN. + */ + if (mcc && mnc && + strncmp(pcf_ue->supi, "imsi-", strlen("imsi-")) == 0) { + int mnc_len = 0; + char buf[OGS_PLMNIDSTRLEN]; + + ogs_snprintf(buf, OGS_PLMNIDSTRLEN, "%03d%02d", mcc, mnc); + if (strncmp(pcf_ue->supi + 5, buf, strlen(buf)) == 0) + mnc_len = 2; + + ogs_snprintf(buf, OGS_PLMNIDSTRLEN, "%03d%03d", mcc, mnc); + if (strncmp(pcf_ue->supi + 5, buf, strlen(buf)) == 0) + mnc_len = 3; + + /* Change Home PLMN for VPLMN */ + if (mnc_len == 2 || mnc_len == 3) { + if (sess->home.presence == true) + ogs_plmn_id_build(&sess->home.plmn_id, mcc, mnc, mnc_len); + } + } + } else { + if (sess->dnn) + ogs_free(sess->dnn); + sess->dnn = ogs_strdup(SmPolicyContextData->dnn); + ogs_assert(sess->dnn); + + if (sess->full_dnn) + ogs_free(sess->full_dnn); + sess->full_dnn = NULL; + } if (sess->notification_uri) ogs_free(sess->notification_uri); sess->notification_uri = ogs_strdup(SmPolicyContextData->notification_uri); ogs_assert(sess->notification_uri); - client = ogs_sbi_client_find(scheme, addr); + client = ogs_sbi_client_find(scheme, fqdn, fqdn_port, addr, addr6); if (!client) { ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); - client = ogs_sbi_client_add(scheme, addr); + client = ogs_sbi_client_add(scheme, fqdn, fqdn_port, addr, addr6); if (!client) { - char buf[OGS_ADDRSTRLEN]; - strerror = ogs_msprintf("%s: ogs_sbi_client_add() failed [%s]:%d", - OGS_FUNC, OGS_ADDR(addr, buf), OGS_PORT(addr)); + strerror = ogs_msprintf("%s: ogs_sbi_client_add() failed", + OGS_FUNC); status = OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR; ogs_freeaddrinfo(addr); goto cleanup; } } OGS_SBI_SETUP_CLIENT(&sess->nsmf, client); + + ogs_free(fqdn); ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); if (SmPolicyContextData->ipv4_address) ogs_assert(true == @@ -345,13 +497,50 @@ bool pcf_npcf_smpolicycontrol_handle_create(pcf_sess_t *sess, sess->subscribed_default_qos = OpenAPI_subscribed_default_qos_copy( sess->subscribed_default_qos, SmPolicyContextData->subs_def_qos); - r = pcf_sess_sbi_discover_and_send( - OGS_SBI_SERVICE_TYPE_NUDR_DR, NULL, - pcf_nudr_dr_build_query_sm_data, sess, stream, NULL); - ogs_expect(r == OGS_OK); - ogs_assert(r != OGS_ERROR); + if (ogs_sbi_supi_in_vplmn(pcf_ue->supi) == true) { + /* Visited PLMN */ + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL; - return (r == OGS_OK); + service_type = OGS_SBI_SERVICE_TYPE_NPCF_POLICYAUTHORIZATION; + + nf_instance = sess->sbi.service_type_array[service_type].nf_instance; + if (!nf_instance) { + OpenAPI_nf_type_e requester_nf_type = + NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance); + ogs_assert(requester_nf_type); + nf_instance = ogs_sbi_nf_instance_find_by_service_type( + service_type, requester_nf_type); + if (nf_instance) + OGS_SBI_SETUP_NF_INSTANCE( + sess->sbi.service_type_array[service_type], + nf_instance); + } + + if (nf_instance) { + r = pcf_sess_sbi_discover_and_send( + OGS_SBI_SERVICE_TYPE_NBSF_MANAGEMENT, NULL, + pcf_nbsf_management_build_register, + sess, stream, nf_instance); + ogs_expect(r == OGS_OK); + ogs_assert(r != OGS_ERROR); + } else { + r = pcf_sess_sbi_discover_only(sess, stream, service_type); + ogs_expect(r == OGS_OK); + ogs_assert(r != OGS_ERROR); + } + + return (r == OGS_OK); + } else { + /* Home PLMN */ + r = pcf_sess_sbi_discover_and_send( + OGS_SBI_SERVICE_TYPE_NUDR_DR, NULL, + pcf_nudr_dr_build_query_sm_data, sess, stream, NULL); + ogs_expect(r == OGS_OK); + ogs_assert(r != OGS_ERROR); + + return (r == OGS_OK); + } cleanup: ogs_assert(status); @@ -433,7 +622,9 @@ bool pcf_npcf_policyauthorization_handle_create(pcf_sess_t *sess, ogs_sbi_client_t *client = NULL; OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; - ogs_sockaddr_t *addr = NULL; + char *fqdn = NULL; + uint16_t fqdn_port = 0; + ogs_sockaddr_t *addr = NULL, *addr6 = NULL; OpenAPI_app_session_context_t *AppSessionContext = NULL; OpenAPI_app_session_context_req_data_t *AscReqData = NULL; @@ -521,7 +712,8 @@ bool pcf_npcf_policyauthorization_handle_create(pcf_sess_t *sess, goto cleanup; } - rc = ogs_sbi_getaddr_from_uri(&scheme, &addr, AscReqData->notif_uri); + rc = ogs_sbi_getaddr_from_uri(&scheme, &fqdn, &fqdn_port, &addr, &addr6, + AscReqData->notif_uri); if (rc == false || scheme == OpenAPI_uri_scheme_NULL) { strerror = ogs_msprintf("[%s:%d] Invalid URI [%s]", pcf_ue->supi, sess->psi, AscReqData->notif_uri); @@ -612,24 +804,28 @@ bool pcf_npcf_policyauthorization_handle_create(pcf_sess_t *sess, app_session->notif_uri = ogs_strdup(AscReqData->notif_uri); ogs_assert(app_session->notif_uri); - client = ogs_sbi_client_find(scheme, addr); + client = ogs_sbi_client_find(scheme, fqdn, fqdn_port, addr, addr6); if (!client) { ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); - client = ogs_sbi_client_add(scheme, addr); + client = ogs_sbi_client_add(scheme, fqdn, fqdn_port, addr, addr6); if (!client) { - char buf[OGS_ADDRSTRLEN]; - strerror = ogs_msprintf("%s: ogs_sbi_client_add() failed [%s]:%d", - OGS_FUNC, OGS_ADDR(addr, buf), OGS_PORT(addr)); + strerror = ogs_msprintf("%s: ogs_sbi_client_add() failed", + OGS_FUNC); status = OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR; ogs_freeaddrinfo(addr); goto cleanup; } } OGS_SBI_SETUP_CLIENT(&app_session->naf, client); - ogs_freeaddrinfo(addr); - rv = ogs_dbi_session_data( - pcf_ue->supi, &sess->s_nssai, sess->dnn, &session_data); + ogs_free(fqdn); + ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); + + rv = pcf_db_qos_data( + pcf_ue->supi, + sess->home.presence == true ? &sess->home.plmn_id : NULL, + &sess->s_nssai, sess->dnn, &session_data); if (rv != OGS_OK) { strerror = ogs_msprintf("[%s:%d] Cannot find SUPI in DB", pcf_ue->supi, sess->psi); @@ -866,7 +1062,7 @@ bool pcf_npcf_policyauthorization_handle_create(pcf_sess_t *sess, OpenAPI_list_free(QosDecisionList); ogs_ims_data_free(&ims_data); - ogs_session_data_free(&session_data); + OGS_SESSION_DATA_FREE(&session_data); return true; @@ -901,7 +1097,7 @@ cleanup: OpenAPI_list_free(QosDecisionList); ogs_ims_data_free(&ims_data); - ogs_session_data_free(&session_data); + OGS_SESSION_DATA_FREE(&session_data); return false; } @@ -1048,8 +1244,10 @@ bool pcf_npcf_policyauthorization_handle_update( } } - rv = ogs_dbi_session_data( - pcf_ue->supi, &sess->s_nssai, sess->dnn, &session_data); + rv = pcf_db_qos_data( + pcf_ue->supi, + sess->home.presence == true ? &sess->home.plmn_id : NULL, + &sess->s_nssai, sess->dnn, &session_data); if (rv != OGS_OK) { strerror = ogs_msprintf("[%s:%d] Cannot find SUPI in DB", pcf_ue->supi, sess->psi); @@ -1276,7 +1474,7 @@ bool pcf_npcf_policyauthorization_handle_update( OpenAPI_list_free(QosDecisionList); ogs_ims_data_free(&ims_data); - ogs_session_data_free(&session_data); + OGS_SESSION_DATA_FREE(&session_data); return true; @@ -1311,7 +1509,7 @@ cleanup: OpenAPI_list_free(QosDecisionList); ogs_ims_data_free(&ims_data); - ogs_session_data_free(&session_data); + OGS_SESSION_DATA_FREE(&session_data); return false; } diff --git a/src/pcf/npcf-handler.h b/src/pcf/npcf-handler.h index de750ea67..b0f1ddc5f 100644 --- a/src/pcf/npcf-handler.h +++ b/src/pcf/npcf-handler.h @@ -26,7 +26,7 @@ extern "C" { #endif -bool pcf_npcf_am_policy_contrtol_handle_create(pcf_ue_t *pcf_ue, +bool pcf_npcf_am_policy_control_handle_create(pcf_ue_t *pcf_ue, ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg); bool pcf_npcf_smpolicycontrol_handle_create(pcf_sess_t *sess, diff --git a/src/pcf/nsmf-build.c b/src/pcf/nsmf-build.c index 53738937c..3b5592fcb 100644 --- a/src/pcf/nsmf-build.c +++ b/src/pcf/nsmf-build.c @@ -37,7 +37,7 @@ ogs_sbi_request_t *pcf_nsmf_callback_build_smpolicycontrol_update( memset(&SmPolicyNotification, 0, sizeof(SmPolicyNotification)); memset(&message, 0, sizeof(message)); - server = ogs_list_first(&ogs_sbi_self()->server_list); + server = ogs_sbi_server_first(); if (!server) { ogs_error("No server"); goto end; diff --git a/src/pcf/nudr-handler.c b/src/pcf/nudr-handler.c index f36333df6..eb0ebfb0b 100644 --- a/src/pcf/nudr-handler.c +++ b/src/pcf/nudr-handler.c @@ -73,7 +73,7 @@ bool pcf_nudr_dr_handle_query_am_data( if (!subscription_data.ambr.uplink && !subscription_data.ambr.downlink) { - ogs_error("[%s] No UE-AMBR", pcf_ue->supi); + strerror = ogs_msprintf("[%s] No UE-AMBR", pcf_ue->supi); status = OGS_SBI_HTTP_STATUS_NOT_FOUND; goto cleanup; } diff --git a/src/pcf/sbi-path.c b/src/pcf/sbi-path.c index 0c30651b6..46d75d138 100644 --- a/src/pcf/sbi-path.c +++ b/src/pcf/sbi-path.c @@ -34,9 +34,9 @@ int pcf_sbi_open(void) /* Build NF instance information. It will be transmitted to NRF. */ 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); - ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_SCP); /* Build NF service information. It will be transmitted to NRF. */ if (ogs_sbi_nf_service_is_available( @@ -97,6 +97,7 @@ int pcf_sbi_open(void) ogs_sbi_nf_fsm_init(nf_instance); /* Setup Subscription-Data */ + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_SEPP, NULL); ogs_sbi_subscription_spec_add( OpenAPI_nf_type_NULL, OGS_SBI_SERVICE_NAME_NBSF_MANAGEMENT); ogs_sbi_subscription_spec_add( @@ -341,7 +342,10 @@ bool pcf_sbi_send_smpolicycontrol_delete_notify( rc = ogs_sbi_send_request_to_client( client, client_delete_notify_cb, request, app_session); - ogs_expect(rc == true); + if (rc == false) { + ogs_error("ogs_sbi_send_request_to_client() failed"); + pcf_app_remove(app_session); + } ogs_sbi_request_free(request); diff --git a/src/pcrf/pcrf-context.c b/src/pcrf/pcrf-context.c index ca85d71cb..bb0edeafd 100644 --- a/src/pcrf/pcrf-context.c +++ b/src/pcrf/pcrf-context.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -90,6 +90,76 @@ static int pcrf_context_validation(void) return OGS_OK; } +static int session_conf_prepare(void) +{ + ogs_app_policy_conf_t *policy_conf = NULL; + ogs_app_slice_conf_t *slice_conf = NULL; + + ogs_plmn_id_t plmn_id; + ogs_s_nssai_t s_nssai; + + ogs_plmn_id_build(&plmn_id, 999, 70, 2); + + s_nssai.sst = 1; + s_nssai.sd.v = OGS_S_NSSAI_NO_SD_VALUE; + + /* Added Dummy POLICY for EPC */ + policy_conf = ogs_app_policy_conf_add(&plmn_id); + if (!policy_conf) { + ogs_error("ogs_app_policy_conf_add() failed"); + return OGS_ERROR; + } + + /* Added Dummy SLICE for EPC */ + slice_conf = ogs_app_slice_conf_add(policy_conf, &s_nssai); + if (!slice_conf) { + ogs_error("ogs_app_slice_conf_add() failed"); + return OGS_ERROR; + } + slice_conf->data.default_indicator = true; + + return OGS_OK; +} + +static int session_conf_validation(void) +{ + int rv; + + rv = ogs_app_check_policy_conf(); + if (rv != OGS_OK) { + ogs_error("ogs_app_check_policy_conf() failed"); + return OGS_ERROR; + } + + return OGS_OK; +} + +static int parse_session_conf(ogs_yaml_iter_t *parent) +{ + int rv; + ogs_app_policy_conf_t *policy_conf = NULL; + ogs_app_slice_conf_t *slice_conf = NULL; + + ogs_assert(parent); + + rv = session_conf_prepare(); + if (rv != OGS_OK) return rv; + + policy_conf = ogs_list_first(&ogs_local_conf()->policy_list); + ogs_assert(policy_conf); + + slice_conf = ogs_list_first(&policy_conf->slice_list); + ogs_assert(slice_conf); + + rv = ogs_app_parse_session_conf(parent, slice_conf); + if (rv != OGS_OK) return rv; + + rv = session_conf_validation(); + if (rv != OGS_OK) return rv; + + return OGS_OK; +} + int pcrf_context_parse_config(void) { int rv; @@ -224,7 +294,8 @@ int pcrf_context_parse_config(void) if (!strcmp(conn_key, "identity")) { identity = ogs_yaml_iter_value( &conn_iter); - } else if (!strcmp(conn_key, "addr")) { + } else if (!strcmp(conn_key, + "address")) { addr = ogs_yaml_iter_value( &conn_iter); } else if (!strcmp(conn_key, "port")) { @@ -254,6 +325,12 @@ int pcrf_context_parse_config(void) ogs_warn("unknown key `%s`", fd_key); } } + } else if (!strcmp(pcrf_key, OGS_SESSION_STRING)) { + rv = parse_session_conf(&pcrf_iter); + if (rv != OGS_OK) { + ogs_error("parse_session_conf() failed"); + return rv; + } } else ogs_warn("unknown key `%s`", pcrf_key); } @@ -271,17 +348,39 @@ int pcrf_db_qos_data( { int rv, i; char *supi = NULL; + ogs_session_data_t zero_data; + + ogs_app_policy_conf_t *policy_conf = NULL; + ogs_app_slice_conf_t *slice_conf = NULL; ogs_assert(imsi_bcd); ogs_assert(apn); ogs_assert(session_data); ogs_thread_mutex_lock(&self.db_lock); + + memset(&zero_data, 0, sizeof(zero_data)); + + /* session_data should be initialized to zero */ + ogs_assert(memcmp(session_data, &zero_data, sizeof(zero_data)) == 0); + supi = ogs_msprintf("%s-%s", OGS_ID_SUPI_TYPE_IMSI, imsi_bcd); ogs_assert(supi); - /* For EPC, we'll use [S_NSSAI = NULL] */ - rv = ogs_dbi_session_data(supi, NULL, apn, session_data); + policy_conf = ogs_list_first(&ogs_local_conf()->policy_list); + if (policy_conf) + slice_conf = ogs_list_first(&policy_conf->slice_list); + + if (slice_conf) { + rv = ogs_app_config_session_data(NULL, NULL, apn, session_data); + if (rv != OGS_OK) + ogs_error("ogs_app_config_session_data() failed for APN(%s)", apn); + } else { + rv = ogs_dbi_session_data(supi, NULL, apn, session_data); + if (rv != OGS_OK) + ogs_error("ogs_dbi_session_data() failed for IMSI(%s)+APN(%s)", + imsi_bcd, apn); + } /* For EPC, we need to inialize Flow-Status in Pcc-Rule */ for (i = 0; i < session_data->num_of_pcc_rule; i++) { diff --git a/src/pcrf/pcrf-gx-path.c b/src/pcrf/pcrf-gx-path.c index edfdc2e08..22360d924 100644 --- a/src/pcrf/pcrf-gx-path.c +++ b/src/pcrf/pcrf-gx-path.c @@ -622,7 +622,7 @@ static int pcrf_gx_ccr_cb( struct msg **msg, struct avp *avp, ogs_diam_logger_self()->stats.nb_echoed++; ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) ==0); - ogs_session_data_free(&gx_message.session_data); + OGS_SESSION_DATA_FREE(&gx_message.session_data); return 0; @@ -659,7 +659,7 @@ out: ret = fd_msg_send(msg, NULL, NULL); ogs_assert(ret == 0); - ogs_session_data_free(&gx_message.session_data); + OGS_SESSION_DATA_FREE(&gx_message.session_data); return 0; } @@ -1017,7 +1017,7 @@ int pcrf_gx_send_rar( /* Set no error */ rx_message->result_code = ER_DIAMETER_SUCCESS; - ogs_session_data_free(&gx_message.session_data); + OGS_SESSION_DATA_FREE(&gx_message.session_data); return OGS_OK; @@ -1026,7 +1026,7 @@ out: ret = fd_sess_state_store(pcrf_gx_reg, session, &sess_data); ogs_assert(sess_data == NULL); - ogs_session_data_free(&gx_message.session_data); + OGS_SESSION_DATA_FREE(&gx_message.session_data); return OGS_ERROR; } diff --git a/src/pcrf/pcrf-init.c b/src/pcrf/pcrf-init.c index 5cd669e7d..3255568d4 100644 --- a/src/pcrf/pcrf-init.c +++ b/src/pcrf/pcrf-init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -26,6 +26,10 @@ int pcrf_initialize(void) { int rv; +#define APP_NAME "pcrf" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + pcrf_context_init(); rv = pcrf_context_parse_config(); @@ -35,8 +39,10 @@ int pcrf_initialize(void) ogs_app()->logger.domain, ogs_app()->logger.level); if (rv != OGS_OK) return rv; - rv = ogs_dbi_init(ogs_app()->db_uri); - if (rv != OGS_OK) return rv; + if (ogs_app()->db_uri) { + rv = ogs_dbi_init(ogs_app()->db_uri); + if (rv != OGS_OK) return rv; + } rv = pcrf_fd_init(); if (rv != OGS_OK) return OGS_ERROR; @@ -52,7 +58,10 @@ void pcrf_terminate(void) pcrf_fd_final(); - ogs_dbi_final(); + if (ogs_app()->db_uri) { + ogs_dbi_final(); + } + pcrf_context_final(); return; diff --git a/src/scp/context.c b/src/scp/context.c index e1082ad69..1014f0223 100644 --- a/src/scp/context.c +++ b/src/scp/context.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -39,7 +39,7 @@ void scp_context_init(void) ogs_log_install_domain(&__scp_log_domain, "scp", ogs_core()->log.level); #define MAX_NUM_OF_SCP_ASSOC 8 - max_num_of_scp_assoc = ogs_app()->max.ue * MAX_NUM_OF_SCP_ASSOC; + max_num_of_scp_assoc = ogs_global_conf()->max.ue * MAX_NUM_OF_SCP_ASSOC; ogs_pool_init(&scp_assoc_pool, max_num_of_scp_assoc); @@ -64,6 +64,48 @@ scp_context_t *scp_self(void) static int scp_context_prepare(void) { + ogs_sbi_server_t *server = NULL; + + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_nf_info_t *nf_info = NULL; + ogs_sbi_scp_info_t *scp_info = NULL; + + /********************************************************************* + * SCP Port Configuration + *********************************************************************/ + nf_instance = ogs_sbi_self()->nf_instance; + ogs_assert(nf_instance); + + nf_info = ogs_sbi_nf_info_add( + &nf_instance->nf_info_list, OpenAPI_nf_type_SCP); + if (!nf_info) { + ogs_error("ogs_sbi_nf_info_add() failed"); + return OGS_ERROR; + } + + scp_info = &nf_info->scp; + + for (server = ogs_sbi_server_first(); + server; server = ogs_sbi_server_next(server)) { + ogs_sockaddr_t *advertise = NULL; + + advertise = server->advertise; + if (!advertise) + advertise = server->node.addr; + ogs_assert(advertise); + + if (server->scheme == OpenAPI_uri_scheme_https) { + scp_info->https.presence = true; + scp_info->https.port = OGS_PORT(advertise); + } else if (server->scheme == OpenAPI_uri_scheme_http) { + scp_info->http.presence = true; + scp_info->http.port = OGS_PORT(advertise); + } else { + ogs_error("Unknown scheme[%d]", server->scheme); + ogs_assert_if_reached(); + } + } + return OGS_OK; } @@ -94,7 +136,13 @@ int scp_context_parse_config(void) while (ogs_yaml_iter_next(&scp_iter)) { const char *scp_key = ogs_yaml_iter_key(&scp_iter); ogs_assert(scp_key); - if (!strcmp(scp_key, "sbi")) { + if (!strcmp(scp_key, "default")) { + /* handle config in sbi library */ + } else if (!strcmp(scp_key, "sbi")) { + /* handle config in sbi library */ + } else if (!strcmp(scp_key, "nrf")) { + /* handle config in sbi library */ + } else if (!strcmp(scp_key, "scp")) { /* handle config in sbi library */ } else if (!strcmp(scp_key, "service_name")) { /* handle config in sbi library */ @@ -111,7 +159,7 @@ int scp_context_parse_config(void) nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); - nf_info = ogs_sbi_nf_info_add( + nf_info = ogs_sbi_nf_info_find( &nf_instance->nf_info_list, OpenAPI_nf_type_SCP); ogs_assert(nf_info); @@ -192,15 +240,19 @@ int scp_context_parse_config(void) port_key); } } else if (!strcmp(domain_key, "name")) { - scp_info->domain[ - scp_info->num_of_domain]. - name = (char *)ogs_yaml_iter_value( + const char *v = ogs_yaml_iter_value( &domain_iter); + if (v) + scp_info->domain[ + scp_info->num_of_domain]. + name = ogs_strdup(v); } else if (!strcmp(domain_key, "fqdn")) { - scp_info->domain[ - scp_info->num_of_domain]. - fqdn = (char *)ogs_yaml_iter_value( + const char *v = ogs_yaml_iter_value( &domain_iter); + if (v) + scp_info->domain[ + scp_info->num_of_domain]. + fqdn = ogs_strdup(v); } else ogs_warn("unknown key `%s`", domain_key); @@ -268,6 +320,9 @@ scp_assoc_t *scp_assoc_add(ogs_sbi_stream_t *stream) assoc->stream = stream; + assoc->discovery_option = ogs_sbi_discovery_option_new(); + ogs_assert(assoc->discovery_option); + ogs_list_add(&self.assoc_list, assoc); return assoc; @@ -279,12 +334,16 @@ void scp_assoc_remove(scp_assoc_t *assoc) ogs_list_remove(&self.assoc_list, assoc); + ogs_assert(assoc->discovery_option); + ogs_sbi_discovery_option_free(assoc->discovery_option); + if (assoc->client) ogs_sbi_client_remove(assoc->client); if (assoc->nrf_client) ogs_sbi_client_remove(assoc->nrf_client); - if (assoc->discovery_option) - ogs_sbi_discovery_option_free(assoc->discovery_option); + + if (assoc->target_apiroot) + ogs_free(assoc->target_apiroot); ogs_pool_free(&scp_assoc_pool, assoc); } @@ -296,8 +355,3 @@ void scp_assoc_remove_all(void) ogs_list_for_each_safe(&self.assoc_list, next_assoc, assoc) scp_assoc_remove(assoc); } - -scp_assoc_t *scp_assoc_find(uint32_t index) -{ - return ogs_pool_find(&scp_assoc_pool, index); -} diff --git a/src/scp/context.h b/src/scp/context.h index 5e6b61ac5..f7b26e53c 100644 --- a/src/scp/context.h +++ b/src/scp/context.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -41,7 +41,7 @@ typedef struct scp_context_s { typedef struct scp_assoc_s scp_assoc_t; typedef struct scp_assoc_s { - ogs_sbi_object_t sbi; + ogs_lnode_t lnode; ogs_sbi_stream_t *stream; @@ -49,11 +49,16 @@ typedef struct scp_assoc_s { ogs_sbi_client_t *nrf_client; ogs_sbi_request_t *request; + ogs_sbi_service_type_e service_type; + + OpenAPI_nf_type_e target_nf_type; OpenAPI_nf_type_e requester_nf_type; ogs_sbi_discovery_option_t *discovery_option; ogs_sbi_nf_instance_t *nf_service_producer; + + char *target_apiroot; } scp_assoc_t; void scp_context_init(void); @@ -63,11 +68,9 @@ scp_context_t *scp_self(void); int scp_context_parse_config(void); scp_assoc_t *scp_assoc_add(ogs_sbi_stream_t *stream); -void scp_assoc_remove(scp_assoc_t *sess); +void scp_assoc_remove(scp_assoc_t *assoc); void scp_assoc_remove_all(void); -scp_assoc_t *scp_assoc_find(uint32_t index); - #ifdef __cplusplus } #endif diff --git a/src/scp/event.h b/src/scp/event.h index d5e233e2f..3477d0e36 100644 --- a/src/scp/event.h +++ b/src/scp/event.h @@ -31,9 +31,6 @@ typedef struct ogs_sbi_nf_instance_s ogs_sbi_nf_instance_t; typedef struct scp_event_s { ogs_event_t h; - - ogs_sbi_nf_instance_t *nf_instance; - scp_sess_t *sess; } scp_event_t; OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(scp_event_t)); diff --git a/src/scp/init.c b/src/scp/init.c index afcc09d7d..561c3e3e6 100644 --- a/src/scp/init.c +++ b/src/scp/init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -29,10 +29,14 @@ int scp_initialize(void) { int rv; +#define APP_NAME "scp" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + ogs_sbi_context_init(OpenAPI_nf_type_SCP); scp_context_init(); - rv = ogs_sbi_context_parse_config("scp", "nrf", "next_scp"); + rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "next_scp"); if (rv != OGS_OK) return rv; rv = scp_context_parse_config(); diff --git a/src/scp/sbi-path.c b/src/scp/sbi-path.c index 0ef585a33..9e9d172ba 100644 --- a/src/scp/sbi-path.c +++ b/src/scp/sbi-path.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -22,8 +22,19 @@ static int request_handler(ogs_sbi_request_t *request, void *data); static int response_handler( int status, ogs_sbi_response_t *response, void *data); -static int discover_handler( +static int nf_discover_handler( int status, ogs_sbi_response_t *response, void *data); +static int sepp_discover_handler( + int status, ogs_sbi_response_t *response, void *data); + +static bool send_discover( + ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb, + scp_assoc_t *assoc); + +static bool send_request( + ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb, + ogs_sbi_request_t *request, bool do_not_remove_custom_header, + scp_assoc_t *assoc); static void copy_request( ogs_sbi_request_t *target, ogs_sbi_request_t *source, @@ -70,6 +81,7 @@ int scp_sbi_open(void) if (nrf_client && !next_scp) { /* Setup Subscription-Data */ + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_SEPP, NULL); ogs_sbi_subscription_spec_add(OpenAPI_nf_type_AMF, NULL); ogs_sbi_subscription_spec_add(OpenAPI_nf_type_AUSF, NULL); ogs_sbi_subscription_spec_add(OpenAPI_nf_type_BSF, NULL); @@ -97,11 +109,9 @@ static int request_handler(ogs_sbi_request_t *request, void *data) int rv; ogs_hash_index_t *hi; ogs_sbi_client_t *client = NULL, *nrf_client = NULL, *next_scp = NULL; + ogs_sbi_client_t *sepp_client = NULL; ogs_sbi_stream_t *stream = data; - ogs_sbi_request_t scp_request; - char *apiroot = NULL, *newuri = NULL; - OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL; OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL; ogs_sbi_discovery_option_t *discovery_option = NULL; @@ -125,7 +135,14 @@ static int request_handler(ogs_sbi_request_t *request, void *data) ogs_assert(request->h.uri); ogs_assert(stream); - /* Check if Next-SCP's client */ + /* SCP Context */ + assoc = scp_assoc_add(stream); + if (!assoc) { + ogs_error("scp_assoc_add() failed"); + return OGS_ERROR; + } + + /* Next-SCP client */ if (ogs_sbi_self()->discovery_config.delegated == OGS_SBI_DISCOVERY_DELEGATED_AUTO) { next_scp = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance); @@ -135,7 +152,11 @@ static int request_handler(ogs_sbi_request_t *request, void *data) ogs_assert(next_scp); } - discovery_option = ogs_sbi_discovery_option_new(); + /* NRF client */ + nrf_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->nrf_instance); + + /* Discovery Option */ + discovery_option = assoc->discovery_option; ogs_assert(discovery_option); /* Extract HTTP Header */ @@ -209,6 +230,17 @@ static int request_handler(ogs_sbi_request_t *request, void *data) } else if (!strcasecmp(key, OGS_SBI_CUSTOM_DISCOVERY_TAI)) { if (val) ogs_sbi_discovery_option_parse_tai(discovery_option, val); + } else if (!strcasecmp(key, OGS_SBI_CUSTOM_DISCOVERY_TARGET_PLMN_LIST)) { + if (val) + 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_REQUESTER_PLMN_LIST)) { + if (val) + discovery_option->num_of_requester_plmn_list = + ogs_sbi_discovery_option_parse_plmn_list( + discovery_option->requester_plmn_list, val); } else if (!strcasecmp(key, OGS_SBI_CUSTOM_DISCOVERY_REQUESTER_FEATURES)) { if (val) @@ -228,7 +260,7 @@ static int request_handler(ogs_sbi_request_t *request, void *data) if (!requester_nf_type) { ogs_error("[%s] No User-Agent", request->h.uri); - ogs_sbi_discovery_option_free(discovery_option); + scp_assoc_remove(assoc); return OGS_ERROR; } @@ -237,7 +269,7 @@ static int request_handler(ogs_sbi_request_t *request, void *data) ogs_error("[%s] No Mandatory Discovery [%d:%d]", request->h.uri, target_nf_type, service_type); - ogs_sbi_discovery_option_free(discovery_option); + scp_assoc_remove(assoc); return OGS_ERROR; } @@ -264,114 +296,139 @@ static int request_handler(ogs_sbi_request_t *request, void *data) discovery_presence = true; } - /************************************ - * Send REQUEST message to the CLIENT - ************************************/ - if (next_scp || headers.target_apiroot || client) { - assoc = scp_assoc_add(stream); - if (!assoc) { - ogs_error("scp_assoc_add() failed"); - ogs_sbi_discovery_option_free(discovery_option); + /************************************** + * Send REQUEST message to the Next-SCP + **************************************/ + if (next_scp) { + + if (false == send_request( + next_scp, response_handler, request, true, assoc)) { + ogs_error("send_request() failed"); + + scp_assoc_remove(assoc); return OGS_ERROR; } - if (next_scp) { - /* Switch to the Next-SCP's client */ - client = next_scp; + return OGS_OK; + } - /* Client ApiRoot */ - apiroot = ogs_sbi_client_apiroot(client); - ogs_assert(apiroot); + /************************************ + * Send REQUEST message to the CLIENT + ************************************/ + if (headers.target_apiroot || client) { - /* Setup New URI */ - newuri = ogs_msprintf("%s%s", apiroot, request->h.uri); - ogs_assert(newuri); + /************************** + * Check if SEPP is needed + **************************/ + if (headers.target_apiroot && + ogs_sbi_fqdn_in_vplmn(headers.target_apiroot) == true) { - ogs_free(apiroot); + /* Re-Use Custom Header(Target-apiRoot) from Target-apiRoot */ + ogs_assert(!assoc->target_apiroot); + assoc->target_apiroot = ogs_strdup(headers.target_apiroot); + ogs_assert(assoc->target_apiroot); + + } else if (client && client->fqdn && + ogs_sbi_fqdn_in_vplmn(client->fqdn) == true) { + + /* Generate Custom Header(Target-apiRoot) from Known-Client */ + ogs_assert(!assoc->target_apiroot); + assoc->target_apiroot = ogs_sbi_client_apiroot(client); + ogs_assert(assoc->target_apiroot); + } + + if (assoc->target_apiroot) { + + /* Visited Network requires SEPP */ + sepp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->sepp_instance); + + if (!sepp_client && !nrf_client) { + + ogs_error("No SEPP(%p) and NRF(%p) [%s]", + sepp_client, nrf_client, assoc->target_apiroot); + + scp_assoc_remove(assoc); + return OGS_ERROR; + + } else if (!sepp_client) { + + assoc->request = request; + ogs_assert(assoc->request); + + assoc->target_nf_type = OpenAPI_nf_type_SEPP;; + ogs_assert(assoc->request); + assoc->requester_nf_type = requester_nf_type; + ogs_assert(assoc->request); + + if (false == send_discover( + nrf_client, sepp_discover_handler, assoc)) { + ogs_error("send_discover() failed"); + + scp_assoc_remove(assoc); + return OGS_ERROR; + } + + return OGS_OK; + } + } + + if (sepp_client) { + + /* Switch to the SEPP client */ + client = sepp_client; } else if (headers.target_apiroot) { bool rc; OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; - ogs_sockaddr_t *addr = NULL; + char *fqdn = NULL; + uint16_t fqdn_port = 0; + ogs_sockaddr_t *addr = NULL, *addr6 = NULL; /* Find or Add Client Instance */ rc = ogs_sbi_getaddr_from_uri( - &scheme, &addr, headers.target_apiroot); + &scheme, &fqdn, &fqdn_port, &addr, &addr6, + headers.target_apiroot); if (rc == false || scheme == OpenAPI_uri_scheme_NULL) { ogs_error("Invalid Target-apiRoot [%s]", headers.target_apiroot); - ogs_sbi_discovery_option_free(discovery_option); scp_assoc_remove(assoc); - return OGS_ERROR; } - client = ogs_sbi_client_find(scheme, addr); + client = ogs_sbi_client_find(scheme, fqdn, fqdn_port, addr, addr6); if (!client) { ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); - client = ogs_sbi_client_add(scheme, addr); + client = ogs_sbi_client_add( + scheme, fqdn, fqdn_port, addr, addr6); if (!client) { - char buf[OGS_ADDRSTRLEN]; - ogs_error("ogs_sbi_client_add() failed [%s]:%d", - OGS_ADDR(addr, buf), OGS_PORT(addr)); + ogs_error("%s: ogs_sbi_client_add() failed", OGS_FUNC); + ogs_free(fqdn); ogs_freeaddrinfo(addr); - ogs_sbi_discovery_option_free(discovery_option); + ogs_freeaddrinfo(addr6); scp_assoc_remove(assoc); return OGS_ERROR; } } OGS_SBI_SETUP_CLIENT(assoc, client); + + ogs_free(fqdn); ogs_freeaddrinfo(addr); - - /* Setup New URI */ - newuri = ogs_msprintf("%s%s", - headers.target_apiroot, request->h.uri); - ogs_assert(newuri); - - } else if (client) { - /* Client ApiRoot */ - apiroot = ogs_sbi_client_apiroot(client); - ogs_assert(apiroot); - - /* Setup New URI */ - newuri = ogs_msprintf("%s%s", apiroot, request->h.uri); - ogs_assert(newuri); - - ogs_free(apiroot); + ogs_freeaddrinfo(addr6); } - /* Check assocation and client instance */ - ogs_assert(assoc); ogs_assert(client); - /* Copy Request for sending SCP */ - copy_request(&scp_request, request, next_scp ? true : false); - ogs_assert(scp_request.http.headers); + if (false == send_request( + client, response_handler, request, false, assoc)) { + ogs_error("send_request() failed"); - /* Setup NEW URI */ - scp_request.h.uri = newuri; - ogs_assert(scp_request.h.uri); - - /* Send the HTTP Request with New URI and HTTP Headers */ - if (ogs_sbi_client_send_request( - client, response_handler, &scp_request, assoc) != true) { - ogs_error("ogs_sbi_client_send_request() failed"); - - ogs_sbi_http_hash_free(scp_request.http.headers); - ogs_free(scp_request.h.uri); - ogs_sbi_discovery_option_free(discovery_option); scp_assoc_remove(assoc); - return OGS_ERROR; } - ogs_sbi_http_hash_free(scp_request.http.headers); - ogs_free(scp_request.h.uri); - ogs_sbi_discovery_option_free(discovery_option); - return OGS_OK; } @@ -379,14 +436,6 @@ static int request_handler(ogs_sbi_request_t *request, void *data) * Send DISCOVERY message to NRF *******************************/ if (discovery_presence == true) { - ogs_sbi_request_t *nrf_request = NULL; - - assoc = scp_assoc_add(stream); - if (!assoc) { - ogs_error("scp_assoc_add() failed"); - ogs_sbi_discovery_option_free(discovery_option); - return OGS_ERROR; - } if (headers.nrf_uri) { char *key = NULL; @@ -440,36 +489,41 @@ static int request_handler(ogs_sbi_request_t *request, void *data) if (nnrf_disc) { bool rc; OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; - ogs_sockaddr_t *addr = NULL; + char *fqdn = NULL; + uint16_t fqdn_port = 0; + ogs_sockaddr_t *addr = NULL, *addr6 = NULL; - rc = ogs_sbi_getaddr_from_uri(&scheme, &addr, nnrf_disc); + rc = ogs_sbi_getaddr_from_uri( + &scheme, &fqdn, &fqdn_port, &addr, &addr6, nnrf_disc); if (rc == false || scheme == OpenAPI_uri_scheme_NULL) { ogs_error("Invalid nnrf-disc [%s]", nnrf_disc); - ogs_sbi_discovery_option_free(discovery_option); scp_assoc_remove(assoc); - return OGS_ERROR; } - nrf_client = ogs_sbi_client_find(scheme, addr); + nrf_client = ogs_sbi_client_find( + scheme, fqdn, fqdn_port, addr, addr6); if (!nrf_client) { ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); - nrf_client = ogs_sbi_client_add(scheme, addr); + nrf_client = ogs_sbi_client_add( + scheme, fqdn, fqdn_port, addr, addr6); if (!nrf_client) { - char buf[OGS_ADDRSTRLEN]; - ogs_error("ogs_sbi_client_add() failed [%s]:%d", - OGS_ADDR(addr, buf), OGS_PORT(addr)); + ogs_error("%s: ogs_sbi_client_add()", OGS_FUNC); + ogs_free(fqdn); ogs_freeaddrinfo(addr); - ogs_sbi_discovery_option_free(discovery_option); + ogs_freeaddrinfo(addr6); scp_assoc_remove(assoc); return OGS_ERROR; } } OGS_SBI_SETUP_CLIENT(assoc, nrf_client); + + ogs_free(fqdn); ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); } if (nnrf_nfm) ogs_free(nnrf_nfm); @@ -478,28 +532,21 @@ static int request_handler(ogs_sbi_request_t *request, void *data) } if (!nrf_client) { - nrf_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->nrf_instance); - if (!nrf_client) { - ogs_error("No NRF"); + ogs_error("No NRF"); - ogs_sbi_discovery_option_free(discovery_option); - scp_assoc_remove(assoc); - - return OGS_ERROR; - } + scp_assoc_remove(assoc); + return OGS_ERROR; } - /* Store request and service-type in association context */ assoc->request = request; ogs_assert(assoc->request); assoc->service_type = service_type; ogs_assert(assoc->service_type); + + assoc->target_nf_type = target_nf_type; + ogs_assert(assoc->target_nf_type); assoc->requester_nf_type = requester_nf_type; ogs_assert(assoc->requester_nf_type); - assoc->discovery_option = discovery_option; - ogs_assert(assoc->discovery_option); - - ogs_assert(target_nf_type); if (!discovery_option->num_of_service_names) { ogs_error("No service names"); @@ -531,30 +578,16 @@ static int request_handler(ogs_sbi_request_t *request, void *data) "in TS29.500"); } - nrf_request = ogs_nnrf_disc_build_discover( - target_nf_type, requester_nf_type, discovery_option); - if (!nrf_request) { - ogs_error("ogs_nnrf_disc_build_discover() failed"); + if (false == send_discover(nrf_client, nf_discover_handler, assoc)) { + ogs_error("send_discover() failed"); scp_assoc_remove(assoc); return OGS_ERROR; } - if (false == ogs_sbi_client_send_request( - nrf_client, discover_handler, nrf_request, assoc)) { - ogs_error("ogs_sbi_client_send_request() failed"); - - scp_assoc_remove(assoc); - ogs_sbi_request_free(nrf_request); - - return OGS_ERROR; - } - - ogs_sbi_request_free(nrf_request); - return OGS_OK; } - ogs_sbi_discovery_option_free(discovery_option); + scp_assoc_remove(assoc); /*************************************** * Receive NOTIFICATION message from NRF @@ -621,7 +654,7 @@ static int response_handler( return OGS_OK; } -static int discover_handler( +static int nf_discover_handler( int status, ogs_sbi_response_t *response, void *data) { int rv; @@ -630,26 +663,28 @@ static int discover_handler( scp_assoc_t *assoc = data; ogs_sbi_stream_t *stream = NULL; + ogs_sbi_request_t *request = NULL; ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL; + OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL; OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL; ogs_sbi_discovery_option_t *discovery_option = NULL; - ogs_sbi_request_t scp_request; - char *apiroot = NULL; - ogs_sbi_nf_instance_t *nf_instance = NULL; - ogs_sbi_client_t *client = NULL, *next_scp = NULL; + ogs_sbi_client_t *client = NULL; + ogs_sbi_client_t *sepp_client = NULL; ogs_assert(assoc); stream = assoc->stream; + ogs_assert(stream); request = assoc->request; ogs_assert(request); service_type = assoc->service_type; ogs_assert(service_type); - target_nf_type = ogs_sbi_service_type_to_nf_type(service_type); + + target_nf_type = assoc->target_nf_type; ogs_assert(target_nf_type); requester_nf_type = assoc->requester_nf_type; ogs_assert(requester_nf_type); @@ -660,15 +695,14 @@ static int discover_handler( ogs_log_message( status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0, - "response_handler() failed [%d]", status); + "nf_discover_handler() failed [%d]", status); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL, - "response_handler() failed", NULL)); + "nf_discover_handler() failed", NULL)); scp_assoc_remove(assoc); - return OGS_ERROR; } @@ -702,6 +736,10 @@ static int discover_handler( goto cleanup; } + /* Store NF Service Producer */ + assoc->nf_service_producer = nf_instance; + ogs_assert(assoc->nf_service_producer); + client = ogs_sbi_client_find_by_service_type(nf_instance, service_type); if (!client) { strerror = ogs_msprintf("(NF discover) No client [%s:%s]", @@ -711,54 +749,33 @@ static int discover_handler( goto cleanup; } - /* Copy Request for sending SCP */ - copy_request(&scp_request, request, false); - ogs_assert(scp_request.http.headers); + /************************** + * Check if SEPP is needed + **************************/ + if (client->fqdn && ogs_sbi_fqdn_in_vplmn(client->fqdn) == true) { - /* Check if Next-SCP's client */ - next_scp = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance); - if (next_scp) { - apiroot = ogs_sbi_client_apiroot(client); - ogs_assert(apiroot); + /* Visited Network requires SEPP */ + sepp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->sepp_instance); + if (!sepp_client) { + ogs_error("No SEPP [%s]", client->fqdn); + strerror = ogs_msprintf("No SEPP [%s]", client->fqdn); + goto cleanup; + } - ogs_sbi_header_set(scp_request.http.headers, - OGS_SBI_CUSTOM_TARGET_APIROOT, apiroot); + /* Generate Custom Header(Target-apiRoot) from Known-Client */ + ogs_assert(!assoc->target_apiroot); + assoc->target_apiroot = ogs_sbi_client_apiroot(client); + ogs_assert(assoc->target_apiroot); - ogs_free(apiroot); - - /* Switch to the Next-SCP's client */ - client = next_scp; + client = sepp_client; } - /* Client ApiRoot */ - apiroot = ogs_sbi_client_apiroot(client); - ogs_assert(apiroot); - - /* Setup New URI */ - scp_request.h.uri = ogs_msprintf("%s%s", apiroot, request->h.uri); - ogs_assert(scp_request.h.uri); - - ogs_free(apiroot); - - /* Store NF Service Producer */ - assoc->nf_service_producer = nf_instance; - ogs_assert(assoc->nf_service_producer); - - /* Send the HTTP Request with New URI and HTTP Headers */ - if (ogs_sbi_client_send_request( - client, response_handler, &scp_request, assoc) != true) { - ogs_error("ogs_sbi_client_send_request() failed"); - strerror = ogs_msprintf("ogs_sbi_client_send_request() failed"); - - ogs_sbi_http_hash_free(scp_request.http.headers); - ogs_free(scp_request.h.uri); - + if (false == send_request( + client, response_handler, request, false, assoc)) { + strerror = ogs_msprintf("send_request() failed"); goto cleanup; } - ogs_sbi_http_hash_free(scp_request.http.headers); - ogs_free(scp_request.h.uri); - ogs_sbi_response_free(response); ogs_sbi_message_free(&message); @@ -782,9 +799,171 @@ cleanup: return OGS_ERROR; } +static int sepp_discover_handler( + int status, ogs_sbi_response_t *response, void *data) +{ + int rv; + char *strerror = NULL; + ogs_sbi_message_t message; + + scp_assoc_t *assoc = data; + ogs_sbi_stream_t *stream = NULL; + + ogs_sbi_request_t *request = NULL; + + ogs_sbi_client_t *sepp_client = NULL; + + ogs_assert(assoc); + ogs_assert(assoc->target_apiroot); + stream = assoc->stream; + ogs_assert(stream); + request = assoc->request; + ogs_assert(request); + + if (status != OGS_OK) { + + ogs_log_message( + status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0, + "sepp_discover_handler() failed [%d]", status); + + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL, + "sepp_discover_handler() failed", NULL)); + + scp_assoc_remove(assoc); + return OGS_ERROR; + } + + ogs_assert(response); + + rv = ogs_sbi_parse_response(&message, response); + if (rv != OGS_OK) { + strerror = ogs_msprintf("cannot parse HTTP response"); + goto cleanup; + } + + if (message.res_status != OGS_SBI_HTTP_STATUS_OK) { + strerror = ogs_msprintf("NF-Discover failed [%d]", message.res_status); + goto cleanup; + } + + if (!message.SearchResult) { + strerror = ogs_msprintf("No SearchResult"); + goto cleanup; + } + + ogs_nnrf_disc_handle_nf_discover_search_result(message.SearchResult); + + /***************************** + * Check if SEPP is discovered + *****************************/ + sepp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->sepp_instance); + if (!sepp_client) { + strerror = ogs_msprintf("No SEPP"); + goto cleanup; + } + + if (false == send_request( + sepp_client, response_handler, request, false, assoc)) { + strerror = ogs_msprintf("send_request() failed"); + goto cleanup; + } + + ogs_sbi_response_free(response); + ogs_sbi_message_free(&message); + + return OGS_OK; + +cleanup: + ogs_assert(strerror); + ogs_error("%s", strerror); + + ogs_assert(true == + ogs_sbi_server_send_error( + stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, NULL, strerror, NULL)); + + ogs_free(strerror); + + scp_assoc_remove(assoc); + + ogs_sbi_response_free(response); + ogs_sbi_message_free(&message); + + return OGS_ERROR; +} + +static bool send_discover( + ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb, + scp_assoc_t *assoc) +{ + bool rc; + ogs_sbi_request_t *request = NULL; + + ogs_assert(client); + ogs_assert(assoc); + + request = ogs_nnrf_disc_build_discover( + assoc->target_nf_type, assoc->requester_nf_type, + assoc->target_nf_type != OpenAPI_nf_type_SEPP ? + assoc->discovery_option : NULL); + if (!request) { + ogs_error("ogs_nnrf_disc_build_discover() failed"); + return false; + } + + rc = ogs_sbi_client_send_request(client, client_cb, request, assoc); + ogs_expect(rc == true); + + ogs_sbi_request_free(request); + + return rc; +} + +static bool send_request( + ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb, + ogs_sbi_request_t *request, bool do_not_remove_custom_header, + scp_assoc_t *assoc) +{ + bool rc; + ogs_sbi_request_t scp_request; + char *uri_apiroot = NULL; + + ogs_assert(client); + ogs_assert(request); + ogs_assert(assoc); + + /* Copy Request for sending SCP */ + copy_request(&scp_request, request, do_not_remove_custom_header); + ogs_assert(scp_request.http.headers); + + /* Added Custom Header(Target-apiRoot) */ + if (assoc->target_apiroot) + ogs_sbi_header_set(scp_request.http.headers, + OGS_SBI_CUSTOM_TARGET_APIROOT, assoc->target_apiroot); + + /* Client ApiRoot */ + uri_apiroot = ogs_sbi_client_apiroot(client); + ogs_assert(uri_apiroot); + + /* Setup New URI */ + scp_request.h.uri = ogs_msprintf("%s%s", uri_apiroot, request->h.uri); + ogs_assert(scp_request.h.uri); + + /* Send the HTTP Request with New URI and HTTP Headers */ + rc = ogs_sbi_client_send_request(client, client_cb, &scp_request, assoc); + ogs_expect(rc == true); + + ogs_sbi_http_hash_free(scp_request.http.headers); + ogs_free(scp_request.h.uri); + ogs_free(uri_apiroot); + + return rc; +} + static void copy_request( ogs_sbi_request_t *target, ogs_sbi_request_t *source, - bool next_scp) + bool do_not_remove_custom_header) { ogs_hash_index_t *hi; @@ -824,9 +1003,9 @@ static void copy_request( * Each header field consists of a name followed by a colon (":") * and the field value. Field names are case-insensitive. */ - if (next_scp == false && + if (do_not_remove_custom_header == false && !strcasecmp(key, OGS_SBI_CUSTOM_TARGET_APIROOT)) { - } else if (next_scp == false && + } else if (do_not_remove_custom_header == false && !strncasecmp(key, OGS_SBI_CUSTOM_DISCOVERY_COMMON, strlen(OGS_SBI_CUSTOM_DISCOVERY_COMMON))) { } else if (!strcasecmp(key, OGS_SBI_SCHEME)) { diff --git a/lib/dbi/path.c b/src/sepp/app.c similarity index 60% rename from lib/dbi/path.c rename to src/sepp/app.c index 3d223f44a..73d44f305 100644 --- a/lib/dbi/path.c +++ b/src/sepp/app.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019,2020 by Sukchan Lee + * Copyright (C) 2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -17,25 +17,24 @@ * along with this program. If not, see . */ -#include "ogs-dbi.h" +#include "ogs-app.h" -int ogs_dbi_process_change_stream(const bson_t *document) +int app_initialize(const char *const argv[]) { int rv; - ogs_event_t *e = NULL; - - e = ogs_event_new(OGS_EVENT_DBI_MESSAGE); - ogs_assert(e); - e->dbi.document = bson_copy(document); - rv = ogs_queue_push(ogs_app()->queue, e); + rv = sepp_initialize(); if (rv != OGS_OK) { - ogs_error("ogs_queue_push() failed:%d", (int)rv); - bson_destroy(e->dbi.document); - ogs_event_free(e); - } else { - ogs_pollset_notify(ogs_app()->pollset); + ogs_error("Failed to intialize SEPP"); + return rv; } + ogs_info("SEPP initialize...done"); return OGS_OK; } + +void app_terminate(void) +{ + sepp_terminate(); + ogs_info("SEPP terminate...done"); +} diff --git a/src/sepp/context.c b/src/sepp/context.c new file mode 100644 index 000000000..90f334dce --- /dev/null +++ b/src/sepp/context.c @@ -0,0 +1,582 @@ +/* + * Copyright (C) 2023 by Sukchan Lee + * + * 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 . + */ + +#include "context.h" + +static sepp_context_t self; + +int __sepp_log_domain; + +static OGS_POOL(sepp_node_pool, sepp_node_t); +static OGS_POOL(sepp_assoc_pool, sepp_assoc_t); + +static int context_initialized = 0; + +static int max_num_of_sepp_node = 0; +static int max_num_of_sepp_assoc = 0; + +void sepp_context_init(void) +{ + ogs_assert(context_initialized == 0); + + /* Initialize SEPP context */ + memset(&self, 0, sizeof(sepp_context_t)); + + ogs_log_install_domain(&__sepp_log_domain, "sepp", ogs_core()->log.level); + + max_num_of_sepp_node = ogs_app()->pool.nf; + ogs_pool_init(&sepp_node_pool, max_num_of_sepp_node); + +#define MAX_NUM_OF_SEPP_ASSOC 8 + max_num_of_sepp_assoc = ogs_global_conf()->max.ue * MAX_NUM_OF_SEPP_ASSOC; + ogs_pool_init(&sepp_assoc_pool, max_num_of_sepp_assoc); + + context_initialized = 1; +} + +void sepp_context_final(void) +{ + ogs_assert(context_initialized == 1); + + ogs_sbi_nf_instance_remove_all(); + + sepp_node_remove_all(); + sepp_assoc_remove_all(); + + ogs_pool_final(&sepp_node_pool); + ogs_pool_final(&sepp_assoc_pool); + + if (self.sender) + ogs_free(self.sender); + + context_initialized = 0; +} + +sepp_context_t *sepp_self(void) +{ + return &self; +} + +static int sepp_context_prepare(void) +{ + ogs_sbi_server_t *server = NULL; + + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_nf_info_t *nf_info = NULL; + ogs_sbi_sepp_info_t *sepp_info = NULL; + + /********************************************************************* + * SEPP Port Configuration + *********************************************************************/ + nf_instance = ogs_sbi_self()->nf_instance; + ogs_assert(nf_instance); + + nf_info = ogs_sbi_nf_info_add( + &nf_instance->nf_info_list, OpenAPI_nf_type_SEPP); + if (!nf_info) { + ogs_error("ogs_sbi_nf_info_add() failed"); + return OGS_ERROR; + } + + sepp_info = &nf_info->sepp; + + for (server = ogs_sbi_server_first(); + server; server = ogs_sbi_server_next(server)) { + ogs_sockaddr_t *advertise = NULL; + + advertise = server->advertise; + if (!advertise) + advertise = server->node.addr; + ogs_assert(advertise); + + if (server->scheme == OpenAPI_uri_scheme_https) { + sepp_info->https.presence = true; + sepp_info->https.port = OGS_PORT(advertise); + } else if (server->scheme == OpenAPI_uri_scheme_http) { + sepp_info->http.presence = true; + sepp_info->http.port = OGS_PORT(advertise); + } else { + ogs_error("Unknown scheme[%d]", server->scheme); + ogs_assert_if_reached(); + } + } + + /********************************************************************* + * Default Configuration + *********************************************************************/ + self.security_capability.tls = true; + self.target_apiroot_supported = true; + + return OGS_OK; +} + +static int sepp_context_validation(void) +{ + if (sepp_self()->security_capability.tls == false && + sepp_self()->security_capability.prins == false) { + ogs_error("No Security Capability [%d:%d] in '%s'", + sepp_self()->security_capability.tls, + sepp_self()->security_capability.prins, + ogs_app()->file); + return OGS_ERROR; + } + + if (!sepp_self()->sender) { + ogs_error("No n32.server.sender"); + return OGS_ERROR; + } + + return OGS_OK; +} + +int sepp_context_parse_config(void) +{ + int rv; + yaml_document_t *document = NULL; + ogs_yaml_iter_t root_iter; + + document = ogs_app()->document; + ogs_assert(document); + + rv = sepp_context_prepare(); + if (rv != OGS_OK) return rv; + + ogs_yaml_iter_init(&root_iter, document); + while (ogs_yaml_iter_next(&root_iter)) { + const char *root_key = ogs_yaml_iter_key(&root_iter); + ogs_assert(root_key); + if (!strcmp(root_key, "sepp")) { + ogs_yaml_iter_t sepp_iter; + ogs_yaml_iter_recurse(&root_iter, &sepp_iter); + while (ogs_yaml_iter_next(&sepp_iter)) { + const char *sepp_key = ogs_yaml_iter_key(&sepp_iter); + ogs_assert(sepp_key); + if (!strcmp(sepp_key, "default")) { + /* handle config in sbi library */ + } else if (!strcmp(sepp_key, "n32")) { + ogs_yaml_iter_t sbi_iter; + ogs_yaml_iter_recurse(&sepp_iter, &sbi_iter); + while (ogs_yaml_iter_next(&sbi_iter)) { + const char *sbi_key = ogs_yaml_iter_key(&sbi_iter); + ogs_assert(sbi_key); + if (!strcmp(sbi_key, "server")) { + const char *sender = NULL; + ogs_yaml_iter_t server_iter, server_array; + ogs_yaml_iter_recurse(&sbi_iter, &server_array); + do { + if (ogs_yaml_iter_type(&server_array) == + YAML_MAPPING_NODE) { + memcpy(&server_iter, &server_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&server_array)) + break; + ogs_yaml_iter_recurse( + &server_array, &server_iter); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); + + while (ogs_yaml_iter_next(&server_iter)) { + const char *server_key = + ogs_yaml_iter_key(&server_iter); + ogs_assert(server_key); + if (!strcmp(server_key, "sender")) { + sender = + ogs_yaml_iter_value(&server_iter); + } + } + } while (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE); + + if (!sender) { + ogs_error("No n32.server.sender"); + return OGS_ERROR; + } + + if (self.sender) + ogs_free(self.sender); + self.sender = ogs_strdup(sender); + if (!self.sender) { + ogs_error("No memory for sender"); + return OGS_ERROR; + } + + rv = ogs_sbi_context_parse_server_config( + &sbi_iter, OGS_SBI_INTERFACE_NAME_SEPP); + if (rv != OGS_OK) { + ogs_error("ogs_sbi_context_parse_server_" + "config() failed"); + return rv; + } + + } else if (!strcmp(sbi_key, "client")) { + ogs_yaml_iter_t client_iter; + ogs_yaml_iter_recurse(&sbi_iter, &client_iter); + while (ogs_yaml_iter_next(&client_iter)) { + const char *client_key = + ogs_yaml_iter_key(&client_iter); + ogs_assert(client_key); + if (!strcmp(client_key, "sepp")) { + ogs_yaml_iter_t peer_array, peer_iter; + ogs_yaml_iter_t saved_iter; + ogs_yaml_iter_recurse( + &client_iter, &peer_array); + do { + sepp_node_t *sepp_node = NULL; + ogs_sbi_client_t *client = NULL; + const char *receiver = NULL; + const char *mnc = NULL, *mcc = NULL; + + if (ogs_yaml_iter_type(&peer_array) == + YAML_MAPPING_NODE) { + memcpy(&peer_iter, &peer_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type( + &peer_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&peer_array)) + break; + ogs_yaml_iter_recurse( + &peer_array, &peer_iter); + } else if (ogs_yaml_iter_type( + &peer_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); + + memcpy(&saved_iter, &peer_iter, + sizeof(saved_iter)); + + while (ogs_yaml_iter_next(&peer_iter)) { + const char *peer_key = + ogs_yaml_iter_key(&peer_iter); + ogs_assert(peer_key); + if (!strcmp(peer_key, "receiver")) { + receiver = ogs_yaml_iter_value( + &peer_iter); + } else if (!strcmp(peer_key, + "target_plmn_id")) { + ogs_yaml_iter_t plmn_id_iter; + + ogs_yaml_iter_recurse( + &peer_iter, + &plmn_id_iter); + while (ogs_yaml_iter_next( + &plmn_id_iter)) { + const char *plmn_id_key = + ogs_yaml_iter_key( + &plmn_id_iter); + ogs_assert(plmn_id_key); + if (!strcmp(plmn_id_key, + "mcc")) { + mcc = + ogs_yaml_iter_value( + &plmn_id_iter); + } else if (!strcmp( + plmn_id_key, + "mnc")) { + mnc = + ogs_yaml_iter_value( + &plmn_id_iter); + } + } + } + } + + if (!receiver) { + ogs_error( + "No n32c.client.sepp.receiver"); + return OGS_ERROR; + } + + sepp_node = + sepp_node_find_by_receiver( + (char *)receiver); + if (sepp_node) { + ogs_error("SEPP duplicated " + "[receiver:%s]", + receiver); + return OGS_ERROR; + } + + sepp_node = sepp_node_add( + (char *)receiver); + ogs_assert(sepp_node); + + if (mcc && mnc) { + ogs_plmn_id_build( + &sepp_node->target_plmn_id, + atoi(mcc), atoi(mnc), + strlen(mnc)); + sepp_node-> + target_plmn_id_presence = + true; + } + + memcpy(&peer_iter, &saved_iter, + sizeof(peer_iter)); + + client = + ogs_sbi_context_parse_client_config( + &peer_iter); + + if (!client) { + ogs_error("ogs_sbi_context_parse_" + "client_config() failed"); + sepp_node_remove(sepp_node); + return OGS_ERROR; + } + + OGS_SBI_SETUP_CLIENT( + sepp_node, client); + + memcpy(&peer_iter, &saved_iter, + sizeof(peer_iter)); + + while (ogs_yaml_iter_next(&peer_iter)) { + const char *peer_key = + ogs_yaml_iter_key(&peer_iter); + ogs_assert(peer_key); + if (!strcmp(peer_key, + OGS_SBI_INTERFACE_NAME_N32F)) { + ogs_yaml_iter_t n32f_iter; + ogs_yaml_iter_recurse( + &peer_iter, &n32f_iter); + client = + ogs_sbi_context_parse_client_config( + &n32f_iter); + if (!client) { + ogs_error( + "ogs_sbi_context_parse_" + "client_config() " + "failed"); + sepp_node_remove(sepp_node); + return OGS_ERROR; + } + OGS_SBI_SETUP_CLIENT( + &sepp_node->n32f, client); + } + } + + } while (ogs_yaml_iter_type(&peer_array) == + YAML_SEQUENCE_NODE); + } + } + } else + ogs_warn("unknown key `%s`", sbi_key); + } + } else if (!strcmp(sepp_key, "nrf")) { + /* handle config in sbi library */ + } else if (!strcmp(sepp_key, "scp")) { + /* handle config in sbi library */ + } else if (!strcmp(sepp_key, "service_name")) { + /* handle config in sbi library */ + } else if (!strcmp(sepp_key, "discovery")) { + /* handle config in sbi library */ + } else if (!strcmp(sepp_key, "info")) { + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_nf_info_t *nf_info = NULL; + ogs_sbi_sepp_info_t *sepp_info = NULL; + + ogs_yaml_iter_t info_iter; + ogs_yaml_iter_recurse(&sepp_iter, &info_iter); + + nf_instance = ogs_sbi_self()->nf_instance; + ogs_assert(nf_instance); + + nf_info = ogs_sbi_nf_info_find( + &nf_instance->nf_info_list, + OpenAPI_nf_type_SEPP); + ogs_assert(nf_info); + + sepp_info = &nf_info->sepp; + + while (ogs_yaml_iter_next(&info_iter)) { + const char *info_key = + ogs_yaml_iter_key(&info_iter); + ogs_assert(info_key); + if (!strcmp(info_key, "port")) { + ogs_yaml_iter_t port_iter; + ogs_yaml_iter_recurse(&info_iter, &port_iter); + while (ogs_yaml_iter_next(&port_iter)) { + const char *port_key = + ogs_yaml_iter_key(&port_iter); + ogs_assert(port_key); + if (!strcmp(port_key, "http")) { + const char *v = + ogs_yaml_iter_value(&port_iter); + if (v) { + sepp_info->http.presence = true; + sepp_info->http.port = atoi(v); + } + } else if (!strcmp(port_key, "https")) { + const char *v = + ogs_yaml_iter_value(&port_iter); + if (v) { + sepp_info->https.presence = true; + sepp_info->https.port = atoi(v); + } + } else + ogs_warn("unknown key `%s`", port_key); + } + } else + ogs_warn("unknown key `%s`", info_key); + } + } + } + } + } + + rv = sepp_context_validation(); + if (rv != OGS_OK) return rv; + + return OGS_OK; +} + +sepp_node_t *sepp_node_add(char *receiver) +{ + sepp_node_t *sepp_node = NULL; + + ogs_assert(receiver); + + ogs_pool_alloc(&sepp_node_pool, &sepp_node); + if (!sepp_node) { + ogs_error("Maximum number of nodeiation[%d] reached", + max_num_of_sepp_node); + return NULL; + } + memset(sepp_node, 0, sizeof *sepp_node); + + sepp_node->receiver = ogs_strdup(receiver); + ogs_assert(sepp_node->receiver); + + ogs_list_add(&self.peer_list, sepp_node); + + return sepp_node; +} + +void sepp_node_remove(sepp_node_t *sepp_node) +{ + ogs_assert(sepp_node); + + ogs_list_remove(&self.peer_list, sepp_node); + + if (sepp_node->client) + ogs_sbi_client_remove(sepp_node->client); + if (sepp_node->n32f.client) + ogs_sbi_client_remove(sepp_node->n32f.client); + + if (sepp_node->receiver) + ogs_free(sepp_node->receiver); + + ogs_pool_free(&sepp_node_pool, sepp_node); +} + +void sepp_node_remove_all(void) +{ + sepp_node_t *sepp_node = NULL, *next_sepp_node = NULL; + + ogs_list_for_each_safe(&self.peer_list, next_sepp_node, sepp_node) + sepp_node_remove(sepp_node); +} + +sepp_node_t *sepp_node_find_by_receiver(char *receiver) +{ + sepp_node_t *sepp_node = NULL; + + ogs_assert(receiver); + + ogs_list_for_each(&self.peer_list, sepp_node) { + ogs_assert(sepp_node->receiver); + if (strcmp(sepp_node->receiver, receiver) == 0) { + return sepp_node; + } + } + + return NULL; +} + +sepp_node_t *sepp_node_find_by_plmn_id(uint16_t mcc, uint16_t mnc) +{ + sepp_node_t *sepp_node = NULL; + + ogs_assert(mcc); + ogs_assert(mnc); + + ogs_list_for_each(&self.peer_list, sepp_node) { + int i; + ogs_assert(sepp_node->receiver); + for (i = 0; i < sepp_node->num_of_plmn_id; i++) { + if (mcc == ogs_plmn_id_mcc(&sepp_node->plmn_id[i]) && + mnc == ogs_plmn_id_mnc(&sepp_node->plmn_id[i])) { + return sepp_node; + } + } + } + + return NULL; +} + +sepp_assoc_t *sepp_assoc_add(ogs_sbi_stream_t *stream) +{ + sepp_assoc_t *assoc = NULL; + + ogs_assert(stream); + + ogs_pool_alloc(&sepp_assoc_pool, &assoc); + if (!assoc) { + ogs_error("Maximum number of association[%d] reached", + max_num_of_sepp_assoc); + return NULL; + } + memset(assoc, 0, sizeof *assoc); + + assoc->stream = stream; + + ogs_list_add(&self.assoc_list, assoc); + + return assoc; +} + +void sepp_assoc_remove(sepp_assoc_t *assoc) +{ + ogs_assert(assoc); + + ogs_list_remove(&self.assoc_list, assoc); + + if (assoc->client) + ogs_sbi_client_remove(assoc->client); + if (assoc->nrf_client) + ogs_sbi_client_remove(assoc->nrf_client); + + ogs_pool_free(&sepp_assoc_pool, assoc); +} + +void sepp_assoc_remove_all(void) +{ + sepp_assoc_t *assoc = NULL, *next_assoc = NULL; + + ogs_list_for_each_safe(&self.assoc_list, next_assoc, assoc) + sepp_assoc_remove(assoc); +} diff --git a/src/sepp/context.h b/src/sepp/context.h new file mode 100644 index 000000000..89e47d217 --- /dev/null +++ b/src/sepp/context.h @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2023 by Sukchan Lee + * + * 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 . + */ + +#ifndef SEPP_CONTEXT_H +#define SEPP_CONTEXT_H + +#include "ogs-sbi.h" +#include "ogs-app.h" + +#include "timer.h" +#include "sepp-sm.h" + +#ifdef __cplusplus +extern "C" { +#endif + +extern int __sepp_log_domain; + +#undef OGS_LOG_DOMAIN +#define OGS_LOG_DOMAIN __sepp_log_domain + +typedef struct sepp_context_s { + char *sender; + + struct { + bool tls; + bool prins; + } security_capability; + + bool target_apiroot_supported; + + ogs_list_t peer_list; + + ogs_list_t assoc_list; +} sepp_context_t; + +typedef struct sepp_node_s sepp_node_t; + +typedef struct sepp_node_s { + ogs_lnode_t lnode; + + char *receiver; + OpenAPI_security_capability_e negotiated_security_scheme; + bool target_apiroot_supported; + + ogs_plmn_id_t plmn_id[OGS_MAX_NUM_OF_PLMN]; + int num_of_plmn_id; + + bool target_plmn_id_presence; + ogs_plmn_id_t target_plmn_id; + + uint64_t supported_features; + + ogs_fsm_t sm; /* A state machine */ + ogs_timer_t *t_establish_interval; /* timer to retry + to establish peer node */ + + void *client; /* only used in CLIENT */ + struct { + void *client; /* For n32 forwarding interface */ + } n32f; +} sepp_node_t; + +typedef struct sepp_assoc_s sepp_assoc_t; + +typedef struct sepp_assoc_s { + ogs_lnode_t lnode; + + ogs_sbi_stream_t *stream; + + ogs_sbi_client_t *client; + ogs_sbi_client_t *nrf_client; + + ogs_sbi_request_t *request; + ogs_sbi_service_type_e service_type; + OpenAPI_nf_type_e requester_nf_type; + + ogs_sbi_nf_instance_t *nf_service_producer; +} sepp_assoc_t; + +void sepp_context_init(void); +void sepp_context_final(void); +sepp_context_t *sepp_self(void); + +int sepp_context_parse_config(void); + +sepp_node_t *sepp_node_add(char *receiver); +void sepp_node_remove(sepp_node_t *sepp_node); +void sepp_node_remove_all(void); +sepp_node_t *sepp_node_find_by_receiver(char *receiver); +sepp_node_t *sepp_node_find_by_plmn_id(uint16_t mcc, uint16_t mnc); + +sepp_assoc_t *sepp_assoc_add(ogs_sbi_stream_t *stream); +void sepp_assoc_remove(sepp_assoc_t *assoc); +void sepp_assoc_remove_all(void); + +#ifdef __cplusplus +} +#endif + +#endif /* SEPP_CONTEXT_H */ diff --git a/src/sepp/event.c b/src/sepp/event.c new file mode 100644 index 000000000..0666e0d09 --- /dev/null +++ b/src/sepp/event.c @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2023 by Sukchan Lee + * + * 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 . + */ + +#include "event.h" + +sepp_event_t *sepp_event_new(int id) +{ + sepp_event_t *e = NULL; + + e = ogs_event_size(id, sizeof(sepp_event_t)); + ogs_assert(e); + + e->h.id = id; + + return e; +} + +const char *sepp_event_get_name(sepp_event_t *e) +{ + if (e == NULL) { + return OGS_FSM_NAME_INIT_SIG; + } + + switch (e->h.id) { + case OGS_FSM_ENTRY_SIG: + return OGS_FSM_NAME_ENTRY_SIG; + case OGS_FSM_EXIT_SIG: + return OGS_FSM_NAME_EXIT_SIG; + + case OGS_EVENT_SBI_SERVER: + return OGS_EVENT_NAME_SBI_SERVER; + case OGS_EVENT_SBI_CLIENT: + return OGS_EVENT_NAME_SBI_CLIENT; + case OGS_EVENT_SBI_TIMER: + return OGS_EVENT_NAME_SBI_TIMER; + + default: + break; + } + + ogs_error("Unknown Event[%d]", e->h.id); + return "UNKNOWN_EVENT"; +} diff --git a/src/sepp/event.h b/src/sepp/event.h new file mode 100644 index 000000000..d72dd8fe0 --- /dev/null +++ b/src/sepp/event.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2023 by Sukchan Lee + * + * 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 . + */ + +#ifndef SEPP_EVENT_H +#define SEPP_EVENT_H + +#include "ogs-proto.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct sepp_node_s sepp_node_t; + +typedef struct sepp_event_s { + ogs_event_t h; + sepp_node_t *sepp_node; +} sepp_event_t; + +OGS_STATIC_ASSERT(OGS_EVENT_SIZE >= sizeof(sepp_event_t)); + +sepp_event_t *sepp_event_new(int id); + +const char *sepp_event_get_name(sepp_event_t *e); + +#ifdef __cplusplus +} +#endif + +#endif /* SEPP_EVENT_H */ diff --git a/src/sepp/handshake-sm.c b/src/sepp/handshake-sm.c new file mode 100644 index 000000000..4d7d25570 --- /dev/null +++ b/src/sepp/handshake-sm.c @@ -0,0 +1,644 @@ +/* + * Copyright (C) 2023 by Sukchan Lee + * + * 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 . + */ + +#include "sbi-path.h" +#include "n32c-handler.h" + +void sepp_handshake_fsm_init(sepp_node_t *sepp_node, bool try_to_establish) +{ + sepp_event_t e; + + ogs_assert(sepp_node); + + memset(&e, 0, sizeof(e)); + e.sepp_node = sepp_node; + + if (try_to_establish == true) { + sepp_node->t_establish_interval = ogs_timer_add(ogs_app()->timer_mgr, + sepp_timer_peer_establish, sepp_node); + ogs_assert(sepp_node->t_establish_interval); + } + + ogs_fsm_init(&sepp_node->sm, + sepp_handshake_state_initial, sepp_handshake_state_final, &e); +} + +void sepp_handshake_fsm_fini(sepp_node_t *sepp_node) +{ + sepp_event_t e; + + ogs_assert(sepp_node); + + memset(&e, 0, sizeof(e)); + e.sepp_node = sepp_node; + + if (OGS_FSM_CHECK(&sepp_node->sm, sepp_handshake_state_established)) { + ogs_expect(true == + sepp_n32c_handshake_send_security_capability_request( + sepp_node, true)); + } + + ogs_fsm_fini(&sepp_node->sm, &e); + + if (sepp_node->t_establish_interval) + ogs_timer_delete(sepp_node->t_establish_interval); +} + +void sepp_handshake_state_initial(ogs_fsm_t *s, sepp_event_t *e) +{ + sepp_node_t *sepp_node = NULL; + + ogs_assert(s); + ogs_assert(e); + + sepp_node = e->sepp_node; + ogs_assert(sepp_node); + + OGS_FSM_TRAN(s, &sepp_handshake_state_will_establish); +} + +void sepp_handshake_state_final(ogs_fsm_t *s, sepp_event_t *e) +{ + ogs_assert(s); + ogs_assert(e); + + sepp_sm_debug(e); +} + +void sepp_handshake_state_will_establish(ogs_fsm_t *s, sepp_event_t *e) +{ + bool handled; + sepp_node_t *sepp_node = NULL; + + ogs_sbi_stream_t *stream = NULL; + ogs_sbi_message_t *message = NULL; + + ogs_assert(s); + ogs_assert(e); + + sepp_sm_debug(e); + + sepp_node = e->sepp_node; + ogs_assert(sepp_node); + + switch (e->h.id) { + case OGS_FSM_ENTRY_SIG: + if (sepp_node->t_establish_interval) { + ogs_timer_start(sepp_node->t_establish_interval, + ogs_local_conf()->time.message.sbi.reconnect_interval); + + ogs_expect(true == + sepp_n32c_handshake_send_security_capability_request( + sepp_node, false)); + } + break; + + case OGS_FSM_EXIT_SIG: + if (sepp_node->t_establish_interval) { + ogs_timer_stop(sepp_node->t_establish_interval); + } + break; + + case OGS_EVENT_SBI_SERVER: + message = e->h.sbi.message; + ogs_assert(message); + stream = e->h.sbi.data; + ogs_assert(stream); + + SWITCH(message->h.service.name) + CASE(OGS_SBI_SERVICE_NAME_N32C_HANDSHAKE) + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_EXCHANGE_CAPABILITY) + SWITCH(message->h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + handled = + sepp_n32c_handshake_handle_security_capability_request( + sepp_node, stream, message); + if (!handled) { + ogs_error("[%s] Cannot handle SBI message", + sepp_node->receiver); + OGS_FSM_TRAN(s, &sepp_handshake_state_exception); + break; + } + + if (sepp_node->negotiated_security_scheme == + OpenAPI_security_capability_TLS) { + + /* Change to ESTABLISHED */ + sepp_n32c_handshake_send_security_capability_response( + sepp_node, stream); + OGS_FSM_TRAN(s, &sepp_handshake_state_established); + + } else if (sepp_node->negotiated_security_scheme == + OpenAPI_security_capability_PRINS) { + + ogs_error("[%s] PRINS is not supported", + sepp_node->receiver); + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "PRINS is not supported", + sepp_node->receiver)); + + } else if (sepp_node->negotiated_security_scheme == + OpenAPI_security_capability_NONE) { + + /* No State Change */ + sepp_n32c_handshake_send_security_capability_response( + sepp_node, stream); + ogs_warn("[%s] SEPP has not been established", + sepp_node->receiver); + } + break; + DEFAULT + ogs_error("Invalid HTTP method [%s]", message->h.method); + END + break; + + DEFAULT + ogs_error("[%s] Invalid resource name [%s]", + sepp_node->receiver, message->h.resource.component[0]); + END + break; + + DEFAULT + ogs_error("[%s] Invalid API name [%s]", + sepp_node->receiver, message->h.service.name); + END + break; + + case OGS_EVENT_SBI_CLIENT: + message = e->h.sbi.message; + ogs_assert(message); + + SWITCH(message->h.service.name) + CASE(OGS_SBI_SERVICE_NAME_N32C_HANDSHAKE) + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_EXCHANGE_CAPABILITY) + SWITCH(message->h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + + if (message->res_status == OGS_SBI_HTTP_STATUS_OK) { + handled = sepp_n32c_handshake_handle_security_capability_response( + sepp_node, message); + if (!handled) { + ogs_error("[%s] Cannot handle SBI message", + sepp_node->receiver); + OGS_FSM_TRAN(s, &sepp_handshake_state_exception); + break; + } + + if (sepp_node->negotiated_security_scheme == + OpenAPI_security_capability_TLS) { + + /* Change to ESTABLISHED */ + OGS_FSM_TRAN(s, &sepp_handshake_state_established); + + } else if (sepp_node->negotiated_security_scheme == + OpenAPI_security_capability_PRINS) { + + ogs_error("[%s] PRINS is not supported", + sepp_node->receiver); + + } else if (sepp_node->negotiated_security_scheme == + OpenAPI_security_capability_NONE) { + + /* No State Change */ + ogs_warn("[%s] SEPP has not been established", + sepp_node->receiver); + } + } else { + ogs_error("[%s] HTTP Response Status Code [%d]", + sepp_node->receiver, message->res_status); + } + break; + + DEFAULT + ogs_error("Invalid HTTP method [%s]", message->h.method); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("[%s] Invalid resource name [%s]", + sepp_node->receiver, message->h.resource.component[0]); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("[%s] Invalid API name [%s]", + sepp_node->receiver, message->h.service.name); + ogs_assert_if_reached(); + END + break; + + case OGS_EVENT_SBI_TIMER: + switch(e->h.timer_id) { + case SEPP_TIMER_PEER_ESTABLISH: + ogs_warn("[%s] Retry establishment with Peer SEPP", + sepp_node->receiver); + + ogs_assert(sepp_node->t_establish_interval); + ogs_timer_start(sepp_node->t_establish_interval, + ogs_local_conf()->time.message.sbi.reconnect_interval); + + ogs_expect(true == + sepp_n32c_handshake_send_security_capability_request( + sepp_node, false)); + break; + + default: + ogs_error("Unknown timer[%s:%d]", + ogs_timer_get_name(e->h.timer_id), e->h.timer_id); + } + break; + + default: + ogs_error("Unknown event %s", sepp_event_get_name(e)); + break; + } +} + +void sepp_handshake_state_established(ogs_fsm_t *s, sepp_event_t *e) +{ + bool handled; + sepp_node_t *sepp_node = NULL; + + ogs_sbi_stream_t *stream = NULL; + ogs_sbi_message_t *message = NULL; + + ogs_assert(s); + ogs_assert(e); + + sepp_sm_debug(e); + + sepp_node = e->sepp_node; + ogs_assert(sepp_node); + + switch (e->h.id) { + case OGS_FSM_ENTRY_SIG: + ogs_info("[%s] SEPP established", sepp_node->receiver); + break; + + case OGS_FSM_EXIT_SIG: + ogs_info("[%s] SEPP terminated", sepp_node->receiver); + break; + + case OGS_EVENT_SBI_SERVER: + message = e->h.sbi.message; + ogs_assert(message); + stream = e->h.sbi.data; + ogs_assert(stream); + + SWITCH(message->h.service.name) + CASE(OGS_SBI_SERVICE_NAME_N32C_HANDSHAKE) + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_EXCHANGE_CAPABILITY) + SWITCH(message->h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + handled = + sepp_n32c_handshake_handle_security_capability_request( + sepp_node, stream, message); + if (!handled) { + ogs_error("[%s] Cannot handle SBI message", + sepp_node->receiver); + OGS_FSM_TRAN(s, &sepp_handshake_state_exception); + break; + } + + if (sepp_node->negotiated_security_scheme == + OpenAPI_security_capability_TLS) { + + /* No State Change */ + sepp_n32c_handshake_send_security_capability_response( + sepp_node, stream); + ogs_warn("[%s] SEPP has already been established", + sepp_node->receiver); + + } else if (sepp_node->negotiated_security_scheme == + OpenAPI_security_capability_PRINS) { + + ogs_error("[%s] PRINS is not supported", + sepp_node->receiver); + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "PRINS is not supported", + sepp_node->receiver)); + + } else if (sepp_node->negotiated_security_scheme == + OpenAPI_security_capability_NONE) { + + /* Change to TERMINATED */ + sepp_n32c_handshake_send_security_capability_response( + sepp_node, stream); + OGS_FSM_TRAN(s, &sepp_handshake_state_terminated); + } + break; + DEFAULT + ogs_error("Invalid HTTP method [%s]", message->h.method); + END + break; + + DEFAULT + ogs_error("[%s] Invalid resource name [%s]", + sepp_node->receiver, message->h.resource.component[0]); + END + break; + + DEFAULT + ogs_error("[%s] Invalid API name [%s]", + sepp_node->receiver, message->h.service.name); + END + break; + + case OGS_EVENT_SBI_CLIENT: + message = e->h.sbi.message; + ogs_assert(message); + + SWITCH(message->h.service.name) + CASE(OGS_SBI_SERVICE_NAME_N32C_HANDSHAKE) + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_EXCHANGE_CAPABILITY) + SWITCH(message->h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + if (message->res_status == OGS_SBI_HTTP_STATUS_OK) { + ogs_warn("[%s] SEPP has already been established", + sepp_node->receiver); + } else { + ogs_error("[%s] HTTP Response Status Code [%d]", + sepp_node->receiver, message->res_status); + } + break; + + DEFAULT + ogs_error("Invalid HTTP method [%s]", message->h.method); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("[%s] Invalid resource name [%s]", + sepp_node->receiver, message->h.resource.component[0]); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("[%s] Invalid API name [%s]", + sepp_node->receiver, message->h.service.name); + ogs_assert_if_reached(); + END + break; + + default: + ogs_error("Unknown event %s", sepp_event_get_name(e)); + break; + } +} + +void sepp_handshake_state_terminated(ogs_fsm_t *s, sepp_event_t *e) +{ + bool handled; + sepp_node_t *sepp_node = NULL; + + ogs_sbi_stream_t *stream = NULL; + ogs_sbi_message_t *message = NULL; + + ogs_assert(s); + ogs_assert(e); + + sepp_sm_debug(e); + + sepp_node = e->sepp_node; + ogs_assert(sepp_node); + + switch (e->h.id) { + case OGS_FSM_ENTRY_SIG: + if (sepp_node->t_establish_interval) { + ogs_timer_start(sepp_node->t_establish_interval, + ogs_local_conf()->time.message.sbi.reconnect_interval); + } + break; + + case OGS_FSM_EXIT_SIG: + if (sepp_node->t_establish_interval) { + ogs_timer_stop(sepp_node->t_establish_interval); + } + break; + + case OGS_EVENT_SBI_SERVER: + message = e->h.sbi.message; + ogs_assert(message); + stream = e->h.sbi.data; + ogs_assert(stream); + + SWITCH(message->h.service.name) + CASE(OGS_SBI_SERVICE_NAME_N32C_HANDSHAKE) + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_EXCHANGE_CAPABILITY) + SWITCH(message->h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + handled = + sepp_n32c_handshake_handle_security_capability_request( + sepp_node, stream, message); + if (!handled) { + ogs_error("[%s] Cannot handle SBI message", + sepp_node->receiver); + OGS_FSM_TRAN(s, &sepp_handshake_state_exception); + break; + } + + if (sepp_node->negotiated_security_scheme == + OpenAPI_security_capability_TLS) { + + /* Change to ESTABLISHED */ + sepp_n32c_handshake_send_security_capability_response( + sepp_node, stream); + OGS_FSM_TRAN(s, &sepp_handshake_state_established); + + } else if (sepp_node->negotiated_security_scheme == + OpenAPI_security_capability_PRINS) { + + ogs_error("[%s] PRINS is not supported", + sepp_node->receiver); + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, + message, "PRINS is not supported", + sepp_node->receiver)); + + } else if (sepp_node->negotiated_security_scheme == + OpenAPI_security_capability_NONE) { + + /* No State Change */ + sepp_n32c_handshake_send_security_capability_response( + sepp_node, stream); + ogs_warn("[%s] SEPP has not been established", + sepp_node->receiver); + } + break; + DEFAULT + ogs_error("Invalid HTTP method [%s]", message->h.method); + END + break; + + DEFAULT + ogs_error("[%s] Invalid resource name [%s]", + sepp_node->receiver, message->h.resource.component[0]); + END + break; + + DEFAULT + ogs_error("[%s] Invalid API name [%s]", + sepp_node->receiver, message->h.service.name); + END + break; + + case OGS_EVENT_SBI_CLIENT: + message = e->h.sbi.message; + ogs_assert(message); + + SWITCH(message->h.service.name) + CASE(OGS_SBI_SERVICE_NAME_N32C_HANDSHAKE) + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_EXCHANGE_CAPABILITY) + SWITCH(message->h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + if (message->res_status == OGS_SBI_HTTP_STATUS_OK) { + ogs_warn("[%s] SEPP was terminated", sepp_node->receiver); + } else { + ogs_error("[%s] HTTP Response Status Code [%d]", + sepp_node->receiver, message->res_status); + } + break; + + DEFAULT + ogs_error("Invalid HTTP method [%s]", message->h.method); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("[%s] Invalid resource name [%s]", + sepp_node->receiver, message->h.resource.component[0]); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("[%s] Invalid API name [%s]", + sepp_node->receiver, message->h.service.name); + ogs_assert_if_reached(); + END + break; + + case OGS_EVENT_SBI_TIMER: + switch(e->h.timer_id) { + case SEPP_TIMER_PEER_ESTABLISH: + ogs_warn("[%s] Retry establishment with Peer SEPP", + sepp_node->receiver); + + OGS_FSM_TRAN(s, &sepp_handshake_state_will_establish); + break; + + default: + ogs_error("Unknown timer[%s:%d]", + ogs_timer_get_name(e->h.timer_id), e->h.timer_id); + } + break; + + default: + ogs_error("Unknown event %s", sepp_event_get_name(e)); + break; + } +} + +void sepp_handshake_state_exception(ogs_fsm_t *s, sepp_event_t *e) +{ + sepp_node_t *sepp_node = NULL; + + ogs_sbi_message_t *message = NULL; + + ogs_assert(s); + ogs_assert(e); + + sepp_sm_debug(e); + + sepp_node = e->sepp_node; + ogs_assert(sepp_node); + + switch (e->h.id) { + case OGS_FSM_ENTRY_SIG: + if (sepp_node->t_establish_interval) { + ogs_timer_start(sepp_node->t_establish_interval, + ogs_local_conf()->time.message.sbi. + reconnect_interval_in_exception); + } + break; + + case OGS_FSM_EXIT_SIG: + if (sepp_node->t_establish_interval) { + ogs_timer_stop(sepp_node->t_establish_interval); + } + break; + + case OGS_EVENT_SBI_TIMER: + switch(e->h.timer_id) { + case SEPP_TIMER_PEER_ESTABLISH: + ogs_warn("[%s] Retry establishment with Peer SEPP", + sepp_node->receiver); + + OGS_FSM_TRAN(s, &sepp_handshake_state_will_establish); + break; + + default: + ogs_error("Unknown timer[%s:%d]", + ogs_timer_get_name(e->h.timer_id), e->h.timer_id); + } + break; + + case OGS_EVENT_SBI_SERVER: + case OGS_EVENT_SBI_CLIENT: + message = e->h.sbi.message; + ogs_assert(message); + + SWITCH(message->h.service.name) + CASE(OGS_SBI_SERVICE_NAME_N32C_HANDSHAKE) + + SWITCH(message->h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_EXCHANGE_CAPABILITY) + ogs_error("[%s] SEPP exception state", sepp_node->receiver); + break; + DEFAULT + ogs_error("Invalid resource name [%s]", + message->h.resource.component[0]); + END + break; + DEFAULT + ogs_error("Invalid API name [%s]", message->h.service.name); + END + break; + + default: + ogs_error("Unknown event %s", sepp_event_get_name(e)); + break; + } +} diff --git a/src/sepp/init.c b/src/sepp/init.c new file mode 100644 index 000000000..03c0154fd --- /dev/null +++ b/src/sepp/init.c @@ -0,0 +1,145 @@ +/* + * Copyright (C) 2023 by Sukchan Lee + * + * 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 . + */ + +#include "context.h" +#include "sbi-path.h" + +static ogs_thread_t *thread; +static void sepp_main(void *data); + +static int initialized = 0; + +int sepp_initialize(void) +{ + int rv; + +#define APP_NAME "sepp" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + + ogs_sbi_context_init(OpenAPI_nf_type_SEPP); + sepp_context_init(); + + rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp"); + if (rv != OGS_OK) return rv; + + rv = sepp_context_parse_config(); + if (rv != OGS_OK) return rv; + + rv = ogs_log_config_domain( + ogs_app()->logger.domain, ogs_app()->logger.level); + if (rv != OGS_OK) return rv; + + rv = sepp_sbi_open(); + if (rv != 0) return OGS_ERROR; + + thread = ogs_thread_create(sepp_main, NULL); + if (!thread) return OGS_ERROR; + + initialized = 1; + + return OGS_OK; +} + +static ogs_timer_t *t_termination_holding = NULL; + +static void event_termination(void) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + sepp_node_t *sepp_node = NULL; + + /* Sending NF Instance De-registeration to NRF */ + ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) + ogs_sbi_nf_fsm_fini(nf_instance); + + /* Sending N32 Termination to Peer SMF */ + ogs_list_for_each(&sepp_self()->peer_list, sepp_node) + sepp_handshake_fsm_fini(sepp_node); + + /* Starting holding timer */ + t_termination_holding = ogs_timer_add(ogs_app()->timer_mgr, NULL, NULL); + ogs_assert(t_termination_holding); +#define TERMINATION_HOLDING_TIME ogs_time_from_msec(300) + ogs_timer_start(t_termination_holding, TERMINATION_HOLDING_TIME); + + /* Sending termination event to the queue */ + ogs_queue_term(ogs_app()->queue); + ogs_pollset_notify(ogs_app()->pollset); +} + +void sepp_terminate(void) +{ + if (!initialized) return; + + /* Daemon terminating */ + event_termination(); + ogs_thread_destroy(thread); + ogs_timer_delete(t_termination_holding); + + sepp_sbi_close(); + + sepp_context_final(); + ogs_sbi_context_final(); +} + +static void sepp_main(void *data) +{ + ogs_fsm_t sepp_sm; + int rv; + + ogs_fsm_init(&sepp_sm, sepp_state_initial, sepp_state_final, 0); + + for ( ;; ) { + ogs_pollset_poll(ogs_app()->pollset, + ogs_timer_mgr_next(ogs_app()->timer_mgr)); + + /* + * After ogs_pollset_poll(), ogs_timer_mgr_expire() must be called. + * + * The reason is why ogs_timer_mgr_next() can get the corrent value + * when ogs_timer_stop() is called internally in ogs_timer_mgr_expire(). + * + * You should not use event-queue before ogs_timer_mgr_expire(). + * In this case, ogs_timer_mgr_expire() does not work + * because 'if rv == OGS_DONE' statement is exiting and + * not calling ogs_timer_mgr_expire(). + */ + ogs_timer_mgr_expire(ogs_app()->timer_mgr); + + for ( ;; ) { + sepp_event_t *e = NULL; + + rv = ogs_queue_trypop(ogs_app()->queue, (void**)&e); + ogs_assert(rv != OGS_ERROR); + + if (rv == OGS_DONE) + goto done; + + if (rv == OGS_RETRY) + break; + + ogs_assert(e); + ogs_fsm_dispatch(&sepp_sm, e); + ogs_event_free(e); + } + } +done: + + ogs_fsm_fini(&sepp_sm, 0); +} diff --git a/src/sepp/meson.build b/src/sepp/meson.build new file mode 100644 index 000000000..47029954f --- /dev/null +++ b/src/sepp/meson.build @@ -0,0 +1,56 @@ +# Copyright (C) 2023 by Sukchan Lee + +# 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 . + +libsepp_sources = files(''' + context.c + event.c + timer.c + + n32c-build.c + n32c-handler.c + + handshake-sm.c + + sbi-path.c + sepp-sm.c + + init.c +'''.split()) + +libsepp = static_library('sepp', + sources : libsepp_sources, + dependencies : [libcrypt_dep, + libsbi_dep], + install : false) + +libsepp_dep = declare_dependency( + link_with : libsepp, + dependencies : [libcrypt_dep, + libsbi_dep]) + +sepp_sources = files(''' + app.c + ../main.c +'''.split()) + +executable('open5gs-seppd', + sources : sepp_sources, + c_args : '-DDEFAULT_CONFIG_FILENAME="@0@/sepp.yaml"'.format(open5gs_sysconfdir), + include_directories : srcinc, + dependencies : libsepp_dep, + install_rpath : libdir, + install : true) diff --git a/src/sepp/n32c-build.c b/src/sepp/n32c-build.c new file mode 100644 index 000000000..246ca41cc --- /dev/null +++ b/src/sepp/n32c-build.c @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2023 by Sukchan Lee + * + * 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 . + */ + +#include "n32c-build.h" + +ogs_sbi_request_t *sepp_n32c_handshake_build_security_capability_request( + sepp_node_t *sepp_node, bool none) +{ + ogs_sbi_message_t message; + ogs_sbi_request_t *request = NULL; + + OpenAPI_sec_negotiate_req_data_t SecNegotiateReqData; + OpenAPI_list_t *SupportedSecCapabilityList = NULL; + + OpenAPI_list_t *PlmnIdList = NULL; + OpenAPI_plmn_id_t *PlmnId = NULL; + + int i; + OpenAPI_lnode_t *node = NULL; + + ogs_assert(sepp_self()->sender); + ogs_assert(sepp_node); + + memset(&message, 0, sizeof(message)); + message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST; + message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_N32C_HANDSHAKE; + message.h.api.version = (char *)OGS_SBI_API_V1; + message.h.resource.component[0] = + (char *)OGS_SBI_RESOURCE_NAME_EXCHANGE_CAPABILITY; + + memset(&SecNegotiateReqData, 0, sizeof(SecNegotiateReqData)); + SecNegotiateReqData.sender = sepp_self()->sender; + + SupportedSecCapabilityList = OpenAPI_list_create(); + if (!SupportedSecCapabilityList) { + ogs_error("No SupportedSecCapabilityList"); + goto end; + } + + if (none == false) { + if (sepp_self()->security_capability.tls == true) + OpenAPI_list_add(SupportedSecCapabilityList, + (void *)OpenAPI_security_capability_TLS); + if (sepp_self()->security_capability.prins == true) + OpenAPI_list_add(SupportedSecCapabilityList, + (void *)OpenAPI_security_capability_PRINS); + } else { + OpenAPI_list_add(SupportedSecCapabilityList, + (void *)OpenAPI_security_capability_NONE); + } + + ogs_assert(SupportedSecCapabilityList->count); + SecNegotiateReqData.supported_sec_capability_list = + SupportedSecCapabilityList; + + if (none == false) { + if (sepp_self()->target_apiroot_supported == true) { + SecNegotiateReqData.is__3_gpp_sbi_target_api_root_supported = true; + SecNegotiateReqData._3_gpp_sbi_target_api_root_supported = 1; + } + } + + PlmnIdList = OpenAPI_list_create(); + if (!PlmnIdList) { + ogs_error("No PlmnIdList"); + goto end; + } + + for (i = 0; i < ogs_local_conf()->num_of_serving_plmn_id; i++) { + PlmnId = ogs_sbi_build_plmn_id(&ogs_local_conf()->serving_plmn_id[i]); + ogs_assert(PlmnId); + OpenAPI_list_add(PlmnIdList, PlmnId); + } + + if (PlmnIdList->count) + SecNegotiateReqData.plmn_id_list = PlmnIdList; + else + OpenAPI_list_free(PlmnIdList); + + if (sepp_node->target_plmn_id_presence) + SecNegotiateReqData.target_plmn_id = + ogs_sbi_build_plmn_id(&sepp_node->target_plmn_id); + + OGS_SBI_FEATURES_SET(sepp_node->supported_features, + OGS_SBI_N32_HANDSHAKE_NFTLST); + SecNegotiateReqData.supported_features = + ogs_uint64_to_string(sepp_node->supported_features); + if (!SecNegotiateReqData.supported_features) { + ogs_error("No supported_features"); + goto end; + } + + message.SecNegotiateReqData = &SecNegotiateReqData; + + request = ogs_sbi_build_request(&message); + ogs_expect(request); + +end: + OpenAPI_list_free(SecNegotiateReqData.supported_sec_capability_list); + OpenAPI_list_for_each(SecNegotiateReqData.plmn_id_list, node) { + PlmnId = node->data; + if (PlmnId) + ogs_sbi_free_plmn_id(PlmnId); + } + OpenAPI_list_free(SecNegotiateReqData.plmn_id_list); + if (SecNegotiateReqData.target_plmn_id) + ogs_sbi_free_plmn_id(SecNegotiateReqData.target_plmn_id); + if (SecNegotiateReqData.supported_features) + ogs_free(SecNegotiateReqData.supported_features); + + return request; +} diff --git a/lib/dbi/timer.h b/src/sepp/n32c-build.h similarity index 73% rename from lib/dbi/timer.h rename to src/sepp/n32c-build.h index 8928ab349..ce66bc941 100644 --- a/lib/dbi/timer.h +++ b/src/sepp/n32c-build.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -17,17 +17,20 @@ * along with this program. If not, see . */ -#ifndef OGS_DBI_TIMER_H -#define OGS_DBI_TIMER_H +#ifndef SEPP_N32C_BUILD_H +#define SEPP_N32C_BUILD_H + +#include "context.h" #ifdef __cplusplus extern "C" { #endif -void ogs_timer_dbi_poll_change_stream(void *data); +ogs_sbi_request_t *sepp_n32c_handshake_build_security_capability_request( + sepp_node_t *sepp_node, bool none); #ifdef __cplusplus } #endif -#endif /* OGS_DBI_TIMER_H */ +#endif /* SEPP_N32C_BUILD_H */ diff --git a/src/sepp/n32c-handler.c b/src/sepp/n32c-handler.c new file mode 100644 index 000000000..75af2e0f1 --- /dev/null +++ b/src/sepp/n32c-handler.c @@ -0,0 +1,201 @@ +/* + * Copyright (C) 2023 by Sukchan Lee + * + * 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 . + */ + +#include "sbi-path.h" + +#include "n32c-handler.h" + +bool sepp_n32c_handshake_handle_security_capability_request( + sepp_node_t *sepp_node, + ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg) +{ + OpenAPI_sec_negotiate_req_data_t *SecNegotiateReqData = NULL; + + OpenAPI_lnode_t *node = NULL; + bool tls = false, prins = false, none = false; + + ogs_assert(sepp_node); + ogs_assert(stream); + ogs_assert(recvmsg); + + SecNegotiateReqData = recvmsg->SecNegotiateReqData; + if (!SecNegotiateReqData) { + ogs_error("[%s] No SecNegotiateReqData", sepp_node->receiver); + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No SecNegotiateReqData", sepp_node->receiver)); + return false; + } + + if (!SecNegotiateReqData->sender) { + ogs_error("[%s] No SecNegotiateReqData.sender", sepp_node->receiver); + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No SecNegotiateReqData.sender", sepp_node->receiver)); + return false; + } + + ogs_assert(sepp_node->receiver); + if (strcmp(SecNegotiateReqData->sender, sepp_node->receiver) != 0) { + ogs_error("[%s] FQDN mismatch Sender [%s]", + sepp_node->receiver, SecNegotiateReqData->sender); + return false; + } + + if (!SecNegotiateReqData->supported_sec_capability_list) { + ogs_error("[%s] No supported_sec_capability_list", sepp_node->receiver); + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No supported_sec_capability_list", + sepp_node->receiver)); + return false; + } + + OpenAPI_list_for_each( + SecNegotiateReqData->supported_sec_capability_list, node) { + OpenAPI_security_capability_e security_capability = + (uintptr_t)node->data; + if (security_capability == OpenAPI_security_capability_TLS) + tls = true; + else if (security_capability == OpenAPI_security_capability_PRINS) + prins = true; + else if (security_capability == OpenAPI_security_capability_NONE) + none = true; + } + + if (none == true) { + sepp_node->negotiated_security_scheme = + OpenAPI_security_capability_NONE; + } else if (tls == true && sepp_self()->security_capability.tls == true) { + sepp_node->negotiated_security_scheme = + OpenAPI_security_capability_TLS; + } else if (prins == true && + sepp_self()->security_capability.prins == true) { + sepp_node->negotiated_security_scheme = + OpenAPI_security_capability_PRINS; + } else { + OpenAPI_list_for_each( + SecNegotiateReqData->supported_sec_capability_list, node) { + OpenAPI_security_capability_e security_capability = + (uintptr_t)node->data; + ogs_error("[%s] Unknown SupportedSecCapability [%d]", + sepp_node->receiver, security_capability); + } + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "Unknown SupportedSecCapability", + sepp_node->receiver)); + return false; + } + + if (SecNegotiateReqData->is__3_gpp_sbi_target_api_root_supported == true && + SecNegotiateReqData->_3_gpp_sbi_target_api_root_supported == 1) + sepp_node->target_apiroot_supported = true; + + sepp_node->num_of_plmn_id = 0; + OpenAPI_list_for_each(SecNegotiateReqData->plmn_id_list, node) { + OpenAPI_plmn_id_t *PlmnId = node->data; + if (PlmnId) { + ogs_sbi_parse_plmn_id( + &sepp_node->plmn_id[sepp_node->num_of_plmn_id], PlmnId); + sepp_node->num_of_plmn_id++; + } + } + + if (SecNegotiateReqData->target_plmn_id) { + ogs_sbi_parse_plmn_id( + &sepp_node->target_plmn_id, SecNegotiateReqData->target_plmn_id); + sepp_node->target_plmn_id_presence = true; + } + + if (SecNegotiateReqData->supported_features) { + uint64_t supported_features = + ogs_uint64_from_string(SecNegotiateReqData->supported_features); + sepp_node->supported_features &= supported_features; + } else { + sepp_node->supported_features = 0; + } + + return true; +} + +bool sepp_n32c_handshake_handle_security_capability_response( + sepp_node_t *sepp_node, ogs_sbi_message_t *recvmsg) +{ + OpenAPI_sec_negotiate_rsp_data_t *SecNegotiateRspData = NULL; + + OpenAPI_lnode_t *node = NULL; + + ogs_assert(sepp_node); + ogs_assert(recvmsg); + + SecNegotiateRspData = recvmsg->SecNegotiateRspData; + if (!SecNegotiateRspData) { + ogs_error("[%s] No SecNegotiateRspData", sepp_node->receiver); + return false; + } + + if (!SecNegotiateRspData->sender) { + ogs_error("[%s] No SecNegotiateRspData.sender", sepp_node->receiver); + return false; + } + + ogs_assert(sepp_node->receiver); + if (strcmp(SecNegotiateRspData->sender, sepp_node->receiver) != 0) { + ogs_error("[%s] FQDN mismatch Sender [%s]", + sepp_node->receiver, SecNegotiateRspData->sender); + return false; + } + + if (!SecNegotiateRspData->selected_sec_capability) { + ogs_error("[%s] No selected_sec_capability", sepp_node->receiver); + return false; + } + + sepp_node->negotiated_security_scheme = + SecNegotiateRspData->selected_sec_capability; + + if (SecNegotiateRspData->is__3_gpp_sbi_target_api_root_supported == true && + SecNegotiateRspData->_3_gpp_sbi_target_api_root_supported == 1) + sepp_node->target_apiroot_supported = true; + + sepp_node->num_of_plmn_id = 0; + OpenAPI_list_for_each(SecNegotiateRspData->plmn_id_list, node) { + OpenAPI_plmn_id_t *PlmnId = node->data; + if (PlmnId) { + ogs_sbi_parse_plmn_id( + &sepp_node->plmn_id[sepp_node->num_of_plmn_id], PlmnId); + sepp_node->num_of_plmn_id++; + } + } + + if (SecNegotiateRspData->supported_features) { + uint64_t supported_features = + ogs_uint64_from_string(SecNegotiateRspData->supported_features); + sepp_node->supported_features &= supported_features; + } else { + sepp_node->supported_features = 0; + } + + return true; +} diff --git a/src/sepp/n32c-handler.h b/src/sepp/n32c-handler.h new file mode 100644 index 000000000..3f6fed403 --- /dev/null +++ b/src/sepp/n32c-handler.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2023 by Sukchan Lee + * + * 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 . + */ + +#ifndef SEPP_N32C_HANDLER_H +#define SEPP_N32C_HANDLER_H + +#include "context.h" + +#ifdef __cplusplus +extern "C" { +#endif + +bool sepp_n32c_handshake_handle_security_capability_request( + sepp_node_t *sepp_node, + ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg); +bool sepp_n32c_handshake_handle_security_capability_response( + sepp_node_t *sepp_node, ogs_sbi_message_t *recvmsg); + +#ifdef __cplusplus +} +#endif + +#endif /* SEPP_N32C_HANDLER_H */ diff --git a/src/sepp/sbi-path.c b/src/sepp/sbi-path.c new file mode 100644 index 000000000..6c0b5c8a2 --- /dev/null +++ b/src/sepp/sbi-path.c @@ -0,0 +1,493 @@ +/* + * Copyright (C) 2023 by Sukchan Lee + * + * 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 . + */ + +#include "sbi-path.h" + +static int request_handler(ogs_sbi_request_t *request, void *data); +static int response_handler( + int status, ogs_sbi_response_t *response, void *data); + +static void copy_request( + ogs_sbi_request_t *target, ogs_sbi_request_t *source, + bool include_discovery); + +int sepp_sbi_open(void) +{ + ogs_sbi_nf_instance_t *nf_instance = NULL; + + /* Initialize SELF NF instance */ + nf_instance = ogs_sbi_self()->nf_instance; + ogs_assert(nf_instance); + ogs_sbi_nf_fsm_init(nf_instance); + + /* Build NF instance information. It will be transmitted to NRF. */ + ogs_sbi_nf_instance_build_default(nf_instance); + + /* Initialize NRF NF Instance */ + nf_instance = ogs_sbi_self()->nrf_instance; + if (nf_instance) + ogs_sbi_nf_fsm_init(nf_instance); + + if (ogs_sbi_server_start_all(request_handler) != OGS_OK) + return OGS_ERROR; + + return OGS_OK; +} + +void sepp_sbi_close(void) +{ + ogs_sbi_client_stop_all(); + ogs_sbi_server_stop_all(); +} + +bool sepp_n32c_handshake_send_security_capability_request( + sepp_node_t *sepp_node, bool none) +{ + bool rc; + ogs_sbi_request_t *request = NULL; + ogs_sbi_client_t *client = NULL; + + ogs_assert(sepp_node); + client = sepp_node->client; + if (!client) { + ogs_error("No Client"); + return false; + } + + request = sepp_n32c_handshake_build_security_capability_request( + sepp_node, none); + if (!request) { + ogs_error("sepp_n32c_handshake_build_exchange_capability() failed"); + return false; + } + + rc = ogs_sbi_client_send_request( + client, ogs_sbi_client_handler, request, sepp_node); + ogs_expect(rc == true); + + ogs_sbi_request_free(request); + + return rc; +} + +void sepp_n32c_handshake_send_security_capability_response( + sepp_node_t *sepp_node, ogs_sbi_stream_t *stream) +{ + ogs_sbi_message_t sendmsg; + ogs_sbi_response_t *response = NULL; + + OpenAPI_sec_negotiate_rsp_data_t SecNegotiateRspData; + + OpenAPI_list_t *PlmnIdList = NULL; + OpenAPI_plmn_id_t *PlmnId = NULL; + + int i; + OpenAPI_lnode_t *node = NULL; + + ogs_assert(sepp_self()->sender); + ogs_assert(sepp_node); + ogs_assert(stream); + + memset(&SecNegotiateRspData, 0, sizeof(SecNegotiateRspData)); + SecNegotiateRspData.sender = sepp_self()->sender; + SecNegotiateRspData.selected_sec_capability = + sepp_node->negotiated_security_scheme; + + if (SecNegotiateRspData.selected_sec_capability != + OpenAPI_security_capability_NONE) { + if (sepp_node->target_apiroot_supported == true) { + SecNegotiateRspData.is__3_gpp_sbi_target_api_root_supported = true; + SecNegotiateRspData._3_gpp_sbi_target_api_root_supported = 1; + } + } + + PlmnIdList = OpenAPI_list_create(); + ogs_assert(PlmnIdList); + + for (i = 0; i < ogs_local_conf()->num_of_serving_plmn_id; i++) { + PlmnId = ogs_sbi_build_plmn_id(&ogs_local_conf()->serving_plmn_id[i]); + ogs_assert(PlmnId); + OpenAPI_list_add(PlmnIdList, PlmnId); + } + + if (PlmnIdList->count) + SecNegotiateRspData.plmn_id_list = PlmnIdList; + else + OpenAPI_list_free(PlmnIdList); + + SecNegotiateRspData.supported_features = + ogs_uint64_to_string(sepp_node->supported_features); + ogs_assert(SecNegotiateRspData.supported_features); + + memset(&sendmsg, 0, sizeof(sendmsg)); + sendmsg.SecNegotiateRspData = &SecNegotiateRspData; + + response = ogs_sbi_build_response(&sendmsg, OGS_SBI_HTTP_STATUS_OK); + ogs_assert(response); + ogs_assert(true == ogs_sbi_server_send_response(stream, response)); + + OpenAPI_list_for_each(SecNegotiateRspData.plmn_id_list, node) { + PlmnId = node->data; + if (PlmnId) + ogs_sbi_free_plmn_id(PlmnId); + } + OpenAPI_list_free(SecNegotiateRspData.plmn_id_list); + if (SecNegotiateRspData.supported_features) + ogs_free(SecNegotiateRspData.supported_features); +} + +static int request_handler(ogs_sbi_request_t *request, void *data) +{ + int rv; + ogs_hash_index_t *hi; + ogs_sbi_client_t *client = NULL, *scp_client = NULL; + ogs_sbi_stream_t *stream = data; + ogs_sbi_server_t *server = NULL; + + ogs_sbi_request_t sepp_request; + char *apiroot = NULL, *newuri = NULL; + + sepp_assoc_t *assoc = NULL; + + struct { + char *target_apiroot; + char *callback; + char *nrf_uri; + } headers = { + NULL, NULL, NULL + }; + + sepp_event_t *e = NULL; + + ogs_assert(request); + ogs_assert(request->h.uri); + ogs_assert(stream); + server = ogs_sbi_server_from_stream(stream); + ogs_assert(server); + + /* Extract HTTP Header */ + for (hi = ogs_hash_first(request->http.headers); + hi; hi = ogs_hash_next(hi)) { + char *key = (char *)ogs_hash_this_key(hi); + char *val = ogs_hash_this_val(hi); + + if (!key || !val) { + ogs_error("No Key[%s] Value[%s]", key, val); + continue; + } + + /* + * + * Each header field consists of a name followed by a colon (":") + * and the field value. Field names are case-insensitive. + */ + if (!strcasecmp(key, OGS_SBI_CUSTOM_TARGET_APIROOT)) { + headers.target_apiroot = val; + } + } + + if (headers.target_apiroot) { + bool rc; + sepp_node_t *sepp_node = NULL; + bool do_not_remove_custom_header; + + assoc = sepp_assoc_add(stream); + if (!assoc) { + ogs_error("sepp_assoc_add() failed"); + return OGS_ERROR; + } + + do_not_remove_custom_header = true; + + if (ogs_sbi_fqdn_in_vplmn(headers.target_apiroot) == true) { + uint16_t mcc = 0, mnc = 0; + + if (server->interface) { + ogs_error("[DROP] Peer SEPP is using " + "the wrong interface[%s]", server->interface); + sepp_assoc_remove(assoc); + return OGS_ERROR; + } + + mcc = ogs_plmn_id_mcc_from_fqdn(headers.target_apiroot); + ogs_assert(mcc); + mnc = ogs_plmn_id_mnc_from_fqdn(headers.target_apiroot); + ogs_assert(mnc); + + /* + * Different PLMN : FROM c-SEPP TO p-SEPP + */ + sepp_node = sepp_node_find_by_plmn_id(mcc, mnc); + if (!sepp_node) { + ogs_error("Cannot find SEPP Peer Node [%s:%d:%d]", + headers.target_apiroot, mcc, mnc); + sepp_assoc_remove(assoc); + return OGS_ERROR; + } + + client = NF_INSTANCE_CLIENT(&sepp_node->n32f); + if (!client) { + client = NF_INSTANCE_CLIENT(sepp_node); + if (!client) { + ogs_error("No Client in SEPP Peer Node [%s:%d:%d]", + headers.target_apiroot, mcc, mnc); + sepp_assoc_remove(assoc); + return OGS_ERROR; + } + } + + /* Client ApiRoot */ + apiroot = ogs_sbi_client_apiroot(client); + ogs_assert(apiroot); + + } else { + /* + * Same PLMN : From p-SEPP to NF via SCP + */ + OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; + char *fqdn = NULL; + uint16_t fqdn_port = 0; + ogs_sockaddr_t *addr = NULL, *addr6 = NULL; + + if (server->interface == NULL) { + if (ogs_sbi_server_first_by_interface( + OGS_SBI_INTERFACE_NAME_SEPP) || + ogs_sbi_server_first_by_interface( + OGS_SBI_INTERFACE_NAME_N32F)) { + ogs_error("[DROP] Peer SEPP is using " + "the wrong interface[%s]", server->interface); + sepp_assoc_remove(assoc); + return OGS_ERROR; + } + } else { + if (strcmp(server->interface, + OGS_SBI_INTERFACE_NAME_SEPP) == 0) { + if (ogs_sbi_server_first_by_interface( + OGS_SBI_INTERFACE_NAME_N32F)) { + ogs_error("[DROP] Peer SEPP is using " + "the wrong interface[%s]", server->interface); + sepp_assoc_remove(assoc); + return OGS_ERROR; + } + } + } + + /* Find or Add Client Instance */ + rc = ogs_sbi_getaddr_from_uri( + &scheme, &fqdn, &fqdn_port, &addr, &addr6, + headers.target_apiroot); + if (rc == false || scheme == OpenAPI_uri_scheme_NULL) { + ogs_error("Invalid Target-apiRoot [%s]", + headers.target_apiroot); + + sepp_assoc_remove(assoc); + return OGS_ERROR; + } + + client = ogs_sbi_client_find( + scheme, fqdn, fqdn_port, addr, addr6); + if (!client) { + client = ogs_sbi_client_add( + scheme, fqdn, fqdn_port, addr, addr6); + ogs_assert(client); + } + OGS_SBI_SETUP_CLIENT(assoc, client); + + ogs_free(fqdn); + ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); + + /* Get SCP client */ + scp_client = NF_INSTANCE_CLIENT(ogs_sbi_self()->scp_instance); + + /* Client ApiRoot */ + if (scp_client) { + apiroot = ogs_sbi_client_apiroot(scp_client); + ogs_assert(apiroot); + + /* Switch to the SCP's client */ + client = scp_client; + } else { + apiroot = ogs_sbi_client_apiroot(client); + ogs_assert(apiroot); + + /* Remove Target-apiRoot */ + do_not_remove_custom_header = false; + } + } + + /* Setup New URI */ + newuri = ogs_msprintf("%s%s", apiroot, request->h.uri); + ogs_assert(newuri); + + ogs_free(apiroot); + + /* Copy Request for SEPP request */ + copy_request(&sepp_request, request, do_not_remove_custom_header); + ogs_assert(sepp_request.http.headers); + + /* Set New URI to SEPP request */ + sepp_request.h.uri = newuri; + ogs_assert(sepp_request.h.uri); + + /* Send the HTTP Request with New URI and HTTP Headers */ + if (scp_client) { + rc = ogs_sbi_client_send_via_scp_or_sepp( + scp_client, response_handler, &sepp_request, assoc); + ogs_expect(rc == true); + } else { + rc = ogs_sbi_client_send_request( + client, response_handler, &sepp_request, assoc); + ogs_expect(rc == true); + } + + if (rc == false) { + ogs_error("ogs_sbi_send_request_to_client() failed"); + + ogs_sbi_http_hash_free(sepp_request.http.headers); + ogs_free(sepp_request.h.uri); + sepp_assoc_remove(assoc); + + return OGS_ERROR; + } + + ogs_sbi_http_hash_free(sepp_request.http.headers); + ogs_free(sepp_request.h.uri); + + return OGS_OK; + } + + /*************************************** + * Receive NOTIFICATION message from NRF + ***************************************/ + ogs_assert(request); + ogs_assert(data); + + if (server->interface && + strcmp(server->interface, OGS_SBI_INTERFACE_NAME_N32F) == 0) { + ogs_error("[DROP] Peer SEPP is using the wrong interface[%s]", + server->interface); + return OGS_ERROR; + } + + e = sepp_event_new(OGS_EVENT_SBI_SERVER); + ogs_assert(e); + + e->h.sbi.request = request; + e->h.sbi.data = data; + + rv = ogs_queue_push(ogs_app()->queue, e); + if (rv != OGS_OK) { + ogs_error("ogs_queue_push() failed:%d", (int)rv); + + ogs_event_free(e); + return OGS_ERROR; + } + + return OGS_OK; +} + +static int response_handler( + int status, ogs_sbi_response_t *response, void *data) +{ + sepp_assoc_t *assoc = data; + ogs_sbi_stream_t *stream = NULL; + + ogs_assert(assoc); + stream = assoc->stream; + ogs_assert(stream); + + if (status != OGS_OK) { + + ogs_log_message( + status == OGS_DONE ? OGS_LOG_DEBUG : OGS_LOG_WARN, 0, + "response_handler() failed [%d]", status); + + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_INTERNAL_SERVER_ERROR, NULL, + "response_handler() failed", NULL)); + + sepp_assoc_remove(assoc); + + return OGS_ERROR; + } + + ogs_assert(response); + + ogs_expect(true == ogs_sbi_server_send_response(stream, response)); + sepp_assoc_remove(assoc); + + return OGS_OK; +} + +static void copy_request( + ogs_sbi_request_t *target, ogs_sbi_request_t *source, + bool do_not_remove_custom_header) +{ + ogs_hash_index_t *hi; + + ogs_assert(source); + ogs_assert(target); + + memset(target, 0, sizeof(*target)); + + /* HTTP method/params/content */ + target->h.method = source->h.method; + target->http.params = source->http.params; + target->http.content = source->http.content; + target->http.content_length = source->http.content_length; + + /* HTTP Headers + * + * To remove the followings, + * Scheme - https + * Authority - sepp.open5gs.org + */ + target->http.headers = ogs_hash_make(); + ogs_assert(target->http.headers); + + /* Extract HTTP Header */ + for (hi = ogs_hash_first(source->http.headers); + hi; hi = ogs_hash_next(hi)) { + char *key = (char *)ogs_hash_this_key(hi); + char *val = ogs_hash_this_val(hi); + + if (!key || !val) { + ogs_error("No Key[%s] Value[%s]", key, val); + continue; + } + + /* + * + * Each header field consists of a name followed by a colon (":") + * and the field value. Field names are case-insensitive. + */ + if (do_not_remove_custom_header == false && + !strcasecmp(key, OGS_SBI_CUSTOM_TARGET_APIROOT)) { + } else if (do_not_remove_custom_header == false && + !strncasecmp(key, OGS_SBI_CUSTOM_DISCOVERY_COMMON, + strlen(OGS_SBI_CUSTOM_DISCOVERY_COMMON))) { + } else if (!strcasecmp(key, OGS_SBI_SCHEME)) { + } else if (!strcasecmp(key, OGS_SBI_AUTHORITY)) { + } else { + ogs_sbi_header_set(target->http.headers, key, val); + } + } +} diff --git a/src/sepp/sbi-path.h b/src/sepp/sbi-path.h new file mode 100644 index 000000000..cd77dc5ea --- /dev/null +++ b/src/sepp/sbi-path.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 by Sukchan Lee + * + * 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 . + */ + +#ifndef SEPP_SBI_PATH_H +#define SEPP_SBI_PATH_H + +#include "n32c-build.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int sepp_sbi_open(void); +void sepp_sbi_close(void); + +bool sepp_n32c_handshake_send_security_capability_request( + sepp_node_t *sepp_node, bool none); +void sepp_n32c_handshake_send_security_capability_response( + sepp_node_t *sepp_node, ogs_sbi_stream_t *stream); + +#ifdef __cplusplus +} +#endif + +#endif /* SEPP_SBI_PATH_H */ diff --git a/src/sepp/sepp-sm.c b/src/sepp/sepp-sm.c new file mode 100644 index 000000000..835d972ec --- /dev/null +++ b/src/sepp/sepp-sm.c @@ -0,0 +1,421 @@ +/* + * Copyright (C) 2023 by Sukchan Lee + * + * 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 . + */ + +#include "sbi-path.h" + +void sepp_state_initial(ogs_fsm_t *s, sepp_event_t *e) +{ + sepp_sm_debug(e); + + ogs_assert(s); + + OGS_FSM_TRAN(s, &sepp_state_operational); +} + +void sepp_state_final(ogs_fsm_t *s, sepp_event_t *e) +{ + sepp_sm_debug(e); + + ogs_assert(s); +} + +void sepp_state_operational(ogs_fsm_t *s, sepp_event_t *e) +{ + int rv; + + sepp_node_t *sepp_node = NULL; + + ogs_sbi_stream_t *stream = NULL; + ogs_sbi_request_t *request = NULL; + ogs_sbi_server_t *server = NULL; + + ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_subscription_data_t *subscription_data = NULL; + ogs_sbi_response_t *response = NULL; + ogs_sbi_message_t message; + + sepp_sm_debug(e); + + ogs_assert(s); + + switch (e->h.id) { + case OGS_FSM_ENTRY_SIG: + break; + + case OGS_FSM_EXIT_SIG: + break; + + case OGS_EVENT_SBI_SERVER: + request = e->h.sbi.request; + ogs_assert(request); + stream = e->h.sbi.data; + ogs_assert(stream); + server = ogs_sbi_server_from_stream(stream); + ogs_assert(server); + + rv = ogs_sbi_parse_request(&message, request); + if (rv != OGS_OK) { + /* 'sbi_message' buffer is released in ogs_sbi_parse_request() */ + ogs_error("cannot parse HTTP sbi_message"); + ogs_assert(true == + ogs_sbi_server_send_error( + stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + NULL, "cannot parse HTTP sbi_message", NULL)); + break; + } + + if (strcmp(message.h.api.version, OGS_SBI_API_V1) != 0) { + ogs_error("Not supported version [%s]", message.h.api.version); + ogs_assert(true == + ogs_sbi_server_send_error( + stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + &message, "Not supported version", NULL)); + ogs_sbi_message_free(&message); + break; + } + + SWITCH(message.h.service.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) + if (server->interface && + strcmp(server->interface, OGS_SBI_INTERFACE_NAME_SEPP) == 0) { + ogs_error("[DROP] Peer SEPP is using the wrong interface[%s]", + server->interface); + break; + } + + SWITCH(message.h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY) + SWITCH(message.h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + ogs_nnrf_nfm_handle_nf_status_notify(stream, &message); + break; + + DEFAULT + ogs_error("Invalid HTTP method [%s]", message.h.method); + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_FORBIDDEN, &message, + "Invalid HTTP method", message.h.method)); + END + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + message.h.resource.component[0]); + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, + "Invalid resource name", + message.h.resource.component[0])); + END + break; + + CASE(OGS_SBI_SERVICE_NAME_N32C_HANDSHAKE) + if (!server->interface && + ogs_sbi_server_first_by_interface( + OGS_SBI_INTERFACE_NAME_SEPP)) { + ogs_error("[DROP] Peer SEPP is using the wrong interface[sbi]"); + break; + } + + SWITCH(message.h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_EXCHANGE_CAPABILITY) + SWITCH(message.h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + if (message.SecNegotiateReqData && + message.SecNegotiateReqData->sender) { + sepp_node = sepp_node_find_by_receiver( + message.SecNegotiateReqData->sender); + if (!sepp_node) { + sepp_node = sepp_node_add( + message.SecNegotiateReqData->sender); + ogs_assert(sepp_node); + + sepp_handshake_fsm_init(sepp_node, false); + } + } + break; + + DEFAULT + ogs_error("Invalid HTTP method [%s]", message.h.method); + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_FORBIDDEN, &message, + "Invalid HTTP method", message.h.method)); + END + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + message.h.resource.component[0]); + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, + "Invalid resource name", + message.h.resource.component[0])); + END + + if (!sepp_node) { + ogs_error("Not found [%s]", message.h.method); + ogs_assert(true == + ogs_sbi_server_send_error( + stream, OGS_SBI_HTTP_STATUS_NOT_FOUND, + &message, "Not found", message.h.method)); + break; + } + + ogs_assert(OGS_FSM_STATE(&sepp_node->sm)); + + e->sepp_node = sepp_node; + e->h.sbi.message = &message; + ogs_fsm_dispatch(&sepp_node->sm, e); + if (OGS_FSM_CHECK(&sepp_node->sm, sepp_handshake_state_exception)) + ogs_error("[%s] State machine exception", sepp_node->receiver); + break; + + DEFAULT + ogs_error("Invalid API name [%s]", message.h.service.name); + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, &message, + "Invalid API name", message.h.service.name)); + END + + /* In lib/sbi/server.c, notify_completed() releases 'request' buffer. */ + ogs_sbi_message_free(&message); + break; + + case OGS_EVENT_SBI_CLIENT: + ogs_assert(e); + + response = e->h.sbi.response; + ogs_assert(response); + rv = ogs_sbi_parse_response(&message, response); + if (rv != OGS_OK) { + ogs_error("cannot parse HTTP response"); + ogs_sbi_message_free(&message); + ogs_sbi_response_free(response); + break; + } + + if (strcmp(message.h.api.version, OGS_SBI_API_V1) != 0) { + ogs_error("Not supported version [%s]", message.h.api.version); + ogs_sbi_message_free(&message); + ogs_sbi_response_free(response); + break; + } + + SWITCH(message.h.service.name) + CASE(OGS_SBI_SERVICE_NAME_NNRF_NFM) + + SWITCH(message.h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) + ogs_fsm_handler_t old_state; + + nf_instance = e->h.sbi.data; + ogs_assert(nf_instance); + + old_state = OGS_FSM_STATE(&nf_instance->sm); + ogs_assert(old_state); + + e->h.sbi.message = &message; + ogs_fsm_dispatch(&nf_instance->sm, e); + + /* + * The SEPP on the H-PLMN should send a n32c-handshake message + * with the Sender PLMN-ID. Otherwise, the UE in the V-PLMN cannot + * find the SEPP in the H-PLMN during the REGISTRATION. + * + * Since SEPP's PLMN-ID can be received when registering with NRF, + * n32c-handshake messages could be started after that. + * + * To confirm that the PLMN-ID has been received from the NRF, + * we check if the NF state has changed from + * ogs_sbi_nf_state_will_register to ogs_sbi_nf_state_registered. + */ + + if (old_state == + (ogs_fsm_handler_t)ogs_sbi_nf_state_will_register && + OGS_FSM_CHECK(&nf_instance->sm, + ogs_sbi_nf_state_registered)) { + + /* Initialize SEPP Peer List */ + ogs_list_for_each(&sepp_self()->peer_list, sepp_node) { + + /* + * Since FSM initialization only needs to be done once + * at the beginning, it only performs initialization + * when the state variable(OGS_FSM_STATE()) is NULL. + */ + if (!OGS_FSM_STATE(&sepp_node->sm)) + sepp_handshake_fsm_init(sepp_node, true); + } + } + break; + + CASE(OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS) + subscription_data = e->h.sbi.data; + ogs_assert(subscription_data); + + SWITCH(message.h.method) + CASE(OGS_SBI_HTTP_METHOD_POST) + if (message.res_status == OGS_SBI_HTTP_STATUS_CREATED || + message.res_status == OGS_SBI_HTTP_STATUS_OK) { + ogs_nnrf_nfm_handle_nf_status_subscribe( + subscription_data, &message); + } else { + ogs_error("HTTP response error : %d", + message.res_status); + } + break; + + CASE(OGS_SBI_HTTP_METHOD_PATCH) + if (message.res_status == OGS_SBI_HTTP_STATUS_OK || + message.res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT) { + ogs_nnrf_nfm_handle_nf_status_update( + subscription_data, &message); + } else { + ogs_error("[%s] HTTP response error [%d]", + subscription_data->id ? + subscription_data->id : "Unknown", + message.res_status); + } + break; + + CASE(OGS_SBI_HTTP_METHOD_DELETE) + if (message.res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT) { + ogs_sbi_subscription_data_remove(subscription_data); + } else { + ogs_error("[%s] HTTP response error [%d]", + subscription_data->id ? + subscription_data->id : "Unknown", + 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_N32C_HANDSHAKE) + + SWITCH(message.h.resource.component[0]) + CASE(OGS_SBI_RESOURCE_NAME_EXCHANGE_CAPABILITY) + sepp_node = e->h.sbi.data; + ogs_assert(sepp_node); + ogs_assert(OGS_FSM_STATE(&sepp_node->sm)); + + e->sepp_node = sepp_node; + e->h.sbi.message = &message; + ogs_fsm_dispatch(&sepp_node->sm, e); + break; + + DEFAULT + ogs_error("Invalid resource name [%s]", + message.h.resource.component[0]); + ogs_assert_if_reached(); + END + break; + + DEFAULT + ogs_error("Invalid service name [%s]", message.h.service.name); + ogs_assert_if_reached(); + END + + ogs_sbi_message_free(&message); + ogs_sbi_response_free(response); + break; + + case OGS_EVENT_SBI_TIMER: + ogs_assert(e); + + switch(e->h.timer_id) { + case SEPP_TIMER_PEER_ESTABLISH: + sepp_node = e->sepp_node; + ogs_assert(sepp_node); + ogs_assert(OGS_FSM_STATE(&sepp_node->sm)); + + ogs_fsm_dispatch(&sepp_node->sm, e); + if (OGS_FSM_CHECK(&sepp_node->sm, sepp_handshake_state_exception)) + ogs_error("[%s] State machine exception [%d]", + sepp_node->receiver, e->h.timer_id); + break; + + case OGS_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + case OGS_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL: + case OGS_TIMER_NF_INSTANCE_NO_HEARTBEAT: + case OGS_TIMER_NF_INSTANCE_VALIDITY: + nf_instance = e->h.sbi.data; + ogs_assert(nf_instance); + ogs_assert(OGS_FSM_STATE(&nf_instance->sm)); + + ogs_fsm_dispatch(&nf_instance->sm, e); + if (OGS_FSM_CHECK(&nf_instance->sm, ogs_sbi_nf_state_exception)) + ogs_error("[%s:%s] State machine exception [%d]", + OpenAPI_nf_type_ToString(nf_instance->nf_type), + nf_instance->id, e->h.timer_id); + break; + + case OGS_TIMER_SUBSCRIPTION_VALIDITY: + subscription_data = e->h.sbi.data; + ogs_assert(subscription_data); + + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_subscribe( + ogs_sbi_self()->nf_instance->nf_type, + subscription_data->req_nf_instance_id, + subscription_data->subscr_cond.nf_type, + subscription_data->subscr_cond.service_name)); + + ogs_error("[%s] Subscription validity expired", + subscription_data->id); + ogs_sbi_subscription_data_remove(subscription_data); + break; + + case OGS_TIMER_SUBSCRIPTION_PATCH: + subscription_data = e->h.sbi.data; + ogs_assert(subscription_data); + + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_update(subscription_data)); + + ogs_info("[%s] Need to update Subscription", + subscription_data->id); + break; + + default: + ogs_error("Unknown timer[%s:%d]", + ogs_timer_get_name(e->h.timer_id), e->h.timer_id); + } + break; + + default: + ogs_error("No handler for event %s", sepp_event_get_name(e)); + break; + } +} diff --git a/src/sepp/sepp-sm.h b/src/sepp/sepp-sm.h new file mode 100644 index 000000000..baea64aae --- /dev/null +++ b/src/sepp/sepp-sm.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2023 by Sukchan Lee + * + * 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 . + */ + +#ifndef SEPP_SM_H +#define SEPP_SM_H + +#include "event.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void sepp_state_initial(ogs_fsm_t *s, sepp_event_t *e); +void sepp_state_final(ogs_fsm_t *s, sepp_event_t *e); +void sepp_state_operational(ogs_fsm_t *s, sepp_event_t *e); +void sepp_state_exception(ogs_fsm_t *s, sepp_event_t *e); + +void sepp_handshake_state_initial(ogs_fsm_t *s, sepp_event_t *e); +void sepp_handshake_state_final(ogs_fsm_t *s, sepp_event_t *e); +void sepp_handshake_state_will_establish(ogs_fsm_t *s, sepp_event_t *e); +void sepp_handshake_state_established(ogs_fsm_t *s, sepp_event_t *e); +void sepp_handshake_state_terminated(ogs_fsm_t *s, sepp_event_t *e); +void sepp_handshake_state_exception(ogs_fsm_t *s, sepp_event_t *e); + +void sepp_handshake_fsm_init(sepp_node_t *sepp_node, bool try_to_establish); +void sepp_handshake_fsm_fini(sepp_node_t *sepp_node); + +#define sepp_sm_debug(__pe) \ + ogs_debug("%s(): %s", __func__, sepp_event_get_name(__pe)) + +#ifdef __cplusplus +} +#endif + +#endif /* SEPP_SM_H */ diff --git a/src/sepp/timer.c b/src/sepp/timer.c new file mode 100644 index 000000000..a8b321813 --- /dev/null +++ b/src/sepp/timer.c @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2023 by Sukchan Lee + * + * 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 . + */ + +#include "context.h" + +const char *sepp_timer_get_name(int timer_id) +{ + switch (timer_id) { + case OGS_TIMER_NF_INSTANCE_REGISTRATION_INTERVAL: + return OGS_TIMER_NAME_NF_INSTANCE_REGISTRATION_INTERVAL; + case OGS_TIMER_NF_INSTANCE_HEARTBEAT_INTERVAL: + return OGS_TIMER_NAME_NF_INSTANCE_HEARTBEAT_INTERVAL; + case OGS_TIMER_NF_INSTANCE_NO_HEARTBEAT: + return OGS_TIMER_NAME_NF_INSTANCE_NO_HEARTBEAT; + case OGS_TIMER_NF_INSTANCE_VALIDITY: + return OGS_TIMER_NAME_NF_INSTANCE_VALIDITY; + case OGS_TIMER_SUBSCRIPTION_VALIDITY: + return OGS_TIMER_NAME_SUBSCRIPTION_VALIDITY; + case OGS_TIMER_SUBSCRIPTION_PATCH: + return OGS_TIMER_NAME_SUBSCRIPTION_PATCH; + case OGS_TIMER_SBI_CLIENT_WAIT: + return OGS_TIMER_NAME_SBI_CLIENT_WAIT; + case SEPP_TIMER_PEER_ESTABLISH: + return "SEPP_TIMER_PEER_ESTABLISH"; + default: + break; + } + + ogs_error("Unknown Timer[%d]", timer_id); + return "UNKNOWN_TIMER"; +} + +static void timer_send_event(int timer_id, void *data) +{ + int rv; + sepp_event_t *e = NULL; + ogs_assert(data); + + switch (timer_id) { + case SEPP_TIMER_PEER_ESTABLISH: + e = sepp_event_new(OGS_EVENT_SBI_TIMER); + ogs_assert(e); + e->h.timer_id = timer_id; + e->sepp_node = data; + break; + default: + ogs_fatal("Unknown timer id[%d]", timer_id); + ogs_assert_if_reached(); + break; + } + + rv = ogs_queue_push(ogs_app()->queue, e); + if (rv != OGS_OK) { + ogs_error("ogs_queue_push() failed [%d] in %s", + (int)rv, sepp_timer_get_name(timer_id)); + ogs_event_free(e); + } +} + +void sepp_timer_peer_establish(void *data) +{ + timer_send_event(SEPP_TIMER_PEER_ESTABLISH, data); +} diff --git a/src/sepp/timer.h b/src/sepp/timer.h new file mode 100644 index 000000000..a38cecdd8 --- /dev/null +++ b/src/sepp/timer.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2023 by Sukchan Lee + * + * 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 . + */ + +#ifndef SEPP_TIMER_H +#define SEPP_TIMER_H + +#include "ogs-proto.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* forward declaration */ +typedef enum { + SEPP_TIMER_BASE = OGS_MAX_NUM_OF_PROTO_TIMER, + + SEPP_TIMER_PEER_ESTABLISH, + + MAX_NUM_OF_SEPP_TIMER, + +} sepp_timer_e; + +const char *sepp_timer_get_name(int timer_id); + +void sepp_timer_peer_establish(void *data); + +#ifdef __cplusplus +} +#endif + +#endif /* SEPP_TIMER_H */ diff --git a/src/sgwc/context.c b/src/sgwc/context.c index 47e84e2d5..81d68112d 100644 --- a/src/sgwc/context.c +++ b/src/sgwc/context.c @@ -52,8 +52,8 @@ void sgwc_context_init(void) ogs_pool_init(&sgwc_bearer_pool, ogs_app()->pool.bearer); ogs_pool_init(&sgwc_tunnel_pool, ogs_app()->pool.tunnel); - ogs_pool_init(&sgwc_ue_pool, ogs_app()->max.ue); - ogs_pool_init(&sgwc_s11_teid_pool, ogs_app()->max.ue); + ogs_pool_init(&sgwc_ue_pool, ogs_global_conf()->max.ue); + ogs_pool_init(&sgwc_s11_teid_pool, ogs_global_conf()->max.ue); ogs_pool_random_id_generate(&sgwc_s11_teid_pool); ogs_pool_init(&sgwc_sess_pool, ogs_app()->pool.sess); @@ -146,6 +146,8 @@ int sgwc_context_parse_config(void) /* handle config in gtp library */ } else if (!strcmp(sgwc_key, "pfcp")) { /* handle config in pfcp library */ + } else if (!strcmp(sgwc_key, "sgwu")) { + /* handle config in pfcp library */ } else ogs_warn("unknown key `%s`", sgwc_key); } @@ -381,7 +383,7 @@ static ogs_pfcp_node_t *selected_sgwu_node( compare_ue_info(node, sess) == true) return node; } - if (ogs_app()->parameter.no_pfcp_rr_select == 0) { + if (ogs_global_conf()->parameter.no_pfcp_rr_select == 0) { /* continue search from current position */ next = ogs_list_next(current); for (node = next; node; node = ogs_list_next(node)) { diff --git a/src/sgwc/init.c b/src/sgwc/init.c index 721ca188d..7f62d09b7 100644 --- a/src/sgwc/init.c +++ b/src/sgwc/init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -31,6 +31,10 @@ int sgwc_initialize(void) { int rv; +#define APP_NAME "sgwc" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + ogs_gtp_context_init(ogs_app()->pool.nf * OGS_MAX_NUM_OF_GTPU_RESOURCE); ogs_pfcp_context_init(); @@ -43,10 +47,10 @@ int sgwc_initialize(void) rv = ogs_pfcp_xact_init(); if (rv != OGS_OK) return rv; - rv = ogs_gtp_context_parse_config("sgwc", "sgwu"); + rv = ogs_gtp_context_parse_config(APP_NAME, "sgwu"); if (rv != OGS_OK) return rv; - rv = ogs_pfcp_context_parse_config("sgwc", "sgwu"); + rv = ogs_pfcp_context_parse_config(APP_NAME, "sgwu"); if (rv != OGS_OK) return rv; rv = sgwc_context_parse_config(); diff --git a/src/sgwc/pfcp-sm.c b/src/sgwc/pfcp-sm.c index fb9a17736..06d47e2cb 100644 --- a/src/sgwc/pfcp-sm.c +++ b/src/sgwc/pfcp-sm.c @@ -85,7 +85,7 @@ void sgwc_pfcp_state_will_associate(ogs_fsm_t *s, sgwc_event_t *e) case OGS_FSM_ENTRY_SIG: if (node->t_association) { ogs_timer_start(node->t_association, - ogs_app()->time.message.pfcp.association_interval); + ogs_local_conf()->time.message.pfcp.association_interval); ogs_pfcp_cp_send_association_setup_request(node, node_timeout); } @@ -103,12 +103,12 @@ void sgwc_pfcp_state_will_associate(ogs_fsm_t *s, sgwc_event_t *e) node = e->pfcp_node; ogs_assert(node); - ogs_warn("Retry to association with peer [%s]:%d failed", + ogs_warn("Retry association with peer [%s]:%d failed", OGS_ADDR(addr, buf), OGS_PORT(addr)); ogs_assert(node->t_association); ogs_timer_start(node->t_association, - ogs_app()->time.message.pfcp.association_interval); + ogs_local_conf()->time.message.pfcp.association_interval); ogs_pfcp_cp_send_association_setup_request(node, node_timeout); break; @@ -184,7 +184,7 @@ void sgwc_pfcp_state_associated(ogs_fsm_t *s, sgwc_event_t *e) OGS_ADDR(&node->addr, buf), OGS_PORT(&node->addr)); ogs_timer_start(node->t_no_heartbeat, - ogs_app()->time.message.pfcp.no_heartbeat_duration); + ogs_local_conf()->time.message.pfcp.no_heartbeat_duration); ogs_assert(OGS_OK == ogs_pfcp_send_heartbeat_request(node, node_timeout)); diff --git a/src/sgwu/context.c b/src/sgwu/context.c index 87f97ef2f..a7bdd56b3 100644 --- a/src/sgwu/context.c +++ b/src/sgwu/context.c @@ -121,6 +121,8 @@ int sgwu_context_parse_config(void) /* handle config in gtp library */ } else if (!strcmp(sgwu_key, "pfcp")) { /* handle config in pfcp library */ + } else if (!strcmp(sgwu_key, "sgwc")) { + /* handle config in pfcp library */ } else ogs_warn("unknown key `%s`", sgwu_key); } diff --git a/src/sgwu/gtp-path.c b/src/sgwu/gtp-path.c index a08cf92a5..e44c0c7f6 100644 --- a/src/sgwu/gtp-path.c +++ b/src/sgwu/gtp-path.c @@ -130,8 +130,8 @@ static void _gtpv1_u_recv_cb(short when, ogs_socket_t fd, void *data) */ if (ogs_time_ntp32_now() > (ogs_pfcp_self()->local_recovery + - ogs_time_sec( - ogs_app()->time.message.pfcp.association_interval))) { + ogs_time_sec(ogs_local_conf()->time.message.pfcp. + association_interval))) { ogs_error("[%s] Send Error Indication [TEID:0x%x] to [%s]", OGS_ADDR(&sock->local_addr, buf1), header_desc.teid, @@ -207,8 +207,8 @@ static void _gtpv1_u_recv_cb(short when, ogs_socket_t fd, void *data) */ if (ogs_time_ntp32_now() > (ogs_pfcp_self()->local_recovery + - ogs_time_sec( - ogs_app()->time.message.pfcp.association_interval))) { + ogs_time_sec(ogs_local_conf()->time.message.pfcp. + association_interval))) { ogs_error("[%s] Send Error Indication [TEID:0x%x] to [%s]", OGS_ADDR(&sock->local_addr, buf1), header_desc.teid, diff --git a/src/sgwu/init.c b/src/sgwu/init.c index aaf9e8f3e..51e20c53d 100644 --- a/src/sgwu/init.c +++ b/src/sgwu/init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -30,6 +30,10 @@ int sgwu_initialize(void) { int rv; +#define APP_NAME "sgwu" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + ogs_gtp_context_init(OGS_MAX_NUM_OF_GTPU_RESOURCE); ogs_pfcp_context_init(); @@ -40,10 +44,10 @@ int sgwu_initialize(void) rv = ogs_pfcp_xact_init(); if (rv != OGS_OK) return rv; - rv = ogs_gtp_context_parse_config("sgwu", "sgwc"); + rv = ogs_gtp_context_parse_config(APP_NAME, "sgwc"); if (rv != OGS_OK) return rv; - rv = ogs_pfcp_context_parse_config("sgwu", "sgwc"); + rv = ogs_pfcp_context_parse_config(APP_NAME, "sgwc"); if (rv != OGS_OK) return rv; rv = sgwu_context_parse_config(); diff --git a/src/sgwu/pfcp-sm.c b/src/sgwu/pfcp-sm.c index 3393eaecf..b14772baf 100644 --- a/src/sgwu/pfcp-sm.c +++ b/src/sgwu/pfcp-sm.c @@ -81,7 +81,7 @@ void sgwu_pfcp_state_will_associate(ogs_fsm_t *s, sgwu_event_t *e) case OGS_FSM_ENTRY_SIG: if (node->t_association) { ogs_timer_start(node->t_association, - ogs_app()->time.message.pfcp.association_interval); + ogs_local_conf()->time.message.pfcp.association_interval); ogs_pfcp_up_send_association_setup_request(node, node_timeout); } @@ -99,12 +99,12 @@ void sgwu_pfcp_state_will_associate(ogs_fsm_t *s, sgwu_event_t *e) addr = node->sa_list; ogs_assert(addr); - ogs_warn("Retry to association with peer [%s]:%d failed", + ogs_warn("Retry association with peer [%s]:%d failed", OGS_ADDR(addr, buf), OGS_PORT(addr)); ogs_assert(node->t_association); ogs_timer_start(node->t_association, - ogs_app()->time.message.pfcp.association_interval); + ogs_local_conf()->time.message.pfcp.association_interval); ogs_pfcp_up_send_association_setup_request(node, node_timeout); break; @@ -180,7 +180,7 @@ void sgwu_pfcp_state_associated(ogs_fsm_t *s, sgwu_event_t *e) OGS_ADDR(&node->addr, buf), OGS_PORT(&node->addr)); ogs_timer_start(node->t_no_heartbeat, - ogs_app()->time.message.pfcp.no_heartbeat_duration); + ogs_local_conf()->time.message.pfcp.no_heartbeat_duration); ogs_assert(OGS_OK == ogs_pfcp_send_heartbeat_request(node, node_timeout)); diff --git a/src/smf/binding.c b/src/smf/binding.c index bd254b903..240219582 100644 --- a/src/smf/binding.c +++ b/src/smf/binding.c @@ -102,8 +102,8 @@ static void encode_traffic_flow_template( ogs_pf_content_from_ipfw_rule( pf->direction, &tft->pf[i].content, &pf->ipfw_rule, - ogs_app()-> - parameter.no_ipv4v6_local_addr_in_packet_filter); + ogs_global_conf()->parameter. + no_ipv4v6_local_addr_in_packet_filter); } i++; diff --git a/src/smf/context.c b/src/smf/context.c index a7086f32c..ea61b6a83 100644 --- a/src/smf/context.c +++ b/src/smf/context.c @@ -82,7 +82,7 @@ void smf_context_init(void) ogs_log_install_domain(&__gsm_log_domain, "gsm", ogs_core()->log.level); ogs_pool_init(&smf_gtp_node_pool, ogs_app()->pool.nf); - ogs_pool_init(&smf_ue_pool, ogs_app()->max.ue); + ogs_pool_init(&smf_ue_pool, ogs_global_conf()->max.ue); ogs_pool_init(&smf_bearer_pool, ogs_app()->pool.bearer); ogs_pool_init(&smf_pf_pool, ogs_app()->pool.bearer * OGS_MAX_NUM_OF_FLOW_IN_BEARER); @@ -172,11 +172,11 @@ static int smf_context_validation(void) return OGS_ERROR; } if (ogs_list_first(&ogs_gtp_self()->gtpu_list) == NULL) { - ogs_error("No smf.gtpu in '%s'", ogs_app()->file); + ogs_error("No smf.gtpu.address in '%s'", ogs_app()->file); return OGS_ERROR; } if (ogs_list_first(&ogs_pfcp_self()->subnet_list) == NULL) { - ogs_error("No smf.subnet: in '%s'", ogs_app()->file); + ogs_error("No smf.session.subnet: in '%s'", ogs_app()->file); return OGS_ERROR; } @@ -422,7 +422,8 @@ int smf_context_parse_config(void) if (!strcmp(conn_key, "identity")) { identity = ogs_yaml_iter_value(&conn_iter); - } else if (!strcmp(conn_key, "addr")) { + } else if (!strcmp(conn_key, + "address")) { addr = ogs_yaml_iter_value(&conn_iter); } else if (!strcmp(conn_key, "port")) { @@ -936,10 +937,18 @@ int smf_context_parse_config(void) } } else if (!strcmp(smf_key, "pfcp")) { /* handle config in pfcp library */ - } else if (!strcmp(smf_key, "subnet")) { + } else if (!strcmp(smf_key, "upf")) { /* handle config in pfcp library */ + } else if (!strcmp(smf_key, "session")) { + /* handle config in pfcp library */ + } else if (!strcmp(smf_key, "default")) { + /* handle config in sbi library */ } else if (!strcmp(smf_key, "sbi")) { /* handle config in sbi library */ + } else if (!strcmp(smf_key, "nrf")) { + /* handle config in sbi library */ + } else if (!strcmp(smf_key, "scp")) { + /* handle config in sbi library */ } else if (!strcmp(smf_key, "service_name")) { /* handle config in sbi library */ } else if (!strcmp(smf_key, "discovery")) { @@ -997,7 +1006,7 @@ static smf_ue_t *smf_ue_add(void) ogs_pool_alloc(&smf_ue_pool, &smf_ue); if (!smf_ue) { ogs_error("Maximum number of smf_ue[%lld] reached", - (long long)ogs_app()->max.ue); + (long long)ogs_global_conf()->max.ue); return NULL; } memset(smf_ue, 0, sizeof *smf_ue); @@ -1140,7 +1149,7 @@ static ogs_pfcp_node_t *selected_upf_node( compare_ue_info(node, sess) == true) return node; } - if (ogs_app()->parameter.no_pfcp_rr_select == 0) { + if (ogs_global_conf()->parameter.no_pfcp_rr_select == 0) { /* continue search from current position */ next = ogs_list_next(current); for (node = next; node; node = ogs_list_next(node)) { @@ -1497,7 +1506,7 @@ smf_sess_t *smf_sess_add_by_sbi_message(ogs_sbi_message_t *message) if (sess) { ogs_warn("OLD Session Will Release [SUPI:%s,PDU Session identity:%d]", SmContextCreateData->supi, SmContextCreateData->pdu_session_id); - smf_metrics_inst_by_slice_add(&sess->plmn_id, &sess->s_nssai, + smf_metrics_inst_by_slice_add(&sess->serving_plmn_id, &sess->s_nssai, SMF_METR_GAUGE_SM_SESSIONNBR, -1); smf_sess_remove(sess); } @@ -1719,6 +1728,8 @@ void smf_sess_remove(smf_sess_t *sess) if (sess->session.name) ogs_free(sess->session.name); + if (sess->full_dnn) + ogs_free(sess->full_dnn); if (sess->session.ipv4_framed_routes) { for (i = 0; i < OGS_MAX_NUM_OF_FRAMED_ROUTES_IN_PDI; i++) { @@ -2003,7 +2014,7 @@ smf_bearer_t *smf_qos_flow_add(smf_sess_t *sess) qos_flow->sess = sess; ogs_list_add(&sess->bearer_list, qos_flow); - smf_metrics_inst_by_5qi_add(&sess->plmn_id, &sess->s_nssai, + smf_metrics_inst_by_5qi_add(&sess->serving_plmn_id, &sess->s_nssai, sess->session.qos.index, SMF_METR_GAUGE_SM_QOSFLOWNBR, 1); smf_metrics_inst_global_inc(SMF_METR_GLOB_GAUGE_BEARERS_ACTIVE); diff --git a/src/smf/context.h b/src/smf/context.h index 87f69a18d..1cef8053f 100644 --- a/src/smf/context.h +++ b/src/smf/context.h @@ -140,7 +140,7 @@ typedef struct smf_ue_s { ogs_assert(__sESS); \ smf_ue = (__sESS)->smf_ue; \ ogs_assert(smf_ue); \ - smf_metrics_inst_by_slice_add(&(__sESS)->plmn_id, \ + smf_metrics_inst_by_slice_add(&(__sESS)->serving_plmn_id, \ &(__sESS)->s_nssai, SMF_METR_GAUGE_SM_SESSIONNBR, -1); \ if (SMF_UE_IS_LAST_SESSION(smf_ue)) \ smf_ue_remove(smf_ue); \ @@ -284,8 +284,9 @@ typedef struct smf_sess_s { OpenAPI_up_cnx_state_e up_cnx_state; - /* PLMN ID & NID */ - ogs_plmn_id_t plmn_id; + /* Serving PLMN ID & Home PLMN ID */ + ogs_plmn_id_t serving_plmn_id; + ogs_plmn_id_t home_plmn_id; /* LTE Location */ ogs_eps_tai_t e_tai; @@ -317,6 +318,9 @@ typedef struct smf_sess_s { uint8_t ue_session_type; uint8_t ue_ssc_mode; + /* DNN */ + char *full_dnn; + ogs_pfcp_ue_ip_t *ipv4; ogs_pfcp_ue_ip_t *ipv6; diff --git a/src/smf/gn-handler.c b/src/smf/gn-handler.c index a3581c594..47a7ca55c 100644 --- a/src/smf/gn-handler.c +++ b/src/smf/gn-handler.c @@ -150,13 +150,13 @@ uint8_t smf_gn_handle_create_pdp_context_request( switch (uli.geo_loc_type) { case OGS_GTP1_GEO_LOC_TYPE_CGI: - ogs_nas_to_plmn_id(&sess->plmn_id, &uli.cgi.nas_plmn_id); + ogs_nas_to_plmn_id(&sess->serving_plmn_id, &uli.cgi.nas_plmn_id); break; case OGS_GTP1_GEO_LOC_TYPE_SAI: - ogs_nas_to_plmn_id(&sess->plmn_id, &uli.sai.nas_plmn_id); + ogs_nas_to_plmn_id(&sess->serving_plmn_id, &uli.sai.nas_plmn_id); break; case OGS_GTP1_GEO_LOC_TYPE_RAI: - ogs_nas_to_plmn_id(&sess->plmn_id, &uli.rai.nas_plmn_id); + ogs_nas_to_plmn_id(&sess->serving_plmn_id, &uli.rai.nas_plmn_id); break; /* default: should not happen */ } diff --git a/src/smf/gsm-build.c b/src/smf/gsm-build.c index 87059b402..b67a9ba4c 100644 --- a/src/smf/gsm-build.c +++ b/src/smf/gsm-build.c @@ -303,7 +303,8 @@ static void encode_qos_rule_packet_filter( ogs_pf_content_from_ipfw_rule( pf->direction, &qos_rule->pf[i].content, &pf->ipfw_rule, - ogs_app()->parameter.no_ipv4v6_local_addr_in_packet_filter); + ogs_global_conf()->parameter. + no_ipv4v6_local_addr_in_packet_filter); i++; } qos_rule->num_of_packet_filter = i; diff --git a/src/smf/gsm-sm.c b/src/smf/gsm-sm.c index 81ccecbc9..b1c9e7f84 100644 --- a/src/smf/gsm-sm.c +++ b/src/smf/gsm-sm.c @@ -1220,7 +1220,7 @@ void smf_gsm_state_wait_pfcp_deletion(ogs_fsm_t *s, smf_event_t *e) switch (e->h.id) { case OGS_FSM_ENTRY_SIG: - /* Since `pfcp_xact->epc` is not avaiable, + /* Since `pfcp_xact->epc` is not available, * we'll use `sess->epc` */ if (sess->epc) { /* EPC */ diff --git a/src/smf/gx-path.c b/src/smf/gx-path.c index 5ffeddb5f..d26e0b1e1 100644 --- a/src/smf/gx-path.c +++ b/src/smf/gx-path.c @@ -522,7 +522,8 @@ void smf_gx_send_ccr(smf_sess_t *sess, ogs_gtp_xact_t *xact, /* Set 3GPP-SGSN-MCC-MNC */ ret = fd_msg_avp_new(ogs_diam_gx_3gpp_sgsn_mcc_mnc, 0, &avp); ogs_assert(ret == 0); - val.os.data = (uint8_t *)ogs_plmn_id_to_string(&sess->plmn_id, buf); + val.os.data = (uint8_t *)ogs_plmn_id_to_string( + &sess->serving_plmn_id, buf); val.os.len = strlen(buf); ret = fd_msg_avp_setvalue(avp, &val); ogs_assert(ret == 0); @@ -1042,14 +1043,14 @@ out: rv = ogs_queue_push(ogs_app()->queue, e); if (rv != OGS_OK) { ogs_error("ogs_queue_push() failed:%d", (int)rv); - ogs_session_data_free(&gx_message->session_data); + OGS_SESSION_DATA_FREE(&gx_message->session_data); ogs_free(gx_message); ogs_event_free(e); } else { ogs_pollset_notify(ogs_app()->pollset); } } else { - ogs_session_data_free(&gx_message->session_data); + OGS_SESSION_DATA_FREE(&gx_message->session_data); ogs_free(gx_message); } @@ -1285,7 +1286,7 @@ static int smf_gx_rar_cb( struct msg **msg, struct avp *avp, rv = ogs_queue_push(ogs_app()->queue, e); if (rv != OGS_OK) { ogs_error("ogs_queue_push() failed:%d", (int)rv); - ogs_session_data_free(&gx_message->session_data); + OGS_SESSION_DATA_FREE(&gx_message->session_data); ogs_free(gx_message); ogs_event_free(e); } else { @@ -1340,7 +1341,7 @@ out: ret = fd_msg_send(msg, NULL, NULL); ogs_assert(ret == 0); - ogs_session_data_free(&gx_message->session_data); + OGS_SESSION_DATA_FREE(&gx_message->session_data); ogs_free(gx_message); return 0; diff --git a/src/smf/gy-path.c b/src/smf/gy-path.c index b5bb48648..8bbb6f463 100644 --- a/src/smf/gy-path.c +++ b/src/smf/gy-path.c @@ -505,7 +505,7 @@ static void fill_service_information_ccr(smf_sess_t *sess, /* 3GPP-SGSN-MCC-MNC */ ret = fd_msg_avp_new(ogs_diam_gy_3gpp_sgsn_mcc_mnc, 0, &avpch2); ogs_assert(ret == 0); - val.os.data = (uint8_t *)ogs_plmn_id_to_string(&sess->plmn_id, buf); + val.os.data = (uint8_t *)ogs_plmn_id_to_string(&sess->serving_plmn_id, buf); val.os.len = strlen(buf); ret = fd_msg_avp_setvalue(avpch2, &val); ogs_assert(ret == 0); diff --git a/src/smf/init.c b/src/smf/init.c index 977c1f3f9..bf7a18e0a 100644 --- a/src/smf/init.c +++ b/src/smf/init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -33,6 +33,10 @@ int smf_initialize(void) { int rv; +#define APP_NAME "smf" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + smf_metrics_init(); ogs_gtp_context_init(ogs_app()->pool.nf * OGS_MAX_NUM_OF_GTPU_RESOURCE); @@ -47,16 +51,16 @@ int smf_initialize(void) rv = ogs_pfcp_xact_init(); if (rv != OGS_OK) return rv; - rv = ogs_gtp_context_parse_config("smf", "upf"); + rv = ogs_gtp_context_parse_config(APP_NAME, "upf"); if (rv != OGS_OK) return rv; - rv = ogs_pfcp_context_parse_config("smf", "upf"); + rv = ogs_pfcp_context_parse_config(APP_NAME, "upf"); if (rv != OGS_OK) return rv; - rv = ogs_sbi_context_parse_config("smf", "nrf", "scp"); + rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp"); if (rv != OGS_OK) return rv; - rv = ogs_metrics_context_parse_config("smf"); + rv = ogs_metrics_context_parse_config(APP_NAME); if (rv != OGS_OK) return rv; rv = smf_context_parse_config(); diff --git a/src/smf/n4-handler.c b/src/smf/n4-handler.c index 70f4e08df..355ff1477 100644 --- a/src/smf/n4-handler.c +++ b/src/smf/n4-handler.c @@ -389,7 +389,7 @@ void smf_5gc_n4_handle_session_modification_response( smf_5gc_pfcp_send_all_pdr_modification_request( sess, stream, OGS_PFCP_MODIFY_INDIRECT|OGS_PFCP_MODIFY_REMOVE, - ogs_app()->time.handover.duration)); + ogs_local_conf()->time.handover.duration)); } smf_sbi_send_sm_context_updated_data_ho_state( @@ -495,7 +495,7 @@ void smf_5gc_n4_handle_session_modification_response( ogs_list_for_each_entry_safe(&sess->qos_flow_to_modify_list, next, qos_flow, to_modify_node) { smf_metrics_inst_by_5qi_add( - &qos_flow->sess->plmn_id, + &qos_flow->sess->serving_plmn_id, &qos_flow->sess->s_nssai, qos_flow->sess->session.qos.index, SMF_METR_GAUGE_SM_QOSFLOWNBR, -1); @@ -527,7 +527,7 @@ void smf_5gc_n4_handle_session_modification_response( ogs_list_for_each_entry_safe(&sess->qos_flow_to_modify_list, next, qos_flow, to_modify_node) { smf_metrics_inst_by_5qi_add( - &qos_flow->sess->plmn_id, + &qos_flow->sess->serving_plmn_id, &qos_flow->sess->s_nssai, qos_flow->sess->session.qos.index, SMF_METR_GAUGE_SM_QOSFLOWNBR, -1); diff --git a/src/smf/namf-build.c b/src/smf/namf-build.c index fb63a0738..e4c7441fe 100644 --- a/src/smf/namf-build.c +++ b/src/smf/namf-build.c @@ -127,7 +127,7 @@ ogs_sbi_request_t *smf_namf_comm_build_n1_n2_message_transfer( } if (param->n1n2_failure_txf_notif_uri == true) { - server = ogs_list_first(&ogs_sbi_self()->server_list); + server = ogs_sbi_server_first(); ogs_assert(server); memset(&header, 0, sizeof(header)); diff --git a/src/smf/namf-handler.c b/src/smf/namf-handler.c index 0656bf884..d04b38ccb 100644 --- a/src/smf/namf-handler.c +++ b/src/smf/namf-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * diff --git a/src/smf/nnrf-handler.c b/src/smf/nnrf-handler.c index d06e1f891..41b60d2ec 100644 --- a/src/smf/nnrf-handler.c +++ b/src/smf/nnrf-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * diff --git a/src/smf/npcf-build.c b/src/smf/npcf-build.c index fb98a2bac..b59adccf5 100644 --- a/src/smf/npcf-build.c +++ b/src/smf/npcf-build.c @@ -37,6 +37,7 @@ ogs_sbi_request_t *smf_npcf_smpolicycontrol_build_create( ogs_assert(sess); ogs_assert(sess->sm_context_ref); + ogs_assert(sess->session.name); smf_ue = sess->smf_ue; ogs_assert(smf_ue); @@ -65,13 +66,62 @@ ogs_sbi_request_t *smf_npcf_smpolicycontrol_build_create( ogs_error("No pdu_session_type"); goto end; } - SmPolicyContextData.dnn = sess->session.name; - if (!SmPolicyContextData.dnn) { - ogs_error("No dnn"); - goto end; + + /* + * Use ogs_sbi_supi_in_vplmn() instead of ogs_sbi_plmn_id_in_vplmn(). + * This is because some vendors might not use the full DNN in LBO and + * Open5GS cannot derive the home PLMN ID without the full DNN. + * + * 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. + * + * TS29.512 + * 5 Npcf_SMPolicyControl Service API + * 5.6 Data Model + * 5.6.2 Structured data types + * Table 5.6.2.3-1: Definition of type SmPolicyContextData + * + * NAME: dnn + * Data type: Dnn + * P: M + * Cardinality: 1 + * The DNN of the PDU session, a full DNN with both the Network Identifier + * and Operator Identifier, or a DNN with the Network Identifier only + */ + if (ogs_sbi_supi_in_vplmn(smf_ue->supi) == true) { + char *home_network_domain = NULL; + + home_network_domain = + ogs_home_network_domain_from_plmn_id(&sess->home_plmn_id); + ogs_assert(home_network_domain); + + SmPolicyContextData.dnn = + ogs_msprintf("%s.%s", sess->session.name, home_network_domain); + ogs_assert(SmPolicyContextData.dnn); + + ogs_free(home_network_domain); + + } else { + SmPolicyContextData.dnn = ogs_strdup(sess->session.name); + ogs_assert(SmPolicyContextData.dnn); } - server = ogs_list_first(&ogs_sbi_self()->server_list); + server = ogs_sbi_server_first(); if (!server) { ogs_error("No server"); goto end; @@ -89,6 +139,13 @@ ogs_sbi_request_t *smf_npcf_smpolicycontrol_build_create( goto end; } + SmPolicyContextData.serving_network = + ogs_sbi_build_plmn_id_nid(&sess->serving_plmn_id); + if (!SmPolicyContextData.serving_network) { + ogs_error("No serving_network"); + goto end; + } + if (sess->ipv4) { SmPolicyContextData.ipv4_address = ogs_ipv4_to_string(sess->ipv4->addr[0]); @@ -201,6 +258,11 @@ end: if (SmPolicyContextData.gpsi) ogs_free(SmPolicyContextData.gpsi); + if (SmPolicyContextData.dnn) + ogs_free(SmPolicyContextData.dnn); + if (SmPolicyContextData.serving_network) + ogs_sbi_free_plmn_id_nid(SmPolicyContextData.serving_network); + if (sNssai.sd) ogs_free(sNssai.sd); @@ -323,7 +385,7 @@ ogs_sbi_request_t *smf_npcf_smpolicycontrol_build_delete( } SmPolicyDeleteData.serving_network = - ogs_sbi_build_plmn_id_nid(&sess->plmn_id); + ogs_sbi_build_plmn_id_nid(&sess->serving_plmn_id); if (!SmPolicyDeleteData.serving_network) { ogs_error("SmPolicyDeleteData.serving_network"); goto end; diff --git a/src/smf/nsmf-handler.c b/src/smf/nsmf-handler.c index 8901fce22..0b3c769a6 100644 --- a/src/smf/nsmf-handler.c +++ b/src/smf/nsmf-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -35,7 +35,9 @@ bool smf_nsmf_handle_create_sm_context( ogs_sbi_client_t *client = NULL; OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; - ogs_sockaddr_t *addr = NULL; + char *fqdn = NULL; + uint16_t fqdn_port = 0; + ogs_sockaddr_t *addr = NULL, *addr6 = NULL; OpenAPI_sm_context_create_data_t *SmContextCreateData = NULL; OpenAPI_nr_location_t *NrLocation = NULL; @@ -151,7 +153,7 @@ bool smf_nsmf_handle_create_sm_context( return false; } - rc = ogs_sbi_getaddr_from_uri(&scheme, &addr, + rc = ogs_sbi_getaddr_from_uri(&scheme, &fqdn, &fqdn_port, &addr, &addr6, SmContextCreateData->sm_context_status_uri); if (rc == false || scheme == OpenAPI_uri_scheme_NULL) { ogs_error("[%s:%d] Invalid URI [%s]", @@ -220,7 +222,9 @@ bool smf_nsmf_handle_create_sm_context( } } - ogs_sbi_parse_plmn_id_nid(&sess->plmn_id, servingNetwork); + /* Serving PLMN & Home PLMN */ + 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->sbi_rat_type = SmContextCreateData->rat_type; @@ -237,9 +241,9 @@ bool smf_nsmf_handle_create_sm_context( SmContextCreateData->hplmn_snssai->sd); } - smf_metrics_inst_by_slice_add(&sess->plmn_id, &sess->s_nssai, + smf_metrics_inst_by_slice_add(&sess->serving_plmn_id, &sess->s_nssai, SMF_METR_GAUGE_SM_SESSIONNBR, 1); - smf_metrics_inst_by_slice_add(&sess->plmn_id, &sess->s_nssai, + smf_metrics_inst_by_slice_add(&sess->serving_plmn_id, &sess->s_nssai, SMF_METR_CTR_SM_PDUSESSIONCREATIONREQ, 1); if (sess->sm_context_status_uri) @@ -248,25 +252,104 @@ bool smf_nsmf_handle_create_sm_context( ogs_strdup(SmContextCreateData->sm_context_status_uri); ogs_assert(sess->sm_context_status_uri); - client = ogs_sbi_client_find(scheme, addr); + client = ogs_sbi_client_find(scheme, fqdn, fqdn_port, addr, addr6); if (!client) { ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); - client = ogs_sbi_client_add(scheme, addr); + client = ogs_sbi_client_add(scheme, fqdn, fqdn_port, addr, addr6); if (!client) { - char buf[OGS_ADDRSTRLEN]; - ogs_error("%s: ogs_sbi_client_add() failed [%s]:%d", - OGS_FUNC, OGS_ADDR(addr, buf), OGS_PORT(addr)); + ogs_error("%s: ogs_sbi_client_add() failed", OGS_FUNC); + + ogs_free(fqdn); ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); + return false; } } OGS_SBI_SETUP_CLIENT(&sess->namf, client); - ogs_freeaddrinfo(addr); + ogs_free(fqdn); + ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr6); + + /* + * 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 (SmContextCreateData->dnn) { - if (sess->session.name) ogs_free(sess->session.name); - sess->session.name = ogs_strdup(SmContextCreateData->dnn); - ogs_assert(sess->session.name); + char *home_network_domain = + ogs_home_network_domain_from_fqdn(SmContextCreateData->dnn); + + if (home_network_domain) { + char dnn_network_identifer[OGS_MAX_DNN_LEN+1]; + uint16_t mcc = 0, mnc = 0; + + ogs_assert(home_network_domain > SmContextCreateData->dnn); + + ogs_cpystrn(dnn_network_identifer, SmContextCreateData->dnn, + ogs_min(OGS_MAX_DNN_LEN, + home_network_domain - SmContextCreateData->dnn)); + + if (sess->session.name) + ogs_free(sess->session.name); + sess->session.name = ogs_strdup(dnn_network_identifer); + ogs_assert(sess->session.name); + + if (sess->full_dnn) + ogs_free(sess->full_dnn); + sess->full_dnn = ogs_strdup(SmContextCreateData->dnn); + ogs_assert(sess->full_dnn); + + mcc = ogs_plmn_id_mcc_from_fqdn(sess->full_dnn); + mnc = ogs_plmn_id_mnc_from_fqdn(sess->full_dnn); + + /* + * To generate the Home PLMN ID of the SMF-UE, + * the length of the MNC is obtained + * by comparing the MNC part of the SUPI and full-DNN. + */ + if (mcc && mnc && + strncmp(smf_ue->supi, "imsi-", strlen("imsi-")) == 0) { + int mnc_len = 0; + char buf[OGS_PLMNIDSTRLEN]; + + ogs_snprintf(buf, OGS_PLMNIDSTRLEN, "%03d%02d", mcc, mnc); + if (strncmp(smf_ue->supi + 5, buf, strlen(buf)) == 0) + mnc_len = 2; + + ogs_snprintf(buf, OGS_PLMNIDSTRLEN, "%03d%03d", mcc, mnc); + if (strncmp(smf_ue->supi + 5, buf, strlen(buf)) == 0) + mnc_len = 3; + + /* Change Home PLMN for VPLMN */ + if (mnc_len == 2 || mnc_len == 3) + ogs_plmn_id_build(&sess->home_plmn_id, mcc, mnc, mnc_len); + } + } else { + if (sess->session.name) + ogs_free(sess->session.name); + sess->session.name = ogs_strdup(SmContextCreateData->dnn); + ogs_assert(sess->session.name); + + if (sess->full_dnn) + ogs_free(sess->full_dnn); + sess->full_dnn = NULL; + } } if (SmContextCreateData->pcf_id) { diff --git a/src/smf/nudm-build.c b/src/smf/nudm-build.c index adb87ca68..7ebeb1c9c 100644 --- a/src/smf/nudm-build.c +++ b/src/smf/nudm-build.c @@ -97,7 +97,7 @@ ogs_sbi_request_t *smf_nudm_uecm_build_registration( SmfRegistration.dnn = sess->session.name; - SmfRegistration.plmn_id = ogs_sbi_build_plmn_id(&sess->plmn_id); + SmfRegistration.plmn_id = ogs_sbi_build_plmn_id(&sess->serving_plmn_id); if (!SmfRegistration.plmn_id) { ogs_error("No memory : SmfRegistration.plmn_id"); goto end; diff --git a/src/smf/nudm-handler.c b/src/smf/nudm-handler.c index f4c60fd16..62b47ac40 100644 --- a/src/smf/nudm-handler.c +++ b/src/smf/nudm-handler.c @@ -354,7 +354,7 @@ bool smf_nudm_sdm_handle_get(smf_sess_t *sess, ogs_sbi_stream_t *stream, ogs_assert(response); ogs_assert(true == ogs_sbi_server_send_response(stream, response)); - smf_metrics_inst_by_slice_add(&sess->plmn_id, &sess->s_nssai, + smf_metrics_inst_by_slice_add(&sess->serving_plmn_id, &sess->s_nssai, SMF_METR_CTR_SM_PDUSESSIONCREATIONSUCC, 1); ogs_free(sendmsg.http.location); diff --git a/src/smf/pfcp-sm.c b/src/smf/pfcp-sm.c index b426f73a0..6d93ee59a 100644 --- a/src/smf/pfcp-sm.c +++ b/src/smf/pfcp-sm.c @@ -89,7 +89,7 @@ void smf_pfcp_state_will_associate(ogs_fsm_t *s, smf_event_t *e) case OGS_FSM_ENTRY_SIG: if (node->t_association) { ogs_timer_start(node->t_association, - ogs_app()->time.message.pfcp.association_interval); + ogs_local_conf()->time.message.pfcp.association_interval); ogs_pfcp_cp_send_association_setup_request(node, node_timeout); } @@ -107,12 +107,12 @@ void smf_pfcp_state_will_associate(ogs_fsm_t *s, smf_event_t *e) node = e->pfcp_node; ogs_assert(node); - ogs_warn("Retry to association with peer [%s]:%d failed", + ogs_warn("Retry association with peer [%s]:%d failed", OGS_ADDR(addr, buf), OGS_PORT(addr)); ogs_assert(node->t_association); ogs_timer_start(node->t_association, - ogs_app()->time.message.pfcp.association_interval); + ogs_local_conf()->time.message.pfcp.association_interval); ogs_pfcp_cp_send_association_setup_request(node, node_timeout); break; @@ -197,7 +197,7 @@ void smf_pfcp_state_associated(ogs_fsm_t *s, smf_event_t *e) OGS_ADDR(&node->addr, buf), OGS_PORT(&node->addr)); ogs_timer_start(node->t_no_heartbeat, - ogs_app()->time.message.pfcp.no_heartbeat_duration); + ogs_local_conf()->time.message.pfcp.no_heartbeat_duration); ogs_assert(OGS_OK == ogs_pfcp_send_heartbeat_request(node, node_timeout)); @@ -494,7 +494,7 @@ static void reselect_upf(ogs_pfcp_node_t *node) } if (iter == NULL) { - ogs_error("No UPF avaiable"); + ogs_error("No UPF available"); return; } diff --git a/src/smf/s5c-handler.c b/src/smf/s5c-handler.c index 86798a3c6..ea6cf8d41 100644 --- a/src/smf/s5c-handler.c +++ b/src/smf/s5c-handler.c @@ -228,7 +228,7 @@ uint8_t smf_s5c_handle_create_session_request( } /* Serving Network */ - ogs_nas_to_plmn_id(&sess->plmn_id, req->serving_network.data); + ogs_nas_to_plmn_id(&sess->serving_plmn_id, req->serving_network.data); /* Select PGW based on UE Location Information */ smf_sess_select_upf(sess); diff --git a/src/smf/s6b-path.c b/src/smf/s6b-path.c index 2d5a98cdc..0dff33901 100644 --- a/src/smf/s6b-path.c +++ b/src/smf/s6b-path.c @@ -223,8 +223,8 @@ void smf_s6b_send_aar(smf_sess_t *sess, ogs_gtp_xact_t *xact) /* Set the User-Name AVP */ user_name = ogs_msprintf("%s@nai.epc.mnc%03d.mcc%03d.3gppnetwork.org", smf_ue->imsi_bcd, - ogs_plmn_id_mnc(&sess->plmn_id), - ogs_plmn_id_mcc(&sess->plmn_id)); + ogs_plmn_id_mnc(&sess->serving_plmn_id), + ogs_plmn_id_mcc(&sess->serving_plmn_id)); ogs_assert(user_name); ret = fd_msg_avp_new(ogs_diam_user_name, 0, &avp); @@ -286,8 +286,8 @@ void smf_s6b_send_aar(smf_sess_t *sess, ogs_gtp_xact_t *xact) /* Set the Visited-Network-Identifier AVP */ visited_network_identifier = ogs_msprintf("mnc%03d.mcc%03d.3gppnetwork.org", - ogs_plmn_id_mnc(&sess->plmn_id), - ogs_plmn_id_mcc(&sess->plmn_id)); + ogs_plmn_id_mnc(&sess->serving_plmn_id), + ogs_plmn_id_mcc(&sess->serving_plmn_id)); ogs_assert(visited_network_identifier); ret = fd_msg_avp_new(ogs_diam_visited_network_identifier, 0, &avp); @@ -576,8 +576,8 @@ void smf_s6b_send_str(smf_sess_t *sess, ogs_gtp_xact_t *xact, uint32_t cause) /* Set the User-Name AVP */ user_name = ogs_msprintf("%s@nai.epc.mnc%03d.mcc%03d.3gppnetwork.org", smf_ue->imsi_bcd, - ogs_plmn_id_mnc(&sess->plmn_id), - ogs_plmn_id_mcc(&sess->plmn_id)); + ogs_plmn_id_mnc(&sess->serving_plmn_id), + ogs_plmn_id_mcc(&sess->serving_plmn_id)); ogs_assert(user_name); ret = fd_msg_avp_new(ogs_diam_user_name, 0, &avp); diff --git a/src/smf/sbi-path.c b/src/smf/sbi-path.c index 4f3f1afc8..fb0e89f4c 100644 --- a/src/smf/sbi-path.c +++ b/src/smf/sbi-path.c @@ -32,7 +32,7 @@ int smf_sbi_open(void) * If the SMF is only running in 4G EPC mode, * it should not send NFRegister/NFStatusSubscribe messages to the NRF. */ - if (ogs_list_count(&ogs_sbi_self()->server_list) == 0) + if (ogs_sbi_server_first() == NULL) return OGS_OK; /* Initialize SELF NF instance */ @@ -42,8 +42,8 @@ int smf_sbi_open(void) /* Build NF instance information. It will be transmitted to NRF. */ ogs_sbi_nf_instance_build_default(nf_instance); - 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_SCP); + ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_AMF); /* Build NF service information. It will be transmitted to NRF. */ if (ogs_sbi_nf_service_is_available(OGS_SBI_SERVICE_NAME_NSMF_PDUSESSION)) { @@ -61,6 +61,7 @@ int smf_sbi_open(void) ogs_sbi_nf_fsm_init(nf_instance); /* Setup Subscription-Data */ + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_SEPP, NULL); ogs_sbi_subscription_spec_add( OpenAPI_nf_type_NULL, OGS_SBI_SERVICE_NAME_NAMF_COMM); ogs_sbi_subscription_spec_add( @@ -96,16 +97,106 @@ int smf_sbi_discover_and_send( ogs_sbi_request_t *(*build)(smf_sess_t *sess, void *data), smf_sess_t *sess, ogs_sbi_stream_t *stream, int state, void *data) { + int r; smf_ue_t *smf_ue = NULL; ogs_sbi_xact_t *xact = NULL; - int r; + OpenAPI_nf_type_e target_nf_type = OpenAPI_nf_type_NULL; ogs_assert(service_type); + target_nf_type = ogs_sbi_service_type_to_nf_type(service_type); + ogs_assert(target_nf_type); ogs_assert(sess); smf_ue = sess->smf_ue; ogs_assert(smf_ue); ogs_assert(build); + /* + * Use ogs_sbi_supi_in_vplmn() instead of ogs_sbi_plmn_id_in_vplmn(). + * This is because some vendors might not use the full DNN in LBO and + * Open5GS cannot derive the home PLMN ID without the full DNN. + * + * 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. + * + * TS29.512 + * 5 Npcf_SMPolicyControl Service API + * 5.6 Data Model + * 5.6.2 Structured data types + * Table 5.6.2.3-1: Definition of type SmPolicyContextData + * + * NAME: dnn + * Data type: Dnn + * P: M + * Cardinality: 1 + * The DNN of the PDU session, a full DNN with both the Network Identifier + * and Operator Identifier, or a DNN with the Network Identifier only + */ + if (target_nf_type == OpenAPI_nf_type_UDM && + ogs_sbi_supi_in_vplmn(smf_ue->supi) == true) { + int i; + + /* TODO: PCF and UDM Selection + * + * FROM: Ultra Cloud Core 5G Session Management Function, + * Release 2023.04 - Configuration and Administration Guide + * https://www.cisco.com/c/en/us/td/docs/wireless/ucc/smf/2023-04/config-and-admin/b_ucc-5g-smf-config-and-admin-guide_2023-04/m_roaming-support.html#Cisco_Reference.dita_ed2a198e-b60d-4d77-b09c-932d82169c11https://www.cisco.com/c/en/us/td/docs/wireless/ucc/smf/2023-04/config-and-admin/b_ucc-5g-smf-config-and-admin-guide_2023-04/m_roaming-support.html#Cisco_Reference.dita_ed2a198e-b60d-4d77-b09c-932d82169c11 + * + * During roaming, the AMF selects both vPCF and hPCF and sends + * the vPCF ID and hPCF ID to the SMF and vPCF respectively + * during policy association. The SMF selects the PCF + * using the received vPCF ID. + * + * During AMF relocation, target AMF selects a new vPCF and hPCF. + * The SMF receives a redirection indication with PCF ID + * from the existing PCF for the PDU session. The SMF terminates + * the current SM Policy Control association and reselects + * a PCF based on the received PCF ID. + * + * The SMF then establishes an SM Policy Control association + * with the reselected PCF. + * + * For selection of PCF and UDM based on local configuration, + * the locally configured addresses map to the VPLMN and HPLMN + * respectively since the PCF is in VPLMN and the UDM is in HPLMN + * for roaming with LBO case. + * + * For NRF-based discovery of PCF and UDM, the query criteria includes + * VPLMN for PCF discovery and HPLMN for UDM discovery. The AMF sends + * the UDM group ID to enable the SMF to select UDM. + * + * The S-NSSAI used by SMF to select PCF should be the VPLMN S-NSSAI + * received from AMF. + */ + if (!discovery_option) { + discovery_option = ogs_sbi_discovery_option_new(); + ogs_assert(discovery_option); + } + + ogs_sbi_discovery_option_add_target_plmn_list( + discovery_option, &sess->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( + discovery_option, &ogs_local_conf()->serving_plmn_id[i]); + } + } + xact = ogs_sbi_xact_add( &sess->sbi, service_type, discovery_option, (ogs_sbi_build_f)build, sess, data); diff --git a/src/smf/smf-sm.c b/src/smf/smf-sm.c index 66b18ddbc..c0369fbea 100644 --- a/src/smf/smf-sm.c +++ b/src/smf/smf-sm.c @@ -314,7 +314,7 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) break; } - ogs_session_data_free(&gx_message->session_data); + OGS_SESSION_DATA_FREE(&gx_message->session_data); ogs_free(gx_message); break; diff --git a/src/udm/context.c b/src/udm/context.c index 1a009f382..4a2b73161 100644 --- a/src/udm/context.c +++ b/src/udm/context.c @@ -37,7 +37,7 @@ void udm_context_init(void) ogs_log_install_domain(&__udm_log_domain, "udm", ogs_core()->log.level); - ogs_pool_init(&udm_ue_pool, ogs_app()->max.ue); + ogs_pool_init(&udm_ue_pool, ogs_global_conf()->max.ue); ogs_pool_init(&udm_sess_pool, ogs_app()->pool.sess); ogs_list_init(&self.udm_ue_list); @@ -103,7 +103,13 @@ int udm_context_parse_config(void) while (ogs_yaml_iter_next(&udm_iter)) { const char *udm_key = ogs_yaml_iter_key(&udm_iter); ogs_assert(udm_key); - if (!strcmp(udm_key, "sbi")) { + if (!strcmp(udm_key, "default")) { + /* handle config in sbi library */ + } else if (!strcmp(udm_key, "sbi")) { + /* handle config in sbi library */ + } else if (!strcmp(udm_key, "nrf")) { + /* handle config in sbi library */ + } else if (!strcmp(udm_key, "scp")) { /* handle config in sbi library */ } else if (!strcmp(udm_key, "service_name")) { /* handle config in sbi library */ diff --git a/src/udm/init.c b/src/udm/init.c index 233d79b87..07eff108b 100644 --- a/src/udm/init.c +++ b/src/udm/init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -27,10 +27,14 @@ int udm_initialize(void) { int rv; +#define APP_NAME "udm" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + ogs_sbi_context_init(OpenAPI_nf_type_UDM); udm_context_init(); - rv = ogs_sbi_context_parse_config("udm", "nrf", "scp"); + rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp"); if (rv != OGS_OK) return rv; rv = udm_context_parse_config(); diff --git a/src/udm/nnrf-handler.c b/src/udm/nnrf-handler.c index 5782432d5..0c5cafb60 100644 --- a/src/udm/nnrf-handler.c +++ b/src/udm/nnrf-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019,2020 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * diff --git a/src/udm/sbi-path.c b/src/udm/sbi-path.c index 7d8e47e47..770c2b8e6 100644 --- a/src/udm/sbi-path.c +++ b/src/udm/sbi-path.c @@ -31,10 +31,10 @@ int udm_sbi_open(void) /* Build NF instance information. It will be transmitted to NRF. */ 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); ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_AUSF); - ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_SCP); /* Build NF service information. It will be transmitted to NRF. */ if (ogs_sbi_nf_service_is_available(OGS_SBI_SERVICE_NAME_NUDM_UEAU)) { @@ -72,7 +72,9 @@ int udm_sbi_open(void) ogs_sbi_nf_fsm_init(nf_instance); /* Setup Subscription-Data */ - ogs_sbi_subscription_spec_add(OpenAPI_nf_type_UDR, NULL); + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_SEPP, NULL); + ogs_sbi_subscription_spec_add( + OpenAPI_nf_type_NULL, OGS_SBI_SERVICE_NAME_NUDR_DR); if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) return OGS_ERROR; diff --git a/src/udr/context.c b/src/udr/context.c index ba679dfd8..de1755d0e 100644 --- a/src/udr/context.c +++ b/src/udr/context.c @@ -82,7 +82,13 @@ int udr_context_parse_config(void) while (ogs_yaml_iter_next(&udr_iter)) { const char *udr_key = ogs_yaml_iter_key(&udr_iter); ogs_assert(udr_key); - if (!strcmp(udr_key, "sbi")) { + if (!strcmp(udr_key, "default")) { + /* handle config in sbi library */ + } else if (!strcmp(udr_key, "sbi")) { + /* handle config in sbi library */ + } else if (!strcmp(udr_key, "nrf")) { + /* handle config in sbi library */ + } else if (!strcmp(udr_key, "scp")) { /* handle config in sbi library */ } else if (!strcmp(udr_key, "service_name")) { /* handle config in sbi library */ diff --git a/src/udr/init.c b/src/udr/init.c index 218cdf512..99965ad7d 100644 --- a/src/udr/init.c +++ b/src/udr/init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -27,10 +27,14 @@ int udr_initialize(void) { int rv; +#define APP_NAME "udr" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + ogs_sbi_context_init(OpenAPI_nf_type_UDR); udr_context_init(); - rv = ogs_sbi_context_parse_config("udr", "nrf", "scp"); + rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp"); if (rv != OGS_OK) return rv; rv = udr_context_parse_config(); diff --git a/src/udr/sbi-path.c b/src/udr/sbi-path.c index e8fcfd331..51613867b 100644 --- a/src/udr/sbi-path.c +++ b/src/udr/sbi-path.c @@ -31,9 +31,9 @@ int udr_sbi_open(void) /* Build NF instance information. It will be transmitted to NRF. */ 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_PCF); ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_UDM); - ogs_sbi_nf_instance_add_allowed_nf_type(nf_instance, OpenAPI_nf_type_SCP); /* Build NF service information. It will be transmitted to NRF. */ if (ogs_sbi_nf_service_is_available(OGS_SBI_SERVICE_NAME_NUDR_DR)) { @@ -51,6 +51,9 @@ int udr_sbi_open(void) if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); + /* Setup Subscription-Data */ + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_SEPP, NULL); + if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) return OGS_ERROR; diff --git a/src/upf/context.c b/src/upf/context.c index 61bf58cb1..a061a49e4 100644 --- a/src/upf/context.c +++ b/src/upf/context.c @@ -115,11 +115,11 @@ static int upf_context_prepare(void) static int upf_context_validation(void) { if (ogs_list_first(&ogs_gtp_self()->gtpu_list) == NULL) { - ogs_error("No upf.gtpu in '%s'", ogs_app()->file); + ogs_error("No upf.gtpu.address in '%s'", ogs_app()->file); return OGS_ERROR; } if (ogs_list_first(&ogs_pfcp_self()->subnet_list) == NULL) { - ogs_error("No upf.subnet: in '%s'", ogs_app()->file); + ogs_error("No upf.session.subnet: in '%s'", ogs_app()->file); return OGS_ERROR; } return OGS_OK; @@ -151,7 +151,9 @@ int upf_context_parse_config(void) /* handle config in gtp library */ } else if (!strcmp(upf_key, "pfcp")) { /* handle config in pfcp library */ - } else if (!strcmp(upf_key, "subnet")) { + } else if (!strcmp(upf_key, "smf")) { + /* handle config in pfcp library */ + } else if (!strcmp(upf_key, "session")) { /* handle config in pfcp library */ } else if (!strcmp(upf_key, "metrics")) { /* handle config in metrics library */ diff --git a/src/upf/gtp-path.c b/src/upf/gtp-path.c index 0d6e20d0e..d2fef084d 100644 --- a/src/upf/gtp-path.c +++ b/src/upf/gtp-path.c @@ -203,7 +203,7 @@ static void _gtpv1_tun_recv_common_cb( pdr = fallback_pdr; if (!pdr) { - if (ogs_app()->parameter.multicast) { + if (ogs_global_conf()->parameter.multicast) { upf_gtp_handle_multicast(recvbuf); } goto cleanup; @@ -409,8 +409,8 @@ static void _gtpv1_u_recv_cb(short when, ogs_socket_t fd, void *data) */ if (ogs_time_ntp32_now() > (ogs_pfcp_self()->local_recovery + - ogs_time_sec( - ogs_app()->time.message.pfcp.association_interval))) { + ogs_time_sec(ogs_local_conf()->time.message.pfcp. + association_interval))) { ogs_error("[%s] Send Error Indication [TEID:0x%x] to [%s]", OGS_ADDR(&sock->local_addr, buf1), header_desc.teid, @@ -469,7 +469,7 @@ static void _gtpv1_u_recv_cb(short when, ogs_socket_t fd, void *data) */ if (ogs_time_ntp32_now() > (ogs_pfcp_self()->local_recovery + - ogs_time_sec(ogs_app()->time.message.pfcp. + ogs_time_sec(ogs_local_conf()->time.message.pfcp. association_interval))) { ogs_error( "[%s] Send Error Indication [TEID:0x%x] to [%s]", @@ -867,7 +867,7 @@ static void upf_gtp_handle_multicast(ogs_pkbuf_t *recvbuf) /* IPv6 Multicast */ ogs_list_for_each(&upf_self()->sess_list, sess) { if (sess->ipv6) { - /* PDN IPv6 is avaiable */ + /* PDN IPv6 is available */ ogs_pfcp_pdr_t *pdr = NULL; ogs_list_for_each(&sess->pfcp.pdr_list, pdr) { diff --git a/src/upf/init.c b/src/upf/init.c index eba2ba3ee..ec14d4f35 100644 --- a/src/upf/init.c +++ b/src/upf/init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -31,6 +31,10 @@ int upf_initialize(void) { int rv; +#define APP_NAME "upf" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + upf_metrics_init(); ogs_gtp_context_init(OGS_MAX_NUM_OF_GTPU_RESOURCE); @@ -43,13 +47,13 @@ int upf_initialize(void) rv = ogs_pfcp_xact_init(); if (rv != OGS_OK) return rv; - rv = ogs_gtp_context_parse_config("upf", "smf"); + rv = ogs_gtp_context_parse_config(APP_NAME, "smf"); if (rv != OGS_OK) return rv; - rv = ogs_pfcp_context_parse_config("upf", "smf"); + rv = ogs_pfcp_context_parse_config(APP_NAME, "smf"); if (rv != OGS_OK) return rv; - rv = ogs_metrics_context_parse_config("upf"); + rv = ogs_metrics_context_parse_config(APP_NAME); if (rv != OGS_OK) return rv; rv = upf_context_parse_config(); diff --git a/src/upf/pfcp-sm.c b/src/upf/pfcp-sm.c index 980bcb60d..ba8d1ed7d 100644 --- a/src/upf/pfcp-sm.c +++ b/src/upf/pfcp-sm.c @@ -86,7 +86,7 @@ void upf_pfcp_state_will_associate(ogs_fsm_t *s, upf_event_t *e) case OGS_FSM_ENTRY_SIG: if (node->t_association) { ogs_timer_start(node->t_association, - ogs_app()->time.message.pfcp.association_interval); + ogs_local_conf()->time.message.pfcp.association_interval); ogs_pfcp_up_send_association_setup_request(node, node_timeout); } @@ -104,12 +104,12 @@ void upf_pfcp_state_will_associate(ogs_fsm_t *s, upf_event_t *e) addr = node->sa_list; ogs_assert(addr); - ogs_warn("Retry to association with peer [%s]:%d failed", + ogs_warn("Retry association with peer [%s]:%d failed", OGS_ADDR(addr, buf), OGS_PORT(addr)); ogs_assert(node->t_association); ogs_timer_start(node->t_association, - ogs_app()->time.message.pfcp.association_interval); + ogs_local_conf()->time.message.pfcp.association_interval); ogs_pfcp_up_send_association_setup_request(node, node_timeout); break; @@ -185,7 +185,7 @@ void upf_pfcp_state_associated(ogs_fsm_t *s, upf_event_t *e) OGS_ADDR(&node->addr, buf), OGS_PORT(&node->addr)); ogs_timer_start(node->t_no_heartbeat, - ogs_app()->time.message.pfcp.no_heartbeat_duration); + ogs_local_conf()->time.message.pfcp.no_heartbeat_duration); ogs_assert(OGS_OK == ogs_pfcp_send_heartbeat_request(node, node_timeout)); diff --git a/tests/af/context.c b/tests/af/context.c index 48a59d922..21d4e2156 100644 --- a/tests/af/context.c +++ b/tests/af/context.c @@ -109,7 +109,13 @@ int af_context_parse_config(void) while (ogs_yaml_iter_next(&af_iter)) { const char *af_key = ogs_yaml_iter_key(&af_iter); ogs_assert(af_key); - if (!strcmp(af_key, "sbi")) { + if (!strcmp(af_key, "default")) { + /* handle config in sbi library */ + } else if (!strcmp(af_key, "sbi")) { + /* handle config in sbi library */ + } else if (!strcmp(af_key, "nrf")) { + /* handle config in sbi library */ + } else if (!strcmp(af_key, "scp")) { /* handle config in sbi library */ } else if (!strcmp(af_key, "service_name")) { /* handle config in sbi library */ @@ -266,76 +272,34 @@ af_sess_t *af_sess_find_by_pcf_app_session_id(char *pcf_app_session_id) pcf_app_session_id, strlen(pcf_app_session_id)); } -static ogs_sbi_client_t *find_client_by_fqdn( - OpenAPI_uri_scheme_e scheme, char *fqdn) -{ - int rv; - ogs_sockaddr_t *addr = NULL; - ogs_sbi_client_t *client = NULL; - - ogs_assert(scheme == OpenAPI_uri_scheme_https || - scheme == OpenAPI_uri_scheme_http); - ogs_assert(fqdn); - - rv = ogs_getaddrinfo( - &addr, AF_UNSPEC, fqdn, - scheme == OpenAPI_uri_scheme_https ? - OGS_SBI_HTTPS_PORT : OGS_SBI_HTTP_PORT, - 0); - if (rv != OGS_OK) { - ogs_error("Invalid NFProfile.fqdn"); - return NULL; - } - - client = ogs_sbi_client_find(scheme, addr); - if (!client) { - ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); - client = ogs_sbi_client_add(scheme, addr); - if (!client) { - char buf[OGS_ADDRSTRLEN]; - ogs_error("%s: ogs_sbi_client_add() failed [%s]:%d", - OGS_FUNC, OGS_ADDR(addr, buf), OGS_PORT(addr)); - ogs_freeaddrinfo(addr); - return NULL; - } - } - - ogs_freeaddrinfo(addr); - - return client; -} - void af_sess_associate_pcf_client(af_sess_t *sess) { ogs_sbi_client_t *client = NULL; - ogs_sockaddr_t *addr = NULL; + ogs_sockaddr_t *addr = NULL, *addr6 = NULL; OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; ogs_assert(sess); - scheme = ogs_app()->sbi.client.no_tls == false ? - OpenAPI_uri_scheme_https : OpenAPI_uri_scheme_http; - - if (sess->pcf.fqdn && strlen(sess->pcf.fqdn)) - client = find_client_by_fqdn(scheme, sess->pcf.fqdn); + scheme = ogs_sbi_self()->tls.client.scheme; + ogs_assert(scheme); if (!client) { /* At this point, CLIENT selection method is very simple. */ if (sess->pcf.num_of_ip) { - addr = sess->pcf.ip[0].addr6; - if (!addr) - addr = sess->pcf.ip[0].addr; + addr = sess->pcf.ip[0].addr; + addr6 = sess->pcf.ip[0].addr6; } - if (addr) { - client = ogs_sbi_client_find(scheme, addr); + if (sess->pcf.fqdn || addr || addr6) { + client = ogs_sbi_client_find( + scheme, sess->pcf.fqdn, 0, addr, addr6); if (!client) { ogs_debug("%s: ogs_sbi_client_add()", OGS_FUNC); - client = ogs_sbi_client_add(scheme, addr); + client = ogs_sbi_client_add( + scheme, sess->pcf.fqdn, 0, addr, addr6); if (!client) { - char buf[OGS_ADDRSTRLEN]; - ogs_error("%s: ogs_sbi_client_add() failed [%s]:%d", - OGS_FUNC, OGS_ADDR(addr, buf), OGS_PORT(addr)); + ogs_error("%s: ogs_sbi_client_add() failed", OGS_FUNC); + return; } } } diff --git a/tests/af/init.c b/tests/af/init.c index 06caa127b..e3f733f9e 100644 --- a/tests/af/init.c +++ b/tests/af/init.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * @@ -27,14 +27,28 @@ static int initialized = 0; int af_initialize(void) { + bool no_scp, no_nrf; int rv; +#define APP_NAME "af" + rv = ogs_app_parse_local_conf(APP_NAME); + if (rv != OGS_OK) return rv; + ogs_sbi_context_init(OpenAPI_nf_type_AF); af_context_init(); - rv = ogs_sbi_context_parse_config("af", "nrf", "scp"); + no_scp = ogs_global_conf()->parameter.no_scp; + no_nrf = ogs_global_conf()->parameter.no_nrf; + + ogs_global_conf()->parameter.no_scp = false; + ogs_global_conf()->parameter.no_nrf = false; + + rv = ogs_sbi_context_parse_config(APP_NAME, "nrf", "scp"); if (rv != OGS_OK) return rv; + ogs_global_conf()->parameter.no_scp = no_scp; + ogs_global_conf()->parameter.no_nrf = no_nrf; + rv = af_context_parse_config(); if (rv != OGS_OK) return rv; diff --git a/tests/af/nbsf-handler.c b/tests/af/nbsf-handler.c index 57a14eeea..69b201735 100644 --- a/tests/af/nbsf-handler.c +++ b/tests/af/nbsf-handler.c @@ -68,19 +68,27 @@ void af_nbsf_management_handle_pcf_binding( if (sess->pcf.num_of_ip < OGS_SBI_MAX_NUM_OF_IP_ADDRESS) { if (!IpEndPoint->is_port) - port = ogs_sbi_client_default_port(); + port = ogs_sbi_default_client_port(OpenAPI_uri_scheme_NULL); else port = IpEndPoint->port; if (IpEndPoint->ipv4_address) { rv = ogs_getaddrinfo(&addr, AF_UNSPEC, IpEndPoint->ipv4_address, port, 0); - if (rv != OGS_OK) continue; + if (rv != OGS_OK) { + ogs_error("ogs_getaddrinfo[%s] failed", + IpEndPoint->ipv4_address); + continue; + } } if (IpEndPoint->ipv6_address) { rv = ogs_getaddrinfo(&addr6, AF_UNSPEC, IpEndPoint->ipv6_address, port, 0); - if (rv != OGS_OK) continue; + if (rv != OGS_OK) { + ogs_error("ogs_getaddrinfo[%s] failed", + IpEndPoint->ipv6_address); + continue; + } } if (addr || addr6) { diff --git a/tests/af/nnrf-handler.c b/tests/af/nnrf-handler.c index 08f0fa3f1..ccdf90a68 100644 --- a/tests/af/nnrf-handler.c +++ b/tests/af/nnrf-handler.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee + * Copyright (C) 2019-2023 by Sukchan Lee * * This file is part of Open5GS. * diff --git a/tests/af/npcf-build.c b/tests/af/npcf-build.c index 1d1ba9990..45ae43209 100644 --- a/tests/af/npcf-build.c +++ b/tests/af/npcf-build.c @@ -75,7 +75,7 @@ ogs_sbi_request_t *af_npcf_policyauthorization_build_create( memset(&AscReqData, 0, sizeof(AscReqData)); - server = ogs_list_first(&ogs_sbi_self()->server_list); + server = ogs_sbi_server_first(); ogs_assert(server); memset(&header, 0, sizeof(header)); @@ -678,7 +678,7 @@ ogs_sbi_request_t *af_npcf_policyauthorization_build_create_video( memset(&AscReqData, 0, sizeof(AscReqData)); - server = ogs_list_first(&ogs_sbi_self()->server_list); + server = ogs_sbi_server_first(); ogs_assert(server); memset(&header, 0, sizeof(header)); diff --git a/tests/af/sbi-path.c b/tests/af/sbi-path.c index 7615f5059..4059c8a9f 100644 --- a/tests/af/sbi-path.c +++ b/tests/af/sbi-path.c @@ -92,6 +92,7 @@ void af_sbi_send_to_pcf( af_sess_t *sess, void *data, ogs_sbi_request_t *(*build)(af_sess_t *sess, void *data)) { + bool rc; ogs_sbi_request_t *request = NULL; ogs_sbi_client_t *client = NULL; @@ -102,8 +103,9 @@ void af_sbi_send_to_pcf( request = (*build)(sess, data); ogs_assert(request); - ogs_sbi_send_request_to_client( + rc = ogs_sbi_send_request_to_client( client, ogs_sbi_client_handler, request, sess); + ogs_expect(rc == true); ogs_sbi_request_free(request); } diff --git a/tests/app/5gc-init.c b/tests/app/5gc-init.c index dfdcac093..94c19b067 100644 --- a/tests/app/5gc-init.c +++ b/tests/app/5gc-init.c @@ -21,6 +21,7 @@ static ogs_thread_t *nrf_thread = NULL; static ogs_thread_t *scp_thread = NULL; +static ogs_thread_t *sepp_thread = NULL; static ogs_thread_t *upf_thread = NULL; static ogs_thread_t *smf_thread = NULL; static ogs_thread_t *amf_thread = NULL; @@ -51,30 +52,32 @@ int app_initialize(const char *const argv[]) argv_out[i] = NULL; } - if (ogs_app()->parameter.no_nrf == 0) + if (ogs_global_conf()->parameter.no_nrf == 0) nrf_thread = test_child_create("nrf", argv_out); - if (ogs_app()->parameter.no_scp == 0) + if (ogs_global_conf()->parameter.no_scp == 0) scp_thread = test_child_create("scp", argv_out); + if (ogs_global_conf()->parameter.no_sepp == 0) + sepp_thread = test_child_create("sepp", argv_out); - if (ogs_app()->parameter.no_upf == 0) + if (ogs_global_conf()->parameter.no_upf == 0) upf_thread = test_child_create("upf", argv_out); - if (ogs_app()->parameter.no_smf == 0) + if (ogs_global_conf()->parameter.no_smf == 0) smf_thread = test_child_create("smf", argv_out); - if (ogs_app()->parameter.no_amf == 0) + if (ogs_global_conf()->parameter.no_amf == 0) amf_thread = test_child_create("amf", argv_out); - if (ogs_app()->parameter.no_ausf == 0) + if (ogs_global_conf()->parameter.no_ausf == 0) ausf_thread = test_child_create("ausf", argv_out); - if (ogs_app()->parameter.no_udm == 0) + if (ogs_global_conf()->parameter.no_udm == 0) udm_thread = test_child_create("udm", argv_out); - if (ogs_app()->parameter.no_pcf == 0) + if (ogs_global_conf()->parameter.no_pcf == 0) pcf_thread = test_child_create("pcf", argv_out); - if (ogs_app()->parameter.no_nssf == 0) + if (ogs_global_conf()->parameter.no_nssf == 0) nssf_thread = test_child_create("nssf", argv_out); - if (ogs_app()->parameter.no_bsf == 0) + if (ogs_global_conf()->parameter.no_bsf == 0) bsf_thread = test_child_create("bsf", argv_out); - if (ogs_app()->parameter.no_udr == 0) + if (ogs_global_conf()->parameter.no_udr == 0) udr_thread = test_child_create("udr", argv_out); /* @@ -101,6 +104,7 @@ void app_terminate(void) if (udm_thread) ogs_thread_destroy(udm_thread); if (ausf_thread) ogs_thread_destroy(ausf_thread); + if (sepp_thread) ogs_thread_destroy(sepp_thread); if (scp_thread) ogs_thread_destroy(scp_thread); if (nrf_thread) ogs_thread_destroy(nrf_thread); } diff --git a/tests/app/app-init.c b/tests/app/app-init.c index d53601ec4..a23b03171 100644 --- a/tests/app/app-init.c +++ b/tests/app/app-init.c @@ -21,6 +21,7 @@ static ogs_thread_t *nrf_thread = NULL; static ogs_thread_t *scp_thread = NULL; +static ogs_thread_t *sepp_thread = NULL; static ogs_thread_t *pcrf_thread = NULL; static ogs_thread_t *hss_thread = NULL; static ogs_thread_t *upf_thread = NULL; @@ -56,41 +57,43 @@ int app_initialize(const char *const argv[]) argv_out[i] = NULL; } - if (ogs_app()->parameter.no_nrf == 0) + if (ogs_global_conf()->parameter.no_nrf == 0) nrf_thread = test_child_create("nrf", argv_out); - if (ogs_app()->parameter.no_scp == 0) + if (ogs_global_conf()->parameter.no_scp == 0) scp_thread = test_child_create("scp", argv_out); - if (ogs_app()->parameter.no_hss == 0) + if (ogs_global_conf()->parameter.no_sepp == 0) + sepp_thread = test_child_create("sepp", argv_out); + if (ogs_global_conf()->parameter.no_hss == 0) hss_thread = test_child_create("hss", argv_out); - if (ogs_app()->parameter.no_pcrf == 0) + if (ogs_global_conf()->parameter.no_pcrf == 0) pcrf_thread = test_child_create("pcrf", argv_out); - if (ogs_app()->parameter.no_upf == 0) + if (ogs_global_conf()->parameter.no_upf == 0) upf_thread = test_child_create("upf", argv_out); - if (ogs_app()->parameter.no_sgwu == 0) + if (ogs_global_conf()->parameter.no_sgwu == 0) sgwu_thread = test_child_create("sgwu", argv_out); - if (ogs_app()->parameter.no_smf == 0) + if (ogs_global_conf()->parameter.no_smf == 0) smf_thread = test_child_create("smf", argv_out); - if (ogs_app()->parameter.no_sgwc == 0) + if (ogs_global_conf()->parameter.no_sgwc == 0) sgwc_thread = test_child_create("sgwc", argv_out); - if (ogs_app()->parameter.no_mme == 0) + if (ogs_global_conf()->parameter.no_mme == 0) mme_thread = test_child_create("mme", argv_out); - if (ogs_app()->parameter.no_amf == 0) + if (ogs_global_conf()->parameter.no_amf == 0) amf_thread = test_child_create("amf", argv_out); - if (ogs_app()->parameter.no_ausf == 0) + if (ogs_global_conf()->parameter.no_ausf == 0) ausf_thread = test_child_create("ausf", argv_out); - if (ogs_app()->parameter.no_udm == 0) + if (ogs_global_conf()->parameter.no_udm == 0) udm_thread = test_child_create("udm", argv_out); - if (ogs_app()->parameter.no_pcf == 0) + if (ogs_global_conf()->parameter.no_pcf == 0) pcf_thread = test_child_create("pcf", argv_out); - if (ogs_app()->parameter.no_nssf == 0) + if (ogs_global_conf()->parameter.no_nssf == 0) nssf_thread = test_child_create("nssf", argv_out); - if (ogs_app()->parameter.no_bsf == 0) + if (ogs_global_conf()->parameter.no_bsf == 0) bsf_thread = test_child_create("bsf", argv_out); - if (ogs_app()->parameter.no_udr == 0) + if (ogs_global_conf()->parameter.no_udr == 0) udr_thread = test_child_create("udr", argv_out); /* @@ -124,6 +127,7 @@ void app_terminate(void) if (hss_thread) ogs_thread_destroy(hss_thread); if (pcrf_thread) ogs_thread_destroy(pcrf_thread); + if (sepp_thread) ogs_thread_destroy(sepp_thread); if (scp_thread) ogs_thread_destroy(scp_thread); if (nrf_thread) ogs_thread_destroy(nrf_thread); } diff --git a/tests/app/epc-init.c b/tests/app/epc-init.c index 7d27ad594..eaf3ab2c5 100644 --- a/tests/app/epc-init.c +++ b/tests/app/epc-init.c @@ -47,22 +47,22 @@ int app_initialize(const char *const argv[]) argv_out[i] = NULL; } - if (ogs_app()->parameter.no_hss == 0) + if (ogs_global_conf()->parameter.no_hss == 0) hss_thread = test_child_create("hss", argv_out); - if (ogs_app()->parameter.no_pcrf == 0) + if (ogs_global_conf()->parameter.no_pcrf == 0) pcrf_thread = test_child_create("pcrf", argv_out); - if (ogs_app()->parameter.no_upf == 0) + if (ogs_global_conf()->parameter.no_upf == 0) upf_thread = test_child_create("upf", argv_out); - if (ogs_app()->parameter.no_sgwu == 0) + if (ogs_global_conf()->parameter.no_sgwu == 0) sgwu_thread = test_child_create("sgwu", argv_out); - if (ogs_app()->parameter.no_smf == 0) + if (ogs_global_conf()->parameter.no_smf == 0) smf_thread = test_child_create("smf", argv_out); - if (ogs_app()->parameter.no_sgwc == 0) + if (ogs_global_conf()->parameter.no_sgwc == 0) sgwc_thread = test_child_create("sgwc", argv_out); - if (ogs_app()->parameter.no_mme == 0) + if (ogs_global_conf()->parameter.no_mme == 0) mme_thread = test_child_create("mme", argv_out); /* diff --git a/tests/common/application.c b/tests/common/application.c index f934fe514..4ef3a0a00 100644 --- a/tests/common/application.c +++ b/tests/common/application.c @@ -68,6 +68,9 @@ void test_app_run(int argc, const char *const argv[], run(argc, argv, name, init); + rv = ogs_app_parse_local_conf("test"); + ogs_assert(rv == OGS_OK); + test_context_init(); rv = test_context_parse_config(); diff --git a/tests/common/context.c b/tests/common/context.c index 6803681cc..84a5ba34b 100644 --- a/tests/common/context.c +++ b/tests/common/context.c @@ -37,7 +37,7 @@ void test_context_init(void) /* Initialize AMF context */ memset(&self, 0, sizeof(test_context_t)); - ogs_pool_init(&test_ue_pool, ogs_app()->max.ue); + ogs_pool_init(&test_ue_pool, ogs_global_conf()->max.ue); ogs_pool_init(&test_sess_pool, ogs_app()->pool.sess); ogs_pool_init(&test_bearer_pool, ogs_app()->pool.bearer); @@ -147,6 +147,15 @@ static int test_context_validation(void) OGS_PLMN_ID_LEN); test_self()->nr_cgi.cell_id = 0x40001; + if (ogs_plmn_id_mcc(&ogs_local_conf()->serving_plmn_id) == 0) { + ogs_error("No PLMN-ID(MCC)"); + return OGS_ERROR; + } + if (ogs_plmn_id_mnc(&ogs_local_conf()->serving_plmn_id) == 0) { + ogs_error("No PLMN-ID(MNC)"); + return OGS_ERROR; + } + return OGS_OK; } @@ -173,126 +182,143 @@ int test_context_parse_config(void) const char *amf_key = ogs_yaml_iter_key(&amf_iter); ogs_assert(amf_key); if (!strcmp(amf_key, "ngap")) { - ogs_yaml_iter_t ngap_array, ngap_iter; - ogs_yaml_iter_recurse(&amf_iter, &ngap_array); - do { - int family = AF_UNSPEC; - int i, num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = self.ngap_port; - const char *dev = NULL; - ogs_sockaddr_t *addr = NULL; + ogs_yaml_iter_t ngap_iter; + ogs_yaml_iter_recurse(&amf_iter, &ngap_iter); + while (ogs_yaml_iter_next(&ngap_iter)) { + const char *ngap_key = ogs_yaml_iter_key(&ngap_iter); + ogs_assert(ngap_key); + if (!strcmp(ngap_key, "server")) { + ogs_yaml_iter_t server_iter, server_array; + ogs_yaml_iter_recurse(&ngap_iter, &server_array); + do { + int family = AF_UNSPEC; + int i, num = 0; + const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; + uint16_t port = self.ngap_port; + const char *dev = NULL; + ogs_sockaddr_t *addr = NULL; - ogs_sockopt_t option; - bool is_option = false; + ogs_sockopt_t option; + bool is_option = false; - if (ogs_yaml_iter_type(&ngap_array) == - YAML_MAPPING_NODE) { - memcpy(&ngap_iter, &ngap_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(&ngap_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&ngap_array)) - break; - ogs_yaml_iter_recurse(&ngap_array, &ngap_iter); - } else if (ogs_yaml_iter_type(&ngap_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); + if (ogs_yaml_iter_type(&server_array) == + YAML_MAPPING_NODE) { + memcpy(&server_iter, &server_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&server_array)) + break; + ogs_yaml_iter_recurse( + &server_array, &server_iter); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); - while (ogs_yaml_iter_next(&ngap_iter)) { - const char *ngap_key = - ogs_yaml_iter_key(&ngap_iter); - ogs_assert(ngap_key); - if (!strcmp(ngap_key, "family")) { - const char *v = ogs_yaml_iter_value(&ngap_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; + while (ogs_yaml_iter_next(&server_iter)) { + const char *server_key = + ogs_yaml_iter_key(&server_iter); + ogs_assert(server_key); + if (!strcmp(server_key, "family")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) family = atoi(v); + if (family != AF_UNSPEC && + family != AF_INET && + family != AF_INET6) { + ogs_warn("Ignore family(%d) : " + "AF_UNSPEC(%d), " + "AF_INET(%d), AF_INET6(%d) ", + family, + AF_UNSPEC, AF_INET, AF_INET6); + family = AF_UNSPEC; + } + } else if (!strcmp(server_key, "address")) { + ogs_yaml_iter_t hostname_iter; + ogs_yaml_iter_recurse( + &server_iter, &hostname_iter); + ogs_assert(ogs_yaml_iter_type( + &hostname_iter) != + YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &hostname_iter)) + break; + } + + ogs_assert(num < + OGS_MAX_NUM_OF_HOSTNAME); + hostname[num++] = + ogs_yaml_iter_value( + &hostname_iter); + } while ( + ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(server_key, "port")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) port = atoi(v); + } else if (!strcmp(server_key, "dev")) { + dev = ogs_yaml_iter_value(&server_iter); + } else if (!strcmp(server_key, "option")) { + rv = ogs_app_parse_sockopt_config( + &server_iter, &option); + if (rv != OGS_OK) { + ogs_error("ogs_app_parse_sockopt_" + "config() failed"); + return rv; + } + is_option = true; + } else + ogs_warn("unknown key `%s`", + server_key); } - } else if (!strcmp(ngap_key, "addr") || - !strcmp(ngap_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse( - &ngap_iter, &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&hostname_iter)) - break; - } + addr = NULL; + for (i = 0; i < num; i++) { + rv = ogs_addaddrinfo(&addr, + family, hostname[i], port, 0); + ogs_assert(rv == OGS_OK); + } - ogs_assert(num <= OGS_MAX_NUM_OF_HOSTNAME); - hostname[num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(ngap_key, "port")) { - const char *v = ogs_yaml_iter_value(&ngap_iter); - if (v) port = atoi(v); - } else if (!strcmp(ngap_key, "dev")) { - dev = ogs_yaml_iter_value(&ngap_iter); - } else if (!strcmp(ngap_key, "option")) { - rv = ogs_app_config_parse_sockopt( - &ngap_iter, &option); - if (rv != OGS_OK) return rv; - is_option = true; - } else - ogs_warn("unknown key `%s`", ngap_key); - } + if (addr) { + if (ogs_global_conf()->parameter. + no_ipv4 == 0) + ogs_socknode_add( + &self.ngap_list, AF_INET, addr, + is_option ? &option : NULL); + if (ogs_global_conf()->parameter. + no_ipv6 == 0) + ogs_socknode_add( + &self.ngap_list6, AF_INET6, addr, + is_option ? &option : NULL); + ogs_freeaddrinfo(addr); + } - addr = NULL; - for (i = 0; i < num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } + if (dev) { + rv = ogs_socknode_probe( + ogs_global_conf()->parameter. + no_ipv4 ? + NULL : &self.ngap_list, + ogs_global_conf()->parameter. + no_ipv6 ? + NULL : &self.ngap_list6, + dev, port, + is_option ? &option : NULL); + ogs_assert(rv == OGS_OK); + } - if (addr) { - if (ogs_app()->parameter.no_ipv4 == 0) - ogs_socknode_add( - &self.ngap_list, AF_INET, addr, - is_option ? &option : NULL); - if (ogs_app()->parameter.no_ipv6 == 0) - ogs_socknode_add( - &self.ngap_list6, AF_INET6, addr, - is_option ? &option : NULL); - ogs_freeaddrinfo(addr); - } - - if (dev) { - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? - NULL : &self.ngap_list, - ogs_app()->parameter.no_ipv6 ? - NULL : &self.ngap_list6, - dev, port, - is_option ? &option : NULL); - ogs_assert(rv == OGS_OK); - } - - } while (ogs_yaml_iter_type(&ngap_array) == - YAML_SEQUENCE_NODE); - - if (ogs_list_first(&self.ngap_list) == NULL && - ogs_list_first(&self.ngap_list6) == NULL) { - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? - NULL : &self.ngap_list, - ogs_app()->parameter.no_ipv6 ? - NULL : &self.ngap_list6, - NULL, self.ngap_port, NULL); - ogs_assert(rv == OGS_OK); + } while (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE); + } else + ogs_warn("unknown key `%s`", ngap_key); } } else if (!strcmp(amf_key, "tai")) { int num_of_list0 = 0; @@ -621,7 +647,14 @@ int test_context_parse_config(void) } } while (ogs_yaml_iter_type(&plmn_support_array) == YAML_SEQUENCE_NODE); - } + } else if (!strcmp(amf_key, "sbi")) { + /* handle config in sbi library */ + } else if (!strcmp(amf_key, "nrf")) { + /* handle config in sbi library */ + } else if (!strcmp(amf_key, "scp")) { + /* handle config in sbi library */ + } else + ogs_warn("unknown key `%s`", amf_key); } } else if (!strcmp(root_key, "mme")) { ogs_yaml_iter_t mme_iter; @@ -630,126 +663,142 @@ int test_context_parse_config(void) const char *mme_key = ogs_yaml_iter_key(&mme_iter); ogs_assert(mme_key); if (!strcmp(mme_key, "s1ap")) { - ogs_yaml_iter_t s1ap_array, s1ap_iter; - ogs_yaml_iter_recurse(&mme_iter, &s1ap_array); - do { - int family = AF_UNSPEC; - int i, num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = self.s1ap_port; - const char *dev = NULL; - ogs_sockaddr_t *addr = NULL; + ogs_yaml_iter_t s1ap_iter; + ogs_yaml_iter_recurse(&mme_iter, &s1ap_iter); + while (ogs_yaml_iter_next(&s1ap_iter)) { + const char *s1ap_key = ogs_yaml_iter_key(&s1ap_iter); + ogs_assert(s1ap_key); + if (!strcmp(s1ap_key, "server")) { + ogs_yaml_iter_t server_iter, server_array; + ogs_yaml_iter_recurse(&s1ap_iter, &server_array); + do { + int family = AF_UNSPEC; + int i, num = 0; + const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; + uint16_t port = self.s1ap_port; + const char *dev = NULL; + ogs_sockaddr_t *addr = NULL; - ogs_sockopt_t option; - bool is_option = false; + ogs_sockopt_t option; + bool is_option = false; - if (ogs_yaml_iter_type(&s1ap_array) == - YAML_MAPPING_NODE) { - memcpy(&s1ap_iter, &s1ap_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(&s1ap_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&s1ap_array)) - break; - ogs_yaml_iter_recurse(&s1ap_array, &s1ap_iter); - } else if (ogs_yaml_iter_type(&s1ap_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); + if (ogs_yaml_iter_type(&server_array) == + YAML_MAPPING_NODE) { + memcpy(&server_iter, &server_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&server_array)) + break; + ogs_yaml_iter_recurse( + &server_array, &server_iter); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); - while (ogs_yaml_iter_next(&s1ap_iter)) { - const char *s1ap_key = - ogs_yaml_iter_key(&s1ap_iter); - ogs_assert(s1ap_key); - if (!strcmp(s1ap_key, "family")) { - const char *v = ogs_yaml_iter_value(&s1ap_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; + while (ogs_yaml_iter_next(&server_iter)) { + const char *server_key = + ogs_yaml_iter_key(&server_iter); + ogs_assert(server_key); + if (!strcmp(server_key, "family")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) family = atoi(v); + if (family != AF_UNSPEC && + family != AF_INET && + family != AF_INET6) { + ogs_warn("Ignore family(%d) : " + "AF_UNSPEC(%d), " + "AF_INET(%d), AF_INET6(%d) ", + family, + AF_UNSPEC, AF_INET, AF_INET6); + family = AF_UNSPEC; + } + } else if (!strcmp(server_key, "address")) { + ogs_yaml_iter_t hostname_iter; + ogs_yaml_iter_recurse( + &server_iter, &hostname_iter); + ogs_assert(ogs_yaml_iter_type( + &hostname_iter) != + YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &hostname_iter)) + break; + } + + ogs_assert(num < + OGS_MAX_NUM_OF_HOSTNAME); + hostname[num++] = + ogs_yaml_iter_value( + &hostname_iter); + } while (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(server_key, "port")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) port = atoi(v); + } else if (!strcmp(server_key, "dev")) { + dev = ogs_yaml_iter_value(&server_iter); + } else if (!strcmp(server_key, "option")) { + rv = ogs_app_parse_sockopt_config( + &server_iter, &option); + if (rv != OGS_OK) { + ogs_error("ogs_app_parse_sockopt_" + "config() failed"); + return rv; + } + is_option = true; + } else + ogs_warn("unknown key `%s`", + server_key); } - } else if (!strcmp(s1ap_key, "addr") || - !strcmp(s1ap_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse( - &s1ap_iter, &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&hostname_iter)) - break; - } + addr = NULL; + for (i = 0; i < num; i++) { + rv = ogs_addaddrinfo(&addr, + family, hostname[i], port, 0); + ogs_assert(rv == OGS_OK); + } - ogs_assert(num <= OGS_MAX_NUM_OF_HOSTNAME); - hostname[num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(s1ap_key, "port")) { - const char *v = ogs_yaml_iter_value(&s1ap_iter); - if (v) port = atoi(v); - } else if (!strcmp(s1ap_key, "dev")) { - dev = ogs_yaml_iter_value(&s1ap_iter); - } else if (!strcmp(s1ap_key, "option")) { - rv = ogs_app_config_parse_sockopt( - &s1ap_iter, &option); - if (rv != OGS_OK) return rv; - is_option = true; - } else - ogs_warn("unknown key `%s`", s1ap_key); - } + if (addr) { + if (ogs_global_conf()->parameter. + no_ipv4 == 0) + ogs_socknode_add( + &self.s1ap_list, AF_INET, addr, + is_option ? &option : NULL); + if (ogs_global_conf()->parameter. + no_ipv6 == 0) + ogs_socknode_add( + &self.s1ap_list6, AF_INET6, addr, + is_option ? &option : NULL); + ogs_freeaddrinfo(addr); + } - addr = NULL; - for (i = 0; i < num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } + if (dev) { + rv = ogs_socknode_probe( + ogs_global_conf()->parameter. + no_ipv4 ? + NULL : &self.s1ap_list, + ogs_global_conf()->parameter. + no_ipv6 ? + NULL : &self.s1ap_list6, + dev, port, + is_option ? &option : NULL); + ogs_assert(rv == OGS_OK); + } - if (addr) { - if (ogs_app()->parameter.no_ipv4 == 0) - ogs_socknode_add( - &self.s1ap_list, AF_INET, addr, - is_option ? &option : NULL); - if (ogs_app()->parameter.no_ipv6 == 0) - ogs_socknode_add( - &self.s1ap_list6, AF_INET6, addr, - is_option ? &option : NULL); - ogs_freeaddrinfo(addr); - } - - if (dev) { - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? - NULL : &self.s1ap_list, - ogs_app()->parameter.no_ipv6 ? - NULL : &self.s1ap_list6, - dev, port, - is_option ? &option : NULL); - ogs_assert(rv == OGS_OK); - } - - } while (ogs_yaml_iter_type(&s1ap_array) == - YAML_SEQUENCE_NODE); - - if (ogs_list_first(&self.s1ap_list) == NULL && - ogs_list_first(&self.s1ap_list6) == NULL) { - rv = ogs_socknode_probe( - ogs_app()->parameter.no_ipv4 ? - NULL : &self.s1ap_list, - ogs_app()->parameter.no_ipv6 ? - NULL : &self.s1ap_list6, - NULL, self.s1ap_port, NULL); - ogs_assert(rv == OGS_OK); + } while (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE); + } else + ogs_warn("unknown key `%s`", s1ap_key); } } else if (!strcmp(mme_key, "tai")) { int num_of_list0 = 0; @@ -1079,12 +1128,10 @@ test_ue_t *test_ue_add_by_suci( memcpy(&test_ue->nr_tai, &test_self()->nr_tai, sizeof(ogs_5gs_tai_t)); memcpy(&test_ue->nr_cgi.plmn_id, &test_ue->nr_tai.plmn_id, OGS_PLMN_ID_LEN); - if (test_self()->nr_tai.tac.v) - ogs_nas_from_plmn_id( - &mobile_identity_suci->nas_plmn_id, &test_ue->nr_tai.plmn_id); - else - ogs_nas_from_plmn_id( - &mobile_identity_suci->nas_plmn_id, &test_ue->e_tai.plmn_id); + ogs_assert(ogs_plmn_id_mcc(&ogs_local_conf()->serving_plmn_id)); + ogs_assert(ogs_plmn_id_mnc(&ogs_local_conf()->serving_plmn_id)); + ogs_nas_from_plmn_id(&mobile_identity_suci->nas_plmn_id, + &ogs_local_conf()->serving_plmn_id); for (i = 0; i < test_self()->num_of_plmn_support; i++) { for (j = 0; j < test_self()->plmn_support[i].num_of_s_nssai; j++) { diff --git a/tests/non3gpp/abts-main.c b/tests/non3gpp/abts-main.c index c20b44252..ca7745ef8 100644 --- a/tests/non3gpp/abts-main.c +++ b/tests/non3gpp/abts-main.c @@ -121,97 +121,119 @@ int parse_config(void) const char *smf_key = ogs_yaml_iter_key(&smf_iter); ogs_assert(smf_key); if (!strcmp(smf_key, "gtpc")) { - ogs_yaml_iter_t gtpc_array, gtpc_iter; - ogs_yaml_iter_recurse(&smf_iter, >pc_array); - do { - int family = AF_UNSPEC; - int i, num = 0; - const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; - uint16_t port = test_self()->gtpc_port; - ogs_sockaddr_t *addr = NULL; + ogs_yaml_iter_t gtpc_iter; + ogs_yaml_iter_recurse(&smf_iter, >pc_iter); + while (ogs_yaml_iter_next(>pc_iter)) { + const char *gtpc_key = ogs_yaml_iter_key(>pc_iter); + ogs_assert(gtpc_key); + if (!strcmp(gtpc_key, "server")) { + ogs_yaml_iter_t server_array, server_iter; + ogs_yaml_iter_recurse(>pc_iter, &server_array); + do { + int family = AF_UNSPEC; + int i, num = 0; + const char *hostname[OGS_MAX_NUM_OF_HOSTNAME]; + uint16_t port = test_self()->gtpc_port; + ogs_sockaddr_t *addr = NULL; - if (ogs_yaml_iter_type(>pc_array) == - YAML_MAPPING_NODE) { - memcpy(>pc_iter, >pc_array, - sizeof(ogs_yaml_iter_t)); - } else if (ogs_yaml_iter_type(>pc_array) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(>pc_array)) - break; - ogs_yaml_iter_recurse(>pc_array, >pc_iter); - } else if (ogs_yaml_iter_type(>pc_array) == - YAML_SCALAR_NODE) { - break; - } else - ogs_assert_if_reached(); + if (ogs_yaml_iter_type(&server_array) == + YAML_MAPPING_NODE) { + memcpy(&server_iter, &server_array, + sizeof(ogs_yaml_iter_t)); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next(&server_array)) + break; + ogs_yaml_iter_recurse( + &server_array, &server_iter); + } else if (ogs_yaml_iter_type(&server_array) == + YAML_SCALAR_NODE) { + break; + } else + ogs_assert_if_reached(); - while (ogs_yaml_iter_next(>pc_iter)) { - const char *gtpc_key = - ogs_yaml_iter_key(>pc_iter); - ogs_assert(gtpc_key); - if (!strcmp(gtpc_key, "family")) { - const char *v = ogs_yaml_iter_value(>pc_iter); - if (v) family = atoi(v); - if (family != AF_UNSPEC && - family != AF_INET && family != AF_INET6) { - ogs_warn("Ignore family(%d) : " - "AF_UNSPEC(%d), " - "AF_INET(%d), AF_INET6(%d) ", - family, AF_UNSPEC, AF_INET, AF_INET6); - family = AF_UNSPEC; + while (ogs_yaml_iter_next(&server_iter)) { + const char *server_key = + ogs_yaml_iter_key(&server_iter); + ogs_assert(server_key); + if (!strcmp(server_key, "family")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) family = atoi(v); + if (family != AF_UNSPEC && + family != AF_INET && + family != AF_INET6) { + ogs_warn("Ignore family(%d) : " + "AF_UNSPEC(%d), " + "AF_INET(%d), AF_INET6(%d) ", + family, + AF_UNSPEC, AF_INET, AF_INET6); + family = AF_UNSPEC; + } + } else if (!strcmp(server_key, "address")) { + ogs_yaml_iter_t hostname_iter; + ogs_yaml_iter_recurse(&server_iter, + &hostname_iter); + ogs_assert(ogs_yaml_iter_type( + &hostname_iter) != + YAML_MAPPING_NODE); + + do { + if (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE) { + if (!ogs_yaml_iter_next( + &hostname_iter)) + break; + } + + ogs_assert(num < + OGS_MAX_NUM_OF_HOSTNAME); + hostname[num++] = + ogs_yaml_iter_value( + &hostname_iter); + } while (ogs_yaml_iter_type( + &hostname_iter) == + YAML_SEQUENCE_NODE); + } else if (!strcmp(server_key, "port")) { + const char *v = + ogs_yaml_iter_value(&server_iter); + if (v) port = atoi(v); + } else + ogs_warn("unknown key `%s`", + server_key); } - } else if (!strcmp(gtpc_key, "addr") || - !strcmp(gtpc_key, "name")) { - ogs_yaml_iter_t hostname_iter; - ogs_yaml_iter_recurse(>pc_iter, - &hostname_iter); - ogs_assert(ogs_yaml_iter_type(&hostname_iter) != - YAML_MAPPING_NODE); - do { - if (ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE) { - if (!ogs_yaml_iter_next(&hostname_iter)) - break; - } + addr = NULL; + for (i = 0; i < num; i++) { + rv = ogs_addaddrinfo(&addr, + family, hostname[i], port, 0); + ogs_assert(rv == OGS_OK); + } - ogs_assert(num < OGS_MAX_NUM_OF_HOSTNAME); - hostname[num++] = - ogs_yaml_iter_value(&hostname_iter); - } while ( - ogs_yaml_iter_type(&hostname_iter) == - YAML_SEQUENCE_NODE); - } else if (!strcmp(gtpc_key, "port")) { - const char *v = ogs_yaml_iter_value(>pc_iter); - if (v) port = atoi(v); - } else - ogs_warn("unknown key `%s`", gtpc_key); - } - - addr = NULL; - for (i = 0; i < num; i++) { - rv = ogs_addaddrinfo(&addr, - family, hostname[i], port, 0); - ogs_assert(rv == OGS_OK); - } - - ogs_filter_ip_version(&addr, - ogs_app()->parameter.no_ipv4, + ogs_filter_ip_version(&addr, + ogs_global_conf()->parameter. + no_ipv4, #if 0 /* Only IPv4 is supporeted in Test-GTPv2C */ - ogs_app()->parameter.no_ipv6, + ogs_global_conf()->parameter. + no_ipv6, #else - 1, + 1, #endif - ogs_app()->parameter.prefer_ipv4); + ogs_global_conf()->parameter. + prefer_ipv4); - if (addr == NULL) continue; + if (addr == NULL) continue; - ogs_gtp_node_add_by_addr(&test_self()->gtpc_list, addr); + ogs_gtp_node_add_by_addr( + &test_self()->gtpc_list, addr); - ogs_freeaddrinfo(addr); + ogs_freeaddrinfo(addr); - } while (ogs_yaml_iter_type(>pc_array) == - YAML_SEQUENCE_NODE); + } while (ogs_yaml_iter_type(&server_array) == + YAML_SEQUENCE_NODE); + } + } } } } diff --git a/tests/sctp/abts-main.c b/tests/sctp/abts-main.c index 2224ad350..a9759eb57 100644 --- a/tests/sctp/abts-main.c +++ b/tests/sctp/abts-main.c @@ -77,6 +77,7 @@ int main(int argc, const char *const argv[]) ogs_app_setup_log(); ogs_app_context_init(); + ogs_app_config_init(); ogs_log_install_domain(&__ogs_sctp_domain, "sctp", OGS_LOG_ERROR); diff --git a/tests/unit/abts-main.c b/tests/unit/abts-main.c index 299f3939f..1f0ebbd6c 100644 --- a/tests/unit/abts-main.c +++ b/tests/unit/abts-main.c @@ -29,6 +29,7 @@ extern int __ogs_sbi_domain; void ogs_sbi_message_init(int num_of_request_pool, int num_of_response_pool); void ogs_sbi_message_final(void); +abts_suite *test_proto_message(abts_suite *suite); abts_suite *test_s1ap_message(abts_suite *suite); abts_suite *test_nas_message(abts_suite *suite); abts_suite *test_gtp_message(abts_suite *suite); @@ -40,6 +41,7 @@ abts_suite *test_crash(abts_suite *suite); const struct testlist { abts_suite *(*func)(abts_suite *suite); } alltests[] = { + {test_proto_message}, {test_s1ap_message}, {test_nas_message}, {test_gtp_message}, diff --git a/tests/unit/meson.build b/tests/unit/meson.build index ba0e61c87..0496a231a 100644 --- a/tests/unit/meson.build +++ b/tests/unit/meson.build @@ -17,6 +17,7 @@ testunit_unit_sources = files(''' abts-main.c + proto-message-test.c s1ap-message-test.c nas-message-test.c gtp-message-test.c diff --git a/tests/unit/proto-message-test.c b/tests/unit/proto-message-test.c new file mode 100644 index 000000000..92a2542b6 --- /dev/null +++ b/tests/unit/proto-message-test.c @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2023 by Sukchan Lee + * + * 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 . + */ + +#include "ogs-sbi.h" +#include "core/abts.h" + +static void proto_message_test1(abts_case *tc, void *data) +{ + char *fqdn = NULL; + ogs_plmn_id_t plmn_id1, plmn_id2; + + ogs_plmn_id_build(&plmn_id1, 456, 123, 3); + fqdn = ogs_home_network_domain_from_plmn_id(&plmn_id1); + ABTS_STR_EQUAL(tc, "5gc.mnc123.mcc456.3gppnetwork.org", fqdn); + ABTS_INT_EQUAL(tc, 456, ogs_plmn_id_mcc_from_fqdn(fqdn)); + ABTS_INT_EQUAL(tc, 123, ogs_plmn_id_mnc_from_fqdn(fqdn)); + ogs_free(fqdn); + + ogs_plmn_id_build(&plmn_id1, 1, 1, 2); + fqdn = ogs_home_network_domain_from_plmn_id(&plmn_id1); + ABTS_STR_EQUAL(tc, "5gc.mnc001.mcc001.3gppnetwork.org", fqdn); + ABTS_INT_EQUAL(tc, 1, ogs_plmn_id_mcc_from_fqdn(fqdn)); + ABTS_INT_EQUAL(tc, 1, ogs_plmn_id_mnc_from_fqdn(fqdn)); + ogs_free(fqdn); + + ogs_plmn_id_build(&plmn_id1, 310, 14, 3); + fqdn = ogs_home_network_domain_from_plmn_id(&plmn_id1); + ABTS_STR_EQUAL(tc, "5gc.mnc014.mcc310.3gppnetwork.org", fqdn); + ABTS_INT_EQUAL(tc, 310, ogs_plmn_id_mcc_from_fqdn(fqdn)); + ABTS_INT_EQUAL(tc, 14, ogs_plmn_id_mnc_from_fqdn(fqdn)); + ogs_free(fqdn); +} + +static void proto_message_test2(abts_case *tc, void *data) +{ + char *home_network_domain = NULL; + char *full_dnn = NULL; + char dnn_ni[OGS_MAX_DNN_LEN+1]; + ogs_plmn_id_t plmn_id1, plmn_id2; + + ogs_plmn_id_build(&plmn_id1, 456, 123, 3); + home_network_domain = ogs_home_network_domain_from_plmn_id(&plmn_id1); + ABTS_STR_EQUAL(tc, + "5gc.mnc123.mcc456.3gppnetwork.org", home_network_domain); + full_dnn = ogs_msprintf("internet.realm.%s", home_network_domain); + ABTS_STR_EQUAL(tc, + "internet.realm.5gc.mnc123.mcc456.3gppnetwork.org", full_dnn); + ABTS_STR_EQUAL(tc, + home_network_domain, ogs_home_network_domain_from_fqdn(full_dnn)); + + ogs_cpystrn(dnn_ni, full_dnn, + ogs_min(OGS_MAX_DNN_LEN, + ogs_home_network_domain_from_fqdn(full_dnn) - full_dnn)); + ABTS_STR_EQUAL(tc, "internet.realm", dnn_ni); + + ABTS_INT_EQUAL(tc, 456, ogs_plmn_id_mcc_from_fqdn(full_dnn)); + ABTS_INT_EQUAL(tc, 123, ogs_plmn_id_mnc_from_fqdn(full_dnn)); + ogs_free(home_network_domain); + ogs_free(full_dnn); +} + +abts_suite *test_proto_message(abts_suite *suite) +{ + suite = ADD_SUITE(suite) + + abts_run_test(suite, proto_message_test1, NULL); + abts_run_test(suite, proto_message_test2, NULL); + + return suite; +} diff --git a/tests/vonr/af-test.c b/tests/vonr/af-test.c index b37d94187..14e1ff0bd 100644 --- a/tests/vonr/af-test.c +++ b/tests/vonr/af-test.c @@ -3966,6 +3966,369 @@ static void test7_func(abts_case *tc, void *data) test_ue_remove(test_ue); } +static void test8_func(abts_case *tc, void *data) +{ + int rv; + ogs_socknode_t *ngap; + ogs_socknode_t *gtpu; + ogs_pkbuf_t *gmmbuf; + ogs_pkbuf_t *gsmbuf; + ogs_pkbuf_t *nasbuf; + ogs_pkbuf_t *sendbuf; + ogs_pkbuf_t *recvbuf; + ogs_ngap_message_t message; + int i; + + uint8_t tmp[OGS_HUGE_LEN]; + char *_gtp_payload = "34ff0024" + "0000000100000085 010002004500001c 0c0b000040015a7a 0a2d00010a2d0002" + "00000964cd7c291f"; + + ogs_nas_5gs_mobile_identity_suci_t mobile_identity_suci; + test_ue_t *test_ue = NULL; + test_sess_t *sess5 = NULL, *sess6 = NULL; + test_bearer_t *qos_flow = NULL; + + bson_t *doc = NULL; + + /* Setup Test UE & Session Context */ + memset(&mobile_identity_suci, 0, sizeof(mobile_identity_suci)); + + mobile_identity_suci.h.supi_format = OGS_NAS_5GS_SUPI_FORMAT_IMSI; + mobile_identity_suci.h.type = OGS_NAS_5GS_MOBILE_IDENTITY_SUCI; + mobile_identity_suci.routing_indicator1 = 0; + mobile_identity_suci.routing_indicator2 = 0xf; + mobile_identity_suci.routing_indicator3 = 0xf; + mobile_identity_suci.routing_indicator4 = 0xf; + mobile_identity_suci.protection_scheme_id = OGS_PROTECTION_SCHEME_NULL; + mobile_identity_suci.home_network_pki_value = 0; + + test_ue = test_ue_add_by_suci(&mobile_identity_suci, "0000203190"); + ogs_assert(test_ue); + + test_ue->nr_cgi.cell_id = 0x40001; + + test_ue->nas.registration.tsc = 0; + test_ue->nas.registration.ksi = OGS_NAS_KSI_NO_KEY_IS_AVAILABLE; + test_ue->nas.registration.follow_on_request = 1; + test_ue->nas.registration.value = OGS_NAS_5GS_REGISTRATION_TYPE_INITIAL; + + test_ue->k_string = "465b5ce8b199b49faa5f0a2ee238a6bc"; + test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca"; + + /* gNB connects to AMF */ + ngap = testngap_client(AF_INET); + ABTS_PTR_NOTNULL(tc, ngap); + + /* gNB connects to UPF */ + gtpu = test_gtpu_server(1, AF_INET); + ABTS_PTR_NOTNULL(tc, gtpu); + + /* Send NG-Setup Reqeust */ + sendbuf = testngap_build_ng_setup_request(0x4000, 22); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive NG-Setup Response */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + + /********** Insert Subscriber in Database */ + doc = test_db_new_ims(test_ue); + ABTS_PTR_NOTNULL(tc, doc); + ABTS_INT_EQUAL(tc, OGS_OK, test_db_insert_ue(test_ue, doc)); + + /* Send Registration request */ + test_ue->registration_request_param.guti = 1; + gmmbuf = testgmm_build_registration_request(test_ue, NULL, false, false); + ABTS_PTR_NOTNULL(tc, gmmbuf); + + test_ue->registration_request_param.gmm_capability = 1; + test_ue->registration_request_param.requested_nssai = 1; + test_ue->registration_request_param.last_visited_registered_tai = 1; + test_ue->registration_request_param.ue_usage_setting = 1; + nasbuf = testgmm_build_registration_request(test_ue, NULL, false, false); + ABTS_PTR_NOTNULL(tc, nasbuf); + + sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, + NGAP_RRCEstablishmentCause_mo_Signalling, false, true); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive Identity request */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + + /* Send Identity response */ + gmmbuf = testgmm_build_identity_response(test_ue); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive Authentication request */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + + /* Send Authentication response */ + gmmbuf = testgmm_build_authentication_response(test_ue); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive Security mode command */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + + /* Send Security mode complete */ + gmmbuf = testgmm_build_security_mode_complete(test_ue, nasbuf); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive InitialContextSetupRequest + + * Registration accept */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + ABTS_INT_EQUAL(tc, + NGAP_ProcedureCode_id_InitialContextSetup, + test_ue->ngap_procedure_code); + + /* Send UERadioCapabilityInfoIndication */ + sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Send InitialContextSetupResponse */ + sendbuf = testngap_build_initial_context_setup_response(test_ue, false); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Send Registration complete */ + gmmbuf = testgmm_build_registration_complete(test_ue); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive Configuration update command */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + + /* Send PDU session establishment request */ + sess5 = test_sess_add_by_dnn_and_psi(test_ue, "internet", 5); + ogs_assert(sess5); + + sess5->ul_nas_transport_param.request_type = + OGS_NAS_5GS_REQUEST_TYPE_INITIAL; + sess5->ul_nas_transport_param.dnn = 1; + sess5->ul_nas_transport_param.s_nssai = 1; + + sess5->pdu_session_establishment_param.ssc_mode = 1; + sess5->pdu_session_establishment_param.epco = 1; + + gsmbuf = testgsm_build_pdu_session_establishment_request(sess5); + ABTS_PTR_NOTNULL(tc, gsmbuf); + gmmbuf = testgmm_build_ul_nas_transport(sess5, + OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, gsmbuf); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive PDUSessionResourceSetupRequest + + * DL NAS transport + + * PDU session establishment accept */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + ABTS_INT_EQUAL(tc, + NGAP_ProcedureCode_id_PDUSessionResourceSetup, + test_ue->ngap_procedure_code); + + /* Send PDUSessionResourceSetupResponse */ + sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess5); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Send PDU session establishment request */ + sess6 = test_sess_add_by_dnn_and_psi(test_ue, "ims", 6); + ogs_assert(sess6); + + sess6->ul_nas_transport_param.request_type = + OGS_NAS_5GS_REQUEST_TYPE_INITIAL; + sess6->ul_nas_transport_param.dnn = 1; + sess6->ul_nas_transport_param.s_nssai = 1; + + sess6->pdu_session_establishment_param.ssc_mode = 1; + sess6->pdu_session_establishment_param.epco = 1; + + gsmbuf = testgsm_build_pdu_session_establishment_request(sess6); + ABTS_PTR_NOTNULL(tc, gsmbuf); + gmmbuf = testgmm_build_ul_nas_transport(sess6, + OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, gsmbuf); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive PDU sess6ion establishment accept */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + + /* Send PDUSessionResourceSetupResponse */ + sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess6); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Send PDU Session release request */ + sess6->pti = 38; + sess6->ul_nas_transport_param.request_type = 0; + sess6->ul_nas_transport_param.dnn = 0; + sess6->ul_nas_transport_param.s_nssai = 0; + + sess6->pdu_session_establishment_param.ssc_mode = 0; + sess6->pdu_session_establishment_param.epco = 0; + + gsmbuf = testgsm_build_pdu_session_release_request(sess6); + ABTS_PTR_NOTNULL(tc, gsmbuf); + gmmbuf = testgmm_build_ul_nas_transport(sess6, + OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, gsmbuf); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Send PDU Session release request */ + sess5->pti = 39; + sess5->ul_nas_transport_param.request_type = 0; + sess5->ul_nas_transport_param.dnn = 0; + sess5->ul_nas_transport_param.s_nssai = 0; + + sess5->pdu_session_establishment_param.ssc_mode = 0; + sess5->pdu_session_establishment_param.epco = 0; + + gsmbuf = testgsm_build_pdu_session_release_request(sess5); + ABTS_PTR_NOTNULL(tc, gsmbuf); + gmmbuf = testgmm_build_ul_nas_transport(sess5, + OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, gsmbuf); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive PDUSessionResourceReleaseCommand + + * DL NAS transport + + * PDU session release command */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + ABTS_INT_EQUAL(tc, + NGAP_ProcedureCode_id_PDUSessionResourceRelease, + test_ue->ngap_procedure_code); + + /* Receive PDUSessionResourceReleaseCommand + + * DL NAS transport + + * PDU session release command */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + ABTS_INT_EQUAL(tc, + NGAP_ProcedureCode_id_PDUSessionResourceRelease, + test_ue->ngap_procedure_code); + + /* Send PDUSessionResourceReleaseResponse */ + sendbuf = testngap_build_pdu_session_resource_release_response(sess6); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Send UplinkNASTransport + + * UL NAS trasnport + + * PDU session resource release complete */ + sess6->ul_nas_transport_param.request_type = 0; + sess6->ul_nas_transport_param.dnn = 0; + sess6->ul_nas_transport_param.s_nssai = 0; + + sess6->pdu_session_establishment_param.ssc_mode = 0; + sess6->pdu_session_establishment_param.epco = 0; + + gsmbuf = testgsm_build_pdu_session_release_complete(sess6); + ABTS_PTR_NOTNULL(tc, gsmbuf); + gmmbuf = testgmm_build_ul_nas_transport(sess6, + OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, gsmbuf); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Test Session Remove */ + test_sess_remove(sess6); + + ogs_msleep(100); + + /* Send De-registration request */ + gmmbuf = testgmm_build_de_registration_request(test_ue, 1, true, true); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive UEContextReleaseCommand */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + ABTS_INT_EQUAL(tc, + NGAP_ProcedureCode_id_UEContextRelease, + test_ue->ngap_procedure_code); + + /* Send UEContextReleaseComplete */ + sendbuf = testngap_build_ue_context_release_complete(test_ue); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + ogs_msleep(300); + + /********** Remove Subscriber in Database */ + ABTS_INT_EQUAL(tc, OGS_OK, test_db_remove_ue(test_ue)); + + /* gNB disonncect from UPF */ + testgnb_gtpu_close(gtpu); + + /* gNB disonncect from AMF */ + testgnb_ngap_close(ngap); + + /* Clear Test UE Context */ + test_ue_remove(test_ue); +} + + abts_suite *test_af(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -3977,6 +4340,7 @@ abts_suite *test_af(abts_suite *suite) abts_run_test(suite, test5_func, NULL); abts_run_test(suite, test6_func, NULL); abts_run_test(suite, test7_func, NULL); + abts_run_test(suite, test8_func, NULL); return suite; } diff --git a/tests/vonr/session-test.c b/tests/vonr/session-test.c index a046f0ecd..25a334e34 100644 --- a/tests/vonr/session-test.c +++ b/tests/vonr/session-test.c @@ -2301,368 +2301,6 @@ static void test6_func(abts_case *tc, void *data) test_ue_remove(test_ue); } -static void test7_func(abts_case *tc, void *data) -{ - int rv; - ogs_socknode_t *ngap; - ogs_socknode_t *gtpu; - ogs_pkbuf_t *gmmbuf; - ogs_pkbuf_t *gsmbuf; - ogs_pkbuf_t *nasbuf; - ogs_pkbuf_t *sendbuf; - ogs_pkbuf_t *recvbuf; - ogs_ngap_message_t message; - int i; - - uint8_t tmp[OGS_HUGE_LEN]; - char *_gtp_payload = "34ff0024" - "0000000100000085 010002004500001c 0c0b000040015a7a 0a2d00010a2d0002" - "00000964cd7c291f"; - - ogs_nas_5gs_mobile_identity_suci_t mobile_identity_suci; - test_ue_t *test_ue = NULL; - test_sess_t *sess5 = NULL, *sess6 = NULL; - test_bearer_t *qos_flow = NULL; - - bson_t *doc = NULL; - - /* Setup Test UE & Session Context */ - memset(&mobile_identity_suci, 0, sizeof(mobile_identity_suci)); - - mobile_identity_suci.h.supi_format = OGS_NAS_5GS_SUPI_FORMAT_IMSI; - mobile_identity_suci.h.type = OGS_NAS_5GS_MOBILE_IDENTITY_SUCI; - mobile_identity_suci.routing_indicator1 = 0; - mobile_identity_suci.routing_indicator2 = 0xf; - mobile_identity_suci.routing_indicator3 = 0xf; - mobile_identity_suci.routing_indicator4 = 0xf; - mobile_identity_suci.protection_scheme_id = OGS_PROTECTION_SCHEME_NULL; - mobile_identity_suci.home_network_pki_value = 0; - - test_ue = test_ue_add_by_suci(&mobile_identity_suci, "0000203190"); - ogs_assert(test_ue); - - test_ue->nr_cgi.cell_id = 0x40001; - - test_ue->nas.registration.tsc = 0; - test_ue->nas.registration.ksi = OGS_NAS_KSI_NO_KEY_IS_AVAILABLE; - test_ue->nas.registration.follow_on_request = 1; - test_ue->nas.registration.value = OGS_NAS_5GS_REGISTRATION_TYPE_INITIAL; - - test_ue->k_string = "465b5ce8b199b49faa5f0a2ee238a6bc"; - test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca"; - - /* gNB connects to AMF */ - ngap = testngap_client(AF_INET); - ABTS_PTR_NOTNULL(tc, ngap); - - /* gNB connects to UPF */ - gtpu = test_gtpu_server(1, AF_INET); - ABTS_PTR_NOTNULL(tc, gtpu); - - /* Send NG-Setup Reqeust */ - sendbuf = testngap_build_ng_setup_request(0x4000, 22); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Receive NG-Setup Response */ - recvbuf = testgnb_ngap_read(ngap); - ABTS_PTR_NOTNULL(tc, recvbuf); - testngap_recv(test_ue, recvbuf); - - /********** Insert Subscriber in Database */ - doc = test_db_new_ims(test_ue); - ABTS_PTR_NOTNULL(tc, doc); - ABTS_INT_EQUAL(tc, OGS_OK, test_db_insert_ue(test_ue, doc)); - - /* Send Registration request */ - test_ue->registration_request_param.guti = 1; - gmmbuf = testgmm_build_registration_request(test_ue, NULL, false, false); - ABTS_PTR_NOTNULL(tc, gmmbuf); - - test_ue->registration_request_param.gmm_capability = 1; - test_ue->registration_request_param.requested_nssai = 1; - test_ue->registration_request_param.last_visited_registered_tai = 1; - test_ue->registration_request_param.ue_usage_setting = 1; - nasbuf = testgmm_build_registration_request(test_ue, NULL, false, false); - ABTS_PTR_NOTNULL(tc, nasbuf); - - sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, - NGAP_RRCEstablishmentCause_mo_Signalling, false, true); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Receive Identity request */ - recvbuf = testgnb_ngap_read(ngap); - ABTS_PTR_NOTNULL(tc, recvbuf); - testngap_recv(test_ue, recvbuf); - - /* Send Identity response */ - gmmbuf = testgmm_build_identity_response(test_ue); - ABTS_PTR_NOTNULL(tc, gmmbuf); - sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Receive Authentication request */ - recvbuf = testgnb_ngap_read(ngap); - ABTS_PTR_NOTNULL(tc, recvbuf); - testngap_recv(test_ue, recvbuf); - - /* Send Authentication response */ - gmmbuf = testgmm_build_authentication_response(test_ue); - ABTS_PTR_NOTNULL(tc, gmmbuf); - sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Receive Security mode command */ - recvbuf = testgnb_ngap_read(ngap); - ABTS_PTR_NOTNULL(tc, recvbuf); - testngap_recv(test_ue, recvbuf); - - /* Send Security mode complete */ - gmmbuf = testgmm_build_security_mode_complete(test_ue, nasbuf); - ABTS_PTR_NOTNULL(tc, gmmbuf); - sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Receive InitialContextSetupRequest + - * Registration accept */ - recvbuf = testgnb_ngap_read(ngap); - ABTS_PTR_NOTNULL(tc, recvbuf); - testngap_recv(test_ue, recvbuf); - ABTS_INT_EQUAL(tc, - NGAP_ProcedureCode_id_InitialContextSetup, - test_ue->ngap_procedure_code); - - /* Send UERadioCapabilityInfoIndication */ - sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Send InitialContextSetupResponse */ - sendbuf = testngap_build_initial_context_setup_response(test_ue, false); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Send Registration complete */ - gmmbuf = testgmm_build_registration_complete(test_ue); - ABTS_PTR_NOTNULL(tc, gmmbuf); - sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Receive Configuration update command */ - recvbuf = testgnb_ngap_read(ngap); - ABTS_PTR_NOTNULL(tc, recvbuf); - testngap_recv(test_ue, recvbuf); - - /* Send PDU session establishment request */ - sess5 = test_sess_add_by_dnn_and_psi(test_ue, "internet", 5); - ogs_assert(sess5); - - sess5->ul_nas_transport_param.request_type = - OGS_NAS_5GS_REQUEST_TYPE_INITIAL; - sess5->ul_nas_transport_param.dnn = 1; - sess5->ul_nas_transport_param.s_nssai = 1; - - sess5->pdu_session_establishment_param.ssc_mode = 1; - sess5->pdu_session_establishment_param.epco = 1; - - gsmbuf = testgsm_build_pdu_session_establishment_request(sess5); - ABTS_PTR_NOTNULL(tc, gsmbuf); - gmmbuf = testgmm_build_ul_nas_transport(sess5, - OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, gsmbuf); - ABTS_PTR_NOTNULL(tc, gmmbuf); - sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Receive PDUSessionResourceSetupRequest + - * DL NAS transport + - * PDU session establishment accept */ - recvbuf = testgnb_ngap_read(ngap); - ABTS_PTR_NOTNULL(tc, recvbuf); - testngap_recv(test_ue, recvbuf); - ABTS_INT_EQUAL(tc, - NGAP_ProcedureCode_id_PDUSessionResourceSetup, - test_ue->ngap_procedure_code); - - /* Send PDUSessionResourceSetupResponse */ - sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess5); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Send PDU session establishment request */ - sess6 = test_sess_add_by_dnn_and_psi(test_ue, "ims", 6); - ogs_assert(sess6); - - sess6->ul_nas_transport_param.request_type = - OGS_NAS_5GS_REQUEST_TYPE_INITIAL; - sess6->ul_nas_transport_param.dnn = 1; - sess6->ul_nas_transport_param.s_nssai = 1; - - sess6->pdu_session_establishment_param.ssc_mode = 1; - sess6->pdu_session_establishment_param.epco = 1; - - gsmbuf = testgsm_build_pdu_session_establishment_request(sess6); - ABTS_PTR_NOTNULL(tc, gsmbuf); - gmmbuf = testgmm_build_ul_nas_transport(sess6, - OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, gsmbuf); - ABTS_PTR_NOTNULL(tc, gmmbuf); - sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Receive PDU sess6ion establishment accept */ - recvbuf = testgnb_ngap_read(ngap); - ABTS_PTR_NOTNULL(tc, recvbuf); - testngap_recv(test_ue, recvbuf); - - /* Send PDUSessionResourceSetupResponse */ - sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess6); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Send PDU Session release request */ - sess6->pti = 38; - sess6->ul_nas_transport_param.request_type = 0; - sess6->ul_nas_transport_param.dnn = 0; - sess6->ul_nas_transport_param.s_nssai = 0; - - sess6->pdu_session_establishment_param.ssc_mode = 0; - sess6->pdu_session_establishment_param.epco = 0; - - gsmbuf = testgsm_build_pdu_session_release_request(sess6); - ABTS_PTR_NOTNULL(tc, gsmbuf); - gmmbuf = testgmm_build_ul_nas_transport(sess6, - OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, gsmbuf); - ABTS_PTR_NOTNULL(tc, gmmbuf); - sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Send PDU Session release request */ - sess5->pti = 39; - sess5->ul_nas_transport_param.request_type = 0; - sess5->ul_nas_transport_param.dnn = 0; - sess5->ul_nas_transport_param.s_nssai = 0; - - sess5->pdu_session_establishment_param.ssc_mode = 0; - sess5->pdu_session_establishment_param.epco = 0; - - gsmbuf = testgsm_build_pdu_session_release_request(sess5); - ABTS_PTR_NOTNULL(tc, gsmbuf); - gmmbuf = testgmm_build_ul_nas_transport(sess5, - OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, gsmbuf); - ABTS_PTR_NOTNULL(tc, gmmbuf); - sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Receive PDUSessionResourceReleaseCommand + - * DL NAS transport + - * PDU session release command */ - recvbuf = testgnb_ngap_read(ngap); - ABTS_PTR_NOTNULL(tc, recvbuf); - testngap_recv(test_ue, recvbuf); - ABTS_INT_EQUAL(tc, - NGAP_ProcedureCode_id_PDUSessionResourceRelease, - test_ue->ngap_procedure_code); - - /* Receive PDUSessionResourceReleaseCommand + - * DL NAS transport + - * PDU session release command */ - recvbuf = testgnb_ngap_read(ngap); - ABTS_PTR_NOTNULL(tc, recvbuf); - testngap_recv(test_ue, recvbuf); - ABTS_INT_EQUAL(tc, - NGAP_ProcedureCode_id_PDUSessionResourceRelease, - test_ue->ngap_procedure_code); - - /* Send PDUSessionResourceReleaseResponse */ - sendbuf = testngap_build_pdu_session_resource_release_response(sess6); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Send UplinkNASTransport + - * UL NAS trasnport + - * PDU session resource release complete */ - sess6->ul_nas_transport_param.request_type = 0; - sess6->ul_nas_transport_param.dnn = 0; - sess6->ul_nas_transport_param.s_nssai = 0; - - sess6->pdu_session_establishment_param.ssc_mode = 0; - sess6->pdu_session_establishment_param.epco = 0; - - gsmbuf = testgsm_build_pdu_session_release_complete(sess6); - ABTS_PTR_NOTNULL(tc, gsmbuf); - gmmbuf = testgmm_build_ul_nas_transport(sess6, - OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, gsmbuf); - ABTS_PTR_NOTNULL(tc, gmmbuf); - sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Test Session Remove */ - test_sess_remove(sess6); - - ogs_msleep(100); - - /* Send De-registration request */ - gmmbuf = testgmm_build_de_registration_request(test_ue, 1, true, true); - ABTS_PTR_NOTNULL(tc, gmmbuf); - sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - /* Receive UEContextReleaseCommand */ - recvbuf = testgnb_ngap_read(ngap); - ABTS_PTR_NOTNULL(tc, recvbuf); - testngap_recv(test_ue, recvbuf); - ABTS_INT_EQUAL(tc, - NGAP_ProcedureCode_id_UEContextRelease, - test_ue->ngap_procedure_code); - - /* Send UEContextReleaseComplete */ - sendbuf = testngap_build_ue_context_release_complete(test_ue); - ABTS_PTR_NOTNULL(tc, sendbuf); - rv = testgnb_ngap_send(ngap, sendbuf); - ABTS_INT_EQUAL(tc, OGS_OK, rv); - - ogs_msleep(300); - - /********** Remove Subscriber in Database */ - ABTS_INT_EQUAL(tc, OGS_OK, test_db_remove_ue(test_ue)); - - /* gNB disonncect from UPF */ - testgnb_gtpu_close(gtpu); - - /* gNB disonncect from AMF */ - testgnb_ngap_close(ngap); - - /* Clear Test UE Context */ - test_ue_remove(test_ue); -} - abts_suite *test_session(abts_suite *suite) { suite = ADD_SUITE(suite) @@ -2673,7 +2311,6 @@ abts_suite *test_session(abts_suite *suite) abts_run_test(suite, test4_func, NULL); abts_run_test(suite, test5_func, NULL); abts_run_test(suite, test6_func, NULL); - abts_run_test(suite, test7_func, NULL); return suite; } diff --git a/webui/server/index.js b/webui/server/index.js index a6f2d1c59..5dac9550c 100644 --- a/webui/server/index.js +++ b/webui/server/index.js @@ -1,7 +1,7 @@ process.env.DB_URI = process.env.DB_URI || 'mongodb://localhost/open5gs'; const _hostname = process.env.HOSTNAME || 'localhost'; -const port = process.env.PORT || 3000; +const port = process.env.PORT || 9999; const co = require('co'); const next = require('next'); diff --git a/webui/server/models/profile.js b/webui/server/models/profile.js index 053567ed7..572748b2c 100644 --- a/webui/server/models/profile.js +++ b/webui/server/models/profile.js @@ -46,12 +46,12 @@ const Profile = new Schema({ uplink: { value: Number, unit: Number } }, ue: { - addr: String, - addr6: String + ipv4: String, + ipv6: String }, smf: { - addr: String, - addr6: String + ipv4: String, + ipv6: String }, pcc_rule: [{ flow: [{ diff --git a/webui/server/models/subscriber.js b/webui/server/models/subscriber.js index 830c7e2de..5cc1f6cab 100644 --- a/webui/server/models/subscriber.js +++ b/webui/server/models/subscriber.js @@ -51,12 +51,12 @@ const Subscriber = new Schema({ uplink: { value: Number, unit: Number } }, ue: { - addr: String, - addr6: String + ipv4: String, + ipv6: String }, smf: { - addr: String, - addr6: String + ipv4: String, + ipv6: String }, pcc_rule: [{ flow: [{ diff --git a/webui/src/components/Profile/Edit.js b/webui/src/components/Profile/Edit.js index 656f4cd5b..cbb62135c 100644 --- a/webui/src/components/Profile/Edit.js +++ b/webui/src/components/Profile/Edit.js @@ -256,12 +256,12 @@ const schema = { "type": "object", "title": "", "properties": { - "addr": { + "ipv4": { "type": "string", "title": "UE IPv4 Address", "format" : "ipv4" }, - "addr6": { + "ipv6": { "type": "string", "title": "UE IPv6 Address", "format" : "ipv6" @@ -272,12 +272,12 @@ const schema = { "type": "object", "title": "", "properties": { - "addr": { + "ipv4": { "type": "string", "title": "SMF IPv4 Address", "format" : "ipv4" }, - "addr6": { + "ipv6": { "type": "string", "title": "SMF IPv6 Address", "format" : "ipv6" @@ -556,19 +556,19 @@ const uiSchema = { }, "ue" : { classNames: "col-xs-12", - "addr" : { + "ipv4" : { classNames: "col-xs-6" }, - "addr6" : { + "ipv6" : { classNames: "col-xs-6" }, }, "smf" : { classNames: "col-xs-12", - "addr" : { + "ipv4" : { classNames: "col-xs-6" }, - "addr6" : { + "ipv6" : { classNames: "col-xs-6" }, }, diff --git a/webui/src/components/Profile/View.js b/webui/src/components/Profile/View.js index cf9523b54..98c3b514e 100644 --- a/webui/src/components/Profile/View.js +++ b/webui/src/components/Profile/View.js @@ -391,18 +391,18 @@ const View = ({ visible, disableOnClickOutside, profile, onEdit, onDelete, onHid
{"UE IPv4"}
-
{(session.ue || {}).addr}
+
{(session.ue || {}).ipv4}
{"UE IPv6"}
-
{(session.ue || {}).addr6}
+
{(session.ue || {}).ipv6}
} {session['smf'] !== undefined &&
{"SMF IPv4"}
-
{(session.smf || {}).addr}
+
{(session.smf || {}).ipv4}
{"SMF IPv6"}
-
{(session.smf || {}).addr6}
+
{(session.smf || {}).ipv6}
} {session['pcc_rule'] !== undefined && diff --git a/webui/src/components/Subscriber/Edit.js b/webui/src/components/Subscriber/Edit.js index ea874c82b..dda78e5ce 100644 --- a/webui/src/components/Subscriber/Edit.js +++ b/webui/src/components/Subscriber/Edit.js @@ -286,12 +286,12 @@ const schema = { "type": "object", "title": "", "properties": { - "addr": { + "ipv4": { "type": "string", "title": "UE IPv4 Address", "format" : "ipv4" }, - "addr6": { + "ipv6": { "type": "string", "title": "UE IPv6 Address", "format" : "ipv6" @@ -302,12 +302,12 @@ const schema = { "type": "object", "title": "", "properties": { - "addr": { + "ipv4": { "type": "string", "title": "SMF IPv4 Address", "format" : "ipv4" }, - "addr6": { + "ipv6": { "type": "string", "title": "SMF IPv6 Address", "format" : "ipv6" @@ -592,19 +592,19 @@ const uiSchema = { }, "ue" : { classNames: "col-xs-12", - "addr" : { + "ipv4" : { classNames: "col-xs-6" }, - "addr6" : { + "ipv6" : { classNames: "col-xs-6" }, }, "smf" : { classNames: "col-xs-12", - "addr" : { + "ipv4" : { classNames: "col-xs-6" }, - "addr6" : { + "ipv6" : { classNames: "col-xs-6" }, }, diff --git a/webui/src/components/Subscriber/View.js b/webui/src/components/Subscriber/View.js index 867e79bdd..ba7e2f0da 100644 --- a/webui/src/components/Subscriber/View.js +++ b/webui/src/components/Subscriber/View.js @@ -436,18 +436,18 @@ const View = ({ visible, disableOnClickOutside, subscriber, onEdit, onDelete, on
{"UE IPv4"}
-
{(session.ue || {}).addr}
+
{(session.ue || {}).ipv4}
{"UE IPv6"}
-
{(session.ue || {}).addr6}
+
{(session.ue || {}).ipv6}
} {session['smf'] !== undefined &&
{"SMF IPv4"}
-
{(session.smf || {}).addr}
+
{(session.smf || {}).ipv4}
{"SMF IPv6"}
-
{(session.smf || {}).addr6}
+
{(session.smf || {}).ipv6}
} {session['pcc_rule'] !== undefined &&