aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2019-03-20 10:36:30 +0100
committerMax <msuraev@sysmocom.de>2019-03-27 12:26:32 +0000
commit85e29892e9d88290ceb9493bd15d7ec7542a5502 (patch)
treed1291c27cc0b40d36ff4777be3cbb8c405ccf4a5 /src/osmo-bsc
parent023fc49ed614d1bd9522b84e4ab135a1524e5841 (diff)
nanobts: use libosmocore's osmo_store*() for OML attr. patching
This slightly simplifies things by making endianness more obvious and removing abstraction. Change-Id: I28cfb09f224072db9889a89923a3da15a6070e2a
Diffstat (limited to 'src/osmo-bsc')
-rw-r--r--src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
index d674c1891..be4041067 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
@@ -25,15 +25,6 @@
#include <osmocom/bsc/abis_nm.h>
#include <osmocom/bsc/gsm_timers.h>
-static void patch_16(uint8_t *data, const uint16_t val)
-{
- memcpy(data, &val, sizeof(val));
-}
-
-static void patch_32(uint8_t *data, const uint32_t val)
-{
- memcpy(data, &val, sizeof(val));
-}
struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts)
{
@@ -213,11 +204,11 @@ struct msgb *nanobts_attr_nscv_get(struct gsm_bts *bts)
msgb_tl16v_put(msgb, NM_ATT_IPACC_NSVCI, 2, buf);
/* remote udp port */
- patch_16(&buf[0], htons(bts->gprs.nsvc[0].remote_port));
+ osmo_store16be(bts->gprs.nsvc[0].remote_port, &buf[0]);
/* remote ip address */
- patch_32(&buf[2], htonl(bts->gprs.nsvc[0].remote_ip));
+ osmo_store32be(bts->gprs.nsvc[0].remote_ip, &buf[2]);
/* local udp port */
- patch_16(&buf[6], htons(bts->gprs.nsvc[0].local_port));
+ osmo_store16be(bts->gprs.nsvc[0].local_port, &buf[6]);
msgb_tl16v_put(msgb, NM_ATT_IPACC_NS_LINK_CFG, 8, buf);
return msgb;