Projects
osmocom:nightly
osmo-hnbgw
Log In
Username
Password
Error getting diff: tar:
×
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 626
View file
osmo-hnbgw.spec
Changed
@@ -17,14 +17,14 @@ %define _lto_cflags %{nil} Name: osmo-hnbgw -Requires: osmocom-nightly = 202403072026 -Version: 1.5.0.21.1ee4.202403072026 +Requires: osmocom-nightly = 202403082026 +Version: 1.5.0.24.0560.202403082026 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.21.1ee4.202403072026.tar.xz +Source: osmo-hnbgw_1.5.0.24.0560.202403082026.tar.xz Source1: rpmlintrc BuildRequires: automake >= 1.9 BuildRequires: libtool >= 2
View file
osmo-hnbgw_1.5.0.21.1ee4.202403072026.dsc -> osmo-hnbgw_1.5.0.24.0560.202403082026.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.21.1ee4.202403072026 +Version: 1.5.0.24.0560.202403082026 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: - 823c7a04c29cfff390d19a942fcdea7c2fff62f6 101316 osmo-hnbgw_1.5.0.21.1ee4.202403072026.tar.xz + 4b5739956d807ec9772178874633a9e5237e6e8a 101692 osmo-hnbgw_1.5.0.24.0560.202403082026.tar.xz Checksums-Sha256: - aad68115d658a4a4c6bbfbec68a49fd11934ee35e81fdaff9286ffe9d5099391 101316 osmo-hnbgw_1.5.0.21.1ee4.202403072026.tar.xz + f8b31e1267161ab95969d076e9c579f596f2cbc6bd1d04a22d84d4006a72ef5d 101692 osmo-hnbgw_1.5.0.24.0560.202403082026.tar.xz Files: - f6301c4b64c62d5c856a25d91a4b0ad8 101316 osmo-hnbgw_1.5.0.21.1ee4.202403072026.tar.xz + 48a79797d714728b9e38079749314102 101692 osmo-hnbgw_1.5.0.24.0560.202403082026.tar.xz
View file
osmo-hnbgw_1.5.0.21.1ee4.202403072026.tar.xz/.tarball-version -> osmo-hnbgw_1.5.0.24.0560.202403082026.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.5.0.21-1ee4.202403072026 +1.5.0.24-0560.202403082026
View file
osmo-hnbgw_1.5.0.21.1ee4.202403072026.tar.xz/contrib/osmo-hnbgw.spec.in -> osmo-hnbgw_1.5.0.24.0560.202403082026.tar.xz/contrib/osmo-hnbgw.spec.in
Changed
@@ -17,7 +17,7 @@ %define _lto_cflags %{nil} Name: osmo-hnbgw -Requires: osmocom-nightly = 202403072026 +Requires: osmocom-nightly = 202403082026 Version: @VERSION@ Release: 0 Summary: OsmoHNBGW: Osmocom's Base Station Controller for 2G CS mobile networks
View file
osmo-hnbgw_1.5.0.21.1ee4.202403072026.tar.xz/debian/changelog -> osmo-hnbgw_1.5.0.24.0560.202403082026.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -osmo-hnbgw (1.5.0.21.1ee4.202403072026) unstable; urgency=medium +osmo-hnbgw (1.5.0.24.0560.202403082026) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom nightly feed - -- Osmocom OBS scripts <info@osmocom.org> Thu, 07 Mar 2024 20:26:47 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Fri, 08 Mar 2024 20:26:46 +0000 osmo-hnbgw (1.5.0) unstable; urgency=medium
View file
osmo-hnbgw_1.5.0.21.1ee4.202403072026.tar.xz/debian/control -> osmo-hnbgw_1.5.0.24.0560.202403082026.tar.xz/debian/control
Changed
@@ -31,7 +31,7 @@ Package: osmo-hnbgw Architecture: any Multi-Arch: foreign -Depends: osmocom-nightly (= 202403072026), ${misc:Depends}, ${shlibs:Depends} +Depends: osmocom-nightly (= 202403082026), ${misc:Depends}, ${shlibs:Depends} Recommends: osmo-mgw Description: OsmoHNBGW: Osmocom Home Node B Gateway @@ -39,14 +39,14 @@ Section: debug Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 202403072026), osmo-hnbgw (= ${binary:Version}), ${misc:Depends} +Depends: osmocom-nightly (= 202403082026), osmo-hnbgw (= ${binary:Version}), ${misc:Depends} Description: OsmoHNBGW: Osmocom Home Node B Gateway Package: osmo-hnbgw-doc Architecture: all Section: doc Priority: optional -Depends: osmocom-nightly (= 202403072026), ${misc:Depends} +Depends: osmocom-nightly (= 202403082026), ${misc:Depends} Description: ${misc:Package} PDF documentation Various manuals: user manual, VTY reference manual and/or protocol/interface manuals.
View file
osmo-hnbgw_1.5.0.21.1ee4.202403072026.tar.xz/src/osmo-hnbgw/hnbgw.c -> osmo-hnbgw_1.5.0.24.0560.202403082026.tar.xz/src/osmo-hnbgw/hnbgw.c
Changed
@@ -47,85 +47,10 @@ {} }; -void g_hnbgw_alloc(void *ctx) -{ - OSMO_ASSERT(!g_hnbgw); - g_hnbgw = talloc_zero(ctx, struct hnbgw); - - /* strdup so we can easily talloc_free in the VTY code */ - g_hnbgw->config.iuh_local_ip = talloc_strdup(g_hnbgw, HNBGW_LOCAL_IP_DEFAULT); - g_hnbgw->config.iuh_local_port = IUH_DEFAULT_SCTP_PORT; - g_hnbgw->config.log_prefix_hnb_id = true; - - /* Set zero PLMN to detect a missing PLMN when transmitting RESET */ - g_hnbgw->config.plmn = (struct osmo_plmn_id){ 0, 0, false }; - g_hnbgw->next_ue_ctx_id = 23; - INIT_LLIST_HEAD(&g_hnbgw->hnb_list); - INIT_LLIST_HEAD(&g_hnbgw->ue_list); - INIT_LLIST_HEAD(&g_hnbgw->sccp.users); - - g_hnbgw->mgw_pool = mgcp_client_pool_alloc(g_hnbgw); - g_hnbgw->config.mgcp_client = mgcp_client_conf_alloc(g_hnbgw); - -#if ENABLE_PFCP - g_hnbgw->config.pfcp.remote_port = OSMO_PFCP_PORT; -#endif - - g_hnbgw->sccp.cnpool_iucs = (struct hnbgw_cnpool){ - .domain = DOMAIN_CS, - .pool_name = "iucs", - .peer_name = "msc", - .default_remote_pc = DEFAULT_PC_MSC, - .vty = { - .nri_bitlen = OSMO_NRI_BITLEN_DEFAULT, - .null_nri_ranges = osmo_nri_ranges_alloc(g_hnbgw), - }, - .cnlink_ctrg_desc = &msc_ctrg_desc, - - .ctrs = rate_ctr_group_alloc(g_hnbgw, &iucs_ctrg_desc, 0), - }; - INIT_LLIST_HEAD(&g_hnbgw->sccp.cnpool_iucs.cnlinks); - - g_hnbgw->sccp.cnpool_iups = (struct hnbgw_cnpool){ - .domain = DOMAIN_PS, - .pool_name = "iups", - .peer_name = "sgsn", - .default_remote_pc = DEFAULT_PC_SGSN, - .vty = { - .nri_bitlen = OSMO_NRI_BITLEN_DEFAULT, - .null_nri_ranges = osmo_nri_ranges_alloc(g_hnbgw), - }, - .cnlink_ctrg_desc = &sgsn_ctrg_desc, - - .ctrs = rate_ctr_group_alloc(g_hnbgw, &iups_ctrg_desc, 0), - }; - INIT_LLIST_HEAD(&g_hnbgw->sccp.cnpool_iups.cnlinks); -} - -static struct hnb_context *hnb_context_by_id(uint32_t cid) -{ - struct hnb_context *hnb; - - llist_for_each_entry(hnb, &g_hnbgw->hnb_list, list) { - if (hnb->id.cid == cid) - return hnb; - } - - return NULL; -} - -struct hnb_context *hnb_context_by_identity_info(const char *identity_info) -{ - struct hnb_context *hnb; - - llist_for_each_entry(hnb, &g_hnbgw->hnb_list, list) { - if (strcmp(identity_info, hnb->identity_info) == 0) - return hnb; - } - - return NULL; -} +/*********************************************************************** + * UE Context + ***********************************************************************/ struct ue_context *ue_context_by_id(uint32_t id) { @@ -212,6 +137,146 @@ talloc_free(ue); } + +/*********************************************************************** + * HNB Context + ***********************************************************************/ + +/* look-up HNB context by id. Used from CTRL */ +static struct hnb_context *hnb_context_by_id(uint32_t cid) +{ + struct hnb_context *hnb; + + llist_for_each_entry(hnb, &g_hnbgw->hnb_list, list) { + if (hnb->id.cid == cid) + return hnb; + } + + return NULL; +} + +/* look-up HNB context by identity_info. Used from VTY */ +struct hnb_context *hnb_context_by_identity_info(const char *identity_info) +{ + struct hnb_context *hnb; + + llist_for_each_entry(hnb, &g_hnbgw->hnb_list, list) { + if (strcmp(identity_info, hnb->identity_info) == 0) + return hnb; + } + + return NULL; +} + +static int hnb_read_cb(struct osmo_stream_srv *conn); +static int hnb_closed_cb(struct osmo_stream_srv *conn); + +static struct hnb_context *hnb_context_alloc(struct osmo_stream_srv_link *link, int new_fd) +{ + struct hnb_context *ctx; + + ctx = talloc_zero(g_hnbgw, struct hnb_context); + if (!ctx) + return NULL; + INIT_LLIST_HEAD(&ctx->map_list); + + ctx->conn = osmo_stream_srv_create(g_hnbgw, link, new_fd, hnb_read_cb, hnb_closed_cb, ctx); + if (!ctx->conn) { + LOGP(DMAIN, LOGL_INFO, "error while creating connection\n"); + talloc_free(ctx); + return NULL; + } + + llist_add_tail(&ctx->list, &g_hnbgw->hnb_list); + return ctx; +} + +const char *umts_cell_id_name(const struct umts_cell_id *ucid) +{ + const char *fmtstr = "%03u-%02u-L%u-R%u-S%u-C%u"; + + if (g_hnbgw->config.plmn.mnc_3_digits) + fmtstr = "%03u-%03u-L%u-R%u-S%u-C%u"; + + return talloc_asprintf(OTC_SELECT, fmtstr, ucid->mcc, ucid->mnc, ucid->lac, ucid->rac, + ucid->sac, ucid->cid); +} + +const char *hnb_context_name(struct hnb_context *ctx) +{ + char *result; + if (!ctx) + return "NULL"; + + if (ctx->conn) { + char hostbuf_rINET6_ADDRSTRLEN; + char portbuf_r6; + int fd = osmo_stream_srv_get_ofd(ctx->conn)->fd; + + /* get remote addr */ + if (osmo_sock_get_ip_and_port(fd, hostbuf_r, sizeof(hostbuf_r), portbuf_r, sizeof(portbuf_r), false) == 0) + result = talloc_asprintf(OTC_SELECT, "%s:%s", hostbuf_r, portbuf_r); + else + result = "?"; + } else { + result = "disconnected"; + } + + if (g_hnbgw->config.log_prefix_hnb_id) + result = talloc_asprintf(OTC_SELECT, "%s %s", result, ctx->identity_info); + else + result = talloc_asprintf(OTC_SELECT, "%s %s", result, umts_cell_id_name(&ctx->id)); + return result; +} + +void hnb_context_release_ue_state(struct hnb_context *ctx) +{ + struct hnbgw_context_map *map, *map2; + + /* deactivate all context maps */ + llist_for_each_entry_safe(map, map2, &ctx->map_list, hnb_list) { + context_map_hnb_released(map); + /* hnbgw_context_map will remove itself from lists when it is ready. */ + } + ue_context_free_by_hnb(ctx); +} + +void hnb_context_release(struct hnb_context *ctx) +{ + struct hnbgw_context_map *map;
View file
osmo-hnbgw_1.5.0.21.1ee4.202403072026.tar.xz/src/osmo-hnbgw/osmo_hnbgw_main.c -> osmo-hnbgw_1.5.0.24.0560.202403082026.tar.xz/src/osmo-hnbgw/osmo_hnbgw_main.c
Changed
@@ -1,6 +1,6 @@ /* OsmoHNBGW main routine */ -/* (C) 2015 by Harald Welte <laforge@gnumonks.org> +/* (C) 2015-2024 by Harald Welte <laforge@gnumonks.org> * (C) 2016-2023 by sysmocom s.f.m.c. GmbH <info@sysmocom.de> * All Rights Reserved * @@ -19,6 +19,7 @@ * */ +#include <signal.h> #include <getopt.h> #include "config.h" @@ -64,6 +65,32 @@ NULL, }; +static void signal_handler(int signum) +{ + fprintf(stdout, "signal %u received\n", signum); + + switch (signum) { + case SIGABRT: + /* in case of abort, we want to obtain a talloc report and + * then run default SIGABRT handler, who will generate coredump + * and abort the process. abort() should do this for us after we + * return, but program wouldn't exit if an external SIGABRT is + * received. + */ + talloc_report(tall_vty_ctx, stderr); + talloc_report_full(g_hnbgw, stderr); + signal(SIGABRT, SIG_DFL); + raise(SIGABRT); + break; + case SIGUSR1: + talloc_report(tall_vty_ctx, stderr); + talloc_report_full(g_hnbgw, stderr); + break; + default: + break; + } +} + static void print_usage(void) { printf("Usage: osmo-hnbgw\n"); @@ -313,6 +340,11 @@ } } + signal(SIGABRT, &signal_handler); + signal(SIGUSR1, &signal_handler); + signal(SIGUSR2, &signal_handler); + osmo_init_ignore_signals(); + while (1) { rc = osmo_select_main_ctx(0); if (rc < 0)
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
.