aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-02-14 16:15:21 +0100
committerHarald Welte <laforge@gnumonks.org>2011-02-14 16:15:21 +0100
commitface7edc6223c2ee3e85daa3b3ea459f6278b394 (patch)
treed2e1aff62aebffdf2c864a4ed33764062b028f40 /openbsc
parenta0fe72de6f7d4c6cd7b6508b7e819e94f8c29989 (diff)
VTY: Allow for per-BTS-model specific config file write functions
This way a BTS module can append config data to the TS, TRX and BTS sections.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/gsm_data.h6
-rw-r--r--openbsc/src/bsc_vty.c9
2 files changed, 15 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index a9f9e5e6..f40bcbdd 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -426,6 +426,8 @@ enum gsm_bts_type {
GSM_BTS_TYPE_RBS2000,
};
+struct vty;
+
struct gsm_bts_model {
struct llist_head list;
@@ -434,6 +436,10 @@ struct gsm_bts_model {
int (*oml_rcvmsg)(struct msgb *msg);
+ void (*config_write_bts)(struct vty *vty, struct gsm_bts *bts);
+ void (*config_write_trx)(struct vty *vty, struct gsm_bts_trx *trx);
+ void (*config_write_ts)(struct vty *vty, struct gsm_bts_trx_ts *ts);
+
struct tlv_definition nm_att_tlvdef;
struct bitvec features;
diff --git a/openbsc/src/bsc_vty.c b/openbsc/src/bsc_vty.c
index 3d7d69b8..55eeb141 100644
--- a/openbsc/src/bsc_vty.c
+++ b/openbsc/src/bsc_vty.c
@@ -333,6 +333,9 @@ static void config_write_ts_single(struct vty *vty, struct gsm_bts_trx_ts *ts)
}
}
config_write_e1_link(vty, &ts->e1_link, " ");
+
+ if (ts->trx->bts->model->config_write_ts)
+ ts->trx->bts->model->config_write_ts(vty, ts);
}
static void config_write_trx_single(struct vty *vty, struct gsm_bts_trx *trx)
@@ -352,6 +355,9 @@ static void config_write_trx_single(struct vty *vty, struct gsm_bts_trx *trx)
config_write_e1_link(vty, &trx->rsl_e1_link, " rsl ");
vty_out(vty, " rsl e1 tei %u%s", trx->rsl_tei, VTY_NEWLINE);
+ if (trx->bts->model->config_write_trx)
+ trx->bts->model->config_write_trx(vty, trx);
+
for (i = 0; i < TRX_NR_TS; i++)
config_write_ts_single(vty, &trx->ts[i]);
}
@@ -500,6 +506,9 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
config_write_bts_gprs(vty, bts);
+ if (bts->model->config_write_bts)
+ bts->model->config_write_bts(vty, bts);
+
llist_for_each_entry(trx, &bts->trx_list, list)
config_write_trx_single(vty, trx);
}