aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-omldummy/main.c
diff options
context:
space:
mode:
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;
+}