[MERGED] osmo-bsc[master]: bsc_vty: display bts features in show bts

2018-03-12 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: bsc_vty: display bts features in show bts
..


bsc_vty: display bts features in show bts

The command show bts displays all kind of BTS related info, but it
does not display the bts features yet.

- display bts specific features in vty-command show bts

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

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 04818d9..9dc754e 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -295,6 +295,24 @@
vty_out(vty, " (%d)", count);
 }
 
+static void bts_dump_vty_features(struct vty *vty, struct gsm_bts *bts)
+{
+   unsigned int i;
+   bool no_features = true;
+   vty_out(vty, "  Features:%s", VTY_NEWLINE);
+
+   for (i = 0; i < _NUM_BTS_FEAT; i++) {
+   if (osmo_bts_has_feature(>features, i)) {
+   vty_out(vty, "%03u ", i);
+   vty_out(vty, "%-40s%s", osmo_bts_feature_name(i), 
VTY_NEWLINE);
+   no_features = false;
+   }
+   }
+
+   if (no_features)
+   vty_out(vty, "(not available)%s", VTY_NEWLINE);
+}
+
 static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
 {
struct pchan_load pl;
@@ -468,6 +486,8 @@
bts->bts_ctrs->ctr[BTS_CTR_BTS_OML_FAIL].current,
bts->bts_ctrs->ctr[BTS_CTR_BTS_RSL_FAIL].current,
VTY_NEWLINE);
+
+   bts_dump_vty_features(vty, bts);
 }
 
 DEFUN(show_bts, show_bts_cmd, "show bts [<0-255>]",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I650133563436349d4ce55f292ea683dbb2ae68d7
Gerrit-PatchSet: 6
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-bsc[master]: bsc_vty: display bts features in show bts

2018-03-05 Thread Harald Welte

Patch Set 4: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I650133563436349d4ce55f292ea683dbb2ae68d7
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] osmo-bsc[master]: bsc_vty: display bts features in show bts

2018-03-02 Thread dexter
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/6994

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

bsc_vty: display bts features in show bts

The command show bts displays all kind of BTS related info, but it
does not display the bts features yet.

- display bts specific features in vty-command show bts

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


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/94/6994/4

diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index be2e559..d0bfbcf 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -288,6 +288,24 @@
vty_out(vty, " (%d)", count);
 }
 
+static void bts_dump_vty_features(struct vty *vty, struct gsm_bts *bts)
+{
+   unsigned int i;
+   bool no_features = true;
+   vty_out(vty, "  Features:%s", VTY_NEWLINE);
+
+   for (i = 0; i < _NUM_BTS_FEAT; i++) {
+   if (osmo_bts_has_feature(>features, i)) {
+   vty_out(vty, "%03u ", i);
+   vty_out(vty, "%-40s%s", osmo_bts_feature_name(i), 
VTY_NEWLINE);
+   no_features = false;
+   }
+   }
+
+   if (no_features)
+   vty_out(vty, "(not available)%s", VTY_NEWLINE);
+}
+
 static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
 {
struct pchan_load pl;
@@ -461,6 +479,8 @@
bts->bts_ctrs->ctr[BTS_CTR_BTS_OML_FAIL].current,
bts->bts_ctrs->ctr[BTS_CTR_BTS_RSL_FAIL].current,
VTY_NEWLINE);
+
+   bts_dump_vty_features(vty, bts);
 }
 
 DEFUN(show_bts, show_bts_cmd, "show bts [<0-255>]",

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I650133563436349d4ce55f292ea683dbb2ae68d7
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-bsc[master]: bsc_vty: display bts features in show bts

2018-03-01 Thread dexter
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/6994

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

bsc_vty: display bts features in show bts

The command show bts displays all kind of BTS related info, but it
does not display the bts features yet.

- display bts specific features in vty-command show bts

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


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

diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index be2e559..24101eb 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -288,6 +288,24 @@
vty_out(vty, " (%d)", count);
 }
 
+static void bts_dump_vty_features(struct vty *vty, struct gsm_bts *bts)
+{
+   unsigned int i;
+   bool no_features = true;
+   vty_out(vty, "  Features:%s", VTY_NEWLINE);
+
+   for (i = 0; i < _NUM_BTS_FEAT; i++) {
+   if (osmo_bts_has_feature(>features, i)) {
+   vty_out(vty, "%03u ", i);
+   vty_out(vty, "%-40s%s", 
get_value_string(osmo_bts_features_descs, i), VTY_NEWLINE);
+   no_features = false;
+   }
+   }
+
+   if (no_features)
+   vty_out(vty, "(not available)%s", VTY_NEWLINE);
+}
+
 static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
 {
struct pchan_load pl;
@@ -461,6 +479,8 @@
bts->bts_ctrs->ctr[BTS_CTR_BTS_OML_FAIL].current,
bts->bts_ctrs->ctr[BTS_CTR_BTS_RSL_FAIL].current,
VTY_NEWLINE);
+
+   bts_dump_vty_features(vty, bts);
 }
 
 DEFUN(show_bts, show_bts_cmd, "show bts [<0-255>]",

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I650133563436349d4ce55f292ea683dbb2ae68d7
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-bsc[master]: bsc_vty: display bts features in show bts

2018-02-28 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I650133563436349d4ce55f292ea683dbb2ae68d7
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] osmo-bsc[master]: bsc_vty: display bts features in show bts

2018-02-28 Thread dexter

Review at  https://gerrit.osmocom.org/6994

bsc_vty: display bts features in show bts

The command show bts displays all kind of BTS related info, but it
does not display the bts features yet.

- display bts specific features in vty-command show bts

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


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

diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 5ff9cb2..dd989c2 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -288,6 +288,24 @@
vty_out(vty, " (%d)", count);
 }
 
+static void bts_dump_vty_features(struct vty *vty, struct gsm_bts *bts)
+{
+   unsigned int i;
+   bool no_features = true;
+   vty_out(vty, "  Features:%s", VTY_NEWLINE);
+
+   for (i = 0; i < _NUM_BTS_FEAT; i++) {
+   if (gsm_bts_has_feature(bts, i)) {
+   vty_out(vty, "%03u ", i);
+   vty_out(vty, "%-40s%s", 
get_value_string(gsm_bts_features_descs, i), VTY_NEWLINE);
+   no_features = false;
+   }
+   }
+
+   if (no_features)
+   vty_out(vty, "(not available)%s", VTY_NEWLINE);
+}
+
 static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
 {
struct pchan_load pl;
@@ -461,6 +479,8 @@
bts->bts_ctrs->ctr[BTS_CTR_BTS_OML_FAIL].current,
bts->bts_ctrs->ctr[BTS_CTR_BTS_RSL_FAIL].current,
VTY_NEWLINE);
+
+   bts_dump_vty_features(vty, bts);
 }
 
 DEFUN(show_bts, show_bts_cmd, "show bts [<0-255>]",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I650133563436349d4ce55f292ea683dbb2ae68d7
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter