Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.04/i586

2017-05-26 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_16.04/i586

Package network:osmocom:nightly/libosmocore failed to build in 
xUbuntu_16.04/i586

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

Last lines of build log:
[  299s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33
[  299s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00
[  299s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00
[  299s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22
[  299s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33
[  299s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00
[  299s] -Success
[  299s] ./testsuite.at:63: exit code was 132, expected 0
[  299s] 10. testsuite.at:60: 10. coding (testsuite.at:60): FAILED 
(testsuite.at:63)
[  299s] debian/rules:26: recipe for target 'override_dh_auto_test' failed
[  299s] make[1]: *** [override_dh_auto_test] Error 1
[  299s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  299s] debian/rules:15: recipe for target 'build' failed
[  299s] make: *** [build] Error 2
[  299s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  299s] 
[  299s] cloud120 failed "build libosmocore_0.9.6.20170526.dsc" at Fri May 26 
19:54:50 UTC 2017.
[  299s] 
[  299s] ### VM INTERACTION START ###
[  299s] [  272.140130] serial8250: too much work for irq4
[  299s] [  272.200144] serial8250: too much work for irq4
[  299s] [  272.256087] serial8250: too much work for irq4
[  299s] [  272.316018] serial8250: too much work for irq4
[  299s] [  272.376015] serial8250: too much work for irq4
[  299s] [  272.436251] serial8250: too much work for irq4
[  303s] ### VM INTERACTION END ###
[  303s] 
[  303s] cloud120 failed "build libosmocore_0.9.6.20170526.dsc" at Fri May 26 
19:54:55 UTC 2017.
[  303s] 

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


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

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

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

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

Last lines of build log:
[  269s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02
[  269s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02
[  269s] -tch_hr_decode: n_errors=10 n_bits_total=456 ber=0.02
[  269s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00
[  269s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22
[  269s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33
[  269s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00
[  269s] -pdtch_decode: n_errors=0 n_bits_total=456 ber=0.00
[  269s] -pdtch_decode: n_errors=132 n_bits_total=588 ber=0.22
[  269s] -pdtch_decode: n_errors=220 n_bits_total=676 ber=0.33
[  269s] -pdtch_decode: n_errors=0 n_bits_total=444 ber=0.00
[  269s] -Success
[  269s] ./testsuite.at:63: exit code was 132, expected 0
[  269s] 10. testsuite.at:60: 10. coding (testsuite.at:60): FAILED 
(testsuite.at:63)
[  269s] debian/rules:26: recipe for target 'override_dh_auto_test' failed
[  269s] make[1]: *** [override_dh_auto_test] Error 1
[  269s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  269s] debian/rules:15: recipe for target 'build' failed
[  269s] make: *** [build] Error 2
[  269s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  269s] 
[  269s] cloud123 failed "build libosmocore_0.9.6.20170526.dsc" at Fri May 26 
19:54:55 UTC 2017.
[  269s] 
[  269s] ### VM INTERACTION START ###
[  271s] [  241.000577] reboot: Power down
[  273s] ### VM INTERACTION END ###
[  274s] 
[  274s] cloud123 failed "build libosmocore_0.9.6.20170526.dsc" at Fri May 26 
19:55:01 UTC 2017.
[  274s] 

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


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

2017-05-26 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmocore/xUbuntu_17.04/i586

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

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

Last lines of build log:
[  244s] -
[  244s] -[+] Testing: ??? (non-recursive, direct truncation, not punctured)
[  244s] -[.] Input length  : ret = 224  exp = 224 -> OK
[  244s] -[.] Output length : ret = 448  exp = 448 -> OK
[  244s] -[.] Pre computed vector checks:
[  244s] -[..] Encoding: OK
[  244s] -[..] Decoding: OK
[  244s] -[.] Random vector checks:
[  244s] -[..] Encoding / Decoding cycle : OK
[  244s] -[..] Encoding / Decoding cycle : OK
[  244s] -[..] Encoding / Decoding cycle : OK
[  244s] -
[  244s] ./testsuite.at:51: exit code was 132, expected 0
[  244s] 8. testsuite.at:48: 8. conv (testsuite.at:48): FAILED (testsuite.at:51)
[  244s] debian/rules:26: recipe for target 'override_dh_auto_test' failed
[  244s] make[1]: *** [override_dh_auto_test] Error 1
[  244s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  244s] debian/rules:15: recipe for target 'build' failed
[  244s] make: *** [build] Error 2
[  244s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  244s] 
[  244s] build33 failed "build libosmocore_0.9.6.20170526.dsc" at Fri May 26 
19:54:07 UTC 2017.
[  244s] 
[  244s] ### VM INTERACTION START ###
[  247s] [  225.830720] reboot: Power down
[  248s] ### VM INTERACTION END ###
[  248s] 
[  248s] build33 failed "build libosmocore_0.9.6.20170526.dsc" at Fri May 26 
19:54:12 UTC 2017.
[  248s] 

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


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

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

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

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

Last lines of build log:
[  265s] | This file was extended by libosmocore config.status 0.9.6.20170526, 
which was
[  265s] | generated by GNU Autoconf 2.69.  Invocation command line was
[  265s] | 
[  265s] |   CONFIG_FILES= 
[  265s] |   CONFIG_HEADERS  = 
[  265s] |   CONFIG_LINKS= 
[  265s] |   CONFIG_COMMANDS = 
[  265s] |   $ ./config.status Doxyfile.core
[  265s] | 
[  265s] | on cloud126
[  265s] | 
[  265s] | config.status:1166: creating Doxyfile.core
[  265s] 
[  265s] debian/rules:26: recipe for target 'override_dh_auto_test' failed
[  265s] make[1]: *** [override_dh_auto_test] Error 1
[  265s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  265s] debian/rules:15: recipe for target 'build' failed
[  265s] make: *** [build] Error 2
[  265s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  265s] 
[  265s] cloud126 failed "build libosmocore_0.9.6.20170526.dsc" at Fri May 26 
19:54:23 UTC 2017.
[  265s] 
[  265s] ### VM INTERACTION START ###
[  266s] Powering off.
[  266s] [  238.685715] reboot: Power down
[  269s] ### VM INTERACTION END ###
[  269s] 
[  269s] cloud126 failed "build libosmocore_0.9.6.20170526.dsc" at Fri May 26 
19:54:27 UTC 2017.
[  269s] 

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


openggsn[master]: libgtp: improve error logging and propagation

2017-05-26 Thread Max

Patch Set 2:

Looking at other functions in gtp.c I fail to determine common style. Some 
functions return 0 on errors, other return -1, yet other return 0 on success 
but EOF on errors. I can drop this part of the change - it turned out that the 
error I've been hunting down lies elsewhere so it doesn't really matter. What 
do you think?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie07f1e4246eb178838b7df21946a08a1f60f2084
Gerrit-PatchSet: 2
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


[PATCH] osmo-bts[master]: measurement: fix measurement computation

2017-05-26 Thread dexter
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/2412

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

measurement: fix measurement computation

Timing advance is currently not taken into account when computing
the measurement results, this commit fixes that

Change-Id: I2e0dfd13b53e8aa2822985f12bf2985e683ab553
---
M include/osmo-bts/measurement.h
M src/common/measurement.c
M src/common/rsl.c
3 files changed, 56 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/12/2412/9

diff --git a/include/osmo-bts/measurement.h b/include/osmo-bts/measurement.h
index 2efe40f..87c8109 100644
--- a/include/osmo-bts/measurement.h
+++ b/include/osmo-bts/measurement.h
@@ -1,6 +1,9 @@
 #ifndef OSMO_BTS_MEAS_H
 #define OSMO_BTS_MEAS_H
 
+#define MEAS_MAX_TIMING_ADVANCE 63
+#define MEAS_MIN_TIMING_ADVANCE 0
+
 int lchan_new_ul_meas(struct gsm_lchan *lchan, struct bts_ul_meas *ulm);
 
 int trx_meas_check_compute(struct gsm_bts_trx *trx, uint32_t fn);
diff --git a/src/common/measurement.c b/src/common/measurement.c
index 22ab27c..aed5847 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -196,6 +196,50 @@
return 7;
 }
 
+/* Update order  TA at end of meas period */
+static void lchan_meas_update_ordered_TA(struct gsm_lchan *lchan,
+int32_t taqb_sum)
+{
+   int32_t ms_timing_offset = 0;
+   uint8_t l1_info_valid;
+
+   l1_info_valid = lchan->meas.flags & LC_UL_M_F_L1_VALID;
+
+   if (l1_info_valid) {
+   DEBUGP(DMEAS,
+  "%s Update TA TimingOffset_Mean:%d, UL RX TA:%d, DL 
ordered TA:%d, flags:%d \n",
+  gsm_lchan_name(lchan), taqb_sum, lchan->meas.l1_info[1],
+  lchan->rqd_ta, lchan->meas.flags);
+
+   ms_timing_offset =
+   taqb_sum + (lchan->meas.l1_info[1] - lchan->rqd_ta);
+
+   if (ms_timing_offset > 0) {
+   if (lchan->rqd_ta < MEAS_MAX_TIMING_ADVANCE) {
+   /* MS is moving away from BTS.
+* So increment Ordered TA by 1 */
+   lchan->rqd_ta++;
+   }
+   } else if (ms_timing_offset < 0) {
+   if (lchan->rqd_ta > MEAS_MIN_TIMING_ADVANCE) {
+   /* MS is moving toward BTS. So decrement
+* Ordered TA by 1 */
+   lchan->rqd_ta--;
+   }
+   }
+
+   DEBUGP(DMEAS,
+  "%s New Update TA--> TimingOff_diff:%d, UL RX TA:%d, DL 
ordered TA:%d \n",
+  gsm_lchan_name(lchan), ms_timing_offset,
+  lchan->meas.l1_info[1], lchan->rqd_ta);
+   }
+
+   /*Clear L1 INFO valid flag at Meas period end */
+   lchan->meas.flags &= ~LC_UL_M_F_L1_VALID;
+
+   return;
+}
+
 int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn)
 {
struct gsm_meas_rep_unidir *mru;
@@ -206,6 +250,7 @@
int32_t taqb_sum = 0;
unsigned int num_meas_sub = 0;
int i;
+   int32_t ms_timing_offset = 0;
 
/* if measurement period is not complete, abort */
if (!is_meas_complete(ts_pchan(lchan->ts), lchan->ts->nr,
@@ -241,6 +286,9 @@
if (num_meas_sub) {
ber_sub_sum = ber_sub_sum / num_meas_sub;
irssi_sub_sum = irssi_sub_sum / num_meas_sub;
+   } else {
+   ber_sub_sum = ber_full_sum;
+   irssi_sub_sum = irssi_full_sum;
}
 
DEBUGP(DMEAS, "%s Computed TA(% 4dqb) BER-FULL(%2u.%02u%%), 
RSSI-FULL(-%3udBm), "
@@ -249,6 +297,9 @@
ber_full_sum%100, irssi_full_sum, ber_sub_sum/100, 
ber_sub_sum%100,
irssi_sub_sum);
 
+   /*Update ordered TA for DL SACCH L1 Header */
+   lchan_meas_update_ordered_TA(lchan, taqb_sum);
+
/* store results */
mru = >meas.ul_res;
mru->full.rx_lev = dbm2rxlev((int)irssi_full_sum * -1);
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 51d23d6..a1b5953 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -2267,7 +2267,8 @@
msgb_tv_put(msg, RSL_IE_BS_POWER, lchan->meas.bts_tx_pwr);
if (lchan->meas.flags & LC_UL_M_F_L1_VALID) {
msgb_tv_fixed_put(msg, RSL_IE_L1_INFO, 2, lchan->meas.l1_info);
-   lchan->meas.flags &= ~LC_UL_M_F_L1_VALID;
+   /* Note: L1 info valid flag is cleared by function
+* lchan_meas_update_ordered_TA() in measurement.c */
}
msgb_tl16v_put(msg, RSL_IE_L3_INFO, l3_len, l3);
if (ms_to_valid(lchan)) {

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: 

[PATCH] osmo-ci[master]: Introduce artifacts holding dependencies to speed up builds.

2017-05-26 Thread blobb
Hello Neels Hofmeyr, Harald Welte,

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

https://gerrit.osmocom.org/2465

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

Introduce artifacts holding dependencies to speed up builds.

Basically, osmo-build.sh holds logic to check whether the necessary
artifact is available. If so it fetches artifact, unpacks it and
triggers the actual build. In case the necessary artifact is not
available osmo-build.sh simply builds all dependencies from source
by using osmo-build-dep.sh and archives deps to the ARTIFACT_STORE
afterwards.

The necessary functions to determine the artifact name from remote and
local repositories as well as the handling of artifact files live in
osmo-artifacts.sh, which is sourced by osmo-build.sh.

osmo-build.sh will be sourced by the contrib/jenkins.sh build script
inside each git repository and invoked via 'build'.
See jenkins-openBsc.sh [1] for more details.

Artifacts will be stored as follows:

$ARTIFACT_STORE/$JOB_NAME/.._...
..._...tar.gz

Furthermore, ARTIFACT_STORE environment variable has to be set on all
jenkins slaves. The JOB_NAME variables is injected to each jenkins job
by jenkins.

[1] https://github.com/blobbsen/diy-artifacts/blob/master/jenkins-openBSC.sh

Change-Id: Ifee0a2f837d23b19aa5326f810234d5452e47484
---
A scripts/osmo-build.sh
1 file changed, 234 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/65/2465/9

diff --git a/scripts/osmo-build.sh b/scripts/osmo-build.sh
new file mode 100644
index 000..199cf1d
--- /dev/null
+++ b/scripts/osmo-build.sh
@@ -0,0 +1,234 @@
+#!/bin/bash
+#
+# This script enables artifacts holding dependencies on a jenkins job level to
+# speed up builds. Basically, it holds logic to check whether the necessary 
artifact
+# is available. If so it fetches artifact, unpacks it and if cp/tar succeeded
+# it triggers the actual build.
+#
+# Otherwise it simply builds all dependencies from source by using 
osmo-build-dep.sh
+# and archives deps to the ARTIFACT_STORE afterwards. Revisions of locally 
built
+# dependencies are detrmined after dependencies are built to ensure catching 
new
+# changes in dep_n+1 meanwhile dep_n building.
+#
+# Furthermore, ARTIFACT_STORE environment variable has to be set on all 
jenkins slaves.
+# The JOB_NAME variables will be injected to each jenkins' job by jenkins 
itself.
+# When using script within a docker container one must inject jenkins' 
JOB_NAME variable
+# to the container and ensure that ARTIFACT_STORE is mounted to the container's
+# internal ARTIFACT_STORE.
+#
+# Artifacts will be stored as follows:
+#
+#  $ARTIFACT_STORE/$JOB_NAME/.._...
+#  ..._...tar.gz
+#
+# Note: each matrix-build has its own directory inside ARTIFACT_STORE.
+#
+# In order to make use of osmo-build.sh one needs to source it, e.g. from
+# ./contrib/jenkins.sh. Furthermore, jenkins should check out the git tree of
+# the project to be built in the workspace root. Following functions needs to 
be
+# declared within a build script that sources osmo-build.sh:
+#
+#  - generic_deps()
+#  - build_project()
+#
+# This is an example for building "libosmo-netif" which depends on 
"libosmocore"
+# and "libosmo-abis".
+#
+# #!/bin/bash
+#
+# # osmo-build.sh must be in PATH
+#  source osmo-build.sh
+#
+#  generic_deps() {
+#   # Holds all required dependencies in the following form:
+#   #
+#   #  x="$( $1   )"
+#   #
+#   # $1 will be one of these script/functions:
+#   # - osmo-build-dep.sh: build a source tree
+#   # - artifact_name_by_local_repos()
+#   # - artifact_name_by_remote_repos()
+#   #
+#   # The arguments are:
+#   #
+#   # - PARALLEL_MAKE: override global PARALLEL_MAKE used for make,
+#   #  (e.g. PARALLEL_MAKE="-j1" to disable mutlithreading)
+#   # - dep_project: the git repository name, gets places in a git.osmocom.org 
URL.
+#   # - branch: branch (optional: default = master)
+#   # - arg 3: configuration (optional: $cfg used in osmo-build-dep.sh)
+#
+#  x="$($1 libosmocore master ac_cv_path_DOXYGEN=false)"
+#  
"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find 
. -name "*.[hc]")
+#  x="${x}_$($1 libosmo-abis)"
+#
+#  echo "${x}.tar.gz"
+#  }
+#
+#  build_project() {
+#  # Necessary commands to build the project, expecting all 
dependencies have
+#  # been build or fetched. Commands within build_project() will 
be executed
+#  # in jenkins' $WORKSPACE.
+#
+#  autoreconf --install --force
+#  ./configure --enable-sanitize
+#  $MAKE $PARALLEL_MAKE
+#  $MAKE distcheck || cat-testlogs.sh
+#  }
+#
+#  build
+#
+
+
+# BUILD FUNCTIONS
+init_build() {
+
+   if [ -z "$JOB_NAME" ]; then
+   set +x
+   echo
+   echo "[ERROR] JOB_NAME variable is not set, running in 

[PATCH] osmo-bts[master]: Implement basic Get Attribute responder

2017-05-26 Thread Max
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/2545

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

Implement basic Get Attribute responder

Add 3GPP TS 52.021 §8.11.2 Get Attribute Response handling:
* report OsmoBTS version
* report sysmoBTS sub-model
* report OsmoBTS variant

Requires I7ecb0c4339530d3a8354a2f94b34063dda87e030 in OpenBSC.

Change-Id: I09f95ed995fab5def9dc6e8cc201012fba4db28d
Related: OS#1614
---
M src/common/oml.c
M src/osmo-bts-sysmo/l1_if.c
2 files changed, 136 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/45/2545/7

diff --git a/src/common/oml.c b/src/common/oml.c
index 9d65d83..3f0f238 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -24,6 +24,8 @@
  * Operation and Maintainance Messages
  */
 
+#include "btsconfig.h"
+
 #include 
 #include 
 #include 
@@ -31,6 +33,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -148,6 +151,93 @@
 get_value_string(abis_nm_obj_class_names, mo->obj_class),
 mo->obj_inst.bts_nr, mo->obj_inst.trx_nr, mo->obj_inst.ts_nr);
return mo_buf;
+}
+
+static inline struct msgb *add_bts_attr(const struct gsm_bts *bts)
+{
+   struct msgb *a = oml_msgb_alloc();
+
+   if (!a)
+   return NULL;
+
+   abis_nm_put_sw_file(a, btstype2str(GSM_BTS_TYPE_OSMOBTS), 
PACKAGE_VERSION, true);
+   abis_nm_put_sw_file(a, btsatttr2str(BTS_TYPE_VARIANT), 
btsvariant2str(bts->variant), true);
+
+   if (bts->sub_model)
+   abis_nm_put_sw_file(a, btsatttr2str(BTS_SUB_MODEL), 
bts->sub_model, true);
+
+   return a;
+}
+
+static inline int handle_attr(const struct gsm_abis_mo *mo, const uint8_t 
*attr, uint16_t attr_len, uint8_t *out)
+{
+   uint16_t i, attr_out_index = 1; /* byte 0 is reserved for unsupported 
attributes counter */
+   struct msgb *ba = NULL;
+   int length;
+
+   for (i = 0; i < attr_len; i++) {
+   switch (attr[i]) {
+   case NM_ATT_SW_CONFIG:
+   switch (mo->obj_class) {
+   case NM_OC_BTS:
+   ba = add_bts_attr(mo->bts);
+   break;
+   default:
+   LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s 
in Get Attribute Response\n",
+get_value_string(abis_nm_obj_class_names, 
mo->obj_class));
+   return -EINVAL;
+   }
+   break;
+   default:
+   LOGP(DOML, LOGL_ERROR, "O Get Attributes [%u], %s is 
unsupported.\n", i,
+get_value_string(abis_nm_att_names, attr[i]));
+   out[attr_out_index] = attr[i];
+   attr_out_index++;
+   }
+   }
+
+   if (attr_out_index - 1 > 255) { /* The number of attributes in §9.4.26 
List of Required Attributes is 2 bytes,
+  but the Count of not-reported 
attributes from §9.4.64 is 1 byte */
+   LOGP(DOML, LOGL_ERROR, "O Get Attributes, Count of 
not-reported attributes is too big: %u\n",
+attr_out_index - 1);
+   out[0] = 255;
+   } else
+   out[0] = attr_out_index - 1; /* Count number of unhandled 
attributes */
+
+   length = attr_out_index + 1;
+
+   if (ba) {
+   memcpy(out + attr_out_index, msgb_data(ba), ba->len);
+   length += ba->len;
+   msgb_free(ba);
+   }
+
+   return length;
+}
+
+/* send 3GPP TS 52.021 §8.11.2 Get Attribute Response */
+static int oml_tx_attr_resp(struct gsm_abis_mo *mo, const uint8_t *attr, 
uint16_t attr_len)
+{
+   struct msgb *nmsg = oml_msgb_alloc();
+   uint8_t resp[MAX_VERSION_LENGTH * attr_len * 2]; /* heuristic for 
Attribute Response Info space requirements */
+   int len;
+
+   LOGP(DOML, LOGL_INFO, "%s Tx Get Attribute Response\n", 
gsm_abis_mo_name(mo));
+
+   if (!nmsg)
+   return -ENOMEM;
+
+   len = handle_attr(mo, attr, attr_len, resp);
+   if (len < 0) {
+   LOGP(DOML, LOGL_ERROR, "Tx Get Attribute Response FAILED with 
%d\n", len);
+   msgb_free(nmsg);
+   return len;
+   }
+
+   /* §9.4.64 Get Attribute Response Info */
+   msgb_tl16v_put(nmsg, NM_ATT_GET_ARI, len, resp);
+
+   return oml_mo_send_msg(mo, nmsg, NM_MT_GET_ATTR_RESP);
 }
 
 /* 8.8.1 sending State Changed Event Report */
@@ -368,6 +458,45 @@
dl_set_t200(>lapdm_dcch.datalink[DL_SAPI3], t200_dcch_sapi3);
dl_set_t200(>lapdm_acch.datalink[DL_SAPI0], t200_acch);
dl_set_t200(>lapdm_acch.datalink[DL_SAPI3], t200_acch_sapi3);
+
+   return 0;
+}
+
+/* 3GPP TS 52.021 §8.11.1 Get Attributes has been received */
+static int oml_rx_get_attr(struct 

osmo-bts[master]: measurement: fix measurement computation

2017-05-26 Thread Max

Patch Set 8:

(2 comments)

https://gerrit.osmocom.org/#/c/2412/8/src/common/measurement.c
File src/common/measurement.c:

Line 229:   } else {
I don't think we use empty-else-with-comment style anywhere else. Just the 
comment would be enough.


Line 238:   /*Do Nothing */
Same here except that "do nothing" comment does not have much value.


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

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


[ABANDON] openbsc[master]: lchan: add ms_timing_offset member to struct gsm_lchan

2017-05-26 Thread dexter
dexter has abandoned this change.

Change subject: lchan: add ms_timing_offset member to struct gsm_lchan
..


Abandoned

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ifc4cff7efa4ba0a4b94448767143dd18b6db9325
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 


[MERGED] libosmo-abis[master]: Revert "ipacces.c: Remove ipa_bts_id_resp() and use libosmoc...

2017-05-26 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Revert "ipacces.c: Remove ipa_bts_id_resp() and use libosmocore"
..


Revert "ipacces.c: Remove ipa_bts_id_resp() and use libosmocore"

This reverts commit d517db06ced45bbe0a70799487964e52edd8a375, which for
some reason broke the IPA client functionality.  This needs to be
investigated and properly fixed.  But until that happens: revert.

Change-Id: Ic168f437c5bf1fcdb7441b0541c80a4805463004
---
M src/input/ipaccess.c
1 file changed, 85 insertions(+), 4 deletions(-)

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



diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index fb2e30d..ac84ffc 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -567,6 +567,90 @@
return ret;
 }
 
+#define IPA_STRING_MAX 64
+
+static struct msgb *
+ipa_bts_id_resp(struct ipaccess_unit *dev, uint8_t *data, int len, int trx_nr)
+{
+   struct msgb *nmsg;
+   char str[IPA_STRING_MAX];
+   uint8_t *tag;
+
+   memset(str, 0, sizeof(str));
+
+   nmsg = ipa_msg_alloc(0);
+   if (!nmsg)
+   return NULL;
+
+   *msgb_put(nmsg, 1) = IPAC_MSGT_ID_RESP;
+   while (len) {
+   if (len < 2) {
+   LOGP(DLINP, LOGL_NOTICE,
+   "Short read of ipaccess tag\n");
+   msgb_free(nmsg);
+   return NULL;
+   }
+   switch (data[1]) {
+   case IPAC_IDTAG_UNIT:
+   snprintf(str, sizeof(str), "%u/%u/%u",
+   dev->site_id, dev->bts_id, trx_nr);
+   break;
+   case IPAC_IDTAG_MACADDR:
+   snprintf(str, sizeof(str),
+"%02x:%02x:%02x:%02x:%02x:%02x",
+dev->mac_addr[0], dev->mac_addr[1],
+dev->mac_addr[2], dev->mac_addr[3],
+dev->mac_addr[4], dev->mac_addr[5]);
+   break;
+   case IPAC_IDTAG_LOCATION1:
+   if (dev->location1)
+   strncpy(str, dev->location1, IPA_STRING_MAX);
+   break;
+   case IPAC_IDTAG_LOCATION2:
+   if (dev->location2)
+   strncpy(str, dev->location2, IPA_STRING_MAX);
+   break;
+   case IPAC_IDTAG_EQUIPVERS:
+   if (dev->equipvers)
+   strncpy(str, dev->equipvers, IPA_STRING_MAX);
+   break;
+   case IPAC_IDTAG_SWVERSION:
+   if (dev->swversion)
+   strncpy(str, dev->swversion, IPA_STRING_MAX);
+   break;
+   case IPAC_IDTAG_UNITNAME:
+   snprintf(str, sizeof(str),
+"%s-%02x-%02x-%02x-%02x-%02x-%02x",
+dev->unit_name,
+dev->mac_addr[0], dev->mac_addr[1],
+dev->mac_addr[2], dev->mac_addr[3],
+dev->mac_addr[4], dev->mac_addr[5]);
+   break;
+   case IPAC_IDTAG_SERNR:
+   if (dev->serno)
+   strncpy(str, dev->serno, IPA_STRING_MAX);
+   break;
+   default:
+   LOGP(DLINP, LOGL_NOTICE,
+   "Unknown ipaccess tag 0x%02x\n", *data);
+   msgb_free(nmsg);
+   return NULL;
+   }
+   str[IPA_STRING_MAX-1] = '\0';
+
+   LOGP(DLINP, LOGL_INFO, " tag %d: %s\n", data[1], str);
+   tag = msgb_put(nmsg, 3 + strlen(str) + 1);
+   tag[0] = 0x00;
+   tag[1] = 1 + strlen(str) + 1;
+   tag[2] = data[1];
+   memcpy(tag + 3, str, strlen(str) + 1);
+   data += 2;
+   len -= 2;
+   }
+   ipa_msg_push_header(nmsg, IPAC_PROTO_IPACCESS);
+   return nmsg;
+}
+
 static struct msgb *ipa_bts_id_ack(void)
 {
struct msgb *nmsg2;
@@ -614,16 +698,13 @@
if (msg_type == IPAC_MSGT_ID_GET) {
uint8_t *data = msgb_l2(msg);
int len = msgb_l2len(msg);
-   int old_trx_nr = dev->trx_id;
int trx_nr = 0;
 
if (link->ofd->priv_nr >= E1INP_SIGN_RSL)
trx_nr = link->ofd->priv_nr - E1INP_SIGN_RSL;
 
LOGP(DLINP, LOGL_NOTICE, "received ID get\n");
-   dev->trx_id = trx_nr;
-   rmsg = ipa_ccm_make_id_resp_from_req(dev, 

libosmo-abis[master]: Revert "ipacces.c: Remove ipa_bts_id_resp() and use libosmoc...

2017-05-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[PATCH] libosmo-abis[master]: Revert "ipacces.c: Remove ipa_bts_id_resp() and use libosmoc...

2017-05-26 Thread Harald Welte

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

Revert "ipacces.c: Remove ipa_bts_id_resp() and use libosmocore"

This reverts commit d517db06ced45bbe0a70799487964e52edd8a375, which for
some reason broke the IPA client functionality.  This needs to be
investigated and properly fixed.  But until that happens: revert.

Change-Id: Ic168f437c5bf1fcdb7441b0541c80a4805463004
---
M src/input/ipaccess.c
1 file changed, 85 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/49/2749/1

diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index fb2e30d..ac84ffc 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -567,6 +567,90 @@
return ret;
 }
 
+#define IPA_STRING_MAX 64
+
+static struct msgb *
+ipa_bts_id_resp(struct ipaccess_unit *dev, uint8_t *data, int len, int trx_nr)
+{
+   struct msgb *nmsg;
+   char str[IPA_STRING_MAX];
+   uint8_t *tag;
+
+   memset(str, 0, sizeof(str));
+
+   nmsg = ipa_msg_alloc(0);
+   if (!nmsg)
+   return NULL;
+
+   *msgb_put(nmsg, 1) = IPAC_MSGT_ID_RESP;
+   while (len) {
+   if (len < 2) {
+   LOGP(DLINP, LOGL_NOTICE,
+   "Short read of ipaccess tag\n");
+   msgb_free(nmsg);
+   return NULL;
+   }
+   switch (data[1]) {
+   case IPAC_IDTAG_UNIT:
+   snprintf(str, sizeof(str), "%u/%u/%u",
+   dev->site_id, dev->bts_id, trx_nr);
+   break;
+   case IPAC_IDTAG_MACADDR:
+   snprintf(str, sizeof(str),
+"%02x:%02x:%02x:%02x:%02x:%02x",
+dev->mac_addr[0], dev->mac_addr[1],
+dev->mac_addr[2], dev->mac_addr[3],
+dev->mac_addr[4], dev->mac_addr[5]);
+   break;
+   case IPAC_IDTAG_LOCATION1:
+   if (dev->location1)
+   strncpy(str, dev->location1, IPA_STRING_MAX);
+   break;
+   case IPAC_IDTAG_LOCATION2:
+   if (dev->location2)
+   strncpy(str, dev->location2, IPA_STRING_MAX);
+   break;
+   case IPAC_IDTAG_EQUIPVERS:
+   if (dev->equipvers)
+   strncpy(str, dev->equipvers, IPA_STRING_MAX);
+   break;
+   case IPAC_IDTAG_SWVERSION:
+   if (dev->swversion)
+   strncpy(str, dev->swversion, IPA_STRING_MAX);
+   break;
+   case IPAC_IDTAG_UNITNAME:
+   snprintf(str, sizeof(str),
+"%s-%02x-%02x-%02x-%02x-%02x-%02x",
+dev->unit_name,
+dev->mac_addr[0], dev->mac_addr[1],
+dev->mac_addr[2], dev->mac_addr[3],
+dev->mac_addr[4], dev->mac_addr[5]);
+   break;
+   case IPAC_IDTAG_SERNR:
+   if (dev->serno)
+   strncpy(str, dev->serno, IPA_STRING_MAX);
+   break;
+   default:
+   LOGP(DLINP, LOGL_NOTICE,
+   "Unknown ipaccess tag 0x%02x\n", *data);
+   msgb_free(nmsg);
+   return NULL;
+   }
+   str[IPA_STRING_MAX-1] = '\0';
+
+   LOGP(DLINP, LOGL_INFO, " tag %d: %s\n", data[1], str);
+   tag = msgb_put(nmsg, 3 + strlen(str) + 1);
+   tag[0] = 0x00;
+   tag[1] = 1 + strlen(str) + 1;
+   tag[2] = data[1];
+   memcpy(tag + 3, str, strlen(str) + 1);
+   data += 2;
+   len -= 2;
+   }
+   ipa_msg_push_header(nmsg, IPAC_PROTO_IPACCESS);
+   return nmsg;
+}
+
 static struct msgb *ipa_bts_id_ack(void)
 {
struct msgb *nmsg2;
@@ -614,16 +698,13 @@
if (msg_type == IPAC_MSGT_ID_GET) {
uint8_t *data = msgb_l2(msg);
int len = msgb_l2len(msg);
-   int old_trx_nr = dev->trx_id;
int trx_nr = 0;
 
if (link->ofd->priv_nr >= E1INP_SIGN_RSL)
trx_nr = link->ofd->priv_nr - E1INP_SIGN_RSL;
 
LOGP(DLINP, LOGL_NOTICE, "received ID get\n");
-   dev->trx_id = trx_nr;
-   rmsg = ipa_ccm_make_id_resp_from_req(dev, data + 1, len 
- 1);
-   dev->trx_id = old_trx_nr;
+   rmsg = ipa_bts_id_resp(dev, data + 1, len - 1, trx_nr);

[PATCH] openbsc[master]: Enable optional static builds

2017-05-26 Thread Max

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

Enable optional static builds

* use LT_INIT instead of AC_PROG_RANLIB
* remove redundant libbsc entries

The default (for both manual and .deb builds) is to use shared build (as
before) - the static build is entirely optional.

Based on work by Sergey Kostanbaev  and
Alexander Chemeris .

Change-Id: Ibcd1da98302413182c85e25c4cb7d69d9e38c35a
---
M openbsc/configure.ac
M openbsc/src/osmo-bsc/Makefile.am
M openbsc/tests/abis/Makefile.am
3 files changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/48/2748/1

diff --git a/openbsc/configure.ac b/openbsc/configure.ac
index c6ae159..ff51ccf 100644
--- a/openbsc/configure.ac
+++ b/openbsc/configure.ac
@@ -16,7 +16,7 @@
 AC_PROG_MAKE_SET
 AC_PROG_CC
 AC_PROG_INSTALL
-AC_PROG_RANLIB
+LT_INIT
 
 dnl check for pkg-config (explained in detail in libosmocore/configure.ac)
 AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no)
diff --git a/openbsc/src/osmo-bsc/Makefile.am b/openbsc/src/osmo-bsc/Makefile.am
index 6f836b0..ae9410c 100644
--- a/openbsc/src/osmo-bsc/Makefile.am
+++ b/openbsc/src/osmo-bsc/Makefile.am
@@ -43,7 +43,6 @@
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libcommon-cs/libcommon-cs.a \
$(top_builddir)/src/libmsc/libmsc.a \
-   $(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libtrau/libtrau.a \
$(top_builddir)/src/libcommon/libcommon.a \
$(LIBOSMOSCCP_LIBS) \
diff --git a/openbsc/tests/abis/Makefile.am b/openbsc/tests/abis/Makefile.am
index cbc3e07..1c5dede 100644
--- a/openbsc/tests/abis/Makefile.am
+++ b/openbsc/tests/abis/Makefile.am
@@ -27,7 +27,6 @@
 abis_test_LDADD = \
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libcommon/libcommon.a \
-   $(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libtrau/libtrau.a \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOABIS_LIBS) \

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibcd1da98302413182c85e25c4cb7d69d9e38c35a
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max 


[PATCH] osmo-gsm-manuals[master]: OsmoBTS: Update osmotrx ip to diff between local and remote

2017-05-26 Thread Pau Espin Pedrol

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

OsmoBTS: Update osmotrx ip to diff between local and remote

Change-Id: Ia4c70b3b8436e2647fc35d579a302dfbf32a83f0
---
M OsmoBTS/chapters/bts-models.adoc
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/OsmoBTS/chapters/bts-models.adoc b/OsmoBTS/chapters/bts-models.adoc
index 1c619d3..2761da0 100644
--- a/OsmoBTS/chapters/bts-models.adoc
+++ b/OsmoBTS/chapters/bts-models.adoc
@@ -224,10 +224,10 @@
 
  at the 'PHY' configuration node
 
-= `osmotrx ip HOST`
+= `osmotrx ip (local|remote) HOST`
 
-Set the IP address of the OsmoTRX transceiver to which we should connect
-to.
+Set the IP address for the OsmoTRX interface for either the local (OsmoBTS) or
+remote (OsmoTRX) side of the UDP flows.
 
 = `osmotrx base-port (local|remote) <0-65535>`
 

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

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


[PATCH] osmo-bts[master]: trx: Allow BTS and TRX to be on different IPs

2017-05-26 Thread Pau Espin Pedrol

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

trx: Allow BTS and TRX to be on different IPs

Depends on libosmocore I3c655a4af64fb80497a5aaa811cce8005dba9cd9

Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5
---
M include/osmo-bts/phy_link.h
M src/osmo-bts-trx/main.c
M src/osmo-bts-trx/trx_if.c
M src/osmo-bts-trx/trx_if.h
M src/osmo-bts-trx/trx_vty.c
5 files changed, 36 insertions(+), 44 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/45/2745/1

diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h
index e8fd7eb..2164dfa 100644
--- a/include/osmo-bts/phy_link.h
+++ b/include/osmo-bts/phy_link.h
@@ -37,7 +37,8 @@
struct {
} sysmobts;
struct {
-   char *transceiver_ip;
+   char *local_ip;
+   char *remote_ip;
uint16_t base_port_local;
uint16_t base_port_remote;
struct osmo_fd trx_ofd_clk;
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index 0148e5b..b2cbb39 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -113,7 +113,8 @@
 
 void bts_model_phy_link_set_defaults(struct phy_link *plink)
 {
-   plink->u.osmotrx.transceiver_ip = talloc_strdup(plink, "127.0.0.1");
+   plink->u.osmotrx.local_ip = talloc_strdup(plink, "127.0.0.1");
+   plink->u.osmotrx.remote_ip = talloc_strdup(plink, "127.0.0.1");
plink->u.osmotrx.base_port_local = 5800;
plink->u.osmotrx.base_port_remote = 5700;
plink->u.osmotrx.clock_advance = 20;
diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index 989e77a..c676d11 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -57,14 +57,10 @@
  */
 
 /* open socket */
-static int trx_udp_open(void *priv, struct osmo_fd *ofd, const char *host,
-   uint16_t port_local, uint16_t port_remote,
+static int trx_udp_open(void *priv, struct osmo_fd *ofd, const char 
*host_local,
+   uint16_t port_local, const char *host_remote, uint16_t 
port_remote,
int (*cb)(struct osmo_fd *fd, unsigned int what))
 {
-   struct sockaddr_storage sas;
-   struct sockaddr *sa = (struct sockaddr *)
-   socklen_t sa_len;
-
int rc;
 
/* Init */
@@ -72,30 +68,10 @@
ofd->cb = cb;
ofd->data = priv;
 
-   /* Listen / Binds */
-   rc = osmo_sock_init_ofd(ofd, AF_UNSPEC, SOCK_DGRAM, 0, host,
-   port_local, OSMO_SOCK_F_BIND);
+   /* Listen / Binds + Connect */
+   rc = osmo_sock_init2_ofd(ofd, AF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, 
host_local, port_local,
+   host_remote, port_remote, OSMO_SOCK_F_BIND | 
OSMO_SOCK_F_CONNECT);
if (rc < 0)
-   return rc;
-
-   /* Connect */
-   sa_len = sizeof(sas);
-   rc = getsockname(ofd->fd, sa, _len);
-   if (rc)
-   return rc;
-
-   if (sa->sa_family == AF_INET) {
-   struct sockaddr_in *sin = (struct sockaddr_in *)sa;
-   sin->sin_port = htons(port_remote);
-   } else if (sa->sa_family == AF_INET6) {
-   struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
-   sin6->sin6_port = htons(port_remote);
-   } else {
-   return -EINVAL;
-   }
-
-   rc = connect(ofd->fd, sa, sa_len);
-   if (rc)
return rc;
 
return 0;
@@ -528,8 +504,9 @@
 
/* open the shared/common clock socket */
rc = trx_udp_open(plink, >u.osmotrx.trx_ofd_clk,
- plink->u.osmotrx.transceiver_ip,
+ plink->u.osmotrx.local_ip,
  plink->u.osmotrx.base_port_local,
+ plink->u.osmotrx.remote_ip,
  plink->u.osmotrx.base_port_remote,
  trx_clk_read_cb);
if (rc < 0) {
@@ -588,14 +565,16 @@
 
/* open sockets */
rc = trx_udp_open(l1h, >trx_ofd_ctrl,
- plink->u.osmotrx.transceiver_ip,
+ plink->u.osmotrx.local_ip,
  compute_port(pinst, 0, 0),
+ plink->u.osmotrx.remote_ip,
  compute_port(pinst, 1, 0), trx_ctrl_read_cb);
if (rc < 0)
goto err;
rc = trx_udp_open(l1h, >trx_ofd_data,
- plink->u.osmotrx.transceiver_ip,
+ plink->u.osmotrx.local_ip,
  compute_port(pinst, 0, 1),
+ plink->u.osmotrx.remote_ip,
  compute_port(pinst, 1, 1), trx_data_read_cb);
if (rc < 0)
goto err;
diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h
index fdc8a8d..05e8bff 100644
--- a/src/osmo-bts-trx/trx_if.h
+++ b/src/osmo-bts-trx/trx_if.h
@@ 

[PATCH] osmo-bts[master]: trx: Save osmotrx base-port vty properties

2017-05-26 Thread Pau Espin Pedrol

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

trx: Save osmotrx base-port vty properties

Change-Id: I0898a8c4eb3899fc1c0f6b17da33b8c7851b90d6
---
M src/osmo-bts-trx/trx_vty.c
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/2746/1

diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c
index 18e4788..5a22fb0 100644
--- a/src/osmo-bts-trx/trx_vty.c
+++ b/src/osmo-bts-trx/trx_vty.c
@@ -502,6 +502,13 @@
vty_out(vty, " osmotrx ip remote %s%s",
plink->u.osmotrx.remote_ip, VTY_NEWLINE);
 
+   if (plink->u.osmotrx.base_port_local)
+   vty_out(vty, " osmotrx base-port local %"PRIu16"%s",
+   plink->u.osmotrx.base_port_local, VTY_NEWLINE);
+   if (plink->u.osmotrx.base_port_remote)
+   vty_out(vty, " osmotrx base-port remote %"PRIu16"%s",
+   plink->u.osmotrx.base_port_remote, VTY_NEWLINE);
+
vty_out(vty, " osmotrx fn-advance %d%s",
plink->u.osmotrx.clock_advance, VTY_NEWLINE);
vty_out(vty, " osmotrx rts-advance %d%s",

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

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


[PATCH] libosmocore[master]: socket: Add osmo_sock_init2_ofd() function

2017-05-26 Thread Pau Espin Pedrol

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

socket: Add osmo_sock_init2_ofd() function

Will be used by osmo-bts-trx

Change-Id: I3c655a4af64fb80497a5aaa811cce8005dba9cd9
---
M include/osmocom/core/socket.h
M src/socket.c
2 files changed, 27 insertions(+), 0 deletions(-)


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

diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h
index e19e8f2..09376c3 100644
--- a/include/osmocom/core/socket.h
+++ b/include/osmocom/core/socket.h
@@ -31,6 +31,10 @@
 int osmo_sock_init_ofd(struct osmo_fd *ofd, int family, int type, int proto,
const char *host, uint16_t port, unsigned int flags);
 
+int osmo_sock_init2_ofd(struct osmo_fd *ofd, int family, int type, int proto,
+   const char *local_host, uint16_t local_port,
+   const char *remote_host, uint16_t remote_port, unsigned 
int flags);
+
 int osmo_sock_init_sa(struct sockaddr *ss, uint16_t type,
  uint8_t proto, unsigned int flags);
 
diff --git a/src/socket.c b/src/socket.c
index ad0f69b..9d22d61 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -363,6 +363,29 @@
return osmo_fd_init_ofd(ofd, osmo_sock_init(family, type, proto, host, 
port, flags));
 }
 
+/*! \brief Initialize a socket and fill \ref osmo_fd
+ *  \param[out] ofd file descriptor (will be filled in)
+ *  \param[in] family Address Family like AF_INET, AF_INET6, AF_UNSPEC
+ *  \param[in] type Socket type like SOCK_DGRAM, SOCK_STREAM
+ *  \param[in] proto Protocol like IPPROTO_TCP, IPPROTO_UDP
+ *  \param[in] local_host local host name or IP address in string form
+ *  \param[in] local_port local port number in host byte order
+ *  \param[in] remote_host remote host name or IP address in string form
+ *  \param[in] remote_port remote port number in host byte order
+ *  \param[in] flags flags like \ref OSMO_SOCK_F_CONNECT
+ *  \returns socket fd on success; negative on error
+ *
+ * This function creates (and optionall binds/connects) a socket using
+ * \ref osmo_sock_init2, but also fills the \a ofd structure.
+ */
+int osmo_sock_init2_ofd(struct osmo_fd *ofd, int family, int type, int proto,
+   const char *local_host, uint16_t local_port,
+   const char *remote_host, uint16_t remote_port, unsigned 
int flags)
+{
+   return osmo_fd_init_ofd(ofd, osmo_sock_init2(family, type, proto, 
local_host,
+   local_port, remote_host, remote_port, 
flags));
+}
+
 /*! \brief Initialize a socket and fill \ref sockaddr
  *  \param[out] ss socket address (will be filled in)
  *  \param[in] type Socket type like SOCK_DGRAM, SOCK_STREAM

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

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


[MERGED] libosmo-abis[master]: ipacces.c: Remove ipa_bts_id_resp() and use libosmocore

2017-05-26 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ipacces.c: Remove ipa_bts_id_resp() and use libosmocore
..


ipacces.c: Remove ipa_bts_id_resp() and use libosmocore

In Chanage-Id Icbcd8827a75fd5f3393351c1ca372de85275ad35 we introduced a
very similar function to libosocore.  Let's use that rather than our own
version here.

Change-Id: I858920db1fb5f5d66e71b676d28c84d330d7904a
---
M src/input/ipaccess.c
1 file changed, 4 insertions(+), 85 deletions(-)

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



diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index ac84ffc..fb2e30d 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -567,90 +567,6 @@
return ret;
 }
 
-#define IPA_STRING_MAX 64
-
-static struct msgb *
-ipa_bts_id_resp(struct ipaccess_unit *dev, uint8_t *data, int len, int trx_nr)
-{
-   struct msgb *nmsg;
-   char str[IPA_STRING_MAX];
-   uint8_t *tag;
-
-   memset(str, 0, sizeof(str));
-
-   nmsg = ipa_msg_alloc(0);
-   if (!nmsg)
-   return NULL;
-
-   *msgb_put(nmsg, 1) = IPAC_MSGT_ID_RESP;
-   while (len) {
-   if (len < 2) {
-   LOGP(DLINP, LOGL_NOTICE,
-   "Short read of ipaccess tag\n");
-   msgb_free(nmsg);
-   return NULL;
-   }
-   switch (data[1]) {
-   case IPAC_IDTAG_UNIT:
-   snprintf(str, sizeof(str), "%u/%u/%u",
-   dev->site_id, dev->bts_id, trx_nr);
-   break;
-   case IPAC_IDTAG_MACADDR:
-   snprintf(str, sizeof(str),
-"%02x:%02x:%02x:%02x:%02x:%02x",
-dev->mac_addr[0], dev->mac_addr[1],
-dev->mac_addr[2], dev->mac_addr[3],
-dev->mac_addr[4], dev->mac_addr[5]);
-   break;
-   case IPAC_IDTAG_LOCATION1:
-   if (dev->location1)
-   strncpy(str, dev->location1, IPA_STRING_MAX);
-   break;
-   case IPAC_IDTAG_LOCATION2:
-   if (dev->location2)
-   strncpy(str, dev->location2, IPA_STRING_MAX);
-   break;
-   case IPAC_IDTAG_EQUIPVERS:
-   if (dev->equipvers)
-   strncpy(str, dev->equipvers, IPA_STRING_MAX);
-   break;
-   case IPAC_IDTAG_SWVERSION:
-   if (dev->swversion)
-   strncpy(str, dev->swversion, IPA_STRING_MAX);
-   break;
-   case IPAC_IDTAG_UNITNAME:
-   snprintf(str, sizeof(str),
-"%s-%02x-%02x-%02x-%02x-%02x-%02x",
-dev->unit_name,
-dev->mac_addr[0], dev->mac_addr[1],
-dev->mac_addr[2], dev->mac_addr[3],
-dev->mac_addr[4], dev->mac_addr[5]);
-   break;
-   case IPAC_IDTAG_SERNR:
-   if (dev->serno)
-   strncpy(str, dev->serno, IPA_STRING_MAX);
-   break;
-   default:
-   LOGP(DLINP, LOGL_NOTICE,
-   "Unknown ipaccess tag 0x%02x\n", *data);
-   msgb_free(nmsg);
-   return NULL;
-   }
-   str[IPA_STRING_MAX-1] = '\0';
-
-   LOGP(DLINP, LOGL_INFO, " tag %d: %s\n", data[1], str);
-   tag = msgb_put(nmsg, 3 + strlen(str) + 1);
-   tag[0] = 0x00;
-   tag[1] = 1 + strlen(str) + 1;
-   tag[2] = data[1];
-   memcpy(tag + 3, str, strlen(str) + 1);
-   data += 2;
-   len -= 2;
-   }
-   ipa_msg_push_header(nmsg, IPAC_PROTO_IPACCESS);
-   return nmsg;
-}
-
 static struct msgb *ipa_bts_id_ack(void)
 {
struct msgb *nmsg2;
@@ -698,13 +614,16 @@
if (msg_type == IPAC_MSGT_ID_GET) {
uint8_t *data = msgb_l2(msg);
int len = msgb_l2len(msg);
+   int old_trx_nr = dev->trx_id;
int trx_nr = 0;
 
if (link->ofd->priv_nr >= E1INP_SIGN_RSL)
trx_nr = link->ofd->priv_nr - E1INP_SIGN_RSL;
 
LOGP(DLINP, LOGL_NOTICE, "received ID get\n");
-   rmsg = ipa_bts_id_resp(dev, data + 1, len - 1, trx_nr);
+   dev->trx_id = trx_nr;
+   rmsg = 

[MERGED] libosmo-abis[master]: Add value_string for input signal names (e1inp_signal_names)

2017-05-26 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Add value_string for input signal names (e1inp_signal_names)
..


Add value_string for input signal names (e1inp_signal_names)

Change-Id: I1662d4a969d2d12677646f3120b25be9a20c6d22
---
M include/osmocom/abis/e1_input.h
M src/e1_input.c
2 files changed, 13 insertions(+), 0 deletions(-)

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



diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h
index 8501d5c..1a701f9 100644
--- a/include/osmocom/abis/e1_input.h
+++ b/include/osmocom/abis/e1_input.h
@@ -212,6 +212,8 @@
S_L_INP_LINE_NOALARM,
 };
 
+extern const struct value_string e1inp_signal_names[];
+
 /* register a driver with the E1 core */
 int e1inp_driver_register(struct e1inp_driver *drv);
 
diff --git a/src/e1_input.c b/src/e1_input.c
index 1e1252e..40e36b4 100644
--- a/src/e1_input.c
+++ b/src/e1_input.c
@@ -803,6 +803,17 @@
return 0;
 }
 
+const struct value_string e1inp_signal_names[] = {
+   { S_L_INP_NONE, "NONE" },
+   { S_L_INP_TEI_UP,   "TEI-UP" },
+   { S_L_INP_TEI_DN,   "TEI-DOWN" },
+   { S_L_INP_TEI_UNKNOWN,  "TEI-UNKNOWN" },
+   { S_L_INP_LINE_INIT,"LINE-INIT" },
+   { S_L_INP_LINE_ALARM,   "LINE-ALARM" },
+   { S_L_INP_LINE_NOALARM, "LINE-NOALARM" },
+   { 0, NULL }
+};
+
 void e1inp_misdn_init(void);
 void e1inp_dahdi_init(void);
 void e1inp_ipaccess_init(void);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1662d4a969d2d12677646f3120b25be9a20c6d22
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-bts[master]: Remove unusued left-over gsm0503_conv.c

2017-05-26 Thread Harald Welte

Patch Set 1: Code-Review-1

there's also a header file...

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

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


osmo-bts[master]: scheduler_trx.c: Avoid code duplication for BER10k computation

2017-05-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


libosmo-abis[master]: ipacces.c: Remove ipa_bts_id_resp() and use libosmocore

2017-05-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


libosmocore[master]: Introduce build script for arm-none-eabi cross-compilations

2017-05-26 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


libosmocore[master]: Revert "Introduce build script for arm-none-eabi cross-compi...

2017-05-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] libosmocore[master]: Introduce build script for arm-none-eabi cross-compilations

2017-05-26 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Introduce build script for arm-none-eabi cross-compilations
..


Introduce build script for arm-none-eabi cross-compilations

This is a necessary step to use libosmocore-arm dep in OsmocomBB.

After this patch is submitted the "./contrib/jenkins.sh" line in
libosmocore jenkins jobs [1][2] needs to be replaced with:

  if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]
  then
./contrib/jenkins-arm.sh
  else
# (FreeBSD && debian8)_amd64 builds
./contrib/jenkins.sh
  fi

Furthermore, the "arch" matrix-build axis has to be created,
holding "arm-none-eabi" and "amd64". Following combination filter 
is necessary to skip cross-compilations on FreeBSD buildslave:

  !(arch=="arm-none-eabi" && label=="FreeBSD_amd64")

[1] https://jenkins.osmocom.org/jenkins/job/libosmocore/
[2] https://jenkins.osmocom.org/jenkins/job/libosmocore-gerrit/

Change-Id: I0db83ad2c94ada65c00fd1bcf867830dec80085d
---
A contrib/jenkins-arm.sh
1 file changed, 33 insertions(+), 0 deletions(-)

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



diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh
new file mode 100755
index 000..d5fc31f
--- /dev/null
+++ b/contrib/jenkins-arm.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+set -ex
+
+./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
+
+autoreconf --install --force
+./configure --enable-static \
+   --prefix=/usr/local/arm-none-eabi \
+   --host=arm-none-eabi \
+   --enable-embedded \
+   --disable-shared \
+   CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles 
-nodefaultlibs"
+
+$MAKE $PARALLEL_MAKE \
+   || cat-testlogs.sh
+
+# verify build in dir other than source tree
+rm -rf *
+git checkout .
+autoreconf --install --force
+mkdir builddir
+cd builddir
+
+../configure --enable-static \
+   --prefix=/usr/local/arm-none-eabi \
+   --host=arm-none-eabi \
+   --enable-embedded \
+   --disable-shared \
+   CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles 
-nodefaultlibs"
+
+$MAKE $PARALLEL_MAKE \
+   || cat-testlogs.sh

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

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


[PATCH] libosmocore[master]: Revert "Introduce build script for arm-none-eabi cross-compi...

2017-05-26 Thread blobb

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

Revert "Introduce build script for arm-none-eabi cross-compilations"

"--enable-sanitize" does not work on jenkins build slave (debian8), although it 
worked out locally for me.

Following patch will introduce corrected arm build script without 
"--enable-sanitize" option:

https://gerrit.osmocom.org/#/c/2742/  

This reverts commit ba58167e1bf6ff8815c4e9e0d7b0b63ba1c529f8.

Change-Id: I644114679db1394e75ff12b0203ae8e568aff82c
---
D contrib/jenkins-arm.sh
1 file changed, 0 insertions(+), 33 deletions(-)


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

diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh
deleted file mode 100755
index e279821..000
--- a/contrib/jenkins-arm.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-set -ex
-
-./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
-
-autoreconf --install --force
-./configure --enable-static --enable-sanitize \
-   --prefix=/usr/local/arm-none-eabi \
-   --host=arm-none-eabi \
-   --enable-embedded \
-   --disable-shared \
-   CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles 
-nodefaultlibs"
-
-$MAKE $PARALLEL_MAKE \
-   || cat-testlogs.sh
-
-# verify build in dir other than source tree
-rm -rf *
-git checkout .
-autoreconf --install --force
-mkdir builddir
-cd builddir
-
-../configure --enable-static \
-   --prefix=/usr/local/arm-none-eabi \
-   --host=arm-none-eabi \
-   --enable-embedded \
-   --disable-shared \
-   CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles 
-nodefaultlibs"
-
-$MAKE $PARALLEL_MAKE \
-   || cat-testlogs.sh

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I644114679db1394e75ff12b0203ae8e568aff82c
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: blobb 


libosmocore[master]: Revert "Introduce build script for arm-none-eabi cross-compi...

2017-05-26 Thread blobb
blobb has reverted this change.

Change subject: Revert "Introduce build script for arm-none-eabi 
cross-compilations"
..


Uploaded patch set 1.

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

Gerrit-MessageType: revert
Gerrit-Change-Id: I644114679db1394e75ff12b0203ae8e568aff82c
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: blobb 


libosmocore[master]: Introduce build script for arm-none-eabi cross-compilations

2017-05-26 Thread blobb

Patch Set 3:

Sure, I will apply mentioned changes!

But, this commit needs to be reverted and [1] needs to be submitted.

Because the "--enable-sanitize" option worked out locally, but not on jenkins 
build slave. 

New commit [1] has been tested in production [2] (changes have been reverted 
until revert+submit have taken place) 

[1] https://gerrit.osmocom.org/#/c/2742/3
[2] 
http://jenkins.osmocom.org/jenkins/view/Jenkins-Gerrit/job/libosmocore-gerrit/1119/

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9e07fb9e60830dbd585f22d9c658c46252ce399f
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: blobb 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: blobb 
Gerrit-HasComments: No


[PATCH] libosmocore[master]: Introduce build script for arm-none-eabi cross-compilations

2017-05-26 Thread blobb
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/2742

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

Introduce build script for arm-none-eabi cross-compilations

This is a necessary step to use libosmocore-arm dep in OsmocomBB.

After this patch is submitted the "./contrib/jenkins.sh" line in
libosmocore jenkins jobs [1][2] needs to be replaced with:

  if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]
  then
./contrib/jenkins-arm.sh
  else
# (FreeBSD && debian8)_amd64 builds
./contrib/jenkins.sh
  fi

Furthermore, the "arch" matrix-build axis has to be created,
holding "arm-none-eabi". Following combination filter is
necessary to skip cross-compilations on FreeBSD buildslave:

  !(arch=="arm-none-eabi" && label=="FreeBSD_amd64")

[1] https://jenkins.osmocom.org/jenkins/job/libosmocore/
[2] https://jenkins.osmocom.org/jenkins/job/libosmocore-gerrit/

Change-Id: I0db83ad2c94ada65c00fd1bcf867830dec80085d
---
A contrib/jenkins-arm.sh
1 file changed, 33 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/42/2742/2

diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh
new file mode 100755
index 000..d5fc31f
--- /dev/null
+++ b/contrib/jenkins-arm.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+set -ex
+
+./contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
+
+autoreconf --install --force
+./configure --enable-static \
+   --prefix=/usr/local/arm-none-eabi \
+   --host=arm-none-eabi \
+   --enable-embedded \
+   --disable-shared \
+   CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles 
-nodefaultlibs"
+
+$MAKE $PARALLEL_MAKE \
+   || cat-testlogs.sh
+
+# verify build in dir other than source tree
+rm -rf *
+git checkout .
+autoreconf --install --force
+mkdir builddir
+cd builddir
+
+../configure --enable-static \
+   --prefix=/usr/local/arm-none-eabi \
+   --host=arm-none-eabi \
+   --enable-embedded \
+   --disable-shared \
+   CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles 
-nodefaultlibs"
+
+$MAKE $PARALLEL_MAKE \
+   || cat-testlogs.sh

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0db83ad2c94ada65c00fd1bcf867830dec80085d
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: blobb 
Gerrit-Reviewer: Jenkins Builder