aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <daniel@totalueberwachung.de>2011-08-18 13:44:49 +0200
committerDaniel Willmann <daniel@totalueberwachung.de>2011-08-22 19:27:49 +0200
commit65e4168e8e9d095b781c7a2174cca9451a59e8a9 (patch)
tree9472bc8028bda59e178dba88178868ff73bcd1ff
parentb63c4be047eb2fc1de252c5a5bb6c9c6b163ad52 (diff)
ctrl: Change the paths to bts.%i. instead of bts%i
-rw-r--r--openbsc/src/libctrl/control_if.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/openbsc/src/libctrl/control_if.c b/openbsc/src/libctrl/control_if.c
index 46869d3e9..4c2d933bb 100644
--- a/openbsc/src/libctrl/control_if.c
+++ b/openbsc/src/libctrl/control_if.c
@@ -155,28 +155,40 @@ int ctrl_cmd_handle(struct ctrl_cmd *cmd, void *data)
break;
cmd->node = net;
node = CTRL_NODE_NET;
- } else if (!strncmp(token, "bts", 3)) {
+ } else if (!strcmp(token, "bts")) {
if (!net)
break;
- num = atoi(&token[3]);
+ i++;
+ if (i >= vector_active(vline))
+ break;
+ token = vector_slot(vline, i);
+ num = atoi(token);
bts = gsm_bts_num(net, num);
if (!bts)
break;
cmd->node = bts;
node = CTRL_NODE_BTS;
- } else if (!strncmp(token, "trx", 3)) {
+ } else if (!strcmp(token, "trx")) {
if (!bts)
break;
- num = atoi(&token[3]);
+ i++;
+ if (i >= vector_active(vline))
+ break;
+ token = vector_slot(vline, i);
+ num = atoi(token);
trx = gsm_bts_trx_num(bts, num);
if (!trx)
break;
cmd->node = trx;
node = CTRL_NODE_TRX;
- } else if (!strncmp(token, "ts", 2)) {
+ } else if (!strcmp(token, "ts")) {
if (!trx)
break;
- num = atoi(&token[2]);
+ i++;
+ if (i >= vector_active(vline))
+ break;
+ token = vector_slot(vline, i);
+ num = atoi(token);
if ((num >= 0) && (num < TRX_NR_TS))
ts = &trx->ts[num];
if (!ts)