Use the new NS2 lib

Depends: Id7edb8feb96436ba170383fc62d43ceb16955d53 (libosmocore)
Depends: I2a9dcd14f4ad16211c0f6d98812ad4a13e910c2a (libosmocore)
Change-Id: Ib389925cf5c9f18951af6242c31ea70476218e9a
diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp
index c5ff3dc..d0e630f 100644
--- a/src/pcu_main.cpp
+++ b/src/pcu_main.cpp
@@ -38,7 +38,7 @@
 #include "pcu_vty.h"
 #include "coding_scheme.h"
 #include <osmocom/gprs/gprs_bssgp.h>
-#include <osmocom/gprs/gprs_ns.h>
+#include <osmocom/gprs/gprs_ns2.h>
 #include <osmocom/vty/telnet_interface.h>
 #include <osmocom/vty/command.h>
 #include <osmocom/vty/vty.h>
@@ -267,7 +267,6 @@
 
 	osmo_stats_init(tall_pcu_ctx);
 	rate_ctr_init(tall_pcu_ctx);
-	gprs_ns_set_log_ss(DNS);
 	bssgp_set_log_ss(DBSSGP);
 
 	pcu_vty_info.tall_ctx = tall_pcu_ctx;
@@ -289,12 +288,13 @@
 	else
 		fprintf(stderr, "Failed to initialize GSMTAP for %s\n", gsmtap_addr);
 
-	bssgp_nsi = gprs_ns_instantiate(&gprs_bssgp_ns_cb, tall_pcu_ctx);
-	if (!bssgp_nsi) {
+	bts->nsi = gprs_ns2_instantiate(tall_pcu_ctx, gprs_ns_prim_cb, NULL);
+	if (!bts->nsi) {
 		LOGP(DBSSGP, LOGL_ERROR, "Failed to create NS instance\n");
 		exit(1);
 	}
-	gprs_ns_vty_init(bssgp_nsi);
+	bssgp_set_bssgp_callback(gprs_gp_send_cb, bts->nsi);
+	gprs_ns2_vty_init(bts->nsi, NULL);
 
 	rc = vty_read_config_file(config_file, NULL);
 	if (rc < 0 && config_given) {
@@ -306,6 +306,8 @@
 		fprintf(stderr, "No config file: '%s' Using default config.\n",
 			config_file);
 
+	gprs_ns2_vty_create();
+
 	rc = telnet_init_dynif(tall_pcu_ctx, NULL, vty_get_bind_addr(),
 			       OSMO_VTY_PORT_PCU);
 	if (rc < 0) {