aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-05 20:46:16 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-05 23:18:53 +0100
commit50cc22a30c8d62af19551dc77819f0d9d6012fa1 (patch)
tree33345b34fc27b88f8f5a91e681c5f18ab2f199d6
parent845e995b5a74da808d48a25b36fd93afcde3f152 (diff)
Print much more information during 'show lchan'
This adds printing of remote RTP IP/Port, LAPDm SAPI information, MS Timing offset, propagation delay, encryption algorithm+state, loopback status and radio link failure counter to the "show lchan" command. It also adds TODO comments fro those bits that are not yet printed but which would make sense to print. Change-Id: Ic4bc47638b7b402aee9344dc912745a9929c37f4
-rw-r--r--include/osmo-bts/gsm_data_shared.h5
-rw-r--r--src/common/gsm_data_shared.c10
-rw-r--r--src/common/vty.c31
3 files changed, 46 insertions, 0 deletions
diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h
index a1ac27a..f694114 100644
--- a/include/osmo-bts/gsm_data_shared.h
+++ b/include/osmo-bts/gsm_data_shared.h
@@ -345,6 +345,11 @@ struct gsm_lchan {
struct msgb *pending_rel_ind_msg;
};
+extern const struct value_string lchan_ciph_state_names[];
+static inline const char *lchan_ciph_state_name(uint8_t state) {
+ return get_value_string(lchan_ciph_state_names, state);
+}
+
enum {
TS_F_PDCH_ACTIVE = 0x1000,
TS_F_PDCH_ACT_PENDING = 0x2000,
diff --git a/src/common/gsm_data_shared.c b/src/common/gsm_data_shared.c
index 9aa4ba1..1ef223c 100644
--- a/src/common/gsm_data_shared.c
+++ b/src/common/gsm_data_shared.c
@@ -854,3 +854,13 @@ const char *gsm_trx_unit_id(struct gsm_bts_trx *trx)
trx->bts->ip_access.bts_id, trx->nr);
return buf;
}
+
+const struct value_string lchan_ciph_state_names[] = {
+ { LCHAN_CIPH_NONE, "NONE" },
+ { LCHAN_CIPH_RX_REQ, "RX_REQ" },
+ { LCHAN_CIPH_RX_CONF, "RX_CONF" },
+ { LCHAN_CIPH_RXTX_REQ, "RXTX_REQ" },
+ { LCHAN_CIPH_RX_CONF_TX_REQ, "RX_CONF_TX_REQ" },
+ { LCHAN_CIPH_RXTX_CONF, "RXTX_CONF" },
+ { 0, NULL }
+};
diff --git a/src/common/vty.c b/src/common/vty.c
index c54ab89..77fc4d9 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -1060,6 +1060,37 @@ static void lchan_dump_full_vty(struct vty *vty, struct gsm_lchan *lchan)
inet_ntoa(ia), lchan->abis_ip.bound_port,
lchan->abis_ip.rtp_payload2, lchan->abis_ip.conn_id,
VTY_NEWLINE);
+ if (lchan->abis_ip.connect_ip) {
+ ia.s_addr = htonl(lchan->abis_ip.connect_ip);
+ vty_out(vty, " Conn. IP: %s Port %u RTP_TYPE=%u SPEECH_MODE=0x%02u%s",
+ inet_ntoa(ia), lchan->abis_ip.connect_port,
+ lchan->abis_ip.rtp_payload, lchan->abis_ip.speech_mode,
+ VTY_NEWLINE);
+ }
+#define LAPDM_ESTABLISHED(link, sapi_idx) \
+ (link).datalink[sapi_idx].dl.state == LAPD_STATE_MF_EST
+ vty_out(vty, " LAPDm SAPIs: DCCH %c%c, SACCH %c%c%s",
+ LAPDM_ESTABLISHED(lchan->lapdm_ch.lapdm_dcch, DL_SAPI0) ? '0' : '-',
+ LAPDM_ESTABLISHED(lchan->lapdm_ch.lapdm_dcch, DL_SAPI3) ? '3' : '-',
+ LAPDM_ESTABLISHED(lchan->lapdm_ch.lapdm_acch, DL_SAPI0) ? '0' : '-',
+ LAPDM_ESTABLISHED(lchan->lapdm_ch.lapdm_acch, DL_SAPI3) ? '3' : '-',
+ VTY_NEWLINE);
+#undef LAPDM_ESTABLISHED
+ vty_out(vty, " Valid System Information: 0x%08x%s",
+ lchan->si.valid, VTY_NEWLINE);
+ /* TODO: L1 SAPI (but those are BTS speific :( */
+ /* TODO: AMR bits */
+ vty_out(vty, " MS Timing Offset: %d, propagation delay: %d symbols %s",
+ lchan->ms_t_offs, lchan->p_offs, VTY_NEWLINE);
+ if (lchan->encr.alg_id) {
+ vty_out(vty, " Ciphering A5/%u State: %s, N(S)=%u%s",
+ lchan->encr.alg_id-1, lchan_ciph_state_name(lchan->ciph_state),
+ lchan->ciph_ns, VTY_NEWLINE);
+ }
+ if (lchan->loopback)
+ vty_out(vty, " RTP/PDCH Loopback Enabled%s", VTY_NEWLINE);
+ vty_out(vty, " Radio Link Failure Counter 'S': %d%s", lchan->s, VTY_NEWLINE);
+ /* TODO: MS Power Control */
}
static void lchan_dump_short_vty(struct vty *vty, struct gsm_lchan *lchan)