diff options
author | Daniel Willmann <daniel@totalueberwachung.de> | 2011-08-18 13:44:49 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-09-11 16:20:45 +0200 |
commit | 7aa4f0a263d26b5a7034d18a874f1511f56c1665 (patch) | |
tree | 3bd14025c40484d651796c357c9998dc2d88fdfd | |
parent | fa0ec157af24af30591bad295d196b31bfc943a2 (diff) |
ctrl: Change the paths to bts.%i. instead of bts%i
-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 8842d3c2f..19f1013d5 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) |