summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-01-05 14:30:22 +0100
committerMax <msuraev@sysmocom.de>2018-01-08 14:07:47 +0100
commite29ec85375f004e63c650e69a9fe5910b15a00eb (patch)
treea5d2485f29fa92fe5db21413594bbd07be413a1e /tests
parentf1ad60e4d861d5ff462a8d7ab481ad082360f346 (diff)
Use existing function for TLLI encoding
Use bssgp_msgb_tlli_put() instead of copy-pasted code. Change-Id: I06d60566a19dcae701f8648c19fbd8db6d586f77
Diffstat (limited to 'tests')
-rw-r--r--tests/gb/gprs_bssgp_test.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/gb/gprs_bssgp_test.c b/tests/gb/gprs_bssgp_test.c
index 1624a31e..c38e1801 100644
--- a/tests/gb/gprs_bssgp_test.c
+++ b/tests/gb/gprs_bssgp_test.c
@@ -98,11 +98,11 @@ static void msgb_bssgp_send_and_free(struct msgb *msg)
static void send_bssgp_supend(enum bssgp_pdu_type pdu_type, uint32_t tlli)
{
struct msgb *msg = bssgp_msgb_alloc();
- uint32_t tlli_be = htonl(tlli);
uint8_t rai[] = {0x0f, 0xf1, 0x80, 0x20, 0x37, 0x00};
msgb_v_put(msg, pdu_type);
- msgb_tvlv_put(msg, BSSGP_IE_TLLI, sizeof(tlli_be), (uint8_t *)&tlli_be);
+
+ bssgp_msgb_tlli_put(msg, tlli);
msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, sizeof(rai), &rai[0]);
msgb_bssgp_send_and_free(msg);
@@ -111,12 +111,12 @@ static void send_bssgp_supend(enum bssgp_pdu_type pdu_type, uint32_t tlli)
static void send_bssgp_resume(enum bssgp_pdu_type pdu_type, uint32_t tlli)
{
struct msgb *msg = bssgp_msgb_alloc();
- uint32_t tlli_be = htonl(tlli);
uint8_t rai[] = {0x0f, 0xf1, 0x80, 0x20, 0x37, 0x00};
uint8_t suspend_ref = 1;
msgb_v_put(msg, pdu_type);
- msgb_tvlv_put(msg, BSSGP_IE_TLLI, sizeof(tlli_be), (uint8_t *)&tlli_be);
+
+ bssgp_msgb_tlli_put(msg, tlli);
msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, sizeof(rai), &rai[0]);
msgb_tvlv_put(msg, BSSGP_IE_SUSPEND_REF_NR, 1, &suspend_ref);