From 9d016fd499cb23ad6d9e4c2757dbc4e1c154107d Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 30 Aug 2019 19:48:34 +0200 Subject: [PATCH] Move out gbproxy to its own subdir Change-Id: I2cc98d3a276d953609bbbbaa9782a0112687791e --- configure.ac | 1 + debian/copyright | 12 +++---- osmoappdesc.py | 2 +- src/Makefile.am | 1 + src/gbproxy/Makefile.am | 46 ++++++++++++++++++++++++++ src/{gprs => gbproxy}/gb_proxy.c | 0 src/{gprs => gbproxy}/gb_proxy_ctrl.c | 0 src/{gprs => gbproxy}/gb_proxy_main.c | 0 src/{gprs => gbproxy}/gb_proxy_patch.c | 0 src/{gprs => gbproxy}/gb_proxy_peer.c | 0 src/{gprs => gbproxy}/gb_proxy_tlli.c | 0 src/{gprs => gbproxy}/gb_proxy_vty.c | 0 src/gprs/Makefile.am | 16 --------- tests/gbproxy/Makefile.am | 8 ++--- tests/vty_test_runner.py | 6 ++-- 15 files changed, 62 insertions(+), 30 deletions(-) create mode 100644 src/gbproxy/Makefile.am rename src/{gprs => gbproxy}/gb_proxy.c (100%) rename src/{gprs => gbproxy}/gb_proxy_ctrl.c (100%) rename src/{gprs => gbproxy}/gb_proxy_main.c (100%) rename src/{gprs => gbproxy}/gb_proxy_patch.c (100%) rename src/{gprs => gbproxy}/gb_proxy_peer.c (100%) rename src/{gprs => gbproxy}/gb_proxy_tlli.c (100%) rename src/{gprs => gbproxy}/gb_proxy_vty.c (100%) diff --git a/configure.ac b/configure.ac index 02dcf05c9..1c3f03b0a 100644 --- a/configure.ac +++ b/configure.ac @@ -247,6 +247,7 @@ AC_OUTPUT( include/osmocom/sgsn/Makefile src/Makefile src/gprs/Makefile + src/gbproxy/Makefile tests/Makefile tests/atlocal tests/gprs/Makefile diff --git a/debian/copyright b/debian/copyright index b9bc8e0c8..695d768bf 100644 --- a/debian/copyright +++ b/debian/copyright @@ -86,12 +86,12 @@ Files: include/osmocom/sgsn/a_reset.h src/gprs/gprs_gb_parse.c src/gprs/gprs_utils.c src/gprs/sgsn_ares.c - src/gprs/gb_proxy.c - src/gprs/gb_proxy_main.c - src/gprs/gb_proxy_patch.c - src/gprs/gb_proxy_peer.c - src/gprs/gb_proxy_tlli.c - src/gprs/gb_proxy_vty.c + src/gbproxy/gb_proxy.c + src/gbproxy/gb_proxy_main.c + src/gbproxy/gb_proxy_patch.c + 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 diff --git a/osmoappdesc.py b/osmoappdesc.py index f610e77b3..1c47aee66 100644 --- a/osmoappdesc.py +++ b/osmoappdesc.py @@ -23,7 +23,7 @@ app_configs = { } -apps = [(4246, "src/gprs/osmo-gbproxy", "OsmoGbProxy", "gbproxy"), +apps = [(4246, "src/gbproxy/osmo-gbproxy", "OsmoGbProxy", "gbproxy"), (4245, "src/gprs/osmo-sgsn", "OsmoSGSN", "sgsn"), (4253, "src/gprs/osmo-gtphub", "OsmoGTPhub", "gtphub") ] diff --git a/src/Makefile.am b/src/Makefile.am index d2dcb9fba..024938d81 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,4 @@ SUBDIRS = \ gprs \ + gbproxy \ $(NULL) diff --git a/src/gbproxy/Makefile.am b/src/gbproxy/Makefile.am new file mode 100644 index 000000000..6876f68a5 --- /dev/null +++ b/src/gbproxy/Makefile.am @@ -0,0 +1,46 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + -I$(top_builddir) \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + -fno-strict-aliasing \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMOCTRL_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOGB_CFLAGS) \ + $(LIBOSMOGSUPCLIENT_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(LIBGTP_CFLAGS) \ + $(NULL) + +bin_PROGRAMS = \ + osmo-gbproxy \ + $(NULL) + +osmo_gbproxy_SOURCES = \ + gb_proxy.c \ + gb_proxy_main.c \ + gb_proxy_vty.c \ + gb_proxy_ctrl.c \ + gb_proxy_patch.c \ + gb_proxy_tlli.c \ + gb_proxy_peer.c \ + $(NULL) +osmo_gbproxy_LDADD = \ + $(top_builddir)/src/gprs/gprs_gb_parse.o \ + $(top_builddir)/src/gprs/gprs_llc_parse.o \ + $(top_builddir)/src/gprs/crc24.o \ + $(top_builddir)/src/gprs/gprs_utils.o \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOVTY_LIBS) \ + $(LIBOSMOCTRL_LIBS) \ + $(LIBOSMOGB_LIBS) \ + $(LIBGTP_LIBS) \ + -lrt \ + $(NULL) diff --git a/src/gprs/gb_proxy.c b/src/gbproxy/gb_proxy.c similarity index 100% rename from src/gprs/gb_proxy.c rename to src/gbproxy/gb_proxy.c diff --git a/src/gprs/gb_proxy_ctrl.c b/src/gbproxy/gb_proxy_ctrl.c similarity index 100% rename from src/gprs/gb_proxy_ctrl.c rename to src/gbproxy/gb_proxy_ctrl.c diff --git a/src/gprs/gb_proxy_main.c b/src/gbproxy/gb_proxy_main.c similarity index 100% rename from src/gprs/gb_proxy_main.c rename to src/gbproxy/gb_proxy_main.c diff --git a/src/gprs/gb_proxy_patch.c b/src/gbproxy/gb_proxy_patch.c similarity index 100% rename from src/gprs/gb_proxy_patch.c rename to src/gbproxy/gb_proxy_patch.c diff --git a/src/gprs/gb_proxy_peer.c b/src/gbproxy/gb_proxy_peer.c similarity index 100% rename from src/gprs/gb_proxy_peer.c rename to src/gbproxy/gb_proxy_peer.c diff --git a/src/gprs/gb_proxy_tlli.c b/src/gbproxy/gb_proxy_tlli.c similarity index 100% rename from src/gprs/gb_proxy_tlli.c rename to src/gbproxy/gb_proxy_tlli.c diff --git a/src/gprs/gb_proxy_vty.c b/src/gbproxy/gb_proxy_vty.c similarity index 100% rename from src/gprs/gb_proxy_vty.c rename to src/gbproxy/gb_proxy_vty.c diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index 0471bfe7c..8f7f054e7 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -55,26 +55,10 @@ libcommon_la_LIBADD = \ $(NULL) bin_PROGRAMS = \ - osmo-gbproxy \ osmo-sgsn \ osmo-gtphub \ $(NULL) -osmo_gbproxy_SOURCES = \ - gb_proxy.c \ - gb_proxy_main.c \ - gb_proxy_vty.c \ - gb_proxy_ctrl.c \ - gb_proxy_patch.c \ - gb_proxy_tlli.c \ - gb_proxy_peer.c \ - $(NULL) -osmo_gbproxy_LDADD = \ - libcommon.la \ - $(OSMO_LIBS) \ - -lrt \ - $(NULL) - osmo_sgsn_SOURCES = \ gprs_gb.c \ gprs_gmm_attach.c \ diff --git a/tests/gbproxy/Makefile.am b/tests/gbproxy/Makefile.am index ef38fb626..cb245b4cd 100644 --- a/tests/gbproxy/Makefile.am +++ b/tests/gbproxy/Makefile.am @@ -32,10 +32,10 @@ gbproxy_test_LDFLAGS = \ $(NULL) gbproxy_test_LDADD = \ - $(top_builddir)/src/gprs/gb_proxy.o \ - $(top_builddir)/src/gprs/gb_proxy_patch.o \ - $(top_builddir)/src/gprs/gb_proxy_peer.o \ - $(top_builddir)/src/gprs/gb_proxy_tlli.o \ + $(top_builddir)/src/gbproxy/gb_proxy.o \ + $(top_builddir)/src/gbproxy/gb_proxy_patch.o \ + $(top_builddir)/src/gbproxy/gb_proxy_peer.o \ + $(top_builddir)/src/gbproxy/gb_proxy_tlli.o \ $(top_builddir)/src/gprs/gprs_gb_parse.o \ $(top_builddir)/src/gprs/gprs_llc_parse.o \ $(top_builddir)/src/gprs/crc24.o \ diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index 19eaf2807..a71865d44 100755 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -71,11 +71,11 @@ class TestVTYBase(unittest.TestCase): class TestVTYGbproxy(TestVTYBase): def vty_command(self): - return ["./src/gprs/osmo-gbproxy", "-c", + return ["./src/gbproxy/osmo-gbproxy", "-c", "doc/examples/osmo-gbproxy/osmo-gbproxy.cfg"] def vty_app(self): - return (4246, "./src/gprs/osmo-gbproxy", "OsmoGbProxy", "gbproxy") + return (4246, "./src/gbproxy/osmo-gbproxy", "OsmoGbProxy", "gbproxy") def testVtyTree(self): self.vty.enable() @@ -277,7 +277,7 @@ class TestVTYSGSN(TestVTYBase): self.assertTrue(self.vty.verify('timer t%d 10' % t, [''])) def add_gbproxy_test(suite, workdir): - if not os.path.isfile(os.path.join(workdir, "src/gprs/osmo-gbproxy")): + if not os.path.isfile(os.path.join(workdir, "src/gbproxy/osmo-gbproxy")): print("Skipping the Gb-Proxy test") return test = unittest.TestLoader().loadTestsFromTestCase(TestVTYGbproxy)