Change in osmo-mgw[master]: check_rtp_origin(): Don't memcmp sockadd_in and in_addr

2018-10-25 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11402 )

Change subject: check_rtp_origin(): Don't memcmp sockadd_in and in_addr
..

check_rtp_origin(): Don't memcmp sockadd_in and in_addr

We were comparing 16 bytes (sockaddr_in) in memcmp() rather than using
four bytes (struct in_addr in mgcp conn end).

This is a good example why we should actually simply use the == (equals)
operator rather than using memcmp which treats everything as void.

Change-Id: Ic64256619ef893d625400e8b1b573ea2c629ed9c
Fixes: Coverity CID#188874
---
M src/libosmo-mgcp/mgcp_network.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index d769ef3..fe63f1e 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -874,7 +874,7 @@
endp = conn->conn->endp;
struct sockaddr_in zero_addr = {};

-   if (memcmp(_addr, >end.addr, sizeof(zero_addr)) == 0) {
+   if (memcmp(_addr.sin_addr, >end.addr, 
sizeof(zero_addr.sin_addr)) == 0) {
switch (conn->conn->mode) {
case MGCP_CONN_LOOPBACK:
/* HACK: for IuUP, we want to reply with an IuUP 
Initialization ACK upon the first RTP

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic64256619ef893d625400e8b1b573ea2c629ed9c
Gerrit-Change-Number: 11402
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-mgw[master]: check_rtp_origin(): Avoid using memcmp for comparing integer types

2018-10-25 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11403 )

Change subject: check_rtp_origin(): Avoid using memcmp for comparing integer 
types
..

check_rtp_origin(): Avoid using memcmp for comparing integer types

in_addr consists only of s_addr, which is an integer type that
can be compared directly.  By avoiding memcmp() here we would have
been able to catch Coverity CID#188874 even without Coverity, and
make the code more compact...

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

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



diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index fe63f1e..de34cc6 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -872,9 +872,8 @@
 {
struct mgcp_endpoint *endp;
endp = conn->conn->endp;
-   struct sockaddr_in zero_addr = {};

-   if (memcmp(_addr.sin_addr, >end.addr, 
sizeof(zero_addr.sin_addr)) == 0) {
+   if (conn->end.addr.s_addr == 0) {
switch (conn->conn->mode) {
case MGCP_CONN_LOOPBACK:
/* HACK: for IuUP, we want to reply with an IuUP 
Initialization ACK upon the first RTP
@@ -904,8 +903,7 @@

/* Note: Check if the inbound RTP data comes from the same host to
 * which we send our outgoing RTP traffic. */
-   if (memcmp(>sin_addr, >end.addr, sizeof(addr->sin_addr))
-   != 0) {
+   if (conn->end.addr.s_addr != addr->sin_addr.s_addr) {
LOGP(DRTP, LOGL_ERROR,
 "endpoint:0x%x data from wrong address: %s, ",
 ENDPOINT_NUMBER(endp), inet_ntoa(addr->sin_addr));

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic6105d39ae2fb4b301f87448b16763fe9f695621
Gerrit-Change-Number: 11403
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in docker-playground[master]: ttcn3-bts-test: Log fake_trx output to file

2018-10-25 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11431 )

Change subject: ttcn3-bts-test: Log fake_trx output to file
..

ttcn3-bts-test: Log fake_trx output to file

Change-Id: I82a80b045e6f298e5254f42f51dbf8c84013f45c
---
M ttcn3-bts-test/jenkins.sh
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Pau Espin Pedrol: Verified



diff --git a/ttcn3-bts-test/jenkins.sh b/ttcn3-bts-test/jenkins.sh
index 1cd06e7..fe448f5 100755
--- a/ttcn3-bts-test/jenkins.sh
+++ b/ttcn3-bts-test/jenkins.sh
@@ -17,6 +17,8 @@

 mkdir $VOL_BASE_DIR/unix

+mkdir $VOL_BASE_DIR/fake_trx
+
 echo Starting container with BSC
 docker run --rm \
--network $NET_NAME --ip 172.18.9.11 \
@@ -37,9 +39,10 @@
 echo Starting container with fake_trx
 docker run --rm \
--network $NET_NAME --ip 172.18.9.21 \
+   -v $VOL_BASE_DIR/fake_trx:/data \
--name ${BUILD_TAG}-fake_trx -d \
$REPO_USER/osmocom-bb-host-master \
-   /tmp/osmocom-bb/src/target/trx_toolkit/fake_trx.py -R 
172.18.9.20 -r 172.18.9.22
+   bash -c "/tmp/osmocom-bb/src/target/trx_toolkit/fake_trx.py -R 
172.18.9.20 -r 172.18.9.22 >/data/fake_trx.log 2>&1"

 echo Starting container with trxcon
 docker run --rm \

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

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I82a80b045e6f298e5254f42f51dbf8c84013f45c
Gerrit-Change-Number: 11431
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-CC: Vadim Yanitskiy 


Change in docker-playground[master]: ttcn3-bts-test: Log fake_trx output to file

2018-10-25 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11431 )

Change subject: ttcn3-bts-test: Log fake_trx output to file
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I82a80b045e6f298e5254f42f51dbf8c84013f45c
Gerrit-Change-Number: 11431
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-CC: Vadim Yanitskiy 
Gerrit-Comment-Date: Thu, 25 Oct 2018 18:05:10 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in docker-playground[master]: Remove top-level Makefile

2018-10-25 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11369 )

Change subject: Remove top-level Makefile
..


Patch Set 7:

I think this change in usage (shell script vs makefile) should be documented in 
a readme file.  Add one in case there's none yet.


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

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id18a9a7a70f85127e6f6c9447d71764018bdb4ff
Gerrit-Change-Number: 11369
Gerrit-PatchSet: 7
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: osmith 
Gerrit-CC: Neels Hofmeyr 
Gerrit-Comment-Date: Thu, 25 Oct 2018 18:04:44 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in docker-playground[master]: rename m3ua-test, sua-test to nplab-*-test

2018-10-25 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11368 )

Change subject: rename m3ua-test, sua-test to nplab-*-test
..


Patch Set 7: Code-Review+2


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

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iedf9a8cd9af1da674e018a08a977490520e602de
Gerrit-Change-Number: 11368
Gerrit-PatchSet: 7
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: osmith 
Gerrit-CC: Neels Hofmeyr 
Gerrit-Comment-Date: Thu, 25 Oct 2018 18:03:18 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in docker-playground[master]: jenkins-common.sh: add docker_images_require()

2018-10-25 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11365 )

Change subject: jenkins-common.sh: add docker_images_require()
..


Patch Set 4: Code-Review+2


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

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0afdf3400282634fca9b31d57eaeedd6b5c28aa1
Gerrit-Change-Number: 11365
Gerrit-PatchSet: 4
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Thu, 25 Oct 2018 18:02:40 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: Fix VLR test macro

2018-10-25 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/6296 )

Change subject: Fix VLR test macro
..


Patch Set 7:

are the tests ever likely going to have more than one "conn" they want to match 
on?  If no, using a global varialbe is perfectly ok.  To me, this seems to be 
another "let's change something for the purpose of changing something" kind of 
commits.  You can find as many arguments against that change as you can find 
for it, I find it highly questionable to spend time on it, sorry.


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I36ae1f9bb395921dc2c5a39e35fbb8040ba47213
Gerrit-Change-Number: 6296
Gerrit-PatchSet: 7
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Thu, 25 Oct 2018 18:00:38 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-gsm-tester[master]: First round of clean-ups of imports and unused variables

2018-10-25 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11067 )

Change subject: First round of clean-ups of imports and unused variables
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I02f1d89078dfdf37d53e2e20811bf36fb14ec3b0
Gerrit-Change-Number: 11067
Gerrit-PatchSet: 2
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 25 Oct 2018 18:01:22 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: Update VLR test helper

2018-10-25 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11458 )

Change subject: Update VLR test helper
..


Patch Set 1: Code-Review+2

nice, but again one of those patches where I'm wondering "why spend time on 
this now?"


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icf507d094319123c6667ba963db1d385df4d4f92
Gerrit-Change-Number: 11458
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 25 Oct 2018 17:58:41 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: add osmo_sock_get_{local, remote}_ip{, _port}()

2018-10-25 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11455 )

Change subject: add osmo_sock_get_{local,remote}_ip{,_port}()
..


Patch Set 1: Code-Review-1

(2 comments)

https://gerrit.osmocom.org/#/c/11455/1/include/osmocom/core/socket.h
File include/osmocom/core/socket.h:

https://gerrit.osmocom.org/#/c/11455/1/include/osmocom/core/socket.h@59
PS1, Line 59: char *osmo_sock_get_name2(void *ctx, int fd, bool local, bool 
port);
> I thought that was necessary to use it with the defines below. […]
just don't try to prematurely optimzie with #defines and make those defines 
below public functions/symbols.  at that point you can have the 
osmo_sock_get_name2() function static and not declare it in the header here.


https://gerrit.osmocom.org/#/c/11455/1/src/socket.c
File src/socket.c:

https://gerrit.osmocom.org/#/c/11455/1/src/socket.c@712
PS1, Line 712: talloc_strdup(ctx, port ? portbuf : hostbuf)
I thought the point was that you wanted to avoid returning a heap-allocated 
buffer with those new functions?



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6803c204771c59a2002bc6a0e6b79c83c35f87e1
Gerrit-Change-Number: 11455
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: osmith 
Gerrit-CC: Max 
Gerrit-Comment-Date: Thu, 25 Oct 2018 17:57:51 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: mobile: fix vty bind ip override

2018-10-25 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11457 )

Change subject: mobile: fix vty bind ip override
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I32517567847fd5c54b1742f18bf409ff81e316fa
Gerrit-Change-Number: 11457
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Thu, 25 Oct 2018 17:54:08 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: mobile: cleanup app init

2018-10-25 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11456 )

Change subject: mobile: cleanup app init
..


Patch Set 1: Code-Review+1

(3 comments)

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

https://gerrit.osmocom.org/#/c/11456/1//COMMIT_MSG@9
PS1, Line 9: remove redundant printf
ok, fine.


https://gerrit.osmocom.org/#/c/11456/1//COMMIT_MSG@10
PS1, Line 10: use boolean where appropriate
this is exactly the kind of "clean up" which I saw at times in the past and 
kept wondering:  Which particular task/ticket/work-item does this address?  Is 
that really worth our valuable and quite limited time and resources?


https://gerrit.osmocom.org/#/c/11456/1/src/host/layer23/src/mobile/main.c
File src/host/layer23/src/mobile/main.c:

https://gerrit.osmocom.org/#/c/11456/1/src/host/layer23/src/mobile/main.c@92
PS1, Line 92:   
replacing tabs with spaces?



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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Idc38feb03656bd9a52aa29095ff7423e0e6ad53b
Gerrit-Change-Number: 11456
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Thu, 25 Oct 2018 17:53:46 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: common/scheduler.c: track TDMA frame loss per logical channels

2018-10-25 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10309 )

Change subject: common/scheduler.c: track TDMA frame loss per logical channels
..

common/scheduler.c: track TDMA frame loss per logical channels

This change modifies the logic of TDMA frame loss tracking. To
be more precise, the tracking logic was moved from per timeslot
level to per logical channel level, what makes OsmoBTS more
accurate in its measurements.

But before getting into details, it's important to clarify some
things about the Uplink burst processing in transceiver (OsmoTRX).
If an Uplink burst is detected, OsmoTRX demodulates it and sends
to OsmoBTS. If nothing is detected on a particular timeslot,
OsmoTRX will do nothing. In other words, it will not
notify OsmoBTS about this.

Meanwhile, there are usually a few logical channels mapped to a
single TDMA timeslot. Let's use SDCCH8 channel configuration as
an example (simplified layout):

  /* SDCCH/8 (ss=0), subscriber A (active) */
  { TRXC_SDCCH8_0,bid=0 },
  { TRXC_SDCCH8_0,bid=1 },
  { TRXC_SDCCH8_0,bid=2 },
  { TRXC_SDCCH8_0,bid=3 }, // <-- last_fn=X

  /* SDCCH/8 (ss=1), subscriber B (inactive) */
  { TRXC_SDCCH8_1,bid=0 },
  { TRXC_SDCCH8_1,bid=1 },
  { TRXC_SDCCH8_1,bid=2 },
  { TRXC_SDCCH8_1,bid=3 },

  /* SDCCH/8 (ss=2), subscriber C (active) */
  { TRXC_SDCCH8_2,bid=0 }, // <-- current_fn=X+5
  { TRXC_SDCCH8_2,bid=1 },
  { TRXC_SDCCH8_2,bid=2 },
  { TRXC_SDCCH8_2,bid=3 },

SDCCH8 has 8 sub-slots, so up to 8 subscribers can use a single
timeslot. Let's imagine there are three subscribers: A, B, and C.
Both A and C are active subscribers, i.e. they are continuously
transmitting UL bursts, while B is not using ss=1 anymore.

The original way of TDMA frame loss tracking was the following:

  - when an UL burst is received, store it's frame number in
the timeslot state structure (last_fn);

  - when the next UL burst is received on same timeslot, compute
how many frames elapsed since the last_fn;

  - if elapsed = (current_fn - last_fn) is lower than 10, then
iterate from (last_fn + 1) until the current_fn and send
dummy zero-filled bursts to the higher layers;

  - otherwise (elapsed > 10), process the current burst,
and do nothing :/

According to our example, subscriber A is sending 4 bursts, then
nobody is sending anything, and then subscriber C is sending
4 bursts. So, there is a 4 frames long gap between the both
transmissions, which is being substituted by dummy bursts. But,
as the logical channel on ss=1 is not active, they are dropped.

This is not that scary, but the current algorithm produces lots
of false-positives, and moreover is not able to track real frame
drops in longer periods (i.e. >10). So, tracking the frame loss
per individual logical channels makes much more sense.

Let's finally drop this hackish 'while (42) { ... }', and track
the amount of lost / received TDMA frames (bursts) individually
per logical channels. Let's also use the multiframe period as
the loss detection period, instead of hardcoded 10. And finally,
let's print more informative debug messages.

Also, it makes sense to use the amount of lost / received bursts
during the calculation of the measurement reports, instead of
sending dummy bursts, but let's do this separately.

Change-Id: I70d05b67a35ddcbdd1b6394dbd7198404a440e76
Related: OS#3428
---
M include/osmo-bts/scheduler.h
M src/common/scheduler.c
2 files changed, 142 insertions(+), 65 deletions(-)

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



diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index 32d6e91..f9d9962 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -80,6 +80,9 @@

/* loss detection */
uint8_t lost_frames;/* how many L2 frames were lost 
*/
+   uint32_tlast_tdma_fn;   /* last processed TDMA frame 
number */
+   uint32_tproc_tdma_fs;   /* how many TDMA frames were 
processed */
+   uint32_tlost_tdma_fs;   /* how many TDMA frames were 
lost */

/* mode */
uint8_t rsl_cmode, tch_mode; /* mode for TCH channels */
@@ -124,7 +127,6 @@

 struct l1sched_ts {
uint8_t mf_index;   /* selected multiframe index */
-   uint32_tmf_last_fn; /* last received frame number */
uint8_t mf_period;  /* period of multiframe */
const struct trx_sched_frame *mf_frames; /* pointer to frame layout */

diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index 65ece7f..f705ddf 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -222,7 +222,6 @@
struct l1sched_ts *l1ts = 

Change in simtrace2[master]: cardem: add more debug information for TPDU state

2018-10-25 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11361 )

Change subject: cardem: add more debug information for TPDU state
..

cardem: add more debug information for TPDU state

this just adds the name of the TPDU state on top of the state number.

the ISO state is cleaned up accordingly

Change-Id: Id5104a2c3579dedb092c179748e9ed525673841c
---
M firmware/libcommon/source/card_emu.c
1 file changed, 79 insertions(+), 14 deletions(-)

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



diff --git a/firmware/libcommon/source/card_emu.c 
b/firmware/libcommon/source/card_emu.c
index 75910c1..b7d0e1f 100644
--- a/firmware/libcommon/source/card_emu.c
+++ b/firmware/libcommon/source/card_emu.c
@@ -55,14 +55,38 @@
 };

 const struct value_string iso7816_3_card_state_names[] = {
-   OSMO_VALUE_STRING(ISO_S_WAIT_POWER),
-   OSMO_VALUE_STRING(ISO_S_WAIT_CLK),
-   OSMO_VALUE_STRING(ISO_S_WAIT_RST),
-   OSMO_VALUE_STRING(ISO_S_WAIT_ATR),
-   OSMO_VALUE_STRING(ISO_S_IN_ATR),
-   OSMO_VALUE_STRING(ISO_S_IN_PTS),
-   OSMO_VALUE_STRING(ISO_S_WAIT_TPDU),
-   OSMO_VALUE_STRING(ISO_S_IN_TPDU),
+   {
+   .value = ISO_S_WAIT_POWER,
+   .str = "WAIT_POWER",
+   },
+   {
+   .value = ISO_S_WAIT_CLK,
+   .str = "WAIT_CLK",
+   },
+   {
+   .value = ISO_S_WAIT_RST,
+   .str = "WAIT_RST",
+   },
+   {
+   .value = ISO_S_WAIT_ATR,
+   .str = "WAIT_ATR",
+   },
+   {
+   .value = ISO_S_IN_ATR,
+   .str = "IN_ATR",
+   },
+   {
+   .value = ISO_S_IN_PTS,
+   .str = "IN_PTS",
+   },
+   {
+   .value = ISO_S_WAIT_TPDU,
+   .str = "WAIT_TPDU",
+   },
+   {
+   .value = ISO_S_IN_TPDU,
+   .str = "IN_TPDU",
+   },
{
.value = 0,
.str = NULL,
@@ -86,6 +110,7 @@
PTS_S_WAIT_RESP_PCK = PTS_S_WAIT_REQ_PCK | 0x10,
 };

+/* PTS field byte index */
 #define _PTSS  0
 #define _PTS0  1
 #define _PTS1  2
@@ -105,6 +130,46 @@
TPDU_S_WAIT_TX, /* waiting for more data to reader */
 };

+const struct value_string tpdu_state_names[] = {
+   {
+   .value = TPDU_S_WAIT_CLA,
+   .str = "WAIT_CLA",
+   },
+   {
+   .value = TPDU_S_WAIT_INS,
+   .str = "WAIT_INS",
+   },
+   {
+   .value = TPDU_S_WAIT_P1,
+   .str = "WAIT_P1",
+   },
+   {
+   .value = TPDU_S_WAIT_P2,
+   .str = "WAIT_P2",
+   },
+   {
+   .value = TPDU_S_WAIT_P3,
+   .str = "WAIT_P3",
+   },
+   {
+   .value = TPDU_S_WAIT_PB,
+   .str = "WAIT_PB",
+   },
+   {
+   .value = TPDU_S_WAIT_RX,
+   .str = "WAIT_RX",
+   },
+   {
+   .value = TPDU_S_WAIT_TX,
+   .str = "WAIT_TX",
+   },
+   {
+   .value = 0,
+   .str = NULL,
+   },
+};
+
+/* TPDU field byte index */
 #define_CLA0
 #define_INS1
 #define_P1 2
@@ -304,9 +369,9 @@
if (ch->state == new_state)
return;

-   TRACE_DEBUG("%u: 7816 card state %u (%s) -> %u (%s)\r\n", ch->num,
-   ch->state, get_value_string(iso7816_3_card_state_names, 
ch->state),
-   new_state, get_value_string(iso7816_3_card_state_names, 
new_state));
+   TRACE_DEBUG("%u: 7816 card state %s -> %s\r\n", ch->num,
+   get_value_string(iso7816_3_card_state_names, ch->state),
+   get_value_string(iso7816_3_card_state_names, new_state));
ch->state = new_state;

switch (new_state) {
@@ -651,9 +716,9 @@
if (ch->tpdu.state == new_ts)
return;

-   TRACE_DEBUG("%u: 7816 TPDU state %u -> %u\r\n", ch->num,
-   ch->tpdu.state, new_ts);
-
+   TRACE_DEBUG("%u: 7816 TPDU state %s -> %s\r\n", ch->num,
+   get_value_string(tpdu_state_names, ch->tpdu.state),
+   get_value_string(tpdu_state_names, new_ts));
ch->tpdu.state = new_ts;

switch (new_ts) {

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id5104a2c3579dedb092c179748e9ed525673841c
Gerrit-Change-Number: 11361
Gerrit-PatchSet: 2
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Kévin Redon 


Change in simtrace2[master]: cardem: add more debug information for TPDU state

2018-10-25 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11361 )

Change subject: cardem: add more debug information for TPDU state
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id5104a2c3579dedb092c179748e9ed525673841c
Gerrit-Change-Number: 11361
Gerrit-PatchSet: 2
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Kévin Redon 
Gerrit-Comment-Date: Thu, 25 Oct 2018 17:51:20 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: cosmetic: fix spec ref for gsm0808_cipher_mode()

2018-10-25 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11437 )

Change subject: cosmetic: fix spec ref for gsm0808_cipher_mode()
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I359caf1dd30f033c0b606040ccf27aa4c5a9d2c6
Gerrit-Change-Number: 11437
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Thu, 25 Oct 2018 17:50:36 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: cosmetic: fix spec ref for gsm0808_cipher_mode()

2018-10-25 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11437 )

Change subject: cosmetic: fix spec ref for gsm0808_cipher_mode()
..

cosmetic: fix spec ref for gsm0808_cipher_mode()

Change-Id: I359caf1dd30f033c0b606040ccf27aa4c5a9d2c6
---
M src/osmo-bsc/osmo_bsc_bssap.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index a20d5d0..48af06b 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -415,7 +415,7 @@
 }

 /*
- * GSM 08.08 § 3.4.7 cipher mode handling. We will have to pick
+ * GSM 08.08 § 3.1.14 cipher mode handling. We will have to pick
  * the cipher to be used for this. In case we are already using
  * a cipher we will have to send cipher mode reject to the MSC,
  * otherwise we will have to pick something that we and the MS

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I359caf1dd30f033c0b606040ccf27aa4c5a9d2c6
Gerrit-Change-Number: 11437
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: osmith 


Change in osmo-bsc[master]: cipher mode reject: send proper cause codes

2018-10-25 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11438 )

Change subject: cipher mode reject: send proper cause codes
..

cipher mode reject: send proper cause codes

bssmap_handle_cipher_mode() had code paths doing "goto reject" without
setting a meaningful cause value.

Related: OS#3186
Change-Id: Ia608fa34a6a2d3035a66d05fbc38553ac5186804
---
M src/osmo-bsc/osmo_bsc_bssap.c
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 48af06b..6b7a682 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -444,6 +444,7 @@

if (conn->ciphering_handled) {
LOGP(DMSC, LOGL_ERROR, "Already seen ciphering command. 
Protocol Error.\n");
+   reject_cause = GSM0808_CAUSE_PROTOCOL_ERROR_BETWEEN_BSS_AND_MSC;
goto reject;
}

@@ -452,6 +453,7 @@
tlv_parse(, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 
0, 0);
if (!TLVP_PRESENT(, GSM0808_IE_ENCRYPTION_INFORMATION)) {
LOGP(DMSC, LOGL_ERROR, "IE Encryption Information missing.\n");
+   reject_cause = 
GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING;
goto reject;
}

@@ -464,6 +466,7 @@
len = TLVP_LEN(, GSM0808_IE_ENCRYPTION_INFORMATION);
if (len < 1) {
LOGP(DMSC, LOGL_ERROR, "IE Encryption Information is too 
short.\n");
+   reject_cause = GSM0808_CAUSE_INCORRECT_VALUE;
goto reject;
}


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia608fa34a6a2d3035a66d05fbc38553ac5186804
Gerrit-Change-Number: 11438
Gerrit-PatchSet: 3
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-mgw[master]: use a dynamic name for rtp connection rate counters

2018-10-25 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11439 )

Change subject: use a dynamic name for rtp connection rate counters
..


Patch Set 1: Code-Review-1

this is not really how rate counter groups were intended to be used.  The point 
is that you have one const group descriptor, and then multiple rate counter 
groups allocated from that descriptor.  If thre's a problem with displaying the 
counters, then that needs to be solved on an infrastructure level, and not by 
"hacking" around with a copy of the group descriptor, sorry.


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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I027644f4b913e1f966c11b081e9027e61591a224
Gerrit-Change-Number: 11439
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Reviewer: dexter 
Gerrit-Comment-Date: Thu, 25 Oct 2018 17:49:44 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-mgw[master]: add MGCP CRCX command statistics to osmo-mgw

2018-10-25 Thread Stefan Sperling
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/11463

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

Change subject: add MGCP CRCX command statistics to osmo-mgw
..

add MGCP CRCX command statistics to osmo-mgw

Add a counter group for CRCX commands. The group contains counters for
successful connection processing as well as various error conditions.
This provides a quick overview of CRCX failures on each trunk throughout
the lifetime of the osmo-mgw process.

For example, after running the TTCN3 mgw test suite, the counters show
the following values:

OsmoMGW> show rate-counters
crxc statistics for trunk 0:
 crcx:success: 88 (0/s 88/m 0/h 0/d) CRCX command processed 
successfully.
  crcx:bad_action:  0 (0/s 0/m 0/h 0/d) bad action in CRCX 
command.
 crcx:unhandled_param:  1 (0/s 1/m 0/h 0/d) unhandled parameter in 
CRCX command.
  crcx:missing_callid:  1 (0/s 1/m 0/h 0/d) missing CallId in CRCX 
command.
crcx:invalid_mode:  1 (0/s 1/m 0/h 0/d) connection invalid mode 
in CRCX command.
  crcx:limit_exceeded:  0 (0/s 0/m 0/h 0/d) limit of concurrent 
connections was reached.
   crcx:unkown_callid:  0 (0/s 0/m 0/h 0/d) unknown CallId in CRCX 
command.
 crcx:alloc_conn_fail:  0 (0/s 0/m 0/h 0/d) connection allocation 
failure.
 crcx:no_remote_conn_desc:  1 (0/s 1/m 0/h 0/d) no opposite end 
specified for connection.
   crcx:start_rtp_failure:  0 (0/s 0/m 0/h 0/d) failure to start RTP 
processing.
   crcx:conn_rejected:  0 (0/s 0/m 0/h 0/d) connection rejected by 
policy.
OsmoMGW>

With input from Philipp Maier.

Change-Id: Ida82fc340d5c66180e5fe9a0d195e9be6dc64c61
Depends: I027644f4b913e1f966c11b081e9027e61591a224
Related: OS#2660
---
M include/osmocom/mgcp/mgcp.h
M src/libosmo-mgcp/mgcp_protocol.c
2 files changed, 89 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/63/11463/2
--
To view, visit https://gerrit.osmocom.org/11463
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ida82fc340d5c66180e5fe9a0d195e9be6dc64c61
Gerrit-Change-Number: 11463
Gerrit-PatchSet: 2
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-mgw[master]: add MGCP CRCX command statistics to osmo-mgw

2018-10-25 Thread Stefan Sperling
Stefan Sperling has uploaded this change for review. ( 
https://gerrit.osmocom.org/11463


Change subject: add MGCP CRCX command statistics to osmo-mgw
..

add MGCP CRCX command statistics to osmo-mgw

Add a counter group for CRCX commands. The group contains counters for
successful connection processing as well as various error conditions.
This provides a quick overview of CRCX failures on each trunk throughout
the lifetime of the osmo-mgw process.

For example, after running the TTCN3 mgw test suite, the counters show
the following values:

OsmoMGW> show rate-counters
crxc statistics for trunk 0:
 crcx:success: 88 (0/s 88/m 0/h 0/d) CRCX command processed 
successfully.
  crcx:bad_action:  0 (0/s 0/m 0/h 0/d) bad action in CRCX 
command.
 crcx:unhandled_param:  1 (0/s 1/m 0/h 0/d) unhandled parameter in 
CRCX command.
  crcx:missing_callid:  1 (0/s 1/m 0/h 0/d) missing CallId in CRCX 
command.
crcx:invalid_mode:  1 (0/s 1/m 0/h 0/d) connection invalid mode 
in CRCX command.
  crcx:limit_exceeded:  0 (0/s 0/m 0/h 0/d) limit of concurrent 
connections was reached.
   crcx:unkown_callid:  0 (0/s 0/m 0/h 0/d) unknown CallId in CRCX 
command.
 crcx:alloc_conn_fail:  0 (0/s 0/m 0/h 0/d) connection allocation 
failure.
 crcx:no_remote_conn_desc:  1 (0/s 1/m 0/h 0/d) no opposite end 
specified for connection.
   crcx:start_rtp_failure:  0 (0/s 0/m 0/h 0/d) failure to start RTP 
processing.
   crcx:conn_rejected:  0 (0/s 0/m 0/h 0/d) connection rejected by 
policy.
OsmoMGW>

With input from Philipp Maier.

Change-Id: Ida82fc340d5c66180e5fe9a0d195e9be6dc64c61
Depends: I027644f4b913e1f966c11b081e9027e61591a224
Related: OS#2660
---
M include/osmocom/mgcp/mgcp.h
M src/libosmo-mgcp/mgcp_protocol.c
2 files changed, 78 insertions(+), 3 deletions(-)



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

diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h
index bdc86fc..f9f0ac7 100644
--- a/include/osmocom/mgcp/mgcp.h
+++ b/include/osmocom/mgcp/mgcp.h
@@ -118,6 +118,21 @@
 #define MGCP_KEEPALIVE_ONCE (-1)
 #define MGCP_KEEPALIVE_NEVER 0

+/* Global MCGP CRCX related rate counters */
+enum {
+   MGCP_CRCX_SUCCESS,
+   MGCP_CRCX_FAIL_BAD_ACTION,
+   MGCP_CRCX_FAIL_UNHANDLED_PARAM,
+   MGCP_CRCX_FAIL_MISSING_CALLID,
+   MGCP_CRCX_FAIL_INVALID_MODE,
+   MGCP_CRCX_FAIL_LIMIT_EXCEEDED,
+   MGCP_CRCX_FAIL_UNKNOWN_CALLID,
+   MGCP_CRCX_FAIL_ALLOC_CONN,
+   MGCP_CRCX_FAIL_NO_REMOTE_CONN_DESC,
+   MGCP_CRCX_FAIL_START_RTP,
+   MGCP_CRCX_FAIL_REJECTED_BY_POLICY,
+};
+
 struct mgcp_trunk_config {
struct llist_head entry;

@@ -155,6 +170,9 @@
unsigned int number_endpoints;
int vty_number_endpoints;
struct mgcp_endpoint *endpoints;
+
+   /* rate counters */
+   struct rate_ctr_group *mgcp_crcx_ctr_group;
 };
 
 enum mgcp_role {
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index e17bdae..63e76cd 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 
@@ -51,6 +52,28 @@
 #define MGCP_REQUEST(NAME, REQ, DEBUG_NAME) \
{ .name = NAME, .handle_request = REQ, .debug_name = DEBUG_NAME },

+static const struct rate_ctr_desc mgcp_crcx_ctr_desc[] = {
+   [MGCP_CRCX_SUCCESS] = {"crcx:success", "CRCX command processed 
successfully."},
+   [MGCP_CRCX_FAIL_BAD_ACTION] = {"crcx:bad_action", "bad action in CRCX 
command."},
+   [MGCP_CRCX_FAIL_UNHANDLED_PARAM] = {"crcx:unhandled_param", "unhandled 
parameter in CRCX command."},
+   [MGCP_CRCX_FAIL_MISSING_CALLID] = {"crcx:missing_callid", "missing 
CallId in CRCX command."},
+   [MGCP_CRCX_FAIL_INVALID_MODE] = {"crcx:invalid_mode", "connection 
invalid mode in CRCX command."},
+   [MGCP_CRCX_FAIL_LIMIT_EXCEEDED] = {"crcx:limit_exceeded", "limit of 
concurrent connections was reached."},
+   [MGCP_CRCX_FAIL_UNKNOWN_CALLID] = {"crcx:unkown_callid", "unknown 
CallId in CRCX command."},
+   [MGCP_CRCX_FAIL_ALLOC_CONN] = {"crcx:alloc_conn_fail", "connection 
allocation failure."},
+   [MGCP_CRCX_FAIL_NO_REMOTE_CONN_DESC] = {"crcx:no_remote_conn_desc", "no 
opposite end specified for connection."},
+   [MGCP_CRCX_FAIL_START_RTP] = {"crcx:start_rtp_failure", "failure to 
start RTP processing."},
+   [MGCP_CRCX_FAIL_REJECTED_BY_POLICY] = {"crcx:conn_rejected", 
"connection rejected by policy."},
+};
+
+const static struct rate_ctr_group_desc mgcp_crcx_ctr_group_desc = {
+   .group_name_prefix = "crcx",
+   .group_description = "crxc statistics",
+   .class_id = OSMO_STATS_CLASS_GLOBAL,
+   .num_ctr = ARRAY_SIZE(mgcp_crcx_ctr_desc),
+   .ctr_desc = 

Change in osmo-gsm-tester[master]: WIP: gprs

2018-10-25 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/11462


Change subject: WIP: gprs
..

WIP: gprs

Change-Id: Icb06bdfcdd37c797be95ab5addb28da2d9f6681c
---
A example/scenarios/modem-ec20.conf
M src/osmo_gsm_tester/modem.py
M src/osmo_gsm_tester/process.py
M src/osmo_gsm_tester/suite.py
M suites/gprs/ping.py
A utils/osmo-gsm-tester_netns_exec.sh
6 files changed, 47 insertions(+), 6 deletions(-)



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

diff --git a/example/scenarios/modem-ec20.conf 
b/example/scenarios/modem-ec20.conf
new file mode 100644
index 000..c6dc8f9
--- /dev/null
+++ b/example/scenarios/modem-ec20.conf
@@ -0,0 +1,3 @@
+resources:
+  modem:
+  - label: ec20
diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py
index d0bbf23..f7acd8c 100644
--- a/src/osmo_gsm_tester/modem.py
+++ b/src/osmo_gsm_tester/modem.py
@@ -17,13 +17,14 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see .

-from . import log, util, sms
+from . import log, util, sms, process
 from .event_loop import MainLoop

 from pydbus import SystemBus, Variant
 import time
 import pprint
 import sys
+import os

 # Required for Gio.Cancellable.
 # See 
https://lazka.github.io/pgi-docs/Gio-2.0/classes/Cancellable.html#Gio.Cancellable
@@ -326,15 +327,17 @@
 CTX_PROT_IPv6 = 'ipv6'
 CTX_PROT_IPv46 = 'dual'

-def __init__(self, conf):
+def __init__(self, suite_run, conf):
+self.suite_run = suite_run
 self.conf = conf
 self.syspath = conf.get('path')
 self.dbuspath = get_dbuspath_from_syspath(self.syspath)
 super().__init__(log.C_TST, self.dbuspath)
-self.dbg('creating from syspath %s', self.syspath)
+self.dbg('creating from syspath %s' % self.syspath)
 self.msisdn = None
 self._ki = None
 self._imsi = None
+self.run_dir = 
util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name().strip('/')))
 self.sms_received_list = []
 self.dbus = ModemDbusInteraction(self.dbuspath)
 self.register_attempts = 0
@@ -361,6 +364,9 @@
 self.dbus.cleanup()
 self.dbus = None

+def netns(self):
+return os.path.basename(self.syspath.rstrip('/'))
+
 def properties(self, *args, **kwargs):
 '''Return a dict of properties on this modem. For the actual arguments,
 see ModemDbusInteraction.properties(), which this function calls.  The
@@ -630,6 +636,23 @@
 connmgr.RemoveContext(ctx_id)
 self.log('context deactivated', path=ctx_id)

+def run_netns_wait(self, name, popen_args):
+proc = process.NetNSProcess(name, self.run_dir.new_dir(name), 
self.netns(), popen_args,
+   env={})
+process.run_proc_sync(proc)
+
+def setup_context_data_plane(self, ctx_id):
+self.dbg('setup_context_data', path=ctx_id)
+ctx = systembus_get(ctx_id)
+ctx_settings = ctx.GetProperties().get('Settings', None)
+if not ctx_settings:
+raise log.Error('%s no Settings found! No way to get iface!' % 
ctx_id)
+iface = ctx_settings.get('Interface', None)
+if not iface:
+raise log.Error('%s Settings contains no iface! %r' % (ctx_id, 
repr(ctx_settings)))
+self.run_netns_wait('ifup', ('ip', 'link', 'set', 'dev', iface, 'up'))
+self.run_netns_wait('dhcp', ('udhcpc', '-q', '-i', iface))
+
 def sms_send(self, to_msisdn_or_modem, *tokens):
 if isinstance(to_msisdn_or_modem, Modem):
 to_msisdn = to_msisdn_or_modem.msisdn
diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py
index fb5c6f6..3764409 100644
--- a/src/osmo_gsm_tester/process.py
+++ b/src/osmo_gsm_tester/process.py
@@ -274,4 +274,12 @@
 scp(run_dir, remote_user, remote_addr, 'scp-cfg-to-remote', cfg_file_name, 
remote_config_file)
 return remote_inst

+class NetNSProcess(Process):
+NETNS_EXEC_BIN = 'osmo-gsm-tester_netns_exec.sh'
+def __init__(self, name, run_dir, netns, popen_args, **popen_kwargs):
+super().__init__(name, run_dir, popen_args, **popen_kwargs)
+self.netns = netns
+
+self.popen_args = ['sudo', self.NETNS_EXEC_BIN, self.netns] + 
list(popen_args)
+self.dbg(self.popen_args, dir=self.run_dir, conf=self.popen_kwargs)
 # vim: expandtab tabstop=4 shiftwidth=4
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index 3a49574..bf8156d 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -323,7 +323,7 @@
 def modem(self, specifics=None):
 conf = self.reserved_resources.get(resource.R_MODEM, 
specifics=specifics)
 self.dbg('create Modem object', conf=conf)
-ms = modem.Modem(conf)
+ms 

Change in osmo-gsm-tester[master]: utils: Introduce show_usb_device.py

2018-10-25 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/11460


Change subject: utils: Introduce show_usb_device.py
..

utils: Introduce show_usb_device.py

This is a small script written by Alexander Couzens that is useful to
list modems and its properties in a quick and easy way in
osmo-gsm-tester setup.

Change-Id: Iec049e2d56d61ecd50b65b64d95d69641fa0f8be
---
A utils/show_usb_device.py
1 file changed, 97 insertions(+), 0 deletions(-)



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

diff --git a/utils/show_usb_device.py b/utils/show_usb_device.py
new file mode 100755
index 000..9136234
--- /dev/null
+++ b/utils/show_usb_device.py
@@ -0,0 +1,97 @@
+#!/usr/bin/env python3
+# Alexander Couzens 
+# MIT
+
+# show usb device with their net and serial devices
+
+import os
+import usb.core
+import usb.util
+from pprint import pprint
+
+def get_path_ids(bus, port_numbers):
+port_numbers = [str(port) for port in port_numbers]
+ports = '.'.join(port_numbers)
+return '{}-{}'.format(bus, ports)
+
+def get_usb_dir(bus, port_numbers):
+return '/sys/bus/usb/devices/' + get_path_ids(bus, port_numbers) + '/'
+
+def get_usbmisc_from_usb(bus, port_numbers):
+usbmisc_ifaces = []
+path = get_usb_dir(bus, port_numbers)
+path_ids = get_path_ids(bus, port_numbers)
+
+usb_interfaces = [f for f in os.listdir(path) if f.startswith(path_ids)]
+for usb_iface in usb_interfaces:
+listdir = [f for f in os.listdir(path + usb_iface) if f == ('usbmisc')]
+if listdir:
+# found a net iface
+usbmisc_ifaces += os.listdir(path + usb_iface + '/usbmisc/')
+return usbmisc_ifaces
+
+def get_net_from_usb(bus, port_numbers):
+net_ifaces = []
+path = get_usb_dir(bus, port_numbers)
+path_ids = get_path_ids(bus, port_numbers)
+
+usb_interfaces = [f for f in os.listdir(path) if f.startswith(path_ids)]
+for usb_iface in usb_interfaces:
+listdir = [f for f in os.listdir(path + usb_iface) if f == ('net')]
+if listdir:
+# found a net iface
+net_ifaces += os.listdir(path + usb_iface + '/net/')
+return net_ifaces
+
+def get_serial_from_usb(bus, port_numbers):
+serial_ifaces = []
+path = get_usb_dir(bus, port_numbers)
+path_ids = get_path_ids(bus, port_numbers)
+
+usb_interfaces = [f for f in os.listdir(path) if f.startswith(path_ids)]
+for usb_iface in usb_interfaces:
+serial_ifaces += [f for f in os.listdir(path + usb_iface) if 
f.startswith('tty')]
+return serial_ifaces
+
+def get_product(bus, port_numbers):
+usb_dir = get_usb_dir(bus, port_numbers)
+try:
+product = open(os.path.join(usb_dir, 'product')).read().strip()
+except OSError as exp:
+product = "Unknown"
+return product
+
+def get_manuf(bus, port_numbers):
+usb_dir = get_usb_dir(bus, port_numbers)
+try:
+manuf = open(os.path.join(usb_dir, 'manufacturer')).read().strip()
+except OSError:
+manuf = "Unknown"
+return manuf
+
+def get_name(bus, port_numbers):
+manuf = get_manuf(bus, port_numbers)
+product = get_product(bus, port_numbers)
+return "%s %s" % (manuf, product)
+
+if __name__ == '__main__':
+USB_DEVS = [dev for dev in usb.core.find(find_all=True)]
+RESULT = {}
+for device in USB_DEVS:
+result = {}
+if not device.port_numbers:
+continue
+
+# retrieve manuf + product from /sys because non-root user can not ask 
the usb device
+result['name'] = get_name(device.bus, device.port_numbers)
+result['path'] = get_usb_dir(device.bus, device.port_numbers)
+result['net'] = get_net_from_usb(device.bus, device.port_numbers)
+result['cdc'] = get_usbmisc_from_usb(device.bus, device.port_numbers)
+result['serial'] = get_serial_from_usb(device.bus, device.port_numbers)
+
+# only show device which have serial or net devices
+if result['net'] or result['serial']:
+RESULT[device] = result
+
+pprint(RESULT)
+

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

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


Change in osmo-gsm-tester[master]: utils: Introduce modem-netns-setup.py

2018-10-25 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/11461


Change subject: utils: Introduce modem-netns-setup.py
..

utils: Introduce modem-netns-setup.py

Used to quickly set modem net interfaces into their own net namespace
(named after modem USB ID path).

The idea is that since osmo-gsm-tester ofono modem.py knowns the USB
path from a modem (path yml attr), it can infer the netns from it and
run a ping process inside it.

Related: OS#2308
Change-Id: Iadb2df2974e132044fba1f1bc2db8b559912e4e1
---
A utils/modem-netns-setup.py
1 file changed, 87 insertions(+), 0 deletions(-)



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

diff --git a/utils/modem-netns-setup.py b/utils/modem-netns-setup.py
new file mode 100755
index 000..e0645d1
--- /dev/null
+++ b/utils/modem-netns-setup.py
@@ -0,0 +1,87 @@
+#!/usr/bin/env python3
+# Pau Espin Pedrol 
+# MIT
+
+# manage netns for ofono modems
+
+import os
+import sys
+import subprocess
+import usb.core
+import usb.util
+from pprint import pprint
+
+def get_path_ids(bus, port_numbers):
+port_numbers = [str(port) for port in port_numbers]
+ports = '.'.join(port_numbers)
+return '{}-{}'.format(bus, ports)
+
+def get_usb_dir(bus, port_numbers):
+return '/sys/bus/usb/devices/' + get_path_ids(bus, port_numbers) + '/'
+
+def get_net_from_usb(bus, port_numbers):
+net_ifaces = []
+path = get_usb_dir(bus, port_numbers)
+path_ids = get_path_ids(bus, port_numbers)
+
+usb_interfaces = [f for f in os.listdir(path) if f.startswith(path_ids)]
+for usb_iface in usb_interfaces:
+listdir = [f for f in os.listdir(path + usb_iface) if f == ('net')]
+if listdir:
+# found a net iface
+net_ifaces += os.listdir(path + usb_iface + '/net/')
+return net_ifaces
+
+def move_modem_to_netns(usb_path_id, net_li):
+
+if len(net_li) == 0:
+print("%s: Device has no net ifaces, skipping" %(usb_path_id))
+return
+
+if not os.path.exists("/var/run/netns/%s" % usb_path_id):
+print("%s: Creating netns" % (usb_path_id))
+subprocess.check_call(["ip", "netns", "add", usb_path_id])
+else:
+print("%s: netns already exists" % (usb_path_id))
+
+for netif in net_li:
+print("%s: Moving iface %s to netns" % (usb_path_id, netif))
+subprocess.check_call(["ip", "link", "set", netif, "netns", 
usb_path_id])
+# iface Must be set up AFTER pdp ctx is activated, otherwise we 
get no DHCP response.
+#print("%s: Setting up iface %s" % (usb_path_id, netif))
+#subprocess.check_call(["ip", "netns", "exec", usb_path_id, "ip", 
"link", "set", "dev", netif, "up"])
+#subprocess.check_call(["ip", "netns", "exec", usb_path_id, 
"udhcpc", "-i", netif])
+
+def delete_modem_netns(usb_path_id):
+if os.path.exists("/var/run/netns/%s" % usb_path_id):
+print("%s: Deleting netns" % (usb_path_id))
+subprocess.check_call(["ip", "netns", "delete", usb_path_id])
+else:
+print("%s: netns doesn't exist" % (usb_path_id))
+
+def print_help():
+print("Usage: %s start|stop" % sys.argv[0])
+exit(1)
+
+
+if __name__ == '__main__':
+
+if len(sys.argv) != 2:
+print_help()
+
+USB_DEVS = [dev for dev in usb.core.find(find_all=True)]
+RESULT = {}
+for device in USB_DEVS:
+result = {}
+if not device.port_numbers:
+continue
+
+usb_path_id = get_path_ids(device.bus, device.port_numbers)
+net_li = get_net_from_usb(device.bus, device.port_numbers)
+
+if sys.argv[1] == "start":
+move_modem_to_netns(usb_path_id, net_li)
+elif sys.argv[1] == "stop":
+delete_modem_netns(usb_path_id)
+else:
+print_help()

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

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


Change in osmo-gsm-tester[master]: process: Make sure sync process is terminated if ogt is stopped

2018-10-25 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/11459


Change subject: process: Make sure sync process is terminated if ogt is stopped
..

process: Make sure sync process is terminated if ogt is stopped

Change-Id: Iecdac96ea576a312be2a6c6b6799e249074687ef
---
M src/osmo_gsm_tester/process.py
1 file changed, 13 insertions(+), 12 deletions(-)



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

diff --git a/src/osmo_gsm_tester/process.py b/src/osmo_gsm_tester/process.py
index 534cdba..fb5c6f6 100644
--- a/src/osmo_gsm_tester/process.py
+++ b/src/osmo_gsm_tester/process.py
@@ -236,25 +236,26 @@
  ' '.join(self.popen_args))]
 self.dbg(self.popen_args, dir=self.run_dir, conf=self.popen_kwargs)

+def run_proc_sync(proc):
+try:
+proc.launch()
+proc.wait()
+except Exception as e:
+proc.terminate()
+raise e
+if proc.result != 0:
+log.ctx(proc)
+raise log.Error('Exited in error')

 def run_local_sync(run_dir, name, popen_args):
 run_dir =run_dir.new_dir(name)
 proc = Process(name, run_dir, popen_args)
-proc.launch()
-proc.wait()
-if proc.result != 0:
-log.ctx(proc)
-raise log.Error('Exited in error')
+run_proc_sync(proc)

 def run_remote_sync(run_dir, remote_user, remote_addr, name, popen_args, 
remote_cwd=None):
 run_dir = run_dir.new_dir(name)
-proc = RemoteProcess(name, run_dir, remote_user, remote_addr, remote_cwd,
- popen_args)
-proc.launch()
-proc.wait()
-if proc.result != 0:
-log.ctx(proc)
-raise log.Error('Exited in error')
+proc = RemoteProcess(name, run_dir, remote_user, remote_addr, remote_cwd, 
popen_args)
+run_proc_sync(proc)

 def scp(run_dir, remote_user, remote_addr, name, local_path, remote_path):
 run_local_sync(run_dir, name, ('scp', '-r', local_path, '%s@%s:%s' % 
(remote_user, remote_addr, remote_path)))

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

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


Change in osmo-msc[master]: Update VLR test helper

2018-10-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11458 )

Change subject: Update VLR test helper
..


Set Ready For Review


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icf507d094319123c6667ba963db1d385df4d4f92
Gerrit-Change-Number: 11458
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 25 Oct 2018 16:19:27 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-msc[master]: Fix VLR test macro

2018-10-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/6296 )

Change subject: Fix VLR test macro
..


Set Ready For Review


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I36ae1f9bb395921dc2c5a39e35fbb8040ba47213
Gerrit-Change-Number: 6296
Gerrit-PatchSet: 7
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Thu, 25 Oct 2018 16:19:31 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bsc[master]: cosmetic: fix spec ref for gsm0808_cipher_mode()

2018-10-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11437 )

Change subject: cosmetic: fix spec ref for gsm0808_cipher_mode()
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I359caf1dd30f033c0b606040ccf27aa4c5a9d2c6
Gerrit-Change-Number: 11437
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Thu, 25 Oct 2018 15:35:27 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: add osmo_sock_get_{local, remote}_ip{, _port}()

2018-10-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11455 )

Change subject: add osmo_sock_get_{local,remote}_ip{,_port}()
..


Patch Set 1:

Not sure how can we make this function - maybe we can somehow use 
OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE to discourage public use of the function. 
Not sure how to make it work with #define wrappers though. Alternatively, we 
can just adjust the comment and make it regular public function.


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6803c204771c59a2002bc6a0e6b79c83c35f87e1
Gerrit-Change-Number: 11455
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: osmith 
Gerrit-CC: Max 
Gerrit-Comment-Date: Thu, 25 Oct 2018 15:32:59 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Build failed in Jenkins: master-asn1c » a1=default,a2=default,a3=default,osmocom-master-debian9 #287

2018-10-25 Thread jenkins
See 


--
[...truncated 3.67 KB...]

+ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking for autoconf... /usr/bin/autoconf
checking for autoheader... /usr/bin/autoheader
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking 

Change in osmocom-bb[master]: mobile: fix vty bind ip override

2018-10-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11457 )

Change subject: mobile: fix vty bind ip override
..


Set Ready For Review


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I32517567847fd5c54b1742f18bf409ff81e316fa
Gerrit-Change-Number: 11457
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Thu, 25 Oct 2018 15:05:24 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmocom-bb[master]: mobile: cleanup app init

2018-10-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11456 )

Change subject: mobile: cleanup app init
..


Set Ready For Review


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Idc38feb03656bd9a52aa29095ff7423e0e6ad53b
Gerrit-Change-Number: 11456
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Thu, 25 Oct 2018 15:05:14 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: add osmo_sock_get_{local, remote}_ip{, _port}()

2018-10-25 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/11455 )

Change subject: add osmo_sock_get_{local,remote}_ip{,_port}()
..


Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/#/c/11455/1/include/osmocom/core/socket.h
File include/osmocom/core/socket.h:

https://gerrit.osmocom.org/#/c/11455/1/include/osmocom/core/socket.h@59
PS1, Line 59: char *osmo_sock_get_name2(void *ctx, int fd, bool local, bool 
port);
> If that's meant for internal use (as per comment in . […]
I thought that was necessary to use it with the defines below. How do we not 
make it public, add an underscore in front of the function?


https://gerrit.osmocom.org/#/c/11455/1/src/socket.c
File src/socket.c:

https://gerrit.osmocom.org/#/c/11455/1/src/socket.c@714
PS1, Line 714:
> There seems to be some code duplication with osmo_sock_get_name() - any 
> chance to unify that?
Good question. I'll try it out tomorrow by adding hostbuf and portbuf arguments 
to osmo_sock_get_name2, and if they are not NULL, write the results into them. 
Then it's possible to use osmo_sock_get_name2() from the function below and 
make it a bit less redundant.



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6803c204771c59a2002bc6a0e6b79c83c35f87e1
Gerrit-Change-Number: 11455
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: osmith 
Gerrit-CC: Max 
Gerrit-Comment-Date: Thu, 25 Oct 2018 15:01:17 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: cosmetic: fix typo (soocket -> socket)

2018-10-25 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11454 )

Change subject: cosmetic: fix typo (soocket -> socket)
..

cosmetic: fix typo (soocket -> socket)

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

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



diff --git a/src/socket.c b/src/socket.c
index a85edb7..bb5505f 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -682,7 +682,7 @@
return osmo_fd_init_ofd(ofd, osmo_sock_unix_init(type, proto, 
socket_path, flags));
 }

-/*! Get address/port information on soocket in dyn-alloc string
+/*! Get address/port information on socket in dyn-alloc string
  *  \param[in] ctx talloc context from which to allocate string buffer
  *  \param[in] fd file descriptor of socket
  *  \returns string identifying the connection of this socket

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2184bf12398902d933f3744bc094418cc6961e86
Gerrit-Change-Number: 11454
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 


Change in libosmocore[master]: cosmetic: fix typo (soocket -> socket)

2018-10-25 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/11454 )

Change subject: cosmetic: fix typo (soocket -> socket)
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2184bf12398902d933f3744bc094418cc6961e86
Gerrit-Change-Number: 11454
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Thu, 25 Oct 2018 13:41:43 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: add osmo_sock_get_{local, remote}_ip{, _port}()

2018-10-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11455 )

Change subject: add osmo_sock_get_{local,remote}_ip{,_port}()
..


Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/#/c/11455/1/include/osmocom/core/socket.h
File include/osmocom/core/socket.h:

https://gerrit.osmocom.org/#/c/11455/1/include/osmocom/core/socket.h@59
PS1, Line 59: char *osmo_sock_get_name2(void *ctx, int fd, bool local, bool 
port);
If that's meant for internal use (as per comment in .c) than why do we add it 
to public API?


https://gerrit.osmocom.org/#/c/11455/1/src/socket.c
File src/socket.c:

https://gerrit.osmocom.org/#/c/11455/1/src/socket.c@714
PS1, Line 714:
There seems to be some code duplication with osmo_sock_get_name() - any chance 
to unify that?



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6803c204771c59a2002bc6a0e6b79c83c35f87e1
Gerrit-Change-Number: 11455
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Max 
Gerrit-Comment-Date: Thu, 25 Oct 2018 13:07:08 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: cosmetic: fix typo (soocket -> socket)

2018-10-25 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11454 )

Change subject: cosmetic: fix typo (soocket -> socket)
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2184bf12398902d933f3744bc094418cc6961e86
Gerrit-Change-Number: 11454
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Thu, 25 Oct 2018 13:02:40 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: cosmetic: fix typo (soocket -> socket)

2018-10-25 Thread osmith
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/11454


Change subject: cosmetic: fix typo (soocket -> socket)
..

cosmetic: fix typo (soocket -> socket)

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



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/54/11454/1

diff --git a/src/socket.c b/src/socket.c
index a85edb7..bb5505f 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -682,7 +682,7 @@
return osmo_fd_init_ofd(ofd, osmo_sock_unix_init(type, proto, 
socket_path, flags));
 }

-/*! Get address/port information on soocket in dyn-alloc string
+/*! Get address/port information on socket in dyn-alloc string
  *  \param[in] ctx talloc context from which to allocate string buffer
  *  \param[in] fd file descriptor of socket
  *  \returns string identifying the connection of this socket

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2184bf12398902d933f3744bc094418cc6961e86
Gerrit-Change-Number: 11454
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 


Change in libosmocore[master]: add osmo_sock_get_{local, remote}_ip{, _port}()

2018-10-25 Thread osmith
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/11455


Change subject: add osmo_sock_get_{local,remote}_ip{,_port}()
..

add osmo_sock_get_{local,remote}_ip{,_port}()

Return only the IP or port of either the local or remote connection,
not the whole set of IP and port of both the local and remote
connection like osmo_sock_get_name() does it. This is needed for
OS#2841, where we only want to print the remote IP.

Related: OS#2841
Change-Id: I6803c204771c59a2002bc6a0e6b79c83c35f87e1
---
M include/osmocom/core/socket.h
M src/socket.c
2 files changed, 35 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/55/11455/1

diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h
index f23a243..6f3de0f 100644
--- a/include/osmocom/core/socket.h
+++ b/include/osmocom/core/socket.h
@@ -56,6 +56,11 @@
const char *socket_path, unsigned int flags);

 char *osmo_sock_get_name(void *ctx, int fd);
+char *osmo_sock_get_name2(void *ctx, int fd, bool local, bool port);
+#define osmo_sock_get_local_ip(ctx, fd) osmo_sock_get_name2(ctx, fd, false, 
false)
+#define osmo_sock_get_local_ip_port(ctx, fd) osmo_sock_get_name2(ctx, fd, 
false, true)
+#define osmo_sock_get_remote_ip(ctx, fd) osmo_sock_get_name2(ctx, fd, true, 
false)
+#define osmo_sock_get_remote_ip_port(ctx, fd) osmo_sock_get_name2(ctx, fd, 
true, true)

 int osmo_sock_mcast_loop_set(int fd, bool enable);
 int osmo_sock_mcast_ttl_set(int fd, uint8_t ttl);
diff --git a/src/socket.c b/src/socket.c
index bb5505f..dedf2b6 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -682,6 +682,36 @@
return osmo_fd_init_ofd(ofd, osmo_sock_unix_init(type, proto, 
socket_path, flags));
 }

+/*! Get one IP or port number on socket in dyn-alloc string. This is
+ *  for internal usage. Convenience wrappers: osmo_sock_get_local_ip(),
+ *  osmo_sock_get_local_ip_port(), osmo_sock_get_remote_ip() and
+ *  osmo_sock_get_remote_ip_port().
+ *  \param[in] ctx talloc context from which to allocate string buffer
+ *  \param[in] fd file descriptor of socket
+ *  \param[in] local (true) or remote (false) name will get looked at
+ *  \param[in] port (true) or ip address (false) will be returned
+ *  \returns string with IP or port
+ */
+char *osmo_sock_get_name2(void *ctx, int fd, bool local, bool port)
+{
+   struct sockaddr sa;
+   socklen_t len = sizeof(sa);
+   char hostbuf[64], portbuf[16];
+   int rc;
+
+   rc = local ? getsockname(fd, , ) : getpeername(fd, , );
+   if (rc < 0)
+   return NULL;
+
+   rc = getnameinfo(, len, hostbuf, sizeof(hostbuf),
+portbuf, sizeof(portbuf),
+NI_NUMERICHOST | NI_NUMERICSERV);
+   if (rc < 0)
+   return NULL;
+
+   return talloc_strdup(ctx, port ? portbuf : hostbuf);
+}
+
 /*! Get address/port information on socket in dyn-alloc string
  *  \param[in] ctx talloc context from which to allocate string buffer
  *  \param[in] fd file descriptor of socket

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6803c204771c59a2002bc6a0e6b79c83c35f87e1
Gerrit-Change-Number: 11455
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 


Change in osmo-bts[master]: common/scheduler.c: track TDMA frame loss per logical channels

2018-10-25 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/10309 )

Change subject: common/scheduler.c: track TDMA frame loss per logical channels
..


Patch Set 4: Code-Review+2


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I70d05b67a35ddcbdd1b6394dbd7198404a440e76
Gerrit-Change-Number: 10309
Gerrit-PatchSet: 4
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Thu, 25 Oct 2018 09:41:58 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in simtrace2[master]: cardem: add more debug information for TPDU state

2018-10-25 Thread Kévin Redon
Kévin Redon has posted comments on this change. ( 
https://gerrit.osmocom.org/11361 )

Change subject: cardem: add more debug information for TPDU state
..


Patch Set 2:

fixed both valid comments, and updated a related debugging output


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id5104a2c3579dedb092c179748e9ed525673841c
Gerrit-Change-Number: 11361
Gerrit-PatchSet: 2
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Kévin Redon 
Gerrit-Comment-Date: Thu, 25 Oct 2018 09:10:00 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in simtrace2[master]: cardem: add more debug information for TPDU state

2018-10-25 Thread Kévin Redon
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/11361

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

Change subject: cardem: add more debug information for TPDU state
..

cardem: add more debug information for TPDU state

this just adds the name of the TPDU state on top of the state number.

the ISO state is cleaned up accordingly

Change-Id: Id5104a2c3579dedb092c179748e9ed525673841c
---
M firmware/libcommon/source/card_emu.c
1 file changed, 79 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/61/11361/2
--
To view, visit https://gerrit.osmocom.org/11361
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id5104a2c3579dedb092c179748e9ed525673841c
Gerrit-Change-Number: 11361
Gerrit-PatchSet: 2
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-bsc[master]: cosmetic: fix spec ref for gsm0808_cipher_mode()

2018-10-25 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/11437 )

Change subject: cosmetic: fix spec ref for gsm0808_cipher_mode()
..


Patch Set 2:

>  You have to find the related section in 08.08 (or these days, 48.008).

Done, it's 08.08 § 3.1.14.


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I359caf1dd30f033c0b606040ccf27aa4c5a9d2c6
Gerrit-Change-Number: 11437
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Thu, 25 Oct 2018 08:18:08 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bsc[master]: cosmetic: fix spec ref for gsm0808_cipher_mode()

2018-10-25 Thread osmith
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/11437

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

Change subject: cosmetic: fix spec ref for gsm0808_cipher_mode()
..

cosmetic: fix spec ref for gsm0808_cipher_mode()

Change-Id: I359caf1dd30f033c0b606040ccf27aa4c5a9d2c6
---
M src/osmo-bsc/osmo_bsc_bssap.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/37/11437/2
--
To view, visit https://gerrit.osmocom.org/11437
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I359caf1dd30f033c0b606040ccf27aa4c5a9d2c6
Gerrit-Change-Number: 11437
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: osmith