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 262
View file
open5gs_2.6.1.4.cf0a9.202303120006.dsc -> open5gs_2.6.1.7.7c873.202303130007.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-scp, open5gs-ausf, open5gs-udm, open5gs-pcf, open5gs-nssf, open5gs-bsf, open5gs-udr, open5gs, open5gs-dbg Architecture: any -Version: 2.6.1.4.cf0a9.202303120006 +Version: 2.6.1.7.7c873.202303130007 Maintainer: Harald Welte <laforge@gnumonks.org> Uploaders: Sukchan Lee <acetcom@gmail.com> Homepage: https://open5gs.org @@ -31,8 +31,8 @@ open5gs-udr deb net optional arch=any open5gs-upf deb net optional arch=any Checksums-Sha1: - b37d5b9ff36cb99eedf497dea92b304c5d01e829 14101672 open5gs_2.6.1.4.cf0a9.202303120006.tar.xz + f2be31db96dde52f8e16d73bbcef85b74c060489 14102800 open5gs_2.6.1.7.7c873.202303130007.tar.xz Checksums-Sha256: - 91ad6aef00517f7ca2ebee06997d64f2a9f94e8e692a621c7720e249e3a867d6 14101672 open5gs_2.6.1.4.cf0a9.202303120006.tar.xz + 2649551e26189e7d8d384d0b6d89182703bf92a45464a07ad85beec29f53fd05 14102800 open5gs_2.6.1.7.7c873.202303130007.tar.xz Files: - 9b9d8dca263157bfe16063c4d65d38ab 14101672 open5gs_2.6.1.4.cf0a9.202303120006.tar.xz + 57c06c2320add396a5d82a58501226c1 14102800 open5gs_2.6.1.7.7c873.202303130007.tar.xz
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/.tarball-version -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -2.6.1.4-cf0a9.202303120006 +2.6.1.7-7c873.202303130007
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/debian/changelog -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -open5gs (2.6.1.4.cf0a9.202303120006) unstable; urgency=medium +open5gs (2.6.1.7.7c873.202303130007) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom nightly feed - -- Osmocom OBS scripts <info@osmocom.org> Sun, 12 Mar 2023 00:08:25 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Mon, 13 Mar 2023 00:08:59 +0000 open5gs (2.6.1) unstable; urgency=medium
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/lib/proto/timer.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/lib/proto/timer.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -29,6 +29,8 @@ "OGS_TIMER_NF_INSTANCE_VALIDITY"; const char *OGS_TIMER_NAME_SUBSCRIPTION_VALIDITY = "OGS_TIMER_SUBSCRIPTION_VALIDITY"; +const char *OGS_TIMER_NAME_SUBSCRIPTION_PATCH = + "OGS_TIMER_SUBSCRIPTION_PATCH"; const char *OGS_TIMER_NAME_SBI_CLIENT_WAIT = "OGS_TIMER_SBI_CLIENT_WAIT"; @@ -45,6 +47,8 @@ return OGS_TIMER_NAME_NF_INSTANCE_VALIDITY; case OGS_TIMER_SUBSCRIPTION_VALIDITY: return OGS_TIMER_NAME_SUBSCRIPTION_VALIDITY; + case OGS_TIMER_SUBSCRIPTION_PATCH: + return OGS_TIMER_NAME_SUBSCRIPTION_PATCH; case OGS_TIMER_SBI_CLIENT_WAIT: return OGS_TIMER_NAME_SBI_CLIENT_WAIT; case OGS_TIMER_DBI_POLL_CHANGE_STREAM:
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/lib/proto/timer.h -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/lib/proto/timer.h
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -33,6 +33,7 @@ extern const char *OGS_TIMER_NAME_NF_INSTANCE_NO_HEARTBEAT; extern const char *OGS_TIMER_NAME_NF_INSTANCE_VALIDITY; extern const char *OGS_TIMER_NAME_SUBSCRIPTION_VALIDITY; +extern const char *OGS_TIMER_NAME_SUBSCRIPTION_PATCH; extern const char *OGS_TIMER_NAME_SBI_CLIENT_WAIT; /* forward declaration */ @@ -44,6 +45,7 @@ OGS_TIMER_NF_INSTANCE_NO_HEARTBEAT, OGS_TIMER_NF_INSTANCE_VALIDITY, OGS_TIMER_SUBSCRIPTION_VALIDITY, + OGS_TIMER_SUBSCRIPTION_PATCH, OGS_TIMER_SBI_CLIENT_WAIT, OGS_TIMER_DBI_POLL_CHANGE_STREAM,
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/lib/sbi/context.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/lib/sbi/context.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -1883,9 +1883,6 @@ ogs_assert(subscription_data); memset(subscription_data, 0, sizeof(ogs_sbi_subscription_data_t)); - subscription_data->time.validity_duration = - ogs_app()->time.subscription.validity_duration; - ogs_list_add(&ogs_sbi_self()->subscription_data_list, subscription_data); return subscription_data; @@ -1923,6 +1920,9 @@ if (subscription_data->t_validity) ogs_timer_delete(subscription_data->t_validity); + if (subscription_data->t_patch) + ogs_timer_delete(subscription_data->t_patch); + if (subscription_data->client) ogs_sbi_client_remove(subscription_data->client);
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/lib/sbi/context.h -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/lib/sbi/context.h
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -246,11 +246,14 @@ typedef struct ogs_sbi_subscription_data_s { ogs_lnode_t lnode; +#define OGS_SBI_VALIDITY_SEC(v) \ + ogs_time_sec(v) + (ogs_time_usec(v) ? 1 : 0) struct { int validity_duration; } time; ogs_timer_t *t_validity; /* check validation */ + ogs_timer_t *t_patch; /* for sending PATCH */ char *id; /* SubscriptionId */ char *req_nf_instance_id; /* reqNfInstanceId */
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/lib/sbi/message.h -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/lib/sbi/message.h
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -143,6 +143,10 @@ #define OGS_SBI_RESOURCE_NAME_PCF_BINDINGS "pcfBindings" +#define OGS_SBI_PATCH_PATH_NF_STATUS "/nfStatus" +#define OGS_SBI_PATCH_PATH_LOAD "/load" +#define OGS_SBI_PATCH_PATH_VALIDITY_TIME "/validityTime" + #define OGS_SBI_FEATURES_IS_SET(__fEATURES, __n) \ (__fEATURES & (1 << ((__n)-1)))
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/lib/sbi/nnrf-build.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/lib/sbi/nnrf-build.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -1215,13 +1215,13 @@ OpenAPI_patch_item_t StatusItem; OpenAPI_patch_item_t LoadItem; - memset(&StatusItem, 0, sizeof(StatusItem)); - memset(&LoadItem, 0, sizeof(LoadItem)); - nf_instance = ogs_sbi_self()->nf_instance; ogs_assert(nf_instance); ogs_assert(nf_instance->id); + memset(&StatusItem, 0, sizeof(StatusItem)); + memset(&LoadItem, 0, sizeof(LoadItem)); + memset(&message, 0, sizeof(message)); message.h.method = (char *)OGS_SBI_HTTP_METHOD_PATCH; message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM; @@ -1239,7 +1239,7 @@ } StatusItem.op = OpenAPI_patch_operation_replace; - StatusItem.path = (char *)"/nfStatus"; + StatusItem.path = (char *)OGS_SBI_PATCH_PATH_NF_STATUS; StatusItem.value = OpenAPI_any_type_create_string( OpenAPI_nf_status_ToString(OpenAPI_nf_status_REGISTERED)); if (!StatusItem.value) { @@ -1250,7 +1250,7 @@ OpenAPI_list_add(PatchItemList, &StatusItem); LoadItem.op = OpenAPI_patch_operation_replace; - LoadItem.path = (char *)"/load"; + LoadItem.path = (char *)OGS_SBI_PATCH_PATH_LOAD; LoadItem.value = OpenAPI_any_type_create_number(nf_instance->load); if (!LoadItem.value) { ogs_error("No load item.value"); @@ -1387,6 +1387,71 @@ return request; } + +ogs_sbi_request_t *ogs_nnrf_nfm_build_status_update( + ogs_sbi_subscription_data_t *subscription_data) +{ + ogs_sbi_message_t message; + ogs_sbi_request_t *request = NULL; + + OpenAPI_list_t *PatchItemList = NULL; + OpenAPI_patch_item_t ValidityItem; + char *validity_time = NULL; + + ogs_assert(subscription_data); + ogs_assert(subscription_data->id); + + memset(&ValidityItem, 0, sizeof(ValidityItem)); + + memset(&message, 0, sizeof(message)); + message.h.method = (char *)OGS_SBI_HTTP_METHOD_PATCH; + message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM; + message.h.api.version = (char *)OGS_SBI_API_V1; + message.h.resource.component0 = + (char *)OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS; + message.h.resource.component1 = subscription_data->id; + + message.http.content_type = (char *)OGS_SBI_CONTENT_PATCH_TYPE; + + PatchItemList = OpenAPI_list_create(); + if (!PatchItemList) { + ogs_error("No PatchItemList"); + goto end; + } + + ogs_assert(subscription_data->time.validity_duration); + validity_time = ogs_sbi_localtime_string( + ogs_time_now() + + ogs_time_from_sec(subscription_data->time.validity_duration)); + ogs_assert(validity_time); + + ValidityItem.op = OpenAPI_patch_operation_replace; + ValidityItem.path = (char *)OGS_SBI_PATCH_PATH_VALIDITY_TIME; + ValidityItem.value = OpenAPI_any_type_create_string(validity_time); + + if (!ValidityItem.value) { + ogs_error("No status item.value"); + goto end; + } + + OpenAPI_list_add(PatchItemList, &ValidityItem); + + message.PatchItemList = PatchItemList; + + request = ogs_sbi_build_request(&message); + ogs_expect(request); + +end: + if (ValidityItem.value) + OpenAPI_any_type_free(ValidityItem.value); + if (validity_time) + ogs_free(validity_time); + + if (PatchItemList) + OpenAPI_list_free(PatchItemList); + + return request; +} ogs_sbi_request_t *ogs_nnrf_nfm_build_status_unsubscribe( ogs_sbi_subscription_data_t *subscription_data)
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/lib/sbi/nnrf-build.h -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/lib/sbi/nnrf-build.h
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -37,6 +37,8 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_status_subscribe( ogs_sbi_subscription_data_t *subscription_data); +ogs_sbi_request_t *ogs_nnrf_nfm_build_status_update( + ogs_sbi_subscription_data_t *subscription_data); ogs_sbi_request_t *ogs_nnrf_nfm_build_status_unsubscribe( ogs_sbi_subscription_data_t *subscription_data); ogs_sbi_request_t *ogs_nnrf_nfm_build_profile_retrieve(char *nf_instance_id);
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/lib/sbi/nnrf-handler.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/lib/sbi/nnrf-handler.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -458,6 +458,68 @@ } } +static void handle_validity_time( + ogs_sbi_subscription_data_t *subscription_data, + char *validity_time, const char *action) +{ + ogs_time_t time, validity, patch; + + ogs_assert(validity_time); + ogs_assert(subscription_data); + ogs_assert(action); + + if (ogs_sbi_time_from_string(&time, validity_time) == false) { + ogs_error("%s Subscription %s until %s parser error", + subscription_data->id, action, validity_time); + return; + } + + validity = time - ogs_time_now(); + if (validity < 0) { + ogs_error("%s Subscription %s until %s validity:%d.%06d", + subscription_data->id, action, validity_time, + (int)ogs_time_sec(validity), (int)ogs_time_usec(validity)); + return; + } + + /* + * Store subscription_data->time.validity_duration to derive NRF validity. + * It will be used in ogs_nnrf_nfm_build_status_update(). + * + * So, you should not remove the following lines. + */ + subscription_data->time.validity_duration = OGS_SBI_VALIDITY_SEC(validity); + + if (!subscription_data->t_validity) { + subscription_data->t_validity = + ogs_timer_add(ogs_app()->timer_mgr, + ogs_timer_subscription_validity, subscription_data); + ogs_assert(subscription_data->t_validity); + } + ogs_timer_start(subscription_data->t_validity, validity); + + /* + * PATCH request will be sent before VALIDITY is expired. + */ +#define PATCH_TIME_FROM_VALIDITY(x) ((x) / 2) + patch = PATCH_TIME_FROM_VALIDITY(validity); + + if (!subscription_data->t_patch) { + subscription_data->t_patch = + ogs_timer_add(ogs_app()->timer_mgr, + ogs_timer_subscription_patch, subscription_data); + ogs_assert(subscription_data->t_patch); + } + ogs_timer_start(subscription_data->t_patch, patch); + + ogs_info("%s Subscription %s until %s " + "duration:%d,validity:%d.%06d,patch:%d.%06d", + subscription_data->id, action, validity_time, + subscription_data->time.validity_duration, + (int)ogs_time_sec(validity), (int)ogs_time_usec(validity), + (int)ogs_time_sec(patch), (int)ogs_time_usec(patch)); +} + void ogs_nnrf_nfm_handle_nf_status_subscribe( ogs_sbi_subscription_data_t *subscription_data, ogs_sbi_message_t *recvmsg) @@ -473,12 +535,44 @@ return; } - if (!SubscriptionData->subscription_id) { - ogs_error("No SubscriptionId"); + if (recvmsg->http.location) { + int rv; + ogs_sbi_message_t message; + ogs_sbi_header_t header; + + memset(&header, 0, sizeof(header)); + header.uri = recvmsg->http.location; + + rv = ogs_sbi_parse_header(&message, &header); + if (rv != OGS_OK) { + ogs_error("Cannot parse http.location %s", + recvmsg->http.location); + return; + } + + if (!message.h.resource.component1) { + ogs_error("No Subscription ID %s", recvmsg->http.location); + ogs_sbi_header_free(&header); + return; + } + + ogs_sbi_subscription_data_set_id( + subscription_data, message.h.resource.component1); + + ogs_sbi_header_free(&header); + + } else if (SubscriptionData->subscription_id) { + /* + * For compatibility with v2.5.x and lower versions + * + * Deprecated : It will be removed soon. + */ + ogs_sbi_subscription_data_set_id( + subscription_data, SubscriptionData->subscription_id); + } else { + ogs_error("No Subscription ID"); return; } - ogs_sbi_subscription_data_set_id( - subscription_data, SubscriptionData->subscription_id); /* SBI Features */ if (SubscriptionData->nrf_supported_features) { @@ -488,26 +582,31 @@ subscription_data->nrf_supported_features = 0; } - if (SubscriptionData->validity_time) { -#define VALIDITY_MINIMUM (10LL * OGS_USEC_PER_SEC) /* 10 seconds */ - ogs_time_t time, duration; - if (ogs_sbi_time_from_string( - &time, SubscriptionData->validity_time) == true) { - duration = time - ogs_time_now(); - if (duration < VALIDITY_MINIMUM) { - duration = VALIDITY_MINIMUM; - ogs_warn("%s Forced to %lld seconds", subscription_data->id, - (long long)ogs_time_sec(VALIDITY_MINIMUM)); - } - subscription_data->t_validity = ogs_timer_add(ogs_app()->timer_mgr, - ogs_timer_subscription_validity, subscription_data); - ogs_assert(subscription_data->t_validity); - ogs_timer_start(subscription_data->t_validity, duration); - } else { - ogs_error("Cannot parse validitiyTime %s", - SubscriptionData->validity_time); - } + /* Subscription Validity Time */ + if (SubscriptionData->validity_time) + handle_validity_time( + subscription_data, SubscriptionData->validity_time, "created"); +} + +void ogs_nnrf_nfm_handle_nf_status_update( + ogs_sbi_subscription_data_t *subscription_data, + ogs_sbi_message_t *recvmsg) +{ + OpenAPI_subscription_data_t *SubscriptionData = NULL; + + ogs_assert(recvmsg); + ogs_assert(subscription_data); + + SubscriptionData = recvmsg->SubscriptionData; + if (!SubscriptionData) { + ogs_error("No SubscriptionData"); + return; } + + /* Subscription Validity Time */ + if (SubscriptionData->validity_time) + handle_validity_time( + subscription_data, SubscriptionData->validity_time, "updated"); } bool ogs_nnrf_nfm_handle_nf_status_notify(
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/lib/sbi/nnrf-handler.h -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/lib/sbi/nnrf-handler.h
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -32,6 +32,9 @@ void ogs_nnrf_nfm_handle_nf_status_subscribe( ogs_sbi_subscription_data_t *subscription_data, ogs_sbi_message_t *recvmsg); +void ogs_nnrf_nfm_handle_nf_status_update( + ogs_sbi_subscription_data_t *subscription_data, + ogs_sbi_message_t *recvmsg); bool ogs_nnrf_nfm_handle_nf_status_notify( ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg);
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/lib/sbi/nnrf-path.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/lib/sbi/nnrf-path.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2022-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -109,6 +109,29 @@ if (!request) { ogs_error("No Request"); return false; + } + + rc = ogs_sbi_send_notification_request( + OGS_SBI_SERVICE_TYPE_NNRF_NFM, NULL, request, subscription_data); + ogs_expect(rc == true); + + ogs_sbi_request_free(request); + + return rc; +} + +bool ogs_nnrf_nfm_send_nf_status_update( + ogs_sbi_subscription_data_t *subscription_data) +{ + bool rc; + ogs_sbi_request_t *request = NULL; + + ogs_assert(subscription_data); + + request = ogs_nnrf_nfm_build_status_update(subscription_data); + if (!request) { + ogs_error("No Request"); + return false; } rc = ogs_sbi_send_notification_request(
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/lib/sbi/nnrf-path.h -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/lib/sbi/nnrf-path.h
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2022-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -33,6 +33,8 @@ 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_update( + ogs_sbi_subscription_data_t *subscription_data); bool ogs_nnrf_nfm_send_nf_status_unsubscribe( ogs_sbi_subscription_data_t *subscription_data);
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/lib/sbi/timer.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/lib/sbi/timer.c
Changed
@@ -31,6 +31,7 @@ case OGS_TIMER_NF_INSTANCE_NO_HEARTBEAT: case OGS_TIMER_NF_INSTANCE_VALIDITY: case OGS_TIMER_SUBSCRIPTION_VALIDITY: + case OGS_TIMER_SUBSCRIPTION_PATCH: case OGS_TIMER_SBI_CLIENT_WAIT: e = ogs_event_new(OGS_EVENT_SBI_TIMER); ogs_assert(e); @@ -76,6 +77,11 @@ timer_send_event(OGS_TIMER_SUBSCRIPTION_VALIDITY, data); } +void ogs_timer_subscription_patch(void *data) +{ + timer_send_event(OGS_TIMER_SUBSCRIPTION_PATCH, data); +} + void ogs_timer_sbi_client_wait_expire(void *data) { timer_send_event(OGS_TIMER_SBI_CLIENT_WAIT, data);
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/lib/sbi/timer.h -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/lib/sbi/timer.h
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -33,6 +33,7 @@ void ogs_timer_nf_instance_no_heartbeat(void *data); void ogs_timer_nf_instance_validity(void *data); void ogs_timer_subscription_validity(void *data); +void ogs_timer_subscription_patch(void *data); void ogs_timer_sbi_client_wait_expire(void *data); #ifdef __cplusplus
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/src/amf/amf-sm.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/src/amf/amf-sm.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -299,8 +299,22 @@ ogs_nnrf_nfm_handle_nf_status_subscribe( subscription_data, &sbi_message); } else { + ogs_error("HTTP response error : %d", + sbi_message.res_status); + } + break; + + CASE(OGS_SBI_HTTP_METHOD_PATCH) + if (sbi_message.res_status == OGS_SBI_HTTP_STATUS_OK || + sbi_message.res_status == + OGS_SBI_HTTP_STATUS_NO_CONTENT) { + ogs_nnrf_nfm_handle_nf_status_update( + subscription_data, &sbi_message); + } else { ogs_error("%s HTTP response error %d", - subscription_data->id, sbi_message.res_status); + subscription_data->id ? + subscription_data->id : "Unknown", + sbi_message.res_status); } break; @@ -310,7 +324,9 @@ ogs_sbi_subscription_data_remove(subscription_data); } else { ogs_error("%s HTTP response error %d", - subscription_data->id, sbi_message.res_status); + subscription_data->id ? + subscription_data->id : "Unknown", + sbi_message.res_status); } break; @@ -591,11 +607,22 @@ subscription_data->subscr_cond.nf_type, subscription_data->subscr_cond.service_name)); - ogs_info("Subscription validity expired %s", + ogs_error("%s Subscription validity expired", subscription_data->id); ogs_sbi_subscription_data_remove(subscription_data); break; + case OGS_TIMER_SUBSCRIPTION_PATCH: + subscription_data = e->h.sbi.data; + ogs_assert(subscription_data); + + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_update(subscription_data)); + + ogs_info("%s Need to update Subscription", + subscription_data->id); + break; + case OGS_TIMER_SBI_CLIENT_WAIT: /* * ogs_pollset_poll() receives the time of the expiration
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/src/amf/timer.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/src/amf/timer.c
Changed
@@ -75,6 +75,8 @@ return OGS_TIMER_NAME_NF_INSTANCE_VALIDITY; case OGS_TIMER_SUBSCRIPTION_VALIDITY: return OGS_TIMER_NAME_SUBSCRIPTION_VALIDITY; + case OGS_TIMER_SUBSCRIPTION_PATCH: + return OGS_TIMER_NAME_SUBSCRIPTION_PATCH; case OGS_TIMER_SBI_CLIENT_WAIT: return OGS_TIMER_NAME_SBI_CLIENT_WAIT; case AMF_TIMER_NG_DELAYED_SEND:
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/src/ausf/ausf-sm.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/src/ausf/ausf-sm.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -219,8 +219,21 @@ ogs_nnrf_nfm_handle_nf_status_subscribe( subscription_data, &message); } else { + ogs_error("HTTP response error : %d", + message.res_status); + } + break; + + CASE(OGS_SBI_HTTP_METHOD_PATCH) + if (message.res_status == OGS_SBI_HTTP_STATUS_OK || + message.res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT) { + ogs_nnrf_nfm_handle_nf_status_update( + subscription_data, &message); + } else { ogs_error("%s HTTP response error %d", - subscription_data->id, message.res_status); + subscription_data->id ? + subscription_data->id : "Unknown", + message.res_status); } break; @@ -230,7 +243,9 @@ ogs_sbi_subscription_data_remove(subscription_data); } else { ogs_error("%s HTTP response error %d", - subscription_data->id, message.res_status); + subscription_data->id ? + subscription_data->id : "Unknown", + message.res_status); } break; @@ -352,11 +367,22 @@ subscription_data->subscr_cond.nf_type, subscription_data->subscr_cond.service_name)); - ogs_info("Subscription validity expired %s", + ogs_error("%s Subscription validity expired", subscription_data->id); ogs_sbi_subscription_data_remove(subscription_data); break; + case OGS_TIMER_SUBSCRIPTION_PATCH: + subscription_data = e->h.sbi.data; + ogs_assert(subscription_data); + + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_update(subscription_data)); + + ogs_info("%s Need to update Subscription", + subscription_data->id); + break; + case OGS_TIMER_SBI_CLIENT_WAIT: /* * ogs_pollset_poll() receives the time of the expiration
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/src/bsf/bsf-sm.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/src/bsf/bsf-sm.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -245,11 +245,26 @@ } break; + CASE(OGS_SBI_HTTP_METHOD_PATCH) + if (message.res_status == OGS_SBI_HTTP_STATUS_OK || + message.res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT) { + ogs_nnrf_nfm_handle_nf_status_update( + subscription_data, &message); + } else { + ogs_error("%s HTTP response error %d", + subscription_data->id ? + subscription_data->id : "Unknown", + message.res_status); + } + break; + CASE(OGS_SBI_HTTP_METHOD_DELETE) if (message.res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT) { ogs_sbi_subscription_data_remove(subscription_data); } else { - ogs_error("HTTP response error : %d", + ogs_error("%s HTTP response error %d", + subscription_data->id ? + subscription_data->id : "Unknown", message.res_status); } break; @@ -336,11 +351,22 @@ subscription_data->subscr_cond.nf_type, subscription_data->subscr_cond.service_name)); - ogs_info("Subscription validity expired %s", + ogs_error("%s Subscription validity expired", subscription_data->id); ogs_sbi_subscription_data_remove(subscription_data); break; + case OGS_TIMER_SUBSCRIPTION_PATCH: + subscription_data = e->h.sbi.data; + ogs_assert(subscription_data); + + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_update(subscription_data)); + + ogs_info("%s Need to update Subscription", + subscription_data->id); + break; + case OGS_TIMER_SBI_CLIENT_WAIT: /* * ogs_pollset_poll() receives the time of the expiration
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/src/nrf/nnrf-handler.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/src/nrf/nnrf-handler.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -125,22 +125,39 @@ CASE(OGS_SBI_HTTP_METHOD_PATCH) PatchItemList = recvmsg->PatchItemList; if (!PatchItemList) { + ogs_error("No PatchItemList Array"); ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No PatchItemList Array", NULL)); + recvmsg, "No PatchItemList", NULL)); return false; } OpenAPI_list_for_each(PatchItemList, node) { OpenAPI_patch_item_t *patch_item = node->data; if (!patch_item) { + ogs_error("No PatchItem"); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, - recvmsg, "No PatchItemList", NULL)); + recvmsg, "No PatchItem", NULL)); return false; } + + if (patch_item->op != OpenAPI_patch_operation_replace) { + ogs_error("Unknown PatchItem.Operation %s", + OpenAPI_patch_operation_ToString(patch_item->op)); + continue; + } + + SWITCH(patch_item->path) + CASE(OGS_SBI_PATCH_PATH_NF_STATUS) + break; + CASE(OGS_SBI_PATCH_PATH_LOAD) + break; + DEFAULT + ogs_error("Unknown PatchItem.Path %s", patch_item->path); + END } response = ogs_sbi_build_response( @@ -171,14 +188,28 @@ OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL; ogs_sockaddr_t *addr = NULL; + ogs_sbi_server_t *server = NULL; + ogs_sbi_header_t header; + ogs_uuid_t uuid; char idOGS_UUID_FORMATTED_LENGTH + 1; ogs_assert(stream); ogs_assert(recvmsg); + if (recvmsg->h.resource.component1) { + ogs_error("Invalid POST Format %s", + recvmsg->h.resource.component1); + ogs_assert(true == + ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "Invalid POST Format", + recvmsg->h.resource.component1)); + return false; + } + SubscriptionData = recvmsg->SubscriptionData; if (!SubscriptionData) { + ogs_error("No SubscriptionData"); ogs_assert(true == ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, recvmsg, "No SubscriptionData", NULL)); @@ -186,6 +217,7 @@ } if (!SubscriptionData->nf_status_notification_uri) { + ogs_error("No nfStatusNotificationUri"); ogs_assert(true == ogs_sbi_server_send_error( stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, @@ -198,6 +230,7 @@ subscription_data = ogs_sbi_subscription_data_add(); ogs_assert(subscription_data); + ogs_sbi_subscription_data_set_id(subscription_data, id); ogs_assert(subscription_data->id); @@ -276,54 +309,243 @@ OGS_SBI_SETUP_CLIENT(subscription_data, client); ogs_freeaddrinfo(addr); + /* + * The NRF validity is initially set in configuration. + */ + subscription_data->time.validity_duration = + ogs_app()->time.subscription.validity_duration; + if (subscription_data->time.validity_duration) { SubscriptionData->validity_time = ogs_sbi_localtime_string( ogs_time_now() + ogs_time_from_sec( subscription_data->time.validity_duration)); ogs_assert(SubscriptionData->validity_time); - subscription_data->t_validity = ogs_timer_add(ogs_app()->timer_mgr, - nrf_timer_subscription_validity, subscription_data); - ogs_assert(subscription_data->t_validity); + if (!subscription_data->t_validity) { + subscription_data->t_validity = + ogs_timer_add(ogs_app()->timer_mgr, + nrf_timer_subscription_validity, subscription_data); + ogs_assert(subscription_data->t_validity); + } ogs_timer_start(subscription_data->t_validity, ogs_time_from_sec(subscription_data->time.validity_duration)); } - recvmsg->http.location = recvmsg->h.uri; + ogs_info("%s Subscription created until %s validity_duration:%d", + subscription_data->id, + SubscriptionData->validity_time, + subscription_data->time.validity_duration); + + /* Location */ + server = ogs_sbi_server_from_stream(stream); + ogs_assert(server); + + memset(&header, 0, sizeof(header)); + header.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM; + header.api.version = (char *)OGS_SBI_API_V1; + header.resource.component0 = + (char *)OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS; + header.resource.component1 = subscription_data->id; + + recvmsg->http.location = ogs_sbi_server_uri(server, &header); + status = OGS_SBI_HTTP_STATUS_CREATED; response = ogs_sbi_build_response(recvmsg, status); ogs_assert(response); ogs_assert(true == ogs_sbi_server_send_response(stream, response)); + if (recvmsg->http.location) + ogs_free(recvmsg->http.location); + return true; } -bool nrf_nnrf_handle_nf_status_unsubscribe( +bool nrf_nnrf_handle_nf_status_update( ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg) { + ogs_sbi_response_t *response = NULL; + + OpenAPI_list_t *PatchItemList = NULL; + OpenAPI_lnode_t *node; + + ogs_sbi_message_t sendmsg; + OpenAPI_subscription_data_t SubscriptionData; + char *validity_time = NULL; + ogs_sbi_subscription_data_t *subscription_data = NULL; + ogs_assert(stream); ogs_assert(recvmsg); + memset(&SubscriptionData, 0, sizeof(SubscriptionData)); + + if (!recvmsg->h.resource.component1) { + ogs_error("No SubscriptionId"); + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No SubscriptionId", NULL)); + return false; + } + subscription_data = ogs_sbi_subscription_data_find( recvmsg->h.resource.component1); - if (subscription_data) { - ogs_sbi_response_t *response = NULL; - ogs_sbi_subscription_data_remove(subscription_data); + if (!subscription_data) { + ogs_error("%s Not found", recvmsg->h.resource.component1); + ogs_assert(true == + ogs_sbi_server_send_error(stream, + OGS_SBI_HTTP_STATUS_NOT_FOUND, + recvmsg, "Not found", recvmsg->h.resource.component1)); + return false; + } + ogs_assert(subscription_data->id); - response = ogs_sbi_build_response( - recvmsg, OGS_SBI_HTTP_STATUS_NO_CONTENT);
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/src/nrf/nnrf-handler.h -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/src/nrf/nnrf-handler.h
Changed
@@ -34,6 +34,8 @@ bool nrf_nnrf_handle_nf_status_subscribe( ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg); +bool nrf_nnrf_handle_nf_status_update( + ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg); bool nrf_nnrf_handle_nf_status_unsubscribe( ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg);
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/src/nrf/nrf-sm.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/src/nrf/nrf-sm.c
Changed
@@ -166,6 +166,10 @@ nrf_nnrf_handle_nf_status_subscribe(stream, &message); break; + CASE(OGS_SBI_HTTP_METHOD_PATCH) + nrf_nnrf_handle_nf_status_update(stream, &message); + break; + CASE(OGS_SBI_HTTP_METHOD_DELETE) nrf_nnrf_handle_nf_status_unsubscribe(stream, &message); break; @@ -254,7 +258,7 @@ subscription_data = e->subscription_data; ogs_assert(subscription_data); - ogs_info("%s Subscription validity expired", + ogs_error("%s Subscription validity expired", subscription_data->id); ogs_sbi_subscription_data_remove(subscription_data); break;
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/src/nssf/nssf-sm.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/src/nssf/nssf-sm.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -182,8 +182,21 @@ ogs_nnrf_nfm_handle_nf_status_subscribe( subscription_data, &message); } else { + ogs_error("HTTP response error : %d", + message.res_status); + } + break; + + CASE(OGS_SBI_HTTP_METHOD_PATCH) + if (message.res_status == OGS_SBI_HTTP_STATUS_OK || + message.res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT) { + ogs_nnrf_nfm_handle_nf_status_update( + subscription_data, &message); + } else { ogs_error("%s HTTP response error %d", - subscription_data->id, message.res_status); + subscription_data->id ? + subscription_data->id : "Unknown", + message.res_status); } break; @@ -193,7 +206,9 @@ ogs_sbi_subscription_data_remove(subscription_data); } else { ogs_error("%s HTTP response error %d", - subscription_data->id, message.res_status); + subscription_data->id ? + subscription_data->id : "Unknown", + message.res_status); } break; @@ -252,11 +267,22 @@ subscription_data->subscr_cond.nf_type, subscription_data->subscr_cond.service_name)); - ogs_info("Subscription validity expired %s", + ogs_error("%s Subscription validity expired", subscription_data->id); ogs_sbi_subscription_data_remove(subscription_data); break; + case OGS_TIMER_SUBSCRIPTION_PATCH: + subscription_data = e->h.sbi.data; + ogs_assert(subscription_data); + + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_update(subscription_data)); + + ogs_info("%s Need to update Subscription", + subscription_data->id); + break; + default: ogs_error("Unknown timer%s:%d", ogs_timer_get_name(e->h.timer_id), e->h.timer_id);
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/src/pcf/pcf-sm.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/src/pcf/pcf-sm.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -333,8 +333,21 @@ ogs_nnrf_nfm_handle_nf_status_subscribe( subscription_data, &message); } else { + ogs_error("HTTP response error : %d", + message.res_status); + } + break; + + CASE(OGS_SBI_HTTP_METHOD_PATCH) + if (message.res_status == OGS_SBI_HTTP_STATUS_OK || + message.res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT) { + ogs_nnrf_nfm_handle_nf_status_update( + subscription_data, &message); + } else { ogs_error("%s HTTP response error %d", - subscription_data->id, message.res_status); + subscription_data->id ? + subscription_data->id : "Unknown", + message.res_status); } break; @@ -344,7 +357,9 @@ ogs_sbi_subscription_data_remove(subscription_data); } else { ogs_error("%s HTTP response error %d", - subscription_data->id, message.res_status); + subscription_data->id ? + subscription_data->id : "Unknown", + message.res_status); } break; @@ -582,11 +597,22 @@ subscription_data->subscr_cond.nf_type, subscription_data->subscr_cond.service_name)); - ogs_info("%s Subscription validity expired", - subscription_data->id); + ogs_error("%s Subscription validity expired", + subscription_data->id); ogs_sbi_subscription_data_remove(subscription_data); break; + case OGS_TIMER_SUBSCRIPTION_PATCH: + subscription_data = e->h.sbi.data; + ogs_assert(subscription_data); + + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_update(subscription_data)); + + ogs_info("%s Need to update Subscription", + subscription_data->id); + break; + case OGS_TIMER_SBI_CLIENT_WAIT: /* * ogs_pollset_poll() receives the time of the expiration
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/src/scp/scp-sm.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/src/scp/scp-sm.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -177,11 +177,26 @@ } break; + CASE(OGS_SBI_HTTP_METHOD_PATCH) + if (message.res_status == OGS_SBI_HTTP_STATUS_OK || + message.res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT) { + ogs_nnrf_nfm_handle_nf_status_update( + subscription_data, &message); + } else { + ogs_error("%s HTTP response error %d", + subscription_data->id ? + subscription_data->id : "Unknown", + message.res_status); + } + break; + CASE(OGS_SBI_HTTP_METHOD_DELETE) if (message.res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT) { ogs_sbi_subscription_data_remove(subscription_data); } else { - ogs_error("HTTP response error : %d", + ogs_error("%s HTTP response error %d", + subscription_data->id ? + subscription_data->id : "Unknown", message.res_status); } break; @@ -238,11 +253,22 @@ subscription_data->subscr_cond.nf_type, subscription_data->subscr_cond.service_name)); - ogs_info("Subscription validity expired %s", + ogs_error("%s Subscription validity expired", subscription_data->id); ogs_sbi_subscription_data_remove(subscription_data); break; + case OGS_TIMER_SUBSCRIPTION_PATCH: + subscription_data = e->h.sbi.data; + ogs_assert(subscription_data); + + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_update(subscription_data)); + + ogs_info("%s Need to update Subscription", + subscription_data->id); + break; + case OGS_TIMER_SBI_CLIENT_WAIT: /* * ogs_pollset_poll() receives the time of the expiration
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/src/smf/smf-sm.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/src/smf/smf-sm.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -695,12 +695,28 @@ } break; + CASE(OGS_SBI_HTTP_METHOD_PATCH) + if (sbi_message.res_status == OGS_SBI_HTTP_STATUS_OK || + sbi_message.res_status == + OGS_SBI_HTTP_STATUS_NO_CONTENT) { + ogs_nnrf_nfm_handle_nf_status_update( + subscription_data, &sbi_message); + } else { + ogs_error("%s HTTP response error %d", + subscription_data->id ? + subscription_data->id : "Unknown", + sbi_message.res_status); + } + break; + CASE(OGS_SBI_HTTP_METHOD_DELETE) if (sbi_message.res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT) { ogs_sbi_subscription_data_remove(subscription_data); } else { - ogs_error("HTTP response error : %d", + ogs_error("%s HTTP response error %d", + subscription_data->id ? + subscription_data->id : "Unknown", sbi_message.res_status); } break; @@ -826,11 +842,22 @@ subscription_data->subscr_cond.nf_type, subscription_data->subscr_cond.service_name)); - ogs_info("Subscription validity expired %s", + ogs_error("%s Subscription validity expired", subscription_data->id); ogs_sbi_subscription_data_remove(subscription_data); break; + case OGS_TIMER_SUBSCRIPTION_PATCH: + subscription_data = e->h.sbi.data; + ogs_assert(subscription_data); + + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_update(subscription_data)); + + ogs_info("%s Need to update Subscription", + subscription_data->id); + break; + case OGS_TIMER_SBI_CLIENT_WAIT: /* * ogs_pollset_poll() receives the time of the expiration
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/src/smf/timer.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/src/smf/timer.c
Changed
@@ -32,6 +32,8 @@ return OGS_TIMER_NAME_NF_INSTANCE_VALIDITY; case OGS_TIMER_SUBSCRIPTION_VALIDITY: return OGS_TIMER_NAME_SUBSCRIPTION_VALIDITY; + case OGS_TIMER_SUBSCRIPTION_PATCH: + return OGS_TIMER_NAME_SUBSCRIPTION_PATCH; case OGS_TIMER_SBI_CLIENT_WAIT: return OGS_TIMER_NAME_SBI_CLIENT_WAIT; case SMF_TIMER_PFCP_ASSOCIATION:
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/src/udm/udm-sm.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/src/udm/udm-sm.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -250,8 +250,21 @@ ogs_nnrf_nfm_handle_nf_status_subscribe( subscription_data, &message); } else { + ogs_error("HTTP response error : %d", + message.res_status); + } + break; + + CASE(OGS_SBI_HTTP_METHOD_PATCH) + if (message.res_status == OGS_SBI_HTTP_STATUS_OK || + message.res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT) { + ogs_nnrf_nfm_handle_nf_status_update( + subscription_data, &message); + } else { ogs_error("%s HTTP response error %d", - subscription_data->id, message.res_status); + subscription_data->id ? + subscription_data->id : "Unknown", + message.res_status); } break; @@ -261,7 +274,9 @@ ogs_sbi_subscription_data_remove(subscription_data); } else { ogs_error("%s HTTP response error %d", - subscription_data->id, message.res_status); + subscription_data->id ? + subscription_data->id : "Unknown", + message.res_status); } break; @@ -393,11 +408,22 @@ subscription_data->subscr_cond.nf_type, subscription_data->subscr_cond.service_name)); - ogs_info("%s Subscription validity expired", - subscription_data->id); + ogs_error("%s Subscription validity expired", + subscription_data->id); ogs_sbi_subscription_data_remove(subscription_data); break; + case OGS_TIMER_SUBSCRIPTION_PATCH: + subscription_data = e->h.sbi.data; + ogs_assert(subscription_data); + + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_update(subscription_data)); + + ogs_info("%s Need to update Subscription", + subscription_data->id); + break; + case OGS_TIMER_SBI_CLIENT_WAIT: /* * ogs_pollset_poll() receives the time of the expiration
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/src/udr/udr-sm.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/src/udr/udr-sm.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com> + * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * @@ -231,8 +231,21 @@ ogs_nnrf_nfm_handle_nf_status_subscribe( subscription_data, &message); } else { + ogs_error("HTTP response error : %d", + message.res_status); + } + break; + + CASE(OGS_SBI_HTTP_METHOD_PATCH) + if (message.res_status == OGS_SBI_HTTP_STATUS_OK || + message.res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT) { + ogs_nnrf_nfm_handle_nf_status_update( + subscription_data, &message); + } else { ogs_error("%s HTTP response error %d", - subscription_data->id, message.res_status); + subscription_data->id ? + subscription_data->id : "Unknown", + message.res_status); } break; @@ -242,7 +255,9 @@ ogs_sbi_subscription_data_remove(subscription_data); } else { ogs_error("%s HTTP response error %d", - subscription_data->id, message.res_status); + subscription_data->id ? + subscription_data->id : "Unknown", + message.res_status); } break; @@ -298,11 +313,22 @@ subscription_data->subscr_cond.nf_type, subscription_data->subscr_cond.service_name)); - ogs_info("%s Subscription validity expired", - subscription_data->id); + ogs_error("%s Subscription validity expired", + subscription_data->id); ogs_sbi_subscription_data_remove(subscription_data); break; + case OGS_TIMER_SUBSCRIPTION_PATCH: + subscription_data = e->h.sbi.data; + ogs_assert(subscription_data); + + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_update(subscription_data)); + + ogs_info("%s Need to update Subscription", + subscription_data->id); + break; + default: ogs_error("Unknown timer%s:%d", ogs_timer_get_name(e->h.timer_id), e->h.timer_id);
View file
open5gs_2.6.1.4.cf0a9.202303120006.tar.xz/tests/af/af-sm.c -> open5gs_2.6.1.7.7c873.202303130007.tar.xz/tests/af/af-sm.c
Changed
@@ -238,11 +238,26 @@ } break; + CASE(OGS_SBI_HTTP_METHOD_PATCH) + if (message.res_status == OGS_SBI_HTTP_STATUS_OK || + message.res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT) { + ogs_nnrf_nfm_handle_nf_status_update( + subscription_data, &message); + } else { + ogs_error("%s HTTP response error %d", + subscription_data->id ? + subscription_data->id : "Unknown", + message.res_status); + } + break; + CASE(OGS_SBI_HTTP_METHOD_DELETE) if (message.res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT) { ogs_sbi_subscription_data_remove(subscription_data); } else { - ogs_error("HTTP response error : %d", + ogs_error("%s HTTP response error %d", + subscription_data->id ? + subscription_data->id : "Unknown", message.res_status); } break; @@ -421,11 +436,22 @@ subscription_data->subscr_cond.nf_type, subscription_data->subscr_cond.service_name)); - ogs_info("Subscription validity expired %s", + ogs_error("%s Subscription validity expired", subscription_data->id); ogs_sbi_subscription_data_remove(subscription_data); break; + case OGS_TIMER_SUBSCRIPTION_PATCH: + subscription_data = e->h.sbi.data; + ogs_assert(subscription_data); + + ogs_assert(true == + ogs_nnrf_nfm_send_nf_status_update(subscription_data)); + + ogs_info("%s Need to update Subscription", + subscription_data->id); + break; + case OGS_TIMER_SBI_CLIENT_WAIT: /* * ogs_pollset_poll() receives the time of the expiration
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
.