summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-08-22 23:29:00 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-05-02 20:13:41 +0200
commitae4e7964dba692695d21da404029b48b99619d74 (patch)
treee9d68f87e4091ef878c728fe3210af1098952f68
parent3e6eb68e44fb61e0013d805412550cb0b5a4b275 (diff)
bsc: Simplify the trap sending by using the location state method
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_ctrl.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
index 2815a3bf0..9ada9b508 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
@@ -426,11 +426,9 @@ static int verify_net_rf_lock(struct ctrl_cmd *cmd, const char *value, void *dat
static int msc_signal_handler(unsigned int subsys, unsigned int signal,
void *handler_data, void *signal_data)
{
- struct ctrl_cmd *cmd;
struct msc_signal_data *msc;
struct gsm_network *net;
struct gsm_bts *bts;
- char *loc_fmt = "net.bts.%i.location";
if (subsys != SS_MSC)
return 0;
@@ -438,24 +436,11 @@ static int msc_signal_handler(unsigned int subsys, unsigned int signal,
return 0;
msc = signal_data;
- cmd = ctrl_cmd_create(msc->data, CTRL_TYPE_TRAP);
- if (!cmd) {
- LOGP(DCTRL, LOGL_ERROR, "Failed to create TRAP for location.\n");
- return 0;
- }
-
- cmd->id = "0";
net = msc->data->network;
- llist_for_each_entry(bts, &net->bts_list, list) {
- cmd->node = bts;
- cmd->variable = talloc_asprintf(cmd, loc_fmt, bts->nr);
- get_bts_loc(cmd, NULL);
- osmo_bsc_send_trap(cmd, msc->data->msc_con);
- talloc_free(cmd->variable);
- }
+ llist_for_each_entry(bts, &net->bts_list, list)
+ generate_location_state_trap(bts, msc->data->msc_con);
- talloc_free(cmd);
return 0;
}