Build failure of network:osmocom:nightly/osmo-pcap in xUbuntu_18.10/i586

2020-05-01 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcap/xUbuntu_18.10/i586

Package network:osmocom:nightly/osmo-pcap failed to build in xUbuntu_18.10/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-pcap

Last lines of build log:
[   14s] dpkg: libgcc1:i386: dependency problems, but configuring anyway as you 
requested:
[   14s]  libgcc1:i386 depends on libc6 (>= 2.2.4); however:
[   14s]   Package libc6 is not installed.
[   14s] [15/213] installing libc6-2.28-0ubuntu1
[   16s] [16/213] installing cpio-2.12+dfsg-6
[   16s] update-alternatives: using /bin/mt-gnu to provide /bin/mt (mt) in auto 
mode
[   16s] [17/213] installing debianutils-4.8.6
[   16s] [18/213] installing diffutils-1:3.6-1
[   16s] [19/213] installing gettext-base-0.19.8.1-8
[   16s] [20/213] installing hostname-3.20
[   16s] [21/213] installing libattr1-1:2.4.47-2build1
[   16s] [22/213] installing libbsd0-0.9.1-1
[   16s] [23/213] installing libbz2-1.0-1.0.6-9
[   16s] [24/213] installing libc-bin-2.28-0ubuntu1
[   16s] [25/213] installing libc-dev-bin-2.28-0ubuntu1
[   16s] dpkg-deb (subprocess): decompressing archive member: lzma error: 
compressed data is corrupt
[   16s] dpkg-deb: error:  subprocess returned error exit status 2
[   16s] dpkg: error processing archive .init_b_cache/libc-dev-bin.deb 
(--install):
[   16s]  cannot copy extracted data for './usr/bin/mtrace' to 
'/usr/bin/mtrace.dpkg-new': unexpected end of file or stream
[   16s] Errors were encountered while processing:
[   16s]  .init_b_cache/libc-dev-bin.deb
[   16s] exit ...
[   16s] ### VM INTERACTION START ###
[   19s] [   12.266494] sysrq: SysRq : Power Off
[   19s] [   12.277357] reboot: Power down
[   19s] ### VM INTERACTION END ###
[   19s] 
[   19s] sheep86 failed "build osmo-pcap_0.1.2.dsc" at Sat May  2 02:12:00 UTC 
2020.
[   19s] 

-- 
Configure notifications at https://build.opensuse.org/my/subscriptions
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/libosmocore in Debian_9.0/armv7l

2020-05-01 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_9.0/armv7l

Package network:osmocom:nightly/libosmocore failed to build in Debian_9.0/armv7l

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmocore

Last lines of build log:
[  944s] |   CONFIG_LINKS= 
[  944s] |   CONFIG_COMMANDS = 
[  944s] |   $ ./config.status Doxyfile.core
[  944s] | 
[  944s] | on obs-arm-6
[  944s] | 
[  944s] | config.status:1341: creating Doxyfile.core
[  944s] 
[  944s] # -*- compilation -*-
[  944s] 59. testsuite.at:372: testing exec ...
[  944s] ./testsuite.at:376: $abs_top_builddir/tests/exec/exec_test
[  944s] --- experr 2020-05-02 01:47:53.79500 +
[  944s] +++ /usr/src/packages/BUILD/tests/testsuite.dir/at-groups/59/stderr
2020-05-02 01:47:53.79500 +
[  944s] @@ -1 +0,0 @@
[  944s] -MAHLZEIT=spaet
[  944s] 59. testsuite.at:372: 59. exec (testsuite.at:372): FAILED 
(testsuite.at:376)
[  944s] debian/rules:26: recipe for target 'override_dh_auto_test' failed
[  944s] make[1]: *** [override_dh_auto_test] Error 1
[  944s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  944s] debian/rules:15: recipe for target 'build' failed
[  944s] make: *** [build] Error 2
[  944s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  944s] ### VM INTERACTION START ###
[  947s] [  923.461487] sysrq: SysRq : Power Off
[  947s] [  923.466927] reboot: Power down
[  947s] ### VM INTERACTION END ###
[  947s] 
[  947s] obs-arm-6 failed "build libosmocore_1.3.0.72.d87d.dsc" at Sat May  2 
01:47:59 UTC 2020.
[  947s] 

-- 
Configure notifications at https://build.opensuse.org/my/subscriptions
openSUSE Build Service (https://build.opensuse.org/)


Change in osmo-ttcn3-hacks[master]: WIP: EGPRS

2020-05-01 Thread pespin
pespin has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16677 )

Change subject: WIP: EGPRS
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/16677
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3b36d20b5350c8011fd5b4cd2bb2eadd08b74823
Gerrit-Change-Number: 16677
Gerrit-PatchSet: 4
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: abandon


Change in libosmocore[master]: configure.ac: Fix HAVE_CLOCK_GETTIME undef when func in -lrt

2020-05-01 Thread tnt
tnt has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/17993 )

Change subject: configure.ac: Fix HAVE_CLOCK_GETTIME undef when func in -lrt
..


Patch Set 1: Code-Review+1

LGTM and works on both soekris and my laptop


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/17993
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Iced1e0542cee6beb9f08f5299aad49fab142cfb4
Gerrit-Change-Number: 17993
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: tnt 
Gerrit-Comment-Date: Fri, 01 May 2020 15:33:11 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: configure.ac: Fix HAVE_CLOCK_GETTIME undef when func in -lrt

2020-05-01 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/17993 )


Change subject: configure.ac: Fix HAVE_CLOCK_GETTIME undef when func in -lrt
..

configure.ac: Fix HAVE_CLOCK_GETTIME undef when func in -lrt

AC_SEARCH_LIBS was finding the function correctly, but later on
AC_CHECK_FUNCS was not including the found LIBRARY_RT so the function
was not found, and hence HAVE_CLOCK_GETTIME ended up undefined (which in
turns disables support for osmo_clock_gettime() API).
This happened in systems like the soekris where the clock_gettime sybmol
is available in external lib -lrt.

Let's avoid double-checking for the function twice, and simply define
HAVE_CLOCK_GETTIME when AC_SEARCH_LIBS succeeds (the success action is
guaranteed to be called even if there's no extra lib required).

Change-Id: Iced1e0542cee6beb9f08f5299aad49fab142cfb4
---
M configure.ac
1 file changed, 4 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/93/17993/1

diff --git a/configure.ac b/configure.ac
index 352648b..cba0a41 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,7 +77,9 @@
 AX_PTHREAD

 # check for old glibc < 2.17 to get clock_gettime
-AC_SEARCH_LIBS([clock_gettime], [rt posix4], [LIBRARY_RT="$LIBS";LIBS=""])
+AC_SEARCH_LIBS([clock_gettime], [rt posix4],
+  [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if clock_gettime is 
available])
+   LIBRARY_RT="$LIBS";LIBS="";])
 AC_SUBST(LIBRARY_RT)

 AC_ARG_ENABLE(doxygen,
@@ -103,7 +105,7 @@
 CFLAGS="$saved_CFLAGS"
 AC_SUBST(SYMBOL_VISIBILITY)

-AC_CHECK_FUNCS(clock_gettime localtime_r)
+AC_CHECK_FUNCS(localtime_r)

 AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [
   AC_CACHE_CHECK(

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/17993
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Iced1e0542cee6beb9f08f5299aad49fab142cfb4
Gerrit-Change-Number: 17993
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmo-ttcn3-hacks[master]: RLCMAC_EncDec.cc: Fix egprs data block encode alignment

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17992 )

Change subject: RLCMAC_EncDec.cc: Fix egprs data block encode alignment
..

RLCMAC_EncDec.cc: Fix egprs data block encode alignment

Selftests I'm using in the pcu testsuite to verify encoding are attached
too.

Change-Id: Id0e21248853eb5fac89e863822804cfbecf3c865
---
M library/RLCMAC_EncDec.cc
M library/RLCMAC_Templates.ttcn
M pcu/PCU_Tests.ttcn
M pcu/PCU_selftest.ttcn
4 files changed, 209 insertions(+), 14 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/library/RLCMAC_EncDec.cc b/library/RLCMAC_EncDec.cc
index 8f3ff2f..d25a7e0 100644
--- a/library/RLCMAC_EncDec.cc
+++ b/library/RLCMAC_EncDec.cc
@@ -2,6 +2,7 @@
 #include 

 #include "RLCMAC_Types.hh"
+#include "RLCMAC_Templates.hh"
 #include "GSM_Types.hh"
 /* Decoding of TS 44.060 GPRS RLC/MAC blocks, portions requiring manual 
functions
  * beyond what TITAN RAW coder can handle internally.
@@ -172,6 +173,22 @@
 #endif
 } __attribute__ ((packed));

+/*
+static const char hex_chars[] = "0123456789abcdef";
+void printbuffer(const char* ptr, TTCN_Buffer& buf) {
+   int len = buf.get_len();
+   const unsigned char* cbuf = buf.get_data();
+
+   fprintf(stderr, "printbuffer %s (len=%d): [", ptr, len);
+
+   for (int i = 0; i < len; i++) {
+   fprintf(stderr, " %c%c", hex_chars[cbuf[i] >> 4], 
hex_chars[cbuf[i] & 0xf]);
+   }
+
+   fprintf(stderr, " ]\n");
+}
+*/
+
 static CodingScheme::enum_type payload_len_2_coding_scheme(size_t payload_len) 
{
switch (payload_len) {
case 23:
@@ -294,7 +311,7 @@
hdr_bytes = offset_bits / 8;
extra_bits = offset_bits % 8;

-   fprintf(stderr, "RLMAC: clone: hdr_bytes=%u extra_bits=%u 
(length_bytes=%u)\n", hdr_bytes, extra_bits, length_bytes);
+   //fprintf(stderr, "RLMAC: clone: hdr_bytes=%u extra_bits=%u 
(length_bytes=%u)\n", hdr_bytes, extra_bits, length_bytes);

if (extra_bits == 0) {
/* It is aligned already */
@@ -324,9 +341,8 @@
size_t length_bytes = (initial_spare_bits + length_bits + 7) / 8;
size_t accepted_len = length_bytes;

-   fprintf(stderr, "RLMAC: trying to allocate %u bytes (orig is %zu bytes 
long with read pos %zu)\n", length_bytes, orig_ttcn_buffer.get_len(), 
orig_ttcn_buffer.get_pos());
+   //fprintf(stderr, "RLMAC: trying to allocate %u bytes (orig is %zu 
bytes long with read pos %zu)\n", length_bytes, orig_ttcn_buffer.get_len(), 
orig_ttcn_buffer.get_pos());
dst_ttcn_buffer.get_end(aligned_buf, accepted_len);
-   fprintf(stderr, "RLMAC: For dst ptr=%p with length=%zu\n", aligned_buf, 
accepted_len);
if (accepted_len < length_bytes) {
fprintf(stderr, "RLMAC: ERROR! asked for %zu bytes but got 
%zu\n", length_bytes, accepted_len);
}
@@ -337,14 +353,90 @@
orig_ttcn_buffer.get_data(),
aligned_buf);

-   fprintf(stderr, "RLMAC: clone_aligned_buffer_lsbf success\n");
-
/* clear spare bits and move block header bits to the right */
aligned_buf[0] = aligned_buf[0] >> initial_spare_bits;

dst_ttcn_buffer.increase_length(length_bytes);
 }

+/* bit-shift the entire 'src' of length 'length_bytes'
+ * and store the result to caller-allocated 'buffer'  by 'offset_bits'.  The 
shifting is
+ * done lsb-first. */
+static void clone_unaligned_buffer_lsbf(unsigned int offset_bits, unsigned int 
length_bytes,
+   const uint8_t *src, uint8_t *buffer)
+{
+   unsigned int hdr_bytes;
+   unsigned int extra_bits;
+   unsigned int i;
+
+   uint8_t c, last_hdr_c, last_c;
+   uint8_t *dst;
+
+   hdr_bytes = offset_bits / 8;
+   extra_bits = offset_bits % 8;
+
+   //fprintf(stderr, "RLMAC: clone: hdr_bytes=%u extra_bits=%u 
(length_bytes=%u)\n", hdr_bytes, extra_bits, length_bytes);
+
+   if (extra_bits == 0) {
+   /* It is aligned already */
+   memcpy(buffer, src + hdr_bytes, length_bytes);
+   return;
+   }
+
+   /* Copy first header+data byte, it's not handled correctly by loop */
+   dst = buffer + hdr_bytes;
+   last_hdr_c = *dst;
+   last_c = *dst << (8 - extra_bits);
+
+   for (i = 0; i < length_bytes; i++) {
+   c = src[i];
+   *(dst++) = (last_c >> (8 - extra_bits)) | (c << extra_bits);
+   last_c = c;
+   }
+   /* overwrite the lower extra_bits */
+   *dst = (*dst & (0xff << extra_bits)) | (last_c >> (8 - extra_bits));
+
+   /* Copy back first header+data byte */
+   dst = buffer + hdr_bytes;
+   *(dst++) = last_hdr_c | (src[0] << (8 - extra_bits));
+   *dst |= (src[0] >> (extra_bits)) & (0xff >> (8 - extra_bits));
+}
+
+/* put an (aligned) EGPRS data block with given bit-offset and
+ * bit-length into parent buffer

Change in osmo-ttcn3-hacks[master]: RLCMAC_EncDec.cc: Fix egprs data block encode alignment

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17992 )

Change subject: RLCMAC_EncDec.cc: Fix egprs data block encode alignment
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17992
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id0e21248853eb5fac89e863822804cfbecf3c865
Gerrit-Change-Number: 17992
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Fri, 01 May 2020 14:49:19 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-msc[master]: SMS-over-GSUP: notify sender in case of RPL delivery failure

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/17875 )

Change subject: SMS-over-GSUP: notify sender in case of RPL delivery failure
..

SMS-over-GSUP: notify sender in case of RPL delivery failure

Change-Id: I8436601c4314395e28829960dc753778c37b1125
---
M src/libmsc/gsm_04_11_gsup.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/libmsc/gsm_04_11_gsup.c b/src/libmsc/gsm_04_11_gsup.c
index 7c9b6fb..1f500d0 100644
--- a/src/libmsc/gsm_04_11_gsup.c
+++ b/src/libmsc/gsm_04_11_gsup.c
@@ -261,7 +261,7 @@
if (rc) {
LOGP(DLSMS, LOGL_NOTICE, "Failed to send MT SMS, "
"ignoring MT-forwardSM-Req message...\n");
-   /* TODO: notify sender about that? */
+   gsup_client_mux_tx_error_reply(net->gcm, gsup_msg, 
GMM_CAUSE_NET_FAIL);
return rc;
}


--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/17875
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I8436601c4314395e28829960dc753778c37b1125
Gerrit-Change-Number: 17875
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in osmo-ttcn3-hacks[master]: RLCMAC_EncDEc.cc: Use copied structure as other parts of the function

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17989 )

Change subject: RLCMAC_EncDEc.cc: Use copied structure as other parts of the 
function
..

RLCMAC_EncDEc.cc: Use copied structure as other parts of the function

Change-Id: Iffe45b3d220c0f95f1fdb54e1b90f0a0cef88ee3
---
M library/RLCMAC_EncDec.cc
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved



diff --git a/library/RLCMAC_EncDec.cc b/library/RLCMAC_EncDec.cc
index 88138c6..f5564d8 100644
--- a/library/RLCMAC_EncDec.cc
+++ b/library/RLCMAC_EncDec.cc
@@ -1078,13 +1078,13 @@

switch (in.mac__hdr().header__type()) {
case EgprsHeaderType::RLCMAC__HDR__TYPE__1:
-   enc__RlcmacUlEgprsDataHeader_type1(si.mac__hdr(), ttcn_buffer);
+   enc__RlcmacUlEgprsDataHeader_type1(in.mac__hdr(), ttcn_buffer);
break;
case EgprsHeaderType::RLCMAC__HDR__TYPE__2:
-   enc__RlcmacUlEgprsDataHeader_type2(si.mac__hdr(), ttcn_buffer);
+   enc__RlcmacUlEgprsDataHeader_type2(in.mac__hdr(), ttcn_buffer);
break;
case EgprsHeaderType::RLCMAC__HDR__TYPE__3:
-   enc__RlcmacUlEgprsDataHeader_type3(si.mac__hdr(), ttcn_buffer);
+   enc__RlcmacUlEgprsDataHeader_type3(in.mac__hdr(), ttcn_buffer);
default:
break; /* TODO: error */
}

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17989
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iffe45b3d220c0f95f1fdb54e1b90f0a0cef88ee3
Gerrit-Change-Number: 17989
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in osmo-ttcn3-hacks[master]: RLCMAC_EncDEc.cc: dec_RlcmacUl(Egprs)DataBlock: fix tlli and pfi unin...

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17986 )

Change subject: RLCMAC_EncDEc.cc: dec_RlcmacUl(Egprs)DataBlock: fix tlli and 
pfi uninitialized instead of omit
..

RLCMAC_EncDEc.cc: dec_RlcmacUl(Egprs)DataBlock: fix tlli and pfi uninitialized 
instead of omit

Change-Id: Id63ae66cd715512f12eb87fd9ff0a9f5af93d5d2
---
M library/RLCMAC_EncDec.cc
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved



diff --git a/library/RLCMAC_EncDec.cc b/library/RLCMAC_EncDec.cc
index f4735e9..d544e69 100644
--- a/library/RLCMAC_EncDec.cc
+++ b/library/RLCMAC_EncDec.cc
@@ -606,10 +606,14 @@
if (ret_val.mac__hdr().tlli__ind()) {
ret_val.tlli() = OCTETSTRING(4, ttcn_buffer.get_read_data());
ttcn_buffer.increase_pos(4);
+   } else {
+   ret_val.tlli() = OMIT_VALUE;
}
/* parse optional PFI */
if (ret_val.mac__hdr().pfi__ind()) {
ret_val.pfi().decode(RlcmacUlDataBlock_pfi_descr_, ttcn_buffer, 
TTCN_EncDec::CT_RAW);
+   } else {
+   ret_val.pfi() = OMIT_VALUE;
}

/* RLC blocks at end */
@@ -734,10 +738,14 @@
if (ret_val.tlli__ind()) {
ret_val.tlli() = OCTETSTRING(4, aligned_buffer.get_read_data());
aligned_buffer.increase_pos(4);
+   } else {
+   ret_val.tlli() = OMIT_VALUE;
}
/* parse optional PFI */
if (ret_val.mac__hdr().pfi__ind()) {
ret_val.pfi().decode(RlcmacUlDataBlock_pfi_descr_, 
aligned_buffer, TTCN_EncDec::CT_RAW);
+   } else {
+   ret_val.pfi() = OMIT_VALUE;
}

/* RLC blocks at end */

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17986
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id63ae66cd715512f12eb87fd9ff0a9f5af93d5d2
Gerrit-Change-Number: 17986
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in osmo-ttcn3-hacks[master]: cosmetic: RLCMAC_EncDEc.cc: fix typos in comments

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17985 )

Change subject: cosmetic: RLCMAC_EncDEc.cc: fix typos in comments
..

cosmetic: RLCMAC_EncDEc.cc: fix typos in comments

Change-Id: Id91ed01759c3e1e2b52f1e35b1f4198fbc052408
---
M library/RLCMAC_EncDec.cc
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved



diff --git a/library/RLCMAC_EncDec.cc b/library/RLCMAC_EncDec.cc
index 777815f..f4735e9 100644
--- a/library/RLCMAC_EncDec.cc
+++ b/library/RLCMAC_EncDec.cc
@@ -279,7 +279,7 @@
 }

 /* bit-shift the entire 'src' of length 'length_bytes' by 'offset_bits'
- * and store the reuslt to caller-allocated 'buffer'.  The shifting is
+ * and store the result to caller-allocated 'buffer'.  The shifting is
  * done lsb-first. */
 static void clone_aligned_buffer_lsbf(unsigned int offset_bits, unsigned int 
length_bytes,
const uint8_t *src, uint8_t *buffer)
@@ -938,7 +938,7 @@
int i;

if (!in.blocks().is_bound()) {
-   /* we don't have nay blocks: Add length value (zero) */
+   /* we don't have any blocks: Add length value (zero) */
in.mac__hdr().e() = false; /* E=0: extension octet follows */
} else if (in.blocks().size_of() == 1 && in.blocks()[0].hdr() == 
OMIT_VALUE) {
/* If there's only a single block, and that block has no HDR 
value defined, */

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17985
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id91ed01759c3e1e2b52f1e35b1f4198fbc052408
Gerrit-Change-Number: 17985
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in osmo-msc[master]: SMS-over-GSUP: notify sender in case of RPL delivery failure

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/17875 )

Change subject: SMS-over-GSUP: notify sender in case of RPL delivery failure
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/17875
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I8436601c4314395e28829960dc753778c37b1125
Gerrit-Change-Number: 17875
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Fri, 01 May 2020 14:40:12 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: RLCMAC_EncDEc.cc: Fix wrong descriptors passed to RAW encoder

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17987 )

Change subject: RLCMAC_EncDEc.cc: Fix wrong descriptors passed to RAW encoder
..

RLCMAC_EncDEc.cc: Fix wrong descriptors passed to RAW encoder

Change-Id: Ieb061d2914be086791e264a78ae14d3d55e10815
---
M library/RLCMAC_EncDec.cc
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved



diff --git a/library/RLCMAC_EncDec.cc b/library/RLCMAC_EncDec.cc
index d544e69..952e2e6 100644
--- a/library/RLCMAC_EncDec.cc
+++ b/library/RLCMAC_EncDec.cc
@@ -743,7 +743,7 @@
}
/* parse optional PFI */
if (ret_val.mac__hdr().pfi__ind()) {
-   ret_val.pfi().decode(RlcmacUlDataBlock_pfi_descr_, 
aligned_buffer, TTCN_EncDec::CT_RAW);
+   ret_val.pfi().decode(RlcmacUlEgprsDataBlock_pfi_descr_, 
aligned_buffer, TTCN_EncDec::CT_RAW);
} else {
ret_val.pfi() = OMIT_VALUE;
}
@@ -1130,7 +1130,7 @@
}

if (in.mac__hdr().pfi__ind()) {
-   in.pfi().encode(RlcmacUlDataBlock_pfi_descr_, ttcn_buffer, 
TTCN_EncDec::CT_RAW);
+   in.pfi().encode(RlcmacUlEgprsDataBlock_pfi_descr_, ttcn_buffer, 
TTCN_EncDec::CT_RAW);
}

if (in.blocks().is_bound()) {

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17987
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ieb061d2914be086791e264a78ae14d3d55e10815
Gerrit-Change-Number: 17987
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in osmo-ttcn3-hacks[master]: RLCMAC_EncDEc.cc: Support decoding Egprs Ul Data HeaderType2

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17990 )

Change subject: RLCMAC_EncDEc.cc: Support decoding Egprs Ul Data HeaderType2
..

RLCMAC_EncDEc.cc: Support decoding Egprs Ul Data HeaderType2

Change-Id: I4dfc994beb7d0ee5522770651150c77701c573fe
---
M library/RLCMAC_EncDec.cc
1 file changed, 21 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/library/RLCMAC_EncDec.cc b/library/RLCMAC_EncDec.cc
index f5564d8..8f3ff2f 100644
--- a/library/RLCMAC_EncDec.cc
+++ b/library/RLCMAC_EncDec.cc
@@ -673,10 +673,30 @@
 static
 EgprsUlMacDataHeader dec__EgprsUlMacDataHeader_type3(const OCTETSTRING& stream)
 {
+   TTCN_Buffer ttcn_buffer(stream);
EgprsUlMacDataHeader ret_val;
+   const struct gprs_rlc_ul_header_egprs_3 *egprs3;
+   uint8_t tmp;

-   fprintf(stderr, "FIXME: Not implemented! %s (%s:%u)\n", __func__, 
__FILE__, __LINE__);
+   egprs3 = static_cast
+   ((const void *)ttcn_buffer.get_data());

+   ret_val.header__type() = EgprsHeaderType::RLCMAC__HDR__TYPE__3;
+   ret_val.tfi() = egprs3->tfi_lo << 2 | egprs3->tfi_hi << 0;
+   ret_val.countdown() = egprs3->cv;
+   tmp = egprs3->si;
+   ret_val.foi__si() = BITSTRING(1, &tmp);
+   tmp = egprs3->r;
+   ret_val.r__ri() = BITSTRING(1, &tmp);
+   ret_val.bsn1() = egprs3->bsn1_lo << 5 | egprs3->bsn1_hi << 0;
+   ret_val.cps() = egprs3->cps_lo << 2 | egprs3->cps_hi << 0;
+   ret_val.pfi__ind() = egprs3->pi;
+   tmp = egprs3->rsb;
+   ret_val.rsb() = BITSTRING(1, &tmp);
+   tmp = egprs3->spb;
+   ret_val.spb() = BITSTRING(2, &tmp);
+
+   ttcn_buffer.increase_pos(sizeof(*egprs3));
return ret_val;
 }


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17990
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I4dfc994beb7d0ee5522770651150c77701c573fe
Gerrit-Change-Number: 17990
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in osmo-ttcn3-hacks[master]: RLCMAC_EncDEc.cc: Fix encoding of tfi and rsb fields in Egprs Ul Hdea...

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17988 )

Change subject: RLCMAC_EncDEc.cc: Fix encoding of tfi and rsb fields in Egprs 
Ul HdeaderType3
..

RLCMAC_EncDEc.cc: Fix encoding of tfi and rsb fields in Egprs Ul HdeaderType3

Change-Id: Id0f7cb29cf3a30aafdaaed2aca7d34277e3c975d
---
M library/RLCMAC_EncDec.cc
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved



diff --git a/library/RLCMAC_EncDec.cc b/library/RLCMAC_EncDec.cc
index 952e2e6..88138c6 100644
--- a/library/RLCMAC_EncDec.cc
+++ b/library/RLCMAC_EncDec.cc
@@ -1040,13 +1040,13 @@
egprs3.si = bs2uint8(si.foi__si());
egprs3.cv = si.countdown();
egprs3.tfi_hi = si.tfi() >> 0;
-   egprs3.tfi_lo = si.tfi() >> 1;
+   egprs3.tfi_lo = si.tfi() >> 2;
egprs3.bsn1_hi = si.bsn1() >> 0;
egprs3.bsn1_lo = si.bsn1() >> 5;
egprs3.cps_hi = si.cps() >> 0;
egprs3.cps_lo = si.cps() >> 2;
egprs3.spb = bs2uint8(si.spb());
-   egprs3.rsb = bs2uint8(si.spb());
+   egprs3.rsb = bs2uint8(si.rsb());
egprs3.pi = si.pfi__ind();
egprs3.spare = 0;
egprs3.dummy = 0;

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17988
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id0f7cb29cf3a30aafdaaed2aca7d34277e3c975d
Gerrit-Change-Number: 17988
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in osmo-ttcn3-hacks[master]: RLCMAC_Templates: Add functions to convert HeaderType<->MCS<->CPS

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17991 )

Change subject: RLCMAC_Templates: Add functions to convert 
HeaderType<->MCS<->CPS
..

RLCMAC_Templates: Add functions to convert HeaderType<->MCS<->CPS

They will be used by tests, templates and RLCMAC_EncDec.cc itself.

MCS HEader Type 1 and 2 to CPS conversion lefts as a TODO with
placeholder functions to easily implement when needed.

Change-Id: I18ff55a8067165bf081bf21473b4f88af955bf5b
---
M library/RLCMAC_Templates.ttcn
M library/RLCMAC_Types.ttcn
2 files changed, 177 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/library/RLCMAC_Templates.ttcn b/library/RLCMAC_Templates.ttcn
index 8fb6b0c..d2174d7 100644
--- a/library/RLCMAC_Templates.ttcn
+++ b/library/RLCMAC_Templates.ttcn
@@ -29,6 +29,22 @@
return 0;
}

+   function f_rlcmac_mcs2headertype(CodingScheme mcs) return 
EgprsHeaderType {
+   select (mcs) {
+   case (MCS_0) { return RLCMAC_HDR_TYPE_3; }
+   case (MCS_1) { return RLCMAC_HDR_TYPE_3; }
+   case (MCS_2) { return RLCMAC_HDR_TYPE_3; }
+   case (MCS_3) { return RLCMAC_HDR_TYPE_3; }
+   case (MCS_4) { return RLCMAC_HDR_TYPE_3; }
+   case (MCS_5) { return RLCMAC_HDR_TYPE_2; }
+   case (MCS_6) { return RLCMAC_HDR_TYPE_2; }
+   case (MCS_7) { return RLCMAC_HDR_TYPE_1; }
+   case (MCS_8) { return RLCMAC_HDR_TYPE_1; }
+   case (MCS_9) { return RLCMAC_HDR_TYPE_1; }
+   }
+   return RLCMAC_HDR_TYPE_3;
+   }
+
function f_rlcmac_cs_mcs2block_len(CodingScheme cs_mcs) return uint32_t 
{
select (cs_mcs) {
case (CS_1) { return 23; }
@@ -72,6 +88,166 @@
return CS_1;
}

+   /* Coding and Puncturing Scheme indicator field for Header type 1 in 
EGPRS TBF or EC TBF or downlink EGPRS2 TBF */
+   function f_rlcmac_cps_htype1_to_mcs(uint3_t cps) return CodingScheme {
+   var CodingSchemeArray 
egprs_Header_type1_coding_puncturing_scheme_to_mcs := {
+   MCS_9 /* 0x00, "(MCS-9/P1 ; MCS-9/P1)" */,
+   MCS_9 /* 0x01, "(MCS-9/P1 ; MCS-9/P2)" */,
+   MCS_9 /* 0x02, "(MCS-9/P1 ; MCS-9/P3)" */,
+   MCS_0 /* 0x03, "reserved" */,
+   MCS_9 /* 0x04, "(MCS-9/P2 ; MCS-9/P1)" */,
+   MCS_9 /* 0x05, "(MCS-9/P2 ; MCS-9/P2)" */,
+   MCS_9 /* 0x06, "(MCS-9/P2 ; MCS-9/P3)" */,
+   MCS_0 /* 0x07, "reserved" */,
+   MCS_9 /* 0x08, "(MCS-9/P3 ; MCS-9/P1)" */,
+   MCS_9 /* 0x09, "(MCS-9/P3 ; MCS-9/P2)" */,
+   MCS_9 /* 0x0A, "(MCS-9/P3 ; MCS-9/P3)" */,
+   MCS_8 /* 0x0B, "(MCS-8/P1 ; MCS-8/P1)" */,
+   MCS_8 /* 0x0C, "(MCS-8/P1 ; MCS-8/P2)" */,
+   MCS_8 /* 0x0D, "(MCS-8/P1 ; MCS-8/P3)" */,
+   MCS_8 /* 0x0E, "(MCS-8/P2 ; MCS-8/P1)" */,
+   MCS_8 /* 0x0F, "(MCS-8/P2 ; MCS-8/P2)" */,
+   MCS_8 /* 0x10, "(MCS-8/P2 ; MCS-8/P3)" */,
+   MCS_8 /* 0x11, "(MCS-8/P3 ; MCS-8/P1)" */,
+   MCS_8 /* 0x12, "(MCS-8/P3 ; MCS-8/P2)" */,
+   MCS_8 /* 0x13, "(MCS-8/P3 ; MCS-8/P3)" */,
+   MCS_7 /* 0x14, "(MCS-7/P1 ; MCS-7/P1)" */,
+   MCS_7 /* 0x15, "(MCS-7/P1 ; MCS-7/P2)" */,
+   MCS_7 /* 0x16, "(MCS-7/P1 ; MCS-7/P3)" */,
+   MCS_7 /* 0x17, "(MCS-7/P2 ; MCS-7/P1)" */,
+   MCS_7 /* 0x18, "(MCS-7/P2 ; MCS-7/P2)" */,
+   MCS_7 /* 0x19, "(MCS-7/P2 ; MCS-7/P3)" */,
+   MCS_7 /* 0x1A, "(MCS-7/P3 ; MCS-7/P1)" */,
+   MCS_7 /* 0x1B, "(MCS-7/P3 ; MCS-7/P2)" */,
+   MCS_7 /* 0x1C, "(MCS-7/P3 ; MCS-7/P3)" */,
+   MCS_0 /* 0x1D, "reserved" */,
+   MCS_0 /* 0x1E, "reserved" */,
+   MCS_0 /* 0x1F, "reserved" */
+   };
+   return egprs_Header_type1_coding_puncturing_scheme_to_mcs[cps];
+   }
+
+   /* Coding and Puncturing Scheme indicator field for Header type 2 in 
(EC-)EGPRS TBF or uplink EGPRS2-A TBF */
+   function f_rlcmac_cps_htype2_to_mcs(uint3_t cps) return CodingScheme {
+   var CodingSchemeArray 
egprs_Header_type2_coding_puncturing_scheme_to_mcs := {
+   MCS_6 /* {0x00, "MCS-6/P1"} */,
+   MCS_6 /* {0x01, "MCS-6/P2"} */,
+   MCS_6 /* {0x02, "MCS-6/P1 with 6 octet padding"} */,
+   MCS_6 /* {0x03, "MCS-6

Change in osmo-ttcn3-hacks[master]: RLCMAC_Templates: Add functions to convert HeaderType<->MCS<->CPS

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17991 )

Change subject: RLCMAC_Templates: Add functions to convert 
HeaderType<->MCS<->CPS
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17991
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I18ff55a8067165bf081bf21473b4f88af955bf5b
Gerrit-Change-Number: 17991
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Fri, 01 May 2020 14:39:18 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: RLCMAC_EncDEc.cc: Support decoding Egprs Ul Data HeaderType2

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17990 )

Change subject: RLCMAC_EncDEc.cc: Support decoding Egprs Ul Data HeaderType2
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17990
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I4dfc994beb7d0ee5522770651150c77701c573fe
Gerrit-Change-Number: 17990
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Fri, 01 May 2020 14:39:08 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: Split templates in RLCMAC_{CSN1_}Types into their own _Templates file

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17981 )

Change subject: Split templates in RLCMAC_{CSN1_}Types into their own 
_Templates file
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17981
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I9c6597178168aa3848b21930f33be698dd2ce545
Gerrit-Change-Number: 17981
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Fri, 01 May 2020 14:38:30 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-hlr[master]: test_nodes.vty: remove cruft

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16460 )

Change subject: test_nodes.vty: remove cruft
..

test_nodes.vty: remove cruft

This stuff is not testing osmo-hlr specific nodes, remove.

Change-Id: Ia11a209778b78ab02424e2abf3f9004fe97cf570
---
M tests/test_nodes.vty
1 file changed, 1 insertion(+), 64 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty
index 3f31b0d..c056e4d 100644
--- a/tests/test_nodes.vty
+++ b/tests/test_nodes.vty
@@ -11,81 +11,21 @@
   logpPrint a message on all log outputs; useful for placing markers 
in test logs
   subscriber  Subscriber management commands
 OsmoHLR> list
-  show version
-  show online-help
-  list
-  exit
-  help
-  enable
-  terminal length <0-512>
-  terminal no length
-  who
-  show history
-  logging enable
 ...
-  show logging vty
-  show alarms
-  show talloc-context (application|all) (full|brief|DEPTH)
-  show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS
-  show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP
-  show stats
-  show stats level (global|peer|subscriber)
-  show asciidoc counters
-  show rate-counters
   show gsup-connections
   subscriber (imsi|msisdn|id|imei) IDENT show
   show subscriber (imsi|msisdn|id|imei) IDENT

 OsmoHLR> enable
 OsmoHLR# ?
-  helpDescription of the interactive help system
-  listPrint command list
-  write   Write running configuration to memory, network, or terminal
-  showShow running system information
-  exitExit current mode and down to previous mode
-  disable Turn off privileged mode command
-  configure   Configuration from vty interface
-  copyCopy configuration
-  terminalSet terminal line parameters
-  who Display who is on vty
-  logging Configure logging
-  no  Negate a command or set its defaults
-  logpPrint a message on all log outputs; useful for placing markers 
in test logs
+...
   subscriber  Subscriber management commands
-OsmoHLR# list
-  help
-...
-  exit
-  disable
-  configure terminal
-  copy running-config startup-config
-  show startup-config
-  show version
-  show online-help
-  terminal length <0-512>
-  terminal no length
-  who
-  show history
-  terminal monitor
-  terminal no monitor
-  logging enable
-...

 OsmoHLR# configure terminal
 OsmoHLR(config)# ?
 ...
-  bannerSet banner string
-  service   Set up miscellaneous service
-  line  Configure a terminal line
-  ctrl  Configure the Control Interface
-  log   Configure logging sub-system
-  stats Configure stats sub-system
   hlr   Configure the HLR
 OsmoHLR(config)# list
-  help
-...
-  exit
-  end
 ...
   hlr

@@ -99,10 +39,7 @@
   store-imei   Save the IMEI in the database when receiving 
Check IMEI requests. Note that an MSC does not necessarily send Check IMEI 
requests (for OsmoMSC, you may want to set 'check-imei-rqd 1').
   subscriber-create-on-demand  Make a new record when a subscriber is first 
seen.
 OsmoHLR(config-hlr)# list
-  help
 ...
-  exit
-  end
   gsup
   database PATH
   euse NAME

--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16460
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: Ia11a209778b78ab02424e2abf3f9004fe97cf570
Gerrit-Change-Number: 16460
Gerrit-PatchSet: 11
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-hlr[master]: gsup_server: send routing error back to the correct peer

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16336 )

Change subject: gsup_server: send routing error back to the correct peer
..

gsup_server: send routing error back to the correct peer

If a peer attempts to add a route to an ipa-name that we already have in the
routing system, don't send the routing error to the peer that already has the
name, but to the peer that attempts to re-use it and would cause the collision.

This is fixing a situation where for example a locally attached MSC has name
'MSC-1', and a remote site is proxying GSUP here for a remote MSC that also has
the name 'MSC-1'. Send the routing error back to the proxy, not local 'MSC-1'.

Change-Id: Icafaedc11b5925149d338bdcb987ae985a7323d6
---
M src/gsup_server.c
1 file changed, 14 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/gsup_server.c b/src/gsup_server.c
index 15d2f83..a5d496e 100644
--- a/src/gsup_server.c
+++ b/src/gsup_server.c
@@ -65,19 +65,30 @@
 static void gsup_server_send_req_response(struct osmo_gsup_req *req, struct 
osmo_gsup_message *response)
 {
struct osmo_gsup_server *server = req->cb_data;
+   struct osmo_cni_peer_id *routing;
struct osmo_gsup_conn *conn = NULL;
struct msgb *msg = osmo_gsup_msgb_alloc("GSUP Tx");
int rc;

-   switch (req->source_name.type) {
+   if (response->message_type == OSMO_GSUP_MSGT_ROUTING_ERROR
+   && !osmo_cni_peer_id_is_empty(&req->via_proxy)) {
+   /* If a routing error occured, we need to route back via the 
immediate sending peer, not via the
+* intended final recipient -- because one source of routing 
errors is a duplicate name for a recipient.
+* If we resolve to req->source_name, we may send to a 
completely unrelated recipient. */
+   routing = &req->via_proxy;
+   } else {
+   routing = &req->source_name;
+   }
+   switch (routing->type) {
case OSMO_CNI_PEER_ID_IPA_NAME:
-   conn = gsup_route_find_by_ipa_name(server, 
&req->source_name.ipa_name);
+   conn = gsup_route_find_by_ipa_name(server, &routing->ipa_name);
break;
default:
LOG_GSUP_REQ(req, LOGL_ERROR, "GSUP peer id kind not supported: 
%s\n",
-osmo_cni_peer_id_type_name(req->source_name.type));
+osmo_cni_peer_id_type_name(routing->type));
break;
}
+
if (!conn) {
LOG_GSUP_REQ(req, LOGL_ERROR, "GSUP client that sent this 
request not found, cannot respond\n");
msgb_free(msg);

--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16336
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: Icafaedc11b5925149d338bdcb987ae985a7323d6
Gerrit-Change-Number: 16336
Gerrit-PatchSet: 17
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-hlr[master]: adoc: add D-GSM chapter to osmohlr-usermanual

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16211 )

Change subject: adoc: add D-GSM chapter to osmohlr-usermanual
..

adoc: add D-GSM chapter to osmohlr-usermanual

Change-Id: I392b5523870c2ef3267179160028d26f3f761b77
---
A doc/examples/osmo-hlr-dgsm.cfg
A doc/manuals/chapters/dgsm.adoc
M doc/manuals/osmohlr-usermanual.adoc
3 files changed, 515 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/doc/examples/osmo-hlr-dgsm.cfg b/doc/examples/osmo-hlr-dgsm.cfg
new file mode 100644
index 000..2774c24
--- /dev/null
+++ b/doc/examples/osmo-hlr-dgsm.cfg
@@ -0,0 +1,22 @@
+# OsmoHLR example configuration for Distributed GSM (mslookup)
+hlr
+ gsup
+  # For D-GSM roaming, osmo-hlr's GSUP must listen on a public IP:
+  bind ip 10.9.8.7
+  # Each HLR should identify with a distinct name
+  ipa-name hlr-23
+mslookup
+ # Bind mslookup mDNS server and client on default multicast address and port:
+ # 239.192.23.42 port 4266
+ mdns bind
+ # Tell the mslookup server in osmo-hlr which IP+ports to return when a
+ # remote voice call or SMS wants to deliver to a local subscriber:
+ server
+  # local osmo-sip-connector SIP port
+  service sip.voice at 10.9.8.7 5060
+  # local osmo-msc SMPP port
+  service smpp.sms at 10.9.8.7 2775
+  # experimental: SMS-over-GSUP: this HLR's GSUP port
+  service gsup.sms at 10.9.8.7 4222
+  # only required if different from above 'gsup'/'bind ip':
+  #service gsup.hlr at 10.9.8.7 4222
diff --git a/doc/manuals/chapters/dgsm.adoc b/doc/manuals/chapters/dgsm.adoc
new file mode 100644
index 000..e506f5a
--- /dev/null
+++ b/doc/manuals/chapters/dgsm.adoc
@@ -0,0 +1,491 @@
+== Distributed GSM / Multicast MS Lookup
+
+Distributed GSM (D-GSM) allows independent mobile core network stacks to 
provide voice, SMS and Roaming services to each
+other, without the need for centralised entities or administration authority, 
and in a way that is resilient against
+unstable network links between sites.
+
+D-GSM aims at communal networks, where several independent sites, let's call 
them villages, each have a full mobile core
+network infrastructure. It elegantly provides ad-hoc service for subscribers 
moving across villages, and allows villages
+to dynamically join or leave the cooperative network without the need for 
configuration changes at other sites.
+
+A challenge for linking separate sites is to find the current location of a 
subscriber. Typically, in mobile networks, a
+centralized entity keeps track of where to Page for subscribers. Running 
several fully independent sites with unreliable
+links between them makes it hard to provide such centralisation.
+
+D-GSM finds subscribers by mslookup, a service provided by OsmoHLR, typically 
using multicast DNS queries.  This allows
+routing Location Updating requests, calls, and SMS to the right site without 
administrative delay nor the need for a
+reliable link to a central database.
+
+D-GSM is highly resilient against single sites or links becoming temporarily 
unavailable. Service between still
+reachable sites simply continues; Service to a disconnected site resumes as 
soon as it becomes reachable again.
+
+This brings an entirely new paradigm to mobile core network infrastructure: as 
sites become reachable on the IP network
+and join the common IP multicast group, services between them become available 
immediately. Basically, the only premise
+is that IP routing and multicast works across sites, and that each site uses 
unique IPA names in the GSUP config.
+
+This chapter describes how D-GSM and mslookup work, and how to configure sites 
to use D-GSM, using Osmocom core network
+infrastructure.
+
+=== Finding Subscribers: mslookup Clients
+
+There are two fundamentally distinct subscriber lookups provided by the 
mslookup service.
+
+ Find the Current Location of an MSISDN
+
+[[fig_dgsm_connect]]
+.mslookup for connecting subscribers: Alice is visiting village C; a phone 
call gets routed directly to her current location independently from her 
resident village infrastructure
+[graphviz]
+
+digraph G {
+rankdir=LR
+
+subgraph cluster_village_b {
+   label="Village B"
+   ms_bob [label="Bob\n(from village B)",shape=box]
+   pbx_b [label="SIP B"]
+}
+
+subgraph cluster_village_c {
+   label="Village C"
+   ms_alice [label="Alice\n(from village A)",shape=box]
+   msc_c [label="MSC C"]
+   hlr_c [label="HLR C"]
+   sip_c [label="SIP C"]
+}
+
+ms_alice -> msc_c [style=dashed,arrowhead=none]
+msc_c -> hlr_c [label="attached",style=dashed,arrowhead=none]
+ms_bob -> pbx_b [label="call Alice"]
+pbx_b -> hlr_c [label="mslookup by MSISDN",style=dotted,dir=both]
+pbx_b -> sip_c -> msc_c -> ms_alice [label="call"]
+}
+
+
+For example, if a subscriber is currently visiting anothe

Change in osmo-hlr[master]: auc3g: officially wrap IND around IND_bitlen space

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16763 )

Change subject: auc3g: officially wrap IND around IND_bitlen space
..

auc3g: officially wrap IND around IND_bitlen space

To determine distinct IND pools for each connected VLR, we need to pick ever
increasing values for any new peer showing up. Each subscriber's individual
IND_bitlen is then required to modulo the least significant N of bits that fit
in its IND_bitlen to effectively round-robin in the available IND pool space.
So far we did that but issued a warning message. This is actually exactly what
we want and it doesn't need to be treated like it weren't so.

Change-Id: I716d8a8a249235c8093d7a6a78b3535d893d867e
---
M src/db_auc.c
1 file changed, 9 insertions(+), 8 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/src/db_auc.c b/src/db_auc.c
index ecb9f58..975eb2d 100644
--- a/src/db_auc.c
+++ b/src/db_auc.c
@@ -200,15 +200,16 @@
if (rc)
return rc;

+   /* modulo by the IND bitlen value range. For example, ind_bitlen == 5 
would modulo 32:
+* 1 << 5 == 0b010 == 32
+* - 1 == 0b001 == bitmask of 5 lowest bits
+* x &= 0b001 == modulo 32
+* Why do this? osmo-hlr cannot possibly choose individual VLR INDs 
always matching all subscribers' IND_bitlen,
+* which might vary wildly. Instead, let hlr.c pass in an arbitrarily 
high number here, and the modulo does a
+* round-robin if the IND pools that this subscriber has available. */
+   auc_3g_ind &= (1U << aud3g.u.umts.ind_bitlen) - 1;
aud3g.u.umts.ind = auc_3g_ind;
-   if (aud3g.type == OSMO_AUTH_TYPE_UMTS
-   && aud3g.u.umts.ind >= (1U << aud3g.u.umts.ind_bitlen)) {
-   LOGAUC(imsi, LOGL_NOTICE, "3G auth: SQN's IND bitlen %u is"
-  " too small to hold an index of %u. Truncating. This"
-  " may cause numerous additional AUTS resyncing.\n",
-  aud3g.u.umts.ind_bitlen, aud3g.u.umts.ind);
-   aud3g.u.umts.ind &= (1U << aud3g.u.umts.ind_bitlen) - 1;
-   }
+
/* the first bit (bit0) cannot be used as AMF anymore, but has been
 * re-appropriated as the separation bit.  See 3GPP TS 33.102 Annex H
 * together with 3GPP TS 33.401 / 33.402 / 33.501 */

--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16763
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I716d8a8a249235c8093d7a6a78b3535d893d867e
Gerrit-Change-Number: 16763
Gerrit-PatchSet: 13
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-hlr[master]: D-GSM 2/n: implement mDNS method of mslookup server

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16257 )

Change subject: D-GSM 2/n: implement mDNS method of mslookup server
..

D-GSM 2/n: implement mDNS method of mslookup server

Implement the mslookup server's mDNS responder, to actually service remote
mslookup requests:
- VTY mslookup/server config with service names,
- the mslookup_mdns_server listening for mslookup requests,

For a detailed overview of the D-GSM and mslookup related files, please see the
elaborate comment at the top of mslookup.c (already added in an earlier patch).

Change-Id: I5cae6459090588b4dd292be90a5e8903432669d2
---
M include/osmocom/hlr/Makefile.am
M include/osmocom/hlr/hlr.h
M include/osmocom/hlr/hlr_vty.h
M include/osmocom/hlr/mslookup_server.h
A include/osmocom/hlr/mslookup_server_mdns.h
M src/Makefile.am
A src/dgsm_vty.c
M src/hlr.c
A src/mslookup_server_mdns.c
M tests/test_nodes.vty
M tests/test_subscriber.vty
11 files changed, 605 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/include/osmocom/hlr/Makefile.am b/include/osmocom/hlr/Makefile.am
index 5c96ec8..b24f084 100644
--- a/include/osmocom/hlr/Makefile.am
+++ b/include/osmocom/hlr/Makefile.am
@@ -11,6 +11,7 @@
logging.h \
lu_fsm.h \
mslookup_server.h \
+   mslookup_server_mdns.h \
rand.h \
timestamp.h \
$(NULL)
diff --git a/include/osmocom/hlr/hlr.h b/include/osmocom/hlr/hlr.h
index 1269994..8f26704 100644
--- a/include/osmocom/hlr/hlr.h
+++ b/include/osmocom/hlr/hlr.h
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 

 #define HLR_DEFAULT_DB_FILE_PATH "hlr.db"

@@ -69,9 +70,20 @@
unsigned int subscr_create_on_demand_rand_msisdn_len;

struct {
+   bool allow_startup;
struct {
+   /* Whether the mslookup server should be active in 
general (all lookup methods) */
+   bool enable;
uint32_t local_attach_max_age;
struct llist_head local_site_services;
+   struct {
+   /* Whether the mDNS method of the mslookup 
server should be active. */
+   bool enable;
+   /* The mDNS bind address and domain suffix as 
set by the VTY, not necessarily in use. */
+   struct osmo_sockaddr_str bind_addr;
+   char *domain_suffix;
+   struct osmo_mslookup_server_mdns *running;
+   } mdns;
} server;
} mslookup;
 };
diff --git a/include/osmocom/hlr/hlr_vty.h b/include/osmocom/hlr/hlr_vty.h
index acd6510..0ba9821 100644
--- a/include/osmocom/hlr/hlr_vty.h
+++ b/include/osmocom/hlr/hlr_vty.h
@@ -31,8 +31,12 @@
HLR_NODE = _LAST_OSMOVTY_NODE + 1,
GSUP_NODE,
EUSE_NODE,
+   MSLOOKUP_NODE,
+   MSLOOKUP_SERVER_NODE,
+   MSLOOKUP_SERVER_MSC_NODE,
 };

 int hlr_vty_is_config_node(struct vty *vty, int node);
 int hlr_vty_go_parent(struct vty *vty);
 void hlr_vty_init(void);
+void dgsm_vty_init(void);
diff --git a/include/osmocom/hlr/mslookup_server.h 
b/include/osmocom/hlr/mslookup_server.h
index 5425328..440c451 100644
--- a/include/osmocom/hlr/mslookup_server.h
+++ b/include/osmocom/hlr/mslookup_server.h
@@ -19,6 +19,9 @@

 #pragma once

+#include 
+#include 
+
 struct osmo_mslookup_query;
 struct osmo_mslookup_result;

diff --git a/include/osmocom/hlr/mslookup_server_mdns.h 
b/include/osmocom/hlr/mslookup_server_mdns.h
new file mode 100644
index 000..ef16e88
--- /dev/null
+++ b/include/osmocom/hlr/mslookup_server_mdns.h
@@ -0,0 +1,36 @@
+/* Copyright 2019 by sysmocom s.f.m.c. GmbH 
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ *
+ */
+
+#pragma once
+
+#include 
+#include 
+#include 
+
+struct osmo_mslookup_server_mdns {
+   struct osmo_mslookup_server *mslookup;
+   struct osmo_sockaddr_str bind_addr;
+   char *domain_suffix;
+   struct osmo_mdns_sock *sock;
+};
+
+struct osmo_mslookup_server_mdns *osmo_mslookup_server_mdns_start(void *ctx, 
const struct osmo_sockaddr_str *bind_addr,
+  

Change in osmo-hlr[master]: db v5: prep for D-GSM: add vlr_via_proxy and sgsn_via_proxy

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16207 )

Change subject: db v5: prep for D-GSM: add vlr_via_proxy and sgsn_via_proxy
..

db v5: prep for D-GSM: add vlr_via_proxy and sgsn_via_proxy

D-GSM will store in the HLR DB whether a locally connected MSC has attached the
subscriber (last_lu_seen[_ps]), or whether the attach happened via a GSUP proxy
from a different site.

Add columns for this separately in this patch.

Change-Id: I98c7b3870559ede84adf56e4bf111f53c7487745
---
M include/osmocom/hlr/db.h
M sql/hlr.sql
M src/db.c
M src/db_hlr.c
M tests/db_upgrade/db_upgrade_test.ok
5 files changed, 75 insertions(+), 14 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/include/osmocom/hlr/db.h b/include/osmocom/hlr/db.h
index 9be88d8..ca336a0 100644
--- a/include/osmocom/hlr/db.h
+++ b/include/osmocom/hlr/db.h
@@ -51,6 +51,7 @@
 bool db_bind_text(sqlite3_stmt *stmt, const char *param_name, const char 
*text);
 bool db_bind_int(sqlite3_stmt *stmt, const char *param_name, int nr);
 bool db_bind_int64(sqlite3_stmt *stmt, const char *param_name, int64_t nr);
+bool db_bind_null(sqlite3_stmt *stmt, const char *param_name);
 void db_close(struct db_context *dbc);
 struct db_context *db_open(void *ctx, const char *fname, bool 
enable_sqlite3_logging, bool allow_upgrades);

@@ -99,6 +100,9 @@
boolms_purged_ps;
time_t  last_lu_seen;
time_t  last_lu_seen_ps;
+   /* talloc'd IPA unit name */
+   struct osmo_ipa_namevlr_via_proxy;
+   struct osmo_ipa_namesgsn_via_proxy;
 };

 /* A format string for use with strptime(3). This format string is
diff --git a/sql/hlr.sql b/sql/hlr.sql
index ad57661..98e586d 100644
--- a/sql/hlr.sql
+++ b/sql/hlr.sql
@@ -43,7 +43,12 @@
-- Timestamp of last location update seen from subscriber
-- The value is a string which encodes a UTC timestamp in granularity 
of seconds.
last_lu_seen TIMESTAMP default NULL,
-   last_lu_seen_ps TIMESTAMP default NULL
+   last_lu_seen_ps TIMESTAMP default NULL,
+
+   -- When a LU was received via a proxy, that proxy's hlr_number is 
stored here,
+   -- while vlr_number reflects the MSC on the far side of that proxy.
+   vlr_via_proxy   VARCHAR,
+   sgsn_via_proxy  VARCHAR
 );

 CREATE TABLE subscriber_apn (
@@ -78,4 +83,4 @@

 -- Set HLR database schema version number
 -- Note: This constant is currently duplicated in src/db.c and must be kept in 
sync!
-PRAGMA user_version = 4;
+PRAGMA user_version = 5;
diff --git a/src/db.c b/src/db.c
index 9d0c621..5ec20e2 100644
--- a/src/db.c
+++ b/src/db.c
@@ -28,7 +28,7 @@
 #include "db_bootstrap.h"

 /* This constant is currently duplicated in sql/hlr.sql and must be kept in 
sync! */
-#define CURRENT_SCHEMA_VERSION 4
+#define CURRENT_SCHEMA_VERSION 5

 #define SEL_COLUMNS \
"id," \
@@ -46,15 +46,17 @@
"ms_purged_cs," \
"ms_purged_ps," \
"last_lu_seen," \
-   "last_lu_seen_ps" \
+   "last_lu_seen_ps," \
+   "vlr_via_proxy," \
+   "sgsn_via_proxy"

 static const char *stmt_sql[] = {
[DB_STMT_SEL_BY_IMSI] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE 
imsi = ?",
[DB_STMT_SEL_BY_MSISDN] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE 
msisdn = ?",
[DB_STMT_SEL_BY_ID] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE id 
= ?",
[DB_STMT_SEL_BY_IMEI] = "SELECT " SEL_COLUMNS " FROM subscriber WHERE 
imei = ?",
-   [DB_STMT_UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = $number 
WHERE id = $subscriber_id",
-   [DB_STMT_UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = $number 
WHERE id = $subscriber_id",
+   [DB_STMT_UPD_VLR_BY_ID] = "UPDATE subscriber SET vlr_number = $number, 
vlr_via_proxy = $proxy WHERE id = $subscriber_id",
+   [DB_STMT_UPD_SGSN_BY_ID] = "UPDATE subscriber SET sgsn_number = 
$number, sgsn_via_proxy = $proxy WHERE id = $subscriber_id",
[DB_STMT_UPD_IMEI_BY_IMSI] = "UPDATE subscriber SET imei = $imei WHERE 
imsi = $imsi",
[DB_STMT_AUC_BY_IMSI] =
"SELECT id, algo_id_2g, ki, algo_id_3g, k, op, opc, sqn, 
ind_bitlen"
@@ -183,6 +185,25 @@
return true;
 }

+bool db_bind_null(sqlite3_stmt *stmt, const char *param_name)
+{
+   int rc;
+   int idx = param_name ? sqlite3_bind_parameter_index(stmt, param_name) : 
1;
+   if (idx < 1) {
+   LOGP(DDB, LOGL_ERROR, "Error composing SQL, cannot bind 
parameter '%s'\n",
+param_name);
+   return false;
+   }
+   rc = sqlite3_bind_null(stmt, idx);
+   if (rc != SQLITE_OK) {
+   LOGP(DDB, LOGL_ERROR, "Error binding NULL to SQL parameter %s: 
%d\n",
+param_name ? param_name : "#1", rc);
+   d

Change in osmo-hlr[master]: D-GSM 1/n: add mslookup server in osmo-hlr

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16209 )

Change subject: D-GSM 1/n: add mslookup server in osmo-hlr
..

D-GSM 1/n: add mslookup server in osmo-hlr

Implement the mslookup server to service remote mslookup requests.

This patch merely adds the logic to answer incoming mslookup requests, an
actual method to receive requests (mDNS) follows in a subsequent patch.

- API to configure service names and addresses for the local site (per MSC).
- determine whether a subscriber is on a local MSC
  (checking the local proxy will be added in subsequent patch that adds proxy
  capability).
- VTY config follows in a subsequent patch.

For a detailed overview of the D-GSM and mslookup related files, please see the
elaborate comment at the top of mslookup.c (already added in an earlier patch).

Change-Id: Ife4a61d71926d08f310a1aeed9d9f1974f64178b
---
M include/osmocom/hlr/Makefile.am
M include/osmocom/hlr/hlr.h
A include/osmocom/hlr/mslookup_server.h
A include/osmocom/hlr/timestamp.h
M src/Makefile.am
M src/hlr.c
A src/mslookup_server.c
A src/timestamp.c
8 files changed, 537 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/include/osmocom/hlr/Makefile.am b/include/osmocom/hlr/Makefile.am
index 532fa5d..5c96ec8 100644
--- a/include/osmocom/hlr/Makefile.am
+++ b/include/osmocom/hlr/Makefile.am
@@ -10,5 +10,7 @@
hlr_vty_subscr.h \
logging.h \
lu_fsm.h \
+   mslookup_server.h \
rand.h \
+   timestamp.h \
$(NULL)
diff --git a/include/osmocom/hlr/hlr.h b/include/osmocom/hlr/hlr.h
index 5885600..1269994 100644
--- a/include/osmocom/hlr/hlr.h
+++ b/include/osmocom/hlr/hlr.h
@@ -67,6 +67,13 @@
/* Bitmask of DB_SUBSCR_FLAG_* */
uint8_t subscr_create_on_demand_flags;
unsigned int subscr_create_on_demand_rand_msisdn_len;
+
+   struct {
+   struct {
+   uint32_t local_attach_max_age;
+   struct llist_head local_site_services;
+   } server;
+   } mslookup;
 };

 extern struct hlr *g_hlr;
diff --git a/include/osmocom/hlr/mslookup_server.h 
b/include/osmocom/hlr/mslookup_server.h
new file mode 100644
index 000..5425328
--- /dev/null
+++ b/include/osmocom/hlr/mslookup_server.h
@@ -0,0 +1,65 @@
+/* Copyright 2019 by sysmocom s.f.m.c. GmbH 
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ *
+ */
+
+#pragma once
+
+struct osmo_mslookup_query;
+struct osmo_mslookup_result;
+
+/*! mslookup service name used for roaming/proxying between osmo-hlr 
instances. */
+#define OSMO_MSLOOKUP_SERVICE_HLR_GSUP "gsup.hlr"
+
+/*! What addresses to return to mslookup queries when a subscriber is attached 
at the local site.
+ * Mapping of service name to IP address and port. This corresponds to the VTY 
config for
+ * 'mslookup' / 'server' [/ 'msc MSC-1-2-3'] / 'service sip.voice at 1.2.3.4 
1234'.
+ */
+struct mslookup_service_host {
+   struct llist_head entry;
+   char service[OSMO_MSLOOKUP_SERVICE_MAXLEN+1];
+   struct osmo_sockaddr_str host_v4;
+   struct osmo_sockaddr_str host_v6;
+};
+
+/*! Sets of mslookup_service_host per connected MSC.
+ * When there are more than one MSC connected to this osmo-hlr, this allows 
keeping separate sets of service addresses
+ * for each MSC. The entry with mslookup_server_msc_wildcard as MSC name is 
used for all MSCs (if no match for that
+ * particular MSC is found). This corresponds to the VTY config for
+ * 'mslookup' / 'server' / 'msc MSC-1-2-3'.
+ */
+struct mslookup_server_msc_cfg {
+   struct llist_head entry;
+   struct osmo_ipa_name name;
+   struct llist_head service_hosts;
+};
+
+struct mslookup_service_host *mslookup_server_service_get(const struct 
osmo_ipa_name *msc_name, const char *service);
+
+struct mslookup_service_host *mslookup_server_msc_service_get(struct 
mslookup_server_msc_cfg *msc, const char *service,
+ bool create);
+int mslookup_server_msc_service_set(struct mslookup_server_msc_cfg *msc, const 
char *service,
+   const struct osmo_

Change in osmo-hlr[master]: vty: show subscriber: change format of 'last LU seen'

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/15359 )

Change subject: vty: show subscriber: change format of 'last LU seen'
..

vty: show subscriber: change format of 'last LU seen'

So far, the time string format comes from ctime_r, and we manually add "UTC" to 
it.

The ctime_r format is wildly chaotic IMHO, mixing weekday, day-of-month and
hour and year in very unsorted ways.

Adding "UTC" to it is non-standard.

Instead use an ISO-8601 standardized time string via strftime().

Change-Id: I6731968f05050399f4dd43b241290186e0c59e1a
---
M src/hlr_vty_subscr.c
1 file changed, 7 insertions(+), 11 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c
index 14a37f2..8079d10 100644
--- a/src/hlr_vty_subscr.c
+++ b/src/hlr_vty_subscr.c
@@ -36,25 +36,21 @@

 #define hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf))

-static char *
-get_datestr(const time_t *t, char *datebuf)
+static char *get_datestr(const time_t *t, char *buf, size_t bufsize)
 {
-   char *p, *s = ctime_r(t, datebuf);
-
-   /* Strip trailing newline. */
-   p = strchr(s, '\n');
-   if (p)
-   *p = '\0';
-   return s;
+   struct tm tm;
+   gmtime_r(t, &tm);
+   strftime(buf, bufsize, "%FT%T+00:00", &tm);
+   return buf;
 }

 static void dump_last_lu_seen(struct vty *vty, const char *domain_label, 
time_t last_lu_seen)
 {
uint32_t age;
-   char datebuf[26]; /* for ctime_r(3) */
+   char datebuf[32];
if (!last_lu_seen)
return;
-   vty_out(vty, "last LU seen on %s: %s UTC", domain_label, 
get_datestr(&last_lu_seen, datebuf));
+   vty_out(vty, "last LU seen on %s: %s", domain_label, 
get_datestr(&last_lu_seen, datebuf, sizeof(datebuf)));
if (!timestamp_age(&last_lu_seen, &age))
vty_out(vty, " (invalid timestamp)%s", VTY_NEWLINE);
else

--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/15359
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I6731968f05050399f4dd43b241290186e0c59e1a
Gerrit-Change-Number: 15359
Gerrit-PatchSet: 29
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-CC: neels 
Gerrit-MessageType: merged


Change in osmo-hlr[master]: 2/2: wrap ipa_name in osmo_cni_peer_id with type enum and union

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16459 )

Change subject: 2/2: wrap ipa_name in osmo_cni_peer_id with type enum and union
..

2/2: wrap ipa_name in osmo_cni_peer_id with type enum and union

To be prepared for the future in public API, wrap the new osmo_ipa_name struct
in an enum-type and union called osmo_cni_peer.

During code review it was requested to insert an ability to handle different
kinds of peer id, in order to be able to add a Global Title in the future.

Use the generic osmo_cni_peer only in the publicly visible API. For osmo-hlr
internal code, I intend to postpone implementing this into the future, when a
different peer identification actually gets introduced.

This way we don't need to implement it now in all osmo-hlr code paths (save
time now), but still make all external API users aware that this type may be
extended in the future.

Change-Id: Ide9dcdca283ab989240cfc6e53e9211862a199c5
---
M include/Makefile.am
A include/osmocom/gsupclient/cni_peer_id.h
M include/osmocom/gsupclient/gsup_req.h
D include/osmocom/gsupclient/ipa_name.h
M include/osmocom/hlr/db.h
M include/osmocom/hlr/gsup_server.h
M src/Makefile.am
M src/db_hlr.c
M src/gsup_server.c
M src/gsupclient/Makefile.am
A src/gsupclient/cni_peer_id.c
M src/gsupclient/gsup_req.c
D src/gsupclient/ipa_name.c
M src/hlr.c
M src/hlr_ussd.c
M src/lu_fsm.c
M tests/db/Makefile.am
M tests/db/db_test.c
M tests/gsup_server/Makefile.am
19 files changed, 346 insertions(+), 181 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/include/Makefile.am b/include/Makefile.am
index aeeb03f..e93fe29 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,7 +1,7 @@
 SUBDIRS = osmocom

 nobase_include_HEADERS = \
-   osmocom/gsupclient/ipa_name.h \
+   osmocom/gsupclient/cni_peer_id.h \
osmocom/gsupclient/gsup_client.h \
osmocom/gsupclient/gsup_req.h \
osmocom/mslookup/mdns.h \
diff --git a/include/osmocom/gsupclient/cni_peer_id.h 
b/include/osmocom/gsupclient/cni_peer_id.h
new file mode 100644
index 000..6e58d06
--- /dev/null
+++ b/include/osmocom/gsupclient/cni_peer_id.h
@@ -0,0 +1,66 @@
+/* Copyright 2019 by sysmocom s.f.m.c. GmbH 
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program.  If not, see .
+ */
+
+#pragma once
+#include 
+#include 
+#include 
+
+/*! IPA Name: Arbitrary length blob, not necessarily zero-terminated.
+ * In osmo-hlr, struct hlr_subscriber is mostly used as static reference and 
cannot serve as talloc context, which is
+ * why this is also implemented as a fixed-maximum-size buffer instead of a 
talloc'd arbitrary sized buffer.
+ * NOTE: The length of val may be extended in the future if it becomes 
necessary.
+ * At the time of writing, this holds IPA unit name strings of very limited 
length.
+ */
+struct osmo_ipa_name {
+   size_t len;
+   uint8_t val[128];
+};
+
+bool osmo_ipa_name_is_empty(const struct osmo_ipa_name *ipa_name);
+int osmo_ipa_name_set(struct osmo_ipa_name *ipa_name, const uint8_t *val, 
size_t len);
+int osmo_ipa_name_set_str(struct osmo_ipa_name *ipa_name, const char *str_fmt, 
...);
+int osmo_ipa_name_cmp(const struct osmo_ipa_name *a, const struct 
osmo_ipa_name *b);
+const char *osmo_ipa_name_to_str_c(void *ctx, const struct osmo_ipa_name 
*ipa_name);
+const char *osmo_ipa_name_to_str(const struct osmo_ipa_name *ipa_name);
+
+enum osmo_cni_peer_id_type {
+   OSMO_CNI_PEER_ID_EMPTY=0,
+   OSMO_CNI_PEER_ID_IPA_NAME,
+   /* OSMO_CNI_PEER_ID_GLOBAL_TITLE, <-- currently not implemented, but 
likely future possibility */
+};
+
+extern const struct value_string osmo_cni_peer_id_type_names[];
+static inline const char *osmo_cni_peer_id_type_name(enum 
osmo_cni_peer_id_type val)
+{ return get_value_string(osmo_cni_peer_id_type_names, val); }
+
+struct osmo_cni_peer_id {
+   enum osmo_cni_peer_id_type type;
+   union {
+   struct osmo_ipa_name ipa_name;
+   };
+};
+
+bool osmo_cni_peer_id_is_empty(const struct osmo_cni_peer_id *cni_peer_id);
+int osmo_cni_peer_id_set(struct osmo_cni_peer_id *cni_peer_id, enum 
osmo_cni_peer_id_type type,
+ const uint8_t *val, size_t len);
+int osmo_cni_peer_id_set_str(struct osmo_cni_peer_id *cni_peer_

Change in osmo-hlr[master]: drop error log for when a subscriber does not exist

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16212 )

Change subject: drop error log for when a subscriber does not exist
..

drop error log for when a subscriber does not exist

Checking for existence of a subscriber and seeing that there is none is not
inherently an error. However, osmo-hlr currently logs on all occasions:

  DAUC ERROR Cannot read subscriber from db: MSISDN='1001': No such subscriber

This spams the ERROR log level. Particularly when a D-GSM setup does subscriber
existence checks for every incoming mslookup request, that potentially creates
constant ERROR logging.

The "No such subscriber" part comes from db_sel(), which might also return an
sqlite3_errmsg(). We still want those sqlite3_errmsg()es in the ERROR log.

Hence print an ERROR log only if db_sel() returns an rc != -ENOENT.

Change-Id: I5044e9b4519b948edc4e451cef0f7830d315619b
---
M src/db_hlr.c
M tests/db/db_test.err
2 files changed, 4 insertions(+), 30 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/src/db_hlr.c b/src/db_hlr.c
index 9073926..83c2c51 100644
--- a/src/db_hlr.c
+++ b/src/db_hlr.c
@@ -568,7 +568,7 @@
return -EIO;

rc = db_sel(dbc, stmt, subscr, &err);
-   if (rc)
+   if (rc && rc != -ENOENT)
LOGP(DAUC, LOGL_ERROR, "Cannot read subscriber from db: 
IMSI='%s': %s\n",
 imsi, err);
return rc;
@@ -619,7 +619,7 @@
return -EIO;

rc = db_sel(dbc, stmt, subscr, &err);
-   if (rc)
+   if (rc && rc != -ENOENT)
LOGP(DAUC, LOGL_ERROR, "Cannot read subscriber from db: 
MSISDN='%s': %s\n",
 msisdn, err);
return rc;
@@ -643,7 +643,7 @@
return -EIO;

rc = db_sel(dbc, stmt, subscr, &err);
-   if (rc)
+   if (rc && rc != -ENOENT)
LOGP(DAUC, LOGL_ERROR, "Cannot read subscriber from db: ID=%" 
PRId64 ": %s\n",
 id, err);
return rc;
@@ -666,7 +666,7 @@
return -EIO;

rc = db_sel(dbc, stmt, subscr, &err);
-   if (rc)
+   if (rc && rc != -ENOENT)
LOGP(DAUC, LOGL_ERROR, "Cannot read subscriber from db: 
IMEI=%s: %s\n", imei, err);
return rc;
 }
diff --git a/tests/db/db_test.err b/tests/db/db_test.err
index e4d43c9..871e722 100644
--- a/tests/db/db_test.err
+++ b/tests/db/db_test.err
@@ -64,25 +64,21 @@
 DAUC Cannot create subscriber: invalid IMSI: '123456789 03'

 db_subscr_get_by_imsi(dbc, "12345678903", &g_subscr) --> -ENOENT
-DAUC Cannot read subscriber from db: IMSI='12345678903': No such subscriber

 db_subscr_create(dbc, "12345678902123456", DB_SUBSCR_FLAG_NAM_CS | 
DB_SUBSCR_FLAG_NAM_PS) --> -EINVAL
 DAUC Cannot create subscriber: invalid IMSI: '12345678902123456'

 db_subscr_get_by_imsi(dbc, "12345678902123456", &g_subscr) --> -ENOENT
-DAUC Cannot read subscriber from db: IMSI='12345678902123456': No such 
subscriber

 db_subscr_create(dbc, "foobar123", DB_SUBSCR_FLAG_NAM_CS | 
DB_SUBSCR_FLAG_NAM_PS) --> -EINVAL
 DAUC Cannot create subscriber: invalid IMSI: 'foobar123'

 db_subscr_get_by_imsi(dbc, "foobar123", &g_subscr) --> -ENOENT
-DAUC Cannot read subscriber from db: IMSI='foobar123': No such subscriber
 
 db_subscr_create(dbc, "123", DB_SUBSCR_FLAG_NAM_CS | DB_SUBSCR_FLAG_NAM_PS) 
--> -EINVAL
 DAUC Cannot create subscriber: invalid IMSI: '123'

 db_subscr_get_by_imsi(dbc, "123", &g_subscr) --> -ENOENT
-DAUC Cannot read subscriber from db: IMSI='123': No such subscriber

 db_subscr_create(dbc, short_imsi, DB_SUBSCR_FLAG_NAM_CS | 
DB_SUBSCR_FLAG_NAM_PS) --> 0

@@ -142,7 +138,6 @@
 }

 db_subscr_get_by_msisdn(dbc, "54321012345678912345678", &g_subscr) --> -ENOENT
-DAUC Cannot read subscriber from db: MSISDN='54321012345678912345678': No such 
subscriber

 db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543 21") --> -EINVAL
 DAUC IMSI='12345678900': Cannot update subscriber: invalid MSISDN: '543 21'
@@ -155,7 +150,6 @@
 }

 db_subscr_get_by_msisdn(dbc, "543 21", &g_subscr) --> -ENOENT
-DAUC Cannot read subscriber from db: MSISDN='543 21': No such subscriber

 db_subscr_update_msisdn_by_imsi(dbc, imsi0, "foobar123") --> -EINVAL
 DAUC IMSI='12345678900': Cannot update subscriber: invalid MSISDN: 
'foobar123'
@@ -168,7 +162,6 @@
 }

 db_subscr_get_by_msisdn(dbc, "foobar123", &g_subscr) --> -ENOENT
-DAUC Cannot read subscriber from db: MSISDN='foobar123': No such subscriber

 db_subscr_update_msisdn_by_imsi(dbc, imsi0, "5") --> 0

@@ -187,7 +180,6 @@
 }

 db_subscr_get_by_msisdn(dbc, "54321", &g_subscr) --> -ENOENT
-DAUC Cannot read subscriber from db: MSISDN='54321': No such subscriber

 db_subscr_update_msisdn_by_imsi(dbc, imsi0, "543210123456789") --> 0

@@ -216,7 +208,6 @@
 }

 db_subscr_get_by_msisdn(dbc,

Change in osmo-hlr[master]: hlr_vty_subscr: prettier output for last LU seen

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16214 )

Change subject: hlr_vty_subscr: prettier output for last LU seen
..

hlr_vty_subscr: prettier output for last LU seen

Extend the "last LU seen on ..." line with the amount of seconds that
passed since now, or "(invalid timestamp)".

Patch split from Id7fc50567211a0870ac0524f6dee94d4513781ba, because it
depends on timestamp_age which was just added in
Ife4a61d71926d08f310a1aeed9d9f1974f64178b.

Change-Id: I24f9e86c1aa0b1576290094e024562f41b988f37
---
M src/hlr_vty_subscr.c
1 file changed, 7 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c
index b561636..14a37f2 100644
--- a/src/hlr_vty_subscr.c
+++ b/src/hlr_vty_subscr.c
@@ -30,6 +30,7 @@

 #include 
 #include 
+#include 

 struct vty;

@@ -49,11 +50,15 @@

 static void dump_last_lu_seen(struct vty *vty, const char *domain_label, 
time_t last_lu_seen)
 {
+   uint32_t age;
char datebuf[26]; /* for ctime_r(3) */
if (!last_lu_seen)
return;
-   vty_out(vty, "last LU seen on %s: %s UTC%s", domain_label, 
get_datestr(&last_lu_seen, datebuf),
-   VTY_NEWLINE);
+   vty_out(vty, "last LU seen on %s: %s UTC", domain_label, 
get_datestr(&last_lu_seen, datebuf));
+   if (!timestamp_age(&last_lu_seen, &age))
+   vty_out(vty, " (invalid timestamp)%s", VTY_NEWLINE);
+   else
+   vty_out(vty, " (%us ago)%s", age, VTY_NEWLINE);
 }

 static void subscr_dump_full_vty(struct vty *vty, struct hlr_subscriber 
*subscr)

--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16214
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I24f9e86c1aa0b1576290094e024562f41b988f37
Gerrit-Change-Number: 16214
Gerrit-PatchSet: 35
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-hlr[master]: gsup client: add up_down_cb(), add osmo_gsup_client_create3()

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16206 )

Change subject: gsup client: add up_down_cb(), add osmo_gsup_client_create3()
..

gsup client: add up_down_cb(), add osmo_gsup_client_create3()

For the GSUP clients in upcoming D-GSM enabled osmo-hlr, it will be necessary
to trigger an event as soon as a GSUP client connection becomes ready for
communication. Add the osmo_gsup_client->up_down_cb.

Add osmo_gsup_client_create3() to pass the up_down_cb in the arguments. Also
add a cb data argument to populate the already existing osmo_gsup_client->data
item directly from osmo_gsup_client_create3().

We need the callbacks and data pointer in the osmo_gsup_client_create()
function right before startup, because this function immediately starts up the
connection. Who knows whether callbacks might trigger right away.

Because there are so many arguments, and to prevent the need for ever new
versions of this function, pass the arguments as an extendable struct.

Change-Id: I6f181e42b678465bc9945f192559dc57d2083c6d
---
M include/osmocom/gsupclient/gsup_client.h
M src/gsupclient/gsup_client.c
2 files changed, 74 insertions(+), 20 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/include/osmocom/gsupclient/gsup_client.h 
b/include/osmocom/gsupclient/gsup_client.h
index b417ade..ea66ca1 100644
--- a/include/osmocom/gsupclient/gsup_client.h
+++ b/include/osmocom/gsupclient/gsup_client.h
@@ -38,6 +38,8 @@
 /* Expects message in msg->l2h */
 typedef int (*osmo_gsup_client_read_cb_t)(struct osmo_gsup_client *gsupc, 
struct msgb *msg);

+typedef bool (*osmo_gsup_client_up_down_cb_t)(struct osmo_gsup_client *gsupc, 
bool up);
+
 struct osmo_gsup_client {
const char *unit_name; /* same as ipa_dev->unit_name, for backwards 
compat */

@@ -53,8 +55,31 @@
int got_ipa_pong;

struct ipaccess_unit *ipa_dev; /* identification information sent to 
IPA server */
+
+   osmo_gsup_client_up_down_cb_t up_down_cb;
 };

+struct osmo_gsup_client_config {
+   /*! IP access unit which contains client identification information; 
must be allocated in talloc_ctx as well to
+* ensure it lives throughout the lifetime of the connection. */
+   struct ipaccess_unit *ipa_dev;
+   /*! GSUP server IP address to connect to. */
+   const char *ip_addr;
+   /*! GSUP server TCP port to connect to. */
+   unsigned int tcp_port;
+   /*! OPA client configuration, or NULL. */
+   struct osmo_oap_client_config *oapc_config;
+   /*! callback for reading from the GSUP connection. */
+   osmo_gsup_client_read_cb_t read_cb;
+   /*! Invoked when the GSUP link is ready for communication, and when the 
link drops. */
+   osmo_gsup_client_up_down_cb_t up_down_cb;
+   /*! User data stored in the returned gsupc->data, as context for the 
callbacks. */
+   void *data;
+   /*! Marker for future extension, always pass this as false. */
+   bool more;
+};
+struct osmo_gsup_client *osmo_gsup_client_create3(void *talloc_ctx, struct 
osmo_gsup_client_config *config);
+
 struct osmo_gsup_client *osmo_gsup_client_create2(void *talloc_ctx,
  struct ipaccess_unit *ipa_dev,
  const char *ip_addr,
diff --git a/src/gsupclient/gsup_client.c b/src/gsupclient/gsup_client.c
index 52985c9..4f76efc 100644
--- a/src/gsupclient/gsup_client.c
+++ b/src/gsupclient/gsup_client.c
@@ -97,6 +97,12 @@
if (gsupc->is_connected)
return;

+   if (gsupc->up_down_cb) {
+   /* When the up_down_cb() returns false, the user asks us not to 
retry connecting. */
+   if (!gsupc->up_down_cb(gsupc, false))
+   return;
+   }
+
gsup_client_connect(gsupc);
 }

@@ -139,9 +145,18 @@
gsup_client_oap_register(gsupc);

osmo_timer_del(&gsupc->connect_timer);
+
+   if (gsupc->up_down_cb)
+   gsupc->up_down_cb(gsupc, true);
} else {
osmo_timer_del(&gsupc->ping_timer);

+   if (gsupc->up_down_cb) {
+   /* When the up_down_cb() returns false, the user asks 
us not to retry connecting. */
+   if (!gsupc->up_down_cb(gsupc, false))
+   return;
+   }
+
osmo_timer_schedule(&gsupc->connect_timer,
OSMO_GSUP_CLIENT_RECONNECT_INTERVAL, 0);
}
@@ -263,31 +278,28 @@
  * Use the provided ipaccess unit as the client-side identifier; ipa_dev should
  * be allocated in talloc_ctx talloc_ctx as well.
  * \param[in] talloc_ctx talloc context.
- * \param[in] ipa_dev IP access unit which contains client identification 
information; must be allocated
- *   

Change in osmo-hlr[master]: vty: show subscriber: show lu d, h, m, s ago, not just seconds

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16262 )

Change subject: vty: show subscriber: show lu d,h,m,s ago, not just seconds
..

vty: show subscriber: show lu d,h,m,s ago, not just seconds

Change-Id: I0fe34e0f065160ef959b2b7b4dd040f3f2985f43
---
M src/hlr_vty_subscr.c
1 file changed, 14 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c
index 8079d10..a9262ba 100644
--- a/src/hlr_vty_subscr.c
+++ b/src/hlr_vty_subscr.c
@@ -53,8 +53,20 @@
vty_out(vty, "last LU seen on %s: %s", domain_label, 
get_datestr(&last_lu_seen, datebuf, sizeof(datebuf)));
if (!timestamp_age(&last_lu_seen, &age))
vty_out(vty, " (invalid timestamp)%s", VTY_NEWLINE);
-   else
-   vty_out(vty, " (%us ago)%s", age, VTY_NEWLINE);
+   else {
+   vty_out(vty, " (");
+#define UNIT_AGO(UNITNAME, UNITVAL) \
+   if (age >= (UNITVAL)) { \
+   vty_out(vty, "%u%s", age / (UNITVAL), UNITNAME); \
+   age = age % (UNITVAL); \
+   }
+   UNIT_AGO("d", 60*60*24);
+   UNIT_AGO("h", 60*60);
+   UNIT_AGO("m", 60);
+   UNIT_AGO("s", 1);
+   vty_out(vty, " ago)%s", VTY_NEWLINE);
+#undef UNIT_AGO
+   }
 }

 static void subscr_dump_full_vty(struct vty *vty, struct hlr_subscriber 
*subscr)

--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16262
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I0fe34e0f065160ef959b2b7b4dd040f3f2985f43
Gerrit-Change-Number: 16262
Gerrit-PatchSet: 25
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-CC: pespin 
Gerrit-MessageType: merged


Change in osmo-hlr[master]: enlarge the GSUP message headroom

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16208 )

Change subject: enlarge the GSUP message headroom
..

enlarge the GSUP message headroom

Make room for (more) arbitrary IPA headers, like longer IPA names as configured
by the user.

Change-Id: I7d86f2dadcae29fe1550ea2c9773394ab31a837b
---
M src/gsup_server.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/gsup_server.c b/src/gsup_server.c
index e9418d4..61b9257 100644
--- a/src/gsup_server.c
+++ b/src/gsup_server.c
@@ -37,7 +37,7 @@

 struct msgb *osmo_gsup_msgb_alloc(const char *label)
 {
-   struct msgb *msg = msgb_alloc_headroom(1024+16, 16, label);
+   struct msgb *msg = msgb_alloc_headroom(1024+512, 512, label);
OSMO_ASSERT(msg);
return msg;
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16208
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I7d86f2dadcae29fe1550ea2c9773394ab31a837b
Gerrit-Change-Number: 16208
Gerrit-PatchSet: 31
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-CC: pespin 
Gerrit-MessageType: merged


Change in osmo-hlr[master]: gsup_server: send routing error back to the correct peer

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16336 )

Change subject: gsup_server: send routing error back to the correct peer
..


Patch Set 17: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16336
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: Icafaedc11b5925149d338bdcb987ae985a7323d6
Gerrit-Change-Number: 16336
Gerrit-PatchSet: 17
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Fri, 01 May 2020 14:36:20 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-hlr[master]: D-GSM 1/n: add mslookup server in osmo-hlr

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16209 )

Change subject: D-GSM 1/n: add mslookup server in osmo-hlr
..


Patch Set 34: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16209
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: Ife4a61d71926d08f310a1aeed9d9f1974f64178b
Gerrit-Change-Number: 16209
Gerrit-PatchSet: 34
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Fri, 01 May 2020 14:35:24 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-hlr[master]: D-GSM 3/n: implement roaming by mslookup in osmo-hlr

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16258 )

Change subject: D-GSM 3/n: implement roaming by mslookup in osmo-hlr
..


Patch Set 26: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16258
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I2fe453553c90e6ee527ed13a13089900efd488aa
Gerrit-Change-Number: 16258
Gerrit-PatchSet: 26
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Fri, 01 May 2020 14:36:01 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-hlr[master]: D-GSM 2/n: implement mDNS method of mslookup server

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16257 )

Change subject: D-GSM 2/n: implement mDNS method of mslookup server
..


Patch Set 25: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16257
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I5cae6459090588b4dd292be90a5e8903432669d2
Gerrit-Change-Number: 16257
Gerrit-PatchSet: 25
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: keith 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Fri, 01 May 2020 14:35:46 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-hlr[master]: gsup client: add up_down_cb(), add osmo_gsup_client_create3()

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16206 )

Change subject: gsup client: add up_down_cb(), add osmo_gsup_client_create3()
..


Patch Set 31: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16206
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I6f181e42b678465bc9945f192559dc57d2083c6d
Gerrit-Change-Number: 16206
Gerrit-PatchSet: 31
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Fri, 01 May 2020 14:34:55 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-hlr[master]: enlarge the GSUP message headroom

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16208 )

Change subject: enlarge the GSUP message headroom
..


Patch Set 31: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16208
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I7d86f2dadcae29fe1550ea2c9773394ab31a837b
Gerrit-Change-Number: 16208
Gerrit-PatchSet: 31
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Fri, 01 May 2020 14:35:03 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-hlr[master]: 2/2: wrap ipa_name in osmo_cni_peer_id with type enum and union

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16459 )

Change subject: 2/2: wrap ipa_name in osmo_cni_peer_id with type enum and union
..


Patch Set 11: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16459
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: Ide9dcdca283ab989240cfc6e53e9211862a199c5
Gerrit-Change-Number: 16459
Gerrit-PatchSet: 11
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Fri, 01 May 2020 14:34:08 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-hlr[master]: 1/2: refactor: add and use lu_fsm, osmo_gsup_req, osmo_ipa_name

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hlr/+/16205 )

Change subject: 1/2: refactor: add and use lu_fsm, osmo_gsup_req, osmo_ipa_name
..


Patch Set 31: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/16205
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I3a8dff3d4a1cbe10d6ab08257a0138d6b2a082d9
Gerrit-Change-Number: 16205
Gerrit-PatchSet: 31
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Fri, 01 May 2020 14:33:21 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: mobile: loopback voice frames

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/17381 )

Change subject: mobile: loopback voice frames
..


Patch Set 6: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/c/osmocom-bb/+/17381/6/src/host/layer23/src/mobile/voice.c
File src/host/layer23/src/mobile/voice.c:

https://gerrit.osmocom.org/c/osmocom-bb/+/17381/6/src/host/layer23/src/mobile/voice.c@44
PS6, Line 44: GSM_TCHF_FRAME
I think this implicitly means FR. Other codecs use other types 
(GSM_TCHF_FRAME_{HR,EFR}, GSM_TCHH_FRAME, GSM_TCHH_FRAME_AMR).

Either add that code to the current patch, or do it in a separate patch.  If 
it's separate, please document the limitation of this implementation in the 
commitlog and make a big fat comment here.  Better even have an assert or an 
error printf if the tch_mode is not FR.



--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/17381
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Icd0b8d00c855db1a6ff5e35e10c8ff67b7ad5c83
Gerrit-Change-Number: 17381
Gerrit-PatchSet: 6
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-CC: fixeria 
Gerrit-Comment-Date: Fri, 01 May 2020 14:33:00 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: mobile: add audio config, with unused audio loopback setting

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/17593 )

Change subject: mobile: add audio config, with unused audio loopback setting
..


Patch Set 4: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/17593
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ie03e4a6c6f81ea3925266dd22e87506d722a6e1a
Gerrit-Change-Number: 17593
Gerrit-PatchSet: 4
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Fri, 01 May 2020 14:29:58 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in mncc-python[master]: rtpsource: CTRL call rtp_create: add codec arg

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/mncc-python/+/17979 )

Change subject: rtpsource: CTRL call rtp_create: add codec arg
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/mncc-python/+/17979
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: mncc-python
Gerrit-Branch: master
Gerrit-Change-Id: If75e902b451d7e202a03e93afcd55bd24f517813
Gerrit-Change-Number: 17979
Gerrit-PatchSet: 3
Gerrit-Owner: osmith 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Fri, 01 May 2020 14:28:20 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in mncc-python[master]: rtpsource: CTRL call rtp_create: add codec arg

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/mncc-python/+/17979 )

Change subject: rtpsource: CTRL call rtp_create: add codec arg
..

rtpsource: CTRL call rtp_create: add codec arg

Instead of hardcoding FR in rtpsource, add an argument to set the codec
from mncc_mt_loadgen.py via CTRL call rtp_create. Hardcode FR in
mncc_mt_loadgen.py for now, a follow up patch will make it configurable
there, too.

Related: SYS#4924
Change-Id: If75e902b451d7e202a03e93afcd55bd24f517813
---
M mncc_mt_loadgen.py
M rtpsource/ctrl_if.c
M rtpsource/internal.h
M rtpsource/rtp_provider.c
M rtpsource/rtp_provider.h
M rtpsource/rtpsource.c
6 files changed, 60 insertions(+), 11 deletions(-)

Approvals:
  osmith: Verified
  laforge: Looks good to me, approved



diff --git a/mncc_mt_loadgen.py b/mncc_mt_loadgen.py
index 021d619..5f15e3b 100755
--- a/mncc_mt_loadgen.py
+++ b/mncc_mt_loadgen.py
@@ -80,7 +80,8 @@

 def on_receive(self, message):
 if message['type'] == 'rtp_create':
-(res, var, val) = self._set_var('rtp_create', message['cname'])
+val = '%s,%s' % (message['cname'], message['codec'])
+(res, var, val) = self._set_var('rtp_create', val)
 v = val.split(',') # input looks like '1,127.23.23.23,37723'
 return {'cname': v[0], 'remote_host': v[1], 'remote_port': 
int(v[2])}
 elif message['type'] == 'rtp_connect':
@@ -113,7 +114,8 @@
 self.msisdn_called = msisdn_called
 self.msisdn_calling = msisdn_calling
 # allocate a RTP connection @ rtpsource
-r = self.ctrl_act.ask({'type':'rtp_create', 'cname':self.callref})
+codec = "GSM_FR"  # FIXME: make configurable
+r = self.ctrl_act.ask({'type':'rtp_create', 'cname':self.callref, 
'codec':codec})
 self.ext_rtp_host = r['remote_host']
 self.ext_rtp_port = r['remote_port']
 # start the MNCC call FSM
diff --git a/rtpsource/ctrl_if.c b/rtpsource/ctrl_if.c
index 708fb02..b021e26 100644
--- a/rtpsource/ctrl_if.c
+++ b/rtpsource/ctrl_if.c
@@ -21,27 +21,52 @@
 #include 

 #include "internal.h"
+#include "rtp_provider.h"

 CTRL_CMD_DEFINE_WO_NOVRF(rtp_create, "rtp_create");
 static int set_rtp_create(struct ctrl_cmd *cmd, void *data)
 {
struct rtp_connection *conn;
-   const char *cname = cmd->value;
+   const char *cname, *codec_str;
+   char *tmp, *saveptr;
+   enum codec_type codec;
+
+   tmp = talloc_strdup(cmd, cmd->value);
+   OSMO_ASSERT(tmp);
+
+   cname = strtok_r(tmp, ",", &saveptr);
+   codec_str = strtok_r(NULL, ",", &saveptr);
+
+   if (!cname || !codec_str) {
+   cmd->reply = "Format is cname,codec";
+   goto error;
+   }

if (find_connection_by_cname(g_rss, cname)) {
cmd->reply = "Connection already exists for cname";
-   return CTRL_CMD_ERROR;
+   goto error;
}

-   conn = create_connection(g_rss, cname);
+   codec = get_string_value(codec_type_names, codec_str);
+   if (codec < 0) {
+   cmd->reply = "Invalid codec name (try GSM_FR, GSM_EFR etc.)";
+   goto error;
+   }
+
+   conn = create_connection(g_rss, cname, codec);
if (!conn) {
cmd->reply = "Error creating RTP connection";
-   return CTRL_CMD_ERROR;
+   goto error;
}

/* Respond */
cmd->reply = talloc_asprintf(cmd, "%s,%s,%d", conn->cname, 
conn->local_host, conn->local_port);
+   talloc_free(tmp);
return CTRL_CMD_REPLY;
+
+error:
+   talloc_free(tmp);
+   return CTRL_CMD_ERROR;
 }

 CTRL_CMD_DEFINE_WO_NOVRF(rtp_connect, "rtp_connect");
diff --git a/rtpsource/internal.h b/rtpsource/internal.h
index a4501a2..35f12d0 100644
--- a/rtpsource/internal.h
+++ b/rtpsource/internal.h
@@ -4,6 +4,8 @@
 #include 
 #include 

+enum codec_type;
+
 enum {
DMAIN,
 };
@@ -36,7 +38,7 @@

 struct rtp_connection *find_connection_by_cname(struct rtpsource_state *rss, 
const char *cname);

-struct rtp_connection *create_connection(struct rtpsource_state *rss, const 
char *cname);
+struct rtp_connection *create_connection(struct rtpsource_state *rss, const 
char *cname, enum codec_type codec);

 int connect_connection(struct rtp_connection *conn, const char *remote_host,
uint16_t remote_port, uint8_t pt);
diff --git a/rtpsource/rtp_provider.c b/rtpsource/rtp_provider.c
index 0d2b9c6..7e12db3 100644
--- a/rtpsource/rtp_provider.c
+++ b/rtpsource/rtp_provider.c
@@ -9,6 +9,24 @@
 static LLIST_HEAD(g_providers);
 static LLIST_HEAD(g_prov_instances);

+const struct value_string codec_type_names[] = {
+   { CODEC_ULAW,   "ULAW" },
+   { CODEC_ALAW,   "ALAW" },
+   { CODEC_GSM_FR, "GSM_FR" },
+   { CODEC_GSM_EFR,"GSM_EFR" },
+   { CODEC_GSM_HR, "GSM_HR" },
+  

Change in mncc-python[master]: rtpsource: Modularize generation of RTP frames

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/mncc-python/+/17978 )

Change subject: rtpsource: Modularize generation of RTP frames
..

rtpsource: Modularize generation of RTP frames

Change-Id: Iad98e1753fef1927c0e8a7493372141372a38224
---
M rtpsource/Makefile
M rtpsource/internal.h
A rtpsource/rtp_provider.c
A rtpsource/rtp_provider.h
A rtpsource/rtp_provider_static.c
M rtpsource/rtpsource.c
6 files changed, 230 insertions(+), 7 deletions(-)

Approvals:
  osmith: Verified
  laforge: Looks good to me, approved



diff --git a/rtpsource/Makefile b/rtpsource/Makefile
index 9972325..2ede792 100644
--- a/rtpsource/Makefile
+++ b/rtpsource/Makefile
@@ -4,7 +4,7 @@
 CFLAGS:= -g -Wall $(OSMO_CFLAGS)
 LIBS:= $(OSMO_LIBS)

-rtpsource: rtpsource.o ctrl_if.o
+rtpsource: rtpsource.o ctrl_if.o rtp_provider.o rtp_provider_static.o
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)


diff --git a/rtpsource/internal.h b/rtpsource/internal.h
index 13d07aa..a4501a2 100644
--- a/rtpsource/internal.h
+++ b/rtpsource/internal.h
@@ -8,6 +8,8 @@
DMAIN,
 };

+struct rtp_provider_instance;
+
 struct rtp_connection {
struct llist_head list;

@@ -21,6 +23,7 @@
uint16_t remote_port;

uint8_t rtp_pt;
+   struct rtp_provider_instance *rtp_prov_inst;
 };

 struct rtpsource_state {
diff --git a/rtpsource/rtp_provider.c b/rtpsource/rtp_provider.c
new file mode 100644
index 000..0d2b9c6
--- /dev/null
+++ b/rtpsource/rtp_provider.c
@@ -0,0 +1,54 @@
+#include 
+#include 
+#include 
+
+#include "rtp_provider.h"
+#include "internal.h"
+
+
+static LLIST_HEAD(g_providers);
+static LLIST_HEAD(g_prov_instances);
+
+void rtp_provider_register(struct rtp_provider *prov)
+{
+   llist_add_tail(&prov->list, &g_providers);
+}
+
+const struct rtp_provider *rtp_provider_find(const char *name)
+{
+   struct rtp_provider *p;
+   llist_for_each_entry(p, &g_providers, list) {
+   if (!strcmp(name, p->name))
+   return p;
+   }
+   LOGP(DMAIN, LOGL_ERROR, "Couldn't find RTP provider '%s'\n", name);
+   return NULL;
+}
+
+struct rtp_provider_instance *
+rtp_provider_instance_alloc(void *ctx, const struct rtp_provider *provider, 
enum codec_type codec)
+{
+   struct rtp_provider_instance *pi;
+
+   pi = talloc_zero(ctx, struct rtp_provider_instance);
+   if (!pi)
+   return NULL;
+
+   pi->provider = provider;
+   pi->codec = codec;
+   llist_add_tail(&pi->list, &g_prov_instances);
+
+   return pi;
+}
+
+void rtp_provider_instance_free(struct rtp_provider_instance *pi)
+{
+   llist_del(&pi->list);
+   talloc_free(pi);
+}
+
+int rtp_provider_instance_gen_frame(struct rtp_provider_instance *pi, uint8_t 
*out, size_t out_size)
+{
+   OSMO_ASSERT(pi->provider);
+   return pi->provider->rtp_gen(pi, out, out_size);
+}
diff --git a/rtpsource/rtp_provider.h b/rtpsource/rtp_provider.h
new file mode 100644
index 000..7048a3e
--- /dev/null
+++ b/rtpsource/rtp_provider.h
@@ -0,0 +1,51 @@
+#pragma once
+#include 
+#include 
+
+enum codec_type {
+   CODEC_ULAW,
+   CODEC_ALAW,
+   CODEC_GSM_FR,
+   CODEC_GSM_EFR,
+   CODEC_GSM_HR,
+   CODEC_AMR_4_75,
+   CODEC_AMR_5_15,
+   CODEC_AMR_5_90,
+   CODEC_AMR_6_70,
+   CODEC_AMR_7_40,
+   CODEC_AMR_7_95,
+   CODEC_AMR_10_2,
+   CODEC_AMR_12_2,
+   CODEC_AMR_SID,
+   _NUM_CODECS
+};
+
+struct rtp_provider_instance;
+
+struct rtp_provider {
+   /* global list of RTP providers */
+   struct llist_head list;
+   const char *name;
+
+   /* generate the next RTP packet; return length in octests or negative 
on error */
+   int (*rtp_gen)(struct rtp_provider_instance *inst, uint8_t *out, size_t 
out_size);
+};
+
+struct rtp_provider_instance {
+   /* entry in global list of RTP provider instances */
+   struct llist_head list;
+   /* pointer to provider of which we are an instance */
+   const struct rtp_provider *provider;
+   /* codec payload we are to generate */
+   enum codec_type codec;
+
+   /* private user data */
+   void *priv;
+};
+
+void rtp_provider_register(struct rtp_provider *prov);
+const struct rtp_provider *rtp_provider_find(const char *name);
+
+struct rtp_provider_instance *rtp_provider_instance_alloc(void *ctx, const 
struct rtp_provider *provider, enum codec_type codec);
+void rtp_provider_instance_free(struct rtp_provider_instance *pi);
+int rtp_provider_instance_gen_frame(struct rtp_provider_instance *pi, uint8_t 
*out, size_t out_size);
diff --git a/rtpsource/rtp_provider_static.c b/rtpsource/rtp_provider_static.c
new file mode 100644
index 000..323e686
--- /dev/null
+++ b/rtpsource/rtp_provider_static.c
@@ -0,0 +1,107 @@
+
+#include 
+#include 
+#include 
+
+#include "rtp_provider.h"
+#include "internal.h"
+
+static struct rtp_provider static_provider;
+
+static con

Change in mncc-python[master]: mncc_mt_loadgen.py: add codec arg

2020-05-01 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/mncc-python/+/17980 )

Change subject: mncc_mt_loadgen.py: add codec arg
..

mncc_mt_loadgen.py: add codec arg

Add codec parameter to start_call() and convenience functions mt_call()
and calls() with FR as default. While at it, update the help text.

Related: SYS#4924
Change-Id: I5879b8b9ccc63908b9f6629487e66eff1e4a1ab4
---
M mncc_mt_loadgen.py
1 file changed, 10 insertions(+), 7 deletions(-)

Approvals:
  osmith: Verified
  laforge: Looks good to me, approved



diff --git a/mncc_mt_loadgen.py b/mncc_mt_loadgen.py
index 5f15e3b..e401fcb 100755
--- a/mncc_mt_loadgen.py
+++ b/mncc_mt_loadgen.py
@@ -109,12 +109,11 @@
 self.state = 'NULL'
 self.rtp_msc = None

-def start_call(self, msisdn_called, msisdn_calling):
+def start_call(self, msisdn_called, msisdn_calling, codec):
 '''Start a MT call from given [external] calling party to given mobile 
party MSISDN'''
 self.msisdn_called = msisdn_called
 self.msisdn_calling = msisdn_calling
 # allocate a RTP connection @ rtpsource
-codec = "GSM_FR"  # FIXME: make configurable
 r = self.ctrl_act.ask({'type':'rtp_create', 'cname':self.callref, 
'codec':codec})
 self.ext_rtp_host = r['remote_host']
 self.ext_rtp_port = r['remote_port']
@@ -173,23 +172,27 @@
 rtpctrl_act = RtpSourceCtrlActor.start(RTPSOURCE_CTRL_IP, RTPSOURCE_CTRL_PORT)
 
 # convenience wrapper
-def mt_call(msisdn_called, msisdn_calling = '123456789', codecs = 
GSM48.AllCodecs):
+def mt_call(msisdn_called, msisdn_calling='123456789', codecs=GSM48.AllCodecs, 
codec='GSM_FR'):
 call_conn = MTCallRtpsource.start(mncc_act, rtpctrl_act, codecs).proxy()
-call_conn.start_call(msisdn_called, msisdn_calling)
+call_conn.start_call(msisdn_called, msisdn_calling, codec)
 return call_conn

-def calls(nr, ramp=1.0):
+def calls(nr, ramp=1.0, codec='GSM_FR'):
 for i in range(nr):
 a = 90001 + i
 a = str(a)
 print("%d: mt_call(%r)" % (i, a))
-mt_call(a)
+mt_call(a, codec=codec)
 time.sleep(ramp)

 log.info("")
 log.info("")
-log.info("Start calls by typing:")
+log.info("Start a single call by typing:")
 log.info("mt_call('90001')")
+log.info("With a specific codec (default is 'GSM_FR'):")
+log.info("mt_call('90001', codec='GSM_EFR')")
+log.info("Start multiple calls with (e.g. 4 calls with EFR):")
+log.info("calls(4, codec='GSM_EFR')")
 log.info("")
 log.info("")


--
To view, visit https://gerrit.osmocom.org/c/mncc-python/+/17980
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: mncc-python
Gerrit-Branch: master
Gerrit-Change-Id: I5879b8b9ccc63908b9f6629487e66eff1e4a1ab4
Gerrit-Change-Number: 17980
Gerrit-PatchSet: 3
Gerrit-Owner: osmith 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-MessageType: merged


Change in mncc-python[master]: mncc_mt_loadgen.py: add codec arg

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/mncc-python/+/17980 )

Change subject: mncc_mt_loadgen.py: add codec arg
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/mncc-python/+/17980
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: mncc-python
Gerrit-Branch: master
Gerrit-Change-Id: I5879b8b9ccc63908b9f6629487e66eff1e4a1ab4
Gerrit-Change-Number: 17980
Gerrit-PatchSet: 3
Gerrit-Owner: osmith 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Fri, 01 May 2020 14:28:32 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in mncc-python[master]: rtpsource: Modularize generation of RTP frames

2020-05-01 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/mncc-python/+/17978 )

Change subject: rtpsource: Modularize generation of RTP frames
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/mncc-python/+/17978
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: mncc-python
Gerrit-Branch: master
Gerrit-Change-Id: Iad98e1753fef1927c0e8a7493372141372a38224
Gerrit-Change-Number: 17978
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Fri, 01 May 2020 14:27:26 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: RLCMAC_EncDec.cc: Fix egprs data block encode alignment

2020-05-01 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17992 )


Change subject: RLCMAC_EncDec.cc: Fix egprs data block encode alignment
..

RLCMAC_EncDec.cc: Fix egprs data block encode alignment

Selftests I'm using in the pcu testsuite to verify encoding are attached
too.

Change-Id: Id0e21248853eb5fac89e863822804cfbecf3c865
---
M library/RLCMAC_EncDec.cc
M library/RLCMAC_Templates.ttcn
M pcu/PCU_Tests.ttcn
M pcu/PCU_selftest.ttcn
4 files changed, 209 insertions(+), 14 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/92/17992/1

diff --git a/library/RLCMAC_EncDec.cc b/library/RLCMAC_EncDec.cc
index 8f3ff2f..d25a7e0 100644
--- a/library/RLCMAC_EncDec.cc
+++ b/library/RLCMAC_EncDec.cc
@@ -2,6 +2,7 @@
 #include 

 #include "RLCMAC_Types.hh"
+#include "RLCMAC_Templates.hh"
 #include "GSM_Types.hh"
 /* Decoding of TS 44.060 GPRS RLC/MAC blocks, portions requiring manual 
functions
  * beyond what TITAN RAW coder can handle internally.
@@ -172,6 +173,22 @@
 #endif
 } __attribute__ ((packed));

+/*
+static const char hex_chars[] = "0123456789abcdef";
+void printbuffer(const char* ptr, TTCN_Buffer& buf) {
+   int len = buf.get_len();
+   const unsigned char* cbuf = buf.get_data();
+
+   fprintf(stderr, "printbuffer %s (len=%d): [", ptr, len);
+
+   for (int i = 0; i < len; i++) {
+   fprintf(stderr, " %c%c", hex_chars[cbuf[i] >> 4], 
hex_chars[cbuf[i] & 0xf]);
+   }
+
+   fprintf(stderr, " ]\n");
+}
+*/
+
 static CodingScheme::enum_type payload_len_2_coding_scheme(size_t payload_len) 
{
switch (payload_len) {
case 23:
@@ -294,7 +311,7 @@
hdr_bytes = offset_bits / 8;
extra_bits = offset_bits % 8;

-   fprintf(stderr, "RLMAC: clone: hdr_bytes=%u extra_bits=%u 
(length_bytes=%u)\n", hdr_bytes, extra_bits, length_bytes);
+   //fprintf(stderr, "RLMAC: clone: hdr_bytes=%u extra_bits=%u 
(length_bytes=%u)\n", hdr_bytes, extra_bits, length_bytes);

if (extra_bits == 0) {
/* It is aligned already */
@@ -324,9 +341,8 @@
size_t length_bytes = (initial_spare_bits + length_bits + 7) / 8;
size_t accepted_len = length_bytes;

-   fprintf(stderr, "RLMAC: trying to allocate %u bytes (orig is %zu bytes 
long with read pos %zu)\n", length_bytes, orig_ttcn_buffer.get_len(), 
orig_ttcn_buffer.get_pos());
+   //fprintf(stderr, "RLMAC: trying to allocate %u bytes (orig is %zu 
bytes long with read pos %zu)\n", length_bytes, orig_ttcn_buffer.get_len(), 
orig_ttcn_buffer.get_pos());
dst_ttcn_buffer.get_end(aligned_buf, accepted_len);
-   fprintf(stderr, "RLMAC: For dst ptr=%p with length=%zu\n", aligned_buf, 
accepted_len);
if (accepted_len < length_bytes) {
fprintf(stderr, "RLMAC: ERROR! asked for %zu bytes but got 
%zu\n", length_bytes, accepted_len);
}
@@ -337,14 +353,90 @@
orig_ttcn_buffer.get_data(),
aligned_buf);

-   fprintf(stderr, "RLMAC: clone_aligned_buffer_lsbf success\n");
-
/* clear spare bits and move block header bits to the right */
aligned_buf[0] = aligned_buf[0] >> initial_spare_bits;

dst_ttcn_buffer.increase_length(length_bytes);
 }

+/* bit-shift the entire 'src' of length 'length_bytes'
+ * and store the result to caller-allocated 'buffer'  by 'offset_bits'.  The 
shifting is
+ * done lsb-first. */
+static void clone_unaligned_buffer_lsbf(unsigned int offset_bits, unsigned int 
length_bytes,
+   const uint8_t *src, uint8_t *buffer)
+{
+   unsigned int hdr_bytes;
+   unsigned int extra_bits;
+   unsigned int i;
+
+   uint8_t c, last_hdr_c, last_c;
+   uint8_t *dst;
+
+   hdr_bytes = offset_bits / 8;
+   extra_bits = offset_bits % 8;
+
+   //fprintf(stderr, "RLMAC: clone: hdr_bytes=%u extra_bits=%u 
(length_bytes=%u)\n", hdr_bytes, extra_bits, length_bytes);
+
+   if (extra_bits == 0) {
+   /* It is aligned already */
+   memcpy(buffer, src + hdr_bytes, length_bytes);
+   return;
+   }
+
+   /* Copy first header+data byte, it's not handled correctly by loop */
+   dst = buffer + hdr_bytes;
+   last_hdr_c = *dst;
+   last_c = *dst << (8 - extra_bits);
+
+   for (i = 0; i < length_bytes; i++) {
+   c = src[i];
+   *(dst++) = (last_c >> (8 - extra_bits)) | (c << extra_bits);
+   last_c = c;
+   }
+   /* overwrite the lower extra_bits */
+   *dst = (*dst & (0xff << extra_bits)) | (last_c >> (8 - extra_bits));
+
+   /* Copy back first header+data byte */
+   dst = buffer + hdr_bytes;
+   *(dst++) = last_hdr_c | (src[0] << (8 - extra_bits));
+   *dst |= (src[0] >> (extra_bits)) & (0xff >> (8 - extra_bits));
+}
+
+/* put an (aligned) EGPRS data block with given bit-offset and
+ * bit-length i

Build failure of network:osmocom:nightly/osmo-uecups in Debian_9.0/armv7l

2020-05-01 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-uecups/Debian_9.0/armv7l

Package network:osmocom:nightly/osmo-uecups failed to build in Debian_9.0/armv7l

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-uecups

Last lines of build log:
[  472s]^~~
[  472s] main.c: In function 'main':
[  472s] main.c:776:23: error: implicit declaration of function 
'osmo_signalfd_setup' [-Werror=implicit-function-declaration]
[  472s]   g_daemon->signalfd = osmo_signalfd_setup(g_daemon, sigset, 
signal_cb, g_daemon);
[  472s]^~~
[  472s] main.c:776:21: warning: assignment makes pointer from integer without 
a cast [-Wint-conversion]
[  472s]   g_daemon->signalfd = osmo_signalfd_setup(g_daemon, sigset, 
signal_cb, g_daemon);
[  472s]  ^
[  472s] cc1: some warnings being treated as errors
[  472s] Makefile:469: recipe for target 'main.o' failed
[  472s] make[3]: *** [main.o] Error 1
[  472s] make[3]: Leaving directory '/usr/src/packages/BUILD/daemon'
[  472s] Makefile:402: recipe for target 'all-recursive' failed
[  472s] make[2]: *** [all-recursive] Error 1
[  472s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  472s] Makefile:349: recipe for target 'all' failed
[  472s] make[1]: *** [all] Error 2
[  472s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  472s] dh_auto_build: make -j1 returned exit code 2
[  472s] debian/rules:45: recipe for target 'build' failed
[  472s] make: *** [build] Error 2
[  472s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  472s] ### VM INTERACTION START ###
[  475s] [  456.630044] sysrq: SysRq : Power Off
[  475s] [  456.670316] reboot: Power down
[  476s] ### VM INTERACTION END ###
[  476s] 
[  476s] armbuild24 failed "build osmo-uecups_0.1.3.1.8362.dsc" at Fri May  1 
07:23:24 UTC 2020.
[  476s] 

-- 
Configure notifications at https://build.opensuse.org/my/subscriptions
openSUSE Build Service (https://build.opensuse.org/)


Change in osmo-ttcn3-hacks[master]: RLCMAC_EncDEc.cc: Support decoding Egprs Ul Data HeaderType2

2020-05-01 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17990 )

Change subject: RLCMAC_EncDEc.cc: Support decoding Egprs Ul Data HeaderType2
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17990
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I4dfc994beb7d0ee5522770651150c77701c573fe
Gerrit-Change-Number: 17990
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Comment-Date: Fri, 01 May 2020 07:21:04 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: RLCMAC_EncDEc.cc: Use copied structure as other parts of the function

2020-05-01 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17989 )

Change subject: RLCMAC_EncDEc.cc: Use copied structure as other parts of the 
function
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17989
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iffe45b3d220c0f95f1fdb54e1b90f0a0cef88ee3
Gerrit-Change-Number: 17989
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Comment-Date: Fri, 01 May 2020 07:15:39 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: RLCMAC_EncDEc.cc: Fix encoding of tfi and rsb fields in Egprs Ul Hdea...

2020-05-01 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17988 )

Change subject: RLCMAC_EncDEc.cc: Fix encoding of tfi and rsb fields in Egprs 
Ul HdeaderType3
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17988
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id0f7cb29cf3a30aafdaaed2aca7d34277e3c975d
Gerrit-Change-Number: 17988
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Comment-Date: Fri, 01 May 2020 07:13:17 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: RLCMAC_EncDEc.cc: Fix wrong descriptors passed to RAW encoder

2020-05-01 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17987 )

Change subject: RLCMAC_EncDEc.cc: Fix wrong descriptors passed to RAW encoder
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17987
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ieb061d2914be086791e264a78ae14d3d55e10815
Gerrit-Change-Number: 17987
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Comment-Date: Fri, 01 May 2020 07:12:44 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: RLCMAC_EncDEc.cc: dec_RlcmacUl(Egprs)DataBlock: fix tlli and pfi unin...

2020-05-01 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17986 )

Change subject: RLCMAC_EncDEc.cc: dec_RlcmacUl(Egprs)DataBlock: fix tlli and 
pfi uninitialized instead of omit
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17986
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id63ae66cd715512f12eb87fd9ff0a9f5af93d5d2
Gerrit-Change-Number: 17986
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Comment-Date: Fri, 01 May 2020 07:10:27 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: cosmetic: RLCMAC_EncDEc.cc: fix typos in comments

2020-05-01 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17985 )

Change subject: cosmetic: RLCMAC_EncDEc.cc: fix typos in comments
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17985
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id91ed01759c3e1e2b52f1e35b1f4198fbc052408
Gerrit-Change-Number: 17985
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Comment-Date: Fri, 01 May 2020 07:09:00 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment