aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/oml.c23
-rw-r--r--src/osmo-bts-sysmo/Makefile.am2
-rw-r--r--src/osmo-bts-sysmo/misc/sysmobts_misc.c5
-rw-r--r--src/osmo-bts-sysmo/utils.c21
4 files changed, 28 insertions, 23 deletions
diff --git a/src/common/oml.c b/src/common/oml.c
index 6cb8e56e..3f7f4729 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -160,6 +160,29 @@ struct msgb *oml_msgb_alloc(void)
return msgb_alloc_headroom(1024, 128, "OML");
}
+int oml_add_manufacturer_id_label(struct msgb *msg,
+ enum oml_message_type vendor_type)
+{
+ uint8_t *manuf;
+
+ switch (vendor_type) {
+ case OML_MSG_TYPE_IPA:
+ manuf = msgb_push(msg, 1 + sizeof(ipaccess_magic));
+ manuf[0] = sizeof(ipaccess_magic);
+ memcpy(manuf+1, ipaccess_magic, sizeof(ipaccess_magic));
+ break;
+ case OML_MSG_TYPE_OSMO:
+ manuf = msgb_push(msg, 1 + sizeof(osmocom_magic));
+ manuf[0] = sizeof(osmocom_magic);
+ memcpy(manuf+1, osmocom_magic, sizeof(osmocom_magic));
+ break;
+ default:
+ return -1;
+ }
+
+ return 0;
+}
+
int oml_check_manuf(struct abis_om_hdr *hdr, size_t msg_size)
{
if (msg_size < 1) {
diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am
index de707614..2273f4b6 100644
--- a/src/osmo-bts-sysmo/Makefile.am
+++ b/src/osmo-bts-sysmo/Makefile.am
@@ -24,7 +24,7 @@ sysmobts_mgr_SOURCES = \
misc/sysmobts_mgr.c misc/sysmobts_misc.c \
misc/sysmobts_par.c misc/sysmobts_nl.c utils.c \
misc/sysmobts_mgr_vty.c
-sysmobts_mgr_LDADD = $(COMMON_LDADD)
+sysmobts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(COMMON_LDADD)
sysmobts_util_SOURCES = misc/sysmobts_util.c misc/sysmobts_par.c
sysmobts_util_LDADD = $(LIBOSMOCORE_LIBS)
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_misc.c b/src/osmo-bts-sysmo/misc/sysmobts_misc.c
index 06f0c4c1..00f3bb99 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_misc.c
+++ b/src/osmo-bts-sysmo/misc/sysmobts_misc.c
@@ -41,6 +41,9 @@
#include <osmocom/gsm/abis_nm.h>
#include <osmocom/gsm/protocol/ipaccess.h>
+#include <osmo-bts/bts.h>
+#include <osmo-bts/oml.h>
+
#include "utils.h"
#include "btsconfig.h"
#include "sysmobts_misc.h"
@@ -98,7 +101,7 @@ static void add_oml_hdr_msg(struct msgb *msg, uint8_t msg_type,
foh->obj_inst.ts_nr = ts_nr;
if (is_manuf)
- add_manufacturer_id_label(msg, MANUF_ID_OSMO);
+ oml_add_manufacturer_id_label(msg, MANUF_ID_OSMO);
msg->l2h = msgb_push(msg, sizeof(*omh));
omh = (struct abis_om_hdr *) msg->l2h;
diff --git a/src/osmo-bts-sysmo/utils.c b/src/osmo-bts-sysmo/utils.c
index bd75c81d..760c97bb 100644
--- a/src/osmo-bts-sysmo/utils.c
+++ b/src/osmo-bts-sysmo/utils.c
@@ -187,24 +187,3 @@ int check_ipa_header(struct msgb *msg)
return 0;
}
-
-int add_manufacturer_id_label(struct msgb *msg, enum manuf_type_id type_id)
-{
- uint8_t *manuf;
-
- switch (type_id) {
- case MANUF_ID_IPA:
- manuf = msgb_push(msg, 1 + sizeof(ipaccess_magic));
- manuf[0] = sizeof(ipaccess_magic);
- memcpy(manuf+1, ipaccess_magic, sizeof(ipaccess_magic));
- break;
- case MANUF_ID_OSMO:
- manuf = msgb_push(msg, 1 + sizeof(osmocom_magic));
- manuf[0] = sizeof(osmocom_magic);
- memcpy(manuf+1, osmocom_magic, sizeof(osmocom_magic));
- break;
- default:
- return -1;
- }
- return 0;
-}