aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorDaniel Willmann <daniel@totalueberwachung.de>2011-08-19 19:32:09 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-09-11 16:20:45 +0200
commit11620111f452c2c30cf9957b733ea0320c64ed4d (patch)
treed75eacb3c13cb1f8a20587b0ccad37bad775ba5e /openbsc
parentd08ad7d6d9d46fdd1d4565ff4b42201f976dd334 (diff)
osmo-bsc: Prepare to send more than just the location in the TRAP
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_ctrl.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
index 9782126a7..a241f7e70 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c
@@ -53,6 +53,29 @@ void osmo_bsc_send_trap(struct ctrl_cmd *cmd, struct bsc_msc_connection *msc_con
talloc_free(trap);
}
+static int get_bts_loc(struct ctrl_cmd *cmd, void *data);
+
+static void generate_location_state_trap(struct gsm_bts *bts, struct bsc_msc_connection *msc_con)
+{
+ struct ctrl_cmd *cmd;
+
+ cmd = ctrl_cmd_create(msc_con, CTRL_TYPE_TRAP);
+ if (!cmd) {
+ LOGP(DCTRL, LOGL_ERROR, "Failed to create TRAP command.\n");
+ return;
+ }
+
+ cmd->id = "0";
+ cmd->variable = talloc_asprintf(cmd, "net.bts.%i.location-state", bts->nr);
+
+ /* Prepare the location reply */
+ cmd->node = bts;
+ get_bts_loc(cmd, NULL);
+
+ osmo_bsc_send_trap(cmd, msc_con);
+ talloc_free(cmd);
+}
+
static const struct value_string valid_names[] = {
{ BTS_LOC_FIX_INVALID, "invalid" },
{ BTS_LOC_FIX_2D, "fix2d" },
@@ -169,7 +192,7 @@ static int set_bts_loc(struct ctrl_cmd *cmd, void *data)
if (!location_equal(curloc, lastloc))
llist_for_each_entry(msc, &gsmnet->bsc_data->mscs, entry)
- osmo_bsc_send_trap(cmd, msc->msc_con);
+ generate_location_state_trap(bts, msc->msc_con);
cleanup_locations(&bts->loc_list);