diff options
author | Daniel Willmann <daniel@totalueberwachung.de> | 2011-08-18 13:44:49 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2014-08-21 15:34:14 +0200 |
commit | bed515f5d6b049eccc2b135be17874156f598705 (patch) | |
tree | 7e001a4d8354066655e1453a8c8db1002a9de941 /openbsc | |
parent | 9f97316fcf99aab2420504c31884343613d6798c (diff) |
ctrl: Change the paths to bts.%i. instead of bts%i
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/libctrl/control_if.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/openbsc/src/libctrl/control_if.c b/openbsc/src/libctrl/control_if.c index 8842d3c2..19f1013d 100644 --- a/openbsc/src/libctrl/control_if.c +++ b/openbsc/src/libctrl/control_if.c @@ -157,28 +157,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) |