matanp has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/32565 )


Change subject: ctrl: Add getting neighbor list
......................................................................

ctrl: Add getting neighbor list

Change-Id: Icba0b7d92f4c67e617d707ca651d674f0d1ba8a7
---
M src/osmo-bsc/bts_ctrl.c
1 file changed, 38 insertions(+), 0 deletions(-)



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

diff --git a/src/osmo-bsc/bts_ctrl.c b/src/osmo-bsc/bts_ctrl.c
index 7f4413f..ecd58f4 100644
--- a/src/osmo-bsc/bts_ctrl.c
+++ b/src/osmo-bsc/bts_ctrl.c
@@ -514,6 +514,34 @@

 CTRL_CMD_DEFINE(bts_c0_power_red, "c0-power-reduction");

+static int get_bts_neighbor_list_si2(struct ctrl_cmd *cmd, void *data)
+{
+       int i;
+       const struct gsm_bts *bts = cmd->node;
+       const struct bitvec *bv = &bts->si_common.neigh_list;
+
+       cmd->reply = talloc_strdup(cmd, "");
+       if (!cmd->reply) {
+               cmd->reply = "OOM";
+               return CTRL_CMD_ERROR;
+       }
+
+       for (i = 0; i < bv->data_len * 8; i++) {
+               if (!bitvec_get_bit_pos(bv, i))
+                       continue;
+
+               cmd->reply = talloc_asprintf_append(cmd->reply, i == 0 ? "%u" : 
" %u", i);
+               if (!cmd->reply) {
+                       cmd->reply = "OOM";
+                       return CTRL_CMD_ERROR;
+               }
+       }
+
+       return CTRL_CMD_REPLY;
+}
+
+CTRL_CMD_DEFINE_RO(bts_neighbor_list_si2, "neighbor-list si2");
+
 static int verify_bts_neighbor_list_add_del(struct ctrl_cmd *cmd, const char 
*value, void *_data)
 {
        int arfcn;
@@ -976,6 +1004,7 @@
        rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_rf_state);
        rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_rf_states);
        rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_c0_power_red);
+       rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_neighbor_list_si2);
        rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_neighbor_list_add);
        rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_neighbor_list_del);
        rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_neighbor_list_mode);

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/32565
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Icba0b7d92f4c67e617d707ca651d674f0d1ba8a7
Gerrit-Change-Number: 32565
Gerrit-PatchSet: 1
Gerrit-Owner: matanp <[email protected]>
Gerrit-MessageType: newchange

Reply via email to