summaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc
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>2013-01-15 11:27:28 +0100
commit25eca0bfdccf56ce5e25d9c9c8f05f16f1984086 (patch)
tree3e1389adf731dcc03552a8248c863af62dafab25 /openbsc/src/osmo-bsc
parent23446844a8884dace5982e86e5c1e5562b9e4049 (diff)
bsc: Simplify the trap sending by using the location state method
Diffstat (limited to 'openbsc/src/osmo-bsc')
-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 96e727e58..40658c11b 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
@@ -424,11 +424,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;
@@ -436,24 +434,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;
}