Move out sgsn to its own subdir

Change-Id: I16fccc0eadf588599b9e5578d0f4dbaf9df81737
diff --git a/configure.ac b/configure.ac
index 6672204..ec7af6e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -247,6 +247,7 @@
     include/osmocom/sgsn/Makefile
     src/Makefile
     src/gprs/Makefile
+    src/sgsn/Makefile
     src/gbproxy/Makefile
     src/gtphub/Makefile
     tests/Makefile
diff --git a/debian/copyright b/debian/copyright
index 5d883b9..fa7405f 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -92,27 +92,27 @@
            src/gbproxy/gb_proxy_peer.c
            src/gbproxy/gb_proxy_tlli.c
            src/gbproxy/gb_proxy_vty.c
-           src/gprs/gprs_gmm.c
-           src/gprs/gprs_llc.c
-           src/gprs/gprs_llc_vty.c
-           src/gprs/gprs_llc_xid.c
-           src/gprs/gprs_sgsn.c
-           src/gprs/gprs_sndcp.c
-           src/gprs/gprs_sndcp_comp.c
-           src/gprs/gprs_sndcp_dcomp.c
-           src/gprs/gprs_sndcp_pcomp.c
-           src/gprs/gprs_sndcp_vty.c
-           src/gprs/gprs_sndcp_xid.c
-           src/gprs/gprs_subscriber.c
            src/gtphub/gtphub.c
            src/gtphub/gtphub_main.c
            src/gtphub/gtphub_vty.c
-           src/gprs/sgsn_auth.c
-           src/gprs/sgsn_cdr.c
-           src/gprs/sgsn_ctrl.c
-           src/gprs/sgsn_libgtp.c
-           src/gprs/sgsn_main.c
-           src/gprs/sgsn_vty.c
+           src/sgsn/gprs_gmm.c
+           src/sgsn/gprs_llc.c
+           src/sgsn/gprs_llc_vty.c
+           src/sgsn/gprs_llc_xid.c
+           src/sgsn/gprs_sgsn.c
+           src/sgsn/gprs_sndcp.c
+           src/sgsn/gprs_sndcp_comp.c
+           src/sgsn/gprs_sndcp_dcomp.c
+           src/sgsn/gprs_sndcp_pcomp.c
+           src/sgsn/gprs_sndcp_vty.c
+           src/sgsn/gprs_sndcp_xid.c
+           src/sgsn/gprs_subscriber.c
+           src/sgsn/sgsn_auth.c
+           src/sgsn/sgsn_cdr.c
+           src/sgsn/sgsn_ctrl.c
+           src/sgsn/sgsn_libgtp.c
+           src/sgsn/sgsn_main.c
+           src/sgsn/sgsn_vty.c
            tests/gtphub/gtphub_test.c
            tests/sgsn/sgsn_test.c
            tests/slhc/slhc_test.c
diff --git a/osmoappdesc.py b/osmoappdesc.py
index 9c3fd5d..08166a9 100644
--- a/osmoappdesc.py
+++ b/osmoappdesc.py
@@ -24,11 +24,11 @@
 
 
 apps = [(4246, "src/gbproxy/osmo-gbproxy", "OsmoGbProxy", "gbproxy"),
-        (4245, "src/gprs/osmo-sgsn", "OsmoSGSN", "sgsn"),
+        (4245, "src/sgsn/osmo-sgsn", "OsmoSGSN", "sgsn"),
         (4253, "src/gtphub/osmo-gtphub", "OsmoGTPhub", "gtphub")
         ]
 
-vty_command = ["./src/gprs/osmo-sgsn", "-c",
+vty_command = ["./src/sgsn/osmo-sgsn", "-c",
                "doc/examples/osmo-sgsn/osmo-sgsn.cfg"]
 
 vty_app = apps[1]
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6c392af..a23d931 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -63,7 +63,7 @@
 vty-transcript-test:
 	osmo_verify_transcript_vty.py -v \
 		-n OsmoSGSN -p 4245 \
-		-r "$(top_builddir)/src/gprs/osmo-sgsn -c $(top_srcdir)/doc/examples/osmo-sgsn/osmo-sgsn.cfg" \
+		-r "$(top_builddir)/src/sgsn/osmo-sgsn -c $(top_srcdir)/doc/examples/osmo-sgsn/osmo-sgsn.cfg" \
 		$(U) $${T:-$(srcdir)/*.vty}
 	rm -f $(builddir)/sms.db $(builddir)/gsn_restart
 
diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py
index 57ef82e..9c253fc 100755
--- a/tests/ctrl_test_runner.py
+++ b/tests/ctrl_test_runner.py
@@ -145,11 +145,11 @@
 
 class TestCtrlSGSN(TestCtrlBase):
     def ctrl_command(self):
-        return ["./src/gprs/osmo-sgsn", "-c",
+        return ["./src/sgsn/osmo-sgsn", "-c",
                 "doc/examples/osmo-sgsn/osmo-sgsn.cfg"]
 
     def ctrl_app(self):
-        return (4251, "./src/gprs/osmo-sgsn", "OsmoSGSN", "sgsn")
+        return (4251, "./src/sgsn/osmo-sgsn", "OsmoSGSN", "sgsn")
 
     def testListSubscribers(self):
         # TODO. Add command to mark a subscriber as active
@@ -159,7 +159,7 @@
         self.assertEquals(r['value'], None)
 
 def add_sgsn_test(suite, workdir):
-    if not os.path.isfile(os.path.join(workdir, "src/gprs/osmo-sgsn")):
+    if not os.path.isfile(os.path.join(workdir, "src/sgsn/osmo-sgsn")):
         print("Skipping the SGSN test")
         return
     test = unittest.TestLoader().loadTestsFromTestCase(TestCtrlSGSN)
diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am
index 47189e5..7ba70eb 100644
--- a/tests/sgsn/Makefile.am
+++ b/tests/sgsn/Makefile.am
@@ -42,31 +42,31 @@
 	$(NULL)
 
 sgsn_test_LDADD = \
-	$(top_builddir)/src/gprs/gprs_llc_parse.o \
-	$(top_builddir)/src/gprs/gprs_llc.o \
-	$(top_builddir)/src/gprs/crc24.o \
-	$(top_builddir)/src/gprs/gprs_gb.o \
-	$(top_builddir)/src/gprs/gprs_ranap.o \
-	$(top_builddir)/src/gprs/gprs_sndcp.o \
-	$(top_builddir)/src/gprs/gprs_gmm_attach.o \
-	$(top_builddir)/src/gprs/gprs_gmm.o \
-	$(top_builddir)/src/gprs/gprs_mm_state_gb_fsm.o \
-	$(top_builddir)/src/gprs/gprs_mm_state_iu_fsm.o \
-	$(top_builddir)/src/gprs/gprs_sgsn.o \
-	$(top_builddir)/src/gprs/sgsn_vty.o \
-	$(top_builddir)/src/gprs/sgsn_libgtp.o \
-	$(top_builddir)/src/gprs/sgsn_auth.o \
-	$(top_builddir)/src/gprs/sgsn_ares.o \
+	$(top_builddir)/src/sgsn/gprs_llc.o \
+	$(top_builddir)/src/sgsn/gprs_gb.o \
+	$(top_builddir)/src/sgsn/gprs_ranap.o \
+	$(top_builddir)/src/sgsn/gprs_sndcp.o \
+	$(top_builddir)/src/sgsn/gprs_gmm_attach.o \
+	$(top_builddir)/src/sgsn/gprs_gmm.o \
+	$(top_builddir)/src/sgsn/gprs_mm_state_gb_fsm.o \
+	$(top_builddir)/src/sgsn/gprs_mm_state_iu_fsm.o \
+	$(top_builddir)/src/sgsn/gprs_sgsn.o \
+	$(top_builddir)/src/sgsn/sgsn_vty.o \
+	$(top_builddir)/src/sgsn/sgsn_libgtp.o \
+	$(top_builddir)/src/sgsn/sgsn_auth.o \
+	$(top_builddir)/src/sgsn/gprs_subscriber.o \
+        $(top_builddir)/src/sgsn/gprs_llc_xid.o \
+	$(top_builddir)/src/sgsn/gprs_sndcp_xid.o \
+        $(top_builddir)/src/sgsn/slhc.o \
+        $(top_builddir)/src/sgsn/gprs_sndcp_comp.o \
+        $(top_builddir)/src/sgsn/gprs_sndcp_pcomp.o \
+        $(top_builddir)/src/sgsn/v42bis.o \
+        $(top_builddir)/src/sgsn/gprs_sndcp_dcomp.o \
 	$(top_builddir)/src/gprs/gprs_utils.o \
-	$(top_builddir)/src/gprs/gprs_subscriber.o \
+	$(top_builddir)/src/gprs/gprs_llc_parse.o \
 	$(top_builddir)/src/gprs/gprs_gb_parse.o \
-        $(top_builddir)/src/gprs/gprs_llc_xid.o \
-	$(top_builddir)/src/gprs/gprs_sndcp_xid.o \
-        $(top_builddir)/src/gprs/slhc.o \
-        $(top_builddir)/src/gprs/gprs_sndcp_comp.o \
-        $(top_builddir)/src/gprs/gprs_sndcp_pcomp.o \
-        $(top_builddir)/src/gprs/v42bis.o \
-        $(top_builddir)/src/gprs/gprs_sndcp_dcomp.o \
+	$(top_builddir)/src/gprs/crc24.o \
+	$(top_builddir)/src/gprs/sgsn_ares.o \
 	$(LIBOSMOABIS_LIBS) \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
diff --git a/tests/slhc/Makefile.am b/tests/slhc/Makefile.am
index 818ae2e..b6738c2 100644
--- a/tests/slhc/Makefile.am
+++ b/tests/slhc/Makefile.am
@@ -8,7 +8,7 @@
 slhc_test_SOURCES = slhc_test.c
 
 slhc_test_LDADD = \
-	$(top_builddir)/src/gprs/slhc.o \
+	$(top_builddir)/src/sgsn/slhc.o \
 	$(LIBOSMOCORE_LIBS)
 
 
diff --git a/tests/sndcp_xid/Makefile.am b/tests/sndcp_xid/Makefile.am
index fbcb36c..24626b3 100644
--- a/tests/sndcp_xid/Makefile.am
+++ b/tests/sndcp_xid/Makefile.am
@@ -8,7 +8,7 @@
 sndcp_xid_test_SOURCES = sndcp_xid_test.c
 
 sndcp_xid_test_LDADD = \
-	$(top_builddir)/src/gprs/gprs_sndcp_xid.o \
+	$(top_builddir)/src/sgsn/gprs_sndcp_xid.o \
 	$(LIBOSMOABIS_LIBS) \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
diff --git a/tests/v42bis/Makefile.am b/tests/v42bis/Makefile.am
index 8e17b4a..7442392 100644
--- a/tests/v42bis/Makefile.am
+++ b/tests/v42bis/Makefile.am
@@ -8,7 +8,7 @@
 v42bis_test_SOURCES = v42bis_test.c
 
 v42bis_test_LDADD = \
-	$(top_builddir)/src/gprs/v42bis.o \
+	$(top_builddir)/src/sgsn/v42bis.o \
 	$(LIBOSMOCORE_LIBS)
 
 
diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py
index a71865d..a925b6b 100755
--- a/tests/vty_test_runner.py
+++ b/tests/vty_test_runner.py
@@ -119,11 +119,11 @@
 class TestVTYSGSN(TestVTYBase):
 
     def vty_command(self):
-        return ["./src/gprs/osmo-sgsn", "-c",
+        return ["./src/sgsn/osmo-sgsn", "-c",
                 "doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg"]
 
     def vty_app(self):
-        return (4245, "./src/gprs/osmo-sgsn", "OsmoSGSN", "sgsn")
+        return (4245, "./src/sgsn/osmo-sgsn", "OsmoSGSN", "sgsn")
 
     def testVtyTree(self):
         self.vty.enable()
@@ -284,7 +284,7 @@
     suite.addTest(test)
 
 def add_sgsn_test(suite, workdir):
-    if not os.path.isfile(os.path.join(workdir, "src/gprs/osmo-sgsn")):
+    if not os.path.isfile(os.path.join(workdir, "src/sgsn/osmo-sgsn")):
         print("Skipping the SGSN test")
         return
     test = unittest.TestLoader().loadTestsFromTestCase(TestVTYSGSN)
diff --git a/tests/xid/Makefile.am b/tests/xid/Makefile.am
index 92876ec..6f058f5 100644
--- a/tests/xid/Makefile.am
+++ b/tests/xid/Makefile.am
@@ -24,7 +24,7 @@
 	$(NULL)
 
 xid_test_LDADD = \
-	$(top_builddir)/src/gprs/gprs_llc_xid.o \
+	$(top_builddir)/src/sgsn/gprs_llc_xid.o \
 	$(LIBOSMOABIS_LIBS) \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \