aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc
diff options
context:
space:
mode:
authorDaniel Willmann <daniel@totalueberwachung.de>2011-07-22 18:09:11 +0200
committerDaniel Willmann <daniel@totalueberwachung.de>2011-08-22 19:24:29 +0200
commitd280f2dfbd7fff097a6d0385a027d11f561bd10d (patch)
treeeffddd9924a827ab1440ead848d6fb759299aded /openbsc/src/osmo-bsc
parent72feed7c708a4f06acdd4a1e85525fc38d7a4ca9 (diff)
osmo-bsc: Add support for traps to the location command
Diffstat (limited to 'openbsc/src/osmo-bsc')
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_main.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c
index fa0bd0724..43b17df50 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_main.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c
@@ -171,6 +171,22 @@ static void signal_handler(int signal)
}
}
+void osmo_bsc_send_trap(struct ctrl_cmd *cmd, struct bsc_msc_connection *msc_con)
+{
+ struct ctrl_cmd *trap;
+ struct ctrl_handle *ctrl;
+ struct osmo_msc_data *msc_data;
+
+ msc_data = (struct osmo_msc_data *) msc_con->write_queue.bfd.data;
+ ctrl = msc_data->network->ctrl;
+
+ trap = ctrl_cmd_trap(cmd);
+ ctrl_cmd_send_to_all(ctrl, trap);
+ ctrl_cmd_send(&msc_con->write_queue, trap);
+
+ talloc_free(trap);
+}
+
struct location {
struct llist_head list;
unsigned long age;
@@ -235,6 +251,8 @@ int set_net_loc(struct ctrl_cmd *cmd, void *data)
{
char *saveptr, *lat, *lon, *height, *age, *valid, *tmp;
struct location *myloc;
+ int ret;
+ struct gsm_network *gsmnet = (struct gsm_network *)data;
tmp = talloc_strdup(cmd, cmd->value);
if (!tmp)
@@ -265,7 +283,11 @@ int set_net_loc(struct ctrl_cmd *cmd, void *data)
llist_add(&myloc->list, &locations);
cleanup_locations();
- return get_net_loc(cmd, data);
+ ret = get_net_loc(cmd, data);
+ osmo_bsc_send_trap(cmd, gsmnet->msc_data->msc_con);
+
+ return ret;
+
oom:
cmd->reply = "OOM";
return CTRL_CMD_ERROR;