aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/hnb-test-rua.c
blob: 69c41eb896c2c181e8d09a33ffcd7c4a23ee3cc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <asn1c/ANY.h>
#include "../rua_ies_defs.h"

#include "hnb-test-layers.h"

void hnb_test_rua_dt_handle(struct hnb_test *hnb, ANY_t *in)
{
	RUA_DirectTransferIEs_t ies;
	int rc;

	rc = rua_decode_directtransferies(&ies, in);
	if (rc < 0) {
		printf("failed to decode RUA DT IEs\n");
		return;
	}

	rc = ranap_cn_rx_co(hnb_test_rua_dt_handle_ranap, hnb, ies.ranaP_Message.buf, ies.ranaP_Message.size);

	/* FIXME: what to do with the asn1c-allocated memory */
	rua_free_directtransferies(&ies);
}

void hnb_test_rua_cl_handle(struct hnb_test *hnb, ANY_t *in)
{
	RUA_ConnectionlessTransferIEs_t ies;
	int rc;

	rc = rua_decode_connectionlesstransferies(&ies, in);
	if (rc < 0) {
		printf("failed to decode RUA CL IEs\n");
		return;
	}

	rc = ranap_cn_rx_cl(hnb_test_rua_cl_handle_ranap, hnb, ies.ranaP_Message.buf, ies.ranaP_Message.size);

	/* FIXME: what to do with the asn1c-allocated memory */
	rua_free_connectionlesstransferies(&ies);
}