Commit Graph

16 Commits

Author SHA1 Message Date
Harald Welte 743deba334 sccp: Introduce initial support for SCCP LUDT + LUDTS messages
* LUDT/LUDTS is now properly received and passed along to the app.
* LUDT/LUDTS is now used if the data to transmit spans more than 255
  bytes.

Related: SYS#6566
Change-Id: Ic91abfc921f5e4f36045bfa325333112cddd9fa6
2023-09-21 16:35:40 +02:00
Pau Espin 945b252a48 sccp2sua: Produce smaller output if msg contains no optional section
Change-Id: I5c8fcb30b76ac7bafd4a99bc3004049644e7e3f9
2023-09-21 10:32:10 +02:00
Oliver Smith ef0d676741 tests: fix old-style function definition
Fix for:
  xua_test.c:575:6: error: old-style function definition [-Werror=old-style-definition]

Change-Id: Iccc942f9f25fb091045d906eb8be658b54c58529
2022-11-11 10:13:24 +01:00
Pau Espin d7ecf7a150 tests: Replace deprecated API log_set_print_filename
Change-Id: Id09f903fc5008d074763441a26d71c4fbaf394d8
2021-02-19 13:10:35 +01:00
Pau Espin 5cac145d2c tests: Explicitly drop category from log
Let's disable category here since we don't care about its formatting here.

In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.

Change-Id: I899e63ab2702bf25514f6585fb45f5bbf60a9ac9
Related: OS#5034
2021-02-19 13:06:02 +01:00
Oliver Smith 20642478f3 xua_test: fix gcc 4 + -std=gnu11 error
Fix 'error: initializer element is not constant' with debian 8's gcc
4.9.2, triggered by XUA_HDR. Create a new _XUA_HDR without the type cast,
and use it inside of const struct definitions in xua_test.c. The new
macro is needed, because removing the type cast from the original
XUA_HDR would break other uses.

Related: OS#5004
Change-Id: I890432ee976043d012b01023f7dd2cfecf79d115
2021-02-02 16:22:01 +01:00
Neels Hofmeyr 21ff9ae426 add osmo_sccp_addr_cmp(), osmo_sccp_addr_ri_cmp()
osmo-msc identifies its BSC and RNC peers by SCCP address, and compares those
by memcmp(), which is not really accurate. Rather provide a meaningful
osmo_sccp_addr_cmp() API to determine whether SCCP addresses are identical.

Go for a full cmp that would also allow sorting.

Change-Id: Ie9e2add7bbfae651c04e230d62e37cebeb91b0f5
2019-04-12 06:28:34 +02:00
Pau Espin 1ba800e36c tests: xua_test: Fix array len computation
As warned by gcc 8.1.0:
In file included from libosmo-sccp/include/osmocom/sigtran/osmo_ss7.h:7,
                 from libosmo-sccp/include/../src/xua_internal.h:3,
                 from libosmo-sccp/tests/xua/xua_test.c:21:
/include/osmocom/core/utils.h:13:34: error: division ‘sizeof (const uint8_t (*)[12] {aka const unsigned char (*)[12]}) / sizeof (const uint8_t[12] {aka const unsigned char[12]})’ does not compute the number of array elements [-Werror=sizeof-pointer-div]
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
                                  ^
libosmo-sccp/tests/xua/xua_test.c:371:45: note: in expansion of macro ‘ARRAY_SIZE’
 #define PARTARR(x, data) { .tag = x, .len = ARRAY_SIZE(data), .dat = (uint8_t *) data }

Change-Id: Iad5703d68fee26fc83958741512820d2539e604e
2018-05-16 14:47:42 +02:00
Pau Espin 920b22c473 tests: xua_test: Fix use of wrong buffer for dest addr
All the others parts use that buffer as its name indicates.

Change-Id: Ide7fe148cc762153330b08f66737816ceed96cb2
2018-05-16 14:47:42 +02:00
Neels Hofmeyr 73a7435d28 xua_test: sanitize: fix msgb leak
Change-Id: Ie57e803bb6361f39042084a21cada754a6506606
2017-11-18 10:19:04 +00:00
Harald Welte db736f432a implement unit tests for osmo_sccp_addr_{parse,encode}()
The recent bug with chopped-off point codes in SCCP Address handling
has shown that this code could need proper test cases.  This patch
adds a testsuite for SCCP address encoding and decoding.

Related: OS#2441
Change-Id: I612352736ab33462ca0dd97798a2c437eadccb86
2017-10-27 18:00:12 +02:00
Neels Hofmeyr 6df7a4a6ee fix compiler warning: xua_test: hexdump pointer type
Was recently introduced by a70b4599f6.

Change-Id: Iab5529f6919fd22902a8b39e8a52079f08deb851
2017-06-29 17:52:08 +00:00
Neels Hofmeyr a70b4599f6 fix sanitize make check: xua_test: initialize gt_out.
The sanitize build fails because gt_out is not initialized to zero, but is
later mem-compared to a zero-initialized struct.

Zero-initialize gt_out.

Also print in the test output both byte dumps. It helped to figure out the test
failure and might as well stay.

Change-Id: Ice8ee9c2a6bde4924f3ae6d95aa9268ebef9f070
2017-06-23 03:21:24 +02:00
Pau Espin 19c5c07525 xua_test.c: remove useless keyword in struct declaration
Fixes following warning:
warning: useless storage class specifier in empty declaratio

Change-Id: I5cea7b6ec2cc755ad8cec69b771f6e3b297e607d
2017-06-22 06:23:04 +00:00
Harald Welte 1e25c3a0ac xua_msg: Add xua_from_nested() helper function for nested IEs
... and add a test case to ensure it continues to work.

Change-Id: Iee434886598b528d23ddce0490dcc782e0f5d6ae
2017-04-10 11:48:35 +02:00
Harald Welte 192cf0c2ac Add tests for xUA code + SCCP/SUA transcoding
Change-Id: I7ce038d72dca18fb83d5a12519c9a48267e52ab8
2017-04-10 11:48:34 +02:00