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>2011-08-25 23:22:01 +0200
commit7c13f4b975c9dd5bffd857f6acd2a0201574f3df (patch)
treedf224c66ba1386271519c1843c32291fd76d1f61
parent158a38221279757b9a84e15db298ec1a630aab30 (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 e7f76beb6..3cc6598e4 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
@@ -320,11 +320,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;
@@ -332,24 +330,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;
}