aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/sgsn_main.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-17 00:44:57 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-17 00:44:57 +0200
commit2720e7310d3cce36bc3cbcf87d3e8eb2eecf5c75 (patch)
tree3136b5836493c1ad2841ef595a27042172cb7f26 /openbsc/src/gprs/sgsn_main.c
parent7363e92cd3b89eaa77db4bf502433524e16667b6 (diff)
[GPRS] Initial untested support for libgtp
libgtp of the OpenGGSN project will allow us to speak the GTPv0/v1 protocol of the interface between SGSN and GGSN. This commit includes code for the main libgtp integration (file descriptor, select loop, timer) as well as code to encode/send a CREATE PDP CONTEXT request.
Diffstat (limited to 'openbsc/src/gprs/sgsn_main.c')
-rw-r--r--openbsc/src/gprs/sgsn_main.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c
index 7aa6e139e..ac895a2ce 100644
--- a/openbsc/src/gprs/sgsn_main.c
+++ b/openbsc/src/gprs/sgsn_main.c
@@ -46,6 +46,8 @@
#include <openbsc/gprs_ns.h>
#include <openbsc/gprs_bssgp.h>
+#include <gtp.h>
+
#include "../../bscconfig.h"
/* this is here for the vty... it will never be called */
@@ -64,8 +66,12 @@ const char *openbsc_copyright =
"This is free software: you are free to change and redistribute it.\n"
"There is NO WARRANTY, to the extent permitted by law.\n";
-static char *config_file = "osmo_sgsn.cfg";
-static struct sgsn_config sgcfg;
+struct sgsn_instance sgsn_inst = {
+ .config_file = "osmo_sgsn.cfg",
+ .cfg = {
+ .gtp_statedir = "./",
+ },
+};
/* call-back function for the NS protocol */
static int sgsn_ns_cb(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
@@ -152,17 +158,18 @@ int main(int argc, char **argv)
LOGP(DGPRS, LOGL_ERROR, "Unable to instantiate NS\n");
exit(1);
}
- bssgp_nsi = sgcfg.nsi = sgsn_nsi;
+ bssgp_nsi = sgsn_inst.cfg.nsi = sgsn_nsi;
gprs_ns_vty_init(bssgp_nsi);
/* FIXME: register signal handler for SS_NS */
- rc = sgsn_parse_config(config_file, &sgcfg);
+ rc = sgsn_parse_config(sgsn_inst.config_file, &sgsn_inst.cfg);
if (rc < 0) {
LOGP(DGPRS, LOGL_FATAL, "Cannot parse config file\n");
exit(2);
}
- nsip_listen(sgsn_nsi, sgcfg.nsip_listen_port);
+ rc = sgsn_gtp_init(&sgsn_inst);
+ nsip_listen(sgsn_nsi, sgsn_inst.cfg.nsip_listen_port);
while (1) {
rc = bsc_select_main(0);