[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.
diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c
index 7aa6e13..ac895a2 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 @@
 	"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 @@
 		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);