Change in osmo-bsc[master]: nanobts: use libosmocore's osmo_store*() for OML attr. patching

Max gerrit-no-reply at lists.osmocom.org
Wed Mar 27 12:26:32 UTC 2019


Max has submitted this change and it was merged. ( 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(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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: merged
Gerrit-Change-Id: I28cfb09f224072db9889a89923a3da15a6070e2a
Gerrit-Change-Number: 13418
Gerrit-PatchSet: 2
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-CC: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190327/f2aff84f/attachment.html>


More information about the gerrit-log mailing list