WIP: Implement the NS Sub-Network-Service (SNS) on Gb connect

This change implements the use of GPRS Gb interface auto-configuration
using the NS IP Sub-Network Service (SNS) procedures.

It requires a (currently experimental) libosmogb in order to support
this feature.

Change-Id: I256b40ac592d3b6e75dd581bf7b9512f69b11e83
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index 100e33d..ee6a80b 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -540,12 +540,16 @@
 		return -EINVAL;
 
 	nssd = (struct ns_signal_data *)signal_data;
-	if (nssd->nsvc != the_pcu.nsvc) {
+	if (signal != S_SNS_CONFIGURED &&  nssd->nsvc != the_pcu.nsvc) {
 		LOGP(DPCU, LOGL_ERROR, "Signal received of unknown NSVC\n");
 		return -EINVAL;
 	}
 
 	switch (signal) {
+	case S_SNS_CONFIGURED:
+		/* SNS configuration completed, send NS-RESET via NS-VC */
+		gprs_nsvc_reset(the_pcu.nsvc, NS_CAUSE_OM_INTERVENTION);
+		break;
 	case S_NS_UNBLOCK:
 		if (!the_pcu.nsvc_unblocked) {
 			the_pcu.nsvc_unblocked = 1;
@@ -871,8 +875,7 @@
 		return -EBADF;
 	}
 
-	nsvc2 = gprs_ns_nsip_connect(bssgp_nsi, &nsvc->ip.bts_addr,
-		nsvc->nsei, nsvc->nsvci);
+	nsvc2 = gprs_ns_nsip_connect_sns(bssgp_nsi, &nsvc->ip.bts_addr, nsvc->nsei, nsvc->nsvci);
 
 	if (!nsvc2) {
 		LOGP(DBSSGP, LOGL_ERROR, "Failed to reconnect NSVC\n");
@@ -919,7 +922,7 @@
 	dest.sin_port = htons(sgsn_port);
 	dest.sin_addr.s_addr = htonl(sgsn_ip);
 
-	the_pcu.nsvc = gprs_ns_nsip_connect(bssgp_nsi, &dest, nsei, nsvci);
+	the_pcu.nsvc = gprs_ns_nsip_connect_sns(bssgp_nsi, &dest, nsei, nsvci);
 	if (!the_pcu.nsvc) {
 		LOGP(DBSSGP, LOGL_ERROR, "Failed to create NSVCt\n");
 		gprs_ns_destroy(bssgp_nsi);