aboutsummaryrefslogtreecommitdiffstats
path: root/src/gsm/gsm0808.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-05-15 12:11:36 +0200
committerHarald Welte <laforge@gnumonks.org>2017-05-15 13:42:03 +0200
commit95871dadbd92048b0dc2ceb2d631a53e062a7420 (patch)
tree1d9de18dda6837429409d235171270706bce7041 /src/gsm/gsm0808.c
parent3318c657dea52c143842dab0e0f7733288f7bd4d (diff)
use osmo_{htonl,htons,ntohl,ntohs}() functions all over libosmocore
This gets us one step closer to fixing the embedded build Change-Id: I3fc2639b6ade9ab138766987eceab7ec9498fdc7
Diffstat (limited to 'src/gsm/gsm0808.c')
-rw-r--r--src/gsm/gsm0808.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c
index be58939d..04c2f018 100644
--- a/src/gsm/gsm0808.c
+++ b/src/gsm/gsm0808.c
@@ -18,13 +18,12 @@
*
*/
+#include <osmocom/core/byteswap.h>
#include <osmocom/gsm/gsm0808.h>
#include <osmocom/gsm/gsm0808_utils.h>
#include <osmocom/gsm/protocol/gsm_08_08.h>
#include <osmocom/gsm/gsm48.h>
-#include <arpa/inet.h>
-
#define BSSMAP_MSG_SIZE 512
#define BSSMAP_MSG_HEADROOM 128
@@ -51,7 +50,7 @@ struct msgb *gsm0808_create_layer3_aoip(const struct msgb *msg_l3, uint16_t nc,
/* create the cell header */
lai_ci.ident = CELL_IDENT_WHOLE_GLOBAL;
gsm48_generate_lai(&lai_ci.lai, cc, nc, lac);
- lai_ci.ci = htons(_ci);
+ lai_ci.ci = osmo_htons(_ci);
msgb_tlv_put(msg, GSM0808_IE_CELL_IDENTIFIER, sizeof(lai_ci),
(uint8_t *) &lai_ci);
@@ -266,7 +265,7 @@ struct msgb *gsm0808_create_ass(const struct gsm0808_channel_type *ct,
/* Circuit Identity Code 3.2.2.2 */
if (cic) {
- cic_sw = htons(*cic);
+ cic_sw = osmo_htons(*cic);
msgb_tv_fixed_put(msg, GSM0808_IE_CIRCUIT_IDENTITY_CODE,
sizeof(cic_sw), (uint8_t *) & cic_sw);
}
@@ -282,7 +281,7 @@ struct msgb *gsm0808_create_ass(const struct gsm0808_channel_type *ct,
/* AoIP: Call Identifier 3.2.2.105 */
if (ci) {
- ci_sw = htonl(*ci);
+ ci_sw = osmo_htonl(*ci);
msgb_tv_fixed_put(msg, GSM0808_IE_CALL_ID, sizeof(ci_sw),
(uint8_t *) & ci_sw);
}
@@ -433,7 +432,7 @@ struct msgb *gsm0808_create_paging(const char *imsi, const uint32_t *tmsi,
/* TMSI 3.2.2.7 */
if (tmsi) {
- tmsi_sw = htonl(*tmsi);
+ tmsi_sw = osmo_htonl(*tmsi);
msgb_tlv_put(msg, GSM0808_IE_TMSI, sizeof(*tmsi),
(uint8_t *) & tmsi_sw);
}