blob: 529b0d481ee0d1bcc3f945461bc79f9aab6d000a [file] [log] [blame]
Harald Welte68628e82009-03-10 12:17:57 +00001/* OpenBSC interface to quagga VTY */
2/* (C) 2009 by Harald Welte <laforge@gnumonks.org>
3 * All Rights Reserved
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 */
20
21#include <stdlib.h>
22#include <unistd.h>
23#include <sys/types.h>
24
25#include <vty/command.h>
Harald Weltef9daefd2009-08-09 15:13:54 +020026#include <vty/buffer.h>
Harald Welte68628e82009-03-10 12:17:57 +000027#include <vty/vty.h>
28
29#include <arpa/inet.h>
30
Harald Welte1bc77352009-03-10 19:47:51 +000031#include <openbsc/linuxlist.h>
Harald Welte68628e82009-03-10 12:17:57 +000032#include <openbsc/gsm_data.h>
Harald Welte68628e82009-03-10 12:17:57 +000033#include <openbsc/e1_input.h>
Harald Welte1bc77352009-03-10 19:47:51 +000034#include <openbsc/abis_nm.h>
Harald Weltef9daefd2009-08-09 15:13:54 +020035#include <openbsc/gsm_utils.h>
Harald Welte40f82892009-05-23 17:31:39 +000036#include <openbsc/db.h>
Harald Welte5013b2a2009-08-07 13:29:14 +020037#include <openbsc/talloc.h>
Harald Welte68628e82009-03-10 12:17:57 +000038
39static struct gsm_network *gsmnet;
40
Harald Welte5013b2a2009-08-07 13:29:14 +020041struct cmd_node net_node = {
42 GSMNET_NODE,
43 "%s(network)#",
44 1,
45};
46
Harald Welte68628e82009-03-10 12:17:57 +000047struct cmd_node bts_node = {
48 BTS_NODE,
49 "%s(bts)#",
50 1,
51};
52
53struct cmd_node trx_node = {
54 TRX_NODE,
55 "%s(trx)#",
56 1,
57};
58
59struct cmd_node ts_node = {
60 TS_NODE,
61 "%s(ts)#",
62 1,
63};
64
65static int dummy_config_write(struct vty *v)
66{
67 return CMD_SUCCESS;
68}
69
70static void net_dump_nmstate(struct vty *vty, struct gsm_nm_state *nms)
71{
Harald Welte1bc77352009-03-10 19:47:51 +000072 vty_out(vty,"Oper '%s', Admin %u, Avail '%s'%s",
73 nm_opstate_name(nms->operational), nms->administrative,
74 nm_avail_name(nms->availability), VTY_NEWLINE);
Harald Welte68628e82009-03-10 12:17:57 +000075}
76
77static void net_dump_vty(struct vty *vty, struct gsm_network *net)
78{
Harald Welteef235b52009-03-10 12:34:02 +000079 vty_out(vty, "BSC is on Country Code %u, Network Code %u "
80 "and has %u BTS%s", net->country_code, net->network_code,
81 net->num_bts, VTY_NEWLINE);
Harald Welte1bc77352009-03-10 19:47:51 +000082 vty_out(vty, " Long network name: '%s'%s",
Harald Welte68628e82009-03-10 12:17:57 +000083 net->name_long, VTY_NEWLINE);
Harald Welte1bc77352009-03-10 19:47:51 +000084 vty_out(vty, " Short network name: '%s'%s",
Harald Welte68628e82009-03-10 12:17:57 +000085 net->name_short, VTY_NEWLINE);
Harald Welte (local)69de3972009-08-12 14:42:23 +020086 vty_out(vty, " Authentication policy: %s%s",
87 gsm_auth_policy_name(net->auth_policy), VTY_NEWLINE);
Harald Welte1085c092009-11-18 20:33:19 +010088 vty_out(vty, " Location updating reject cause: %u%s",
89 net->reject_cause, VTY_NEWLINE);
Harald Welte4381cfe2009-08-30 15:47:06 +090090 vty_out(vty, " Encryption: A5/%u%s", net->a5_encryption,
91 VTY_NEWLINE);
Holger Hans Peter Freytherf7d752f2009-11-16 17:12:38 +010092 vty_out(vty, " NECI (TCH/H): %u%s", net->neci,
93 VTY_NEWLINE);
Harald Welte68628e82009-03-10 12:17:57 +000094}
95
96DEFUN(show_net, show_net_cmd, "show network",
97 SHOW_STR "Display information about a GSM NETWORK\n")
98{
99 struct gsm_network *net = gsmnet;
100 net_dump_vty(vty, net);
101
102 return CMD_SUCCESS;
103}
104
105static void e1isl_dump_vty(struct vty *vty, struct e1inp_sign_link *e1l)
106{
Harald Welteedb37782009-05-01 14:59:07 +0000107 struct e1inp_line *line;
108
109 if (!e1l) {
110 vty_out(vty, " None%s", VTY_NEWLINE);
111 return;
112 }
113
114 line = e1l->ts->line;
115
116 vty_out(vty, " E1 Line %u, Type %s: Timeslot %u, Mode %s%s",
117 line->num, line->driver->name, e1l->ts->num,
Harald Welte1bc77352009-03-10 19:47:51 +0000118 e1inp_signtype_name(e1l->type), VTY_NEWLINE);
Harald Welteedb37782009-05-01 14:59:07 +0000119 vty_out(vty, " E1 TEI %u, SAPI %u%s",
Harald Welte68628e82009-03-10 12:17:57 +0000120 e1l->tei, e1l->sapi, VTY_NEWLINE);
121}
122
123static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
124{
Holger Hans Peter Freytherc4a49e32009-08-21 14:44:12 +0200125 vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, "
Harald Weltefcd24452009-06-20 18:15:19 +0200126 "BSIC %u, TSC %u and %u TRX%s",
127 bts->nr, btstype2str(bts->type), gsm_band_name(bts->band),
Holger Hans Peter Freytherc4a49e32009-08-21 14:44:12 +0200128 bts->cell_identity,
Harald Weltefcd24452009-06-20 18:15:19 +0200129 bts->location_area_code, bts->bsic, bts->tsc,
130 bts->num_trx, VTY_NEWLINE);
Harald Welte1d8dbc42009-12-12 15:38:16 +0100131 vty_out(vty, "MS Max power: %u dBm%s", bts->ms_max_power, VTY_NEWLINE);
Harald Welte73225282009-12-12 18:17:25 +0100132 vty_out(vty, "Minimum Rx Level for Access: %i dBm%s",
Harald Welte1d8dbc42009-12-12 15:38:16 +0100133 rxlev2dbm(bts->si_common.cell_sel_par.rxlev_acc_min),
134 VTY_NEWLINE);
135 vty_out(vty, "Cell Reselection Hysteresis: %u dBm%s",
Harald Welte73225282009-12-12 18:17:25 +0100136 bts->si_common.cell_sel_par.cell_resel_hyst*2, VTY_NEWLINE);
Harald Welte (local)5dececf2009-08-12 13:28:23 +0200137 if (bts->cell_barred)
138 vty_out(vty, " CELL IS BARRED%s", VTY_NEWLINE);
Harald Welte4cc34222009-05-01 15:12:31 +0000139 if (is_ipaccess_bts(bts))
Harald Welte8175e952009-10-20 00:22:00 +0200140 vty_out(vty, " Unit ID: %u/%u/0, OML Stream ID 0x%02x%s",
Harald Welte4cc34222009-05-01 15:12:31 +0000141 bts->ip_access.site_id, bts->ip_access.bts_id,
Harald Welte8175e952009-10-20 00:22:00 +0200142 bts->oml_tei, VTY_NEWLINE);
Harald Welte68628e82009-03-10 12:17:57 +0000143 vty_out(vty, " NM State: ");
144 net_dump_nmstate(vty, &bts->nm_state);
145 vty_out(vty, " Site Mgr NM State: ");
146 net_dump_nmstate(vty, &bts->site_mgr.nm_state);
147 vty_out(vty, " Paging: FIXME pending requests, %u free slots%s",
148 bts->paging.available_slots, VTY_NEWLINE);
Harald Welte8175e952009-10-20 00:22:00 +0200149 if (!is_ipaccess_bts(bts)) {
150 vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE);
151 e1isl_dump_vty(vty, bts->oml_link);
152 }
Harald Welte68628e82009-03-10 12:17:57 +0000153 /* FIXME: oml_link, chan_desc */
154}
155
156DEFUN(show_bts, show_bts_cmd, "show bts [number]",
157 SHOW_STR "Display information about a BTS\n"
158 "BTS number")
159{
160 struct gsm_network *net = gsmnet;
161 int bts_nr;
162
163 if (argc != 0) {
164 /* use the BTS number that the user has specified */
165 bts_nr = atoi(argv[0]);
166 if (bts_nr > net->num_bts) {
Harald Welte1bc77352009-03-10 19:47:51 +0000167 vty_out(vty, "%% can't find BTS '%s'%s", argv[0],
Harald Welte68628e82009-03-10 12:17:57 +0000168 VTY_NEWLINE);
169 return CMD_WARNING;
170 }
Harald Weltee441d9c2009-06-21 16:17:15 +0200171 bts_dump_vty(vty, gsm_bts_num(net, bts_nr));
Harald Welte68628e82009-03-10 12:17:57 +0000172 return CMD_SUCCESS;
173 }
174 /* print all BTS's */
175 for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++)
Harald Weltee441d9c2009-06-21 16:17:15 +0200176 bts_dump_vty(vty, gsm_bts_num(net, bts_nr));
Harald Welte68628e82009-03-10 12:17:57 +0000177
178 return CMD_SUCCESS;
179}
180
Harald Welte42581822009-08-08 16:12:58 +0200181/* utility functions */
182static void parse_e1_link(struct gsm_e1_subslot *e1_link, const char *line,
183 const char *ts, const char *ss)
184{
185 e1_link->e1_nr = atoi(line);
186 e1_link->e1_ts = atoi(ts);
187 if (!strcmp(ss, "full"))
188 e1_link->e1_ts_ss = 255;
189 else
190 e1_link->e1_ts_ss = atoi(ss);
191}
192
193static void config_write_e1_link(struct vty *vty, struct gsm_e1_subslot *e1_link,
194 const char *prefix)
195{
196 if (!e1_link->e1_ts)
197 return;
198
199 if (e1_link->e1_ts_ss == 255)
200 vty_out(vty, "%se1 line %u timeslot %u sub-slot full%s",
201 prefix, e1_link->e1_nr, e1_link->e1_ts, VTY_NEWLINE);
202 else
203 vty_out(vty, "%se1 line %u timeslot %u sub-slot %u%s",
204 prefix, e1_link->e1_nr, e1_link->e1_ts,
205 e1_link->e1_ts_ss, VTY_NEWLINE);
206}
207
208
Harald Welte67ce0732009-08-06 19:06:46 +0200209static void config_write_ts_single(struct vty *vty, struct gsm_bts_trx_ts *ts)
210{
Harald Welte42581822009-08-08 16:12:58 +0200211 vty_out(vty, " timeslot %u%s", ts->nr, VTY_NEWLINE);
212 if (ts->pchan != GSM_PCHAN_NONE)
213 vty_out(vty, " phys_chan_config %s%s",
214 gsm_pchan_name(ts->pchan), VTY_NEWLINE);
215 config_write_e1_link(vty, &ts->e1_link, " ");
Harald Welte67ce0732009-08-06 19:06:46 +0200216}
217
218static void config_write_trx_single(struct vty *vty, struct gsm_bts_trx *trx)
219{
220 int i;
221
Harald Welte5013b2a2009-08-07 13:29:14 +0200222 vty_out(vty, " trx %u%s", trx->nr, VTY_NEWLINE);
223 vty_out(vty, " arfcn %u%s", trx->arfcn, VTY_NEWLINE);
224 vty_out(vty, " max_power_red %u%s", trx->max_power_red, VTY_NEWLINE);
Harald Welte42581822009-08-08 16:12:58 +0200225 config_write_e1_link(vty, &trx->rsl_e1_link, " rsl ");
226 vty_out(vty, " rsl e1 tei %u%s", trx->rsl_tei, VTY_NEWLINE);
Harald Welte67ce0732009-08-06 19:06:46 +0200227
228 for (i = 0; i < TRX_NR_TS; i++)
229 config_write_ts_single(vty, &trx->ts[i]);
230}
231
232static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
233{
234 struct gsm_bts_trx *trx;
235
Harald Welte5013b2a2009-08-07 13:29:14 +0200236 vty_out(vty, " bts %u%s", bts->nr, VTY_NEWLINE);
237 vty_out(vty, " type %s%s", btstype2str(bts->type), VTY_NEWLINE);
238 vty_out(vty, " band %s%s", gsm_band_name(bts->band), VTY_NEWLINE);
Holger Hans Peter Freytherf926ed62009-11-19 16:38:49 +0100239 vty_out(vty, " cell_identity %u%s", bts->cell_identity, VTY_NEWLINE);
Harald Welte5013b2a2009-08-07 13:29:14 +0200240 vty_out(vty, " location_area_code %u%s", bts->location_area_code,
Harald Welte67ce0732009-08-06 19:06:46 +0200241 VTY_NEWLINE);
Harald Welte5013b2a2009-08-07 13:29:14 +0200242 vty_out(vty, " training_sequence_code %u%s", bts->tsc, VTY_NEWLINE);
243 vty_out(vty, " base_station_id_code %u%s", bts->bsic, VTY_NEWLINE);
Harald Welte (local)0e451d02009-08-13 10:14:26 +0200244 vty_out(vty, " ms max power %u%s", bts->ms_max_power, VTY_NEWLINE);
Harald Welte73225282009-12-12 18:17:25 +0100245 vty_out(vty, " cell reselection hysteresis %u%s",
246 bts->si_common.cell_sel_par.cell_resel_hyst*2, VTY_NEWLINE);
247 vty_out(vty, " rxlev access min %u%s",
248 bts->si_common.cell_sel_par.rxlev_acc_min, VTY_NEWLINE);
Harald Weltea43f7892009-12-01 18:04:30 +0530249 if (bts->si_common.chan_desc.t3212)
Harald Welte (local)efc92312009-08-14 23:09:25 +0200250 vty_out(vty, " periodic location update %u%s",
Harald Weltea43f7892009-12-01 18:04:30 +0530251 bts->si_common.chan_desc.t3212 * 10, VTY_NEWLINE);
Harald Welte7a8fa412009-08-10 13:48:16 +0200252 vty_out(vty, " channel allocator %s%s",
253 bts->chan_alloc_reverse ? "descending" : "ascending",
254 VTY_NEWLINE);
Harald Welte (local)5dececf2009-08-12 13:28:23 +0200255 if (bts->cell_barred)
256 vty_out(vty, " cell barred 1%s", VTY_NEWLINE);
Harald Welte8175e952009-10-20 00:22:00 +0200257 if (is_ipaccess_bts(bts)) {
Harald Welte5013b2a2009-08-07 13:29:14 +0200258 vty_out(vty, " ip.access unit_id %u %u%s",
Harald Weltea6fd58e2009-08-07 00:25:23 +0200259 bts->ip_access.site_id, bts->ip_access.bts_id, VTY_NEWLINE);
Harald Welte8175e952009-10-20 00:22:00 +0200260 vty_out(vty, " oml ip.access stream_id %u%s", bts->oml_tei, VTY_NEWLINE);
261 } else {
Harald Welte42581822009-08-08 16:12:58 +0200262 config_write_e1_link(vty, &bts->oml_e1_link, " oml ");
263 vty_out(vty, " oml e1 tei %u%s", bts->oml_tei, VTY_NEWLINE);
264 }
Harald Welte67ce0732009-08-06 19:06:46 +0200265
266 llist_for_each_entry(trx, &bts->trx_list, list)
267 config_write_trx_single(vty, trx);
268}
269
270static int config_write_bts(struct vty *v)
271{
272 struct gsm_bts *bts;
273
274 llist_for_each_entry(bts, &gsmnet->bts_list, list)
275 config_write_bts_single(v, bts);
276
277 return CMD_SUCCESS;
278}
279
Harald Welte5013b2a2009-08-07 13:29:14 +0200280static int config_write_net(struct vty *vty)
281{
282 vty_out(vty, "network%s", VTY_NEWLINE);
Harald Welte42581822009-08-08 16:12:58 +0200283 vty_out(vty, " network country code %u%s", gsmnet->country_code, VTY_NEWLINE);
Harald Welte5013b2a2009-08-07 13:29:14 +0200284 vty_out(vty, " mobile network code %u%s", gsmnet->network_code, VTY_NEWLINE);
Harald Welte42581822009-08-08 16:12:58 +0200285 vty_out(vty, " short name %s%s", gsmnet->name_short, VTY_NEWLINE);
286 vty_out(vty, " long name %s%s", gsmnet->name_long, VTY_NEWLINE);
Harald Welte (local)69de3972009-08-12 14:42:23 +0200287 vty_out(vty, " auth policy %s%s", gsm_auth_policy_name(gsmnet->auth_policy), VTY_NEWLINE);
Harald Welte1085c092009-11-18 20:33:19 +0100288 vty_out(vty, " location updating reject cause %u%s",
289 gsmnet->reject_cause, VTY_NEWLINE);
Harald Welte4381cfe2009-08-30 15:47:06 +0900290 vty_out(vty, " encryption a5 %u%s", gsmnet->a5_encryption, VTY_NEWLINE);
Holger Hans Peter Freytherd54c3372009-11-19 16:37:48 +0100291 vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE);
Holger Hans Peter Freytherc4d88ad2009-11-21 21:18:38 +0100292 vty_out(vty, " timer t3101 %u%s", gsmnet->T3101, VTY_NEWLINE);
Holger Hans Peter Freyther23975e72009-11-21 21:42:26 +0100293 vty_out(vty, " timer t3103 %u%s", gsmnet->T3103, VTY_NEWLINE);
294 vty_out(vty, " timer t3105 %u%s", gsmnet->T3105, VTY_NEWLINE);
295 vty_out(vty, " timer t3107 %u%s", gsmnet->T3107, VTY_NEWLINE);
296 vty_out(vty, " timer t3109 %u%s", gsmnet->T3109, VTY_NEWLINE);
297 vty_out(vty, " timer t3111 %u%s", gsmnet->T3111, VTY_NEWLINE);
298 vty_out(vty, " timer t3113 %u%s", gsmnet->T3113, VTY_NEWLINE);
299 vty_out(vty, " timer t3115 %u%s", gsmnet->T3115, VTY_NEWLINE);
300 vty_out(vty, " timer t3117 %u%s", gsmnet->T3117, VTY_NEWLINE);
301 vty_out(vty, " timer t3119 %u%s", gsmnet->T3119, VTY_NEWLINE);
302 vty_out(vty, " timer t3141 %u%s", gsmnet->T3141, VTY_NEWLINE);
Harald Welte5013b2a2009-08-07 13:29:14 +0200303
304 return CMD_SUCCESS;
305}
Harald Welte67ce0732009-08-06 19:06:46 +0200306
Harald Welte68628e82009-03-10 12:17:57 +0000307static void trx_dump_vty(struct vty *vty, struct gsm_bts_trx *trx)
308{
309 vty_out(vty, "TRX %u of BTS %u is on ARFCN %u%s",
310 trx->nr, trx->bts->nr, trx->arfcn, VTY_NEWLINE);
Harald Weltefcd24452009-06-20 18:15:19 +0200311 vty_out(vty, " RF Nominal Power: %d dBm, reduced by %u dB, "
Harald Welte42581822009-08-08 16:12:58 +0200312 "resulting BS power: %d dBm%s",
Harald Weltefcd24452009-06-20 18:15:19 +0200313 trx->nominal_power, trx->max_power_red,
Harald Welte42581822009-08-08 16:12:58 +0200314 trx->nominal_power - trx->max_power_red, VTY_NEWLINE);
Harald Welte68628e82009-03-10 12:17:57 +0000315 vty_out(vty, " NM State: ");
316 net_dump_nmstate(vty, &trx->nm_state);
317 vty_out(vty, " Baseband Transceiver NM State: ");
318 net_dump_nmstate(vty, &trx->bb_transc.nm_state);
Harald Welte8175e952009-10-20 00:22:00 +0200319 if (is_ipaccess_bts(trx->bts)) {
320 vty_out(vty, " ip.access stream ID: 0x%02x%s",
321 trx->rsl_tei, VTY_NEWLINE);
322 } else {
323 vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE);
324 e1isl_dump_vty(vty, trx->rsl_link);
325 }
Harald Welte68628e82009-03-10 12:17:57 +0000326}
327
328DEFUN(show_trx,
329 show_trx_cmd,
330 "show trx [bts_nr] [trx_nr]",
331 SHOW_STR "Display information about a TRX\n")
332{
333 struct gsm_network *net = gsmnet;
334 struct gsm_bts *bts = NULL;
335 struct gsm_bts_trx *trx;
336 int bts_nr, trx_nr;
337
338 if (argc >= 1) {
339 /* use the BTS number that the user has specified */
340 bts_nr = atoi(argv[0]);
341 if (bts_nr >= net->num_bts) {
Harald Welte1bc77352009-03-10 19:47:51 +0000342 vty_out(vty, "%% can't find BTS '%s'%s", argv[0],
Harald Welte68628e82009-03-10 12:17:57 +0000343 VTY_NEWLINE);
344 return CMD_WARNING;
345 }
Harald Weltee441d9c2009-06-21 16:17:15 +0200346 bts = gsm_bts_num(net, bts_nr);
Harald Welte68628e82009-03-10 12:17:57 +0000347 }
348 if (argc >= 2) {
349 trx_nr = atoi(argv[1]);
350 if (trx_nr >= bts->num_trx) {
Harald Welte1bc77352009-03-10 19:47:51 +0000351 vty_out(vty, "%% can't find TRX '%s'%s", argv[1],
Harald Welte68628e82009-03-10 12:17:57 +0000352 VTY_NEWLINE);
353 return CMD_WARNING;
354 }
Harald Weltee441d9c2009-06-21 16:17:15 +0200355 trx = gsm_bts_trx_num(bts, trx_nr);
Harald Welte68628e82009-03-10 12:17:57 +0000356 trx_dump_vty(vty, trx);
357 return CMD_SUCCESS;
358 }
359 if (bts) {
360 /* print all TRX in this BTS */
361 for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) {
Harald Weltee441d9c2009-06-21 16:17:15 +0200362 trx = gsm_bts_trx_num(bts, trx_nr);
Harald Welte68628e82009-03-10 12:17:57 +0000363 trx_dump_vty(vty, trx);
364 }
365 return CMD_SUCCESS;
366 }
367
368 for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) {
Harald Weltee441d9c2009-06-21 16:17:15 +0200369 bts = gsm_bts_num(net, bts_nr);
Harald Welte68628e82009-03-10 12:17:57 +0000370 for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) {
Harald Weltee441d9c2009-06-21 16:17:15 +0200371 trx = gsm_bts_trx_num(bts, trx_nr);
Harald Welte68628e82009-03-10 12:17:57 +0000372 trx_dump_vty(vty, trx);
373 }
374 }
375
376 return CMD_SUCCESS;
377}
378
Harald Welte67ce0732009-08-06 19:06:46 +0200379
Harald Welte68628e82009-03-10 12:17:57 +0000380static void ts_dump_vty(struct vty *vty, struct gsm_bts_trx_ts *ts)
381{
Harald Welte68628e82009-03-10 12:17:57 +0000382 vty_out(vty, "Timeslot %u of TRX %u in BTS %u, phys cfg %s%s",
383 ts->nr, ts->trx->nr, ts->trx->bts->nr,
384 gsm_pchan_name(ts->pchan), VTY_NEWLINE);
385 vty_out(vty, " NM State: ");
386 net_dump_nmstate(vty, &ts->nm_state);
Harald Welte2c828992009-12-02 01:56:49 +0530387 if (!is_ipaccess_bts(ts->trx->bts))
Harald Welteef235b52009-03-10 12:34:02 +0000388 vty_out(vty, " E1 Line %u, Timeslot %u, Subslot %u%s",
389 ts->e1_link.e1_nr, ts->e1_link.e1_ts,
390 ts->e1_link.e1_ts_ss, VTY_NEWLINE);
Harald Welte68628e82009-03-10 12:17:57 +0000391}
392
393DEFUN(show_ts,
394 show_ts_cmd,
Harald Welte1bc77352009-03-10 19:47:51 +0000395 "show timeslot [bts_nr] [trx_nr] [ts_nr]",
Harald Welte68628e82009-03-10 12:17:57 +0000396 SHOW_STR "Display information about a TS\n")
397{
398 struct gsm_network *net = gsmnet;
399 struct gsm_bts *bts;
400 struct gsm_bts_trx *trx;
401 struct gsm_bts_trx_ts *ts;
402 int bts_nr, trx_nr, ts_nr;
403
404 if (argc >= 1) {
405 /* use the BTS number that the user has specified */
406 bts_nr = atoi(argv[0]);
407 if (bts_nr >= net->num_bts) {
Harald Welte1bc77352009-03-10 19:47:51 +0000408 vty_out(vty, "%% can't find BTS '%s'%s", argv[0],
Harald Welte68628e82009-03-10 12:17:57 +0000409 VTY_NEWLINE);
410 return CMD_WARNING;
411 }
Harald Weltee441d9c2009-06-21 16:17:15 +0200412 bts = gsm_bts_num(net, bts_nr);
Harald Welte68628e82009-03-10 12:17:57 +0000413 }
414 if (argc >= 2) {
415 trx_nr = atoi(argv[1]);
416 if (trx_nr >= bts->num_trx) {
Harald Welte1bc77352009-03-10 19:47:51 +0000417 vty_out(vty, "%% can't find TRX '%s'%s", argv[1],
Harald Welte68628e82009-03-10 12:17:57 +0000418 VTY_NEWLINE);
419 return CMD_WARNING;
420 }
Harald Weltee441d9c2009-06-21 16:17:15 +0200421 trx = gsm_bts_trx_num(bts, trx_nr);
Harald Welte68628e82009-03-10 12:17:57 +0000422 }
423 if (argc >= 3) {
424 ts_nr = atoi(argv[2]);
425 if (ts_nr >= TRX_NR_TS) {
Harald Welte1bc77352009-03-10 19:47:51 +0000426 vty_out(vty, "%% can't find TS '%s'%s", argv[2],
Harald Welte68628e82009-03-10 12:17:57 +0000427 VTY_NEWLINE);
428 return CMD_WARNING;
429 }
430 ts = &trx->ts[ts_nr];
431 ts_dump_vty(vty, ts);
432 return CMD_SUCCESS;
433 }
434 for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) {
Harald Weltee441d9c2009-06-21 16:17:15 +0200435 bts = gsm_bts_num(net, bts_nr);
Harald Welte68628e82009-03-10 12:17:57 +0000436 for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) {
Harald Weltee441d9c2009-06-21 16:17:15 +0200437 trx = gsm_bts_trx_num(bts, trx_nr);
Harald Welte68628e82009-03-10 12:17:57 +0000438 for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) {
439 ts = &trx->ts[ts_nr];
440 ts_dump_vty(vty, ts);
441 }
442 }
443 }
444
445 return CMD_SUCCESS;
446}
447
Holger Hans Peter Freythercfa90d42009-08-10 10:17:50 +0200448void subscr_dump_vty(struct vty *vty, struct gsm_subscriber *subscr)
Harald Welte68628e82009-03-10 12:17:57 +0000449{
Harald Weltefcd24452009-06-20 18:15:19 +0200450 vty_out(vty, " ID: %llu, Authorized: %d%s", subscr->id,
Harald Welte40f82892009-05-23 17:31:39 +0000451 subscr->authorized, VTY_NEWLINE);
Harald Welte68628e82009-03-10 12:17:57 +0000452 if (subscr->name)
Harald Welte1bc77352009-03-10 19:47:51 +0000453 vty_out(vty, " Name: '%s'%s", subscr->name, VTY_NEWLINE);
Harald Welte68628e82009-03-10 12:17:57 +0000454 if (subscr->extension)
455 vty_out(vty, " Extension: %s%s", subscr->extension,
456 VTY_NEWLINE);
457 if (subscr->imsi)
458 vty_out(vty, " IMSI: %s%s", subscr->imsi, VTY_NEWLINE);
Holger Hans Peter Freyther22230252009-08-19 12:53:57 +0200459 if (subscr->tmsi != GSM_RESERVED_TMSI)
460 vty_out(vty, " TMSI: %08X%s", subscr->tmsi,
Harald Welte731fd912009-08-15 03:24:51 +0200461 VTY_NEWLINE);
Harald Welte (local)15920de2009-08-14 20:27:16 +0200462 vty_out(vty, " Use count: %u%s", subscr->use_count, VTY_NEWLINE);
Harald Welte68628e82009-03-10 12:17:57 +0000463}
464
465static void lchan_dump_vty(struct vty *vty, struct gsm_lchan *lchan)
466{
467 vty_out(vty, "Lchan %u in Timeslot %u of TRX %u in BTS %u, Type %s%s",
468 lchan->nr, lchan->ts->nr, lchan->ts->trx->nr,
469 lchan->ts->trx->bts->nr, gsm_lchan_name(lchan->type),
470 VTY_NEWLINE);
471 vty_out(vty, " Use Count: %u%s", lchan->use_count, VTY_NEWLINE);
Harald Welte73225282009-12-12 18:17:25 +0100472 vty_out(vty, " BS Power: %u dBm, MS Power: %u dBm%s",
473 lchan->ts->trx->nominal_power - lchan->ts->trx->max_power_red
474 - lchan->bs_power*2,
475 ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power),
476 VTY_NEWLINE);
Harald Welte68628e82009-03-10 12:17:57 +0000477 if (lchan->subscr) {
478 vty_out(vty, " Subscriber:%s", VTY_NEWLINE);
479 subscr_dump_vty(vty, lchan->subscr);
480 } else
481 vty_out(vty, " No Subscriber%s", VTY_NEWLINE);
Harald Welte2c828992009-12-02 01:56:49 +0530482 if (is_ipaccess_bts(lchan->ts->trx->bts)) {
483 struct in_addr ia;
484 ia.s_addr = lchan->abis_ip.bound_ip;
485 vty_out(vty, " Bound IP: %s Port %u RTP_TYPE2=%u CONN_ID=%u%s",
486 inet_ntoa(ia), lchan->abis_ip.bound_port,
487 lchan->abis_ip.rtp_payload2, lchan->abis_ip.conn_id,
488 VTY_NEWLINE);
489 }
Harald Welte68628e82009-03-10 12:17:57 +0000490}
491
Harald Welte4bfdfe72009-06-10 23:11:52 +0800492#if 0
493TODO: callref and remote callref of call must be resolved to get gsm_trans object
Harald Welte68628e82009-03-10 12:17:57 +0000494static void call_dump_vty(struct vty *vty, struct gsm_call *call)
495{
496 vty_out(vty, "Call Type %u, State %u, Transaction ID %u%s",
497 call->type, call->state, call->transaction_id, VTY_NEWLINE);
498
499 if (call->local_lchan) {
500 vty_out(vty, "Call Local Channel:%s", VTY_NEWLINE);
501 lchan_dump_vty(vty, call->local_lchan);
502 } else
503 vty_out(vty, "Call has no Local Channel%s", VTY_NEWLINE);
504
505 if (call->remote_lchan) {
506 vty_out(vty, "Call Remote Channel:%s", VTY_NEWLINE);
507 lchan_dump_vty(vty, call->remote_lchan);
508 } else
509 vty_out(vty, "Call has no Remote Channel%s", VTY_NEWLINE);
510
511 if (call->called_subscr) {
512 vty_out(vty, "Called Subscriber:%s", VTY_NEWLINE);
513 subscr_dump_vty(vty, call->called_subscr);
514 } else
515 vty_out(vty, "Call has no Called Subscriber%s", VTY_NEWLINE);
516}
Harald Welte4bfdfe72009-06-10 23:11:52 +0800517#endif
Harald Welte68628e82009-03-10 12:17:57 +0000518
519DEFUN(show_lchan,
520 show_lchan_cmd,
521 "show lchan [bts_nr] [trx_nr] [ts_nr] [lchan_nr]",
522 SHOW_STR "Display information about a logical channel\n")
523{
524 struct gsm_network *net = gsmnet;
525 struct gsm_bts *bts;
526 struct gsm_bts_trx *trx;
527 struct gsm_bts_trx_ts *ts;
528 struct gsm_lchan *lchan;
529 int bts_nr, trx_nr, ts_nr, lchan_nr;
530
531 if (argc >= 1) {
532 /* use the BTS number that the user has specified */
533 bts_nr = atoi(argv[0]);
534 if (bts_nr >= net->num_bts) {
535 vty_out(vty, "%% can't find BTS %s%s", argv[0],
536 VTY_NEWLINE);
537 return CMD_WARNING;
538 }
Harald Weltee441d9c2009-06-21 16:17:15 +0200539 bts = gsm_bts_num(net, bts_nr);
Harald Welte68628e82009-03-10 12:17:57 +0000540 }
541 if (argc >= 2) {
542 trx_nr = atoi(argv[1]);
543 if (trx_nr >= bts->num_trx) {
544 vty_out(vty, "%% can't find TRX %s%s", argv[1],
545 VTY_NEWLINE);
546 return CMD_WARNING;
547 }
Harald Weltee441d9c2009-06-21 16:17:15 +0200548 trx = gsm_bts_trx_num(bts, trx_nr);
Harald Welte68628e82009-03-10 12:17:57 +0000549 }
550 if (argc >= 3) {
551 ts_nr = atoi(argv[2]);
552 if (ts_nr >= TRX_NR_TS) {
553 vty_out(vty, "%% can't find TS %s%s", argv[2],
554 VTY_NEWLINE);
555 return CMD_WARNING;
556 }
557 ts = &trx->ts[ts_nr];
558 }
559 if (argc >= 4) {
560 lchan_nr = atoi(argv[3]);
561 if (lchan_nr >= TS_MAX_LCHAN) {
562 vty_out(vty, "%% can't find LCHAN %s%s", argv[3],
563 VTY_NEWLINE);
564 return CMD_WARNING;
565 }
566 lchan = &ts->lchan[lchan_nr];
567 lchan_dump_vty(vty, lchan);
568 return CMD_SUCCESS;
569 }
570 for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) {
Harald Weltee441d9c2009-06-21 16:17:15 +0200571 bts = gsm_bts_num(net, bts_nr);
Harald Welte68628e82009-03-10 12:17:57 +0000572 for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) {
Harald Weltee441d9c2009-06-21 16:17:15 +0200573 trx = gsm_bts_trx_num(bts, trx_nr);
Harald Welte68628e82009-03-10 12:17:57 +0000574 for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) {
575 ts = &trx->ts[ts_nr];
576 for (lchan_nr = 0; lchan_nr < TS_MAX_LCHAN;
577 lchan_nr++) {
578 lchan = &ts->lchan[lchan_nr];
Harald Welteef235b52009-03-10 12:34:02 +0000579 if (lchan->type == GSM_LCHAN_NONE)
580 continue;
Harald Welte68628e82009-03-10 12:17:57 +0000581 lchan_dump_vty(vty, lchan);
582 }
583 }
584 }
585 }
586
587 return CMD_SUCCESS;
588}
589
Harald Welte1bc77352009-03-10 19:47:51 +0000590static void e1drv_dump_vty(struct vty *vty, struct e1inp_driver *drv)
591{
592 vty_out(vty, "E1 Input Driver %s%s", drv->name, VTY_NEWLINE);
593}
594
595DEFUN(show_e1drv,
596 show_e1drv_cmd,
597 "show e1_driver",
598 SHOW_STR "Display information about available E1 drivers\n")
599{
600 struct e1inp_driver *drv;
601
602 llist_for_each_entry(drv, &e1inp_driver_list, list)
603 e1drv_dump_vty(vty, drv);
604
605 return CMD_SUCCESS;
606}
607
Harald Welte68628e82009-03-10 12:17:57 +0000608static void e1line_dump_vty(struct vty *vty, struct e1inp_line *line)
609{
610 vty_out(vty, "E1 Line Number %u, Name %s, Driver %s%s",
611 line->num, line->name ? line->name : "",
612 line->driver->name, VTY_NEWLINE);
613}
614
615DEFUN(show_e1line,
616 show_e1line_cmd,
617 "show e1_line [line_nr]",
618 SHOW_STR "Display information about a E1 line\n")
619{
Harald Welte1bc77352009-03-10 19:47:51 +0000620 struct e1inp_line *line;
621
622 if (argc >= 1) {
623 int num = atoi(argv[0]);
624 llist_for_each_entry(line, &e1inp_line_list, list) {
625 if (line->num == num) {
626 e1line_dump_vty(vty, line);
627 return CMD_SUCCESS;
628 }
629 }
630 return CMD_WARNING;
631 }
632
633 llist_for_each_entry(line, &e1inp_line_list, list)
634 e1line_dump_vty(vty, line);
635
636 return CMD_SUCCESS;
Harald Welte68628e82009-03-10 12:17:57 +0000637}
638
639static void e1ts_dump_vty(struct vty *vty, struct e1inp_ts *ts)
640{
Harald Welte42581822009-08-08 16:12:58 +0200641 if (ts->type == E1INP_TS_TYPE_NONE)
642 return;
Harald Welte1bc77352009-03-10 19:47:51 +0000643 vty_out(vty, "E1 Timeslot %2u of Line %u is Type %s%s",
644 ts->num, ts->line->num, e1inp_tstype_name(ts->type),
645 VTY_NEWLINE);
Harald Welte68628e82009-03-10 12:17:57 +0000646}
647
648DEFUN(show_e1ts,
649 show_e1ts_cmd,
650 "show e1_timeslot [line_nr] [ts_nr]",
651 SHOW_STR "Display information about a E1 timeslot\n")
652{
Harald Welte986c3d72009-11-17 06:12:16 +0100653 struct e1inp_line *line = NULL;
Harald Welte1bc77352009-03-10 19:47:51 +0000654 struct e1inp_ts *ts;
655 int ts_nr;
Harald Welte68628e82009-03-10 12:17:57 +0000656
Harald Welte1bc77352009-03-10 19:47:51 +0000657 if (argc == 0) {
658 llist_for_each_entry(line, &e1inp_line_list, list) {
659 for (ts_nr = 0; ts_nr < NUM_E1_TS; ts_nr++) {
660 ts = &line->ts[ts_nr];
661 e1ts_dump_vty(vty, ts);
662 }
663 }
664 return CMD_SUCCESS;
665 }
666 if (argc >= 1) {
667 int num = atoi(argv[0]);
668 llist_for_each_entry(line, &e1inp_line_list, list) {
669 if (line->num == num)
670 break;
671 }
672 if (!line || line->num != num) {
673 vty_out(vty, "E1 line %s is invalid%s",
674 argv[0], VTY_NEWLINE);
675 return CMD_WARNING;
676 }
677 }
678 if (argc >= 2) {
679 ts_nr = atoi(argv[1]);
680 if (ts_nr > NUM_E1_TS) {
681 vty_out(vty, "E1 timeslot %s is invalid%s",
682 argv[1], VTY_NEWLINE);
683 return CMD_WARNING;
684 }
685 ts = &line->ts[ts_nr];
686 e1ts_dump_vty(vty, ts);
687 return CMD_SUCCESS;
688 } else {
689 for (ts_nr = 0; ts_nr < NUM_E1_TS; ts_nr++) {
690 ts = &line->ts[ts_nr];
691 e1ts_dump_vty(vty, ts);
692 }
693 return CMD_SUCCESS;
694 }
695 return CMD_SUCCESS;
Harald Welte68628e82009-03-10 12:17:57 +0000696}
697
Harald Weltebe4b7302009-05-23 16:59:33 +0000698static void paging_dump_vty(struct vty *vty, struct gsm_paging_request *pag)
Harald Weltef5025b62009-03-28 16:55:11 +0000699{
700 vty_out(vty, "Paging on BTS %u%s", pag->bts->nr, VTY_NEWLINE);
701 subscr_dump_vty(vty, pag->subscr);
702}
703
Harald Weltebe4b7302009-05-23 16:59:33 +0000704static void bts_paging_dump_vty(struct vty *vty, struct gsm_bts *bts)
Harald Weltef5025b62009-03-28 16:55:11 +0000705{
706 struct gsm_paging_request *pag;
707
708 llist_for_each_entry(pag, &bts->paging.pending_requests, entry)
709 paging_dump_vty(vty, pag);
710}
711
712DEFUN(show_paging,
713 show_paging_cmd,
714 "show paging [bts_nr]",
Harald Weltebe4b7302009-05-23 16:59:33 +0000715 SHOW_STR "Display information about paging reuqests of a BTS\n")
Harald Weltef5025b62009-03-28 16:55:11 +0000716{
717 struct gsm_network *net = gsmnet;
718 struct gsm_bts *bts;
719 int bts_nr;
720
721 if (argc >= 1) {
722 /* use the BTS number that the user has specified */
723 bts_nr = atoi(argv[0]);
724 if (bts_nr >= net->num_bts) {
725 vty_out(vty, "%% can't find BTS %s%s", argv[0],
726 VTY_NEWLINE);
727 return CMD_WARNING;
728 }
Harald Weltee441d9c2009-06-21 16:17:15 +0200729 bts = gsm_bts_num(net, bts_nr);
Harald Weltef5025b62009-03-28 16:55:11 +0000730 bts_paging_dump_vty(vty, bts);
731
732 return CMD_SUCCESS;
733 }
734 for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) {
Harald Weltee441d9c2009-06-21 16:17:15 +0200735 bts = gsm_bts_num(net, bts_nr);
Harald Weltef5025b62009-03-28 16:55:11 +0000736 bts_paging_dump_vty(vty, bts);
737 }
738
739 return CMD_SUCCESS;
740}
741
Harald Welte5013b2a2009-08-07 13:29:14 +0200742DEFUN(cfg_net,
743 cfg_net_cmd,
744 "network",
745 "Configure the GSM network")
746{
747 vty->index = gsmnet;
748 vty->node = GSMNET_NODE;
749
750 return CMD_SUCCESS;
751}
752
753
754DEFUN(cfg_net_ncc,
755 cfg_net_ncc_cmd,
756 "network country code <1-999>",
757 "Set the GSM network country code")
758{
759 gsmnet->country_code = atoi(argv[0]);
760
761 return CMD_SUCCESS;
762}
763
764DEFUN(cfg_net_mnc,
765 cfg_net_mnc_cmd,
766 "mobile network code <1-999>",
767 "Set the GSM mobile network code")
768{
769 gsmnet->network_code = atoi(argv[0]);
770
771 return CMD_SUCCESS;
772}
773
774DEFUN(cfg_net_name_short,
775 cfg_net_name_short_cmd,
776 "short name NAME",
777 "Set the short GSM network name")
778{
779 if (gsmnet->name_short)
780 talloc_free(gsmnet->name_short);
781
782 gsmnet->name_short = talloc_strdup(gsmnet, argv[0]);
783
784 return CMD_SUCCESS;
785}
786
787DEFUN(cfg_net_name_long,
788 cfg_net_name_long_cmd,
789 "long name NAME",
790 "Set the long GSM network name")
791{
792 if (gsmnet->name_long)
793 talloc_free(gsmnet->name_long);
794
795 gsmnet->name_long = talloc_strdup(gsmnet, argv[0]);
796
797 return CMD_SUCCESS;
798}
Harald Welte40f82892009-05-23 17:31:39 +0000799
Harald Welte (local)69de3972009-08-12 14:42:23 +0200800DEFUN(cfg_net_auth_policy,
801 cfg_net_auth_policy_cmd,
802 "auth policy (closed|accept-all|token)",
803 "Set the GSM network authentication policy\n")
804{
805 enum gsm_auth_policy policy = gsm_auth_policy_parse(argv[0]);
806
807 gsmnet->auth_policy = policy;
808
809 return CMD_SUCCESS;
810}
811
Harald Welte1085c092009-11-18 20:33:19 +0100812DEFUN(cfg_net_reject_cause,
813 cfg_net_reject_cause_cmd,
814 "location updating reject cause <2-111>",
815 "Set the reject cause of location updating reject\n")
816{
817 gsmnet->reject_cause = atoi(argv[0]);
818
819 return CMD_SUCCESS;
820}
821
Harald Welte4381cfe2009-08-30 15:47:06 +0900822DEFUN(cfg_net_encryption,
823 cfg_net_encryption_cmd,
824 "encryption a5 (0|1|2)",
825 "Enable or disable encryption (A5) for this network\n")
826{
Andreas.Eversberg1059deb2009-11-17 09:55:26 +0100827 gsmnet->a5_encryption= atoi(argv[0]);
Harald Welte4381cfe2009-08-30 15:47:06 +0900828
829 return CMD_SUCCESS;
830}
831
Holger Hans Peter Freytherf7d752f2009-11-16 17:12:38 +0100832DEFUN(cfg_net_neci,
833 cfg_net_neci_cmd,
834 "neci (0|1)",
835 "Set if NECI of cell selection is to be set")
836{
837 gsmnet->neci = atoi(argv[0]);
838 return CMD_SUCCESS;
839}
840
Holger Hans Peter Freytherc4d88ad2009-11-21 21:18:38 +0100841#define DECLARE_TIMER(number) \
842 DEFUN(cfg_net_T##number, \
843 cfg_net_T##number##_cmd, \
844 "timer t" #number " <0-65535>", \
845 "Set the T" #number " value.") \
846{ \
847 int value = atoi(argv[0]); \
848 \
849 if (value < 0 || value > 65535) { \
850 vty_out(vty, "Timer value %s out of range.%s", \
851 argv[0], VTY_NEWLINE); \
852 return CMD_WARNING; \
853 } \
854 \
855 gsmnet->T##number = value; \
856 return CMD_SUCCESS; \
857}
858
859DECLARE_TIMER(3101)
Holger Hans Peter Freyther23975e72009-11-21 21:42:26 +0100860DECLARE_TIMER(3103)
861DECLARE_TIMER(3105)
862DECLARE_TIMER(3107)
863DECLARE_TIMER(3109)
864DECLARE_TIMER(3111)
865DECLARE_TIMER(3113)
866DECLARE_TIMER(3115)
867DECLARE_TIMER(3117)
868DECLARE_TIMER(3119)
869DECLARE_TIMER(3141)
Holger Hans Peter Freytherc4d88ad2009-11-21 21:18:38 +0100870
871
Harald Welte5258fc42009-03-28 19:07:53 +0000872/* per-BTS configuration */
873DEFUN(cfg_bts,
874 cfg_bts_cmd,
875 "bts BTS_NR",
876 "Select a BTS to configure\n")
877{
878 int bts_nr = atoi(argv[0]);
879 struct gsm_bts *bts;
880
Harald Weltee441d9c2009-06-21 16:17:15 +0200881 if (bts_nr > gsmnet->num_bts) {
882 vty_out(vty, "%% The next unused BTS number is %u%s",
883 gsmnet->num_bts, VTY_NEWLINE);
Harald Welte5258fc42009-03-28 19:07:53 +0000884 return CMD_WARNING;
Harald Weltee441d9c2009-06-21 16:17:15 +0200885 } else if (bts_nr == gsmnet->num_bts) {
886 /* allocate a new one */
887 bts = gsm_bts_alloc(gsmnet, GSM_BTS_TYPE_UNKNOWN,
888 HARDCODED_TSC, HARDCODED_BSIC);
889 } else
890 bts = gsm_bts_num(gsmnet, bts_nr);
891
892 if (!bts)
893 return CMD_WARNING;
Harald Welte5258fc42009-03-28 19:07:53 +0000894
895 vty->index = bts;
896 vty->node = BTS_NODE;
897
898 return CMD_SUCCESS;
899}
900
901DEFUN(cfg_bts_type,
902 cfg_bts_type_cmd,
903 "type TYPE",
904 "Set the BTS type\n")
905{
906 struct gsm_bts *bts = vty->index;
907
Harald Weltea6fd58e2009-08-07 00:25:23 +0200908 bts->type = parse_btstype(argv[0]);
909
Harald Welte8175e952009-10-20 00:22:00 +0200910 if (is_ipaccess_bts(bts)) {
911 /* Set the default OML Stream ID to 0xff */
912 bts->oml_tei = 0xff;
913 }
914
Harald Welte5258fc42009-03-28 19:07:53 +0000915 return CMD_SUCCESS;
916}
917
Harald Weltefcd24452009-06-20 18:15:19 +0200918DEFUN(cfg_bts_band,
919 cfg_bts_band_cmd,
920 "band BAND",
921 "Set the frequency band of this BTS\n")
922{
923 struct gsm_bts *bts = vty->index;
Harald Welte42581822009-08-08 16:12:58 +0200924 int band = gsm_band_parse(argv[0]);
Harald Weltefcd24452009-06-20 18:15:19 +0200925
926 if (band < 0) {
927 vty_out(vty, "%% BAND %d is not a valid GSM band%s",
928 band, VTY_NEWLINE);
929 return CMD_WARNING;
930 }
931
932 bts->band = band;
933
934 return CMD_SUCCESS;
935}
936
Holger Hans Peter Freytherc4a49e32009-08-21 14:44:12 +0200937DEFUN(cfg_bts_ci,
938 cfg_bts_ci_cmd,
939 "cell_identity <0-65535>",
940 "Set the Cell identity of this BTS\n")
941{
942 struct gsm_bts *bts = vty->index;
943 int ci = atoi(argv[0]);
944
945 if (ci < 0 || ci > 0xffff) {
946 vty_out(vty, "%% CI %d is not in the valid range (0-65535)%s",
947 ci, VTY_NEWLINE);
948 return CMD_WARNING;
949 }
950 bts->cell_identity = ci;
951
952 return CMD_SUCCESS;
953}
954
Harald Welte5258fc42009-03-28 19:07:53 +0000955DEFUN(cfg_bts_lac,
956 cfg_bts_lac_cmd,
Holger Hans Peter Freyther0b7f4b32009-09-29 14:02:33 +0200957 "location_area_code <0-65535>",
Harald Welte5258fc42009-03-28 19:07:53 +0000958 "Set the Location Area Code (LAC) of this BTS\n")
959{
960 struct gsm_bts *bts = vty->index;
961 int lac = atoi(argv[0]);
962
Holger Hans Peter Freyther0b7f4b32009-09-29 14:02:33 +0200963 if (lac < 0 || lac > 0xffff) {
964 vty_out(vty, "%% LAC %d is not in the valid range (0-65535)%s",
Harald Welte5258fc42009-03-28 19:07:53 +0000965 lac, VTY_NEWLINE);
966 return CMD_WARNING;
967 }
Holger Hans Peter Freythere48b9562009-10-01 04:07:15 +0200968
969 if (lac == GSM_LAC_RESERVED_DETACHED || lac == GSM_LAC_RESERVED_ALL_BTS) {
970 vty_out(vty, "%% LAC %d is reserved by GSM 04.08%s",
971 lac, VTY_NEWLINE);
972 return CMD_WARNING;
973 }
974
Harald Welte5258fc42009-03-28 19:07:53 +0000975 bts->location_area_code = lac;
976
977 return CMD_SUCCESS;
978}
979
Harald Weltea43f7892009-12-01 18:04:30 +0530980
Harald Welte5258fc42009-03-28 19:07:53 +0000981DEFUN(cfg_bts_tsc,
982 cfg_bts_tsc_cmd,
983 "training_sequence_code <0-255>",
984 "Set the Training Sequence Code (TSC) of this BTS\n")
985{
986 struct gsm_bts *bts = vty->index;
987 int tsc = atoi(argv[0]);
988
989 if (tsc < 0 || tsc > 0xff) {
990 vty_out(vty, "%% TSC %d is not in the valid range (0-255)%s",
991 tsc, VTY_NEWLINE);
992 return CMD_WARNING;
993 }
994 bts->tsc = tsc;
995
996 return CMD_SUCCESS;
997}
998
Harald Welte78f2f502009-05-23 16:56:52 +0000999DEFUN(cfg_bts_bsic,
1000 cfg_bts_bsic_cmd,
1001 "base_station_id_code <0-63>",
1002 "Set the Base Station Identity Code (BSIC) of this BTS\n")
1003{
1004 struct gsm_bts *bts = vty->index;
1005 int bsic = atoi(argv[0]);
1006
1007 if (bsic < 0 || bsic > 0x3f) {
Harald Welte42581822009-08-08 16:12:58 +02001008 vty_out(vty, "%% BSIC %d is not in the valid range (0-255)%s",
Harald Welte78f2f502009-05-23 16:56:52 +00001009 bsic, VTY_NEWLINE);
1010 return CMD_WARNING;
1011 }
1012 bts->bsic = bsic;
1013
1014 return CMD_SUCCESS;
1015}
1016
1017
Harald Welte4cc34222009-05-01 15:12:31 +00001018DEFUN(cfg_bts_unit_id,
1019 cfg_bts_unit_id_cmd,
Harald Welte07dc73d2009-08-07 13:27:09 +02001020 "ip.access unit_id <0-65534> <0-255>",
1021 "Set the ip.access BTS Unit ID of this BTS\n")
Harald Welte4cc34222009-05-01 15:12:31 +00001022{
1023 struct gsm_bts *bts = vty->index;
1024 int site_id = atoi(argv[0]);
1025 int bts_id = atoi(argv[1]);
1026
Harald Welte07dc73d2009-08-07 13:27:09 +02001027 if (!is_ipaccess_bts(bts)) {
1028 vty_out(vty, "%% BTS is not of ip.access type%s", VTY_NEWLINE);
1029 return CMD_WARNING;
1030 }
1031
Harald Welte4cc34222009-05-01 15:12:31 +00001032 bts->ip_access.site_id = site_id;
1033 bts->ip_access.bts_id = bts_id;
1034
1035 return CMD_SUCCESS;
1036}
1037
Harald Welte8175e952009-10-20 00:22:00 +02001038DEFUN(cfg_bts_stream_id,
1039 cfg_bts_stream_id_cmd,
1040 "oml ip.access stream_id <0-255>",
1041 "Set the ip.access Stream ID of the OML link of this BTS\n")
1042{
1043 struct gsm_bts *bts = vty->index;
1044 int stream_id = atoi(argv[0]);
1045
1046 if (!is_ipaccess_bts(bts)) {
1047 vty_out(vty, "%% BTS is not of ip.access type%s", VTY_NEWLINE);
1048 return CMD_WARNING;
1049 }
1050
1051 bts->oml_tei = stream_id;
1052
1053 return CMD_SUCCESS;
1054}
1055
1056
Harald Welte42581822009-08-08 16:12:58 +02001057DEFUN(cfg_bts_oml_e1,
1058 cfg_bts_oml_e1_cmd,
1059 "oml e1 line E1_LINE timeslot <1-31> sub-slot (0|1|2|3|full)",
1060 "E1 interface to be used for OML\n")
1061{
1062 struct gsm_bts *bts = vty->index;
1063
1064 parse_e1_link(&bts->oml_e1_link, argv[0], argv[1], argv[2]);
1065
1066 return CMD_SUCCESS;
1067}
1068
1069
1070DEFUN(cfg_bts_oml_e1_tei,
1071 cfg_bts_oml_e1_tei_cmd,
1072 "oml e1 tei <0-63>",
1073 "Set the TEI to be used for OML")
1074{
1075 struct gsm_bts *bts = vty->index;
1076
1077 bts->oml_tei = atoi(argv[0]);
1078
1079 return CMD_SUCCESS;
1080}
1081
Harald Welte7a8fa412009-08-10 13:48:16 +02001082DEFUN(cfg_bts_challoc, cfg_bts_challoc_cmd,
1083 "channel allocator (ascending|descending)",
1084 "Should the channel allocator allocate in reverse TRX order?")
1085{
1086 struct gsm_bts *bts = vty->index;
1087
1088 if (!strcmp(argv[0], "ascending"))
1089 bts->chan_alloc_reverse = 0;
1090 else
1091 bts->chan_alloc_reverse = 1;
1092
1093 return CMD_SUCCESS;
1094}
1095
Harald Welte (local)5dececf2009-08-12 13:28:23 +02001096DEFUN(cfg_bts_cell_barred, cfg_bts_cell_barred_cmd,
1097 "cell barred (0|1)",
1098 "Should this cell be barred from access?")
1099{
1100 struct gsm_bts *bts = vty->index;
1101
1102 bts->cell_barred = atoi(argv[0]);
1103
1104 return CMD_SUCCESS;
1105}
1106
Harald Welte (local)0e451d02009-08-13 10:14:26 +02001107DEFUN(cfg_bts_ms_max_power, cfg_bts_ms_max_power_cmd,
1108 "ms max power <0-40>",
1109 "Maximum transmit power of the MS")
1110{
1111 struct gsm_bts *bts = vty->index;
1112
1113 bts->ms_max_power = atoi(argv[0]);
1114
1115 return CMD_SUCCESS;
1116}
1117
Harald Welte73225282009-12-12 18:17:25 +01001118DEFUN(cfg_bts_cell_resel_hyst, cfg_bts_cell_resel_hyst_cmd,
1119 "cell reselection hysteresis <0-14>",
1120 "Cell Re-Selection Hysteresis in dB")
1121{
1122 struct gsm_bts *bts = vty->index;
1123
1124 bts->si_common.cell_sel_par.cell_resel_hyst = atoi(argv[0])/2;
1125
1126 return CMD_SUCCESS;
1127}
1128
1129DEFUN(cfg_bts_rxlev_acc_min, cfg_bts_rxlev_acc_min_cmd,
1130 "rxlev access min <0-63>",
1131 "Minimum RxLev needed for cell access (better than -110dBm)")
1132{
1133 struct gsm_bts *bts = vty->index;
1134
1135 bts->si_common.cell_sel_par.rxlev_acc_min = atoi(argv[0]);
1136
1137 return CMD_SUCCESS;
1138}
1139
Harald Welte (local)efc92312009-08-14 23:09:25 +02001140DEFUN(cfg_bts_per_loc_upd, cfg_bts_per_loc_upd_cmd,
1141 "periodic location update <0-1530>",
1142 "Periodic Location Updating Interval in Minutes")
1143{
1144 struct gsm_bts *bts = vty->index;
1145
Harald Weltea43f7892009-12-01 18:04:30 +05301146 bts->si_common.chan_desc.t3212 = atoi(argv[0]) / 10;
Harald Welte (local)efc92312009-08-14 23:09:25 +02001147
1148 return CMD_SUCCESS;
1149}
1150
Harald Welte7a8fa412009-08-10 13:48:16 +02001151
Harald Welte5258fc42009-03-28 19:07:53 +00001152/* per TRX configuration */
1153DEFUN(cfg_trx,
1154 cfg_trx_cmd,
1155 "trx TRX_NR",
1156 "Select a TRX to configure")
1157{
1158 int trx_nr = atoi(argv[0]);
1159 struct gsm_bts *bts = vty->index;
1160 struct gsm_bts_trx *trx;
1161
Harald Weltee441d9c2009-06-21 16:17:15 +02001162 if (trx_nr > bts->num_trx) {
1163 vty_out(vty, "%% The next unused TRX number in this BTS is %u%s",
1164 bts->num_trx, VTY_NEWLINE);
Harald Welte5258fc42009-03-28 19:07:53 +00001165 return CMD_WARNING;
Harald Weltee441d9c2009-06-21 16:17:15 +02001166 } else if (trx_nr == bts->num_trx) {
1167 /* we need to allocate a new one */
1168 trx = gsm_bts_trx_alloc(bts);
1169 } else
1170 trx = gsm_bts_trx_num(bts, trx_nr);
1171
1172 if (!trx)
1173 return CMD_WARNING;
Harald Welte5258fc42009-03-28 19:07:53 +00001174
1175 vty->index = trx;
1176 vty->node = TRX_NODE;
1177
1178 return CMD_SUCCESS;
1179}
1180
1181DEFUN(cfg_trx_arfcn,
1182 cfg_trx_arfcn_cmd,
1183 "arfcn <1-1024>",
1184 "Set the ARFCN for this TRX\n")
1185{
1186 int arfcn = atoi(argv[0]);
1187 struct gsm_bts_trx *trx = vty->index;
1188
1189 /* FIXME: check if this ARFCN is supported by this TRX */
1190
1191 trx->arfcn = arfcn;
1192
1193 /* FIXME: patch ARFCN into SYSTEM INFORMATION */
1194 /* FIXME: use OML layer to update the ARFCN */
1195 /* FIXME: use RSL layer to update SYSTEM INFORMATION */
1196
1197 return CMD_SUCCESS;
1198}
1199
Harald Weltefcd24452009-06-20 18:15:19 +02001200DEFUN(cfg_trx_max_power_red,
1201 cfg_trx_max_power_red_cmd,
1202 "max_power_red <0-100>",
1203 "Reduction of maximum BS RF Power in dB\n")
1204{
1205 int maxpwr_r = atoi(argv[0]);
1206 struct gsm_bts_trx *trx = vty->index;
Harald Welte61a83b22009-11-18 09:20:22 +01001207 int upper_limit = 24; /* default 12.21 max power red. */
Harald Weltefcd24452009-06-20 18:15:19 +02001208
1209 /* FIXME: check if our BTS type supports more than 12 */
1210 if (maxpwr_r < 0 || maxpwr_r > upper_limit) {
1211 vty_out(vty, "%% Power %d dB is not in the valid range%s",
1212 maxpwr_r, VTY_NEWLINE);
1213 return CMD_WARNING;
1214 }
1215 if (maxpwr_r & 1) {
1216 vty_out(vty, "%% Power %d dB is not an even value%s",
1217 maxpwr_r, VTY_NEWLINE);
1218 return CMD_WARNING;
1219 }
1220
1221 trx->max_power_red = maxpwr_r;
1222
1223 /* FIXME: make sure we update this using OML */
1224
1225 return CMD_SUCCESS;
1226}
1227
Harald Welte42581822009-08-08 16:12:58 +02001228DEFUN(cfg_trx_rsl_e1,
1229 cfg_trx_rsl_e1_cmd,
1230 "rsl e1 line E1_LINE timeslot <1-31> sub-slot (0|1|2|3|full)",
1231 "E1 interface to be used for RSL\n")
1232{
1233 struct gsm_bts_trx *trx = vty->index;
1234
1235 parse_e1_link(&trx->rsl_e1_link, argv[0], argv[1], argv[2]);
1236
1237 return CMD_SUCCESS;
1238}
1239
1240DEFUN(cfg_trx_rsl_e1_tei,
1241 cfg_trx_rsl_e1_tei_cmd,
1242 "rsl e1 tei <0-63>",
1243 "Set the TEI to be used for RSL")
1244{
1245 struct gsm_bts_trx *trx = vty->index;
1246
1247 trx->rsl_tei = atoi(argv[0]);
1248
1249 return CMD_SUCCESS;
1250}
1251
Holger Hans Peter Freyther2d501ea2009-11-11 11:54:24 +01001252DEFUN(cfg_trx_rf_locked,
1253 cfg_trx_rf_locked_cmd,
1254 "rf_locked (0|1)",
1255 "Turn off RF of the TRX.\n")
1256{
1257 int locked = atoi(argv[0]);
1258 struct gsm_bts_trx *trx = vty->index;
1259
1260 gsm_trx_lock_rf(trx, locked);
1261 return CMD_SUCCESS;
1262}
Harald Welte42581822009-08-08 16:12:58 +02001263
Harald Welte5258fc42009-03-28 19:07:53 +00001264/* per TS configuration */
1265DEFUN(cfg_ts,
1266 cfg_ts_cmd,
Harald Welte42581822009-08-08 16:12:58 +02001267 "timeslot <0-7>",
Harald Welte5258fc42009-03-28 19:07:53 +00001268 "Select a Timeslot to configure")
1269{
1270 int ts_nr = atoi(argv[0]);
1271 struct gsm_bts_trx *trx = vty->index;
1272 struct gsm_bts_trx_ts *ts;
1273
1274 if (ts_nr >= TRX_NR_TS) {
1275 vty_out(vty, "%% A GSM TRX only has %u Timeslots per TRX%s",
1276 TRX_NR_TS, VTY_NEWLINE);
1277 return CMD_WARNING;
1278 }
1279
1280 ts = &trx->ts[ts_nr];
1281
1282 vty->index = ts;
1283 vty->node = TS_NODE;
1284
1285 return CMD_SUCCESS;
1286}
1287
Harald Weltea6fd58e2009-08-07 00:25:23 +02001288DEFUN(cfg_ts_pchan,
1289 cfg_ts_pchan_cmd,
1290 "phys_chan_config PCHAN",
1291 "Physical Channel configuration (TCH/SDCCH/...)")
1292{
1293 struct gsm_bts_trx_ts *ts = vty->index;
1294 int pchanc;
1295
1296 pchanc = gsm_pchan_parse(argv[0]);
1297 if (pchanc < 0)
1298 return CMD_WARNING;
1299
1300 ts->pchan = pchanc;
1301
1302 return CMD_SUCCESS;
1303}
1304
1305DEFUN(cfg_ts_e1_subslot,
1306 cfg_ts_e1_subslot_cmd,
Harald Welte42581822009-08-08 16:12:58 +02001307 "e1 line E1_LINE timeslot <1-31> sub-slot (0|1|2|3|full)",
Harald Weltea6fd58e2009-08-07 00:25:23 +02001308 "E1 sub-slot connected to this on-air timeslot")
1309{
1310 struct gsm_bts_trx_ts *ts = vty->index;
1311
Harald Welte42581822009-08-08 16:12:58 +02001312 parse_e1_link(&ts->e1_link, argv[0], argv[1], argv[2]);
Harald Weltea6fd58e2009-08-07 00:25:23 +02001313
1314 return CMD_SUCCESS;
1315}
Harald Welte5258fc42009-03-28 19:07:53 +00001316
Harald Welte68628e82009-03-10 12:17:57 +00001317int bsc_vty_init(struct gsm_network *net)
1318{
1319 gsmnet = net;
1320
1321 cmd_init(1);
1322 vty_init();
1323
1324 install_element(VIEW_NODE, &show_net_cmd);
1325 install_element(VIEW_NODE, &show_bts_cmd);
1326 install_element(VIEW_NODE, &show_trx_cmd);
1327 install_element(VIEW_NODE, &show_ts_cmd);
1328 install_element(VIEW_NODE, &show_lchan_cmd);
Harald Welte1bc77352009-03-10 19:47:51 +00001329
1330 install_element(VIEW_NODE, &show_e1drv_cmd);
Harald Welte68628e82009-03-10 12:17:57 +00001331 install_element(VIEW_NODE, &show_e1line_cmd);
1332 install_element(VIEW_NODE, &show_e1ts_cmd);
1333
Harald Weltef5025b62009-03-28 16:55:11 +00001334 install_element(VIEW_NODE, &show_paging_cmd);
Harald Welte5258fc42009-03-28 19:07:53 +00001335
Harald Welte5013b2a2009-08-07 13:29:14 +02001336 install_element(CONFIG_NODE, &cfg_net_cmd);
1337 install_node(&net_node, config_write_net);
1338 install_default(GSMNET_NODE);
Harald Welte42581822009-08-08 16:12:58 +02001339 install_element(GSMNET_NODE, &cfg_net_ncc_cmd);
Harald Welte5013b2a2009-08-07 13:29:14 +02001340 install_element(GSMNET_NODE, &cfg_net_mnc_cmd);
1341 install_element(GSMNET_NODE, &cfg_net_name_short_cmd);
1342 install_element(GSMNET_NODE, &cfg_net_name_long_cmd);
Harald Welte (local)69de3972009-08-12 14:42:23 +02001343 install_element(GSMNET_NODE, &cfg_net_auth_policy_cmd);
Harald Welte1085c092009-11-18 20:33:19 +01001344 install_element(GSMNET_NODE, &cfg_net_reject_cause_cmd);
Harald Welte4381cfe2009-08-30 15:47:06 +09001345 install_element(GSMNET_NODE, &cfg_net_encryption_cmd);
Holger Hans Peter Freytherf7d752f2009-11-16 17:12:38 +01001346 install_element(GSMNET_NODE, &cfg_net_neci_cmd);
Holger Hans Peter Freytherc4d88ad2009-11-21 21:18:38 +01001347 install_element(GSMNET_NODE, &cfg_net_T3101_cmd);
Holger Hans Peter Freyther23975e72009-11-21 21:42:26 +01001348 install_element(GSMNET_NODE, &cfg_net_T3103_cmd);
1349 install_element(GSMNET_NODE, &cfg_net_T3105_cmd);
1350 install_element(GSMNET_NODE, &cfg_net_T3107_cmd);
1351 install_element(GSMNET_NODE, &cfg_net_T3109_cmd);
1352 install_element(GSMNET_NODE, &cfg_net_T3111_cmd);
1353 install_element(GSMNET_NODE, &cfg_net_T3113_cmd);
1354 install_element(GSMNET_NODE, &cfg_net_T3115_cmd);
1355 install_element(GSMNET_NODE, &cfg_net_T3117_cmd);
1356 install_element(GSMNET_NODE, &cfg_net_T3119_cmd);
1357 install_element(GSMNET_NODE, &cfg_net_T3141_cmd);
Harald Welte5013b2a2009-08-07 13:29:14 +02001358
1359 install_element(GSMNET_NODE, &cfg_bts_cmd);
Harald Welte67ce0732009-08-06 19:06:46 +02001360 install_node(&bts_node, config_write_bts);
Harald Welte68628e82009-03-10 12:17:57 +00001361 install_default(BTS_NODE);
Harald Welte5258fc42009-03-28 19:07:53 +00001362 install_element(BTS_NODE, &cfg_bts_type_cmd);
Harald Weltefcd24452009-06-20 18:15:19 +02001363 install_element(BTS_NODE, &cfg_bts_band_cmd);
Holger Hans Peter Freytherc4a49e32009-08-21 14:44:12 +02001364 install_element(BTS_NODE, &cfg_bts_ci_cmd);
Harald Welte5258fc42009-03-28 19:07:53 +00001365 install_element(BTS_NODE, &cfg_bts_lac_cmd);
1366 install_element(BTS_NODE, &cfg_bts_tsc_cmd);
Harald Welte42581822009-08-08 16:12:58 +02001367 install_element(BTS_NODE, &cfg_bts_bsic_cmd);
Harald Welte4cc34222009-05-01 15:12:31 +00001368 install_element(BTS_NODE, &cfg_bts_unit_id_cmd);
Harald Welte8175e952009-10-20 00:22:00 +02001369 install_element(BTS_NODE, &cfg_bts_stream_id_cmd);
Harald Welte42581822009-08-08 16:12:58 +02001370 install_element(BTS_NODE, &cfg_bts_oml_e1_cmd);
1371 install_element(BTS_NODE, &cfg_bts_oml_e1_tei_cmd);
Harald Welte7a8fa412009-08-10 13:48:16 +02001372 install_element(BTS_NODE, &cfg_bts_challoc_cmd);
Harald Welte (local)5dececf2009-08-12 13:28:23 +02001373 install_element(BTS_NODE, &cfg_bts_cell_barred_cmd);
Harald Welte (local)0e451d02009-08-13 10:14:26 +02001374 install_element(BTS_NODE, &cfg_bts_ms_max_power_cmd);
Harald Welte (local)efc92312009-08-14 23:09:25 +02001375 install_element(BTS_NODE, &cfg_bts_per_loc_upd_cmd);
Harald Welte73225282009-12-12 18:17:25 +01001376 install_element(BTS_NODE, &cfg_bts_cell_resel_hyst_cmd);
1377 install_element(BTS_NODE, &cfg_bts_rxlev_acc_min_cmd);
Harald Welte7a8fa412009-08-10 13:48:16 +02001378
Harald Welte68628e82009-03-10 12:17:57 +00001379
Harald Welte5258fc42009-03-28 19:07:53 +00001380 install_element(BTS_NODE, &cfg_trx_cmd);
Harald Welte68628e82009-03-10 12:17:57 +00001381 install_node(&trx_node, dummy_config_write);
Harald Welte68628e82009-03-10 12:17:57 +00001382 install_default(TRX_NODE);
Harald Welte5258fc42009-03-28 19:07:53 +00001383 install_element(TRX_NODE, &cfg_trx_arfcn_cmd);
Harald Welte879dc972009-06-20 22:36:12 +02001384 install_element(TRX_NODE, &cfg_trx_max_power_red_cmd);
Harald Welte42581822009-08-08 16:12:58 +02001385 install_element(TRX_NODE, &cfg_trx_rsl_e1_cmd);
1386 install_element(TRX_NODE, &cfg_trx_rsl_e1_tei_cmd);
Holger Hans Peter Freyther2d501ea2009-11-11 11:54:24 +01001387 install_element(TRX_NODE, &cfg_trx_rf_locked_cmd);
Harald Welte68628e82009-03-10 12:17:57 +00001388
Harald Welte5258fc42009-03-28 19:07:53 +00001389 install_element(TRX_NODE, &cfg_ts_cmd);
Harald Welte68628e82009-03-10 12:17:57 +00001390 install_node(&ts_node, dummy_config_write);
Harald Welte68628e82009-03-10 12:17:57 +00001391 install_default(TS_NODE);
Harald Weltea6fd58e2009-08-07 00:25:23 +02001392 install_element(TS_NODE, &cfg_ts_pchan_cmd);
1393 install_element(TS_NODE, &cfg_ts_e1_subslot_cmd);
Harald Welte68628e82009-03-10 12:17:57 +00001394
Holger Hans Peter Freythercfa90d42009-08-10 10:17:50 +02001395 bsc_vty_init_extra(net);
Harald Welte40f82892009-05-23 17:31:39 +00001396
Harald Welte68628e82009-03-10 12:17:57 +00001397 return 0;
1398}