oml: encode IPv6 NSVC using the new OML attribute NM_ATT_OSMO_NS_LINK_CFG
The old IE NM_ATT_IPACC_NS_LINK_CFG didn't support IPv6 NSVC.
Depends: Ic261bc43a07fa741b97a9c6ec5a9ed6f5ecae588 (libosmocore)
Depends: I9e279bb20940c66eea5196f281184cb4f8a5cc5f (libosmocore)
Change-Id: I6529876a3c1116a79dd624312243d8ae48a41fe2
diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c
index ea98409..da220c1 100644
--- a/tests/nanobts_omlattr/nanobts_omlattr_test.c
+++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c
@@ -27,6 +27,7 @@
#include <osmocom/core/talloc.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/application.h>
+#include <osmocom/core/sockaddr_str.h>
#include <stdio.h>
#include <string.h>
@@ -263,9 +264,10 @@
};
/* Parameters needed to test nanobts_attr_nscv_get() */
+ struct osmo_sockaddr_str addr;
+ osmo_sockaddr_str_from_str(&addr, "10.9.1.101", 23000);
+ osmo_sockaddr_str_to_sockaddr(&addr, &bts->gprs.nsvc[0].remote.u.sas);
bts->gprs.nsvc[0].nsvci = 0x65;
- bts->gprs.nsvc[0].remote_port = 0x59d8;
- bts->gprs.nsvc[0].remote_ip = 0x0a090165;
bts->gprs.nsvc[0].local_port = 0x5a3c;
uint8_t attr_nscv_expected[] =
{ 0x9f, 0x00, 0x02, 0x00, 0x65, 0xa2, 0x00, 0x08, 0x59, 0xd8, 0x0a,
@@ -286,6 +288,24 @@
test_nanobts_attr_nscv_get(bts, attr_nscv_expected);
test_nanobts_attr_radio_get(bts, trx, attr_radio_expected);
+ /* NSVC IPv6 test */
+ struct osmo_sockaddr_str addr6;
+ osmo_sockaddr_str_from_str(&addr6, "fd00:5678:9012:3456:7890:1234:5678:9012", 23010);
+ osmo_sockaddr_str_to_sockaddr(&addr6, &bts->gprs.nsvc[0].remote.u.sas);
+ bts->gprs.nsvc[0].nsvci = 0x65;
+ bts->gprs.nsvc[0].local_port = 0x5a3c;
+ uint8_t attr_nscv6_expected[] =
+ /* |- oml attr |-16bit length */
+ { 0x9f, 0x00, 0x02, 0x00, 0x65, 0xfd, 0x00, 0x16,
+ /* 1b type, 1b padding, 2b local port, 2b remote port */
+ 0x29, 0x00, 0x5a, 0x3c, 0x59, 0xe2,
+ /* 128bit / 16b ipv6 address */
+ 0xfd, 0x00, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56,
+ 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12,
+ };
+ test_nanobts_attr_nscv_get(bts, attr_nscv6_expected);
+
+
printf("Done\n");
talloc_free(bts);
talloc_free(net);
diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.ok b/tests/nanobts_omlattr/nanobts_omlattr_test.ok
index ef46cf9..abdb95e 100644
--- a/tests/nanobts_omlattr/nanobts_omlattr_test.ok
+++ b/tests/nanobts_omlattr/nanobts_omlattr_test.ok
@@ -23,4 +23,9 @@
expected=2d0b0500020362
ok.
+Testing nanobts_attr_nscv_get()...
+result= 9f00020065fd001629005a3c59e2fd005678901234567890123456789012
+expected=9f00020065fd001629005a3c59e2fd005678901234567890123456789012
+ok.
+
Done