Attention is currently required from: laforge, neels, pespin.
Timur Davydov has posted comments on this change by Timur Davydov. ( https://gerrit.osmocom.org/c/libosmocore/+/41813?usp=email )
Change subject: Add Emscripten build support and JS callback logging backend
......................................................................
Patch Set 9:
(1 comment)
File src/core/netdev.c:
https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/ab067eff_a1415b89?… :
PS5, Line 67: #if (!EMBEDDED) && !defined(__EMSCRIPTEN__)
> Great, please submit a separate patch with those changes (since they are actually independent from e […]
Done, the changes have been submitted as a separate patch.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41813?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia8d5f4bb6570b5e055826f3a051e5e5896866e31
Gerrit-Change-Number: 41813
Gerrit-PatchSet: 9
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 20 Jan 2026 11:50:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: Timur Davydov <dtv.comp(a)gmail.com>
Attention is currently required from: pespin.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-msc/+/41880?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: Avoid accessing struct log_target members directly
......................................................................
Avoid accessing struct log_target members directly
Use newly available APIs instead.
Depends: libosmocore.git Change-Id Ie48e7e635feb91509b9c034394df4fb16cb931a3
Change-Id: I81020f368c7e0e7b8dcd92917301bf3844157705
---
M TODO-RELEASE
M src/libvlr/vlr.c
M src/osmo-msc/msc_main.c
3 files changed, 15 insertions(+), 12 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/80/41880/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/41880?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I81020f368c7e0e7b8dcd92917301bf3844157705
Gerrit-Change-Number: 41880
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Jenkins Builder has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/41879?usp=email )
Change subject: logging: Add APIs to set/get log_{target,context} fields
......................................................................
Patch Set 1:
(1 comment)
File src/core/logging.c:
Robot Comment from checkpatch (run ID ):
https://gerrit.osmocom.org/c/libosmocore/+/41879/comment/f961be5e_246d9271?… :
PS1, Line 921: return target->filter_map & (1 << log_filter_index);
space prohibited after that '&' (ctx:WxW)
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41879?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie48e7e635feb91509b9c034394df4fb16cb931a3
Gerrit-Change-Number: 41879
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Tue, 20 Jan 2026 11:25:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/41879?usp=email )
Change subject: logging: Add APIs to set/get log_{target,context} fields
......................................................................
logging: Add APIs to set/get log_{target,context} fields
Change-Id: Ie48e7e635feb91509b9c034394df4fb16cb931a3
---
M TODO-RELEASE
M include/osmocom/core/logging.h
M src/core/libosmocore.map
M src/core/logging.c
4 files changed, 115 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/79/41879/1
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 3c98f06..b7d1585 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -10,3 +10,4 @@
core added osmo_sock_set_nonblock(), osmo_sock_get_nonblock()
core added gsmtap_source_set_nonblock(), gsmtap_source_using_wq()
core added osmo_iofd_set_name_f()
+core added log_{get,set}_filter(_data)(), log_get_context()
diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h
index 44263fb..286f646 100644
--- a/include/osmocom/core/logging.h
+++ b/include/osmocom/core/logging.h
@@ -225,7 +225,7 @@
/*! Log context information, passed to filter */
struct log_context {
- void *ctx[LOG_MAX_CTX+1];
+ void *ctx[LOG_MAX_CTX+1] OSMO_DEPRECATED_OUTSIDE("Accessing struct log_context members directly is deprecated");
};
/*! Compatibility with older libosmocore versions */
@@ -298,13 +298,15 @@
};
/*! structure representing a logging target */
+#define OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE_LOG_TARGET \
+ OSMO_DEPRECATED_OUTSIDE("Accessing struct log_target members directly is deprecated")
struct log_target {
struct llist_head entry; /*!< linked list */
/*! Internal data for filtering */
- int filter_map;
+ int filter_map OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE_LOG_TARGET;
/*! Internal data for filtering */
- void *filter_data[LOG_MAX_FILTERS+1];
+ void *filter_data[LOG_MAX_FILTERS+1] OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE_LOG_TARGET;
/*! logging categories */
struct log_category *categories;
@@ -406,10 +408,16 @@
/* context management */
void log_reset_context(void);
-int log_set_context(uint8_t ctx, void *value);
+int log_set_context(uint8_t ctx_nr, void *value);
+void *log_get_context(const struct log_context *ctx, uint8_t ctx_nr);
/* filter on the targets */
void log_set_all_filter(struct log_target *target, int);
+bool log_get_filter(const struct log_target *target, int log_filter_index);
+int log_set_filter(struct log_target *target, int log_filter_index, bool enable);
+void *log_get_filter_data(const struct log_target *target, int log_filter_index);
+int log_set_filter_data(struct log_target *target, int log_filter_index, void *data);
+
int log_cache_enable(void);
void log_cache_update(int mapped_subsys, uint8_t enabled, uint8_t level);
void log_set_use_color(struct log_target *target, int);
diff --git a/src/core/libosmocore.map b/src/core/libosmocore.map
index 2818f8a..3ec322c 100644
--- a/src/core/libosmocore.map
+++ b/src/core/libosmocore.map
@@ -75,8 +75,13 @@
log_parse_level;
logp_stub;
log_reset_context;
+log_get_context;
+log_get_filter;
+log_get_filter_data;
log_set_all_filter;
log_set_category_filter;
+log_set_filter;
+log_set_filter_data;
log_set_context;
log_set_log_level;
log_set_print_category;
diff --git a/src/core/logging.c b/src/core/logging.c
index 9e5ae9f..ac10d00 100644
--- a/src/core/logging.c
+++ b/src/core/logging.c
@@ -886,7 +886,42 @@
return 0;
}
-/*! Enable the \ref LOG_FLT_ALL log filter
+/*! Get the logging context
+ * \param[in] ctx logging context
+ * \param[in] ctx_nr logging context number
+ * \returns value set for the context
+ *
+ * A logging context is something like the subscriber identity to which
+ * the currently processed message relates, or the BTS through which it
+ * was received. The main use of this API is during
+ * (struct log_info)->filter_fn(ctx, log_tgt).
+ */
+void *log_get_context(const struct log_context *ctx, uint8_t ctx_nr)
+{
+ if (ctx_nr > LOG_MAX_CTX)
+ return NULL;
+ return ctx->ctx[ctx_nr];
+}
+
+/*! Query whether a log filter is enabled or disabled
+ * \param[in] target Log target to be queried
+ * \param[in] log_filter_index the index of the log filter to query
+ * \returns whether the filtering is enabled (true) or disabled (false)
+ */
+bool log_get_filter(const struct log_target *target, int log_filter_index)
+{
+ /* TODO: in the future we can support app-specified log filters here,
+ * similar to how we do dynamic cateogries defined by apps. */
+ if (log_filter_index < 0)
+ return false;
+
+ if (log_filter_index >= LOG_MAX_FILTERS)
+ return false;
+
+ return target->filter_map & (1 << log_filter_index);
+}
+
+/*! Enable/disable the \ref LOG_FLT_ALL log filter
* \param[in] target Log target to be affected
* \param[in] all enable (1) or disable (0) the ALL filter
*
@@ -902,6 +937,67 @@
target->filter_map &= ~(1 << LOG_FLT_ALL);
}
+/*! Enable/disable a log filter
+ * \param[in] target Log target to be affected
+ * \param[in] log_filter_index the index of the log filter to set
+ * \param[in] enable enable (true) or disable (false) the ALL filter
+ * \returns 0 on success, negative on error.
+ */
+int log_set_filter(struct log_target *target, int log_filter_index, bool enable)
+{
+ /* TODO: in the future we can support app-specified log filters here,
+ * similar to how we do dynamic cateogries defined by apps. */
+ if (log_filter_index < 0)
+ return -EINVAL;
+
+ if (log_filter_index >= LOG_MAX_FILTERS)
+ return -EINVAL;
+
+ if (enable)
+ target->filter_map |= (1 << log_filter_index);
+ else
+ target->filter_map &= ~(1 << log_filter_index);
+ return 0;
+}
+
+/*! Obtain data associated to a log filter
+ * \param[in] target Log target to be queried
+ * \param[in] log_filter_index the index of the log filter to query
+ * \returns data associated to the log filter
+ */
+void *log_get_filter_data(const struct log_target *target, int log_filter_index)
+{
+ /* TODO: in the future we can support app-specified log filters here,
+ * similar to how we do dynamic cateogries defined by apps. */
+ if (log_filter_index < 0)
+ return NULL;
+
+ if (log_filter_index >= LOG_MAX_FILTERS)
+ return NULL;
+
+ return target->filter_data[log_filter_index];
+}
+
+/*! Set data associated to a log filter
+ * \param[in] target Log target to be affected
+ * \param[in] log_filter_index the index of the log filter to set associate data for
+ * \param[in] data The user provided data pointer to associate to the log filter
+ * \returns 0 on success, negative on error.
+ */
+int log_set_filter_data(struct log_target *target, int log_filter_index, void *data)
+{
+ /* TODO: in the future we can support app-specified log filters here,
+ * similar to how we do dynamic cateogries defined by apps. */
+ if (log_filter_index < 0)
+ return -EINVAL;
+
+ if (log_filter_index >= LOG_MAX_FILTERS)
+ return -EINVAL;
+
+ target->filter_data[log_filter_index] = data;
+ return 0;
+}
+
/*! Enable or disable the use of colored output
* \param[in] target Log target to be affected
* \param[in] use_color Use color (1) or don't use color (0)
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41879?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie48e7e635feb91509b9c034394df4fb16cb931a3
Gerrit-Change-Number: 41879
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: fixeria, phcoder.
dexter has posted comments on this change by phcoder. ( https://gerrit.osmocom.org/c/pysim/+/41786?usp=email )
Change subject: Print SMSC in pySim-read.py
......................................................................
Patch Set 15: Code-Review+1 Verified+1
(1 comment)
Patchset:
PS15:
I have tried this out and it works fine. I have also set the EF.SMSP record 1 to all FF to see what happens. No problem, it just shows "SMSC: "
I would suggest to indent the SMSC: output to make more clear that it is related to SMSP. (similar to SIM Service Table, there you have the hex string and below are the parsed results with an indentation. Maybe also print "SMSC: (none)" in case it is not set.
In any case, those are just cosmetic suggestions. I think its ok the way it is and I don't want to block you. Also the output of pySim-read.py has some consistency issues here and there anyway.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41786?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I17067b68086316d51fd71ba77049874605594e3f
Gerrit-Change-Number: 41786
Gerrit-PatchSet: 15
Gerrit-Owner: phcoder <phcoder(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: phcoder <phcoder(a)gmail.com>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 20 Jan 2026 10:49:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Attention is currently required from: Timur Davydov, laforge, neels.
Hello Jenkins Builder, fixeria, neels, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/41813?usp=email
to look at the new patch set (#9).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: Add Emscripten build support and JS callback logging backend
......................................................................
Add Emscripten build support and JS callback logging backend
This change enables building libosmocore for sandboxed, non-POSIX
environments, specifically WebAssembly targets produced via the
Emscripten toolchain.
The broader motivation is to allow partial execution of selected
Osmocom components in isolated runtime environments where direct access
to hardware and traditional operating system facilities (filesystem,
sockets, privileged execution) is not available.
One intended use case is running a GSM 2G base station where the
radio-facing components are executed inside a web environment, while
the remaining Osmocom stack and core network components continue to run
unchanged on a conventional backend server. In this model, highly
stripped-down variants of osmo-bts and osmo-trx are built as static
WebAssembly libraries and executed in the browser, while depending on
core libraries such as libosmocore, libosmo-netif, and libosmo-abis.
A practical advantage of this approach is that no deployment or
privileged setup is required on the radio endpoint side. A user can
instantiate a radio endpoint with minimal configuration, while all
stateful logic and operational complexity remains centralized on the
backend. Multiple such radio endpoints may connect to the same backend
core network, effectively forming a single logical network from the
core network perspective, independent of the physical location of the
radio endpoints.
Existing libosmocore build logic and platform assumptions rely on the
availability of POSIX APIs and OS services which are not present in
WebAssembly runtimes. This currently prevents libosmocore from being
built for such targets without targeted, build-time adjustments. This
patch introduces the minimal set of changes required to enable such
builds, without affecting native platforms.
As part of this groundwork, a minimal callback-based logging hook is
introduced. When building for Emscripten, this hook allows forwarding
log messages to an external environment via a user-provided JavaScript
callback. This enables integration with browser-side logging or UI
infrastructure without introducing new logging backends or runtime
dependencies. For all other build targets, the hook resolves to a no-op
implementation and does not alter existing logging behavior.
No runtime behavior, protocol semantics, or network interactions are
changed by this patch. All modifications are strictly limited to
build-time and platform-specific code paths and are only active when
targeting Emscripten. Native builds and existing deployment scenarios
remain unaffected.
This patch is intended as groundwork. Follow-up changes, proposed
separately and incrementally, may extend similar support to other
Osmocom components such as libosmo-netif, libosmo-abis, osmo-bts, and
osmo-trx, while keeping all such changes optional and isolated from
native builds.
Change-Id: Ia8d5f4bb6570b5e055826f3a051e5e5896866e31
---
M .gitignore
M configure.ac
M include/osmocom/core/logging.h
M include/osmocom/core/netns.h
M src/core/Makefile.am
M src/core/libosmocore.map
A src/core/logging_emscripten.c
M src/core/netdev.c
M src/core/osmo_io_internal.h
M src/core/socket.c
M src/core/stats_tcp.c
M src/core/tun.c
M src/vty/logging_vty.c
13 files changed, 206 insertions(+), 19 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/41813/9
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41813?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia8d5f4bb6570b5e055826f3a051e5e5896866e31
Gerrit-Change-Number: 41813
Gerrit-PatchSet: 9
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: Timur Davydov <dtv.comp(a)gmail.com>