diff options
author | Daniel Willmann <daniel@totalueberwachung.de> | 2011-08-19 19:32:09 +0200 |
---|---|---|
committer | Daniel Willmann <daniel@totalueberwachung.de> | 2011-08-22 19:27:49 +0200 |
commit | efda919e2da1a566cf449b6925df97d4fd2e9b02 (patch) | |
tree | a6d7ca05a38f7f604cb5c2cf96209cbf133d48e3 /openbsc | |
parent | 1bb18c8e611ef1413221a24ea9aa450d370d8fd2 (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.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c index b82a62abd..58a281818 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c @@ -48,6 +48,24 @@ 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); + + 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); +} + static const struct value_string valid_names[] = { { BTS_LOC_FIX_INVALID, "invalid" }, { BTS_LOC_FIX_2D, "fix2d" }, @@ -162,7 +180,7 @@ static int set_bts_loc(struct ctrl_cmd *cmd, void *data) ret = get_bts_loc(cmd, data); if (!location_equal(curloc, lastloc)) - osmo_bsc_send_trap(cmd, gsmnet->msc_data->msc_con); + generate_location_state_trap(bts, gsmnet->msc_data->msc_con); cleanup_locations(&bts->loc_list); |