From e29ec85375f004e63c650e69a9fe5910b15a00eb Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 5 Jan 2018 14:30:22 +0100 Subject: Use existing function for TLLI encoding Use bssgp_msgb_tlli_put() instead of copy-pasted code. Change-Id: I06d60566a19dcae701f8648c19fbd8db6d586f77 --- tests/gb/gprs_bssgp_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') 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); -- cgit v1.2.3