This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Max gerrit-no-reply at lists.osmocom.orgMax has uploaded this change for review. ( https://gerrit.osmocom.org/13418
Change subject: nanobts: use libosmocore's osmo_store*() for OML attr. patching
......................................................................
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
---
M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
1 file changed, 3 insertions(+), 12 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/18/13418/1
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
index d674c18..be40410 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 @@
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;
--
To view, visit https://gerrit.osmocom.org/13418
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I28cfb09f224072db9889a89923a3da15a6070e2a
Gerrit-Change-Number: 13418
Gerrit-PatchSet: 1
Gerrit-Owner: Max <msuraev at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190326/28b2bff7/attachment.htm>