summaryrefslogtreecommitdiffstats
path: root/src/gb/gprs_bssgp_util.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-05-15 12:48:30 +0200
committerHarald Welte <laforge@gnumonks.org>2017-05-15 13:42:03 +0200
commitbfe62e5781e3ee895a44ca9ccc155ff87c42bf43 (patch)
tree00e488e16dc4326816a4e22d111508956ae5315b /src/gb/gprs_bssgp_util.c
parent50ef73377cb9235adafe673c2bfa7a9dc02c0c02 (diff)
libosmogb: Convert to use new endian conversion helpers
Change-Id: I5ed17702cd9487e1cab6bae39802aa11fb6a37b0
Diffstat (limited to 'src/gb/gprs_bssgp_util.c')
-rw-r--r--src/gb/gprs_bssgp_util.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gb/gprs_bssgp_util.c b/src/gb/gprs_bssgp_util.c
index 6fff3621..88916c17 100644
--- a/src/gb/gprs_bssgp_util.c
+++ b/src/gb/gprs_bssgp_util.c
@@ -1,6 +1,6 @@
/* GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */
-/* (C) 2009-2012 by Harald Welte <laforge@gnumonks.org>
+/* (C) 2009-2017 by Harald Welte <laforge@gnumonks.org>
*
* All Rights Reserved
*
@@ -22,9 +22,8 @@
#include <errno.h>
#include <stdint.h>
-#include <netinet/in.h>
-
#include <osmocom/core/msgb.h>
+#include <osmocom/core/byteswap.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/core/talloc.h>
#include <osmocom/gprs/gprs_bssgp.h>
@@ -168,7 +167,7 @@ int bssgp_tx_simple_bvci(uint8_t pdu_type, uint16_t nsei,
msgb_bvci(msg) = ns_bvci;
bgph->pdu_type = pdu_type;
- _bvci = htons(bvci);
+ _bvci = osmo_htons(bvci);
msgb_tvlv_put(msg, BSSGP_IE_BVCI, 2, (uint8_t *) &_bvci);
return gprs_ns_sendmsg(bssgp_nsi, msg);
@@ -203,7 +202,7 @@ int bssgp_tx_status(uint8_t cause, uint16_t *bvci, struct msgb *orig_msg)
bgph->pdu_type = BSSGP_PDUT_STATUS;
msgb_tvlv_put(msg, BSSGP_IE_CAUSE, 1, &cause);
if (bvci) {
- uint16_t _bvci = htons(*bvci);
+ uint16_t _bvci = osmo_htons(*bvci);
msgb_tvlv_put(msg, BSSGP_IE_BVCI, 2, (uint8_t *) &_bvci);
}
msgb_tvlv_put(msg, BSSGP_IE_PDU_IN_ERROR,