Projects
osmocom:nightly
open5gs
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 28
View file
open5gs_2.4.8.202207240002.dsc -> open5gs_2.4.8.202207250002.dsc
Changed
@@ -2,7 +2,7 @@ Source: open5gs Binary: open5gs-common, open5gs-mme, open5gs-sgwc, open5gs-smf, open5gs-amf, open5gs-sgwu, open5gs-upf, open5gs-hss, open5gs-pcrf, open5gs-nrf, open5gs-ausf, open5gs-udm, open5gs-pcf, open5gs-nssf, open5gs-bsf, open5gs-udr, open5gs, open5gs-dbg Architecture: any -Version: 2.4.8.202207240002 +Version: 2.4.8.202207250002 Maintainer: Harald Welte <laforge@gnumonks.org> Uploaders: Sukchan Lee <acetcom@gmail.com> Homepage: https://open5gs.org @@ -30,8 +30,8 @@ open5gs-udr deb net optional arch=any open5gs-upf deb net optional arch=any Checksums-Sha1: - a817c7bb979ac93ae6ddced2415884bea86d2ab9 11456572 open5gs_2.4.8.202207240002.tar.xz + 8fc909756d2593e0d8d4e67eee0b2c74eb2c01f5 11457528 open5gs_2.4.8.202207250002.tar.xz Checksums-Sha256: - ff8a9228b5067fd8aadd1f09aee880d0102e3e64553a720fde146817eed1b77c 11456572 open5gs_2.4.8.202207240002.tar.xz + 0434cbed773ff92d587b1f282d413f45da1fead1eb6d9176cebe9668856cdf75 11457528 open5gs_2.4.8.202207250002.tar.xz Files: - 5a47aa968aad5e630cc2f600472174c6 11456572 open5gs_2.4.8.202207240002.tar.xz + 7eb7efce92ad40619d1f254e4e9b3dee 11457528 open5gs_2.4.8.202207250002.tar.xz
View file
open5gs_2.4.8.202207240002.tar.xz/configs/sample.yaml.in -> open5gs_2.4.8.202207250002.tar.xz/configs/sample.yaml.in
Changed
@@ -200,33 +200,33 @@ # # <SBI Client>> # -# o SBI Client(http://127.0.0.10:7777) +# o SBI Client(http://127.0.1.10:7777) # sbi: -# addr: 127.0.0.10 +# addr: 127.0.1.10 # port: 7777 # -# o SBI Client(https://127.0.0.10:443, http://scp.open5gs.org:80) +# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80) # sbi: -# - addr: 127.0.0.10 +# - addr: 127.0.1.10 # tls: # key: scp.key # pem: scp.pem # - name: scp.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. +# 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.0.10 -# - fd69:f21d:873c:fa::1 +# - 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.0.10 +# addr: 127.0.1.10 # option: # tcp_nodelay: false # so_linger:
View file
open5gs_2.4.8.202207240002.tar.xz/debian/changelog -> open5gs_2.4.8.202207250002.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -open5gs (2.4.8.202207240002) UNRELEASED; urgency=medium +open5gs (2.4.8.202207250002) UNRELEASED; urgency=medium * Snapshot build - -- Sukchan Lee <acetcom@gmail.com> Sun, 24 Jul 2022 00:09:15 +0000 + -- Sukchan Lee <acetcom@gmail.com> Mon, 25 Jul 2022 00:09:22 +0000 open5gs (2.4.8) unstable; urgency=medium
View file
open5gs_2.4.8.202207240002.tar.xz/debian/control -> open5gs_2.4.8.202207250002.tar.xz/debian/control
Changed
@@ -31,7 +31,7 @@ Package: open5gs-common Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${shlibs:Depends}, ${misc:Depends} Description: 5G Core and EPC (Shared Files) Open5GS is a C-language implementation of 5G Core and EPC @@ -43,7 +43,7 @@ Package: open5gs-mme Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: MME (Mobility Management Entity) @@ -58,7 +58,7 @@ Package: open5gs-sgwc Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: SGW-C (Serving Gateway - Control Plane) @@ -72,7 +72,7 @@ Package: open5gs-smf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: SMF (Session Management Function) @@ -84,7 +84,7 @@ Package: open5gs-amf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: AMF (Access and Mobility Management Function) @@ -96,7 +96,7 @@ Package: open5gs-sgwu Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: SGW-U (Serving Gateway - User Plane) @@ -110,7 +110,7 @@ Package: open5gs-upf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${shlibs:Depends}, ${misc:Depends}, udev, open5gs-common (= ${binary:Version}) @@ -123,7 +123,7 @@ Package: open5gs-hss Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${shlibs:Depends}, ${misc:Depends}, mongodb-org | mongodb, open5gs-common (= ${binary:Version}) @@ -140,7 +140,7 @@ Package: open5gs-pcrf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${shlibs:Depends}, ${misc:Depends}, mongodb-org | mongodb, open5gs-common (= ${binary:Version}) @@ -156,7 +156,7 @@ Package: open5gs-nrf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: NRF (Network Repository Function) @@ -168,7 +168,7 @@ Package: open5gs-ausf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: AUSF (Authentication Server Function) @@ -180,7 +180,7 @@ Package: open5gs-udm Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: UDM (Unified Data Management) @@ -192,7 +192,7 @@ Package: open5gs-pcf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: PCF (Policy Control Function) @@ -204,7 +204,7 @@ Package: open5gs-nssf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: NSSF (Network Slice Selection Function) @@ -216,7 +216,7 @@ Package: open5gs-bsf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: BSF (Binding Support Function) @@ -228,7 +228,7 @@ Package: open5gs-udr Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: UDR (Unified Data Repository) @@ -240,7 +240,7 @@ Package: open5gs Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${misc:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${misc:Depends}, open5gs-common (= ${binary:Version}), open5gs-mme (= ${binary:Version}), open5gs-sgwc (= ${binary:Version}), @@ -266,7 +266,7 @@ Package: open5gs-dbg Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202207240002), ${misc:Depends}, +Depends: osmocom-nightly (= 1.0.0.202207250002), ${misc:Depends}, open5gs (= ${binary:Version}) Description: Debug symbols for Open5GS Open5GS is a C-language implementation of 5G Core and EPC
View file
open5gs_2.4.8.202207240002.tar.xz/lib/app/ogs-context.c -> open5gs_2.4.8.202207250002.tar.xz/lib/app/ogs-context.c
Changed
@@ -64,38 +64,27 @@ 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 MAX_NUM_OF_TIMER 16 - self.pool.timer = self.max.ue * MAX_NUM_OF_TIMER; -#define MAX_NUM_OF_MESSAGE 16 - self.pool.message = self.max.ue * MAX_NUM_OF_MESSAGE; -#define MAX_NUM_OF_EVENT 16 - self.pool.event = self.max.ue * MAX_NUM_OF_EVENT; +#define OGS_MAX_NUM_OF_NF_SUBSCRIPTION 4 /* Num of Subscription per NF */ + self.pool.nf_service = self.max.gnb * OGS_MAX_NUM_OF_NF_SERVICE; - self.pool.packet = self.max.ue * OGS_MAX_NUM_OF_PACKET_BUFFER; +#define POOL_NUM_PER_UE 16 +#define POOL_NUM_PER_GNB 8 + 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.subscription = self.max.ue * POOL_NUM_PER_UE; + self.pool.xact = self.max.ue * POOL_NUM_PER_UE; self.pool.nf = self.max.gnb; -#define MAX_NUM_OF_SOCKET 8 - self.pool.socket = self.max.ue * MAX_NUM_OF_SOCKET; - -#define MAX_NUM_OF_XACT 8 - self.pool.gtp_xact = self.max.ue * MAX_NUM_OF_XACT; - self.pool.gtp_node = self.max.gtp_peer; - - self.pool.pfcp_xact = self.max.ue * MAX_NUM_OF_XACT; - self.pool.pfcp_node = self.pool.nf; - -#define MAX_NUM_OF_NF_SERVICE 16 /* Num of NF Service per NF Instance */ -#define MAX_NUM_OF_SBI_MESSAGE 4 /* Num of HTTP(s) Request/Response per NF */ -#define MAX_NUM_OF_NF_SUBSCRIPTION 4 /* Num of Subscription per NF */ - self.pool.nf_service = self.pool.nf * MAX_NUM_OF_NF_SERVICE; - self.pool.nf_subscription = self.pool.nf * MAX_NUM_OF_NF_SUBSCRIPTION; - #define MAX_CSMAP_POOL 128 self.pool.csmap = MAX_CSMAP_POOL; /* Num of TAI-LAI Mapping Table */ @@ -192,11 +181,9 @@ #define MAX_NUM_OF_UE 1024 /* Num of UE per AMF/MME */ #define MAX_NUM_OF_GNB 64 /* Num of gNB per AMF/MME */ -#define MAX_NUM_OF_GTP_PEER 64 /* Num of gtp_node per SGW/PGW */ self.max.gnb = MAX_NUM_OF_GNB; self.max.ue = MAX_NUM_OF_UE; - self.max.gtp_peer = MAX_NUM_OF_GTP_PEER; ogs_pkbuf_default_init(&self.pool.defconfig); @@ -444,9 +431,6 @@ !strcmp(max_key, "enb")) { const char *v = ogs_yaml_iter_value(&max_iter); if (v) self.max.gnb = atoi(v); - } else if (!strcmp(max_key, "gtp_peer")) { - 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); }
View file
open5gs_2.4.8.202207240002.tar.xz/lib/app/ogs-context.h -> open5gs_2.4.8.202207250002.tar.xz/lib/app/ogs-context.h
Changed
@@ -109,27 +109,25 @@ struct { ogs_pkbuf_config_t defconfig; - uint64_t packet; - uint64_t nf; + uint64_t packet; uint64_t sess; uint64_t bearer; uint64_t tunnel; - uint64_t nf_service; - uint64_t nf_subscription; - uint64_t csmap; + uint64_t nf_service; + uint64_t timer; uint64_t message; uint64_t event; - uint64_t timer; - uint64_t socket; - uint64_t gtp_xact; - uint64_t gtp_node; - uint64_t pfcp_xact; - uint64_t pfcp_node; + uint64_t subscription; + uint64_t xact; + + uint64_t nf; + + uint64_t csmap; uint64_t impi; uint64_t impu;
View file
open5gs_2.4.8.202207240002.tar.xz/lib/core/ogs-3gpp-types.h -> open5gs_2.4.8.202207250002.tar.xz/lib/core/ogs-3gpp-types.h
Changed
@@ -33,6 +33,9 @@ #define OGS_BEARER_PER_UE 8 /* Num of Bearer per UE */ #define OGS_MAX_NUM_OF_PACKET_BUFFER 64 /* Num of PacketBuffer per UE */ +/* Num of NF Service per NF Instance */ +#define OGS_MAX_NUM_OF_NF_SERVICE 16 + /* * The array of TLV messages is limited to 8. * So, Flow(PDI.SDF_Filter) in PDR is limited to 8. @@ -56,6 +59,8 @@ #define OGS_PLMN_ID_LEN 3 #define OGS_MAX_PLMN_ID_BCD_LEN 6 +#define OGS_CHRGCHARS_LEN 2 + #define OGS_BCD_TO_BUFFER_LEN(x) (((x)+1)/2) #define OGS_MAX_IMSI_BCD_LEN 15 #define OGS_MAX_IMSI_LEN \ @@ -453,6 +458,9 @@ uint32_t context_identifier; /* EPC */ bool default_dnn_indicator; /* 5GC */ + uint8_t charging_characteristicsOGS_CHRGCHARS_LEN; + bool charging_characteristics_presence; + #define OGS_PDU_SESSION_TYPE_IPV4 1 #define OGS_PDU_SESSION_TYPE_IPV6 2 #define OGS_PDU_SESSION_TYPE_IPV4V6 3
View file
open5gs_2.4.8.202207240002.tar.xz/lib/diameter/s6a/message.c -> open5gs_2.4.8.202207250002.tar.xz/lib/diameter/s6a/message.c
Changed
@@ -57,6 +57,7 @@ struct dict_object *ogs_diam_s6a_max_bandwidth_ul = NULL; struct dict_object *ogs_diam_s6a_max_bandwidth_dl = NULL; struct dict_object *ogs_diam_s6a_pdn_type = NULL; +struct dict_object *ogs_diam_s6a_3gpp_charging_characteristics = NULL; struct dict_object *ogs_diam_s6a_served_party_ip_address = NULL; struct dict_object *ogs_diam_s6a_eps_subscribed_qos_profile = NULL; struct dict_object *ogs_diam_s6a_qos_class_identifier = NULL; @@ -125,6 +126,7 @@ CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "All-APN-Configurations-Included-Indicator", &ogs_diam_s6a_all_apn_configuration_included_indicator); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "APN-Configuration", &ogs_diam_s6a_apn_configuration); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "PDN-Type", &ogs_diam_s6a_pdn_type); + CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-Charging-Characteristics", &ogs_diam_s6a_3gpp_charging_characteristics); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Served-Party-IP-Address", &ogs_diam_s6a_served_party_ip_address); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Data", &ogs_diam_s6a_subscription_data); CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscriber-Status", &ogs_diam_s6a_subscriber_status);
View file
open5gs_2.4.8.202207240002.tar.xz/lib/diameter/s6a/message.h -> open5gs_2.4.8.202207250002.tar.xz/lib/diameter/s6a/message.h
Changed
@@ -103,6 +103,7 @@ extern struct dict_object *ogs_diam_s6a_max_bandwidth_ul; extern struct dict_object *ogs_diam_s6a_max_bandwidth_dl; extern struct dict_object *ogs_diam_s6a_pdn_type; +extern struct dict_object *ogs_diam_s6a_3gpp_charging_characteristics; extern struct dict_object *ogs_diam_s6a_served_party_ip_address; extern struct dict_object *ogs_diam_s6a_eps_subscribed_qos_profile; extern struct dict_object *ogs_diam_s6a_qos_class_identifier;
View file
open5gs_2.4.8.202207240002.tar.xz/lib/gtp/context.c -> open5gs_2.4.8.202207250002.tar.xz/lib/gtp/context.c
Changed
@@ -35,7 +35,7 @@ ogs_log_install_domain(&__ogs_gtp_domain, "gtp", ogs_core()->log.level); - ogs_pool_init(&pool, ogs_app()->pool.gtp_node); + ogs_pool_init(&pool, ogs_app()->pool.nf); ogs_pool_init(&ogs_gtpu_resource_pool, num_of_gtpu_resource); context_initialized = 1;
View file
open5gs_2.4.8.202207240002.tar.xz/lib/gtp/xact.c -> open5gs_2.4.8.202207250002.tar.xz/lib/gtp/xact.c
Changed
@@ -48,7 +48,7 @@ { ogs_assert(ogs_gtp_xact_initialized == 0); - ogs_pool_init(&pool, ogs_app()->pool.gtp_xact); + ogs_pool_init(&pool, ogs_app()->pool.xact); g_xact_id = 0;
View file
open5gs_2.4.8.202207240002.tar.xz/lib/pfcp/context.c -> open5gs_2.4.8.202207250002.tar.xz/lib/pfcp/context.c
Changed
@@ -48,7 +48,7 @@ ogs_log_install_domain(&__ogs_pfcp_domain, "pfcp", ogs_core()->log.level); - ogs_pool_init(&ogs_pfcp_node_pool, ogs_app()->pool.pfcp_node); + ogs_pool_init(&ogs_pfcp_node_pool, ogs_app()->pool.nf); ogs_pool_init(&ogs_pfcp_sess_pool, ogs_app()->pool.sess);
View file
open5gs_2.4.8.202207240002.tar.xz/lib/pfcp/xact.c -> open5gs_2.4.8.202207250002.tar.xz/lib/pfcp/xact.c
Changed
@@ -53,7 +53,7 @@ { ogs_assert(ogs_pfcp_xact_initialized == 0); - ogs_pool_init(&pool, ogs_app()->pool.pfcp_xact); + ogs_pool_init(&pool, ogs_app()->pool.xact); g_xact_id = 0;
View file
open5gs_2.4.8.202207240002.tar.xz/lib/sbi/context.c -> open5gs_2.4.8.202207250002.tar.xz/lib/sbi/context.c
Changed
@@ -50,10 +50,10 @@ ogs_pool_init(&nf_instance_pool, ogs_app()->pool.nf); ogs_pool_init(&nf_service_pool, ogs_app()->pool.nf_service); - ogs_pool_init(&xact_pool, ogs_app()->pool.message); + ogs_pool_init(&xact_pool, ogs_app()->pool.xact); ogs_list_init(&self.subscription_list); - ogs_pool_init(&subscription_pool, ogs_app()->pool.nf_subscription); + ogs_pool_init(&subscription_pool, ogs_app()->pool.subscription); ogs_pool_init(&smf_info_pool, ogs_app()->pool.nf); @@ -1323,41 +1323,48 @@ nf_service_associate_client(nf_service); } -void ogs_sbi_select_nf( - ogs_sbi_object_t *sbi_object, OpenAPI_nf_type_e nf_type, void *state) +bool ogs_sbi_discovery_param_is_matched( + ogs_sbi_nf_instance_t *nf_instance, + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option) { - ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_assert(nf_instance); + ogs_assert(ogs_sbi_self()->nf_state_registered); + ogs_assert(target_nf_type); - ogs_assert(sbi_object); - ogs_assert(nf_type); - ogs_assert(state); + if (!OGS_FSM_CHECK(&nf_instance->sm, + ogs_sbi_self()->nf_state_registered)) return false; - ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) { - if (OGS_FSM_CHECK(&nf_instance->sm, state) && - nf_instance->nf_type == nf_type) { - OGS_SBI_SETUP_NF(sbi_object, nf_type, nf_instance); - break; - } + if (nf_instance->nf_type != target_nf_type) return false; + + if (discovery_option) { + if (discovery_option->target_nf_instance_id && + strcmp(nf_instance->id, + discovery_option->target_nf_instance_id) != 0) + return false; } + + return true; } -void ogs_sbi_select_nf_by_instanceid( - ogs_sbi_object_t *sbi_object, OpenAPI_nf_type_e nf_type, void *state, - char *nf_instance_id) +void ogs_sbi_select_nf( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option) { ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_assert(ogs_sbi_self()->nf_state_registered); ogs_assert(sbi_object); - ogs_assert(nf_type); - ogs_assert(state); + ogs_assert(target_nf_type); ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) { - if (OGS_FSM_CHECK(&nf_instance->sm, state) && - (nf_instance->nf_type == nf_type) && - (!(strcmp(nf_instance->id, nf_instance_id)))) { - OGS_SBI_SETUP_NF(sbi_object, nf_type, nf_instance); - break; - } + if (ogs_sbi_discovery_param_is_matched( + nf_instance, target_nf_type, discovery_option) == false) + continue; + + OGS_SBI_SETUP_NF(sbi_object, target_nf_type, nf_instance); + break; } } @@ -1423,21 +1430,25 @@ } ogs_sbi_xact_t *ogs_sbi_xact_add( - OpenAPI_nf_type_e target_nf_type, ogs_sbi_object_t *sbi_object, - ogs_sbi_build_f build, void *context, void *data, - void (*timer_cb)(void *data)) + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_build_f build, void *context, void *data) { ogs_sbi_xact_t *xact = NULL; + ogs_assert(ogs_sbi_self()->client_wait_expire); ogs_assert(sbi_object); ogs_pool_alloc(&xact_pool, &xact); ogs_expect_or_return_val(xact, NULL); memset(xact, 0, sizeof(ogs_sbi_xact_t)); - xact->target_nf_type = target_nf_type; xact->sbi_object = sbi_object; + xact->target_nf_type = target_nf_type; + xact->discovery_option = discovery_option; + xact->request = (*build)(context, data); if (!xact->request) { ogs_error("SBI build failed"); @@ -1446,7 +1457,7 @@ } xact->t_response = ogs_timer_add( - ogs_app()->timer_mgr, timer_cb, xact); + ogs_app()->timer_mgr, ogs_sbi_self()->client_wait_expire, xact); if (!xact->t_response) { ogs_error("ogs_timer_add() failed"); ogs_sbi_request_free(xact->request); @@ -1471,6 +1482,9 @@ sbi_object = xact->sbi_object; ogs_assert(sbi_object); + if (xact->discovery_option) + ogs_sbi_discovery_option_free(xact->discovery_option); + ogs_assert(xact->t_response); ogs_timer_delete(xact->t_response);
View file
open5gs_2.4.8.202207240002.tar.xz/lib/sbi/context.h -> open5gs_2.4.8.202207250002.tar.xz/lib/sbi/context.h
Changed
@@ -65,6 +65,9 @@ const char *content_encoding; + void (*client_wait_expire)(void *data); + ogs_fsm_handler_t nf_state_registered; + } ogs_sbi_context_t; typedef struct ogs_sbi_nf_instance_s { @@ -157,6 +160,7 @@ ogs_lnode_t lnode; OpenAPI_nf_type_e target_nf_type; + ogs_sbi_discovery_option_t *discovery_option; ogs_sbi_request_t *request; ogs_timer_t *t_response; @@ -337,18 +341,23 @@ (__nFInstance)->reference_count); \ } while(0) +bool ogs_sbi_discovery_param_is_matched( + ogs_sbi_nf_instance_t *nf_instance, + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option); + void ogs_sbi_select_nf( - ogs_sbi_object_t *sbi_object, OpenAPI_nf_type_e nf_type, void *state); -void ogs_sbi_select_nf_by_instanceid( - ogs_sbi_object_t *sbi_object, OpenAPI_nf_type_e nf_type, void *state, - char *nf_instance_id); + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option); void ogs_sbi_object_free(ogs_sbi_object_t *sbi_object); ogs_sbi_xact_t *ogs_sbi_xact_add( - OpenAPI_nf_type_e target_nf_type, ogs_sbi_object_t *sbi_object, - ogs_sbi_build_f build, void *context, void *data, - void (*timer_cb)(void *data)); + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_build_f build, void *context, void *data); void ogs_sbi_xact_remove(ogs_sbi_xact_t *xact); void ogs_sbi_xact_remove_all(ogs_sbi_object_t *sbi_object); ogs_sbi_xact_t *ogs_sbi_xact_cycle(ogs_sbi_xact_t *xact);
View file
open5gs_2.4.8.202207240002.tar.xz/lib/sbi/message.c -> open5gs_2.4.8.202207250002.tar.xz/lib/sbi/message.c
Changed
@@ -60,6 +60,11 @@ ogs_assert(message); + /* Discovery Option */ + if (message->param.discovery_option) + ogs_sbi_discovery_option_free(message->param.discovery_option); + + /* JSON Data */ if (message->NFProfile) OpenAPI_nf_profile_free(message->NFProfile); if (message->ProblemDetails) @@ -176,6 +181,7 @@ if (message->DeregistrationData) OpenAPI_deregistration_data_free(message->DeregistrationData); + /* HTTP Part */ for (i = 0; i < message->num_of_part; i++) { if (message->parti.pkbuf) ogs_pkbuf_free(message->parti.pkbuf); @@ -242,6 +248,7 @@ ogs_sbi_request_t *ogs_sbi_build_request(ogs_sbi_message_t *message) { + int i; ogs_sbi_request_t *request = NULL; ogs_assert(message); @@ -255,8 +262,6 @@ request->h.uri = ogs_strdup(message->h.uri); ogs_expect_or_return_val(request->h.uri, NULL); } else { - int i; - ogs_expect_or_return_val(message->h.service.name, NULL); request->h.service.name = ogs_strdup(message->h.service.name); ogs_expect_or_return_val(message->h.api.version, NULL); @@ -270,15 +275,12 @@ message->h.resource.componenti); } - /* URL Param */ - if (message->param.nf_id) { - ogs_sbi_header_set(request->http.params, - OGS_SBI_PARAM_NF_ID, message->param.nf_id); - } - if (message->param.nf_type) { - char *v = OpenAPI_nf_type_ToString(message->param.nf_type); + /* Discovery Parameter */ + if (message->param.target_nf_type) { + char *v = OpenAPI_nf_type_ToString(message->param.target_nf_type); ogs_expect_or_return_val(v, NULL); - ogs_sbi_header_set(request->http.params, OGS_SBI_PARAM_NF_TYPE, v); + ogs_sbi_header_set(request->http.params, + OGS_SBI_PARAM_TARGET_NF_TYPE, v); } if (message->param.requester_nf_type) { char *v = OpenAPI_nf_type_ToString(message->param.requester_nf_type); @@ -286,11 +288,50 @@ ogs_sbi_header_set(request->http.params, OGS_SBI_PARAM_REQUESTER_NF_TYPE, v); } - if (message->param.target_nf_type) { - char *v = OpenAPI_nf_type_ToString(message->param.target_nf_type); - ogs_expect_or_return_val(v, NULL); + + /* Discovery Option Parameter */ + if (message->param.discovery_option) { + ogs_sbi_discovery_option_t *discovery_option = + message->param.discovery_option; + + if (discovery_option->target_nf_instance_id) { + ogs_sbi_header_set(request->http.params, + OGS_SBI_PARAM_TARGET_NF_INSTANCE_ID, + discovery_option->target_nf_instance_id); + } + if (discovery_option->requester_nf_instance_id) { + ogs_sbi_header_set(request->http.params, + OGS_SBI_PARAM_REQUESTER_NF_INSTANCE_ID, + discovery_option->requester_nf_instance_id); + } + if (discovery_option->num_of_service_names) { + char *v = NULL; + cJSON *item = NULL; + + item = cJSON_CreateStringArray( + (const char * const*)discovery_option->service_names, + discovery_option->num_of_service_names); + ogs_expect_or_return_val(item, NULL); + + v = cJSON_Print(item); + ogs_expect_or_return_val(v, NULL); + cJSON_Delete(item); + + ogs_sbi_header_set( + request->http.params, OGS_SBI_PARAM_SERVICE_NAMES, v); + ogs_free(v); + } + } + + /* URL Query Paramemter */ + if (message->param.nf_id) { ogs_sbi_header_set(request->http.params, - OGS_SBI_PARAM_TARGET_NF_TYPE, v); + OGS_SBI_PARAM_NF_ID, message->param.nf_id); + } + if (message->param.nf_type) { + char *v = OpenAPI_nf_type_ToString(message->param.nf_type); + ogs_expect_or_return_val(v, NULL); + ogs_sbi_header_set(request->http.params, OGS_SBI_PARAM_NF_TYPE, v); } if (message->param.limit) { char *v = ogs_msprintf("%d", message->param.limit); @@ -440,6 +481,8 @@ { int rv; ogs_hash_index_t *hi; + ogs_sbi_discovery_option_t *discovery_option = NULL; + bool discovery_option_presence = false; ogs_assert(request); ogs_assert(message); @@ -450,14 +493,14 @@ return OGS_ERROR; } + discovery_option_presence = false; + discovery_option = ogs_sbi_discovery_option_new(); + ogs_assert(discovery_option); + for (hi = ogs_hash_first(request->http.params); hi; hi = ogs_hash_next(hi)) { - if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_PARAM_NF_ID)) { - message->param.nf_id = ogs_hash_this_val(hi); - } else if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_PARAM_NF_TYPE)) { - message->param.nf_type = - OpenAPI_nf_type_FromString(ogs_hash_this_val(hi)); - } else if (!strcmp(ogs_hash_this_key(hi), + /* Discovery Parameter */ + if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_PARAM_TARGET_NF_TYPE)) { message->param.target_nf_type = OpenAPI_nf_type_FromString(ogs_hash_this_val(hi)); @@ -465,6 +508,46 @@ OGS_SBI_PARAM_REQUESTER_NF_TYPE)) { message->param.requester_nf_type = OpenAPI_nf_type_FromString(ogs_hash_this_val(hi)); + + /* Discovery Option Parameter */ + } else if (!strcmp(ogs_hash_this_key(hi), + OGS_SBI_PARAM_TARGET_NF_INSTANCE_ID)) { + discovery_option_presence = true; + ogs_sbi_discovery_option_set_target_nf_instance_id( + discovery_option, ogs_hash_this_val(hi)); + } else if (!strcmp(ogs_hash_this_key(hi), + OGS_SBI_PARAM_REQUESTER_NF_INSTANCE_ID)) { + discovery_option_presence = true; + ogs_sbi_discovery_option_set_requester_nf_instance_id( + discovery_option, ogs_hash_this_val(hi)); + } else if (!strcmp(ogs_hash_this_key(hi), + OGS_SBI_PARAM_SERVICE_NAMES)) { + char *v = NULL; + cJSON *array = NULL, *item = NULL; + + v = ogs_hash_this_val(hi); + if (v) { + array = cJSON_Parse(v); + if (cJSON_IsArray(array)) { + + discovery_option_presence = true; + + cJSON_ArrayForEach(item, array) { + char *names = cJSON_GetStringValue(item); + if (names) + ogs_sbi_discovery_option_add_service_names( + discovery_option, names); + } + } + cJSON_Delete(array); + } + + /* URL Query Parameter */ + } else if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_PARAM_NF_ID)) { + message->param.nf_id = ogs_hash_this_val(hi); + } else if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_PARAM_NF_TYPE)) { + message->param.nf_type = + OpenAPI_nf_type_FromString(ogs_hash_this_val(hi)); } else if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_PARAM_LIMIT)) { message->param.limit = atoi(ogs_hash_this_val(hi)); } else if (!strcmp(ogs_hash_this_key(hi), OGS_SBI_PARAM_DNN)) { @@ -544,6 +627,13 @@ } } + if (discovery_option_presence == true) + /* message->param.discovery_option will be freed() + * in ogs_sbi_message_free() */ + message->param.discovery_option = discovery_option; + else + ogs_sbi_discovery_option_free(discovery_option);
View file
open5gs_2.4.8.202207240002.tar.xz/lib/sbi/message.h -> open5gs_2.4.8.202207250002.tar.xz/lib/sbi/message.h
Changed
@@ -247,20 +247,6 @@ #define OGS_SBI_NBSF_MANAGEMENT_ES3XX 4 #define OGS_SBI_NBSF_MANAGEMENT_EXTENDED_SAME_PCF 5 -#define OGS_SBI_PARAM_NF_ID "nf-id" -#define OGS_SBI_PARAM_NF_TYPE "nf-type" -#define OGS_SBI_PARAM_TARGET_NF_TYPE "target-nf-type" -#define OGS_SBI_PARAM_REQUESTER_NF_TYPE "requester-nf-type" -#define OGS_SBI_PARAM_LIMIT "limit" -#define OGS_SBI_PARAM_DNN "dnn" -#define OGS_SBI_PARAM_PLMN_ID "plmn-id" -#define OGS_SBI_PARAM_SINGLE_NSSAI "single-nssai" -#define OGS_SBI_PARAM_SNSSAI "snssai" -#define OGS_SBI_PARAM_SLICE_INFO_REQUEST_FOR_PDU_SESSION \ - "slice-info-request-for-pdu-session" -#define OGS_SBI_PARAM_IPV4ADDR "ipv4Addr" -#define OGS_SBI_PARAM_IPV6PREFIX "ipv6Prefix" - #define OGS_SBI_ACCEPT "Accept" #define OGS_SBI_ACCEPT_ENCODING "Accept-Encoding" #define OGS_SBI_CONTENT_TYPE "Content-Type" @@ -274,20 +260,61 @@ #define OGS_SBI_APPLICATION_5GNAS_TYPE "vnd.3gpp.5gnas" #define OGS_SBI_APPLICATION_NGAP_TYPE "vnd.3gpp.ngap" -#define OGS_SBI_CUSTOM_3GPP_COMMON "3gpp-Sbi-" -#define OGS_SBI_CUSTOM_MESSAGE_PRIORITY "3gpp-Sbi-Message-Priority" -#define OGS_SBI_CUSTOM_CALLBACK "3gpp-Sbi-Callback" -#define OGS_SBI_CUSTOM_TARGET_APIROOT "3gpp-Sbi-Target-apiRoot" -#define OGS_SBI_CUSTOM_ROUTING_BINDING "3gpp-Sbi-Routing-Binding" -#define OGS_SBI_CUSTOM_BINDING "3gpp-Sbi-Binding" -#define OGS_SBI_CUSTOM_DISCOVERY_COMMON "3gpp-Sbi-Discovery-" -#define OGS_SBI_CUSTOM_PRODUCER_ID "3gpp-Sbi-Producer-Id" -#define OGS_SBI_CUSTOM_OCI "3gpp-Sbi-Oci" -#define OGS_SBI_CUSTOM_CLIENT_CREDENTIALS "3gpp-Sbi-Client-Credentials" -#define OGS_SBI_CUSTOM_NRF_URI "3gpp-Sbi-Nrf-Uri" -#define OGS_SBI_CUSTOM_TARGET_NF_ID "3gpp-Sbi-Target-Nf-Id" -#define OGS_SBI_CUSTOM_ACCESS_SCOPE "3gpp-Sbi-Access-Scope" -#define OGS_SBI_CUSTOM_ACCESS_TOKEN "3gpp-Sbi-Access-Token" +#define OGS_SBI_CUSTOM_3GPP_COMMON "3gpp-Sbi-" +#define OGS_SBI_CUSTOM_MESSAGE_PRIORITY \ + OGS_SBI_CUSTOM_3GPP_COMMON "Message-Priority" +#define OGS_SBI_CUSTOM_CALLBACK \ + OGS_SBI_CUSTOM_3GPP_COMMON "Callback" +#define OGS_SBI_CUSTOM_TARGET_APIROOT \ + OGS_SBI_CUSTOM_3GPP_COMMON "Target-apiRoot" +#define OGS_SBI_CUSTOM_ROUTING_BINDING \ + OGS_SBI_CUSTOM_3GPP_COMMON "Routing-Binding" +#define OGS_SBI_CUSTOM_BINDING \ + OGS_SBI_CUSTOM_3GPP_COMMON "Binding" +#define OGS_SBI_CUSTOM_DISCOVERY_COMMON \ + OGS_SBI_CUSTOM_3GPP_COMMON "Discovery-" +#define OGS_SBI_CUSTOM_DISCOVERY_TARGET_NF_TYPE \ + OGS_SBI_CUSTOM_DISCOVERY_COMMON OGS_SBI_PARAM_TARGET_NF_TYPE +#define OGS_SBI_CUSTOM_DISCOVERY_REQUESTER_NF_TYPE \ + OGS_SBI_CUSTOM_DISCOVERY_COMMON OGS_SBI_PARAM_REQUESTER_NF_TYPE +#define OGS_SBI_CUSTOM_DISCOVERY_TARGET_NF_INSTANCE_ID \ + OGS_SBI_CUSTOM_DISCOVERY_COMMON OGS_SBI_PARAM_TARGET_NF_INSTANCE_ID +#define OGS_SBI_CUSTOM_DISCOVERY_REQUESTER_NF_INSTANCE_ID \ + OGS_SBI_CUSTOM_DISCOVERY_COMMON OGS_SBI_PARAM_REQUESTER_NF_INSTANCE_ID +#define OGS_SBI_CUSTOM_DISCOVERY_SERVICE_NAMES \ + OGS_SBI_CUSTOM_DISCOVERY_COMMON OGS_SBI_PARAM_SERVICE_NAMES +#define OGS_SBI_CUSTOM_PRODUCER_ID \ + OGS_SBI_CUSTOM_3GPP_COMMON "Producer-Id" +#define OGS_SBI_CUSTOM_OCI \ + OGS_SBI_CUSTOM_3GPP_COMMON "Oci" +#define OGS_SBI_CUSTOM_CLIENT_CREDENTIALS \ + OGS_SBI_CUSTOM_3GPP_COMMON "Client-Credentials" +#define OGS_SBI_CUSTOM_NRF_URI \ + OGS_SBI_CUSTOM_3GPP_COMMON "Nrf-Uri" +#define OGS_SBI_CUSTOM_TARGET_NF_ID \ + OGS_SBI_CUSTOM_3GPP_COMMON "Target-Nf-Id" +#define OGS_SBI_CUSTOM_ACCESS_SCOPE \ + OGS_SBI_CUSTOM_3GPP_COMMON "Access-Scope" +#define OGS_SBI_CUSTOM_ACCESS_TOKEN \ + OGS_SBI_CUSTOM_3GPP_COMMON "Access-Token" + +#define OGS_SBI_PARAM_TARGET_NF_TYPE "target-nf-type" +#define OGS_SBI_PARAM_REQUESTER_NF_TYPE "requester-nf-type" +#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_NF_ID "nf-id" +#define OGS_SBI_PARAM_NF_TYPE "nf-type" +#define OGS_SBI_PARAM_LIMIT "limit" +#define OGS_SBI_PARAM_DNN "dnn" +#define OGS_SBI_PARAM_PLMN_ID "plmn-id" +#define OGS_SBI_PARAM_SINGLE_NSSAI "single-nssai" +#define OGS_SBI_PARAM_SNSSAI "snssai" +#define OGS_SBI_PARAM_SLICE_INFO_REQUEST_FOR_PDU_SESSION \ + "slice-info-request-for-pdu-session" +#define OGS_SBI_PARAM_IPV4ADDR "ipv4Addr" +#define OGS_SBI_PARAM_IPV6PREFIX "ipv6Prefix" #define OGS_SBI_CONTENT_JSON_TYPE \ OGS_SBI_APPLICATION_TYPE "/" OGS_SBI_APPLICATION_JSON_TYPE @@ -337,6 +364,14 @@ ogs_pkbuf_t *pkbuf; } ogs_sbi_part_t; +typedef struct ogs_sbi_discovery_option_s { + char *target_nf_instance_id; + char *requester_nf_instance_id; + + int num_of_service_names; + char *service_namesOGS_MAX_NUM_OF_NF_SERVICE; +} ogs_sbi_discovery_option_t; + typedef struct ogs_sbi_message_s { ogs_sbi_header_t h; @@ -349,8 +384,14 @@ } http; struct { + /* Discovery Parameter */ OpenAPI_nf_type_e target_nf_type; OpenAPI_nf_type_e requester_nf_type; + + /* Discovery Option Parameter */ + ogs_sbi_discovery_option_t *discovery_option; + + /* URL Query Parameter */ char *nf_id; OpenAPI_nf_type_e nf_type; int limit; @@ -494,6 +535,20 @@ void ogs_sbi_http_hash_free(ogs_hash_t *hash); +ogs_sbi_discovery_option_t *ogs_sbi_discovery_option_new(void); +void ogs_sbi_discovery_option_free( + ogs_sbi_discovery_option_t *discovery_option); + +void ogs_sbi_discovery_option_set_target_nf_instance_id( + ogs_sbi_discovery_option_t *discovery_option, + char *target_nf_instance_id); +void ogs_sbi_discovery_option_set_requester_nf_instance_id( + ogs_sbi_discovery_option_t *discovery_option, + char *requester_nf_instance_id); +void ogs_sbi_discovery_option_add_service_names( + ogs_sbi_discovery_option_t *discovery_option, + char *service_name); + #ifdef __cplusplus } #endif
View file
open5gs_2.4.8.202207240002.tar.xz/lib/sbi/nnrf-build.c -> open5gs_2.4.8.202207250002.tar.xz/lib/sbi/nnrf-build.c
Changed
@@ -501,7 +501,8 @@ } ogs_sbi_request_t *ogs_nnrf_disc_build_discover( - OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type) + OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type, + ogs_sbi_discovery_option_t *discovery_option) { ogs_sbi_message_t message; ogs_sbi_request_t *request = NULL; @@ -519,6 +520,8 @@ message.param.target_nf_type = target_nf_type; message.param.requester_nf_type = requester_nf_type; + message.param.discovery_option = discovery_option; + request = ogs_sbi_build_request(&message); return request;
View file
open5gs_2.4.8.202207240002.tar.xz/lib/sbi/nnrf-build.h -> open5gs_2.4.8.202207250002.tar.xz/lib/sbi/nnrf-build.h
Changed
@@ -37,7 +37,8 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_profile_retrieve(char *nf_instance_id); ogs_sbi_request_t *ogs_nnrf_disc_build_discover( - OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type); + OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type, + ogs_sbi_discovery_option_t *discovery_option); #ifdef __cplusplus }
View file
open5gs_2.4.8.202207240002.tar.xz/lib/sbi/path.c -> open5gs_2.4.8.202207250002.tar.xz/lib/sbi/path.c
Changed
@@ -20,7 +20,7 @@ #include "ogs-sbi.h" #include "ogs-app.h" -bool ogs_sbi_send(ogs_sbi_nf_instance_t *nf_instance, +bool ogs_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_client_cb_f client_cb, ogs_sbi_xact_t *xact) { ogs_sbi_request_t *request = NULL; @@ -77,49 +77,49 @@ return true; } -bool ogs_sbi_discover_and_send(ogs_sbi_xact_t *xact, - ogs_fsm_handler_t nf_state_registered, ogs_sbi_client_cb_f client_cb) +bool ogs_sbi_discover_and_send( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + OpenAPI_nf_type_e requester_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_client_cb_f client_cb, void *data) { ogs_sbi_nf_instance_t *nf_instance = NULL; - ogs_assert(xact); - ogs_assert(xact->sbi_object); - ogs_assert(xact->target_nf_type); - ogs_assert(nf_state_registered); + ogs_assert(sbi_object); + ogs_assert(target_nf_type); + ogs_assert(requester_nf_type); ogs_assert(client_cb); /* Target NF-Instance */ - nf_instance = OGS_SBI_NF_INSTANCE(xact->sbi_object, xact->target_nf_type); + nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, target_nf_type); if (!nf_instance) { - ogs_assert(xact->target_nf_type != OpenAPI_nf_type_NRF); - ogs_sbi_select_nf( - xact->sbi_object, xact->target_nf_type, nf_state_registered); - nf_instance = OGS_SBI_NF_INSTANCE( - xact->sbi_object, xact->target_nf_type); + ogs_assert(target_nf_type != OpenAPI_nf_type_NRF); + ogs_sbi_select_nf(sbi_object, target_nf_type, discovery_option); + nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, target_nf_type); } if (nf_instance) { - return ogs_sbi_send(nf_instance, client_cb, xact); + return ogs_sbi_send_request(nf_instance, client_cb, data); } /* NRF NF-Instance */ - nf_instance = OGS_SBI_NF_INSTANCE(xact->sbi_object, OpenAPI_nf_type_NRF); + nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, OpenAPI_nf_type_NRF); if (!nf_instance) { - ogs_sbi_select_nf( - xact->sbi_object, OpenAPI_nf_type_NRF, nf_state_registered); - nf_instance = OGS_SBI_NF_INSTANCE( - xact->sbi_object, OpenAPI_nf_type_NRF); + ogs_sbi_select_nf(sbi_object, OpenAPI_nf_type_NRF, NULL); + nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, OpenAPI_nf_type_NRF); } if (nf_instance) { ogs_warn("Try to discover %s", - OpenAPI_nf_type_ToString(xact->target_nf_type)); + OpenAPI_nf_type_ToString(target_nf_type)); return ogs_nnrf_disc_send_nf_discover( - nf_instance, xact->target_nf_type, xact); + nf_instance, + target_nf_type, requester_nf_type, discovery_option, + data); } - ogs_error("Cannot discover %s", - OpenAPI_nf_type_ToString(xact->target_nf_type)); + ogs_error("Cannot discover %s", OpenAPI_nf_type_ToString(target_nf_type)); return false; } @@ -141,51 +141,6 @@ return ogs_sbi_scp_send_request(client, client->cb, request, nf_instance); } -bool ogs_sbi_discover_by_nf_instanceid_and_send(ogs_sbi_xact_t *xact, - ogs_fsm_handler_t nf_state_registered, ogs_sbi_client_cb_f client_cb, - char *nf_instance_id) -{ - ogs_sbi_nf_instance_t *nf_instance = NULL; - - ogs_assert(xact); - ogs_assert(xact->sbi_object); - ogs_assert(xact->target_nf_type); - ogs_assert(nf_state_registered); - ogs_assert(client_cb); - ogs_assert(nf_instance_id); - - /* Target NF-Instance - search by NF Instance Id */ - ogs_assert(xact->target_nf_type != OpenAPI_nf_type_NRF); - ogs_sbi_select_nf_by_instanceid( - xact->sbi_object, xact->target_nf_type, nf_state_registered, - nf_instance_id); - - nf_instance = OGS_SBI_NF_INSTANCE( - xact->sbi_object, xact->target_nf_type); - - if (nf_instance) { - return ogs_sbi_send(nf_instance, client_cb, xact); - } - - /* NRF NF-Instance */ - nf_instance = OGS_SBI_NF_INSTANCE(xact->sbi_object, OpenAPI_nf_type_NRF); - if (!nf_instance) { - ogs_sbi_select_nf( - xact->sbi_object, OpenAPI_nf_type_NRF, nf_state_registered); - nf_instance = OGS_SBI_NF_INSTANCE( - xact->sbi_object, OpenAPI_nf_type_NRF); - } - - if (nf_instance) { - ogs_warn("Try to retrieve %s", nf_instance_id); - return ogs_nnrf_nfm_send_nf_profile_retrieve(nf_instance, - nf_instance_id, xact); - } - - ogs_error("Cannot retrieve %s", nf_instance_id); - return false; -} - bool ogs_nnrf_nfm_send_nf_update(ogs_sbi_nf_instance_t *nf_instance) { ogs_sbi_request_t *request = NULL; @@ -279,17 +234,22 @@ client, client->cb, request, subscription); } -bool ogs_nnrf_disc_send_nf_discover(ogs_sbi_nf_instance_t *nf_instance, - OpenAPI_nf_type_e target_nf_type, void *data) +bool ogs_nnrf_disc_send_nf_discover( + ogs_sbi_nf_instance_t *nf_instance, + OpenAPI_nf_type_e target_nf_type, + OpenAPI_nf_type_e requester_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + void *data) { ogs_sbi_client_t *client = NULL; ogs_sbi_request_t *request = NULL; ogs_assert(nf_instance); + ogs_assert(target_nf_type); + ogs_assert(requester_nf_type); - ogs_assert(ogs_sbi_self()->nf_instance); request = ogs_nnrf_disc_build_discover( - target_nf_type, ogs_sbi_self()->nf_instance->nf_type); + target_nf_type, requester_nf_type, discovery_option); ogs_expect_or_return_val(request, false); client = nf_instance->client;
View file
open5gs_2.4.8.202207240002.tar.xz/lib/sbi/path.h -> open5gs_2.4.8.202207250002.tar.xz/lib/sbi/path.h
Changed
@@ -26,13 +26,14 @@ extern "C" { #endif -bool ogs_sbi_send(ogs_sbi_nf_instance_t *nf_instance, +bool ogs_sbi_send_request(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_client_cb_f client_cb, ogs_sbi_xact_t *xact); -bool ogs_sbi_discover_and_send(ogs_sbi_xact_t *xact, - ogs_fsm_handler_t nf_state_registered, ogs_sbi_client_cb_f client_cb); -bool ogs_sbi_discover_by_nf_instanceid_and_send(ogs_sbi_xact_t *xact, - ogs_fsm_handler_t nf_state_registered, ogs_sbi_client_cb_f client_cb, - char *nf_instance_id); +bool ogs_sbi_discover_and_send( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + OpenAPI_nf_type_e requester_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_client_cb_f client_cb, void *data); bool ogs_nnrf_nfm_send_nf_register( ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_request_t *(*build)(void)); @@ -47,8 +48,12 @@ bool ogs_nnrf_nfm_send_nf_status_unsubscribe( ogs_sbi_subscription_t *subscription); -bool ogs_nnrf_disc_send_nf_discover(ogs_sbi_nf_instance_t *nf_instance, - OpenAPI_nf_type_e target_nf_type, void *data); +bool ogs_nnrf_disc_send_nf_discover( + ogs_sbi_nf_instance_t *nf_instance, + OpenAPI_nf_type_e target_nf_type, + OpenAPI_nf_type_e requester_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + void *data); #define ogs_sbi_send_http_status_no_content(__sTREAM) \ ogs_sbi_send_response(__sTREAM, OGS_SBI_HTTP_STATUS_NO_CONTENT)
View file
open5gs_2.4.8.202207240002.tar.xz/src/amf/context.c -> open5gs_2.4.8.202207250002.tar.xz/src/amf/context.c
Changed
@@ -1780,40 +1780,46 @@ return ogs_pool_cycle(&amf_sess_pool, sess); } -void amf_ue_select_nf(amf_ue_t *amf_ue, OpenAPI_nf_type_e nf_type) -{ - ogs_assert(amf_ue); - ogs_assert(nf_type); - - ogs_sbi_select_nf(&amf_ue->sbi, nf_type, amf_nf_state_registered); -} - -void amf_sess_select_nf(amf_sess_t *sess, OpenAPI_nf_type_e nf_type) -{ - ogs_assert(sess); - ogs_assert(nf_type); - - if (nf_type == OpenAPI_nf_type_SMF) - amf_sess_select_smf(sess); - else - ogs_sbi_select_nf(&sess->sbi, nf_type, amf_nf_state_registered); -} - static bool check_smf_info(amf_sess_t *sess, ogs_list_t *nf_info_list); -void amf_sess_select_smf(amf_sess_t *sess) +void amf_sbi_select_nf( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option) { ogs_sbi_nf_instance_t *nf_instance = NULL; + amf_sess_t *sess = NULL; - ogs_assert(sess); + ogs_assert(ogs_sbi_self()->nf_state_registered); + ogs_assert(sbi_object); + ogs_assert(target_nf_type); + + switch(sbi_object->type) { + case OGS_SBI_OBJ_UE_TYPE: + ogs_sbi_select_nf(sbi_object, target_nf_type, discovery_option); + break; + case OGS_SBI_OBJ_SESS_TYPE: + sess = (amf_sess_t *)sbi_object; + ogs_assert(sess); + + ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) { + if (ogs_sbi_discovery_param_is_matched( + nf_instance, target_nf_type, discovery_option) == false) + continue; + + if (target_nf_type == OpenAPI_nf_type_SMF) { + if (check_smf_info(sess, &nf_instance->nf_info_list) == false) + continue; + } - ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) { - if (OGS_FSM_CHECK(&nf_instance->sm, amf_nf_state_registered) && - nf_instance->nf_type == OpenAPI_nf_type_SMF && - check_smf_info(sess, &nf_instance->nf_info_list) == true) { - OGS_SBI_SETUP_NF(&sess->sbi, OpenAPI_nf_type_SMF, nf_instance); + OGS_SBI_SETUP_NF(sbi_object, target_nf_type, nf_instance); break; } + break; + default: + ogs_fatal("(NF discover search result) Not implemented %d", + sbi_object->type); + ogs_assert_if_reached(); } }
View file
open5gs_2.4.8.202207240002.tar.xz/src/amf/context.h -> open5gs_2.4.8.202207250002.tar.xz/src/amf/context.h
Changed
@@ -752,10 +752,10 @@ amf_ue_t *amf_ue_cycle(amf_ue_t *amf_ue); amf_sess_t *amf_sess_cycle(amf_sess_t *sess); -void amf_ue_select_nf(amf_ue_t *amf_ue, OpenAPI_nf_type_e nf_type); -void amf_sess_select_nf(amf_sess_t *sess, OpenAPI_nf_type_e nf_type); - -void amf_sess_select_smf(amf_sess_t *sess); +void amf_sbi_select_nf( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option); #define AMF_SESSION_SYNC_DONE(__aMF, __sTATE) \ (amf_sess_xact_state_count(__aMF, __sTATE) == 0)
View file
open5gs_2.4.8.202207240002.tar.xz/src/amf/gmm-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/amf/gmm-handler.c
Changed
@@ -720,8 +720,8 @@ authentication_response_parameter->length); ogs_assert(true == - amf_ue_sbi_discover_and_send(OpenAPI_nf_type_AUSF, amf_ue, NULL, - amf_nausf_auth_build_authenticate_confirmation)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_AUSF, NULL, + amf_nausf_auth_build_authenticate_confirmation, amf_ue, NULL)); return OGS_OK; } @@ -1067,20 +1067,22 @@ nf_instance = OGS_SBI_NF_INSTANCE( &sess->sbi, OpenAPI_nf_type_SMF); if (!nf_instance) { - amf_sess_select_smf(sess); + amf_sbi_select_nf(&sess->sbi, OpenAPI_nf_type_SMF, NULL); nf_instance = OGS_SBI_NF_INSTANCE( &sess->sbi, OpenAPI_nf_type_SMF); } if (nf_instance) { ogs_assert(true == - amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, - sess, AMF_CREATE_SM_CONTEXT_NO_STATE, NULL, - amf_nsmf_pdusession_build_create_sm_context)); + amf_sess_sbi_discover_and_send( + OpenAPI_nf_type_SMF, NULL, + amf_nsmf_pdusession_build_create_sm_context, + sess, AMF_CREATE_SM_CONTEXT_NO_STATE, NULL)); } else { ogs_assert(true == - amf_sess_sbi_discover_and_send(OpenAPI_nf_type_NSSF, - sess, 0, NULL, amf_nnssf_nsselection_build_get)); + amf_sess_sbi_discover_and_send( + OpenAPI_nf_type_NSSF, NULL, + amf_nnssf_nsselection_build_get, sess, 0, NULL)); } } else { @@ -1090,9 +1092,10 @@ param.cause = OpenAPI_cause_REL_DUE_TO_DUPLICATE_SESSION_ID; ogs_assert(true == - amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, + amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, NULL, + amf_nsmf_pdusession_build_update_sm_context, sess, AMF_UPDATE_SM_CONTEXT_DUPLICATED_PDU_SESSION_ID, - ¶m, amf_nsmf_pdusession_build_update_sm_context)); + ¶m)); } } else { @@ -1115,15 +1118,15 @@ param.ue_timezone = true; ogs_assert(true == - amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, - sess, AMF_UPDATE_SM_CONTEXT_N1_RELEASED, ¶m, - amf_nsmf_pdusession_build_update_sm_context)); + amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, NULL, + amf_nsmf_pdusession_build_update_sm_context, + sess, AMF_UPDATE_SM_CONTEXT_N1_RELEASED, ¶m)); } else { ogs_assert(true == - amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, - sess, AMF_UPDATE_SM_CONTEXT_MODIFIED, ¶m, - amf_nsmf_pdusession_build_update_sm_context)); + amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, NULL, + amf_nsmf_pdusession_build_update_sm_context, + sess, AMF_UPDATE_SM_CONTEXT_MODIFIED, ¶m)); } switch (gsm_header->message_type) {
View file
open5gs_2.4.8.202207240002.tar.xz/src/amf/gmm-sm.c -> open5gs_2.4.8.202207250002.tar.xz/src/amf/gmm-sm.c
Changed
@@ -177,8 +177,9 @@ if (!PCF_AM_POLICY_ASSOCIATED(amf_ue)) { ogs_assert(true == amf_ue_sbi_discover_and_send( - OpenAPI_nf_type_PCF, amf_ue, NULL, - amf_npcf_am_policy_control_build_create)); + OpenAPI_nf_type_PCF, NULL, + amf_npcf_am_policy_control_build_create, + amf_ue, NULL)); OGS_FSM_TRAN(s, &gmm_state_initial_context_setup); break; } @@ -199,9 +200,8 @@ amf_ue, AMF_RELEASE_SM_CONTEXT_NO_STATE); if (amf_sess_xact_count(amf_ue) == xact_count) { ogs_assert(true == - amf_ue_sbi_discover_and_send( - OpenAPI_nf_type_AUSF, amf_ue, NULL, - amf_nausf_auth_build_authenticate)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_AUSF, NULL, + amf_nausf_auth_build_authenticate, amf_ue, NULL)); } OGS_FSM_TRAN(s, &gmm_state_authentication); @@ -277,9 +277,8 @@ amf_ue, AMF_RELEASE_SM_CONTEXT_NO_STATE); if (amf_sess_xact_count(amf_ue) == xact_count) { ogs_assert(true == - amf_ue_sbi_discover_and_send( - OpenAPI_nf_type_AUSF, amf_ue, NULL, - amf_nausf_auth_build_authenticate)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_AUSF, NULL, + amf_nausf_auth_build_authenticate, amf_ue, NULL)); } OGS_FSM_TRAN(s, &gmm_state_authentication); @@ -585,9 +584,8 @@ case OGS_5GMM_CAUSE_NGKSI_ALREADY_IN_USE: ogs_warn("Authentication failure(ngKSI already in use)"); ogs_assert(true == - amf_ue_sbi_discover_and_send( - OpenAPI_nf_type_AUSF, amf_ue, NULL, - amf_nausf_auth_build_authenticate)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_AUSF, NULL, + amf_nausf_auth_build_authenticate, amf_ue, NULL)); return; case OGS_5GMM_CAUSE_SYNCH_FAILURE: @@ -598,9 +596,9 @@ break; } ogs_assert(true == - amf_ue_sbi_discover_and_send(OpenAPI_nf_type_AUSF, amf_ue, - authentication_failure_parameter->auts, - amf_nausf_auth_build_authenticate)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_AUSF, NULL, + amf_nausf_auth_build_authenticate, + amf_ue, authentication_failure_parameter->auts)); return; default: @@ -630,8 +628,8 @@ } ogs_assert(true == - amf_ue_sbi_discover_and_send(OpenAPI_nf_type_AUSF, amf_ue, NULL, - amf_nausf_auth_build_authenticate)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_AUSF, NULL, + amf_nausf_auth_build_authenticate, amf_ue, NULL)); break; case OGS_NAS_5GS_5GMM_STATUS: @@ -834,8 +832,8 @@ amf_ue->nhcc = 1; ogs_assert(true == - amf_ue_sbi_discover_and_send(OpenAPI_nf_type_UDM, amf_ue, NULL, - amf_nudm_uecm_build_registration)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_UDM, NULL, + amf_nudm_uecm_build_registration, amf_ue, NULL)); if (amf_ue->nas.message_type == OGS_NAS_5GS_REGISTRATION_REQUEST) { OGS_FSM_TRAN(s, &gmm_state_initial_context_setup); @@ -869,8 +867,8 @@ } ogs_assert(true == - amf_ue_sbi_discover_and_send(OpenAPI_nf_type_AUSF, amf_ue, NULL, - amf_nausf_auth_build_authenticate)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_AUSF, NULL, + amf_nausf_auth_build_authenticate, amf_ue, NULL)); OGS_FSM_TRAN(s, &gmm_state_authentication); break; @@ -996,9 +994,9 @@ CASE(OGS_SBI_HTTP_METHOD_PUT) ogs_assert(true == amf_ue_sbi_discover_and_send( - OpenAPI_nf_type_UDM, amf_ue, - (char *)OGS_SBI_RESOURCE_NAME_AM_DATA, - amf_nudm_sdm_build_get)); + OpenAPI_nf_type_UDM, NULL, + amf_nudm_sdm_build_get, + amf_ue, (char *)OGS_SBI_RESOURCE_NAME_AM_DATA)); break; DEFAULT @@ -1196,9 +1194,8 @@ amf_ue, AMF_RELEASE_SM_CONTEXT_NO_STATE); if (amf_sess_xact_count(amf_ue) == xact_count) { ogs_assert(true == - amf_ue_sbi_discover_and_send( - OpenAPI_nf_type_AUSF, amf_ue, NULL, - amf_nausf_auth_build_authenticate)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_AUSF, NULL, + amf_nausf_auth_build_authenticate, amf_ue, NULL)); } OGS_FSM_TRAN(s, &gmm_state_authentication); break; @@ -1361,8 +1358,9 @@ if (!PCF_AM_POLICY_ASSOCIATED(amf_ue)) { ogs_assert(true == amf_ue_sbi_discover_and_send( - OpenAPI_nf_type_PCF, amf_ue, NULL, - amf_npcf_am_policy_control_build_create)); + OpenAPI_nf_type_PCF, NULL, + amf_npcf_am_policy_control_build_create, + amf_ue, NULL)); OGS_FSM_TRAN(s, &gmm_state_initial_context_setup); break; } @@ -1383,9 +1381,8 @@ amf_ue, AMF_RELEASE_SM_CONTEXT_NO_STATE); if (amf_sess_xact_count(amf_ue) == xact_count) { ogs_assert(true == - amf_ue_sbi_discover_and_send( - OpenAPI_nf_type_AUSF, amf_ue, NULL, - amf_nausf_auth_build_authenticate)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_AUSF, NULL, + amf_nausf_auth_build_authenticate, amf_ue, NULL)); } OGS_FSM_TRAN(s, &gmm_state_authentication);
View file
open5gs_2.4.8.202207240002.tar.xz/src/amf/namf-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/amf/namf-handler.c
Changed
@@ -577,9 +577,8 @@ if (ogs_list_count(&amf_ue->sess_list) == 0) ogs_assert(true == - amf_ue_sbi_discover_and_send( - OpenAPI_nf_type_PCF, amf_ue, - NULL, amf_npcf_am_policy_control_build_delete)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_PCF, NULL, + amf_npcf_am_policy_control_build_delete, amf_ue, NULL)); OGS_FSM_TRAN(&amf_ue->sm, &gmm_state_de_registered); }
View file
open5gs_2.4.8.202207240002.tar.xz/src/amf/ngap-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/amf/ngap-handler.c
Changed
@@ -904,9 +904,9 @@ ogs_pkbuf_put_data(param.n2smbuf, transfer->buf, transfer->size); ogs_assert(true == - amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, - sess, AMF_UPDATE_SM_CONTEXT_ACTIVATED, ¶m, - amf_nsmf_pdusession_build_update_sm_context)); + amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, NULL, + amf_nsmf_pdusession_build_update_sm_context, + sess, AMF_UPDATE_SM_CONTEXT_ACTIVATED, ¶m)); ogs_pkbuf_free(param.n2smbuf); } @@ -1643,9 +1643,9 @@ ogs_pkbuf_put_data(param.n2smbuf, transfer->buf, transfer->size); ogs_assert(true == - amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, - sess, AMF_UPDATE_SM_CONTEXT_ACTIVATED, ¶m, - amf_nsmf_pdusession_build_update_sm_context)); + amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, NULL, + amf_nsmf_pdusession_build_update_sm_context, + sess, AMF_UPDATE_SM_CONTEXT_ACTIVATED, ¶m)); ogs_pkbuf_free(param.n2smbuf); } @@ -1762,9 +1762,9 @@ amf_ue->deactivation.cause = NGAP_CauseNas_normal_release; ogs_assert(true == - amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, - sess, AMF_UPDATE_SM_CONTEXT_SETUP_FAIL, ¶m, - amf_nsmf_pdusession_build_update_sm_context)); + amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, NULL, + amf_nsmf_pdusession_build_update_sm_context, + sess, AMF_UPDATE_SM_CONTEXT_SETUP_FAIL, ¶m)); ogs_pkbuf_free(param.n2smbuf); } @@ -1942,9 +1942,9 @@ ogs_pkbuf_put_data(param.n2smbuf, transfer->buf, transfer->size); ogs_assert(true == - amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, - sess, AMF_UPDATE_SM_CONTEXT_MODIFIED, ¶m, - amf_nsmf_pdusession_build_update_sm_context)); + amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, NULL, + amf_nsmf_pdusession_build_update_sm_context, + sess, AMF_UPDATE_SM_CONTEXT_MODIFIED, ¶m)); ogs_pkbuf_free(param.n2smbuf); } @@ -2117,9 +2117,9 @@ ogs_pkbuf_put_data(param.n2smbuf, transfer->buf, transfer->size); ogs_assert(true == - amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, - sess, AMF_UPDATE_SM_CONTEXT_N2_RELEASED, ¶m, - amf_nsmf_pdusession_build_update_sm_context)); + amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, NULL, + amf_nsmf_pdusession_build_update_sm_context, + sess, AMF_UPDATE_SM_CONTEXT_N2_RELEASED, ¶m)); ogs_pkbuf_free(param.n2smbuf); } @@ -2539,9 +2539,9 @@ ogs_pkbuf_put_data(param.n2smbuf, transfer->buf, transfer->size); ogs_assert(true == - amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, - sess, AMF_UPDATE_SM_CONTEXT_PATH_SWITCH_REQUEST, ¶m, - amf_nsmf_pdusession_build_update_sm_context)); + amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, NULL, + amf_nsmf_pdusession_build_update_sm_context, + sess, AMF_UPDATE_SM_CONTEXT_PATH_SWITCH_REQUEST, ¶m)); ogs_pkbuf_free(param.n2smbuf); } @@ -2855,9 +2855,9 @@ param.TargetID = TargetID; ogs_assert(true == - amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, - sess, AMF_UPDATE_SM_CONTEXT_HANDOVER_REQUIRED, ¶m, - amf_nsmf_pdusession_build_update_sm_context)); + amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, NULL, + amf_nsmf_pdusession_build_update_sm_context, + sess, AMF_UPDATE_SM_CONTEXT_HANDOVER_REQUIRED, ¶m)); ogs_pkbuf_free(param.n2smbuf); } @@ -3079,9 +3079,9 @@ param.hoState = OpenAPI_ho_state_PREPARED; ogs_assert(true == - amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, - sess, AMF_UPDATE_SM_CONTEXT_HANDOVER_REQ_ACK, ¶m, - amf_nsmf_pdusession_build_update_sm_context)); + amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, NULL, + amf_nsmf_pdusession_build_update_sm_context, + sess, AMF_UPDATE_SM_CONTEXT_HANDOVER_REQ_ACK, ¶m)); ogs_pkbuf_free(param.n2smbuf); } @@ -3324,9 +3324,9 @@ param.ngApCause.value = (int)Cause->choice.radioNetwork; ogs_assert(true == - amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, - sess, AMF_UPDATE_SM_CONTEXT_HANDOVER_CANCEL, ¶m, - amf_nsmf_pdusession_build_update_sm_context)); + amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, NULL, + amf_nsmf_pdusession_build_update_sm_context, + sess, AMF_UPDATE_SM_CONTEXT_HANDOVER_CANCEL, ¶m)); } } @@ -3604,9 +3604,9 @@ param.hoState = OpenAPI_ho_state_COMPLETED; ogs_assert(true == - amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, - sess, AMF_UPDATE_SM_CONTEXT_HANDOVER_NOTIFY, ¶m, - amf_nsmf_pdusession_build_update_sm_context)); + amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, NULL, + amf_nsmf_pdusession_build_update_sm_context, + sess, AMF_UPDATE_SM_CONTEXT_HANDOVER_NOTIFY, ¶m)); } }
View file
open5gs_2.4.8.202207240002.tar.xz/src/amf/nnrf-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/amf/nnrf-handler.c
Changed
@@ -255,16 +255,19 @@ ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg) { ogs_sbi_object_t *sbi_object = NULL; - amf_ue_t *amf_ue = NULL; - amf_sess_t *sess = NULL; - ogs_sbi_nf_instance_t *nf_instance = NULL; + OpenAPI_nf_type_e target_nf_type = 0; + ogs_sbi_discovery_option_t *discovery_option = NULL; OpenAPI_search_result_t *SearchResult = NULL; + ogs_assert(recvmsg); ogs_assert(xact); sbi_object = xact->sbi_object; ogs_assert(sbi_object); - ogs_assert(recvmsg); + target_nf_type = xact->target_nf_type; + ogs_assert(target_nf_type); + + discovery_option = xact->discovery_option; SearchResult = recvmsg->SearchResult; if (!SearchResult) { @@ -272,53 +275,19 @@ return; } - amf_nnrf_handle_nf_discover_search_result(sbi_object, SearchResult); + amf_nnrf_handle_nf_discover_search_result( + sbi_object, target_nf_type, discovery_option, SearchResult); - ogs_assert(xact->target_nf_type); - nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, xact->target_nf_type); - if (!nf_instance) { - ogs_assert(sbi_object->type > OGS_SBI_OBJ_BASE && - sbi_object->type < OGS_SBI_OBJ_TOP); - switch(sbi_object->type) { - case OGS_SBI_OBJ_UE_TYPE: - amf_ue = (amf_ue_t *)sbi_object; - ogs_assert(amf_ue); - ogs_error("%s (NF discover) No %s", amf_ue->suci, - OpenAPI_nf_type_ToString(xact->target_nf_type)); - ogs_assert(OGS_OK == - nas_5gs_send_gmm_reject_from_sbi(amf_ue, - OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT)); - break; - case OGS_SBI_OBJ_SESS_TYPE: - sess = (amf_sess_t *)sbi_object; - ogs_assert(sess); - ogs_error("%d:%d (NF discover) No %s", sess->psi, sess->pti, - OpenAPI_nf_type_ToString(xact->target_nf_type)); - if (sess->payload_container_type) { - ogs_assert(OGS_OK == - nas_5gs_send_back_gsm_message(sess, - OGS_5GMM_CAUSE_PAYLOAD_WAS_NOT_FORWARDED, - AMF_NAS_BACKOFF_TIME)); - } else { - ogs_assert(OGS_OK == - ngap_send_error_indication2(amf_ue, - NGAP_Cause_PR_transport, - NGAP_CauseTransport_transport_resource_unavailable)); - } - break; - default: - ogs_fatal("(NF discover) Not implemented %s:%d", - OpenAPI_nf_type_ToString(xact->target_nf_type), - sbi_object->type); - ogs_assert_if_reached(); - } - } else { - ogs_assert(true == amf_sbi_send(nf_instance, xact)); - } + amf_sbi_select_nf(sbi_object, target_nf_type, discovery_option); + + ogs_expect(true == amf_sbi_send_request(sbi_object, target_nf_type, xact)); } void amf_nnrf_handle_nf_discover_search_result( - ogs_sbi_object_t *sbi_object, OpenAPI_search_result_t *SearchResult) + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + OpenAPI_search_result_t *SearchResult) { bool handled; @@ -355,9 +324,6 @@ } if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { - amf_ue_t *amf_ue = NULL; - amf_sess_t *sess = NULL; - handled = ogs_sbi_nnrf_handle_nf_profile( nf_instance, NFProfile, NULL, NULL); if (!handled) { @@ -374,23 +340,6 @@ continue; } - switch(sbi_object->type) { - case OGS_SBI_OBJ_UE_TYPE: - amf_ue = (amf_ue_t *)sbi_object; - ogs_assert(amf_ue); - amf_ue_select_nf(amf_ue, nf_instance->nf_type); - break; - case OGS_SBI_OBJ_SESS_TYPE: - sess = (amf_sess_t *)sbi_object; - ogs_assert(sess); - amf_sess_select_nf(sess, nf_instance->nf_type); - break; - default: - ogs_fatal("(NF discover search result) Not implemented %d", - sbi_object->type); - ogs_assert_if_reached(); - } - /* TIME : Update validity from NRF */ if (SearchResult->is_validity_period && SearchResult->validity_period) {
View file
open5gs_2.4.8.202207240002.tar.xz/src/amf/nnrf-handler.h -> open5gs_2.4.8.202207250002.tar.xz/src/amf/nnrf-handler.h
Changed
@@ -37,7 +37,10 @@ void amf_nnrf_handle_nf_discover( ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg); void amf_nnrf_handle_nf_discover_search_result( - ogs_sbi_object_t *sbi_object, OpenAPI_search_result_t *SearchResult); + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + OpenAPI_search_result_t *SearchResult); #ifdef __cplusplus }
View file
open5gs_2.4.8.202207240002.tar.xz/src/amf/nsmf-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/amf/nsmf-handler.c
Changed
@@ -231,8 +231,9 @@ if (!PCF_AM_POLICY_ASSOCIATED(amf_ue)) { ogs_assert(true == amf_ue_sbi_discover_and_send( - OpenAPI_nf_type_PCF, amf_ue, NULL, - amf_npcf_am_policy_control_build_create)); + OpenAPI_nf_type_PCF, NULL, + amf_npcf_am_policy_control_build_create, + amf_ue, NULL)); } else { CLEAR_AMF_UE_TIMER(amf_ue->t3550); ogs_assert(OGS_OK == @@ -562,9 +563,9 @@ ogs_warn("%s:%d Receive Update SM context" "(DUPLICATED_PDU_SESSION_ID)", amf_ue->supi, sess->psi); - amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, - sess, AMF_CREATE_SM_CONTEXT_NO_STATE, NULL, - amf_nsmf_pdusession_build_create_sm_context); + amf_sess_sbi_discover_and_send(OpenAPI_nf_type_SMF, NULL, + amf_nsmf_pdusession_build_create_sm_context, + sess, AMF_CREATE_SM_CONTEXT_NO_STATE, NULL); } else if (state == AMF_UPDATE_SM_CONTEXT_PATH_SWITCH_REQUEST) { @@ -815,9 +816,8 @@ if (!PCF_AM_POLICY_ASSOCIATED(amf_ue)) { ogs_assert(true == - amf_ue_sbi_discover_and_send( - OpenAPI_nf_type_PCF, amf_ue, NULL, - amf_npcf_am_policy_control_build_create)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_PCF, NULL, + amf_npcf_am_policy_control_build_create, amf_ue, NULL)); } else { CLEAR_AMF_UE_TIMER(amf_ue->t3550); ogs_assert(OGS_OK == @@ -868,9 +868,8 @@ if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_authentication)) { ogs_assert(true == - amf_ue_sbi_discover_and_send( - OpenAPI_nf_type_AUSF, amf_ue, NULL, - amf_nausf_auth_build_authenticate)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_AUSF, NULL, + amf_nausf_auth_build_authenticate, amf_ue, NULL)); } else if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_de_registered)) { @@ -886,9 +885,9 @@ */ ogs_assert(true == - amf_ue_sbi_discover_and_send( - OpenAPI_nf_type_PCF, amf_ue, - NULL, amf_npcf_am_policy_control_build_delete)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_PCF, NULL, + amf_npcf_am_policy_control_build_delete, + amf_ue, NULL)); } else if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_registered)) { /*
View file
open5gs_2.4.8.202207240002.tar.xz/src/amf/nudm-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/amf/nudm-handler.c
Changed
@@ -140,9 +140,9 @@ } ogs_assert(true == - amf_ue_sbi_discover_and_send(OpenAPI_nf_type_UDM, amf_ue, - (char *)OGS_SBI_RESOURCE_NAME_SMF_SELECT_DATA, - amf_nudm_sdm_build_get)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_UDM, NULL, + amf_nudm_sdm_build_get, + amf_ue, (char *)OGS_SBI_RESOURCE_NAME_SMF_SELECT_DATA)); break; CASE(OGS_SBI_RESOURCE_NAME_SMF_SELECT_DATA) @@ -212,15 +212,15 @@ } } ogs_assert(true == - amf_ue_sbi_discover_and_send(OpenAPI_nf_type_UDM, amf_ue, - (char *)OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA, - amf_nudm_sdm_build_get)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_UDM, NULL, + amf_nudm_sdm_build_get, + amf_ue, (char *)OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)); break; CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA) ogs_assert(true == - amf_ue_sbi_discover_and_send(OpenAPI_nf_type_PCF, amf_ue, - NULL, amf_npcf_am_policy_control_build_create)); + amf_ue_sbi_discover_and_send(OpenAPI_nf_type_PCF, NULL, + amf_npcf_am_policy_control_build_create, amf_ue, NULL)); break; DEFAULT
View file
open5gs_2.4.8.202207240002.tar.xz/src/amf/sbi-path.c -> open5gs_2.4.8.202207250002.tar.xz/src/amf/sbi-path.c
Changed
@@ -19,6 +19,7 @@ #include "sbi-path.h" #include "nas-path.h" +#include "ngap-path.h" #include "nnrf-handler.h" static int server_cb(ogs_sbi_request_t *request, void *data) @@ -81,9 +82,6 @@ ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_nf_service_t *service = NULL; - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) - return OGS_ERROR; - /* Add SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); @@ -126,6 +124,16 @@ amf_nf_fsm_init(nf_instance); } + /* Timer expiration handler of client wait timer */ + ogs_sbi_self()->client_wait_expire = amf_timer_sbi_client_wait_expire; + + /* NF register state in NF state machine */ + ogs_sbi_self()->nf_state_registered = + (ogs_fsm_handler_t)amf_nf_state_registered; + + if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + return OGS_ERROR; + return OGS_OK; } @@ -135,24 +143,84 @@ ogs_sbi_server_stop_all(); } -bool amf_sbi_send(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact) +bool amf_sbi_send_request( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + void *data) { - return ogs_sbi_send(nf_instance, client_cb, xact); + ogs_sbi_nf_instance_t *nf_instance = NULL; + + ogs_assert(sbi_object); + ogs_assert(target_nf_type); + ogs_assert(data); + + nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, target_nf_type); + if (!nf_instance) { + amf_ue_t *amf_ue = NULL; + amf_sess_t *sess = NULL; + + ogs_assert(sbi_object->type > OGS_SBI_OBJ_BASE && + sbi_object->type < OGS_SBI_OBJ_TOP); + switch(sbi_object->type) { + case OGS_SBI_OBJ_UE_TYPE: + amf_ue = (amf_ue_t *)sbi_object; + ogs_assert(amf_ue); + ogs_error("%s (NF discover) No %s", amf_ue->suci, + OpenAPI_nf_type_ToString(target_nf_type)); + ogs_assert(OGS_OK == + nas_5gs_send_gmm_reject_from_sbi(amf_ue, + OGS_SBI_HTTP_STATUS_GATEWAY_TIMEOUT)); + break; + case OGS_SBI_OBJ_SESS_TYPE: + sess = (amf_sess_t *)sbi_object; + ogs_assert(sess); + ogs_error("%d:%d (NF discover) No %s", sess->psi, sess->pti, + OpenAPI_nf_type_ToString(target_nf_type)); + if (sess->payload_container_type) { + ogs_assert(OGS_OK == + nas_5gs_send_back_gsm_message(sess, + OGS_5GMM_CAUSE_PAYLOAD_WAS_NOT_FORWARDED, + AMF_NAS_BACKOFF_TIME)); + } else { + ogs_assert(OGS_OK == + ngap_send_error_indication2(amf_ue, + NGAP_Cause_PR_transport, + NGAP_CauseTransport_transport_resource_unavailable)); + } + break; + default: + ogs_fatal("(NF discover) Not implemented %s:%d", + OpenAPI_nf_type_ToString(target_nf_type), + sbi_object->type); + ogs_assert_if_reached(); + } + + return false; + } + + return ogs_sbi_send_request(nf_instance, client_cb, data); } bool amf_ue_sbi_discover_and_send( - OpenAPI_nf_type_e target_nf_type, amf_ue_t *amf_ue, void *data, - ogs_sbi_request_t *(*build)(amf_ue_t *amf_ue, void *data)) + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(amf_ue_t *amf_ue, void *data), + amf_ue_t *amf_ue, void *data) { ogs_sbi_xact_t *xact = NULL; + OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL; + + ogs_assert(ogs_sbi_self()->nf_instance); + requester_nf_type = ogs_sbi_self()->nf_instance->nf_type; + ogs_assert(requester_nf_type); ogs_assert(target_nf_type); ogs_assert(amf_ue); ogs_assert(build); - xact = ogs_sbi_xact_add(target_nf_type, &amf_ue->sbi, - (ogs_sbi_build_f)build, amf_ue, data, - amf_timer_sbi_client_wait_expire); + xact = ogs_sbi_xact_add( + &amf_ue->sbi, target_nf_type, discovery_option, + (ogs_sbi_build_f)build, amf_ue, data); if (!xact) { ogs_error("amf_ue_sbi_discover_and_send() failed"); ogs_assert(OGS_OK == @@ -161,8 +229,10 @@ return false; } - if (ogs_sbi_discover_and_send(xact, - (ogs_fsm_handler_t)amf_nf_state_registered, client_cb) != true) { + if (ogs_sbi_discover_and_send( + &amf_ue->sbi, + target_nf_type, requester_nf_type, discovery_option, + client_cb, xact) != true) { ogs_error("amf_ue_sbi_discover_and_send() failed"); ogs_sbi_xact_remove(xact); ogs_assert(OGS_OK == @@ -174,19 +244,26 @@ return true; } -bool amf_sess_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - amf_sess_t *sess, int state, void *data, - ogs_sbi_request_t *(*build)(amf_sess_t *sess, void *data)) +bool amf_sess_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(amf_sess_t *sess, void *data), + amf_sess_t *sess, int state, void *data) { ogs_sbi_xact_t *xact = NULL; + OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL; + + ogs_assert(ogs_sbi_self()->nf_instance); + requester_nf_type = ogs_sbi_self()->nf_instance->nf_type; + ogs_assert(requester_nf_type); ogs_assert(target_nf_type); ogs_assert(sess); ogs_assert(build); - xact = ogs_sbi_xact_add(target_nf_type, &sess->sbi, - (ogs_sbi_build_f)build, sess, data, - amf_timer_sbi_client_wait_expire); + xact = ogs_sbi_xact_add( + &sess->sbi, target_nf_type, discovery_option, + (ogs_sbi_build_f)build, sess, data); if (!xact) { ogs_error("amf_sess_sbi_discover_and_send() failed"); ogs_assert(OGS_OK == nas_5gs_send_back_gsm_message(sess, @@ -196,8 +273,10 @@ xact->state = state; - if (ogs_sbi_discover_and_send(xact, - (ogs_fsm_handler_t)amf_nf_state_registered, client_cb) != true) { + if (ogs_sbi_discover_and_send( + &sess->sbi, + target_nf_type, requester_nf_type, discovery_option, + client_cb, xact) != true) { ogs_error("amf_sess_sbi_discover_and_send() failed"); ogs_sbi_xact_remove(xact); ogs_assert(OGS_OK == nas_5gs_send_back_gsm_message(sess, @@ -252,7 +331,9 @@ } amf_nnrf_handle_nf_discover_search_result( - &sess->sbi, message.SearchResult); + &sess->sbi, OpenAPI_nf_type_SMF, NULL, message.SearchResult); + + amf_sbi_select_nf(&sess->sbi, OpenAPI_nf_type_SMF, NULL); if (!OGS_SBI_NF_INSTANCE(&sess->sbi, OpenAPI_nf_type_SMF)) { ogs_error("Cannot discover %s", @@ -265,9 +346,9 @@ goto cleanup; }
View file
open5gs_2.4.8.202207240002.tar.xz/src/amf/sbi-path.h -> open5gs_2.4.8.202207250002.tar.xz/src/amf/sbi-path.h
Changed
@@ -34,10 +34,15 @@ int amf_sbi_open(void); void amf_sbi_close(void); -bool amf_sbi_send(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact); -bool amf_ue_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - amf_ue_t *amf_ue, void *data, - ogs_sbi_request_t *(*build)(amf_ue_t *amf_ue, void *data)); +bool amf_sbi_send_request( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + void *data); +bool amf_ue_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(amf_ue_t *amf_ue, void *data), + amf_ue_t *amf_ue, void *data); #define AMF_CREATE_SM_CONTEXT_NO_STATE 0 #define AMF_UPDATE_SM_CONTEXT_ACTIVATED 11 @@ -61,9 +66,11 @@ #define AMF_REMOVE_S1_CONTEXT_BY_LO_CONNREFUSED 51 #define AMF_REMOVE_S1_CONTEXT_BY_RESET_ALL 52 #define AMF_REMOVE_S1_CONTEXT_BY_RESET_PARTIAL 53 -bool amf_sess_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - amf_sess_t *sess, int state, void *data, - ogs_sbi_request_t *(*build)(amf_sess_t *sess, void *data)); +bool amf_sess_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(amf_sess_t *sess, void *data), + amf_sess_t *sess, int state, void *data); bool amf_sess_sbi_discover_by_nsi( OpenAPI_nf_type_e target_nf_type, amf_sess_t *sess);
View file
open5gs_2.4.8.202207240002.tar.xz/src/ausf/context.c -> open5gs_2.4.8.202207250002.tar.xz/src/ausf/context.c
Changed
@@ -222,11 +222,3 @@ { return ogs_pool_cycle(&ausf_ue_pool, ausf_ue); } - -void ausf_ue_select_nf(ausf_ue_t *ausf_ue, OpenAPI_nf_type_e nf_type) -{ - ogs_assert(ausf_ue); - ogs_assert(nf_type); - - ogs_sbi_select_nf(&ausf_ue->sbi, nf_type, ausf_nf_state_registered); -}
View file
open5gs_2.4.8.202207240002.tar.xz/src/ausf/context.h -> open5gs_2.4.8.202207250002.tar.xz/src/ausf/context.h
Changed
@@ -97,8 +97,6 @@ ausf_ue_t *ausf_ue_cycle(ausf_ue_t *ausf_ue); -void ausf_ue_select_nf(ausf_ue_t *ausf_ue, OpenAPI_nf_type_e nf_type); - #ifdef __cplusplus } #endif
View file
open5gs_2.4.8.202207240002.tar.xz/src/ausf/nausf-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/ausf/nausf-handler.c
Changed
@@ -55,9 +55,9 @@ ogs_assert(ausf_ue->serving_network_name); ogs_assert(true == - ausf_sbi_discover_and_send(OpenAPI_nf_type_UDM, ausf_ue, stream, - AuthenticationInfo->resynchronization_info, - ausf_nudm_ueau_build_get)); + ausf_sbi_discover_and_send(OpenAPI_nf_type_UDM, NULL, + ausf_nudm_ueau_build_get, + ausf_ue, stream, AuthenticationInfo->resynchronization_info)); return true; } @@ -104,8 +104,9 @@ } ogs_assert(true == - ausf_sbi_discover_and_send(OpenAPI_nf_type_UDM, ausf_ue, stream, NULL, - ausf_nudm_ueau_build_result_confirmation_inform)); + ausf_sbi_discover_and_send(OpenAPI_nf_type_UDM, NULL, + ausf_nudm_ueau_build_result_confirmation_inform, + ausf_ue, stream, NULL)); return true; }
View file
open5gs_2.4.8.202207240002.tar.xz/src/ausf/nnrf-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/ausf/nnrf-handler.c
Changed
@@ -252,16 +252,22 @@ ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg) { ogs_sbi_object_t *sbi_object = NULL; + OpenAPI_nf_type_e target_nf_type = 0; + ogs_sbi_discovery_option_t *discovery_option = NULL; ogs_sbi_nf_instance_t *nf_instance = NULL; OpenAPI_search_result_t *SearchResult = NULL; OpenAPI_lnode_t *node = NULL; bool handled; + ogs_assert(recvmsg); ogs_assert(xact); sbi_object = xact->sbi_object; ogs_assert(sbi_object); - ogs_assert(recvmsg); + target_nf_type = xact->target_nf_type; + ogs_assert(target_nf_type); + + discovery_option = xact->discovery_option; SearchResult = recvmsg->SearchResult; if (!SearchResult) { @@ -296,8 +302,6 @@ } if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { - ausf_ue_t *ausf_ue = NULL; - handled = ogs_sbi_nnrf_handle_nf_profile( nf_instance, NFProfile, NULL, NULL); if (!handled) { @@ -314,10 +318,6 @@ continue; } - ausf_ue = (ausf_ue_t *)sbi_object; - ogs_assert(ausf_ue); - ausf_ue_select_nf(ausf_ue, nf_instance->nf_type); - /* TIME : Update validity from NRF */ if (SearchResult->is_validity_period && SearchResult->validity_period) { @@ -336,12 +336,7 @@ } } - ogs_assert(xact->target_nf_type); - nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, xact->target_nf_type); - if (!nf_instance) { - ogs_error("(NF discover) No %s", - OpenAPI_nf_type_ToString(xact->target_nf_type)); - } else { - ogs_assert(true == ausf_sbi_send(nf_instance, xact)); - } + ogs_sbi_select_nf(sbi_object, target_nf_type, discovery_option); + + ogs_expect(true == ausf_sbi_send_request(sbi_object, target_nf_type, xact)); }
View file
open5gs_2.4.8.202207240002.tar.xz/src/ausf/sbi-path.c -> open5gs_2.4.8.202207250002.tar.xz/src/ausf/sbi-path.c
Changed
@@ -79,9 +79,6 @@ ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_nf_service_t *service = NULL; - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) - return OGS_ERROR; - /* Add SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); @@ -114,6 +111,16 @@ } } + /* Timer expiration handler of client wait timer */ + ogs_sbi_self()->client_wait_expire = ausf_timer_sbi_client_wait_expire; + + /* NF register state in NF state machine */ + ogs_sbi_self()->nf_state_registered = + (ogs_fsm_handler_t)ausf_nf_state_registered; + + if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + return OGS_ERROR; + return OGS_OK; } @@ -123,25 +130,44 @@ ogs_sbi_server_stop_all(); } -bool ausf_sbi_send(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact) +bool ausf_sbi_send_request( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + void *data) { - return ogs_sbi_send(nf_instance, client_cb, xact); + ogs_sbi_nf_instance_t *nf_instance = NULL; + + nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, target_nf_type); + if (!nf_instance) { + ogs_error("(NF discover) No %s", + OpenAPI_nf_type_ToString(target_nf_type)); + return false; + } + + return ogs_sbi_send_request(nf_instance, client_cb, data); } -bool ausf_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - ausf_ue_t *ausf_ue, ogs_sbi_stream_t *stream, void *data, - ogs_sbi_request_t *(*build)(ausf_ue_t *ausf_ue, void *data)) +bool ausf_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(ausf_ue_t *ausf_ue, void *data), + ausf_ue_t *ausf_ue, ogs_sbi_stream_t *stream, void *data) { ogs_sbi_xact_t *xact = NULL; + OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL; + + ogs_assert(ogs_sbi_self()->nf_instance); + requester_nf_type = ogs_sbi_self()->nf_instance->nf_type; + ogs_assert(requester_nf_type); ogs_assert(target_nf_type); ogs_assert(ausf_ue); ogs_assert(stream); ogs_assert(build); - xact = ogs_sbi_xact_add(target_nf_type, &ausf_ue->sbi, - (ogs_sbi_build_f)build, ausf_ue, data, - ausf_timer_sbi_client_wait_expire); + xact = ogs_sbi_xact_add( + &ausf_ue->sbi, target_nf_type, discovery_option, + (ogs_sbi_build_f)build, ausf_ue, data); if (!xact) { ogs_error("ausf_sbi_discover_and_send() failed"); ogs_assert(true == @@ -153,8 +179,10 @@ xact->assoc_stream = stream; - if (ogs_sbi_discover_and_send(xact, - (ogs_fsm_handler_t)ausf_nf_state_registered, client_cb) != true) { + if (ogs_sbi_discover_and_send( + &ausf_ue->sbi, + target_nf_type, requester_nf_type, discovery_option, + client_cb, xact) != true) { ogs_error("ausf_sbi_discover_and_send() failed"); ogs_sbi_xact_remove(xact); ogs_assert(true ==
View file
open5gs_2.4.8.202207240002.tar.xz/src/ausf/sbi-path.h -> open5gs_2.4.8.202207250002.tar.xz/src/ausf/sbi-path.h
Changed
@@ -30,10 +30,15 @@ int ausf_sbi_open(void); void ausf_sbi_close(void); -bool ausf_sbi_send(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact); -bool ausf_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - ausf_ue_t *ausf_ue, ogs_sbi_stream_t *stream, void *data, - ogs_sbi_request_t *(*build)(ausf_ue_t *ausf_ue, void *data)); +bool ausf_sbi_send_request( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + void *data); +bool ausf_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(ausf_ue_t *ausf_ue, void *data), + ausf_ue_t *ausf_ue, ogs_sbi_stream_t *stream, void *data); #ifdef __cplusplus }
View file
open5gs_2.4.8.202207240002.tar.xz/src/bsf/context.c -> open5gs_2.4.8.202207250002.tar.xz/src/bsf/context.c
Changed
@@ -323,11 +323,3 @@ return ogs_hash_get(self.ipv6prefix_hash, &ipv6prefix, (ipv6prefix.len >> 3) + 1); } - -void bsf_sess_select_nf(bsf_sess_t *sess, OpenAPI_nf_type_e nf_type) -{ - ogs_assert(sess); - ogs_assert(nf_type); - - ogs_sbi_select_nf(&sess->sbi, nf_type, bsf_nf_state_registered); -}
View file
open5gs_2.4.8.202207240002.tar.xz/src/bsf/context.h -> open5gs_2.4.8.202207250002.tar.xz/src/bsf/context.h
Changed
@@ -114,8 +114,6 @@ bsf_sess_t *bsf_sess_find_by_ipv4addr(char *ipv4addr_string); bsf_sess_t *bsf_sess_find_by_ipv6prefix(char *ipv6prefix_string); -void bsf_sess_select_nf(bsf_sess_t *sess, OpenAPI_nf_type_e nf_type); - #ifdef __cplusplus } #endif
View file
open5gs_2.4.8.202207240002.tar.xz/src/bsf/nnrf-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/bsf/nnrf-handler.c
Changed
@@ -253,16 +253,22 @@ ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg) { ogs_sbi_object_t *sbi_object = NULL; + OpenAPI_nf_type_e target_nf_type = 0; + ogs_sbi_discovery_option_t *discovery_option = NULL; ogs_sbi_nf_instance_t *nf_instance = NULL; OpenAPI_search_result_t *SearchResult = NULL; OpenAPI_lnode_t *node = NULL; bool handled; + ogs_assert(recvmsg); ogs_assert(xact); sbi_object = xact->sbi_object; ogs_assert(sbi_object); - ogs_assert(recvmsg); + target_nf_type = xact->target_nf_type; + ogs_assert(target_nf_type); + + discovery_option = xact->discovery_option; SearchResult = recvmsg->SearchResult; if (!SearchResult) { @@ -297,8 +303,6 @@ } if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { - bsf_sess_t *sess = NULL; - handled = ogs_sbi_nnrf_handle_nf_profile( nf_instance, NFProfile, NULL, NULL); if (!handled) { @@ -315,10 +319,6 @@ continue; } - sess = (bsf_sess_t *)sbi_object; - ogs_assert(sess); - bsf_sess_select_nf(sess, nf_instance->nf_type); - /* TIME : Update validity from NRF */ if (SearchResult->is_validity_period && SearchResult->validity_period) { @@ -337,12 +337,7 @@ } } - ogs_assert(xact->target_nf_type); - nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, xact->target_nf_type); - if (!nf_instance) { - ogs_error("(NF discover) No %s", - OpenAPI_nf_type_ToString(xact->target_nf_type)); - } else { - bsf_sbi_send(nf_instance, xact); - } + ogs_sbi_select_nf(sbi_object, target_nf_type, discovery_option); + + ogs_expect(true == bsf_sbi_send_request(sbi_object, target_nf_type, xact)); }
View file
open5gs_2.4.8.202207240002.tar.xz/src/bsf/sbi-path.c -> open5gs_2.4.8.202207250002.tar.xz/src/bsf/sbi-path.c
Changed
@@ -79,9 +79,6 @@ ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_nf_service_t *service = NULL; - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) - return OGS_ERROR; - /* Add SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); @@ -114,6 +111,16 @@ } } + /* Timer expiration handler of client wait timer */ + ogs_sbi_self()->client_wait_expire = bsf_timer_sbi_client_wait_expire; + + /* NF register state in NF state machine */ + ogs_sbi_self()->nf_state_registered = + (ogs_fsm_handler_t)bsf_nf_state_registered; + + if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + return OGS_ERROR; + return OGS_OK; } @@ -123,26 +130,43 @@ ogs_sbi_server_stop_all(); } -bool bsf_sbi_send(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact) +bool bsf_sbi_send_request( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + void *data) { - return ogs_sbi_send(nf_instance, client_cb, xact); + ogs_sbi_nf_instance_t *nf_instance = NULL; + + nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, target_nf_type); + if (!nf_instance) { + ogs_error("(NF discover) No %s", + OpenAPI_nf_type_ToString(target_nf_type)); + return false; + } + + return ogs_sbi_send_request(nf_instance, client_cb, data); } -bool bsf_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - bsf_sess_t *sess, ogs_sbi_stream_t *stream, void *data, - ogs_sbi_request_t *(*build)(bsf_sess_t *sess, void *data)) +bool bsf_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(bsf_sess_t *sess, void *data), + bsf_sess_t *sess, ogs_sbi_stream_t *stream, void *data) { ogs_sbi_xact_t *xact = NULL; + OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL; - ogs_assert(target_nf_type); + ogs_assert(ogs_sbi_self()->nf_instance); + requester_nf_type = ogs_sbi_self()->nf_instance->nf_type; + ogs_assert(requester_nf_type); ogs_assert(sess); ogs_assert(stream); ogs_assert(build); - xact = ogs_sbi_xact_add(target_nf_type, &sess->sbi, - (ogs_sbi_build_f)build, sess, data, - bsf_timer_sbi_client_wait_expire); + xact = ogs_sbi_xact_add( + &sess->sbi, target_nf_type, discovery_option, + (ogs_sbi_build_f)build, sess, data); if (!xact) { ogs_error("bsf_sbi_discover_and_send() failed"); ogs_assert(true == @@ -154,8 +178,10 @@ xact->assoc_stream = stream; - if (ogs_sbi_discover_and_send(xact, - (ogs_fsm_handler_t)bsf_nf_state_registered, client_cb) != true) { + if (ogs_sbi_discover_and_send( + &sess->sbi, + target_nf_type, requester_nf_type, discovery_option, + client_cb, xact) != true) { ogs_error("bsf_sbi_discover_and_send() failed"); ogs_sbi_xact_remove(xact); ogs_assert(true ==
View file
open5gs_2.4.8.202207240002.tar.xz/src/bsf/sbi-path.h -> open5gs_2.4.8.202207250002.tar.xz/src/bsf/sbi-path.h
Changed
@@ -29,11 +29,15 @@ int bsf_sbi_open(void); void bsf_sbi_close(void); -bool bsf_sbi_send(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact); - -bool bsf_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - bsf_sess_t *sess, ogs_sbi_stream_t *stream, void *data, - ogs_sbi_request_t *(*build)(bsf_sess_t *sess, void *data)); +bool bsf_sbi_send_request( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + void *data); +bool bsf_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(bsf_sess_t *sess, void *data), + bsf_sess_t *sess, ogs_sbi_stream_t *stream, void *data); void bsf_sbi_send_response(ogs_sbi_stream_t *stream, int status);
View file
open5gs_2.4.8.202207240002.tar.xz/src/mme/mme-context.h -> open5gs_2.4.8.202207250002.tar.xz/src/mme/mme-context.h
Changed
@@ -422,6 +422,8 @@ /* HSS Info */ ogs_bitrate_t ambr; /* UE-AMBR */ uint32_t network_access_mode; /* Permitted EPS Attach Type */ + uint8_t charging_characteristicsOGS_CHRGCHARS_LEN; /* Subscription Level Charging Characteristics */ + bool charging_characteristics_presence; uint32_t context_identifier; /* default APN */
View file
open5gs_2.4.8.202207240002.tar.xz/src/mme/mme-fd-path.c -> open5gs_2.4.8.202207250002.tar.xz/src/mme/mme-fd-path.c
Changed
@@ -593,6 +593,8 @@ { int ret; + char bufOGS_CHRGCHARS_LEN; + struct sess_state *sess_data = NULL; struct timespec ts; struct session *session; @@ -795,6 +797,26 @@ ogs_warn("no subscribed Network-Access-Mode, defaulting to PACKET_AND_CIRCUIT (0)"); } + /* AVP: '3GPP-Charging-Characteristics'(13) + * For GGSN, it contains the charging characteristics for + * this PDP Context received in the Create PDP Context + * Request Message (only available in R99 and later releases). + * For PGW, it contains the charging characteristics for the + * IP-CAN bearer. + * Reference: 3GPP TS 29.061 16.4.7.2 13 + */ + ret = fd_avp_search_avp(avp, ogs_diam_s6a_3gpp_charging_characteristics, &avpch1); + ogs_assert(ret == 0); + if (avpch1) { + ret = fd_msg_avp_hdr(avpch1, &hdr); + memcpy(mme_ue->charging_characteristics, + OGS_HEX(hdr->avp_value->os.data, (int)hdr->avp_value->os.len, buf), OGS_CHRGCHARS_LEN); + mme_ue->charging_characteristics_presence = true; + } else { + memcpy(mme_ue->charging_characteristics, (uint8_t *)"\x00\x00", OGS_CHRGCHARS_LEN); + mme_ue->charging_characteristics_presence = false; + } + /* AVP: 'AMBR'(1435) * The Amber AVP contains the Max-Requested-Bandwidth-UL and * Max-Requested-Bandwidth-DL AVPs. @@ -984,6 +1006,27 @@ error++; } + /* AVP: '3GPP-Charging-Characteristics'(13) + * For GGSN, it contains the charging characteristics for + * this PDP Context received in the Create PDP Context + * Request Message (only available in R99 and later releases). + * For PGW, it contains the charging characteristics for the + * IP-CAN bearer. + * Reference: 3GPP TS 29.061 16.4.7.2 13 + */ + ret = fd_avp_search_avp(avpch2, ogs_diam_s6a_3gpp_charging_characteristics, + &avpch3); + ogs_assert(ret == 0); + if (avpch3) { + ret = fd_msg_avp_hdr(avpch3, &hdr); + memcpy(session->charging_characteristics, + OGS_HEX(hdr->avp_value->os.data, (int)hdr->avp_value->os.len, buf), OGS_CHRGCHARS_LEN); + session->charging_characteristics_presence = true; + } else { + memcpy(session->charging_characteristics, (uint8_t *)"\x00\x00", OGS_CHRGCHARS_LEN); + session->charging_characteristics_presence = false; + } + /* AVP: 'Served-Party-IP-Address'(848) * The Served-Party-IP-Address AVP holds the IP address of * either the calling or called party, depending on whether
View file
open5gs_2.4.8.202207240002.tar.xz/src/mme/mme-s11-build.c -> open5gs_2.4.8.202207250002.tar.xz/src/mme/mme-s11-build.c
Changed
@@ -330,9 +330,15 @@ req->ue_time_zone.data = &ue_timezone; req->ue_time_zone.len = sizeof(ue_timezone); - req->charging_characteristics.presence = 1; - req->charging_characteristics.data = (uint8_t *)"\x54\x00"; - req->charging_characteristics.len = 2; + if (session->charging_characteristics_presence == true) { + req->charging_characteristics.presence = 1; + req->charging_characteristics.data = session->charging_characteristics; + req->charging_characteristics.len = OGS_CHRGCHARS_LEN; + } else if (mme_ue->charging_characteristics_presence == true) { + req->charging_characteristics.presence = 1; + req->charging_characteristics.data = mme_ue->charging_characteristics; + req->charging_characteristics.len = OGS_CHRGCHARS_LEN; + } gtp_message.h.type = type; return ogs_gtp2_build_msg(>p_message);
View file
open5gs_2.4.8.202207240002.tar.xz/src/mme/mme-s6a-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/mme/mme-s6a-handler.c
Changed
@@ -91,6 +91,11 @@ memcpy(&mme_ue->sessioni.smf_ip, &slice_data->sessioni.smf_ip, sizeof(mme_ue->sessioni.smf_ip)); + + memcpy(&mme_ue->sessioni.charging_characteristics, &slice_data->sessioni.charging_characteristics, + sizeof(mme_ue->sessioni.charging_characteristics)); + mme_ue->sessioni.charging_characteristics_presence = + slice_data->sessioni.charging_characteristics_presence; } mme_ue->num_of_session = i;
View file
open5gs_2.4.8.202207240002.tar.xz/src/nrf/nnrf-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/nrf/nnrf-handler.c
Changed
@@ -400,6 +400,7 @@ ogs_sbi_message_t sendmsg; ogs_sbi_response_t *response = NULL; ogs_sbi_nf_instance_t *nf_instance = NULL; + ogs_sbi_discovery_option_t *discovery_option = NULL; OpenAPI_search_result_t *SearchResult = NULL; int i; @@ -437,12 +438,36 @@ SearchResult->nf_instances = OpenAPI_list_create(); ogs_assert(SearchResult->nf_instances); + if (recvmsg->param.discovery_option) + discovery_option = recvmsg->param.discovery_option; + + if (discovery_option) { + if (discovery_option->target_nf_instance_id) { + ogs_debug("target-nf-instance-id%s", + discovery_option->target_nf_instance_id); + } + if (discovery_option->requester_nf_instance_id) { + ogs_debug("requester-nf-instance-id%s", + discovery_option->requester_nf_instance_id); + } + if (discovery_option->num_of_service_names) { + for (i = 0; i < discovery_option->num_of_service_names; i++) + ogs_debug("%d service-names%s", i, + discovery_option->service_namesi); + } + } + i = 0; ogs_list_for_each(&ogs_sbi_self()->nf_instance_list, nf_instance) { if (nf_instance->nf_type != recvmsg->param.target_nf_type) continue; - if (nf_instance->nf_type == recvmsg->param.requester_nf_type) - continue; + + if (discovery_option) { + if (discovery_option->target_nf_instance_id && + strcmp(nf_instance->id, + discovery_option->target_nf_instance_id) != 0) + continue; + } if (!recvmsg->param.limit || (recvmsg->param.limit && i < recvmsg->param.limit)) {
View file
open5gs_2.4.8.202207240002.tar.xz/src/nrf/sbi-path.c -> open5gs_2.4.8.202207250002.tar.xz/src/nrf/sbi-path.c
Changed
@@ -82,9 +82,6 @@ { ogs_sbi_nf_instance_t *nf_instance = NULL; - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) - return OGS_ERROR; - /* Initialize SCP NF Instance */ nf_instance = ogs_sbi_self()->scp_instance; if (nf_instance) { @@ -96,6 +93,16 @@ client->cb = client_notify_cb; } + /* Timer expiration handler of client wait timer */ + ogs_sbi_self()->client_wait_expire = nrf_timer_sbi_client_wait_expire; + + /* NF register state in NF state machine */ + ogs_sbi_self()->nf_state_registered = + (ogs_fsm_handler_t)nrf_nf_state_registered; + + if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + return OGS_ERROR; + return OGS_OK; }
View file
open5gs_2.4.8.202207240002.tar.xz/src/nrf/timer.c -> open5gs_2.4.8.202207250002.tar.xz/src/nrf/timer.c
Changed
@@ -82,3 +82,8 @@ { timer_send_event(NRF_TIMER_SUBSCRIPTION_VALIDITY, data); } + +void nrf_timer_sbi_client_wait_expire(void *data) +{ + timer_send_event(NRF_TIMER_SBI_CLIENT_WAIT, data); +}
View file
open5gs_2.4.8.202207240002.tar.xz/src/nrf/timer.h -> open5gs_2.4.8.202207250002.tar.xz/src/nrf/timer.h
Changed
@@ -32,6 +32,7 @@ NRF_TIMER_NF_INSTANCE_NO_HEARTBEAT, NRF_TIMER_SUBSCRIPTION_VALIDITY, + NRF_TIMER_SBI_CLIENT_WAIT, MAX_NUM_OF_NRF_TIMER, @@ -48,6 +49,7 @@ void nrf_timer_nf_instance_no_heartbeat(void *data); void nrf_timer_subscription_validity(void *data); +void nrf_timer_sbi_client_wait_expire(void *data); #ifdef __cplusplus }
View file
open5gs_2.4.8.202207240002.tar.xz/src/nssf/sbi-path.c -> open5gs_2.4.8.202207250002.tar.xz/src/nssf/sbi-path.c
Changed
@@ -79,9 +79,6 @@ ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_nf_service_t *service = NULL; - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) - return OGS_ERROR; - /* Add SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); @@ -114,6 +111,16 @@ } } + /* Timer expiration handler of client wait timer */ + ogs_sbi_self()->client_wait_expire = nssf_timer_sbi_client_wait_expire; + + /* NF register state in NF state machine */ + ogs_sbi_self()->nf_state_registered = + (ogs_fsm_handler_t)nssf_nf_state_registered; + + if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + return OGS_ERROR; + return OGS_OK; }
View file
open5gs_2.4.8.202207240002.tar.xz/src/nssf/timer.c -> open5gs_2.4.8.202207250002.tar.xz/src/nssf/timer.c
Changed
@@ -94,3 +94,8 @@ { sbi_timer_send_event(NSSF_TIMER_SUBSCRIPTION_VALIDITY, data); } + +void nssf_timer_sbi_client_wait_expire(void *data) +{ + sbi_timer_send_event(NSSF_TIMER_SBI_CLIENT_WAIT, data); +}
View file
open5gs_2.4.8.202207240002.tar.xz/src/nssf/timer.h -> open5gs_2.4.8.202207250002.tar.xz/src/nssf/timer.h
Changed
@@ -35,6 +35,7 @@ NSSF_TIMER_NF_INSTANCE_NO_HEARTBEAT, NSSF_TIMER_NF_INSTANCE_VALIDITY, NSSF_TIMER_SUBSCRIPTION_VALIDITY, + NSSF_TIMER_SBI_CLIENT_WAIT, MAX_NUM_OF_NSSF_TIMER, @@ -47,6 +48,7 @@ void nssf_timer_nf_instance_no_heartbeat(void *data); void nssf_timer_nf_instance_validity(void *data); void nssf_timer_subscription_validity(void *data); +void nssf_timer_sbi_client_wait_expire(void *data); #ifdef __cplusplus }
View file
open5gs_2.4.8.202207240002.tar.xz/src/pcf/context.c -> open5gs_2.4.8.202207250002.tar.xz/src/pcf/context.c
Changed
@@ -499,22 +499,6 @@ return ogs_pool_cycle(&pcf_sess_pool, sess); } -void pcf_ue_select_nf(pcf_ue_t *pcf_ue, OpenAPI_nf_type_e nf_type) -{ - ogs_assert(pcf_ue); - ogs_assert(nf_type); - - ogs_sbi_select_nf(&pcf_ue->sbi, nf_type, pcf_nf_state_registered); -} - -void pcf_sess_select_nf(pcf_sess_t *sess, OpenAPI_nf_type_e nf_type) -{ - ogs_assert(sess); - ogs_assert(nf_type); - - ogs_sbi_select_nf(&sess->sbi, nf_type, pcf_nf_state_registered); -} - pcf_app_t *pcf_app_add(pcf_sess_t *sess) { pcf_app_t *app = NULL;
View file
open5gs_2.4.8.202207240002.tar.xz/src/pcf/context.h -> open5gs_2.4.8.202207250002.tar.xz/src/pcf/context.h
Changed
@@ -184,9 +184,6 @@ pcf_ue_t *pcf_ue_cycle(pcf_ue_t *pcf_ue); pcf_sess_t *pcf_sess_cycle(pcf_sess_t *sess); -void pcf_ue_select_nf(pcf_ue_t *pcf_ue, OpenAPI_nf_type_e nf_type); -void pcf_sess_select_nf(pcf_sess_t *sess, OpenAPI_nf_type_e nf_type); - pcf_app_t *pcf_app_add(pcf_sess_t *sess); int pcf_app_remove(pcf_app_t *app); void pcf_app_remove_all(pcf_sess_t *sess);
View file
open5gs_2.4.8.202207240002.tar.xz/src/pcf/nnrf-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/pcf/nnrf-handler.c
Changed
@@ -253,18 +253,23 @@ ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg) { ogs_sbi_object_t *sbi_object = NULL; - pcf_ue_t *pcf_ue = NULL; - pcf_sess_t *sess = NULL; + OpenAPI_nf_type_e target_nf_type = 0; + ogs_sbi_discovery_option_t *discovery_option = NULL; + ogs_sbi_nf_instance_t *nf_instance = NULL; OpenAPI_search_result_t *SearchResult = NULL; OpenAPI_lnode_t *node = NULL; bool handled; + ogs_assert(recvmsg); ogs_assert(xact); sbi_object = xact->sbi_object; ogs_assert(sbi_object); - ogs_assert(recvmsg); + target_nf_type = xact->target_nf_type; + ogs_assert(target_nf_type); + + discovery_option = xact->discovery_option; SearchResult = recvmsg->SearchResult; if (!SearchResult) { @@ -299,9 +304,6 @@ } if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { - pcf_ue_t *pcf_ue = NULL; - pcf_sess_t *sess = NULL; - handled = ogs_sbi_nnrf_handle_nf_profile( nf_instance, NFProfile, NULL, NULL); if (!handled) { @@ -318,23 +320,6 @@ continue; } - switch(sbi_object->type) { - case OGS_SBI_OBJ_UE_TYPE: - pcf_ue = (pcf_ue_t *)sbi_object; - ogs_assert(pcf_ue); - pcf_ue_select_nf(pcf_ue, nf_instance->nf_type); - break; - case OGS_SBI_OBJ_SESS_TYPE: - sess = (pcf_sess_t *)sbi_object; - ogs_assert(sess); - pcf_sess_select_nf(sess, nf_instance->nf_type); - break; - default: - ogs_fatal("(NF discover search result) Not implemented %d", - sbi_object->type); - ogs_assert_if_reached(); - } - /* TIME : Update validity from NRF */ if (SearchResult->is_validity_period && SearchResult->validity_period) { @@ -353,31 +338,7 @@ } } - ogs_assert(xact->target_nf_type); - nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, xact->target_nf_type); - if (!nf_instance) { - ogs_assert(sbi_object->type > OGS_SBI_OBJ_BASE && - sbi_object->type < OGS_SBI_OBJ_TOP); - switch(sbi_object->type) { - case OGS_SBI_OBJ_UE_TYPE: - pcf_ue = (pcf_ue_t *)sbi_object; - ogs_assert(pcf_ue); - ogs_error("%s (NF discover) No %s", pcf_ue->supi, - OpenAPI_nf_type_ToString(xact->target_nf_type)); - break; - case OGS_SBI_OBJ_SESS_TYPE: - sess = (pcf_sess_t *)sbi_object; - ogs_assert(sess); - ogs_error("%d (NF discover) No %s", sess->psi, - OpenAPI_nf_type_ToString(xact->target_nf_type)); - break; - default: - ogs_fatal("(NF discover) Not implemented %s:%d", - OpenAPI_nf_type_ToString(xact->target_nf_type), - sbi_object->type); - ogs_assert_if_reached(); - } - } else { - ogs_assert(true == pcf_sbi_send(nf_instance, xact)); - } + ogs_sbi_select_nf(sbi_object, target_nf_type, discovery_option); + + ogs_expect(true == pcf_sbi_send_request(sbi_object, target_nf_type, xact)); }
View file
open5gs_2.4.8.202207240002.tar.xz/src/pcf/npcf-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/pcf/npcf-handler.c
Changed
@@ -148,8 +148,8 @@ pcf_ue->subscribed_ue_ambr, PolicyAssociationRequest->ue_ambr); ogs_assert(true == - pcf_ue_sbi_discover_and_send(OpenAPI_nf_type_UDR, pcf_ue, stream, NULL, - pcf_nudr_dr_build_query_am_data)); + pcf_ue_sbi_discover_and_send(OpenAPI_nf_type_UDR, NULL, + pcf_nudr_dr_build_query_am_data, pcf_ue, stream, NULL)); return true; } @@ -298,8 +298,8 @@ sess->subscribed_default_qos, SmPolicyContextData->subs_def_qos); ogs_assert(true == - pcf_sess_sbi_discover_and_send(OpenAPI_nf_type_UDR, sess, stream, NULL, - pcf_nudr_dr_build_query_sm_data)); + pcf_sess_sbi_discover_and_send(OpenAPI_nf_type_UDR, NULL, + pcf_nudr_dr_build_query_sm_data, sess, stream, NULL)); return true; @@ -352,9 +352,8 @@ ogs_assert(true == ogs_sbi_server_send_response(stream, response)); } else { ogs_assert(true == - pcf_sess_sbi_discover_and_send( - OpenAPI_nf_type_BSF, sess, stream, NULL, - pcf_nbsf_management_build_de_register)); + pcf_sess_sbi_discover_and_send(OpenAPI_nf_type_BSF, NULL, + pcf_nbsf_management_build_de_register, sess, stream, NULL)); } return true;
View file
open5gs_2.4.8.202207240002.tar.xz/src/pcf/nudr-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/pcf/nudr-handler.c
Changed
@@ -194,9 +194,8 @@ } ogs_assert(true == - pcf_sess_sbi_discover_and_send( - OpenAPI_nf_type_BSF, sess, stream, NULL, - pcf_nbsf_management_build_register)); + pcf_sess_sbi_discover_and_send(OpenAPI_nf_type_BSF, NULL, + pcf_nbsf_management_build_register, sess, stream, NULL)); return true;
View file
open5gs_2.4.8.202207240002.tar.xz/src/pcf/sbi-path.c -> open5gs_2.4.8.202207250002.tar.xz/src/pcf/sbi-path.c
Changed
@@ -79,9 +79,6 @@ ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_nf_service_t *service = NULL; - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) - return OGS_ERROR; - /* Add SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); @@ -127,6 +124,16 @@ } } + /* Timer expiration handler of client wait timer */ + ogs_sbi_self()->client_wait_expire = pcf_timer_sbi_client_wait_expire; + + /* NF register state in NF state machine */ + ogs_sbi_self()->nf_state_registered = + (ogs_fsm_handler_t)pcf_nf_state_registered; + + if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + return OGS_ERROR; + return OGS_OK; } @@ -136,31 +143,76 @@ ogs_sbi_server_stop_all(); } -bool pcf_sbi_send(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact) +bool pcf_sbi_send_request( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + void *data) { - return ogs_sbi_send(nf_instance, client_cb, xact); + ogs_sbi_nf_instance_t *nf_instance = NULL; + + nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, target_nf_type); + if (!nf_instance) { + pcf_ue_t *pcf_ue = NULL; + pcf_sess_t *sess = NULL; + + ogs_assert(sbi_object->type > OGS_SBI_OBJ_BASE && + sbi_object->type < OGS_SBI_OBJ_TOP); + switch(sbi_object->type) { + case OGS_SBI_OBJ_UE_TYPE: + pcf_ue = (pcf_ue_t *)sbi_object; + ogs_assert(pcf_ue); + ogs_error("%s (NF discover) No %s", pcf_ue->supi, + OpenAPI_nf_type_ToString(target_nf_type)); + break; + case OGS_SBI_OBJ_SESS_TYPE: + sess = (pcf_sess_t *)sbi_object; + ogs_assert(sess); + ogs_error("%d (NF discover) No %s", sess->psi, + OpenAPI_nf_type_ToString(target_nf_type)); + break; + default: + ogs_fatal("(NF discover) Not implemented %s:%d", + OpenAPI_nf_type_ToString(target_nf_type), + sbi_object->type); + ogs_assert_if_reached(); + } + + return false; + } + + return ogs_sbi_send_request(nf_instance, client_cb, data); } -static bool pcf_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - ogs_sbi_object_t *sbi_object, ogs_sbi_stream_t *stream, - ogs_sbi_build_f build, void *context, void *data) +static bool pcf_sbi_discover_and_send( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_build_f build, + void *context, ogs_sbi_stream_t *stream, void *data) { ogs_sbi_xact_t *xact = NULL; + OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL; + + ogs_assert(ogs_sbi_self()->nf_instance); + requester_nf_type = ogs_sbi_self()->nf_instance->nf_type; + ogs_assert(requester_nf_type); ogs_assert(target_nf_type); ogs_assert(sbi_object); ogs_assert(stream); ogs_assert(build); - xact = ogs_sbi_xact_add(target_nf_type, sbi_object, - build, context, data, - pcf_timer_sbi_client_wait_expire); + xact = ogs_sbi_xact_add( + sbi_object, target_nf_type, discovery_option, + build, context, data); ogs_expect_or_return_val(xact, false); xact->assoc_stream = stream; - if (ogs_sbi_discover_and_send(xact, - (ogs_fsm_handler_t)pcf_nf_state_registered, client_cb) != true) { + if (ogs_sbi_discover_and_send( + sbi_object, + target_nf_type, requester_nf_type, discovery_option, + client_cb, xact) != true) { ogs_error("ogs_sbi_discover_and_send() failed"); ogs_sbi_xact_remove(xact); return false; @@ -169,12 +221,15 @@ return true; } -bool pcf_ue_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - pcf_ue_t *pcf_ue, ogs_sbi_stream_t *stream, void *data, - ogs_sbi_request_t *(*build)(pcf_ue_t *pcf_ue, void *data)) +bool pcf_ue_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(pcf_ue_t *pcf_ue, void *data), + pcf_ue_t *pcf_ue, ogs_sbi_stream_t *stream, void *data) { - if (pcf_sbi_discover_and_send(target_nf_type, &pcf_ue->sbi, stream, - (ogs_sbi_build_f)build, pcf_ue, data) != true) { + if (pcf_sbi_discover_and_send( + &pcf_ue->sbi, target_nf_type, discovery_option, + (ogs_sbi_build_f)build, pcf_ue, stream, data) != true) { ogs_error("pcf_ue_sbi_discover_and_send() failed"); ogs_assert(true == ogs_sbi_server_send_error(stream, @@ -186,12 +241,15 @@ return true; } -bool pcf_sess_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - pcf_sess_t *sess, ogs_sbi_stream_t *stream, void *data, - ogs_sbi_request_t *(*build)(pcf_sess_t *sess, void *data)) +bool pcf_sess_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(pcf_sess_t *sess, void *data), + pcf_sess_t *sess, ogs_sbi_stream_t *stream, void *data) { - if (pcf_sbi_discover_and_send(target_nf_type, &sess->sbi, stream, - (ogs_sbi_build_f)build, sess, data) != true) { + if (pcf_sbi_discover_and_send( + &sess->sbi, target_nf_type, discovery_option, + (ogs_sbi_build_f)build, sess, stream, data) != true) { ogs_error("pcf_sess_sbi_discover_and_send() failed"); ogs_assert(true == ogs_sbi_server_send_error(stream,
View file
open5gs_2.4.8.202207240002.tar.xz/src/pcf/sbi-path.h -> open5gs_2.4.8.202207250002.tar.xz/src/pcf/sbi-path.h
Changed
@@ -34,13 +34,20 @@ int pcf_sbi_open(void); void pcf_sbi_close(void); -bool pcf_sbi_send(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact); -bool pcf_ue_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - pcf_ue_t *pcf_ue, ogs_sbi_stream_t *stream, void *data, - ogs_sbi_request_t *(*build)(pcf_ue_t *pcf_ue, void *data)); -bool pcf_sess_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - pcf_sess_t *sess, ogs_sbi_stream_t *stream, void *data, - ogs_sbi_request_t *(*build)(pcf_sess_t *sess, void *data)); +bool pcf_sbi_send_request( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + void *data); +bool pcf_ue_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(pcf_ue_t *pcf_ue, void *data), + pcf_ue_t *pcf_ue, ogs_sbi_stream_t *stream, void *data); +bool pcf_sess_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(pcf_sess_t *sess, void *data), + pcf_sess_t *sess, ogs_sbi_stream_t *stream, void *data); bool pcf_sbi_send_am_policy_control_notify(pcf_ue_t *pcf_ue); bool pcf_sbi_send_smpolicycontrol_update_notify(
View file
open5gs_2.4.8.202207240002.tar.xz/src/scp/context.c -> open5gs_2.4.8.202207250002.tar.xz/src/scp/context.c
Changed
@@ -153,11 +153,3 @@ { return ogs_pool_find(&scp_conn_pool, index); } - -void scp_conn_select_nf(scp_conn_t *sess, OpenAPI_nf_type_e nf_type) -{ - ogs_assert(sess); - ogs_assert(nf_type); - - ogs_sbi_select_nf(&sess->sbi, nf_type, scp_nf_state_registered); -}
View file
open5gs_2.4.8.202207240002.tar.xz/src/scp/context.h -> open5gs_2.4.8.202207250002.tar.xz/src/scp/context.h
Changed
@@ -79,8 +79,6 @@ scp_conn_t *scp_conn_find(uint32_t index); -void scp_conn_select_nf(scp_conn_t *sess, OpenAPI_nf_type_e nf_type); - #ifdef __cplusplus } #endif
View file
open5gs_2.4.8.202207240002.tar.xz/src/scp/nf-sm.c -> open5gs_2.4.8.202207250002.tar.xz/src/scp/nf-sm.c
Changed
@@ -229,6 +229,47 @@ nf_instance->time.heartbeat_interval + ogs_app()->time.nf_instance.no_heartbeat_margin)); } + + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_subscribe(client, + ogs_sbi_self()->nf_instance->nf_type, + ogs_sbi_self()->nf_instance->id, + OpenAPI_nf_type_AMF)); + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_subscribe(client, + ogs_sbi_self()->nf_instance->nf_type, + ogs_sbi_self()->nf_instance->id, + OpenAPI_nf_type_AUSF)); + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_subscribe(client, + ogs_sbi_self()->nf_instance->nf_type, + ogs_sbi_self()->nf_instance->id, + OpenAPI_nf_type_BSF)); + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_subscribe(client, + ogs_sbi_self()->nf_instance->nf_type, + ogs_sbi_self()->nf_instance->id, + OpenAPI_nf_type_NSSF)); + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_subscribe(client, + ogs_sbi_self()->nf_instance->nf_type, + ogs_sbi_self()->nf_instance->id, + OpenAPI_nf_type_PCF)); + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_subscribe(client, + ogs_sbi_self()->nf_instance->nf_type, + ogs_sbi_self()->nf_instance->id, + OpenAPI_nf_type_SMF)); + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_subscribe(client, + ogs_sbi_self()->nf_instance->nf_type, + ogs_sbi_self()->nf_instance->id, + OpenAPI_nf_type_UDM)); + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_subscribe(client, + ogs_sbi_self()->nf_instance->nf_type, + ogs_sbi_self()->nf_instance->id, + OpenAPI_nf_type_UDR)); } break;
View file
open5gs_2.4.8.202207240002.tar.xz/src/scp/nnrf-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/scp/nnrf-handler.c
Changed
@@ -253,16 +253,22 @@ ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg) { ogs_sbi_object_t *sbi_object = NULL; + OpenAPI_nf_type_e target_nf_type = 0; + ogs_sbi_discovery_option_t *discovery_option = NULL; ogs_sbi_nf_instance_t *nf_instance = NULL; OpenAPI_search_result_t *SearchResult = NULL; OpenAPI_lnode_t *node = NULL; bool handled; + ogs_assert(recvmsg); ogs_assert(xact); sbi_object = xact->sbi_object; ogs_assert(sbi_object); - ogs_assert(recvmsg); + target_nf_type = xact->target_nf_type; + ogs_assert(target_nf_type); + + discovery_option = xact->discovery_option; SearchResult = recvmsg->SearchResult; if (!SearchResult) { @@ -297,8 +303,6 @@ } if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { - scp_conn_t *conn = NULL; - handled = ogs_sbi_nnrf_handle_nf_profile( nf_instance, NFProfile, NULL, NULL); if (!handled) { @@ -315,10 +319,6 @@ continue; } - conn = (scp_conn_t *)sbi_object; - ogs_assert(conn); - scp_conn_select_nf(conn, nf_instance->nf_type); - /* TIME : Update validity from NRF */ if (SearchResult->is_validity_period && SearchResult->validity_period) { @@ -337,11 +337,12 @@ } } - ogs_assert(xact->target_nf_type); - nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, xact->target_nf_type); + ogs_sbi_select_nf(sbi_object, target_nf_type, discovery_option); + + nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, target_nf_type); if (!nf_instance) { ogs_error("(NF discover) No %s", - OpenAPI_nf_type_ToString(xact->target_nf_type)); + OpenAPI_nf_type_ToString(target_nf_type)); } else { scp_sbi_send(nf_instance, xact); }
View file
open5gs_2.4.8.202207240002.tar.xz/src/scp/sbi-path.c -> open5gs_2.4.8.202207250002.tar.xz/src/scp/sbi-path.c
Changed
@@ -29,9 +29,6 @@ { ogs_sbi_nf_instance_t *nf_instance = NULL; - if (ogs_sbi_server_start_all(request_handler) != OGS_OK) - return OGS_ERROR; - /* Add SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); @@ -65,6 +62,16 @@ scp_nf_fsm_init(nf_instance); } + /* Timer expiration handler of client wait timer */ + ogs_sbi_self()->client_wait_expire = scp_timer_sbi_client_wait_expire; + + /* NF register state in NF state machine */ + ogs_sbi_self()->nf_state_registered = + (ogs_fsm_handler_t)scp_nf_state_registered; + + if (ogs_sbi_server_start_all(request_handler) != OGS_OK) + return OGS_ERROR; + return OGS_OK; } @@ -266,35 +273,25 @@ return OGS_ERROR; } } else { - ogs_sbi_message_t message; + scp_event_t *e = NULL; + int rv; - ogs_error("Unknown HTTP Headers"); - ogs_error(" %s:%s", source->h.method, source->h.uri); - 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); - ogs_error(" %s:%s", key, val); - } + ogs_assert(source); + ogs_assert(data); - rv = ogs_sbi_parse_request(&message, source); + e = scp_event_new(SCP_EVT_SBI_SERVER); + ogs_assert(e); + + e->sbi.request = source; + e->sbi.data = data; + + rv = ogs_queue_push(ogs_app()->queue, e); if (rv != OGS_OK) { - 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)); + ogs_error("ogs_queue_push() failed:%d", (int)rv); + ogs_sbi_request_free(source); + scp_event_free(e); return OGS_ERROR; } - - ogs_assert(true == - ogs_sbi_server_send_error( - stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - &message, "SCP - HTTP Client", NULL)); - - ogs_sbi_message_free(&message); - - return OGS_OK; } return OGS_OK; @@ -366,24 +363,29 @@ bool scp_sbi_send(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact) { - return ogs_sbi_send(nf_instance, client_cb, xact); + return ogs_sbi_send_request(nf_instance, client_cb, xact); } -bool scp_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - scp_conn_t *conn, ogs_sbi_stream_t *stream, void *data, - ogs_sbi_request_t *(*build)(scp_conn_t *conn, void *data)) +bool scp_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(scp_conn_t *conn, void *data), + scp_conn_t *conn, ogs_sbi_stream_t *stream, void *data) { ogs_sbi_xact_t *xact = NULL; + OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL; - ogs_assert(target_nf_type); + ogs_assert(ogs_sbi_self()->nf_instance); + requester_nf_type = ogs_sbi_self()->nf_instance->nf_type; + ogs_assert(requester_nf_type); ogs_assert(conn); ogs_assert(stream); ogs_assert(build); - xact = ogs_sbi_xact_add(target_nf_type, &conn->sbi, - (ogs_sbi_build_f)build, conn, data, - scp_timer_sbi_client_wait_expire); + xact = ogs_sbi_xact_add( + &conn->sbi, target_nf_type, discovery_option, + (ogs_sbi_build_f)build, conn, data); if (!xact) { ogs_error("scp_sbi_discover_and_send() failed"); ogs_assert(true == @@ -395,8 +397,10 @@ xact->assoc_stream = stream; - if (ogs_sbi_discover_and_send(xact, - (ogs_fsm_handler_t)scp_nf_state_registered, client_cb) != true) { + if (ogs_sbi_discover_and_send( + &conn->sbi, + target_nf_type, requester_nf_type, discovery_option, + client_cb, xact) != true) { ogs_error("scp_sbi_discover_and_send() failed"); ogs_sbi_xact_remove(xact); ogs_assert(true ==
View file
open5gs_2.4.8.202207240002.tar.xz/src/scp/sbi-path.h -> open5gs_2.4.8.202207250002.tar.xz/src/scp/sbi-path.h
Changed
@@ -31,9 +31,11 @@ bool scp_sbi_send(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact); -bool scp_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - scp_conn_t *conn, ogs_sbi_stream_t *stream, void *data, - ogs_sbi_request_t *(*build)(scp_conn_t *conn, void *data)); +bool scp_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(scp_conn_t *conn, void *data), + scp_conn_t *conn, ogs_sbi_stream_t *stream, void *data); #ifdef __cplusplus }
View file
open5gs_2.4.8.202207240002.tar.xz/src/smf/context.c -> open5gs_2.4.8.202207250002.tar.xz/src/smf/context.c
Changed
@@ -80,7 +80,7 @@ ogs_log_install_domain(&__smf_log_domain, "smf", ogs_core()->log.level); ogs_log_install_domain(&__gsm_log_domain, "gsm", ogs_core()->log.level); - ogs_pool_init(&smf_gtp_node_pool, ogs_app()->pool.gtp_node); + 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_sess_pool, ogs_app()->pool.sess); ogs_pool_init(&smf_bearer_pool, ogs_app()->pool.bearer); @@ -2528,14 +2528,6 @@ return ogs_pool_cycle(&smf_bearer_pool, qos_flow); } -void smf_sess_select_nf(smf_sess_t *sess, OpenAPI_nf_type_e nf_type) -{ - ogs_assert(sess); - ogs_assert(nf_type); - - ogs_sbi_select_nf(&sess->sbi, nf_type, smf_nf_state_registered); -} - smf_pf_t *smf_pf_add(smf_bearer_t *bearer) { smf_sess_t *sess = NULL;
View file
open5gs_2.4.8.202207240002.tar.xz/src/smf/context.h -> open5gs_2.4.8.202207250002.tar.xz/src/smf/context.h
Changed
@@ -502,8 +502,6 @@ smf_bearer_t *smf_qos_flow_cycle(smf_bearer_t *qos_flow); smf_bearer_t *smf_bearer_cycle(smf_bearer_t *bearer); -void smf_sess_select_nf(smf_sess_t *sess, OpenAPI_nf_type_e nf_type); - smf_pf_t *smf_pf_add(smf_bearer_t *bearer); int smf_pf_remove(smf_pf_t *pf); void smf_pf_remove_all(smf_bearer_t *bearer);
View file
open5gs_2.4.8.202207240002.tar.xz/src/smf/gsm-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/smf/gsm-handler.c
Changed
@@ -67,9 +67,9 @@ } ogs_assert(true == - smf_sbi_discover_and_send(OpenAPI_nf_type_UDM, sess, stream, - 0, (char *)OGS_SBI_RESOURCE_NAME_SM_DATA, - smf_nudm_sdm_build_get)); + smf_sbi_discover_and_send(OpenAPI_nf_type_UDM, NULL, + smf_nudm_sdm_build_get, + sess, stream, 0, (char *)OGS_SBI_RESOURCE_NAME_SM_DATA)); return OGS_OK; }
View file
open5gs_2.4.8.202207240002.tar.xz/src/smf/gsm-sm.c -> open5gs_2.4.8.202207250002.tar.xz/src/smf/gsm-sm.c
Changed
@@ -996,9 +996,10 @@ NGAP_CauseNas_normal_release; ogs_assert(true == - smf_sbi_discover_and_send(OpenAPI_nf_type_PCF, sess, stream, - OGS_PFCP_DELETE_TRIGGER_UE_REQUESTED, ¶m, - smf_npcf_smpolicycontrol_build_delete)); + smf_sbi_discover_and_send(OpenAPI_nf_type_PCF, NULL, + smf_npcf_smpolicycontrol_build_delete, + sess, stream, + OGS_PFCP_DELETE_TRIGGER_UE_REQUESTED, ¶m)); } else { ogs_error("%s:%d No PolicyAssociationId", smf_ue->supi, sess->psi);
View file
open5gs_2.4.8.202207240002.tar.xz/src/smf/nnrf-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/smf/nnrf-handler.c
Changed
@@ -253,16 +253,22 @@ ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg) { ogs_sbi_object_t *sbi_object = NULL; + OpenAPI_nf_type_e target_nf_type = 0; + ogs_sbi_discovery_option_t *discovery_option = NULL; ogs_sbi_nf_instance_t *nf_instance = NULL; OpenAPI_search_result_t *SearchResult = NULL; OpenAPI_lnode_t *node = NULL; bool handled; + ogs_assert(recvmsg); ogs_assert(xact); sbi_object = xact->sbi_object; ogs_assert(sbi_object); - ogs_assert(recvmsg); + target_nf_type = xact->target_nf_type; + ogs_assert(target_nf_type); + + discovery_option = xact->discovery_option; SearchResult = recvmsg->SearchResult; if (!SearchResult) { @@ -297,8 +303,6 @@ } if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { - smf_sess_t *sess = NULL; - handled = ogs_sbi_nnrf_handle_nf_profile( nf_instance, NFProfile, NULL, NULL); if (!handled) { @@ -315,10 +319,6 @@ continue; } - sess = (smf_sess_t *)sbi_object; - ogs_assert(sess); - smf_sess_select_nf(sess, nf_instance->nf_type); - /* TIME : Update validity from NRF */ if (SearchResult->is_validity_period && SearchResult->validity_period) { @@ -337,85 +337,7 @@ } } - ogs_assert(xact->target_nf_type); - nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, xact->target_nf_type); - if (!nf_instance) { - ogs_error("(NF discover) No %s", - OpenAPI_nf_type_ToString(xact->target_nf_type)); - } else { - ogs_assert(true == smf_sbi_send(nf_instance, xact)); - } -} - -void smf_nnrf_handle_nf_profile_retrieve( - ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg) -{ - ogs_sbi_object_t *sbi_object = NULL; - ogs_sbi_nf_instance_t *nf_instance = NULL; - - OpenAPI_nf_profile_t *NFProfile = NULL; - bool handled; + ogs_sbi_select_nf(sbi_object, target_nf_type, discovery_option); - ogs_assert(xact); - sbi_object = xact->sbi_object; - ogs_assert(sbi_object); - ogs_assert(recvmsg); - - NFProfile = recvmsg->NFProfile; - if (!NFProfile) { - ogs_error("No NFProfile"); - return; - } - - 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); - - smf_nf_fsm_init(nf_instance); - - ogs_info("%s (NF-discover) NF registered", nf_instance->id); - } else { - nf_instance->reference_count++; - - OGS_FSM_TRAN(&nf_instance->sm, smf_nf_state_registered); - ogs_fsm_dispatch(&nf_instance->sm, NULL); - - ogs_warn("%s (NF-discover) NF has already been added", - NFProfile->nf_instance_id); - } - - if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { - smf_sess_t *sess = NULL; - - handled = ogs_sbi_nnrf_handle_nf_profile( - nf_instance, NFProfile, NULL, NULL); - if (!handled) { - ogs_error("ogs_sbi_nnrf_handle_nf_profile() failed %s", - nf_instance->id); - SMF_NF_INSTANCE_CLEAR("NRF-discover", nf_instance); - return; - } - - handled = ogs_sbi_client_associate(nf_instance); - if (!handled) { - ogs_error("%s Cannot assciate NF EndPoint", nf_instance->id); - SMF_NF_INSTANCE_CLEAR("NRF-discover", nf_instance); - return; - } - - sess = (smf_sess_t *)sbi_object; - ogs_assert(sess); - smf_sess_select_nf(sess, nf_instance->nf_type); - - ogs_info("%s (NF-discover) NF Profile updated", nf_instance->id); - } - - if (!nf_instance) { - ogs_error("(NF discover) No %s", - OpenAPI_nf_type_ToString(xact->target_nf_type)); - } else { - ogs_assert(true == smf_sbi_send(nf_instance, xact)); - } + ogs_expect(true == smf_sbi_send_request(sbi_object, target_nf_type, xact)); }
View file
open5gs_2.4.8.202207240002.tar.xz/src/smf/nnrf-handler.h -> open5gs_2.4.8.202207250002.tar.xz/src/smf/nnrf-handler.h
Changed
@@ -36,8 +36,6 @@ void smf_nnrf_handle_nf_discover( ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg); -void smf_nnrf_handle_nf_profile_retrieve( - ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg); #ifdef __cplusplus }
View file
open5gs_2.4.8.202207240002.tar.xz/src/smf/npcf-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/smf/npcf-handler.c
Changed
@@ -683,9 +683,9 @@ memset(¶m, 0, sizeof(param)); ogs_assert(true == - smf_sbi_discover_and_send(OpenAPI_nf_type_PCF, sess, NULL, - OGS_PFCP_DELETE_TRIGGER_PCF_INITIATED, ¶m, - smf_npcf_smpolicycontrol_build_delete)); + smf_sbi_discover_and_send(OpenAPI_nf_type_PCF, NULL, + smf_npcf_smpolicycontrol_build_delete, + sess, NULL, OGS_PFCP_DELETE_TRIGGER_PCF_INITIATED, ¶m)); return true; }
View file
open5gs_2.4.8.202207240002.tar.xz/src/smf/nsmf-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/smf/nsmf-handler.c
Changed
@@ -590,9 +590,10 @@ param.ue_timezone = true; ogs_assert(true == - smf_sbi_discover_and_send(OpenAPI_nf_type_PCF, sess, stream, - OGS_PFCP_DELETE_TRIGGER_AMF_UPDATE_SM_CONTEXT, ¶m, - smf_npcf_smpolicycontrol_build_delete)); + smf_sbi_discover_and_send(OpenAPI_nf_type_PCF, NULL, + smf_npcf_smpolicycontrol_build_delete, + sess, stream, + OGS_PFCP_DELETE_TRIGGER_AMF_UPDATE_SM_CONTEXT, ¶m)); } } else { ogs_error("No PolicyAssociationId"); @@ -665,9 +666,10 @@ if (sess->policy_association_id) { ogs_assert(true == - smf_sbi_discover_and_send(OpenAPI_nf_type_PCF, sess, stream, - OGS_PFCP_DELETE_TRIGGER_AMF_RELEASE_SM_CONTEXT, ¶m, - smf_npcf_smpolicycontrol_build_delete)); + smf_sbi_discover_and_send(OpenAPI_nf_type_PCF, NULL, + smf_npcf_smpolicycontrol_build_delete, + sess, stream, + OGS_PFCP_DELETE_TRIGGER_AMF_RELEASE_SM_CONTEXT, ¶m)); } else { ogs_error("No PolicyAssociationId"); ogs_assert(true ==
View file
open5gs_2.4.8.202207240002.tar.xz/src/smf/nudm-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/smf/nudm-handler.c
Changed
@@ -288,8 +288,8 @@ ogs_free(sendmsg.http.location); ogs_assert(true == - smf_sbi_discover_and_send(OpenAPI_nf_type_PCF, sess, stream, - 0, NULL, smf_npcf_smpolicycontrol_build_create)); + smf_sbi_discover_and_send(OpenAPI_nf_type_PCF, NULL, + smf_npcf_smpolicycontrol_build_create, sess, stream, 0, NULL)); return true;
View file
open5gs_2.4.8.202207240002.tar.xz/src/smf/sbi-path.c -> open5gs_2.4.8.202207250002.tar.xz/src/smf/sbi-path.c
Changed
@@ -81,9 +81,6 @@ ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_nf_service_t *service = NULL; - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) - return OGS_ERROR; - /* Add SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); @@ -116,6 +113,16 @@ } } + /* Timer expiration handler of client wait timer */ + ogs_sbi_self()->client_wait_expire = smf_timer_sbi_client_wait_expire; + + /* NF register state in NF state machine */ + ogs_sbi_self()->nf_state_registered = + (ogs_fsm_handler_t)smf_nf_state_registered; + + if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + return OGS_ERROR; + return OGS_OK; } @@ -125,29 +132,47 @@ ogs_sbi_server_stop_all(); } -bool smf_sbi_send(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact) +bool smf_sbi_send_request( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + void *data) { - return ogs_sbi_send(nf_instance, client_cb, xact); + ogs_sbi_nf_instance_t *nf_instance = NULL; + + nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, target_nf_type); + if (!nf_instance) { + ogs_error("(NF discover) No %s", + OpenAPI_nf_type_ToString(target_nf_type)); + return false; + } + + return ogs_sbi_send_request(nf_instance, client_cb, data); } -bool smf_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - smf_sess_t *sess, ogs_sbi_stream_t *stream, int state, void *data, - ogs_sbi_request_t *(*build)(smf_sess_t *sess, void *data)) +bool smf_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(smf_sess_t *sess, void *data), + smf_sess_t *sess, ogs_sbi_stream_t *stream, int state, void *data) { - ogs_sbi_xact_t *xact = NULL; smf_ue_t *smf_ue = NULL; + ogs_sbi_xact_t *xact = NULL; - ogs_assert(target_nf_type); + OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL; ogs_assert(sess); smf_ue = sess->smf_ue; ogs_assert(smf_ue); + ogs_assert(ogs_sbi_self()->nf_instance); + requester_nf_type = ogs_sbi_self()->nf_instance->nf_type; + ogs_assert(requester_nf_type); + ogs_assert(build); - xact = ogs_sbi_xact_add(target_nf_type, &sess->sbi, - (ogs_sbi_build_f)build, sess, data, - smf_timer_sbi_client_wait_expire); + xact = ogs_sbi_xact_add( + &sess->sbi, target_nf_type, discovery_option, + (ogs_sbi_build_f)build, sess, data); if (!xact) { ogs_error("smf_sbi_discover_and_send() failed"); ogs_assert(true == @@ -160,8 +185,10 @@ xact->state = state; xact->assoc_stream = stream; - if (ogs_sbi_discover_and_send(xact, - (ogs_fsm_handler_t)smf_nf_state_registered, client_cb) != true) { + if (ogs_sbi_discover_and_send( + &sess->sbi, + target_nf_type, requester_nf_type, discovery_option, + client_cb, xact) != true) { ogs_error("smf_sbi_discover_and_send() failed"); ogs_sbi_xact_remove(xact); @@ -179,8 +206,12 @@ void smf_namf_comm_send_n1_n2_message_transfer( smf_sess_t *sess, smf_n1_n2_message_transfer_param_t *param) { - ogs_sbi_xact_t *xact = NULL; smf_ue_t *smf_ue = NULL; + ogs_sbi_xact_t *xact = 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_assert(param); ogs_assert(param->state); @@ -190,9 +221,21 @@ smf_ue = sess->smf_ue; ogs_assert(smf_ue); - xact = ogs_sbi_xact_add(OpenAPI_nf_type_AMF, &sess->sbi, + ogs_assert(ogs_sbi_self()->nf_instance); + requester_nf_type = ogs_sbi_self()->nf_instance->nf_type; + ogs_assert(requester_nf_type); + + target_nf_type = OpenAPI_nf_type_AMF; + + discovery_option = ogs_sbi_discovery_option_new(); + ogs_assert(discovery_option); + ogs_sbi_discovery_option_set_target_nf_instance_id( + discovery_option, sess->serving_nf_id); + + xact = ogs_sbi_xact_add( + &sess->sbi, target_nf_type, discovery_option, (ogs_sbi_build_f)smf_namf_comm_build_n1_n2_message_transfer, - sess, param, smf_timer_sbi_client_wait_expire); + sess, param); if (!xact) { ogs_error("smf_namf_comm_send_n1_n2_message_transfer() failed"); return; @@ -200,10 +243,10 @@ xact->state = param->state; - if (ogs_sbi_discover_by_nf_instanceid_and_send(xact, - (ogs_fsm_handler_t)smf_nf_state_registered, client_cb, - sess->serving_nf_id) != true) - { + if (ogs_sbi_discover_and_send( + &sess->sbi, + target_nf_type, requester_nf_type, discovery_option, + client_cb, xact) != true) { ogs_error("smf_namf_comm_send_n1_n2_message_transfer() failed"); ogs_sbi_xact_remove(xact); }
View file
open5gs_2.4.8.202207240002.tar.xz/src/smf/sbi-path.h -> open5gs_2.4.8.202207250002.tar.xz/src/smf/sbi-path.h
Changed
@@ -34,11 +34,15 @@ int smf_sbi_open(void); void smf_sbi_close(void); -bool smf_sbi_send(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact); - -bool smf_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - smf_sess_t *sess, ogs_sbi_stream_t *stream, int state, void *data, - ogs_sbi_request_t *(*build)(smf_sess_t *sess, void *data)); +bool smf_sbi_send_request( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + void *data); +bool smf_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(smf_sess_t *sess, void *data), + smf_sess_t *sess, ogs_sbi_stream_t *stream, int state, void *data); void smf_namf_comm_send_n1_n2_message_transfer( smf_sess_t *sess, smf_n1_n2_message_transfer_param_t *param);
View file
open5gs_2.4.8.202207240002.tar.xz/src/smf/smf-sm.c -> open5gs_2.4.8.202207250002.tar.xz/src/smf/smf-sm.c
Changed
@@ -658,27 +658,12 @@ SWITCH(sbi_message.h.resource.component0) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) + nf_instance = e->sbi.data; + ogs_assert(nf_instance); + ogs_assert(OGS_FSM_STATE(&nf_instance->sm)); - SWITCH(sbi_message.h.method) - CASE(OGS_SBI_HTTP_METHOD_GET) - sbi_xact = e->sbi.data; - ogs_assert(sbi_xact); - - if (sbi_message.res_status == OGS_SBI_HTTP_STATUS_OK) - smf_nnrf_handle_nf_profile_retrieve( - sbi_xact, &sbi_message); - else - ogs_error("HTTP response error %d", - sbi_message.res_status); - break; - DEFAULT - nf_instance = e->sbi.data; - ogs_assert(nf_instance); - ogs_assert(OGS_FSM_STATE(&nf_instance->sm)); - - e->sbi.message = &sbi_message; - ogs_fsm_dispatch(&nf_instance->sm, e); - END + e->sbi.message = &sbi_message; + ogs_fsm_dispatch(&nf_instance->sm, e); break; CASE(OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS)
View file
open5gs_2.4.8.202207240002.tar.xz/src/udm/context.c -> open5gs_2.4.8.202207250002.tar.xz/src/udm/context.c
Changed
@@ -229,11 +229,3 @@ { return ogs_pool_cycle(&udm_ue_pool, udm_ue); } - -void udm_ue_select_nf(udm_ue_t *udm_ue, OpenAPI_nf_type_e nf_type) -{ - ogs_assert(udm_ue); - ogs_assert(nf_type); - - ogs_sbi_select_nf(&udm_ue->sbi, nf_type, udm_nf_state_registered); -}
View file
open5gs_2.4.8.202207240002.tar.xz/src/udm/context.h -> open5gs_2.4.8.202207250002.tar.xz/src/udm/context.h
Changed
@@ -106,8 +106,6 @@ udm_ue_t *udm_ue_cycle(udm_ue_t *udm_ue); -void udm_ue_select_nf(udm_ue_t *udm_ue, OpenAPI_nf_type_e nf_type); - #ifdef __cplusplus } #endif
View file
open5gs_2.4.8.202207240002.tar.xz/src/udm/nnrf-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/udm/nnrf-handler.c
Changed
@@ -253,16 +253,22 @@ ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg) { ogs_sbi_object_t *sbi_object = NULL; + OpenAPI_nf_type_e target_nf_type = 0; + ogs_sbi_discovery_option_t *discovery_option = NULL; ogs_sbi_nf_instance_t *nf_instance = NULL; OpenAPI_search_result_t *SearchResult = NULL; OpenAPI_lnode_t *node = NULL; bool handled; + ogs_assert(recvmsg); ogs_assert(xact); sbi_object = xact->sbi_object; ogs_assert(sbi_object); - ogs_assert(recvmsg); + target_nf_type = xact->target_nf_type; + ogs_assert(target_nf_type); + + discovery_option = xact->discovery_option; SearchResult = recvmsg->SearchResult; if (!SearchResult) { @@ -297,8 +303,6 @@ } if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { - udm_ue_t *udm_ue = NULL; - handled = ogs_sbi_nnrf_handle_nf_profile( nf_instance, NFProfile, NULL, NULL); if (!handled) { @@ -315,10 +319,6 @@ continue; } - udm_ue = (udm_ue_t *)sbi_object; - ogs_assert(udm_ue); - udm_ue_select_nf(udm_ue, nf_instance->nf_type); - /* TIME : Update validity from NRF */ if (SearchResult->is_validity_period && SearchResult->validity_period) { @@ -337,12 +337,7 @@ } } - ogs_assert(xact->target_nf_type); - nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, xact->target_nf_type); - if (!nf_instance) { - ogs_error("(NF discover) No %s", - OpenAPI_nf_type_ToString(xact->target_nf_type)); - } else { - ogs_assert(true == udm_sbi_send(nf_instance, xact)); - } + ogs_sbi_select_nf(sbi_object, target_nf_type, discovery_option); + + ogs_expect(true == udm_sbi_send_request(sbi_object, target_nf_type, xact)); }
View file
open5gs_2.4.8.202207240002.tar.xz/src/udm/nudm-handler.c -> open5gs_2.4.8.202207250002.tar.xz/src/udm/nudm-handler.c
Changed
@@ -73,9 +73,10 @@ ResynchronizationInfo = AuthenticationInfoRequest->resynchronization_info; if (!ResynchronizationInfo) { - ogs_assert(true == udm_sbi_discover_and_send( - OpenAPI_nf_type_UDR, udm_ue, stream, NULL, - udm_nudr_dr_build_authentication_subscription)); + ogs_assert(true == + udm_sbi_discover_and_send(OpenAPI_nf_type_UDR, NULL, + udm_nudr_dr_build_authentication_subscription, + udm_ue, stream, NULL)); } else { uint8_t randOGS_RAND_LEN; @@ -162,9 +163,9 @@ ogs_uint64_to_buffer(sqn, OGS_SQN_LEN, udm_ue->sqn); ogs_assert(true == - udm_sbi_discover_and_send(OpenAPI_nf_type_UDR, - udm_ue, stream, udm_ue->sqn, - udm_nudr_dr_build_authentication_subscription)); + udm_sbi_discover_and_send(OpenAPI_nf_type_UDR, NULL, + udm_nudr_dr_build_authentication_subscription, + udm_ue, stream, udm_ue->sqn)); } return true; @@ -232,8 +233,9 @@ udm_ue->auth_event, message->AuthEvent); ogs_assert(true == - udm_sbi_discover_and_send(OpenAPI_nf_type_UDR, udm_ue, stream, NULL, - udm_nudr_dr_build_update_authentication_status)); + udm_sbi_discover_and_send(OpenAPI_nf_type_UDR, NULL, + udm_nudr_dr_build_update_authentication_status, + udm_ue, stream, NULL)); return true; } @@ -330,8 +332,8 @@ message->Amf3GppAccessRegistration); ogs_assert(true == - udm_sbi_discover_and_send(OpenAPI_nf_type_UDR, udm_ue, stream, NULL, - udm_nudr_dr_build_update_amf_context)); + udm_sbi_discover_and_send(OpenAPI_nf_type_UDR, NULL, + udm_nudr_dr_build_update_amf_context, udm_ue, stream, NULL)); return true; } @@ -437,8 +439,9 @@ } ogs_assert(true == - udm_sbi_discover_and_send(OpenAPI_nf_type_UDR, udm_ue, stream, - PatchItemList, udm_nudr_dr_build_patch_amf_context)); + udm_sbi_discover_and_send(OpenAPI_nf_type_UDR, NULL, + udm_nudr_dr_build_patch_amf_context, + udm_ue, stream, PatchItemList)); return true; }
View file
open5gs_2.4.8.202207240002.tar.xz/src/udm/sbi-path.c -> open5gs_2.4.8.202207250002.tar.xz/src/udm/sbi-path.c
Changed
@@ -79,9 +79,6 @@ ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_nf_service_t *service = NULL; - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) - return OGS_ERROR; - /* Add SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); @@ -129,6 +126,16 @@ } } + /* Timer expiration handler of client wait timer */ + ogs_sbi_self()->client_wait_expire = udm_timer_sbi_client_wait_expire; + + /* NF register state in NF state machine */ + ogs_sbi_self()->nf_state_registered = + (ogs_fsm_handler_t)udm_nf_state_registered; + + if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + return OGS_ERROR; + return OGS_OK; } @@ -138,25 +145,44 @@ ogs_sbi_server_stop_all(); } -bool udm_sbi_send(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact) +bool udm_sbi_send_request( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + void *data) { - return ogs_sbi_send(nf_instance, client_cb, xact); + ogs_sbi_nf_instance_t *nf_instance = NULL; + + nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, target_nf_type); + if (!nf_instance) { + ogs_error("(NF discover) No %s", + OpenAPI_nf_type_ToString(target_nf_type)); + return false; + } + + return ogs_sbi_send_request(nf_instance, client_cb, data); } -bool udm_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - udm_ue_t *udm_ue, ogs_sbi_stream_t *stream, void *data, - ogs_sbi_request_t *(*build)(udm_ue_t *udm_ue, void *data)) +bool udm_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(udm_ue_t *udm_ue, void *data), + udm_ue_t *udm_ue, ogs_sbi_stream_t *stream, void *data) { ogs_sbi_xact_t *xact = NULL; + OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL; + + ogs_assert(ogs_sbi_self()->nf_instance); + requester_nf_type = ogs_sbi_self()->nf_instance->nf_type; + ogs_assert(requester_nf_type); ogs_assert(target_nf_type); ogs_assert(udm_ue); ogs_assert(stream); ogs_assert(build); - xact = ogs_sbi_xact_add(target_nf_type, &udm_ue->sbi, - (ogs_sbi_build_f)build, udm_ue, data, - udm_timer_sbi_client_wait_expire); + xact = ogs_sbi_xact_add( + &udm_ue->sbi, target_nf_type, discovery_option, + (ogs_sbi_build_f)build, udm_ue, data); if (!xact) { ogs_error("udm_sbi_discover_and_send() failed"); ogs_assert(true == @@ -168,8 +194,10 @@ xact->assoc_stream = stream; - if (ogs_sbi_discover_and_send(xact, - (ogs_fsm_handler_t)udm_nf_state_registered, client_cb) != true) { + if (ogs_sbi_discover_and_send( + &udm_ue->sbi, + target_nf_type, requester_nf_type, discovery_option, + client_cb, xact) != true) { ogs_error("udm_sbi_discover_and_send() failed"); ogs_sbi_xact_remove(xact); ogs_assert(true ==
View file
open5gs_2.4.8.202207240002.tar.xz/src/udm/sbi-path.h -> open5gs_2.4.8.202207250002.tar.xz/src/udm/sbi-path.h
Changed
@@ -30,10 +30,15 @@ int udm_sbi_open(void); void udm_sbi_close(void); -bool udm_sbi_send(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact); -bool udm_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - udm_ue_t *udm_ue, ogs_sbi_stream_t *stream, void *data, - ogs_sbi_request_t *(*build)(udm_ue_t *udm_ue, void *data)); +bool udm_sbi_send_request( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + void *data); +bool udm_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(udm_ue_t *udm_ue, void *data), + udm_ue_t *udm_ue, ogs_sbi_stream_t *stream, void *data); #ifdef __cplusplus }
View file
open5gs_2.4.8.202207240002.tar.xz/src/udm/ue-sm.c -> open5gs_2.4.8.202207250002.tar.xz/src/udm/ue-sm.c
Changed
@@ -143,9 +143,9 @@ CASE(OGS_SBI_RESOURCE_NAME_SMF_SELECT_DATA) CASE(OGS_SBI_RESOURCE_NAME_SM_DATA) ogs_assert(true == - udm_sbi_discover_and_send( - OpenAPI_nf_type_UDR, udm_ue, stream, message, - udm_nudr_dr_build_query_subscription_provisioned)); + udm_sbi_discover_and_send(OpenAPI_nf_type_UDR, NULL, + udm_nudr_dr_build_query_subscription_provisioned, + udm_ue, stream, message)); break; CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)
View file
open5gs_2.4.8.202207240002.tar.xz/src/udr/sbi-path.c -> open5gs_2.4.8.202207250002.tar.xz/src/udr/sbi-path.c
Changed
@@ -79,9 +79,6 @@ ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_nf_service_t *service = NULL; - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) - return OGS_ERROR; - /* Add SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); @@ -116,6 +113,16 @@ } } + /* Timer expiration handler of client wait timer */ + ogs_sbi_self()->client_wait_expire = udr_timer_sbi_client_wait_expire; + + /* NF register state in NF state machine */ + ogs_sbi_self()->nf_state_registered = + (ogs_fsm_handler_t)udr_nf_state_registered; + + if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + return OGS_ERROR; + return OGS_OK; }
View file
open5gs_2.4.8.202207240002.tar.xz/src/udr/timer.c -> open5gs_2.4.8.202207250002.tar.xz/src/udr/timer.c
Changed
@@ -94,3 +94,8 @@ { sbi_timer_send_event(UDR_TIMER_SUBSCRIPTION_VALIDITY, data); } + +void udr_timer_sbi_client_wait_expire(void *data) +{ + sbi_timer_send_event(UDR_TIMER_SBI_CLIENT_WAIT, data); +}
View file
open5gs_2.4.8.202207240002.tar.xz/src/udr/timer.h -> open5gs_2.4.8.202207250002.tar.xz/src/udr/timer.h
Changed
@@ -35,6 +35,7 @@ UDR_TIMER_NF_INSTANCE_NO_HEARTBEAT, UDR_TIMER_NF_INSTANCE_VALIDITY, UDR_TIMER_SUBSCRIPTION_VALIDITY, + UDR_TIMER_SBI_CLIENT_WAIT, MAX_NUM_OF_UDR_TIMER, @@ -47,6 +48,7 @@ void udr_timer_nf_instance_no_heartbeat(void *data); void udr_timer_nf_instance_validity(void *data); void udr_timer_subscription_validity(void *data); +void udr_timer_sbi_client_wait_expire(void *data); #ifdef __cplusplus }
View file
open5gs_2.4.8.202207240002.tar.xz/tests/af/af-sm.c -> open5gs_2.4.8.202207250002.tar.xz/tests/af/af-sm.c
Changed
@@ -455,8 +455,8 @@ switch(e->local_id) { case AF_LOCAL_DISCOVER_AND_SEND: - af_sbi_discover_and_send(e->local.target_nf_type, - e->sess, e->local.data, e->local.build); + af_sbi_discover_and_send(e->local.target_nf_type, NULL, + e->local.build, e->sess, e->local.data); break; case AF_LOCAL_SEND_TO_PCF: af_sbi_send_to_pcf(e->sess, e->local.data, e->local.build);
View file
open5gs_2.4.8.202207240002.tar.xz/tests/af/context.c -> open5gs_2.4.8.202207250002.tar.xz/tests/af/context.c
Changed
@@ -262,14 +262,6 @@ pcf_app_session_id, strlen(pcf_app_session_id)); } -void af_sess_select_nf(af_sess_t *sess, OpenAPI_nf_type_e nf_type) -{ - ogs_assert(sess); - ogs_assert(nf_type); - - ogs_sbi_select_nf(&sess->sbi, nf_type, af_nf_state_registered); -} - static ogs_sbi_client_t *find_client_by_fqdn(char *fqdn, int port) { int rv;
View file
open5gs_2.4.8.202207240002.tar.xz/tests/af/context.h -> open5gs_2.4.8.202207250002.tar.xz/tests/af/context.h
Changed
@@ -113,8 +113,6 @@ af_sess_t *af_sess_find_by_af_app_session_id(char *af_app_session_id); af_sess_t *af_sess_find_by_pcf_app_session_id(char *pcf_app_session_id); -void af_sess_select_nf(af_sess_t *sess, OpenAPI_nf_type_e nf_type); - void af_sess_associate_pcf_client(af_sess_t *sess); #ifdef __cplusplus
View file
open5gs_2.4.8.202207240002.tar.xz/tests/af/nnrf-handler.c -> open5gs_2.4.8.202207250002.tar.xz/tests/af/nnrf-handler.c
Changed
@@ -257,16 +257,22 @@ ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg) { ogs_sbi_object_t *sbi_object = NULL; + OpenAPI_nf_type_e target_nf_type = 0; + ogs_sbi_discovery_option_t *discovery_option = NULL; ogs_sbi_nf_instance_t *nf_instance = NULL; OpenAPI_search_result_t *SearchResult = NULL; OpenAPI_lnode_t *node = NULL; bool handled; + ogs_assert(recvmsg); ogs_assert(xact); sbi_object = xact->sbi_object; ogs_assert(sbi_object); - ogs_assert(recvmsg); + target_nf_type = xact->target_nf_type; + ogs_assert(target_nf_type); + + discovery_option = xact->discovery_option; SearchResult = recvmsg->SearchResult; if (!SearchResult) { @@ -301,8 +307,6 @@ } if (NF_INSTANCE_IS_OTHERS(nf_instance->id)) { - af_sess_t *sess = NULL; - handled = ogs_sbi_nnrf_handle_nf_profile( nf_instance, NFProfile, NULL, NULL); if (!handled) { @@ -319,10 +323,6 @@ continue; } - sess = (af_sess_t *)sbi_object; - ogs_assert(sess); - af_sess_select_nf(sess, nf_instance->nf_type); - /* TIME : Update validity from NRF */ if (SearchResult->validity_period) { nf_instance->time.validity_duration = @@ -340,12 +340,7 @@ } } - ogs_assert(xact->target_nf_type); - nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, xact->target_nf_type); - if (!nf_instance) { - ogs_error("(NF discover) No %s", - OpenAPI_nf_type_ToString(xact->target_nf_type)); - } else { - af_sbi_send(nf_instance, xact); - } + ogs_sbi_select_nf(sbi_object, target_nf_type, discovery_option); + + ogs_expect(true == af_sbi_send_request(sbi_object, target_nf_type, xact)); }
View file
open5gs_2.4.8.202207240002.tar.xz/tests/af/sbi-path.c -> open5gs_2.4.8.202207250002.tar.xz/tests/af/sbi-path.c
Changed
@@ -79,9 +79,6 @@ ogs_sbi_nf_instance_t *nf_instance = NULL; ogs_sbi_nf_service_t *service = NULL; - if (ogs_sbi_server_start_all(server_cb) != OGS_OK) - return OGS_ERROR; - /* Add SELF NF instance */ nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); @@ -112,6 +109,17 @@ } } + /* Timer expiration handler of client wait timer */ + ogs_sbi_self()->client_wait_expire = af_timer_sbi_client_wait_expire; + + /* NF register state in NF state machine */ + ogs_sbi_self()->nf_state_registered = + (ogs_fsm_handler_t)af_nf_state_registered; + + if (ogs_sbi_server_start_all(server_cb) != OGS_OK) + return OGS_ERROR; + + return OGS_OK; } @@ -136,32 +144,53 @@ client, client->cb, request, nf_instance); } -void af_sbi_send(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact) +bool af_sbi_send_request( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + void *data) { - ogs_sbi_send(nf_instance, client_cb, xact); + ogs_sbi_nf_instance_t *nf_instance = NULL; + + nf_instance = OGS_SBI_NF_INSTANCE(sbi_object, target_nf_type); + if (!nf_instance) { + ogs_error("(NF discover) No %s", + OpenAPI_nf_type_ToString(target_nf_type)); + return false; + } + + return ogs_sbi_send_request(nf_instance, client_cb, data); } -void af_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - af_sess_t *sess, void *data, - ogs_sbi_request_t *(*build)(af_sess_t *sess, void *data)) +void af_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(af_sess_t *sess, void *data), + af_sess_t *sess, void *data) { ogs_sbi_xact_t *xact = NULL; + OpenAPI_nf_type_e requester_nf_type = OpenAPI_nf_type_NULL; + + ogs_assert(ogs_sbi_self()->nf_instance); + requester_nf_type = ogs_sbi_self()->nf_instance->nf_type; + ogs_assert(requester_nf_type); ogs_assert(target_nf_type); ogs_assert(sess); ogs_assert(build); - xact = ogs_sbi_xact_add(target_nf_type, &sess->sbi, - (ogs_sbi_build_f)build, sess, data, - af_timer_sbi_client_wait_expire); + xact = ogs_sbi_xact_add( + &sess->sbi, target_nf_type, discovery_option, + (ogs_sbi_build_f)build, sess, data); if (!xact) { ogs_error("af_sbi_discover_and_send() failed"); return; } - if (ogs_sbi_discover_and_send(xact, - (ogs_fsm_handler_t)af_nf_state_registered, client_cb) != true) { + if (ogs_sbi_discover_and_send( + &sess->sbi, + target_nf_type, requester_nf_type, discovery_option, + client_cb, xact) != true) { ogs_error("af_sbi_discover_and_send() failed"); return; }
View file
open5gs_2.4.8.202207240002.tar.xz/tests/af/sbi-path.h -> open5gs_2.4.8.202207250002.tar.xz/tests/af/sbi-path.h
Changed
@@ -33,11 +33,15 @@ bool af_nnrf_nfm_send_nf_register(ogs_sbi_nf_instance_t *nf_instance); -void af_sbi_send(ogs_sbi_nf_instance_t *nf_instance, ogs_sbi_xact_t *xact); - -void af_sbi_discover_and_send(OpenAPI_nf_type_e target_nf_type, - af_sess_t *sess, void *data, - ogs_sbi_request_t *(*build)(af_sess_t *sess, void *data)); +bool af_sbi_send_request( + ogs_sbi_object_t *sbi_object, + OpenAPI_nf_type_e target_nf_type, + void *data); +void af_sbi_discover_and_send( + OpenAPI_nf_type_e target_nf_type, + ogs_sbi_discovery_option_t *discovery_option, + ogs_sbi_request_t *(*build)(af_sess_t *sess, void *data), + af_sess_t *sess, void *data); void af_sbi_send_to_pcf( af_sess_t *sess, void *data,
View file
open5gs_2.4.8.202207240002.tar.xz/tests/app/5gc-init.c -> open5gs_2.4.8.202207250002.tar.xz/tests/app/5gc-init.c
Changed
@@ -101,8 +101,8 @@ if (udm_thread) ogs_thread_destroy(udm_thread); if (ausf_thread) ogs_thread_destroy(ausf_thread); - if (nrf_thread) ogs_thread_destroy(nrf_thread); if (scp_thread) ogs_thread_destroy(scp_thread); + if (nrf_thread) ogs_thread_destroy(nrf_thread); } void test_5gc_init(void)
View file
open5gs_2.4.8.202207240002.tar.xz/tests/app/app-init.c -> open5gs_2.4.8.202207250002.tar.xz/tests/app/app-init.c
Changed
@@ -123,8 +123,9 @@ if (hss_thread) ogs_thread_destroy(hss_thread); if (pcrf_thread) ogs_thread_destroy(pcrf_thread); - if (nrf_thread) ogs_thread_destroy(nrf_thread); + if (scp_thread) ogs_thread_destroy(scp_thread); + if (nrf_thread) ogs_thread_destroy(nrf_thread); } void test_app_init(void)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.