aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs/gprs_sgsn.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-10-30 18:00:57 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-10-30 18:25:47 +0100
commit73b2bf321575abe7ea31dedb1c061db430dfd95a (patch)
tree4bd33aaed4f41098f9461c74619ce02201cc523c /src/gprs/gprs_sgsn.c
parentb1d1c240dbfe6a065fd489c38e2e8563ff2d747c (diff)
Allocate sgsn_instance with talloc
Diffstat (limited to 'src/gprs/gprs_sgsn.c')
-rw-r--r--src/gprs/gprs_sgsn.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c
index bac7325b..01f039a6 100644
--- a/src/gprs/gprs_sgsn.c
+++ b/src/gprs/gprs_sgsn.c
@@ -32,6 +32,7 @@
#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <osmocom/gsm/apn.h>
#include <osmocom/gsm/gsm_utils.h>
+#include <osmocom/gsm/gsup.h>
#include <osmocom/sgsn/gprs_subscriber.h>
#include <osmocom/sgsn/debug.h>
@@ -978,7 +979,17 @@ static void sgsn_llme_check_cb(void *data_)
osmo_timer_schedule(&sgsn->llme_timer, GPRS_LLME_CHECK_TICK, 0);
}
-void sgsn_inst_init()
+struct sgsn_instance *sgsn_instance_alloc(void *talloc_ctx)
+{
+ struct sgsn_instance *inst;
+ inst = talloc_zero(talloc_ctx, struct sgsn_instance);
+ inst->cfg.gtp_statedir = talloc_strdup(inst, "./");
+ inst->cfg.auth_policy = SGSN_AUTH_POLICY_CLOSED;
+ inst->cfg.gsup_server_port = OSMO_GSUP_PORT;
+ return inst;
+}
+
+void sgsn_inst_init(struct sgsn_instance *sgsn)
{
osmo_timer_setup(&sgsn->llme_timer, sgsn_llme_check_cb, NULL);
osmo_timer_schedule(&sgsn->llme_timer, GPRS_LLME_CHECK_TICK, 0);