Projects
osmocom:master
osmo-hnbgw
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 78
View file
osmo-hnbgw.spec
Changed
@@ -18,13 +18,13 @@ Name: osmo-hnbgw Requires: osmocom-master -Version: 1.5.0.26.7ec5 +Version: 1.5.0.29.3069 Release: 0 Summary: OsmoHNBGW: Osmocom's Base Station Controller for 2G CS mobile networks License: AGPL-3.0-or-later AND GPL-2.0-or-later Group: Hardware/Mobile URL: https://osmocom.org/projects/osmohnbgw -Source: osmo-hnbgw_1.5.0.26.7ec5.tar.xz +Source: osmo-hnbgw_1.5.0.29.3069.tar.xz Source1: rpmlintrc BuildRequires: automake >= 1.9 BuildRequires: libtool >= 2
View file
commit_30691e7b900b222b817cf890a8013c9360ca8d02.txt
Added
View file
commit_7ec5cb72804389e4fa6687066fa1d7075f514d7c.txt
Deleted
View file
osmo-hnbgw_1.5.0.26.7ec5.dsc -> osmo-hnbgw_1.5.0.29.3069.dsc
Changed
@@ -2,7 +2,7 @@ Source: osmo-hnbgw Binary: osmo-hnbgw, osmo-hnbgw-dbg, osmo-hnbgw-doc Architecture: any all -Version: 1.5.0.26.7ec5 +Version: 1.5.0.29.3069 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/osmo-hnbgw Standards-Version: 3.9.8 @@ -14,8 +14,8 @@ osmo-hnbgw-dbg deb debug extra arch=any osmo-hnbgw-doc deb doc optional arch=all Checksums-Sha1: - c13886f3d92b23e2f57eddbfcb4da18250789895 102868 osmo-hnbgw_1.5.0.26.7ec5.tar.xz + 02be69e60bfdc6914bff5af2118c3f8e49863868 103984 osmo-hnbgw_1.5.0.29.3069.tar.xz Checksums-Sha256: - 2be5eafd8c81ea88b40a6cdf21834c079c72ffa8a0b05469efce097450da2da4 102868 osmo-hnbgw_1.5.0.26.7ec5.tar.xz + 2b2e582b6169d3cecd0e11e805149b8485d92a57e5e4c160fdd1d18e15169e7b 103984 osmo-hnbgw_1.5.0.29.3069.tar.xz Files: - 43d693d55ae7329d34e3c6a0d75fed96 102868 osmo-hnbgw_1.5.0.26.7ec5.tar.xz + 4d1e8b11c0be84507206cfe0e2d37b4a 103984 osmo-hnbgw_1.5.0.29.3069.tar.xz
View file
osmo-hnbgw_1.5.0.26.7ec5.tar.xz/.tarball-version -> osmo-hnbgw_1.5.0.29.3069.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.5.0.26-7ec5 +1.5.0.29-3069
View file
osmo-hnbgw_1.5.0.26.7ec5.tar.xz/debian/changelog -> osmo-hnbgw_1.5.0.29.3069.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -osmo-hnbgw (1.5.0.26.7ec5) unstable; urgency=medium +osmo-hnbgw (1.5.0.29.3069) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom master feed - -- Osmocom OBS scripts <info@osmocom.org> Tue, 12 Mar 2024 08:25:53 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Tue, 12 Mar 2024 20:46:27 +0000 osmo-hnbgw (1.5.0) unstable; urgency=medium
View file
osmo-hnbgw_1.5.0.26.7ec5.tar.xz/include/osmocom/hnbgw/hnbgw.h -> osmo-hnbgw_1.5.0.29.3069.tar.xz/include/osmocom/hnbgw/hnbgw.h
Changed
@@ -18,6 +18,8 @@ #include <osmocom/mgcp_client/mgcp_client.h> #include <osmocom/mgcp_client/mgcp_client_pool.h> +#define STORE_UPTIME_INTERVAL 10 /* seconds */ + enum { DMAIN, DHNBAP, @@ -70,6 +72,36 @@ #define IUH_MSGB_SIZE 2048 +enum hnb_rate_ctr { + HNB_CTR_IUH_ESTABLISHED, + HNB_CTR_RANAP_PS_ERR_IND_UL, + HNB_CTR_RANAP_CS_ERR_IND_UL, + HNB_CTR_RANAP_PS_RESET_REQ_UL, + HNB_CTR_RANAP_CS_RESET_REQ_UL, + + HNB_CTR_RUA_ERR_IND, + + HNB_CTR_RUA_PS_CONNECT_UL, + HNB_CTR_RUA_CS_CONNECT_UL, + + HNB_CTR_RUA_PS_DISCONNECT_UL, + HNB_CTR_RUA_CS_DISCONNECT_UL, + HNB_CTR_RUA_PS_DISCONNECT_DL, + HNB_CTR_RUA_CS_DISCONNECT_DL, + + HNB_CTR_RUA_PS_DT_UL, + HNB_CTR_RUA_CS_DT_UL, + HNB_CTR_RUA_PS_DT_DL, + HNB_CTR_RUA_CS_DT_DL, + + HNB_CTR_RUA_UDT_UL, + HNB_CTR_RUA_UDT_DL, +}; + +enum hnb_stat { + HNB_STAT_UPTIME_SECONDS, +}; + struct umts_cell_id { uint16_t mcc; /*!< Mobile Country Code (0-999) */ uint16_t mnc; /*!< Mobile Network Code (0-999) */ @@ -253,10 +285,16 @@ /* linked list of hnbgw_context_map */ struct llist_head map_list; - /*! pointer to the associated hnb persistent state */ + /*! pointer to the associated hnb persistent state. Always present after HNB-Register */ struct hnb_persistent *persistent; }; +#define HNBP_CTR(hnbp, x) rate_ctr_group_get_ctr((hnbp)->ctrs, x) +#define HNBP_CTR_INC(hnbp, x) rate_ctr_inc(HNBP_CTR(hnbp, x)) + +#define HNBP_STAT(hbp, x) osmo_stat_item_group_get_item((hnbp)->statg, x) +#define HNBP_STAT_SET(hnbp, x, val) osmo_stat_item_set(HNBP_STAT(hnbp, x), val) + /* persistent data for one HNB. This continues to exist even as conn / hnb_context is deleted on disconnect */ struct hnb_persistent { /*! Entry in HNBGW-global list of hnb_persistent */ @@ -268,6 +306,12 @@ struct umts_cell_id id; /*! stringified version of the cell identiy above (for printing/naming) */ const char *id_str; + + /*! copied from HNB-Identity-Info IE */ + time_t updowntime; + + struct rate_ctr_group *ctrs; + struct osmo_stat_item_group *statg; }; struct ue_context { @@ -313,6 +357,7 @@ struct llist_head hnb_list; /* list of struct hnb_persistent */ struct llist_head hnb_persistent_list; + struct osmo_timer_list store_uptime_timer; /* list of struct ue_context */ struct llist_head ue_list; /* next availble UE Context ID */
View file
osmo-hnbgw_1.5.0.26.7ec5.tar.xz/src/osmo-hnbgw/hnbgw.c -> osmo-hnbgw_1.5.0.29.3069.tar.xz/src/osmo-hnbgw/hnbgw.c
Changed
@@ -22,6 +22,10 @@ #include <netinet/in.h> #include <netinet/sctp.h> +#include <osmocom/core/stats.h> +#include <osmocom/core/rate_ctr.h> +#include <osmocom/core/stat_item.h> + #include <osmocom/vty/vty.h> #include <osmocom/gsm/gsm23236.h> @@ -270,9 +274,14 @@ void hnb_context_release(struct hnb_context *ctx) { struct hnbgw_context_map *map; + struct timespec tp; + int rc; LOGHNB(ctx, DMAIN, LOGL_INFO, "Releasing HNB context\n"); + rc = osmo_clock_gettime(CLOCK_MONOTONIC, &tp); + ctx->persistent->updowntime = (rc < 0) ? 0 : tp.tv_sec; + /* remove from the list of HNB contexts */ llist_del(&ctx->list); @@ -305,6 +314,72 @@ * HNB Persistent Data ***********************************************************************/ +const struct rate_ctr_desc hnb_ctr_description = { + HNB_CTR_IUH_ESTABLISHED = { + "iuh:established", "Number of times Iuh link was established" }, + + HNB_CTR_RANAP_PS_ERR_IND_UL = { + "ranap:ps:error_ind:ul", "Received ERROR Indications in Uplink (PS Domain)" }, + HNB_CTR_RANAP_CS_ERR_IND_UL = { + "ranap:cs:error_ind:ul", "Received ERROR Indications in Uplink (PS Domain)" }, + + HNB_CTR_RANAP_PS_RESET_REQ_UL = { + "ranap:ps:reset_req:ul", "Received RESET Requests in Uplink (PS Domain)" }, + HNB_CTR_RANAP_CS_RESET_REQ_UL = { + "ranap:cs:reset_req:ul", "Received RESET Requests in Uplink (CS Domain)" }, + + HNB_CTR_RUA_ERR_IND = { + "rua:error_ind", "Received RUA Error Indications" }, + + HNB_CTR_RUA_PS_CONNECT_UL = { + "rua:ps:connect:ul", "Received RUA Connect requests (PS Domain)" }, + HNB_CTR_RUA_CS_CONNECT_UL = { + "rua:cs:connect:ul", "Received RUA Connect requests (CS Domain)" }, + + HNB_CTR_RUA_PS_DISCONNECT_UL = { + "rua:ps:disconnect:ul", "Received RUA Disconnect requests in uplink (PS Domain)" }, + HNB_CTR_RUA_CS_DISCONNECT_UL = { + "rua:cs:disconnect:ul", "Received RUA Disconnect requests in uplink (CS Domain)" }, + HNB_CTR_RUA_PS_DISCONNECT_DL = { + "rua:ps:disconnect:dl", "Transmitted RUA Disconnect requests in downlink (PS Domain)" }, + HNB_CTR_RUA_CS_DISCONNECT_DL = { + "rua:cs:disconnect:dl", "Transmitted RUA Disconnect requests in downlink (CS Domain)" }, + + HNB_CTR_RUA_PS_DT_UL = { + "rua:ps:direct_transfer:ul", "Received RUA DirectTransfer in uplink (PS Domain)" }, + HNB_CTR_RUA_CS_DT_UL = { + "rua:cs:direct_transfer:ul", "Received RUA DirectTransfer in uplink (CS Domain)" }, + HNB_CTR_RUA_PS_DT_DL = { + "rua:ps:direct_transfer:dl", "Transmitted RUA DirectTransfer in downlink (PS Domain)" }, + HNB_CTR_RUA_CS_DT_DL = { + "rua:cs:direct_transfer:dl", "Transmitted RUA DirectTransfer in downlink (CS Domain)" }, + + HNB_CTR_RUA_UDT_UL = { + "rua:unit_data:ul", "Received RUA UnitData (UDT) in uplink" }, + HNB_CTR_RUA_UDT_DL = { + "rua:unit_data:dl", "Transmitted RUA UnitData (UDT) in downlink" }, +}; + +const struct rate_ctr_group_desc hnb_ctrg_desc = { + "hnb", + "hNodeB", + OSMO_STATS_CLASS_GLOBAL, + ARRAY_SIZE(hnb_ctr_description), + hnb_ctr_description, +}; + +const struct osmo_stat_item_desc hnb_stat_desc = { + HNB_STAT_UPTIME_SECONDS = { "uptime:seconds", "Seconds of uptime", "s", 60, 0 }, +}; + +const struct osmo_stat_item_group_desc hnb_statg_desc = { + .group_name_prefix = "hnb", + .group_description = "hNodeB", + .class_id = OSMO_STATS_CLASS_GLOBAL, + .num_items = ARRAY_SIZE(hnb_stat_desc), + .item_desc = hnb_stat_desc, +}; + struct hnb_persistent *hnb_persistent_alloc(const struct umts_cell_id *id) { struct hnb_persistent *hnbp = talloc_zero(g_hnbgw, struct hnb_persistent); @@ -313,10 +388,24 @@ hnbp->id = *id; hnbp->id_str = talloc_strdup(hnbp, umts_cell_id_name(id)); + hnbp->ctrs = rate_ctr_group_alloc(hnbp, &hnb_ctrg_desc, 0); + if (!hnbp->ctrs) + goto out_free; + rate_ctr_group_set_name(hnbp->ctrs, hnbp->id_str); + hnbp->statg = osmo_stat_item_group_alloc(hnbp, &hnb_statg_desc, 0); + if (!hnbp->statg) + goto out_free_ctrs; + osmo_stat_item_group_set_name(hnbp->statg, hnbp->id_str); llist_add(&hnbp->list, &g_hnbgw->hnb_persistent_list); return hnbp; + +out_free_ctrs: + rate_ctr_group_free(hnbp->ctrs); +out_free: + talloc_free(hnbp); + return NULL; } struct hnb_persistent *hnb_persistent_find_by_id(const struct umts_cell_id *id) @@ -338,6 +427,32 @@ talloc_free(hnbp); } +/* return the amount of time the HNB is up (hnbp->ctx != NULL) or down (hnbp->ctx == NULL) */ +static unsigned long long hnbp_get_updowntime(const struct hnb_persistent *hnbp) +{ + struct timespec tp; + + if (!hnbp->updowntime) + return 0; + + if (osmo_clock_gettime(CLOCK_MONOTONIC, &tp) != 0) + return 0; + + return difftime(tp.tv_sec, hnbp->updowntime); +} + +/* timer call-back: Update the HNB_STAT_UPTIME_SECONDS stat item of each hnb_persistent */ +static void hnbgw_store_hnb_uptime(void *data) +{ + struct hnb_persistent *hnbp; + + llist_for_each_entry(hnbp, &g_hnbgw->hnb_persistent_list, list) { + HNBP_STAT_SET(hnbp, HNB_STAT_UPTIME_SECONDS, hnbp->ctx != NULL ? hnbp_get_updowntime(hnbp) : 0); + } + + osmo_timer_schedule(&g_hnbgw->store_uptime_timer, STORE_UPTIME_INTERVAL, 0); +} + /*********************************************************************** * SCTP Socket / stream handling ***********************************************************************/ @@ -584,7 +699,7 @@ #define HNBGW_COPYRIGHT \ "OsmoHNBGW - Osmocom Home Node B Gateway implementation\r\n" \ - "Copyright (C) 2016-2023 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>\r\n" \ + "Copyright (C) 2016-2024 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>\r\n" \ "Contributions by Daniel Willmann, Harald Welte, Neels Hofmeyr\r\n" \ "License AGPLv3+: GNU AGPL version 3 or later <http://gnu.org/licenses/agpl-3.0.html>\r\n" \ "This is free software: you are free to change and redistribute it.\r\n" \ @@ -696,4 +811,7 @@ .ctrs = rate_ctr_group_alloc(g_hnbgw, &iups_ctrg_desc, 0), }; INIT_LLIST_HEAD(&g_hnbgw->sccp.cnpool_iups.cnlinks); + + osmo_timer_setup(&g_hnbgw->store_uptime_timer, hnbgw_store_hnb_uptime, g_hnbgw); + osmo_timer_schedule(&g_hnbgw->store_uptime_timer, STORE_UPTIME_INTERVAL, 0); }
View file
osmo-hnbgw_1.5.0.26.7ec5.tar.xz/src/osmo-hnbgw/hnbgw_hnbap.c -> osmo-hnbgw_1.5.0.29.3069.tar.xz/src/osmo-hnbgw/hnbgw_hnbap.c
Changed
@@ -412,6 +412,7 @@ struct osmo_fd *ofd = osmo_stream_srv_get_ofd(ctx->conn); char identity_str256; const char *cell_id_str; + struct timespec tp; rc = hnbap_decode_hnbregisterrequesties(&ies, in); if (rc < 0) { @@ -441,7 +442,11 @@ return hnbgw_tx_hnb_register_rej(ctx); } ctx->persistent = hnbp; + hnbp->ctx = ctx; + HNBP_CTR_INC(hnbp, HNB_CTR_IUH_ESTABLISHED); + rc = osmo_clock_gettime(CLOCK_MONOTONIC, &tp); + hnbp->updowntime = (rc < 0) ? 0 : tp.tv_sec; llist_for_each_entry_safe(hnb, tmp, &g_hnbgw->hnb_list, list) { if (hnb->hnb_registered && ctx != hnb && memcmp(&ctx->id, &hnb->id, sizeof(ctx->id)) == 0) {
View file
osmo-hnbgw_1.5.0.26.7ec5.tar.xz/src/osmo-hnbgw/hnbgw_ranap.c -> osmo-hnbgw_1.5.0.29.3069.tar.xz/src/osmo-hnbgw/hnbgw_ranap.c
Changed
@@ -66,6 +66,7 @@ LOGHNB(hnb, DRANAP, LOGL_INFO, "Rx RESET.req(%s,%s)\n", is_ps ? "ps" : "cs", ranap_cause_str(&ies.cause)); + HNBP_CTR_INC(hnb->persistent, is_ps ? HNB_CTR_RANAP_PS_RESET_REQ_UL : HNB_CTR_RANAP_CS_RESET_REQ_UL); /* FIXME: Actually we have to wait for some guard time? */ /* FIXME: Reset all resources related to this HNB/RNC */ @@ -78,15 +79,20 @@ { RANAP_ErrorIndicationIEs_t ies; int rc; + bool is_ps = false; rc = ranap_decode_errorindicationies(&ies, in); if (rc < 0) return rc; + if (ies.cN_DomainIndicator == RANAP_CN_DomainIndicator_ps_domain) + is_ps = true; + if (ies.presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) { LOGHNB(hnb, DRANAP, LOGL_ERROR, "Rx ERROR.ind(%s)\n", ranap_cause_str(&ies.cause)); } else LOGHNB(hnb, DRANAP, LOGL_ERROR, "Rx ERROR.ind\n"); + HNBP_CTR_INC(hnb->persistent, is_ps ? HNB_CTR_RANAP_PS_ERR_IND_UL : HNB_CTR_RANAP_CS_ERR_IND_UL); return 0; }
View file
osmo-hnbgw_1.5.0.26.7ec5.tar.xz/src/osmo-hnbgw/hnbgw_rua.c -> osmo-hnbgw_1.5.0.29.3069.tar.xz/src/osmo-hnbgw/hnbgw_rua.c
Changed
@@ -83,6 +83,7 @@ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RUA_ConnectionlessTransfer, &out); LOGHNB(hnb, DRUA, LOGL_DEBUG, "transmitting RUA payload of %u bytes\n", msgb_length(msg)); + HNBP_CTR_INC(hnb->persistent, HNB_CTR_RUA_UDT_DL); return hnbgw_rua_tx(hnb, msg); } @@ -120,6 +121,7 @@ LOGHNB(hnb, DRUA, LOGL_DEBUG, "transmitting RUA DirectTransfer (cn=%s) payload of %u bytes\n", is_ps ? "ps" : "cs", msgb_length(msg)); + HNBP_CTR_INC(hnb->persistent, is_ps ? HNB_CTR_RUA_PS_DT_DL : HNB_CTR_RUA_CS_DT_DL); return hnbgw_rua_tx(hnb, msg); } @@ -157,9 +159,9 @@ &out); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RUA_Disconnect, &out); - LOGHNB(hnb, DRUA, LOGL_DEBUG, "transmitting RUA Disconnect (cn=%s) payload of %u bytes\n", is_ps ? "ps" : "cs", msgb_length(msg)); + HNBP_CTR_INC(hnb->persistent, is_ps ? HNB_CTR_RUA_PS_DISCONNECT_DL : HNB_CTR_RUA_CS_DISCONNECT_DL); return hnbgw_rua_tx(hnb, msg); } @@ -386,6 +388,8 @@ LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA %s Connect.req(ctx=0x%x, %s)\n", ranap_domain_name(ies.cN_DomainIndicator), context_id, ies.establishment_Cause == RUA_Establishment_Cause_emergency_call ? "emergency" : "normal"); + HNBP_CTR_INC(hnb->persistent, ies.cN_DomainIndicator == DOMAIN_PS ? + HNB_CTR_RUA_PS_CONNECT_UL : HNB_CTR_RUA_CS_CONNECT_UL); rc = rua_to_scu(hnb, ies.cN_DomainIndicator, RUA_ProcedureCode_id_Connect, context_id, 0, ies.ranaP_Message.buf, @@ -415,6 +419,8 @@ LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA Disconnect.req(ctx=0x%x,cause=%s)\n", context_id, rua_cause_str(&ies.cause)); + HNBP_CTR_INC(hnb->persistent, ies.cN_DomainIndicator == DOMAIN_PS ? + HNB_CTR_RUA_PS_DISCONNECT_UL : HNB_CTR_RUA_CS_DISCONNECT_UL); if (ies.presenceMask & DISCONNECTIES_RUA_RANAP_MESSAGE_PRESENT) { ranap_data = ies.ranaP_Message.buf; @@ -444,6 +450,8 @@ context_id = asn1bitstr_to_u24(&ies.context_ID); LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA Data.req(ctx=0x%x)\n", context_id); + HNBP_CTR_INC(hnb->persistent, ies.cN_DomainIndicator == DOMAIN_PS ? + HNB_CTR_RUA_PS_DT_UL : HNB_CTR_RUA_CS_DT_UL); rc = rua_to_scu(hnb, ies.cN_DomainIndicator, @@ -467,6 +475,7 @@ return rc; LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA UData.req()\n"); + HNBP_CTR_INC(hnb->persistent, HNB_CTR_RUA_UDT_UL); /* according tot the spec, we can primarily receive Overload, * Reset, Reset ACK, Error Indication, reset Resource, Reset @@ -493,6 +502,7 @@ return rc; LOGHNB(hnb, DRUA, LOGL_ERROR, "RUA UData.ErrorInd(%s)\n", rua_cause_str(&ies.cause)); + HNBP_CTR_INC(hnb->persistent, HNB_CTR_RUA_ERR_IND); rua_free_errorindicationies(&ies); return rc;
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
.