[PATCH] osmo-pcu[master]: Simplify TS alloc: use defines for constants

2017-11-02 Thread Max
Hello Harald Welte, Jenkins Builder, Holger Freyther,

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

https://gerrit.osmocom.org/3920

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

Simplify TS alloc: use defines for constants

* define and use constant for occupied TFI instead copying the same
  magic number all over the place
* use libosmocore's define for bit pretty-printer

Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293
Related: OS#2282
---
M src/bts.cpp
M src/bts.h
M src/gprs_rlcmac_ts_alloc.cpp
M tests/alloc/AllocTest.cpp
4 files changed, 9 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/20/3920/7

diff --git a/src/bts.cpp b/src/bts.cpp
index e41b1fa..c36c5ee 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -469,7 +469,7 @@
for (trx = trx_from; trx <= trx_to; trx++) {
bool trx_has_pdch = false;
 
-   free_tfis = 0x;
+   free_tfis = NO_FREE_TFI;
 
for (ts = 0; ts < 8; ts++) {
pdch = &m_bts.trx[trx].pdch[ts];
diff --git a/src/bts.h b/src/bts.h
index d65cd2f..26aaa21 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -44,6 +44,7 @@
 #define LLC_CODEL_DISABLE 0
 #define LLC_CODEL_USE_DEFAULT (-1)
 #define MAX_GPRS_CS 9
+#define NO_FREE_TFI 0xUL
 
 /* see bts->gsmtap_categ_mask */
 enum pcu_gsmtap_category {
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp
index 2b08cf6..5a53267 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -129,7 +129,7 @@
int8_t tfi;
 
tfi_map = pdch->assigned_tfi(dir);
-   if (tfi_map == 0xUL)
+   if (tfi_map == NO_FREE_TFI)
return -1;
 
/* look for USF, don't use USF=7 */
@@ -210,7 +210,7 @@
pdch->num_tbfs(GPRS_RLCMAC_UL_TBF) +
compute_usage_by_reservation(pdch, dir);
 
-   if (pdch->assigned_tfi(reverse(dir)) == 0x)
+   if (pdch->assigned_tfi(reverse(dir)) == NO_FREE_TFI)
/* No TFI in the opposite direction, avoid it */
usage += 32;
 
@@ -341,10 +341,10 @@
if (!pdch->is_enabled())
continue;
 
-   if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == 
0x)
+   if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == 
NO_FREE_TFI)
continue;
 
-   if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == 
0x)
+   if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == 
NO_FREE_TFI)
continue;
 
return trx_no;
diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp
index a88f477..9bff38a 100644
--- a/tests/alloc/AllocTest.cpp
+++ b/tests/alloc/AllocTest.cpp
@@ -613,17 +613,17 @@
continue;
 
if (ul_tbf &&
-   pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != 
0x)
+   pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != 
NO_FREE_TFI)
continue;
 
if (dl_tbf &&
-   pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != 
0x)
+   pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != 
NO_FREE_TFI)
continue;
 
busy_slots |= 1 << i;
}
 
-   printf(" TBF[%d] class %d reserves %c%c%c%c%c%c%c%c\n",
+   printf(" TBF[%d] class %d reserves " OSMO_BIT_SPEC "\n",
tfi, ms_class,
get_dir_char(0x01, ul_slots, dl_slots, busy_slots),
get_dir_char(0x02, ul_slots, dl_slots, busy_slots),

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293
Gerrit-PatchSet: 7
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[PATCH] osmocom-bb[master]: mobile/main.c: fix deprecated call to msgb_set_talloc_ctx()

2017-11-02 Thread Vadim Yanitskiy

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

mobile/main.c: fix deprecated call to msgb_set_talloc_ctx()

The usage of msgb_set_talloc_ctx() was deprecated many days ago,
so it's time to use the proper replacement.

Change-Id: I56440d8e2152c4bb2e5ad677f88c61742d2ad9ca
---
M src/host/layer23/src/mobile/main.c
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/39/4639/1

diff --git a/src/host/layer23/src/mobile/main.c 
b/src/host/layer23/src/mobile/main.c
index bc66557..997e2d5 100644
--- a/src/host/layer23/src/mobile/main.c
+++ b/src/host/layer23/src/mobile/main.c
@@ -220,7 +220,8 @@
log_set_all_filter(stderr_target, 1);
 
l23_ctx = talloc_named_const(NULL, 1, "layer2 context");
-   msgb_set_talloc_ctx(l23_ctx);
+   /* TODO: measure and choose a proper pool size */
+   msgb_talloc_ctx_init(l23_ctx, 0);
 
handle_options(argc, argv);
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I56440d8e2152c4bb2e5ad677f88c61742d2ad9ca
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


[PATCH] osmocom-bb[master]: mobile: get rid of unused variables / functions

2017-11-02 Thread Vadim Yanitskiy

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

mobile: get rid of unused variables / functions

Change-Id: Id867ffed9b2b67025320d002e1e009e19c759a23
---
M src/host/layer23/src/mobile/gsm411_sms.c
M src/host/layer23/src/mobile/gsm48_mm.c
M src/host/layer23/src/mobile/gsm48_rr.c
3 files changed, 19 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/44/4644/1

diff --git a/src/host/layer23/src/mobile/gsm411_sms.c 
b/src/host/layer23/src/mobile/gsm411_sms.c
index f56262e..22db859 100644
--- a/src/host/layer23/src/mobile/gsm411_sms.c
+++ b/src/host/layer23/src/mobile/gsm411_sms.c
@@ -226,7 +226,7 @@
uint8_t *smsp = msgb_sms(msg);
struct gsm_sms *gsms;
unsigned int sms_alphabet;
-   uint8_t sms_mti, sms_mms;
+   uint8_t sms_mti;
uint8_t oa_len_bytes;
uint8_t address_lv[12]; /* according to 03.40 / 9.1.2.5 */
int rc = 0;
@@ -235,7 +235,7 @@
 
/* invert those fields where 0 means active/present */
sms_mti = *smsp & 0x03;
-   sms_mms = !!(*smsp & 0x04);
+   /* uint8_t sms_mms = !!(*smsp & 0x04); */
gsms->status_rep_req = (*smsp & 0x20);
gsms->ud_hdr_ind = (*smsp & 0x40);
gsms->reply_path_req  = (*smsp & 0x80);
diff --git a/src/host/layer23/src/mobile/gsm48_mm.c 
b/src/host/layer23/src/mobile/gsm48_mm.c
index 360f9b3..4b1db1e 100644
--- a/src/host/layer23/src/mobile/gsm48_mm.c
+++ b/src/host/layer23/src/mobile/gsm48_mm.c
@@ -3244,7 +3244,6 @@
struct gsm48_mmlayer *mm = &ms->mmlayer;
struct gsm48_mm_conn *conn, *conn_found = NULL;
struct msgb *nmsg;
-   struct gsm48_mmxx_hdr *nmmh;
 
/* the first and only pending connection is the recent requested */
llist_for_each_entry(conn, &mm->mm_conn, list) {
@@ -3293,7 +3292,7 @@
}
if (!nmsg)
return -ENOMEM;
-   nmmh = (struct gsm48_mmxx_hdr *)nmsg->data;
+
gsm48_mmxx_upmsg(ms, nmsg);
 
return 0;
@@ -3325,7 +3324,6 @@
struct gsm48_mmlayer *mm = &ms->mmlayer;
struct gsm48_mm_conn *conn;
struct msgb *nmsg;
-   struct gsm48_mmxx_hdr *nmmh;
 
/* stop MM connection timer */
stop_mm_t3230(mm);
@@ -3342,7 +3340,7 @@
}
if (!nmsg)
continue; /* skip if not of CC type */
-   nmmh = (struct gsm48_mmxx_hdr *)nmsg->data;
+
/* copy L3 message */
nmsg->l3h = msgb_put(nmsg, msgb_l3len(msg));
memcpy(nmsg->l3h, msg->l3h, msgb_l3len(msg));
@@ -3595,15 +3593,12 @@
llist_for_each_entry(conn, &mm->mm_conn, list) {
if (conn->sapi == sapi
 && conn->state == GSM48_MMXX_ST_DEDICATED) {
-   struct gsm48_mmxx_hdr *nmmh;
struct msgb *nmsg;
-
nmsg = gsm48_mmxx_msgb_alloc(
GSM48_MMSMS_EST_CNF, conn->ref,
conn->transaction_id, conn->sapi);
if (!nmsg)
return -ENOMEM;
-   nmmh = (struct gsm48_mmxx_hdr *)nmsg->data;
gsm48_mmxx_upmsg(ms, nmsg);
}
}
diff --git a/src/host/layer23/src/mobile/gsm48_rr.c 
b/src/host/layer23/src/mobile/gsm48_rr.c
index b821457..ac27214 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -743,11 +743,6 @@
LOGP(DRR, LOGL_INFO, "timer T3122 has fired\n");
 }
 
-static void timeout_rr_t3124(void *arg)
-{
-   LOGP(DRR, LOGL_INFO, "timer T3124 has fired\n");
-}
-
 static void timeout_rr_t3126(void *arg)
 {
struct gsm48_rrlayer *rr = arg;
@@ -810,15 +805,6 @@
rr->t3122.cb = timeout_rr_t3122;
rr->t3122.data = rr;
osmo_timer_schedule(&rr->t3122, sec, micro);
-}
-
-static void start_rr_t3124(struct gsm48_rrlayer *rr, int sec, int micro)
-{
-   LOGP(DRR, LOGL_INFO, "starting T3124 with %d.%03d seconds\n", sec,
-   micro / 1000);
-   rr->t3124.cb = timeout_rr_t3124;
-   rr->t3124.data = rr;
-   osmo_timer_schedule(&rr->t3124, sec, micro);
 }
 
 static void start_rr_t3126(struct gsm48_rrlayer *rr, int sec, int micro)
@@ -2735,7 +2721,7 @@
uint8_t serv_rxlev_full = 0, serv_rxlev_sub = 0, serv_rxqual_full = 0,
serv_rxqual_sub = 0;
uint8_t ta, tx_power;
-   uint8_t rep_ba = 0, rep_valid = 0, meas_valid = 0, multi_rep = 0;
+   uint8_t rep_ba = 0, rep_valid = 0, meas_valid = 0;
uint8_t n = 0, rxlev_nc[6], bsic_nc[6], bcch_f_nc[6];
 
/* just in case! */
@@ -2770,12 +2756,13 @@
uint8_t ncc;
int i, index;
 
-   /* multiband reporting, if not: 0 = normal reporting */
-   if (s->si5

[PATCH] osmocom-bb[master]: mobile/gsm411_sms.c: use secure gsm_7bit_(en|de)code_n

2017-11-02 Thread Vadim Yanitskiy

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

mobile/gsm411_sms.c: use secure gsm_7bit_(en|de)code_n

Since some 'gsm_7bit_*' functions were deprecated and replaced by
more secure ones with the '_n_' postfix in names, it's better to
use the updated functions.

Change-Id: I58150e9b74699e5f54b9a83416ad8efcb2eccd8e
---
M src/host/layer23/src/mobile/gsm411_sms.c
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/43/4643/1

diff --git a/src/host/layer23/src/mobile/gsm411_sms.c 
b/src/host/layer23/src/mobile/gsm411_sms.c
index 655fe53..f56262e 100644
--- a/src/host/layer23/src/mobile/gsm411_sms.c
+++ b/src/host/layer23/src/mobile/gsm411_sms.c
@@ -113,7 +113,8 @@
sms->data_coding_scheme = dcs;
strncpy(sms->address, receiver, sizeof(sms->address)-1);
/* Generate user_data */
-   sms->user_data_len = gsm_7bit_encode(sms->user_data, sms->text);
+   sms->user_data_len = gsm_7bit_encode_n(sms->user_data,
+   sizeof(sms->user_data), sms->text, NULL);
 
return sms;
 }
@@ -282,7 +283,8 @@
 
switch (sms_alphabet) {
case DCS_7BIT_DEFAULT:
-   gsm_7bit_decode(gsms->text, smsp, gsms->user_data_len);
+   gsm_7bit_decode_n(gsms->text, sizeof(gsms->text),
+   smsp, gsms->user_data_len);
break;
case DCS_8BIT_DATA:
case DCS_UCS2:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I58150e9b74699e5f54b9a83416ad8efcb2eccd8e
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


[PATCH] osmocom-bb[master]: mobile/gsm322.c: prevent calling memset with n <= 0

2017-11-02 Thread Vadim Yanitskiy

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

mobile/gsm322.c: prevent calling memset with n <= 0

Change-Id: I2d8d78474614939659a7f24d5007b1c890776b1a
---
M src/host/layer23/src/mobile/gsm322.c
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/45/4645/1

diff --git a/src/host/layer23/src/mobile/gsm322.c 
b/src/host/layer23/src/mobile/gsm322.c
index ad6a83b..4b39924 100644
--- a/src/host/layer23/src/mobile/gsm322.c
+++ b/src/host/layer23/src/mobile/gsm322.c
@@ -322,7 +322,9 @@
else
value -= min;
 
-   memset(bar, '=', value);
+   if (value >= 0)
+   memset(bar, '=', value);
+
bar[value] = '\0';
 
return bar;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d8d78474614939659a7f24d5007b1c890776b1a
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


[PATCH] osmocom-bb[master]: mobile/gsm480_ss.c: use secure gsm_7bit_(en|de)code_n_ussd

2017-11-02 Thread Vadim Yanitskiy

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

mobile/gsm480_ss.c: use secure gsm_7bit_(en|de)code_n_ussd

Since some 'gsm_7bit_*' functions were deprecated and replaced by
more secure ones with the '_n_' suffix in names, it's better to
use the updated functions.

Change-Id: If8a1983592f5800e3981f29962eb333ac9473f40
---
M src/host/layer23/src/mobile/gsm480_ss.c
1 file changed, 14 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/41/4641/1

diff --git a/src/host/layer23/src/mobile/gsm480_ss.c 
b/src/host/layer23/src/mobile/gsm480_ss.c
index 8d025e9..6f06cf7 100644
--- a/src/host/layer23/src/mobile/gsm480_ss.c
+++ b/src/host/layer23/src/mobile/gsm480_ss.c
@@ -193,20 +193,23 @@
{ 0, NULL }
 };
 
-static int gsm480_ss_result(struct osmocom_ms *ms, const char *response,
+static int gsm480_ss_result(struct osmocom_ms *ms, char *response,
uint8_t error)
 {
vty_notify(ms, NULL);
if (response) {
-   char text[256], *t = text, *s;
+   char *line;
+   int i;
 
-   strncpy(text, response, sizeof(text) - 1);
-   text[sizeof(text) - 1] = '\0';
-   while ((s = strchr(text, '\r')))
-   *s = '\n';
-   while ((s = strsep(&t, "\n"))) {
-   vty_notify(ms, "Service response: %s\n", s);
-   }
+   for (i = 0; response[i]; i++)
+   if (response[i] == '\r')
+   response[i] = '\n';
+
+   if (response[0] && response[strlen(response) - 1] == '\n')
+   response[strlen(response) - 1] = '\0';
+
+   while ((line = strsep(&response, "\n")))
+   vty_notify(ms, "Service response: %s\n", line);
} else if (error)
vty_notify(ms, "Service request failed: %s\n",
get_value_string(gsm480_err_names, error));
@@ -532,7 +535,7 @@
}
 
/* Encode service request */
-   length = gsm_7bit_encode(msg->data, text);
+   gsm_7bit_encode_n_ussd(msg->data, msgb_tailroom(msg), text, &length);
msgb_put(msg, length);
 
/* Then wrap it as an Octet String */
@@ -730,7 +733,6 @@
 {
int num_chars;
char text[256];
-   int i;
const uint8_t *tag_data;
int tag_len;
 
@@ -772,19 +774,7 @@
return -EINVAL;
}
num_chars = tag_len * 8 / 7;
-   /* Prevent a mobile-originated buffer-overrun! */
-   if (num_chars > sizeof(text) - 1)
-   num_chars = sizeof(text) - 1;
-   text[sizeof(text) - 1] = '\0';
-   gsm_7bit_decode(text, tag_data, num_chars);
-
-   for (i = 0; text[i]; i++) {
-   if (text[i] == '\r')
-   text[i] = '\n';
-   }
-   /* remove last CR, if exists */
-   if (text[0] && text[strlen(text) - 1] == '\n')
-   text[strlen(text) - 1] = '\0';
+   gsm_7bit_decode_n_ussd(text, sizeof(text), tag_data, num_chars);
gsm480_ss_result(trans->ms, text, 0);
 
return 0;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8a1983592f5800e3981f29962eb333ac9473f40
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


[PATCH] osmocom-bb[master]: mobile/vty_interface.c: add missing 'vty/misc.h' header

2017-11-02 Thread Vadim Yanitskiy

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

mobile/vty_interface.c: add missing 'vty/misc.h' header

This header contains declaration of the osmo_talloc_vty_add_cmds().

Change-Id: Icdafb22758897cfb67e249f37991f4af4213a5fa
---
M src/host/layer23/src/mobile/vty_interface.c
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/38/4638/1

diff --git a/src/host/layer23/src/mobile/vty_interface.c 
b/src/host/layer23/src/mobile/vty_interface.c
index 2ad95d0..b3777dc 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 
 void *l23_ctx;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icdafb22758897cfb67e249f37991f4af4213a5fa
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


[PATCH] osmocom-bb[master]: mobile/gsm48_mm.c: use secure gsm_7bit_decode_n

2017-11-02 Thread Vadim Yanitskiy

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

mobile/gsm48_mm.c: use secure gsm_7bit_decode_n

Since some 'gsm_7bit_*' functions were deprecated and replaced by
more secure ones with the '_n_' postfix in names, it's better to
use the updated functions.

Change-Id: I4499b592a0dfea71462aed19fe641419d79b3cbd
---
M src/host/layer23/src/mobile/gsm48_mm.c
1 file changed, 1 insertion(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/42/4642/1

diff --git a/src/host/layer23/src/mobile/gsm48_mm.c 
b/src/host/layer23/src/mobile/gsm48_mm.c
index 100129b..360f9b3 100644
--- a/src/host/layer23/src/mobile/gsm48_mm.c
+++ b/src/host/layer23/src/mobile/gsm48_mm.c
@@ -264,10 +264,7 @@
length = ((in_len - 1) * 8 - padding) / 7;
if (length <= 0)
return 0;
-   if (length >= name_len)
-   length = name_len - 1;
-   gsm_7bit_decode(name, lv + 2, length);
-   name[length] = '\0';
+   gsm_7bit_decode_n(name, name_len, lv + 2, length);
 
return length;
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4499b592a0dfea71462aed19fe641419d79b3cbd
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


[PATCH] osmocom-bb[master]: mobile/vty_interface.c: fix incompatible pointer type warning

2017-11-02 Thread Vadim Yanitskiy

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

mobile/vty_interface.c: fix incompatible pointer type warning

According to the vty_app_info struct definition, the go_parent_cb()
should return an integer, but not enum. So, this change fixes the
following compiler warning:

> warning: initialization from incompatible pointer type
>   .go_parent_cb = ms_vty_go_parent,

Change-Id: Ib55e43eaaebdd9fe0d74a030b1057ae82804a77e
---
M src/host/layer23/include/osmocom/bb/mobile/vty.h
M src/host/layer23/src/mobile/vty_interface.c
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/40/4640/1

diff --git a/src/host/layer23/include/osmocom/bb/mobile/vty.h 
b/src/host/layer23/include/osmocom/bb/mobile/vty.h
index 1f1341b..3bec113 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/vty.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/vty.h
@@ -12,7 +12,7 @@
SUPPORT_NODE,
 };
 
-enum node_type ms_vty_go_parent(struct vty *vty);
+int ms_vty_go_parent(struct vty *vty);
 int ms_vty_init(void);
 extern void vty_notify(struct osmocom_ms *ms, const char *fmt, ...) 
__attribute__ ((format (printf, 2, 3)));
 
diff --git a/src/host/layer23/src/mobile/vty_interface.c 
b/src/host/layer23/src/mobile/vty_interface.c
index b3777dc..0f27194 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -2757,7 +2757,7 @@
return CMD_SUCCESS;
 }
 
-enum node_type ms_vty_go_parent(struct vty *vty)
+int ms_vty_go_parent(struct vty *vty)
 {
switch (vty->node) {
case MS_NODE:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib55e43eaaebdd9fe0d74a030b1057ae82804a77e
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


osmocom-bb[master]: mobile/vty_interface.c: add missing 'vty/misc.h' header

2017-11-02 Thread Max

Patch Set 1: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Icdafb22758897cfb67e249f37991f4af4213a5fa
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


osmocom-bb[master]: mobile/main.c: fix deprecated call to msgb_set_talloc_ctx()

2017-11-02 Thread Max

Patch Set 1: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I56440d8e2152c4bb2e5ad677f88c61742d2ad9ca
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


osmocom-bb[master]: mobile/gsm480_ss.c: use secure gsm_7bit_(en|de)code_n_ussd

2017-11-02 Thread Max

Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/4641/1/src/host/layer23/src/mobile/gsm480_ss.c
File src/host/layer23/src/mobile/gsm480_ss.c:

Line 205:   if (response[i] == '\r')
That doesn't seem to be related to change to secure functions. And it also 
forces you to drop 'const' from response. Please clarify why this is necessary.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: If8a1983592f5800e3981f29962eb333ac9473f40
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: Yes


osmocom-bb[master]: mobile/vty_interface.c: fix incompatible pointer type warning

2017-11-02 Thread Max

Patch Set 1: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib55e43eaaebdd9fe0d74a030b1057ae82804a77e
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


osmocom-bb[master]: mobile: get rid of unused variables / functions

2017-11-02 Thread Max

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/4644/1/src/host/layer23/src/mobile/gsm411_sms.c
File src/host/layer23/src/mobile/gsm411_sms.c:

Line 238:   /* uint8_t sms_mms = !!(*smsp & 0x04); */
Why keeping it? If it's not used anywhere than it should be simply removed.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id867ffed9b2b67025320d002e1e009e19c759a23
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: Yes


osmocom-bb[master]: mobile/gsm322.c: prevent calling memset with n <= 0

2017-11-02 Thread Max

Patch Set 1:

(1 comment)

If I interpret the code correctly it's impossible for 'value' to be negative at 
this point. So it's just to get rid of compile warning? If so than you could, 
perhaps, use size_t instead of int for 'value' type: that's what memset expects 
anyway.

https://gerrit.osmocom.org/#/c/4645/1/src/host/layer23/src/mobile/gsm322.c
File src/host/layer23/src/mobile/gsm322.c:

Line 328:   bar[value] = '\0';
That cannot possibly be right. If 'value' is negative in here than 'bar[value]' 
will almost certainly point where it shouldn't.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2d8d78474614939659a7f24d5007b1c890776b1a
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: Yes


osmocom-bb[master]: mobile/main.c: fix deprecated call to msgb_set_talloc_ctx()

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I56440d8e2152c4bb2e5ad677f88c61742d2ad9ca
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


osmocom-bb[master]: mobile/vty_interface.c: fix incompatible pointer type warning

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib55e43eaaebdd9fe0d74a030b1057ae82804a77e
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


osmocom-bb[master]: mobile/vty_interface.c: add missing 'vty/misc.h' header

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Icdafb22758897cfb67e249f37991f4af4213a5fa
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


osmocom-bb[master]: mobile/gsm48_mm.c: use secure gsm_7bit_decode_n

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I4499b592a0dfea71462aed19fe641419d79b3cbd
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmocom-bb[master]: mobile/gsm411_sms.c: use secure gsm_7bit_(en|de)code_n

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I58150e9b74699e5f54b9a83416ad8efcb2eccd8e
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmocom-bb[master]: mobile: get rid of unused variables / functions

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id867ffed9b2b67025320d002e1e009e19c759a23
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


osmo-gsm-tester[master]: Change example config to use only 1 TRX for osmo-bts-octphy ...

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bts[master]: octphy: override firmware version check

2017-11-02 Thread Harald Welte

Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/#/c/4446/3/src/osmo-bts-octphy/main.c
File src/osmo-bts-octphy/main.c:

Line 58:return 0;
I think if you introduce bts-specific command line options, you should also 
document them in the --help output.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I5774fbb29da832786326afb991014b9bd8b04b59
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: Yes


libosmocore[master]: Enable GnuTLS fallback

2017-11-02 Thread Harald Welte

Patch Set 8: Code-Review+2

(1 comment)

I'm happy to merge it, but my original review comments about using a static 
variable to cache whether the syscall works has not been implemented. Please 
follow up with that in a later patch (or create a ticket as a reminder for this 
optimization)

https://gerrit.osmocom.org/#/c/4593/8/src/gsm/gsm_utils.c
File src/gsm/gsm_utils.c:

Line 437: #endif
whitespace


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic77866ce65acf524b768882c751a4f9c0635740b
Gerrit-PatchSet: 8
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: Yes


[PATCH] osmo-gsm-manuals[master]: Fix build with default paths

2017-11-02 Thread Max

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

Fix build with default paths

If LIBOSMO_DIR is not set explicitly than ~/source/gsm/libosmocore is
used which is base for MERGE_DOC which is used by
vty_reference_combine.sh as it is. If the shell used by
vty_reference_combine.sh does not expand ~ than the build will
fail. Let's be nice and use realpath on MERGE_DOC before giving it to
vty_reference_combine.sh to make sure complete path is used.

Change-Id: I2edf64348502cbe498d9fd27a686c712b044c926
---
M build/Makefile.vty-reference.inc
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/46/4646/1

diff --git a/build/Makefile.vty-reference.inc b/build/Makefile.vty-reference.inc
index baf9cf5..6607ae5 100644
--- a/build/Makefile.vty-reference.inc
+++ b/build/Makefile.vty-reference.inc
@@ -26,7 +26,7 @@
 include $(TOPDIR)/build/Makefile.docbook.inc
 
 LIBOSMO_DIR ?= ~/source/gsm/libosmocore
-MERGE_DOC = $(LIBOSMO_DIR)/doc/vty/merge_doc.xsl
+MERGE_DOC = $(shell realpath $(LIBOSMO_DIR)/doc/vty/merge_doc.xsl)
 
 CLEAN_FILES += generated
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2edf64348502cbe498d9fd27a686c712b044c926
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Max 


[PATCH] libosmocore[master]: Enable GnuTLS fallback

2017-11-02 Thread Max
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/4593

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

Enable GnuTLS fallback

On systems with GNU/Linux kernel older than 3.17 (Debian 8 "jessie" for
example) the osmo_get_rand_id() would always return failure due to
missing getrandom() syscall.

To support such systems, let's add fallback code which uses GnuTLS
library. It can be disabled explicitly via '--disable-gnutls' option at
compile-time, otherwise ./configure will fail if both getrandom() and
GnuTLS are not available. When building with '--enable-embedded' the
fallback is disabled automatically.

Related: OS#1694

Change-Id: Ic77866ce65acf524b768882c751a4f9c0635740b
---
M configure.ac
M src/gsm/Makefile.am
M src/gsm/gsm_utils.c
3 files changed, 36 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/93/4593/9

diff --git a/configure.ac b/configure.ac
index d9390cf..a8c1d2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -130,6 +130,20 @@
 AM_CONDITIONAL(ENABLE_PCSC, test "x$ENABLE_PCSC" = "xyes")
 AC_SUBST(ENABLE_PCSC)
 
+AC_ARG_ENABLE([gnutls], [AS_HELP_STRING([--disable-gnutls], [Do not use GnuTLS 
fallback for missing getrandom()])],
+   [ENABLE_GNUTLS=$enableval], [ENABLE_GNUTLS="yes"])
+AM_CONDITIONAL(ENABLE_GNUTLS, test x"$ENABLE_GNUTLS" = x"yes")
+AS_IF([test "x$ENABLE_GNUTLS" = "xyes"], [
+   PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.12.0])
+])
+AC_SUBST(ENABLE_GNUTLS)
+if test x"$ENABLE_GNUTLS" = x"yes"
+then
+   AC_SUBST([LIBGNUTLS_CFLAGS])
+   AC_SUBST([LIBGNUTLS_LIBS])
+   AC_DEFINE([USE_GNUTLS], [1], [Use GnuTLS as a fallback for missing 
getrandom()])
+fi
+
 AC_ARG_ENABLE(plugin,
[AS_HELP_STRING(
[--disable-plugin],
@@ -228,12 +242,15 @@
AM_CONDITIONAL(ENABLE_PLUGIN, false)
AM_CONDITIONAL(ENABLE_MSGFILE, false)
AM_CONDITIONAL(ENABLE_SERIAL, false)
+   AM_CONDITIONAL(ENABLE_GNUTLS, false)
AM_CONDITIONAL(ENABLE_VTY, false)
AM_CONDITIONAL(ENABLE_CTRL, false)
AM_CONDITIONAL(ENABLE_UTILITIES, false)
AM_CONDITIONAL(ENABLE_GB, false)
+   AM_CONDITIONAL(ENABLE_GNUTLS, false)
AM_CONDITIONAL(ENABLE_PCSC, false)
AM_CONDITIONAL(ENABLE_PSEUDOTALLOC, true)
+   AC_DEFINE([USE_GNUTLS], [0])
AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than 
fprintf/abort])
 fi
 
diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am
index 4476971..12f56db 100644
--- a/src/gsm/Makefile.am
+++ b/src/gsm/Makefile.am
@@ -38,6 +38,11 @@
 libosmogsm_la_LDFLAGS = $(LTLDFLAGS_OSMOGSM) -version-info $(LIBVERSION) 
-no-undefined
 libosmogsm_la_LIBADD = libgsmint.la $(TALLOC_LIBS)
 
+if ENABLE_GNUTLS
+AM_CPPFLAGS += $(LIBGNUTLS_CFLAGS)
+libosmogsm_la_LIBADD += $(LIBGNUTLS_LIBS)
+endif
+
 EXTRA_DIST = libosmogsm.map
 
 # Convolutional codes generation
diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c
index e3f792e..134b475 100644
--- a/src/gsm/gsm_utils.c
+++ b/src/gsm/gsm_utils.c
@@ -106,6 +106,12 @@
 #endif
 #endif
 
+#if (USE_GNUTLS)
+#pragma message ("including GnuTLS for getrandom fallback.")
+#include 
+#include 
+#endif
+
 /* ETSI GSM 03.38 6.2.1 and 6.2.1.1 default alphabet
  * Greek symbols at hex positions 0x10 and 0x12-0x1a
  * left out as they can't be handled with a char and
@@ -409,7 +415,7 @@
  */
 int osmo_get_rand_id(uint8_t *out, size_t len)
 {
-   int rc;
+   int rc = -ENOTSUP;
 
/* this function is intended for generating short identifiers only, not 
arbitrary-length random data */
if (len > OSMO_MAX_RAND_ID_LEN)
@@ -421,13 +427,16 @@
 #pragma message ("Using direct syscall access for getrandom(): consider 
upgrading to glibc >= 2.25")
/* FIXME: this can be removed once we bump glibc requirements to 2.25: 
*/
rc = syscall(SYS_getrandom, out, len, GRND_NONBLOCK);
-#else
-#pragma message ("Secure random unavailable: calls to osmo_get_rand_id() will 
always fail!")
-   return -ENOTSUP;
 #endif
+
/* getrandom() failed entirely: */
-   if (rc < 0)
+   if (rc < 0) {
+#if (USE_GNUTLS)
+#pragma message ("Secure random failed: using GnuTLS fallback.")
+   return gnutls_rnd(GNUTLS_RND_RANDOM, out, len);
+#endif
return -errno;
+   }
 
/* getrandom() failed partially due to signal interruption:
   this should never happen (according to getrandom(2)) as long as 
OSMO_MAX_RAND_ID_LEN < 256

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic77866ce65acf524b768882c751a4f9c0635740b
Gerrit-PatchSet: 9
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 


libosmocore[master]: Enable GnuTLS fallback

2017-11-02 Thread Max

Patch Set 9:

OS#2610 is created to track optimization suggestion.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic77866ce65acf524b768882c751a4f9c0635740b
Gerrit-PatchSet: 9
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


[PATCH] osmo-mgw[master]: sdp: refactoring sdp parser/generator

2017-11-02 Thread dexter
Hello Neels Hofmeyr, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/4006

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

sdp: refactoring sdp parser/generator

move SDP generator function write_response_sdp() from mgcp_protocol.c
to mgcp_sdp.c and use msgb_printf() instead of snprintf()

move prototypes for mgcp_parse_sdp_data() and mgcp_set_audio_info()
to mgcp_sdp.h

change parameter list of mgcp_parse_sdp_data() so that it takes the
rtp conn directly, rather than struct mgcp_rtp_end.

add doxygen comments to all public functions

Change-Id: I9f88c93872ff913bc211f560b26901267f577324
---
M include/osmocom/mgcp/Makefile.am
M include/osmocom/mgcp/mgcp_internal.h
A include/osmocom/mgcp/mgcp_sdp.h
M src/libosmo-mgcp/mgcp_protocol.c
M src/libosmo-mgcp/mgcp_sdp.c
5 files changed, 158 insertions(+), 100 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/06/4006/16

diff --git a/include/osmocom/mgcp/Makefile.am b/include/osmocom/mgcp/Makefile.am
index 646b887..cd8f599 100644
--- a/include/osmocom/mgcp/Makefile.am
+++ b/include/osmocom/mgcp/Makefile.am
@@ -4,4 +4,5 @@
mgcp_conn.h \
mgcp_stat.h \
mgcp_ep.h \
+   mgcp_sdp.h \
$(NULL)
diff --git a/include/osmocom/mgcp/mgcp_internal.h 
b/include/osmocom/mgcp/mgcp_internal.h
index 751aba5..d4c8dc9 100644
--- a/include/osmocom/mgcp/mgcp_internal.h
+++ b/include/osmocom/mgcp/mgcp_internal.h
@@ -317,9 +317,6 @@
 #define DEFAULT_RTP_AUDIO_DEFAULT_CHANNELS 1
 
 #define PTYPE_UNDEFINED (-1)
-int mgcp_parse_sdp_data(struct mgcp_endpoint *endp, struct mgcp_rtp_end *rtp, 
struct mgcp_parse_data *p);
-int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec,
-   int payload_type, const char *audio_name);
 
 /*! get the ip-address where the mgw application is bound on.
  *  \param[in] endp mgcp endpoint, that holds a copy of the VTY parameters
diff --git a/include/osmocom/mgcp/mgcp_sdp.h b/include/osmocom/mgcp/mgcp_sdp.h
new file mode 100644
index 000..da23cba
--- /dev/null
+++ b/include/osmocom/mgcp/mgcp_sdp.h
@@ -0,0 +1,35 @@
+/*
+ * SDP generation and parsing
+ *
+ * (C) 2009-2015 by Holger Hans Peter Freyther 
+ * (C) 2009-2014 by On-Waves
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ *
+ */
+
+#pragma once
+#include 
+
+int mgcp_parse_sdp_data(const struct mgcp_endpoint *endp,
+   struct mgcp_conn_rtp *conn,
+   struct mgcp_parse_data *p);
+
+int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec,
+   int payload_type, const char *audio_name);
+
+int mgcp_write_response_sdp(const struct mgcp_endpoint *endp,
+   const struct mgcp_conn_rtp *conn, struct msgb *sdp,
+   const char *addr);
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index c00cdc6..6c611f7 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 
 struct mgcp_request {
char *name;
@@ -191,80 +192,6 @@
return create_resp(endp, code, " FAIL", msg, trans, NULL, NULL);
 }
 
-static int write_response_sdp(struct mgcp_endpoint *endp,
- struct mgcp_conn_rtp *conn,
- char *sdp_record, size_t size, const char *addr)
-{
-   const char *fmtp_extra;
-   const char *audio_name;
-   int payload_type;
-   int len;
-   int nchars;
-
-   if (!conn)
-   return -1;
-
-   endp->cfg->get_net_downlink_format_cb(endp, &payload_type,
- &audio_name, &fmtp_extra, conn);
-
-   len = snprintf(sdp_record, size,
-  "v=0\r\n"
-  "o=- %u 23 IN IP4 %s\r\n"
-  "s=-\r\n"
-  "c=IN IP4 %s\r\n"
-  "t=0 0\r\n", conn->conn->id, addr, addr);
-
-   if (len < 0 || len >= size)
-   goto buffer_too_small;
-
-   if (payload_type >= 0) {
-   nchars = snprintf(sdp_record + len, size - len,
- "m=audio %d RTP/AVP %d\r\n",
- conn->end.local_port, payload_type);
- 

[PATCH] osmo-mgw[master]: cosmetic: make dummy packet handling more explicit

2017-11-02 Thread dexter
Hello Neels Hofmeyr, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/4617

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

cosmetic: make dummy packet handling more explicit

The way how osmo-mgw decides when to send a dummy packet and
when not is not very obvious.

use more explicit if statements, and define constants. Also add
comments that explain how it works.

Change-Id: Ie7ee9409baec50a09fb357d655b5253434fae924
---
M include/osmocom/mgcp/mgcp.h
M src/libosmo-mgcp/mgcp_protocol.c
M src/libosmo-mgcp/mgcp_vty.c
3 files changed, 37 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/17/4617/3

diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h
index 83505a2..59147f0 100644
--- a/include/osmocom/mgcp/mgcp.h
+++ b/include/osmocom/mgcp/mgcp.h
@@ -98,7 +98,17 @@
int last_port;
 };
 
+/* There are up to three modes in which the keep-alive dummy packet can be
+ * sent. The beviour is controlled viw the keepalive_interval member of the
+ * trunk config. If that member is set to 0 (MGCP_KEEPALIVE_NEVER) no dummy-
+ * packet is sent at all and the timer that sends regular dummy packets
+ * is no longer scheduled. If the keepalive_interval is set to -1, only
+ * one dummy packet is sent when an CRCX or an MDCX is performed. No timer
+ * is scheduled. For all vales greater 0, the a timer is scheduled and the
+ * value is used as interval. See also mgcp_keepalive_timer_cb(),
+ * handle_modify_con(), and handle_create_con() */
 #define MGCP_KEEPALIVE_ONCE (-1)
+#define MGCP_KEEPALIVE_NEVER 0
 
 struct mgcp_trunk_config {
struct llist_head entry;
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 9c92c65..4826790 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -666,10 +666,11 @@
if (p->cfg->change_cb)
p->cfg->change_cb(tcfg, ENDPOINT_NUMBER(endp), MGCP_ENDP_CRCX);
 
+   /* Send dummy packet, see also comments in mgcp_keepalive_timer_cb() */
+   OSMO_ASSERT(tcfg->keepalive_interval >= MGCP_KEEPALIVE_ONCE);
if (conn->conn->mode & MGCP_CONN_RECV_ONLY
-   && tcfg->keepalive_interval != 0) {
+   && tcfg->keepalive_interval != MGCP_KEEPALIVE_NEVER)
send_dummy(endp, conn);
-   }
 
LOGP(DLMGCP, LOGL_NOTICE,
 "CRCX: endpoint:%x connection successfully created\n",
@@ -815,8 +816,10 @@
p->cfg->change_cb(endp->tcfg, ENDPOINT_NUMBER(endp),
  MGCP_ENDP_MDCX);
 
-   if (conn->conn->mode & MGCP_CONN_RECV_ONLY &&
-   endp->tcfg->keepalive_interval != 0)
+   /* Send dummy packet, see also comments in mgcp_keepalive_timer_cb() */
+   OSMO_ASSERT(endp->tcfg->keepalive_interval >= MGCP_KEEPALIVE_ONCE);
+   if (conn->conn->mode & MGCP_CONN_RECV_ONLY
+   && endp->tcfg->keepalive_interval != MGCP_KEEPALIVE_NEVER)
send_dummy(endp, conn);
 
if (silent)
@@ -1051,10 +1054,25 @@
struct mgcp_conn *conn;
int i;
 
-   LOGP(DLMGCP, LOGL_DEBUG, "Triggered trunk %d keepalive timer.\n",
+   LOGP(DLMGCP, LOGL_DEBUG, "triggered trunk %d keepalive timer\n",
 tcfg->trunk_nr);
 
-   if (tcfg->keepalive_interval <= 0)
+   /* Do not accept invalid configuration values
+* valid is MGCP_KEEPALIVE_NEVER, MGCP_KEEPALIVE_ONCE and
+* values greater 0 */
+   OSMO_ASSERT(tcfg->keepalive_interval >= MGCP_KEEPALIVE_ONCE);
+
+   /* The dummy packet functionality has been disabled, we will exit
+* immediately, no further timer is scheduled, which means we will no
+* longer send dummy packets even when we did before */
+   if (tcfg->keepalive_interval == MGCP_KEEPALIVE_NEVER)
+   return;
+
+   /* In cases where only one dummy packet is sent, we do not need
+* the timer since the functions that handle the CRCX and MDCX are
+* triggering the sending of the dummy packet. So we behave like in
+* the  MGCP_KEEPALIVE_NEVER case */
+   if (tcfg->keepalive_interval == MGCP_KEEPALIVE_ONCE)
return;
 
/* Send walk over all endpoints and send out dummy packets through
@@ -1067,7 +1085,8 @@
}
}
 
-   LOGP(DLMGCP, LOGL_DEBUG, "Rescheduling trunk %d keepalive timer.\n",
+   /* Schedule the keepalive timer for the next round */
+   LOGP(DLMGCP, LOGL_DEBUG, "rescheduling trunk %d keepalive timer\n",
 tcfg->trunk_nr);
osmo_timer_schedule(&tcfg->keepalive_timer, tcfg->keepalive_interval,
0);
diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c
index e8ad818..7107bcc 100644
--- a/src/libosmo-mgcp/mgcp_vty.c
+++ b/src/libosmo-mgcp/mgcp_vty.c
@@ -569,7 +569,7 @@
   cfg_mgcp_no_rtp_keepalive_cmd,
   "no rtp keep-alive", NO_STR RTP_S

[PATCH] libosmo-sccp[master]: Fix typo in .deb dependency

2017-11-02 Thread Max

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

Fix typo in .deb dependency

Change-Id: Ie6b8770febebcd280e86725dffb5cb86046baeb5
---
M debian/control
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/debian/control b/debian/control
index 1184664..3d47abe 100644
--- a/debian/control
+++ b/debian/control
@@ -68,7 +68,7 @@
 Section: doc
 Depends: ${misc:Depends},
  libosmo-sigtran0 (= ${binary:Version}),
- libjs-query
+ libjs-jquery
 Description: Documentation for the Osmocom SIGTRAN library
   libosmo-sigtran is a shared library containing SS7/SIGTRAN related 
functionality,
   including connection-less and connection-oriented SCCP as per ITU-T Q.71x,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie6b8770febebcd280e86725dffb5cb86046baeb5
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Max 


[PATCH] osmo-gsm-manuals[master]: OsmoBSC: update CTRL docs

2017-11-02 Thread Max

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

OsmoBSC: update CTRL docs

* use proper naming scheme for BTS-specific CTRL commands
* add/update oml-* commands

Change-Id: I5b2cd940b4d84c140fce871f236aeab091b27360
Related: OS#2486
---
M OsmoBSC/chapters/control.adoc
1 file changed, 14 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/48/4648/1

diff --git a/OsmoBSC/chapters/control.adoc b/OsmoBSC/chapters/control.adoc
index a1d6b43..327e5b4 100644
--- a/OsmoBSC/chapters/control.adoc
+++ b/OsmoBSC/chapters/control.adoc
@@ -4,10 +4,10 @@
 The actual protocol is described in <>, the variables
 common to all programs using it are described in <>. Here we
 describe variables specific to OsmoBSC. The commands starting with prefix
-"net.btsN." are specific to a certain BTS so N have to be replaced with BTS
-number when issuing command e. g. "net.bts1.channel-load". Similarly the
+"bts.N." are specific to a certain BTS so N have to be replaced with BTS
+number when issuing command e. g. "bts.1.channel-load". Similarly the
 TRX-specific commands are additionally prefixed with TRX number e. g.
-"net.bts1.trx2.arfcn".
+"bts.1.trx.2.arfcn".
 
 .Variables available over control interface
 [options="header",width="100%",cols="20%,5%,5%,50%,20%"]
@@ -28,16 +28,17 @@
 |ussd-notify-v1|WO|No|",,"| See <> for details.
 |rf_locked|RW|No|"0","1"|See <> for details.
 |number-of-bts|RO|No|""|Get number of configured BTS.
-|net.btsN.location-area-code|RW|No|""|Set/Get LAC (value between (0, 
65535)).
-|net.btsN.cell-identity|RW|No|""|Set/Get Cell Identity (value between (0, 
65535)).
-|net.btsN.apply-configuration|WO|No|Ignored|Restart BTS via OML.
-|net.btsN.send-new-system-informations|WO|No|Ignored|Regenerate System 
Information messages for given BTS.
-|net.btsN.channel-load|RO|No|",,"|See <> for 
details.
-|net.btsN.oml-connection-state|RO|No|"connected", "disconnected"|Indicate the 
status of OML connection of BTS.
-|net.btsN.gprs-mode|RW|No|""|See <> for details.
-|net.btsN.rf_state|RO|No|",,"|See <> for details.
-|net.btsN.trxM.arfcn|RW|No|""|Set/Get ARFCN (value between (0, 1023)).
-|net.btsN.trxM.max-power-reduction|RW|No|""|See <> for details.
+|bts.N.location-area-code|RW|No|""|Set/Get LAC (value between (0, 65535)).
+|bts.N.cell-identity|RW|No|""|Set/Get Cell Identity (value between (0, 
65535)).
+|bts.N.apply-configuration|WO|No|Ignored|Restart BTS via OML.
+|bts.N.send-new-system-informations|WO|No|Ignored|Regenerate System 
Information messages for given BTS.
+|bts.N.channel-load|RO|No|",,"|See <> for details.
+|bts.N.oml-connection-state|RO|No|"connected", "disconnected", 
"degraded"|Indicate the status of OML connection of BTS.
+|bts.N.oml-uptime|RO|No||Return OML link uptime in seconds.
+|bts.N.gprs-mode|RW|No|""|See <> for details.
+|bts.N.rf_state|RO|No|",,"|See <> for details.
+|bts.N.trx.M.arfcn|RW|No|""|Set/Get ARFCN (value between (0, 1023)).
+|bts.N.trx.M.max-power-reduction|RW|No|""|See <> for details.
 |===
 
 [[notif]]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b2cd940b4d84c140fce871f236aeab091b27360
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Max 


osmo-gsm-manuals[master]: OsmoBSC: update CTRL docs

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I5b2cd940b4d84c140fce871f236aeab091b27360
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


osmo-gsm-manuals[master]: Fix build with default paths

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2edf64348502cbe498d9fd27a686c712b044c926
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


libosmo-sccp[master]: Fix typo in .deb dependency

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie6b8770febebcd280e86725dffb5cb86046baeb5
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus 
Gerrit-HasComments: No


[MERGED] libosmo-sccp[master]: Fix typo in .deb dependency

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Fix typo in .deb dependency
..


Fix typo in .deb dependency

Change-Id: Ie6b8770febebcd280e86725dffb5cb86046baeb5
---
M debian/control
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/debian/control b/debian/control
index 1184664..3d47abe 100644
--- a/debian/control
+++ b/debian/control
@@ -68,7 +68,7 @@
 Section: doc
 Depends: ${misc:Depends},
  libosmo-sigtran0 (= ${binary:Version}),
- libjs-query
+ libjs-jquery
 Description: Documentation for the Osmocom SIGTRAN library
   libosmo-sigtran is a shared library containing SS7/SIGTRAN related 
functionality,
   including connection-less and connection-oriented SCCP as per ITU-T Q.71x,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie6b8770febebcd280e86725dffb5cb86046baeb5
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus 


osmo-mgw[master]: sdp: refactoring sdp parser/generator

2017-11-02 Thread Harald Welte

Patch Set 16: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9f88c93872ff913bc211f560b26901267f577324
Gerrit-PatchSet: 16
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: dexter 
Gerrit-HasComments: No


[MERGED] osmo-mgw[master]: client: add unified function to generate MGCP messages

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: client: add unified function to generate MGCP messages
..


client: add unified function to generate MGCP messages

currently the only way to generate MGCP messages is to use
mgcp_msg_crcx(), mgcp_msg_mdcx() and mgcp_msg_dlcx(). All
three function take a fixed set of parameters via their
parameter list. There is no way to add or leave away optional
parameters.

add function mgcp_msg_gen(), this function takes a unified
message struct. The struct features a presence bitmask which
allows to enable and disable parameters as needed. It is also
possible to add new parameters in the future without breaking
the API.

Depends: libosmocore I15e1af68616309555d0ed9ac5da027c9833d42e3

Change-Id: I29c5e2fb972896faeb771ba040f015592487fcbe
---
M include/osmocom/mgcp_client/mgcp_client.h
M src/libosmo-mgcp-client/mgcp_client.c
M tests/mgcp_client/mgcp_client_test.c
M tests/mgcp_client/mgcp_client_test.err
M tests/mgcp_client/mgcp_client_test.ok
5 files changed, 249 insertions(+), 3 deletions(-)

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



diff --git a/include/osmocom/mgcp_client/mgcp_client.h 
b/include/osmocom/mgcp_client/mgcp_client.h
index efc1f76..21717e3 100644
--- a/include/osmocom/mgcp_client/mgcp_client.h
+++ b/include/osmocom/mgcp_client/mgcp_client.h
@@ -1,6 +1,7 @@
 #pragma once
 
 #include 
+#include 
 
 #include 
 
@@ -37,6 +38,36 @@
uint16_t audio_port;
 };
 
+enum mgcp_verb {
+   MGCP_VERB_CRCX,
+   MGCP_VERB_MDCX,
+   MGCP_VERB_DLCX,
+   MGCP_VERB_AUEP,
+   MGCP_VERB_RSIP,
+};
+
+#define MGCP_MSG_PRESENCE_ENDPOINT 0x0001
+#define MGCP_MSG_PRESENCE_CALL_ID  0x0002
+#define MGCP_MSG_PRESENCE_CONN_ID  0x0004
+#define MGCP_MSG_PRESENCE_AUDIO_IP 0x0008
+#define MGCP_MSG_PRESENCE_AUDIO_PORT   0x0010
+#define MGCP_MSG_PRESENCE_CONN_MODE0x0020
+
+/* See also RFC3435 section 3.2.1.3 */
+#define MGCP_ENDPOINT_MAXLEN (255*2+1+1)
+
+struct mgcp_msg {
+   enum mgcp_verb verb;
+   /* See MGCP_MSG_PRESENCE_* constants */
+   uint32_t presence;
+   char endpoint[MGCP_ENDPOINT_MAXLEN];
+   unsigned int call_id;
+   uint32_t conn_id;
+uint16_t audio_port;
+char *audio_ip;
+   enum mgcp_connection_mode conn_mode;
+};
+
 void mgcp_client_conf_init(struct mgcp_client_conf *conf);
 void mgcp_client_vty_init(void *talloc_ctx, int node, struct mgcp_client_conf 
*conf);
 int mgcp_client_config_write(struct vty *vty, const char *indent);
@@ -65,14 +96,19 @@
 
 struct msgb *mgcp_msg_crcx(struct mgcp_client *mgcp,
   uint16_t rtp_endpoint, unsigned int call_id,
-  enum mgcp_connection_mode mode);
+  enum mgcp_connection_mode mode)
+OSMO_DEPRECATED("Use mgcp_msg_gen() instead");
 
 struct msgb *mgcp_msg_mdcx(struct mgcp_client *mgcp,
   uint16_t rtp_endpoint, const char *rtp_conn_addr,
-  uint16_t rtp_port, enum mgcp_connection_mode mode);
+  uint16_t rtp_port, enum mgcp_connection_mode mode)
+OSMO_DEPRECATED("Use mgcp_msg_gen() instead");
 
 struct msgb *mgcp_msg_dlcx(struct mgcp_client *mgcp, uint16_t rtp_endpoint,
-  unsigned int call_id);
+  unsigned int call_id)
+OSMO_DEPRECATED("Use mgcp_msg_gen() instead");
+
+struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg);
 
 extern const struct value_string mgcp_client_connection_mode_strs[];
 static inline const char *mgcp_client_cmode_name(enum mgcp_connection_mode 
mode)
diff --git a/src/libosmo-mgcp-client/mgcp_client.c 
b/src/libosmo-mgcp-client/mgcp_client.c
index 1cd37be..c7cc989 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -614,6 +615,109 @@
 "C: %x\r\n", trans_id, rtp_endpoint, call_id);
 }
 
+#define MGCP_CRCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \
+MGCP_MSG_PRESENCE_CALL_ID | \
+MGCP_MSG_PRESENCE_CONN_ID | \
+MGCP_MSG_PRESENCE_CONN_MODE)
+#define MGCP_MDCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \
+MGCP_MSG_PRESENCE_CONN_ID)
+#define MGCP_DLCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT)
+#define MGCP_AUEP_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT)
+#define MGCP_RSIP_MANDATORY 0  /* none */
+
+struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg)
+{
+   mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp);
+   uint32_t mandatory_mask;
+   struct msgb *msg = msgb_alloc_headroom(4096, 128, "MGCP tx");
+   int rc = 0;
+
+   msg->l2h = msg->data;
+   msg->cb[MSGB_CB_MGCP

[MERGED] osmo-mgw[master]: mgcp: remove port/timeslot calculator functions from mgcp.h

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: mgcp: remove port/timeslot calculator functions from  mgcp.h
..


mgcp: remove port/timeslot calculator functions from  mgcp.h

the functions rtp_calculate_port(), mgcp_timeslot_to_endpoint(),
mgcp_endpoint_to_timeslot() were a hack to map CIC addresses
to endpoints and ports. This is no longer needed.

Remove the affected functions.

Change-Id: I9ef14396dc9f97e570d9bcfb4d9b4a94e650ad46
---
M include/osmocom/mgcp/mgcp.h
1 file changed, 0 insertions(+), 41 deletions(-)

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



diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h
index 7307f3c..83505a2 100644
--- a/include/osmocom/mgcp/mgcp.h
+++ b/include/osmocom/mgcp/mgcp.h
@@ -37,31 +37,6 @@
 #define RTP_PORT_DEFAULT_RANGE_START 16002
 #define RTP_PORT_DEFAULT_RANGE_END RTP_PORT_DEFAULT_RANGE_START + 64
 
-/**
- * Calculate the RTP audio port for the given multiplex
- * and the direction. This allows a semi static endpoint
- * to port calculation removing the need for the BSC
- * and the MediaGateway to communicate.
- *
- * Port usage explained:
- *   base + (multiplex * 2) + 0 == local port to wait for network packets
- *   base + (multiplex * 2) + 1 == local port for rtcp
- *
- * The above port will receive packets from the BTS that need
- * to be patched and forwarded to the network.
- * The above port will receive packets from the network that
- * need to be patched and forwarded to the BTS.
- *
- * We assume to have a static BTS IP address so we can differentiate
- * network and BTS.
- *
- */
-static inline int rtp_calculate_port(int multiplex, int base)
-{
-   return base + (multiplex * 2);
-}
-
-
 /*
  * Handling of MGCP Endpoints and the MGCP Config
  */
@@ -236,22 +211,6 @@
  */
 struct msgb *mgcp_handle_message(struct mgcp_config *cfg, struct msgb *msg);
 
-/* adc helper */
-static inline int mgcp_timeslot_to_endpoint(int multiplex, int timeslot)
-{
-   if (timeslot == 0) {
-   LOGP(DLMGCP, LOGL_ERROR, "Timeslot should not be 0\n");
-   timeslot = 255;
-   }
-
-   return timeslot + (32 * multiplex);
-}
-
-static inline void mgcp_endpoint_to_timeslot(int endpoint, int *multiplex, int 
*timeslot)
-{
-   *multiplex = endpoint / 32;
-   *timeslot = endpoint % 32;
-}
 
 int mgcp_send_reset_ep(struct mgcp_endpoint *endp, int endpoint);
 int mgcp_send_reset_all(struct mgcp_config *cfg);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9ef14396dc9f97e570d9bcfb4d9b4a94e650ad46
Gerrit-PatchSet: 4
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-mgw[master]: sdp: refactoring sdp parser/generator

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: sdp: refactoring sdp parser/generator
..


sdp: refactoring sdp parser/generator

move SDP generator function write_response_sdp() from mgcp_protocol.c
to mgcp_sdp.c and use msgb_printf() instead of snprintf()

move prototypes for mgcp_parse_sdp_data() and mgcp_set_audio_info()
to mgcp_sdp.h

change parameter list of mgcp_parse_sdp_data() so that it takes the
rtp conn directly, rather than struct mgcp_rtp_end.

add doxygen comments to all public functions

Change-Id: I9f88c93872ff913bc211f560b26901267f577324
---
M include/osmocom/mgcp/Makefile.am
M include/osmocom/mgcp/mgcp_internal.h
A include/osmocom/mgcp/mgcp_sdp.h
M src/libosmo-mgcp/mgcp_protocol.c
M src/libosmo-mgcp/mgcp_sdp.c
5 files changed, 158 insertions(+), 100 deletions(-)

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



diff --git a/include/osmocom/mgcp/Makefile.am b/include/osmocom/mgcp/Makefile.am
index 646b887..cd8f599 100644
--- a/include/osmocom/mgcp/Makefile.am
+++ b/include/osmocom/mgcp/Makefile.am
@@ -4,4 +4,5 @@
mgcp_conn.h \
mgcp_stat.h \
mgcp_ep.h \
+   mgcp_sdp.h \
$(NULL)
diff --git a/include/osmocom/mgcp/mgcp_internal.h 
b/include/osmocom/mgcp/mgcp_internal.h
index 751aba5..d4c8dc9 100644
--- a/include/osmocom/mgcp/mgcp_internal.h
+++ b/include/osmocom/mgcp/mgcp_internal.h
@@ -317,9 +317,6 @@
 #define DEFAULT_RTP_AUDIO_DEFAULT_CHANNELS 1
 
 #define PTYPE_UNDEFINED (-1)
-int mgcp_parse_sdp_data(struct mgcp_endpoint *endp, struct mgcp_rtp_end *rtp, 
struct mgcp_parse_data *p);
-int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec,
-   int payload_type, const char *audio_name);
 
 /*! get the ip-address where the mgw application is bound on.
  *  \param[in] endp mgcp endpoint, that holds a copy of the VTY parameters
diff --git a/include/osmocom/mgcp/mgcp_sdp.h b/include/osmocom/mgcp/mgcp_sdp.h
new file mode 100644
index 000..da23cba
--- /dev/null
+++ b/include/osmocom/mgcp/mgcp_sdp.h
@@ -0,0 +1,35 @@
+/*
+ * SDP generation and parsing
+ *
+ * (C) 2009-2015 by Holger Hans Peter Freyther 
+ * (C) 2009-2014 by On-Waves
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ *
+ */
+
+#pragma once
+#include 
+
+int mgcp_parse_sdp_data(const struct mgcp_endpoint *endp,
+   struct mgcp_conn_rtp *conn,
+   struct mgcp_parse_data *p);
+
+int mgcp_set_audio_info(void *ctx, struct mgcp_rtp_codec *codec,
+   int payload_type, const char *audio_name);
+
+int mgcp_write_response_sdp(const struct mgcp_endpoint *endp,
+   const struct mgcp_conn_rtp *conn, struct msgb *sdp,
+   const char *addr);
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index c00cdc6..6c611f7 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 
 struct mgcp_request {
char *name;
@@ -191,80 +192,6 @@
return create_resp(endp, code, " FAIL", msg, trans, NULL, NULL);
 }
 
-static int write_response_sdp(struct mgcp_endpoint *endp,
- struct mgcp_conn_rtp *conn,
- char *sdp_record, size_t size, const char *addr)
-{
-   const char *fmtp_extra;
-   const char *audio_name;
-   int payload_type;
-   int len;
-   int nchars;
-
-   if (!conn)
-   return -1;
-
-   endp->cfg->get_net_downlink_format_cb(endp, &payload_type,
- &audio_name, &fmtp_extra, conn);
-
-   len = snprintf(sdp_record, size,
-  "v=0\r\n"
-  "o=- %u 23 IN IP4 %s\r\n"
-  "s=-\r\n"
-  "c=IN IP4 %s\r\n"
-  "t=0 0\r\n", conn->conn->id, addr, addr);
-
-   if (len < 0 || len >= size)
-   goto buffer_too_small;
-
-   if (payload_type >= 0) {
-   nchars = snprintf(sdp_record + len, size - len,
- "m=audio %d RTP/AVP %d\r\n",
- conn->end.local_port, payload_type)

[MERGED] osmo-mgw[master]: network: add separate log category

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: network: add separate log category
..


network: add separate log category

the network (mgcp_network.c) part and the protocol part
(mgcp_protoocl.c) share a single loglevel DLMGCP. This
makes debuging hard because when debugging the protocol
we also get the log output from the RTP packets.

assign the network part a private loglevel and keep DLMGCP
for the directly MGCP related code

Change-Id: I55a2711798d1d1c2c9ef2f3b7ebb8fdd78bd6ea2
---
M include/osmocom/mgcp/Makefile.am
A include/osmocom/mgcp/debug.h
M src/libosmo-mgcp/mgcp_network.c
M src/osmo-mgw/mgw_main.c
4 files changed, 108 insertions(+), 64 deletions(-)

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



diff --git a/include/osmocom/mgcp/Makefile.am b/include/osmocom/mgcp/Makefile.am
index cd8f599..d706807 100644
--- a/include/osmocom/mgcp/Makefile.am
+++ b/include/osmocom/mgcp/Makefile.am
@@ -5,4 +5,5 @@
mgcp_stat.h \
mgcp_ep.h \
mgcp_sdp.h \
+   debug.h \
$(NULL)
diff --git a/include/osmocom/mgcp/debug.h b/include/osmocom/mgcp/debug.h
new file mode 100644
index 000..ddeb0dc
--- /dev/null
+++ b/include/osmocom/mgcp/debug.h
@@ -0,0 +1,35 @@
+/* (C) 2017 by sysmocom - s.f.m.c. GmbH 
+ * All Rights Reserved
+ *
+ * Author: Philipp Maier
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ *
+ */
+
+#pragma once
+
+#include 
+#include 
+
+#define DEBUG
+#include 
+
+/* Debug Areas of the code */
+enum {
+   DRTP,
+   Debug_LastEntry,
+};
+
+extern const struct log_info log_info;
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index dac1698..3d52d07 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define RTP_SEQ_MOD(1 << 16)
 #define RTP_MAX_DROPOUT3000
@@ -64,7 +65,7 @@
 
memset(&tp, 0, sizeof(tp));
if (clock_gettime(CLOCK_MONOTONIC, &tp) != 0)
-   LOGP(DLMGCP, LOGL_NOTICE, "Getting the clock failed.\n");
+   LOGP(DRTP, LOGL_NOTICE, "Getting the clock failed.\n");
 
/* convert it to 1/unit seconds */
ret = tp.tv_sec;
@@ -85,7 +86,7 @@
 {
struct sockaddr_in out;
 
-   LOGP(DLMGCP, LOGL_DEBUG,
+   LOGP(DRTP, LOGL_DEBUG,
 "sending %i bytes length packet to %s:%u ...\n",
 len, inet_ntoa(*addr), ntohs(port));
 
@@ -109,9 +110,9 @@
OSMO_ASSERT(endp);
OSMO_ASSERT(conn);
 
-   LOGP(DLMGCP, LOGL_DEBUG,
+   LOGP(DRTP, LOGL_DEBUG,
 "endpoint:%x sending dummy packet...\n", ENDPOINT_NUMBER(endp));
-   LOGP(DLMGCP, LOGL_DEBUG, "endpoint:%x conn:%s\n",
+   LOGP(DRTP, LOGL_DEBUG, "endpoint:%x conn:%s\n",
 ENDPOINT_NUMBER(endp), mgcp_conn_dump(conn->conn));
 
rc = mgcp_udp_send(conn->end.rtp.fd, &conn->end.addr,
@@ -131,7 +132,7 @@
return rc;
 
 failed:
-   LOGP(DLMGCP, LOGL_ERROR,
+   LOGP(DRTP, LOGL_ERROR,
 "endpoint:%x Failed to send dummy %s packet.\n",
 ENDPOINT_NUMBER(endp), was_rtcp ? "RTCP" : "RTP");
 
@@ -172,7 +173,7 @@
if (seq == sstate->last_seq) {
if (timestamp != sstate->last_timestamp) {
sstate->err_ts_counter += 1;
-   LOGP(DLMGCP, LOGL_ERROR,
+   LOGP(DRTP, LOGL_ERROR,
 "The %s timestamp delta is != 0 but the sequence "
 "number %d is the same, "
 "TS offset: %d, SeqNo offset: %d "
@@ -192,7 +193,7 @@
 
if (tsdelta == 0) {
/* Don't update *tsdelta_out */
-   LOGP(DLMGCP, LOGL_NOTICE,
+   LOGP(DRTP, LOGL_NOTICE,
 "The %s timestamp delta is %d "
 "on 0x%x SSRC: %u timestamp: %u "
 "from %s:%d\n",
@@ -205,7 +206,7 @@
 
if (sstate->last_tsdelta != tsdelta) {
if (sstate->last_tsdelta) {
-   LOGP(DLMGCP, LOGL_INFO,
+   LOGP(DRTP, LOGL_INFO,
 "The %s timestamp delta changes from %d to %d "

[MERGED] osmo-mgw[master]: client: add ip address parsing to the client

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: client: add ip address parsing to the client
..


client: add ip address parsing to the client

Some MGCP messages (CRCX, MDCX) return IP-Addresses. Make use of
this information.

Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a
---
M include/osmocom/mgcp_client/mgcp_client.h
M src/libosmo-mgcp-client/mgcp_client.c
M tests/mgcp_client/mgcp_client_test.c
M tests/mgcp_client/mgcp_client_test.ok
4 files changed, 42 insertions(+), 5 deletions(-)

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



diff --git a/include/osmocom/mgcp_client/mgcp_client.h 
b/include/osmocom/mgcp_client/mgcp_client.h
index 21717e3..e91b190 100644
--- a/include/osmocom/mgcp_client/mgcp_client.h
+++ b/include/osmocom/mgcp_client/mgcp_client.h
@@ -36,6 +36,7 @@
char *body;
struct mgcp_response_head head;
uint16_t audio_port;
+   char audio_ip[INET_ADDRSTRLEN];
 };
 
 enum mgcp_verb {
diff --git a/src/libosmo-mgcp-client/mgcp_client.c 
b/src/libosmo-mgcp-client/mgcp_client.c
index c7cc989..f8c55ac 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -174,7 +174,7 @@
 }
 
 /* Parse a line like "m=audio 16002 RTP/AVP 98" */
-static int mgcp_parse_audio(struct mgcp_response *r, const char *line)
+static int mgcp_parse_audio_port(struct mgcp_response *r, const char *line)
 {
 if (sscanf(line, "m=audio %hu",
   &r->audio_port) != 1)
@@ -184,7 +184,35 @@
 
 response_parse_failure:
LOGP(DLMGCP, LOGL_ERROR,
-"Failed to parse MGCP response header\n");
+"Failed to parse MGCP response header (audio port)\n");
+   return -EINVAL;
+}
+
+/* Parse a line like "c=IN IP4 10.11.12.13" */
+static int mgcp_parse_audio_ip(struct mgcp_response *r, const char *line)
+{
+   struct in_addr ip_test;
+
+   if (strlen(line) < 16)
+   goto response_parse_failure;
+
+   /* The current implementation strictly supports IPV4 only ! */
+   if (memcmp("c=IN IP4 ", line, 9) != 0)
+   goto response_parse_failure;
+
+   /* Extract IP-Address */
+   strncpy(r->audio_ip, line + 9, sizeof(r->audio_ip));
+   r->audio_ip[sizeof(r->audio_ip) - 1] = '\0';
+
+   /* Check IP-Address */
+   if (inet_aton(r->audio_ip, &ip_test) == 0)
+   goto response_parse_failure;
+
+   return 0;
+
+response_parse_failure:
+   LOGP(DLMGCP, LOGL_ERROR,
+"Failed to parse MGCP response header (audio ip)\n");
return -EINVAL;
 }
 
@@ -213,7 +241,12 @@
 
switch (line[0]) {
case 'm':
-   rc = mgcp_parse_audio(r, line);
+   rc = mgcp_parse_audio_port(r, line);
+   if (rc)
+   return rc;
+   break;
+   case 'c':
+   rc = mgcp_parse_audio_ip(r, line);
if (rc)
return rc;
break;
diff --git a/tests/mgcp_client/mgcp_client_test.c 
b/tests/mgcp_client/mgcp_client_test.c
index 7977a6a..513f345 100644
--- a/tests/mgcp_client/mgcp_client_test.c
+++ b/tests/mgcp_client/mgcp_client_test.c
@@ -99,11 +99,13 @@
   "  head.response_code = %d\n"
   "  head.trans_id = %u\n"
   "  head.comment = %s\n"
-  "  audio_port = %u\n",
+  "  audio_port = %u\n"
+  "  audio_ip = %s\n",
   response->head.response_code,
   response->head.trans_id,
   response->head.comment,
-  response->audio_port
+  response->audio_port,
+  response->audio_ip
  );
 }
 
diff --git a/tests/mgcp_client/mgcp_client_test.ok 
b/tests/mgcp_client/mgcp_client_test.ok
index e3b6113..d4efee4 100644
--- a/tests/mgcp_client/mgcp_client_test.ok
+++ b/tests/mgcp_client/mgcp_client_test.ok
@@ -28,6 +28,7 @@
   head.trans_id = 1
   head.comment = OK
   audio_port = 16002
+  audio_ip = 10.9.1.120
 
 Generated CRCX message:
 CRCX 1 23@mgw MGCP 1.0

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a
Gerrit-PatchSet: 16
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[MERGED] osmo-mgw[master]: protocol: allow wildcarded DLCX

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: protocol: allow wildcarded DLCX
..


protocol: allow wildcarded DLCX

In many cases it is simpler to instruct the mgcp-gw to drop all
connections at once instead of removing each connection
individually.

drop all connections and release the endpoint in when no connection
id is supplied with the DLCX command.

Change-Id: Ib5fcc72775bf72b489ff79ade36fb345d8d20736
---
M src/libosmo-mgcp/mgcp_protocol.c
1 file changed, 19 insertions(+), 2 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 6c611f7..9c92c65 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -910,14 +910,31 @@
}
}
 
-   /* find the connection */
+   /* When no connection id is supplied, we will interpret this as a
+* wildcarded DLCX and drop all connections at once. (See also
+* RFC3435 Section F.7) */
+   if (!ci) {
+   LOGP(DLMGCP, LOGL_NOTICE,
+"DLCX: endpoint:%x missing ci (connectionIdentifier), will 
remove all connections at once\n",
+ENDPOINT_NUMBER(endp));
+
+   mgcp_release_endp(endp);
+
+   /* Note: In this case we do not return any statistics,
+* as we assume that the client is not interested in
+* this case. */
+   return create_ok_response(endp, 200, "DLCX", p->trans);
+   }
+
+   /* Parse the connection id */
if (mgcp_parse_ci(&conn_id, ci)) {
LOGP(DLMGCP, LOGL_ERROR,
-"DLCX: endpoint:%x insufficient parameters, missing ci 
(connectionIdentifier)\n",
+"DLCX: endpoint:%x insufficient parameters, invalid ci 
(connectionIdentifier)\n",
 ENDPOINT_NUMBER(endp));
return create_err_response(endp, 400, "DLCX", p->trans);
}
 
+   /* Find the connection */
conn = mgcp_conn_get_rtp(endp, conn_id);
if (!conn)
goto error3;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib5fcc72775bf72b489ff79ade36fb345d8d20736
Gerrit-PatchSet: 11
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[MERGED] osmo-mgw[master]: cosmetic: rename bts_codec to codec_str

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: cosmetic: rename bts_codec to codec_str
..


cosmetic: rename bts_codec to codec_str

make variable name more meaningful

e enter the commit message for your changes. Lines starting

Change-Id: I4d4d5af8925d032155ca1ef8c7d7d2e496a60fb6
---
M src/libosmo-mgcp/mgcp_sdp.c
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c
index e6bf9c2..423153c 100644
--- a/src/libosmo-mgcp/mgcp_sdp.c
+++ b/src/libosmo-mgcp/mgcp_sdp.c
@@ -175,7 +175,7 @@
 static int is_codec_compatible(const struct mgcp_endpoint *endp,
   const struct sdp_rtp_map *codec)
 {
-   char *bts_codec;
+   char *codec_str;
char audio_codec[64];
 
if (!codec->codec_name)
@@ -185,8 +185,8 @@
 * GSM, GSM/8000 and GSM/8000/1 should all be compatible.. let's go
 * by name first.
 */
-   bts_codec = endp->tcfg->audio_name;
-   if (sscanf(bts_codec, "%63[^/]/%*d/%*d", audio_codec) < 1)
+   codec_str = endp->tcfg->audio_name;
+   if (sscanf(codec_str, "%63[^/]/%*d/%*d", audio_codec) < 1)
return 0;
 
return strcasecmp(audio_codec, codec->codec_name) == 0;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4d4d5af8925d032155ca1ef8c7d7d2e496a60fb6
Gerrit-PatchSet: 4
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-mgw[master]: cosmetic: fix commenting style

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: cosmetic: fix commenting style
..


cosmetic: fix commenting style

Change-Id: Ib717d9dd3b17250ef4d6c67be0463a407cb83fbe
---
M src/libosmo-mgcp/mgcp_sdp.c
1 file changed, 2 insertions(+), 4 deletions(-)

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



diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c
index 8575e86..314ba3e 100644
--- a/src/libosmo-mgcp/mgcp_sdp.c
+++ b/src/libosmo-mgcp/mgcp_sdp.c
@@ -181,10 +181,8 @@
if (!codec->codec_name)
return 0;
 
-   /*
-* GSM, GSM/8000 and GSM/8000/1 should all be compatible.. let's go
-* by name first.
-*/
+   /* GSM, GSM/8000 and GSM/8000/1 should all be compatible...
+* let's go by name first. */
codec_str = endp->tcfg->audio_name;
if (sscanf(codec_str, "%63[^/]/%*d/%*d", audio_codec) < 1)
return 0;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib717d9dd3b17250ef4d6c67be0463a407cb83fbe
Gerrit-PatchSet: 4
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-mgw[master]: client: fix stderror logging in unit-test

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: client: fix stderror logging in unit-test
..


client: fix stderror logging in unit-test

When testing the file name and the line numbers are output to
stderr, this causes the test to fail when change moves the
lines.

Disable line numbers in the stderror log when testing, also
disable timestamps and colors. Make sure the log category
is print.

Change-Id: I7f1bd9454188f0ca869dada1fcc2877b789cc0ac
---
M tests/mgcp_client/mgcp_client_test.c
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/tests/mgcp_client/mgcp_client_test.c 
b/tests/mgcp_client/mgcp_client_test.c
index f2f0e0f..69e1810 100644
--- a/tests/mgcp_client/mgcp_client_test.c
+++ b/tests/mgcp_client/mgcp_client_test.c
@@ -163,6 +163,10 @@
ctx = talloc_named_const(NULL, 1, "mgcp_client_test");
msgb_talloc_ctx_init(ctx, 0);
osmo_init_logging(&log_info);
+   log_set_print_filename(osmo_stderr_target, 0);
+   log_set_print_timestamp(osmo_stderr_target, 0);
+   log_set_use_color(osmo_stderr_target, 0);
+   log_set_print_category(osmo_stderr_target, 1);
 
mgcp_client_conf_init(&conf);
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7f1bd9454188f0ca869dada1fcc2877b789cc0ac
Gerrit-PatchSet: 3
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-mgw[master]: cosmetic: fix coding style for mgcp_parse_sdp_data()

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: cosmetic: fix coding style for mgcp_parse_sdp_data()
..


cosmetic: fix coding style for mgcp_parse_sdp_data()

move variable declaration to the top

remove brackets in case statement

correct whitespaces

Change-Id: I6dcf53ef8d3af5885b8b1f258d963949fa3ee93a
---
M src/libosmo-mgcp/mgcp_sdp.c
1 file changed, 38 insertions(+), 39 deletions(-)

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



diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c
index 423153c..8575e86 100644
--- a/src/libosmo-mgcp/mgcp_sdp.c
+++ b/src/libosmo-mgcp/mgcp_sdp.c
@@ -213,6 +213,12 @@
void *tmp_ctx = talloc_new(NULL);
struct mgcp_rtp_end *rtp;
 
+   int payload;
+   int ptime, ptime2 = 0;
+   char audio_name[64];
+   int port, rc;
+   char ipv4[16];
+
OSMO_ASSERT(endp);
OSMO_ASSERT(conn);
OSMO_ASSERT(p);
@@ -228,41 +234,36 @@
case 'v':
/* skip these SDP attributes */
break;
-   case 'a': {
-   int payload;
-   int ptime, ptime2 = 0;
-   char audio_name[64];
-
-
+   case 'a':
if (sscanf(line, "a=rtpmap:%d %63s",
   &payload, audio_name) == 2) {
-   codecs_update(tmp_ctx, codecs, codecs_used, 
payload, audio_name);
-   } else if (sscanf(line, "a=ptime:%d-%d",
- &ptime, &ptime2) >= 1) {
+   codecs_update(tmp_ctx, codecs,
+ codecs_used, payload, audio_name);
+   } else
+   if (sscanf
+   (line, "a=ptime:%d-%d", &ptime, &ptime2) >= 1) {
if (ptime2 > 0 && ptime2 != ptime)
rtp->packet_duration_ms = 0;
else
rtp->packet_duration_ms = ptime;
-   } else if (sscanf(line, "a=maxptime:%d", &ptime2) == 1) 
{
+   } else if (sscanf(line, "a=maxptime:%d", &ptime2)
+  == 1) {
maxptime = ptime2;
}
break;
-   }
-   case 'm': {
-   int port, rc;
-
-   rc = sscanf(line, "m=audio %d RTP/AVP %d %d %d %d %d %d 
%d %d %d %d",
-   &port,
-   &codecs[0].payload_type,
-   &codecs[1].payload_type,
-   &codecs[2].payload_type,
-   &codecs[3].payload_type,
-   &codecs[4].payload_type,
-   &codecs[5].payload_type,
-   &codecs[6].payload_type,
-   &codecs[7].payload_type,
-   &codecs[8].payload_type,
-   &codecs[9].payload_type);
+   case 'm':
+   rc = sscanf(line,
+   "m=audio %d RTP/AVP %d %d %d %d %d %d %d %d 
%d %d",
+   &port, &codecs[0].payload_type,
+   &codecs[1].payload_type,
+   &codecs[2].payload_type,
+   &codecs[3].payload_type,
+   &codecs[4].payload_type,
+   &codecs[5].payload_type,
+   &codecs[6].payload_type,
+   &codecs[7].payload_type,
+   &codecs[8].payload_type,
+   &codecs[9].payload_type);
if (rc >= 2) {
rtp->rtp_port = htons(port);
rtp->rtcp_port = htons(port + 1);
@@ -270,20 +271,18 @@
codecs_initialize(tmp_ctx, codecs, codecs_used);
}
break;
-   }
-   case 'c': {
-   char ipv4[16];
+   case 'c':
 
if (sscanf(line, "c=IN IP4 %15s", ipv4) == 1) {
inet_aton(ipv4, &rtp->addr);
}
break;
-   }
default:
if (p->endp)
LOGP(DLMGCP, LOGL_NOTICE,

[MERGED] osmo-mgw[master]: cosmetic: correct whitespaces

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: cosmetic: correct whitespaces
..


cosmetic: correct whitespaces

Change-Id: I22302ae8a48a2c776025a60267f5ef5af706e576
---
M src/libosmo-mgcp/mgcp_sdp.c
1 file changed, 21 insertions(+), 11 deletions(-)

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



diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c
index 314ba3e..f45d6e7 100644
--- a/src/libosmo-mgcp/mgcp_sdp.c
+++ b/src/libosmo-mgcp/mgcp_sdp.c
@@ -62,15 +62,23 @@
 
if (!audio_name) {
switch (payload_type) {
-   case 0: audio_name = "PCMU/8000/1"; break;
-   case 3: audio_name = "GSM/8000/1"; break;
-   case 8: audio_name = "PCMA/8000/1"; break;
-   case 18: audio_name = "G729/8000/1"; break;
+   case 0:
+   audio_name = "PCMU/8000/1";
+   break;
+   case 3:
+   audio_name = "GSM/8000/1";
+   break;
+   case 8:
+   audio_name = "PCMA/8000/1";
+   break;
+   case 18:
+   audio_name = "G729/8000/1";
+   break;
default:
-/* Payload type is unknown, don't change rate and
- * channels. */
-/* TODO: return value? */
-return 0;
+   /* Payload type is unknown, don't change rate and
+* channels. */
+   /* TODO: return value? */
+   return 0;
}
}
 
@@ -156,8 +164,9 @@
if (codecs[i].payload_type != payload)
continue;
if (sscanf(audio_name, "%63[^/]/%d/%d",
-   audio_codec, &rate, &channels) < 1) {
-   LOGP(DLMGCP, LOGL_ERROR, "Failed to parse '%s'\n", 
audio_name);
+  audio_codec, &rate, &channels) < 1) {
+   LOGP(DLMGCP, LOGL_ERROR, "Failed to parse '%s'\n",
+audio_name);
continue;
}
 
@@ -168,7 +177,8 @@
return;
}
 
-   LOGP(DLMGCP, LOGL_ERROR, "Unconfigured PT(%d) with %s\n", payload, 
audio_name);
+   LOGP(DLMGCP, LOGL_ERROR, "Unconfigured PT(%d) with %s\n", payload,
+audio_name);
 }
 
 /* Check if the codec matches what is set up in the trunk config */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I22302ae8a48a2c776025a60267f5ef5af706e576
Gerrit-PatchSet: 4
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-mgw[master]: cosmetic: make dummy packet handling more explicit

2017-11-02 Thread Harald Welte

Patch Set 3: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie7ee9409baec50a09fb357d655b5253434fae924
Gerrit-PatchSet: 3
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[MERGED] osmocom-bb[master]: mobile/vty_interface.c: add missing 'vty/misc.h' header

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: mobile/vty_interface.c: add missing 'vty/misc.h' header
..


mobile/vty_interface.c: add missing 'vty/misc.h' header

This header contains declaration of the osmo_talloc_vty_add_cmds().

Change-Id: Icdafb22758897cfb67e249f37991f4af4213a5fa
---
M src/host/layer23/src/mobile/vty_interface.c
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/src/host/layer23/src/mobile/vty_interface.c 
b/src/host/layer23/src/mobile/vty_interface.c
index 2ad95d0..b3777dc 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 
 void *l23_ctx;
 

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

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


[MERGED] osmocom-bb[master]: mobile/main.c: fix deprecated call to msgb_set_talloc_ctx()

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: mobile/main.c: fix deprecated call to msgb_set_talloc_ctx()
..


mobile/main.c: fix deprecated call to msgb_set_talloc_ctx()

The usage of msgb_set_talloc_ctx() was deprecated many days ago,
so it's time to use the proper replacement.

Change-Id: I56440d8e2152c4bb2e5ad677f88c61742d2ad9ca
---
M src/host/layer23/src/mobile/main.c
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/src/host/layer23/src/mobile/main.c 
b/src/host/layer23/src/mobile/main.c
index bc66557..997e2d5 100644
--- a/src/host/layer23/src/mobile/main.c
+++ b/src/host/layer23/src/mobile/main.c
@@ -220,7 +220,8 @@
log_set_all_filter(stderr_target, 1);
 
l23_ctx = talloc_named_const(NULL, 1, "layer2 context");
-   msgb_set_talloc_ctx(l23_ctx);
+   /* TODO: measure and choose a proper pool size */
+   msgb_talloc_ctx_init(l23_ctx, 0);
 
handle_options(argc, argv);
 

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

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


[MERGED] osmo-gsm-manuals[master]: OsmoBSC: update CTRL docs

2017-11-02 Thread Max
Max has submitted this change and it was merged.

Change subject: OsmoBSC: update CTRL docs
..


OsmoBSC: update CTRL docs

* use proper naming scheme for BTS-specific CTRL commands
* add/update oml-* commands

Change-Id: I5b2cd940b4d84c140fce871f236aeab091b27360
Related: OS#2486
---
M OsmoBSC/chapters/control.adoc
1 file changed, 14 insertions(+), 13 deletions(-)

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



diff --git a/OsmoBSC/chapters/control.adoc b/OsmoBSC/chapters/control.adoc
index a1d6b43..327e5b4 100644
--- a/OsmoBSC/chapters/control.adoc
+++ b/OsmoBSC/chapters/control.adoc
@@ -4,10 +4,10 @@
 The actual protocol is described in <>, the variables
 common to all programs using it are described in <>. Here we
 describe variables specific to OsmoBSC. The commands starting with prefix
-"net.btsN." are specific to a certain BTS so N have to be replaced with BTS
-number when issuing command e. g. "net.bts1.channel-load". Similarly the
+"bts.N." are specific to a certain BTS so N have to be replaced with BTS
+number when issuing command e. g. "bts.1.channel-load". Similarly the
 TRX-specific commands are additionally prefixed with TRX number e. g.
-"net.bts1.trx2.arfcn".
+"bts.1.trx.2.arfcn".
 
 .Variables available over control interface
 [options="header",width="100%",cols="20%,5%,5%,50%,20%"]
@@ -28,16 +28,17 @@
 |ussd-notify-v1|WO|No|",,"| See <> for details.
 |rf_locked|RW|No|"0","1"|See <> for details.
 |number-of-bts|RO|No|""|Get number of configured BTS.
-|net.btsN.location-area-code|RW|No|""|Set/Get LAC (value between (0, 
65535)).
-|net.btsN.cell-identity|RW|No|""|Set/Get Cell Identity (value between (0, 
65535)).
-|net.btsN.apply-configuration|WO|No|Ignored|Restart BTS via OML.
-|net.btsN.send-new-system-informations|WO|No|Ignored|Regenerate System 
Information messages for given BTS.
-|net.btsN.channel-load|RO|No|",,"|See <> for 
details.
-|net.btsN.oml-connection-state|RO|No|"connected", "disconnected"|Indicate the 
status of OML connection of BTS.
-|net.btsN.gprs-mode|RW|No|""|See <> for details.
-|net.btsN.rf_state|RO|No|",,"|See <> for details.
-|net.btsN.trxM.arfcn|RW|No|""|Set/Get ARFCN (value between (0, 1023)).
-|net.btsN.trxM.max-power-reduction|RW|No|""|See <> for details.
+|bts.N.location-area-code|RW|No|""|Set/Get LAC (value between (0, 65535)).
+|bts.N.cell-identity|RW|No|""|Set/Get Cell Identity (value between (0, 
65535)).
+|bts.N.apply-configuration|WO|No|Ignored|Restart BTS via OML.
+|bts.N.send-new-system-informations|WO|No|Ignored|Regenerate System 
Information messages for given BTS.
+|bts.N.channel-load|RO|No|",,"|See <> for details.
+|bts.N.oml-connection-state|RO|No|"connected", "disconnected", 
"degraded"|Indicate the status of OML connection of BTS.
+|bts.N.oml-uptime|RO|No||Return OML link uptime in seconds.
+|bts.N.gprs-mode|RW|No|""|See <> for details.
+|bts.N.rf_state|RO|No|",,"|See <> for details.
+|bts.N.trx.M.arfcn|RW|No|""|Set/Get ARFCN (value between (0, 1023)).
+|bts.N.trx.M.max-power-reduction|RW|No|""|See <> for details.
 |===
 
 [[notif]]

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5b2cd940b4d84c140fce871f236aeab091b27360
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 


[PATCH] osmo-bsc[master]: Check OML state per-BTS

2017-11-02 Thread Max

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

Check OML state per-BTS

To properly decide if a given OML link is degraded we have to use
BTS-specific information about MO state.

* move check function into BTS-specific part
* add generic wrapper

Related: OS#2486
Change-Id: Iddc7a4d20fbb95a6566eed1487a12733e5adb9e2
---
M include/osmocom/bsc/abis_nm.h
M include/osmocom/bsc/gsm_data.h
M src/libbsc/abis_nm.c
M src/libbsc/bts_ipaccess_nanobts.c
4 files changed, 10 insertions(+), 10 deletions(-)


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

diff --git a/include/osmocom/bsc/abis_nm.h b/include/osmocom/bsc/abis_nm.h
index 34f16a9..e25cb4f 100644
--- a/include/osmocom/bsc/abis_nm.h
+++ b/include/osmocom/bsc/abis_nm.h
@@ -162,6 +162,7 @@
 const char *ipacc_testres_name(uint8_t res);
 
 /* Functions calling into other code parts */
+bool all_trx_rsl_connected(const struct gsm_bts *bts);
 int nm_is_running(struct gsm_nm_state *s);
 
 int abis_nm_vty_init(void);
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 51b2c98..74298b8 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -654,7 +654,6 @@
 extern const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE+1];
 extern const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1];
 
-char *get_oml_status(const struct gsm_bts *bts);
 char *get_model_oml_status(const struct gsm_bts *bts);
 
 unsigned long long bts_uptime(const struct gsm_bts *bts);
diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c
index f0dfe9e..b7391a1 100644
--- a/src/libbsc/abis_nm.c
+++ b/src/libbsc/abis_nm.c
@@ -683,7 +683,7 @@
return 0;
 }
 
-static inline bool all_trx_rsl_connected(const struct gsm_bts *bts)
+bool all_trx_rsl_connected(const struct gsm_bts *bts)
 {
const struct gsm_bts_trx *trx;
 
@@ -693,14 +693,6 @@
}
 
return true;
-}
-
-char *get_oml_status(const struct gsm_bts *bts)
-{
-   if (bts->oml_link)
-   return all_trx_rsl_connected(bts) ? "connected" : "degraded";
-
-   return "disconnected";
 }
 
 char *get_model_oml_status(const struct gsm_bts *bts)
diff --git a/src/libbsc/bts_ipaccess_nanobts.c 
b/src/libbsc/bts_ipaccess_nanobts.c
index dbb0e4f..9e273f5 100644
--- a/src/libbsc/bts_ipaccess_nanobts.c
+++ b/src/libbsc/bts_ipaccess_nanobts.c
@@ -47,6 +47,14 @@
 static int bts_model_nanobts_start(struct gsm_network *net);
 static void bts_model_nanobts_e1line_bind_ops(struct e1inp_line *line);
 
+static char *get_oml_status(const struct gsm_bts *bts)
+{
+   if (bts->oml_link)
+   return all_trx_rsl_connected(bts) ? "connected" : "degraded";
+
+   return "disconnected";
+}
+
 struct gsm_bts_model bts_model_nanobts = {
.type = GSM_BTS_TYPE_NANOBTS,
.name = "nanobts",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iddc7a4d20fbb95a6566eed1487a12733e5adb9e2
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Max 


[PATCH] osmo-mgw[master]: network: autdetect rtp bind ip-address

2017-11-02 Thread dexter

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

network: autdetect rtp bind ip-address

Currently there are two ways to set the rtp bind ip-address (local
ip address where the rtp streams are bound to). It is possible to
set no set an rtp bind ip, if none no address is configured, then
the ip address where the mgcp service is bound to is used.

On a system with multiple network interfaces it is likely that
there are the remote end is not reachable through the interface
that has been configured. In this case rtp ip-probing can be
enabled via vty option in order to automatically detect the
ip address of the interface that points towards the remote end.

The autodetection can only work if the ip-address is known when
a CRCX is performed. For this the remote entity must include the
remote ip address in the sdp trailer.

Implement probing to determine te right local ip address
Add debug log to display which ip address is actually used
Add a VTY option for the probing functionality.

Change-Id: Ia57cf7dab8421fd3ab6e1515727db0080373485e
---
M include/osmocom/mgcp/mgcp.h
M include/osmocom/mgcp/mgcp_internal.h
M src/libosmo-mgcp/mgcp_network.c
M src/libosmo-mgcp/mgcp_protocol.c
M src/libosmo-mgcp/mgcp_vty.c
5 files changed, 97 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/50/4650/1

diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h
index 59147f0..42a91d8 100644
--- a/include/osmocom/mgcp/mgcp.h
+++ b/include/osmocom/mgcp/mgcp.h
@@ -96,6 +96,12 @@
int range_start;
int range_end;
int last_port;
+
+   /* set to true to enable automatic probing
+* of the local bind IP-Address, bind_addr
+* (or its fall back) is used when automatic
+* probing fails */
+   bool bind_addr_probe;
 };
 
 /* There are up to three modes in which the keep-alive dummy packet can be
diff --git a/include/osmocom/mgcp/mgcp_internal.h 
b/include/osmocom/mgcp/mgcp_internal.h
index d4c8dc9..b9c1731 100644
--- a/include/osmocom/mgcp/mgcp_internal.h
+++ b/include/osmocom/mgcp/mgcp_internal.h
@@ -318,12 +318,4 @@
 
 #define PTYPE_UNDEFINED (-1)
 
-/*! get the ip-address where the mgw application is bound on.
- *  \param[in] endp mgcp endpoint, that holds a copy of the VTY parameters
- *  \returns pointer to a string that contains the source ip-address */
-static inline const char *mgcp_net_src_addr(struct mgcp_endpoint *endp)
-{
-   if (endp->cfg->net_ports.bind_addr)
-   return endp->cfg->net_ports.bind_addr;
-   return endp->cfg->source_addr;
-}
+void mgcp_get_local_addr(char *addr, struct mgcp_conn_rtp *conn);
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 3d52d07..7876b33 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -32,6 +32,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -51,6 +52,56 @@
MGCP_PROTO_RTP,
MGCP_PROTO_RTCP,
 };
+
+/*! Determine the local rtp bind IP-address.
+ *  \param[out] addr caller provided memory to store the resulting IP-Address
+ *  \param[in] endp mgcp endpoint, that holds a copy of the VTY parameters
+ *
+ *  The local bind IP-address is automatically selected by probing the
+ *  IP-Address of the interface that is pointing towards the remote IP-Address,
+ *  if no remote IP-Address is known yet, the statically configured
+ *  IP-Addresses are used as fallback. */
+void mgcp_get_local_addr(char *addr, struct mgcp_conn_rtp *conn)
+{
+
+   struct mgcp_endpoint *endp;
+   int rc;
+   endp = conn->conn->endp;
+
+   /* Try probing the local IP-Address */
+   if (endp->cfg->net_ports.bind_addr_probe && conn->end.addr.s_addr != 0) 
{
+   rc = osmo_sock_local_ip(addr, inet_ntoa(conn->end.addr));
+   if (rc < 0)
+   LOGP(DRTP, LOGL_ERROR,
+"endpoint:%x CI:%i local interface auto detection 
failed, using configured addresses...\n",
+ENDPOINT_NUMBER(endp), conn->conn->id);
+   else {
+   LOGP(DRTP, LOGL_DEBUG,
+"endpoint:%x CI:%i selected local rtp bind ip %s 
by probing using remote ip %s\n",
+ENDPOINT_NUMBER(endp), conn->conn->id, addr,
+inet_ntoa(conn->end.addr));
+   return;
+   }
+   }
+
+   /* Select from preconfigured IP-Addresses */
+   if (endp->cfg->net_ports.bind_addr) {
+   /* Check there is a bind IP for the RTP traffic configured,
+* if so, use that IP-Address */
+   strncpy(addr, endp->cfg->net_ports.bind_addr, INET_ADDRSTRLEN);
+   LOGP(DRTP, LOGL_DEBUG,
+"endpoint:%x CI:%i using configured rtp bind ip as local 
bind ip %s\n",
+ENDPOINT_NUMBER(endp), conn->conn->id, addr);
+   } else {
+  

osmo-mgw[master]: network: autdetect rtp bind ip-address

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bsc[master]: Check OML state per-BTS

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iddc7a4d20fbb95a6566eed1487a12733e5adb9e2
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-bsc[master]: Check OML state per-BTS

2017-11-02 Thread Max
Max has submitted this change and it was merged.

Change subject: Check OML state per-BTS
..


Check OML state per-BTS

To properly decide if a given OML link is degraded we have to use
BTS-specific information about MO state.

* move check function into BTS-specific part
* add generic wrapper

Related: OS#2486
Change-Id: Iddc7a4d20fbb95a6566eed1487a12733e5adb9e2
---
M include/osmocom/bsc/abis_nm.h
M include/osmocom/bsc/gsm_data.h
M src/libbsc/abis_nm.c
M src/libbsc/bts_ipaccess_nanobts.c
4 files changed, 10 insertions(+), 10 deletions(-)

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



diff --git a/include/osmocom/bsc/abis_nm.h b/include/osmocom/bsc/abis_nm.h
index 34f16a9..e25cb4f 100644
--- a/include/osmocom/bsc/abis_nm.h
+++ b/include/osmocom/bsc/abis_nm.h
@@ -162,6 +162,7 @@
 const char *ipacc_testres_name(uint8_t res);
 
 /* Functions calling into other code parts */
+bool all_trx_rsl_connected(const struct gsm_bts *bts);
 int nm_is_running(struct gsm_nm_state *s);
 
 int abis_nm_vty_init(void);
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 51b2c98..74298b8 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -654,7 +654,6 @@
 extern const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE+1];
 extern const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1];
 
-char *get_oml_status(const struct gsm_bts *bts);
 char *get_model_oml_status(const struct gsm_bts *bts);
 
 unsigned long long bts_uptime(const struct gsm_bts *bts);
diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c
index f0dfe9e..b7391a1 100644
--- a/src/libbsc/abis_nm.c
+++ b/src/libbsc/abis_nm.c
@@ -683,7 +683,7 @@
return 0;
 }
 
-static inline bool all_trx_rsl_connected(const struct gsm_bts *bts)
+bool all_trx_rsl_connected(const struct gsm_bts *bts)
 {
const struct gsm_bts_trx *trx;
 
@@ -693,14 +693,6 @@
}
 
return true;
-}
-
-char *get_oml_status(const struct gsm_bts *bts)
-{
-   if (bts->oml_link)
-   return all_trx_rsl_connected(bts) ? "connected" : "degraded";
-
-   return "disconnected";
 }
 
 char *get_model_oml_status(const struct gsm_bts *bts)
diff --git a/src/libbsc/bts_ipaccess_nanobts.c 
b/src/libbsc/bts_ipaccess_nanobts.c
index dbb0e4f..9e273f5 100644
--- a/src/libbsc/bts_ipaccess_nanobts.c
+++ b/src/libbsc/bts_ipaccess_nanobts.c
@@ -47,6 +47,14 @@
 static int bts_model_nanobts_start(struct gsm_network *net);
 static void bts_model_nanobts_e1line_bind_ops(struct e1inp_line *line);
 
+static char *get_oml_status(const struct gsm_bts *bts)
+{
+   if (bts->oml_link)
+   return all_trx_rsl_connected(bts) ? "connected" : "degraded";
+
+   return "disconnected";
+}
+
 struct gsm_bts_model bts_model_nanobts = {
.type = GSM_BTS_TYPE_NANOBTS,
.name = "nanobts",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iddc7a4d20fbb95a6566eed1487a12733e5adb9e2
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Improve Resource Resolution section content

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Improve Resource Resolution section content

Change-Id: Ice37093dc9f8e03a2a9f5e3f7df79d1b589b6991
---
M OsmoGSMTester/chapters/intro.adoc
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/54/4654/1

diff --git a/OsmoGSMTester/chapters/intro.adoc 
b/OsmoGSMTester/chapters/intro.adoc
index b405e1f..e2156df 100644
--- a/OsmoGSMTester/chapters/intro.adoc
+++ b/OsmoGSMTester/chapters/intro.adoc
@@ -202,12 +202,12 @@
 
 === Resource Resolution
 
-- A global configuration defines which hardware is connected to the
+- A global configuration 'resources.conf' defines which hardware is connected 
to the
   osmo-gsm-tester main unit.
 - Each suite contains a number of test scripts. The amount of resources a test
   may use is defined by the test suite's 'suite.conf'.
 - Which specific modems, BTS models, NITB IP addresses etc. are made available
-  to a test run is typically determined by a combination of scenario
+  to a test run is typically determined by 'suite.conf' and a combination of 
scenario
   configurations -- or picked automatically if not.
 
 [[resources_conf_example]]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice37093dc9f8e03a2a9f5e3f7df79d1b589b6991
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Add deps required for osmo-bts-octphy support

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Add deps required for osmo-bts-octphy support

Change-Id: I384ec8cd55cfaa68ee1f461de99ceac78c5d8414
---
M OsmoGSMTester/chapters/install.adoc
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/59/4659/1

diff --git a/OsmoGSMTester/chapters/install.adoc 
b/OsmoGSMTester/chapters/install.adoc
index 8397459..112d4f9 100644
--- a/OsmoGSMTester/chapters/install.adoc
+++ b/OsmoGSMTester/chapters/install.adoc
@@ -24,6 +24,9 @@
   python3-mako \
   python3-gi \
   ofono \
+  patchelf \
+  sudo \
+  libcap2-bin \
   python3-pip
 pip3 install pydbus
 pip3 install git+git://github.com/podshumok/python-smpplib.git

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I384ec8cd55cfaa68ee1f461de99ceac78c5d8414
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Update trial graph with current data

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Update trial graph with current data

The osmo-bts-trx tgz doesn't exist anymore and it does not contain
osmo-trx, which comes in its own tgz.

Change-Id: Id803eca3791137b04bc24d195119d5c511fcfc49
---
M OsmoGSMTester/chapters/intro.adoc
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/52/4652/1

diff --git a/OsmoGSMTester/chapters/intro.adoc 
b/OsmoGSMTester/chapters/intro.adoc
index 557c2f3..cc37e88 100644
--- a/OsmoGSMTester/chapters/intro.adoc
+++ b/OsmoGSMTester/chapters/intro.adoc
@@ -146,7 +146,7 @@
subgraph cluster_trial {
label = "Trial (binaries)"
sysmo [label="osmo-bts-sysmo.build-23.tgz\n(osmo-bts-sysmo\n+ 
deps\ncompiled for sysmoBTS)"]
-   trx [label="osmo-bts-trx.build-5.tgz\n(osmo-trx + 
osmo-bts-trx\n+ deps\ncompiled for main unit)"]
+   trx [label="osmo-bts.build-5.tgz\n(osmo-bts-octphy + 
osmo-bts-trx\n+ deps\ncompiled for main unit)"]
nitb [label="osmo-nitb.build-42.tgz\n(osmo-nitb\n+ 
deps\ncompiled for main unit)"]
checksums [label="checksums.md5"]
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id803eca3791137b04bc24d195119d5c511fcfc49
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Update suite.conf example

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Update suite.conf example

This is the one we are usig nowadays in suite.conf, which explicitly
asks to be run with modems supporting sms features.

Change-Id: If5dbc3b4689b282db6fae4668e2838be59e88da8
---
M OsmoGSMTester/chapters/intro.adoc
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/56/4656/1

diff --git a/OsmoGSMTester/chapters/intro.adoc 
b/OsmoGSMTester/chapters/intro.adoc
index 8c106b7..6e377da 100644
--- a/OsmoGSMTester/chapters/intro.adoc
+++ b/OsmoGSMTester/chapters/intro.adoc
@@ -316,6 +316,8 @@
   - times: 1
   modem:
   - times: 2
+features:
+- sms
 
 
 It may also request e.g. specific BTS models, but this is typically left to

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If5dbc3b4689b282db6fae4668e2838be59e88da8
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Update sample test script with an AoIP example

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Update sample test script with an AoIP example

Change-Id: I7978c7e96c8f1d43837271c94dd64893649974e0
---
M OsmoGSMTester/chapters/intro.adoc
1 file changed, 23 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/53/4653/1

diff --git a/OsmoGSMTester/chapters/intro.adoc 
b/OsmoGSMTester/chapters/intro.adoc
index cc37e88..b405e1f 100644
--- a/OsmoGSMTester/chapters/intro.adoc
+++ b/OsmoGSMTester/chapters/intro.adoc
@@ -163,26 +163,38 @@
 #!/usr/bin/env python3
 from osmo_gsm_tester.test import *
 
-nitb = suite.nitb()
+hlr = suite.hlr()
 bts = suite.bts()
+mgcpgw = suite.mgcpgw(bts_ip=bts.remote_addr())
+msc = suite.msc(hlr, mgcpgw)
+bsc = suite.bsc(msc)
+stp = suite.stp()
 ms_mo = suite.modem()
 ms_mt = suite.modem()
 
-print('start nitb and bts...')
-nitb.bts_add(bts)
-nitb.start()
+hlr.start()
+stp.start()
+msc.start()
+mgcpgw.start()
+
+bsc.bts_add(bts)
+bsc.start()
+
 bts.start()
 
-nitb.subscriber_add(ms_mo)
-nitb.subscriber_add(ms_mt)
+hlr.subscriber_add(ms_mo)
+hlr.subscriber_add(ms_mt)
 
-ms_mo.connect(nitb.mcc_mnc())
-ms_mt.connect(nitb.mcc_mnc())
+ms_mo.connect(msc.mcc_mnc())
+ms_mt.connect(msc.mcc_mnc())
+
+ms_mo.log_info()
+ms_mt.log_info()
 
 print('waiting for modems to attach...')
-wait(ms_mo.is_connected, nitb.mcc_mnc())
-wait(ms_mt.is_connected, nitb.mcc_mnc())
-wait(nitb.subscriber_attached, ms_mo, ms_mt)
+wait(ms_mo.is_connected, msc.mcc_mnc())
+wait(ms_mt.is_connected, msc.mcc_mnc())
+wait(msc.subscriber_attached, ms_mo, ms_mt)
 
 sms = ms_mo.sms_send(ms_mt)
 wait(ms_mt.sms_was_received, sms)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7978c7e96c8f1d43837271c94dd64893649974e0
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Installation: change some confusing terminology

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Installation: change some confusing terminology

It's difficult to understand when it referrs to jenkins job in general
and when it talks about specific jenkins jobs that builds binaries required for
osmo-gsm-tester and the ones which run osmo-gsm-tester.

As a result, it's difficult to understand which sections apply to each
host in case more than one host is used.

Change-Id: I5c882e77b469629028b8d773053783e18f3d1737
---
M OsmoGSMTester/chapters/install.adoc
M OsmoGSMTester/chapters/trial.adoc
2 files changed, 12 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/60/4660/1

diff --git a/OsmoGSMTester/chapters/install.adoc 
b/OsmoGSMTester/chapters/install.adoc
index 112d4f9..5f6f1bc 100644
--- a/OsmoGSMTester/chapters/install.adoc
+++ b/OsmoGSMTester/chapters/install.adoc
@@ -9,7 +9,7 @@
 for manual test runs and/or a different user name is identical, simply replace
 the user name or group.
 
-=== Dependencies
+=== Osmo-gsm-tester Dependencies
 
 On a Debian/Ubuntu based system, these commands install the packages needed to
 run the osmo-gsm-tester.py code, i.e. install these on your main unit:
@@ -46,7 +46,7 @@
 
 
 [[jenkins_deps]]
- Jenkins Build Dependencies
+ Osmocom Build Dependencies
 
 Each of the jenkins builds requires individual dependencies. This is generally
 the same as for building the software outside of osmo-gsm-tester and will not
@@ -57,8 +57,8 @@
 should match the installed sysmoBTS firmware.
 
 
-[[configure_build_slave]]
-=== Jenkins Build Slave
+[[configure_jenkins_slave]]
+=== Jenkins Build and Run Slave
 
  Create 'jenkins' User on Main Unit
 
@@ -140,8 +140,8 @@
 exit
 
 
-[[install_add_build_slave]]
- Add Build Slave
+[[install_add_jenkins_slave]]
+ Add Jenkins Slave
 
 In the jenkins web UI, add a new build slave for the osmo-gsm-tester:
 
@@ -253,10 +253,10 @@
 
  Add Run Job
 
-This is the build job that actually runs the tests on the GSM hardware:
+This is the jenkins job that runs the tests on the GSM hardware:
 
-* It sources the artifacts from the build jobs.
-* It runs on the osmo-gsm-tester main unit's build slave.
+* It sources the artifacts from jenkins' build jobs.
+* It runs on the osmo-gsm-tester main unit.
 
 Here is the configuration for the run job:
 
@@ -265,7 +265,7 @@
   Configure this to taste, for example:
 ** 'Max # of build to keep': "20"
 * 'Restrict where this project can be run': "osmo-gsm-tester" +
-  (to match the 'Label' configured in <>).
+  (to match the 'Label' configured in <>).
 * 'Source Code Management':
 ** 'Git'
 *** 'Repository URL': "git://git.osmocom.org/osmo-gsm-tester"
@@ -332,7 +332,7 @@
 
 === Install osmo-gsm-tester on Main Unit
 
-This assumes you have already created the jenkins user (see 
<>).
+This assumes you have already created the jenkins user (see 
<>).
 
  User Permissions
 
diff --git a/OsmoGSMTester/chapters/trial.adoc 
b/OsmoGSMTester/chapters/trial.adoc
index 928ee28..86bf12b 100644
--- a/OsmoGSMTester/chapters/trial.adoc
+++ b/OsmoGSMTester/chapters/trial.adoc
@@ -3,7 +3,7 @@
 
 A trial is a set of pre-built binaries to be tested. They are typically built
 by jenkins using the build scripts found in osmo-gsm-tester's source in the
-'contrib/' dir, see <>.
+'contrib/' dir, see <>.
 
 A trial comes in the form of a directory containing a number of '*.tgz' tar
 archives as well as a 'checksums.md5' file to verify the tar archives'
@@ -20,4 +20,3 @@
 * stdout and stderr outputs of the binaries
 * a test log
 * *TODO*: jenkins parsable XML reports
-

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c882e77b469629028b8d773053783e18f3d1737
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Use a more up-to-date resources.conf example

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Use a more up-to-date resources.conf example

It showcases new features such as osmo-trx support, cipher support,
modem features support, etc.

Change-Id: I66bbcd028f03290797c2c467271d0f0982698b47
---
M OsmoGSMTester/chapters/intro.adoc
1 file changed, 59 insertions(+), 32 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/55/4655/1

diff --git a/OsmoGSMTester/chapters/intro.adoc 
b/OsmoGSMTester/chapters/intro.adoc
index e2156df..8c106b7 100644
--- a/OsmoGSMTester/chapters/intro.adoc
+++ b/OsmoGSMTester/chapters/intro.adoc
@@ -218,62 +218,89 @@
 
 
 ip_address:
-- addr: 10.42.42.1
 - addr: 10.42.42.2
 - addr: 10.42.42.3
+- addr: 10.42.42.4
+- addr: 10.42.42.5
+- addr: 10.42.42.6
 
 bts:
 - label: sysmoBTS 1002
   type: osmo-bts-sysmo
+  ipa_unit_id: 1
   addr: 10.42.42.114
   band: GSM-1800
+  ciphers:
+  - a5_0
+  - a5_1
+  - a5_3
 
-- label: octBTS 3000
-  type: osmo-bts-octphy
-  addr: 10.42.42.115
-  band: GSM-1800
-  trx_list:
-  - hw_addr: 00:0c:90:32:b5:8a
-net_device: eth0.2342
-
-- label: Ettus B210
+- label: Ettus B200
   type: osmo-bts-trx
-  addr: 10.42.42.116
+  ipa_unit_id: 6
+  addr: 10.42.42.50
   band: GSM-1800
+  launch_trx: true
+  ciphers:
+  - a5_0
+  - a5_1
 
-- label: nanoBTS 1900
-  type: nanobts
-  addr: 10.42.42.190
-  band: GSM-1900
+- label: sysmoCell 5000
+  type: osmo-bts-trx
+  ipa_unit_id: 7
+  addr: 10.42.42.51
+  band: GSM-1800
+  trx_remote_ip: 10.42.42.112
+  ciphers:
+  - a5_0
+  - a5_1
+
+- label: OCTBTS 3500
+  type: osmo-bts-octphy
+  ipa_unit_id: 8
+  addr: 10.42.42.52
+  band: GSM-1800
   trx_list:
-  - hw_addr: 00:02:95:00:41:b3
+  - hw_addr: 00:0c:90:2e:80:1e
+net_device: eth1
+  - hw_addr: 00:0c:90:2e:87:52
+net_device: eth1
 
 arfcn:
   - arfcn: 512
 band: GSM-1800
   - arfcn: 514
 band: GSM-1800
-
-  - arfcn: 540
+  - arfcn: 516
+band: GSM-1800
+  - arfcn: 546
 band: GSM-1900
-  - arfcn: 542
+  - arfcn: 548
 band: GSM-1900
 
 modem:
-- label: m7801
-  path: '/wavecom_0'
-  imsi: 90170007801
-  ki: D620F48487B1B782DA55DF6717F08FF9
+- label: sierra_1
+  path: '/sierra_1'
+  imsi: '90170009031'
+  ki: '80A37E6FDEA931EAC92FFA5F671EFEAD'
+  auth_algo: 'xor'
+  ciphers:
+  - a5_0
+  - a5_1
+  features:
+  - 'sms'
+  - 'voice'
 
-- label: m7802
-  path: '/wavecom_1'
-  imsi: 90170007802
-  ki: 47FDB2D55CE6A10A85ABDAD034A5B7B3
-
-- label: m7803
-  path: '/wavecom_2'
-  imsi: 90170007803
-  ki: ABBED4C91417DF710F60675B6EE2C8D2
+- label: gobi_0
+  path: '/gobi_0'
+  imsi: '90170009030'
+  ki: 'BB70807226393CDBAC8DD3439FF54252'
+  auth_algo: 'xor'
+  ciphers:
+  - a5_0
+  - a5_1
+  features:
+  - 'sms'
 
 
 === Typical 'suites/*/suite.conf'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I66bbcd028f03290797c2c467271d0f0982698b47
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Explain patchelf is used sometimes to modify ...

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Explain patchelf is used sometimes to modify RPATH

Change-Id: I7bb811bc984c8d576984b038b391cf8130cc465e
---
M OsmoGSMTester/chapters/intro.adoc
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/57/4657/1

diff --git a/OsmoGSMTester/chapters/intro.adoc 
b/OsmoGSMTester/chapters/intro.adoc
index 6e377da..55f1a5e 100644
--- a/OsmoGSMTester/chapters/intro.adoc
+++ b/OsmoGSMTester/chapters/intro.adoc
@@ -385,7 +385,11 @@
 
 Also, the binaries from a trial are never installed system-wide, but are run
 with a specific 'LD_LIBRARY_PATH' pointing at the trial's 'inst', so that
-several trials can run consecutively without conflicting binary versions.
+several trials can run consecutively without conflicting binary versions. For
+some specific binaries which require extra permissions (such as osmo-bts-octphy
+requiring 'CAP_NET_RAW'), 'patchelf' program is used to modify the binary
+'RPATH' field instead because the OS dynamic linker skips 'LD_LIBRARY_PATH' for
+binaries with special permissions.
 
 Once a test suite run is complete, all its reserved resources are torn down (if
 the test scripts have not done so already), and the reservations are released

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7bb811bc984c8d576984b038b391cf8130cc465e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Move TODO comment to a redmine task

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Move TODO comment to a redmine task

Following task has been created: OS#2612

Change-Id: I79837e49f3e6af4254e9f0c7f53037eae66cda6d
---
M OsmoGSMTester/chapters/install.adoc
1 file changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/61/4661/1

diff --git a/OsmoGSMTester/chapters/install.adoc 
b/OsmoGSMTester/chapters/install.adoc
index 5f6f1bc..aaf4d39 100644
--- a/OsmoGSMTester/chapters/install.adoc
+++ b/OsmoGSMTester/chapters/install.adoc
@@ -444,8 +444,6 @@
 your terminal is in turn is picked up in the tcpdump trace, and so forth. When
 testing 'tcpdump' access, make sure to have proper filter expressions in place.
 
-TODO: allow skipping pcaps by configuration if access to tcpdump is not wanted
-
  Allow Core Files
 
 In case a binary run for the test crashes, a core file of the crash should be

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79837e49f3e6af4254e9f0c7f53037eae66cda6d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Improve setup graph

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Improve setup graph

* Add sysmocell5000
* Remove 1 modem, showing 2 of them is enough
* Split osmo-bts-trx from osmo-trx node as sysmocell500 doesn't use the
later.
* Update OsmoNITB node to show we also support split openbsc.git
components.

Change-Id: I893beb114d47edd3f67183dd9ea5acc19462496c
---
M OsmoGSMTester/chapters/intro.adoc
1 file changed, 12 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/51/4651/1

diff --git a/OsmoGSMTester/chapters/intro.adoc 
b/OsmoGSMTester/chapters/intro.adoc
index 50b6dff..557c2f3 100644
--- a/OsmoGSMTester/chapters/intro.adoc
+++ b/OsmoGSMTester/chapters/intro.adoc
@@ -37,14 +37,14 @@
 
modem0 [shape=box label="Modems..."]
modem1 [shape=box label="Modems..."]
-   modem2 [shape=box label="Modems..."]
osmo_bts_sysmo [label="sysmocom sysmoBTS\nrunning 
osmo-bts-sysmo" shape=box]
B200 [label="Ettus B200" shape=box]
+   sysmoCell5K [label="sysmocom sysmoCell5000" shape=box]
octphy [label="Octasic octphy BTS" shape=box]
nanoBTS [label="ip.access nanoBTS" shape=box]
rf_distribution [label="RF distribution"]
 
-   {modem0 modem1 modem2 osmo_bts_sysmo B200 octphy 
nanoBTS}->rf_distribution [dir=both arrowhead="curve" arrowtail="curve"]
+   {modem0 modem1 osmo_bts_sysmo B200 octphy nanoBTS 
sysmoCell5K}->rf_distribution [dir=both arrowhead="curve" arrowtail="curve"]
}
subgraph cluster_main_unit {
  label = "Main Unit"
@@ -52,22 +52,24 @@
  subgraph {
rank=same
ofono [label="ofono daemon"]
-   OsmoNITB
-   osmo_bts_trx [label="osmo-bts-trx\n+ osmo-trx"]
+   osmo_trx [label="osmo-trx"]
+   osmo_bts_trx [label="osmo-bts-trx"]
osmo_bts_octphy [label="osmo-bts-octphy"]
+   OsmoNITB [label="BSC + Core 
Network\n(Osmo{NITB,MSC,BSC,HLR,...})"]
  }
}
 
 
jenkins->osmo_gsm_tester [label="trial\n(binaries)"]
osmo_gsm_tester->jenkins [label="results"]
-   ofono->{modem0 modem1 modem2} [label="USB"]
-   osmo_gsm_tester-> {OsmoNITB osmo_bts_trx osmo_bts_octphy}
-   osmo_gsm_tester-> osmo_bts_sysmo [taillabel="SSH"]
-   osmo_gsm_tester-> ofono [taillabel="DBus"]
-   osmo_bts_trx->B200 [label="USB"]
+   ofono->{modem0 modem1} [label="USB"]
+   osmo_gsm_tester->{OsmoNITB osmo_bts_trx osmo_bts_octphy}
+   osmo_gsm_tester->osmo_bts_sysmo [taillabel="SSH"]
+   osmo_gsm_tester->ofono [taillabel="DBus"]
+   osmo_trx->B200 [label="USB"]
+   osmo_bts_trx->{osmo_trx sysmoCell5K} [dir=both label="UDP"]
osmo_bts_octphy->octphy [label="raw eth"]
-   {osmo_bts_sysmo nanoBTS}->OsmoNITB [label="eth"]
+   {osmo_bts_sysmo nanoBTS}->OsmoNITB [label="IP"]
{B200 octphy}->OsmoNITB [label="eth" style=invis]
{osmo_bts_trx osmo_bts_octphy}->OsmoNITB
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I893beb114d47edd3f67183dd9ea5acc19462496c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OSmoGsmTester: Specify group in Main unit intro

2017-11-02 Thread Pau Espin Pedrol

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

OSmoGsmTester: Specify group in Main unit intro

Change-Id: I132bf7681a1a435c161c4048e41c28dc75c1fa28
---
M OsmoGSMTester/chapters/install.adoc
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/58/4658/1

diff --git a/OsmoGSMTester/chapters/install.adoc 
b/OsmoGSMTester/chapters/install.adoc
index 6eef2fa..8397459 100644
--- a/OsmoGSMTester/chapters/install.adoc
+++ b/OsmoGSMTester/chapters/install.adoc
@@ -4,9 +4,10 @@
 runs the core network components, controls the modems and so on. This can be
 anything from a dedicated production rack unit to your laptop at home.
 
-This manual will assume that tests are run from a jenkins build slave, by a
-user named 'jenkins'. The user configuration for manual test runs and/or a
-different user name is identical, simply replace the user name.
+This manual will assume that tests are run from a jenkins build slave, by a 
user
+named 'jenkins' that belong to group 'osmo-gsm-tester'. The user configuration
+for manual test runs and/or a different user name is identical, simply replace
+the user name or group.
 
 === Dependencies
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I132bf7681a1a435c161c4048e41c28dc75c1fa28
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Update defaults.conf example

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Update defaults.conf example

Change-Id: If12df88b4088ecec6d6cb20c83a693c019b8af4a
---
M OsmoGSMTester/chapters/config.adoc
1 file changed, 31 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/65/4665/1

diff --git a/OsmoGSMTester/chapters/config.adoc 
b/OsmoGSMTester/chapters/config.adoc
index 8176b45..3f8cb44 100644
--- a/OsmoGSMTester/chapters/config.adoc
+++ b/OsmoGSMTester/chapters/config.adoc
@@ -217,31 +217,50 @@
 channel combinations are in fact not resources (only the nitb's interface
 address is). These additional settings may be provided by the scenario
 configurations, but in case the provided scenarios leave some values unset,
-they are taken from this 'defaults.conf'. (A 'scenario.conf' providing a
-similar setting always has precedence over the values given in a
-'defaults.conf').
-
-*TODO* better match this format with 'resources.conf'?
+they are taken from this 'defaults.conf'. (A 'scenario.conf' or a
+'resources.conf' providing a similar setting always has precedence over the
+values given in a 'defaults.conf').
 
 Example of a 'defaults.conf':
 
 
 nitb:
   net:
-mcc: 1
-mnc: 868
-short_name: osmo-gsm-tester
-long_name: osmo-gsm-tester
+mcc: 901
+mnc: 70
+short_name: osmo-gsm-tester-nitb
+long_name: osmo-gsm-tester-nitb
 auth_policy: closed
-encryption: a5 0
+encryption: a5_0
 
-nitb_bts:
+bsc:
+  net:
+mcc: 901
+mnc: 70
+short_name: osmo-gsm-tester-msc
+long_name: osmo-gsm-tester-msc
+auth_policy: closed
+encryption: a5_0
+authentication: optional
+
+msc:
+  net:
+mcc: 901
+mnc: 70
+short_name: osmo-gsm-tester-msc
+long_name: osmo-gsm-tester-msc
+auth_policy: closed
+encryption: a5_0
+authentication: optional
+
+bsc_bts:
   location_area_code: 23
   base_station_id_code: 63
   stream_id: 255
   osmobsc_bts_type: sysmobts
   trx_list:
-  - max_power_red: 22
+  - nominal_power: 23
+max_power_red: 0
 arfcn: 868
 timeslot_list:
 - phys_chan_config: CCCH+SDCCH4
@@ -253,5 +272,3 @@
 - phys_chan_config: TCH/F_TCH/H_PDCH
 - phys_chan_config: TCH/F_TCH/H_PDCH
 
-
-*TODO*: detailed descriptions

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If12df88b4088ecec6d6cb20c83a693c019b8af4a
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Document how to setup main unit to set CAP_NE...

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Document how to setup main unit to set CAP_NET_RAW as
non-root

Change-Id: I011beaa929efcabe9a9dc4f9c7222ba36fa2aae4
---
M OsmoGSMTester/chapters/install.adoc
1 file changed, 30 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/62/4662/1

diff --git a/OsmoGSMTester/chapters/install.adoc 
b/OsmoGSMTester/chapters/install.adoc
index aaf4d39..146dae1 100644
--- a/OsmoGSMTester/chapters/install.adoc
+++ b/OsmoGSMTester/chapters/install.adoc
@@ -486,6 +486,36 @@
 gpasswd -a jenkins usrp
 
 
+ Allow CAP_NET_RAW capability
+
+Certain binaries require 'CAP_NET_RAW' to be set, like 'osmo-bts-octphy' as it
+uses a 'AF_PACKET' socket.
+
+To be able to set the following capability without being root, osmo-gsm-tester
+uses sudo to gain permissions to set the capability.
+
+This is the script that osmo-gsm-tester expects on the main unit:
+
+
+echo /usr/local/bin/osmo-gsm-tester_setcap_net_raw.sh < 
/etc/sudoers.d/osmo-gsm-tester_setcap_net_raw
+chmod 0440 /etc/sudoers.d/osmo-gsm-tester_setcap_net_raw
+
+
+The script file name 'osmo-gsm-tester_setcap_net_raw.sh' is important, as
+osmo-gsm-tester expects to find a script with this name in '$PATH' at run time.
+
+
  Log Rotation
 
 To avoid clogging up /var/log, it makes sense to choose a sane maximum log 
size:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I011beaa929efcabe9a9dc4f9c7222ba36fa2aae4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Remove resolved TODO

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Remove resolved TODO

Change-Id: Ie0f18293e566a690d2434d08cbaaf2fdf71d88e4
---
M OsmoGSMTester/chapters/config.adoc
1 file changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/64/4664/1

diff --git a/OsmoGSMTester/chapters/config.adoc 
b/OsmoGSMTester/chapters/config.adoc
index 335a603..8176b45 100644
--- a/OsmoGSMTester/chapters/config.adoc
+++ b/OsmoGSMTester/chapters/config.adoc
@@ -205,8 +205,6 @@
 - voice:trx+dyn_ts
 
 
-*TODO*: voice is not actually implemented yet
-
 === 'defaults.conf' (optional)
 
 Each binary run by osmo-gsm-tester, e.g. 'osmo-nitb' or 'osmo-bts-sysmo',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0f18293e566a690d2434d08cbaaf2fdf71d88e4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Update resources cfg documentation

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Update resources cfg documentation

Change-Id: I6ec9fc5468ce6ead52d9c8b35d8991cac4bfa97e
---
M OsmoGSMTester/chapters/config.adoc
1 file changed, 38 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/63/4663/1

diff --git a/OsmoGSMTester/chapters/config.adoc 
b/OsmoGSMTester/chapters/config.adoc
index 7c06392..335a603 100644
--- a/OsmoGSMTester/chapters/config.adoc
+++ b/OsmoGSMTester/chapters/config.adoc
@@ -92,9 +92,11 @@
- 'osmo-bts-trx'
- 'osmo-bts-octphy'
- 'ipa-nanobts'
+  'ipa_unit_id':::
+   ip.access unit id to be used by the BTS, written into BTS and BSC 
config.
   'addr':::
-   remote IP address of the BTS, used to start the BTS and tell it where
-   to find the OsmoNITB.
+   Remote IP address of the BTS for BTS like sysmoBTS, and local IP address
+   to bind to for locally run BTS such as osmo-bts-trx.
   'band':::
GSM band that this BTS shoud use (*TODO*: allow multiple bands). One of:
- 'GSM-1800'
@@ -109,8 +111,11 @@
only used for osmo-bts-octphy.  (*TODO*: and nanobts??)
 'net_device'
Local network device to reach the TRX's 'hw_addr' at, only used for
-   osmo-bts-octphy.
-
+   osmo-bts-octphy. Example: 'eth0'.
+'nominal_power'
+   Nominal power to be used by the TRX.
+'max_power_red'
+   Max power reduction to apply to the nominal power of the TRX.
 'arfcn'::
List of ARFCNs to use for running BTSes, which defines the actual RF
frequency bands used.
@@ -118,24 +123,46 @@
ARFCN number, see e.g.
https://en.wikipedia.org/wiki/Absolute_radio-frequency_channel_number
(note that the resource type 'arfcn' contains an item trait also named
-   'arfcn')
+   'arfcn').
   'band':::
GSM band name to use this ARFCN for, same as for 'bts:band' above.
 
 'modem'::
List of modems reachable via ofono and information on the inserted SIM
-   card. (Note: the MSISDN is allocated dynamically in test scripts)
+   card. (Note: the MSISDN is allocated dynamically in test scripts).
   'label':::
-   human readable label for your own reference
+   Human readable label for your own reference, which also appears in logs.
   'path':::
-   ofono's path for this modem, like '/modemkind_99'
+   Ofono's path for this modem, like '/modemkind_99'.
   'imsi':::
-   IMSI of the inserted SIM card, like '"123456789012345"'
+   IMSI of the inserted SIM card, like '"123456789012345"'.
   'ki':::
16 byte authentication/encryption KI of the inserted SIM card, in
hexadecimal notation (32 characters) like +
-   '"00112233445566778899aabbccddeeff"' (*TODO*: authentication algorithm,
-   currently always comp128v1)
+   '"00112233445566778899aabbccddeeff"'.
+  'auth_algo':::
+   Authentication algorithm to be used with the SIM card. One of:
+   - 'none'
+   - 'xor'
+   - 'comp128v1'
+  'ciphers':::
+   List of ciphers that this modem supports, used to match
+   requirements in suites or scenarios. Any combination of:
+   - 'a5_0'
+   - 'a5_1'
+   - 'a5_2'
+   - 'a5_3'
+   - 'a5_4'
+   - 'a5_5'
+   - 'a5_6'
+   - 'a5_7'
+  'features':::
+   List of features that this modem supports, used to match requirements in
+   suites or scenarios. Any combination of:
+   - 'sms'
+   - 'gprs'
+   - 'voice'
+   - 'ussd'
 
 Side note: at first sight it might make sense to the reader to rather structure
 e.g. the 'ip_address' or 'arfcn' configuration as +

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ec9fc5468ce6ead52d9c8b35d8991cac4bfa97e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Add suites_dir section

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Add suites_dir section

Change-Id: Ie25fd742f484981f5e5b25397c2637eda38f0424
---
M OsmoGSMTester/chapters/config.adoc
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/68/4668/1

diff --git a/OsmoGSMTester/chapters/config.adoc 
b/OsmoGSMTester/chapters/config.adoc
index a6a6c16..7aec344 100644
--- a/OsmoGSMTester/chapters/config.adoc
+++ b/OsmoGSMTester/chapters/config.adoc
@@ -58,6 +58,16 @@
 that the 'state_dir' is used to reserve resources, which only works when all
 configurations that share resources also use the same 'state_dir'.
 
+[[suites_dir]]
+ 'suites_dir'
+
+Suites contain a set of tests which are designed to be run together to test a
+set of features given a specific set of resources. As a result, resources are
+allocated per suite and not per test.
+
+Tests for a given suite are located in the form of '.py' python scripts in the
+same directory where the 'suite.conf' lays.
+
 [[scenarios_dir]]
  'scenarios_dir'
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie25fd742f484981f5e5b25397c2637eda38f0424
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGsmTester: Put several permission categories under cat U...

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGsmTester: Put several permission categories under cat User Permission

Change-Id: Ie9f846af0311d768c5dd6f9da572c8f6482f4d39
---
M OsmoGSMTester/chapters/install.adoc
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/70/4670/1

diff --git a/OsmoGSMTester/chapters/install.adoc 
b/OsmoGSMTester/chapters/install.adoc
index 146dae1..d19f909 100644
--- a/OsmoGSMTester/chapters/install.adoc
+++ b/OsmoGSMTester/chapters/install.adoc
@@ -444,7 +444,7 @@
 your terminal is in turn is picked up in the tcpdump trace, and so forth. When
 testing 'tcpdump' access, make sure to have proper filter expressions in place.
 
- Allow Core Files
+= Allow Core Files
 
 In case a binary run for the test crashes, a core file of the crash should be
 written. This requires a limit rule. Create a file with the required rule:
@@ -464,7 +464,7 @@
 sysctl -w kernel.core_pattern=core
 
 
- Allow Realtime Priority
+= Allow Realtime Priority
 
 Certain binaries should be run with real-time priority, like 'osmo-bts-trx'.
 Add this permission on the main unit:
@@ -477,7 +477,7 @@
 Re-login the user to make these changes take effect.
 
 [[user_config_uhd]]
- UHD
+= UHD
 
 Grant permission to use the UHD driver to run USRP devices for osmo-bts-trx, by
 adding the jenkins user to the 'usrp' group:
@@ -486,7 +486,7 @@
 gpasswd -a jenkins usrp
 
 
- Allow CAP_NET_RAW capability
+= Allow CAP_NET_RAW capability
 
 Certain binaries require 'CAP_NET_RAW' to be set, like 'osmo-bts-octphy' as it
 uses a 'AF_PACKET' socket.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie9f846af0311d768c5dd6f9da572c8f6482f4d39
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Improve Trial section content

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Improve Trial section content

Change-Id: I8d74b02166ea33ad9ab7f987894f4f02064fbebc
---
M OsmoGSMTester/chapters/trial.adoc
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/66/4666/1

diff --git a/OsmoGSMTester/chapters/trial.adoc 
b/OsmoGSMTester/chapters/trial.adoc
index 86bf12b..b41b72f 100644
--- a/OsmoGSMTester/chapters/trial.adoc
+++ b/OsmoGSMTester/chapters/trial.adoc
@@ -18,5 +18,12 @@
 
 * the rendered configuration files used to run the binaries
 * stdout and stderr outputs of the binaries
+* pcap files for processes doing relevant network communication
 * a test log
-* *TODO*: jenkins parsable XML reports
+* jenkins parsable XML (Junit) reports
+
+The script in 'contrib/jenkins-run.sh' will take care of related tasks such as
+creating the dir structure and md5 file from the several tar.gz containing the
+software builts before running osmo-gsm-tester. After running it, it clean up
+the extracted files and save extra logs such as journalctl output from ofonod,
+and generate a new .tar.gz file with all the output.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d74b02166ea33ad9ab7f987894f4f02064fbebc
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Add state_dir section

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Add state_dir section

Change-Id: Ie12e3933747a4e698de59ff9ac57281e9f261d3d
---
M OsmoGSMTester/chapters/config.adoc
1 file changed, 22 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/69/4669/1

diff --git a/OsmoGSMTester/chapters/config.adoc 
b/OsmoGSMTester/chapters/config.adoc
index 7aec344..6274a20 100644
--- a/OsmoGSMTester/chapters/config.adoc
+++ b/OsmoGSMTester/chapters/config.adoc
@@ -54,10 +54,32 @@
 scenarios_dir: './scenarios'
 
 
+[[state_dir]]
+ 'state_dir'
+
+It contains global or system-wide state for osmo-gsm-tester. In a typical state
+dir you can find the following files:
+
+'last_used_msisdn.state'::
+   Contains last used msisdn number, which is automatically increased every
+   time osmo-gsm-tester needs to assign a new subscriber in a test.
+'lock'::
+   Lock file used to implement a mutual exclusion zone around the
+   'reserved_resources.state' file.
+'reserved_resources.state'::
+   File containing a set reserved resources by some osmo-gsm-tester
+   instance. Each osmo-gsm-tester instance is responsible to clear its
+   resources from the list once it is done using them and are no longer
+   reserved.
+
 If you would like to set up several separate configurations (not typical), note
 that the 'state_dir' is used to reserve resources, which only works when all
 configurations that share resources also use the same 'state_dir'.
 
+This way, several concurrent users of osmo-gsm-tester (ie. several
+osmo-gsm-tester processes running in parallel) can run without interfering each
+other (e.g. using same ARFCN, same IP or same ofono modem path).
+
 [[suites_dir]]
  'suites_dir'
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie12e3933747a4e698de59ff9ac57281e9f261d3d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-manuals[master]: OsmoGSMTester: Add scenarios_dir section

2017-11-02 Thread Pau Espin Pedrol

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

OsmoGSMTester: Add scenarios_dir section

It explains how scenario combination works

Change-Id: I3f89bd3d71400da14cda7ea8bb9c190fe80a539f
---
M OsmoGSMTester/chapters/config.adoc
1 file changed, 34 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/67/4667/1

diff --git a/OsmoGSMTester/chapters/config.adoc 
b/OsmoGSMTester/chapters/config.adoc
index 3f8cb44..a6a6c16 100644
--- a/OsmoGSMTester/chapters/config.adoc
+++ b/OsmoGSMTester/chapters/config.adoc
@@ -58,6 +58,40 @@
 that the 'state_dir' is used to reserve resources, which only works when all
 configurations that share resources also use the same 'state_dir'.
 
+[[scenarios_dir]]
+ 'scenarios_dir'
+
+Scenarios define contrains that match one-to-one with the resources specified
+in a 'suite.conf' for a specific type of resource after the list is expanded
+taking the 'times' attribute into account. This means, for instance, that given
+'suite.conf' requests 2 BTS and that we want to enforce both to be of type
+'osmo-bts-sysmo', we then need to provide an scenario like the one below:
+
+
+resources:
+  bts:
+  - type: osmo-bts-sysmo
+  - type: osmo-bts-sysmo
+
+
+or alternatively,
+
+
+resources:
+  bts:
+  - times: 2
+type: osmo-bts-sysmo
+
+
+If only one resource is specified in the scenario, then the resource allocator
+assumes the restriction is to be applied to the first resource and that next
+resources have no restrictions to be taken into consideration. If the user 
wants
+to apply no restrictions to the first resource but wants to do so for any of 
the
+other ones, the first element can be listed but left empty in the scenario 
file.
+
+Any number of such scenario configurations can be combined in the form
+':++...', e.g. 'my_suite:sysmo+tch_f+amr'.
+
 [[resources_conf]]
 === 'resources.conf'
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f89bd3d71400da14cda7ea8bb9c190fe80a539f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] libosmocore[master]: Bump version: 0.10.1 → 0.10.2

2017-11-02 Thread Harald Welte

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

Bump version: 0.10.1 → 0.10.2

Change-Id: I88c0d0327fb022b0626ab0feff3f34468b122d4b
---
M debian/changelog
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/71/4671/1

diff --git a/debian/changelog b/debian/changelog
index 6e81256..a50e30b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libosmocore (0.10.2) unstable; urgency=medium
+
+  * Revert "vty: Fix bad use of vector_slot()"
+  * New upstream release of libosmocore
+
+ -- Harald Welte   Thu, 02 Nov 2017 18:51:02 +0100
+
 libosmocore (0.10.1) unstable; urgency=medium
 
   * New upstream release of libosmocore

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

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


libosmocore[master]: Bump version: 0.10.1 → 0.10.2

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] libosmocore[master]: Bump version: 0.10.1 → 0.10.2

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Bump version: 0.10.1 → 0.10.2
..


Bump version: 0.10.1 → 0.10.2

Change-Id: I88c0d0327fb022b0626ab0feff3f34468b122d4b
---
M debian/changelog
1 file changed, 7 insertions(+), 0 deletions(-)

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



diff --git a/debian/changelog b/debian/changelog
index 6e81256..a50e30b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libosmocore (0.10.2) unstable; urgency=medium
+
+  * Revert "vty: Fix bad use of vector_slot()"
+  * New upstream release of libosmocore
+
+ -- Harald Welte   Thu, 02 Nov 2017 18:51:02 +0100
+
 libosmocore (0.10.1) unstable; urgency=medium
 
   * New upstream release of libosmocore

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

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


osmo-gsm-manuals[master]: OsmoGSMTester: Improve setup graph

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-gsm-manuals[master]: OsmoGSMTester: Improve Resource Resolution section content

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-gsm-manuals[master]: OsmoGSMTester: Update trial graph with current data

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-gsm-manuals[master]: OsmoGSMTester: Update sample test script with an AoIP example

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-gsm-manuals[master]: OsmoGSMTester: Update suite.conf example

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-gsm-manuals[master]: OsmoGSMTester: Use a more up-to-date resources.conf example

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+1

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

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


osmo-gsm-manuals[master]: OsmoGSMTester: Add deps required for osmo-bts-octphy support

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-gsm-manuals[master]: OSmoGsmTester: Specify group in Main unit intro

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-gsm-manuals[master]: OsmoGSMTester: Explain patchelf is used sometimes to modify ...

2017-11-02 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] libosmocore[master]: Enable GnuTLS fallback

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Enable GnuTLS fallback
..


Enable GnuTLS fallback

On systems with GNU/Linux kernel older than 3.17 (Debian 8 "jessie" for
example) the osmo_get_rand_id() would always return failure due to
missing getrandom() syscall.

To support such systems, let's add fallback code which uses GnuTLS
library. It can be disabled explicitly via '--disable-gnutls' option at
compile-time, otherwise ./configure will fail if both getrandom() and
GnuTLS are not available. When building with '--enable-embedded' the
fallback is disabled automatically.

Related: OS#1694

Change-Id: Ic77866ce65acf524b768882c751a4f9c0635740b
---
M configure.ac
M src/gsm/Makefile.am
M src/gsm/gsm_utils.c
3 files changed, 36 insertions(+), 5 deletions(-)

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



diff --git a/configure.ac b/configure.ac
index d9390cf..a8c1d2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -130,6 +130,20 @@
 AM_CONDITIONAL(ENABLE_PCSC, test "x$ENABLE_PCSC" = "xyes")
 AC_SUBST(ENABLE_PCSC)
 
+AC_ARG_ENABLE([gnutls], [AS_HELP_STRING([--disable-gnutls], [Do not use GnuTLS 
fallback for missing getrandom()])],
+   [ENABLE_GNUTLS=$enableval], [ENABLE_GNUTLS="yes"])
+AM_CONDITIONAL(ENABLE_GNUTLS, test x"$ENABLE_GNUTLS" = x"yes")
+AS_IF([test "x$ENABLE_GNUTLS" = "xyes"], [
+   PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.12.0])
+])
+AC_SUBST(ENABLE_GNUTLS)
+if test x"$ENABLE_GNUTLS" = x"yes"
+then
+   AC_SUBST([LIBGNUTLS_CFLAGS])
+   AC_SUBST([LIBGNUTLS_LIBS])
+   AC_DEFINE([USE_GNUTLS], [1], [Use GnuTLS as a fallback for missing 
getrandom()])
+fi
+
 AC_ARG_ENABLE(plugin,
[AS_HELP_STRING(
[--disable-plugin],
@@ -228,12 +242,15 @@
AM_CONDITIONAL(ENABLE_PLUGIN, false)
AM_CONDITIONAL(ENABLE_MSGFILE, false)
AM_CONDITIONAL(ENABLE_SERIAL, false)
+   AM_CONDITIONAL(ENABLE_GNUTLS, false)
AM_CONDITIONAL(ENABLE_VTY, false)
AM_CONDITIONAL(ENABLE_CTRL, false)
AM_CONDITIONAL(ENABLE_UTILITIES, false)
AM_CONDITIONAL(ENABLE_GB, false)
+   AM_CONDITIONAL(ENABLE_GNUTLS, false)
AM_CONDITIONAL(ENABLE_PCSC, false)
AM_CONDITIONAL(ENABLE_PSEUDOTALLOC, true)
+   AC_DEFINE([USE_GNUTLS], [0])
AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than 
fprintf/abort])
 fi
 
diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am
index 4476971..12f56db 100644
--- a/src/gsm/Makefile.am
+++ b/src/gsm/Makefile.am
@@ -38,6 +38,11 @@
 libosmogsm_la_LDFLAGS = $(LTLDFLAGS_OSMOGSM) -version-info $(LIBVERSION) 
-no-undefined
 libosmogsm_la_LIBADD = libgsmint.la $(TALLOC_LIBS)
 
+if ENABLE_GNUTLS
+AM_CPPFLAGS += $(LIBGNUTLS_CFLAGS)
+libosmogsm_la_LIBADD += $(LIBGNUTLS_LIBS)
+endif
+
 EXTRA_DIST = libosmogsm.map
 
 # Convolutional codes generation
diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c
index e3f792e..134b475 100644
--- a/src/gsm/gsm_utils.c
+++ b/src/gsm/gsm_utils.c
@@ -106,6 +106,12 @@
 #endif
 #endif
 
+#if (USE_GNUTLS)
+#pragma message ("including GnuTLS for getrandom fallback.")
+#include 
+#include 
+#endif
+
 /* ETSI GSM 03.38 6.2.1 and 6.2.1.1 default alphabet
  * Greek symbols at hex positions 0x10 and 0x12-0x1a
  * left out as they can't be handled with a char and
@@ -409,7 +415,7 @@
  */
 int osmo_get_rand_id(uint8_t *out, size_t len)
 {
-   int rc;
+   int rc = -ENOTSUP;
 
/* this function is intended for generating short identifiers only, not 
arbitrary-length random data */
if (len > OSMO_MAX_RAND_ID_LEN)
@@ -421,13 +427,16 @@
 #pragma message ("Using direct syscall access for getrandom(): consider 
upgrading to glibc >= 2.25")
/* FIXME: this can be removed once we bump glibc requirements to 2.25: 
*/
rc = syscall(SYS_getrandom, out, len, GRND_NONBLOCK);
-#else
-#pragma message ("Secure random unavailable: calls to osmo_get_rand_id() will 
always fail!")
-   return -ENOTSUP;
 #endif
+
/* getrandom() failed entirely: */
-   if (rc < 0)
+   if (rc < 0) {
+#if (USE_GNUTLS)
+#pragma message ("Secure random failed: using GnuTLS fallback.")
+   return gnutls_rnd(GNUTLS_RND_RANDOM, out, len);
+#endif
return -errno;
+   }
 
/* getrandom() failed partially due to signal interruption:
   this should never happen (according to getrandom(2)) as long as 
OSMO_MAX_RAND_ID_LEN < 256

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic77866ce65acf524b768882c751a4f9c0635740b
Gerrit-PatchSet: 10
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 


libosmocore[master]: Enable GnuTLS fallback

2017-11-02 Thread Harald Welte

Patch Set 9: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic77866ce65acf524b768882c751a4f9c0635740b
Gerrit-PatchSet: 9
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


[MERGED] osmo-mgw[master]: cosmetic: make dummy packet handling more explicit

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: cosmetic: make dummy packet handling more explicit
..


cosmetic: make dummy packet handling more explicit

The way how osmo-mgw decides when to send a dummy packet and
when not is not very obvious.

use more explicit if statements, and define constants. Also add
comments that explain how it works.

Change-Id: Ie7ee9409baec50a09fb357d655b5253434fae924
---
M include/osmocom/mgcp/mgcp.h
M src/libosmo-mgcp/mgcp_protocol.c
M src/libosmo-mgcp/mgcp_vty.c
3 files changed, 37 insertions(+), 8 deletions(-)

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



diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h
index 83505a2..59147f0 100644
--- a/include/osmocom/mgcp/mgcp.h
+++ b/include/osmocom/mgcp/mgcp.h
@@ -98,7 +98,17 @@
int last_port;
 };
 
+/* There are up to three modes in which the keep-alive dummy packet can be
+ * sent. The beviour is controlled viw the keepalive_interval member of the
+ * trunk config. If that member is set to 0 (MGCP_KEEPALIVE_NEVER) no dummy-
+ * packet is sent at all and the timer that sends regular dummy packets
+ * is no longer scheduled. If the keepalive_interval is set to -1, only
+ * one dummy packet is sent when an CRCX or an MDCX is performed. No timer
+ * is scheduled. For all vales greater 0, the a timer is scheduled and the
+ * value is used as interval. See also mgcp_keepalive_timer_cb(),
+ * handle_modify_con(), and handle_create_con() */
 #define MGCP_KEEPALIVE_ONCE (-1)
+#define MGCP_KEEPALIVE_NEVER 0
 
 struct mgcp_trunk_config {
struct llist_head entry;
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 9c92c65..4826790 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -666,10 +666,11 @@
if (p->cfg->change_cb)
p->cfg->change_cb(tcfg, ENDPOINT_NUMBER(endp), MGCP_ENDP_CRCX);
 
+   /* Send dummy packet, see also comments in mgcp_keepalive_timer_cb() */
+   OSMO_ASSERT(tcfg->keepalive_interval >= MGCP_KEEPALIVE_ONCE);
if (conn->conn->mode & MGCP_CONN_RECV_ONLY
-   && tcfg->keepalive_interval != 0) {
+   && tcfg->keepalive_interval != MGCP_KEEPALIVE_NEVER)
send_dummy(endp, conn);
-   }
 
LOGP(DLMGCP, LOGL_NOTICE,
 "CRCX: endpoint:%x connection successfully created\n",
@@ -815,8 +816,10 @@
p->cfg->change_cb(endp->tcfg, ENDPOINT_NUMBER(endp),
  MGCP_ENDP_MDCX);
 
-   if (conn->conn->mode & MGCP_CONN_RECV_ONLY &&
-   endp->tcfg->keepalive_interval != 0)
+   /* Send dummy packet, see also comments in mgcp_keepalive_timer_cb() */
+   OSMO_ASSERT(endp->tcfg->keepalive_interval >= MGCP_KEEPALIVE_ONCE);
+   if (conn->conn->mode & MGCP_CONN_RECV_ONLY
+   && endp->tcfg->keepalive_interval != MGCP_KEEPALIVE_NEVER)
send_dummy(endp, conn);
 
if (silent)
@@ -1051,10 +1054,25 @@
struct mgcp_conn *conn;
int i;
 
-   LOGP(DLMGCP, LOGL_DEBUG, "Triggered trunk %d keepalive timer.\n",
+   LOGP(DLMGCP, LOGL_DEBUG, "triggered trunk %d keepalive timer\n",
 tcfg->trunk_nr);
 
-   if (tcfg->keepalive_interval <= 0)
+   /* Do not accept invalid configuration values
+* valid is MGCP_KEEPALIVE_NEVER, MGCP_KEEPALIVE_ONCE and
+* values greater 0 */
+   OSMO_ASSERT(tcfg->keepalive_interval >= MGCP_KEEPALIVE_ONCE);
+
+   /* The dummy packet functionality has been disabled, we will exit
+* immediately, no further timer is scheduled, which means we will no
+* longer send dummy packets even when we did before */
+   if (tcfg->keepalive_interval == MGCP_KEEPALIVE_NEVER)
+   return;
+
+   /* In cases where only one dummy packet is sent, we do not need
+* the timer since the functions that handle the CRCX and MDCX are
+* triggering the sending of the dummy packet. So we behave like in
+* the  MGCP_KEEPALIVE_NEVER case */
+   if (tcfg->keepalive_interval == MGCP_KEEPALIVE_ONCE)
return;
 
/* Send walk over all endpoints and send out dummy packets through
@@ -1067,7 +1085,8 @@
}
}
 
-   LOGP(DLMGCP, LOGL_DEBUG, "Rescheduling trunk %d keepalive timer.\n",
+   /* Schedule the keepalive timer for the next round */
+   LOGP(DLMGCP, LOGL_DEBUG, "rescheduling trunk %d keepalive timer\n",
 tcfg->trunk_nr);
osmo_timer_schedule(&tcfg->keepalive_timer, tcfg->keepalive_interval,
0);
diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c
index e8ad818..7107bcc 100644
--- a/src/libosmo-mgcp/mgcp_vty.c
+++ b/src/libosmo-mgcp/mgcp_vty.c
@@ -569,7 +569,7 @@
   cfg_mgcp_no_rtp_keepalive_cmd,
   "n

[MERGED] osmo-mgw[master]: network: autdetect rtp bind ip-address

2017-11-02 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: network: autdetect rtp bind ip-address
..


network: autdetect rtp bind ip-address

Currently there are two ways to set the rtp bind ip-address (local
ip address where the rtp streams are bound to). It is possible to
set no set an rtp bind ip, if none no address is configured, then
the ip address where the mgcp service is bound to is used.

On a system with multiple network interfaces it is likely that
there are the remote end is not reachable through the interface
that has been configured. In this case rtp ip-probing can be
enabled via vty option in order to automatically detect the
ip address of the interface that points towards the remote end.

The autodetection can only work if the ip-address is known when
a CRCX is performed. For this the remote entity must include the
remote ip address in the sdp trailer.

Implement probing to determine te right local ip address
Add debug log to display which ip address is actually used
Add a VTY option for the probing functionality.

Change-Id: Ia57cf7dab8421fd3ab6e1515727db0080373485e
---
M include/osmocom/mgcp/mgcp.h
M include/osmocom/mgcp/mgcp_internal.h
M src/libosmo-mgcp/mgcp_network.c
M src/libosmo-mgcp/mgcp_protocol.c
M src/libosmo-mgcp/mgcp_vty.c
5 files changed, 97 insertions(+), 20 deletions(-)

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



diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h
index 59147f0..42a91d8 100644
--- a/include/osmocom/mgcp/mgcp.h
+++ b/include/osmocom/mgcp/mgcp.h
@@ -96,6 +96,12 @@
int range_start;
int range_end;
int last_port;
+
+   /* set to true to enable automatic probing
+* of the local bind IP-Address, bind_addr
+* (or its fall back) is used when automatic
+* probing fails */
+   bool bind_addr_probe;
 };
 
 /* There are up to three modes in which the keep-alive dummy packet can be
diff --git a/include/osmocom/mgcp/mgcp_internal.h 
b/include/osmocom/mgcp/mgcp_internal.h
index d4c8dc9..b9c1731 100644
--- a/include/osmocom/mgcp/mgcp_internal.h
+++ b/include/osmocom/mgcp/mgcp_internal.h
@@ -318,12 +318,4 @@
 
 #define PTYPE_UNDEFINED (-1)
 
-/*! get the ip-address where the mgw application is bound on.
- *  \param[in] endp mgcp endpoint, that holds a copy of the VTY parameters
- *  \returns pointer to a string that contains the source ip-address */
-static inline const char *mgcp_net_src_addr(struct mgcp_endpoint *endp)
-{
-   if (endp->cfg->net_ports.bind_addr)
-   return endp->cfg->net_ports.bind_addr;
-   return endp->cfg->source_addr;
-}
+void mgcp_get_local_addr(char *addr, struct mgcp_conn_rtp *conn);
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 3d52d07..7876b33 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -32,6 +32,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -51,6 +52,56 @@
MGCP_PROTO_RTP,
MGCP_PROTO_RTCP,
 };
+
+/*! Determine the local rtp bind IP-address.
+ *  \param[out] addr caller provided memory to store the resulting IP-Address
+ *  \param[in] endp mgcp endpoint, that holds a copy of the VTY parameters
+ *
+ *  The local bind IP-address is automatically selected by probing the
+ *  IP-Address of the interface that is pointing towards the remote IP-Address,
+ *  if no remote IP-Address is known yet, the statically configured
+ *  IP-Addresses are used as fallback. */
+void mgcp_get_local_addr(char *addr, struct mgcp_conn_rtp *conn)
+{
+
+   struct mgcp_endpoint *endp;
+   int rc;
+   endp = conn->conn->endp;
+
+   /* Try probing the local IP-Address */
+   if (endp->cfg->net_ports.bind_addr_probe && conn->end.addr.s_addr != 0) 
{
+   rc = osmo_sock_local_ip(addr, inet_ntoa(conn->end.addr));
+   if (rc < 0)
+   LOGP(DRTP, LOGL_ERROR,
+"endpoint:%x CI:%i local interface auto detection 
failed, using configured addresses...\n",
+ENDPOINT_NUMBER(endp), conn->conn->id);
+   else {
+   LOGP(DRTP, LOGL_DEBUG,
+"endpoint:%x CI:%i selected local rtp bind ip %s 
by probing using remote ip %s\n",
+ENDPOINT_NUMBER(endp), conn->conn->id, addr,
+inet_ntoa(conn->end.addr));
+   return;
+   }
+   }
+
+   /* Select from preconfigured IP-Addresses */
+   if (endp->cfg->net_ports.bind_addr) {
+   /* Check there is a bind IP for the RTP traffic configured,
+* if so, use that IP-Address */
+   strncpy(addr, endp->cfg->net_ports.bind_addr, INET_ADDRSTRLEN);
+   LOGP(DRTP, LOGL_DEBUG,
+"endpoint

osmo-mgw[master]: mgcp client: vty: tweak doc strings

2017-11-02 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie1a408f9e651c5fb3424a84ceaaa603e20ad595c
Gerrit-PatchSet: 2
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] libosmocore[master]: vty: Fix bad use of vector_slot()

2017-11-02 Thread Pau Espin Pedrol

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

vty: Fix bad use of vector_slot()

Commit in e9e9e427b78271941a25a63567fc2ec2bb9e4433 attempted to fix a
compilation warning but introduced a regression documented in OS#2613.

The commit was reverted in 4aa0258269296f078e685e21fb08b115567e814.

After closer lookup and testing, it seems vector_slot(vline, index) is
expected to be NULL in this case as set by vty_complete_command:
/* In case of 'help \t'. */
if (isspace((int)vty->buf[vty->length - 1]))
vector_set(vline, NULL);

As a result, the correct fix for the compilation warning is to test
against NULL instead of testing for empty string.

Change-Id: Id9e02bbf89e0a94e1766b1efd236538712415c8a
---
M src/vty/command.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/4672/1

diff --git a/src/vty/command.c b/src/vty/command.c
index 21b26b4..98d86d2 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -1950,7 +1950,7 @@
 
/* In case of 'command \t' pattern.  Do you need '?' command at
   the end of the line. */
-   if (vector_slot(vline, index) == '\0')
+   if (vector_slot(vline, index) == NULL)
*status = CMD_ERR_NOTHING_TODO;
else
*status = CMD_ERR_NO_MATCH;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9e02bbf89e0a94e1766b1efd236538712415c8a
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


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

2017-11-02 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_9.0/i586

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

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

Last lines of build log:
[  104s] #define STDC_HEADERS 1
[  104s] #define HAVE_EXECINFO_H 1
[  104s] #define HAVE_SYS_SELECT_H 1
[  104s] #define HAVE_SYS_SOCKET_H 1
[  104s] #define HAVE_SYSLOG_H 1
[  104s] #define HAVE_CTYPE_H 1
[  104s] #define HAVE_NETINET_TCP_H 1
[  104s] #define HAVE_ALLOCA_H 1
[  104s] #define HAVE_ALLOCA 1
[  104s] #define HAVE_DECL_SYS_GETRANDOM 1
[  104s] #define HAVE_TM_GMTOFF_IN_TM 1
[  104s] 
[  104s] configure: exit 1
[  104s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu 
--libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking --enable-static returned exit code 1
[  104s] debian/rules:33: recipe for target 'override_dh_auto_configure' failed
[  104s] make[1]: *** [override_dh_auto_configure] Error 2
[  104s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  104s] debian/rules:15: recipe for target 'build' failed
[  104s] make: *** [build] Error 2
[  104s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  104s] 
[  104s] lamb10 failed "build libosmocore_0.10.2.20171102.dsc" at Thu Nov  2 
19:52:47 UTC 2017.
[  104s] 
[  104s] ### VM INTERACTION START ###
[  107s] [   99.851838] reboot: Power down
[  107s] ### VM INTERACTION END ###
[  107s] 
[  107s] lamb10 failed "build libosmocore_0.10.2.20171102.dsc" at Thu Nov  2 
19:52:50 UTC 2017.
[  107s] 

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


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

2017-11-02 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.10/x86_64

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

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

Last lines of build log:
[  103s] #define STDC_HEADERS 1
[  103s] #define HAVE_EXECINFO_H 1
[  103s] #define HAVE_SYS_SELECT_H 1
[  103s] #define HAVE_SYS_SOCKET_H 1
[  103s] #define HAVE_SYSLOG_H 1
[  103s] #define HAVE_CTYPE_H 1
[  103s] #define HAVE_NETINET_TCP_H 1
[  103s] #define HAVE_ALLOCA_H 1
[  103s] #define HAVE_ALLOCA 1
[  103s] #define HAVE_DECL_SYS_GETRANDOM 1
[  103s] #define HAVE_TM_GMTOFF_IN_TM 1
[  103s] 
[  103s] configure: exit 1
[  103s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr 
--includedir=\${prefix}/include --mandir=\${prefix}/share/man 
--infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu 
--libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking --enable-static returned exit code 1
[  103s] debian/rules:33: recipe for target 'override_dh_auto_configure' failed
[  103s] make[1]: *** [override_dh_auto_configure] Error 2
[  103s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  103s] debian/rules:15: recipe for target 'build' failed
[  103s] make: *** [build] Error 2
[  103s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  103s] 
[  103s] lamb21 failed "build libosmocore_0.10.2.20171102.dsc" at Thu Nov  2 
19:53:10 UTC 2017.
[  103s] 
[  103s] ### VM INTERACTION START ###
[  107s] [   99.447941] reboot: Power down
[  107s] ### VM INTERACTION END ###
[  107s] 
[  107s] lamb21 failed "build libosmocore_0.10.2.20171102.dsc" at Thu Nov  2 
19:53:14 UTC 2017.
[  107s] 

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


Build failure of network:osmocom:nightly/libosmocore in Debian_8.0/i586

2017-11-02 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_8.0/i586

Package network:osmocom:nightly/libosmocore failed to build in Debian_8.0/i586

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

Last lines of build log:
[   84s] #define HAVE_SYS_SELECT_H 1
[   84s] #define HAVE_SYS_SOCKET_H 1
[   84s] #define HAVE_SYSLOG_H 1
[   84s] #define HAVE_CTYPE_H 1
[   84s] #define HAVE_NETINET_TCP_H 1
[   84s] #define HAVE_ALLOCA_H 1
[   84s] #define HAVE_ALLOCA 1
[   84s] #define HAVE_DECL_SYS_GETRANDOM 0
[   84s] #define HAVE_TM_GMTOFF_IN_TM 1
[   84s] 
[   84s] configure: exit 1
[   84s] dh_auto_configure: ./configure --build=i586-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386[   
78.116015] serial8250: too much work for irq4
[   84s] -linux-gnu --disable-maintainer-mode --disable-dependency-tracking 
--enable-static returned exit code 1
[   84s] debian/rules:33: recipe for target 'override_dh_auto_configure' failed
[   84s] make[1]: *** [override_dh_auto_configure] Error 255
[   84s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[   84s] debian/rules:15: recipe for target 'build' failed
[   84s] make: *** [build] Error 2
[   84s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[   84s] 
[   84s] build70 failed "build libosmocore_0.10.2.20171102.dsc" at Thu Nov  2 
19:52:25 UTC 2017.
[   84s] 
[   84s] ### VM INTERACTION START ###
[   85s] Powering off.
[   85s] [   79.184040] reboot: Power down
[   85s] ### VM INTERACTION END ###
[   85s] 
[   85s] build70 failed "build libosmocore_0.10.2.20171102.dsc" at Thu Nov  2 
19:52:27 UTC 2017.
[   85s] 

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


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

2017-11-02 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.10/x86_64

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

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

Last lines of build log:
[  123s] #define STDC_HEADERS 1
[  123s] #define HAVE_EXECINFO_H 1
[  123s] #define HAVE_SYS_SELECT_H 1
[  123s] #define HAVE_SYS_SOCKET_H 1
[  123s] #define HAVE_SYSLOG_H 1
[  123s] #define HAVE_CTYPE_H 1
[  123s] #define HAVE_NETINET_TCP_H 1
[  123s] #define HAVE_ALLOCA_H 1
[  123s] #define HAVE_ALLOCA 1
[  123s] #define HAVE_DECL_SYS_GETRANDOM 1
[  123s] #define HAVE_TM_GMTOFF_IN_TM 1
[  123s] 
[  123s] configure: exit 1
[  123s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu 
--libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking --enable-static returned exit code 1
[  123s] debian/rules:33: recipe for target 'override_dh_auto_configure' failed
[  123s] make[1]: *** [override_dh_auto_configure] Error 2
[  123s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  123s] debian/rules:15: recipe for target 'build' failed
[  123s] make: *** [build] Error 2
[  123s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  123s] 
[  123s] cloud115 failed "build libosmocore_0.10.2.20171102.dsc" at Thu Nov  2 
19:53:25 UTC 2017.
[  123s] 
[  123s] ### VM INTERACTION START ###
[  126s] [  105.341658] reboot: Power down
[  128s] ### VM INTERACTION END ###
[  128s] 
[  128s] cloud115 failed "build libosmocore_0.10.2.20171102.dsc" at Thu Nov  2 
19:53:31 UTC 2017.
[  128s] 

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


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

2017-11-02 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/Debian_8.0/x86_64

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

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

Last lines of build log:
[  144s] #define HAVE_EXECINFO_H 1
[  144s] #define HAVE_SYS_SELECT_H 1
[  144s] #define HAVE_SYS_SOCKET_H 1
[  144s] #define HAVE_SYSLOG_H 1
[  144s] #define HAVE_CTYPE_H 1
[  144s] #define HAVE_NETINET_TCP_H 1
[  144s] #define HAVE_ALLOCA_H 1
[  144s] #define HAVE_ALLOCA 1
[  144s] #define HAVE_DECL_SYS_GETRANDOM 0
[  144s] #define HAVE_TM_GMTOFF_IN_TM 1
[  144s] 
[  144s] configure: exit 1
[  144s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--libdir=${prefix}/lib/x86_64-linux-gnu 
--libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking --enable-static returned exit code 1
[  144s] debian/rules:33: recipe for target 'override_dh_auto_configure' failed
[  144s] make[1]: *** [override_dh_auto_configure] Error 255
[  144s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  144s] debian/rules:15: recipe for target 'build' failed
[  144s] make: *** [build] Error 2
[  144s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  144s] 
[  144s] build36 failed "build libosmocore_0.10.2.20171102.dsc" at Thu Nov  2 
19:53:27 UTC 2017.
[  144s] 
[  144s] ### VM INTERACTION START ###
[  145s] Powering off.
[  145s] [  135.553223] reboot: Power down
[  146s] ### VM INTERACTION END ###
[  146s] 
[  146s] build36 failed "build libosmocore_0.10.2.20171102.dsc" at Thu Nov  2 
19:53:30 UTC 2017.
[  146s] 

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


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

2017-11-02 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.04/x86_64

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

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

Last lines of build log:
[  133s] #define STDC_HEADERS 1
[  133s] #define HAVE_EXECINFO_H 1
[  133s] #define HAVE_SYS_SELECT_H 1
[  133s] #define HAVE_SYS_SOCKET_H 1
[  133s] #define HAVE_SYSLOG_H 1
[  133s] #define HAVE_CTYPE_H 1
[  133s] #define HAVE_NETINET_TCP_H 1
[  133s] #define HAVE_ALLOCA_H 1
[  133s] #define HAVE_ALLOCA 1
[  133s] #define HAVE_DECL_SYS_GETRANDOM 1
[  133s] #define HAVE_TM_GMTOFF_IN_TM 1
[  133s] 
[  133s] configure: exit 1
[  133s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr 
--includedir=${prefix}/include --mandir=${prefix}/share/man 
--infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu 
--libexecdir=${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking --enable-static returned exit code 1
[  133s] debian/rules:33: recipe for target 'override_dh_auto_configure' failed
[  133s] make[1]: *** [override_dh_auto_configure] Error 2
[  133s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  133s] debian/rules:15: recipe for target 'build' failed
[  133s] make: *** [build] Error 2
[  133s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  133s] 
[  133s] lamb06 failed "build libosmocore_0.10.2.20171102.dsc" at Thu Nov  2 
19:53:35 UTC 2017.
[  133s] 
[  133s] ### VM INTERACTION START ###
[  136s] [  127.151418] reboot: Power down
[  136s] ### VM INTERACTION END ###
[  136s] 
[  136s] lamb06 failed "build libosmocore_0.10.2.20171102.dsc" at Thu Nov  2 
19:53:39 UTC 2017.
[  136s] 

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


  1   2   >