fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/32056 )
Change subject: trxcon: add GSMTAP logging target if '-g' is given ......................................................................
trxcon: add GSMTAP logging target if '-g' is given
Unlike the other more mature Osmocom projects, trxcon does not have its own VTY interface and thus does not support the config file parsing, so currently it's impossible to configure additional logging targets.
There is a command line option '-g', which enables GSMTAP Um logging. Let's also add a GSMTAP logging target if it's given. This is a quick hack, but good enough for occasional debugging.
Change-Id: I2c5e630dd508dff12d0116bdc0a4cc1276cac5ed Related: OS#5500 --- M src/host/trxcon/src/trxcon_main.c 1 file changed, 31 insertions(+), 1 deletion(-)
Approvals: laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified
diff --git a/src/host/trxcon/src/trxcon_main.c b/src/host/trxcon/src/trxcon_main.c index 26a5742..d30c98e 100644 --- a/src/host/trxcon/src/trxcon_main.c +++ b/src/host/trxcon/src/trxcon_main.c @@ -348,11 +348,23 @@
/* Optional GSMTAP */ if (app_data.gsmtap_ip != NULL) { + struct log_target *lt; + app_data.gsmtap = gsmtap_source_init(app_data.gsmtap_ip, GSMTAP_UDP_PORT, 1); if (!app_data.gsmtap) { - LOGP(DAPP, LOGL_ERROR, "Failed to init GSMTAP\n"); + LOGP(DAPP, LOGL_ERROR, "Failed to init GSMTAP Um logging\n"); goto exit; } + + lt = log_target_create_gsmtap(app_data.gsmtap_ip, GSMTAP_UDP_PORT, + "trxcon", false, false); + if (lt == NULL) { + LOGP(DAPP, LOGL_ERROR, "Failed to init GSMTAP logging target\n"); + goto exit; + } else { + log_add_target(lt); + } + /* Suppress ICMP "destination unreachable" errors */ gsmtap_source_add_sink(app_data.gsmtap); }