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


Change subject: ctrl: Add getting access control class
......................................................................

ctrl: Add getting access control class

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



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

diff --git a/src/osmo-bsc/bts_ctrl.c b/src/osmo-bsc/bts_ctrl.c
index fdd08c1..f4058b2 100644
--- a/src/osmo-bsc/bts_ctrl.c
+++ b/src/osmo-bsc/bts_ctrl.c
@@ -834,6 +834,48 @@

 CTRL_CMD_DEFINE(bts_cell_reselection_hysteresis, 
"cell-reselection-hysteresis");

+/* Return space concatenated set of pairs <class>,<barred/allowed> */
+static int get_bts_rach_access_control_class(struct ctrl_cmd *cmd, void *data)
+{
+       int i;
+       struct gsm_bts *bts = cmd->node;
+
+       cmd->reply = talloc_strdup(cmd, "");
+       if (!cmd->reply) {
+               cmd->reply = "OOM";
+               return CTRL_CMD_ERROR;
+       }
+
+       for (i = 0; i < 8; i++) {
+               cmd->reply = talloc_asprintf_append(cmd->reply,
+                                       i == 0 ? "%u,%s": " %u,%s",
+                                       i, bts->si_common.rach_control.t3 & 
(0x1 << i) ? "barred" : "allowed");
+               if (!cmd->reply) {
+                       cmd->reply = "OOM";
+                       return CTRL_CMD_ERROR;
+               }
+       }
+
+       for (i = 0; i < 8; i++) {
+               if (i != 2)
+                       cmd->reply = talloc_asprintf_append(cmd->reply,
+                                               " %u,%s",
+                                               i + 8, 
bts->si_common.rach_control.t2 & (0x1 << i) ? "barred" : "allowed");
+               else
+                       cmd->reply = talloc_asprintf_append(cmd->reply,
+                                               " emergency,%s",
+                                               bts->si_common.rach_control.t2 
& (0x1 << i) ? "barred" : "allowed");
+               if (!cmd->reply) {
+                       cmd->reply = "OOM";
+                       return CTRL_CMD_ERROR;
+               }
+       }
+
+       return CTRL_CMD_REPLY;
+}
+
+CTRL_CMD_DEFINE_RO(bts_rach_access_control_class, 
"si3-rach-access-control-classes");
+
 int bsc_bts_ctrl_cmds_install(void)
 {
        int rc = 0;
@@ -859,6 +901,7 @@
        rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_cell_reselection_offset);
        rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_penalty_time);
        rc |= ctrl_cmd_install(CTRL_NODE_BTS, 
&cmd_bts_cell_reselection_hysteresis);
+       rc |= ctrl_cmd_install(CTRL_NODE_BTS, 
&cmd_bts_rach_access_control_class);

        rc |= neighbor_ident_ctrl_init();


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

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

Reply via email to