Projects
osmocom:master
open5gs
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 435
View file
commit_bbdfca29bf90660579cfac873a69374d76da00e0.txt
Deleted
View file
commit_d3a779e7153b1962788e42f916e0148b0225dcda.txt
Added
View file
open5gs_2.7.0.130.bbdf.dsc
Deleted
@@ -1,39 +0,0 @@ -Format: 3.0 (native) -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.0.130.bbdf -Maintainer: Harald Welte <laforge@gnumonks.org> -Uploaders: Sukchan Lee <acetcom@gmail.com> -Homepage: https://open5gs.org -Standards-Version: 4.3.0 -Vcs-Browser: https://github.com/open5gs/open5gs -Vcs-Git: git://github.com/open5gs/open5gs -Build-Depends: debhelper (>= 11), git, pkg-config, meson (>= 0.43.0), cmake, flex, bison, libgnutls28-dev, libgcrypt-dev, libssl-dev, libidn11-dev, libmongoc-dev, libbson-dev, libsctp-dev, libyaml-dev, libmicrohttpd-dev, libcurl4-gnutls-dev, libnghttp2-dev, libtins-dev, libtalloc-dev -Package-List: - open5gs deb net optional arch=any - open5gs-amf deb net optional arch=any - open5gs-ausf deb net optional arch=any - open5gs-bsf deb net optional arch=any - open5gs-common deb net optional arch=any - open5gs-dbg deb net optional arch=any - open5gs-hss deb net optional arch=any - open5gs-mme deb net optional arch=any - open5gs-nrf deb net optional arch=any - open5gs-nssf deb net optional arch=any - open5gs-pcf deb net optional arch=any - open5gs-pcrf deb net optional arch=any - open5gs-scp deb net optional arch=any - open5gs-sepp deb net optional arch=any - open5gs-sgwc deb net optional arch=any - open5gs-sgwu deb net optional arch=any - open5gs-smf deb net optional arch=any - open5gs-udm deb net optional arch=any - open5gs-udr deb net optional arch=any - open5gs-upf deb net optional arch=any -Checksums-Sha1: - 52d54fef9ca2b44ec01294877cd4d94d324f735e 14489080 open5gs_2.7.0.130.bbdf.tar.xz -Checksums-Sha256: - fc06cc739d68331468a2175331f4273c1c2b4f39cce116a99e993808101dca59 14489080 open5gs_2.7.0.130.bbdf.tar.xz -Files: - 31f8500c3c953ec86b2fd63c11f749ed 14489080 open5gs_2.7.0.130.bbdf.tar.xz
View file
open5gs_2.7.0.134.d3a7.dsc
Added
@@ -0,0 +1,39 @@ +Format: 3.0 (native) +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.0.134.d3a7 +Maintainer: Harald Welte <laforge@gnumonks.org> +Uploaders: Sukchan Lee <acetcom@gmail.com> +Homepage: https://open5gs.org +Standards-Version: 4.3.0 +Vcs-Browser: https://github.com/open5gs/open5gs +Vcs-Git: git://github.com/open5gs/open5gs +Build-Depends: debhelper (>= 11), git, pkg-config, meson (>= 0.43.0), cmake, flex, bison, libgnutls28-dev, libgcrypt-dev, libssl-dev, libidn11-dev, libmongoc-dev, libbson-dev, libsctp-dev, libyaml-dev, libmicrohttpd-dev, libcurl4-gnutls-dev, libnghttp2-dev, libtins-dev, libtalloc-dev +Package-List: + open5gs deb net optional arch=any + open5gs-amf deb net optional arch=any + open5gs-ausf deb net optional arch=any + open5gs-bsf deb net optional arch=any + open5gs-common deb net optional arch=any + open5gs-dbg deb net optional arch=any + open5gs-hss deb net optional arch=any + open5gs-mme deb net optional arch=any + open5gs-nrf deb net optional arch=any + open5gs-nssf deb net optional arch=any + open5gs-pcf deb net optional arch=any + open5gs-pcrf deb net optional arch=any + open5gs-scp deb net optional arch=any + open5gs-sepp deb net optional arch=any + open5gs-sgwc deb net optional arch=any + open5gs-sgwu deb net optional arch=any + open5gs-smf deb net optional arch=any + open5gs-udm deb net optional arch=any + open5gs-udr deb net optional arch=any + open5gs-upf deb net optional arch=any +Checksums-Sha1: + 7168bdc6758c9835f44f9bab801759bfa93c3707 14490140 open5gs_2.7.0.134.d3a7.tar.xz +Checksums-Sha256: + 27ff53dd6ea9afb74483b29f6fe9df4f1085795daee61dbb8f17080ad415f5d8 14490140 open5gs_2.7.0.134.d3a7.tar.xz +Files: + c921164d4b6006ba7a0ba6ec63276cf1 14490140 open5gs_2.7.0.134.d3a7.tar.xz
View file
open5gs_2.7.0.130.bbdf.tar.xz/.tarball-version -> open5gs_2.7.0.134.d3a7.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -2.7.0.130-bbdf +2.7.0.134-d3a7
View file
open5gs_2.7.0.130.bbdf.tar.xz/debian/changelog -> open5gs_2.7.0.134.d3a7.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -open5gs (2.7.0.130.bbdf) unstable; urgency=medium +open5gs (2.7.0.134.d3a7) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom master feed - -- Osmocom OBS scripts <info@osmocom.org> Sun, 07 Apr 2024 14:13:31 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Mon, 08 Apr 2024 22:42:01 +0000 open5gs (2.7.0) unstable; urgency=medium
View file
open5gs_2.7.0.130.bbdf.tar.xz/lib/diameter/common/logger.c -> open5gs_2.7.0.134.d3a7.tar.xz/lib/diameter/common/logger.c
Changed
@@ -27,8 +27,8 @@ static ogs_diam_logger_user_handler user_handler = NULL; -static void ogs_diam_logger_cb(enum fd_hook_type type, struct msg * msg, - struct peer_hdr * peer, void * other, struct fd_hook_permsgdata *pmd, +static void ogs_diam_logger_cb(enum fd_hook_type type, struct msg * msg, + struct peer_hdr * peer, void * other, struct fd_hook_permsgdata *pmd, void * regdata); static void * diam_stats_worker(void * arg); @@ -41,7 +41,7 @@ self.mode = mode; self.duration = 60; /* 60 seconds */ - CHECK_FCT( fd_hook_register( + CHECK_FCT( fd_hook_register( mask_peers, ogs_diam_logger_cb, NULL, NULL, &logger_hdl) ); CHECK_POSIX( pthread_mutex_init(&self.stats_lock, NULL) ); @@ -81,8 +81,8 @@ } /* The callback called when messages are received and sent */ -static void ogs_diam_logger_cb(enum fd_hook_type type, struct msg * msg, - struct peer_hdr * peer, void * other, struct fd_hook_permsgdata *pmd, +static void ogs_diam_logger_cb(enum fd_hook_type type, struct msg * msg, + struct peer_hdr * peer, void * other, struct fd_hook_permsgdata *pmd, void * regdata) { const char * peer_name = peer ? peer->info.pi_diamid : "<unknown peer>"; @@ -117,7 +117,7 @@ } /* Function to display statistics periodically */ -static void * diam_stats_worker(void * arg) +static void * diam_stats_worker(void * arg) { struct timespec start, now; struct fd_stats copy; @@ -146,7 +146,7 @@ (int)(now.tv_sec - start.tv_sec), (long)(now.tv_nsec - start.tv_nsec) / 1000); } - else + else { ogs_trace(" Executing for: %d.%06ld sec", (int)(now.tv_sec - 1 - start.tv_sec), @@ -154,7 +154,7 @@ } if (self.mode & FD_MODE_SERVER) { - ogs_trace(" Server: %llu message(s) echoed", + ogs_trace(" Server: %llu message(s) echoed", copy.nb_echoed); } if (self.mode & FD_MODE_CLIENT) { @@ -162,11 +162,11 @@ ogs_trace(" %llu message(s) sent", copy.nb_sent); ogs_trace(" %llu error(s) received", copy.nb_errs); ogs_trace(" %llu answer(s) received", copy.nb_recv); - ogs_trace(" fastest: %ld.%06ld sec.", + ogs_trace(" fastest: %ld.%06ld sec.", copy.shortest / 1000000, copy.shortest % 1000000); - ogs_trace(" slowest: %ld.%06ld sec.", + ogs_trace(" slowest: %ld.%06ld sec.", copy.longest / 1000000, copy.longest % 1000000); - ogs_trace(" Average: %ld.%06ld sec.", + ogs_trace(" Average: %ld.%06ld sec.", copy.avg / 1000000, copy.avg % 1000000); } ogs_trace("-------------------------------------");
View file
open5gs_2.7.0.130.bbdf.tar.xz/lib/diameter/common/logger.h -> open5gs_2.7.0.134.d3a7.tar.xz/lib/diameter/common/logger.h
Changed
@@ -33,7 +33,7 @@ #define FD_MODE_SERVER 0x1 #define FD_MODE_CLIENT 0x2 int mode; /* default FD_MODE_SERVER | FD_MODE_CLIENT */ - + int duration; /* default 10 */ struct fd_stats { unsigned long long nb_echoed; /* server */ @@ -56,7 +56,7 @@ int ogs_diam_logger_stats_start(void); typedef void (*ogs_diam_logger_user_handler)( - enum fd_hook_type type, struct msg *msg, struct peer_hdr *peer, + enum fd_hook_type type, struct msg *msg, struct peer_hdr *peer, void *other, struct fd_hook_permsgdata *pmd, void *regdata); void ogs_diam_logger_register(ogs_diam_logger_user_handler instance);
View file
open5gs_2.7.0.130.bbdf.tar.xz/lib/diameter/gy/message.h -> open5gs_2.7.0.134.d3a7.tar.xz/lib/diameter/gy/message.h
Changed
@@ -40,8 +40,10 @@ #define OGS_DIAM_GY_AVP_CODE_CC_REQUEST_TYPE (416) #define OGS_DIAM_GY_AVP_CODE_CC_TIME (420) #define OGS_DIAM_GY_AVP_CODE_CC_TOTAL_OCTETS (421) +#define OGS_DIAM_GY_AVP_CODE_FINAL_UNIT_INDICATION (430) #define OGS_DIAM_GY_AVP_CODE_GRANTED_SERVICE_UNIT (431) #define OGS_DIAM_GY_AVP_CODE_VALIDITY_TIME (448) +#define OGS_DIAM_GY_AVP_CODE_FINAL_UNIT_ACTION (449) #define OGS_DIAM_GY_AVP_CODE_MULTIPLE_SERVICES_CREDIT_CONTROL (456) #define OGS_DIAM_GY_AVP_CODE_SUPPORTED_FEATURES (628) #define OGS_DIAM_GY_AVP_CODE_TIME_QUOTA_THRESHOLD (868) @@ -155,6 +157,14 @@ uint64_t cc_output_octets; } ogs_diam_gy_service_unit_t; +typedef struct gs_diam_gy_final_unit_s { + bool cc_final_action_present; +#define OGS_DIAM_GY_FINAL_UNIT_ACTION_TERMINATE 0 +#define OGS_DIAM_GY_FINAL_UNIT_ACTION_REDIRECT 1 +#define OGS_DIAM_GY_FINAL_UNIT_ACTION_REDIRECT_ACCESS 2 + int32_t cc_final_action; +} ogs_diam_gy_final_unit_t; + typedef struct ogs_diam_gy_message_s { #define OGS_DIAM_GY_CMD_CODE_CREDIT_CONTROL 272 #define OGS_DIAM_GY_CMD_RE_AUTH 258 @@ -187,6 +197,7 @@ uint32_t time_threshold; uint32_t volume_threshold; ogs_diam_gy_service_unit_t granted; + ogs_diam_gy_final_unit_t final; uint32_t result_code; uint32_t *err; } cca;
View file
open5gs_2.7.0.130.bbdf.tar.xz/src/hss/hss-context.c -> open5gs_2.7.0.134.d3a7.tar.xz/src/hss/hss-context.c
Changed
@@ -337,6 +337,8 @@ #else self.use_mongodb_change_stream = false; #endif + } else if (!strcmp(hss_key, "metrics")) { + /* handle config in metrics library */ } else ogs_warn("unknown key `%s`", hss_key); } @@ -519,6 +521,7 @@ ogs_hash_set(self.imsi_hash, imsi->id, strlen(imsi->id), imsi); ogs_list_add(&self.imsi_list, imsi); + hss_metrics_inst_global_inc(HSS_METR_GLOB_GAUGE_IMSI); return imsi; } @@ -528,6 +531,7 @@ ogs_assert(imsi); ogs_list_remove(&self.imsi_list, imsi); + hss_metrics_inst_global_dec(HSS_METR_GLOB_GAUGE_IMSI); ogs_assert(imsi->id); ogs_hash_set(self.imsi_hash, imsi->id, strlen(imsi->id), NULL); @@ -569,6 +573,7 @@ ogs_hash_set(self.impi_hash, impi->id, strlen(impi->id), impi); ogs_list_add(&self.impi_list, impi); + hss_metrics_inst_global_inc(HSS_METR_GLOB_GAUGE_IMPI); return impi; } @@ -578,6 +583,7 @@ ogs_assert(impi); ogs_list_remove(&self.impi_list, impi); + hss_metrics_inst_global_dec(HSS_METR_GLOB_GAUGE_IMPI); impu_remove_all(impi); @@ -633,7 +639,9 @@ ogs_hash_set(self.impu_hash, impu->id, strlen(impu->id), impu); impu->impi = impi; + ogs_list_add(&impi->impu_list, impu); + hss_metrics_inst_global_inc(HSS_METR_GLOB_GAUGE_IMPU); return impu; } @@ -647,6 +655,7 @@ ogs_assert(impi); ogs_list_remove(&impi->impu_list, impu); + hss_metrics_inst_global_dec(HSS_METR_GLOB_GAUGE_IMPU); ogs_assert(impu->id); ogs_hash_set(self.impu_hash, impu->id, strlen(impu->id), NULL);
View file
open5gs_2.7.0.130.bbdf.tar.xz/src/hss/hss-context.h -> open5gs_2.7.0.134.d3a7.tar.xz/src/hss/hss-context.h
Changed
@@ -25,6 +25,7 @@ #include "ogs-diameter-swx.h" #include "ogs-dbi.h" #include "ogs-app.h" +#include "metrics.h" #ifdef __cplusplus extern "C" {
View file
open5gs_2.7.0.130.bbdf.tar.xz/src/hss/hss-cx-path.c -> open5gs_2.7.0.134.d3a7.tar.xz/src/hss/hss-cx-path.c
Changed
@@ -34,17 +34,18 @@ static struct disp_hdl *hdl_cx_lir = NULL; /* Default callback for the application. */ -static int hss_ogs_diam_cx_fb_cb(struct msg **msg, struct avp *avp, +static int hss_ogs_diam_cx_fb_cb(struct msg **msg, struct avp *avp, struct session *session, void *opaque, enum disp_action *act) { /* This CB should never be called */ ogs_warn("Unexpected message received!"); + hss_metrics_inst_global_inc(HSS_METR_GLOB_CTR_CX_RX_UNKNOWN); return ENOTSUP; } /* Callback for incoming User-Authorization-Request messages */ -static int hss_ogs_diam_cx_uar_cb( struct msg **msg, struct avp *avp, +static int hss_ogs_diam_cx_uar_cb( struct msg **msg, struct avp *avp, struct session *session, void *opaque, enum disp_action *act) { int rv, ret; @@ -66,7 +67,8 @@ ogs_assert(msg); - ogs_debug("User-Authorization-Request"); + ogs_debug("Rx User-Authorization-Request"); + hss_metrics_inst_global_inc(HSS_METR_GLOB_CTR_CX_RX_UAR); /* Create answer header */ qry = *msg; @@ -250,7 +252,8 @@ ogs_assert(msg); - ogs_debug("Multimedia-Auth-Request"); + ogs_debug("Rx Multimedia-Auth-Request"); + hss_metrics_inst_global_inc(HSS_METR_GLOB_CTR_CX_RX_MAR); /* Create answer header */ qry = *msg; @@ -627,7 +630,8 @@ ogs_assert(msg); - ogs_debug("Server-Assignment-Request"); + ogs_debug("Rx Server-Assignment-Request"); + hss_metrics_inst_global_inc(HSS_METR_GLOB_CTR_CX_RX_SAR); /* Create answer header */ qry = *msg; @@ -875,7 +879,8 @@ ogs_assert(msg); - ogs_debug("Location-Info-Request"); + ogs_debug("Rx Location-Info-Request"); + hss_metrics_inst_global_inc(HSS_METR_GLOB_CTR_CX_RX_LIR); /* Create answer header */ qry = *msg;
View file
open5gs_2.7.0.130.bbdf.tar.xz/src/hss/hss-init.c -> open5gs_2.7.0.134.d3a7.tar.xz/src/hss/hss-init.c
Changed
@@ -20,6 +20,7 @@ #include "hss-context.h" #include "hss-fd-path.h" #include "hss-sm.h" +#include "metrics.h" static ogs_thread_t *thread; @@ -35,9 +36,14 @@ rv = ogs_app_parse_local_conf(APP_NAME); if (rv != OGS_OK) return rv; + hss_metrics_init(); + hss_context_init(); hss_event_init(); + rv = ogs_metrics_context_parse_config(APP_NAME); + if (rv != OGS_OK) return rv; + rv = hss_context_parse_config(); if (rv != OGS_OK) return rv; @@ -45,6 +51,8 @@ ogs_app()->logger.domain, ogs_app()->logger.level); if (rv != OGS_OK) return rv; + ogs_metrics_context_open(ogs_metrics_self()); + rv = ogs_dbi_init(ogs_app()->db_uri); if (rv != OGS_OK) return rv; @@ -65,12 +73,14 @@ hss_event_term(); ogs_thread_destroy(thread); + ogs_metrics_context_close(ogs_metrics_self()); hss_fd_final(); ogs_dbi_final(); hss_context_final(); hss_event_final(); + hss_metrics_final(); return; }
View file
open5gs_2.7.0.130.bbdf.tar.xz/src/hss/hss-s6a-path.c -> open5gs_2.7.0.134.d3a7.tar.xz/src/hss/hss-s6a-path.c
Changed
@@ -58,6 +58,7 @@ { /* This CB should never be called */ ogs_warn("Unexpected message received!"); + hss_metrics_inst_global_inc(HSS_METR_GLOB_CTR_S6A_RX_UNKNOWN); return ENOTSUP; } @@ -96,7 +97,8 @@ ogs_assert(msg); - ogs_debug("Authentication-Information-Request"); + ogs_debug("Rx Authentication-Information-Request"); + hss_metrics_inst_global_inc(HSS_METR_GLOB_CTR_S6A_RX_AIR); /* Create answer header */ qry = *msg; @@ -765,7 +767,8 @@ ogs_assert(msg); - ogs_debug("Update-Location-Request"); + ogs_debug("Rx Update-Location-Request"); + hss_metrics_inst_global_inc(HSS_METR_GLOB_CTR_S6A_RX_ULR); memset(&subscription_data, 0, sizeof(ogs_subscription_data_t)); @@ -1032,7 +1035,8 @@ ogs_assert(msg); - ogs_debug("Purge-UE-Request"); + ogs_debug("Rx Purge-UE-Request"); + hss_metrics_inst_global_inc(HSS_METR_GLOB_CTR_S6A_RX_PUR); memset(&subscription_data, 0, sizeof(ogs_subscription_data_t)); @@ -1167,7 +1171,7 @@ struct sess_state *sess_data = NULL, *svg; struct session *session = NULL; - ogs_debug("HSS Cancel-Location-Request"); + ogs_debug("HSS Tx Cancel-Location-Request"); /* Create the random value to store with the session */ sess_data = ogs_calloc(1, sizeof(*sess_data)); @@ -1276,6 +1280,8 @@ ret = fd_msg_send(&req, hss_s6a_cla_cb, svg); ogs_assert(ret == 0); + hss_metrics_inst_global_inc(HSS_METR_GLOB_CTR_S6A_TX_CLR); + /* Increment the counter */ ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0); ogs_diam_logger_self()->stats.nb_sent++; @@ -1292,7 +1298,8 @@ struct session *session; int new; - ogs_debug("HSS Cancel-Location-Answer"); + ogs_debug("HSS Rx Cancel-Location-Answer"); + hss_metrics_inst_global_inc(HSS_METR_GLOB_CTR_S6A_RX_CLA); /* Search the session, retrieve its data */ ret = fd_msg_sess_get(fd_g_config->cnf_dict, *msg, &session, &new); @@ -1341,7 +1348,7 @@ ogs_subscription_data_t subscription_data; - ogs_debug("HSS Insert-Subscriber-Data-Request"); + ogs_debug("HSS Tx Insert-Subscriber-Data-Request"); memset(&subscription_data, 0, sizeof(ogs_subscription_data_t)); @@ -1477,6 +1484,8 @@ ret = fd_msg_send(&req, hss_s6a_ida_cb, svg); ogs_assert(ret == 0); + hss_metrics_inst_global_inc(HSS_METR_GLOB_CTR_S6A_TX_IDR); + /* Increment the counter */ ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0); ogs_diam_logger_self()->stats.nb_sent++; @@ -1496,7 +1505,8 @@ struct session *session; int new; - ogs_debug("HSS Insert-Subscriber-Data-Answer"); + ogs_debug("HSS Rx Insert-Subscriber-Data-Answer"); + hss_metrics_inst_global_inc(HSS_METR_GLOB_CTR_S6A_RX_IDA); /* Search the session, retrieve its data */ ret = fd_msg_sess_get(fd_g_config->cnf_dict, *msg, &session, &new);
View file
open5gs_2.7.0.130.bbdf.tar.xz/src/hss/meson.build -> open5gs_2.7.0.134.d3a7.tar.xz/src/hss/meson.build
Changed
@@ -22,6 +22,7 @@ hss-event.h hss-timer.h hss-sm.h + metrics.h hss-init.c hss-context.c @@ -34,11 +35,14 @@ hss-swx-path.c hss-fd-path.c + + metrics.c '''.split()) libhss = static_library('hss', sources : libhss_sources, - dependencies : libapp_dep, + dependencies : libmetrics_dep, + libapp_dep, libcrypt_dep, libdbi_dep, libdiameter_s6a_dep, @@ -48,7 +52,8 @@ libhss_dep = declare_dependency( link_with : libhss, - dependencies : libapp_dep, + dependencies : libmetrics_dep, + libapp_dep, libcrypt_dep, libdbi_dep, libdiameter_s6a_dep,
View file
open5gs_2.7.0.134.d3a7.tar.xz/src/hss/metrics.c
Added
@@ -0,0 +1,159 @@ +#include "ogs-app.h" +#include "hss-context.h" + +#include "metrics.h" + +typedef struct hss_metrics_spec_def_s { + unsigned int type; + const char *name; + const char *description; + int initial_val; + unsigned int num_labels; + const char **labels; +} hss_metrics_spec_def_t; + +/* Helper generic functions: */ +static int hss_metrics_init_inst(ogs_metrics_inst_t **inst, ogs_metrics_spec_t **specs, + unsigned int len, unsigned int num_labels, const char **labels) +{ + unsigned int i; + for (i = 0; i < len; i++) + insti = ogs_metrics_inst_new(specsi, num_labels, labels); + return OGS_OK; +} + +static int hss_metrics_free_inst(ogs_metrics_inst_t **inst, + unsigned int len) +{ + unsigned int i; + for (i = 0; i < len; i++) + ogs_metrics_inst_free(insti); + memset(inst, 0, sizeof(inst0) * len); + return OGS_OK; +} + +static int hss_metrics_init_spec(ogs_metrics_context_t *ctx, + ogs_metrics_spec_t **dst, hss_metrics_spec_def_t *src, unsigned int len) +{ + unsigned int i; + for (i = 0; i < len; i++) { + dsti = ogs_metrics_spec_new(ctx, srci.type, + srci.name, srci.description, + srci.initial_val, srci.num_labels, srci.labels, + NULL); + } + return OGS_OK; +} + +/* GLOBAL */ +ogs_metrics_spec_t *hss_metrics_spec_global_HSS_METR_GLOB_MAX; +ogs_metrics_inst_t *hss_metrics_inst_global_HSS_METR_GLOB_MAX; +hss_metrics_spec_def_t hss_metrics_spec_def_global_HSS_METR_GLOB_MAX = { +/* Global Counters: */ +HSS_METR_GLOB_CTR_CX_RX_UNKNOWN = { + .type = OGS_METRICS_METRIC_TYPE_COUNTER, + .name = "cx_rx_unknown", + .description = "Received Cx unknown messages", +}, +HSS_METR_GLOB_CTR_CX_RX_MAR = { + .type = OGS_METRICS_METRIC_TYPE_COUNTER, + .name = "cx_rx_mar", + .description = "Received Cx MAR messages", +}, +HSS_METR_GLOB_CTR_CX_RX_SAR = { + .type = OGS_METRICS_METRIC_TYPE_COUNTER, + .name = "cx_rx_sar", + .description = "Received Cx SAR messages", +}, +HSS_METR_GLOB_CTR_CX_RX_UAR = { + .type = OGS_METRICS_METRIC_TYPE_COUNTER, + .name = "cx_rx_uar", + .description = "Received Cx UAR messages", +}, +HSS_METR_GLOB_CTR_CX_RX_LIR = { + .type = OGS_METRICS_METRIC_TYPE_COUNTER, + .name = "cx_rx_lir", + .description = "Received Cx LIR messages", +}, +HSS_METR_GLOB_CTR_S6A_RX_UNKNOWN = { + .type = OGS_METRICS_METRIC_TYPE_COUNTER, + .name = "s6a_rx_unknown", + .description = "Received s6a unknown messages", +}, +HSS_METR_GLOB_CTR_S6A_RX_AIR = { + .type = OGS_METRICS_METRIC_TYPE_COUNTER, + .name = "s6a_rx_air", + .description = "Received s6a AIR messages", +}, +HSS_METR_GLOB_CTR_S6A_RX_CLA = { + .type = OGS_METRICS_METRIC_TYPE_COUNTER, + .name = "s6a_rx_cla", + .description = "Received s6a CLA messages", +}, +HSS_METR_GLOB_CTR_S6A_RX_IDA = { + .type = OGS_METRICS_METRIC_TYPE_COUNTER, + .name = "s6a_rx_ida", + .description = "Received s6a IDA messages", +}, +HSS_METR_GLOB_CTR_S6A_RX_PUR = { + .type = OGS_METRICS_METRIC_TYPE_COUNTER, + .name = "s6a_rx_pur", + .description = "Received s6a PUR messages", +}, +HSS_METR_GLOB_CTR_S6A_RX_ULR = { + .type = OGS_METRICS_METRIC_TYPE_COUNTER, + .name = "s6a_rx_ulr", + .description = "Received s6a ULR messages", +}, +HSS_METR_GLOB_CTR_S6A_TX_CLR = { + .type = OGS_METRICS_METRIC_TYPE_COUNTER, + .name = "s6a_tx_clr", + .description = "Transmitted s6a CLR messages", +}, +HSS_METR_GLOB_CTR_S6A_TX_IDR = { + .type = OGS_METRICS_METRIC_TYPE_COUNTER, + .name = "s6a_tx_idr", + .description = "Transmitted s6a IDR messages", +}, +/* Global Gauges: */ +HSS_METR_GLOB_GAUGE_IMSI = { + .type = OGS_METRICS_METRIC_TYPE_GAUGE, + .name = "hss_imsi", + .description = "Number of IMSIs attached to HSS", +}, +HSS_METR_GLOB_GAUGE_IMPI = { + .type = OGS_METRICS_METRIC_TYPE_GAUGE, + .name = "hss_impi", + .description = "Number of IMPIs attached to HSS", +}, +HSS_METR_GLOB_GAUGE_IMPU = { + .type = OGS_METRICS_METRIC_TYPE_GAUGE, + .name = "hss_impu", + .description = "Number of IMPUs attached to HSS", +}, +}; +int hss_metrics_init_inst_global(void) +{ + return hss_metrics_init_inst(hss_metrics_inst_global, hss_metrics_spec_global, + _HSS_METR_GLOB_MAX, 0, NULL); +} +int hss_metrics_free_inst_global(void) +{ + return hss_metrics_free_inst(hss_metrics_inst_global, _HSS_METR_GLOB_MAX); +} + +void hss_metrics_init(void) +{ + ogs_metrics_context_t *ctx = ogs_metrics_self(); + ogs_metrics_context_init(); + + hss_metrics_init_spec(ctx, hss_metrics_spec_global, hss_metrics_spec_def_global, + _HSS_METR_GLOB_MAX); + + hss_metrics_init_inst_global(); +} + +void hss_metrics_final(void) +{ + ogs_metrics_context_final(); +}
View file
open5gs_2.7.0.134.d3a7.tar.xz/src/hss/metrics.h
Added
@@ -0,0 +1,51 @@ +#ifndef HSS_METRICS_H +#define HSS_METRICS_H + +#include "ogs-metrics.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* GLOBAL */ +typedef enum hss_metric_type_global_s { + HSS_METR_GLOB_CTR_CX_RX_UNKNOWN, + HSS_METR_GLOB_CTR_CX_RX_MAR, + HSS_METR_GLOB_CTR_CX_RX_SAR, + HSS_METR_GLOB_CTR_CX_RX_UAR, + HSS_METR_GLOB_CTR_CX_RX_LIR, + HSS_METR_GLOB_CTR_S6A_RX_UNKNOWN, + HSS_METR_GLOB_CTR_S6A_RX_AIR, + HSS_METR_GLOB_CTR_S6A_RX_CLA, + HSS_METR_GLOB_CTR_S6A_RX_IDA, + HSS_METR_GLOB_CTR_S6A_RX_PUR, + HSS_METR_GLOB_CTR_S6A_RX_ULR, + HSS_METR_GLOB_CTR_S6A_TX_CLR, + HSS_METR_GLOB_CTR_S6A_TX_IDR, + HSS_METR_GLOB_GAUGE_IMSI, + HSS_METR_GLOB_GAUGE_IMPI, + HSS_METR_GLOB_GAUGE_IMPU, + _HSS_METR_GLOB_MAX, +} hss_metric_type_global_t; +extern ogs_metrics_inst_t *hss_metrics_inst_global_HSS_METR_GLOB_MAX; + +int hss_metrics_init_inst_global(void); +int hss_metrics_free_inst_global(void); + +static inline void hss_metrics_inst_global_set(hss_metric_type_global_t t, int val) +{ ogs_metrics_inst_set(hss_metrics_inst_globalt, val); } +static inline void hss_metrics_inst_global_add(hss_metric_type_global_t t, int val) +{ ogs_metrics_inst_add(hss_metrics_inst_globalt, val); } +static inline void hss_metrics_inst_global_inc(hss_metric_type_global_t t) +{ ogs_metrics_inst_inc(hss_metrics_inst_globalt); } +static inline void hss_metrics_inst_global_dec(hss_metric_type_global_t t) +{ ogs_metrics_inst_dec(hss_metrics_inst_globalt); } + +void hss_metrics_init(void); +void hss_metrics_final(void); + +#ifdef __cplusplus +} +#endif + +#endif /* HSS_METRICS_H */
View file
open5gs_2.7.0.130.bbdf.tar.xz/src/smf/context.h -> open5gs_2.7.0.134.d3a7.tar.xz/src/smf/context.h
Changed
@@ -357,6 +357,9 @@ uint64_t dl_octets; ogs_time_t duration; uint32_t reporting_reason; /* OGS_DIAM_GY_REPORTING_REASON_* */ + /* Whether Gy Final-Unit-Indication was received. + * Triggers session release upon Rx of next PFCP Report Req */ + bool final_unit; /* Snapshot of measurement when last report was sent: */ struct { uint64_t ul_octets;
View file
open5gs_2.7.0.130.bbdf.tar.xz/src/smf/gsm-sm.c -> open5gs_2.7.0.134.d3a7.tar.xz/src/smf/gsm-sm.c
Changed
@@ -727,6 +727,7 @@ ogs_pfcp_xact_t *pfcp_xact = NULL; ogs_pfcp_message_t *pfcp_message = NULL; + uint8_t pfcp_cause; ogs_diam_gy_message_t *gy_message = NULL; uint32_t diam_err; @@ -838,6 +839,14 @@ OGS_FSM_TRAN(s, smf_gsm_state_epc_session_will_release); break; + case OGS_PFCP_SESSION_REPORT_REQUEST_TYPE: + pfcp_cause = smf_n4_handle_session_report_request(sess, pfcp_xact, + &pfcp_message->pfcp_session_report_request); + if (pfcp_cause != OGS_PFCP_CAUSE_REQUEST_ACCEPTED) { + OGS_FSM_TRAN(s, smf_gsm_state_wait_pfcp_deletion); + } + break; + default: ogs_error("cannot handle PFCP message type%d", pfcp_message->h.type);
View file
open5gs_2.7.0.130.bbdf.tar.xz/src/smf/gy-handler.c -> open5gs_2.7.0.134.d3a7.tar.xz/src/smf/gy-handler.c
Changed
@@ -164,6 +164,7 @@ /* Configure based on what we received from OCS: */ urr_update_time(sess, bearer->urr, gy_message); urr_update_volume(sess, bearer->urr, gy_message); + sess->gy.final_unit = gy_message->cca.final.cc_final_action_present; /* Associate acconting URR each direction PDR: */ ogs_pfcp_pdr_associate_urr(bearer->ul_pdr, bearer->urr); @@ -221,6 +222,7 @@ urr_update_time(sess, urr, gy_message); urr_update_volume(sess, urr, gy_message); + sess->gy.final_unit = gy_message->cca.final.cc_final_action_present; /* Associate accounting URR each direction PDR: */ ogs_pfcp_pdr_associate_urr(bearer->ul_pdr, urr); ogs_pfcp_pdr_associate_urr(bearer->dl_pdr, urr);
View file
open5gs_2.7.0.130.bbdf.tar.xz/src/smf/gy-path.c -> open5gs_2.7.0.134.d3a7.tar.xz/src/smf/gy-path.c
Changed
@@ -48,6 +48,8 @@ static int decode_granted_service_unit( ogs_diam_gy_service_unit_t *su, struct avp *avpch1, int *perror); +static int decode_final_unit_indication( + ogs_diam_gy_final_unit_t *fu, struct avp *avpch1, int *perror); static void smf_gy_cca_cb(void *data, struct msg **msg); static __inline__ struct sess_state *new_state(os0_t sid) @@ -1149,6 +1151,11 @@ case OGS_DIAM_GY_AVP_CODE_VOLUME_QUOTA_THRESHOLD: gy_message->cca.volume_threshold = hdr->avp_value->u32; break; + case OGS_DIAM_GY_AVP_CODE_FINAL_UNIT_INDICATION: + rv = decode_final_unit_indication( + &gy_message->cca.final, avpch1, &error); + ogs_assert(rv == OGS_OK); + break; default: ogs_warn("Not supported(%d)", hdr->avp_code); break; @@ -1455,6 +1462,45 @@ default: ogs_error("Not implemented(%d)", hdr->avp_code); break; + } + fd_msg_browse(avpch2, MSG_BRW_NEXT, &avpch2, NULL); + } + + if (perror) + *perror = error; + + return OGS_OK; +} + +static int decode_final_unit_indication( + ogs_diam_gy_final_unit_t *fu, struct avp *avpch1, int *perror) +{ + int ret = 0, error = 0; + struct avp *avpch2; + struct avp_hdr *hdr; + + ogs_assert(fu); + ogs_assert(avpch1); + memset(fu, 0, sizeof(*fu)); + + ret = fd_msg_browse(avpch1, MSG_BRW_FIRST_CHILD, &avpch2, NULL); + ogs_assert(ret == 0); + while (avpch2) { + ret = fd_msg_avp_hdr(avpch2, &hdr); + ogs_assert(ret == 0); + switch (hdr->avp_code) { + case OGS_DIAM_GY_AVP_CODE_FINAL_UNIT_ACTION: + fu->cc_final_action_present = true; + fu->cc_final_action = hdr->avp_value->i32; + break; + /* TODO: + case OGS_DIAM_GY_AVP_CODE_REDIRECT_SERVER: + case OGS_DIAM_GY_AVP_CODE_FILTER_ID: + case OGS_DIAM_GY_AVP_CODE_RESTRICTION_FILTER_RULE: + */ + default: + ogs_error("Not implemented(%d)", hdr->avp_code); + break; } fd_msg_browse(avpch2, MSG_BRW_NEXT, &avpch2, NULL); }
View file
open5gs_2.7.0.130.bbdf.tar.xz/src/smf/n4-handler.c -> open5gs_2.7.0.134.d3a7.tar.xz/src/smf/n4-handler.c
Changed
@@ -1147,7 +1147,9 @@ return OGS_PFCP_CAUSE_REQUEST_ACCEPTED; } -void smf_n4_handle_session_report_request( +/* Returns OGS_PFCP_CAUSE_REQUEST_ACCEPTED on success, + * other cause value on failure */ +uint8_t smf_n4_handle_session_report_request( smf_sess_t *sess, ogs_pfcp_xact_t *pfcp_xact, ogs_pfcp_session_report_request_t *pfcp_req) { @@ -1185,7 +1187,7 @@ ogs_pfcp_send_error_message(pfcp_xact, 0, OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE, cause_value, 0); - return; + return cause_value; } ogs_assert(sess); @@ -1225,7 +1227,7 @@ ogs_pfcp_send_error_message(pfcp_xact, 0, OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE, OGS_PFCP_CAUSE_SERVICE_NOT_SUPPORTED, 0); - return; + return OGS_PFCP_CAUSE_SERVICE_NOT_SUPPORTED; } if (qfi) { @@ -1235,7 +1237,7 @@ ogs_pfcp_send_error_message(pfcp_xact, 0, OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE, OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND, 0); - return; + return OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND; } } } else { @@ -1260,7 +1262,7 @@ ogs_pfcp_send_error_message(pfcp_xact, 0, OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE, OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND, 0); - return; + return OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND; } switch (sess->up_cnx_state) { @@ -1332,14 +1334,21 @@ sess->gy.reporting_reason = smf_pfcp_urr_usage_report_trigger2diam_gy_reporting_reason(&rep_trig); } - switch(smf_use_gy_iface()) { + switch (smf_use_gy_iface()) { case 1: - smf_gy_send_ccr(sess, pfcp_xact, - OGS_DIAM_GY_CC_REQUEST_TYPE_UPDATE_REQUEST); + if (!sess->gy.final_unit) { + smf_gy_send_ccr(sess, pfcp_xact, + OGS_DIAM_GY_CC_REQUEST_TYPE_UPDATE_REQUEST); + } else { + ogs_debug("%s:%s Rx PFCP report after Gy Final Unit Indication", + smf_ue->imsi_bcd, sess->session.name); + /* This effectively triggers session release: */ + cause_value = OGS_PFCP_CAUSE_NO_RESOURCES_AVAILABLE; + } break; case -1: ogs_error("No Gy Diameter Peer"); - /* TODO: terminate connection */ + cause_value = OGS_PFCP_CAUSE_NO_RESOURCES_AVAILABLE; break; /* default: continue below */ } @@ -1379,4 +1388,5 @@ 0)); } } + return cause_value; }
View file
open5gs_2.7.0.130.bbdf.tar.xz/src/smf/n4-handler.h -> open5gs_2.7.0.134.d3a7.tar.xz/src/smf/n4-handler.h
Changed
@@ -47,7 +47,7 @@ smf_sess_t *sess, ogs_pfcp_xact_t *xact, ogs_pfcp_session_deletion_response_t *rsp); -void smf_n4_handle_session_report_request( +uint8_t smf_n4_handle_session_report_request( smf_sess_t *sess, ogs_pfcp_xact_t *pfcp_xact, ogs_pfcp_session_report_request_t *pfcp_req);
View file
open5gs_2.7.0.130.bbdf.tar.xz/src/smf/pfcp-sm.c -> open5gs_2.7.0.134.d3a7.tar.xz/src/smf/pfcp-sm.c
Changed
@@ -370,8 +370,14 @@ case OGS_PFCP_SESSION_REPORT_REQUEST_TYPE: if (!message->h.seid_presence) ogs_error("No SEID"); - smf_n4_handle_session_report_request( - sess, xact, &message->pfcp_session_report_request); + if (!sess) { + ogs_error("No Session"); + ogs_pfcp_send_error_message(xact, 0, + OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE, + OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND, 0); + break; + } + ogs_fsm_dispatch(&sess->sm, e); break; default:
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
.