[PATCH] osmo-bsc[master]: vty: 'show bts': print neighbor cells

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/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Feb 16 15:57:54 UTC 2018


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/6479

to look at the new patch set (#2).

vty: 'show bts': print neighbor cells

Print out the current neighbor cell list, works both for manual and
automatically populated modes.

Examples of output for various configs:

  Neighbor Cells: Automatic, ARFCNs: (none)
  Neighbor Cells: Automatic, ARFCNs: 868 (1)
  Neighbor Cells: Manual, ARFCNs: 123 125 (2)
  Neighbor Cells: Manual/separate SI5, ARFCNs: 123 125 (2) SI5: 321 (1)

Change-Id: I57dae0e01b81a6f028b39f3edcaf430251ca8fe2
---
M src/libbsc/bsc_vty.c
1 file changed, 38 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/79/6479/2

diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index a612e0d..a0327b2 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -266,6 +266,22 @@
 		e1l->tei, e1l->sapi, VTY_NEWLINE);
 }
 
+static void vty_out_neigh_list(struct vty *vty, struct bitvec *bv)
+{
+	int count = 0;
+	int i;
+	for (i = 0; i < 1024; i++) {
+		if (!bitvec_get_bit_pos(bv, i))
+			continue;
+		vty_out(vty, " %u", i);
+		count ++;
+	}
+	if (!count)
+		vty_out(vty, " (none)");
+	else
+		vty_out(vty, " (%d)", count);
+}
+
 static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
 {
 	struct pchan_load pl;
@@ -387,6 +403,28 @@
 		e1isl_dump_vty(vty, bts->oml_link);
 	}
 
+	vty_out(vty, "  Neighbor Cells: ");
+	switch (bts->neigh_list_manual_mode) {
+	default:
+	case NL_MODE_AUTOMATIC:
+		vty_out(vty, "Automatic");
+		/* generate_bcch_chan_list() should populate si_common.neigh_list */
+		break;
+	case NL_MODE_MANUAL:
+		vty_out(vty, "Manual");
+		break;
+	case NL_MODE_MANUAL_SI5SEP:
+		vty_out(vty, "Manual/separate SI5");
+		break;
+	}
+	vty_out(vty, ", ARFCNs:");
+	vty_out_neigh_list(vty, &bts->si_common.neigh_list);
+	if (bts->neigh_list_manual_mode == NL_MODE_MANUAL_SI5SEP) {
+		vty_out(vty, " SI5:");
+		vty_out_neigh_list(vty, &bts->si_common.si5_neigh_list);
+	}
+	vty_out(vty, "%s", VTY_NEWLINE);
+
 	/* FIXME: chan_desc */
 	memset(&pl, 0, sizeof(pl));
 	bts_chan_load(&pl, bts);

-- 
To view, visit https://gerrit.osmocom.org/6479
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I57dae0e01b81a6f028b39f3edcaf430251ca8fe2
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list