From 7c00983275c1b830b88db124bc0b15078b9cd45d Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 5 Apr 2015 13:45:53 +0200 Subject: nat: Inform others if an IMSI is rejected In case one wants to monitor the access lists one there is now a trap for the IMSI. --- openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c') diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c index 1a45e7667..6aa2ff044 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c @@ -412,3 +412,21 @@ error: return NULL; } +void bsc_nat_inform_reject(struct bsc_connection *conn, const char *imsi) +{ + struct ctrl_cmd *cmd; + + cmd = ctrl_cmd_create(conn, 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.0.bsc.%d.notification-rejection-v1", + conn->cfg->nr); + cmd->reply = talloc_asprintf(cmd, "imsi=%s", imsi); + + ctrl_cmd_send_to_all(conn->cfg->nat->ctrl, cmd); + talloc_free(cmd); +} -- cgit v1.2.3