Projects
osmocom:nightly
open5gs
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 974
View file
open5gs_2.7.2.4616.ba05.202502192026.dsc -> open5gs_2.7.2.4617.6a22.202502202026.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-sepp, open5gs-ausf, open5gs-udm, open5gs-pcf, open5gs-nssf, open5gs-bsf, open5gs-udr, open5gs, open5gs-dbg Architecture: any -Version: 2.7.2.4616.ba05.202502192026 +Version: 2.7.2.4617.6a22.202502202026 Maintainer: Harald Welte <laforge@gnumonks.org> Uploaders: Sukchan Lee <acetcom@gmail.com> Homepage: https://open5gs.org @@ -32,8 +32,8 @@ open5gs-udr deb net optional arch=any open5gs-upf deb net optional arch=any Checksums-Sha1: - fd1ab99ce38fbd5049f8a7fadeae3ba2a8f0e3b4 14525752 open5gs_2.7.2.4616.ba05.202502192026.tar.xz + c2a3bb28aae18932a2990fbaf3290c9d2a48e427 14526944 open5gs_2.7.2.4617.6a22.202502202026.tar.xz Checksums-Sha256: - 964014513327ac654eaa4c5af14431c157fa0e723bb4b57b7b8bda864880399c 14525752 open5gs_2.7.2.4616.ba05.202502192026.tar.xz + e43e9a07b6554e0d1e4a124098aa08e1af5ae7a8588bdf3b42fac47bcd9a8631 14526944 open5gs_2.7.2.4617.6a22.202502202026.tar.xz Files: - a3757c6d259b0a533eb0e1e6a66b2943 14525752 open5gs_2.7.2.4616.ba05.202502192026.tar.xz + 1cb0341baa94282f657229ce010de221 14526944 open5gs_2.7.2.4617.6a22.202502202026.tar.xz
View file
open5gs_2.7.2.4616.ba05.202502192026.tar.xz/.tarball-version -> open5gs_2.7.2.4617.6a22.202502202026.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -2.7.2.4616-ba05.202502192026 +2.7.2.4617-6a22.202502202026
View file
open5gs_2.7.2.4616.ba05.202502192026.tar.xz/debian/changelog -> open5gs_2.7.2.4617.6a22.202502202026.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -open5gs (2.7.2.4616.ba05.202502192026) unstable; urgency=medium +open5gs (2.7.2.4617.6a22.202502202026) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom nightly feed - -- Osmocom OBS scripts <info@osmocom.org> Wed, 19 Feb 2025 20:27:56 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Thu, 20 Feb 2025 20:27:55 +0000 open5gs (2.7.2) unstable; urgency=medium
View file
open5gs_2.7.2.4616.ba05.202502192026.tar.xz/lib/sbi/custom/links.c -> open5gs_2.7.2.4617.6a22.202502202026.tar.xz/lib/sbi/custom/links.c
Changed
@@ -46,7 +46,8 @@ ogs_assert(linksJSON); cJSON_AddItemToObject(linksJSON, "items", itemsJSON); - cJSON_AddItemToObject(linksJSON, "self", selfJSON); + cJSON_AddItemToObject(linksJSON, "self", selfJSON); + cJSON_AddNumberToObject(linksJSON, "totalItemCount", cJSON_GetArraySize(itemsJSON)); /* root */ root = cJSON_CreateObject(); @@ -56,3 +57,57 @@ return root; } + +ogs_sbi_links_t *ogs_sbi_links_parseFromJSON(cJSON *json) +{ + ogs_sbi_links_t *links; + cJSON *_links = NULL; + cJSON *_items = NULL, *_item = NULL; + cJSON *_self = NULL; + + ogs_assert(json); + + _links = cJSON_GetObjectItemCaseSensitive(json, "_links"); + if (!_links) { + ogs_error("No _links"); + return NULL; + } + + _items = cJSON_GetObjectItemCaseSensitive(_links, "items"); + if (!_items) { + ogs_error("No items"); + return NULL; + } + + + links = ogs_malloc(sizeof(ogs_sbi_links_t)); + ogs_assert(links); + + memset(links, 0, sizeof(*links)); + links->items = OpenAPI_list_create(); + ogs_assert(links->items); + + + cJSON_ArrayForEach(_item, _items) { + cJSON *href; + char *link; + + href = cJSON_GetObjectItemCaseSensitive(_item, "href"); + if (href) { + link = cJSON_GetStringValue(href); + OpenAPI_list_add(links->items, ogs_strdup(link)); + } + } + + + _self = cJSON_GetObjectItemCaseSensitive(_links, "self"); + if (_self) { + cJSON *self_href; + + self_href = cJSON_GetObjectItemCaseSensitive(_self, "href"); + if (self_href) + links->self = ogs_strdup(cJSON_GetStringValue(self_href)); + } + + return links; +}
View file
open5gs_2.7.2.4616.ba05.202502192026.tar.xz/lib/sbi/custom/links.h -> open5gs_2.7.2.4617.6a22.202502202026.tar.xz/lib/sbi/custom/links.h
Changed
@@ -23,6 +23,7 @@ } ogs_sbi_links_t; cJSON *ogs_sbi_links_convertToJSON(ogs_sbi_links_t *links); +ogs_sbi_links_t *ogs_sbi_links_parseFromJSON(cJSON *json); #ifdef __cplusplus }
View file
open5gs_2.7.2.4616.ba05.202502192026.tar.xz/lib/sbi/message.c -> open5gs_2.7.2.4617.6a22.202502202026.tar.xz/lib/sbi/message.c
Changed
@@ -203,6 +203,13 @@ OpenAPI_ue_reg_status_update_req_data_free(message->UeRegStatusUpdateReqData); if (message->UeRegStatusUpdateRspData) OpenAPI_ue_reg_status_update_rsp_data_free(message->UeRegStatusUpdateRspData); + if (message->links) { + OpenAPI_clear_and_free_string_list(message->links->items); + if (message->links->self) + ogs_free(message->links->self); + + ogs_free(message->links); + } /* HTTP Part */ for (i = 0; i < message->num_of_part; i++) { @@ -1499,15 +1506,27 @@ SWITCH(message->h.resource.component0) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) - if (message->res_status < 300) { - message->NFProfile = - OpenAPI_nf_profile_parseFromJSON(item); - if (!message->NFProfile) { - rv = OGS_ERROR; - ogs_error("JSON parse error"); + if (message->h.resource.component1) { + if (message->res_status < 300) { + message->NFProfile = + OpenAPI_nf_profile_parseFromJSON(item); + if (!message->NFProfile) { + rv = OGS_ERROR; + ogs_error("JSON parse error"); + } + } else { + ogs_error("HTTP ERROR Status : %d", message->res_status); } } else { - ogs_error("HTTP ERROR Status : %d", message->res_status); + if (message->res_status < 300) { + message->links = ogs_sbi_links_parseFromJSON(item); + if (!message->links) { + rv = OGS_ERROR; + ogs_error("JSON parse error"); + } + } else { + ogs_error("HTTP ERROR Status : %d", message->res_status); + } } break;
View file
open5gs_2.7.2.4616.ba05.202502192026.tar.xz/lib/sbi/nf-sm.c -> open5gs_2.7.2.4617.6a22.202502202026.tar.xz/lib/sbi/nf-sm.c
Changed
@@ -19,6 +19,93 @@ #include "ogs-sbi.h" +static void handle_nf_profile_retrieval( + char *nf_instance_id, + OpenAPI_nf_profile_t *NFProfile) +{ + ogs_sbi_nf_instance_t *nf_instance; + ogs_sbi_subscription_spec_t *subscription_spec = NULL; + bool save = false; + + ogs_assert(nf_instance_id); + ogs_assert(NFProfile); + + nf_instance = ogs_sbi_nf_instance_find(nf_instance_id); + if (nf_instance) { + /* already have this nf_instance; done */ + return; + } + + if (NF_INSTANCE_ID_IS_SELF(nf_instance_id)) { + /* don't save ourselves */ + return; + } + + nf_instance = ogs_sbi_nf_instance_add(); + ogs_assert(nf_instance); + + ogs_sbi_nf_instance_set_id(nf_instance, nf_instance_id); + + ogs_nnrf_nfm_handle_nf_profile(nf_instance, NFProfile); + + /* verify against our subscription list that we want to save this + * nf instance to our context */ + ogs_list_for_each(&ogs_sbi_self()->subscription_spec_list, subscription_spec) { + ogs_sbi_nf_service_t *nf_service = NULL; + + if (subscription_spec->subscr_cond.nf_type == nf_instance->nf_type) { + /* ok; save the nf_instance */ + save = true; + break; + } + + ogs_list_for_each(&nf_instance->nf_service_list, nf_service) { + if (subscription_spec->subscr_cond.service_name && + nf_service->name && + !strcmp(subscription_spec->subscr_cond.service_name, nf_service->name)) + { + /* ok; save the nf_instance */ + save = true; + break; + } + } + + if (save) + break; + } + + if (!save) { + ogs_sbi_nf_instance_remove(nf_instance); + } else { + ogs_sbi_nf_fsm_init(nf_instance); + ogs_info("%s (NRF-profile-get) NF registered", nf_instance->id); + ogs_sbi_client_associate(nf_instance); + } +} + +static void handle_nf_list_retrieval(ogs_sbi_links_t *links) +{ + ogs_sbi_header_t header; + ogs_sbi_message_t msg; + OpenAPI_lnode_t *node = NULL; + + OpenAPI_list_for_each(links->items, node) { + + memset(&header, 0, sizeof(header)); + header.uri = node->data; + + if (ogs_sbi_parse_header(&msg, &header) != OGS_OK) { + ogs_error("Cannot parse href: %s", header.uri); + continue; + } + + if (msg.h.resource.component1) + ogs_nnrf_nfm_send_nf_profile_get(msg.h.resource.component1); + + ogs_sbi_header_free(&header); + } +} + void ogs_sbi_nf_fsm_init(ogs_sbi_nf_instance_t *nf_instance) { ogs_event_t e; @@ -227,6 +314,8 @@ subscription_spec->subscr_cond.nf_type, subscription_spec->subscr_cond.service_name); } + + ogs_nnrf_nfm_send_nf_list_retrieve(); } break; @@ -252,19 +341,64 @@ SWITCH(message->h.resource.component0) CASE(OGS_SBI_RESOURCE_NAME_NF_INSTANCES) - if (message->res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT || - message->res_status == OGS_SBI_HTTP_STATUS_OK) { - if (nf_instance->time.heartbeat_interval) - ogs_timer_start(nf_instance->t_no_heartbeat, - ogs_time_from_sec( - nf_instance->time.heartbeat_interval + - ogs_local_conf()->time.nf_instance. - no_heartbeat_margin)); + if (message->h.resource.component1) { + SWITCH(message->h.method) + CASE(OGS_SBI_HTTP_METHOD_PATCH) + if (message->res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT || + message->res_status == OGS_SBI_HTTP_STATUS_OK) { + + if (nf_instance->time.heartbeat_interval) + ogs_timer_start(nf_instance->t_no_heartbeat, + ogs_time_from_sec( + nf_instance->time.heartbeat_interval + + ogs_local_conf()->time.nf_instance. + no_heartbeat_margin)); + + } else { + ogs_warn("%s HTTP response error %d", + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance), + message->res_status); + OGS_FSM_TRAN(s, &ogs_sbi_nf_state_exception); + } + break; + + CASE(OGS_SBI_HTTP_METHOD_GET) + if (message->res_status == OGS_SBI_HTTP_STATUS_OK) { + if (!message->h.resource.component1) { + ogs_error("No NFInstanceId"); + break; + } + if (!message->NFProfile) { + ogs_error("No NFProfile"); + break; + } + handle_nf_profile_retrieval( + message->h.resource.component1, + message->NFProfile); + } else { + ogs_warn("%s HTTP response error %d", + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance), + message->res_status); + OGS_FSM_TRAN(s, &ogs_sbi_nf_state_exception); + } + break; + DEFAULT + ogs_error("Unknown method %s", message->h.method); + break; + END } else { - ogs_warn("%s HTTP response error %d", - NF_INSTANCE_ID(ogs_sbi_self()->nf_instance), - message->res_status); - OGS_FSM_TRAN(s, &ogs_sbi_nf_state_exception); + if (!message->links) { + ogs_warn("No links"); + break; + } + if (message->res_status != OGS_SBI_HTTP_STATUS_OK) { + ogs_warn("%s HTTP response error %d", + NF_INSTANCE_ID(ogs_sbi_self()->nf_instance), + message->res_status); + break; + } + + handle_nf_list_retrieval(message->links); } break;
View file
open5gs_2.7.2.4616.ba05.202502192026.tar.xz/lib/sbi/nnrf-build.c -> open5gs_2.7.2.4617.6a22.202502202026.tar.xz/lib/sbi/nnrf-build.c
Changed
@@ -1817,6 +1817,24 @@ return request; } +ogs_sbi_request_t *ogs_nnrf_nfm_build_nflist_retrieve(void) +{ + ogs_sbi_message_t message; + ogs_sbi_request_t *request = NULL; + + memset(&message, 0, sizeof(message)); + message.h.method = (char *)OGS_SBI_HTTP_METHOD_GET; + 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_NF_INSTANCES; + + request = ogs_sbi_build_request(&message); + ogs_expect(request); + + return request; +} + ogs_sbi_request_t *ogs_nnrf_disc_build_discover( OpenAPI_nf_type_e target_nf_type, OpenAPI_nf_type_e requester_nf_type,
View file
open5gs_2.7.2.4616.ba05.202502192026.tar.xz/lib/sbi/nnrf-build.h -> open5gs_2.7.2.4617.6a22.202502202026.tar.xz/lib/sbi/nnrf-build.h
Changed
@@ -42,6 +42,7 @@ 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); +ogs_sbi_request_t *ogs_nnrf_nfm_build_nflist_retrieve(void); ogs_sbi_request_t *ogs_nnrf_disc_build_discover( OpenAPI_nf_type_e target_nf_type,
View file
open5gs_2.7.2.4616.ba05.202502192026.tar.xz/lib/sbi/nnrf-path.c -> open5gs_2.7.2.4617.6a22.202502202026.tar.xz/lib/sbi/nnrf-path.c
Changed
@@ -180,3 +180,45 @@ return rc; } + +bool ogs_nnrf_nfm_send_nf_list_retrieve(void) +{ + bool rc; + ogs_sbi_request_t *request = NULL; + + request = ogs_nnrf_nfm_build_nflist_retrieve(); + if (!request) { + ogs_error("No Request"); + return false; + } + + rc = ogs_sbi_send_request_to_nrf( + OGS_SBI_SERVICE_TYPE_NNRF_NFM, NULL, + ogs_sbi_client_handler, request, ogs_sbi_self()->nf_instance); + ogs_expect(rc == true); + + ogs_sbi_request_free(request); + + return rc; +} + +bool ogs_nnrf_nfm_send_nf_profile_get(char *nf_instance_id) +{ + bool rc; + ogs_sbi_request_t *request = NULL; + + request = ogs_nnrf_nfm_build_profile_retrieve(nf_instance_id); + if (!request) { + ogs_error("No Request"); + return false; + } + + rc = ogs_sbi_send_request_to_nrf( + OGS_SBI_SERVICE_TYPE_NNRF_NFM, NULL, + ogs_sbi_client_handler, request, ogs_sbi_self()->nf_instance); + ogs_expect(rc == true); + + ogs_sbi_request_free(request); + + return rc; +}
View file
open5gs_2.7.2.4616.ba05.202502192026.tar.xz/lib/sbi/nnrf-path.h -> open5gs_2.7.2.4617.6a22.202502202026.tar.xz/lib/sbi/nnrf-path.h
Changed
@@ -37,6 +37,8 @@ ogs_sbi_subscription_data_t *subscription_data); bool ogs_nnrf_nfm_send_nf_status_unsubscribe( ogs_sbi_subscription_data_t *subscription_data); +bool ogs_nnrf_nfm_send_nf_list_retrieve(void); +bool ogs_nnrf_nfm_send_nf_profile_get(char *nf_instance_id); bool ogs_nnrf_nfm_send_to_nrf( ogs_sbi_client_t *client, ogs_sbi_client_cb_f client_cb,
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
.