aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-01-08 14:43:53 +0100
committerHarald Welte <laforge@gnumonks.org>2018-01-19 15:11:00 +0000
commit25c65c3d1f39f55340180273201cf91a1d10d741 (patch)
tree43615c9ca564f469e313487339259ee9cb3cb18d /tests
parent6789c84457eb278f4ad144f90c29fd7420899e60 (diff)
Use gsm48_encode_ra() for RAI encoding
It has stricter type signature which increase the chance of spotting misuse either via compiler warning or with automated scan. This also paves the way for gsm48_construct_ra() deprecation in libosmocore. Change-Id: I2c0f082dc7214ed57a40dad0788e34b838dfac97 Related: OS#1640
Diffstat (limited to 'tests')
-rw-r--r--tests/gbproxy/gbproxy_test.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c
index 3ebdccba..080c96bb 100644
--- a/tests/gbproxy/gbproxy_test.c
+++ b/tests/gbproxy/gbproxy_test.c
@@ -222,9 +222,9 @@ static int dump_peers(FILE *stream, int indent, time_t now,
const uint8_t *convert_ra(struct gprs_ra_id *raid)
{
- static uint8_t buf[6];
- gsm48_construct_ra(buf, raid);
- return buf;
+ static struct gsm48_ra_id r;
+ gsm48_encode_ra(&r, raid);
+ return (const uint8_t *)&r;
}
/* DTAP - Attach Request */
@@ -582,7 +582,7 @@ static void send_bssgp_ul_unitdata(
OSMO_ASSERT(bssgp_msg_size <= sizeof(msg));
- gsm48_construct_ra(msg + 10, raid);
+ gsm48_encode_ra((struct gsm48_ra_id *)(msg + 10), raid);
msg[1] = (uint8_t)(tlli >> 24);
msg[2] = (uint8_t)(tlli >> 16);
msg[3] = (uint8_t)(tlli >> 8);
@@ -713,7 +713,7 @@ static void send_bssgp_suspend(struct gprs_ns_inst *nsi,
msg[5] = (uint8_t)(tlli >> 8);
msg[6] = (uint8_t)(tlli >> 0);
- gsm48_construct_ra(msg + 9, raid);
+ gsm48_encode_ra((struct gsm48_ra_id *)(msg + 9), raid);
send_ns_unitdata(nsi, "BVC_SUSPEND", src_addr, 0, msg, sizeof(msg));
}
@@ -735,7 +735,7 @@ static void send_bssgp_suspend_ack(struct gprs_ns_inst *nsi,
msg[5] = (uint8_t)(tlli >> 8);
msg[6] = (uint8_t)(tlli >> 0);
- gsm48_construct_ra(msg + 9, raid);
+ gsm48_encode_ra((struct gsm48_ra_id *)(msg + 9), raid);
send_ns_unitdata(nsi, "BVC_SUSPEND_ACK", src_addr, 0, msg, sizeof(msg));
}
@@ -795,7 +795,7 @@ static void send_bssgp_paging(struct gprs_ns_inst *nsi,
if (raid) {
msg[bssgp_msg_size] = BSSGP_IE_ROUTEING_AREA;
msg[bssgp_msg_size+1] = 0x86;
- gsm48_construct_ra(msg + bssgp_msg_size + 2, raid);
+ gsm48_encode_ra((struct gsm48_ra_id *)(msg + bssgp_msg_size + 2), raid);
bssgp_msg_size += 8;
}