aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-omldummy/main.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-12-17 13:35:52 +0100
committerHarald Welte <laforge@gnumonks.org>2018-03-17 15:22:51 +0100
commit553535f87b490a8b8a2ab2633417ab7c286907bd (patch)
treeb9d970393d6b191494c88778cd13d403a620b046 /src/osmo-bts-omldummy/main.c
parent6d0c67684c4ea8e1f767310636dbe840c36d54e2 (diff)
Add 'osmo-bts-omldummy' to bring up only OML without RSL
This is used only in integration testing, where in the TTCN-3 testsuite we currently have no A-bis OML implementation, but only a RSL one. Change-Id: Id8e5f34091e6e32621d8c8673de7ea848dfd252f
Diffstat (limited to 'src/osmo-bts-omldummy/main.c')
-rw-r--r--src/osmo-bts-omldummy/main.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/osmo-bts-omldummy/main.c b/src/osmo-bts-omldummy/main.c
new file mode 100644
index 00000000..b9334b1b
--- /dev/null
+++ b/src/osmo-bts-omldummy/main.c
@@ -0,0 +1,52 @@
+
+#include <osmocom/core/talloc.h>
+#include <osmo-bts/logging.h>
+#include <osmo-bts/abis.h>
+#include <osmo-bts/bts.h>
+#include <osmo-bts/oml.h>
+
+
+int main(int argc, char **argv)
+{
+ struct gsm_bts *bts;
+ struct gsm_bts_trx *trx;
+ struct e1inp_line *line;
+ int rc, i;
+
+ char *dst_host = argv[1];
+ int site_id = atoi(argv[2]);
+
+ tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context");
+ msgb_talloc_ctx_init(tall_bts_ctx, 10*1024);
+
+ bts_log_init(NULL);
+
+ bts = gsm_bts_alloc(tall_bts_ctx, 0);
+ if (!bts)
+ exit(1);
+ bts->ip_access.site_id = site_id;
+ bts->ip_access.bts_id = 0;
+
+ /* Additional TRXs */
+ for (i = 1; i < 8; i++) {
+ trx = gsm_bts_trx_alloc(bts);
+ if (!trx)
+ exit(1);
+ }
+
+ if (bts_init(bts) < 0)
+ exit(1);
+ //btsb = bts_role_bts(bts);
+ abis_init(bts);
+
+
+ line = abis_open(bts, dst_host, "OMLdummy");
+ if (!line)
+ exit(2);
+
+ while (1) {
+ osmo_select_main(0);
+ }
+
+ return EXIT_SUCCESS;
+}