aboutsummaryrefslogtreecommitdiffstats
path: root/src/e1_input.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-05-02 21:09:15 +0200
committerlaforge <laforge@osmocom.org>2020-06-09 07:11:42 +0000
commitb90318808b2fcf5b8ee25f0129f02af19dd13c91 (patch)
treeb529fa3c73bd35b4b74fa1bb6303bb0c09c29f82 /src/e1_input.c
parent62725d0b58a4842ce96ac9107c565de40fe4e945 (diff)
lapd: Always print context information when logging
Historically, OpenBSC has primarily been used with setups that have a single E1 based BTS connected. This meant that an error message on the E1 LAPD implicitly has to be related to that single BTS. However, in more comprehensive setups, there may be many BTSs on many E1 lines with many signaling slots. At this point, it's important to know which line/timeslot/tei/sapi a given log message relates to. This patch introduces related log context. Change-Id: Ib81a749ae24013b17caaf5fd64ccd9acbbc3ce08 Requires: libosmocore.git Change-Id Ie6742843fff809edffcac24c4dce4edf66bc71be Related: OS#1938
Diffstat (limited to 'src/e1_input.c')
-rw-r--r--src/e1_input.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/e1_input.c b/src/e1_input.c
index b3341e7..7066acf 100644
--- a/src/e1_input.c
+++ b/src/e1_input.c
@@ -312,6 +312,14 @@ int e1inp_ts_config_trau(struct e1inp_ts *ts, struct e1inp_line *line,
return 0;
}
+void e1inp_ts_name(char *out, size_t out_len, const struct e1inp_ts *ts)
+{
+ if (ts->line->name)
+ snprintf(out, out_len, "%s:%u", ts->line->name, ts->num);
+ else
+ snprintf(out, out_len, "%u:%u", ts->line->num, ts->num);
+}
+
int e1inp_ts_config_sign(struct e1inp_ts *ts, struct e1inp_line *line)
{
if (ts->type == E1INP_TS_TYPE_SIGN && ts->line && line)