split libgb into a separate library for outside use

This also removes the dependency to osmo_sock() inside libcommon and
replaces it with osmo_sock_* from libosmocore
diff --git a/openbsc/include/Makefile.am b/openbsc/include/Makefile.am
index 4596b6e..2cc8bee 100644
--- a/openbsc/include/Makefile.am
+++ b/openbsc/include/Makefile.am
@@ -1,3 +1,3 @@
-SUBDIRS = openbsc
+SUBDIRS = openbsc osmocom
 
 noinst_HEADERS = mISDNif.h compat_af_isdn.h
diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am
index 8e64ff8..58fa691 100644
--- a/openbsc/include/openbsc/Makefile.am
+++ b/openbsc/include/openbsc/Makefile.am
@@ -7,9 +7,9 @@
 		 system_information.h handover.h mgcp_internal.h \
 		 vty.h socket.h e1_config.h trau_upqueue.h token_auth.h \
 		 handover_decision.h rrlp.h control_if.h \
-		crc24.h gprs_bssgp.h gprs_llc.h gprs_ns.h gprs_gmm.h \
+		crc24.h gprs_llc.h gprs_gmm.h \
 		gb_proxy.h gprs_sgsn.h gsm_04_08_gprs.h sgsn.h \
-		gprs_ns_frgre.h auth.h osmo_msc.h bsc_msc.h bsc_nat.h \
+		auth.h osmo_msc.h bsc_msc.h bsc_nat.h \
 		osmo_bsc_rf.h osmo_bsc.h network_listen.h bsc_nat_sccp.h \
 		osmo_msc_data.h osmo_bsc_grace.h sms_queue.h abis_om2000.h \
 		bss.h gsm_data_shared.h control_cmd.h ipaccess.h mncc_int.h
diff --git a/openbsc/include/openbsc/gb_proxy.h b/openbsc/include/openbsc/gb_proxy.h
index c0cdcbf..2c8ddb3 100644
--- a/openbsc/include/openbsc/gb_proxy.h
+++ b/openbsc/include/openbsc/gb_proxy.h
@@ -4,7 +4,7 @@
 
 #include <osmocom/core/msgb.h>
 
-#include <openbsc/gprs_ns.h>
+#include <osmocom/gprs/gprs_ns.h>
 #include <osmocom/vty/command.h>
 
 struct gbproxy_config {
diff --git a/openbsc/include/openbsc/sgsn.h b/openbsc/include/openbsc/sgsn.h
index 966b4e6..48a7b34 100644
--- a/openbsc/include/openbsc/sgsn.h
+++ b/openbsc/include/openbsc/sgsn.h
@@ -4,7 +4,7 @@
 
 #include <osmocom/core/msgb.h>
 
-#include <openbsc/gprs_ns.h>
+#include <osmocom/gprs/gprs_ns.h>
 #include <openbsc/gprs_sgsn.h>
 
 struct sgsn_config {
diff --git a/openbsc/include/osmocom/Makefile.am b/openbsc/include/osmocom/Makefile.am
new file mode 100644
index 0000000..596ce23
--- /dev/null
+++ b/openbsc/include/osmocom/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = gprs
diff --git a/openbsc/include/osmocom/gprs/Makefile.am b/openbsc/include/osmocom/gprs/Makefile.am
new file mode 100644
index 0000000..fe5714e
--- /dev/null
+++ b/openbsc/include/osmocom/gprs/Makefile.am
@@ -0,0 +1,3 @@
+libgb_HEADERS = gprs_bssgp.h gprs_ns.h gprs_ns_frgre.h
+
+libgbdir = $(includedir)/osmocom/gprs
diff --git a/openbsc/include/openbsc/gprs_bssgp.h b/openbsc/include/osmocom/gprs/gprs_bssgp.h
similarity index 99%
rename from openbsc/include/openbsc/gprs_bssgp.h
rename to openbsc/include/osmocom/gprs/gprs_bssgp.h
index df93f5b..bfc7d33 100644
--- a/openbsc/include/openbsc/gprs_bssgp.h
+++ b/openbsc/include/osmocom/gprs/gprs_bssgp.h
@@ -143,6 +143,8 @@
 
 /* Our implementation */
 
+#include <osmocom/gsm/gsm48.h>
+
 /* gprs_bssgp_util.c */
 extern struct gprs_ns_inst *bssgp_nsi;
 struct msgb *bssgp_msgb_alloc(void);
diff --git a/openbsc/include/openbsc/gprs_ns.h b/openbsc/include/osmocom/gprs/gprs_ns.h
similarity index 100%
rename from openbsc/include/openbsc/gprs_ns.h
rename to openbsc/include/osmocom/gprs/gprs_ns.h
diff --git a/openbsc/include/openbsc/gprs_ns_frgre.h b/openbsc/include/osmocom/gprs/gprs_ns_frgre.h
similarity index 100%
rename from openbsc/include/openbsc/gprs_ns_frgre.h
rename to openbsc/include/osmocom/gprs/gprs_ns_frgre.h