From 57f1f2c21ade61af50d4dc7f0dd7b23e09aef2b9 Mon Sep 17 00:00:00 2001 From: Sukchan Lee Date: Fri, 18 Nov 2022 23:28:35 +0900 Subject: [PATCH] Fixed crash after 48 hours of running (#1893) --- debian/changelog | 20 +++--- docker/README.md | 1 - docs/_posts/2022-10-01-release-v2.4.11.md | 33 --------- ....4.10.md => 2022-11-18-release-v2.4.12.md} | 21 +++++- ...v2.5.5.md => 2022-11-18-release-v2.5.6.md} | 6 +- docs/assets/webui/install | 2 +- lib/sbi/context.c | 71 +++++++++++++------ lib/sbi/context.h | 19 ++++- lib/sbi/nf-sm.c | 11 +-- lib/sbi/nnrf-path.c | 14 +++- lib/sbi/nnrf-path.h | 4 +- meson.build | 4 +- src/amf/amf-sm.c | 6 +- src/amf/sbi-path.c | 14 ++-- src/ausf/ausf-sm.c | 6 +- src/ausf/sbi-path.c | 4 +- src/bsf/bsf-sm.c | 6 +- src/nssf/nssf-sm.c | 6 +- src/pcf/pcf-sm.c | 6 +- src/pcf/sbi-path.c | 6 +- src/scp/sbi-path.c | 18 ++--- src/scp/scp-sm.c | 6 +- src/smf/sbi-path.c | 8 +-- src/smf/smf-sm.c | 6 +- src/udm/sbi-path.c | 4 +- src/udm/udm-sm.c | 6 +- src/udr/udr-sm.c | 6 +- tests/af/af-sm.c | 6 +- tests/af/sbi-path.c | 4 +- webui/package-lock.json | 4 +- webui/package.json | 2 +- 31 files changed, 207 insertions(+), 123 deletions(-) delete mode 100644 docs/_posts/2022-10-01-release-v2.4.11.md rename docs/_posts/{2022-09-09-release-v2.4.10.md => 2022-11-18-release-v2.4.12.md} (63%) rename docs/_posts/{2022-11-04-release-v2.5.5.md => 2022-11-18-release-v2.5.6.md} (90%) diff --git a/debian/changelog b/debian/changelog index 15b2dc152..dbb8314df 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,32 +1,32 @@ -open5gs (2.5.5) unstable; urgency=medium +open5gs (2.5.6) unstable; urgency=medium * New NF - SCP(Service Communication Proxy) - -- Sukchan Lee Fri, 04 Nov 2022 20:32:51 +0900 + -- Sukchan Lee Fri, 18 Nov 2022 23:24:32 +0900 -open5gs (2.5.5~kinetic) kinetic; urgency=medium +open5gs (2.5.6~jammy5) jammy; urgency=medium * New NF - SCP(Service Communication Proxy) - -- Sukchan Lee Fri, 04 Nov 2022 20:31:19 +0900 + -- Sukchan Lee Fri, 18 Nov 2022 23:23:07 +0900 -open5gs (2.5.5~jammy) jammy; urgency=medium +open5gs (2.5.6~kinetic3) kinetic; urgency=medium * New NF - SCP(Service Communication Proxy) - -- Sukchan Lee Fri, 04 Nov 2022 20:29:55 +0900 + -- Sukchan Lee Fri, 18 Nov 2022 23:21:16 +0900 -open5gs (2.5.5~focal) focal; urgency=medium +open5gs (2.5.6~bionic3) bionic; urgency=medium * New NF - SCP(Service Communication Proxy) - -- Sukchan Lee Fri, 04 Nov 2022 20:28:28 +0900 + -- Sukchan Lee Fri, 18 Nov 2022 23:18:33 +0900 -open5gs (2.5.5~bionic) bionic; urgency=medium +open5gs (2.5.6~focal3) focal; urgency=medium * New NF - SCP(Service Communication Proxy) - -- Sukchan Lee Fri, 04 Nov 2022 20:26:31 +0900 + -- Sukchan Lee Fri, 18 Nov 2022 23:17:05 +0900 open5gs (2.4.11) unstable; urgency=medium diff --git a/docker/README.md b/docker/README.md index 7c6c843f0..4b7793495 100644 --- a/docker/README.md +++ b/docker/README.md @@ -81,7 +81,6 @@ export DEBEMAIL='acetcom@gmail.com' ``` $ cat ./meson.build - $ cat ./docker/webui/Dockerfile $ cat ./webui/package.json $ cat ./webui/package-lock.json $ cat ./docs/assets/webui/install diff --git a/docs/_posts/2022-10-01-release-v2.4.11.md b/docs/_posts/2022-10-01-release-v2.4.11.md deleted file mode 100644 index 0c15cabc6..000000000 --- a/docs/_posts/2022-10-01-release-v2.4.11.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: "v2.4.11 - Bug Fixes (critical: session deletion)" -date: 2022-10-01 09:43:00 +0900 -categories: - - Release -tags: - - News - - Release -head_inline: "" ---- - -#### Bug Fixes -- [5GC] Session deletion was not properly worked in BSF([#1725](https://github.com/open5gs/open5gs/issues/1725)) -- [prasenjitpdas](https://github.com/prasenjitpdas) -- [AMF] In deregistration state, we use an invalid state-machine pointer. ([#1805](https://github.com/open5gs/open5gs/pull/1805)) -- [bmeglicit](https://github.com/bmeglicit) -- [SGWC] Fixed crash because session context could be deleted before response message is not received from SMF ([#1765](https://github.com/open5gs/open5gs/issues/1765)) -- [dai9000](https://github.com/dai9000) -- [SMF] Wait for both N1&N2 release signals before releasing session ([#1753](https://github.com/open5gs/open5gs/pull/1753)) -- [bmeglicit](https://github.com/bmeglicit) -- [UPF] UL and DL URR usage Report was swapped ([#1793](https://github.com/open5gs/open5gs/issues/1793)) -- [dibasdas02](https://github.com/dibasdas02) -- [CORE] Fixed timer overflow on 32bit systems ([#1770](https://github.com/open5gs/open5gs/pull/1770)) -- [spencersevilla](https://github.com/spencersevilla) - -#### Enhancements -- [MME] Added protection code if no PDN-Type ([#1756](https://github.com/open5gs/open5gs/pull/1756)) -- [yar-or81](https://github.com/yar-or81) -- [Metric] Move metrics configuration section under respective ([#1754](https://github.com/open5gs/open5gs/pull/1754)) -- [bmeglicit](https://github.com/bmeglicit) -- [Diameter] Enable Change Streams ([#1758](https://github.com/open5gs/open5gs/pull/1758)) -- [jmasterfunk84](https://github.com/jmasterfunk84) -- [AMF] Added amfInfoList to NFProfile ([#1757](https://github.com/open5gs/open5gs/pull/1757)) -- [gstaa](https://github.com/gstaa) -- [TLV] Acceptable even if the TLV length is smaller than expected ([#1780](https://github.com/open5gs/open5gs/discussions/1780)) -- [infinitydon](https://github.com/infinitydon) -- [Diameter] Introduce Cancel Location and Insert Subscription Data ([#1744](https://github.com/open5gs/open5gs/pull/1744)) -- [jmasterfunk84](https://github.com/jmasterfunk84) - -#### Security Issues -- [SBI] Fixed HTTP2 crash from random JSON data ([#1679](https://github.com/open5gs/open5gs/issues/1679)) -- [Popvlvs](https://github.com/Popvlvs) -- [TLV] UPF crashes after UDP port scan ([#1767](https://github.com/open5gs/open5gs/issues/1767)) -- [Popvlvs](https://github.com/Popvlvs) - -Download -- [v2.4.11.tar.gz](https://github.com/open5gs/open5gs/archive/v2.4.11.tar.gz) -{: .notice--info} diff --git a/docs/_posts/2022-09-09-release-v2.4.10.md b/docs/_posts/2022-11-18-release-v2.4.12.md similarity index 63% rename from docs/_posts/2022-09-09-release-v2.4.10.md rename to docs/_posts/2022-11-18-release-v2.4.12.md index 32b54081b..d6f50400c 100644 --- a/docs/_posts/2022-09-09-release-v2.4.10.md +++ b/docs/_posts/2022-11-18-release-v2.4.12.md @@ -1,6 +1,6 @@ --- -title: "v2.4.10 - Service-name based NF Discovery" -date: 2022-09-09 09:43:00 +0900 +title: "v2.4.12 - Service-name based NF Discovery" +date: 2022-11-18 22:00:00 +0900 categories: - Release tags: @@ -9,6 +9,7 @@ tags: head_inline: "" --- + #### New Features - [CONF] Service-name based NF Discovery -- [f020732](https://github.com/open5gs/open5gs/commit/f020732ce9f60217dfcd0b7e9ba5c8949db966d5), [9f98d42](https://github.com/open5gs/open5gs/commit/9f98d421a081a5edc3a525d1cf2504b8b6cf059e), [5295c10](https://github.com/open5gs/open5gs/commit/5295c108adc2fc5ae97ee5007760334ef7a6297b) @@ -16,9 +17,17 @@ head_inline: " - [SBI] Move state machine from src to lib directory -- [e6a14cb](https://github.com/open5gs/open5gs/commit/e6a14cb73debbdc21e91499b75dde3d71a5aa02b) - [SBI] Increased the MAX stream number from UE * 16 -- [db37bc8](https://github.com/open5gs/open5gs/commit/db37bc894459df38661bdf98891938ec3513bc72), [ec9fe7b](https://github.com/open5gs/open5gs/commit/ec9fe7b31d0253003244be498e8f963da63e7657), [603a746](https://github.com/open5gs/open5gs/commit/603a746f49c68b06ab5d8b3ceeca3afde987cab5) - [Diameter] Improve S6A interface ([#1676](https://github.com/open5gs/open5gs/pull/1676), [#1698](https://github.com/open5gs/open5gs/pull/1698), [#1714](https://github.com/open5gs/open5gs/pull/1714)) -- [jmasterfunk84](https://github.com/jmasterfunk84) +- [MME] Added protection code if no PDN-Type ([#1756](https://github.com/open5gs/open5gs/pull/1756)) -- [yar-or81](https://github.com/yar-or81) +- [Metric] Move metrics configuration section under respective ([#1754](https://github.com/open5gs/open5gs/pull/1754)) -- [bmeglicit](https://github.com/bmeglicit) +- [Diameter] Enable Change Streams ([#1758](https://github.com/open5gs/open5gs/pull/1758)) -- [jmasterfunk84](https://github.com/jmasterfunk84) +- [AMF] Added amfInfoList to NFProfile ([#1757](https://github.com/open5gs/open5gs/pull/1757)) -- [gstaa](https://github.com/gstaa) +- [TLV] Acceptable even if the TLV length is smaller than expected ([#1780](https://github.com/open5gs/open5gs/discussions/1780)) -- [infinitydon](https://github.com/infinitydon) +- [Diameter] Introduce Cancel Location and Insert Subscription Data ([#1744](https://github.com/open5gs/open5gs/pull/1744)) -- [jmasterfunk84](https://github.com/jmasterfunk84) #### Security Issues - [PFCP] Fixed security protection -- [CVE-2022-39063](https://cve.report/CVE-2022-39063), [d99491a](https://github.com/open5gs/open5gs/commit/d99491aca5304460d3929b37bf26e064efd86686), [444e182](https://github.com/open5gs/open5gs/commit/444e1822887a78d3c3ef1f0bcaad9ee10ac951c3) +- [SBI] Fixed HTTP2 crash from random JSON data ([#1679](https://github.com/open5gs/open5gs/issues/1679)) -- [Popvlvs](https://github.com/Popvlvs) +- [TLV] UPF crashes after UDP port scan ([#1767](https://github.com/open5gs/open5gs/issues/1767)) -- [Popvlvs](https://github.com/Popvlvs) #### Bug Fixes - [SBI] Fixed memory leak and CPU usage 100% -- [7231daf](https://github.com/open5gs/open5gs/commit/7231dafbf12c2009ec6fe740686342e2c5d245a2), [c716a12](https://github.com/open5gs/open5gs/commit/c716a1294a6120f4100ba2efa9039f6168d74ce7) @@ -27,6 +36,12 @@ head_inline: " - [SMF] Fixed abort on app exit when no diameter configuration -- ([#1710](https://github.com/open5gs/open5gs/issues/1710)) -- [bmeglicit](https://github.com/bmeglicit) - [MME] Fixed crash on sending SMS between UEs -- ([#1701](https://github.com/open5gs/open5gs/issues/1701)) -- [salibeh](https://github.com/salibeh) - [MME] Fixed GTP transaction crash if it has already been removed during paging-- ([#1696](https://github.com/open5gs/open5gs/issues/1696)) -- [vsbc2010](https://github.com/vsbc2010) +- [5GC] Session deletion was not properly worked in BSF([#1725](https://github.com/open5gs/open5gs/issues/1725)) -- [prasenjitpdas](https://github.com/prasenjitpdas) +- [AMF] In deregistration state, we use an invalid state-machine pointer. ([#1805](https://github.com/open5gs/open5gs/pull/1805)) -- [bmeglicit](https://github.com/bmeglicit) +- [SGWC] Fixed crash because session context could be deleted before response message is not received from SMF ([#1765](https://github.com/open5gs/open5gs/issues/1765)) -- [dai9000](https://github.com/dai9000) +- [SMF] Wait for both N1&N2 release signals before releasing session ([#1753](https://github.com/open5gs/open5gs/pull/1753)) -- [bmeglicit](https://github.com/bmeglicit) +- [UPF] UL and DL URR usage Report was swapped ([#1793](https://github.com/open5gs/open5gs/issues/1793)) -- [dibasdas02](https://github.com/dibasdas02) +- [CORE] Fixed timer overflow on 32bit systems ([#1770](https://github.com/open5gs/open5gs/pull/1770)) -- [spencersevilla](https://github.com/spencersevilla) #### Specification Compliance - [5GC] Handle APN/DNN names as case-insensitive ([#1747](https://github.com/open5gs/open5gs/pull/1747)) -- [jmasterfunk84](https://github.com/jmasterfunk84) @@ -39,5 +54,5 @@ head_inline: " - [Diameter] Fixed the path of Nnrf_NFManagement Service ([#1683](https://github.com/open5gs/open5gs/issues/1683)) -- [s5uishida](https://github.com/s5uishida) - [Diameter] Fixed AVP Occurring Too Many Times ([#1680](https://github.com/open5gs/open5gs/pull/1680)) -- [jmasterfunk84](https://github.com/jmasterfunk84) -Download -- [v2.4.10.tar.gz](https://github.com/open5gs/open5gs/archive/v2.4.10.tar.gz) +Download -- [v2.4.12.tar.gz](https://github.com/open5gs/open5gs/archive/v2.4.12.tar.gz) {: .notice--info} diff --git a/docs/_posts/2022-11-04-release-v2.5.5.md b/docs/_posts/2022-11-18-release-v2.5.6.md similarity index 90% rename from docs/_posts/2022-11-04-release-v2.5.5.md rename to docs/_posts/2022-11-18-release-v2.5.6.md index 42454325d..ceb1f9c1d 100644 --- a/docs/_posts/2022-11-04-release-v2.5.5.md +++ b/docs/_posts/2022-11-18-release-v2.5.6.md @@ -1,6 +1,6 @@ --- -title: "v2.5.5 - SCP for Indirect Communication" -date: 2022-11-04 20:37:00 +0900 +title: "v2.5.6 - SCP for Indirect Communication" +date: 2022-11-18 22:59:00 +0900 categories: - Release tags: @@ -85,6 +85,8 @@ scp: - [MME] Support for Insert Subscriber Data ([#1794](https://github.com/open5gs/open5gs/pull/1794)) -- [jmasterfunk84](https://github.com/jmasterfunk84) #### Bug Fixes +- [AMD] Added implicit_unsubscribe field to SDMSubscription ([#1884](https://github.com/open5gs/open5gs/pull/1884)) -- [bmeglicit](https://github.com/bmeglicit) +- [SMF] Fixed PTI when PDU Session Reject -- [ddf09f2](https://github.com/open5gs/open5gs/commit/ddf09f270aaaaae67ac9ec1c157b4b28f1c90d10) - [SBI] Do not send empty arrays in NRF/PCF ([#1876](https://github.com/open5gs/open5gs/pull/1876)) -- [bmeglicit](https://github.com/bmeglicit) - [SGW-C] Fixed the bug of SGW-C session deletion ([#1825](https://github.com/open5gs/open5gs/pull/1825)) -- [dai9000](https://github.com/dai9000), [cmmacneill53](https://github.com/cmmacneill53) - [AMF] Reject registration requests when pool for UE context is empty ([#1828](https://github.com/open5gs/open5gs/pull/1828)) -- [bmeglicit](https://github.com/bmeglicit) diff --git a/docs/assets/webui/install b/docs/assets/webui/install index 974a329de..715009a87 100644 --- a/docs/assets/webui/install +++ b/docs/assets/webui/install @@ -10,7 +10,7 @@ # PACKAGE="open5gs" -VERSION="2.5.5" +VERSION="2.5.6" print_status() { echo diff --git a/lib/sbi/context.c b/lib/sbi/context.c index 791c6ad1e..79d9dc67b 100644 --- a/lib/sbi/context.c +++ b/lib/sbi/context.c @@ -26,6 +26,7 @@ static int context_initialized = 0; static OGS_POOL(nf_instance_pool, ogs_sbi_nf_instance_t); static OGS_POOL(nf_service_pool, ogs_sbi_nf_service_t); static OGS_POOL(xact_pool, ogs_sbi_xact_t); +static OGS_POOL(subscription_spec_pool, ogs_sbi_subscription_spec_t); static OGS_POOL(subscription_data_pool, ogs_sbi_subscription_data_t); static OGS_POOL(smf_info_pool, ogs_sbi_smf_info_t); static OGS_POOL(nf_info_pool, ogs_sbi_nf_info_t); @@ -51,6 +52,9 @@ void ogs_sbi_context_init(void) ogs_pool_init(&xact_pool, ogs_app()->pool.xact); + ogs_list_init(&self.subscription_spec_list); + ogs_pool_init(&subscription_spec_pool, ogs_app()->pool.subscription); + ogs_list_init(&self.subscription_data_list); ogs_pool_init(&subscription_data_pool, ogs_app()->pool.subscription); @@ -86,6 +90,9 @@ void ogs_sbi_context_final(void) ogs_sbi_subscription_data_remove_all(); ogs_pool_final(&subscription_data_pool); + ogs_sbi_subscription_spec_remove_all(); + ogs_pool_final(&subscription_spec_pool); + ogs_pool_final(&xact_pool); ogs_sbi_nf_instance_remove_all(); @@ -1717,6 +1724,49 @@ ogs_sbi_xact_t *ogs_sbi_xact_cycle(ogs_sbi_xact_t *xact) return ogs_pool_cycle(&xact_pool, xact); } +ogs_sbi_subscription_spec_t *ogs_sbi_subscription_spec_add( + OpenAPI_nf_type_e nf_type, const char *service_name) +{ + ogs_sbi_subscription_spec_t *subscription_spec = NULL; + + ogs_assert(nf_type); + + ogs_pool_alloc(&subscription_spec_pool, &subscription_spec); + ogs_assert(subscription_spec); + memset(subscription_spec, 0, sizeof(ogs_sbi_subscription_spec_t)); + + subscription_spec->subscr_cond.nf_type = nf_type; + if (service_name) + subscription_spec->subscr_cond.service_name = ogs_strdup(service_name); + + ogs_list_add(&ogs_sbi_self()->subscription_spec_list, subscription_spec); + + return subscription_spec; +} + +void ogs_sbi_subscription_spec_remove( + ogs_sbi_subscription_spec_t *subscription_spec) +{ + ogs_assert(subscription_spec); + + ogs_list_remove(&ogs_sbi_self()->subscription_spec_list, subscription_spec); + + if (subscription_spec->subscr_cond.service_name) + ogs_free(subscription_spec->subscr_cond.service_name); + + ogs_pool_free(&subscription_spec_pool, subscription_spec); +} + +void ogs_sbi_subscription_spec_remove_all(void) +{ + ogs_sbi_subscription_spec_t *subscription_spec = NULL; + ogs_sbi_subscription_spec_t *next_subscription_spec = NULL; + + ogs_list_for_each_safe(&ogs_sbi_self()->subscription_spec_list, + next_subscription_spec, subscription_spec) + ogs_sbi_subscription_spec_remove(subscription_spec); +} + ogs_sbi_subscription_data_t *ogs_sbi_subscription_data_add(void) { ogs_sbi_subscription_data_t *subscription_data = NULL; @@ -1814,24 +1864,3 @@ ogs_sbi_subscription_data_t *ogs_sbi_subscription_data_find(char *id) return subscription_data; } - -void ogs_sbi_subscription_data_build_default( - OpenAPI_nf_type_e nf_type, const char *service_name) -{ - ogs_sbi_subscription_data_t *subscription_data = NULL; - - ogs_assert(nf_type); - - subscription_data = ogs_sbi_subscription_data_add(); - ogs_assert(subscription_data); - - subscription_data->req_nf_type = - NF_INSTANCE_TYPE(ogs_sbi_self()->nf_instance); - ogs_assert(subscription_data->req_nf_type); - if (NF_INSTANCE_ID(ogs_sbi_self()->nf_instance)) - subscription_data->req_nf_instance_id = - ogs_strdup(NF_INSTANCE_ID(ogs_sbi_self()->nf_instance)); - subscription_data->subscr_cond.nf_type = nf_type; - if (service_name) - subscription_data->subscr_cond.service_name = ogs_strdup(service_name); -} diff --git a/lib/sbi/context.h b/lib/sbi/context.h index 24a48991d..40db75ff5 100644 --- a/lib/sbi/context.h +++ b/lib/sbi/context.h @@ -57,6 +57,7 @@ typedef struct ogs_sbi_context_s { ogs_uuid_t uuid; ogs_list_t nf_instance_list; + ogs_list_t subscription_spec_list; ogs_list_t subscription_data_list; ogs_sbi_nf_instance_t *nf_instance; /* SELF NF Instance */ @@ -208,6 +209,16 @@ typedef struct ogs_sbi_nf_service_s { void *client; } ogs_sbi_nf_service_t; +typedef struct ogs_sbi_subscription_spec_s { + ogs_lnode_t lnode; + + struct { + OpenAPI_nf_type_e nf_type; /* nfType */ + char *service_name; /* ServiceName */ + } subscr_cond; + +} ogs_sbi_subscription_spec_t; + typedef struct ogs_sbi_subscription_data_s { ogs_lnode_t lnode; @@ -400,6 +411,12 @@ 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); +ogs_sbi_subscription_spec_t *ogs_sbi_subscription_spec_add( + OpenAPI_nf_type_e nf_type, const char *service_name); +void ogs_sbi_subscription_spec_remove( + ogs_sbi_subscription_spec_t *subscription_spec); +void ogs_sbi_subscription_spec_remove_all(void); + ogs_sbi_subscription_data_t *ogs_sbi_subscription_data_add(void); void ogs_sbi_subscription_data_set_id( ogs_sbi_subscription_data_t *subscription_data, char *id); @@ -409,8 +426,6 @@ void ogs_sbi_subscription_data_remove_all_by_nf_instance_id( char *nf_instance_id); void ogs_sbi_subscription_data_remove_all(void); ogs_sbi_subscription_data_t *ogs_sbi_subscription_data_find(char *id); -void ogs_sbi_subscription_data_build_default( - OpenAPI_nf_type_e nf_type, const char *service_name); #ifdef __cplusplus } diff --git a/lib/sbi/nf-sm.c b/lib/sbi/nf-sm.c index f52539b41..cd83bee24 100644 --- a/lib/sbi/nf-sm.c +++ b/lib/sbi/nf-sm.c @@ -209,7 +209,7 @@ void ogs_sbi_nf_state_registered(ogs_fsm_t *s, ogs_event_t *e) switch (e->id) { case OGS_FSM_ENTRY_SIG: if (NF_INSTANCE_TYPE_IS_NRF(nf_instance)) { - ogs_sbi_subscription_data_t *subscription_data = NULL; + ogs_sbi_subscription_spec_t *subscription_spec = NULL; ogs_info("[%s] NF registered [Heartbeat:%ds]", NF_INSTANCE_ID(ogs_sbi_self()->nf_instance), @@ -225,9 +225,12 @@ void ogs_sbi_nf_state_registered(ogs_fsm_t *s, ogs_event_t *e) } ogs_list_for_each( - &ogs_sbi_self()->subscription_data_list, subscription_data) { - ogs_assert(true == - ogs_nnrf_nfm_send_nf_status_subscribe(subscription_data)); + &ogs_sbi_self()->subscription_spec_list, subscription_spec) { + ogs_nnrf_nfm_send_nf_status_subscribe( + ogs_sbi_self()->nf_instance->nf_type, + ogs_sbi_self()->nf_instance->id, + subscription_spec->subscr_cond.nf_type, + subscription_spec->subscr_cond.service_name); } } break; diff --git a/lib/sbi/nnrf-path.c b/lib/sbi/nnrf-path.c index 2d4fe4f63..8bdfc31a5 100644 --- a/lib/sbi/nnrf-path.c +++ b/lib/sbi/nnrf-path.c @@ -86,13 +86,25 @@ bool ogs_nnrf_nfm_send_nf_de_register(ogs_sbi_nf_instance_t *nf_instance) } bool ogs_nnrf_nfm_send_nf_status_subscribe( - ogs_sbi_subscription_data_t *subscription_data) + OpenAPI_nf_type_e req_nf_type, char *req_nf_instance_id, + OpenAPI_nf_type_e subscr_cond_nf_type, + char *subscr_cond_service_name) { bool rc; ogs_sbi_request_t *request = NULL; + ogs_sbi_subscription_data_t *subscription_data = NULL; + subscription_data = ogs_sbi_subscription_data_add(); ogs_assert(subscription_data); + subscription_data->req_nf_type = req_nf_type; + if (req_nf_instance_id) + subscription_data->req_nf_instance_id = ogs_strdup(req_nf_instance_id); + subscription_data->subscr_cond.nf_type = subscr_cond_nf_type; + if (subscr_cond_service_name) + subscription_data->subscr_cond.service_name = + ogs_strdup(subscr_cond_service_name); + request = ogs_nnrf_nfm_build_status_subscribe(subscription_data); if (!request) { ogs_error("No Request"); diff --git a/lib/sbi/nnrf-path.h b/lib/sbi/nnrf-path.h index 869eaf660..3186c6431 100644 --- a/lib/sbi/nnrf-path.h +++ b/lib/sbi/nnrf-path.h @@ -30,7 +30,9 @@ bool ogs_nnrf_nfm_send_nf_register(ogs_sbi_nf_instance_t *nf_instance); bool ogs_nnrf_nfm_send_nf_update(ogs_sbi_nf_instance_t *nf_instance); bool ogs_nnrf_nfm_send_nf_de_register(ogs_sbi_nf_instance_t *nf_instance); bool ogs_nnrf_nfm_send_nf_status_subscribe( - ogs_sbi_subscription_data_t *subscription_data); + OpenAPI_nf_type_e req_nf_type, char *req_nf_instance_id, + OpenAPI_nf_type_e subscr_cond_nf_type, + char *subscr_cond_service_name); bool ogs_nnrf_nfm_send_nf_status_unsubscribe( ogs_sbi_subscription_data_t *subscription_data); diff --git a/meson.build b/meson.build index f9177e4ce..8540c3119 100644 --- a/meson.build +++ b/meson.build @@ -16,7 +16,7 @@ # along with this program. If not, see . project('open5gs', 'c', 'cpp', - version : '2.5.5', + version : '2.5.6', license : 'AGPL-3.0-or-later', meson_version : '>= 0.43.0', default_options : [ @@ -24,7 +24,7 @@ project('open5gs', 'c', 'cpp', ], ) -libogslib_version = '2.5.5' +libogslib_version = '2.5.6' prefix = get_option('prefix') bindir = join_paths(prefix, get_option('bindir')) diff --git a/src/amf/amf-sm.c b/src/amf/amf-sm.c index 3c751112e..57c455c48 100644 --- a/src/amf/amf-sm.c +++ b/src/amf/amf-sm.c @@ -579,7 +579,11 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e) ogs_assert(subscription_data); ogs_assert(true == - ogs_nnrf_nfm_send_nf_status_subscribe(subscription_data)); + ogs_nnrf_nfm_send_nf_status_subscribe( + ogs_sbi_self()->nf_instance->nf_type, + subscription_data->req_nf_instance_id, + subscription_data->subscr_cond.nf_type, + subscription_data->subscr_cond.service_name)); ogs_info("Subscription validity expired [%s]", subscription_data->id); diff --git a/src/amf/sbi-path.c b/src/amf/sbi-path.c index dc8c78720..d8de0a57a 100644 --- a/src/amf/sbi-path.c +++ b/src/amf/sbi-path.c @@ -52,18 +52,18 @@ int amf_sbi_open(void) if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); - /* Build Subscription-Data */ - ogs_sbi_subscription_data_build_default( + /* Setup Subscription-Data */ + ogs_sbi_subscription_spec_add( OpenAPI_nf_type_AUSF, OGS_SBI_SERVICE_NAME_NAUSF_AUTH); - ogs_sbi_subscription_data_build_default( + ogs_sbi_subscription_spec_add( OpenAPI_nf_type_UDM, OGS_SBI_SERVICE_NAME_NUDM_UECM); - ogs_sbi_subscription_data_build_default( + ogs_sbi_subscription_spec_add( OpenAPI_nf_type_UDM, OGS_SBI_SERVICE_NAME_NUDM_SDM); - ogs_sbi_subscription_data_build_default( + ogs_sbi_subscription_spec_add( OpenAPI_nf_type_PCF, OGS_SBI_SERVICE_NAME_NPCF_AM_POLICY_CONTROL); - ogs_sbi_subscription_data_build_default( + ogs_sbi_subscription_spec_add( OpenAPI_nf_type_SMF, OGS_SBI_SERVICE_NAME_NSMF_PDUSESSION); - ogs_sbi_subscription_data_build_default( + ogs_sbi_subscription_spec_add( OpenAPI_nf_type_NSSF, OGS_SBI_SERVICE_NAME_NNSSF_NSSELECTION); if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) diff --git a/src/ausf/ausf-sm.c b/src/ausf/ausf-sm.c index 889bed1e9..439ba6c4c 100644 --- a/src/ausf/ausf-sm.c +++ b/src/ausf/ausf-sm.c @@ -343,7 +343,11 @@ void ausf_state_operational(ogs_fsm_t *s, ausf_event_t *e) ogs_assert(subscription_data); ogs_assert(true == - ogs_nnrf_nfm_send_nf_status_subscribe(subscription_data)); + ogs_nnrf_nfm_send_nf_status_subscribe( + ogs_sbi_self()->nf_instance->nf_type, + subscription_data->req_nf_instance_id, + subscription_data->subscr_cond.nf_type, + subscription_data->subscr_cond.service_name)); ogs_info("Subscription validity expired [%s]", subscription_data->id); diff --git a/src/ausf/sbi-path.c b/src/ausf/sbi-path.c index 552459abc..c1df8a04e 100644 --- a/src/ausf/sbi-path.c +++ b/src/ausf/sbi-path.c @@ -49,8 +49,8 @@ int ausf_sbi_open(void) if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); - /* Build Subscription-Data */ - ogs_sbi_subscription_data_build_default( + /* Setup Subscription-Data */ + ogs_sbi_subscription_spec_add( OpenAPI_nf_type_UDM, OGS_SBI_SERVICE_NAME_NUDM_UEAU); if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) diff --git a/src/bsf/bsf-sm.c b/src/bsf/bsf-sm.c index 95e8bf970..60a4843dd 100644 --- a/src/bsf/bsf-sm.c +++ b/src/bsf/bsf-sm.c @@ -328,7 +328,11 @@ void bsf_state_operational(ogs_fsm_t *s, bsf_event_t *e) ogs_assert(subscription_data); ogs_assert(true == - ogs_nnrf_nfm_send_nf_status_subscribe(subscription_data)); + ogs_nnrf_nfm_send_nf_status_subscribe( + ogs_sbi_self()->nf_instance->nf_type, + subscription_data->req_nf_instance_id, + subscription_data->subscr_cond.nf_type, + subscription_data->subscr_cond.service_name)); ogs_info("Subscription validity expired [%s]", subscription_data->id); diff --git a/src/nssf/nssf-sm.c b/src/nssf/nssf-sm.c index 002ca5471..0d997c82f 100644 --- a/src/nssf/nssf-sm.c +++ b/src/nssf/nssf-sm.c @@ -244,7 +244,11 @@ void nssf_state_operational(ogs_fsm_t *s, nssf_event_t *e) ogs_assert(subscription_data); ogs_assert(true == - ogs_nnrf_nfm_send_nf_status_subscribe(subscription_data)); + ogs_nnrf_nfm_send_nf_status_subscribe( + ogs_sbi_self()->nf_instance->nf_type, + subscription_data->req_nf_instance_id, + subscription_data->subscr_cond.nf_type, + subscription_data->subscr_cond.service_name)); ogs_info("Subscription validity expired [%s]", subscription_data->id); diff --git a/src/pcf/pcf-sm.c b/src/pcf/pcf-sm.c index 3944e8386..8586baa58 100644 --- a/src/pcf/pcf-sm.c +++ b/src/pcf/pcf-sm.c @@ -574,7 +574,11 @@ void pcf_state_operational(ogs_fsm_t *s, pcf_event_t *e) ogs_assert(subscription_data); ogs_assert(true == - ogs_nnrf_nfm_send_nf_status_subscribe(subscription_data)); + ogs_nnrf_nfm_send_nf_status_subscribe( + ogs_sbi_self()->nf_instance->nf_type, + subscription_data->req_nf_instance_id, + subscription_data->subscr_cond.nf_type, + subscription_data->subscr_cond.service_name)); ogs_info("[%s] Subscription validity expired", subscription_data->id); diff --git a/src/pcf/sbi-path.c b/src/pcf/sbi-path.c index 86604e226..c1e3cddb8 100644 --- a/src/pcf/sbi-path.c +++ b/src/pcf/sbi-path.c @@ -96,10 +96,10 @@ int pcf_sbi_open(void) if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); - /* Build Subscription-Data */ - ogs_sbi_subscription_data_build_default( + /* Setup Subscription-Data */ + ogs_sbi_subscription_spec_add( OpenAPI_nf_type_BSF, OGS_SBI_SERVICE_NAME_NBSF_MANAGEMENT); - ogs_sbi_subscription_data_build_default( + ogs_sbi_subscription_spec_add( OpenAPI_nf_type_UDR, OGS_SBI_SERVICE_NAME_NUDR_DR); if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) diff --git a/src/scp/sbi-path.c b/src/scp/sbi-path.c index c692b0d01..c72605104 100644 --- a/src/scp/sbi-path.c +++ b/src/scp/sbi-path.c @@ -69,15 +69,15 @@ int scp_sbi_open(void) /* If the SCP has an NRF client and does not delegate to Next-SCP */ if (nrf_client && !next_scp) { - /* Build Subscription-Data */ - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_AMF, NULL); - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_AUSF, NULL); - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_BSF, NULL); - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_NSSF, NULL); - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_PCF, NULL); - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_SMF, NULL); - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_UDM, NULL); - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_UDR, NULL); + /* Setup Subscription-Data */ + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_AMF, NULL); + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_AUSF, NULL); + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_BSF, NULL); + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_NSSF, NULL); + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_PCF, NULL); + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_SMF, NULL); + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_UDM, NULL); + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_UDR, NULL); } if (ogs_sbi_server_start_all(request_handler) != OGS_OK) diff --git a/src/scp/scp-sm.c b/src/scp/scp-sm.c index fba2a5a33..9fce3ea12 100644 --- a/src/scp/scp-sm.c +++ b/src/scp/scp-sm.c @@ -232,7 +232,11 @@ void scp_state_operational(ogs_fsm_t *s, scp_event_t *e) ogs_assert(subscription_data); ogs_assert(true == - ogs_nnrf_nfm_send_nf_status_subscribe(subscription_data)); + ogs_nnrf_nfm_send_nf_status_subscribe( + ogs_sbi_self()->nf_instance->nf_type, + subscription_data->req_nf_instance_id, + subscription_data->subscr_cond.nf_type, + subscription_data->subscr_cond.service_name)); ogs_info("Subscription validity expired [%s]", subscription_data->id); diff --git a/src/smf/sbi-path.c b/src/smf/sbi-path.c index 102a7b8ed..ea7aa2b42 100644 --- a/src/smf/sbi-path.c +++ b/src/smf/sbi-path.c @@ -60,12 +60,12 @@ int smf_sbi_open(void) if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); - /* Build Subscription-Data */ - ogs_sbi_subscription_data_build_default( + /* Setup Subscription-Data */ + ogs_sbi_subscription_spec_add( OpenAPI_nf_type_AMF, OGS_SBI_SERVICE_NAME_NAMF_COMM); - ogs_sbi_subscription_data_build_default( + ogs_sbi_subscription_spec_add( OpenAPI_nf_type_PCF, OGS_SBI_SERVICE_NAME_NPCF_SMPOLICYCONTROL); - ogs_sbi_subscription_data_build_default( + ogs_sbi_subscription_spec_add( OpenAPI_nf_type_UDM, OGS_SBI_SERVICE_NAME_NUDM_SDM); if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) diff --git a/src/smf/smf-sm.c b/src/smf/smf-sm.c index c2980fe7e..e088028a2 100644 --- a/src/smf/smf-sm.c +++ b/src/smf/smf-sm.c @@ -810,7 +810,11 @@ void smf_state_operational(ogs_fsm_t *s, smf_event_t *e) ogs_assert(subscription_data); ogs_assert(true == - ogs_nnrf_nfm_send_nf_status_subscribe(subscription_data)); + ogs_nnrf_nfm_send_nf_status_subscribe( + ogs_sbi_self()->nf_instance->nf_type, + subscription_data->req_nf_instance_id, + subscription_data->subscr_cond.nf_type, + subscription_data->subscr_cond.service_name)); ogs_info("Subscription validity expired [%s]", subscription_data->id); diff --git a/src/udm/sbi-path.c b/src/udm/sbi-path.c index a86aab259..cd4d01305 100644 --- a/src/udm/sbi-path.c +++ b/src/udm/sbi-path.c @@ -70,8 +70,8 @@ int udm_sbi_open(void) if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); - /* Build Subscription-Data */ - ogs_sbi_subscription_data_build_default(OpenAPI_nf_type_UDR, NULL); + /* Setup Subscription-Data */ + ogs_sbi_subscription_spec_add(OpenAPI_nf_type_UDR, NULL); if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) return OGS_ERROR; diff --git a/src/udm/udm-sm.c b/src/udm/udm-sm.c index 47cb63428..a73cba26c 100644 --- a/src/udm/udm-sm.c +++ b/src/udm/udm-sm.c @@ -385,7 +385,11 @@ void udm_state_operational(ogs_fsm_t *s, udm_event_t *e) ogs_assert(subscription_data); ogs_assert(true == - ogs_nnrf_nfm_send_nf_status_subscribe(subscription_data)); + ogs_nnrf_nfm_send_nf_status_subscribe( + ogs_sbi_self()->nf_instance->nf_type, + subscription_data->req_nf_instance_id, + subscription_data->subscr_cond.nf_type, + subscription_data->subscr_cond.service_name)); ogs_info("[%s] Subscription validity expired", subscription_data->id); diff --git a/src/udr/udr-sm.c b/src/udr/udr-sm.c index f34a2e388..4efd36e0f 100644 --- a/src/udr/udr-sm.c +++ b/src/udr/udr-sm.c @@ -292,7 +292,11 @@ void udr_state_operational(ogs_fsm_t *s, udr_event_t *e) ogs_assert(subscription_data); ogs_assert(true == - ogs_nnrf_nfm_send_nf_status_subscribe(subscription_data)); + ogs_nnrf_nfm_send_nf_status_subscribe( + ogs_sbi_self()->nf_instance->nf_type, + subscription_data->req_nf_instance_id, + subscription_data->subscr_cond.nf_type, + subscription_data->subscr_cond.service_name)); ogs_info("[%s] Subscription validity expired", subscription_data->id); diff --git a/tests/af/af-sm.c b/tests/af/af-sm.c index 2e8aa2c20..e9ca38054 100644 --- a/tests/af/af-sm.c +++ b/tests/af/af-sm.c @@ -415,7 +415,11 @@ void af_state_operational(ogs_fsm_t *s, af_event_t *e) ogs_assert(subscription_data); ogs_assert(true == - ogs_nnrf_nfm_send_nf_status_subscribe(subscription_data)); + ogs_nnrf_nfm_send_nf_status_subscribe( + ogs_sbi_self()->nf_instance->nf_type, + subscription_data->req_nf_instance_id, + subscription_data->subscr_cond.nf_type, + subscription_data->subscr_cond.service_name)); ogs_info("Subscription validity expired [%s]", subscription_data->id); diff --git a/tests/af/sbi-path.c b/tests/af/sbi-path.c index 46cd1d672..5b49318ea 100644 --- a/tests/af/sbi-path.c +++ b/tests/af/sbi-path.c @@ -36,8 +36,8 @@ int af_sbi_open(void) if (nf_instance) ogs_sbi_nf_fsm_init(nf_instance); - /* Build Subscription-Data */ - ogs_sbi_subscription_data_build_default( + /* Setup Subscription-Data */ + ogs_sbi_subscription_spec_add( OpenAPI_nf_type_BSF, OGS_SBI_SERVICE_NAME_NBSF_MANAGEMENT); if (ogs_sbi_server_start_all(ogs_sbi_server_handler) != OGS_OK) diff --git a/webui/package-lock.json b/webui/package-lock.json index ff75b5759..d57edb282 100644 --- a/webui/package-lock.json +++ b/webui/package-lock.json @@ -1,12 +1,12 @@ { "name": "open5gs", - "version": "2.5.5", + "version": "2.5.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "open5gs", - "version": "2.5.5", + "version": "2.5.6", "license": "AGPL-3.0", "dependencies": { "axios": "^0.27.2", diff --git a/webui/package.json b/webui/package.json index 7bdb51aec..7df4ec92e 100644 --- a/webui/package.json +++ b/webui/package.json @@ -1,6 +1,6 @@ { "name": "open5gs", - "version": "2.5.5", + "version": "2.5.6", "description": "Open5gs", "main": "index.js", "repository": "https://github.com/open5gs/open5gs/webui",