gprs_ns2: introduce NS dialects

A NS dialect describes how the NS Entity interacts with
different virtual circuits. E.g. ipaccess use reset/block on udp
and is a dynamic connection.
A single NS Entity can only support one dialect. This can be later
used to protect a NS Entity against dynamic NS virtual circuits of a
different type.

It further allows a bind to support multiple dialects at the same time.

Change-Id: Ia118bb6f994845d84db09de7a94856f5ca573404
diff --git a/src/gb/gprs_ns2_udp.c b/src/gb/gprs_ns2_udp.c
index 928116d..b923e81 100644
--- a/src/gb/gprs_ns2_udp.c
+++ b/src/gb/gprs_ns2_udp.c
@@ -359,8 +359,6 @@
 	}
 
 	llist_add(&bind->list, &nsi->binding);
-	ns2_vty_bind_apply(bind);
-
 	if (result)
 		*result = bind;
 
@@ -378,8 +376,16 @@
 {
 	struct gprs_ns2_vc *nsvc;
 	struct priv_vc *priv;
+	enum gprs_ns2_vc_mode vc_mode;
 
-	nsvc = ns2_vc_alloc(bind, nse, true);
+	vc_mode = gprs_ns2_dialect_to_vc_mode(nse->dialect);
+	if ((int) vc_mode == -1) {
+		LOGP(DLNS, LOGL_ERROR, "Can not derive vc mode from dialect %d. Maybe libosmocore is too old.\n",
+		     nse->dialect);
+		return NULL;
+	}
+
+	nsvc = ns2_vc_alloc(bind, nse, true, vc_mode);
 	if (!nsvc)
 		return NULL;