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

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

Change subject: octphy: override firmware version check
..


octphy: override firmware version check

When osmo-bts detects a mismatch between the firmware of the DSP
and the header version which it was compile with, a hard exit
is performed. In some cases this may hinder debugging/testing things.

Implement a commandline option to intentinally override the check.

Change-Id: I5774fbb29da832786326afb991014b9bd8b04b59
---
M src/osmo-bts-octphy/l1_oml.c
M src/osmo-bts-octphy/main.c
2 files changed, 24 insertions(+), 4 deletions(-)

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



diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index d1d5bf6..a1c384a 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -52,6 +52,8 @@
 #include 
 #include 
 
+bool no_fw_check = 0;
+
 /* Map OSMOCOM logical channel type to OctPHY Logical channel type */
 static tOCTVC1_GSM_LOGICAL_CHANNEL_COMBINATION_ENUM 
pchan_to_logChComb[_GSM_PCHAN_MAX] =
 {
@@ -1161,11 +1163,23 @@
 "Rx APP-INFO.resp (name='%s', desc='%s', ver='%s', 
ver_hdr='%s')\n",
 air->szName, air->szDescription, air->szVersion, ver_hdr);
 
-   /* Bail if dsp firmware does not match up the header version info */
+   /* Check if the firmware version of the DSP matches the header files
+* that were used to compile osmo-bts */
if (strcmp(air->szVersion, ver_hdr) != 0) {
LOGP(DL1C, LOGL_ERROR,
-"Invalid header-file / dsp-firmware combination, 
exiting...\n");
-   exit(1);
+"Invalid header-file-version / dsp-firmware-version 
combination\n");
+   LOGP(DL1C, LOGL_ERROR,
+"Expected firmware version: %s\n", ver_hdr);
+   LOGP(DL1C, LOGL_ERROR,
+"Actual firmware version:   %s\n", air->szVersion);
+
+   if (!no_fw_check) {
+   LOGP(DL1C, LOGL_ERROR,
+"use option -I to override the check (not 
recommened)\n");
+   LOGP(DL1C, LOGL_ERROR,
+"exiting...\n");
+   exit(1);
+   }
}
 
talloc_replace(fl1h->info.app.name, fl1h, air->szName);
diff --git a/src/osmo-bts-octphy/main.c b/src/osmo-bts-octphy/main.c
index 0f4d0dd..928a4c8 100644
--- a/src/osmo-bts-octphy/main.c
+++ b/src/osmo-bts-octphy/main.c
@@ -51,9 +51,11 @@
 #define RF_LOCK_PATH   "/var/lock/bts_rf_lock"
 
 extern int pcu_direct;
+extern bool no_fw_check;
 
 int bts_model_print_help()
 {
+   printf("  -I--no-fw-check   Override firmware version check\n");
return 0;
 }
 
@@ -65,15 +67,19 @@
int option_idx = 0, c;
static const struct option long_options[] = {
/* specific to this hardware */
+   { "no-fw-check", 0, 0, 'I' },
{ 0, 0, 0, 0 }
};
 
-   c = getopt_long(argc, argv, "",
+   c = getopt_long(argc, argv, "I",
long_options, _idx);
if (c == -1)
break;
 
switch (c) {
+   case 'I':
+   no_fw_check = true;
+   break;
default:
num_errors++;
break;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5774fbb29da832786326afb991014b9bd8b04b59
Gerrit-PatchSet: 5
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 


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

2017-11-07 Thread Harald Welte

Patch Set 4: Code-Review+2

-- 
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: 4
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


[MERGED] libosmo-sccp[master]: sccp vty: be fatal for addressbook entry errors

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

Change subject: sccp vty: be fatal for addressbook entry errors
..


sccp vty: be fatal for addressbook entry errors

So far, the config would log an error upon config parsing, and then continue to
use defaults, which is super easy to miss. On errors, return CMD_ERR_INCOMPLETE
to abort the program in a config parsing error.

Be fatal for re-using an already defined addressbook entry in another cs7
instance, and for having a too long addressbook entry name.

Though it is mixing in cosmetic changes, add "Error:" to the output and arrange
the erratic name to the end of the message, as is customary for error messages.

Related: osmo-bsc Ia4e58902a2d3757b266cf35ac89f256cfb8f0eec
Change-Id: I2f71b9c4dd30f919d2054da81283dd7035f44f60
---
M src/osmo_ss7_vty.c
1 file changed, 6 insertions(+), 5 deletions(-)

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



diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 2c3d78e..890fec8 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -1246,8 +1246,9 @@
const char *name = argv[0];
 
if (strlen(name) >= sizeof(entry->name)) {
-   vty_out(vty, "sccp address name to long!%s", VTY_NEWLINE);
-   return CMD_WARNING;
+   vty_out(vty, "Error: SCCP address name to long: '%s'%s",
+   name, VTY_NEWLINE);
+   return CMD_ERR_INCOMPLETE;
}
 
/* Ensure that we do not use address names that
@@ -1255,9 +1256,9 @@
entry = addr_entry_by_name_global(name);
if (entry != NULL) {
vty_out(vty,
-   "address name (%s) already used in ss7 instance %u%s",
-   entry->name, entry->inst->cfg.id, VTY_NEWLINE);
-   return CMD_WARNING;
+   "Error: SCCP address name already used in ss7 instance 
%u: '%s'%s",
+   entry->inst->cfg.id, entry->name, VTY_NEWLINE);
+   return CMD_ERR_INCOMPLETE;
}
 
entry = addr_entry_by_name_local(name, inst);

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

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


[MERGED] libosmo-sccp[master]: add osmo_sccp_inst_addr_name(), a variant of osmo_sccp_addr_...

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

Change subject: add osmo_sccp_inst_addr_name(), a variant of 
osmo_sccp_addr_name()
..


add osmo_sccp_inst_addr_name(), a variant of osmo_sccp_addr_name()

It can be cumbersome to derive the ss7 instance needed to pass to
sccp_addr_name(), because struct osmo_sccp_instance is opaque and only
available in sccp_internal.h, within libosmo-sccp.

Add osmo_sccp_inst_addr_name() which derives the ss7 instance from the internal
knowledge of the osmo_sccp_instance struct. This can save calls to
osmo_ss7_instance_find() just to do some logging of an sccp address.

Naming: first I thought to pick osmo_sccp_addr_name2(), but for some of the
string composing functions, adding a 2 already means that it is identical but
using a second static buffer (to be used twice within the same printf).

Change-Id: I70ec5c8b42682a23f11a5820431c7e34e225709b
---
M include/osmocom/sigtran/sccp_helpers.h
M src/sccp_helpers.c
2 files changed, 8 insertions(+), 0 deletions(-)

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



diff --git a/include/osmocom/sigtran/sccp_helpers.h 
b/include/osmocom/sigtran/sccp_helpers.h
index c2175f4..3ef7740 100644
--- a/include/osmocom/sigtran/sccp_helpers.h
+++ b/include/osmocom/sigtran/sccp_helpers.h
@@ -55,3 +55,4 @@
 char *osmo_sccp_gt_dump(const struct osmo_sccp_gt *gt);
 char *osmo_sccp_addr_dump(const struct osmo_sccp_addr *addr);
 char *osmo_sccp_addr_name(const struct osmo_ss7_instance *ss7, const struct 
osmo_sccp_addr *addr);
+char *osmo_sccp_inst_addr_name(const struct osmo_sccp_instance *sccp, const 
struct osmo_sccp_addr *addr);
diff --git a/src/sccp_helpers.c b/src/sccp_helpers.c
index 4b24392..f752e2a 100644
--- a/src/sccp_helpers.c
+++ b/src/sccp_helpers.c
@@ -324,3 +324,10 @@
 
return buf;
 }
+
+/* Derive ss7 from the sccp instance and call osmo_sccp_addr_name() with that.
+ * If sccp is passed as NULL, simply use the default point code format. */
+char *osmo_sccp_inst_addr_name(const struct osmo_sccp_instance *sccp, const 
struct osmo_sccp_addr *addr)
+{
+   return osmo_sccp_addr_name(sccp? sccp->ss7 : NULL, addr);
+}

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

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


libosmo-sccp[master]: add osmo_sccp_inst_addr_name(), a variant of osmo_sccp_addr_...

2017-11-07 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


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

2017-11-07 Thread Harald Welte

Patch Set 1:

As we already screwed up with the first attempt to merge a fix, I would rather 
not want to touch this code again unless we have a test case.

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

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


osmo-bsc[master]: osmo-bsc vty: be fatal for addressbook entry errors

2017-11-07 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bsc[master]: osmo-bsc: SCCP addrs: default only if unset, reject invalid

2017-11-07 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bsc[master]: osmo-bsc RESET FSM: use distinct struct names

2017-11-07 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I986377a74ccd83ca3b52e7f058bbc9115f05f741
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
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


osmo-msc[master]: examples: apply mgcp_client vty rename from 'mgcpgw' to 'mgw'

2017-11-07 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


[MERGED] libosmocore[master]: vty: deprecate now empty node commands

2017-11-07 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: vty: deprecate now empty node commands
..


vty: deprecate now empty node commands

Following I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b a deprecation of
vty_install_default() and install_default() commands is indicated.

However, compiler warnings may clutter build output or even fail strict builds,
hence I am submitting the deprecation in a separate patch.

Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b
Change-Id: Icf5d83f641e838ceb635a043e94ba352abff
---
M include/osmocom/vty/command.h
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h
index 8fbdb7b..13d6e89 100644
--- a/include/osmocom/vty/command.h
+++ b/include/osmocom/vty/command.h
@@ -360,12 +360,12 @@
 
 /* Prototypes. */
 void install_node(struct cmd_node *, int (*)(struct vty *));
-void install_default(int node_type);
+void install_default(int node_type) OSMO_DEPRECATED("Now happens implicitly 
with install_node()");
 void install_element(int node_type, struct cmd_element *);
 void install_element_ve(struct cmd_element *cmd);
 void sort_node(void);
 
-void vty_install_default(int node_type);
+void vty_install_default(int node_type) OSMO_DEPRECATED("Now happens 
implicitly with install_node()");
 
 /* Concatenates argv[shift] through argv[argc-1] into a single NUL-terminated
string with a space between each element (allocated using

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

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


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

2017-11-07 Thread Neels Hofmeyr

Patch Set 1: Code-Review+1

(2 comments)

https://gerrit.osmocom.org/#/c/4669/1/OsmoGSMTester/chapters/config.adoc
File OsmoGSMTester/chapters/config.adoc:

Line 70:File containing a set reserved resources by some osmo-gsm-tester
add 'of' or remove 'a set'. s/some .. instance/any number of osmo-gsm-tester 
instances/


Line 80: osmo-gsm-tester processes running in parallel) can run without 
interfering each
with each other


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie12e3933747a4e698de59ff9ac57281e9f261d3d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: Yes


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

2017-11-07 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

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


osmo-gsm-tester[master]: Remove unused file bts_model.py

2017-11-07 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

wow, what! gasp

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

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


osmo-gsm-tester[master]: test.py: Remove unused parameter ofono_client in setup()

2017-11-07 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

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


osmo-gsm-tester[master]: Rename module ofono_client as modem

2017-11-07 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

finally :)

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

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


osmo-gsm-tester[master]: modem: Improve handling of errors in dbus_call_dismiss_error

2017-11-07 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

I have no idea what this is doing, but it looks like you do

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

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


osmo-ci[master]: osmo-deps.sh: Force fetching git tags

2017-11-07 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

Pau, if you've verified that it works, add a V+1 vote and go ahead...

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I4bfe4846959c70e435d6792a755a6f2a6f0a932c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: lynxis lazus 
Gerrit-HasComments: No


osmo-gsm-tester[master]: Use unique incrementing value for BTS LAC

2017-11-07 Thread Neels Hofmeyr

Patch Set 3: Code-Review+2

(1 comment)

https://gerrit.osmocom.org/#/c/4704/3/src/osmo_gsm_tester/schema.py
File src/osmo_gsm_tester/schema.py:

Line 74: def uint16(val):
(at some point, you know with those 65534 etc, it might be more useful to have 
a validator function returned as lambda from passed-in min,max range ... for 
now it's fine)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9f864bac05e39ec2fc305f774194799c3d8fe1b0
Gerrit-PatchSet: 3
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: Yes


osmo-gsm-tester[master]: resource: Refactor next_msisdn to be more generic

2017-11-07 Thread Neels Hofmeyr

Patch Set 2: Code-Review+2

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

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


osmo-gsm-tester[master]: Use unique incrementing value for BTS CellId

2017-11-07 Thread Neels Hofmeyr

Patch Set 2: Code-Review+2

(1 comment)

https://gerrit.osmocom.org/#/c/4706/2/src/osmo_gsm_tester/suite.py
File src/osmo_gsm_tester/suite.py:

Line 378: return lac
(add a blank line)


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

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


osmocom-bb[master]: vty: skip installing cmds now always installed by default

2017-11-07 Thread Neels Hofmeyr

Patch Set 1:

I'm not sure enough to merge. Can you verbally confirm that this is actually 
correct without updating a libosmocore contained within?

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

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


[MERGED] openbsc[master]: vty: skip installing cmds now always installed by default

2017-11-07 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: vty: skip installing cmds now always installed by default
..


vty: skip installing cmds now always installed by default

vty_install_default() and install_default() will soon be deprecated.

Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b
Change-Id: I4951982fc78ae167d8e16a672d7af44d703721a9
---
0 files changed, 0 insertions(+), 0 deletions(-)

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4951982fc78ae167d8e16a672d7af44d703721a9
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[PATCH] osmo-bsc[master]: osmo-bsc RESET FSM: use distinct struct names

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

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

https://gerrit.osmocom.org/4375

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

osmo-bsc RESET FSM: use distinct struct names

Use distinctive struct names: s/fsm_/fsm_bsc_reset/. They only exist
in the static context and it works fine, but the mad fsm-to-dot.py script
breaks with identical struct names. Can't hurt to have unique names.

Change-Id: I986377a74ccd83ca3b52e7f058bbc9115f05f741
---
M src/osmo-bsc/osmo_bsc_reset.c
1 file changed, 10 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/75/4375/2

diff --git a/src/osmo-bsc/osmo_bsc_reset.c b/src/osmo-bsc/osmo_bsc_reset.c
index aadbd86..e482a44 100644
--- a/src/osmo-bsc/osmo_bsc_reset.c
+++ b/src/osmo-bsc/osmo_bsc_reset.c
@@ -33,24 +33,24 @@
 #define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number 
*/
 #define BAD_CONNECTION_THRESOLD 3  /* connection failures */
 
-enum fsm_states {
+enum fsm_bsc_reset_states {
ST_DISC,/* Disconnected from MSC */
ST_CONN,/* We have a confirmed connection to the MSC */
 };
 
-static const struct value_string fsm_state_names[] = {
+static const struct value_string fsm_bsc_reset_state_names[] = {
{ST_DISC, "ST_DISC (disconnected)"},
{ST_CONN, "ST_CONN (connected)"},
{0, NULL},
 };
 
-enum fsm_evt {
+enum fsm_bsc_reset_evt {
EV_RESET_ACK,   /* got reset acknowlegement from the MSC */
EV_N_DISCONNECT,/* lost a connection */
EV_N_CONNECT,   /* made a successful connection */
 };
 
-static const struct value_string fsm_evt_names[] = {
+static const struct value_string fsm_bsc_reset_evt_names[] = {
{EV_RESET_ACK, "EV_RESET_ACK"},
{EV_N_DISCONNECT, "EV_N_DISCONNECT"},
{EV_N_CONNECT, "EV_N_CONNECT"},
@@ -63,7 +63,7 @@
struct bsc_msc_data *msc = (struct bsc_msc_data *)data;
 
LOGP(DMSC, LOGL_NOTICE, "fsm-state (msc-reset): %s, fsm-event: %s, MSC 
No.: %i\n",
-get_value_string(fsm_state_names, ST_DISC), 
get_value_string(fsm_evt_names, event), msc->nr);
+get_value_string(fsm_bsc_reset_state_names, ST_DISC), 
get_value_string(fsm_bsc_reset_evt_names, event), msc->nr);
msc->msc_con->msc_conn_loss_count = 0;
osmo_fsm_inst_state_chg(fi, ST_CONN, 0, 0);
 }
@@ -74,7 +74,7 @@
struct bsc_msc_data *msc = (struct bsc_msc_data *)data;
 
LOGP(DMSC, LOGL_NOTICE, "fsm-state (msc-reset): %s, fsm-event: %s, MSC 
No.: %i\n",
-get_value_string(fsm_state_names, ST_CONN), 
get_value_string(fsm_evt_names, event), msc->nr);
+get_value_string(fsm_bsc_reset_state_names, ST_CONN), 
get_value_string(fsm_bsc_reset_evt_names, event), msc->nr);
 
OSMO_ASSERT(msc);
 
@@ -98,7 +98,7 @@
struct bsc_msc_data *msc = (struct bsc_msc_data *)fi->priv;
 
LOGP(DMSC, LOGL_NOTICE, "reset-ack timeout (T%i) in state %s, MSC No.: 
%i, resending...\n", fi->T,
-get_value_string(fsm_state_names, fi->state), msc->nr);
+get_value_string(fsm_bsc_reset_state_names, fi->state), msc->nr);
 
osmo_bsc_sigtran_reset(msc);
osmo_bsc_sigtran_tx_reset(msc);
@@ -107,7 +107,7 @@
return 0;
 }
 
-static struct osmo_fsm_state fsm_states[] = {
+static struct osmo_fsm_state fsm_bsc_reset_states[] = {
[ST_DISC] = {
 .in_event_mask = (1 << EV_RESET_ACK),
 .out_state_mask = (1 << ST_DISC) | (1 << ST_CONN),
@@ -125,8 +125,8 @@
 /* State machine definition */
 static struct osmo_fsm fsm = {
.name = "A-CONNECTION",
-   .states = fsm_states,
-   .num_states = ARRAY_SIZE(fsm_states),
+   .states = fsm_bsc_reset_states,
+   .num_states = ARRAY_SIZE(fsm_bsc_reset_states),
.log_subsys = DMSC,
.timer_cb = fsm_reset_ack_timeout_cb,
 };

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I986377a74ccd83ca3b52e7f058bbc9115f05f741
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: dexter 


[PATCH] osmo-bsc[master]: use osmo_sccp_inst_addr_name() instead of looking up ss7

2017-11-07 Thread Neels Hofmeyr

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

use osmo_sccp_inst_addr_name() instead of looking up ss7

Depends: libosmo-sccp I70ec5c8b42682a23f11a5820431c7e34e225709b
Change-Id: Idb451597c724ac87a391121cebd0b0a927dd49d1
---
M src/osmo-bsc/osmo_bsc_sigtran.c
1 file changed, 4 insertions(+), 8 deletions(-)


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

diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index 253f1e8..a18d4f3 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -516,8 +516,7 @@
if (!osmo_sccp_check_addr(>a.bsc_addr, 
OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC)) {
LOGP(DMSC, LOGL_ERROR,
 "(%s) A-interface: invalid local (BSC) SCCP 
address: %s\n",
-msc_name,
-
osmo_sccp_addr_name(osmo_ss7_instance_find(msc->a.cs7_instance), 
>a.bsc_addr));
+msc_name, osmo_sccp_inst_addr_name(msc->a.sccp, 
>a.bsc_addr));
return -EINVAL;
}
 
@@ -530,17 +529,14 @@
if (!osmo_sccp_check_addr(>a.msc_addr, 
OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC)) {
LOGP(DMSC, LOGL_ERROR,
 "(%s) A-interface: invalid remote (MSC) SCCP 
address: %s\n",
-msc_name,
-
osmo_sccp_addr_name(osmo_ss7_instance_find(msc->a.cs7_instance), 
>a.msc_addr));
+msc_name, osmo_sccp_inst_addr_name(msc->a.sccp, 
>a.msc_addr));
return -EINVAL;
}
 
LOGP(DMSC, LOGL_NOTICE, "(%s) A-interface: local (BSC) SCCP 
address: %s\n",
-msc_name,
-
osmo_sccp_addr_name(osmo_ss7_instance_find(msc->a.cs7_instance), 
>a.bsc_addr));
+msc_name, osmo_sccp_inst_addr_name(msc->a.sccp, 
>a.bsc_addr));
LOGP(DMSC, LOGL_NOTICE, "(%s) A-interface: remote (MSC) SCCP 
address: %s\n",
-msc_name,
-
osmo_sccp_addr_name(osmo_ss7_instance_find(msc->a.cs7_instance), 
>a.msc_addr));
+msc_name, osmo_sccp_inst_addr_name(msc->a.sccp, 
>a.msc_addr));
 
/* Bind SCCP user */
msc->a.sccp_user = osmo_sccp_user_bind(msc->a.sccp, msc_name, 
sccp_sap_up, msc->a.bsc_addr.ssn);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb451597c724ac87a391121cebd0b0a927dd49d1
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-bsc[master]: osmo-bsc: SCCP addrs: default only if unset, reject invalid

2017-11-07 Thread Neels Hofmeyr

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

osmo-bsc: SCCP addrs: default only if unset, reject invalid

So far, if the user entered an invalid SCCP address in the config, the
osmo_bsc_sigtran_init() code simply replaced that with the default, i.e.
running with a completely different address than the user may intend.

Use the default SCCP addresses only when they are unset by the user.

Default MSC addr: set directly, do not detour via cs7 instance PC. The default
MSC SCCP addr is just a point code + SSN, deriving it from the cs7 instance
first is a confusing step. Just set the PC and SSN, and done.

Using default addresses does not constitute an "auto configuration": if we set
up a cs7 instance automatically, we do not want to have to create a second one
automatically, to prevent "auto-confusion", and want to bail instead. But for
each MSC on its own, using default SCCP addresses makes sense and is orthogonal
to automatic cs7 instance creation. Hence drop the auto config semantics from
the default SCCP address parts.

Always validate the SCCP addresses we will end up using, and bail immediately
if they are erratic. i.e. don't overwrite a non-empty invalid SCCP address with
defaults, but straight bail.

Beneficial side effects:
- Fix some grammar ultra confusion in log messages.
- Add context: log the MSC number the logging refers to.
- Drop code dup: since we're always logging the used SCCP addresses, might as
  well log those once, unconditionally, in the end.

Change-Id: Iadbc2e9740457e1b389b7e7ad9c94274e7d8cb11
---
M src/osmo-bsc/osmo_bsc_sigtran.c
1 file changed, 25 insertions(+), 32 deletions(-)


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

diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index 2ba777e..253f1e8 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -509,46 +509,39 @@
if (!msc->a.sccp)
return -EINVAL;
 
-   /* Check if the sccp-address fullfills minimum requirements 
(SSN+PC is present,
-* automatically recover addresses if the addresses are not set 
up properly) */
-   if (!osmo_sccp_check_addr(>a.bsc_addr, 
OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC)) {
-   if (fail_on_next_invalid_cfg)
-   goto fail_auto_cofiguration;
-   free_attempt_used = true;
-
-   LOGP(DMSC, LOGL_NOTICE,
-"A-interface: invalid or missing local (BSC) SCCP 
address (a.bsc_addr=%s)\n",
-
osmo_sccp_addr_name(osmo_ss7_instance_find(msc->a.cs7_instance), 
>a.bsc_addr));
+   /* If unset, use default local SCCP address */
+   if (!msc->a.bsc_addr.presence)
osmo_sccp_local_addr_by_instance(>a.bsc_addr, 
msc->a.sccp, SCCP_SSN_BSSAP);
-   LOGP(DMSC, LOGL_NOTICE,
-"A-interface: using automatically generated local 
(BSC) SCCP address (a.bsc_addr=%s)\n",
+
+   if (!osmo_sccp_check_addr(>a.bsc_addr, 
OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC)) {
+   LOGP(DMSC, LOGL_ERROR,
+"(%s) A-interface: invalid local (BSC) SCCP 
address: %s\n",
+msc_name,
 
osmo_sccp_addr_name(osmo_ss7_instance_find(msc->a.cs7_instance), 
>a.bsc_addr));
-   } else {
-   LOGP(DMSC, LOGL_NOTICE,
-"A-interface: using local (BSC) automatically SCCP 
address (a.msc_addr=%s)\n",
-
osmo_sccp_addr_name(osmo_ss7_instance_find(msc->a.cs7_instance), 
>a.bsc_addr));
+   return -EINVAL;
}
+
+   /* If unset, use default SCCP address for the MSC */
+   if (!msc->a.msc_addr.presence)
+   osmo_sccp_make_addr_pc_ssn(>a.msc_addr,
+  
osmo_ss7_pointcode_parse(NULL, MSC_DEFAULT_PC),
+  SCCP_SSN_BSSAP);
 
if (!osmo_sccp_check_addr(>a.msc_addr, 
OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC)) {
-   if (fail_on_next_invalid_cfg)
-   goto fail_auto_cofiguration;
-   free_attempt_used = true;
-
-   LOGP(DMSC, LOGL_NOTICE,
-"A-interface: invalid or missing remote (MSC) SCCP 
address for the MSC (a.msc_addr=%s)\n",
+   LOGP(DMSC, LOGL_ERROR,
+"(%s) A-interface: invalid remote (MSC) SCCP 
address: %s\n",
+msc_name,
 
osmo_sccp_addr_name(osmo_ss7_instance_find(msc->a.cs7_instance), 
>a.msc_addr));
-   osmo_sccp_local_addr_by_instance(>a.msc_addr, 

[PATCH] osmo-bsc[master]: osmo-bsc vty: be fatal for addressbook entry errors

2017-11-07 Thread Neels Hofmeyr

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

osmo-bsc vty: be fatal for addressbook entry errors

So far, the config would log an error upon config parsing, and then continue to
use defaults, which is super easy to miss. On errors, return CMD_ERR_INCOMPLETE
to abort the program in a config parsing error.

Be fatal for non-existing addressbook entries and for using address book
entries from mismatching cs7 instances.

Though it is mixing in cosmetic changes, add "Error:" to the output and arrange
the erratic name to the end of the message, as is customary for error messages.

Related: libosmo-sccp I2f71b9c4dd30f919d2054da81283dd7035f44f60
Change-Id: Ia4e58902a2d3757b266cf35ac89f256cfb8f0eec
---
M src/osmo-bsc/osmo_bsc_vty.c
1 file changed, 8 insertions(+), 10 deletions(-)


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

diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c
index ca47097..0003cfa 100644
--- a/src/osmo-bsc/osmo_bsc_vty.c
+++ b/src/osmo-bsc/osmo_bsc_vty.c
@@ -724,18 +724,17 @@
 
ss7 = osmo_sccp_addr_by_name(>a.bsc_addr, bsc_addr_name);
if (!ss7) {
-   vty_out(vty, "No sccp address %s found%s", bsc_addr_name,
-   VTY_NEWLINE);
-   return CMD_WARNING;
+   vty_out(vty, "Error: No such SCCP addressbook entry: '%s'%s", 
bsc_addr_name, VTY_NEWLINE);
+   return CMD_ERR_INCOMPLETE;
}
 
/* Prevent mixing addresses from different CS7/SS7 instances */
if (msc->a.cs7_instance_valid) {
if (msc->a.cs7_instance != ss7->cfg.id) {
vty_out(vty,
-   "SCCP address %s from different CS7 instance%s",
+   "Error: SCCP addressbook entry from mismatching 
CS7 instance: '%s'%s",
bsc_addr_name, VTY_NEWLINE);
-   return CMD_WARNING;
+   return CMD_ERR_INCOMPLETE;
}
}
 
@@ -757,18 +756,17 @@
 
ss7 = osmo_sccp_addr_by_name(>a.msc_addr, msc_addr_name);
if (!ss7) {
-   vty_out(vty, "No sccp address %s found%s", msc_addr_name,
-   VTY_NEWLINE);
-   return CMD_WARNING;
+   vty_out(vty, "Error: No such SCCP addressbook entry: '%s'%s", 
msc_addr_name, VTY_NEWLINE);
+   return CMD_ERR_INCOMPLETE;
}
 
/* Prevent mixing addresses from different CS7/SS7 instances */
if (msc->a.cs7_instance_valid) {
if (msc->a.cs7_instance != ss7->cfg.id) {
vty_out(vty,
-   "SCCP address %s from different CS7 instance%s",
+   "Error: SCCP addressbook entry from mismatching 
CS7 instance: '%s'%s",
msc_addr_name, VTY_NEWLINE);
-   return CMD_WARNING;
+   return CMD_ERR_INCOMPLETE;
}
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4e58902a2d3757b266cf35ac89f256cfb8f0eec
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] libosmo-sccp[master]: sccp vty: be fatal for addressbook entry errors

2017-11-07 Thread Neels Hofmeyr

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

sccp vty: be fatal for addressbook entry errors

So far, the config would log an error upon config parsing, and then continue to
use defaults, which is super easy to miss. On errors, return CMD_ERR_INCOMPLETE
to abort the program in a config parsing error.

Be fatal for re-using an already defined addressbook entry in another cs7
instance, and for having a too long addressbook entry name.

Though it is mixing in cosmetic changes, add "Error:" to the output and arrange
the erratic name to the end of the message, as is customary for error messages.

Related: osmo-bsc Ia4e58902a2d3757b266cf35ac89f256cfb8f0eec
Change-Id: I2f71b9c4dd30f919d2054da81283dd7035f44f60
---
M src/osmo_ss7_vty.c
1 file changed, 6 insertions(+), 5 deletions(-)


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

diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 2c3d78e..890fec8 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -1246,8 +1246,9 @@
const char *name = argv[0];
 
if (strlen(name) >= sizeof(entry->name)) {
-   vty_out(vty, "sccp address name to long!%s", VTY_NEWLINE);
-   return CMD_WARNING;
+   vty_out(vty, "Error: SCCP address name to long: '%s'%s",
+   name, VTY_NEWLINE);
+   return CMD_ERR_INCOMPLETE;
}
 
/* Ensure that we do not use address names that
@@ -1255,9 +1256,9 @@
entry = addr_entry_by_name_global(name);
if (entry != NULL) {
vty_out(vty,
-   "address name (%s) already used in ss7 instance %u%s",
-   entry->name, entry->inst->cfg.id, VTY_NEWLINE);
-   return CMD_WARNING;
+   "Error: SCCP address name already used in ss7 instance 
%u: '%s'%s",
+   entry->inst->cfg.id, entry->name, VTY_NEWLINE);
+   return CMD_ERR_INCOMPLETE;
}
 
entry = addr_entry_by_name_local(name, inst);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f71b9c4dd30f919d2054da81283dd7035f44f60
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[MERGED] osmo-hlr[master]: vty: skip installing cmds now always installed by default

2017-11-07 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: vty: skip installing cmds now always installed by default
..


vty: skip installing cmds now always installed by default

vty_install_default() and install_default() will soon be deprecated.

Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b
Change-Id: I09762f110c7bcaf85c0ef2f472eb43ac543c74e9
---
M src/hlr_vty.c
1 file changed, 0 insertions(+), 2 deletions(-)

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



diff --git a/src/hlr_vty.c b/src/hlr_vty.c
index a5eb26f..202f7f7 100644
--- a/src/hlr_vty.c
+++ b/src/hlr_vty.c
@@ -129,11 +129,9 @@
 
install_element(CONFIG_NODE, _hlr_cmd);
install_node(_node, config_write_hlr);
-   install_default(HLR_NODE);
 
install_element(HLR_NODE, _gsup_cmd);
install_node(_node, config_write_hlr_gsup);
-   install_default(GSUP_NODE);
 
install_element(GSUP_NODE, _hlr_gsup_bind_ip_cmd);
 

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

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


[MERGED] osmo-hlr[master]: hlr_db_tool: fix error log strerror invocation

2017-11-07 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: hlr_db_tool: fix error log strerror invocation
..


hlr_db_tool: fix error log strerror invocation

The db API returns negative errno values, need to flip the sign before feeding
to strerror.

Fixes: coverity CID#178658
Change-Id: Iaab46f565a1112d8a7def8ea90a5cd440c0a3b41
---
M src/hlr_db_tool.c
1 file changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/src/hlr_db_tool.c b/src/hlr_db_tool.c
index 8982739..eb82c92 100644
--- a/src/hlr_db_tool.c
+++ b/src/hlr_db_tool.c
@@ -284,12 +284,12 @@
snprintf(imsi_str, sizeof(imsi_str), "%"PRId64, imsi);
 
rc = db_subscr_create(dbc, imsi_str);
-   if (rc) {
+   if (rc < 0) {
LOGP(DDB, LOGL_ERROR, "OsmoNITB DB import to %s: failed to 
create IMSI %s: %d: %s\n",
 dbc->fname,
 imsi_str,
 rc,
-strerror(rc));
+strerror(-rc));
/* on error, still attempt to continue */
}
 
@@ -303,13 +303,13 @@
 
/* find the just created id */
rc = db_subscr_get_by_imsi(dbc, imsi_str, );
-   if (rc) {
+   if (rc < 0) {
LOGP(DDB, LOGL_ERROR, "OsmoNITB DB import to %s: created IMSI 
%s,"
 " but failed to get new subscriber id: %d: %s\n",
 dbc->fname,
 imsi_str,
 rc,
-strerror(rc));
+strerror(-rc));
return;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaab46f565a1112d8a7def8ea90a5cd440c0a3b41
Gerrit-PatchSet: 2
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[MERGED] osmo-iuh[master]: vty: skip installing cmds now always installed by default

2017-11-07 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: vty: skip installing cmds now always installed by default
..


vty: skip installing cmds now always installed by default

vty_install_default() and install_default() will soon be deprecated.

Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b
Change-Id: I61b79f633d36814b53e40f1a92b5847c9ff4fde0
---
M src/hnbgw_vty.c
M src/tests/hnb-test.c
2 files changed, 0 insertions(+), 5 deletions(-)

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



diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c
index ddea578..f504dd5 100644
--- a/src/hnbgw_vty.c
+++ b/src/hnbgw_vty.c
@@ -268,11 +268,9 @@
 
install_element(CONFIG_NODE, _hnbgw_cmd);
install_node(_node, config_write_hnbgw);
-   vty_install_default(HNBGW_NODE);
 
install_element(HNBGW_NODE, _hnbgw_iuh_cmd);
install_node(_node, config_write_hnbgw_iuh);
-   vty_install_default(IUH_NODE);
 
install_element(IUH_NODE, _hnbgw_iuh_local_ip_cmd);
install_element(IUH_NODE, _hnbgw_iuh_local_port_cmd);
@@ -280,13 +278,11 @@
 
install_element(HNBGW_NODE, _hnbgw_iucs_cmd);
install_node(_node, config_write_hnbgw_iucs);
-   vty_install_default(IUCS_NODE);
 
install_element(IUCS_NODE, _hnbgw_iucs_remote_addr_cmd);
 
install_element(HNBGW_NODE, _hnbgw_iups_cmd);
install_node(_node, config_write_hnbgw_iups);
-   vty_install_default(IUPS_NODE);
 
install_element(IUPS_NODE, _hnbgw_iups_remote_addr_cmd);
 
diff --git a/src/tests/hnb-test.c b/src/tests/hnb-test.c
index 68a3117..32f4ba8 100644
--- a/src/tests/hnb-test.c
+++ b/src/tests/hnb-test.c
@@ -904,7 +904,6 @@
install_element_ve(_cmd);
 
install_node(_node, NULL);
-   vty_install_default(CHAN_NODE);
 }
 
 static void handle_options(int argc, char **argv)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I61b79f633d36814b53e40f1a92b5847c9ff4fde0
Gerrit-PatchSet: 2
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[PATCH] libosmo-sccp[master]: add osmo_sccp_inst_addr_name(), a variant of osmo_sccp_addr_...

2017-11-07 Thread Neels Hofmeyr

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

add osmo_sccp_inst_addr_name(), a variant of osmo_sccp_addr_name()

It can be cumbersome to derive the ss7 instance needed to pass to
sccp_addr_name(), because struct osmo_sccp_instance is opaque and only
available in sccp_internal.h, within libosmo-sccp.

Add osmo_sccp_inst_addr_name() which derives the ss7 instance from the internal
knowledge of the osmo_sccp_instance struct. This can save calls to
osmo_ss7_instance_find() just to do some logging of an sccp address.

Naming: first I thought to pick osmo_sccp_addr_name2(), but for some of the
string composing functions, adding a 2 already means that it is identical but
using a second static buffer (to be used twice within the same printf).

Change-Id: I70ec5c8b42682a23f11a5820431c7e34e225709b
---
M include/osmocom/sigtran/sccp_helpers.h
M src/sccp_helpers.c
2 files changed, 8 insertions(+), 0 deletions(-)


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

diff --git a/include/osmocom/sigtran/sccp_helpers.h 
b/include/osmocom/sigtran/sccp_helpers.h
index c2175f4..3ef7740 100644
--- a/include/osmocom/sigtran/sccp_helpers.h
+++ b/include/osmocom/sigtran/sccp_helpers.h
@@ -55,3 +55,4 @@
 char *osmo_sccp_gt_dump(const struct osmo_sccp_gt *gt);
 char *osmo_sccp_addr_dump(const struct osmo_sccp_addr *addr);
 char *osmo_sccp_addr_name(const struct osmo_ss7_instance *ss7, const struct 
osmo_sccp_addr *addr);
+char *osmo_sccp_inst_addr_name(const struct osmo_sccp_instance *sccp, const 
struct osmo_sccp_addr *addr);
diff --git a/src/sccp_helpers.c b/src/sccp_helpers.c
index 4b24392..f752e2a 100644
--- a/src/sccp_helpers.c
+++ b/src/sccp_helpers.c
@@ -324,3 +324,10 @@
 
return buf;
 }
+
+/* Derive ss7 from the sccp instance and call osmo_sccp_addr_name() with that.
+ * If sccp is passed as NULL, simply use the default point code format. */
+char *osmo_sccp_inst_addr_name(const struct osmo_sccp_instance *sccp, const 
struct osmo_sccp_addr *addr)
+{
+   return osmo_sccp_addr_name(sccp? sccp->ss7 : NULL, addr);
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I70ec5c8b42682a23f11a5820431c7e34e225709b
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


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

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

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

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

Last lines of build log:
[  247s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02
[  247s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02
[  247s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00
[  247s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22
[  247s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33
[  247s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00
[  247s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00
[  247s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22
[  247s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33
[  247s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00
[  247s] -Success
[  247s] ./testsuite.at:69: exit code was 132, expected 0
[  247s] 11. testsuite.at:66: 11. coding (testsuite.at:66): FAILED 
(testsuite.at:69)
[  247s] debian/rules:26: recipe for target 'override_dh_auto_test' failed
[  247s] make[1]: *** [override_dh_auto_test] Error 1
[  247s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  247s] debian/rules:15: recipe for target 'build' failed
[  247s] make: *** [build] Error 2
[  247s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  247s] 
[  247s] build36 failed "build libosmocore_0.10.2.dsc" at Wed Nov  8 01:02:06 
UTC 2017.
[  247s] 
[  247s] ### VM INTERACTION START ###
[  248s] Powering off.
[  248s] [  239.561579] reboot: Power down
[  249s] ### VM INTERACTION END ###
[  249s] 
[  249s] build36 failed "build libosmocore_0.10.2.dsc" at Wed Nov  8 01:02:09 
UTC 2017.
[  249s] 

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


[MERGED] osmo-bsc[master]: fix build: bssap test broke by undefined references

2017-11-07 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: fix build: bssap test broke by undefined references
..


fix build: bssap test broke by undefined references

After the bssap test in Ie934c5d229140a89763bf2efff86d6a3766cd351, the
subsequent commit Ia2882b7ca31a3219c676986e85045fa08a425d7a was not tested
against the latest head, and its breaking bssap_test was not caught.

Fix current master of osmo-bsc's 'make check' target: add osmo_bsc_mgcp.c and
libosmo-mgcp-client dependencies to bssap_test linkage.

Change-Id: I28719d267452f66d65581c43433e24a9f46cf7dc
---
M tests/bssap/Makefile.am
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/tests/bssap/Makefile.am b/tests/bssap/Makefile.am
index 80d655f..4bbe9ea 100644
--- a/tests/bssap/Makefile.am
+++ b/tests/bssap/Makefile.am
@@ -11,6 +11,7 @@
$(LIBOSMOABIS_CFLAGS) \
$(LIBOSMOSIGTRAN_CFLAGS) \
$(COVERAGE_CFLAGS) \
+   $(LIBOSMOMGCPCLIENT_CFLAGS) \
$(NULL)
 
 EXTRA_DIST = \
@@ -28,6 +29,7 @@
$(top_srcdir)/src/osmo-bsc/osmo_bsc_sigtran.c \
$(top_srcdir)/src/osmo-bsc/osmo_bsc_filter.c \
$(top_srcdir)/src/osmo-bsc/osmo_bsc_grace.c \
+   $(top_srcdir)/src/osmo-bsc/osmo_bsc_mgcp.c \
$(NULL)
 
 bssap_test_LDADD = \
@@ -39,6 +41,7 @@
$(LIBOSMOGSM_LIBS) \
$(LIBOSMOABIS_LIBS) \
$(LIBOSMOSIGTRAN_LIBS) \
+   $(LIBOSMOMGCPCLIENT_LIBS) \
$(NULL)
 
 bssap_test_LDFLAGS = \

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I28719d267452f66d65581c43433e24a9f46cf7dc
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


osmo-bsc[master]: fix build: bssap test broke by undefined references

2017-11-07 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

again fast tracking to prevent build fallout ... I hope I'm doing the right 
thing here, let me know if we need to revert some of these fast track merges.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I28719d267452f66d65581c43433e24a9f46cf7dc
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[PATCH] osmo-bsc[master]: fix build: bssap test broke by undefined references

2017-11-07 Thread Neels Hofmeyr

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

fix build: bssap test broke by undefined references

After the bssap test in Ie934c5d229140a89763bf2efff86d6a3766cd351, the
subsequent commit Ia2882b7ca31a3219c676986e85045fa08a425d7a was not tested
against the latest head, and its breaking bssap_test was not caught.

Fix current master of osmo-bsc's 'make check' target: add osmo_bsc_mgcp.c and
libosmo-mgcp-client dependencies to bssap_test linkage.

Change-Id: I28719d267452f66d65581c43433e24a9f46cf7dc
---
M tests/bssap/Makefile.am
1 file changed, 3 insertions(+), 0 deletions(-)


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

diff --git a/tests/bssap/Makefile.am b/tests/bssap/Makefile.am
index 80d655f..4bbe9ea 100644
--- a/tests/bssap/Makefile.am
+++ b/tests/bssap/Makefile.am
@@ -11,6 +11,7 @@
$(LIBOSMOABIS_CFLAGS) \
$(LIBOSMOSIGTRAN_CFLAGS) \
$(COVERAGE_CFLAGS) \
+   $(LIBOSMOMGCPCLIENT_CFLAGS) \
$(NULL)
 
 EXTRA_DIST = \
@@ -28,6 +29,7 @@
$(top_srcdir)/src/osmo-bsc/osmo_bsc_sigtran.c \
$(top_srcdir)/src/osmo-bsc/osmo_bsc_filter.c \
$(top_srcdir)/src/osmo-bsc/osmo_bsc_grace.c \
+   $(top_srcdir)/src/osmo-bsc/osmo_bsc_mgcp.c \
$(NULL)
 
 bssap_test_LDADD = \
@@ -39,6 +41,7 @@
$(LIBOSMOGSM_LIBS) \
$(LIBOSMOABIS_LIBS) \
$(LIBOSMOSIGTRAN_LIBS) \
+   $(LIBOSMOMGCPCLIENT_LIBS) \
$(NULL)
 
 bssap_test_LDFLAGS = \

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I28719d267452f66d65581c43433e24a9f46cf7dc
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[ABANDON] osmo-bsc[master]: osmo-bsc MGCP FSM: catch all unexpected events

2017-11-07 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: osmo-bsc MGCP FSM: catch all unexpected events
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I2aea11c476aa91ed5d508ec443ca7c992bda52d9
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 


[MERGED] osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams

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

Change subject: mgcp: use osmo-mgw to switch RTP streams
..


mgcp: use osmo-mgw to switch RTP streams

osmo-bsc currently negotiates the RTP stream directly with the
BTS and reports back the RTP IP/Port on the BTS. This works fine
for a single BTS, but for Handover the port/ip pointing to the
MSC side must not change, so an entity in between the BTSs and
the MSC is required.

Integrate the mgcp-client and use osmo-mgw to switch the RTP
streams.

Depends: osmo-mgw Ib5fcc72775bf72b489ff79ade36fb345d8d20736
Depends: osmo-mgw I44b338b09de45e1675cedf9737fa72dde72e979a
Depends: osmo-mgw I29c5e2fb972896faeb771ba040f015592487fcbe

Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a
---
M configure.ac
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/osmo_bsc.h
A include/osmocom/bsc/osmo_bsc_mgcp.h
M src/Makefile.am
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/osmo_bsc_audio.c
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_main.c
A src/osmo-bsc/osmo_bsc_mgcp.c
M src/osmo-bsc/osmo_bsc_sigtran.c
M src/osmo-bsc/osmo_bsc_vty.c
13 files changed, 1,324 insertions(+), 67 deletions(-)

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



diff --git a/configure.ac b/configure.ac
index 02a81c6..4ec903a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,8 +47,9 @@
 PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0)
 PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.8.0)
 PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5)
-PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1)
 PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
+PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0)
+PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 1.0.0)
 
 dnl checks for header files
 AC_HEADER_STDC
@@ -135,7 +136,6 @@
 src/libfilter/Makefile
 src/libcommon-cs/Makefile
 src/osmo-bsc/Makefile
-src/osmo-bsc_nat/Makefile
 src/ipaccess/Makefile
 src/utils/Makefile
 tests/Makefile
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index 8ad2b5d..1f7cd39 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -41,6 +41,7 @@
openbscdefines.h \
osmo_bsc.h \
osmo_bsc_grace.h \
+   osmo_bsc_mgcp.h \
osmo_bsc_rf.h \
osmo_bsc_sigtran.h \
bsc_msc_data.h \
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 74298b8..b9427b8 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -479,6 +479,11 @@
uint8_t t3212;
 
struct {
+   struct mgcp_client_conf *conf;
+   struct mgcp_client *client;
+   } mgw;
+
+   struct {
/* CS7 instance id number (set via VTY) */
uint32_t cs7_instance;
/* A list with the context information about
diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h
index 5ebea50..8a5cd30 100644
--- a/include/osmocom/bsc/osmo_bsc.h
+++ b/include/osmocom/bsc/osmo_bsc.h
@@ -29,6 +29,20 @@
uint32_t rtp_ip;
int rtp_port;
 
+   /* RTP address of the remote end (assigned by MSC through assignment
+* request) */
+   struct sockaddr_storage aoip_rtp_addr_remote;
+
+   /* Local RTP address (reported back to the MSC by us with the
+* assignment complete message) */
+   struct sockaddr_storage aoip_rtp_addr_local;
+
+   /* storage to keep states of the MGCP connection handler, the
+* handler is created when an assignment request is received
+* and is terminated when the assignment complete message is
+* sent */
+   struct mgcp_ctx *mgcp_ctx;
+
/* for advanced ping/pong */
int send_ping;
 
@@ -72,4 +86,6 @@
 
 struct llist_head *bsc_access_lists(void);
 
+int bssmap_send_aoip_ass_compl(struct gsm_lchan *lchan);
+
 #endif
diff --git a/include/osmocom/bsc/osmo_bsc_mgcp.h 
b/include/osmocom/bsc/osmo_bsc_mgcp.h
new file mode 100644
index 000..ddcba0f
--- /dev/null
+++ b/include/osmocom/bsc/osmo_bsc_mgcp.h
@@ -0,0 +1,48 @@
+/* (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 

osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams

2017-11-07 Thread Harald Welte

Patch Set 14: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a
Gerrit-PatchSet: 14
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: dexter 
Gerrit-HasComments: No


osmo-iuh[master]: vty: skip installing cmds now always installed by default

2017-11-07 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


openbsc[master]: vty: skip installing cmds now always installed by default

2017-11-07 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-hlr[master]: vty: skip installing cmds now always installed by default

2017-11-07 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-sip-connector[master]: mncc.c: Ensure proper string buffer NUL termination

2017-11-07 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2f58a495f60ed744c1f625dc8df56aa4dc0aa4cb
Gerrit-PatchSet: 1
Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-sip-connector[master]: mncc.c: Ensure proper string buffer NUL termination

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

Change subject: mncc.c: Ensure proper string buffer NUL termination
..


mncc.c: Ensure proper string buffer NUL termination

Change-Id: I2f58a495f60ed744c1f625dc8df56aa4dc0aa4cb
Fixes: Coverity CID#92223
---
M src/mncc.c
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/src/mncc.c b/src/mncc.c
index 669a80c..45c062f 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -738,7 +738,7 @@
mncc.fields |= MNCC_F_CALLING;
mncc.calling.plan = 1;
mncc.calling.type = 0x0;
-   strncpy(mncc.calling.number, call->source, sizeof(mncc.calling.number));
+   osmo_strlcpy(mncc.calling.number, call->source, 
sizeof(mncc.calling.number));
 
if (conn->app->use_imsi_as_id) {
snprintf(mncc.imsi, 15, "%s", call->dest);
@@ -746,7 +746,7 @@
mncc.fields |= MNCC_F_CALLED;
mncc.called.plan = 1;
mncc.called.type = 0x0;
-   strncpy(mncc.called.number, call->dest, 
sizeof(mncc.called.number));
+   osmo_strlcpy(mncc.called.number, call->dest, 
sizeof(mncc.called.number));
}
 
/*

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2f58a495f60ed744c1f625dc8df56aa4dc0aa4cb
Gerrit-PatchSet: 2
Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-mgw[master]: cosmetic: guard dead coded with ifdef

2017-11-07 Thread Harald Welte

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/4712/1//COMMIT_MSG
Commit Message:

Line 15: This fixes CID 178648
syntax


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

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


osmo-mgw[master]: osmux: fix nullpointer dereference

2017-11-07 Thread Harald Welte

Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/#/c/4711/1//COMMIT_MSG
Commit Message:

Line 15: This fixes CID 178662
syntax


https://gerrit.osmocom.org/#/c/4711/1/src/libosmo-mgcp/mgcp_osmux.c
File src/libosmo-mgcp/mgcp_osmux.c:

Line 213:   this = NULL;
one could simply initialize 'this' to NULL in the variable declaration and save 
the 'else' clauses here. Not overly important.


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

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


osmo-mgw[master]: network: remove unused return code

2017-11-07 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


[PATCH] osmo-mgw[master]: network: remove unused return code

2017-11-07 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/4710

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

network: remove unused return code

The function that forwards the tapped (voice ebug) traffic returns
its status (sendto) to the caller. However, none of the callers
seem need this info.

Remove the return code and print an error message on failure

Fixes: Coverity CID#178666
Change-Id: I16c12c4565bccbc0d75c412b43469bf70b6b7ea5
---
M src/libosmo-mgcp/mgcp_network.c
1 file changed, 12 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/10/4710/2

diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 7876b33..947b87e 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -627,14 +627,20 @@
 
 /* Forward data to a debug tap. This is debug function that is intended for
  * debugging the voice traffic with tools like gstreamer */
-static int forward_data(int fd, struct mgcp_rtp_tap *tap, const char *buf,
-   int len)
+static void forward_data(int fd, struct mgcp_rtp_tap *tap, const char *buf,
+int len)
 {
-   if (!tap->enabled)
-   return 0;
+   int rc;
 
-   return sendto(fd, buf, len, 0,
- (struct sockaddr *)>forward, sizeof(tap->forward));
+   if (!tap->enabled)
+   return;
+
+   rc = sendto(fd, buf, len, 0, (struct sockaddr *)>forward,
+   sizeof(tap->forward));
+
+   if (rc < 0)
+   LOGP(DRTP, LOGL_ERROR,
+"Forwarding tapped (debug) voice data failed.\n");
 }
 
 /*! Send RTP/RTCP data to a specified destination connection.

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I16c12c4565bccbc0d75c412b43469bf70b6b7ea5
Gerrit-PatchSet: 2
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-mgw[master]: network: remove unused return code

2017-11-07 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmocom-bb[master]: mobile/gsm322.c: replace memset() by simple for-loop

2017-11-07 Thread Harald Welte

Patch Set 2: Code-Review+2

(1 comment)

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

Line 326:   for (i = 0; i < value && i < sizeof(bar) - 1; i++)
you could just as well simply compute the length of the interval as a positive 
integer and then call memset() on that. But hey, we don't need to optimize here.


-- 
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: 2
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: Yes


osmocom-bb[master]: host/mobile: use osmocom_ms as talloc context

2017-11-07 Thread Harald Welte

Patch Set 5: Code-Review-2

(1 comment)

https://gerrit.osmocom.org/#/c/2668/5//COMMIT_MSG
Commit Message:

Line 1: Parent: d30eebaf (mobile/gsm322.c: replace memset() by simple 
for-loop)
I think you have uploaded an unrelated patch with the same Change-Id as another 
patch.  Please fix this up.  Also, why would we want to replace memset?


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0d5fcbdd77fe41d78cfe54731dd2ebfc4171f62c
Gerrit-PatchSet: 5
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: Yes


osmo-gsm-tester[master]: Use unique incrementing value for BTS CellId

2017-11-07 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


osmo-gsm-tester[master]: modem: Fallback to automatic registration if manual one is n...

2017-11-07 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibc322317db634a5380573de88a56eb53fd92e67b
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-HasComments: No


osmo-ci[master]: osmo-deps.sh: Force fetching git tags

2017-11-07 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-hlr[master]: hlr_db_tool: fix error log strerror invocation

2017-11-07 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-hlr[master]: cosmetic: add comment on ignored return value

2017-11-07 Thread Harald Welte

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/4715/1/src/db.c
File src/db.c:

Line 104:* during sqlite3_step(). */
there is a way to tell coverity fo ignore this: Put "coverity[CHECKED_RETURN]" 
in this comment.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I64ac8c148f48be60f9c0d346df0c5152bb527494
Gerrit-PatchSet: 1
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: Yes


osmo-msc[master]: vlr: auth_fsm_start: check return value of fsm alloc

2017-11-07 Thread Harald Welte

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/4714/1/src/libvlr/vlr_auth_fsm.c
File src/libvlr/vlr_auth_fsm.c:

Line 592:   if (!afp) {
don't we leak 'fi' here if 'afp' allocation fails above?


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I7d1c15b546377b1afa38f7f40c5421b743e21605
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: Yes


osmo-bsc[master]: reset: check length of the reset context name

2017-11-07 Thread Harald Welte

Patch Set 1: Code-Review-1

see review comments of related osmo-bsc patch

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

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


osmo-msc[master]: reset: check length of the reset context name

2017-11-07 Thread Harald Welte

Patch Set 1: Code-Review-1

(2 comments)

https://gerrit.osmocom.org/#/c/4716/1//COMMIT_MSG
Commit Message:

Line 15: This fixes CID 178664
please use "Fixes: Coverity CID#178664" like in our other related comits.  
Thisis machine-parseable. We don't have any code that parses it yet (AFAIK) but 
this is useful in the future.


https://gerrit.osmocom.org/#/c/4716/1/src/libcommon-cs/a_reset.c
File src/libcommon-cs/a_reset.c:

Line 141:   if (strlen(name) >= sizeof(reset->name))
where does 'reset->name' come from? why is there a separate name at all? Isn't 
the fsm->name sufficient which we allocate/create below?  I think I raised this 
question before in code review but don't recall an answer, sorry.


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

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


osmo-trx[master]: SocketsTest: Fix printing of non-nul-terminated string

2017-11-07 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-trx[master]: SocketsTest: Fix printing of non-nul-terminated string

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

Change subject: SocketsTest: Fix printing of non-nul-terminated string
..


SocketsTest: Fix printing of non-nul-terminated string

Change-Id: I33d0ddf851d84b81ab5252e3755422170cee54ee
Fixes: Coverity CID#149363
---
M CommonLibs/SocketsTest.cpp
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/CommonLibs/SocketsTest.cpp b/CommonLibs/SocketsTest.cpp
index c2849e0..3198a5e 100644
--- a/CommonLibs/SocketsTest.cpp
+++ b/CommonLibs/SocketsTest.cpp
@@ -61,7 +61,8 @@
readSocket.nonblocking();
int rc = 0;
while (rc0) {
COUT("read: " << buf);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I33d0ddf851d84b81ab5252e3755422170cee54ee
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


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

2017-11-07 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:
[  275s] | 
[  275s] | This file was extended by libosmocore config.status 0.10.2.20171107, 
which was
[  275s] | generated by GNU Autoconf 2.69.  Invocation command line was
[  275s] | 
[  275s] |   CONFIG_FILES= 
[  275s] |   CONFIG_HEADERS  = 
[  275s] |   CONFIG_LINKS= 
[  275s] |   CONFIG_COMMANDS = 
[  275s] |   $ ./config.status Doxyfile.core
[  275s] | 
[  275s] | on build36
[  275s] | 
[  275s] | config.status:1180: creating Doxyfile.core
[  275s] 
[  275s] debian/rules:26: recipe for target 'override_dh_auto_test' failed
[  275s] make[1]: *** [override_dh_auto_test] Error 1
[  275s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  275s] debian/rules:15: recipe for target 'build' failed
[  275s] make: *** [build] Error 2
[  275s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  275s] 
[  275s] build36 failed "build libosmocore_0.10.2.20171107.dsc" at Tue Nov  7 
19:55:44 UTC 2017.
[  275s] 
[  275s] ### VM INTERACTION START ###
[  278s] [  268.734739] reboot: Power down
[  279s] ### VM INTERACTION END ###
[  279s] 
[  279s] build36 failed "build libosmocore_0.10.2.20171107.dsc" at Tue Nov  7 
19:55:48 UTC 2017.
[  279s] 

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


[PATCH] osmo-bsc[master]: mgcp: use osmo-mgw to switch RTP streams

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

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

https://gerrit.osmocom.org/4334

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

mgcp: use osmo-mgw to switch RTP streams

osmo-bsc currently negotiates the RTP stream directly with the
BTS and reports back the RTP IP/Port on the BTS. This works fine
for a single BTS, but for Handover the port/ip pointing to the
MSC side must not change, so an entity in between the BTSs and
the MSC is required.

Integrate the mgcp-client and use osmo-mgw to switch the RTP
streams.

Depends: osmo-mgw Ib5fcc72775bf72b489ff79ade36fb345d8d20736
Depends: osmo-mgw I44b338b09de45e1675cedf9737fa72dde72e979a
Depends: osmo-mgw I29c5e2fb972896faeb771ba040f015592487fcbe

Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a
---
M configure.ac
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/osmo_bsc.h
A include/osmocom/bsc/osmo_bsc_mgcp.h
M src/Makefile.am
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/osmo_bsc_audio.c
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_main.c
A src/osmo-bsc/osmo_bsc_mgcp.c
M src/osmo-bsc/osmo_bsc_sigtran.c
M src/osmo-bsc/osmo_bsc_vty.c
13 files changed, 1,324 insertions(+), 67 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/34/4334/14

diff --git a/configure.ac b/configure.ac
index 79523d1..862e5bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,8 +47,9 @@
 PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0)
 PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.8.0)
 PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5)
-PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1)
 PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
+PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.0.0)
+PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 1.0.0)
 
 dnl checks for header files
 AC_HEADER_STDC
@@ -135,7 +136,6 @@
 src/libfilter/Makefile
 src/libcommon-cs/Makefile
 src/osmo-bsc/Makefile
-src/osmo-bsc_nat/Makefile
 src/ipaccess/Makefile
 src/utils/Makefile
 tests/Makefile
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index 8ad2b5d..1f7cd39 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -41,6 +41,7 @@
openbscdefines.h \
osmo_bsc.h \
osmo_bsc_grace.h \
+   osmo_bsc_mgcp.h \
osmo_bsc_rf.h \
osmo_bsc_sigtran.h \
bsc_msc_data.h \
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 74298b8..b9427b8 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -479,6 +479,11 @@
uint8_t t3212;
 
struct {
+   struct mgcp_client_conf *conf;
+   struct mgcp_client *client;
+   } mgw;
+
+   struct {
/* CS7 instance id number (set via VTY) */
uint32_t cs7_instance;
/* A list with the context information about
diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h
index 5ebea50..8a5cd30 100644
--- a/include/osmocom/bsc/osmo_bsc.h
+++ b/include/osmocom/bsc/osmo_bsc.h
@@ -29,6 +29,20 @@
uint32_t rtp_ip;
int rtp_port;
 
+   /* RTP address of the remote end (assigned by MSC through assignment
+* request) */
+   struct sockaddr_storage aoip_rtp_addr_remote;
+
+   /* Local RTP address (reported back to the MSC by us with the
+* assignment complete message) */
+   struct sockaddr_storage aoip_rtp_addr_local;
+
+   /* storage to keep states of the MGCP connection handler, the
+* handler is created when an assignment request is received
+* and is terminated when the assignment complete message is
+* sent */
+   struct mgcp_ctx *mgcp_ctx;
+
/* for advanced ping/pong */
int send_ping;
 
@@ -72,4 +86,6 @@
 
 struct llist_head *bsc_access_lists(void);
 
+int bssmap_send_aoip_ass_compl(struct gsm_lchan *lchan);
+
 #endif
diff --git a/include/osmocom/bsc/osmo_bsc_mgcp.h 
b/include/osmocom/bsc/osmo_bsc_mgcp.h
new file mode 100644
index 000..ddcba0f
--- /dev/null
+++ b/include/osmocom/bsc/osmo_bsc_mgcp.h
@@ -0,0 +1,48 @@
+/* (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 

[PATCH] osmo-gsm-tester[master]: modem: Improve handling of errors in dbus_call_dismiss_error

2017-11-07 Thread Pau Espin Pedrol

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

modem: Improve handling of errors in dbus_call_dismiss_error

Change-Id: I25d08c74608c3ec5c6e46c36c161e777b2ed337a
---
M src/osmo_gsm_tester/modem.py
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/19/4719/1

diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py
index e8f57cc..bff62bb 100644
--- a/src/osmo_gsm_tester/modem.py
+++ b/src/osmo_gsm_tester/modem.py
@@ -145,11 +145,11 @@
 def dbus_call_dismiss_error(log_obj, err_str, method):
 try:
 method()
-except Exception as e:
-if isinstance(e, GLib.Error) and err_str in e.domain:
+except GLib.Error as e:
+if Gio.DBusError.is_remote_error(e) and 
Gio.DBusError.get_remote_error(e) == err_str:
 log_obj.log('Dismissed Dbus method error: %r' % e)
 return
-raise log.Error('dbus_call_dismiss_error raised error %r' % e)
+raise e
 
 class ModemDbusInteraction(log.Origin):
 '''Work around inconveniences specific to pydbus and ofono.

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

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


[PATCH] osmo-gsm-tester[master]: modem: Fallback to automatic registration if manual one is n...

2017-11-07 Thread Pau Espin Pedrol

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

modem: Fallback to automatic registration if manual one is not supported by 
modem

Some modems such as the gobi 2000 doesn't support the Register() method
in /operator path. If the method returns a NotSupported error, fallback
to automatic registration.

Change-Id: Ibc322317db634a5380573de88a56eb53fd92e67b
---
M src/osmo_gsm_tester/modem.py
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/20/4720/1

diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py
index bff62bb..cb4a8de 100644
--- a/src/osmo_gsm_tester/modem.py
+++ b/src/osmo_gsm_tester/modem.py
@@ -502,7 +502,14 @@
 return
 dbus_op = systembus_get(matching_op_path)
 self.log('Registering with operator', matching_op_path, mcc_mnc)
-dbus_call_dismiss_error(self, 'org.ofono.Error.InProgress', 
dbus_op.Register)
+try:
+dbus_call_dismiss_error(self, 'org.ofono.Error.InProgress', 
dbus_op.Register)
+except GLib.Error as e:
+if Gio.DBusError.is_remote_error(e) and 
Gio.DBusError.get_remote_error(e) == 'org.ofono.Error.NotSupported':
+self.log('modem does not support manual registering, 
attempting automatic registering')
+self.scan_cb_register_automatic(scanned_operators, mcc_mnc)
+return
+raise e
 
 def cancel_pending_dbus_methods(self):
 self.cancellable.cancel()

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

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


osmo-ci[master]: osmo-deps.sh: Force fetching git tags

2017-11-07 Thread lynxis lazus

Patch Set 1: Code-Review+1

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

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


osmo-ci[master]: osmo-deps.sh: Force fetching git tags

2017-11-07 Thread Pau Espin Pedrol

Patch Set 1:

Please read the whole description, specially latest paragraph.

See 
https://stackoverflow.com/questions/1204190/does-git-fetch-tags-include-git-fetch
 first answer for information. It seems behavior/documentation changes starting 
from git 1.9/2.0 (Q1 2014)

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

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


osmo-ci[master]: osmo-deps.sh: Force fetching git tags

2017-11-07 Thread lynxis lazus

Patch Set 1:

> I think the --tags can be merged into one line.

`git fetch --tags` is already fetching the same as `git fetch` according to the 
man pages.

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

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


osmo-ci[master]: osmo-deps.sh: Force fetching git tags

2017-11-07 Thread lynxis lazus

Patch Set 1: Code-Review-1

I think the --tags can be merged into one line.

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

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


osmo-ci[master]: osmo-deps.sh: Force fetching git tags

2017-11-07 Thread lynxis lazus

Patch Set 1: Code-Review+1

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

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


[PATCH] osmo-ci[master]: osmo-deps.sh: Force fetching git tags

2017-11-07 Thread Pau Espin Pedrol

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

osmo-deps.sh: Force fetching git tags

It was recently spotted, in a osmo-msc jenkins build, that an updated
dependency (new commits to be fetched) contained a new tag which was
not fetched with the commit. It resulted in the Makefile generating an
old .version file, which ended up generating a library version in the
.pc which later in the build make the configure script fail while
checking at the dependencies.

As far as I could understand after reading several discussion threads,
it seems git fetch doesn't necessarily fetch and store locally all new
tags found in the remote, and we need to explicitly add the --tags
parameter to be sure all of them are downloaded.

This patch adds a new fetch line instead of patching the one already
present because it seems in old versions of git the --tags parameter had
a different behaviour, in which only tags and not branches are fetched.
This way is ensured that we get both correct regardless of git version.

Change-Id: I4bfe4846959c70e435d6792a755a6f2a6f0a932c
---
M scripts/osmo-deps.sh
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/18/4718/1

diff --git a/scripts/osmo-deps.sh b/scripts/osmo-deps.sh
index d5a724b..a4afec5 100755
--- a/scripts/osmo-deps.sh
+++ b/scripts/osmo-deps.sh
@@ -9,6 +9,7 @@
 fi
 
 cd "$project"
+git fetch --tags origin
 git fetch origin
 
 # Cleanup should already have happened during a global osmo-clean-workspace.sh,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4bfe4846959c70e435d6792a755a6f2a6f0a932c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-bsc[master]: reset: check length of the reset context name

2017-11-07 Thread dexter

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

reset: check length of the reset context name

When allocating a reset context, the user must supply a human
readable string name. At the moment the length of this name
is not checked

Check the length of the string name.

This fixes CID 178664

Change-Id: I34511698923abec7545a6f3defd595f97b4bbeb1
---
M src/libcommon-cs/a_reset.c
1 file changed, 3 insertions(+), 0 deletions(-)


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

diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c
index f08d813..5216798 100644
--- a/src/libcommon-cs/a_reset.c
+++ b/src/libcommon-cs/a_reset.c
@@ -138,6 +138,9 @@
 
struct a_reset_ctx *reset;
 
+   if (strlen(name) >= sizeof(reset->name))
+   return NULL;
+
/* Register the fsm description (if not already done) */
if (osmo_fsm_find_by_name(fsm.name) != )
osmo_fsm_register();

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

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


[PATCH] osmo-msc[master]: reset: check length of the reset context name

2017-11-07 Thread dexter

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

reset: check length of the reset context name

When allocating a reset context, the user must supply a human
readable string name. At the moment the length of this name
is not checked

Check the length of the string name.

This fixes CID 178664

Change-Id: Id7c4a7ff17e1c8ceb6e543ab6f0f07c87df603c7
---
M src/libcommon-cs/a_reset.c
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/16/4716/1

diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c
index 7dbd014..0bf36c6 100644
--- a/src/libcommon-cs/a_reset.c
+++ b/src/libcommon-cs/a_reset.c
@@ -138,6 +138,9 @@
 
struct a_reset_ctx *reset;
 
+   if (strlen(name) >= sizeof(reset->name))
+   return NULL;
+
/* Register the fsm description (if not already done) */
if (osmo_fsm_find_by_name(fsm.name) != )
osmo_fsm_register();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7c4a7ff17e1c8ceb6e543ab6f0f07c87df603c7
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: dexter 


osmo-pcu[master]: PCU: display TA information in TBF stats

2017-11-07 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I26886224c2ad6d5a29e92203635b8bf7459730a2
Gerrit-PatchSet: 2
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Minh-Quang Nguyen 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-pcu[master]: PCU: Fix TA adjustment

2017-11-07 Thread Harald Welte

Patch Set 2: Code-Review+2

(1 comment)

https://gerrit.osmocom.org/#/c/4678/2/src/bts.cpp
File src/bts.cpp:

Line 1628:  if (ta_delta) {
no change needed now/here, just general remark: Our usual coding style would be 
to exit early, i.e. "if (!ta_delta) return;" which saves us one level of 
indent.  Maybe good to follow for any future patches/changes. Don't waste time 
on it now.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I65212f8203f1a35278890f51db038d689b2493d5
Gerrit-PatchSet: 2
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Minh-Quang Nguyen 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Minh-Quang Nguyen 
Gerrit-HasComments: Yes


[PATCH] osmo-hlr[master]: cosmetic: add comment on ignored return value

2017-11-07 Thread Neels Hofmeyr

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

cosmetic: add comment on ignored return value

Coverity wants us to evaluate sqlite3_reset, but it is of no use to do so.

Related: coverity CID#178653
Change-Id: I64ac8c148f48be60f9c0d346df0c5152bb527494
---
M src/db.c
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/15/4715/1

diff --git a/src/db.c b/src/db.c
index 8733cf5..bcb67b1 100644
--- a/src/db.c
+++ b/src/db.c
@@ -99,6 +99,9 @@
 void db_remove_reset(sqlite3_stmt *stmt)
 {
sqlite3_clear_bindings(stmt);
+   /* coverity complains about ignoring the return value of
+* sqlite3_reset(), but it just repeats an error code already evaluated
+* during sqlite3_step(). */
sqlite3_reset(stmt);
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I64ac8c148f48be60f9c0d346df0c5152bb527494
Gerrit-PatchSet: 1
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-msc[master]: vlr: auth_fsm_start: check return value of fsm alloc

2017-11-07 Thread Neels Hofmeyr

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

vlr: auth_fsm_start: check return value of fsm alloc

Fixes: coverity CID#178663
Change-Id: I7d1c15b546377b1afa38f7f40c5421b743e21605
---
M src/libvlr/vlr_auth_fsm.c
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/14/4714/1

diff --git a/src/libvlr/vlr_auth_fsm.c b/src/libvlr/vlr_auth_fsm.c
index f07e60f..1376c82 100644
--- a/src/libvlr/vlr_auth_fsm.c
+++ b/src/libvlr/vlr_auth_fsm.c
@@ -583,7 +583,10 @@
 
fi = osmo_fsm_inst_alloc_child(_auth_fsm, parent,
parent_term_event);
-
+   if (!fi) {
+   osmo_fsm_inst_dispatch(parent, parent_term_event, 0);
+   return NULL;
+   }
 
afp = talloc_zero(fi, struct auth_fsm_priv);
if (!afp) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d1c15b546377b1afa38f7f40c5421b743e21605
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-hlr[master]: hlr_db_tool: fix error log strerror invocation

2017-11-07 Thread Neels Hofmeyr

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

hlr_db_tool: fix error log strerror invocation

The db API returns negative errno values, need to flip the sign before feeding
to strerror.

Fixes: coverity CID#178658
Change-Id: Iaab46f565a1112d8a7def8ea90a5cd440c0a3b41
---
M src/hlr_db_tool.c
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/13/4713/1

diff --git a/src/hlr_db_tool.c b/src/hlr_db_tool.c
index 8982739..eb82c92 100644
--- a/src/hlr_db_tool.c
+++ b/src/hlr_db_tool.c
@@ -284,12 +284,12 @@
snprintf(imsi_str, sizeof(imsi_str), "%"PRId64, imsi);
 
rc = db_subscr_create(dbc, imsi_str);
-   if (rc) {
+   if (rc < 0) {
LOGP(DDB, LOGL_ERROR, "OsmoNITB DB import to %s: failed to 
create IMSI %s: %d: %s\n",
 dbc->fname,
 imsi_str,
 rc,
-strerror(rc));
+strerror(-rc));
/* on error, still attempt to continue */
}
 
@@ -303,13 +303,13 @@
 
/* find the just created id */
rc = db_subscr_get_by_imsi(dbc, imsi_str, );
-   if (rc) {
+   if (rc < 0) {
LOGP(DDB, LOGL_ERROR, "OsmoNITB DB import to %s: created IMSI 
%s,"
 " but failed to get new subscriber id: %d: %s\n",
 dbc->fname,
 imsi_str,
 rc,
-strerror(rc));
+strerror(-rc));
return;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaab46f565a1112d8a7def8ea90a5cd440c0a3b41
Gerrit-PatchSet: 1
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-gsm-tester[master]: Use unique incrementing value for BTS CellId

2017-11-07 Thread Pau Espin Pedrol
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/4706

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

Use unique incrementing value for BTS CellId

Change-Id: If4559b945a3e71f3a36fd7ac760cb094278f6b39
---
M selftest/template_test.ok
M selftest/template_test.py
M selftest/template_test/osmo-nitb.cfg.tmpl
M src/osmo_gsm_tester/bts_octphy.py
M src/osmo_gsm_tester/bts_osmotrx.py
M src/osmo_gsm_tester/bts_sysmo.py
M src/osmo_gsm_tester/resource.py
M src/osmo_gsm_tester/suite.py
M src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
10 files changed, 32 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/06/4706/2

diff --git a/selftest/template_test.ok b/selftest/template_test.ok
index 5bd32a4..dcfacc2 100644
--- a/selftest/template_test.ok
+++ b/selftest/template_test.ok
@@ -38,7 +38,7 @@
  bts 0
   type val_type_bts0
   band val_band_bts0
-  cell_identity 0
+  cell_identity val_bts.cell_identity_bts0
   location_area_code val_bts.location_area_code_bts0
   training_sequence_code 7
   base_station_id_code val_bts.base_station_id_code_bts0
@@ -82,7 +82,7 @@
  bts 1
   type val_type_bts1
   band val_band_bts1
-  cell_identity 0
+  cell_identity val_bts.cell_identity_bts1
   location_area_code val_bts.location_area_code_bts1
   training_sequence_code 7
   base_station_id_code val_bts.base_station_id_code_bts1
diff --git a/selftest/template_test.py b/selftest/template_test.py
index 769df49..0c83632 100755
--- a/selftest/template_test.py
+++ b/selftest/template_test.py
@@ -22,6 +22,7 @@
 'osmobsc_bts_type': 'val_type',
 'band': 'val_band',
 'location_area_code': 'val_bts.location_area_code',
+'cell_identity': 'val_bts.cell_identity',
 'base_station_id_code': 'val_bts.base_station_id_code',
 'ipa_unit_id': 'val_bts.unit_id',
 'stream_id': 'val_bts.stream_id',
diff --git a/selftest/template_test/osmo-nitb.cfg.tmpl 
b/selftest/template_test/osmo-nitb.cfg.tmpl
index 2559b14..f1508ec 100644
--- a/selftest/template_test/osmo-nitb.cfg.tmpl
+++ b/selftest/template_test/osmo-nitb.cfg.tmpl
@@ -54,7 +54,7 @@
  bts ${loop.index}
   type ${bts.type}
   band ${bts.band}
-  cell_identity 0
+  cell_identity ${bts.cell_identity}
   location_area_code ${bts.location_area_code}
   training_sequence_code 7
   base_station_id_code ${bts.base_station_id_code}
diff --git a/src/osmo_gsm_tester/bts_octphy.py 
b/src/osmo_gsm_tester/bts_octphy.py
index eb1092c..bc93a3a 100644
--- a/src/osmo_gsm_tester/bts_octphy.py
+++ b/src/osmo_gsm_tester/bts_octphy.py
@@ -31,6 +31,7 @@
 pcu_sk_tmp_dir = None
 values = None
 lac = None
+cellid = None
 
 BIN_BTS_OCTPHY = 'osmo-bts-octphy'
 
@@ -161,6 +162,8 @@
 config.overlay(values, config.get_defaults('osmo_bts_octphy'))
 if self.lac is not None:
 config.overlay(values, { 'location_area_code': self.lac })
+if self.cellid is not None:
+config.overlay(values, { 'cell_identity': self.cellid })
 config.overlay(values, self.conf)
 self.dbg(conf=values)
 return values
@@ -171,4 +174,7 @@
 def set_lac(self, lac):
 self.lac = lac
 
+def set_cellid(self, cellid):
+self.cellid = cellid
+
 # vim: expandtab tabstop=4 shiftwidth=4
diff --git a/src/osmo_gsm_tester/bts_osmotrx.py 
b/src/osmo_gsm_tester/bts_osmotrx.py
index 731daa5..a964169 100644
--- a/src/osmo_gsm_tester/bts_osmotrx.py
+++ b/src/osmo_gsm_tester/bts_osmotrx.py
@@ -31,6 +31,7 @@
 trx = None
 pcu_sk_tmp_dir = None
 lac = None
+cellid = None
 
 BIN_BTS_TRX = 'osmo-bts-trx'
 BIN_PCU = 'osmo-pcu'
@@ -139,6 +140,8 @@
 config.overlay(values, config.get_defaults('osmo_bts_trx'))
 if self.lac is not None:
 config.overlay(values, { 'location_area_code': self.lac })
+if self.cellid is not None:
+config.overlay(values, { 'cell_identity': self.cellid })
 config.overlay(values, self.conf)
 self.dbg(conf=values)
 return values
@@ -149,6 +152,9 @@
 def set_lac(self, lac):
 self.lac = lac
 
+def set_cellid(self, cellid):
+self.cellid = cellid
+
 class OsmoTrx(log.Origin):
 suite_run = None
 run_dir = None
diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py
index 03dc97e..fc546ae 100644
--- a/src/osmo_gsm_tester/bts_sysmo.py
+++ b/src/osmo_gsm_tester/bts_sysmo.py
@@ -30,6 +30,7 @@
 remote_env = None
 remote_dir = None
 lac = None
+cellid = None
 
 REMOTE_DIR = '/osmo-gsm-tester'
 BTS_SYSMO_BIN = 'osmo-bts-sysmo'
@@ -146,6 +147,8 @@
 config.overlay(values, config.get_defaults('osmo_bts_sysmo'))
 if self.lac is not None:
 config.overlay(values, { 'location_area_code': self.lac })
+if self.cellid is not None:
+config.overlay(values, { 'cell_identity': self.cellid })
 

[PATCH] osmo-mgw[master]: network: remove unused return code

2017-11-07 Thread dexter

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

network: remove unused return code

The function that forwards the tapped (voice ebug) traffic returns
its status (sendto) to the caller. However, none of the callers
seem need this info.

Remove the return code and print an error message on failure

This fixes CID 178666

Change-Id: I16c12c4565bccbc0d75c412b43469bf70b6b7ea5
---
M src/libosmo-mgcp/mgcp_network.c
1 file changed, 12 insertions(+), 6 deletions(-)


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

diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 7876b33..947b87e 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -627,14 +627,20 @@
 
 /* Forward data to a debug tap. This is debug function that is intended for
  * debugging the voice traffic with tools like gstreamer */
-static int forward_data(int fd, struct mgcp_rtp_tap *tap, const char *buf,
-   int len)
+static void forward_data(int fd, struct mgcp_rtp_tap *tap, const char *buf,
+int len)
 {
-   if (!tap->enabled)
-   return 0;
+   int rc;
 
-   return sendto(fd, buf, len, 0,
- (struct sockaddr *)>forward, sizeof(tap->forward));
+   if (!tap->enabled)
+   return;
+
+   rc = sendto(fd, buf, len, 0, (struct sockaddr *)>forward,
+   sizeof(tap->forward));
+
+   if (rc < 0)
+   LOGP(DRTP, LOGL_ERROR,
+"Forwarding tapped (debug) voice data failed.\n");
 }
 
 /*! Send RTP/RTCP data to a specified destination connection.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I16c12c4565bccbc0d75c412b43469bf70b6b7ea5
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-mgw[master]: osmux: fix nullpointer dereference

2017-11-07 Thread dexter

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

osmux: fix nullpointer dereference

in point_lookup() the connection pointer is determined using
mgcp_conn_get_rtp() this function may return 0. At the moment
there are no nullpointer checks implemented

Add checks to test for nullpointer.

This fixes CID 178662

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


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

diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index 60ffe06..09b2636 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -207,12 +207,18 @@
case MGCP_DEST_NET:
/* FIXME: Get rid of CONN_ID_XXX! */
conn_net = mgcp_conn_get_rtp(endp, CONN_ID_NET);
-   this = _net->end.addr;
+   if (conn_net)
+   this = _net->end.addr;
+   else
+   this = NULL;
break;
case MGCP_DEST_BTS:
/* FIXME: Get rid of CONN_ID_XXX! */
conn_bts = mgcp_conn_get_rtp(endp, CONN_ID_BTS);
-   this = _bts->end.addr;
+   if (conn_bts)
+   this = _bts->end.addr;
+   else
+   this = NULL;
break;
default:
/* Should not ever happen */
@@ -222,7 +228,8 @@
 
/* FIXME: Get rid of CONN_ID_XXX! */
conn_net = mgcp_conn_get_rtp(endp, CONN_ID_NET);
-   if (conn_net->osmux.cid == cid && this->s_addr == 
from_addr->s_addr)
+   if (conn_net && this && conn_net->osmux.cid == cid
+   && this->s_addr == from_addr->s_addr)
return endp;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If9a3c1ac002bc8adc90ca1c1c3dd1db4feea07ac
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-mgw[master]: cosmetic: guard dead coded with ifdef

2017-11-07 Thread dexter

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

cosmetic: guard dead coded with ifdef

Since currently osmux is not available we decided to lock down the
respective VTY command with an early return CMD_WARNING, making
the code after this line unreachable.

Guard the dead code with an ifdef

This fixes CID 178648

Change-Id: I2ad9579453f52fe129cf120801a2efa19a26304e
---
M src/libosmo-mgcp/mgcp_vty.c
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c
index 7ff1fdd..a7d9e4a 100644
--- a/src/libosmo-mgcp/mgcp_vty.c
+++ b/src/libosmo-mgcp/mgcp_vty.c
@@ -1102,7 +1102,7 @@
 * allow to turn it on yet. */
vty_out(vty, "OSMUX currently unavailable in this software version.%s", 
VTY_NEWLINE);
return CMD_WARNING;
-
+#if 0
if (strcmp(argv[0], "on") == 0)
g_cfg->osmux = OSMUX_USAGE_ON;
else if (strcmp(argv[0], "only") == 0)
@@ -1114,6 +1114,7 @@
}
 
return CMD_SUCCESS;
+#endif
 }
 
 DEFUN(cfg_mgcp_osmux_ip,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ad9579453f52fe129cf120801a2efa19a26304e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-gsm-tester[master]: Rename module ofono_client as modem

2017-11-07 Thread Pau Espin Pedrol

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

Rename module ofono_client as modem

Change-Id: I43b51ae937d87d6d4e18caea59f9366e2e28c9f2
---
R src/osmo_gsm_tester/modem.py
M src/osmo_gsm_tester/resource.py
M src/osmo_gsm_tester/suite.py
3 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/09/4709/1

diff --git a/src/osmo_gsm_tester/ofono_client.py b/src/osmo_gsm_tester/modem.py
similarity index 100%
rename from src/osmo_gsm_tester/ofono_client.py
rename to src/osmo_gsm_tester/modem.py
diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index 25bb00f..044de95 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -27,7 +27,7 @@
 from . import config
 from . import util
 from . import schema
-from . import ofono_client
+from . import modem
 from . import osmo_nitb
 from . import bts_sysmo, bts_osmotrx, bts_octphy
 
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index 33a7761..cca8e55 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -23,7 +23,7 @@
 import copy
 import traceback
 import pprint
-from . import config, log, template, util, resource, schema, ofono_client, 
event_loop, esme, sms
+from . import config, log, template, util, resource, schema, modem, 
event_loop, esme, sms
 from . import osmo_nitb
 from . import osmo_hlr, osmo_mgcpgw, osmo_msc, osmo_bsc, osmo_stp
 from . import test
@@ -350,9 +350,9 @@
 def modem(self, specifics=None):
 conf = self.reserved_resources.get(resource.R_MODEM, 
specifics=specifics)
 self.dbg('create Modem object', conf=conf)
-modem = ofono_client.Modem(conf)
-self.register_for_cleanup(modem)
-return modem
+ms = modem.Modem(conf)
+self.register_for_cleanup(ms)
+return ms
 
 def modems(self, count):
 l = []

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

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


[PATCH] osmo-gsm-tester[master]: test.py: Remove unused parameter ofono_client in setup()

2017-11-07 Thread Pau Espin Pedrol

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

test.py: Remove unused parameter ofono_client in setup()

Change-Id: Ib8983421a7ca5f94fe1363768a12fff63c1fc64a
---
M src/osmo_gsm_tester/suite.py
M src/osmo_gsm_tester/test.py
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/08/4708/1

diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index 28bdd69..33a7761 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -91,7 +91,7 @@
 log.large_separator(self.suite_run.trial.name(), 
self.suite_run.name(), self.name(), sublevel=3)
 self.status = Test.UNKNOWN
 self.start_timestamp = time.time()
-test.setup(self.suite_run, self, ofono_client, 
sys.modules[__name__], event_loop, sms)
+test.setup(self.suite_run, self, sys.modules[__name__], 
event_loop, sms)
 with self.redirect_stdout():
 util.run_python_file('%s.%s' % 
(self.suite_run.definition.name(), self.basename),
  self.path)
diff --git a/src/osmo_gsm_tester/test.py b/src/osmo_gsm_tester/test.py
index 49911b3..b939054 100644
--- a/src/osmo_gsm_tester/test.py
+++ b/src/osmo_gsm_tester/test.py
@@ -35,7 +35,7 @@
 Timeout = None
 Sms = None
 
-def setup(suite_run, _test, ofono_client, suite_module, event_module, 
sms_module):
+def setup(suite_run, _test, suite_module, event_module, sms_module):
 global trial, suite, test, resources, log, dbg, err, wait, wait_no_raise, 
sleep, poll, prompt, Timeout, Sms
 trial = suite_run.trial
 suite = suite_run

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

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


[PATCH] osmo-gsm-tester[master]: Remove unused file bts_model.py

2017-11-07 Thread Pau Espin Pedrol

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

Remove unused file bts_model.py

Change-Id: If24b7dafb659d45bc13f4d624212d6c266c1b522
---
D src/osmo_gsm_tester/bts_model.py
1 file changed, 0 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/07/4707/1

diff --git a/src/osmo_gsm_tester/bts_model.py b/src/osmo_gsm_tester/bts_model.py
deleted file mode 100644
index 41e8491..000
--- a/src/osmo_gsm_tester/bts_model.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# osmo_gsm_tester: bts model specifics
-#
-# Copyright (C) 2016-2017 by sysmocom - s.f.m.c. GmbH
-#
-# Author: Neels Hofmeyr 
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as
-# published by the Free Software Foundation, either version 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see .
-
-from . import log, schema, util
-
-class TestContext(log.Origin):
-'''
-API to allow testing various BTS models.
-'''
-
-def __init__(self, 
-
-# vim: expandtab tabstop=4 shiftwidth=4

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

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


[PATCH] osmo-gsm-tester[master]: resource: Refactor next_msisdn to be more generic

2017-11-07 Thread Pau Espin Pedrol
Hello Neels Hofmeyr, Jenkins Builder,

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

https://gerrit.osmocom.org/4703

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

resource: Refactor next_msisdn to be more generic

The logic in next_msisdn can be later re-used for other purposes, such
as getting different location area codes for BTS.

Change-Id: Ib04a34892aacd7e71f8f5961e7339add583f73f2
---
M src/osmo_gsm_tester/resource.py
1 file changed, 17 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/03/4703/2

diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index 25bb00f..ecafa2f 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -38,7 +38,6 @@
 USED_KEY = '_used'
 
 RESOURCES_CONF = 'resources.conf'
-LAST_USED_MSISDN_FILE = 'last_used_msisdn.state'
 RESERVED_RESOURCES_FILE = 'reserved_resources.state'
 
 R_IP_ADDRESS = 'ip_address'
@@ -189,24 +188,27 @@
 if not self._remember_to_free:
 self.unregister_exit_handler()
 
-def next_msisdn(self, origin):
+def next_persistent_value(self, token, first_val, validate_func, inc_func, 
origin):
 origin_id = origin.origin_id()
 
 with self.state_dir.lock(origin_id):
-msisdn_path = self.state_dir.child(LAST_USED_MSISDN_FILE)
-log.ctx(msisdn_path)
-last_msisdn = '1000'
-if os.path.exists(msisdn_path):
-if not os.path.isfile(msisdn_path):
-raise RuntimeError('path should be a file but is not: %r' 
% msisdn_path)
-with open(msisdn_path, 'r') as f:
-last_msisdn = f.read().strip()
-schema.msisdn(last_msisdn)
+token_path = self.state_dir.child('last_used_%s.state' % token)
+log.ctx(token_path)
+last_value = first_val
+if os.path.exists(token_path):
+if not os.path.isfile(token_path):
+raise RuntimeError('path should be a file but is not: %r' 
% token_path)
+with open(token_path, 'r') as f:
+last_value = f.read().strip()
+validate_func(last_value)
 
-next_msisdn = util.msisdn_inc(last_msisdn)
-with open(msisdn_path, 'w') as f:
-f.write(next_msisdn)
-return next_msisdn
+next_value = inc_func(last_value)
+with open(token_path, 'w') as f:
+f.write(next_value)
+return next_value
+
+def next_msisdn(self, origin):
+return self.next_persistent_value('msisdn', '1000', schema.msisdn, 
util.msisdn_inc, origin)
 
 
 class NoResourceExn(log.Error):

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ib04a34892aacd7e71f8f5961e7339add583f73f2
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[PATCH] osmo-gsm-tester[master]: Use unique incrementing value for BTS CellId

2017-11-07 Thread Pau Espin Pedrol

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

Use unique incrementing value for BTS CellId

Change-Id: If4559b945a3e71f3a36fd7ac760cb094278f6b39
---
M src/osmo_gsm_tester/bts_octphy.py
M src/osmo_gsm_tester/bts_osmotrx.py
M src/osmo_gsm_tester/bts_sysmo.py
M src/osmo_gsm_tester/resource.py
M src/osmo_gsm_tester/suite.py
M src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
M src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
7 files changed, 28 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/06/4706/1

diff --git a/src/osmo_gsm_tester/bts_octphy.py 
b/src/osmo_gsm_tester/bts_octphy.py
index eb1092c..bc93a3a 100644
--- a/src/osmo_gsm_tester/bts_octphy.py
+++ b/src/osmo_gsm_tester/bts_octphy.py
@@ -31,6 +31,7 @@
 pcu_sk_tmp_dir = None
 values = None
 lac = None
+cellid = None
 
 BIN_BTS_OCTPHY = 'osmo-bts-octphy'
 
@@ -161,6 +162,8 @@
 config.overlay(values, config.get_defaults('osmo_bts_octphy'))
 if self.lac is not None:
 config.overlay(values, { 'location_area_code': self.lac })
+if self.cellid is not None:
+config.overlay(values, { 'cell_identity': self.cellid })
 config.overlay(values, self.conf)
 self.dbg(conf=values)
 return values
@@ -171,4 +174,7 @@
 def set_lac(self, lac):
 self.lac = lac
 
+def set_cellid(self, cellid):
+self.cellid = cellid
+
 # vim: expandtab tabstop=4 shiftwidth=4
diff --git a/src/osmo_gsm_tester/bts_osmotrx.py 
b/src/osmo_gsm_tester/bts_osmotrx.py
index 731daa5..a964169 100644
--- a/src/osmo_gsm_tester/bts_osmotrx.py
+++ b/src/osmo_gsm_tester/bts_osmotrx.py
@@ -31,6 +31,7 @@
 trx = None
 pcu_sk_tmp_dir = None
 lac = None
+cellid = None
 
 BIN_BTS_TRX = 'osmo-bts-trx'
 BIN_PCU = 'osmo-pcu'
@@ -139,6 +140,8 @@
 config.overlay(values, config.get_defaults('osmo_bts_trx'))
 if self.lac is not None:
 config.overlay(values, { 'location_area_code': self.lac })
+if self.cellid is not None:
+config.overlay(values, { 'cell_identity': self.cellid })
 config.overlay(values, self.conf)
 self.dbg(conf=values)
 return values
@@ -149,6 +152,9 @@
 def set_lac(self, lac):
 self.lac = lac
 
+def set_cellid(self, cellid):
+self.cellid = cellid
+
 class OsmoTrx(log.Origin):
 suite_run = None
 run_dir = None
diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py
index 03dc97e..fc546ae 100644
--- a/src/osmo_gsm_tester/bts_sysmo.py
+++ b/src/osmo_gsm_tester/bts_sysmo.py
@@ -30,6 +30,7 @@
 remote_env = None
 remote_dir = None
 lac = None
+cellid = None
 
 REMOTE_DIR = '/osmo-gsm-tester'
 BTS_SYSMO_BIN = 'osmo-bts-sysmo'
@@ -146,6 +147,8 @@
 config.overlay(values, config.get_defaults('osmo_bts_sysmo'))
 if self.lac is not None:
 config.overlay(values, { 'location_area_code': self.lac })
+if self.cellid is not None:
+config.overlay(values, { 'cell_identity': self.cellid })
 config.overlay(values, self.conf)
 self.dbg(conf=values)
 return values
@@ -156,4 +159,7 @@
 def set_lac(self, lac):
 self.lac = lac
 
+def set_cellid(self, cellid):
+self.cellid = cellid
+
 # vim: expandtab tabstop=4 shiftwidth=4
diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index 9571131..1bacd38 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -213,6 +213,9 @@
 def next_lac(self, origin):
 return self.next_persistent_value('lac', '1', schema.uint16, lambda x: 
str((int(x)+1) % pow(2,16)), origin)
 
+def next_cellid(self, origin):
+return self.next_persistent_value('cellid', '1', schema.uint16, lambda 
x: str((int(x)+1) % pow(2,16)), origin)
+
 class NoResourceExn(log.Error):
 pass
 
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index 9f9421e..4a3de19 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -345,6 +345,7 @@
 def bts(self, specifics=None):
 bts = bts_obj(self, self.reserved_resources.get(resource.R_BTS, 
specifics=specifics))
 bts.set_lac(self.lac())
+bts.set_cellid(self.cellid())
 self.register_for_cleanup(bts)
 return bts
 
@@ -375,6 +376,10 @@
 lac = self.resources_pool.next_lac(self)
 self.log('using LAC', lac)
 return lac
+def cellid(self):
+cellid = self.resources_pool.next_cellid(self)
+self.log('using CellId', cellid)
+return cellid
 
 def poll(self):
 if self._processes:
diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
index 14aa62d..d79bb2b 100644
--- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
@@ -44,7 

osmo-gsm-tester[master]: Use unique incrementing value for BTS CellId

2017-11-07 Thread Pau Espin Pedrol

Patch Set 1:

Works fine as seen by ofono modem:
11:11:54.392983 tst/sierra_2: DBG: 
'org.ofono.NetworkRegistration'.PropertyChanged() -> LocationAreaCode=8
11:11:54.422874 tst/sierra_2: DBG: 
'org.ofono.NetworkRegistration'.PropertyChanged() -> CellId=4

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

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


[PATCH] osmo-gsm-tester[master]: Use unique incrementing value for BTS LAC

2017-11-07 Thread Pau Espin Pedrol
Hello Neels Hofmeyr, Jenkins Builder,

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

https://gerrit.osmocom.org/4704

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

Use unique incrementing value for BTS LAC

Change-Id: I9f864bac05e39ec2fc305f774194799c3d8fe1b0
---
M example/defaults.conf
M src/osmo_gsm_tester/bts_octphy.py
M src/osmo_gsm_tester/bts_osmotrx.py
M src/osmo_gsm_tester/bts_sysmo.py
M src/osmo_gsm_tester/resource.py
M src/osmo_gsm_tester/schema.py
M src/osmo_gsm_tester/suite.py
7 files changed, 33 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/04/4704/3

diff --git a/example/defaults.conf b/example/defaults.conf
index e2921a4..d555ab0 100644
--- a/example/defaults.conf
+++ b/example/defaults.conf
@@ -28,7 +28,6 @@
 authentication: optional
 
 bsc_bts:
-  location_area_code: 23
   base_station_id_code: 63
   stream_id: 255
   osmobsc_bts_type: sysmobts
diff --git a/src/osmo_gsm_tester/bts_octphy.py 
b/src/osmo_gsm_tester/bts_octphy.py
index ae2e249..eb1092c 100644
--- a/src/osmo_gsm_tester/bts_octphy.py
+++ b/src/osmo_gsm_tester/bts_octphy.py
@@ -30,6 +30,7 @@
 env = None
 pcu_sk_tmp_dir = None
 values = None
+lac = None
 
 BIN_BTS_OCTPHY = 'osmo-bts-octphy'
 
@@ -158,6 +159,8 @@
 def conf_for_bsc(self):
 values = config.get_defaults('bsc_bts')
 config.overlay(values, config.get_defaults('osmo_bts_octphy'))
+if self.lac is not None:
+config.overlay(values, { 'location_area_code': self.lac })
 config.overlay(values, self.conf)
 self.dbg(conf=values)
 return values
@@ -165,4 +168,7 @@
 def set_bsc(self, bsc):
 self.bsc = bsc
 
+def set_lac(self, lac):
+self.lac = lac
+
 # vim: expandtab tabstop=4 shiftwidth=4
diff --git a/src/osmo_gsm_tester/bts_osmotrx.py 
b/src/osmo_gsm_tester/bts_osmotrx.py
index f53b8a3..731daa5 100644
--- a/src/osmo_gsm_tester/bts_osmotrx.py
+++ b/src/osmo_gsm_tester/bts_osmotrx.py
@@ -30,6 +30,7 @@
 env = None
 trx = None
 pcu_sk_tmp_dir = None
+lac = None
 
 BIN_BTS_TRX = 'osmo-bts-trx'
 BIN_PCU = 'osmo-pcu'
@@ -136,6 +137,8 @@
 def conf_for_bsc(self):
 values = config.get_defaults('bsc_bts')
 config.overlay(values, config.get_defaults('osmo_bts_trx'))
+if self.lac is not None:
+config.overlay(values, { 'location_area_code': self.lac })
 config.overlay(values, self.conf)
 self.dbg(conf=values)
 return values
@@ -143,6 +146,9 @@
 def set_bsc(self, bsc):
 self.bsc = bsc
 
+def set_lac(self, lac):
+self.lac = lac
+
 class OsmoTrx(log.Origin):
 suite_run = None
 run_dir = None
diff --git a/src/osmo_gsm_tester/bts_sysmo.py b/src/osmo_gsm_tester/bts_sysmo.py
index e8ac7c2..03dc97e 100644
--- a/src/osmo_gsm_tester/bts_sysmo.py
+++ b/src/osmo_gsm_tester/bts_sysmo.py
@@ -29,6 +29,7 @@
 remote_inst = None
 remote_env = None
 remote_dir = None
+lac = None
 
 REMOTE_DIR = '/osmo-gsm-tester'
 BTS_SYSMO_BIN = 'osmo-bts-sysmo'
@@ -143,6 +144,8 @@
 def conf_for_bsc(self):
 values = config.get_defaults('bsc_bts')
 config.overlay(values, config.get_defaults('osmo_bts_sysmo'))
+if self.lac is not None:
+config.overlay(values, { 'location_area_code': self.lac })
 config.overlay(values, self.conf)
 self.dbg(conf=values)
 return values
@@ -150,4 +153,7 @@
 def set_bsc(self, bsc):
 self.bsc = bsc
 
+def set_lac(self, lac):
+self.lac = lac
+
 # vim: expandtab tabstop=4 shiftwidth=4
diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py
index ecafa2f..9571131 100644
--- a/src/osmo_gsm_tester/resource.py
+++ b/src/osmo_gsm_tester/resource.py
@@ -210,6 +210,8 @@
 def next_msisdn(self, origin):
 return self.next_persistent_value('msisdn', '1000', schema.msisdn, 
util.msisdn_inc, origin)
 
+def next_lac(self, origin):
+return self.next_persistent_value('lac', '1', schema.uint16, lambda x: 
str((int(x)+1) % pow(2,16)), origin)
 
 class NoResourceExn(log.Error):
 pass
diff --git a/src/osmo_gsm_tester/schema.py b/src/osmo_gsm_tester/schema.py
index 9b142d3..a78bc63 100644
--- a/src/osmo_gsm_tester/schema.py
+++ b/src/osmo_gsm_tester/schema.py
@@ -71,6 +71,13 @@
 if n < 0:
 raise ValueError('Positive value expected instead of %d' % n)
 
+def uint16(val):
+n = int(val)
+if n < 0:
+raise ValueError('Positive value expected instead of %d' % n)
+if n > 65535: # 2^16 - 1
+raise ValueError('Value %d too big, max value is 65535' % n)
+
 def times(val):
 n = int(val)
 if n < 1:
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index 28bdd69..9f9421e 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -344,6 +344,7 @@
 
 def bts(self, specifics=None):
 bts = 

osmo-gsm-tester[master]: Use unique incrementing value for BTS LAC

2017-11-07 Thread Pau Espin Pedrol

Patch Set 2:

(3 comments)

https://gerrit.osmocom.org/#/c/4704/2/src/osmo_gsm_tester/bts_sysmo.py
File src/osmo_gsm_tester/bts_sysmo.py:

Line 147: 'location_area_code': self.suite_run.lac(),
> -1: Each BTS object must get a LAC *once*, conf_for_bsc() should be a "cons
On practise it doesn't matter because we only call conf_for_bsc once per bsc, 
but I agree it's better to move it as you suggest.

I'll leave the BtsBase class for later as it requires several changes and it's 
not entirely related to this topic.


https://gerrit.osmocom.org/#/c/4704/2/src/osmo_gsm_tester/resource.py
File src/osmo_gsm_tester/resource.py:

Line 215: return self.next_persistent_value('lac', '1', schema.uint16, 
lambda x: str((int(x)+1) %  pow(2,16)), origin)
> -1: What if x starts out as -23? maybe str(max(0, ... ));
* X cannot start out as -23 because the default is 1 and in any case if a 
negative value is read, schema.unit16() is going to throw and exception before 
it reaches the increment function.

* Good catch, I'll fix it.

* Me too, but in python I think it's clearer this way.

* I don't think it makes sense, as it's only being used here.


https://gerrit.osmocom.org/#/c/4704/2/src/osmo_gsm_tester/schema.py
File src/osmo_gsm_tester/schema.py:

Line 78: if n >= pow(2,16):
> 0: lol, why not just > 65535 ... python goes on to calculate 2 ** 16 every 
because it's clearer, but I can use 65535 and then write in a comment 2^16-1


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9f864bac05e39ec2fc305f774194799c3d8fe1b0
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: Yes


[MERGED] osmo-gsm-tester[master]: default-suites: Add test cases with octphy BTS

2017-11-07 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged.

Change subject: default-suites: Add test cases with octphy BTS
..


default-suites: Add test cases with octphy BTS

Change-Id: If8b5bda50c245ad693e7679ad44515b90a067fbb
---
M example/default-suites.conf
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/example/default-suites.conf b/example/default-suites.conf
index 5cf19ef..039ead8 100644
--- a/example/default-suites.conf
+++ b/example/default-suites.conf
@@ -13,6 +13,11 @@
 - voice:trx-sysmocell5000
 - ussd:trx-sysmocell5000
 - aoip_ussd:trx-sysmocell5000
+- sms:octphy
+- aoip_sms:octphy
+- ussd:octphy
+- aoip_ussd:octphy
+- voice:octphy
 - smpp
 - aoip_smpp
 - aoip_encryption

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If8b5bda50c245ad693e7679ad44515b90a067fbb
Gerrit-PatchSet: 4
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 


osmo-gsm-tester[master]: default-suites: Add test cases with octphy BTS

2017-11-07 Thread Pau Espin Pedrol

Patch Set 4: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: If8b5bda50c245ad693e7679ad44515b90a067fbb
Gerrit-PatchSet: 4
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