Migrate VTY code to libosmovty
diff --git a/openbsc/src/gprs/Makefile.am b/openbsc/src/gprs/Makefile.am
index 191f619..11b2ac9 100644
--- a/openbsc/src/gprs/Makefile.am
+++ b/openbsc/src/gprs/Makefile.am
@@ -1,6 +1,6 @@
 INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
-AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) -fno-strict-aliasing
-AM_LDFLAGS = $(LIBOSMOCORE_LIBS)
+AM_CFLAGS=-Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS)
+AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS)
 
 noinst_LIBRARIES = libgb.a
 
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index 26c9e4f..b6fbac7 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -567,7 +567,7 @@
 }
 
 
-#include <vty/command.h>
+#include <osmocom/vty/command.h>
 
 gDEFUN(show_gbproxy, show_gbproxy_cmd, "show gbproxy",
        SHOW_STR "Display information about the Gb proxy")
diff --git a/openbsc/src/gprs/gb_proxy_main.c b/openbsc/src/gprs/gb_proxy_main.c
index 71d6086..208ae47 100644
--- a/openbsc/src/gprs/gb_proxy_main.c
+++ b/openbsc/src/gprs/gb_proxy_main.c
@@ -42,11 +42,11 @@
 #include <openbsc/debug.h>
 #include <openbsc/gprs_ns.h>
 #include <openbsc/gprs_bssgp.h>
-#include <openbsc/telnet_interface.h>
 #include <openbsc/vty.h>
 #include <openbsc/gb_proxy.h>
 
-#include <vty/command.h>
+#include <osmocom/vty/command.h>
+#include <osmocom/vty/telnet_interface.h>
 
 #include "../../bscconfig.h"
 
diff --git a/openbsc/src/gprs/gb_proxy_vty.c b/openbsc/src/gprs/gb_proxy_vty.c
index 738adcf..7b6d2da 100644
--- a/openbsc/src/gprs/gb_proxy_vty.c
+++ b/openbsc/src/gprs/gb_proxy_vty.c
@@ -31,8 +31,8 @@
 #include <openbsc/gprs_ns.h>
 #include <openbsc/vty.h>
 
-#include <vty/command.h>
-#include <vty/vty.h>
+#include <osmocom/vty/command.h>
+#include <osmocom/vty/vty.h>
 
 static struct gbproxy_config *g_cfg = NULL;
 
diff --git a/openbsc/src/gprs/gprs_bssgp_vty.c b/openbsc/src/gprs/gprs_bssgp_vty.c
index 8377c56..9da02ab 100644
--- a/openbsc/src/gprs/gprs_bssgp_vty.c
+++ b/openbsc/src/gprs/gprs_bssgp_vty.c
@@ -37,11 +37,12 @@
 #include <openbsc/signal.h>
 #include <openbsc/gprs_ns.h>
 #include <openbsc/gprs_bssgp.h>
-#include <openbsc/telnet_interface.h>
 #include <openbsc/vty.h>
 
-#include <vty/vty.h>
-#include <vty/command.h>
+#include <osmocom/vty/vty.h>
+#include <osmocom/vty/command.h>
+#include <osmocom/vty/logging.h>
+#include <osmocom/vty/telnet_interface.h>
 
 /* FIXME: this should go to some common file as it is copied
  * in vty_interface.c of the BSC */
diff --git a/openbsc/src/gprs/gprs_llc_vty.c b/openbsc/src/gprs/gprs_llc_vty.c
index 510ef64..9c7f556 100644
--- a/openbsc/src/gprs/gprs_llc_vty.c
+++ b/openbsc/src/gprs/gprs_llc_vty.c
@@ -37,8 +37,8 @@
 #include <openbsc/signal.h>
 #include <openbsc/gprs_llc.h>
 
-#include <vty/vty.h>
-#include <vty/command.h>
+#include <osmocom/vty/vty.h>
+#include <osmocom/vty/command.h>
 
 struct value_string gprs_llc_state_strs[] = {
 	{ GPRS_LLS_UNASSIGNED, 		"TLLI Unassigned" },
diff --git a/openbsc/src/gprs/gprs_ns_vty.c b/openbsc/src/gprs/gprs_ns_vty.c
index 423ac20..81346c6 100644
--- a/openbsc/src/gprs/gprs_ns_vty.c
+++ b/openbsc/src/gprs/gprs_ns_vty.c
@@ -37,11 +37,12 @@
 #include <openbsc/signal.h>
 #include <openbsc/gprs_ns.h>
 #include <openbsc/gprs_bssgp.h>
-#include <openbsc/telnet_interface.h>
 #include <openbsc/vty.h>
 
-#include <vty/vty.h>
-#include <vty/command.h>
+#include <osmocom/vty/vty.h>
+#include <osmocom/vty/command.h>
+#include <osmocom/vty/logging.h>
+#include <osmocom/vty/telnet_interface.h>
 
 static struct gprs_ns_inst *vty_nsi = NULL;
 
diff --git a/openbsc/src/gprs/osmo_sgsn.cfg b/openbsc/src/gprs/osmo_sgsn.cfg
index d3d4bb2..298d2d6 100644
--- a/openbsc/src/gprs/osmo_sgsn.cfg
+++ b/openbsc/src/gprs/osmo_sgsn.cfg
@@ -6,10 +6,12 @@
  no login
 !
 sgsn
-  ggsn 0 remote-ip 192.168.100.239
+  ggsn 0 remote-ip 127.0.0.1
   ggsn 0 gtp-version 1
 ns
+ encapsulation udp local-ip 192.168.100.239
  encapsulation udp local-port 23000
+ encapsulation framerelay-gre enabled 1
  timer tns-block 3
  timer tns-block-retries 3
  timer tns-reset 3
diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c
index 7c5afe5..4ed4980 100644
--- a/openbsc/src/gprs/sgsn_main.c
+++ b/openbsc/src/gprs/sgsn_main.c
@@ -38,9 +38,10 @@
 #include <osmocore/select.h>
 #include <osmocore/rate_ctr.h>
 
+#include <osmocom/vty/telnet_interface.h>
+
 #include <openbsc/signal.h>
 #include <openbsc/debug.h>
-#include <openbsc/telnet_interface.h>
 #include <openbsc/vty.h>
 #include <openbsc/sgsn.h>
 #include <openbsc/gprs_ns.h>
diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c
index 2532a88..34dd8c6 100644
--- a/openbsc/src/gprs/sgsn_vty.c
+++ b/openbsc/src/gprs/sgsn_vty.c
@@ -34,8 +34,8 @@
 #include <openbsc/gprs_sgsn.h>
 #include <openbsc/vty.h>
 
-#include <vty/command.h>
-#include <vty/vty.h>
+#include <osmocom/vty/command.h>
+#include <osmocom/vty/vty.h>
 
 #include <pdp.h>