libosmocore[master]: gsm/gsm48.c: add call independent SS message names

2018-04-16 Thread Vadim Yanitskiy

Patch Set 1:

Please note that this change may break tests of some
projects in the following way:

'NCSS:0x3b (0xb:0x3b)' - > 'GSM0480_MTYPE_REGISTER'

-- 
To view, visit https://gerrit.osmocom.org/7846
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I697639d8469e5dda617b27995c4a92e1f0c0bead
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


[PATCH] libosmocore[master]: gsm/gsm48.c: add call independent SS message names

2018-04-16 Thread Vadim Yanitskiy

Review at  https://gerrit.osmocom.org/7846

gsm/gsm48.c: add call independent SS message names

Change-Id: I697639d8469e5dda617b27995c4a92e1f0c0bead
---
M src/gsm/gsm48.c
1 file changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/46/7846/1

diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c
index 0bce1ed..b4892de 100644
--- a/src/gsm/gsm48.c
+++ b/src/gsm/gsm48.c
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -944,6 +945,14 @@
{ 0, NULL }
 };
 
+/*! TS 04.80, section 3.4 Messages for supplementary services control */
+const struct value_string gsm48_nc_ss_msgtype_names[] = {
+   OSMO_VALUE_STRING(GSM0480_MTYPE_RELEASE_COMPLETE),
+   OSMO_VALUE_STRING(GSM0480_MTYPE_FACILITY),
+   OSMO_VALUE_STRING(GSM0480_MTYPE_REGISTER),
+   { 0, NULL }
+};
+
 /*! Compose a string naming the message type for given protocol.
  * If the message type string is known, return the message type name, otherwise
  * return ":".
@@ -966,6 +975,9 @@
case GSM48_PDISC_CC:
msgt_names = gsm48_cc_msgtype_names;
break;
+   case GSM48_PDISC_NC_SS:
+   msgt_names = gsm48_nc_ss_msgtype_names;
+   break;
default:
msgt_names = NULL;
break;

-- 
To view, visit https://gerrit.osmocom.org/7846
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I697639d8469e5dda617b27995c4a92e1f0c0bead
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


[PATCH] libosmocore[master]: protocol/gsm_04_08.h: drop incorrect GSM48_PDISC_USSD

2018-04-16 Thread Vadim Yanitskiy

Review at  https://gerrit.osmocom.org/7845

protocol/gsm_04_08.h: drop incorrect GSM48_PDISC_USSD

According to the GSM TS 04.07, section 11.2.3.1.1 "Protocol
discriminator", bits 1 to 4 of the first octet of a standard
L3 message contain the protocol discriminator IE.

Meanwhile, the GSM48_PDISC_USSD represents value 0x11, i.e.
0b10001, that requires 5 bits, and moreover it is not
documented anywhere. Let's drop it.

Change-Id: Ic4eb8a6db4ff1dfd535bd0c84e7acf1908422f64
---
M include/osmocom/gsm/protocol/gsm_04_08.h
M src/gsm/gsm48.c
2 files changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/45/7845/1

diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h 
b/include/osmocom/gsm/protocol/gsm_04_08.h
index 6a5fb3b..68ba650 100644
--- a/include/osmocom/gsm/protocol/gsm_04_08.h
+++ b/include/osmocom/gsm/protocol/gsm_04_08.h
@@ -977,7 +977,6 @@
 #define GSM48_PDISC_EXTEND 0x0e
 #define GSM48_PDISC_TEST   0x0f/* as per 11.10, 04.14 */
 #define GSM48_PDISC_MASK   0x0f
-#define GSM48_PDISC_USSD   0x11
 
 extern const struct value_string gsm48_pdisc_names[];
 static inline const char *gsm48_pdisc_name(uint8_t val)
diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c
index 468b2a9..0bce1ed 100644
--- a/src/gsm/gsm48.c
+++ b/src/gsm/gsm48.c
@@ -775,7 +775,6 @@
{ GSM48_PDISC_LOC,  "LCS" },
{ GSM48_PDISC_EXTEND,   "EXTD" },
{ GSM48_PDISC_MASK, "MASK" },
-   { GSM48_PDISC_USSD, "USSD" },
{ 0, NULL }
 };
 

-- 
To view, visit https://gerrit.osmocom.org/7845
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic4eb8a6db4ff1dfd535bd0c84e7acf1908422f64
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


[PATCH] libosmocore[master]: add gsm0808 channel enum to IE val conversion functions

2018-04-16 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/7844

add gsm0808 channel enum to IE val conversion functions

Add:
- gsm0808_current_channel_type_1()
- gsm0808_permitted_speech()
- gsm0808_chosen_channel()

gsm0808_permitted_speech() is moved from osmo-bsc's bssap_speech_from_lchan();
gsm0808_chosen_channel() is moved from osmo-bsc's lchan_to_chosen_channel();

Rationale: will be re-used by inter-BSC handover, makes sense to keep with the
other gsm0808 utils.

Related: OS#2283 (inter-BSC handover, BSC side)
Change-Id: I8a3cc5d4548e9a78d945d54c69ccced251edcec9
---
M include/osmocom/gsm/gsm0808_utils.h
1 file changed, 104 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/7844/1

diff --git a/include/osmocom/gsm/gsm0808_utils.h 
b/include/osmocom/gsm/gsm0808_utils.h
index c007c28..95bb315 100644
--- a/include/osmocom/gsm/gsm0808_utils.h
+++ b/include/osmocom/gsm/gsm0808_utils.h
@@ -27,6 +27,7 @@
 
 #include 
 #include 
+#include 
 
  /*! (225-1)/2 is the maximum number of elements in a cell identifier list. */
 #define GSM0808_CELL_ID_LIST2_MAXLEN   127
@@ -101,4 +102,107 @@
 int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc,
uint8_t perm_spch);
 
+/*! Return 3GPP TS 48.008 3.2.2.49 Current Channel Type 1 from enum 
gsm_chan_t. */
+static inline uint8_t gsm0808_current_channel_type_1(enum gsm_chan_t type)
+{
+   switch (type) {
+   default:
+   return 0;
+   case GSM_LCHAN_SDCCH:
+   return 0x01;
+   case GSM_LCHAN_TCH_F:
+   return 0x18;
+   case GSM_LCHAN_TCH_H:
+   return 0x19;
+   }
+}
+
+/*! Return 3GPP TS 48.008 3.2.2.51 Speech Version aka permitted speech version 
indication in 3.2.2.11
+ * Channel Type. */
+static inline enum gsm0808_permitted_speech gsm0808_permitted_speech(enum 
gsm_chan_t type,
+enum 
gsm48_chan_mode mode)
+{
+   switch (mode) {
+   case GSM48_CMODE_SPEECH_V1:
+   switch (type) {
+   case GSM_LCHAN_TCH_F:
+   return GSM0808_PERM_FR1;
+   case GSM_LCHAN_TCH_H:
+   return GSM0808_PERM_HR1;
+   default:
+   return 0;
+   }
+   case GSM48_CMODE_SPEECH_EFR:
+   switch (type) {
+   case GSM_LCHAN_TCH_F:
+   return GSM0808_PERM_FR2;
+   case GSM_LCHAN_TCH_H:
+   return GSM0808_PERM_HR2;
+   default:
+   return 0;
+   }
+   case GSM48_CMODE_SPEECH_AMR:
+   switch (type) {
+   case GSM_LCHAN_TCH_F:
+   return GSM0808_PERM_HR3;
+   case GSM_LCHAN_TCH_H:
+   return GSM0808_PERM_HR3;
+   default:
+   return 0;
+   }
+   default:
+   return 0;
+   }
+}
+
+/*! Return 3GPP TS 48.008 3.2.2.33 Chosen Channel. */
+static inline uint8_t gsm0808_chosen_channel(enum gsm_chan_t type, enum 
gsm48_chan_mode mode)
+{
+   uint8_t channel_mode = 0, channel = 0;
+
+   switch (mode) {
+   case GSM48_CMODE_SPEECH_V1:
+   case GSM48_CMODE_SPEECH_EFR:
+   case GSM48_CMODE_SPEECH_AMR:
+   channel_mode = 0x9;
+   break;
+   case GSM48_CMODE_SIGN:
+   channel_mode = 0x8;
+   break;
+   case GSM48_CMODE_DATA_14k5:
+   channel_mode = 0xe;
+   break;
+   case GSM48_CMODE_DATA_12k0:
+   channel_mode = 0xb;
+   break;
+   case GSM48_CMODE_DATA_6k0:
+   channel_mode = 0xc;
+   break;
+   case GSM48_CMODE_DATA_3k6:
+   channel_mode = 0xd;
+   break;
+   default:
+   return 0;
+   }
+
+   switch (type) {
+   case GSM_LCHAN_NONE:
+   channel = 0x0;
+   break;
+   case GSM_LCHAN_SDCCH:
+   channel = 0x1;
+   break;
+   case GSM_LCHAN_TCH_F:
+   channel = 0x8;
+   break;
+   case GSM_LCHAN_TCH_H:
+   channel = 0x9;
+   break;
+   default:
+   return 0;
+   }
+
+   return channel_mode << 4 | channel;
+}
+
 /*! @} */

-- 
To view, visit https://gerrit.osmocom.org/7844
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8a3cc5d4548e9a78d945d54c69ccced251edcec9
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] libosmocore[master]: add gsm0808_cell_{id, id_list}_name() and friends

2018-04-16 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/7843

add gsm0808_cell_{id,id_list}_name() and friends

Provide comprehensive API to obtain string representations of Cell Identifiers
and -Lists.

Change gsm0808_test.c to use the new functions (which simplifies the output a
bit), so that we don't duplicate printing code in gsm0808_test.c, and so that
the not-so-trivial printing code is also tested.

In gsm0808_test, also test gsm0808_cell_id_list_name_buf()'s return value and
truncation behavior.

The rationale for gsm0808_cell_id_list_name(), i.e. printing an entire list of
cell identifiers, is that even though the maximum is 127 elements, a list of
more than a few elements is hardly ever expected in practice (even more than
one element isn't actually expected: either "entire BSS" or a single LAC). It
is thus useful to log the entire list when it shows up in Paging and Handover.

Change-Id: I9b2106805422f96c5cc96ebb9178451355582df3
---
M include/osmocom/gsm/gsm0808_utils.h
M include/osmocom/gsm/protocol/gsm_08_08.h
M src/gsm/gsm0808_utils.c
M src/gsm/libosmogsm.map
M tests/gsm0808/gsm0808_test.c
M tests/gsm0808/gsm0808_test.ok
6 files changed, 199 insertions(+), 98 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/43/7843/1

diff --git a/include/osmocom/gsm/gsm0808_utils.h 
b/include/osmocom/gsm/gsm0808_utils.h
index 8e71b43..c007c28 100644
--- a/include/osmocom/gsm/gsm0808_utils.h
+++ b/include/osmocom/gsm/gsm0808_utils.h
@@ -55,6 +55,16 @@
unsigned int id_list_len;
 };
 
+extern const struct value_string gsm0808_cell_id_discr_names[];
+static inline const char *gsm0808_cell_id_discr_name(enum CELL_IDENT id_discr)
+{ return get_value_string(gsm0808_cell_id_discr_names, id_discr); }
+
+const char *gsm0808_cell_id_name(const struct gsm0808_cell_id *cid);
+const char *gsm0808_cell_id_list_name(const struct gsm0808_cell_id_list2 *cil);
+int gsm0808_cell_id_list_name_buf(char *buf, size_t buflen, const struct 
gsm0808_cell_id_list2 *cil);
+int gsm0808_cell_id_u_name(char *buf, size_t buflen,
+  enum CELL_IDENT id_discr, const union 
gsm0808_cell_id_u *u);
+
 uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg,
const struct sockaddr_storage *ss);
 int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss,
diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h 
b/include/osmocom/gsm/protocol/gsm_08_08.h
index 4539b96..5d2864f 100644
--- a/include/osmocom/gsm/protocol/gsm_08_08.h
+++ b/include/osmocom/gsm/protocol/gsm_08_08.h
@@ -10,7 +10,8 @@
 
 /*
  * this is from GSM 03.03 CGI but is copied in GSM 08.08
- * in § 3.2.2.27 for Cell Identifier List
+ * in § 3.2.2.27 for Cell Identifier List.
+ * See gsm0808_cell_id_discr_name() for a human readable representation.
  */
 enum CELL_IDENT {
CELL_IDENT_WHOLE_GLOBAL = 0,
diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c
index 73d9362..7ed4873 100644
--- a/src/gsm/gsm0808_utils.c
+++ b/src/gsm/gsm0808_utils.c
@@ -1130,4 +1130,132 @@
return 0;
 }
 
+/*! Print a human readable name of the cell identifier to the char buffer.
+ * This is useful both for struct gsm0808_cell_id and struct 
gsm0808_cell_id_list2.
+ * See also gsm0808_cell_id_name() and gsm0808_cell_id_list_name().
+ * \param[out] buf  Destination buffer to write string representation to.
+ * \param[in] buflen  Amount of memory available in \a buf.
+ * \param[in] id_discr  Cell Identifier type.
+ * \param[in] u  Cell Identifer value.
+ * \returns Like snprintf(): the amount of characters (excluding terminating 
nul) written,
+ *  or that would have been written if the buffer were large enough.
+ */
+int gsm0808_cell_id_u_name(char *buf, size_t buflen,
+  enum CELL_IDENT id_discr, const union 
gsm0808_cell_id_u *u)
+{
+   switch (id_discr) {
+   case CELL_IDENT_LAC:
+   return snprintf(buf, buflen, "%u", u->lac);
+   case CELL_IDENT_CI:
+   return snprintf(buf, buflen, "%u", u->ci);
+   case CELL_IDENT_LAC_AND_CI:
+   return snprintf(buf, buflen, "%u-%u", u->lac_and_ci.lac, 
u->lac_and_ci.ci);
+   case CELL_IDENT_LAI_AND_LAC:
+   return snprintf(buf, buflen, "%s", 
osmo_lai_name(>lai_and_lac));
+   case CELL_IDENT_WHOLE_GLOBAL:
+   return snprintf(buf, buflen, "%s", osmo_cgi_name(>global));
+   default:
+   /* For CELL_IDENT_BSS and CELL_IDENT_NO_CELL, just print the 
discriminator.
+* Same for kinds we have no string representation of yet. */
+   return snprintf(buf, buflen, "%s", 
gsm0808_cell_id_discr_name(id_discr));
+   }
+}
+
+/*! value_string[] for enum CELL_IDENT. */
+const struct value_string gsm0808_cell_id_discr_names[] = {
+   { CELL_IDENT_WHOLE_GLOBAL, "CGI" },
+   { CELL_IDENT_LAC_AND_CI, "LAC-CI" },
+   { CELL_IDENT_CI, "CI" },
+   { CELL_IDENT_NO_CELL, "NO-CELL" },
+   { 

[PATCH] libosmocore[master]: tlv: add TLV_GET() and TLV_GET_MINLEN()

2018-04-16 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/7842

tlv: add TLV_GET() and TLV_GET_MINLEN()

Rationale: so far we use code like

  if (TLVP_PRESENT(, VERY_LONG_ENUM_VALUE_NAME_THAT_NEVER_ENDS)) {
val = TLVP_VAL(, VERY_LONG_ENUM_VALUE_NAME_THAT_NEVER_ENDS);
len = TLVP_LEN(, VERY_L0NG_ENUM_VALUE_NAME_TH4T_NEVER_EMDS);
  }

This is a) very long and b) prone to picking the wrong name one of the three
times, which would use the wrong length or val without necessarily being
noticed. A safer and shorter, more readable pattern is:

  struct tlv_p_entry *e = TVLP_GET(, 
VERY_LONG_ENUM_VALUE_NAME_THAT_NEVER_ENDS);
  if (!e)
return -ENOENT;
  hexdump(e->val, e->len);

Change-Id: I445de17fc2daa3ab051f5708dd0cc185b23dc048
---
M include/osmocom/gsm/tlv.h
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/42/7842/1

diff --git a/include/osmocom/gsm/tlv.h b/include/osmocom/gsm/tlv.h
index 996f6aa..8fc7693 100644
--- a/include/osmocom/gsm/tlv.h
+++ b/include/osmocom/gsm/tlv.h
@@ -446,6 +446,16 @@
 #define TLVP_PRES_LEN(tp, tag, min_len) \
(TLVP_PRESENT(tp, tag) && TLVP_LEN(tp, tag) >= min_len)
 
+/* Usage:
+ * struct tlv_p_entry *e = TVLP_GET(, TAG);
+ * if (!e)
+ *   return -ENOENT;
+ * hexdump(e->val, e->len);
+ */
+#define TLVP_GET(_tp, tag) (TLVP_PRESENT(_tp, tag)? &_tp->lv[tag] : NULL)
+#define TLVP_GET_MINLEN(_tp, tag, min_len) \
+   (TLVP_PRES_LEN(_tp, tag, min_len)? &_tp->lv[tag] : NULL)
+
 /*! Align given TLV element with 16 bit value to an even address
  *  \param[in] tp pointer to \ref tlv_parsed
  *  \param[in] pos element to return

-- 
To view, visit https://gerrit.osmocom.org/7842
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I445de17fc2daa3ab051f5708dd0cc185b23dc048
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


Jenkins build is back to normal : master-osmo-bts » lc15,origin/nrw/litecell15-next,default,osmocom-master-debian9 #516

2018-04-16 Thread jenkins
See 




[PATCH] libosmo-sccp[master]: ipa_asp_fsm: Prevent against integer underflow

2018-04-16 Thread Harald Welte

Review at  https://gerrit.osmocom.org/7841

ipa_asp_fsm: Prevent against integer underflow

Ensure we don't pass a negative integer as "unsigned int len" to
ipa_asp_fsm_wait_id_get().  This could result in a remotely-triggered
integer underflow.

Change-Id: Idf9a5c0938e6ae6d47bf85ddfec3306fa3ddb3ce
---
M src/xua_asp_fsm.c
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/41/7841/1

diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index e81f0af..93c76cb 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -881,6 +881,11 @@
data_len = msgb_l2len(msg_get)-1;
LOGPFSM(fi, "Received IPA CCM IDENTITY REQUEST for IEs %s\n",
osmo_hexdump(req_data, data_len));
+   /* avoid possible unsigned integer underflow, as 
ipa_ccm_make_id_resp_from_req()
+* expects an unsigned integer, and in case of a zero-length L2 
message we might
+* have data_len == -1 here */
+   if (data_len < 0)
+   data_len = 0;
/* Send ID_RESP to server */
msg_resp = ipa_ccm_make_id_resp_from_req(iafp->ipa_unit, 
req_data, data_len);
if (!msg_resp) {

-- 
To view, visit https://gerrit.osmocom.org/7841
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf9a5c0938e6ae6d47bf85ddfec3306fa3ddb3ce
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] libosmocore[master]: prevent integer underflow in ipa_ccm_make_id_resp_from_req()

2018-04-16 Thread Harald Welte

Review at  https://gerrit.osmocom.org/7840

prevent integer underflow in ipa_ccm_make_id_resp_from_req()

don't blindly trust the tag-length value in an IPA CCM ID GET
message.  This could result in a remotely-triggered integer underflow.

Change-Id: I4723361e1094b358310541a7dc4c5c921c778a15
---
M src/gsm/ipa.c
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/40/7840/1

diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c
index e03f615..0c7aaad 100644
--- a/src/gsm/ipa.c
+++ b/src/gsm/ipa.c
@@ -328,7 +328,12 @@
ies[num_ies++] = t_tag;
 
cur += t_len;
-   len -= t_len;
+   /* prevent any unsigned integer underflow due to somebody 
sending us
+* messages with wrong length values */
+   if (len <= t_len)
+   len -= t_len;
+   else
+   len = 0;
}
return ipa_ccm_make_id_resp(dev, ies, num_ies);
 }

-- 
To view, visit https://gerrit.osmocom.org/7840
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4723361e1094b358310541a7dc4c5c921c778a15
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


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

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/armv7l

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

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

Last lines of build log:
[  163s]  #include 
[  163s]  ^
[  163s] compilation terminated.
[  163s] Makefile:455: recipe for target 'mgcp_protocol.o' failed
[  163s] make[4]: *** [mgcp_protocol.o] Error 1
[  163s] make[4]: Leaving directory 
'/usr/src/packages/BUILD/openbsc/src/libmgcp'
[  163s] Makefile:447: recipe for target 'all-recursive' failed
[  163s] make[3]: *** [all-recursive] Error 1
[  163s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/src'
[  163s] Makefile:518: recipe for target 'all-recursive' failed
[  163s] make[2]: *** [all-recursive] Error 1
[  163s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  163s] Makefile:427: recipe for target 'all' failed
[  163s] make[1]: *** [all] Error 2
[  163s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  163s] dh_auto_build: make -j1 returned exit code 2
[  163s] debian/rules:13: recipe for target 'build' failed
[  163s] make: *** [build] Error 2
[  163s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  163s] 
[  163s] armbuild16 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:51:51 UTC 2018.
[  163s] 
[  163s] ### VM INTERACTION START ###
[  166s] [  133.393182] SysRq : Power Off
[  166s] [  133.394645] reboot: Power down
[  166s] ### VM INTERACTION END ###
[  166s] 
[  166s] armbuild16 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:51:54 UTC 2018.
[  166s] 

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


Build failure of network:osmocom:nightly/libosmo-netif in Debian_9.0/armv7l

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/Debian_9.0/armv7l

Package network:osmocom:nightly/libosmo-netif failed to build in 
Debian_9.0/armv7l

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmo-netif

Last lines of build log:
[  206s] Makefile:476: recipe for target 'jibuf/jibuf_tool.o' failed
[  206s] make[5]: *** [jibuf/jibuf_tool.o] Error 1
[  206s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests'
[  206s] Makefile:585: recipe for target 'check-am' failed
[  206s] make[4]: *** [check-am] Error 2
[  206s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests'
[  206s] Makefile:494: recipe for target 'check-recursive' failed
[  206s] make[3]: *** [check-recursive] Error 1
[  206s] make[3]: Leaving directory '/usr/src/packages/BUILD'
[  206s] Makefile:785: recipe for target 'check' failed
[  206s] make[2]: *** [check] Error 2
[  206s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  206s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2
[  206s] debian/rules:31: recipe for target 'override_dh_auto_test' failed
[  206s] make[1]: *** [override_dh_auto_test] Error 1
[  206s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  206s] debian/rules:13: recipe for target 'build' failed
[  206s] make: *** [build] Error 2
[  206s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  206s] 
[  206s] armbuild15 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 
16 20:44:19 UTC 2018.
[  206s] 
[  206s] ### VM INTERACTION START ###
[  209s] [  175.137606] sysrq: SysRq : Power Off
[  209s] [  175.139900] reboot: Power down
[  209s] ### VM INTERACTION END ###
[  209s] 
[  209s] armbuild15 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 
16 20:44:23 UTC 2018.
[  209s] 

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


osmo-bsc[master]: gscon: fix assignment of signalling channels

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/7838/1/src/libbsc/bsc_subscr_conn_fsm.c
File src/libbsc/bsc_subscr_conn_fsm.c:

Line 244:   if (!voice) {
I think this is inverted logic here.  "voice" parameter should indicate if it 
is a voice assingment (true) or not (false).  But you're now checking if it's 
*not* a voice assignment, and then add speech codec related bits in such cases?


-- 
To view, visit https://gerrit.osmocom.org/7838
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I316ebcb1f27b668e17fe48fff028e047aac47f76
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: Yes


osmo-ttcn3-hacks[master]: BSC_Tests: handle mode modify also for signalling

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review-1

why would we want a MODE MODIFY handling in a pure signaling assignment?  What 
kind of modification is performed there?  The channel is in SIGNALING mode from 
the point of immediate assignment onwards, and it still is in SIGNALING mode at 
the time we receive an assignment command (sign).  So in this situation the 
expectation is that there's no modification (that would be signalling->speech) 
and no assignment (as that would change to a different channel).  So all in 
all, there should just be BSSAP ASS CMD and BSSAP ASS CMPL with nothing 
happening at all on the RSL side.  Please correct me if you think differenly

-- 
To view, visit https://gerrit.osmocom.org/7837
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie0e5f15c1a13b773a7693918942e7ff92dfb99d6
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: BSC_Tests: Assign g_pars in TC_assignment_sign

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7836
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iad65d8ff8bfb98df2b212c69916f1e74dc2c61af
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-mgw[master]: stats: use libosmocore rate counter for in/out_stream.err_ts...

2018-04-16 Thread Harald Welte

Patch Set 2:

comments were not addressed, patch seems to just have been rebased.

-- 
To view, visit https://gerrit.osmocom.org/7555
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I67aa7a8602f60366ef3ba2c5b1319b1b85719f64
Gerrit-PatchSet: 2
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


[MERGED] osmo-ttcn3-hacks[master]: BSC_Tests: Assign g_pars in TC_assignment_sign

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: BSC_Tests: Assign g_pars in TC_assignment_sign
..


BSC_Tests: Assign g_pars in TC_assignment_sign

The testcase TC_assignment_sign does not assign g_pars in its
test function. However, it assigns local variable pars but then
never uses it.

- remove local variable pars and assign g_pars instead

Change-Id: Iad65d8ff8bfb98df2b212c69916f1e74dc2c61af
Related: OS#2762
---
M bsc/BSC_Tests.ttcn
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 0dfb708..8380175 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1558,7 +1558,7 @@
 
 
 private function f_tc_assignment_sign(charstring id) runs on MSC_ConnHdlr {
-   var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+   g_pars := valueof(t_def_TestHdlrPars);
var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, 
omit);
var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, omit));
 

-- 
To view, visit https://gerrit.osmocom.org/7836
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iad65d8ff8bfb98df2b212c69916f1e74dc2c61af
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[ABANDON] openbsc[master]: libmsc/db: Prevent subscr->extension without NULL termination

2018-04-16 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: libmsc/db: Prevent subscr->extension without NULL termination
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/1311
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ic1ae7b2d9dde8dab8f7795e5baa8918424f5f393
Gerrit-PatchSet: 4
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[ABANDON] openbsc[master]: Fix build after recent rate_ctr patches

2018-04-16 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: Fix build after recent rate_ctr patches
..


Abandoned

-- 
To view, visit https://gerrit.osmocom.org/4416
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: abandon
Gerrit-Change-Id: I84558866b478abeb19855a771c9cb6483d04cca0
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


Build failure of network:osmocom:nightly/openbsc in Debian_9.0/x86_64

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/x86_64

Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/x86_64

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

Last lines of build log:
[   82s] ../../include/openbsc/mgcp_internal.h:28:33: fatal error: 
osmocom/netif/jibuf.h: No such file or directory
[   82s]  #include 
[   82s]  ^
[   82s] compilation terminated.
[   82s] Makefile:455: recipe for target 'mgcp_protocol.o' failed
[   82s] make[4]: *** [mgcp_protocol.o] Error 1
[   82s] make[4]: Leaving directory 
'/usr/src/packages/BUILD/openbsc/src/libmgcp'
[   82s] Makefile:447: recipe for target 'all-recursive' failed
[   82s] make[3]: *** [all-recursive] Error 1
[   82s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/src'
[   82s] Makefile:518: recipe for target 'all-recursive' failed
[   82s] make[2]: *** [all-recursive] Error 1
[   82s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[   82s] Makefile:427: recipe for target 'all' failed
[   82s] make[1]: *** [all] Error 2
[   82s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[   82s] dh_auto_build: make -j1 returned exit code 2
[   82s] debian/rules:13: recipe for target 'build' failed
[   82s] make: *** [build] Error 2
[   82s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[   82s] 
[   82s] lamb59 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:17:29 UTC 2018.
[   82s] 
[   82s] ### VM INTERACTION START ###
[   85s] [   77.506453] reboot: Power down
[   85s] ### VM INTERACTION END ###
[   85s] 
[   85s] lamb59 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:17:32 UTC 2018.
[   85s] 

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


Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/x86_64

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/x86_64

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/x86_64

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

Last lines of build log:
[   98s] ../../include/openbsc/mgcp_internal.h:28:33: fatal error: 
osmocom/netif/jibuf.h: No such file or directory
[   98s]  #include 
[   98s]  ^
[   98s] compilation terminated.
[   98s] Makefile:455: recipe for target 'mgcp_protocol.o' failed
[   98s] make[4]: *** [mgcp_protocol.o] Error 1
[   98s] make[4]: Leaving directory 
'/usr/src/packages/BUILD/openbsc/src/libmgcp'
[   98s] Makefile:447: recipe for target 'all-recursive' failed
[   98s] make[3]: *** [all-recursive] Error 1
[   98s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/src'
[   98s] Makefile:518: recipe for target 'all-recursive' failed
[   98s] make[2]: *** [all-recursive] Error 1
[   98s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[   98s] Makefile:427: recipe for target 'all' failed
[   98s] make[1]: *** [all] Error 2
[   98s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[   98s] dh_auto_build: make -j1 returned exit code 2
[   98s] debian/rules:13: recipe for target 'build' failed
[   98s] make: *** [build] Error 2
[   98s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[   98s] 
[   98s] lamb56 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:17:40 UTC 2018.
[   98s] 
[   98s] ### VM INTERACTION START ###
[  102s] [   94.385422] reboot: Power down
[  102s] ### VM INTERACTION END ###
[  102s] 
[  102s] lamb56 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:17:44 UTC 2018.
[  102s] 

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


Build failure of network:osmocom:nightly/openbsc in Debian_8.0/x86_64

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_8.0/x86_64

Package network:osmocom:nightly/openbsc failed to build in Debian_8.0/x86_64

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

Last lines of build log:
[   94s]  #include 
[   94s]  ^
[   94s] compilation terminated.
[   94s] Makefile:443: recipe for target 'mgcp_protocol.o' failed
[   94s] make[4]: *** [mgcp_protocol.o] Error 1
[   94s] make[4]: Leaving directory 
'/usr/src/packages/BUILD/openbsc/src/libmgcp'
[   94s] Makefile:435: recipe for target 'all-recursive' failed
[   94s] make[3]: *** [all-recursive] Error 1
[   94s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/src'
[   94s] Makefile:507: recipe for target 'all-recursive' failed
[   94s] make[2]: *** [all-recursive] Error 1
[   94s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[   94s] Makefile:415: recipe for target 'all' failed
[   94s] make[1]: *** [all] Error 2
[   94s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[   94s] dh_auto_build: make -j1 returned exit code 2
[   94s] debian/rules:13: recipe for target 'build' failed
[   94s] make: *** [build] Error 2
[   94s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[   94s] 
[   94s] lamb53 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:17:31 UTC 2018.
[   94s] 
[   94s] ### VM INTERACTION START ###
[   95s] Powering off.
[   95s] [   88.305247] reboot: Power down
[   95s] ### VM INTERACTION END ###
[   95s] 
[   95s] lamb53 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:17:33 UTC 2018.
[   95s] 

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


Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.04/x86_64

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.04/x86_64

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.04/x86_64

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

Last lines of build log:
[  146s] gcc -DHAVE_CONFIG_H -I. -I../..   -I../../include -I../..  -Wdate-time 
-D_FORTIFY_SOURCE=2 -Wall -I/usr/include/ -I/usr/include/ -I/usr/include/-g 
-O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security 
-Werror=implicit -Werror=maybe-uninitialized -Werror=memset-transposed-args 
-Werror=sizeof-array-argument -Werror=sizeof-pointer-memaccess -c -o 
mgcp_protocol.o mgcp_protocol.c
[  146s] In file included from mgcp_protocol.c:37:0:
[  146s] ../../include/openbsc/mgcp_internal.h:28:33: fatal error: 
osmocom/netif/jibuf.h: No such file or directory
[  146s] compilation terminated.
[  146s] Makefile:455: recipe for target 'mgcp_protocol.o' failed
[  146s] make[4]: *** [mgcp_protocol.o] Error 1
[  146s] make[4]: Leaving directory 
'/usr/src/packages/BUILD/openbsc/src/libmgcp'
[  146s] Makefile:447: recipe for target 'all-recursive' failed
[  146s] make[3]: *** [all-recursive] Error 1
[  146s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/src'
[  146s] Makefile:518: recipe for target 'all-recursive' failed
[  146s] make[2]: *** [all-recursive] Error 1
[  146s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  146s] Makefile:427: recipe for target 'all' failed
[  146s] make[1]: *** [all] Error 2
[  146s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  146s] dh_auto_build: make -j1 returned exit code 2
[  146s] debian/rules:13: recipe for target 'build' failed
[  146s] make: *** [build] Error 2
[  146s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  146s] 
[  146s] cloud128 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:16:41 UTC 2018.
[  146s] 
[  146s] ### VM INTERACTION START ###
[  150s] [  131.594769] reboot: Power down
[  151s] ### VM INTERACTION END ###
[  152s] 
[  152s] cloud128 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:16:46 UTC 2018.
[  152s] 

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


Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/x86_64

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/x86_64

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/x86_64

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

Last lines of build log:
[   85s] ../../include/openbsc/mgcp_internal.h:28:33: fatal error: 
osmocom/netif/jibuf.h: No such file or directory
[   85s]  #include 
[   85s]  ^
[   85s] compilation terminated.
[   85s] Makefile:455: recipe for target 'mgcp_protocol.o' failed
[   85s] make[4]: *** [mgcp_protocol.o] Error 1
[   85s] make[4]: Leaving directory 
'/usr/src/packages/BUILD/openbsc/src/libmgcp'
[   85s] Makefile:447: recipe for target 'all-recursive' failed
[   85s] make[3]: *** [all-recursive] Error 1
[   85s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/src'
[   85s] Makefile:518: recipe for target 'all-recursive' failed
[   85s] make[2]: *** [all-recursive] Error 1
[   85s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[   85s] Makefile:427: recipe for target 'all' failed
[   85s] make[1]: *** [all] Error 2
[   85s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[   85s] dh_auto_build: make -j1 returned exit code 2
[   85s] debian/rules:13: recipe for target 'build' failed
[   85s] make: *** [build] Error 2
[   85s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[   85s] 
[   85s] lamb19 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:16:31 UTC 2018.
[   85s] 
[   85s] ### VM INTERACTION START ###
[   88s] [   80.338236] reboot: Power down
[   88s] ### VM INTERACTION END ###
[   88s] 
[   88s] lamb19 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:16:34 UTC 2018.
[   88s] 

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


Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.10/x86_64

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.10/x86_64

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.10/x86_64

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

Last lines of build log:
[   72s] ../../include/openbsc/mgcp_internal.h:28:10: fatal error: 
osmocom/netif/jibuf.h: No such file or directory
[   72s]  #include 
[   72s]   ^~~
[   72s] compilation terminated.
[   72s] Makefile:455: recipe for target 'mgcp_protocol.o' failed
[   73s] make[4]: *** [mgcp_protocol.o] Error 1
[   73s] make[4]: Leaving directory 
'/usr/src/packages/BUILD/openbsc/src/libmgcp'
[   73s] Makefile:447: recipe for target 'all-recursive' failed
[   73s] make[3]: *** [all-recursive] Error 1
[   73s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/src'
[   73s] Makefile:518: recipe for target 'all-recursive' failed
[   73s] make[2]: *** [all-recursive] Error 1
[   73s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[   73s] Makefile:427: recipe for target 'all' failed
[   73s] make[1]: *** [all] Error 2
[   73s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[   73s] dh_auto_build: make -j1 returned exit code 2
[   73s] debian/rules:13: recipe for target 'build' failed
[   73s] make: *** [build] Error 2
[   73s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[   73s] 
[   73s] build84 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:13:48 UTC 2018.
[   73s] 
[   73s] ### VM INTERACTION START ###
[   76s] [   69.372320] reboot: Power down
[   76s] ### VM INTERACTION END ###
[   77s] 
[   77s] build84 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:13:53 UTC 2018.
[   77s] 

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


Build failure of network:osmocom:nightly/libosmo-netif in Debian_9.0/x86_64

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/Debian_9.0/x86_64

Package network:osmocom:nightly/libosmo-netif failed to build in 
Debian_9.0/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmo-netif

Last lines of build log:
[   93s] compilation terminated.
[   93s] Makefile:476: recipe for target 'jibuf/jibuf_tool.o' failed
[   93s] make[5]: *** [jibuf/jibuf_tool.o] Error 1
[   93s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests'
[   93s] Makefile:585: recipe for target 'check-am' failed
[   93s] make[4]: *** [check-am] Error 2
[   93s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests'
[   93s] Makefile:494: recipe for target 'check-recursive' failed
[   93s] make[3]: *** [check-recursive] Error 1
[   93s] make[3]: Leaving directory '/usr/src/packages/BUILD'
[   93s] Makefile:785: recipe for target 'check' failed
[   93s] make[2]: *** [check] Error 2
[   93s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[   93s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2
[   93s] debian/rules:31: recipe for target 'override_dh_auto_test' failed
[   93s] make[1]: *** [override_dh_auto_test] Error 1
[   93s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[   93s] debian/rules:13: recipe for target 'build' failed
[   93s] make: *** [build] Error 2
[   93s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[   93s] 
[   93s] lamb06 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:12:15 UTC 2018.
[   93s] 
[   93s] ### VM INTERACTION START ###
[   96s] [   88.094668] reboot: Power down
[   96s] ### VM INTERACTION END ###
[   96s] 
[   96s] lamb06 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:12:19 UTC 2018.
[   96s] 

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


Build failure of network:osmocom:nightly/libosmo-netif in Debian_8.0/x86_64

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/Debian_8.0/x86_64

Package network:osmocom:nightly/libosmo-netif failed to build in 
Debian_8.0/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmo-netif

Last lines of build log:
[   97s] Makefile:464: recipe for target 'jibuf/jibuf_tool.o' failed
[   97s] make[5]: *** [jibuf/jibuf_tool.o] Error 1
[   97s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests'
[   97s] Makefile:573: recipe for target 'check-am' failed
[   97s] make[4]: *** [check-am] Error 2
[   97s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests'
[   97s] Makefile:483: recipe for target 'check-recursive' failed
[   97s] make[3]: *** [check-recursive] Error 1
[   97s] make[3]: Leaving directory '/usr/src/packages/BUILD'
[   97s] Makefile:774: recipe for target 'check' failed
[   97s] make[2]: *** [check] Error 2
[   97s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[   97s] dh_auto_test: make -j1 check returned exit code 2
[   97s] debian/rules:31: recipe for target 'override_dh_auto_test' failed
[   97s] make[1]: *** [override_dh_auto_test] Error 1
[   97s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[   97s] debian/rules:13: recipe for target 'build' failed
[   97s] make: *** [build] Error 2
[   97s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[   97s] 
[   97s] lamb53 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:11:50 UTC 2018.
[   97s] 
[   97s] ### VM INTERACTION START ###
[   98s] Powering off.
[   98s] [   90.908752] reboot: Power down
[   98s] ### VM INTERACTION END ###
[   98s] 
[   98s] lamb53 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:11:52 UTC 2018.
[   98s] 

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


Build failure of network:osmocom:nightly/libosmo-netif in xUbuntu_16.10/x86_64

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/xUbuntu_16.10/x86_64

Package network:osmocom:nightly/libosmo-netif failed to build in 
xUbuntu_16.10/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmo-netif

Last lines of build log:
[   71s] compilation terminated.
[   71s] Makefile:476: recipe for target 'jibuf/jibuf_tool.o' failed
[   71s] make[5]: *** [jibuf/jibuf_tool.o] Error 1
[   71s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests'
[   71s] Makefile:585: recipe for target 'check-am' failed
[   71s] make[4]: *** [check-am] Error 2
[   71s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests'
[   71s] Makefile:494: recipe for target 'check-recursive' failed
[   71s] make[3]: *** [check-recursive] Error 1
[   71s] make[3]: Leaving directory '/usr/src/packages/BUILD'
[   71s] Makefile:785: recipe for target 'check' failed
[   71s] make[2]: *** [check] Error 2
[   71s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[   71s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2
[   71s] debian/rules:31: recipe for target 'override_dh_auto_test' failed
[   71s] make[1]: *** [override_dh_auto_test] Error 1
[   71s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[   71s] debian/rules:13: recipe for target 'build' failed
[   71s] make: *** [build] Error 2
[   71s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[   71s] 
[   71s] build81 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:10:05 UTC 2018.
[   71s] 
[   71s] ### VM INTERACTION START ###
[   74s] [   67.691230] reboot: Power down
[   74s] ### VM INTERACTION END ###
[   74s] 
[   74s] build81 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:10:09 UTC 2018.
[   74s] 

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


Build failure of network:osmocom:nightly/libosmo-netif in xUbuntu_17.04/x86_64

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/xUbuntu_17.04/x86_64

Package network:osmocom:nightly/libosmo-netif failed to build in 
xUbuntu_17.04/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmo-netif

Last lines of build log:
[  127s] compilation terminated.
[  127s] Makefile:476: recipe for target 'jibuf/jibuf_tool.o' failed
[  127s] make[5]: *** [jibuf/jibuf_tool.o] Error 1
[  127s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests'
[  127s] Makefile:585: recipe for target 'check-am' failed
[  127s] make[4]: *** [check-am] Error 2
[  127s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests'
[  127s] Makefile:494: recipe for target 'check-recursive' failed
[  127s] make[3]: *** [check-recursive] Error 1
[  127s] make[3]: Leaving directory '/usr/src/packages/BUILD'
[  127s] Makefile:785: recipe for target 'check' failed
[  127s] make[2]: *** [check] Error 2
[  127s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  127s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2
[  127s] debian/rules:31: recipe for target 'override_dh_auto_test' failed
[  127s] make[1]: *** [override_dh_auto_test] Error 1
[  127s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  127s] debian/rules:13: recipe for target 'build' failed
[  127s] make: *** [build] Error 2
[  127s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  127s] 
[  127s] build34 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:10:10 UTC 2018.
[  127s] 
[  127s] ### VM INTERACTION START ###
[  130s] [  121.529726] reboot: Power down
[  130s] ### VM INTERACTION END ###
[  130s] 
[  130s] build34 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:10:13 UTC 2018.
[  130s] 

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


Build failure of network:osmocom:nightly/openbsc in Debian_9.0/aarch64

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/aarch64

Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/aarch64

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

Last lines of build log:
[  149s]  #include 
[  149s]  ^
[  149s] compilation terminated.
[  149s] Makefile:455: recipe for target 'mgcp_protocol.o' failed
[  149s] make[4]: *** [mgcp_protocol.o] Error 1
[  149s] make[4]: Leaving directory 
'/usr/src/packages/BUILD/openbsc/src/libmgcp'
[  149s] Makefile:447: recipe for target 'all-recursive' failed
[  149s] make[3]: *** [all-recursive] Error 1
[  149s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/src'
[  149s] Makefile:518: recipe for target 'all-recursive' failed
[  149s] make[2]: *** [all-recursive] Error 1
[  149s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  149s] Makefile:427: recipe for target 'all' failed
[  149s] make[1]: *** [all] Error 2
[  149s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  149s] dh_auto_build: make -j1 returned exit code 2
[  149s] debian/rules:13: recipe for target 'build' failed
[  149s] make: *** [build] Error 2
[  149s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  149s] 
[  149s] obs-arm-4 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:10:51 UTC 2018.
[  149s] 
[  149s] ### VM INTERACTION START ###
[  152s] [  130.162336] sysrq: SysRq : Power Off
[  152s] [  130.165697] reboot: Power down
[  152s] ### VM INTERACTION END ###
[  152s] 
[  152s] obs-arm-4 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:10:55 UTC 2018.
[  152s] 

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


Build failure of network:osmocom:nightly/libosmo-netif in xUbuntu_16.04/x86_64

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/xUbuntu_16.04/x86_64

Package network:osmocom:nightly/libosmo-netif failed to build in 
xUbuntu_16.04/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmo-netif

Last lines of build log:
[  127s] compilation terminated.
[  127s] Makefile:476: recipe for target 'jibuf/jibuf_tool.o' failed
[  127s] make[5]: *** [jibuf/jibuf_tool.o] Error 1
[  127s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests'
[  127s] Makefile:585: recipe for target 'check-am' failed
[  127s] make[4]: *** [check-am] Error 2
[  127s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests'
[  127s] Makefile:494: recipe for target 'check-recursive' failed
[  127s] make[3]: *** [check-recursive] Error 1
[  127s] make[3]: Leaving directory '/usr/src/packages/BUILD'
[  127s] Makefile:785: recipe for target 'check' failed
[  127s] make[2]: *** [check] Error 2
[  127s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  127s] dh_auto_test: make -j1 check returned exit code 2
[  127s] debian/rules:31: recipe for target 'override_dh_auto_test' failed
[  127s] make[1]: *** [override_dh_auto_test] Error 1
[  127s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  127s] debian/rules:13: recipe for target 'build' failed
[  127s] make: *** [build] Error 2
[  127s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  127s] 
[  127s] build32 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:10:50 UTC 2018.
[  127s] 
[  127s] ### VM INTERACTION START ###
[  130s] [  119.218447] reboot: Power down
[  130s] ### VM INTERACTION END ###
[  130s] 
[  130s] build32 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:10:54 UTC 2018.
[  130s] 

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


Build failure of network:osmocom:nightly/libosmo-netif in xUbuntu_17.10/x86_64

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/xUbuntu_17.10/x86_64

Package network:osmocom:nightly/libosmo-netif failed to build in 
xUbuntu_17.10/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmo-netif

Last lines of build log:
[   77s] compilation terminated.
[   77s] Makefile:476: recipe for target 'jibuf/jibuf_tool.o' failed
[   77s] make[5]: *** [jibuf/jibuf_tool.o] Error 1
[   77s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests'
[   77s] Makefile:585: recipe for target 'check-am' failed
[   77s] make[4]: *** [check-am] Error 2
[   77s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests'
[   77s] Makefile:494: recipe for target 'check-recursive' failed
[   77s] make[3]: *** [check-recursive] Error 1
[   77s] make[3]: Leaving directory '/usr/src/packages/BUILD'
[   77s] Makefile:785: recipe for target 'check' failed
[   77s] make[2]: *** [check] Error 2
[   77s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[   77s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2
[   77s] debian/rules:31: recipe for target 'override_dh_auto_test' failed
[   77s] make[1]: *** [override_dh_auto_test] Error 1
[   77s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[   77s] debian/rules:13: recipe for target 'build' failed
[   77s] make: *** [build] Error 2
[   77s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[   77s] 
[   77s] build78 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:09:28 UTC 2018.
[   77s] 
[   77s] ### VM INTERACTION START ###
[   80s] [   73.165320] reboot: Power down
[   80s] ### VM INTERACTION END ###
[   80s] 
[   80s] build78 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:09:31 UTC 2018.
[   80s] 

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


Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/i586

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/i586

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/i586

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

Last lines of build log:
[  111s] ../../include/openbsc/mgcp_internal.h:28:33: fatal error: 
osmocom/netif/jibuf.h: No such file or directory
[  111s]  #include 
[  111s]  ^
[  111s] compilation terminated.
[  111s] Makefile:455: recipe for target 'mgcp_protocol.o' failed
[  111s] make[4]: *** [mgcp_protocol.o] Error 1
[  111s] make[4]: Leaving directory 
'/usr/src/packages/BUILD/openbsc/src/libmgcp'
[  111s] Makefile:447: recipe for target 'all-recursive' failed
[  111s] make[3]: *** [all-recursive] Error 1
[  111s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/src'
[  111s] Makefile:518: recipe for target 'all-recursive' failed
[  111s] make[2]: *** [all-recursive] Error 1
[  111s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  111s] Makefile:427: recipe for target 'all' failed
[  111s] make[1]: *** [all] Error 2
[  111s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  111s] dh_auto_build: make -j1 returned exit code 2
[  111s] debian/rules:13: recipe for target 'build' failed
[  111s] make: *** [build] Error 2
[  111s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  111s] 
[  111s] lamb01 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:09:48 UTC 2018.
[  111s] 
[  111s] ### VM INTERACTION START ###
[  114s] [  107.698964] reboot: Power down
[  114s] ### VM INTERACTION END ###
[  114s] 
[  114s] lamb01 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:09:51 UTC 2018.
[  114s] 

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


Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/i586

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/i586

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/i586

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

Last lines of build log:
[   78s] In file included from mgcp_protocol.c:37:0:
[   78s] ../../include/openbsc/mgcp_internal.h:28:33: fatal error: 
osmocom/netif/jibuf.h: No such file or directory
[   78s]  #include 
[   78s]  ^
[   78s] compilation terminated.
[   78s] Makefile:455: recipe for target 'mgcp_protocol.o' failed
[   78s] make[4]: *** [mgcp_protocol.o] Error 1
[   78s] make[4]: Leaving directory 
'/usr/src/packages/BUILD/openbsc/src/libmgcp'
[   78s] Makefile:447: recipe for target 'all-recursive' failed
[   78s] make[3]: *** [all-recursive] Error 1
[   78s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/src'
[   78s] Makefile:518: recipe for target 'all-recursive' failed
[   78s] make[2]: *** [all-recursive] Error 1
[   78s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[   78s] Makefile:427: recipe for target 'all' failed
[   78s] make[1]: *** [all] Error 2
[   78s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[   78s] dh_auto_build: make -j1 returned exit code 2
[   78s] debian/rules:13: recipe for target 'build' failed
[   78s] make: *** [build] Error 2
[   78s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[   78s] 
[   78s] build84 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:05:31 UTC 2018.
[   78s] 
[   78s] ### VM INTERACTION START ###
[   81s] [   76.149311] reboot: Power down
[   82s] ### VM INTERACTION END ###
[   83s] 
[   83s] build84 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:05:36 UTC 2018.

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


Build failure of network:osmocom:nightly/libosmo-netif in xUbuntu_16.10/i586

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/xUbuntu_16.10/i586

Package network:osmocom:nightly/libosmo-netif failed to build in 
xUbuntu_16.10/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmo-netif

Last lines of build log:
[  148s] compilation terminated.
[  148s] Makefile:476: recipe for target 'jibuf/jibuf_tool.o' failed
[  148s] make[5]: *** [jibuf/jibuf_tool.o] Error 1
[  148s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests'
[  148s] Makefile:585: recipe for target 'check-am' failed
[  148s] make[4]: *** [check-am] Error 2
[  148s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests'
[  148s] Makefile:494: recipe for target 'check-recursive' failed
[  148s] make[3]: *** [check-recursive] Error 1
[  148s] make[3]: Leaving directory '/usr/src/packages/BUILD'
[  148s] Makefile:785: recipe for target 'check' failed
[  148s] make[2]: *** [check] Error 2
[  148s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  148s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2
[  148s] debian/rules:31: recipe for target 'override_dh_auto_test' failed
[  148s] make[1]: *** [override_dh_auto_test] Error 1
[  148s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  148s] debian/rules:13: recipe for target 'build' failed
[  148s] make: *** [build] Error 2
[  148s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  148s] 
[  148s] lamb59 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:04:07 UTC 2018.
[  148s] 
[  148s] ### VM INTERACTION START ###
[  151s] [  133.011725] reboot: Power down
[  151s] ### VM INTERACTION END ###
[  151s] 
[  151s] lamb59 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:04:11 UTC 2018.
[  151s] 

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


Build failure of network:osmocom:nightly/libosmo-netif in Debian_9.0/aarch64

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/Debian_9.0/aarch64

Package network:osmocom:nightly/libosmo-netif failed to build in 
Debian_9.0/aarch64

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmo-netif

Last lines of build log:
[  172s] Makefile:476: recipe for target 'jibuf/jibuf_tool.o' failed
[  172s] make[5]: *** [jibuf/jibuf_tool.o] Error 1
[  172s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests'
[  172s] Makefile:585: recipe for target 'check-am' failed
[  172s] make[4]: *** [check-am] Error 2
[  172s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests'
[  172s] Makefile:494: recipe for target 'check-recursive' failed
[  172s] make[3]: *** [check-recursive] Error 1
[  172s] make[3]: Leaving directory '/usr/src/packages/BUILD'
[  172s] Makefile:785: recipe for target 'check' failed
[  172s] make[2]: *** [check] Error 2
[  172s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  172s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2
[  172s] debian/rules:31: recipe for target 'override_dh_auto_test' failed
[  172s] make[1]: *** [override_dh_auto_test] Error 1
[  172s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  172s] debian/rules:13: recipe for target 'build' failed
[  172s] make: *** [build] Error 2
[  172s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  172s] 
[  172s] obs-arm-2 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 
16 20:04:11 UTC 2018.
[  172s] 
[  172s] ### VM INTERACTION START ###
[  175s] [  153.335109] sysrq: SysRq : Power Off
[  175s] [  153.338484] reboot: Power down
[  175s] ### VM INTERACTION END ###
[  175s] 
[  175s] obs-arm-2 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 
16 20:04:13 UTC 2018.
[  175s] 

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


Build failure of network:osmocom:nightly/openbsc in Debian_9.0/i586

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/i586

Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/i586

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

Last lines of build log:
[   79s] ../../include/openbsc/mgcp_internal.h:28:33: fatal error: 
osmocom/netif/jibuf.h: No such file or directory
[   79s]  #include 
[   79s]  ^
[   79s] compilation terminated.
[   79s] Makefile:455: recipe for target 'mgcp_protocol.o' failed
[   79s] make[4]: *** [mgcp_protocol.o] Error 1
[   79s] make[4]: Leaving directory 
'/usr/src/packages/BUILD/openbsc/src/libmgcp'
[   79s] Makefile:447: recipe for target 'all-recursive' failed
[   79s] make[3]: *** [all-recursive] Error 1
[   79s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/src'
[   79s] Makefile:518: recipe for target 'all-recursive' failed
[   79s] make[2]: *** [all-recursive] Error 1
[   79s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[   79s] Makefile:427: recipe for target 'all' failed
[   79s] make[1]: *** [all] Error 2
[   79s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[   79s] dh_auto_build: make -j1 returned exit code 2
[   79s] debian/rules:13: recipe for target 'build' failed
[   79s] make: *** [build] Error 2
[   79s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[   79s] 
[   79s] lamb75 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:03:21 UTC 2018.
[   79s] 
[   79s] ### VM INTERACTION START ###
[   82s] [   73.509087] reboot: Power down
[   82s] ### VM INTERACTION END ###
[   82s] 
[   82s] lamb75 failed "build openbsc_1.0.0.20180416.dsc" at Mon Apr 16 
20:03:24 UTC 2018.
[   82s] 

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


Build failure of network:osmocom:nightly/libosmo-netif in xUbuntu_16.04/i586

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/xUbuntu_16.04/i586

Package network:osmocom:nightly/libosmo-netif failed to build in 
xUbuntu_16.04/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmo-netif

Last lines of build log:
[  135s] compilation terminated.
[  135s] Makefile:476: recipe for target 'jibuf/jibuf_tool.o' failed
[  135s] make[5]: *** [jibuf/jibuf_tool.o] Error 1
[  135s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests'
[  135s] Makefile:585: recipe for target 'check-am' failed
[  135s] make[4]: *** [check-am] Error 2
[  135s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests'
[  135s] Makefile:494: recipe for target 'check-recursive' failed
[  135s] make[3]: *** [check-recursive] Error 1
[  135s] make[3]: Leaving directory '/usr/src/packages/BUILD'
[  135s] Makefile:785: recipe for target 'check' failed
[  135s] make[2]: *** [check] Error 2
[  135s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  135s] dh_auto_test: make -j1 check returned exit code 2
[  135s] debian/rules:31: recipe for target 'override_dh_auto_test' failed
[  135s] make[1]: *** [override_dh_auto_test] Error 1
[  135s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  135s] debian/rules:13: recipe for target 'build' failed
[  135s] make: *** [build] Error 2
[  135s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  135s] 
[  135s] cloud107 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
19:59:57 UTC 2018.
[  135s] 
[  135s] ### VM INTERACTION START ###
[  138s] [  121.786421] reboot: Power down
[  140s] ### VM INTERACTION END ###
[  140s] 
[  140s] cloud107 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:00:03 UTC 2018.
[  140s] 

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


Build failure of network:osmocom:nightly/libosmo-netif in xUbuntu_17.04/i586

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/xUbuntu_17.04/i586

Package network:osmocom:nightly/libosmo-netif failed to build in 
xUbuntu_17.04/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmo-netif

Last lines of build log:
[  101s] compilation terminated.
[  101s] Makefile:476: recipe for target 'jibuf/jibuf_tool.o' failed
[  101s] make[5]: *** [jibuf/jibuf_tool.o] Error 1
[  101s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests'
[  101s] Makefile:585: recipe for target 'check-am' failed
[  101s] make[4]: *** [check-am] Error 2
[  101s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests'
[  101s] Makefile:494: recipe for target 'check-recursive' failed
[  101s] make[3]: *** [check-recursive] Error 1
[  101s] make[3]: Leaving directory '/usr/src/packages/BUILD'
[  101s] Makefile:785: recipe for target 'check' failed
[  101s] make[2]: *** [check] Error 2
[  101s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  101s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2
[  101s] debian/rules:31: recipe for target 'override_dh_auto_test' failed
[  101s] make[1]: *** [override_dh_auto_test] Error 1
[  101s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  101s] debian/rules:13: recipe for target 'build' failed
[  101s] make: *** [build] Error 2
[  101s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  101s] 
[  101s] lamb03 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:00:01 UTC 2018.
[  101s] 
[  101s] ### VM INTERACTION START ###
[  105s] [   96.258389] reboot: Power down
[  105s] ### VM INTERACTION END ###
[  105s] 
[  105s] lamb03 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:00:05 UTC 2018.
[  105s] 

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


Build failure of network:osmocom:nightly/libosmo-netif in Debian_8.0/i586

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/Debian_8.0/i586

Package network:osmocom:nightly/libosmo-netif failed to build in Debian_8.0/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmo-netif

Last lines of build log:
[  204s] Makefile:464: recipe for target 'jibuf/jibuf_tool.o' failed
[  204s] make[5]: *** [jibuf/jibuf_tool.o] Error 1
[  204s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests'
[  204s] Makefile:573: recipe for target 'check-am' failed
[  204s] make[4]: *** [check-am] Error 2
[  204s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests'
[  204s] Makefile:483: recipe for target 'check-recursive' failed
[  204s] make[3]: *** [check-recursive] Error 1
[  204s] make[3]: Leaving directory '/usr/src/packages/BUILD'
[  204s] Makefile:774: recipe for target 'check' failed
[  204s] make[2]: *** [check] Error 2
[  204s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  204s] dh_auto_test: make -j1 check returned exit code 2
[  204s] debian/rules:31: recipe for target 'override_dh_auto_test' failed
[  204s] make[1]: *** [override_dh_auto_test] Error 1
[  204s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  204s] debian/rules:13: recipe for target 'build' failed
[  204s] make: *** [build] Error 2
[  204s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  204s] 
[  204s] cloud115 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
19:59:52 UTC 2018.
[  204s] 
[  204s] ### VM INTERACTION START ###
[  205s] Powering off.
[  205s] [  164.329146] reboot: Power down
[  220s] ### VM INTERACTION END ###
[  220s] 
[  220s] cloud115 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
20:00:08 UTC 2018.
[  220s] 

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


Build failure of network:osmocom:nightly/libosmo-netif in Debian_9.0/i586

2018-04-16 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-netif/Debian_9.0/i586

Package network:osmocom:nightly/libosmo-netif failed to build in Debian_9.0/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmo-netif

Last lines of build log:
[  122s] compilation terminated.
[  122s] Makefile:476: recipe for target 'jibuf/jibuf_tool.o' failed
[  122s] make[5]: *** [jibuf/jibuf_tool.o] Error 1
[  122s] make[5]: Leaving directory '/usr/src/packages/BUILD/tests'
[  122s] Makefile:585: recipe for target 'check-am' failed
[  122s] make[4]: *** [check-am] Error 2
[  122s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests'
[  122s] Makefile:494: recipe for target 'check-recursive' failed
[  122s] make[3]: *** [check-recursive] Error 1
[  122s] make[3]: Leaving directory '/usr/src/packages/BUILD'
[  122s] Makefile:785: recipe for target 'check' failed
[  122s] make[2]: *** [check] Error 2
[  122s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  122s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2
[  122s] debian/rules:31: recipe for target 'override_dh_auto_test' failed
[  122s] make[1]: *** [override_dh_auto_test] Error 1
[  122s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  122s] debian/rules:13: recipe for target 'build' failed
[  122s] make: *** [build] Error 2
[  122s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  122s] 
[  122s] lamb55 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
19:58:22 UTC 2018.
[  122s] 
[  122s] ### VM INTERACTION START ###
[  125s] [  116.174460] reboot: Power down
[  125s] ### VM INTERACTION END ###
[  125s] 
[  125s] lamb55 failed "build libosmo-netif_0.1.1.20180416.dsc" at Mon Apr 16 
19:58:26 UTC 2018.
[  125s] 

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


[PATCH] osmo-bsc[master]: gscon: remove dead code

2018-04-16 Thread dexter

Review at  https://gerrit.osmocom.org/7839

gscon: remove dead code

The state ST_WAIT_MODE_MODIFY_ACK can never be reached by the
current FSM model.

- Remove ST_WAIT_MODE_MODIFY_ACK and all related code

Change-Id: Iacaae2ee50ca1956066b7dce4517bbc9c2b0897e
Related: OS#2762
---
M include/osmocom/bsc/bsc_subscr_conn_fsm.h
M src/libbsc/bsc_subscr_conn_fsm.c
2 files changed, 1 insertion(+), 45 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/39/7839/1

diff --git a/include/osmocom/bsc/bsc_subscr_conn_fsm.h 
b/include/osmocom/bsc/bsc_subscr_conn_fsm.h
index 9421528..9498d9f 100644
--- a/include/osmocom/bsc/bsc_subscr_conn_fsm.h
+++ b/include/osmocom/bsc/bsc_subscr_conn_fsm.h
@@ -21,8 +21,6 @@
GSCON_EV_RR_ASS_COMPL,
/* RR ASSIGNMENT FAIL received */
GSCON_EV_RR_ASS_FAIL,
-   /* RR MODE MODIFY ACK received */
-   GSCON_EV_RR_MODE_MODIFY_ACK,
 
/* RSL RLL Release Indication */
GSCON_EV_RLL_REL_IND,
diff --git a/src/libbsc/bsc_subscr_conn_fsm.c b/src/libbsc/bsc_subscr_conn_fsm.c
index e18e466..d80e1ed 100644
--- a/src/libbsc/bsc_subscr_conn_fsm.c
+++ b/src/libbsc/bsc_subscr_conn_fsm.c
@@ -56,8 +56,6 @@
ST_ACTIVE,
/* during assignment; waiting for ASS_CMPL */
ST_WAIT_ASS_CMPL,
-   /* during assignment; waiting for MODE_MODIFY_ACK */
-   ST_WAIT_MODE_MODIFY_ACK,
/* BSSMAP CLEAR has been received */
ST_CLEARING,
 
@@ -99,7 +97,6 @@
 
{GSCON_EV_RR_ASS_COMPL, "RR_ASSIGN_COMPL"},
{GSCON_EV_RR_ASS_FAIL, "RR_ASSIGN_FAIL"},
-   {GSCON_EV_RR_MODE_MODIFY_ACK, "RR_MODE_MODIFY_ACK"},
{GSCON_EV_RLL_REL_IND, "RLL_RELEASE.ind"},
{GSCON_EV_RSL_CONN_FAIL, "RSL_CONN_FAIL.ind"},
{GSCON_EV_RSL_CLEAR_COMPL, "RSL_CLEAR_COMPLETE"},
@@ -718,39 +715,6 @@
}
 }
 
-/* We're waiting for a MODE MODIFY ACK from MS + BTS */
-static void gscon_fsm_wait_mode_modify_ack(struct osmo_fsm_inst *fi, uint32_t 
event, void *data)
-{
-   struct gsm_subscriber_connection *conn = fi->priv;
-   struct gsm_lchan *lchan = conn->lchan;
-
-   switch (event) {
-   case GSCON_EV_RR_MODE_MODIFY_ACK:
-   /* we assume that not only have we received the RR 
MODE_MODIFY_ACK, but
-* actually that also the BTS side of the channel mode has been 
changed accordingly */
-   osmo_fsm_inst_state_chg(fi, ST_ACTIVE, 0, 0);
-
-   /* FIXME: Check if this requires special handling. For now I 
assume that the send_ass_compl()
-* can be used. But I am not sure. */
-   send_ass_compl(lchan, fi, false);
-
-   break;
-   /* FIXME: Do we need to handle DTAP traffic in this state? 
Maybe yes? Needs to be checked. */
-   case GSCON_EV_MO_DTAP:
-   forward_dtap(conn, (struct msgb *)data, fi);
-   break;
-   case GSCON_EV_MT_DTAP:
-   submit_dtap(conn, (struct msgb *)data, fi);
-   break;
-   case GSCON_EV_TX_SCCP:
-   sigtran_send(conn, (struct msgb *)data, fi);
-   break;
-   default:
-   OSMO_ASSERT(false);
-   break;
-   }
-}
-
 static void gscon_fsm_clearing(struct osmo_fsm_inst *fi, uint32_t event, void 
*data)
 {
struct gsm_subscriber_connection *conn = fi->priv;
@@ -865,7 +829,7 @@
.in_event_mask = EV_TRANSPARENT_SCCP | 
S(GSCON_EV_A_ASSIGNMENT_CMD) |
 S(GSCON_EV_A_HO_REQ) | S(GSCON_EV_HO_START),
.out_state_mask = S(ST_CLEARING) | S(ST_WAIT_CRCX_BTS) | 
S(ST_WAIT_ASS_CMPL) |
- S(ST_WAIT_MODE_MODIFY_ACK) | 
S(ST_WAIT_MO_HO_CMD) | S(ST_WAIT_HO_COMPL),
+ S(ST_WAIT_MO_HO_CMD) | S(ST_WAIT_HO_COMPL),
.action = gscon_fsm_active,
},
[ST_WAIT_CRCX_BTS] = {
@@ -891,12 +855,6 @@
.in_event_mask = EV_TRANSPARENT_SCCP | 
S(GSCON_EV_MGW_CRCX_RESP_MSC),
.out_state_mask = S(ST_ACTIVE),
.action = gscon_fsm_wait_crcx_msc,
-   },
-   [ST_WAIT_MODE_MODIFY_ACK] = {
-   .name = OSMO_STRINGIFY(WAIT_MODE_MODIFY_ACK),
-   .in_event_mask = EV_TRANSPARENT_SCCP | 
S(GSCON_EV_RR_MODE_MODIFY_ACK),
-   .out_state_mask = S(ST_ACTIVE) | S(ST_CLEARING),
-   .action = gscon_fsm_wait_mode_modify_ack,
},
[ST_CLEARING] = {
.name = OSMO_STRINGIFY(CLEARING),

-- 
To view, visit https://gerrit.osmocom.org/7839
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iacaae2ee50ca1956066b7dce4517bbc9c2b0897e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-bsc[master]: gscon: fix assignment of signalling channels

2018-04-16 Thread dexter

Review at  https://gerrit.osmocom.org/7838

gscon: fix assignment of signalling channels

On the assignmen of signalling channels, the voice related fields
do not play a role. However the function send_ass_compl() that
generates the assignment complete message is very strict about the
presence of those voice related parameters.

- Add a parameter to function send_ass_compl() to generate the
  different types of assignment complete messages

Change-Id: I316ebcb1f27b668e17fe48fff028e047aac47f76
Related: OS#2762
---
M src/libbsc/bsc_subscr_conn_fsm.c
1 file changed, 20 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/38/7838/1

diff --git a/src/libbsc/bsc_subscr_conn_fsm.c b/src/libbsc/bsc_subscr_conn_fsm.c
index a63483e..e18e466 100644
--- a/src/libbsc/bsc_subscr_conn_fsm.c
+++ b/src/libbsc/bsc_subscr_conn_fsm.c
@@ -226,29 +226,38 @@
 }
 
 /* Generate and send assignment complete message */
-static void send_ass_compl(struct gsm_lchan *lchan, struct osmo_fsm_inst *fi)
+static void send_ass_compl(struct gsm_lchan *lchan, struct osmo_fsm_inst *fi, 
bool voice)
 {
struct msgb *resp;
struct gsm0808_speech_codec sc;
+   struct gsm0808_speech_codec *sc_ptr = NULL;
struct gsm_subscriber_connection *conn;
-   int perm_spch = bssap_speech_from_lchan(lchan);
+   struct sockaddr_storage *addr_local = NULL;
+   int perm_spch = 0;
 
conn = lchan->conn;
-
-   OSMO_ASSERT(lchan->abis_ip.ass_compl.valid);
OSMO_ASSERT(conn);
 
LOGPFSML(fi, LOGL_DEBUG, "Sending assignment complete message... 
(id=%i)\n", conn->sccp.conn_id);
 
-   /* Extrapolate speech codec from speech mode */
-   gsm0808_speech_codec_from_chan_type(, perm_spch);
-   /* FIXME: AMR codec configuration must be derived from lchan1! */
+   /* Generate voice related fields */
+   if (!voice) {
+   OSMO_ASSERT(lchan->abis_ip.ass_compl.valid);
+   perm_spch = bssap_speech_from_lchan(lchan);
+   addr_local = >user_plane.aoip_rtp_addr_local;
+
+   /* Extrapolate speech codec from speech mode */
+   gsm0808_speech_codec_from_chan_type(, perm_spch);
+   sc_ptr = 
+
+   /* FIXME: AMR codec configuration must be derived from lchan1! 
*/
+   }
 
/* Generate message */
resp = gsm0808_create_ass_compl(lchan->abis_ip.ass_compl.rr_cause,
lchan_to_chosen_channel(lchan),
lchan->encr.alg_id, perm_spch,
-   >user_plane.aoip_rtp_addr_local, 
, NULL);
+   addr_local, sc_ptr, NULL);
 
if (!resp) {
LOGPFSML(fi, LOGL_ERROR, "Failed to generate assignment 
completed message! (id=%i)\n",
@@ -586,7 +595,7 @@
case GSM48_CMODE_SIGN:
/* Confirm the successful assignment on BSSMAP and
 * change back into active state */
-   send_ass_compl(lchan, fi);
+   send_ass_compl(lchan, fi, false);
osmo_fsm_inst_state_chg(fi, ST_ACTIVE, 0, 0);
break;
default:
@@ -689,7 +698,7 @@
sin->sin_port = osmo_ntohs(conn_peer->port);
 
/* Send assignment complete message to the MSC */
-   send_ass_compl(lchan, fi);
+   send_ass_compl(lchan, fi, true);
 
osmo_fsm_inst_state_chg(fi, ST_ACTIVE, 0, 0);
 
@@ -723,7 +732,7 @@
 
/* FIXME: Check if this requires special handling. For now I 
assume that the send_ass_compl()
 * can be used. But I am not sure. */
-   send_ass_compl(lchan, fi);
+   send_ass_compl(lchan, fi, false);
 
break;
/* FIXME: Do we need to handle DTAP traffic in this state? 
Maybe yes? Needs to be checked. */

-- 
To view, visit https://gerrit.osmocom.org/7838
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I316ebcb1f27b668e17fe48fff028e047aac47f76
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-ttcn3-hacks[master]: BSC_Tests: handle mode modify also for signalling

2018-04-16 Thread dexter

Review at  https://gerrit.osmocom.org/7837

BSC_Tests: handle mode modify also for signalling

The Altstep as_modify() is designed to work only with assignments
that assign a voice call (st.voice_call must be true). Howeber, it
should also work on assignments that assign a signalling channel
only.

- Remove the test on st.voice_call from the guard statement of
  the two altsteps.

Change-Id: Ie0e5f15c1a13b773a7693918942e7ff92dfb99d6
Related: OS#2762
---
M bsc/MSC_ConnectionHandler.ttcn
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index e648427..71ad1f2 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -578,7 +578,7 @@
/* no assignment, just mode modify */
var RSL_Message rsl;
 
-   [st.voice_call and not st.rr_modify_seen] 
RSL.receive(tr_RSL_DATA_REQ(g_chan_nr)) -> value rsl {
+   [not st.rr_modify_seen] RSL.receive(tr_RSL_DATA_REQ(g_chan_nr)) -> 
value rsl {
var PDU_ML3_NW_MS l3 := 
dec_PDU_ML3_NW_MS(rsl.ies[2].body.l3_info.payload);
log("Rx L3 from net: ", l3);
if (ischosen(l3.msgs.rrm.channelModeModify)) {
@@ -588,7 +588,7 @@
}
repeat;
}
-   [st.voice_call and st.rr_modify_seen] 
RSL.receive(tr_RSL_MsgTypeD(RSL_MT_MODE_MODIFY_REQ)) -> value rsl {
+   [st.rr_modify_seen] 
RSL.receive(tr_RSL_MsgTypeD(RSL_MT_MODE_MODIFY_REQ)) -> value rsl {
RSL.send(ts_RSL_MODE_MODIFY_ACK(g_chan_nr));
st.modify_done := true;
repeat;

-- 
To view, visit https://gerrit.osmocom.org/7837
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0e5f15c1a13b773a7693918942e7ff92dfb99d6
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-ttcn3-hacks[master]: BSC_Tests: Assign g_pars in TC_assignment_sign

2018-04-16 Thread dexter

Review at  https://gerrit.osmocom.org/7836

BSC_Tests: Assign g_pars in TC_assignment_sign

The testcase TC_assignment_sign does not assign g_pars in its
test function. However, it assigns local variable pars but then
never uses it.

- remove local variable pars and assign g_pars instead

Change-Id: Iad65d8ff8bfb98df2b212c69916f1e74dc2c61af
Related: OS#2762
---
M bsc/BSC_Tests.ttcn
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 0dfb708..8380175 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1558,7 +1558,7 @@
 
 
 private function f_tc_assignment_sign(charstring id) runs on MSC_ConnHdlr {
-   var TestHdlrParams pars := valueof(t_def_TestHdlrPars);
+   g_pars := valueof(t_def_TestHdlrPars);
var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, 
omit);
var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, omit));
 

-- 
To view, visit https://gerrit.osmocom.org/7836
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad65d8ff8bfb98df2b212c69916f1e74dc2c61af
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: dexter 


[MERGED] osmocom-bb[master]: VIRT_PHY: add missing L1CTL_BURST_IND to l1ctlPrimNames

2018-04-16 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged.

Change subject: VIRT_PHY: add missing L1CTL_BURST_IND to l1ctlPrimNames
..


VIRT_PHY: add missing L1CTL_BURST_IND to l1ctlPrimNames

Change-Id: I442305c034bbba5eaed080fb262a61895623eb4f
---
M src/host/virt_phy/src/logging.c
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c
index 631a6e6..a3e63bc 100644
--- a/src/host/virt_phy/src/logging.c
+++ b/src/host/virt_phy/src/logging.c
@@ -57,6 +57,7 @@
 "L1CTL_TRAFFIC_REQ",
 "L1CTL_TRAFFIC_CONF",
 "L1CTL_TRAFFIC_IND",
+"L1CTL_BURST_IND",
 "L1CTL_TBF_CFG_REQ",
 "L1CTL_TBF_CFG_CONF",
 "L1CTL_DATA_TBF_REQ",

-- 
To view, visit https://gerrit.osmocom.org/7808
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I442305c034bbba5eaed080fb262a61895623eb4f
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 


[MERGED] osmo-gsm-tester[master]: contrib: build-osmo-trx: Enable addr sanitize for osmo-trx

2018-04-16 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged.

Change subject: contrib: build-osmo-trx: Enable addr sanitize for osmo-trx
..


contrib: build-osmo-trx: Enable addr sanitize for osmo-trx

Change-Id: Iad90c7c8c2098680276de000c36bec0224f9746d
---
M contrib/jenkins-build-osmo-trx.sh
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/contrib/jenkins-build-osmo-trx.sh 
b/contrib/jenkins-build-osmo-trx.sh
index 33eb07d..480c787 100755
--- a/contrib/jenkins-build-osmo-trx.sh
+++ b/contrib/jenkins-build-osmo-trx.sh
@@ -5,6 +5,6 @@
 . "$(dirname "$0")/jenkins-build-common.sh"
 
 build_repo libosmocore --enable-sanitize --disable-doxygen
-build_repo osmo-trx --without-sse
+build_repo osmo-trx --enable-sanitize --without-sse
 
 create_bin_tgz osmo-trx

-- 
To view, visit https://gerrit.osmocom.org/7832
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iad90c7c8c2098680276de000c36bec0224f9746d
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


[MERGED] osmo-bsc[master]: Cosmetic: Fix typo: Siganlling->Signalling

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Cosmetic: Fix typo: Siganlling->Signalling
..


Cosmetic: Fix typo: Siganlling->Signalling

Change-Id: I92b39eebfba396ee7690e99de09ee20593b7139d
---
M src/osmo-bsc/osmo_bsc_main.c
M tests/handover/handover_test.c
2 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 89d0d02..db6bcdb 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -305,7 +305,7 @@
},
[DRSL] = {
.name = "DRSL",
-   .description = "A-bis Radio Siganlling Link (RSL)",
+   .description = "A-bis Radio Signalling Link (RSL)",
.color = "\033[1;35m",
.enabled = 1, .loglevel = LOGL_NOTICE,
},
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index ab32a29..82afbe5 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -1323,7 +1323,7 @@
},
[DRSL] = {
.name = "DRSL",
-   .description = "A-bis Radio Siganlling Link (RSL)",
+   .description = "A-bis Radio Signalling Link (RSL)",
.color = "\033[1;35m",
.enabled = 1, .loglevel = LOGL_DEBUG,
},

-- 
To view, visit https://gerrit.osmocom.org/7819
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I92b39eebfba396ee7690e99de09ee20593b7139d
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


osmo-bsc[master]: Cosmetic: Fix typo: Siganlling->Signalling

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7819
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I92b39eebfba396ee7690e99de09ee20593b7139d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[MERGED] osmo-gsm-tester[master]: contrib: build-osm-bts-sysmo: openbsc dep no longer needed

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: contrib: build-osm-bts-sysmo: openbsc dep no longer needed
..


contrib: build-osm-bts-sysmo: openbsc dep no longer needed

Change-Id: Iafd5ee1df001719ff6165ada996359b92116671e
---
M contrib/jenkins-build-osmo-bts-sysmo.sh
1 file changed, 0 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/contrib/jenkins-build-osmo-bts-sysmo.sh 
b/contrib/jenkins-build-osmo-bts-sysmo.sh
index 98f8249..afce771 100755
--- a/contrib/jenkins-build-osmo-bts-sysmo.sh
+++ b/contrib/jenkins-build-osmo-bts-sysmo.sh
@@ -18,9 +18,6 @@
 prefix_real="$DESTDIR$prefix"
 . "$(dirname "$0")/jenkins-build-common.sh"
 
-# for gsm_data_shared.h
-have_repo openbsc
-
 build_repo libosmocore --disable-pcsc --disable-doxygen --disable-gnutls
 build_repo libosmo-abis
 build_repo osmo-bts --enable-sysmocom-bts 
--with-openbsc=$base/openbsc/openbsc/include

-- 
To view, visit https://gerrit.osmocom.org/7831
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iafd5ee1df001719ff6165ada996359b92116671e
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


openbsc[master]: nat: Add jitter buffer on the uplink receiver

2018-04-16 Thread Harald Welte

Patch Set 3: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7793
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibf3932adc07442fb5e9c7a06404853f9d0a20959
Gerrit-PatchSet: 3
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: daniel 
Gerrit-HasComments: No


[MERGED] openbsc[master]: nat: Add jitter buffer on the uplink receiver

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: nat: Add jitter buffer on the uplink receiver
..


nat: Add jitter buffer on the uplink receiver

Default usage values are defined in mgcp node, and can be per-BSC
overriden on each bsc node.

Change-Id: Ibf3932adc07442fb5e9c7a06404853f9d0a20959
---
M openbsc/include/openbsc/bsc_nat.h
M openbsc/include/openbsc/mgcp.h
M openbsc/include/openbsc/mgcp_internal.h
M openbsc/src/libmgcp/mgcp_network.c
M openbsc/src/libmgcp/mgcp_protocol.c
M openbsc/src/libmgcp/mgcp_vty.c
M openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
M openbsc/src/osmo-bsc_nat/bsc_nat_vty.c
8 files changed, 253 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/include/openbsc/bsc_nat.h 
b/openbsc/include/openbsc/bsc_nat.h
index fad3804..5171c3e 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -175,6 +175,16 @@
 
/* Osmux is enabled/disabled per BSC */
int osmux;
+
+   /* Use a jitterbuffer on the bts-side receiver */
+   bool bts_use_jibuf;
+   /* Minimum and maximum buffer size for the jitter buffer, in ms */
+   uint32_t bts_jitter_delay_min;
+   uint32_t bts_jitter_delay_max;
+   /* Enabled if explicitly configured through VTY: */
+   bool bts_use_jibuf_override;
+   bool bts_jitter_delay_min_override;
+   bool bts_jitter_delay_max_override;
 };
 
 struct bsc_lac_entry {
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index b2262bc..4d1c5ef 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -236,6 +236,12 @@
 * message.
 */
uint16_t osmux_dummy;
+
+   /* Use a jitterbuffer on the bts-side receiver */
+   bool bts_use_jibuf;
+   /* Minimum and maximum buffer size for the jitter buffer, in ms */
+   uint32_t bts_jitter_delay_min;
+   uint32_t bts_jitter_delay_max;
 };
 
 /* config management */
diff --git a/openbsc/include/openbsc/mgcp_internal.h 
b/openbsc/include/openbsc/mgcp_internal.h
index 7c89d10..cd6365f 100644
--- a/openbsc/include/openbsc/mgcp_internal.h
+++ b/openbsc/include/openbsc/mgcp_internal.h
@@ -25,6 +25,7 @@
 #include 
 
 #include 
+#include 
 
 #define CI_UNUSED 0
 
@@ -205,6 +206,14 @@
uint32_t octets;
} stats;
} osmux;
+
+   /* Jitter buffer */
+   struct osmo_jibuf* bts_jb;
+   /* Use a jitterbuffer on the bts-side receiver */
+   bool bts_use_jibuf;
+   /* Minimum and maximum buffer size for the jitter buffer, in ms */
+   uint32_t bts_jitter_delay_min;
+   uint32_t bts_jitter_delay_max;
 };
 
 #define for_each_line(line, save)  \
@@ -340,3 +349,8 @@
return endp->cfg->bts_ports.bind_addr;
return endp->cfg->source_addr;
 }
+
+/**
+ * Internal jitter buffer related
+ */
+void mgcp_dejitter_udp_send(struct msgb *msg, void *data);
diff --git a/openbsc/src/libmgcp/mgcp_network.c 
b/openbsc/src/libmgcp/mgcp_network.c
index abce6e4..799d998 100644
--- a/openbsc/src/libmgcp/mgcp_network.c
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -580,6 +580,36 @@
return rc;
 }
 
+void mgcp_dejitter_udp_send(struct msgb *msg, void *data)
+{
+   struct mgcp_rtp_end *rtp_end = (struct mgcp_rtp_end *) data;
+
+   int rc = mgcp_udp_send(rtp_end->rtp.fd, _end->addr,
+  rtp_end->rtp_port, (char*) msg->data, msg->len);
+   if (rc != msg->len)
+   LOGP(DMGCP, LOGL_ERROR,
+   "Failed to send data after jitter buffer: %d\n", rc);
+   msgb_free(msg);
+}
+
+static int enqueue_dejitter(struct osmo_jibuf *jb, struct mgcp_rtp_end 
*rtp_end, char *buf, int len)
+{
+   struct msgb *msg;
+   msg = msgb_alloc(len, "mgcp-jibuf");
+   if (!msg)
+   return -1;
+
+   memcpy(msg->data, buf, len);
+   msgb_put(msg, len);
+
+   if (osmo_jibuf_enqueue(jb, msg) < 0) {
+   rtp_end->dropped_packets += 1;
+   msgb_free(msg);
+   }
+
+   return len;
+}
+
 int mgcp_send(struct mgcp_endpoint *endp, int dest, int is_rtp,
  struct sockaddr_in *addr, char *buf, int rc)
 {
@@ -587,6 +617,7 @@
struct mgcp_rtp_end *rtp_end;
struct mgcp_rtp_state *rtp_state;
int tap_idx;
+   struct osmo_jibuf *jb;
 
/* For loop toggle the destination and then dispatch. */
if (tcfg->audio_loop)
@@ -600,10 +631,12 @@
rtp_end = >net_end;
rtp_state = >bts_state;
tap_idx = MGCP_TAP_NET_OUT;
+   jb = endp->bts_jb;
} else {
rtp_end = >bts_end;
rtp_state = >net_state;
tap_idx = MGCP_TAP_BTS_OUT;
+   jb = NULL;
}
 
if 

osmo-ttcn3-hacks[master]: deps: Switch titan.ProtocolModules.SMPP back to upstream TITAN

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7835
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib171451af264aa675b173b5cad37f08bcd64fbc3
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-ttcn3-hacks[master]: deps: Switch titan.ProtocolModules.SMPP back to upstream TITAN

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: deps: Switch titan.ProtocolModules.SMPP back to upstream TITAN
..


deps: Switch titan.ProtocolModules.SMPP back to upstream TITAN

Our patch for SMPP AlertNotification was merged, so we can switch
back to use upstream instead of our osmocom fork.

Change-Id: Ib171451af264aa675b173b5cad37f08bcd64fbc3
---
M deps/Makefile
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/deps/Makefile b/deps/Makefile
index d09d917..37e48e2 100644
--- a/deps/Makefile
+++ b/deps/Makefile
@@ -9,6 +9,7 @@
titan.ProtocolModules.IP \
titan.ProtocolModules.L2TP \
titan.ProtocolModules.M3UA \
+   titan.ProtocolModules.SMPP \
titan.ProtocolModules.TCP \
titan.ProtocolModules.UDP \
titan.ProtocolModules.RTP \
@@ -42,7 +43,6 @@
 
 OSMOGITHUB_REPOS=  titan.TestPorts.SCTPasp \
titan.TestPorts.MTP3asp \
-   titan.ProtocolModules.SMPP \
titan.ProtocolEmulations.M3UA
 
 ALL_REPOS=$(ECLIPSEGIT_REPOS) $(ECLIPSEGIT2_REPOS) $(OSMOGITHUB_REPOS)
@@ -72,7 +72,7 @@
 titan.ProtocolModules.RTP_commit=  R.5.A
 titan.ProtocolModules.SCTP_commit= R.2.A
 titan.ProtocolModules.SDP_commit=  R.14.A
-titan.ProtocolModules.SMPP_commit= R.2.A-1-ge044a36
+titan.ProtocolModules.SMPP_commit= R.2.A-2-gb7aee69
 titan.ProtocolModules.SNDCP_v7.0.0_commit= R.2.A
 titan.ProtocolModules.SUA_commit=  R.5.A
 titan.ProtocolModules.TCP_commit=  R.3.A

-- 
To view, visit https://gerrit.osmocom.org/7835
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib171451af264aa675b173b5cad37f08bcd64fbc3
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[PATCH] openbsc[master]: nat: Add jitter buffer on the uplink receiver

2018-04-16 Thread Pau Espin Pedrol
Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/7793

to look at the new patch set (#3).

nat: Add jitter buffer on the uplink receiver

Default usage values are defined in mgcp node, and can be per-BSC
overriden on each bsc node.

Change-Id: Ibf3932adc07442fb5e9c7a06404853f9d0a20959
---
M openbsc/include/openbsc/bsc_nat.h
M openbsc/include/openbsc/mgcp.h
M openbsc/include/openbsc/mgcp_internal.h
M openbsc/src/libmgcp/mgcp_network.c
M openbsc/src/libmgcp/mgcp_protocol.c
M openbsc/src/libmgcp/mgcp_vty.c
M openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
M openbsc/src/osmo-bsc_nat/bsc_nat_vty.c
8 files changed, 253 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/93/7793/3

diff --git a/openbsc/include/openbsc/bsc_nat.h 
b/openbsc/include/openbsc/bsc_nat.h
index fad3804..5171c3e 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -175,6 +175,16 @@
 
/* Osmux is enabled/disabled per BSC */
int osmux;
+
+   /* Use a jitterbuffer on the bts-side receiver */
+   bool bts_use_jibuf;
+   /* Minimum and maximum buffer size for the jitter buffer, in ms */
+   uint32_t bts_jitter_delay_min;
+   uint32_t bts_jitter_delay_max;
+   /* Enabled if explicitly configured through VTY: */
+   bool bts_use_jibuf_override;
+   bool bts_jitter_delay_min_override;
+   bool bts_jitter_delay_max_override;
 };
 
 struct bsc_lac_entry {
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index b2262bc..4d1c5ef 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -236,6 +236,12 @@
 * message.
 */
uint16_t osmux_dummy;
+
+   /* Use a jitterbuffer on the bts-side receiver */
+   bool bts_use_jibuf;
+   /* Minimum and maximum buffer size for the jitter buffer, in ms */
+   uint32_t bts_jitter_delay_min;
+   uint32_t bts_jitter_delay_max;
 };
 
 /* config management */
diff --git a/openbsc/include/openbsc/mgcp_internal.h 
b/openbsc/include/openbsc/mgcp_internal.h
index 7c89d10..cd6365f 100644
--- a/openbsc/include/openbsc/mgcp_internal.h
+++ b/openbsc/include/openbsc/mgcp_internal.h
@@ -25,6 +25,7 @@
 #include 
 
 #include 
+#include 
 
 #define CI_UNUSED 0
 
@@ -205,6 +206,14 @@
uint32_t octets;
} stats;
} osmux;
+
+   /* Jitter buffer */
+   struct osmo_jibuf* bts_jb;
+   /* Use a jitterbuffer on the bts-side receiver */
+   bool bts_use_jibuf;
+   /* Minimum and maximum buffer size for the jitter buffer, in ms */
+   uint32_t bts_jitter_delay_min;
+   uint32_t bts_jitter_delay_max;
 };
 
 #define for_each_line(line, save)  \
@@ -340,3 +349,8 @@
return endp->cfg->bts_ports.bind_addr;
return endp->cfg->source_addr;
 }
+
+/**
+ * Internal jitter buffer related
+ */
+void mgcp_dejitter_udp_send(struct msgb *msg, void *data);
diff --git a/openbsc/src/libmgcp/mgcp_network.c 
b/openbsc/src/libmgcp/mgcp_network.c
index abce6e4..799d998 100644
--- a/openbsc/src/libmgcp/mgcp_network.c
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -580,6 +580,36 @@
return rc;
 }
 
+void mgcp_dejitter_udp_send(struct msgb *msg, void *data)
+{
+   struct mgcp_rtp_end *rtp_end = (struct mgcp_rtp_end *) data;
+
+   int rc = mgcp_udp_send(rtp_end->rtp.fd, _end->addr,
+  rtp_end->rtp_port, (char*) msg->data, msg->len);
+   if (rc != msg->len)
+   LOGP(DMGCP, LOGL_ERROR,
+   "Failed to send data after jitter buffer: %d\n", rc);
+   msgb_free(msg);
+}
+
+static int enqueue_dejitter(struct osmo_jibuf *jb, struct mgcp_rtp_end 
*rtp_end, char *buf, int len)
+{
+   struct msgb *msg;
+   msg = msgb_alloc(len, "mgcp-jibuf");
+   if (!msg)
+   return -1;
+
+   memcpy(msg->data, buf, len);
+   msgb_put(msg, len);
+
+   if (osmo_jibuf_enqueue(jb, msg) < 0) {
+   rtp_end->dropped_packets += 1;
+   msgb_free(msg);
+   }
+
+   return len;
+}
+
 int mgcp_send(struct mgcp_endpoint *endp, int dest, int is_rtp,
  struct sockaddr_in *addr, char *buf, int rc)
 {
@@ -587,6 +617,7 @@
struct mgcp_rtp_end *rtp_end;
struct mgcp_rtp_state *rtp_state;
int tap_idx;
+   struct osmo_jibuf *jb;
 
/* For loop toggle the destination and then dispatch. */
if (tcfg->audio_loop)
@@ -600,10 +631,12 @@
rtp_end = >net_end;
rtp_state = >bts_state;
tap_idx = MGCP_TAP_NET_OUT;
+   jb = endp->bts_jb;
} else {
rtp_end = >bts_end;
rtp_state = >net_state;
tap_idx = MGCP_TAP_BTS_OUT;
+   jb = NULL;
}
 
if (!rtp_end->output_enabled)
@@ -621,9 +654,12 @@
  

Jenkins build is back to normal : master-osmo-pcu » origin/nrw/litecell15-next,osmocom-master-debian9,lc15,True #388

2018-04-16 Thread jenkins
See 




Build failed in Jenkins: master-osmo-bts » lc15, origin/nrw/litecell15-next,default,osmocom-master-debian9 #515

2018-04-16 Thread jenkins
See 


--
[...truncated 112.78 KB...]
+ project=libosmo-abis
+ branch=master
+ git branch -a
+ grep -c remotes/origin/master$
+ [ x1 != x0 ]
+ branch=origin/master
+ test -d libosmo-abis
+ cd libosmo-abis
+ git fetch --tags origin
+ git fetch origin
+ deps= osmo-clean-workspace.sh
+ chmod -R +w .
+ git checkout -f HEAD
+ git clean -dxf
+ [ -d  ]
+ [ -d layer1-headers ]
+ git checkout -f origin/master
HEAD is now at 43b5b69... configure.ac: Fix condition check for 
RTP_SIGNAL_PTR_CAST define
+ git rev-parse HEAD
43b5b69bb890441c7285541b36ef986063eab8cb
+ cd libosmo-abis
+ mkdir -p 

+ autoreconf --install --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:20: installing './compile'
configure.ac:22: installing './config.guess'
configure.ac:22: installing './config.sub'
configure.ac:8: installing './install-sh'
configure.ac:8: installing './missing'
src/Makefile.am: installing './depcomp'
+ ./configure 
--prefix=
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether make sets $(MAKE)... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu 
format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... 
func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes

Jenkins build is back to normal : master-osmo-pcu » master,osmocom-master-debian9,lc15,True #388

2018-04-16 Thread jenkins
See 




[PATCH] osmo-ttcn3-hacks[master]: deps: Switch titan.ProtocolModules.SMPP back to upstream TITAN

2018-04-16 Thread Harald Welte

Review at  https://gerrit.osmocom.org/7835

deps: Switch titan.ProtocolModules.SMPP back to upstream TITAN

Our patch for SMPP AlertNotification was merged, so we can switch
back to use upstream instead of our osmocom fork.

Change-Id: Ib171451af264aa675b173b5cad37f08bcd64fbc3
---
M deps/Makefile
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/deps/Makefile b/deps/Makefile
index d09d917..37e48e2 100644
--- a/deps/Makefile
+++ b/deps/Makefile
@@ -9,6 +9,7 @@
titan.ProtocolModules.IP \
titan.ProtocolModules.L2TP \
titan.ProtocolModules.M3UA \
+   titan.ProtocolModules.SMPP \
titan.ProtocolModules.TCP \
titan.ProtocolModules.UDP \
titan.ProtocolModules.RTP \
@@ -42,7 +43,6 @@
 
 OSMOGITHUB_REPOS=  titan.TestPorts.SCTPasp \
titan.TestPorts.MTP3asp \
-   titan.ProtocolModules.SMPP \
titan.ProtocolEmulations.M3UA
 
 ALL_REPOS=$(ECLIPSEGIT_REPOS) $(ECLIPSEGIT2_REPOS) $(OSMOGITHUB_REPOS)
@@ -72,7 +72,7 @@
 titan.ProtocolModules.RTP_commit=  R.5.A
 titan.ProtocolModules.SCTP_commit= R.2.A
 titan.ProtocolModules.SDP_commit=  R.14.A
-titan.ProtocolModules.SMPP_commit= R.2.A-1-ge044a36
+titan.ProtocolModules.SMPP_commit= R.2.A-2-gb7aee69
 titan.ProtocolModules.SNDCP_v7.0.0_commit= R.2.A
 titan.ProtocolModules.SUA_commit=  R.5.A
 titan.ProtocolModules.TCP_commit=  R.3.A

-- 
To view, visit https://gerrit.osmocom.org/7835
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib171451af264aa675b173b5cad37f08bcd64fbc3
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


openbsc[master]: nat: Add jitter buffer on the uplink receiver

2018-04-16 Thread Harald Welte

Patch Set 2: Code-Review-1

(7 comments)

https://gerrit.osmocom.org/#/c/7793/2/openbsc/include/openbsc/mgcp_internal.h
File openbsc/include/openbsc/mgcp_internal.h:

Line 215:   uint32_t bts_jitter_delay_min;
what units is this? ms? us? bytes? codec-frames?  If the varioable name doesn't 
indicate this (like delay_ms_min) the comment should at least state it.


https://gerrit.osmocom.org/#/c/7793/2/openbsc/src/libmgcp/mgcp_protocol.c
File openbsc/src/libmgcp/mgcp_protocol.c:

Line 872:   if(endp->bts_use_jibuf) {
"if" is not a function (space needed)


Line 887:   if(endp->bts_use_jibuf) {
same here


Line 1357:  if(endp->bts_jb)
and again?


https://gerrit.osmocom.org/#/c/7793/2/openbsc/src/libmgcp/mgcp_vty.c
File openbsc/src/libmgcp/mgcp_vty.c:

Line 1371:   DEJITTER_STR " Minimum Delay\n" "Minimum Delay\n")
see my other comment at the struct definition.  The VTY user has no idea about 
the unit of the value he's supposed to enter here.  the "?" help should make 
that clear.


https://gerrit.osmocom.org/#/c/7793/2/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
File openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c:

Line 589:   if(bsc_endp->bsc->cfg->bts_use_jibuf_override)
if is not a function (below two more instances)


https://gerrit.osmocom.org/#/c/7793/2/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c
File openbsc/src/osmo-bsc_nat/bsc_nat_vty.c:

Line 1266:   "bts-jitter-buffer-delay-min <1-65535>",
same comment related to "unit" of the value


-- 
To view, visit https://gerrit.osmocom.org/7793
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibf3932adc07442fb5e9c7a06404853f9d0a20959
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: daniel 
Gerrit-HasComments: Yes


osmo-gsm-tester[master]: contrib: Enable address-sanitize in builds

2018-04-16 Thread Pau Espin Pedrol

Patch Set 2:

Tested/verified in 
https://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_manual-build-all/60/

-- 
To view, visit https://gerrit.osmocom.org/7830
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibef6c2fc497bce0d799116a854a48872f9ca16d7
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


osmo-gsm-tester[master]: contrib: Enable address-sanitize in builds

2018-04-16 Thread Pau Espin Pedrol

Patch Set 2: Verified+1

-- 
To view, visit https://gerrit.osmocom.org/7830
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibef6c2fc497bce0d799116a854a48872f9ca16d7
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[MERGED] osmo-sgsn[master]: use osmo_init_logging2(), fix regression test memleaks

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: use osmo_init_logging2(), fix regression test memleaks
..


use osmo_init_logging2(), fix regression test memleaks

Particularly gbproxy_test.c had various mem leaks, which (will) show up with
gcc (Debian 7.3.0-15) 7.3.0 address sanitizer. Fix those leaks to verify that
we don't have memleaks in the production code.

Change-Id: Ia4204c8b3d895b42c103edecb61b99d3d22bd36f
---
M src/gprs/gb_proxy_main.c
M src/gprs/gtphub_main.c
M src/gprs/sgsn_main.c
M src/libcommon/gsup_test_client.c
M tests/gbproxy/gbproxy_test.c
M tests/gprs/gprs_test.c
M tests/gtphub/gtphub_test.c
M tests/oap/oap_client_test.c
M tests/sgsn/sgsn_test.c
M tests/slhc/slhc_test.c
M tests/sndcp_xid/sndcp_xid_test.c
M tests/v42bis/v42bis_test.c
M tests/xid/xid_test.c
13 files changed, 96 insertions(+), 40 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gprs/gb_proxy_main.c b/src/gprs/gb_proxy_main.c
index 1416ff5..04143bb 100644
--- a/src/gprs/gb_proxy_main.c
+++ b/src/gprs/gb_proxy_main.c
@@ -275,7 +275,7 @@
signal(SIGUSR2, _handler);
osmo_init_ignore_signals();
 
-   osmo_init_logging(_log_info);
+   osmo_init_logging2(tall_bsc_ctx, _log_info);
 
vty_info.copyright = openbsc_copyright;
vty_init(_info);
diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c
index 197c5e3..a1a2c1d 100644
--- a/src/gprs/gtphub_main.c
+++ b/src/gprs/gtphub_main.c
@@ -346,7 +346,7 @@
signal(SIGUSR2, _handler);
osmo_init_ignore_signals();
 
-   osmo_init_logging(_log_info);
+   osmo_init_logging2(osmo_gtphub_ctx, _log_info);
 
vty_info.copyright = gtphub_copyright;
vty_init(_info);
diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c
index 0276e34..feffefb 100644
--- a/src/gprs/sgsn_main.c
+++ b/src/gprs/sgsn_main.c
@@ -386,7 +386,7 @@
signal(SIGUSR2, _handler);
 
osmo_init_ignore_signals();
-   osmo_init_logging(_log_info);
+   osmo_init_logging2(tall_bsc_ctx, _log_info);
osmo_stats_init(tall_bsc_ctx);
 
vty_info.copyright = openbsc_copyright;
diff --git a/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c
index cc0f58b..2357ba5 100644
--- a/src/libcommon/gsup_test_client.c
+++ b/src/libcommon/gsup_test_client.c
@@ -272,10 +272,11 @@
unsigned long long i;
char *server_host = "127.0.0.1";
uint16_t server_port = OSMO_GSUP_PORT;
+   void *ctx = talloc_named_const(NULL, 0, "gsup_test_client");
 
-   osmo_init_logging(_test_client_log_info);
+   osmo_init_logging2(ctx, _test_client_log_info);
 
-   g_gc = gsup_client_create("GSUPTEST", server_host, server_port,
+   g_gc = gsup_client_create(ctx, "GSUPTEST", server_host, server_port,
  gsupc_read_cb, NULL);
 
 
diff --git a/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c
index 8edb171..f9a1c6b 100644
--- a/tests/gbproxy/gbproxy_test.c
+++ b/tests/gbproxy/gbproxy_test.c
@@ -47,7 +47,7 @@
 
 #define MATCH_ANY (-1)
 
-void *tall_bsc_ctx;
+void *tall_bsc_ctx = NULL;
 
 struct gbproxy_config gbcfg = {0};
 
@@ -1329,7 +1329,7 @@
 
 static void test_gbproxy()
 {
-   struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL);
+   struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, 
tall_bsc_ctx);
struct sockaddr_in bss_peer[4] = {{0},};
struct sockaddr_in sgsn_peer= {0};
 
@@ -1497,7 +1497,7 @@
 
 static void test_gbproxy_ident_changes()
 {
-   struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL);
+   struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, 
tall_bsc_ctx);
struct sockaddr_in bss_peer[1] = {{0},};
struct sockaddr_in sgsn_peer= {0};
uint16_t nsei[2] = {0x1000, 0x2000};
@@ -1629,7 +1629,7 @@
 
 static void test_gbproxy_ra_patching()
 {
-   struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL);
+   struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, 
tall_bsc_ctx);
struct sockaddr_in bss_peer[1] = {{0},};
struct sockaddr_in sgsn_peer= {0};
struct  gprs_ra_id rai_bss =
@@ -1657,7 +1657,7 @@
gbcfg.nsi = bssgp_nsi;
gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
gbcfg.core_plmn = (struct osmo_plmn_id){ .mcc = 123, .mnc = 456 };
-   gbcfg.core_apn = talloc_zero_size(NULL, 100);
+   gbcfg.core_apn = talloc_zero_size(tall_bsc_ctx, 100);
gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar");
gbcfg.patch_ptmsi = 0;
 
@@ -1960,6 +1960,9 @@
OSMO_ASSERT(!expect_msg());
received_messages = NULL;
 
+   talloc_free(gbcfg.core_apn);
+   gbcfg.core_apn = NULL;
+
gbproxy_clear_patch_filter([GBPROX_MATCH_PATCHING]);
gbprox_reset();

[MERGED] libosmocore[master]: cosmetic: log: fix typo, clarify msg for rate_ctr name mangling

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: cosmetic: log: fix typo, clarify msg for rate_ctr name mangling
..


cosmetic: log: fix typo, clarify msg for rate_ctr name mangling

Change-Id: I9a04d501698f8a3360ef9dcbf04b57c5ac10e63b
---
M src/rate_ctr.c
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/rate_ctr.c b/src/rate_ctr.c
index ec054c5..777a42a 100644
--- a/src/rate_ctr.c
+++ b/src/rate_ctr.c
@@ -169,8 +169,9 @@
goto err_free;
}
 
-   LOGP(DLGLOBAL, LOGL_INFO, "Needed to mangle ounter group '%s' names 
still using '.' as "
-   "separator, please consider updating the application\n", 
desc->group_name_prefix);
+   LOGP(DLGLOBAL, LOGL_INFO, "Needed to mangle counter group '%s' names: 
it is still using '.' as "
+   "separator, which is not allowed. please consider updating the 
application\n",
+   desc->group_name_prefix);
 
return desc_new;
 err_free:

-- 
To view, visit https://gerrit.osmocom.org/7817
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9a04d501698f8a3360ef9dcbf04b57c5ac10e63b
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


libosmocore[master]: test_gsm0808_enc_dec_speech_codec_with_cfg: initialize properly

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7815
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iaa20c59f624fbdc69a018cabd0f7e9c5a1389519
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] libosmocore[master]: test_gsm0808_enc_dec_speech_codec_with_cfg: initialize properly

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: test_gsm0808_enc_dec_speech_codec_with_cfg: initialize properly
..


test_gsm0808_enc_dec_speech_codec_with_cfg: initialize properly

The uninitialized members of enc_sc sporadically hit address sanitizer failure
during gsm0808_test, like:
../../../../src/libosmocore/src/gsm/gsm0808_utils.c:187:8: runtime error: load 
of value 13, which is not a valid value for type '_Bool'
../../../../src/libosmocore/src/gsm/gsm0808_utils.c:191:8: runtime error: load 
of value 119, which is not a valid value for type '_Bool'

How the test survived so long is a mystery to me; as soon as some uninitialized
members would by coincidence not be zero, the test should always have failed at
OSMO_ASSERT(memcmp(_sc, _sc, sizeof(enc_sc)) == 0).

Related: OS#3148
Change-Id: Iaa20c59f624fbdc69a018cabd0f7e9c5a1389519
---
M tests/gsm0808/gsm0808_test.c
1 file changed, 7 insertions(+), 7 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index a9ab72b..49673fe 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -595,16 +595,16 @@
 
 static void test_gsm0808_enc_dec_speech_codec_with_cfg()
 {
-   struct gsm0808_speech_codec enc_sc;
-   struct gsm0808_speech_codec dec_sc;
+   struct gsm0808_speech_codec enc_sc = {
+   .pi = true,
+   .tf = true,
+   .type = GSM0808_SCT_FR3,
+   .cfg = 0xabcd,
+   };
+   struct gsm0808_speech_codec dec_sc = {};
struct msgb *msg;
uint8_t rc_enc;
int rc_dec;
-
-   enc_sc.pi = true;
-   enc_sc.tf = true;
-   enc_sc.type = GSM0808_SCT_FR3;
-   enc_sc.cfg = 0xabcd;
 
msg = msgb_alloc(1024, "output buffer");
rc_enc = gsm0808_enc_speech_codec(msg, _sc);

-- 
To view, visit https://gerrit.osmocom.org/7815
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaa20c59f624fbdc69a018cabd0f7e9c5a1389519
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


libosmocore[master]: cosmetic: log: fix typo, clarify msg for rate_ctr name mangling

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7817
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9a04d501698f8a3360ef9dcbf04b57c5ac10e63b
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-msc[master]: cosmetic: use enum ranap_nsap_addr_enc instead of int

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: cosmetic: use enum ranap_nsap_addr_enc instead of int
..


cosmetic: use enum ranap_nsap_addr_enc instead of int

The only reason to use int instead of the enum was the lack of header
iu_client.h when not building with Iu support. Rather use the configure result
properly, include the header when Iu support is built and use the proper enum.

Omit the entire iu sub-struct when building without Iu.

Add LIBOSMORANAP_CFLAGS to libvlr, in order to find the iu_client.h header (now
also included from gsm_data.h).

Rationale: Instead of using a questionable typecast from int* to enum*, we can
now use the enum member directly without needing to silence compiler warnings.

Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f
---
M include/osmocom/msc/gsm_data.h
M src/libmsc/msc_vty.c
M src/libvlr/Makefile.am
3 files changed, 18 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index c5e7aaf..73047ee 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -23,6 +23,11 @@
 /* TS 48.008 DLCI containing DCCH/ACCH + SAPI */
 #define OMSC_LINKID_CB(__msgb)   (__msgb)->cb[3]
 
+#include "../../bscconfig.h"
+#if BUILD_IU
+#include 
+#endif
+
 /** annotations for msgb ownership */
 #define __uses
 
@@ -311,12 +316,14 @@
struct mgcp_client *client;
} mgw;
 
+#if BUILD_IU
struct {
/* CS7 instance id number (set via VTY) */
uint32_t cs7_instance;
-   int rab_assign_addr_enc;
+   enum ranap_nsap_addr_enc rab_assign_addr_enc;
struct osmo_sccp_instance *sccp;
} iu;
+#endif
 
struct {
/* CS7 instance id number (set via VTY) */
diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c
index 84d4d14..d10028e 100644
--- a/src/libmsc/msc_vty.c
+++ b/src/libmsc/msc_vty.c
@@ -380,8 +380,14 @@
   "cs7-instance-iu <0-15>",
   "Set SS7 to be used by the Iu-Interface.\n" "SS7 instance reference 
number\n")
 {
+#if BUILD_IU
gsmnet->iu.cs7_instance = atoi(argv[0]);
return CMD_SUCCESS;
+#else
+   vty_out(vty, "WARNING: 'cs7-instance-iu' without effect: built without 
Iu support%s",
+   VTY_NEWLINE);
+   return CMD_WARNING;
+#endif
 }
 
 DEFUN(cfg_msc_auth_tuple_max_reuse_count, 
cfg_msc_auth_tuple_max_reuse_count_cmd,
@@ -437,8 +443,10 @@
 
vty_out(vty, " cs7-instance-a %u%s", gsmnet->a.cs7_instance,
VTY_NEWLINE);
+#if BUILD_IU
vty_out(vty, " cs7-instance-iu %u%s", gsmnet->iu.cs7_instance,
VTY_NEWLINE);
+#endif
 
if (gsmnet->vlr->cfg.auth_tuple_max_reuse_count)
vty_out(vty, " auth-tuple-max-reuse-count %d%s",
@@ -1422,7 +1430,7 @@
 
mgcp_client_vty_init(msc_network, MSC_NODE, _network->mgw.conf);
 #ifdef BUILD_IU
-   ranap_iu_vty_init(MSC_NODE, (enum 
ranap_nsap_addr_enc*)_network->iu.rab_assign_addr_enc);
+   ranap_iu_vty_init(MSC_NODE, _network->iu.rab_assign_addr_enc);
 #endif
osmo_fsm_vty_add_cmds();
 
diff --git a/src/libvlr/Makefile.am b/src/libvlr/Makefile.am
index e3d5ced..1408f6c 100644
--- a/src/libvlr/Makefile.am
+++ b/src/libvlr/Makefile.am
@@ -6,6 +6,7 @@
   $(LIBOSMOSCCP_CFLAGS) \
   $(LIBOSMOMGCPCLIENT_CFLAGS) \
   $(LIBOSMOABIS_CFLAGS) \
+  $(LIBOSMORANAP_CFLAGS) \
   $(COVERAGE_CFLAGS) \
   $(NULL)
 

-- 
To view, visit https://gerrit.osmocom.org/7296
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f
Gerrit-PatchSet: 4
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


osmo-msc[master]: cosmetic: use enum ranap_nsap_addr_enc instead of int

2018-04-16 Thread Harald Welte

Patch Set 4: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7296
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f
Gerrit-PatchSet: 4
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


openbsc[master]: fix handling of state changes in acc ramping

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7825
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I235d2c5fa962f2f338e77d0c11502921b37f4c36
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[MERGED] openbsc[master]: only log actual access control class ramping changes

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: only log actual access control class ramping changes
..


only log actual access control class ramping changes

Silence log messages about no-op changes to access granted to access
control classes. For example, these always occur while configuration
files are being loaded.

This is a port of osmo-bsc commit 53d40e078e9df20103b7ed26daa936720c9dec83
Related: OS#2591

Change-Id: I2f892b998eb8119e623c1d87ffe865b48f7d5a87
---
M openbsc/src/libbsc/acc_ramp.c
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/src/libbsc/acc_ramp.c b/openbsc/src/libbsc/acc_ramp.c
index 08810b5..9b3f90b 100644
--- a/openbsc/src/libbsc/acc_ramp.c
+++ b/openbsc/src/libbsc/acc_ramp.c
@@ -42,14 +42,16 @@
 static void allow_one_acc(struct acc_ramp *acc_ramp, unsigned int acc)
 {
OSMO_ASSERT(acc >= 0 && acc <= 9);
-   LOGP(DRSL, LOGL_DEBUG, "(bts=%d) ACC RAMP: allowing Access Control 
Class %u\n", acc_ramp->bts->nr, acc);
+   if (acc_ramp->barred_accs & (1 << acc))
+   LOGP(DRSL, LOGL_DEBUG, "(bts=%d) ACC RAMP: allowing Access 
Control Class %u\n", acc_ramp->bts->nr, acc);
acc_ramp->barred_accs &= ~(1 << acc);
 }
 
 static void barr_one_acc(struct acc_ramp *acc_ramp, unsigned int acc)
 {
OSMO_ASSERT(acc >= 0 && acc <= 9);
-   LOGP(DRSL, LOGL_DEBUG, "(bts=%d) ACC RAMP: barring Access Control Class 
%u\n", acc_ramp->bts->nr, acc);
+   if ((acc_ramp->barred_accs & (1 << acc)) == 0)
+   LOGP(DRSL, LOGL_DEBUG, "(bts=%d) ACC RAMP: barring Access 
Control Class %u\n", acc_ramp->bts->nr, acc);
acc_ramp->barred_accs |= (1 << acc);
 }
 

-- 
To view, visit https://gerrit.osmocom.org/7818
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2f892b998eb8119e623c1d87ffe865b48f7d5a87
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


[MERGED] openbsc[master]: trigger acc ramping based on trx rf-locked state

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: trigger acc ramping based on trx rf-locked state
..


trigger acc ramping based on trx rf-locked state

Make ACC ramping listen to network management signals and trigger
or abort ACC ramping based on the RF locked state of TRX 0.

This is a port of osmo-bsc commit 60ecdeffecf3db4ad044c5ee0185f384d1b16eb3

Change-Id: I4124f1da3dadec003de45c1da8435506ee8f0a34
---
M openbsc/src/libbsc/acc_ramp.c
M openbsc/src/libbsc/bsc_vty.c
2 files changed, 49 insertions(+), 1 deletion(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/src/libbsc/acc_ramp.c b/openbsc/src/libbsc/acc_ramp.c
index e887723..fd2c715 100644
--- a/openbsc/src/libbsc/acc_ramp.c
+++ b/openbsc/src/libbsc/acc_ramp.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /*
  * Check if an ACC has been permanently barred for a BTS,
@@ -136,6 +137,49 @@
osmo_timer_schedule(_ramp->step_timer, 
get_next_step_interval(acc_ramp), 0);
 }
 
+/* Implements osmo_signal_cbfn() -- trigger or abort ACC ramping upon changes 
RF lock state. */
+static int acc_ramp_nm_sig_cb(unsigned int subsys, unsigned int signal, void 
*handler_data, void *signal_data)
+{
+   struct nm_statechg_signal_data *nsd = signal_data;
+   struct acc_ramp *acc_ramp = handler_data;
+   struct gsm_bts_trx *trx = NULL;
+
+   if (signal != S_NM_STATECHG_ADM)
+   return 0;
+
+   if (nsd->obj_class != NM_OC_RADIO_CARRIER)
+   return 0;
+
+   trx = nsd->obj;
+
+   /* We only care about state changes of the first TRX. */
+   if (trx->nr != 0)
+   return 0;
+
+   /* RSL must already be up. We cannot send RACH system information to 
the BTS otherwise. */
+   if (trx->rsl_link == NULL)
+   return 0;
+
+   /* Trigger or abort ACC ramping based on the new 'RF lock' state of 
this TRX. */
+   switch (nsd->new_state->administrative) {
+   case NM_STATE_UNLOCKED:
+   acc_ramp_trigger(acc_ramp);
+   break;
+   case NM_STATE_LOCKED:
+   case NM_STATE_SHUTDOWN:
+   acc_ramp_abort(acc_ramp);
+   break;
+   case NM_STATE_NULL:
+   break;
+   default:
+   LOGP(DRSL, LOGL_NOTICE, "(bts=%d) ACC RAMP: unrecognized 
administrative state '0x%x' reported for TRX 0\n",
+   acc_ramp->bts->nr, nsd->new_state->administrative);
+   break;
+   }
+
+   return 0;
+}
+
 /*!
  * Initialize an acc_ramp data structure.
  * Storage for this structure must be provided by the caller.
@@ -154,6 +198,7 @@
acc_ramp->step_interval_is_fixed = false;
allow_all_enabled_accs(acc_ramp);
osmo_timer_setup(_ramp->step_timer, do_acc_ramping_step, acc_ramp);
+   osmo_signal_register_handler(SS_NM, acc_ramp_nm_sig_cb, acc_ramp);
 }
 
 /*!
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index a076397..c71ea4a 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -3045,7 +3045,10 @@
if (!acc_ramp_is_enabled(>acc_ramp))
acc_ramp_set_enabled(>acc_ramp, true);
 
-   /* ACC ramping takes effect when the BTS reconnects. */
+   /*
+* ACC ramping takes effect either when the BTS reconnects RSL,
+* or when RF administrative state changes to 'unlocked'.
+*/
return CMD_SUCCESS;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/7821
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4124f1da3dadec003de45c1da8435506ee8f0a34
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


[MERGED] openbsc[master]: trigger acc ramping on state-changed-event reports

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: trigger acc ramping on state-changed-event reports
..


trigger acc ramping on state-changed-event reports

Trigger ACC ramping not only when an Administrative State Change
ACK is received from a BTS, but also when an administrative state
change is reported for TRX 0 in a State Changed Event Report.

This should allow ACC ramping to work with any BTS which reports
an administrative state change to 'unlock' using either of these
OML messages.

Tested with a sysmobts and a nanobts.

The sysmobts only reports TRX locked/unlock changes in Administrative
State Change ACKs, not via State Changed Event Reports.

The nanobts is known to send both of these OML messages in quick
succession, so do not re-trigger ramping if it's already in progress.

This is a port of osmo-bsc commit b06c7a253752ecb67fd20cdf0b069688b561af0e

Change-Id: I6443635b822b6cd776f6dc8a6ee73ab09e865b04
Related: OS#2591
---
M openbsc/src/libbsc/acc_ramp.c
1 file changed, 10 insertions(+), 2 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/src/libbsc/acc_ramp.c b/openbsc/src/libbsc/acc_ramp.c
index 03ba80b..a866458 100644
--- a/openbsc/src/libbsc/acc_ramp.c
+++ b/openbsc/src/libbsc/acc_ramp.c
@@ -144,7 +144,8 @@
struct acc_ramp *acc_ramp = handler_data;
struct gsm_bts_trx *trx = NULL;
 
-   if (signal != S_NM_STATECHG_ADM)
+   /* Handled signals map to an Administrative State Change ACK, or a 
State Changed Event Report. */
+   if (signal != S_NM_STATECHG_ADM && signal != S_NM_STATECHG_OPER)
return 0;
 
if (nsd->obj_class != NM_OC_RADIO_CARRIER)
@@ -163,7 +164,14 @@
/* Trigger or abort ACC ramping based on the new 'RF lock' state of 
this TRX. */
switch (nsd->new_state->administrative) {
case NM_STATE_UNLOCKED:
-   acc_ramp_trigger(acc_ramp);
+   /*
+* Do not re-trigger ACC ramping if ramping is already in 
progress.
+* A BTS might send several "unlock" change events: One in the 
Administrative
+* State Change ACK, and/or another in a State Changed Event 
Report.
+* For instance, the nanobts is known to send both.
+*/
+   if (!osmo_timer_pending(_ramp->step_timer))
+   acc_ramp_trigger(acc_ramp);
break;
case NM_STATE_LOCKED:
case NM_STATE_SHUTDOWN:

-- 
To view, visit https://gerrit.osmocom.org/7823
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6443635b822b6cd776f6dc8a6ee73ab09e865b04
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


[MERGED] openbsc[master]: only trigger acc ramping if trx 0 is usable and unlocked

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: only trigger acc ramping if trx 0 is usable and unlocked
..


only trigger acc ramping if trx 0 is usable and unlocked

Starting an ACC ramping process while TRX 0 is unusable or locked is
pointless. For instance, after loading a config with 'rf_locked 1'
for trx 0, the ramping process was started as soon as the BTS
established RSL, even though the air interface was still down.
ACC ramping should instead be triggered once TRX 0 is unlocked.

This is a port of osmo-bsc commit 4d3d2436cdf3296ddc110be4022dc2ec13d3eb86
Related: OS#2591

Change-Id: I2cc9c1b8193546ea04ea5beb3751c2206f0215f2
---
M openbsc/src/libbsc/acc_ramp.c
1 file changed, 9 insertions(+), 4 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/src/libbsc/acc_ramp.c b/openbsc/src/libbsc/acc_ramp.c
index a866458..6e64109 100644
--- a/openbsc/src/libbsc/acc_ramp.c
+++ b/openbsc/src/libbsc/acc_ramp.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 /*
@@ -257,7 +258,7 @@
 
 /*!
  * Determine if ACC ramping should be started according to configuration, and
- * if ACC ramping is enabled, begin the ramping process.
+ * begin the ramping process if the necessary conditions are present.
  * Perform at least one ramping step to allow 'step_size' ACCs.
  * If 'step_size' is ACC_RAMP_STEP_SIZE_MAX, or if ACC ramping is disabled,
  * all ACCs will be allowed immediately.
@@ -269,9 +270,13 @@
acc_ramp_abort(acc_ramp);
 
if (acc_ramp_is_enabled(acc_ramp)) {
-   /* Set all available ACCs to barred and start ramping up. */
-   barr_all_accs(acc_ramp);
-   do_acc_ramping_step(acc_ramp);
+   struct gsm_bts_trx *trx0 = gsm_bts_trx_by_nr(acc_ramp->bts, 0);
+   /* TRX 0 should be usable and unlocked, otherwise starting ACC 
ramping is pointless. */
+   if (trx0 && trx_is_usable(trx0) && 
trx0->mo.nm_state.administrative == NM_STATE_UNLOCKED) {
+   /* Set all available ACCs to barred and start ramping 
up. */
+   barr_all_accs(acc_ramp);
+   do_acc_ramping_step(acc_ramp);
+   }
}
 }
 

-- 
To view, visit https://gerrit.osmocom.org/7824
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2cc9c1b8193546ea04ea5beb3751c2206f0215f2
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


[MERGED] openbsc[master]: rename helper functions in the acc ramp code to avoid confusion

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: rename helper functions in the acc ramp code to avoid confusion
..


rename helper functions in the acc ramp code to avoid confusion

The word 'enabled' was used in two contexts: Whether ACC ramp is
enabled as a feature, and whether a particular access control class
is permantly allowed/disallowed via VTY configuration.

Rename some helper functions to avoid the use of the word 'enabled'
in the latter context.

This is a port of osmo-bsc commit 0ad90b39b9e638b5e3d926c9261d26e777ca478c

Change-Id: Ic1e5a1f969823cfbfb9fe9e959db87c1717c3a83
Related: OS#2591
---
M openbsc/src/libbsc/acc_ramp.c
1 file changed, 13 insertions(+), 13 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/src/libbsc/acc_ramp.c b/openbsc/src/libbsc/acc_ramp.c
index fd2c715..03ba80b 100644
--- a/openbsc/src/libbsc/acc_ramp.c
+++ b/openbsc/src/libbsc/acc_ramp.c
@@ -32,12 +32,12 @@
  * Check if an ACC has been permanently barred for a BTS,
  * e.g. with the 'rach access-control-class' VTY command.
  */
-static bool acc_is_enabled(struct gsm_bts *bts, unsigned int acc)
+static bool acc_is_permanently_barred(struct gsm_bts *bts, unsigned int acc)
 {
OSMO_ASSERT(acc >= 0 && acc <= 9);
if (acc == 8 || acc == 9)
-   return (bts->si_common.rach_control.t2 & (1 << (acc - 8))) == 0;
-   return (bts->si_common.rach_control.t3 & (1 << (acc))) == 0;
+   return (bts->si_common.rach_control.t2 & (1 << (acc - 8)));
+   return (bts->si_common.rach_control.t3 & (1 << (acc)));
 }
 
 static void allow_one_acc(struct acc_ramp *acc_ramp, unsigned int acc)
@@ -56,20 +56,20 @@
acc_ramp->barred_accs |= (1 << acc);
 }
 
-static void barr_all_enabled_accs(struct acc_ramp *acc_ramp)
+static void barr_all_accs(struct acc_ramp *acc_ramp)
 {
unsigned int acc;
for (acc = 0; acc < 10; acc++) {
-   if (acc_is_enabled(acc_ramp->bts, acc))
+   if (!acc_is_permanently_barred(acc_ramp->bts, acc))
barr_one_acc(acc_ramp, acc);
}
 }
 
-static void allow_all_enabled_accs(struct acc_ramp *acc_ramp)
+static void allow_all_accs(struct acc_ramp *acc_ramp)
 {
unsigned int acc;
for (acc = 0; acc < 10; acc++) {
-   if (acc_is_enabled(acc_ramp->bts, acc))
+   if (!acc_is_permanently_barred(acc_ramp->bts, acc))
allow_one_acc(acc_ramp, acc);
}
 }
@@ -102,7 +102,7 @@
 
/* Shortcut in case we only do one ramping step. */
if (acc_ramp->step_size == ACC_RAMP_STEP_SIZE_MAX) {
-   allow_all_enabled_accs(acc_ramp);
+   allow_all_accs(acc_ramp);
gsm_bts_set_system_infos(acc_ramp->bts);
return;
}
@@ -113,14 +113,14 @@
if (idx > 0) {
/* One of ACC0-ACC7 is still bared. */
unsigned int acc = idx - 1;
-   if (acc_is_enabled(acc_ramp->bts, acc))
+   if (!acc_is_permanently_barred(acc_ramp->bts, acc))
allow_one_acc(acc_ramp, acc);
} else {
idx = ffs(acc_ramp_get_barred_t2(acc_ramp));
if (idx == 1 || idx == 2) {
/* ACC8 or ACC9 is still barred. */
unsigned int acc = idx - 1 + 8;
-   if (acc_is_enabled(acc_ramp->bts, acc))
+   if (!acc_is_permanently_barred(acc_ramp->bts, 
acc))
allow_one_acc(acc_ramp, acc);
} else {
/* All ACCs are now allowed. */
@@ -196,7 +196,7 @@
acc_ramp->step_size = ACC_RAMP_STEP_SIZE_DEFAULT;
acc_ramp->step_interval_sec = ACC_RAMP_STEP_INTERVAL_MIN;
acc_ramp->step_interval_is_fixed = false;
-   allow_all_enabled_accs(acc_ramp);
+   allow_all_accs(acc_ramp);
osmo_timer_setup(_ramp->step_timer, do_acc_ramping_step, acc_ramp);
osmo_signal_register_handler(SS_NM, acc_ramp_nm_sig_cb, acc_ramp);
 }
@@ -262,7 +262,7 @@
 
if (acc_ramp_is_enabled(acc_ramp)) {
/* Set all available ACCs to barred and start ramping up. */
-   barr_all_enabled_accs(acc_ramp);
+   barr_all_accs(acc_ramp);
do_acc_ramping_step(acc_ramp);
}
 }
@@ -276,6 +276,6 @@
if (osmo_timer_pending(_ramp->step_timer))
osmo_timer_del(_ramp->step_timer);
 
-   allow_all_enabled_accs(acc_ramp);
+   allow_all_accs(acc_ramp);
 }
 

-- 
To view, visit https://gerrit.osmocom.org/7822
To unsubscribe, visit 

[MERGED] openbsc[master]: fix handling of state changes in acc ramping

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: fix handling of state changes in acc ramping
..


fix handling of state changes in acc ramping

Take both the operative and administrative states into account
when deciding whether to start ACC ramping, and examine old/new
state values to avoid triggering ramping for a no-op state change.

This requires a fix to gsm_trx_lock_rf(): This function overwrote
the old administrative state of a trx before enqueuing a state
change request towards the BTS.
The BTS will confirm this request with an ACK, at which time a
signal is generated which the ACC ramp code listens to. We must
not overwrite the old state value until the signal has been handled,
otherwise the signal handler cannot tell what the old state was.

Tested with a virtphy setup, nanobts, and osmo-bts.

This is a port of osmo-bsc commit cda994edb20d24032d6ab4e916d0e9411671cfc0

Change-Id: I235d2c5fa962f2f338e77d0c11502921b37f4c36
Related: OS#2591
---
M openbsc/src/libbsc/abis_nm.c
M openbsc/src/libbsc/acc_ramp.c
M openbsc/src/libbsc/bsc_init.c
3 files changed, 113 insertions(+), 37 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c
index 8eadfa8..cbb255a 100644
--- a/openbsc/src/libbsc/abis_nm.c
+++ b/openbsc/src/libbsc/abis_nm.c
@@ -2797,13 +2797,17 @@
 {
uint8_t new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED;
 
-   LOGP(DNM, LOGL_NOTICE, "(bts=%d,trx=%d) Changing adm. state %s -> %s 
[%s]\n", trx->bts->nr, trx->nr,
+
+   if (!trx->bts || !trx->bts->oml_link) {
+   /* Set initial state which will be sent when BTS connects. */
+   trx->mo.nm_state.administrative = new_state;
+   return;
+   }
+
+   LOGP(DNM, LOGL_NOTICE, "(bts=%d,trx=%d) Requesting administrative state 
change %s -> %s [%s]\n",
+trx->bts->nr, trx->nr,
 get_value_string(abis_nm_adm_state_names, 
trx->mo.nm_state.administrative),
 get_value_string(abis_nm_adm_state_names, new_state), reason);
-
-   trx->mo.nm_state.administrative = new_state;
-   if (!trx->bts || !trx->bts->oml_link)
-   return;
 
abis_nm_chg_adm_state(trx->bts, NM_OC_RADIO_CARRIER,
  trx->bts->bts_nr, trx->nr, 0xff,
diff --git a/openbsc/src/libbsc/acc_ramp.c b/openbsc/src/libbsc/acc_ramp.c
index 6e64109..c90d087 100644
--- a/openbsc/src/libbsc/acc_ramp.c
+++ b/openbsc/src/libbsc/acc_ramp.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /*
  * Check if an ACC has been permanently barred for a BTS,
@@ -144,6 +145,7 @@
struct nm_statechg_signal_data *nsd = signal_data;
struct acc_ramp *acc_ramp = handler_data;
struct gsm_bts_trx *trx = NULL;
+   bool trigger_ramping = false, abort_ramping = false;
 
/* Handled signals map to an Administrative State Change ACK, or a 
State Changed Event Report. */
if (signal != S_NM_STATECHG_ADM && signal != S_NM_STATECHG_OPER)
@@ -154,37 +156,109 @@
 
trx = nsd->obj;
 
+   LOGP(DRSL, LOGL_DEBUG, "(bts=%d,trx=%d) ACC RAMP: administrative state 
%s -> %s\n",
+   acc_ramp->bts->nr, trx->nr,
+   get_value_string(abis_nm_adm_state_names, 
nsd->old_state->administrative),
+   get_value_string(abis_nm_adm_state_names, 
nsd->new_state->administrative));
+   LOGP(DRSL, LOGL_DEBUG, "(bts=%d,trx=%d) ACC RAMP: operational state %s 
-> %s\n",
+   acc_ramp->bts->nr, trx->nr,
+   abis_nm_opstate_name(nsd->old_state->operational),
+   abis_nm_opstate_name(nsd->new_state->operational));
+
/* We only care about state changes of the first TRX. */
if (trx->nr != 0)
return 0;
 
/* RSL must already be up. We cannot send RACH system information to 
the BTS otherwise. */
-   if (trx->rsl_link == NULL)
+   if (trx->rsl_link == NULL) {
+   LOGP(DRSL, LOGL_DEBUG, "(bts=%d,trx=%d) ACC RAMP: ignoring 
state change because RSL link is down\n",
+acc_ramp->bts->nr, trx->nr);
return 0;
-
-   /* Trigger or abort ACC ramping based on the new 'RF lock' state of 
this TRX. */
-   switch (nsd->new_state->administrative) {
-   case NM_STATE_UNLOCKED:
-   /*
-* Do not re-trigger ACC ramping if ramping is already in 
progress.
-* A BTS might send several "unlock" change events: One in the 
Administrative
-* State Change ACK, and/or another in a State Changed Event 
Report.
-* For instance, the nanobts is known to send both.
-*/
-   if (!osmo_timer_pending(_ramp->step_timer))
-   

[MERGED] openbsc[master]: ensure that acc_ramp_init() is only called once

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ensure that acc_ramp_init() is only called once
..


ensure that acc_ramp_init() is only called once

There are plans to register signal handlers in acc_ramp_init(). Once we
do that, the acc_ramp_init() function should only be called once to
avoid duplicate signal handlers on the handler list.

However, the acc_ramp_init() function currently serves a dual-purpose:

1) Initialize the acc_ramp structure for a bts
2) Enable or disable ACC ramping

Add new functions to support use case 2, and call acc_ramp_init()
just once while reading the configuration file. The VTY commands
which enable/disable ACC ramping use the new APIs instead.

Also, rename acc_ramp_start() to acc_ramp_trigger() and tweak its
semantics so that it can always be called regardless of what the
current configuration settings are. This prepares us for triggering
ACC ramping upon events other than "RSL link-up".

This is a port of osmo-bsc commit ea33341cf7b52d432be98f2280b4a5f3129ef667.
Also remove a call to acc_ramp_init() which should have been removed in
openbsc commit ebc1e39d919f5f919cb176ee9c6cbbccc8d620b1

Change-Id: Iadd25016e6478a9dc5da1db42e6192ce0f5cc746
Related: OS2591
---
M openbsc/include/openbsc/acc_ramp.h
M openbsc/src/libbsc/acc_ramp.c
M openbsc/src/libbsc/bsc_init.c
M openbsc/src/libbsc/bsc_vty.c
4 files changed, 43 insertions(+), 35 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/include/openbsc/acc_ramp.h 
b/openbsc/include/openbsc/acc_ramp.h
index cb063bf..efb12b0 100644
--- a/openbsc/include/openbsc/acc_ramp.h
+++ b/openbsc/include/openbsc/acc_ramp.h
@@ -79,6 +79,18 @@
 };
 
 /*!
+ * Enable or disable ACC ramping.
+ * When enabled, ramping begins once acc_ramp_start() is called.
+ * When disabled, an ACC ramping process in progress will continue
+ * unless acc_ramp_abort() is called as well.
+ * \param[in] acc_ramp Pointer to acc_ramp structure.
+ */
+static inline void acc_ramp_set_enabled(struct acc_ramp *acc_ramp, bool enable)
+{
+   acc_ramp->acc_ramping_enabled = enable;
+}
+
+/*!
  * Return true if ACC ramping is currently enabled, else false.
  * \param[in] acc_ramp Pointer to acc_ramp structure.
  */
@@ -141,9 +153,9 @@
rach_control->t3 |= acc_ramp_get_barred_t3(acc_ramp);
 }
 
-void acc_ramp_init(struct acc_ramp *acc_ramp, bool enable, struct gsm_bts 
*bts);
+void acc_ramp_init(struct acc_ramp *acc_ramp, struct gsm_bts *bts);
 int acc_ramp_set_step_size(struct acc_ramp *acc_ramp, unsigned int step_size);
 int acc_ramp_set_step_interval(struct acc_ramp *acc_ramp, unsigned int 
step_interval);
 void acc_ramp_set_step_interval_dynamic(struct acc_ramp *acc_ramp);
-void acc_ramp_start(struct acc_ramp *acc_ramp);
+void acc_ramp_trigger(struct acc_ramp *acc_ramp);
 void acc_ramp_abort(struct acc_ramp *acc_ramp);
diff --git a/openbsc/src/libbsc/acc_ramp.c b/openbsc/src/libbsc/acc_ramp.c
index 9b3f90b..e887723 100644
--- a/openbsc/src/libbsc/acc_ramp.c
+++ b/openbsc/src/libbsc/acc_ramp.c
@@ -140,28 +140,20 @@
  * Initialize an acc_ramp data structure.
  * Storage for this structure must be provided by the caller.
  *
- * If ACC ramping is enabled, all ACCs are denied by default.
- * A subsequent call to acc_ramp_start() will begin the ramping process.
- * If ACC ramping is disabled, all ACCs will be allowed by default,
- * and there is no need to do anything else.
+ * By default, ACC ramping is disabled and all ACCs are allowed.
  *
  * \param[in] acc_ramp Pointer to acc_ramp structure to be initialized.
- * \param[in] enable Indicates whether ACC ramping should be enabled or 
disabled.
  * \param[in] bts BTS which uses this ACC ramp data structure.
  */
-void acc_ramp_init(struct acc_ramp *acc_ramp, bool enable, struct gsm_bts *bts)
+void acc_ramp_init(struct acc_ramp *acc_ramp, struct gsm_bts *bts)
 {
acc_ramp->bts = bts;
-   acc_ramp->acc_ramping_enabled = enable;
+   acc_ramp_set_enabled(acc_ramp, false);
acc_ramp->step_size = ACC_RAMP_STEP_SIZE_DEFAULT;
acc_ramp->step_interval_sec = ACC_RAMP_STEP_INTERVAL_MIN;
acc_ramp->step_interval_is_fixed = false;
+   allow_all_enabled_accs(acc_ramp);
osmo_timer_setup(_ramp->step_timer, do_acc_ramping_step, acc_ramp);
-
-   if (acc_ramp->acc_ramping_enabled)
-   barr_all_enabled_accs(acc_ramp);
-   else
-   allow_all_enabled_accs(acc_ramp);
 }
 
 /*!
@@ -211,28 +203,34 @@
 }
 
 /*!
- * Begin the ramping process. Perform at least one ramping step to allow 
'step_size' ACCs.
- * If 'step_size' is ACC_RAMP_STEP_SIZE_MAX, all ACCs will be allowed 
immediately.
+ * Determine if ACC ramping should be started according to configuration, and
+ * if ACC ramping is enabled, begin the ramping process.
+ * Perform at 

openbsc[master]: only trigger acc ramping if trx 0 is usable and unlocked

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7824
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2cc9c1b8193546ea04ea5beb3751c2206f0215f2
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


openbsc[master]: trigger acc ramping on state-changed-event reports

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7823
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6443635b822b6cd776f6dc8a6ee73ab09e865b04
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No



openbsc[master]: rename helper functions in the acc ramp code to avoid confusion

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7822
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic1e5a1f969823cfbfb9fe9e959db87c1717c3a83
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


openbsc[master]: trigger acc ramping based on trx rf-locked state

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7821
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4124f1da3dadec003de45c1da8435506ee8f0a34
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


openbsc[master]: ensure that acc_ramp_init() is only called once

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7820
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iadd25016e6478a9dc5da1db42e6192ce0f5cc746
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


openbsc[master]: only log actual access control class ramping changes

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7818
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2f892b998eb8119e623c1d87ffe865b48f7d5a87
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No



[MERGED] osmo-trx[master]: configure.ac: Add --enable-sanitize option

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: configure.ac: Add --enable-sanitize option
..


configure.ac: Add --enable-sanitize option

Change-Id: I1b5154a47bb2f66103ac254a0f422e8a80b2d3e0
---
M configure.ac
M contrib/jenkins.sh
2 files changed, 19 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/configure.ac b/configure.ac
index c80f1cf..8271dbf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,6 +78,18 @@
 PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
 PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.10.0)
 
+AC_ARG_ENABLE(sanitize,
+   [AS_HELP_STRING(
+   [--enable-sanitize],
+   [Compile with address sanitizer enabled],
+   )],
+   [sanitize=$enableval], [sanitize="no"])
+if test x"$sanitize" = x"yes"
+then
+   CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
+   LDFLAGS="$LDFLAGS -fsanitize=address -fsanitize=undefined"
+fi
+
 AC_ARG_WITH(usrp1, [
 AS_HELP_STRING([--with-usrp1],
 [enable USRP1 gnuradio based transceiver])
@@ -176,6 +188,11 @@
 AC_CHECK_HEADER([boost/config.hpp],[],
 [AC_MSG_ERROR([boost/config.hpp not found, install e.g. libboost-dev])])
 
+AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
+AC_MSG_RESULT([CFLAGS="$CFLAGS"])
+AC_MSG_RESULT([CXXFLAGS="$CXXFLAGS"])
+AC_MSG_RESULT([LDFLAGS="$LDFLAGS"])
+
 dnl Output files
 AC_CONFIG_FILES([\
 Makefile \
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index c4d786d..e600e01 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -63,7 +63,7 @@
 
 mkdir "$deps" || true
 
-osmo-build-dep.sh libosmocore "" "--disable-doxygen --disable-pcsc"
+osmo-build-dep.sh libosmocore "" "--enable-sanitize --disable-doxygen 
--disable-pcsc"
 
 export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
 export LD_LIBRARY_PATH="$inst/lib"
@@ -78,7 +78,7 @@
 
 cd "$base"
 autoreconf --install --force
-./configure $INSTR
+./configure --enable-sanitize $INSTR
 $MAKE $PARALLEL_MAKE
 $MAKE check \
   || cat-testlogs.sh

-- 
To view, visit https://gerrit.osmocom.org/7828
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1b5154a47bb2f66103ac254a0f422e8a80b2d3e0
Gerrit-PatchSet: 4
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-gsm-tester[master]: contrib: build-osmo-trx: Enable addr sanitize for osmo-trx

2018-04-16 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7832
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iad90c7c8c2098680276de000c36bec0224f9746d
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


osmo-gsm-tester[master]: contrib: build-osm-bts-sysmo: openbsc dep no longer needed

2018-04-16 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7831
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iafd5ee1df001719ff6165ada996359b92116671e
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


osmo-gsm-tester[master]: contrib: Enable address-sanitize in builds

2018-04-16 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7830
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibef6c2fc497bce0d799116a854a48872f9ca16d7
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


[MERGED] osmo-ci[master]: scripts/docker-cleanup.sh: set permissions to 755

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: scripts/docker-cleanup.sh: set permissions to 755
..


scripts/docker-cleanup.sh: set permissions to 755

It will otherwise not executed by the cron, because the cron
is checking for the executable bit

Change-Id: Ie9d67b157d62b38b62f5e74406d14344f90d07b8
---
M scripts/docker-cleanup.sh
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/scripts/docker-cleanup.sh b/scripts/docker-cleanup.sh
old mode 100644
new mode 100755

-- 
To view, visit https://gerrit.osmocom.org/7834
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie9d67b157d62b38b62f5e74406d14344f90d07b8
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 


osmo-ci[master]: scripts/docker-cleanup.sh: set permissions to 755

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review+2 Verified+1

thanks, nice catch!

-- 
To view, visit https://gerrit.osmocom.org/7834
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9d67b157d62b38b62f5e74406d14344f90d07b8
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


[MERGED] osmo-ci[master]: ansible: osmocom-jenkins-slave: fix crontab for fstrim

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ansible: osmocom-jenkins-slave: fix crontab for fstrim
..


ansible: osmocom-jenkins-slave: fix crontab for fstrim

Change-Id: Ib6aae8d1d986346dc7bc0fc945bab6491fff4f3f
---
M ansible/roles/osmocom-jenkins-slave/tasks/main.yml
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml 
b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml
index f8b29d8..b57c81a 100644
--- a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml
+++ b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml
@@ -114,5 +114,6 @@
   cron:
 name: "fstrim"
 hour: "*/12"
+minute: 0
 job: "fstrim / >/dev/null 2>/dev/null || true"
   when: osmocom_jenkins_slave_fstrim

-- 
To view, visit https://gerrit.osmocom.org/7833
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib6aae8d1d986346dc7bc0fc945bab6491fff4f3f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 


[MERGED] osmo-trx[master]: tests: Makefile.am: Fix typo in include path

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: tests: Makefile.am: Fix typo in include path
..


tests: Makefile.am: Fix typo in include path

Change-Id: I036f1f587f2a5eaf93ec8fb619bf76b571c1633a
---
M tests/Transceiver52M/Makefile.am
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/tests/Transceiver52M/Makefile.am b/tests/Transceiver52M/Makefile.am
index 79f73c6..8a05bd8 100644
--- a/tests/Transceiver52M/Makefile.am
+++ b/tests/Transceiver52M/Makefile.am
@@ -1,6 +1,6 @@
 include $(top_srcdir)/Makefile.common
 
-AM_CFLAGS = -Wall -I$(top_srcdir)/Transciever52 $(STD_DEFINES_AND_INCLUDES) -g
+AM_CFLAGS = -Wall -I$(top_srcdir)/Transceiver52M $(STD_DEFINES_AND_INCLUDES) -g
 
 EXTRA_DIST = convolve_test.ok
 

-- 
To view, visit https://gerrit.osmocom.org/7829
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I036f1f587f2a5eaf93ec8fb619bf76b571c1633a
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-ci[master]: ansible: osmocom-jenkins-slave: fix crontab for fstrim

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review+2 Verified+1

-- 
To view, visit https://gerrit.osmocom.org/7833
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib6aae8d1d986346dc7bc0fc945bab6491fff4f3f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


[MERGED] libosmo-netif[master]: tests: jibuf_tool: Add OSMUX support

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: tests: jibuf_tool: Add OSMUX support
..


tests: jibuf_tool: Add OSMUX support

Change-Id: I0f02da0329e6739ff340d31113161bb520b1b760
---
M tests/jibuf/jibuf_tool.c
1 file changed, 40 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/tests/jibuf/jibuf_tool.c b/tests/jibuf/jibuf_tool.c
index 7550c1c..ce6632a 100644
--- a/tests/jibuf/jibuf_tool.c
+++ b/tests/jibuf/jibuf_tool.c
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "osmo-pcap-test/osmo_pcap.h"
 
@@ -57,6 +58,7 @@
 static bool opt_test_rand;
 static bool opt_debug_human;
 static bool opt_debug_table;
+static bool opt_osmux;
 static char* opt_pcap_file;
 /* - */
 
@@ -106,6 +108,8 @@
 /* Used for test pcap: */
 static struct osmo_pcap osmo_pcap;
 static bool pcap_finished;
+static struct osmux_out_handle pcap_osmux_h;
+static struct llist_head osmux_list;
 /* - */
 
 static void sigalarm_handler(int foo)
@@ -399,9 +403,33 @@
return 0;
 }
 
+void glue_cb(struct msgb *msg, void *data)
+{
+   pcap_generate_pkt_cb(msg);
+}
+
+int pcap_read_osmux(struct msgb *msg)
+{
+   struct osmux_hdr *osmuxh;
+
+   /* This code below belongs to the osmux receiver */
+   while((osmuxh = osmux_xfrm_output_pull(msg)) != NULL) {
+   osmux_xfrm_output(osmuxh, _osmux_h, _list);
+   osmux_tx_sched(_list, glue_cb, NULL);
+   }
+   msgb_free(msg);
+   return 0;
+}
+
 void pcap_pkt_timer_cb(void *data)
 {
-   if (osmo_pcap_test_run(_pcap, IPPROTO_UDP, pcap_generate_pkt_cb) < 
0) {
+   int (*mycb)(struct msgb *msgb);
+   if(opt_osmux)
+   mycb = pcap_read_osmux;
+   else
+   mycb = pcap_generate_pkt_cb;
+
+   if (osmo_pcap_test_run(_pcap, IPPROTO_UDP, mycb) < 0) {
osmo_pcap_stats_printf();
osmo_pcap_test_close(osmo_pcap.h);
pcap_finished=true;
@@ -466,6 +494,11 @@
 
osmo_pcap.timer.cb = pcap_pkt_timer_cb;
 
+   if(opt_osmux) {
+   INIT_LLIST_HEAD(_list);
+   osmux_xfrm_output_init(_osmux_h, 0);
+   }
+
jb = osmo_jibuf_alloc(NULL);
osmo_jibuf_set_dequeue_cb(jb, dequeue_cb, NULL);
osmo_jibuf_set_min_delay(jb, 60);
@@ -484,10 +517,11 @@
 
 static void print_help(void)
 {
-   printf("jibuf_test [-r] [-p pcap] [-d] [-g]\n");
+   printf("jibuf_test [-r] [-p pcap] [-o] [-d] [-g]\n");
printf(" -h Print this help message\n");
printf(" -r Run test with randomly generated jitter\n");
printf(" -p Run test with specified pcap file\n");
+   printf(" -o The pcap contains OSMUX packets isntead of RTP\n");
printf(" -d Enable packet trace debug suitable for humans\n");
printf(" -t Enable packet trace debug suitable for gnuplot\n");
 }
@@ -496,7 +530,7 @@
 {
int opt;
 
-   while ((opt = getopt(argc, argv, "hdtrp:")) != -1) {
+   while ((opt = getopt(argc, argv, "hdtrop:")) != -1) {
switch (opt) {
case 'h':
print_help();
@@ -510,6 +544,9 @@
case 'r':
opt_test_rand = true;
break;
+   case 'o':
+   opt_osmux = true;
+   break;
case 'p':
opt_pcap_file = strdup(optarg);
break;

-- 
To view, visit https://gerrit.osmocom.org/7776
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0f02da0329e6739ff340d31113161bb520b1b760
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-trx[master]: use osmo_init_logging2()

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: use osmo_init_logging2()
..


use osmo_init_logging2()

Change-Id: I2c28e6e6e3eb9f587680b34330e03408e32c2b94
---
M Transceiver52M/osmo-trx.cpp
M tests/CommonLibs/LogTest.cpp
2 files changed, 7 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index 2eb8309..1b351d6 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -506,7 +506,7 @@
convolve_init();
convert_init();
 
-   osmo_init_logging(_info);
+   osmo_init_logging2(tall_trx_ctx, _info);
osmo_stats_init(tall_trx_ctx);
vty_init(_vty_info);
ctrl_vty_init(tall_trx_ctx);
diff --git a/tests/CommonLibs/LogTest.cpp b/tests/CommonLibs/LogTest.cpp
index b8677e6..5167a62 100644
--- a/tests/CommonLibs/LogTest.cpp
+++ b/tests/CommonLibs/LogTest.cpp
@@ -29,6 +29,8 @@
 
 #include "Logger.h"
 extern "C" {
+#include 
+#include 
 #include 
 #include 
 #include "debug.h"
@@ -50,7 +52,10 @@
linfo.cat = categories;
linfo.num_cat = ARRAY_SIZE(categories);
 
-   osmo_init_logging();
+   void *tall_ctx = talloc_named_const(NULL, 1, "OsmoTRX context");
+   msgb_talloc_ctx_init(tall_ctx, 0);
+
+   osmo_init_logging2(tall_ctx, );
 
log_set_use_color(osmo_stderr_target, 0);
log_set_print_filename(osmo_stderr_target, 0);

-- 
To view, visit https://gerrit.osmocom.org/7827
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2c28e6e6e3eb9f587680b34330e03408e32c2b94
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


osmo-trx[master]: tests: Makefile.am: Fix typo in include path

2018-04-16 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7829
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I036f1f587f2a5eaf93ec8fb619bf76b571c1633a
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] libosmo-netif[master]: jibuf: Take RTP marker into account

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: jibuf: Take RTP marker into account
..


jibuf: Take RTP marker into account

Change-Id: Ie142acfb45650e0af775f58226fd191beaf8178e
---
M src/jibuf.c
M tests/jibuf/jibuf_test.c
M tests/jibuf/jibuf_test.ok
M tests/jibuf/jibuf_tool.c
4 files changed, 89 insertions(+), 5 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/jibuf.c b/src/jibuf.c
index c3d6bad..dfeb12e 100644
--- a/src/jibuf.c
+++ b/src/jibuf.c
@@ -115,6 +115,14 @@
 
 }
 
+static bool msg_get_marker(struct msgb *msg)
+{
+   /* TODO: make it more generic as a callback so that different types of
+* pkts can be used ? */
+   struct rtp_hdr *rtph = osmo_rtp_get_hdr(msg);
+   return rtph->marker;
+}
+
 static uint16_t msg_get_sequence(struct msgb *msg)
 {
struct rtp_hdr *rtph = osmo_rtp_get_hdr(msg);
@@ -275,7 +283,11 @@
 
clock_gettime_timeval(CLOCK_MONOTONIC, >last_enqueue_time);
 
-   if (!jb->started) {
+   /* If packet contains a mark -> start of talkspurt.
+* A lot of packets may have been suppressed by the sender before it,
+* so let's take it as a reference
+*/
+   if (!jb->started || msg_get_marker(msg)) {
jb->started = true;
msg_set_as_reference(jb, msg);
rel_delay = 0;
@@ -310,10 +322,10 @@
timeradd(>last_enqueue_time, _ts, _ts);
 
LOGP(DLJIBUF, LOGL_DEBUG, "enqueuing packet seq=%"PRIu16" rel=%d 
delay=%d" \
-   " thres=%d {%lu.%06lu -> %lu.%06lu}\n",
+   " thres=%d {%lu.%06lu -> %lu.%06lu} %s\n",
msg_get_sequence(msg), rel_delay, delay, jb->threshold_delay,
jb->last_enqueue_time.tv_sec, jb->last_enqueue_time.tv_usec,
-   sched_ts.tv_sec, sched_ts.tv_usec);
+   sched_ts.tv_sec, sched_ts.tv_usec, msg_get_marker(msg)? "M" : 
"");
 
/* Add scheduled dequeue time in msg->cb so we can check it later */
unsigned long *old_cb = talloc_memdup(jb->talloc_ctx, msg->cb, 
sizeof(msg->cb));
diff --git a/tests/jibuf/jibuf_test.c b/tests/jibuf/jibuf_test.c
index ba21906..9965387 100644
--- a/tests/jibuf/jibuf_test.c
+++ b/tests/jibuf/jibuf_test.c
@@ -568,6 +568,56 @@
osmo_jibuf_delete(jb);
 }
 
+static void test_rtp_marker(void)
+{
+   int min_delay = 60;
+   struct msgb *msg;
+   struct rtp_hdr *rtph;
+
+   printf("===test_rtp_marker===\n");
+
+   clock_override_enable(true);
+   clock_override_set(0, 0);
+   rtp_init(32, 400);
+   jb = osmo_jibuf_alloc(NULL);
+   osmo_jibuf_set_dequeue_cb(jb, dequeue_cb, NULL);
+   osmo_jibuf_set_min_delay(jb, min_delay);
+   osmo_jibuf_set_max_delay(jb, 200);
+
+   /* First rtp at t=0, should be scheduled in min_delay time */
+   clock_debug("enqueue 1st packet");
+   ENQUEUE_NEXT(jb);
+   clock_override_add(0, TIME_RTP_PKT_MS*1000);
+   clock_debug("enqueue 2nd packet");
+   ENQUEUE_NEXT(jb);
+   clock_override_add(0, min_delay*1000);
+   clock_debug("2 packets dequeued");
+   osmo_select_main(0);
+
+   clock_override_add(0, 40*1000);
+/* We are at t=120, next non-marked (consecutive seq) packet arriving 
at
+ * this time should be dropped, but since marker establishes new ref,
+ * it will be accepted as well an ext paket */
+   clock_debug("enqueue late pkt with marker=1, will be enqueued");
+   msg = rtp_next();
+   rtph = osmo_rtp_get_hdr(msg);
+   rtph->marker = 1;
+   OSMO_ASSERT(osmo_jibuf_enqueue(jb, msg) == 0);
+
+   clock_debug("enqueue late pkt after pkt with marker=1, will be 
enqueued");
+   clock_override_add(0, TIME_RTP_PKT_MS*1000);
+   ENQUEUE_NEXT(jb);
+
+   clock_debug("2 packets dequeued");
+   clock_override_add(0, min_delay*1000);
+   osmo_select_main(0);
+
+   /* t=120, 4 enqueued, 4 dequeued.*/
+   OSMO_ASSERT(osmo_jibuf_empty(jb));
+
+   osmo_jibuf_delete(jb);
+}
+
 int main(int argc, char **argv)
 {
 
@@ -592,6 +642,7 @@
test_buffer_threshold_change();
test_seq_wraparound();
test_timestamp_wraparound();
+   test_rtp_marker();
 
fprintf(stdout, "OK: Test passed\n");
return EXIT_SUCCESS;
diff --git a/tests/jibuf/jibuf_test.ok b/tests/jibuf/jibuf_test.ok
index 5a0f121..3103781 100644
--- a/tests/jibuf/jibuf_test.ok
+++ b/tests/jibuf/jibuf_test.ok
@@ -348,4 +348,21 @@
 sys={0.16}, mono={0.16}: clock_override_add
 sys={0.16}, mono={0.16}: dequeue 5th packet (ts=334)
 sys={0.16}, mono={0.16}: dequeue: seq=37 ts=334 LATEST
+===test_rtp_marker===
+sys={0.00}, mono={0.00}: clock_override_set
+sys={0.00}, mono={0.00}: enqueue 1st packet
+sys={0.02}, mono={0.02}: clock_override_add
+sys={0.02}, 

[MERGED] libosmo-netif[master]: tests: jibuf_tool: Improve jibuf_test to read pcaps

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: tests: jibuf_tool: Improve jibuf_test to read pcaps
..


tests: jibuf_tool: Improve jibuf_test to read pcaps

Change-Id: I7a13c823fb70e0adbc5fa0726fd66b15dc40014e
Signed-off-by: Pau Espin Pedrol 
---
M tests/Makefile.am
M tests/jibuf/jibuf_tool.c
M tests/jibuf/jitter.plt
3 files changed, 315 insertions(+), 112 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/tests/Makefile.am b/tests/Makefile.am
index a4abca2..dd0e2b2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -2,6 +2,9 @@
 AM_LDFLAGS = $(LIBOSMOCORE_LDFLAGS)
 
 check_PROGRAMS = osmux/osmux_test jibuf/jibuf_test jibuf/jibuf_tool
+check_HEADERS = \
+   osmo-pcap-test/osmo_pcap.h \
+   osmo-pcap-test/proto.h
 
 osmux_osmux_test_SOURCES = osmux/osmux_test.c
 osmux_osmux_test_LDADD = $(LIBOSMOCORE_LIBS) 
$(top_builddir)/src/libosmonetif.la
@@ -9,8 +12,20 @@
 jibuf_jibuf_test_SOURCES = jibuf/jibuf_test.c
 jibuf_jibuf_test_LDADD = $(LIBOSMOCORE_LIBS) 
$(top_builddir)/src/libosmonetif.la
 
-jibuf_jibuf_tool_SOURCES = jibuf/jibuf_tool.c
-jibuf_jibuf_tool_LDADD = $(LIBOSMOCORE_LIBS) 
$(top_builddir)/src/libosmonetif.la
+jibuf_jibuf_tool_SOURCES = \
+   jibuf/jibuf_tool.c \
+   osmo-pcap-test/proto.c \
+   osmo-pcap-test/l2_eth.c \
+   osmo-pcap-test/l2_sll.c \
+   osmo-pcap-test/l3_ipv4.c \
+   osmo-pcap-test/l4_tcp.c \
+   osmo-pcap-test/l4_udp.c \
+   osmo-pcap-test/pcap.c
+
+jibuf_jibuf_tool_LDADD = \
+   $(LIBOSMOCORE_LIBS) \
+   $(top_builddir)/src/libosmonetif.la \
+   -lpcap
 
 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
diff --git a/tests/jibuf/jibuf_tool.c b/tests/jibuf/jibuf_tool.c
index 810ecb4..7550c1c 100644
--- a/tests/jibuf/jibuf_tool.c
+++ b/tests/jibuf/jibuf_tool.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -29,50 +30,14 @@
 #include 
 #include 
 
-/* Logging related stuff */
-#define INT2IDX(x)   (-1*(x)-1)
-struct log_info_cat jibuf_test_cat[] = {
-   [INT2IDX(DLJIBUF)] = {
-   .name = "DLJIBUF",
-   .description = "Osmocom Jitter Buffer",
-   .enabled = 1, .loglevel = LOGL_DEBUG,
-   },
-};
-const struct log_info jibuf_test_log_info = {
-   .filter_fn = NULL,
-   .cat = jibuf_test_cat,
-   .num_cat = ARRAY_SIZE(jibuf_test_cat),
-};
+#include "osmo-pcap-test/osmo_pcap.h"
 
-/* RTP packet with AMR payload */
-static uint8_t rtp_pkt[] = {
-   0x80, 0x62, 0x3f, 0xcc, 0x00, 0x01, 0xa7, 0x6f, /* RTP */
-   0x07, 0x09, 0x00, 0x62, 0x20, 0x14, 0xff, 0xd4, /* AMR */
-   0xf9, 0xff, 0xfb, 0xe7, 0xeb, 0xf9, 0x9f, 0xf8,
-   0xf2, 0x26, 0x33, 0x65, 0x54,
-};
-
-static void sigalarm_handler(int foo)
-{
-   printf("FAIL: test did not run successfully\n");
-   exit(EXIT_FAILURE);
-}
-
-#define SAMPLES_PER_PKT160
-#define RTP_FREQ_MS 20
-#define RTP_PKTS_PER_SEC (1000/RTP_FREQ_MS)
-#define NET_DELAY_MS   300
-#define GENERATED_JITTER_MS 160
-#define NUM_PACKETS_TO_SEND 1000
-
-#define TRACE_PACKE_DEBUG 0
-#define TRACE_PACKET_GNUPLOT 1
-#define TRACE_PACKET_TEST_JITTER 0
 
 struct checkpoint {
struct timeval ts;
int transit;
double jitter;
+   uint32_t timestamp;
 };
 
 struct rtp_pkt_info {
@@ -88,14 +53,66 @@
struct rtp_pkt_info *data;
 };
 
-struct osmo_jibuf *jb;
-uint16_t rtp_first_seq;
-uint16_t rtp_next_seq;
-uint32_t rtp_next_ts;
-uint32_t packets_sent;
-uint32_t packets_received;
-uint32_t packets_dropped;
-uint32_t packets_too_much_jitter;
+/* Option parameters to the program */
+static bool opt_test_rand;
+static bool opt_debug_human;
+static bool opt_debug_table;
+static char* opt_pcap_file;
+/* - */
+
+/* Logging related stuff */
+#define INT2IDX(x)   (-1*(x)-1)
+struct log_info_cat jibuf_test_cat[] = {
+   [INT2IDX(DLJIBUF)] = {
+   .name = "DLJIBUF",
+   .description = "Osmocom Jitter Buffer",
+   .enabled = 1, .loglevel = LOGL_DEBUG,
+   },
+};
+const struct log_info jibuf_test_log_info = {
+   .filter_fn = NULL,
+   .cat = jibuf_test_cat,
+   .num_cat = ARRAY_SIZE(jibuf_test_cat),
+};
+/* - */
+
+/* Used for test random: */
+#define SAMPLES_PER_PKT160
+#define RTP_FREQ_MS 20
+#define RTP_PKTS_PER_SEC (1000/RTP_FREQ_MS)
+#define NET_DELAY_MS   300
+#define GENERATED_JITTER_MS 160
+#define NUM_PACKETS_TO_SEND 1000
+
+/* RTP packet with AMR payload */
+static uint8_t rtp_pkt[] = {
+   0x80, 0x62, 0x3f, 0xcc, 0x00, 0x01, 0xa7, 0x6f, /* RTP */
+   0x07, 0x09, 0x00, 0x62, 0x20, 0x14, 0xff, 0xd4, /* AMR */
+   0xf9, 0xff, 0xfb, 0xe7, 0xeb, 0xf9, 0x9f, 0xf8,
+ 

[MERGED] libosmo-netif[master]: tests: jibuf_tool: Initial commit

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: tests: jibuf_tool: Initial commit
..


tests: jibuf_tool: Initial commit

Change-Id: I92307c8b1483dd488339771462290aae0ae5689a
---
M tests/Makefile.am
A tests/jibuf/jibuf_tool.c
A tests/jibuf/jitter.plt
3 files changed, 421 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/tests/Makefile.am b/tests/Makefile.am
index bf1db1f..a4abca2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,7 +1,7 @@
 AM_CFLAGS = -Wall -I$(top_srcdir)/include $(LIBOSMOCORE_CFLAGS) -g
 AM_LDFLAGS = $(LIBOSMOCORE_LDFLAGS)
 
-check_PROGRAMS = osmux/osmux_test jibuf/jibuf_test
+check_PROGRAMS = osmux/osmux_test jibuf/jibuf_test jibuf/jibuf_tool
 
 osmux_osmux_test_SOURCES = osmux/osmux_test.c
 osmux_osmux_test_LDADD = $(LIBOSMOCORE_LIBS) 
$(top_builddir)/src/libosmonetif.la
@@ -9,6 +9,9 @@
 jibuf_jibuf_test_SOURCES = jibuf/jibuf_test.c
 jibuf_jibuf_test_LDADD = $(LIBOSMOCORE_LIBS) 
$(top_builddir)/src/libosmonetif.la
 
+jibuf_jibuf_tool_SOURCES = jibuf/jibuf_tool.c
+jibuf_jibuf_tool_LDADD = $(LIBOSMOCORE_LIBS) 
$(top_builddir)/src/libosmonetif.la
+
 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
:;{ \
diff --git a/tests/jibuf/jibuf_tool.c b/tests/jibuf/jibuf_tool.c
new file mode 100644
index 000..810ecb4
--- /dev/null
+++ b/tests/jibuf/jibuf_tool.c
@@ -0,0 +1,382 @@
+/* (C) 2017 by sysmocom - s.f.m.c. GmbH 
+ *
+ * Author: Pau Espin Pedrol 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ * 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.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Logging related stuff */
+#define INT2IDX(x)   (-1*(x)-1)
+struct log_info_cat jibuf_test_cat[] = {
+   [INT2IDX(DLJIBUF)] = {
+   .name = "DLJIBUF",
+   .description = "Osmocom Jitter Buffer",
+   .enabled = 1, .loglevel = LOGL_DEBUG,
+   },
+};
+const struct log_info jibuf_test_log_info = {
+   .filter_fn = NULL,
+   .cat = jibuf_test_cat,
+   .num_cat = ARRAY_SIZE(jibuf_test_cat),
+};
+
+/* RTP packet with AMR payload */
+static uint8_t rtp_pkt[] = {
+   0x80, 0x62, 0x3f, 0xcc, 0x00, 0x01, 0xa7, 0x6f, /* RTP */
+   0x07, 0x09, 0x00, 0x62, 0x20, 0x14, 0xff, 0xd4, /* AMR */
+   0xf9, 0xff, 0xfb, 0xe7, 0xeb, 0xf9, 0x9f, 0xf8,
+   0xf2, 0x26, 0x33, 0x65, 0x54,
+};
+
+static void sigalarm_handler(int foo)
+{
+   printf("FAIL: test did not run successfully\n");
+   exit(EXIT_FAILURE);
+}
+
+#define SAMPLES_PER_PKT160
+#define RTP_FREQ_MS 20
+#define RTP_PKTS_PER_SEC (1000/RTP_FREQ_MS)
+#define NET_DELAY_MS   300
+#define GENERATED_JITTER_MS 160
+#define NUM_PACKETS_TO_SEND 1000
+
+#define TRACE_PACKE_DEBUG 0
+#define TRACE_PACKET_GNUPLOT 1
+#define TRACE_PACKET_TEST_JITTER 0
+
+struct checkpoint {
+   struct timeval ts;
+   int transit;
+   double jitter;
+};
+
+struct rtp_pkt_info {
+   struct osmo_timer_list timer;
+   struct timeval tx_prev_time;
+   struct timeval tx_time;
+   uint32_t tx_delay;
+   struct checkpoint prequeue;
+   struct checkpoint postqueue;
+};
+
+struct rtp_pkt_info_cb {
+   struct rtp_pkt_info *data;
+};
+
+struct osmo_jibuf *jb;
+uint16_t rtp_first_seq;
+uint16_t rtp_next_seq;
+uint32_t rtp_next_ts;
+uint32_t packets_sent;
+uint32_t packets_received;
+uint32_t packets_dropped;
+uint32_t packets_too_much_jitter;
+
+struct rtp_pkt_info *msgb_get_pinfo(struct msgb* msg)
+{
+   struct rtp_pkt_info_cb *cb = (struct rtp_pkt_info_cb *)&((msg)->cb[0]);
+   return cb->data;
+}
+
+static uint32_t timeval2ms(const struct timeval *ts)
+{
+   return ts->tv_sec * 1000 + ts->tv_usec / 1000;
+}
+
+int calc_relative_transmit_time(struct timeval *tx_0, struct timeval *tx_f,
+   struct timeval *rx_0, struct timeval *rx_f)
+{
+   struct timeval txdiff, rxdiff, diff;
+   timersub(rx_f, rx_0, );
+   timersub(tx_f, tx_0, );
+   timersub(, , );
+   return timeval2ms();
+}
+
+void trace_pkt(struct msgb *msg, char* info) {
+   struct timeval now, total_delay;
+   struct rtp_hdr *rtph = osmo_rtp_get_hdr(msg);
+   struct rtp_pkt_info *pinfo = msgb_get_pinfo(msg);
+
+   gettimeofday(, NULL);
+   timersub(, >tx_time, _delay);
+
+#if TRACE_PACKET_DEBUG
+   uint32_t total_delay_ms = timeval2ms(_delay);
+   LOGP(DLJIBUF, LOGL_DEBUG, "%s: 

libosmo-netif[master]: jibuf: Add initial implementation of Jitter Buffer

2018-04-16 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7773
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9688ba9c4d5b733b9f29d0f15f73750f9271ef55
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[MERGED] libosmo-netif[master]: jibuf: re-sync clock out of sync timestamps

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: jibuf: re-sync clock out of sync timestamps
..


jibuf: re-sync clock out of sync timestamps

Change-Id: I33556b33d7549654442d9bdd7f31128792506652
---
M src/jibuf.c
M tests/jibuf/jibuf_test.c
M tests/jibuf/jibuf_test.ok
M tests/jibuf/jibuf_tool.c
4 files changed, 152 insertions(+), 7 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/jibuf.c b/src/jibuf.c
index dfeb12e..774ddfc 100644
--- a/src/jibuf.c
+++ b/src/jibuf.c
@@ -36,6 +36,7 @@
 
 /* Sampling rate (in Hz) */
 /* TODO: SAMPLE RATE can be guessed from rtp.p_type */
+#define SAMPLES_PER_PKT 160
 #define SAMPLE_RATE 8000
 
 /* TUNABLE PARAMETERS: */
@@ -149,6 +150,27 @@
uint32_t current_tx_ts = msg_get_timestamp(msg);
 
return samples2ms((current_tx_ts - jb->ref_tx_ts)) - (current_rx_ts - 
jb->ref_rx_ts);
+}
+
+static bool msg_is_in_sequence(struct osmo_jibuf *jb, struct msgb *msg)
+{
+   uint32_t current_tx_ts = msg_get_timestamp(msg);
+   uint16_t current_seq = msg_get_sequence(msg);
+   return (current_tx_ts - jb->ref_tx_ts) == (current_seq - 
jb->ref_tx_seq)*SAMPLES_PER_PKT;
+}
+
+/* If packet contains a mark -> start of talkspurt.
+ * A lot of packets may have been suppressed by the sender before it,
+ * so let's take it as a reference
+ * If packet timestamp is not aligned with sequence
+ * number, then we are most probaly starting a talkspurt */
+static bool msg_is_syncpoint(struct osmo_jibuf *jb, struct msgb* msg)
+{
+   bool res = msg_get_marker(msg) || !msg_is_in_sequence(jb, msg);
+   if(res)
+   LOGP(DLMIB, LOGL_DEBUG, "syncpoint: %"PRIu16": marker=%d 
in_seq=%d\n",
+   msg_get_sequence(msg), msg_get_marker(msg), 
msg_is_in_sequence(jb, msg));
+   return res;
 }
 
 static void msg_set_as_reference(struct osmo_jibuf *jb, struct msgb *msg)
@@ -283,11 +305,8 @@
 
clock_gettime_timeval(CLOCK_MONOTONIC, >last_enqueue_time);
 
-   /* If packet contains a mark -> start of talkspurt.
-* A lot of packets may have been suppressed by the sender before it,
-* so let's take it as a reference
-*/
-   if (!jb->started || msg_get_marker(msg)) {
+   /* Check if it's time to sync, ie. start of talkspurt */
+   if (!jb->started || msg_is_syncpoint(jb, msg)) {
jb->started = true;
msg_set_as_reference(jb, msg);
rel_delay = 0;
diff --git a/tests/jibuf/jibuf_test.c b/tests/jibuf/jibuf_test.c
index 9965387..cbfe0af 100644
--- a/tests/jibuf/jibuf_test.c
+++ b/tests/jibuf/jibuf_test.c
@@ -618,6 +618,72 @@
osmo_jibuf_delete(jb);
 }
 
+void test_rtp_out_of_sync(unsigned int time_inc_ms, uint16_t seq_nosync_inc, 
uint32_t ts_nosync_inc, bool expect_drop)
+{
+   int min_delay = 60;
+   struct msgb *msg;
+   int rc;
+
+   printf("===test_rtp_out_of_sync(%u, %"PRIu16", %"PRIu32", %d)===\n",
+   time_inc_ms, seq_nosync_inc, ts_nosync_inc, expect_drop);
+
+   clock_override_enable(true);
+   clock_override_set(0, 0);
+   rtp_init(32, 400);
+   jb = osmo_jibuf_alloc(NULL);
+   osmo_jibuf_set_dequeue_cb(jb, dequeue_cb, NULL);
+   osmo_jibuf_set_min_delay(jb, min_delay);
+   osmo_jibuf_set_max_delay(jb, 200);
+
+   /* First rtp at t=0, should be scheduled in min_delay time */
+   clock_debug("enqueue 1st packet (seq=33, ts=560)");
+   ENQUEUE_NEXT(jb);
+   clock_override_add(0, TIME_RTP_PKT_MS*1000);
+   clock_debug("enqueue 2nd packet (seq=34, ts=720)");
+   ENQUEUE_NEXT(jb);
+
+   clock_override_add(0, time_inc_ms*1000);
+   clock_debug("2 packets dequeued");
+   osmo_select_main(0);
+
+/* We are at t=20+time_inc_ms, next pkt would normally be dropped 
since it is
+ * pretty late, but since seq and timestamp are out of sync, which
+ * means the sender had some clock issues, the jibuf is going to take
+ * this new tuple as reference and accept it.
+   */
+   clock_debug("enqueue late pkt with possible sync change");
+   rtp_init(rtp_next_seq + seq_nosync_inc, rtp_next_ts + ts_nosync_inc);
+   msg = rtp_new(rtp_next_seq, rtp_next_ts);
+   rc = osmo_jibuf_enqueue(jb, msg);
+   if (expect_drop) {
+   OSMO_ASSERT(rc < 0);
+   msgb_free(msg);
+   } else {
+   OSMO_ASSERT(rc == 0);
+   }
+
+   clock_debug("enqueue late pkt after possible resync");
+   clock_override_add(0, TIME_RTP_PKT_MS*1000);
+   msg = rtp_next();
+   rc = osmo_jibuf_enqueue(jb, msg);
+   if (expect_drop) {
+   OSMO_ASSERT(rc < 0);
+   msgb_free(msg);
+   } else {
+   OSMO_ASSERT(rc == 0);
+   }
+
+   if (!expect_drop) {
+   clock_debug("2 packets dequeued");
+  

[MERGED] libosmo-netif[master]: jibuf: Add initial implementation of Jitter Buffer

2018-04-16 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: jibuf: Add initial implementation of Jitter Buffer
..


jibuf: Add initial implementation of Jitter Buffer

Change-Id: I9688ba9c4d5b733b9f29d0f15f73750f9271ef55
---
M include/osmocom/netif/Makefile.am
A include/osmocom/netif/jibuf.h
M src/Makefile.am
A src/jibuf.c
M tests/Makefile.am
A tests/jibuf/jibuf_test.c
A tests/jibuf/jibuf_test.ok
M tests/testsuite.at
8 files changed, 1,407 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/netif/Makefile.am 
b/include/osmocom/netif/Makefile.am
index cbaff5c..0db78fb 100644
--- a/include/osmocom/netif/Makefile.am
+++ b/include/osmocom/netif/Makefile.am
@@ -3,6 +3,7 @@
 osmonetif_HEADERS = amr.h  \
channel.h   \
datagram.h  \
+   jibuf.h \
osmux.h \
ipa.h   \
ipa_unit.h  \
diff --git a/include/osmocom/netif/jibuf.h b/include/osmocom/netif/jibuf.h
new file mode 100644
index 000..6273983
--- /dev/null
+++ b/include/osmocom/netif/jibuf.h
@@ -0,0 +1,63 @@
+#pragma once
+
+#include 
+#include 
+#include 
+
+#include 
+
+/*! \defgroup jibuf Osmocom Jitter Buffer
+ *  @{
+ */
+
+/*! \file jibuf.h
+ *  \brief Osmocom Jitter Buffer helpers
+ */
+
+typedef void (*osmo_jibuf_dequeue_cb)(struct msgb *msg, void *data);
+
+/*! \brief A structure representing a single instance of a jitter buffer */
+struct osmo_jibuf {
+   void *talloc_ctx;
+   bool started;
+   struct osmo_timer_list timer;
+   struct llist_head msg_list; /* sorted by output ts */
+   uint32_t min_delay; /* in msec */
+   uint32_t max_delay; /* in msec */
+   uint32_t threshold_delay; /* in msec */
+
+   osmo_jibuf_dequeue_cb dequeue_cb;
+   void *dequeue_cb_data;
+
+   /* number of pkt drops since we last changed the buffer size */
+   uint32_t last_dropped;
+   uint32_t consecutive_drops;
+
+   uint32_t ref_rx_ts;
+   uint32_t ref_tx_ts;
+   uint16_t ref_tx_seq;
+
+   struct timeval last_enqueue_time;
+   struct timeval next_dequeue_time;
+
+   struct {
+   uint32_t total_enqueued;
+   uint64_t total_dropped;
+   } stats;
+};
+
+
+struct osmo_jibuf *osmo_jibuf_alloc(void *talloc_ctx);
+
+void osmo_jibuf_delete(struct osmo_jibuf *jb);
+
+int osmo_jibuf_enqueue(struct osmo_jibuf *jb, struct msgb *msg);
+
+bool osmo_jibuf_empty(struct osmo_jibuf *jb);
+
+void osmo_jibuf_set_min_delay(struct osmo_jibuf *jb, uint32_t min_delay);
+void osmo_jibuf_set_max_delay(struct osmo_jibuf *jb, uint32_t max_delay);
+
+void osmo_jibuf_set_dequeue_cb(struct osmo_jibuf *jb, osmo_jibuf_dequeue_cb 
dequeue_cb, void* cb_data);
+
+/*! @} */
diff --git a/src/Makefile.am b/src/Makefile.am
index 81a55b4..79e3685 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,6 +18,7 @@
  datagram.c\
  ipa.c \
  ipa_unit.c\
+ jibuf.c   \
  osmux.c   \
  rs232.c   \
  rtp.c \
diff --git a/src/jibuf.c b/src/jibuf.c
new file mode 100644
index 000..c3d6bad
--- /dev/null
+++ b/src/jibuf.c
@@ -0,0 +1,381 @@
+/* (C) 2017 by sysmocom - s.f.m.c. GmbH 
+ *
+ * Author: Pau Espin Pedrol 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ * 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.
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+
+/*! \addtogroup jibuf Osmocom Jitter Buffer
+ *  @{
+ */
+
+/*! \file jibuf.c
+ *  \brief Osmocom Jitter Buffer helpers
+ */
+
+/* Sampling rate (in Hz) */
+/* TODO: SAMPLE RATE can be guessed from rtp.p_type */
+#define SAMPLE_RATE 8000
+
+/* TUNABLE PARAMETERS: */
+
+/* default {min,max}_delay values if set_{min,max}_delay() is never called */
+#define JIBUF_DEFAULT_MIN_DELAY_MS 60
+#define JIBUF_DEFAULT_MAX_DELAY_MS 200
+
+/* How frequently (num of input packets) do we reselect a new reference? */
+#define JIBUF_REFERENCE_TS_FREQ 60
+
+/* How frequently (num of input packets) do we check if we should adapt the
+ * buffer size (threshold_delay) ? */
+#define JIBUF_BUFFER_RECALC_FREQ 40
+/* How many pkts should be dropped at max every JIBUF_BUFFER_RECALC_FREQ input
+ * pkts? */
+#define JIBUF_ALLOWED_PKT_DROP 3
+/* 

  1   2   >