Change in osmo-bsc[master]: vty 'show bts'/'show trx': display IPs and ports

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

osmith gerrit-no-reply at lists.osmocom.org
Tue Oct 9 13:57:55 UTC 2018


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/11290


Change subject: vty 'show bts'/'show trx': display IPs and ports
......................................................................

vty 'show bts'/'show trx': display IPs and ports

This quickly allows knowing which IP a BTS is using in order to SSH
into it. Example output:

OsmoBSC> show trx
...
  Baseband Transceiver NM State: Oper 'Enabled', Admin 'Unlocked', Avail 'OK'
  ip.access stream ID: 0x00
    (r=192.168.1.178:55416<->l=192.168.1.37:3003)
...

OsmoBSC> show bts
...
  OML Link state: connected 0 days 0 hours 0 min. 43 sec.
    (r=192.168.1.178:46006<->l=192.168.1.37:3002)
...

Relates: OS#3145
Change-Id: I37f020fcdb68cafcdbdb621808483d1dd996354f
---
M src/osmo-bsc/bsc_vty.c
1 file changed, 16 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/90/11290/1

diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 8e6ff3e..84ae617 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -38,6 +38,7 @@
 #include <arpa/inet.h>
 
 #include <osmocom/core/linuxlist.h>
+#include <osmocom/core/socket.h>
 #include <osmocom/bsc/gsm_data.h>
 #include <osmocom/abis/e1_input.h>
 #include <osmocom/bsc/abis_nm.h>
@@ -289,6 +290,19 @@
 		e1l->tei, e1l->sapi, VTY_NEWLINE);
 }
 
+/*! Dump the IP addresses and ports of the input signal link's timeslot.
+ *  This only makes sense for links connected with ipaccess.
+ *  Example output: "    (r=10.1.42.1:55416<->l=10.1.42.123:3003)" */
+static void e1isl_dump_vty_tcp(struct vty *vty, struct e1inp_sign_link *e1l)
+{
+	if (!e1l)
+		return;
+
+	char *name = osmo_sock_get_name(NULL, e1l->ts->driver.ipaccess.fd.fd);
+	vty_out(vty, "    %s%s", name, VTY_NEWLINE);
+	talloc_free(name);
+}
+
 static void vty_out_neigh_list(struct vty *vty, struct bitvec *bv)
 {
 	int count = 0;
@@ -451,6 +465,7 @@
 			vty_out(vty, " %llu days %llu hours %llu min. %llu sec.",
 				OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), sec % 60);
 		vty_out(vty, "%s", VTY_NEWLINE);
+		e1isl_dump_vty_tcp(vty, bts->oml_link);
 	} else {
 		vty_out(vty, "  E1 Signalling Link:%s", VTY_NEWLINE);
 		e1isl_dump_vty(vty, bts->oml_link);
@@ -1048,6 +1063,7 @@
 	if (is_ipaccess_bts(trx->bts)) {
 		vty_out(vty, "  ip.access stream ID: 0x%02x%s",
 			trx->rsl_tei, VTY_NEWLINE);
+		e1isl_dump_vty_tcp(vty, trx->rsl_link);
 	} else {
 		vty_out(vty, "  E1 Signalling Link:%s", VTY_NEWLINE);
 		e1isl_dump_vty(vty, trx->rsl_link);

-- 
To view, visit https://gerrit.osmocom.org/11290
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I37f020fcdb68cafcdbdb621808483d1dd996354f
Gerrit-Change-Number: 11290
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181009/a7d7430f/attachment.htm>


More information about the gerrit-log mailing list